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
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
Commits
1227e78f
Commit
1227e78f
authored
Dec 06, 2022
by
mercury233
Committed by
GitHub
Dec 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fail hint (#2472)
* add deck not selected hint * add create host fail hint
parent
022914dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+26
-3
No files found.
gframe/menu_handler.cpp
View file @
1227e78f
...
@@ -126,10 +126,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -126,10 +126,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case
BUTTON_HOST_CONFIRM
:
{
case
BUTTON_HOST_CONFIRM
:
{
bot_mode
=
false
;
bot_mode
=
false
;
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
mainGame
->
btnHostConfirm
->
setEnabled
(
false
);
mainGame
->
btnHostConfirm
->
setEnabled
(
false
);
...
@@ -169,6 +174,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -169,6 +174,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case
BUTTON_HP_READY
:
{
case
BUTTON_HP_READY
:
{
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
mainGame
->
gMutex
.
lock
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1406
));
mainGame
->
gMutex
.
unlock
();
break
;
break
;
}
}
UpdateDeck
();
UpdateDeck
();
...
@@ -323,10 +332,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -323,10 +332,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
bot_mode
=
true
;
bot_mode
=
true
;
#ifdef _WIN32
#ifdef _WIN32
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
STARTUPINFOW
si
;
STARTUPINFOW
si
;
...
@@ -373,10 +387,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -373,10 +387,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
NULL
);
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
NULL
);
exit
(
0
);
exit
(
0
);
}
else
{
}
else
{
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
}
}
...
@@ -607,7 +626,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -607,7 +626,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
if
(
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
isChecked
())
{
if
(
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
isChecked
())
{
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
mainGame
->
gMutex
.
lock
();
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
setChecked
(
false
);
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
setChecked
(
false
);
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1406
));
mainGame
->
gMutex
.
unlock
();
break
;
break
;
}
}
UpdateDeck
();
UpdateDeck
();
...
...
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