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
MobiusMei
ygopro
Commits
7501deec
Commit
7501deec
authored
Mar 26, 2021
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ClientField::SetResponseSelectedOption()
Now it store the index related to the option in another vector.
parent
091765ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+8
-7
No files found.
gframe/client_field.h
View file @
7501deec
...
...
@@ -42,6 +42,7 @@ public:
std
::
vector
<
ClientCard
*>
conti_cards
;
std
::
vector
<
std
::
pair
<
int
,
int
>>
activatable_descs
;
std
::
vector
<
int
>
select_options
;
std
::
vector
<
int
>
select_options_index
;
std
::
vector
<
ChainInfo
>
chains
;
int
extra_p_count
[
2
];
...
...
gframe/event_handler.cpp
View file @
7501deec
...
...
@@ -364,22 +364,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
ShowCancelOrFinishButton
(
0
);
if
(
!
list_command
)
{
int
index
=
-
1
;
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_descs
[
i
].
second
==
EDESC_OPERATION
)
continue
;
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
if
(
id
==
BUTTON_CMD_ACTIVATE
)
continue
;
}
else
{
if
(
id
==
BUTTON_CMD_RESET
)
continue
;
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
@@ -648,9 +649,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
if
(
list_command
==
COMMAND_ACTIVATE
||
list_command
==
COMMAND_OPERATION
)
{
int
index
=
-
1
;
command_card
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
mainGame
->
scrCardList
->
getPos
()
/
10
];
select_options
.
clear
();
select_options_index
.
clear
();
for
(
size_t
i
=
0
;
i
<
activatable_cards
.
size
();
++
i
)
{
if
(
activatable_cards
[
i
]
==
command_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
{
...
...
@@ -659,10 +660,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
list_command
==
COMMAND_OPERATION
)
continue
;
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
@@ -2412,8 +2414,7 @@ void ClientField::SetResponseSelectedOption() const {
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
DuelClient
::
SetResponseI
(
selected_option
);
}
else
{
int
index
=
0
;
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
int
index
=
select_options_index
[
selected_option
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
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