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
baichixing
ygopro
Commits
ca11c21b
Commit
ca11c21b
authored
May 07, 2019
by
mercury233
Committed by
GitHub
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add surrender confirm (#2144)
parent
8c4e6544
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
1 deletion
+37
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+4
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+14
-1
gframe/game.cpp
gframe/game.cpp
+9
-0
gframe/game.h
gframe/game.h
+7
-0
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+2
-0
strings.conf
strings.conf
+1
-0
No files found.
gframe/duelclient.cpp
View file @
ca11c21b
...
...
@@ -641,6 +641,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
wSurrender
->
setVisible
(
false
);
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -674,6 +675,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
case
STOC_REPLAY
:
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wSurrender
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
...
...
@@ -2272,6 +2274,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
mainGame
->
btnChainIgnore
->
setVisible
(
true
);
...
...
gframe/event_handler.cpp
View file @
ca11c21b
...
...
@@ -147,8 +147,19 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
}
else
{
mainGame
->
PopupElement
(
mainGame
->
wSurrender
);
}
break
;
}
case
BUTTON_SURRENDER_YES
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
break
;
}
case
BUTTON_SURRENDER_NO
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
break
;
}
case
BUTTON_CHAIN_IGNORE
:
{
...
...
@@ -1422,6 +1433,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
mainGame
->
fadingList
.
size
())
break
;
...
...
gframe/game.cpp
View file @
ca11c21b
...
...
@@ -385,6 +385,14 @@ bool Game::Initialize() {
stQMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
btnYes
=
env
->
addButton
(
rect
<
s32
>
(
100
,
105
,
150
,
130
),
wQuery
,
BUTTON_YES
,
dataManager
.
GetSysString
(
1213
));
btnNo
=
env
->
addButton
(
rect
<
s32
>
(
200
,
105
,
250
,
130
),
wQuery
,
BUTTON_NO
,
dataManager
.
GetSysString
(
1214
));
//surrender yes/no (310)
wSurrender
=
env
->
addWindow
(
rect
<
s32
>
(
490
,
200
,
840
,
340
),
false
,
dataManager
.
GetSysString
(
560
));
wSurrender
->
getCloseButton
()
->
setVisible
(
false
);
wSurrender
->
setVisible
(
false
);
stSurrenderMessage
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1359
),
rect
<
s32
>
(
20
,
20
,
350
,
100
),
false
,
true
,
wSurrender
,
-
1
,
false
);
stSurrenderMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
btnSurrenderYes
=
env
->
addButton
(
rect
<
s32
>
(
100
,
105
,
150
,
130
),
wSurrender
,
BUTTON_SURRENDER_YES
,
dataManager
.
GetSysString
(
1213
));
btnSurrenderNo
=
env
->
addButton
(
rect
<
s32
>
(
200
,
105
,
250
,
130
),
wSurrender
,
BUTTON_SURRENDER_NO
,
dataManager
.
GetSysString
(
1214
));
//options (310)
wOptions
=
env
->
addWindow
(
rect
<
s32
>
(
490
,
200
,
840
,
340
),
false
,
L""
);
wOptions
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -1458,6 +1466,7 @@ void Game::CloseDuelWindow() {
wPhase
->
setVisible
(
false
);
wPosSelect
->
setVisible
(
false
);
wQuery
->
setVisible
(
false
);
wSurrender
->
setVisible
(
false
);
wReplayControl
->
setVisible
(
false
);
wReplaySave
->
setVisible
(
false
);
stHintMsg
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
ca11c21b
...
...
@@ -381,6 +381,11 @@ public:
irr
::
gui
::
IGUIStaticText
*
stQMessage
;
irr
::
gui
::
IGUIButton
*
btnYes
;
irr
::
gui
::
IGUIButton
*
btnNo
;
//surrender yes/no
irr
::
gui
::
IGUIWindow
*
wSurrender
;
irr
::
gui
::
IGUIStaticText
*
stSurrenderMessage
;
irr
::
gui
::
IGUIButton
*
btnSurrenderYes
;
irr
::
gui
::
IGUIButton
*
btnSurrenderNo
;
//options
irr
::
gui
::
IGUIWindow
*
wOptions
;
irr
::
gui
::
IGUIStaticText
*
stOptions
;
...
...
@@ -655,6 +660,8 @@ extern Game* mainGame;
#define BUTTON_DISPLAY_4 294
#define SCROLL_CARD_DISPLAY 295
#define BUTTON_CARD_DISP_OK 296
#define BUTTON_SURRENDER_YES 297
#define BUTTON_SURRENDER_NO 298
#define COMBOBOX_DBLFLIST 301
#define COMBOBOX_DBDECKS 302
...
...
gframe/sound_manager.cpp
View file @
ca11c21b
...
...
@@ -181,6 +181,8 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
PlaySoundEffect
(
SOUND_INFO
);
}
else
if
(
element
==
mainGame
->
wQuery
)
{
PlaySoundEffect
(
SOUND_QUESTION
);
}
else
if
(
element
==
mainGame
->
wSurrender
)
{
PlaySoundEffect
(
SOUND_QUESTION
);
}
else
if
(
element
==
mainGame
->
wOptions
)
{
PlaySoundEffect
(
SOUND_QUESTION
);
}
else
if
(
element
==
mainGame
->
wANAttribute
)
{
...
...
strings.conf
View file @
ca11c21b
...
...
@@ -392,6 +392,7 @@
!
system
1356
是否要放弃对卡组的修改?
!
system
1357
不提示保留对卡组的修改
!
system
1358
键入关键字后自动进行搜索
!
system
1359
是否确定投降?
!
system
1360
上一步
!
system
1361
删除录像
!
system
1362
重命名
...
...
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