Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wyykak
ygopro
Commits
2f0b8df3
Commit
2f0b8df3
authored
Jun 11, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/Fluorohydride/ygopro
into server
parents
efe43032
1dc1e961
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
772 additions
and
247 deletions
+772
-247
cards.cdb
cards.cdb
+0
-0
gframe/client_card.cpp
gframe/client_card.cpp
+62
-11
gframe/client_card.h
gframe/client_card.h
+7
-4
gframe/client_field.cpp
gframe/client_field.cpp
+3
-3
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/data_manager.cpp
gframe/data_manager.cpp
+1
-1
gframe/deck_con.cpp
gframe/deck_con.cpp
+221
-105
gframe/deck_con.h
gframe/deck_con.h
+6
-1
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+13
-0
gframe/deck_manager.h
gframe/deck_manager.h
+1
-0
gframe/drawing.cpp
gframe/drawing.cpp
+8
-7
gframe/duelclient.cpp
gframe/duelclient.cpp
+32
-8
gframe/event_handler.cpp
gframe/event_handler.cpp
+77
-9
gframe/game.cpp
gframe/game.cpp
+84
-41
gframe/game.h
gframe/game.h
+32
-12
gframe/materials.cpp
gframe/materials.cpp
+8
-8
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+8
-2
gframe/replay.cpp
gframe/replay.cpp
+3
-0
gframe/replay.h
gframe/replay.h
+1
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+147
-19
gframe/replay_mode.h
gframe/replay_mode.h
+5
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+12
-4
gframe/single_mode.cpp
gframe/single_mode.cpp
+0
-1
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+12
-4
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+24
-4
system.conf
system.conf
+2
-1
No files found.
cards.cdb
View file @
2f0b8df3
No preview for this file type
gframe/client_card.cpp
View file @
2f0b8df3
#include "client_card.h"
#include "client_field.h"
#include "data_manager.h"
#include "game.h"
namespace
ygo
{
...
...
@@ -30,9 +31,9 @@ ClientCard::ClientCard() {
race
=
0
;
attribute
=
0
;
attack
=
0
;
defen
c
e
=
0
;
defen
s
e
=
0
;
base_attack
=
0
;
base_defen
c
e
=
0
;
base_defen
s
e
=
0
;
lscale
=
0
;
rscale
=
0
;
cHint
=
0
;
...
...
@@ -99,18 +100,18 @@ void ClientCard::UpdateInfo(char* buf) {
}
else
myswprintf
(
atkstring
,
L"%d"
,
attack
);
}
if
(
flag
&
QUERY_DEFEN
C
E
)
{
defen
c
e
=
BufferIO
::
ReadInt32
(
buf
);
if
(
defen
c
e
<
0
)
{
if
(
flag
&
QUERY_DEFEN
S
E
)
{
defen
s
e
=
BufferIO
::
ReadInt32
(
buf
);
if
(
defen
s
e
<
0
)
{
defstring
[
0
]
=
'?'
;
defstring
[
1
]
=
0
;
}
else
myswprintf
(
defstring
,
L"%d"
,
defen
c
e
);
myswprintf
(
defstring
,
L"%d"
,
defen
s
e
);
}
if
(
flag
&
QUERY_BASE_ATTACK
)
base_attack
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_BASE_DEFEN
C
E
)
base_defen
c
e
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_BASE_DEFEN
S
E
)
base_defen
s
e
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_REASON
)
reason
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_EQUIP_CARD
)
{
...
...
@@ -213,12 +214,62 @@ bool ClientCard::deck_sort_lv(code_pointer p1, code_pointer p2) {
return
p1
->
second
.
level
>
p2
->
second
.
level
;
if
(
p1
->
second
.
attack
!=
p2
->
second
.
attack
)
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
defen
ce
!=
p2
->
second
.
defenc
e
)
return
p1
->
second
.
defen
ce
>
p2
->
second
.
defenc
e
;
else
return
p1
->
first
<
p2
->
first
;
if
(
p1
->
second
.
defen
se
!=
p2
->
second
.
defens
e
)
return
p1
->
second
.
defen
se
>
p2
->
second
.
defens
e
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_atk
(
code_pointer
p1
,
code_pointer
p2
)
{
if
((
p1
->
second
.
type
&
0x7
)
!=
(
p2
->
second
.
type
&
0x7
))
return
(
p1
->
second
.
type
&
0x7
)
<
(
p2
->
second
.
type
&
0x7
);
if
((
p1
->
second
.
type
&
0x7
)
==
1
)
{
if
(
p1
->
second
.
attack
!=
p2
->
second
.
attack
)
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
defense
!=
p2
->
second
.
defense
)
return
p1
->
second
.
defense
>
p2
->
second
.
defense
;
if
(
p1
->
second
.
level
!=
p2
->
second
.
level
)
return
p1
->
second
.
level
>
p2
->
second
.
level
;
int
type1
=
(
p1
->
second
.
type
&
0x8020c0
)
?
(
p1
->
second
.
type
&
0x8020c1
)
:
(
p1
->
second
.
type
&
0x31
);
int
type2
=
(
p2
->
second
.
type
&
0x8020c0
)
?
(
p2
->
second
.
type
&
0x8020c1
)
:
(
p2
->
second
.
type
&
0x31
);
if
(
type1
!=
type2
)
return
type1
<
type2
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_def
(
code_pointer
p1
,
code_pointer
p2
)
{
if
((
p1
->
second
.
type
&
0x7
)
!=
(
p2
->
second
.
type
&
0x7
))
return
(
p1
->
second
.
type
&
0x7
)
<
(
p2
->
second
.
type
&
0x7
);
if
((
p1
->
second
.
type
&
0x7
)
==
1
)
{
if
(
p1
->
second
.
defense
!=
p2
->
second
.
defense
)
return
p1
->
second
.
defense
>
p2
->
second
.
defense
;
if
(
p1
->
second
.
attack
!=
p2
->
second
.
attack
)
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
level
!=
p2
->
second
.
level
)
return
p1
->
second
.
level
>
p2
->
second
.
level
;
int
type1
=
(
p1
->
second
.
type
&
0x8020c0
)
?
(
p1
->
second
.
type
&
0x8020c1
)
:
(
p1
->
second
.
type
&
0x31
);
int
type2
=
(
p2
->
second
.
type
&
0x8020c0
)
?
(
p2
->
second
.
type
&
0x8020c1
)
:
(
p2
->
second
.
type
&
0x31
);
if
(
type1
!=
type2
)
return
type1
<
type2
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_name
(
code_pointer
p1
,
code_pointer
p2
)
{
CardString
cstr1
;
CardString
cstr2
;
dataManager
.
GetString
(
p1
->
second
.
code
,
&
cstr1
);
dataManager
.
GetString
(
p2
->
second
.
code
,
&
cstr2
);
int
res
=
wcscmp
(
cstr1
.
name
,
cstr2
.
name
);
if
(
res
!=
0
)
return
res
<
0
;
return
p1
->
first
<
p2
->
first
;
}
}
gframe/client_card.h
View file @
2f0b8df3
...
...
@@ -17,7 +17,7 @@ struct CardData {
unsigned
int
attribute
;
unsigned
int
race
;
int
attack
;
int
defen
c
e
;
int
defen
s
e
;
unsigned
int
lscale
;
unsigned
int
rscale
;
};
...
...
@@ -30,7 +30,7 @@ struct CardDataC {
unsigned
int
attribute
;
unsigned
int
race
;
int
attack
;
int
defen
c
e
;
int
defen
s
e
;
unsigned
int
lscale
;
unsigned
int
rscale
;
unsigned
int
ot
;
...
...
@@ -74,9 +74,9 @@ public:
u32 attribute;
u32 race;
s32 attack;
s32 defen
c
e;
s32 defen
s
e;
s32 base_attack;
s32 base_defen
c
e;
s32 base_defen
s
e;
u32 lscale;
u32 rscale;
u32 reason;
...
...
@@ -113,6 +113,9 @@ public:
void ClearTarget();
static bool client_card_sort(ClientCard* c1, ClientCard* c2);
static bool deck_sort_lv(code_pointer l1, code_pointer l2);
static bool deck_sort_atk(code_pointer l1, code_pointer l2);
static bool deck_sort_def(code_pointer l1, code_pointer l2);
static bool deck_sort_name(code_pointer l1, code_pointer l2);
*/
};
...
...
gframe/client_field.cpp
View file @
2f0b8df3
...
...
@@ -91,7 +91,7 @@ void ClientField::Initial(int player, int deckc, int extrac) {
pcard
->
controler
=
player
;
pcard
->
location
=
0x40
;
pcard
->
sequence
=
i
;
pcard
->
position
=
POS_FACEDOWN_DEFEN
C
E
;
pcard
->
position
=
POS_FACEDOWN_DEFEN
S
E
;
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
...
...
@@ -878,7 +878,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
X
=
(
matManager
.
vFields
[
16
].
Pos
.
X
+
matManager
.
vFields
[
17
].
Pos
.
X
)
/
2
+
1.1
f
*
sequence
;
t
->
Y
=
(
matManager
.
vFields
[
16
].
Pos
.
Y
+
matManager
.
vFields
[
18
].
Pos
.
Y
)
/
2
;
t
->
Z
=
0.01
f
;
if
(
pcard
->
position
&
POS_DEFEN
C
E
)
{
if
(
pcard
->
position
&
POS_DEFEN
S
E
)
{
r
->
X
=
0.0
f
;
r
->
Z
=
-
3.1415926
f
/
2.0
f
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
...
...
@@ -895,7 +895,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
X
=
(
matManager
.
vFields
[
84
].
Pos
.
X
+
matManager
.
vFields
[
85
].
Pos
.
X
)
/
2
-
1.1
f
*
sequence
;
t
->
Y
=
(
matManager
.
vFields
[
84
].
Pos
.
Y
+
matManager
.
vFields
[
86
].
Pos
.
Y
)
/
2
;
t
->
Z
=
0.01
f
;
if
(
pcard
->
position
&
POS_DEFEN
C
E
)
{
if
(
pcard
->
position
&
POS_DEFEN
S
E
)
{
r
->
X
=
0.0
f
;
r
->
Z
=
3.1415926
f
/
2.0
f
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
...
...
gframe/client_field.h
View file @
2f0b8df3
...
...
@@ -124,6 +124,7 @@ public:
virtual bool OnEvent(const irr::SEvent& event);
void GetHoverField(int x, int y);
void ShowMenu(int flag, int x, int y);
void UpdateChainButtons();
void SetResponseSelectedCards() const;
};
...
...
gframe/data_manager.cpp
View file @
2f0b8df3
...
...
@@ -30,7 +30,7 @@ bool DataManager::LoadDB(const char* file) {
cd
.
setcode
=
sqlite3_column_int64
(
pStmt
,
3
);
cd
.
type
=
sqlite3_column_int
(
pStmt
,
4
);
cd
.
attack
=
sqlite3_column_int
(
pStmt
,
5
);
cd
.
defen
c
e
=
sqlite3_column_int
(
pStmt
,
6
);
cd
.
defen
s
e
=
sqlite3_column_int
(
pStmt
,
6
);
unsigned
int
level
=
sqlite3_column_int
(
pStmt
,
7
);
cd
.
level
=
level
&
0xff
;
cd
.
lscale
=
(
level
>>
24
)
&
0xff
;
...
...
gframe/deck_con.cpp
View file @
2f0b8df3
...
...
@@ -9,10 +9,44 @@
namespace
ygo
{
static
int
parse_filter
(
const
wchar_t
*
pstr
,
unsigned
int
*
type
)
{
if
(
*
pstr
==
L'='
)
{
*
type
=
1
;
return
BufferIO
::
GetVal
(
pstr
+
1
);
}
else
if
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
*
type
=
1
;
return
BufferIO
::
GetVal
(
pstr
);
}
else
if
(
*
pstr
==
L'>'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
*
type
=
2
;
return
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
*
type
=
3
;
return
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'<'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
*
type
=
4
;
return
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
*
type
=
5
;
return
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'?'
)
{
*
type
=
6
;
return
0
;
}
*
type
=
0
;
return
0
;
}
bool
DeckBuilder
::
OnEvent
(
const
irr
::
SEvent
&
event
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
if
(
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
break
;
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
break
;
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
...
...
@@ -62,13 +96,24 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
BUTTON_DBEXIT
:
{
case
BUTTON_DELETE_DECK
:
{
if
(
mainGame
->
cbDBDecks
->
getSelected
()
==
-
1
)
break
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetSysString
(
1337
));
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
break
;
}
case
BUTTON_LEAVE_GAME
:
{
mainGame
->
is_building
=
false
;
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wCategories
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
wCardImg
->
setVisible
(
false
);
mainGame
->
wInfos
->
setVisible
(
false
);
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
PopupElement
(
mainGame
->
wMainMenu
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
wACMessage
->
setVisible
(
false
);
...
...
@@ -89,98 +134,21 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
filter_type
=
mainGame
->
cbCardType
->
getSelected
();
filter_type2
=
mainGame
->
cbCardType2
->
getItemData
(
mainGame
->
cbCardType2
->
getSelected
());
filter_lm
=
mainGame
->
cbLimit
->
getSelected
();
if
(
filter_type
>
1
)
{
FilterCards
();
break
;
}
filter_attrib
=
mainGame
->
cbAttribute
->
getItemData
(
mainGame
->
cbAttribute
->
getSelected
());
filter_race
=
mainGame
->
cbRace
->
getItemData
(
mainGame
->
cbRace
->
getSelected
());
const
wchar_t
*
pstr
=
mainGame
->
ebAttack
->
getText
();
if
(
*
pstr
==
0
)
filter_atktype
=
0
;
else
{
if
(
*
pstr
==
L'='
)
{
filter_atktype
=
1
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
else
if
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
filter_atktype
=
1
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
);
}
else
if
(
*
pstr
==
L'>'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_atktype
=
2
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_atktype
=
3
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'<'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_atktype
=
4
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_atktype
=
5
;
filter_atk
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'?'
)
{
filter_atktype
=
6
;
}
else
filter_atktype
=
0
;
}
pstr
=
mainGame
->
ebDefence
->
getText
();
if
(
*
pstr
==
0
)
filter_deftype
=
0
;
else
{
if
(
*
pstr
==
L'='
)
{
filter_deftype
=
1
;
filter_def
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
else
if
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
filter_deftype
=
1
;
filter_def
=
BufferIO
::
GetVal
(
pstr
);
}
else
if
(
*
pstr
==
L'>'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_deftype
=
2
;
filter_def
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_deftype
=
3
;
filter_def
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'<'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_deftype
=
4
;
filter_def
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_deftype
=
5
;
filter_def
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'?'
)
{
filter_deftype
=
6
;
}
else
filter_deftype
=
0
;
}
pstr
=
mainGame
->
ebStar
->
getText
();
if
(
*
pstr
==
0
)
filter_lvtype
=
0
;
else
{
if
(
*
pstr
==
L'='
)
{
filter_lvtype
=
1
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
else
if
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
filter_lvtype
=
1
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
);
}
else
if
(
*
pstr
==
L'>'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_lvtype
=
2
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_lvtype
=
3
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
if
(
*
pstr
==
L'<'
)
{
if
(
*
(
pstr
+
1
)
==
L'='
)
{
filter_lvtype
=
4
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
+
2
);
}
else
{
filter_lvtype
=
5
;
filter_lv
=
BufferIO
::
GetVal
(
pstr
+
1
);
}
}
else
filter_lvtype
=
0
;
if
(
filter_type
==
1
)
{
filter_attrib
=
mainGame
->
cbAttribute
->
getItemData
(
mainGame
->
cbAttribute
->
getSelected
());
filter_race
=
mainGame
->
cbRace
->
getItemData
(
mainGame
->
cbRace
->
getSelected
());
filter_atk
=
parse_filter
(
mainGame
->
ebAttack
->
getText
(),
&
filter_atktype
);
filter_def
=
parse_filter
(
mainGame
->
ebDefense
->
getText
(),
&
filter_deftype
);
filter_lv
=
parse_filter
(
mainGame
->
ebStar
->
getText
(),
&
filter_lvtype
);
filter_scl
=
parse_filter
(
mainGame
->
ebScale
->
getText
(),
&
filter_scltype
);
}
FilterCards
();
if
(
!
mainGame
->
gameConf
.
separate_clear_button
)
ClearFilter
();
break
;
}
case
BUTTON_CLEAR_FILTER
:
{
ClearSearch
();
break
;
}
case
BUTTON_CATEGORY_OK
:
{
...
...
@@ -211,6 +179,26 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
DuelClient
::
SendBufferToServer
(
CTOS_UPDATE_DECK
,
deckbuf
,
pdeck
-
deckbuf
);
break
;
}
case
BUTTON_YES
:
{
mainGame
->
HideElement
(
mainGame
->
wQuery
);
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
deckManager
.
DeleteDeck
(
deckManager
.
current_deck
,
mainGame
->
cbDBDecks
->
getItem
(
sel
)))
{
mainGame
->
cbDBDecks
->
removeItem
(
sel
);
int
count
=
mainGame
->
cbDBDecks
->
getItemCount
();
if
(
sel
>=
count
)
sel
=
count
-
1
;
mainGame
->
cbDBDecks
->
setSelected
(
sel
);
if
(
sel
!=
-
1
)
deckManager
.
LoadDeck
(
mainGame
->
cbDBDecks
->
getItem
(
sel
));
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1338
));
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
}
break
;
}
case
BUTTON_NO
:
{
mainGame
->
HideElement
(
mainGame
->
wQuery
);
break
;
}
}
break
;
}
...
...
@@ -249,24 +237,36 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
case
COMBOBOX_MAINTYPE
:
{
mainGame
->
cbCardType2
->
setSelected
(
0
);
mainGame
->
cbAttribute
->
setSelected
(
0
);
mainGame
->
cbRace
->
setSelected
(
0
);
mainGame
->
ebAttack
->
setText
(
L""
);
mainGame
->
ebDefense
->
setText
(
L""
);
mainGame
->
ebStar
->
setText
(
L""
);
mainGame
->
ebScale
->
setText
(
L""
);
switch
(
mainGame
->
cbCardType
->
getSelected
())
{
case
0
:
{
mainGame
->
cbCardType2
->
setEnabled
(
false
);
mainGame
->
cbCardType2
->
setSelected
(
0
);
mainGame
->
cbRace
->
setEnabled
(
false
);
mainGame
->
cbAttribute
->
setEnabled
(
false
);
mainGame
->
ebAttack
->
setEnabled
(
false
);
mainGame
->
ebDefen
c
e
->
setEnabled
(
false
);
mainGame
->
ebDefen
s
e
->
setEnabled
(
false
);
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
break
;
}
case
1
:
{
wchar_t
normaltuner
[
32
];
wchar_t
normalpen
[
32
];
wchar_t
syntuner
[
32
];
mainGame
->
cbCardType2
->
setEnabled
(
true
);
mainGame
->
cbRace
->
setEnabled
(
true
);
mainGame
->
cbAttribute
->
setEnabled
(
true
);
mainGame
->
ebAttack
->
setEnabled
(
true
);
mainGame
->
ebDefen
c
e
->
setEnabled
(
true
);
mainGame
->
ebDefen
s
e
->
setEnabled
(
true
);
mainGame
->
ebStar
->
setEnabled
(
true
);
mainGame
->
ebScale
->
setEnabled
(
true
);
mainGame
->
cbCardType2
->
clear
();
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1080
),
0
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1054
),
TYPE_MONSTER
+
TYPE_NORMAL
);
...
...
@@ -274,10 +274,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1056
),
TYPE_MONSTER
+
TYPE_FUSION
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1057
),
TYPE_MONSTER
+
TYPE_RITUAL
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1063
),
TYPE_MONSTER
+
TYPE_SYNCHRO
);
myswprintf
(
syntuner
,
L"%ls|%ls"
,
dataManager
.
GetSysString
(
1063
),
dataManager
.
GetSysString
(
1062
));
mainGame
->
cbCardType2
->
addItem
(
syntuner
,
TYPE_MONSTER
+
TYPE_SYNCHRO
+
TYPE_TUNER
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1073
),
TYPE_MONSTER
+
TYPE_XYZ
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1074
),
TYPE_MONSTER
+
TYPE_PENDULUM
);
myswprintf
(
normaltuner
,
L"%ls|%ls"
,
dataManager
.
GetSysString
(
1054
),
dataManager
.
GetSysString
(
1062
));
mainGame
->
cbCardType2
->
addItem
(
normaltuner
,
TYPE_MONSTER
+
TYPE_NORMAL
+
TYPE_TUNER
);
myswprintf
(
normalpen
,
L"%ls|%ls"
,
dataManager
.
GetSysString
(
1054
),
dataManager
.
GetSysString
(
1074
));
mainGame
->
cbCardType2
->
addItem
(
normalpen
,
TYPE_MONSTER
+
TYPE_NORMAL
+
TYPE_PENDULUM
);
myswprintf
(
syntuner
,
L"%ls|%ls"
,
dataManager
.
GetSysString
(
1063
),
dataManager
.
GetSysString
(
1062
));
mainGame
->
cbCardType2
->
addItem
(
syntuner
,
TYPE_MONSTER
+
TYPE_SYNCHRO
+
TYPE_TUNER
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1062
),
TYPE_MONSTER
+
TYPE_TUNER
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1061
),
TYPE_MONSTER
+
TYPE_DUAL
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1060
),
TYPE_MONSTER
+
TYPE_UNION
);
...
...
@@ -291,8 +295,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbRace
->
setEnabled
(
false
);
mainGame
->
cbAttribute
->
setEnabled
(
false
);
mainGame
->
ebAttack
->
setEnabled
(
false
);
mainGame
->
ebDefen
c
e
->
setEnabled
(
false
);
mainGame
->
ebDefen
s
e
->
setEnabled
(
false
);
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
mainGame
->
cbCardType2
->
clear
();
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1080
),
0
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1054
),
TYPE_SPELL
);
...
...
@@ -308,8 +313,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbRace
->
setEnabled
(
false
);
mainGame
->
cbAttribute
->
setEnabled
(
false
);
mainGame
->
ebAttack
->
setEnabled
(
false
);
mainGame
->
ebDefen
c
e
->
setEnabled
(
false
);
mainGame
->
ebDefen
s
e
->
setEnabled
(
false
);
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
mainGame
->
cbCardType2
->
clear
();
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1080
),
0
);
mainGame
->
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1054
),
TYPE_TRAP
);
...
...
@@ -318,6 +324,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
}
break
;
}
case
COMBOBOX_SORTTYPE
:
{
SortList
();
mainGame
->
env
->
setFocus
(
0
);
break
;
}
}
}
...
...
@@ -328,7 +340,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_MOUSE_INPUT_EVENT
:
{
switch
(
event
.
MouseInput
.
Event
)
{
case
irr
:
:
EMIE_LMOUSE_PRESSED_DOWN
:
{
if
(
mainGame
->
wCategories
->
isVisible
())
position2d
<
s32
>
mouse_pos
=
position2d
<
s32
>
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
if
(
root
->
getElementFromPoint
(
mouse_pos
)
!=
root
)
break
;
if
(
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wQuery
->
isVisible
())
break
;
if
(
hovered_pos
==
0
||
hovered_seq
==
-
1
)
break
;
...
...
@@ -464,7 +480,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break
;
}
if
(
mainGame
->
wCategories
->
isVisible
())
if
(
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wQuery
->
isVisible
()
)
break
;
if
(
hovered_pos
==
0
||
hovered_seq
==
-
1
)
break
;
...
...
@@ -528,11 +544,73 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
deckManager
.
current_deck
.
extra
.
push_back
(
draging_pointer
);
}
else
if
(
!
(
draging_pointer
->
second
.
type
&
0x802040
)
&&
deckManager
.
current_deck
.
main
.
size
()
<
60
)
{
deckManager
.
current_deck
.
main
.
push_back
(
draging_pointer
);
}
else
if
(
deckManager
.
current_deck
.
side
.
size
()
<
15
)
{
deckManager
.
current_deck
.
side
.
push_back
(
draging_pointer
);
}
}
}
break
;
}
case
irr
:
:
EMIE_MMOUSE_LEFT_UP
:
{
if
(
mainGame
->
is_siding
)
break
;
if
(
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wQuery
->
isVisible
())
break
;
if
(
hovered_pos
==
0
||
hovered_seq
==
-
1
)
break
;
if
(
is_draging
)
break
;
draging_pointer
=
dataManager
.
GetCodePointer
(
hovered_code
);
unsigned
int
limitcode
=
draging_pointer
->
second
.
alias
?
draging_pointer
->
second
.
alias
:
draging_pointer
->
first
;
int
limit
=
3
;
if
(
filterList
->
count
(
limitcode
))
limit
=
(
*
filterList
)[
limitcode
];
for
(
size_t
i
=
0
;
i
<
deckManager
.
current_deck
.
main
.
size
();
++
i
)
if
(
deckManager
.
current_deck
.
main
[
i
]
->
first
==
limitcode
||
deckManager
.
current_deck
.
main
[
i
]
->
second
.
alias
==
limitcode
)
limit
--
;
for
(
size_t
i
=
0
;
i
<
deckManager
.
current_deck
.
extra
.
size
();
++
i
)
if
(
deckManager
.
current_deck
.
extra
[
i
]
->
first
==
limitcode
||
deckManager
.
current_deck
.
extra
[
i
]
->
second
.
alias
==
limitcode
)
limit
--
;
for
(
size_t
i
=
0
;
i
<
deckManager
.
current_deck
.
side
.
size
();
++
i
)
if
(
deckManager
.
current_deck
.
side
[
i
]
->
first
==
limitcode
||
deckManager
.
current_deck
.
side
[
i
]
->
second
.
alias
==
limitcode
)
limit
--
;
if
(
limit
<=
0
)
break
;
if
(
hovered_pos
==
1
)
{
if
(
deckManager
.
current_deck
.
main
.
size
()
<
60
)
deckManager
.
current_deck
.
main
.
push_back
(
draging_pointer
);
else
if
(
deckManager
.
current_deck
.
side
.
size
()
<
15
)
deckManager
.
current_deck
.
side
.
push_back
(
draging_pointer
);
}
else
if
(
hovered_pos
==
2
)
{
if
(
deckManager
.
current_deck
.
extra
.
size
()
<
15
)
deckManager
.
current_deck
.
extra
.
push_back
(
draging_pointer
);
else
if
(
deckManager
.
current_deck
.
side
.
size
()
<
15
)
deckManager
.
current_deck
.
side
.
push_back
(
draging_pointer
);
}
else
if
(
hovered_pos
==
3
)
{
if
(
deckManager
.
current_deck
.
side
.
size
()
<
15
)
deckManager
.
current_deck
.
side
.
push_back
(
draging_pointer
);
else
{
if
((
draging_pointer
->
second
.
type
&
0x802040
)
&&
deckManager
.
current_deck
.
extra
.
size
()
<
15
)
deckManager
.
current_deck
.
extra
.
push_back
(
draging_pointer
);
else
if
(
!
(
draging_pointer
->
second
.
type
&
0x802040
)
&&
deckManager
.
current_deck
.
main
.
size
()
<
60
)
deckManager
.
current_deck
.
main
.
push_back
(
draging_pointer
);
}
}
else
{
if
((
draging_pointer
->
second
.
type
&
0x802040
)
&&
deckManager
.
current_deck
.
extra
.
size
()
<
15
)
deckManager
.
current_deck
.
extra
.
push_back
(
draging_pointer
);
else
if
(
!
(
draging_pointer
->
second
.
type
&
0x802040
)
&&
deckManager
.
current_deck
.
main
.
size
()
<
60
)
deckManager
.
current_deck
.
main
.
push_back
(
draging_pointer
);
else
if
(
deckManager
.
current_deck
.
side
.
size
()
<
15
)
deckManager
.
current_deck
.
side
.
push_back
(
draging_pointer
);
}
break
;
}
case
irr
:
:
EMIE_MOUSE_MOVED
:
{
int
x
=
event
.
MouseInput
.
X
;
int
y
=
event
.
MouseInput
.
Y
;
...
...
@@ -683,15 +761,21 @@ void DeckBuilder::FilterCards() {
continue
;
}
if
(
filter_deftype
)
{
if
((
filter_deftype
==
1
&&
data
.
defen
ce
!=
filter_def
)
||
(
filter_deftype
==
2
&&
data
.
defenc
e
<
filter_def
)
||
(
filter_deftype
==
3
&&
data
.
defen
ce
<=
filter_def
)
||
(
filter_deftype
==
4
&&
(
data
.
defence
>
filter_def
||
data
.
defenc
e
<
0
))
||
(
filter_deftype
==
5
&&
(
data
.
defen
ce
>=
filter_def
||
data
.
defence
<
0
))
||
(
filter_deftype
==
6
&&
data
.
defenc
e
!=
-
2
))
if
((
filter_deftype
==
1
&&
data
.
defen
se
!=
filter_def
)
||
(
filter_deftype
==
2
&&
data
.
defens
e
<
filter_def
)
||
(
filter_deftype
==
3
&&
data
.
defen
se
<=
filter_def
)
||
(
filter_deftype
==
4
&&
(
data
.
defense
>
filter_def
||
data
.
defens
e
<
0
))
||
(
filter_deftype
==
5
&&
(
data
.
defen
se
>=
filter_def
||
data
.
defense
<
0
))
||
(
filter_deftype
==
6
&&
data
.
defens
e
!=
-
2
))
continue
;
}
if
(
filter_lvtype
)
{
if
((
filter_lvtype
==
1
&&
data
.
level
!=
filter_lv
)
||
(
filter_lvtype
==
2
&&
data
.
level
<
filter_lv
)
||
(
filter_lvtype
==
3
&&
data
.
level
<=
filter_lv
)
||
(
filter_lvtype
==
4
&&
data
.
level
>
filter_lv
)
||
(
filter_lvtype
==
5
&&
data
.
level
>=
filter_lv
))
||
(
filter_lvtype
==
5
&&
data
.
level
>=
filter_lv
)
||
filter_lvtype
==
6
)
continue
;
}
if
(
filter_scltype
)
{
if
((
filter_scltype
==
1
&&
data
.
lscale
!=
filter_scl
)
||
(
filter_scltype
==
2
&&
data
.
lscale
<
filter_scl
)
||
(
filter_scltype
==
3
&&
data
.
lscale
<=
filter_scl
)
||
(
filter_scltype
==
4
&&
(
data
.
lscale
>
filter_scl
||
data
.
lscale
==
0
))
||
(
filter_scltype
==
5
&&
(
data
.
lscale
>=
filter_scl
||
data
.
lscale
==
0
))
||
filter_scltype
==
6
)
continue
;
}
break
;
...
...
@@ -757,16 +841,48 @@ void DeckBuilder::FilterCards() {
mainGame
->
scrFilter
->
setVisible
(
false
);
mainGame
->
scrFilter
->
setPos
(
0
);
}
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_lv
);
SortList
();
}
void
DeckBuilder
::
ClearSearch
()
{
mainGame
->
cbCardType
->
setSelected
(
0
);
mainGame
->
cbCardType2
->
setSelected
(
0
);
mainGame
->
cbCardType2
->
setEnabled
(
false
);
mainGame
->
cbRace
->
setEnabled
(
false
);
mainGame
->
cbAttribute
->
setEnabled
(
false
);
mainGame
->
ebAttack
->
setEnabled
(
false
);
mainGame
->
ebDefense
->
setEnabled
(
false
);
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
mainGame
->
ebCardName
->
setText
(
L""
);
ClearFilter
();
}
void
DeckBuilder
::
ClearFilter
()
{
mainGame
->
cbAttribute
->
setSelected
(
0
);
mainGame
->
cbRace
->
setSelected
(
0
);
mainGame
->
cbLimit
->
setSelected
(
0
);
mainGame
->
ebAttack
->
setText
(
L""
);
mainGame
->
ebDefen
c
e
->
setText
(
L""
);
mainGame
->
ebDefen
s
e
->
setText
(
L""
);
mainGame
->
ebStar
->
setText
(
L""
);
mainGame
->
ebScale
->
setText
(
L""
);
filter_effect
=
0
;
for
(
int
i
=
0
;
i
<
32
;
++
i
)
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
}
void
DeckBuilder
::
SortList
()
{
switch
(
mainGame
->
cbSortType
->
getSelected
())
{
case
0
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_lv
);
break
;
case
1
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_atk
);
break
;
case
2
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_def
);
break
;
case
3
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_name
);
break
;
}
}
}
gframe/deck_con.h
View file @
2f0b8df3
...
...
@@ -12,7 +12,10 @@ class DeckBuilder: public irr::IEventReceiver {
public:
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
void
FilterCards
();
void
ClearFilter
();
void
ClearSearch
();
void
SortList
();
long
long
filter_effect
;
unsigned
int
filter_type
;
unsigned
int
filter_type2
;
...
...
@@ -24,6 +27,8 @@ public:
int
filter_def
;
unsigned
int
filter_lvtype
;
unsigned
int
filter_lv
;
unsigned
int
filter_scltype
;
unsigned
int
filter_scl
;
int
filter_lm
;
int
hovered_code
;
int
hovered_pos
;
...
...
gframe/deck_manager.cpp
View file @
2f0b8df3
...
...
@@ -232,4 +232,17 @@ bool DeckManager::SaveDeck(Deck& deck, const wchar_t* name) {
fclose
(
fp
);
return
true
;
}
bool
DeckManager
::
DeleteDeck
(
Deck
&
deck
,
const
wchar_t
*
name
)
{
wchar_t
file
[
64
];
myswprintf
(
file
,
L"./deck/%ls.ydk"
,
name
);
#ifdef WIN32
BOOL
result
=
DeleteFileW
(
file
);
return
!!
result
;
#else
char
filefn
[
256
];
BufferIO
::
EncodeUTF8
(
file
,
filefn
);
int
result
=
unlink
(
filefn
);
return
result
==
0
;
#endif
}
}
gframe/deck_manager.h
View file @
2f0b8df3
...
...
@@ -42,6 +42,7 @@ public:
bool
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
bool
LoadDeck
(
const
wchar_t
*
file
);
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
bool
DeleteDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
};
extern
DeckManager
deckManager
;
...
...
gframe/drawing.cpp
View file @
2f0b8df3
...
...
@@ -415,7 +415,7 @@ void Game::DrawMisc() {
w
=
adFont
->
getDimension
(
pcard
->
defstring
).
Width
;
adFont
->
draw
(
pcard
->
defstring
,
recti
(
m
+
4
,
416
,
m
+
4
+
w
,
436
),
0xff000000
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
defstring
,
recti
(
m
+
5
,
417
,
m
+
5
+
w
,
437
),
pcard
->
defen
ce
>
pcard
->
base_defence
?
0xffffff00
:
pcard
->
defence
<
pcard
->
base_defenc
e
?
0xffff2090
:
0xffffffff
,
false
,
false
,
0
);
pcard
->
defen
se
>
pcard
->
base_defense
?
0xffffff00
:
pcard
->
defense
<
pcard
->
base_defens
e
?
0xffff2090
:
0xffffffff
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
lvstring
,
recti
(
473
+
i
*
80
,
356
,
475
+
i
*
80
,
366
),
0xff000000
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
lvstring
,
recti
(
474
+
i
*
80
,
357
,
476
+
i
*
80
,
367
),
(
pcard
->
type
&
TYPE_XYZ
)
?
0xffff80ff
:
(
pcard
->
type
&
TYPE_TUNER
)
?
0xffffff00
:
0xffffffff
,
false
,
false
,
0
);
...
...
@@ -434,7 +434,7 @@ void Game::DrawMisc() {
w
=
adFont
->
getDimension
(
pcard
->
defstring
).
Width
;
adFont
->
draw
(
pcard
->
defstring
,
recti
(
m
+
4
,
235
,
m
+
4
+
w
,
255
),
0xff000000
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
defstring
,
recti
(
m
+
5
,
236
,
m
+
5
+
w
,
256
),
pcard
->
defen
ce
>
pcard
->
base_defence
?
0xffffff00
:
pcard
->
defence
<
pcard
->
base_defenc
e
?
0xffff2090
:
0xffffffff
,
false
,
false
,
0
);
pcard
->
defen
se
>
pcard
->
base_defense
?
0xffffff00
:
pcard
->
defense
<
pcard
->
base_defens
e
?
0xffff2090
:
0xffffffff
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
lvstring
,
recti
(
779
-
i
*
71
,
272
,
800
-
i
*
71
,
292
),
0xff000000
,
false
,
false
,
0
);
adFont
->
draw
(
pcard
->
lvstring
,
recti
(
780
-
i
*
71
,
273
,
800
-
i
*
71
,
293
),
(
pcard
->
type
&
TYPE_XYZ
)
?
0xffff80ff
:
(
pcard
->
type
&
TYPE_TUNER
)
?
0xffffff00
:
0xffffffff
,
false
,
false
,
0
);
...
...
@@ -847,7 +847,8 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) {
}
void
Game
::
PopupElement
(
irr
::
gui
::
IGUIElement
*
element
,
int
hideframe
)
{
element
->
getParent
()
->
bringToFront
(
element
);
dField
.
panel
=
element
;
if
(
!
mainGame
->
is_building
)
dField
.
panel
=
element
;
env
->
setFocus
(
element
);
if
(
!
hideframe
)
ShowElement
(
element
);
...
...
@@ -966,13 +967,13 @@ void Game::DrawDeckBd() {
myswprintf
(
textBuffer
,
L"%ls/%ls %c%d"
,
dataManager
.
FormatAttribute
(
ptr
->
second
.
attribute
),
dataManager
.
FormatRace
(
ptr
->
second
.
race
),
form
,
ptr
->
second
.
level
);
textFont
->
draw
(
textBuffer
,
recti
(
859
,
186
+
i
*
66
,
955
,
207
+
i
*
66
),
0xff000000
,
false
,
false
);
textFont
->
draw
(
textBuffer
,
recti
(
860
,
187
+
i
*
66
,
955
,
207
+
i
*
66
),
0xffffffff
,
false
,
false
);
if
(
ptr
->
second
.
attack
<
0
&&
ptr
->
second
.
defen
c
e
<
0
)
if
(
ptr
->
second
.
attack
<
0
&&
ptr
->
second
.
defen
s
e
<
0
)
myswprintf
(
textBuffer
,
L"?/?"
);
else
if
(
ptr
->
second
.
attack
<
0
)
myswprintf
(
textBuffer
,
L"?/%d"
,
ptr
->
second
.
defen
c
e
);
else
if
(
ptr
->
second
.
defen
c
e
<
0
)
myswprintf
(
textBuffer
,
L"?/%d"
,
ptr
->
second
.
defen
s
e
);
else
if
(
ptr
->
second
.
defen
s
e
<
0
)
myswprintf
(
textBuffer
,
L"%d/?"
,
ptr
->
second
.
attack
);
else
myswprintf
(
textBuffer
,
L"%d/%d"
,
ptr
->
second
.
attack
,
ptr
->
second
.
defen
c
e
);
else
myswprintf
(
textBuffer
,
L"%d/%d"
,
ptr
->
second
.
attack
,
ptr
->
second
.
defen
s
e
);
if
(
ptr
->
second
.
type
&
TYPE_PENDULUM
)
{
wchar_t
scaleBuffer
[
16
];
myswprintf
(
scaleBuffer
,
L" %d/%d"
,
ptr
->
second
.
lscale
,
ptr
->
second
.
rscale
);
...
...
gframe/duelclient.cpp
View file @
2f0b8df3
...
...
@@ -277,12 +277,17 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
dField
.
Clear
();
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
btnSideOK
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
...
...
@@ -501,6 +506,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
}
case
STOC_DUEL_END
:
{
mainGame
->
gMutex
.
Lock
();
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -527,6 +537,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
wPhase
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
...
...
@@ -892,7 +905,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
extrac
=
BufferIO
::
ReadInt16
(
pbuf
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
deckc
,
extrac
);
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
strTurn
[
0
]
=
0
;
mainGame
->
dInfo
.
is_shuffling
=
false
;
mainGame
->
gMutex
.
Unlock
();
return
true
;
...
...
@@ -1214,7 +1226,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
panelmode
=
true
;
}
}
if
(
!
forced
&&
(
mainGame
->
ignore_chain
||
((
count
==
0
||
specount
==
0
)
&&
!
mainGame
->
always_chain
)))
{
if
(
!
forced
&&
(
mainGame
->
ignore_chain
||
((
count
==
0
||
specount
==
0
)
&&
!
mainGame
->
always_chain
))
&&
(
count
==
0
||
!
mainGame
->
chain_when_avail
)
)
{
SetResponseI
(
-
1
);
mainGame
->
dField
.
ClearChainSelect
();
if
(
mainGame
->
chkWaitChain
->
isChecked
()
&&
!
mainGame
->
ignore_chain
)
{
...
...
@@ -1223,7 +1235,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
DuelClient
::
SendResponse
();
return
true
;
}
if
(
mainGame
->
chkAutoChain
->
isChecked
()
&&
forced
)
{
if
(
mainGame
->
chkAutoChain
->
isChecked
()
&&
forced
&&
!
(
mainGame
->
always_chain
||
mainGame
->
chain_when_avail
)
)
{
SetResponseI
(
0
);
mainGame
->
dField
.
ClearChainSelect
();
DuelClient
::
SendResponse
();
...
...
@@ -1836,6 +1848,19 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
}
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
!
mainGame
->
chkHideChainButton
->
isChecked
())
{
mainGame
->
btnChainIgnore
->
setVisible
(
true
);
mainGame
->
btnChainAlways
->
setVisible
(
true
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
true
);
mainGame
->
dField
.
UpdateChainButtons
();
}
else
{
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
}
}
if
(
mainGame
->
dInfo
.
isTag
&&
mainGame
->
dInfo
.
turn
!=
1
)
{
if
(
player
==
0
)
mainGame
->
dInfo
.
tag_player
[
0
]
=
!
mainGame
->
dInfo
.
tag_player
[
0
];
...
...
@@ -1843,7 +1868,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dInfo
.
tag_player
[
1
]
=
!
mainGame
->
dInfo
.
tag_player
[
1
];
}
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
myswprintf
(
mainGame
->
dInfo
.
strTurn
,
L"Turn:%d"
,
mainGame
->
dInfo
.
turn
);
mainGame
->
showcardcode
=
10
;
mainGame
->
showcarddif
=
30
;
mainGame
->
showcardp
=
0
;
...
...
@@ -2754,8 +2778,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
attack
=
aatk
;
myswprintf
(
pcard
->
atkstring
,
L"%d"
,
aatk
);
}
if
(
adef
!=
pcard
->
defen
c
e
)
{
pcard
->
defen
c
e
=
adef
;
if
(
adef
!=
pcard
->
defen
s
e
)
{
pcard
->
defen
s
e
=
adef
;
myswprintf
(
pcard
->
defstring
,
L"%d"
,
adef
);
}
if
(
ld
)
{
...
...
@@ -2764,8 +2788,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
attack
=
datk
;
myswprintf
(
pcard
->
atkstring
,
L"%d"
,
datk
);
}
if
(
ddef
!=
pcard
->
defen
c
e
)
{
pcard
->
defen
c
e
=
ddef
;
if
(
ddef
!=
pcard
->
defen
s
e
)
{
pcard
->
defen
s
e
=
ddef
;
myswprintf
(
pcard
->
defstring
,
L"%d"
,
ddef
);
}
}
...
...
gframe/event_handler.cpp
View file @
2f0b8df3
...
...
@@ -50,6 +50,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnReplayStart
->
setVisible
(
false
);
mainGame
->
btnReplayPause
->
setVisible
(
true
);
mainGame
->
btnReplayStep
->
setVisible
(
false
);
mainGame
->
btnReplayUndo
->
setVisible
(
false
);
ReplayMode
::
Pause
(
false
,
false
);
break
;
}
...
...
@@ -59,6 +60,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnReplayStart
->
setVisible
(
true
);
mainGame
->
btnReplayPause
->
setVisible
(
false
);
mainGame
->
btnReplayStep
->
setVisible
(
true
);
mainGame
->
btnReplayUndo
->
setVisible
(
true
);
ReplayMode
::
Pause
(
true
,
false
);
break
;
}
...
...
@@ -80,6 +82,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
ReplayMode
::
SwapField
();
break
;
}
case
BUTTON_REPLAY_UNDO
:
{
if
(
!
mainGame
->
dInfo
.
isReplay
)
break
;
ReplayMode
::
Undo
();
break
;
}
case
BUTTON_REPLAY_SAVE
:
{
if
(
mainGame
->
ebRSName
->
getText
()[
0
]
==
0
)
break
;
...
...
@@ -119,6 +127,27 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
BUTTON_CHAIN_IGNORE
:
{
mainGame
->
ignore_chain
=
mainGame
->
btnChainIgnore
->
isPressed
();
mainGame
->
always_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
break
;
}
case
BUTTON_CHAIN_ALWAYS
:
{
mainGame
->
always_chain
=
mainGame
->
btnChainAlways
->
isPressed
();
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
break
;
}
case
BUTTON_CHAIN_WHENAVAIL
:
{
mainGame
->
chain_when_avail
=
mainGame
->
btnChainWhenAvail
->
isPressed
();
mainGame
->
always_chain
=
false
;
mainGame
->
ignore_chain
=
false
;
UpdateChainButtons
();
break
;
}
case
BUTTON_MSG_OK
:
{
mainGame
->
HideElement
(
mainGame
->
wMessage
);
mainGame
->
actionSignal
.
Set
();
...
...
@@ -190,12 +219,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_POS_DU
:
{
DuelClient
::
SetResponseI
(
POS_FACEUP_DEFEN
C
E
);
DuelClient
::
SetResponseI
(
POS_FACEUP_DEFEN
S
E
);
mainGame
->
HideElement
(
mainGame
->
wPosSelect
,
true
);
break
;
}
case
BUTTON_POS_DD
:
{
DuelClient
::
SetResponseI
(
POS_FACEDOWN_DEFEN
C
E
);
DuelClient
::
SetResponseI
(
POS_FACEDOWN_DEFEN
S
E
);
mainGame
->
HideElement
(
mainGame
->
wPosSelect
,
true
);
break
;
}
...
...
@@ -876,8 +905,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
irr
::
core
::
position2di
pos
(
x
,
y
);
if
(
x
<
300
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
{
mainGame
->
always_chain
=
event
.
MouseInput
.
isLeftPressed
();
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
if
(
mainGame
->
wCmdMenu
->
isVisible
()
&&
!
mainGame
->
wCmdMenu
->
getRelativePosition
().
isPointInside
(
pos
))
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
panel
&&
panel
->
isVisible
())
...
...
@@ -1211,8 +1244,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EMIE_RMOUSE_LEFT_UP
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
{
mainGame
->
ignore_chain
=
event
.
MouseInput
.
isRightPressed
();
mainGame
->
always_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
mainGame
->
fadingList
.
size
())
break
;
...
...
@@ -1510,15 +1547,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EMIE_LMOUSE_PRESSED_DOWN
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
{
mainGame
->
always_chain
=
event
.
MouseInput
.
isLeftPressed
();
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
break
;
}
case
irr
:
:
EMIE_RMOUSE_PRESSED_DOWN
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
{
mainGame
->
ignore_chain
=
event
.
MouseInput
.
isRightPressed
();
mainGame
->
always_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
break
;
}
default:
...
...
@@ -1529,13 +1574,30 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_A
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
mainGame
->
always_chain
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
break
;
}
case
irr
:
:
KEY_KEY_S
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
mainGame
->
ignore_chain
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
always_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
break
;
}
case
irr
:
:
KEY_KEY_D
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
mainGame
->
chain_when_avail
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
always_chain
=
false
;
mainGame
->
ignore_chain
=
false
;
UpdateChainButtons
();
}
break
;
}
case
irr
:
:
KEY_KEY_R
:
{
...
...
@@ -1844,7 +1906,13 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame
->
wCmdMenu
->
setVisible
(
true
);
mainGame
->
wCmdMenu
->
setRelativePosition
(
irr
::
core
::
recti
(
x
-
20
,
y
-
20
-
height
,
x
+
80
,
y
-
20
));
}
void
ClientField
::
UpdateChainButtons
()
{
if
(
mainGame
->
btnChainAlways
->
isVisible
())
{
mainGame
->
btnChainIgnore
->
setPressed
(
mainGame
->
ignore_chain
);
mainGame
->
btnChainAlways
->
setPressed
(
mainGame
->
always_chain
);
mainGame
->
btnChainWhenAvail
->
setPressed
(
mainGame
->
chain_when_avail
);
}
}
void
ClientField
::
SetResponseSelectedCards
()
const
{
unsigned
char
respbuf
[
64
];
respbuf
[
0
]
=
selected_cards
.
size
();
...
...
gframe/game.cpp
View file @
2f0b8df3
...
...
@@ -15,7 +15,7 @@
#include <unistd.h>
#endif
const
unsigned
short
PRO_VERSION
=
0x133
9
;
const
unsigned
short
PRO_VERSION
=
0x133
A
;
namespace
ygo
{
...
...
@@ -216,13 +216,14 @@ bool Game::Initialize() {
stHostPrepRule = env->addStaticText(L"", rect<s32>(280, 30, 460, 230), false, true, wHostPrepare);
env->addStaticText(dataManager.GetSysString(1254), rect<s32>(10, 235, 110, 255), false, false, wHostPrepare);
cbDeckSelect = env->addComboBox(rect<s32>(120, 230, 270, 255), wHostPrepare);
cbDeckSelect->setMaxSelectionRows(10);
btnHostPrepStart = env->addButton(rect<s32>(230, 280, 340, 305), wHostPrepare, BUTTON_HP_START, dataManager.GetSysString(1215));
btnHostPrepCancel = env->addButton(rect<s32>(350, 280, 460, 305), wHostPrepare, BUTTON_HP_CANCEL, dataManager.GetSysString(1212));
//img
wCardImg = env->addStaticText(L"", rect<s32>(1, 1, 199, 273), true, false, 0, -1, true);
wCardImg->setBackgroundColor(0xc0c0c0c0);
wCardImg->setVisible(false);
imgCard = env->addImage(rect<s32>(
9, 9, 187, 262
), wCardImg);
imgCard = env->addImage(rect<s32>(
10, 9, 187, 263
), wCardImg);
imgCard->setUseAlphaChannel(true);
//phase
wPhase = env->addStaticText(L"", rect<s32>(480, 310, 855, 330));
...
...
@@ -286,6 +287,8 @@ bool Game::Initialize() {
chkIgnore2->setChecked(gameConf.chkIgnore2 != 0);
chkHideSetname = env->addCheckBox(false, rect<s32>(20, 260, 280, 285), tabSystem, -1, dataManager.GetSysString(1354));
chkHideSetname->setChecked(gameConf.chkHideSetname != 0);
chkHideChainButton = env->addCheckBox(false, rect<s32>(20, 290, 280, 315), tabSystem, -1, dataManager.GetSysString(1355));
chkHideChainButton->setChecked(gameConf.chkHideChainButton != 0);
//
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false);
...
...
@@ -428,67 +431,80 @@ bool Game::Initialize() {
btnAttack = env->addButton(rect<s32>(1, 127, 99, 147), wCmdMenu, BUTTON_CMD_ATTACK, dataManager.GetSysString(1157));
btnShowList = env->addButton(rect<s32>(1, 148, 99, 168), wCmdMenu, BUTTON_CMD_SHOWLIST, dataManager.GetSysString(1158));
//deck edit
wDeckEdit = env->addStaticText(L"", rect<s32>(309,
8
, 605, 130), true, false, 0, -1, true);
wDeckEdit = env->addStaticText(L"", rect<s32>(309,
5
, 605, 130), true, false, 0, -1, true);
wDeckEdit->setVisible(false);
env->addStaticText(dataManager.GetSysString(1300), rect<s32>(10, 9, 100, 29), false, false, wDeckEdit);
cbDBLFList = env->addComboBox(rect<s32>(80, 5, 220, 30), wDeckEdit, COMBOBOX_DBLFLIST);
cbDBLFList->setMaxSelectionRows(10);
env->addStaticText(dataManager.GetSysString(1301), rect<s32>(10, 39, 100, 59), false, false, wDeckEdit);
cbDBDecks = env->addComboBox(rect<s32>(80, 35, 220, 60), wDeckEdit, COMBOBOX_DBDECKS);
cbDBDecks->setMaxSelectionRows(15);
for(unsigned int i = 0; i < deckManager._lfList.size(); ++i)
cbDBLFList->addItem(deckManager._lfList[i].listName);
btnSaveDeck = env->addButton(rect<s32>(225, 35, 290, 60), wDeckEdit, BUTTON_SAVE_DECK, dataManager.GetSysString(1302));
ebDeckname = env->addEditBox(L"", rect<s32>(80, 65, 220, 90), true, wDeckEdit, -1);
ebDeckname->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnSaveDeckAs = env->addButton(rect<s32>(225, 65, 290, 90), wDeckEdit, BUTTON_SAVE_DECK_AS, dataManager.GetSysString(1303));
btn
ClearDeck = env->addButton(rect<s32>(240, 95, 290, 116), wDeckEdit, BUTTON_CLEAR_DECK, dataManager.GetSysString(1304
));
btnS
ortDeck = env->addButton(rect<s32>(185, 95, 235, 116), wDeckEdit, BUTTON_SORT_DECK, dataManager.GetSysString(1305
));
btnS
huffleDeck = env->addButton(rect<s32>(130, 95, 180, 116), wDeckEdit, BUTTON_SHUFFLE_DECK, dataManager.GetSysString(1307
));
btn
DBExit = env->addButton(rect<s32>(10, 95, 90, 116), wDeckEdit, BUTTON_DBEXIT, dataManager.GetSysString(1306
));
btn
DeleteDeck = env->addButton(rect<s32>(225, 95, 290, 120), wDeckEdit, BUTTON_DELETE_DECK, dataManager.GetSysString(1308
));
btnS
huffleDeck = env->addButton(rect<s32>(5, 99, 55, 120), wDeckEdit, BUTTON_SHUFFLE_DECK, dataManager.GetSysString(1307
));
btnS
ortDeck = env->addButton(rect<s32>(60, 99, 110, 120), wDeckEdit, BUTTON_SORT_DECK, dataManager.GetSysString(1305
));
btn
ClearDeck = env->addButton(rect<s32>(115, 99, 165, 120), wDeckEdit, BUTTON_CLEAR_DECK, dataManager.GetSysString(1304
));
btnSideOK = env->addButton(rect<s32>(510, 40, 820, 80), 0, BUTTON_SIDE_OK, dataManager.GetSysString(1334));
btnSideOK->setVisible(false);
//filters
wFilter = env->addStaticText(L"", rect<s32>(610,
8
, 1020, 130), true, false, 0, -1, true);
wFilter = env->addStaticText(L"", rect<s32>(610,
5
, 1020, 130), true, false, 0, -1, true);
wFilter->setVisible(false);
env->addStaticText(dataManager.GetSysString(1311), rect<s32>(10,
5, 70, 25
), false, false, wFilter);
cbCardType = env->addComboBox(rect<s32>(60,
3, 120, 23
), wFilter, COMBOBOX_MAINTYPE);
env->addStaticText(dataManager.GetSysString(1311), rect<s32>(10,
25 / 6 + 2, 70, 22 + 25 / 6
), false, false, wFilter);
cbCardType = env->addComboBox(rect<s32>(60,
25 / 6, 120, 20 + 25 / 6
), wFilter, COMBOBOX_MAINTYPE);
cbCardType->addItem(dataManager.GetSysString(1310));
cbCardType->addItem(dataManager.GetSysString(1312));
cbCardType->addItem(dataManager.GetSysString(1313));
cbCardType->addItem(dataManager.GetSysString(1314));
cbCardType2 = env->addComboBox(rect<s32>(125, 3, 200, 23), wFilter, -1);
cbCardType2 = env->addComboBox(rect<s32>(125, 25 / 6, 200, 20 + 25 / 6), wFilter, -1);
cbCardType2->setMaxSelectionRows(10);
cbCardType2->addItem(dataManager.GetSysString(1310), 0);
env->addStaticText(dataManager.GetSysString(1315), rect<s32>(205, 5, 280, 25), false, false, wFilter);
cbLimit = env->addComboBox(rect<s32>(260, 3, 390, 23), wFilter, -1);
env->addStaticText(dataManager.GetSysString(1315), rect<s32>(205, 2 + 25 / 6, 280, 22 + 25 / 6), false, false, wFilter);
cbLimit = env->addComboBox(rect<s32>(260, 25 / 6, 390, 20 + 25 / 6), wFilter, -1);
cbLimit->setMaxSelectionRows(10);
cbLimit->addItem(dataManager.GetSysString(1310));
cbLimit->addItem(dataManager.GetSysString(1316));
cbLimit->addItem(dataManager.GetSysString(1317));
cbLimit->addItem(dataManager.GetSysString(1318));
cbLimit->addItem(dataManager.GetSysString(1240));
cbLimit->addItem(dataManager.GetSysString(1241));
env->addStaticText(dataManager.GetSysString(1319), rect<s32>(10, 28, 70, 48), false, false, wFilter);
cbAttribute = env->addComboBox(rect<s32>(60, 26, 190, 46), wFilter, -1);
env->addStaticText(dataManager.GetSysString(1319), rect<s32>(10, 22 + 50 / 6, 70, 42 + 50 / 6), false, false, wFilter);
cbAttribute = env->addComboBox(rect<s32>(60, 20 + 50 / 6, 190, 40 + 50 / 6), wFilter, -1);
cbAttribute->setMaxSelectionRows(10);
cbAttribute->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x80; filter <<= 1)
cbAttribute->addItem(dataManager.FormatAttribute(filter), filter);
env->addStaticText(dataManager.GetSysString(1321), rect<s32>(10, 51, 70, 71), false, false, wFilter);
cbRace = env->addComboBox(rect<s32>(60, 49, 190, 69), wFilter, -1);
env->addStaticText(dataManager.GetSysString(1321), rect<s32>(10, 42 + 75 / 6, 70, 62 + 75 / 6), false, false, wFilter);
cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 190, 60 + 75 / 6), wFilter, -1);
cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x1000000; filter <<= 1)
cbRace->addItem(dataManager.FormatRace(filter), filter);
env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 2
8, 280, 48
), false, false, wFilter);
ebAttack = env->addEditBox(L"", rect<s32>(260, 2
6, 340, 4
6), true, wFilter);
env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 2
2 + 50 / 6, 280, 42 + 50 / 6
), false, false, wFilter);
ebAttack = env->addEditBox(L"", rect<s32>(260, 2
0 + 50 / 6, 340, 40 + 50 /
6), true, wFilter);
ebAttack->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1323), rect<s32>(205,
51, 280, 71
), false, false, wFilter);
ebDefen
ce = env->addEditBox(L"", rect<s32>(260, 49, 340, 69
), true, wFilter);
ebDefen
c
e->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1324), rect<s32>(10,
74, 80, 94
), false, false, wFilter);
ebStar = env->addEditBox(L"", rect<s32>(60,
72, 140, 92
), true, wFilter);
env->addStaticText(dataManager.GetSysString(1323), rect<s32>(205,
42 + 75 / 6, 280, 62 + 75 / 6
), false, false, wFilter);
ebDefen
se = env->addEditBox(L"", rect<s32>(260, 40 + 75 / 6, 340, 60 + 75 / 6
), true, wFilter);
ebDefen
s
e->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1324), rect<s32>(10,
62 + 100 / 6, 80, 82 + 100 / 6
), false, false, wFilter);
ebStar = env->addEditBox(L"", rect<s32>(60,
60 + 100 / 6, 190, 80 + 100 / 6
), true, wFilter);
ebStar->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1325), rect<s32>(205, 74, 280, 94), false, false, wFilter);
ebCardName = env->addEditBox(L"", rect<s32>(260, 72, 390, 92), true, wFilter, EDITBOX_KEYWORD);
env->addStaticText(dataManager.GetSysString(1336), rect<s32>(10, 82 + 125 / 6, 80, 102 + 125 / 6), false, false, wFilter);
ebScale = env->addEditBox(L"", rect<s32>(60, 80 + 125 / 6, 190, 100 + 125 / 6), true, wFilter);
ebScale->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1325), rect<s32>(205, 62 + 100 / 6, 280, 82 + 100 / 6), false, false, wFilter);
ebCardName = env->addEditBox(L"", rect<s32>(260, 60 + 100 / 6, 390, 80 + 100 / 6), true, wFilter, EDITBOX_KEYWORD);
ebCardName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnEffectFilter = env->addButton(rect<s32>(345, 28, 390, 69), wFilter, BUTTON_EFFECT_FILTER, dataManager.GetSysString(1326));
btnStartFilter = env->addButton(rect<s32>(210, 96, 390, 118), wFilter, BUTTON_START_FILTER, dataManager.GetSysString(1327));
btnEffectFilter = env->addButton(rect<s32>(345, 20 + 50 / 6, 390, 60 + 75 / 6), wFilter, BUTTON_EFFECT_FILTER, dataManager.GetSysString(1326));
btnStartFilter = env->addButton(rect<s32>(205, 80 + 125 / 6, 390, 100 + 125 / 6), wFilter, BUTTON_START_FILTER, dataManager.GetSysString(1327));
if(mainGame->gameConf.separate_clear_button) {
btnStartFilter->setRelativePosition(rect<s32>(260, 80 + 125 / 6, 390, 100 + 125 / 6));
btnClearFilter = env->addButton(rect<s32>(205, 80 + 125 / 6, 255, 100 + 125 / 6), wFilter, BUTTON_CLEAR_FILTER, dataManager.GetSysString(1304));
}
wCategories = env->addWindow(rect<s32>(630, 60, 1000, 270), false, dataManager.strBuffer);
wCategories->getCloseButton()->setVisible(false);
wCategories->setDrawTitlebar(false);
...
...
@@ -501,6 +517,13 @@ bool Game::Initialize() {
scrFilter->setLargeStep(10);
scrFilter->setSmallStep(1);
scrFilter->setVisible(false);
//sort type
wSort = env->addStaticText(L"", rect<s32>(930, 132, 1020, 156), true, false, 0, -1, true);
cbSortType = env->addComboBox(rect<s32>(10, 2, 85, 22), wSort, COMBOBOX_SORTTYPE);
cbSortType->setMaxSelectionRows(10);
for(int i = 1370; i <= 1373; i++)
cbSortType->addItem(dataManager.GetSysString(i));
wSort->setVisible(false);
//replay window
wReplay = env->addWindow(rect<s32>(220, 100, 800, 520), false, dataManager.GetSysString(1202));
wReplay->getCloseButton()->setVisible(false);
...
...
@@ -534,13 +557,14 @@ bool Game::Initialize() {
btnRSYes = env->addButton(rect<s32>(70, 80, 140, 105), wReplaySave, BUTTON_REPLAY_SAVE, dataManager.GetSysString(1341));
btnRSNo = env->addButton(rect<s32>(170, 80, 240, 105), wReplaySave, BUTTON_REPLAY_CANCEL, dataManager.GetSysString(1212));
//replay control
wReplayControl = env->addStaticText(L"", rect<s32>(205, 1
43
, 295, 273), true, false, 0, -1, true);
wReplayControl = env->addStaticText(L"", rect<s32>(205, 1
18
, 295, 273), true, false, 0, -1, true);
wReplayControl->setVisible(false);
btnReplayStart = env->addButton(rect<s32>(5, 5, 85, 25), wReplayControl, BUTTON_REPLAY_START, dataManager.GetSysString(1343));
btnReplayPause = env->addButton(rect<s32>(5, 30, 85, 50), wReplayControl, BUTTON_REPLAY_PAUSE, dataManager.GetSysString(1344));
btnReplayStep = env->addButton(rect<s32>(5, 55, 85, 75), wReplayControl, BUTTON_REPLAY_STEP, dataManager.GetSysString(1345));
btnReplaySwap = env->addButton(rect<s32>(5, 80, 85, 100), wReplayControl, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnReplayExit = env->addButton(rect<s32>(5, 105, 85, 125), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347));
btnReplayUndo = env->addButton(rect<s32>(5, 80, 85, 100), wReplayControl, BUTTON_REPLAY_UNDO, dataManager.GetSysString(1360));
btnReplaySwap = env->addButton(rect<s32>(5, 105, 85, 125), wReplayControl, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnReplayExit = env->addButton(rect<s32>(5, 130, 85, 150), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347));
//chat
wChat = env->addWindow(rect<s32>(305, 615, 1020, 640), false, L"");
wChat->getCloseButton()->setVisible(false);
...
...
@@ -548,7 +572,17 @@ bool Game::Initialize() {
wChat->setDrawTitlebar(false);
wChat->setVisible(false);
ebChatInput = env->addEditBox(L"", rect<s32>(3, 2, 710, 22), true, wChat, EDITBOX_CHAT);
//
//chain buttons
btnChainIgnore = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainAlways = env->addButton(rect<s32>(205, 140, 295, 175), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
btnChainWhenAvail = env->addButton(rect<s32>(205, 180, 295, 215), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
btnChainIgnore->setIsPushButton(true);
btnChainAlways->setIsPushButton(true);
btnChainWhenAvail->setIsPushButton(true);
btnChainIgnore->setVisible(false);
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
//leave/surrender/exit
btnLeaveGame = env->addButton(rect<s32>(205, 5, 295, 80), 0, BUTTON_LEAVE_GAME, L"");
btnLeaveGame->setVisible(false);
device->setEventReceiver(&menuHandler);
...
...
@@ -628,8 +662,6 @@ void Game::MainLoop() {
driver->endScene();
if(closeSignal.Wait(0))
CloseDuelWindow();
if(!device->isWindowActive())
ignore_chain = false;
fps++;
cur_time = timer->getTime();
if(cur_time < fps * 17 - 20)
...
...
@@ -872,8 +904,10 @@ void Game::LoadConfig() {
gameConf.chkIgnore1 = 0;
gameConf.chkIgnore2 = 0;
gameConf.chkHideSetname = 0;
gameConf.chkHideChainButton = 0;
gameConf.control_mode = 0;
gameConf.draw_field_spell = 1;
gameConf.separate_clear_button = 1;
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
...
...
@@ -920,10 +954,14 @@ void Game::LoadConfig() {
gameConf.chkIgnore2 = atoi(valbuf);
} else if(!strcmp(strbuf, "hide_setname")) {
gameConf.chkHideSetname = atoi(valbuf);
} else if(!strcmp(strbuf, "hide_chain_button")) {
gameConf.chkHideChainButton = atoi(valbuf);
} else if(!strcmp(strbuf, "control_mode")) {
gameConf.control_mode = atoi(valbuf);
} else if(!strcmp(strbuf, "draw_field_spell")) {
gameConf.draw_field_spell = atoi(valbuf);
} else if(!strcmp(strbuf, "separate_clear_button")) {
gameConf.separate_clear_button = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
...
...
@@ -972,9 +1010,11 @@ void Game::SaveConfig() {
fprintf(fp, "mute_opponent = %d\n", ((mainGame->chkIgnore1->isChecked()) ? 1 : 0));
fprintf(fp, "mute_spectators = %d\n", ((mainGame->chkIgnore2->isChecked()) ? 1 : 0));
fprintf(fp, "hide_setname = %d\n", ((mainGame->chkHideSetname->isChecked()) ? 1 : 0));
fprintf(fp, "#control_mode = 0: Key A/S/R. control_mode = 1: MouseLeft/MouseRight/F9\n");
fprintf(fp, "hide_chain_button = %d\n", ((mainGame->chkHideChainButton->isChecked()) ? 1 : 0));
fprintf(fp, "#control_mode = 0: Key A/S/D/R. control_mode = 1: MouseLeft/MouseRight/NULL/F9\n");
fprintf(fp, "control_mode = %d\n", gameConf.control_mode);
fprintf(fp, "draw_field_spell = %d\n", gameConf.draw_field_spell);
fprintf(fp, "separate_clear_button = %d\n", gameConf.separate_clear_button);
fclose(fp);
}
void Game::ShowCardInfo(int code) {
...
...
@@ -1009,17 +1049,17 @@ void Game::ShowCardInfo(int code) {
myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute));
stInfo->setText(formatBuffer);
int form = 0x2605;
if(cd.type & TYPE_XYZ) ++form
;
myswprintf(formatBuffer, L"[%c%d] ",
form,
cd.level);
if(cd.type & TYPE_XYZ) ++form;
myswprintf(formatBuffer, L"[%c%d] ",
form,
cd.level);
wchar_t adBuffer[16];
if(cd.attack < 0 && cd.defen
c
e < 0)
if(cd.attack < 0 && cd.defen
s
e < 0)
myswprintf(adBuffer, L"?/?");
else if(cd.attack < 0)
myswprintf(adBuffer, L"?/%d", cd.defen
c
e);
else if(cd.defen
c
e < 0)
myswprintf(adBuffer, L"?/%d", cd.defen
s
e);
else if(cd.defen
s
e < 0)
myswprintf(adBuffer, L"%d/?", cd.attack);
else
myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defen
c
e);
myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defen
s
e);
wcscat(formatBuffer, adBuffer);
if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16];
...
...
@@ -1122,6 +1162,9 @@ void Game::CloseDuelWindow() {
stHintMsg->setVisible(false);
btnSideOK->setVisible(false);
btnLeaveGame->setVisible(false);
btnChainIgnore->setVisible(false);
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
wChat->setVisible(false);
lstLog->clear();
logParam.clear();
...
...
gframe/game.h
View file @
2f0b8df3
...
...
@@ -32,8 +32,10 @@ struct Config {
int
chkIgnore1
;
int
chkIgnore2
;
int
chkHideSetname
;
int
chkHideChainButton
;
int
control_mode
;
int
draw_field_spell
;
int
separate_clear_button
;
};
struct
DuelInfo
{
...
...
@@ -53,7 +55,6 @@ struct DuelInfo {
wchar_t
hostname_tag
[
20
];
wchar_t
clientname_tag
[
20
];
wchar_t
strLP
[
2
][
16
];
wchar_t
strTurn
[
8
];
wchar_t
*
vic_string
;
unsigned
char
player_type
;
unsigned
char
time_player
;
...
...
@@ -157,6 +158,7 @@ public:
wchar_t* lpcstring;
bool always_chain;
bool ignore_chain;
bool chain_when_avail;
bool is_building;
bool is_siding;
...
...
@@ -196,6 +198,7 @@ public:
irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideChainButton;
irr::gui::IGUIListBox* lstLog;
irr::gui::IGUIButton* btnClearLog;
irr::gui::IGUIButton* btnSaveLog;
...
...
@@ -350,8 +353,8 @@ public:
irr::gui::IGUIButton* btnSortDeck;
irr::gui::IGUIButton* btnShuffleDeck;
irr::gui::IGUIButton* btnSaveDeck;
irr::gui::IGUIButton* btnDeleteDeck;
irr::gui::IGUIButton* btnSaveDeckAs;
irr::gui::IGUIButton* btnDBExit;
irr::gui::IGUIButton* btnSideOK;
irr::gui::IGUIEditBox* ebDeckname;
//filter
...
...
@@ -363,14 +366,19 @@ public:
irr::gui::IGUIComboBox* cbAttribute;
irr::gui::IGUIComboBox* cbLimit;
irr::gui::IGUIEditBox* ebStar;
irr::gui::IGUIEditBox* ebScale;
irr::gui::IGUIEditBox* ebAttack;
irr::gui::IGUIEditBox* ebDefen
c
e;
irr::gui::IGUIEditBox* ebDefen
s
e;
irr::gui::IGUIEditBox* ebCardName;
irr::gui::IGUIButton* btnEffectFilter;
irr::gui::IGUIButton* btnStartFilter;
irr::gui::IGUIButton* btnClearFilter;
irr::gui::IGUIWindow* wCategories;
irr::gui::IGUICheckBox* chkCategory[32];
irr::gui::IGUIButton* btnCategoryOK;
//sort type
irr::gui::IGUIStaticText* wSort;
irr::gui::IGUIComboBox* cbSortType;
//replay save
irr::gui::IGUIWindow* wReplaySave;
irr::gui::IGUIEditBox* ebRSName;
...
...
@@ -381,10 +389,15 @@ public:
irr::gui::IGUIButton* btnReplayStart;
irr::gui::IGUIButton* btnReplayPause;
irr::gui::IGUIButton* btnReplayStep;
irr::gui::IGUIButton* btnReplayUndo;
irr::gui::IGUIButton* btnReplayExit;
irr::gui::IGUIButton* btnReplaySwap;
//surrender/leave
irr::gui::IGUIButton* btnLeaveGame;
//chain control
irr::gui::IGUIButton* btnChainIgnore;
irr::gui::IGUIButton* btnChainAlways;
irr::gui::IGUIButton* btnChainWhenAvail;
*/
};
...
...
@@ -479,6 +492,9 @@ extern unsigned char draw_count;
#define BUTTON_M2 261
#define BUTTON_EP 262
#define BUTTON_LEAVE_GAME 263
#define BUTTON_CHAIN_IGNORE 264
#define BUTTON_CHAIN_ALWAYS 265
#define BUTTON_CHAIN_WHENAVAIL 266
#define BUTTON_CLEAR_LOG 270
#define LISTBOX_LOG 271
#define SCROLL_CARDTEXT 280
...
...
@@ -495,23 +511,27 @@ extern unsigned char draw_count;
#define BUTTON_CLEAR_DECK 303
#define BUTTON_SAVE_DECK 304
#define BUTTON_SAVE_DECK_AS 305
#define BUTTON_DBEXIT 306
#define BUTTON_SORT_DECK 307
#define BUTTON_SIDE_OK 308
#define BUTTON_SHUFFLE_DECK 309
#define COMBOBOX_MAINTYPE 310
#define BUTTON_EFFECT_FILTER 311
#define BUTTON_START_FILTER 312
#define BUTTON_DELETE_DECK 306
#define BUTTON_DBEXIT 307
#define BUTTON_SORT_DECK 308
#define BUTTON_SIDE_OK 309
#define BUTTON_SHUFFLE_DECK 310
#define COMBOBOX_MAINTYPE 311
#define BUTTON_EFFECT_FILTER 312
#define BUTTON_START_FILTER 313
#define SCROLL_FILTER 314
#define EDITBOX_KEYWORD 315
#define BUTTON_CLEAR_FILTER 316
#define BUTTON_REPLAY_START 320
#define BUTTON_REPLAY_PAUSE 321
#define BUTTON_REPLAY_STEP 322
#define BUTTON_REPLAY_EXIT 323
#define BUTTON_REPLAY_SWAP 324
#define BUTTON_REPLAY_UNDO 323
#define BUTTON_REPLAY_EXIT 324
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_CANCEL 331
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define COMBOBOX_SORTTYPE 370
#endif // GAME_H
gframe/materials.cpp
View file @
2f0b8df3
...
...
@@ -45,14 +45,14 @@ Materials::Materials() {
vFieldSpell
[
1
]
=
S3DVertex
(
vector3df
(
6.7
f
,
-
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vFieldSpell
[
2
]
=
S3DVertex
(
vector3df
(
1.2
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vFieldSpell
[
3
]
=
S3DVertex
(
vector3df
(
6.7
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vFieldSpell1
[
0
]
=
S3DVertex
(
vector3df
(
1.2
f
,
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
vFieldSpell1
[
1
]
=
S3DVertex
(
vector3df
(
6.7
f
,
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vFieldSpell1
[
2
]
=
S3DVertex
(
vector3df
(
1.2
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vFieldSpell1
[
3
]
=
S3DVertex
(
vector3df
(
6.7
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vFieldSpell2
[
0
]
=
S3DVertex
(
vector3df
(
1.2
f
,
-
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
vFieldSpell2
[
1
]
=
S3DVertex
(
vector3df
(
6.7
f
,
-
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vFieldSpell2
[
2
]
=
S3DVertex
(
vector3df
(
1.2
f
,
-
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vFieldSpell2
[
3
]
=
S3DVertex
(
vector3df
(
6.7
f
,
-
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vFieldSpell1
[
0
]
=
S3DVertex
(
vector3df
(
1.2
f
,
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
.2
f
));
vFieldSpell1
[
1
]
=
S3DVertex
(
vector3df
(
6.7
f
,
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
.2
f
));
vFieldSpell1
[
2
]
=
S3DVertex
(
vector3df
(
1.2
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0.63636
f
));
vFieldSpell1
[
3
]
=
S3DVertex
(
vector3df
(
6.7
f
,
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0.63636
f
));
vFieldSpell2
[
0
]
=
S3DVertex
(
vector3df
(
1.2
f
,
-
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0.63636
f
));
vFieldSpell2
[
1
]
=
S3DVertex
(
vector3df
(
6.7
f
,
-
3.2
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0.63636
f
));
vFieldSpell2
[
2
]
=
S3DVertex
(
vector3df
(
1.2
f
,
-
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0.2
f
));
vFieldSpell2
[
3
]
=
S3DVertex
(
vector3df
(
6.7
f
,
-
0.8
f
,
0
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0.2
f
));
//background grids
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
vBackLine
[
i
*
6
+
0
]
=
S3DVertex
(
vector3df
(
1.2
f
+
i
*
1.1
f
,
0.5
f
,
-
0.01
f
),
vector3df
(
0
,
0
,
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
...
...
gframe/menu_handler.cpp
View file @
2f0b8df3
...
...
@@ -178,6 +178,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
btnReplayStart
->
setVisible
(
false
);
mainGame
->
btnReplayPause
->
setVisible
(
true
);
mainGame
->
btnReplayStep
->
setVisible
(
false
);
mainGame
->
btnReplayUndo
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
true
);
mainGame
->
dField
.
panel
=
0
;
mainGame
->
dField
.
hovered_card
=
0
;
...
...
@@ -219,6 +220,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wDeckEdit
->
setVisible
(
true
);
mainGame
->
wFilter
->
setVisible
(
true
);
mainGame
->
wSort
->
setVisible
(
true
);
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1306
));
mainGame
->
btnSideOK
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
filterList
=
deckManager
.
_lfList
[
0
].
content
;
mainGame
->
cbDBLFList
->
setSelected
(
0
);
...
...
@@ -227,14 +231,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
cbAttribute
->
setSelected
(
0
);
mainGame
->
cbRace
->
setSelected
(
0
);
mainGame
->
ebAttack
->
setText
(
L""
);
mainGame
->
ebDefen
c
e
->
setText
(
L""
);
mainGame
->
ebDefen
s
e
->
setText
(
L""
);
mainGame
->
ebStar
->
setText
(
L""
);
mainGame
->
ebScale
->
setText
(
L""
);
mainGame
->
cbCardType2
->
setEnabled
(
false
);
mainGame
->
cbAttribute
->
setEnabled
(
false
);
mainGame
->
cbRace
->
setEnabled
(
false
);
mainGame
->
ebAttack
->
setEnabled
(
false
);
mainGame
->
ebDefen
c
e
->
setEnabled
(
false
);
mainGame
->
ebDefen
s
e
->
setEnabled
(
false
);
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
mainGame
->
deckBuilder
.
filter_effect
=
0
;
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
...
...
gframe/replay.cpp
View file @
2f0b8df3
...
...
@@ -257,5 +257,8 @@ char Replay::ReadInt8() {
return
-
1
;
return
*
pdata
++
;
}
void
Replay
::
Rewind
()
{
pdata
=
replay_data
;
}
}
gframe/replay.h
View file @
2f0b8df3
...
...
@@ -41,6 +41,7 @@ public:
int
ReadInt32
();
short
ReadInt16
();
char
ReadInt8
();
void
Rewind
();
FILE
*
fp
;
ReplayHeader
pheader
;
...
...
gframe/replay_mode.cpp
View file @
2f0b8df3
...
...
@@ -14,8 +14,11 @@ bool ReplayMode::is_closing = false;
bool
ReplayMode
::
is_pausing
=
false
;
bool
ReplayMode
::
is_paused
=
false
;
bool
ReplayMode
::
is_swaping
=
false
;
bool
ReplayMode
::
is_restarting
=
false
;
bool
ReplayMode
::
exit_pending
=
false
;
int
ReplayMode
::
skip_turn
=
0
;
int
ReplayMode
::
current_step
=
0
;
int
ReplayMode
::
skip_step
=
0
;
bool
ReplayMode
::
StartReplay
(
int
skipturn
)
{
skip_turn
=
skipturn
;
...
...
@@ -52,7 +55,7 @@ bool ReplayMode::ReadReplayResponse() {
return
result
;
}
int
ReplayMode
::
ReplayThread
(
void
*
param
)
{
ReplayHeader
rh
=
cur_replay
.
pheader
;
const
ReplayHeader
&
rh
=
cur_replay
.
pheader
;
mainGame
->
dInfo
.
isFirst
=
true
;
mtrandom
rnd
;
int
seed
=
rh
.
seed
;
...
...
@@ -63,6 +66,8 @@ int ReplayMode::ReplayThread(void* param) {
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname_tag
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname
,
40
);
mainGame
->
dInfo
.
isTag
=
true
;
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
}
else
{
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
hostname
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname
,
40
);
...
...
@@ -81,29 +86,28 @@ int ReplayMode::ReplayThread(void* param) {
myswprintf
(
mainGame
->
dInfo
.
strLP
[
0
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
0
]);
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
strTurn
[
0
]
=
0
;
if
(
!
(
opt
&
DUEL_TAG_MODE
))
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
mainGame
->
dField
.
Initial
(
0
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
mainGame
->
dField
.
Initial
(
1
,
main
,
extra
);
}
else
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
mainGame
->
dField
.
Initial
(
0
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
...
...
@@ -113,10 +117,10 @@ int ReplayMode::ReplayThread(void* param) {
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
LOCATION_EXTRA
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
mainGame
->
dField
.
Initial
(
1
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
...
...
@@ -135,6 +139,8 @@ int ReplayMode::ReplayThread(void* param) {
char
engineBuffer
[
0x1000
];
is_continuing
=
true
;
exit_pending
=
false
;
current_step
=
0
;
skip_step
=
0
;
if
(
skip_turn
<
0
)
skip_turn
=
0
;
if
(
skip_turn
)
{
...
...
@@ -181,21 +187,130 @@ int ReplayMode::ReplayThread(void* param) {
}
return
0
;
}
void
ReplayMode
::
Restart
(
bool
refresh
)
{
end_duel
(
pduel
);
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dField
.
panel
=
0
;
mainGame
->
dField
.
hovered_card
=
0
;
mainGame
->
dField
.
clicked_card
=
0
;
mainGame
->
dField
.
Clear
();
//mainGame->device->setEventReceiver(&mainGame->dField);
cur_replay
.
Rewind
();
const
ReplayHeader
&
rh
=
cur_replay
.
pheader
;
//mainGame->dInfo.isFirst = true;
mtrandom
rnd
;
int
seed
=
rh
.
seed
;
rnd
.
reset
(
seed
);
if
(
rh
.
flag
&
REPLAY_TAG
)
{
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
hostname
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
hostname_tag
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname_tag
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname
,
40
);
mainGame
->
dInfo
.
isTag
=
true
;
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
}
else
{
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
hostname
,
40
);
cur_replay
.
ReadData
(
mainGame
->
dInfo
.
clientname
,
40
);
}
//set_card_reader((card_reader)DataManager::CardReader);
//set_message_handler((message_handler)MessageHandler);
pduel
=
create_duel
(
rnd
.
rand
());
int
start_lp
=
cur_replay
.
ReadInt32
();
int
start_hand
=
cur_replay
.
ReadInt32
();
int
draw_count
=
cur_replay
.
ReadInt32
();
int
opt
=
cur_replay
.
ReadInt32
();
set_player_info
(
pduel
,
0
,
start_lp
,
start_hand
,
draw_count
);
set_player_info
(
pduel
,
1
,
start_lp
,
start_hand
,
draw_count
);
mainGame
->
dInfo
.
lp
[
0
]
=
start_lp
;
mainGame
->
dInfo
.
lp
[
1
]
=
start_lp
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
0
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
0
]);
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
mainGame
->
dInfo
.
turn
=
0
;
if
(
!
(
opt
&
DUEL_TAG_MODE
))
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
0
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
1
,
main
,
extra
);
}
else
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
0
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
LOCATION_DECK
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
LOCATION_EXTRA
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
1
,
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
LOCATION_DECK
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
LOCATION_EXTRA
);
}
start_duel
(
pduel
,
opt
);
if
(
refresh
)
{
mainGame
->
dField
.
RefreshAllCards
();
mainGame
->
dInfo
.
isStarted
=
true
;
//mainGame->dInfo.isReplay = true;
}
skip_turn
=
0
;
is_restarting
=
true
;
}
void
ReplayMode
::
Undo
()
{
Restart
(
false
);
skip_step
=
current_step
-
1
;
if
(
skip_step
<
0
)
skip_step
=
0
;
current_step
=
0
;
if
(
skip_step
)
{
mainGame
->
dInfo
.
isReplaySkiping
=
true
;
mainGame
->
gMutex
.
Lock
();
Pause
(
false
,
false
);
}
else
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
}
bool
ReplayMode
::
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
)
{
char
*
offset
,
*
pbuf
=
msg
;
char
*
pbuf
=
msg
;
int
player
,
count
;
bool
pauseabl
e
;
is_restarting
=
fals
e
;
while
(
pbuf
-
msg
<
(
int
)
len
)
{
if
(
is_closing
)
return
false
;
if
(
is_restarting
)
{
is_restarting
=
false
;
return
true
;
}
if
(
is_swaping
)
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
ReplaySwap
();
mainGame
->
gMutex
.
Unlock
();
is_swaping
=
false
;
}
offset
=
pbuf
;
pauseable
=
true
;
char
*
offset
=
pbuf
;
bool
pauseable
=
true
;
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
switch
(
mainGame
->
dInfo
.
curMsg
)
{
case
MSG_RETRY
:
{
...
...
@@ -662,11 +777,24 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
break
;
}
}
if
(
pauseable
&&
is_pausing
)
{
is_paused
=
true
;
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
is_paused
=
false
;
if
(
pauseable
)
{
if
(
skip_step
)
{
skip_step
--
;
if
(
skip_step
==
0
)
{
Pause
(
true
,
false
);
mainGame
->
dInfo
.
isStarted
=
true
;
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
dField
.
RefreshAllCards
();
mainGame
->
gMutex
.
Unlock
();
}
}
if
(
is_pausing
)
{
is_paused
=
true
;
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
is_paused
=
false
;
}
current_step
++
;
}
}
return
true
;
...
...
gframe/replay_mode.h
View file @
2f0b8df3
...
...
@@ -17,8 +17,11 @@ private:
static
bool
is_pausing
;
static
bool
is_paused
;
static
bool
is_swaping
;
static
bool
is_restarting
;
static
bool
exit_pending
;
static
int
skip_turn
;
static
int
current_step
;
static
int
skip_step
;
public:
static
Replay
cur_replay
;
...
...
@@ -30,6 +33,8 @@ public:
static
void
Pause
(
bool
is_pause
,
bool
is_step
);
static
bool
ReadReplayResponse
();
static
int
ReplayThread
(
void
*
param
);
static
void
Restart
(
bool
refresh
);
static
void
Undo
();
static
bool
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
ReplayRefresh
(
int
flag
=
0x781fff
);
...
...
gframe/single_duel.cpp
View file @
2f0b8df3
...
...
@@ -474,22 +474,22 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
last_replay
.
Flush
();
last_replay
.
WriteInt32
(
pdeck
[
0
].
main
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
0
].
main
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
0
].
main
[
i
]
->
first
,
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
0
].
main
[
i
]
->
first
,
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
0
].
main
[
i
]
->
first
,
false
);
}
last_replay
.
WriteInt32
(
pdeck
[
0
].
extra
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
0
].
extra
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
0
].
extra
[
i
]
->
first
,
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
0
].
extra
[
i
]
->
first
,
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
0
].
extra
[
i
]
->
first
,
false
);
}
last_replay
.
WriteInt32
(
pdeck
[
1
].
main
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
1
].
main
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
1
].
main
[
i
]
->
first
,
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
1
].
main
[
i
]
->
first
,
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
1
].
main
[
i
]
->
first
,
false
);
}
last_replay
.
WriteInt32
(
pdeck
[
1
].
extra
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
1
].
extra
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
1
].
extra
[
i
]
->
first
,
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
1
].
extra
[
i
]
->
first
,
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
1
].
extra
[
i
]
->
first
,
false
);
}
last_replay
.
Flush
();
...
...
@@ -959,11 +959,19 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SWAP
:
{
int
c1
=
pbuf
[
4
];
int
l1
=
pbuf
[
5
];
int
s1
=
pbuf
[
6
];
int
c2
=
pbuf
[
12
];
int
l2
=
pbuf
[
13
];
int
s2
=
pbuf
[
14
];
pbuf
+=
16
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
RefreshSingle
(
c1
,
l1
,
s1
);
RefreshSingle
(
c2
,
l2
,
s2
);
break
;
}
case
MSG_FIELD_DISABLED
:
{
...
...
gframe/single_mode.cpp
View file @
2f0b8df3
...
...
@@ -47,7 +47,6 @@ int SingleMode::SinglePlayThread(void* param) {
BufferIO
::
CopyWStr
(
mainGame
->
ebNickName
->
getText
(),
mainGame
->
dInfo
.
hostname
,
20
);
mainGame
->
dInfo
.
clientname
[
0
]
=
0
;
mainGame
->
dInfo
.
turn
=
0
;
mainGame
->
dInfo
.
strTurn
[
0
]
=
0
;
if
(
!
preload_script
(
pduel
,
fname2
,
slen
))
{
end_duel
(
pduel
);
return
0
;
...
...
gframe/tag_duel.cpp
View file @
2f0b8df3
...
...
@@ -450,12 +450,12 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
//
last_replay
.
WriteInt32
(
pdeck
[
0
].
main
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
0
].
main
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
0
].
main
[
i
]
->
first
,
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
0
].
main
[
i
]
->
first
,
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
0
].
main
[
i
]
->
first
,
false
);
}
last_replay
.
WriteInt32
(
pdeck
[
0
].
extra
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
0
].
extra
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
0
].
extra
[
i
]
->
first
,
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
0
].
extra
[
i
]
->
first
,
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
0
].
extra
[
i
]
->
first
,
false
);
}
//
...
...
@@ -472,12 +472,12 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
//
last_replay
.
WriteInt32
(
pdeck
[
3
].
main
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
3
].
main
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
3
].
main
[
i
]
->
first
,
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
3
].
main
[
i
]
->
first
,
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
3
].
main
[
i
]
->
first
,
false
);
}
last_replay
.
WriteInt32
(
pdeck
[
3
].
extra
.
size
(),
false
);
for
(
int32
i
=
(
int32
)
pdeck
[
3
].
extra
.
size
()
-
1
;
i
>=
0
;
--
i
)
{
new_card
(
pduel
,
pdeck
[
3
].
extra
[
i
]
->
first
,
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
C
E
);
new_card
(
pduel
,
pdeck
[
3
].
extra
[
i
]
->
first
,
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFEN
S
E
);
last_replay
.
WriteInt32
(
pdeck
[
3
].
extra
[
i
]
->
first
,
false
);
}
//
...
...
@@ -932,6 +932,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SWAP
:
{
int
c1
=
pbuf
[
4
];
int
l1
=
pbuf
[
5
];
int
s1
=
pbuf
[
6
];
int
c2
=
pbuf
[
12
];
int
l2
=
pbuf
[
13
];
int
s2
=
pbuf
[
14
];
pbuf
+=
16
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -939,6 +945,8 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer
::
ReSendToPlayer
(
players
[
3
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
RefreshSingle
(
c1
,
l1
,
s1
);
RefreshSingle
(
c2
,
l2
,
s2
);
break
;
}
case
MSG_FIELD_DISABLED
:
{
...
...
ocgcore
@
8f6ed154
Subproject commit
db298072153b0ff5c0d287172681ca1f9c3a6a04
Subproject commit
8f6ed154785a9bac433feaffda147c1def53e708
script
@
9f812e23
Subproject commit
37f6152e1c5361511b6a2efc31c4019baad1df38
Subproject commit
9f812e233303463fc4f1b91e7764022a951882c1
strings.conf
View file @
2f0b8df3
...
...
@@ -279,6 +279,9 @@
!
system
1281
自定义
!
system
1290
忽略对方发言
!
system
1291
忽略观战者发言
!
system
1292
忽略时点
!
system
1293
显示时点
!
system
1294
可用时点
!
system
1300
禁限卡表:
!
system
1301
卡组列表:
!
system
1302
保存
...
...
@@ -287,6 +290,7 @@
!
system
1305
排序
!
system
1306
退出编辑
!
system
1307
打乱
!
system
1308
删除
!
system
1310
(无)
!
system
1311
种类:
!
system
1312
怪兽
...
...
@@ -303,8 +307,7 @@
!
system
1324
星数:
!
system
1325
关键字:
!
system
1326
效果
!
system
1327
重新搜索
!
system
1328
结果中搜索
!
system
1327
搜索
!
system
1329
系列:
!
system
1330
主卡组:
!
system
1331
额外卡组:
...
...
@@ -312,6 +315,9 @@
!
system
1333
搜索结果:
!
system
1334
副卡组更换完成
!
system
1335
保存成功
!
system
1336
刻度:
!
system
1337
是否删除这个卡组?
!
system
1338
删除成功
!
system
1340
是否保存录像?
!
system
1341
保存
!
system
1342
录像文件:
...
...
@@ -327,6 +333,12 @@
!
system
1352
主要信息:
!
system
1353
播放起始于回合:
!
system
1354
不显示卡片系列
!
system
1355
不显示询问连锁按钮
!
system
1360
上一步
!
system
1370
星数↑
!
system
1371
攻击↑
!
system
1372
守备↑
!
system
1373
名称↓
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
...
...
@@ -434,7 +446,7 @@
!
counter
0
x27
指示物(死亡蚊)
!
counter
0
x28
指示物(暗黑投射手)
!
counter
0
x29
指示物(气球蜥蜴)
!
counter
0
x2a
指示物(魔法防护器)
!
counter
0
x
10
2a
指示物(魔法防护器)
!
counter
0
x2b
命运指示物
!
counter
0
x2c
遵命指示物
!
counter
0
x2d
指示物(踢火)
...
...
@@ -449,6 +461,8 @@
!
counter
0
x36
娱乐法师指示物
!
counter
0
x37
大怪兽指示物
!
counter
0
x1038
方界指示物
!
counter
0
x1039
咕咚指示物
!
counter
0
x40
指示物(
No
.
51
怪腕之必杀摔角手)
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -641,6 +655,7 @@
!
setname
0
x92
纹章 メダリオン
!
setname
0
x93
电子 サイバー
!
setname
0
x1093
电子龙 サイバー・ドラゴン
!
setname
0
x2093
电子化天使 サイバー・エンジェル
!
setname
0
x94
电子科技 サイバネティック
!
setname
0
x95
升阶魔法
RUM
!
setname
0
x96
电子鱼人 フィッシュボーグ
...
...
@@ -662,7 +677,8 @@
!
setname
0
x20a2
魔术少女 マジシャン・ガール
!
setname
0
x30a2
黑魔术少女 ブラック・マジシャン・ガール
!
setname
0
xa3
星尘 スターダスト
!
setname
0
xa4
羽翼栗子球 ハネクリボー
!
setname
0
xa4
栗子球 クリボー
!
setname
0
x10a4
羽翼栗子球 ハネクリボー
!
setname
0
xa5
变化 チェンジ
!
setname
0
xa6
幼芽 スプラウト
!
setname
0
xa7
阿托利斯 アルトリウス
...
...
@@ -735,3 +751,7 @@
!
setname
0
xe2
三形金字塔 トラミッド
!
setname
0
xe3
方界
!
setname
0
xe4
精灵剑士 エルフの剣士
!
setname
0
xe5
光波 サイファー
!
setname
0
xe6
花札卫 花札衛
!
setname
0
xe7
沉默剑士 サイレント・ソードマン
!
setname
0
xe8
沉默魔术师 サイレント・マジシャン
system.conf
View file @
2f0b8df3
...
...
@@ -18,6 +18,7 @@ waitchain = 0
mute_opponent
=
0
mute_spectators
=
0
hide_setname
=
0
#control_mode = 0: Key A/S/R. control_mode = 1: MouseLeft/MouseRight/F9
hide_chain_button
=
0
#control_mode = 0: Key A/S/D/R. control_mode = 1: MouseLeft/MouseRight/NULL/F9
control_mode
=
0
draw_field_spell
=
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment