Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
fef019ac
Commit
fef019ac
authored
Sep 10, 2016
by
独孤朲
Committed by
GitHub
Sep 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1836 from mercury233/patch-cancel-button
add button for cancel or finish selecting
parents
9c69a7a8
62674b86
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
218 additions
and
3 deletions
+218
-3
gframe/client_field.cpp
gframe/client_field.cpp
+7
-0
gframe/client_field.h
gframe/client_field.h
+2
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+10
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+190
-1
gframe/game.cpp
gframe/game.cpp
+4
-0
gframe/game.h
gframe/game.h
+3
-1
strings.conf
strings.conf
+2
-0
No files found.
gframe/client_field.cpp
View file @
fef019ac
...
@@ -1131,6 +1131,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
...
@@ -1131,6 +1131,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
if
(
CheckSelectSum
())
{
if
(
CheckSelectSum
())
{
if
(
selectsum_cards
.
size
()
==
0
||
selectable_cards
.
size
()
==
0
)
{
if
(
selectsum_cards
.
size
()
==
0
||
selectable_cards
.
size
()
==
0
)
{
SetResponseSelectedCards
();
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
if
(
mainGame
->
wCardSelect
->
isVisible
())
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
else
{
else
{
...
@@ -1151,6 +1152,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
...
@@ -1151,6 +1152,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
if
(
CheckSelectSum
())
{
if
(
CheckSelectSum
())
{
if
(
selectsum_cards
.
size
()
==
0
||
selectable_cards
.
size
()
==
0
)
{
if
(
selectsum_cards
.
size
()
==
0
||
selectable_cards
.
size
()
==
0
)
{
SetResponseSelectedCards
();
SetResponseSelectedCards
();
ShowCancelOrFinishButton
(
0
);
DuelClient
::
SendResponse
();
DuelClient
::
SendResponse
();
return
true
;
return
true
;
}
else
{
}
else
{
...
@@ -1165,6 +1167,11 @@ bool ClientField::ShowSelectSum(bool panelmode) {
...
@@ -1165,6 +1167,11 @@ bool ClientField::ShowSelectSum(bool panelmode) {
}
else
}
else
select_ready
=
false
;
select_ready
=
false
;
}
}
if
(
select_ready
)
{
ShowCancelOrFinishButton
(
1
);
}
else
{
ShowCancelOrFinishButton
(
0
);
}
return
false
;
return
false
;
}
}
bool
ClientField
::
CheckSelectSum
()
{
bool
ClientField
::
CheckSelectSum
()
{
...
...
gframe/client_field.h
View file @
fef019ac
...
@@ -126,7 +126,8 @@ public:
...
@@ -126,7 +126,8 @@ public:
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
void
GetHoverField
(
int
x
,
int
y
);
void
GetHoverField
(
int
x
,
int
y
);
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
void
UpdateChainButtons
();
void
UpdateChainButtons
();
void
ShowCancelOrFinishButton
(
int
buttonOp
);
void
SetResponseSelectedCards
()
const
;
void
SetResponseSelectedCards
()
const
;
};
};
...
...
gframe/duelclient.cpp
View file @
fef019ac
...
@@ -288,6 +288,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -288,6 +288,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
mainGame
->
deckBuilder
.
results
.
clear
();
...
@@ -510,6 +511,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -510,6 +511,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
...
@@ -539,6 +541,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -539,6 +541,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
time_t
nowtime
=
time
(
NULL
);
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
char
timebuf
[
40
];
...
@@ -1179,6 +1182,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1179,6 +1182,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
}
}
if
(
mainGame
->
dField
.
select_cancelable
)
{
mainGame
->
dField
.
ShowCancelOrFinishButton
(
1
);
}
return
false
;
return
false
;
}
}
case
MSG_SELECT_CHAIN
:
{
case
MSG_SELECT_CHAIN
:
{
...
@@ -1412,6 +1418,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1412,6 +1418,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setText
(
textBuffer
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
mainGame
->
stHintMsg
->
setVisible
(
true
);
if
(
mainGame
->
dField
.
select_cancelable
)
{
mainGame
->
dField
.
ShowCancelOrFinishButton
(
1
);
}
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
return
false
;
return
false
;
}
}
...
@@ -1875,6 +1884,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1875,6 +1884,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
}
}
}
}
if
(
mainGame
->
dInfo
.
isTag
&&
mainGame
->
dInfo
.
turn
!=
1
)
{
if
(
mainGame
->
dInfo
.
isTag
&&
mainGame
->
dInfo
.
turn
!=
1
)
{
...
...
gframe/event_handler.cpp
View file @
fef019ac
This diff is collapsed.
Click to expand it.
gframe/game.cpp
View file @
fef019ac
...
@@ -541,6 +541,9 @@ bool Game::Initialize() {
...
@@ -541,6 +541,9 @@ bool Game::Initialize() {
btnChainIgnore
->
setVisible
(
false
);
btnChainIgnore
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
//cancel or finish
btnCancelOrFinish
=
env
->
addButton
(
rect
<
s32
>
(
205
,
230
,
295
,
265
),
0
,
BUTTON_CANCEL_OR_FINISH
,
dataManager
.
GetSysString
(
1295
));
btnCancelOrFinish
->
setVisible
(
false
);
//leave/surrender/exit
//leave/surrender/exit
btnLeaveGame
=
env
->
addButton
(
rect
<
s32
>
(
205
,
5
,
295
,
80
),
0
,
BUTTON_LEAVE_GAME
,
L""
);
btnLeaveGame
=
env
->
addButton
(
rect
<
s32
>
(
205
,
5
,
295
,
80
),
0
,
BUTTON_LEAVE_GAME
,
L""
);
btnLeaveGame
->
setVisible
(
false
);
btnLeaveGame
->
setVisible
(
false
);
...
@@ -1122,6 +1125,7 @@ void Game::CloseDuelWindow() {
...
@@ -1122,6 +1125,7 @@ void Game::CloseDuelWindow() {
btnChainIgnore
->
setVisible
(
false
);
btnChainIgnore
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnCancelOrFinish
->
setVisible
(
false
);
wChat
->
setVisible
(
false
);
wChat
->
setVisible
(
false
);
lstLog
->
clear
();
lstLog
->
clear
();
logParam
.
clear
();
logParam
.
clear
();
...
...
gframe/game.h
View file @
fef019ac
...
@@ -395,7 +395,8 @@ public:
...
@@ -395,7 +395,8 @@ public:
irr
::
gui
::
IGUIButton
*
btnChainIgnore
;
irr
::
gui
::
IGUIButton
*
btnChainIgnore
;
irr
::
gui
::
IGUIButton
*
btnChainAlways
;
irr
::
gui
::
IGUIButton
*
btnChainAlways
;
irr
::
gui
::
IGUIButton
*
btnChainWhenAvail
;
irr
::
gui
::
IGUIButton
*
btnChainWhenAvail
;
//cancel or finish
irr
::
gui
::
IGUIButton
*
btnCancelOrFinish
;
};
};
extern
Game
*
mainGame
;
extern
Game
*
mainGame
;
...
@@ -486,6 +487,7 @@ extern Game* mainGame;
...
@@ -486,6 +487,7 @@ extern Game* mainGame;
#define BUTTON_CHAIN_IGNORE 264
#define BUTTON_CHAIN_IGNORE 264
#define BUTTON_CHAIN_ALWAYS 265
#define BUTTON_CHAIN_ALWAYS 265
#define BUTTON_CHAIN_WHENAVAIL 266
#define BUTTON_CHAIN_WHENAVAIL 266
#define BUTTON_CANCEL_OR_FINISH 267
#define BUTTON_CLEAR_LOG 270
#define BUTTON_CLEAR_LOG 270
#define LISTBOX_LOG 271
#define LISTBOX_LOG 271
#define SCROLL_CARDTEXT 280
#define SCROLL_CARDTEXT 280
...
...
strings.conf
View file @
fef019ac
...
@@ -286,6 +286,8 @@
...
@@ -286,6 +286,8 @@
!
system
1292
忽略时点
!
system
1292
忽略时点
!
system
1293
显示时点
!
system
1293
显示时点
!
system
1294
可用时点
!
system
1294
可用时点
!
system
1295
取消操作
!
system
1296
完成选择
!
system
1300
禁限卡表:
!
system
1300
禁限卡表:
!
system
1301
卡组列表:
!
system
1301
卡组列表:
!
system
1302
保存
!
system
1302
保存
...
...
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