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
YGOPRO-520DIY
ygopro
Commits
a75565fe
Commit
a75565fe
authored
Sep 30, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro
parents
7fcafa98
23f54dd0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
27 deletions
+192
-27
gframe/client_field.cpp
gframe/client_field.cpp
+83
-0
gframe/client_field.h
gframe/client_field.h
+6
-0
gframe/drawing.cpp
gframe/drawing.cpp
+13
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+20
-3
gframe/event_handler.cpp
gframe/event_handler.cpp
+62
-22
gframe/game.cpp
gframe/game.cpp
+1
-1
strings.conf
strings.conf
+7
-0
No files found.
gframe/client_field.cpp
View file @
a75565fe
...
@@ -32,6 +32,7 @@ ClientField::ClientField() {
...
@@ -32,6 +32,7 @@ ClientField::ClientField() {
conti_act
=
false
;
conti_act
=
false
;
deck_reversed
=
false
;
deck_reversed
=
false
;
conti_selecting
=
false
;
conti_selecting
=
false
;
cant_check_grave
=
false
;
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
mzone
[
p
].
resize
(
7
,
0
);
mzone
[
p
].
resize
(
7
,
0
);
szone
[
p
].
resize
(
8
,
0
);
szone
[
p
].
resize
(
8
,
0
);
...
@@ -99,6 +100,7 @@ void ClientField::Clear() {
...
@@ -99,6 +100,7 @@ void ClientField::Clear() {
pzone_act
[
1
]
=
false
;
pzone_act
[
1
]
=
false
;
conti_act
=
false
;
conti_act
=
false
;
deck_reversed
=
false
;
deck_reversed
=
false
;
cant_check_grave
=
false
;
RefreshCardCountDisplay
();
RefreshCardCountDisplay
();
}
}
void
ClientField
::
Initial
(
int
player
,
int
deckc
,
int
extrac
)
{
void
ClientField
::
Initial
(
int
player
,
int
deckc
,
int
extrac
)
{
...
@@ -396,6 +398,18 @@ void ClientField::ClearChainSelect() {
...
@@ -396,6 +398,18 @@ void ClientField::ClearChainSelect() {
}
}
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED
void
ClientField
::
ShowSelectCard
(
bool
buttonok
,
bool
chain
)
{
void
ClientField
::
ShowSelectCard
(
bool
buttonok
,
bool
chain
)
{
if
(
cant_check_grave
)
{
bool
has_card_in_grave
=
false
;
for
(
size_t
i
=
0
;
i
<
selectable_cards
.
size
();
++
i
)
{
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
{
has_card_in_grave
=
true
;
break
;
}
}
if
(
has_card_in_grave
)
{
std
::
random_shuffle
(
selectable_cards
.
begin
(),
selectable_cards
.
end
());
}
}
int
startpos
;
int
startpos
;
size_t
ct
;
size_t
ct
;
if
(
selectable_cards
.
size
()
<=
5
)
{
if
(
selectable_cards
.
size
()
<=
5
)
{
...
@@ -422,6 +436,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
...
@@ -422,6 +436,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
conti_selecting
)
if
(
conti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
overlayTarget
->
location
,
selectable_cards
[
i
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
overlayTarget
->
location
,
selectable_cards
[
i
]
->
overlayTarget
->
sequence
),
...
@@ -1245,6 +1261,27 @@ bool ClientField::CheckSelectSum() {
...
@@ -1245,6 +1261,27 @@ bool ClientField::CheckSelectSum() {
return
ret
;
return
ret
;
}
}
}
}
bool
ClientField
::
CheckSelectTribute
()
{
std
::
set
<
ClientCard
*>
selable
;
for
(
auto
sit
=
selectsum_all
.
begin
();
sit
!=
selectsum_all
.
end
();
++
sit
)
{
(
*
sit
)
->
is_selectable
=
false
;
(
*
sit
)
->
is_selected
=
false
;
selable
.
insert
(
*
sit
);
}
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
{
selected_cards
[
i
]
->
is_selectable
=
true
;
selected_cards
[
i
]
->
is_selected
=
true
;
selable
.
erase
(
selected_cards
[
i
]);
}
selectsum_cards
.
clear
();
bool
ret
=
check_sel_sum_trib_s
(
selable
,
0
,
0
);
selectable_cards
.
clear
();
for
(
auto
sit
=
selectsum_cards
.
begin
();
sit
!=
selectsum_cards
.
end
();
++
sit
)
{
(
*
sit
)
->
is_selectable
=
true
;
selectable_cards
.
push_back
(
*
sit
);
}
return
ret
;
}
bool
ClientField
::
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_iterator
index
,
int
min
,
int
max
)
{
bool
ClientField
::
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_iterator
index
,
int
min
,
int
max
)
{
if
(
index
==
left
.
end
())
if
(
index
==
left
.
end
())
return
false
;
return
false
;
...
@@ -1308,6 +1345,52 @@ bool ClientField::check_sum(std::set<ClientCard*>::const_iterator index, std::se
...
@@ -1308,6 +1345,52 @@ bool ClientField::check_sum(std::set<ClientCard*>::const_iterator index, std::se
||
(
l2
>
0
&&
acc
>
l2
&&
check_sum
(
index
,
end
,
acc
-
l2
,
count
+
1
))
||
(
l2
>
0
&&
acc
>
l2
&&
check_sum
(
index
,
end
,
acc
-
l2
,
count
+
1
))
||
check_sum
(
index
,
end
,
acc
,
count
);
||
check_sum
(
index
,
end
,
acc
,
count
);
}
}
bool
ClientField
::
check_sel_sum_trib_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
)
{
if
(
acc
>
select_max
)
return
false
;
if
(
index
==
(
int
)
selected_cards
.
size
())
{
check_sel_sum_trib_t
(
left
,
acc
);
return
acc
>=
select_min
&&
acc
<=
select_max
;
}
int
l
=
selected_cards
[
index
]
->
opParam
;
int
l1
=
l
&
0xffff
;
int
l2
=
l
>>
16
;
bool
res1
=
false
,
res2
=
false
;
res1
=
check_sel_sum_trib_s
(
left
,
index
+
1
,
acc
+
l1
);
if
(
l2
>
0
)
res2
=
check_sel_sum_trib_s
(
left
,
index
+
1
,
acc
+
l2
);
return
res1
||
res2
;
}
void
ClientField
::
check_sel_sum_trib_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
)
{
for
(
auto
sit
=
left
.
begin
();
sit
!=
left
.
end
();
++
sit
)
{
if
(
selectsum_cards
.
find
(
*
sit
)
!=
selectsum_cards
.
end
())
continue
;
std
::
set
<
ClientCard
*>
testlist
(
left
);
testlist
.
erase
(
*
sit
);
int
l
=
(
*
sit
)
->
opParam
;
int
l1
=
l
&
0xffff
;
int
l2
=
l
>>
16
;
if
(
check_sum_trib
(
testlist
.
begin
(),
testlist
.
end
(),
acc
+
l1
)
||
(
l2
>
0
&&
check_sum_trib
(
testlist
.
begin
(),
testlist
.
end
(),
acc
+
l2
)))
{
selectsum_cards
.
insert
(
*
sit
);
}
}
}
bool
ClientField
::
check_sum_trib
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
)
{
if
(
acc
>=
select_min
&&
acc
<=
select_max
)
return
true
;
if
(
acc
>
select_max
||
index
==
end
)
return
false
;
int
l
=
(
*
index
)
->
opParam
;
int
l1
=
l
&
0xffff
;
int
l2
=
l
>>
16
;
if
((
acc
+
l1
>=
select_min
&&
acc
+
l1
<=
select_max
)
||
(
acc
+
l2
>=
select_min
&&
acc
+
l2
<=
select_max
))
return
true
;
++
index
;
return
check_sum_trib
(
index
,
end
,
acc
+
l1
)
||
check_sum_trib
(
index
,
end
,
acc
+
l2
)
||
check_sum_trib
(
index
,
end
,
acc
);
}
template
<
class
T
>
template
<
class
T
>
static
bool
is_declarable
(
T
const
&
cd
,
const
std
::
vector
<
int
>&
opcode
)
{
static
bool
is_declarable
(
T
const
&
cd
,
const
std
::
vector
<
int
>&
opcode
)
{
std
::
stack
<
int
>
stack
;
std
::
stack
<
int
>
stack
;
...
...
gframe/client_field.h
View file @
a75565fe
...
@@ -83,6 +83,7 @@ public:
...
@@ -83,6 +83,7 @@ public:
bool
last_chain
;
bool
last_chain
;
bool
deck_reversed
;
bool
deck_reversed
;
bool
conti_selecting
;
bool
conti_selecting
;
bool
cant_check_grave
;
ClientField
();
ClientField
();
void
Clear
();
void
Clear
();
...
@@ -108,10 +109,14 @@ public:
...
@@ -108,10 +109,14 @@ public:
void
FadeCard
(
ClientCard
*
pcard
,
int
alpha
,
int
frame
);
void
FadeCard
(
ClientCard
*
pcard
,
int
alpha
,
int
frame
);
bool
ShowSelectSum
(
bool
panelmode
);
bool
ShowSelectSum
(
bool
panelmode
);
bool
CheckSelectSum
();
bool
CheckSelectSum
();
bool
CheckSelectTribute
();
bool
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_iterator
index
,
int
min
,
int
max
);
bool
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_iterator
index
,
int
min
,
int
max
);
bool
check_sel_sum_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
bool
check_sel_sum_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
void
check_sel_sum_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
void
check_sel_sum_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
bool
check_sum
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
,
int
count
);
bool
check_sum
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
,
int
count
);
bool
check_sel_sum_trib_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
void
check_sel_sum_trib_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
bool
check_sum_trib
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
);
void
UpdateDeclarableList
();
void
UpdateDeclarableList
();
...
@@ -153,5 +158,6 @@ public:
...
@@ -153,5 +158,6 @@ public:
//special cards
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
#define CARD_TWINKLE_MOSS 13857930
#define CARD_QUESTION 38723936
#endif //CLIENT_FIELD_H
#endif //CLIENT_FIELD_H
gframe/drawing.cpp
View file @
a75565fe
...
@@ -447,7 +447,7 @@ void Game::DrawShadowText(CGUITTFont * font, const core::stringw & text, const c
...
@@ -447,7 +447,7 @@ void Game::DrawShadowText(CGUITTFont * font, const core::stringw & text, const c
void
Game
::
DrawMisc
()
{
void
Game
::
DrawMisc
()
{
static
irr
::
core
::
vector3df
act_rot
(
0
,
0
,
0
);
static
irr
::
core
::
vector3df
act_rot
(
0
,
0
,
0
);
int
rule
=
(
dInfo
.
duel_rule
>=
4
)
?
1
:
0
;
int
rule
=
(
dInfo
.
duel_rule
>=
4
)
?
1
:
0
;
irr
::
core
::
matrix4
im
,
ic
,
it
;
irr
::
core
::
matrix4
im
,
ic
,
it
,
ig
;
act_rot
.
Z
+=
0.02
f
;
act_rot
.
Z
+=
0.02
f
;
im
.
setRotationRadians
(
act_rot
);
im
.
setRotationRadians
(
act_rot
);
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tAct
);
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tAct
);
...
@@ -531,6 +531,18 @@ void Game::DrawMisc() {
...
@@ -531,6 +531,18 @@ void Game::DrawMisc() {
driver
->
drawVertexPrimitiveList
(
matManager
.
vChainNum
,
4
,
matManager
.
iRectangle
,
2
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vChainNum
,
4
,
matManager
.
iRectangle
,
2
);
}
}
}
}
if
(
dField
.
cant_check_grave
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tNegated
);
driver
->
setMaterial
(
matManager
.
mTexture
);
ig
.
setTranslation
(
vector3df
((
matManager
.
vFieldGrave
[
0
][
rule
][
0
].
Pos
.
X
+
matManager
.
vFieldGrave
[
0
][
rule
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldGrave
[
0
][
rule
][
0
].
Pos
.
Y
+
matManager
.
vFieldGrave
[
0
][
rule
][
2
].
Pos
.
Y
)
/
2
,
dField
.
grave
[
0
].
size
()
*
0.01
f
+
0.02
f
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
ig
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vNegate
,
4
,
matManager
.
iRectangle
,
2
);
ig
.
setTranslation
(
vector3df
((
matManager
.
vFieldGrave
[
1
][
rule
][
0
].
Pos
.
X
+
matManager
.
vFieldGrave
[
1
][
rule
][
1
].
Pos
.
X
)
/
2
,
(
matManager
.
vFieldGrave
[
1
][
rule
][
0
].
Pos
.
Y
+
matManager
.
vFieldGrave
[
1
][
rule
][
2
].
Pos
.
Y
)
/
2
,
dField
.
grave
[
1
].
size
()
*
0.01
f
+
0.02
f
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
ig
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vNegate
,
4
,
matManager
.
iRectangle
,
2
);
}
//finish button
//finish button
if
(
btnCancelOrFinish
->
isVisible
()
&&
dField
.
select_ready
)
if
(
btnCancelOrFinish
->
isVisible
()
&&
dField
.
select_ready
)
DrawSelectionLine
(
btnCancelOrFinish
,
2
,
0xffffff00
);
DrawSelectionLine
(
btnCancelOrFinish
,
2
,
0xffffff00
);
...
...
gframe/duelclient.cpp
View file @
a75565fe
...
@@ -1875,7 +1875,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1875,7 +1875,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
case
MSG_SELECT_DISFIELD
:
{
int
selecting_player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
selecting_player
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_min
=
count
>
0
?
count
:
1
;
mainGame
->
dField
.
select_ready
=
false
;
mainGame
->
dField
.
select_cancelable
=
count
==
0
;
mainGame
->
dField
.
selectable_field
=
~
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
selectable_field
=
~
BufferIO
::
ReadInt32
(
pbuf
);
if
(
selecting_player
==
mainGame
->
LocalPlayer
(
1
))
if
(
selecting_player
==
mainGame
->
LocalPlayer
(
1
))
mainGame
->
dField
.
selectable_field
=
(
mainGame
->
dField
.
selectable_field
>>
16
)
|
(
mainGame
->
dField
.
selectable_field
<<
16
);
mainGame
->
dField
.
selectable_field
=
(
mainGame
->
dField
.
selectable_field
>>
16
)
|
(
mainGame
->
dField
.
selectable_field
<<
16
);
...
@@ -1950,6 +1953,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1950,6 +1953,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
return
true
;
return
true
;
}
}
if
(
mainGame
->
dField
.
select_cancelable
)
{
mainGame
->
dField
.
ShowCancelOrFinishButton
(
1
);
}
return
false
;
return
false
;
}
}
case
MSG_SELECT_POSITION
:
{
case
MSG_SELECT_POSITION
:
{
...
@@ -2003,6 +2009,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2003,6 +2009,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
selectsum_all
.
clear
();
mainGame
->
dField
.
selectsum_cards
.
clear
();
mainGame
->
dField
.
select_panalmode
=
false
;
mainGame
->
dField
.
select_panalmode
=
false
;
int
c
,
l
,
s
,
t
;
int
c
,
l
,
s
,
t
;
unsigned
int
code
;
unsigned
int
code
;
...
@@ -2018,10 +2026,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2018,10 +2026,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
code
&&
pcard
->
code
!=
code
)
if
(
code
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
mainGame
->
dField
.
selectable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
selectable_cards
.
push_back
(
pcard
);
pcard
->
opParam
=
t
;
mainGame
->
dField
.
selectsum_all
.
push_back
(
pcard
);
pcard
->
opParam
=
t
<<
16
|
1
;
pcard
->
select_seq
=
i
;
pcard
->
select_seq
=
i
;
pcard
->
is_selectable
=
true
;
pcard
->
is_selectable
=
true
;
}
}
mainGame
->
dField
.
CheckSelectTribute
();
if
(
select_hint
)
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetDesc
(
select_hint
),
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetDesc
(
select_hint
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
...
@@ -3880,7 +3890,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3880,7 +3890,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
if
(
chtype
==
PHINT_DESC_ADD
)
{
if
(
value
==
CARD_QUESTION
&&
player
==
0
)
{
/* if(chtype == PHINT_DESC_ADD) { // KoishiPro disables this
mainGame->dField.cant_check_grave = true;
} else if(chtype == PHINT_DESC_REMOVE) {
mainGame->dField.cant_check_grave = false;
}*/
}
else
if
(
chtype
==
PHINT_DESC_ADD
)
{
player_desc_hints
[
value
]
++
;
player_desc_hints
[
value
]
++
;
}
else
if
(
chtype
==
PHINT_DESC_REMOVE
)
{
}
else
if
(
chtype
==
PHINT_DESC_REMOVE
)
{
player_desc_hints
[
value
]
--
;
player_desc_hints
[
value
]
--
;
...
...
gframe/event_handler.cpp
View file @
a75565fe
...
@@ -905,6 +905,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -905,6 +905,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
else
{
}
else
{
if
(
conti_selecting
)
if
(
conti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
location
,
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
location
,
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
),
...
@@ -1207,6 +1209,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1207,6 +1209,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
LOCATION_GRAVE
:
{
case
LOCATION_GRAVE
:
{
if
(
grave
[
hovered_controler
].
size
()
==
0
)
if
(
grave
[
hovered_controler
].
size
()
==
0
)
break
;
break
;
if
(
cant_check_grave
)
break
;
ShowMenu
(
COMMAND_LIST
,
x
,
y
);
ShowMenu
(
COMMAND_LIST
,
x
,
y
);
break
;
break
;
}
}
...
@@ -1257,6 +1261,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1257,6 +1261,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
int
command_flag
=
0
;
int
command_flag
=
0
;
if
(
grave
[
hovered_controler
].
size
()
==
0
)
if
(
grave
[
hovered_controler
].
size
()
==
0
)
break
;
break
;
if
(
cant_check_grave
)
break
;
for
(
size_t
i
=
0
;
i
<
grave
[
hovered_controler
].
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
grave
[
hovered_controler
].
size
();
++
i
)
command_flag
|=
grave
[
hovered_controler
][
i
]
->
cmdFlag
;
command_flag
|=
grave
[
hovered_controler
][
i
]
->
cmdFlag
;
command_flag
|=
COMMAND_LIST
;
command_flag
|=
COMMAND_LIST
;
...
@@ -1353,16 +1359,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1353,16 +1359,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
selected_field
=
0
;
selected_field
=
0
;
DuelClient
::
SetResponseB
(
respbuf
,
p
);
DuelClient
::
SetResponseB
(
respbuf
,
p
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
ShowCancelOrFinishButton
(
0
);
}
}
}
}
}
}
break
;
break
;
}
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_CARD
:
{
case
MSG_SELECT_TRIBUTE
:
{
if
(
!
(
hovered_location
&
0xe
)
||
!
clicked_card
||
!
clicked_card
->
is_selectable
)
if
(
!
(
hovered_location
&
0xe
)
||
!
clicked_card
||
!
clicked_card
->
is_selectable
)
break
;
break
;
if
(
clicked_card
->
is_selected
)
{
if
(
clicked_card
->
is_selected
)
{
clicked_card
->
is_selected
=
false
;
clicked_card
->
is_selected
=
false
;
int
i
=
0
;
int
i
=
0
;
while
(
selected_cards
[
i
]
!=
clicked_card
)
i
++
;
while
(
selected_cards
[
i
]
!=
clicked_card
)
i
++
;
...
@@ -1371,18 +1377,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1371,18 +1377,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
clicked_card
->
is_selected
=
true
;
clicked_card
->
is_selected
=
true
;
selected_cards
.
push_back
(
clicked_card
);
selected_cards
.
push_back
(
clicked_card
);
}
}
int
min
=
selected_cards
.
size
(),
max
=
0
;
if
(
selected_cards
.
size
()
>=
select_max
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_CARD
)
{
max
=
selected_cards
.
size
();
}
else
{
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
max
+=
selected_cards
[
i
]
->
opParam
;
}
if
(
min
>=
select_max
)
{
SetResponseSelectedCards
();
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
ShowCancelOrFinishButton
(
0
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
}
else
if
(
max
>=
select_min
)
{
}
else
if
(
selected_cards
.
size
()
>=
select_min
)
{
if
(
selected_cards
.
size
()
==
selectable_cards
.
size
())
{
if
(
selected_cards
.
size
()
==
selectable_cards
.
size
())
{
SetResponseSelectedCards
();
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
ShowCancelOrFinishButton
(
0
);
...
@@ -1390,18 +1389,37 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1390,18 +1389,37 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
else
{
}
else
{
select_ready
=
true
;
select_ready
=
true
;
ShowCancelOrFinishButton
(
2
);
ShowCancelOrFinishButton
(
2
);
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_TRIBUTE
)
{
wchar_t
wbuf
[
256
],
*
pwbuf
=
wbuf
;
BufferIO
::
CopyWStrRef
(
dataManager
.
GetSysString
(
209
),
pwbuf
,
256
);
*
pwbuf
++
=
L'\n'
;
BufferIO
::
CopyWStrRef
(
dataManager
.
GetSysString
(
210
),
pwbuf
,
256
);
mainGame
->
stQMessage
->
setText
(
wbuf
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
}
}
}
}
else
{
}
else
{
select_ready
=
false
;
select_ready
=
false
;
if
(
select_cancelable
&&
min
==
0
)
if
(
select_cancelable
&&
selected_cards
.
size
()
==
0
)
ShowCancelOrFinishButton
(
1
);
else
ShowCancelOrFinishButton
(
0
);
}
break
;
}
case
MSG_SELECT_TRIBUTE
:
{
if
(
!
(
hovered_location
&
0xe
)
||
!
clicked_card
||
!
clicked_card
->
is_selectable
)
break
;
if
(
clicked_card
->
is_selected
)
{
auto
it
=
std
::
find
(
selected_cards
.
begin
(),
selected_cards
.
end
(),
clicked_card
);
selected_cards
.
erase
(
it
);
}
else
{
selected_cards
.
push_back
(
clicked_card
);
}
if
(
CheckSelectTribute
())
{
if
(
selectsum_cards
.
size
()
==
0
)
{
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
DuelClient
::
SendResponse
();
}
else
{
select_ready
=
true
;
ShowCancelOrFinishButton
(
2
);
}
}
else
{
select_ready
=
false
;
if
(
select_cancelable
&&
selected_cards
.
size
()
==
0
)
ShowCancelOrFinishButton
(
1
);
ShowCancelOrFinishButton
(
1
);
else
else
ShowCancelOrFinishButton
(
0
);
ShowCancelOrFinishButton
(
0
);
...
@@ -1748,6 +1766,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1748,6 +1766,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
display_cards
.
clear
();
display_cards
.
clear
();
switch
(
event
.
KeyInput
.
Key
)
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_F1
:
case
irr
:
:
KEY_F1
:
if
(
cant_check_grave
)
break
;
loc_id
=
1004
;
loc_id
=
1004
;
for
(
auto
it
=
grave
[
0
].
rbegin
();
it
!=
grave
[
0
].
rend
();
++
it
)
for
(
auto
it
=
grave
[
0
].
rbegin
();
it
!=
grave
[
0
].
rend
();
++
it
)
display_cards
.
push_back
(
*
it
);
display_cards
.
push_back
(
*
it
);
...
@@ -1772,6 +1792,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1772,6 +1792,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
break
;
break
;
case
irr
:
:
KEY_F5
:
case
irr
:
:
KEY_F5
:
if
(
cant_check_grave
)
break
;
loc_id
=
1004
;
loc_id
=
1004
;
for
(
auto
it
=
grave
[
1
].
rbegin
();
it
!=
grave
[
1
].
rend
();
++
it
)
for
(
auto
it
=
grave
[
1
].
rbegin
();
it
!=
grave
[
1
].
rend
();
++
it
)
display_cards
.
push_back
(
*
it
);
display_cards
.
push_back
(
*
it
);
...
@@ -2583,6 +2605,11 @@ void ClientField::CancelOrFinish() {
...
@@ -2583,6 +2605,11 @@ void ClientField::CancelOrFinish() {
mainGame
->
HideElement
(
mainGame
->
wQuery
,
true
);
mainGame
->
HideElement
(
mainGame
->
wQuery
,
true
);
break
;
break
;
}
}
if
(
select_ready
)
{
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
DuelClient
::
SendResponse
();
}
break
;
break
;
}
}
case
MSG_SELECT_SUM
:
{
case
MSG_SELECT_SUM
:
{
...
@@ -2623,6 +2650,19 @@ void ClientField::CancelOrFinish() {
...
@@ -2623,6 +2650,19 @@ void ClientField::CancelOrFinish() {
}
}
break
;
break
;
}
}
case
MSG_SELECT_PLACE
:
{
if
(
select_cancelable
)
{
unsigned
char
respbuf
[
3
];
respbuf
[
0
]
=
mainGame
->
LocalPlayer
(
0
);
respbuf
[
1
]
=
0
;
respbuf
[
2
]
=
0
;
mainGame
->
dField
.
selectable_field
=
0
;
DuelClient
::
SetResponseB
(
respbuf
,
3
);
DuelClient
::
SendResponse
();
ShowCancelOrFinishButton
(
0
);
}
break
;
}
}
}
}
}
}
}
gframe/game.cpp
View file @
a75565fe
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include <sstream>
#include <sstream>
#include <regex>
#include <regex>
unsigned
short
PRO_VERSION
=
0x135
1
;
unsigned
short
PRO_VERSION
=
0x135
2
;
namespace
ygo
{
namespace
ygo
{
...
...
strings.conf
View file @
a75565fe
...
@@ -1068,3 +1068,10 @@
...
@@ -1068,3 +1068,10 @@
!
setname
0
x14e
电脑堺 電脳堺
!
setname
0
x14e
电脑堺 電脳堺
!
setname
0
x114e
电脑堺门 電脳堺門
!
setname
0
x114e
电脑堺门 電脳堺門
!
setname
0
x14f
双天
!
setname
0
x14f
双天
!
setname
0
x150
大贤者 マギストス
#setname 0x151 双子 Twin
!
setname
0
x1151
直播☆双子
Live
☆
Twin
!
setname
0
x2151
邪恶★双子
Evil
★
Twin
!
setname
0
x152
姬丝基勒 キスキル
!
setname
0
x153
璃拉 リィラ
!
setname
0
x154
龙辉巧 ドライトロン
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