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
2f8dbc6c
Commit
2f8dbc6c
authored
Apr 28, 2021
by
salix5
Committed by
GitHub
Apr 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2337 from Fluorohydride/patch-selected-index
fix ClientField::SetResponseSelectedOption()
parents
356e05d4
7501deec
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 @
2f8dbc6c
...
@@ -42,6 +42,7 @@ public:
...
@@ -42,6 +42,7 @@ public:
std
::
vector
<
ClientCard
*>
conti_cards
;
std
::
vector
<
ClientCard
*>
conti_cards
;
std
::
vector
<
std
::
pair
<
int
,
int
>>
activatable_descs
;
std
::
vector
<
std
::
pair
<
int
,
int
>>
activatable_descs
;
std
::
vector
<
int
>
select_options
;
std
::
vector
<
int
>
select_options
;
std
::
vector
<
int
>
select_options_index
;
std
::
vector
<
ChainInfo
>
chains
;
std
::
vector
<
ChainInfo
>
chains
;
int
extra_p_count
[
2
];
int
extra_p_count
[
2
];
...
...
gframe/event_handler.cpp
View file @
2f8dbc6c
...
@@ -364,22 +364,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -364,22 +364,23 @@ 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
)
{
int
index
=
-
1
;
select_options
.
clear
();
select_options
.
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
]
==
clicked_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
continue
;
continue
;
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
if
(
id
==
BUTTON_CMD_ACTIVATE
)
continue
;
if
(
id
==
BUTTON_CMD_ACTIVATE
)
continue
;
}
else
{
}
else
{
if
(
id
==
BUTTON_CMD_RESET
)
continue
;
if
(
id
==
BUTTON_CMD_RESET
)
continue
;
}
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
}
}
if
(
select_options
.
size
()
==
1
)
{
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
@@ -648,9 +649,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -648,9 +649,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
if
(
list_command
==
COMMAND_ACTIVATE
||
list_command
==
COMMAND_OPERATION
)
{
if
(
list_command
==
COMMAND_ACTIVATE
||
list_command
==
COMMAND_OPERATION
)
{
int
index
=
-
1
;
command_card
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
mainGame
->
scrCardList
->
getPos
()
/
10
];
command_card
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
mainGame
->
scrCardList
->
getPos
()
/
10
];
select_options
.
clear
();
select_options
.
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
]
==
command_card
)
{
if
(
activatable_cards
[
i
]
==
command_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
{
...
@@ -659,10 +660,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -659,10 +660,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
list_command
==
COMMAND_OPERATION
)
continue
;
if
(
list_command
==
COMMAND_OPERATION
)
continue
;
}
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
}
}
if
(
select_options
.
size
()
==
1
)
{
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
@@ -2412,8 +2414,7 @@ void ClientField::SetResponseSelectedOption() const {
...
@@ -2412,8 +2414,7 @@ void ClientField::SetResponseSelectedOption() const {
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
DuelClient
::
SetResponseI
(
selected_option
);
DuelClient
::
SetResponseI
(
selected_option
);
}
else
{
}
else
{
int
index
=
0
;
int
index
=
select_options_index
[
selected_option
];
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
}
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