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
nanahira
ygopro
Commits
2cedcbb9
Commit
2cedcbb9
authored
May 02, 2021
by
mercury233
Committed by
GitHub
May 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix card showing popup menu may be inaccurate (#2342)
parent
05d362b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
15 deletions
+21
-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
+18
-15
No files found.
gframe/client_field.cpp
View file @
2cedcbb9
...
...
@@ -15,6 +15,7 @@ ClientField::ClientField() {
hovered_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
menu_card
=
0
;
hovered_controler
=
0
;
hovered_location
=
0
;
hovered_sequence
=
0
;
...
...
@@ -83,6 +84,7 @@ void ClientField::Clear() {
hovered_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
menu_card
=
0
;
hovered_controler
=
0
;
hovered_location
=
0
;
hovered_sequence
=
0
;
...
...
gframe/client_field.h
View file @
2cedcbb9
...
...
@@ -132,6 +132,7 @@ public:
ClientCard
*
clicked_card
;
ClientCard
*
command_card
;
ClientCard
*
highlighting_card
;
ClientCard
*
menu_card
;
int
list_command
;
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
...
...
gframe/event_handler.cpp
View file @
2cedcbb9
...
...
@@ -366,10 +366,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
ShowCancelOrFinishButton
(
0
);
if
(
!
list_command
)
{
if
(
!
menu_card
)
break
;
select_options
.
clear
();
select_options_index
.
clear
();
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
)
continue
;
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
...
...
@@ -392,7 +394,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
DuelClient
::
SendResponse
();
}
else
{
command_card
=
clicked
_card
;
command_card
=
menu
_card
;
ShowSelectOption
();
select_ready
=
false
;
ShowCancelOrFinishButton
(
1
);
...
...
@@ -448,10 +450,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_SUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
for
(
size_t
i
=
0
;
i
<
summonable_cards
.
size
();
++
i
)
{
if
(
summonable_cards
[
i
]
==
clicked
_card
)
{
if
(
summonable_cards
[
i
]
==
menu
_card
)
{
ClearCommandFlag
();
DuelClient
::
SetResponseI
(
i
<<
16
);
DuelClient
::
SendResponse
();
...
...
@@ -463,10 +465,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
BUTTON_CMD_SPSUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
list_command
)
{
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
for
(
size_t
i
=
0
;
i
<
spsummonable_cards
.
size
();
++
i
)
{
if
(
spsummonable_cards
[
i
]
==
clicked
_card
)
{
if
(
spsummonable_cards
[
i
]
==
menu
_card
)
{
ClearCommandFlag
();
DuelClient
::
SetResponseI
((
i
<<
16
)
+
1
);
DuelClient
::
SendResponse
();
...
...
@@ -505,10 +507,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_MSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
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
::
SendResponse
();
break
;
...
...
@@ -518,10 +520,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_SSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
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
::
SendResponse
();
break
;
...
...
@@ -531,10 +533,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_REPOS
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
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
::
SendResponse
();
break
;
...
...
@@ -544,10 +546,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_ATTACK
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
!
clicked
_card
)
if
(
!
menu
_card
)
break
;
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
::
SendResponse
();
break
;
...
...
@@ -1560,7 +1562,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
SetShowMark
(
hovered_card
,
false
);
}
if
(
mcard
)
{
if
(
mcard
!=
clicked
_card
)
if
(
mcard
!=
menu
_card
)
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
hovered_location
==
LOCATION_HAND
)
{
mcard
->
is_hovered
=
true
;
...
...
@@ -2249,6 +2251,7 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
return
;
}
menu_card
=
clicked_card
;
int
height
=
1
;
int
offset
=
mainGame
->
gameConf
.
resize_popup_menu
?
((
mainGame
->
yScale
>=
0.666
)
?
21
*
mainGame
->
yScale
:
14
)
:
21
;
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