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
856b9985
Commit
856b9985
authored
Nov 21, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui update
parent
ac41c27e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
36 deletions
+140
-36
gframe/config.h
gframe/config.h
+1
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+71
-21
gframe/event_handler.cpp
gframe/event_handler.cpp
+2
-0
gframe/game.cpp
gframe/game.cpp
+11
-11
gframe/game.h
gframe/game.h
+10
-0
gframe/gframe.cpp
gframe/gframe.cpp
+1
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+35
-1
strings.conf
strings.conf
+9
-3
No files found.
gframe/config.h
View file @
856b9985
...
...
@@ -76,5 +76,6 @@ extern int enable_log;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
extern
bool
bot_mode
;
#endif
gframe/duelclient.cpp
View file @
856b9985
...
...
@@ -69,8 +69,12 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
if
(
!
mainGame
->
wLanWindow
->
isVisible
())
if
(
bot_mode
&&
!
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
if
(
!
bot_mode
&&
!
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -110,18 +114,34 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
if
(
create_game
)
{
CTOS_CreateGame
cscg
;
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
cscg
.
name
,
20
);
BufferIO
::
CopyWStr
(
mainGame
->
ebServerPass
->
getText
(),
cscg
.
pass
,
20
);
cscg
.
info
.
rule
=
mainGame
->
cbRule
->
getSelected
();
cscg
.
info
.
mode
=
mainGame
->
cbMatchMode
->
getSelected
();
cscg
.
info
.
start_hand
=
_wtoi
(
mainGame
->
ebStartHand
->
getText
());
cscg
.
info
.
start_lp
=
_wtoi
(
mainGame
->
ebStartLP
->
getText
());
cscg
.
info
.
draw_count
=
_wtoi
(
mainGame
->
ebDrawCount
->
getText
());
cscg
.
info
.
time_limit
=
_wtoi
(
mainGame
->
ebTimeLimit
->
getText
());
cscg
.
info
.
lflist
=
mainGame
->
cbLFlist
->
getItemData
(
mainGame
->
cbLFlist
->
getSelected
());
cscg
.
info
.
duel_rule
=
mainGame
->
cbDuelRule
->
getSelected
()
+
1
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkNoShuffleDeck
->
isChecked
();
if
(
bot_mode
)
{
BufferIO
::
CopyWStr
(
L"Bot Game"
,
cscg
.
name
,
20
);
BufferIO
::
CopyWStr
(
L""
,
cscg
.
pass
,
20
);
cscg
.
info
.
rule
=
2
;
cscg
.
info
.
mode
=
0
;
cscg
.
info
.
start_hand
=
5
;
cscg
.
info
.
start_lp
=
8000
;
cscg
.
info
.
draw_count
=
1
;
cscg
.
info
.
time_limit
=
0
;
cscg
.
info
.
lflist
=
0
;
cscg
.
info
.
duel_rule
=
mainGame
->
chkBotOldRule
->
isChecked
()
?
DEFAULT_DUEL_RULE
-
1
:
DEFAULT_DUEL_RULE
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkBotNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkBotNoShuffleDeck
->
isChecked
();
}
else
{
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
cscg
.
name
,
20
);
BufferIO
::
CopyWStr
(
mainGame
->
ebServerPass
->
getText
(),
cscg
.
pass
,
20
);
cscg
.
info
.
rule
=
mainGame
->
cbRule
->
getSelected
();
cscg
.
info
.
mode
=
mainGame
->
cbMatchMode
->
getSelected
();
cscg
.
info
.
start_hand
=
_wtoi
(
mainGame
->
ebStartHand
->
getText
());
cscg
.
info
.
start_lp
=
_wtoi
(
mainGame
->
ebStartLP
->
getText
());
cscg
.
info
.
draw_count
=
_wtoi
(
mainGame
->
ebDrawCount
->
getText
());
cscg
.
info
.
time_limit
=
_wtoi
(
mainGame
->
ebTimeLimit
->
getText
());
cscg
.
info
.
lflist
=
mainGame
->
cbLFlist
->
getItemData
(
mainGame
->
cbLFlist
->
getSelected
());
cscg
.
info
.
duel_rule
=
mainGame
->
cbDuelRule
->
getSelected
()
+
1
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkNoShuffleDeck
->
isChecked
();
}
SendPacketToServer
(
CTOS_CREATE_GAME
,
cscg
);
}
else
{
CTOS_JoinGame
csjg
;
...
...
@@ -139,8 +159,12 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
if
(
!
mainGame
->
wLanWindow
->
isVisible
())
if
(
bot_mode
&&
!
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
if
(
!
bot_mode
&&
!
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -149,9 +173,14 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
wChat
->
setVisible
(
false
);
if
(
events
&
BEV_EVENT_EOF
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1401
));
...
...
@@ -163,6 +192,8 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
...
...
@@ -171,7 +202,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
}
}
...
...
@@ -203,6 +237,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
if
(
pkt
->
code
==
0
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1403
));
...
...
@@ -276,6 +312,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
wchar_t
msgbuf
[
256
];
myswprintf
(
msgbuf
,
dataManager
.
GetSysString
(
1411
),
pkt
->
code
>>
12
,
(
pkt
->
code
>>
4
)
&
0xff
,
pkt
->
code
&
0xf
);
...
...
@@ -425,8 +463,10 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
if
(
mainGame
->
wCreateHost
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
else
if
(
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -600,9 +640,14 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
...
...
@@ -823,9 +868,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
...
...
@@ -3612,8 +3662,8 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
if
(
pHP
->
host
.
draw_count
==
1
&&
pHP
->
host
.
start_hand
==
5
&&
pHP
->
host
.
start_lp
==
8000
&&
!
pHP
->
host
.
no_check_deck
&&
!
pHP
->
host
.
no_shuffle_deck
&&
pHP
->
host
.
duel_rule
==
DEFAULT_DUEL_RULE
)
hoststr
.
append
(
dataManager
.
GetSysString
(
12
80
));
else
hoststr
.
append
(
dataManager
.
GetSysString
(
12
81
));
hoststr
.
append
(
dataManager
.
GetSysString
(
12
47
));
else
hoststr
.
append
(
dataManager
.
GetSysString
(
12
48
));
hoststr
.
append
(
L"]"
);
wchar_t
gamename
[
20
];
BufferIO
::
CopyWStr
(
pHP
->
name
,
gamename
,
20
);
...
...
gframe/event_handler.cpp
View file @
856b9985
...
...
@@ -125,6 +125,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
}
else
{
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
...
...
gframe/game.cpp
View file @
856b9985
...
...
@@ -556,18 +556,18 @@ bool Game::Initialize() {
wSinglePlay
->
getCloseButton
()
->
setVisible
(
false
);
wSinglePlay
->
setVisible
(
false
);
irr
::
gui
::
IGUITabControl
*
wSingle
=
env
->
addTabControl
(
rect
<
s32
>
(
0
,
20
,
579
,
419
),
wSinglePlay
,
true
);
irr
::
gui
::
IGUITab
*
tab
AI
=
wSingle
->
addTab
(
L"人机模式"
);
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
350
,
350
),
tabAI
,
LISTBOX_SINGLEPLAY_LIST
,
true
);
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabAI
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabAI
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
13
52
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabAI
);
env
->
addStaticText
(
L"一个可怕的AI
\n
非常可怕"
,
rect
<
s32
>
(
360
,
40
,
550
,
160
),
false
,
true
,
tabAI
);
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
170
,
560
,
190
),
tabAI
,
-
1
,
L"使用旧规则(大师规则3)"
);
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
200
,
560
,
220
),
tabAI
,
-
1
,
L"锁定出剪刀"
);
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
230
,
560
,
250
),
tabAI
,
-
1
,
dataManager
.
GetSysString
(
1229
));
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
260
,
560
,
280
),
tabAI
,
-
1
,
dataManager
.
GetSysString
(
1230
));
irr
::
gui
::
IGUITab
*
tab
Bot
=
wSingle
->
addTab
(
dataManager
.
GetSysString
(
1380
)
);
lstBotList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
350
,
350
),
tabBot
,
LISTBOX_SINGLEPLAY_LIST
,
true
);
btnStartBot
=
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabBot
,
BUTTON_BOT_START
,
dataManager
.
GetSysString
(
1211
));
btnBotCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabBot
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
13
82
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabBot
);
stBotInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
550
,
160
),
false
,
true
,
tabBot
);
chkBotOldRule
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
170
,
560
,
190
),
tabBot
,
CHECKBOX_BOT_OLD_RULE
,
dataManager
.
GetSysString
(
1383
)
);
chkBotHand
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
200
,
560
,
220
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1384
)
);
chkBotNoCheckDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
230
,
560
,
250
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1229
));
chkBotNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
260
,
560
,
280
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1230
));
irr
::
gui
::
IGUITab
*
tabSingle
=
wSingle
->
addTab
(
L"残局模式"
);
irr
::
gui
::
IGUITab
*
tabSingle
=
wSingle
->
addTab
(
dataManager
.
GetSysString
(
1381
)
);
lstSinglePlayList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
350
,
350
),
tabSingle
,
LISTBOX_SINGLEPLAY_LIST
,
true
);
lstSinglePlayList
->
setItemHeight
(
18
);
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabSingle
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
...
...
gframe/game.h
View file @
856b9985
...
...
@@ -277,6 +277,14 @@ public:
irr
::
gui
::
IGUIEditBox
*
ebRepStartTurn
;
//single play
irr
::
gui
::
IGUIWindow
*
wSinglePlay
;
irr
::
gui
::
IGUIListBox
*
lstBotList
;
irr
::
gui
::
IGUIStaticText
*
stBotInfo
;
irr
::
gui
::
IGUIButton
*
btnStartBot
;
irr
::
gui
::
IGUIButton
*
btnBotCancel
;
irr
::
gui
::
IGUICheckBox
*
chkBotOldRule
;
irr
::
gui
::
IGUICheckBox
*
chkBotHand
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoCheckDeck
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoShuffleDeck
;
irr
::
gui
::
IGUIListBox
*
lstSinglePlayList
;
irr
::
gui
::
IGUIStaticText
*
stSinglePlayInfo
;
irr
::
gui
::
IGUIButton
*
btnLoadSinglePlay
;
...
...
@@ -565,6 +573,8 @@ extern Game* mainGame;
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_CANCEL 331
#define BUTTON_BOT_START 340
#define CHECKBOX_BOT_OLD_RULE 341
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
...
...
gframe/gframe.cpp
View file @
856b9985
...
...
@@ -10,6 +10,7 @@ int enable_log = 0;
bool
exit_on_return
=
false
;
bool
open_file
=
false
;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
...
...
gframe/menu_handler.cpp
View file @
856b9985
...
...
@@ -46,6 +46,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_JOIN_HOST
:
{
bot_mode
=
false
;
char
ip
[
20
];
const
wchar_t
*
pstr
=
mainGame
->
ebJoinHost
->
getText
();
BufferIO
::
CopyWStr
(
pstr
,
ip
,
16
);
...
...
@@ -103,6 +104,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_HOST_CONFIRM
:
{
bot_mode
=
false
;
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
break
;
...
...
@@ -167,8 +169,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
wChat
->
setVisible
(
false
);
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
...
...
@@ -227,6 +234,33 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
ShowElement
(
mainGame
->
wMainMenu
);
break
;
}
case
BUTTON_BOT_START
:
{
bot_mode
=
true
;
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
break
;
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
break
;
}
#ifdef _WIN32
STARTUPINFO
si
;
PROCESS_INFORMATION
pi
;
ZeroMemory
(
&
si
,
sizeof
(
si
));
si
.
cb
=
sizeof
(
si
);
ZeroMemory
(
&
pi
,
sizeof
(
pi
));
LPTSTR
cmd
=
new
TCHAR
[
MAX_PATH
];
myswprintf
(
cmd
,
L"Bot.exe %s"
,
L"1"
);
if
(
!
CreateProcess
(
NULL
,
cmd
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
))
{
NetServer
::
StopServer
();
break
;
}
#endif
mainGame
->
btnStartBot
->
setEnabled
(
false
);
mainGame
->
btnBotCancel
->
setEnabled
(
false
);
break
;
}
case
BUTTON_LOAD_SINGLEPLAY
:
{
if
(
!
open_file
&&
mainGame
->
lstSinglePlayList
->
getSelected
()
==
-
1
)
break
;
...
...
strings.conf
View file @
856b9985
...
...
@@ -241,7 +241,7 @@
!
system
1163
灵摆召唤
#menu
!
system
1200
联机模式
!
system
1201
残局
模式
!
system
1201
单人
模式
!
system
1202
观看录像
!
system
1203
N/A
!
system
1204
编辑卡组
...
...
@@ -280,6 +280,8 @@
!
system
1244
单局模式
!
system
1245
比赛模式
!
system
1246
TAG
!
system
1247
标准对战
!
system
1248
自定义
!
system
1250
决斗准备
!
system
1251
→决斗者
!
system
1252
→观战
...
...
@@ -299,8 +301,6 @@
!
system
1276
自动排列连锁顺序
!
system
1277
没有可连锁的卡时延迟回应
!
system
1278
自动选择魔陷卡片位置
!
system
1280
标准对战
!
system
1281
自定义
!
system
1290
忽略对方发言
!
system
1291
忽略观战者发言
!
system
1292
忽略时点
...
...
@@ -373,6 +373,12 @@
!
system
1372
守备↑
!
system
1373
名称↓
!
system
1374
连接标记
!
system
1380
人机模式
!
system
1381
残局模式
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1385
列表为空,可能未安装人机
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
...
...
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