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
8ab5f3bc
Commit
8ab5f3bc
authored
May 02, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server
parents
280f72f4
2cedcbb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
15 deletions
+25
-15
gframe/client_field.cpp
gframe/client_field.cpp
+2
-0
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+22
-15
No files found.
gframe/client_field.cpp
View file @
8ab5f3bc
...
@@ -15,6 +15,7 @@ ClientField::ClientField() {
...
@@ -15,6 +15,7 @@ ClientField::ClientField() {
hovered_card
=
0
;
hovered_card
=
0
;
clicked_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
highlighting_card
=
0
;
menu_card
=
0
;
hovered_controler
=
0
;
hovered_controler
=
0
;
hovered_location
=
0
;
hovered_location
=
0
;
hovered_sequence
=
0
;
hovered_sequence
=
0
;
...
@@ -83,6 +84,7 @@ void ClientField::Clear() {
...
@@ -83,6 +84,7 @@ void ClientField::Clear() {
hovered_card
=
0
;
hovered_card
=
0
;
clicked_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
highlighting_card
=
0
;
menu_card
=
0
;
hovered_controler
=
0
;
hovered_controler
=
0
;
hovered_location
=
0
;
hovered_location
=
0
;
hovered_sequence
=
0
;
hovered_sequence
=
0
;
...
...
gframe/client_field.h
View file @
8ab5f3bc
...
@@ -132,6 +132,7 @@ public:
...
@@ -132,6 +132,7 @@ public:
ClientCard
*
clicked_card
;
ClientCard
*
clicked_card
;
ClientCard
*
command_card
;
ClientCard
*
command_card
;
ClientCard
*
highlighting_card
;
ClientCard
*
highlighting_card
;
ClientCard
*
menu_card
;
int
list_command
;
int
list_command
;
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
...
...
gframe/event_handler.cpp
View file @
8ab5f3bc
...
@@ -306,11 +306,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -306,11 +306,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
int
step
=
mainGame
->
scrOption
->
isVisible
()
?
mainGame
->
scrOption
->
getPos
()
:
0
;
int
step
=
mainGame
->
scrOption
->
isVisible
()
?
mainGame
->
scrOption
->
getPos
()
:
0
;
selected_option
=
id
-
BUTTON_OPTION_0
+
step
;
selected_option
=
id
-
BUTTON_OPTION_0
+
step
;
SetResponseSelectedOption
();
SetResponseSelectedOption
();
ShowCancelOrFinishButton
(
0
);
break
;
break
;
}
}
case
BUTTON_OPTION_OK
:
{
case
BUTTON_OPTION_OK
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
SetResponseSelectedOption
();
SetResponseSelectedOption
();
ShowCancelOrFinishButton
(
0
);
break
;
break
;
}
}
case
BUTTON_ANNUMBER_1
:
case
BUTTON_ANNUMBER_1
:
...
@@ -364,10 +366,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -364,10 +366,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
ShowCancelOrFinishButton
(
0
);
ShowCancelOrFinishButton
(
0
);
if
(
!
list_command
)
{
if
(
!
list_command
)
{
if
(
!
menu_card
)
break
;
select_options
.
clear
();
select_options
.
clear
();
select_options_index
.
clear
();
select_options_index
.
clear
();
for
(
size_t
i
=
0
;
i
<
activatable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
activatable_cards
.
size
();
++
i
)
{
if
(
activatable_cards
[
i
]
==
clicked
_card
)
{
if
(
activatable_cards
[
i
]
==
menu
_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
continue
;
continue
;
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
...
@@ -390,8 +394,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -390,8 +394,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
}
else
{
}
else
{
command_card
=
clicked
_card
;
command_card
=
menu
_card
;
ShowSelectOption
();
ShowSelectOption
();
select_ready
=
false
;
ShowCancelOrFinishButton
(
1
);
}
}
}
else
{
}
else
{
selectable_cards
.
clear
();
selectable_cards
.
clear
();
...
@@ -444,10 +450,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -444,10 +450,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_CMD_SUMMON
:
{
case
BUTTON_CMD_SUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
summonable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
summonable_cards
.
size
();
++
i
)
{
if
(
summonable_cards
[
i
]
==
clicked
_card
)
{
if
(
summonable_cards
[
i
]
==
menu
_card
)
{
ClearCommandFlag
();
ClearCommandFlag
();
DuelClient
::
SetResponseI
(
i
<<
16
);
DuelClient
::
SetResponseI
(
i
<<
16
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
...
@@ -459,10 +465,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -459,10 +465,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
BUTTON_CMD_SPSUMMON
:
{
case
BUTTON_CMD_SPSUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
list_command
)
{
if
(
!
list_command
)
{
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
spsummonable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
spsummonable_cards
.
size
();
++
i
)
{
if
(
spsummonable_cards
[
i
]
==
clicked
_card
)
{
if
(
spsummonable_cards
[
i
]
==
menu
_card
)
{
ClearCommandFlag
();
ClearCommandFlag
();
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
...
@@ -501,10 +507,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -501,10 +507,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_CMD_MSET
:
{
case
BUTTON_CMD_MSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
msetable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
msetable_cards
.
size
();
++
i
)
{
if
(
msetable_cards
[
i
]
==
clicked
_card
)
{
if
(
msetable_cards
[
i
]
==
menu
_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
3
);
DuelClient
::
SetResponseI
((
i
<<
16
)
+
3
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
break
;
break
;
...
@@ -514,10 +520,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -514,10 +520,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_CMD_SSET
:
{
case
BUTTON_CMD_SSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
ssetable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
ssetable_cards
.
size
();
++
i
)
{
if
(
ssetable_cards
[
i
]
==
clicked
_card
)
{
if
(
ssetable_cards
[
i
]
==
menu
_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
4
);
DuelClient
::
SetResponseI
((
i
<<
16
)
+
4
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
break
;
break
;
...
@@ -527,10 +533,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -527,10 +533,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_CMD_REPOS
:
{
case
BUTTON_CMD_REPOS
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
reposable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
reposable_cards
.
size
();
++
i
)
{
if
(
reposable_cards
[
i
]
==
clicked
_card
)
{
if
(
reposable_cards
[
i
]
==
menu
_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
2
);
DuelClient
::
SetResponseI
((
i
<<
16
)
+
2
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
break
;
break
;
...
@@ -540,10 +546,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -540,10 +546,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_CMD_ATTACK
:
{
case
BUTTON_CMD_ATTACK
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
break
;
for
(
size_t
i
=
0
;
i
<
attackable_cards
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
attackable_cards
.
size
();
++
i
)
{
if
(
attackable_cards
[
i
]
==
clicked
_card
)
{
if
(
attackable_cards
[
i
]
==
menu
_card
)
{
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
break
;
break
;
...
@@ -1556,7 +1562,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1556,7 +1562,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
SetShowMark
(
hovered_card
,
false
);
SetShowMark
(
hovered_card
,
false
);
}
}
if
(
mcard
)
{
if
(
mcard
)
{
if
(
mcard
!=
clicked
_card
)
if
(
mcard
!=
menu
_card
)
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
hovered_location
==
LOCATION_HAND
)
{
if
(
hovered_location
==
LOCATION_HAND
)
{
mcard
->
is_hovered
=
true
;
mcard
->
is_hovered
=
true
;
...
@@ -2245,6 +2251,7 @@ void ClientField::ShowMenu(int flag, int x, int y) {
...
@@ -2245,6 +2251,7 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
return
;
return
;
}
}
menu_card
=
clicked_card
;
int
height
=
1
;
int
height
=
1
;
int
offset
=
mainGame
->
gameConf
.
resize_popup_menu
?
((
mainGame
->
yScale
>=
0.666
)
?
21
*
mainGame
->
yScale
:
14
)
:
21
;
int
offset
=
mainGame
->
gameConf
.
resize_popup_menu
?
((
mainGame
->
yScale
>=
0.666
)
?
21
*
mainGame
->
yScale
:
14
)
:
21
;
if
(
flag
&
COMMAND_ACTIVATE
)
{
if
(
flag
&
COMMAND_ACTIVATE
)
{
...
...
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