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
033ed689
Commit
033ed689
authored
Nov 21, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ai' into test
parents
02adc741
b21854b4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
226 additions
and
39 deletions
+226
-39
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
+59
-9
gframe/game.h
gframe/game.h
+21
-1
gframe/gframe.cpp
gframe/gframe.cpp
+2
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+49
-1
strings.conf
strings.conf
+21
-6
No files found.
gframe/config.h
View file @
033ed689
...
@@ -77,5 +77,6 @@ extern int enable_log;
...
@@ -77,5 +77,6 @@ extern int enable_log;
extern
bool
exit_on_return
;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name
[
256
];
extern
bool
bot_mode
;
#endif
#endif
gframe/duelclient.cpp
View file @
033ed689
...
@@ -69,8 +69,12 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
...
@@ -69,8 +69,12 @@ void DuelClient::ConnectTimeout(evutil_socket_t fd, short events, void* arg) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
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
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
...
@@ -110,18 +114,34 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -110,18 +114,34 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
if
(
create_game
)
{
if
(
create_game
)
{
CTOS_CreateGame
cscg
;
CTOS_CreateGame
cscg
;
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
cscg
.
name
,
20
);
if
(
bot_mode
)
{
BufferIO
::
CopyWStr
(
mainGame
->
ebServerPass
->
getText
(),
cscg
.
pass
,
20
);
BufferIO
::
CopyWStr
(
L"Bot Game"
,
cscg
.
name
,
20
);
cscg
.
info
.
rule
=
mainGame
->
cbRule
->
getSelected
();
BufferIO
::
CopyWStr
(
L""
,
cscg
.
pass
,
20
);
cscg
.
info
.
mode
=
mainGame
->
cbMatchMode
->
getSelected
();
cscg
.
info
.
rule
=
2
;
cscg
.
info
.
start_hand
=
_wtoi
(
mainGame
->
ebStartHand
->
getText
());
cscg
.
info
.
mode
=
0
;
cscg
.
info
.
start_lp
=
_wtoi
(
mainGame
->
ebStartLP
->
getText
());
cscg
.
info
.
start_hand
=
5
;
cscg
.
info
.
draw_count
=
_wtoi
(
mainGame
->
ebDrawCount
->
getText
());
cscg
.
info
.
start_lp
=
8000
;
cscg
.
info
.
time_limit
=
_wtoi
(
mainGame
->
ebTimeLimit
->
getText
());
cscg
.
info
.
draw_count
=
1
;
cscg
.
info
.
lflist
=
mainGame
->
cbLFlist
->
getItemData
(
mainGame
->
cbLFlist
->
getSelected
());
cscg
.
info
.
time_limit
=
0
;
cscg
.
info
.
duel_rule
=
mainGame
->
cbDuelRule
->
getSelected
()
+
1
;
cscg
.
info
.
lflist
=
0
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkNoCheckDeck
->
isChecked
();
cscg
.
info
.
duel_rule
=
mainGame
->
chkBotOldRule
->
isChecked
()
?
DEFAULT_DUEL_RULE
-
1
:
DEFAULT_DUEL_RULE
;
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkNoShuffleDeck
->
isChecked
();
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
);
SendPacketToServer
(
CTOS_CREATE_GAME
,
cscg
);
}
else
{
}
else
{
CTOS_JoinGame
csjg
;
CTOS_JoinGame
csjg
;
...
@@ -139,8 +159,12 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -139,8 +159,12 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
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
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
...
@@ -149,9 +173,14 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -149,9 +173,14 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
false
);
if
(
events
&
BEV_EVENT_EOF
)
if
(
events
&
BEV_EVENT_EOF
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1401
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1401
));
...
@@ -163,6 +192,8 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -163,6 +192,8 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeSignal
.
Set
();
...
@@ -172,7 +203,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -172,7 +203,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
}
}
}
}
...
@@ -204,6 +238,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -204,6 +238,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
if
(
pkt
->
code
==
0
)
if
(
pkt
->
code
==
0
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1403
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1403
));
...
@@ -277,6 +313,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -277,6 +313,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
wchar_t
msgbuf
[
256
];
wchar_t
msgbuf
[
256
];
myswprintf
(
msgbuf
,
dataManager
.
GetSysString
(
1411
),
pkt
->
code
>>
12
,
(
pkt
->
code
>>
4
)
&
0xff
,
pkt
->
code
&
0xf
);
myswprintf
(
msgbuf
,
dataManager
.
GetSysString
(
1411
),
pkt
->
code
>>
12
,
(
pkt
->
code
>>
4
)
&
0xff
,
pkt
->
code
&
0xf
);
...
@@ -426,8 +464,10 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -426,8 +464,10 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
if
(
mainGame
->
wCreateHost
->
isVisible
())
if
(
mainGame
->
wCreateHost
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
else
if
(
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
...
@@ -604,9 +644,14 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -604,9 +644,14 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
if
(
exit_on_return
)
...
@@ -832,9 +877,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -832,9 +877,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
gMutex
.
Unlock
();
event_base_loopbreak
(
client_base
);
event_base_loopbreak
(
client_base
);
if
(
exit_on_return
)
if
(
exit_on_return
)
...
@@ -3669,8 +3719,8 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
...
@@ -3669,8 +3719,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
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
.
no_check_deck
&&
!
pHP
->
host
.
no_shuffle_deck
&&
pHP
->
host
.
duel_rule
==
DEFAULT_DUEL_RULE
)
&&
pHP
->
host
.
duel_rule
==
DEFAULT_DUEL_RULE
)
hoststr
.
append
(
dataManager
.
GetSysString
(
12
80
));
hoststr
.
append
(
dataManager
.
GetSysString
(
12
47
));
else
hoststr
.
append
(
dataManager
.
GetSysString
(
12
81
));
else
hoststr
.
append
(
dataManager
.
GetSysString
(
12
48
));
hoststr
.
append
(
L"]"
);
hoststr
.
append
(
L"]"
);
wchar_t
gamename
[
20
];
wchar_t
gamename
[
20
];
BufferIO
::
CopyWStr
(
pHP
->
name
,
gamename
,
20
);
BufferIO
::
CopyWStr
(
pHP
->
name
,
gamename
,
20
);
...
...
gframe/event_handler.cpp
View file @
033ed689
...
@@ -136,6 +136,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -136,6 +136,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
}
else
{
}
else
{
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
DuelClient
::
SendPacketToServer
(
CTOS_SURRENDER
);
...
...
gframe/game.cpp
View file @
033ed689
...
@@ -89,7 +89,7 @@ bool Game::Initialize() {
...
@@ -89,7 +89,7 @@ bool Game::Initialize() {
wMainMenu
=
env
->
addWindow
(
rect
<
s32
>
(
370
,
200
,
950
,
600
),
false
,
strbuf
);
wMainMenu
=
env
->
addWindow
(
rect
<
s32
>
(
370
,
200
,
950
,
600
),
false
,
strbuf
);
wMainMenu
->
getCloseButton
()
->
setVisible
(
false
);
wMainMenu
->
getCloseButton
()
->
setVisible
(
false
);
btnLanMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
270
,
60
),
wMainMenu
,
BUTTON_LAN_MODE
,
dataManager
.
GetSysString
(
1200
));
btnLanMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
270
,
60
),
wMainMenu
,
BUTTON_LAN_MODE
,
dataManager
.
GetSysString
(
1200
));
btnS
erver
Mode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
65
,
270
,
95
),
wMainMenu
,
BUTTON_SINGLE_MODE
,
dataManager
.
GetSysString
(
1201
));
btnS
ingle
Mode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
65
,
270
,
95
),
wMainMenu
,
BUTTON_SINGLE_MODE
,
dataManager
.
GetSysString
(
1201
));
btnReplayMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
100
,
270
,
130
),
wMainMenu
,
BUTTON_REPLAY_MODE
,
dataManager
.
GetSysString
(
1202
));
btnReplayMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
100
,
270
,
130
),
wMainMenu
,
BUTTON_REPLAY_MODE
,
dataManager
.
GetSysString
(
1202
));
// btnTestMode = env->addButton(rect<s32>(10, 135, 270, 165), wMainMenu, BUTTON_TEST_MODE, dataManager.GetSysString(1203));
// btnTestMode = env->addButton(rect<s32>(10, 135, 270, 165), wMainMenu, BUTTON_TEST_MODE, dataManager.GetSysString(1203));
btnDeckEdit
=
env
->
addButton
(
rect
<
s32
>
(
10
,
135
,
270
,
165
),
wMainMenu
,
BUTTON_DECK_EDIT
,
dataManager
.
GetSysString
(
1204
));
btnDeckEdit
=
env
->
addButton
(
rect
<
s32
>
(
10
,
135
,
270
,
165
),
wMainMenu
,
BUTTON_DECK_EDIT
,
dataManager
.
GetSysString
(
1204
));
...
@@ -299,7 +299,7 @@ bool Game::Initialize() {
...
@@ -299,7 +299,7 @@ bool Game::Initialize() {
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
posY
+=
30
;
posY
+=
30
;
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable_sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1
380
));
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable_sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1
279
));
chkEnableSound
->
setChecked
(
gameConf
.
enable_sound
);
chkEnableSound
->
setChecked
(
gameConf
.
enable_sound
);
scrSoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrSoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrSoundVolume
->
setMax
(
100
);
scrSoundVolume
->
setMax
(
100
);
...
@@ -308,7 +308,7 @@ bool Game::Initialize() {
...
@@ -308,7 +308,7 @@ bool Game::Initialize() {
scrSoundVolume
->
setLargeStep
(
1
);
scrSoundVolume
->
setLargeStep
(
1
);
scrSoundVolume
->
setSmallStep
(
1
);
scrSoundVolume
->
setSmallStep
(
1
);
posY
+=
30
;
posY
+=
30
;
chkEnableMusic
=
env
->
addCheckBox
(
gameConf
.
enable_music
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
CHECKBOX_ENABLE_MUSIC
,
dataManager
.
GetSysString
(
1
381
));
chkEnableMusic
=
env
->
addCheckBox
(
gameConf
.
enable_music
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
CHECKBOX_ENABLE_MUSIC
,
dataManager
.
GetSysString
(
1
280
));
chkEnableMusic
->
setChecked
(
gameConf
.
enable_music
);
chkEnableMusic
->
setChecked
(
gameConf
.
enable_music
);
scrMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrMusicVolume
->
setMax
(
100
);
scrMusicVolume
->
setMax
(
100
);
...
@@ -317,7 +317,7 @@ bool Game::Initialize() {
...
@@ -317,7 +317,7 @@ bool Game::Initialize() {
scrMusicVolume
->
setLargeStep
(
1
);
scrMusicVolume
->
setLargeStep
(
1
);
scrMusicVolume
->
setSmallStep
(
1
);
scrMusicVolume
->
setSmallStep
(
1
);
posY
+=
30
;
posY
+=
30
;
chkMusicMode
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1
382
));
chkMusicMode
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1
281
));
chkMusicMode
->
setChecked
(
gameConf
.
music_mode
!=
0
);
chkMusicMode
->
setChecked
(
gameConf
.
music_mode
!=
0
);
//
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
...
@@ -595,12 +595,25 @@ bool Game::Initialize() {
...
@@ -595,12 +595,25 @@ bool Game::Initialize() {
wSinglePlay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1201
));
wSinglePlay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1201
));
wSinglePlay
->
getCloseButton
()
->
setVisible
(
false
);
wSinglePlay
->
getCloseButton
()
->
setVisible
(
false
);
wSinglePlay
->
setVisible
(
false
);
wSinglePlay
->
setVisible
(
false
);
lstSinglePlayList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
30
,
350
,
400
),
wSinglePlay
,
LISTBOX_SINGLEPLAY_LIST
,
true
);
irr
::
gui
::
IGUITabControl
*
wSingle
=
env
->
addTabControl
(
rect
<
s32
>
(
0
,
20
,
579
,
419
),
wSinglePlay
,
true
);
irr
::
gui
::
IGUITab
*
tabBot
=
wSingle
->
addTab
(
dataManager
.
GetSysString
(
1380
));
lstBotList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
350
,
350
),
tabBot
,
LISTBOX_BOT_LIST
,
true
);
lstBotList
->
setItemHeight
(
18
);
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
(
1382
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabBot
);
stBotInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
560
,
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
(
dataManager
.
GetSysString
(
1381
));
lstSinglePlayList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
350
,
350
),
tabSingle
,
LISTBOX_SINGLEPLAY_LIST
,
true
);
lstSinglePlayList
->
setItemHeight
(
18
);
lstSinglePlayList
->
setItemHeight
(
18
);
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
4
60
,
355
,
570
,
380
),
wSinglePlay
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
4
59
,
301
,
569
,
326
),
tabSingle
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
btnSinglePlayCancel
=
env
->
addButton
(
rect
<
s32
>
(
4
60
,
385
,
570
,
410
),
wSinglePlay
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
btnSinglePlayCancel
=
env
->
addButton
(
rect
<
s32
>
(
4
59
,
331
,
569
,
356
),
tabSingle
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1352
),
rect
<
s32
>
(
360
,
30
,
570
,
50
),
false
,
true
,
wSinglePlay
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1352
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabSingle
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
60
,
570
,
350
),
false
,
true
,
wSinglePlay
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
550
,
280
),
false
,
true
,
tabSingle
);
//replay save
//replay save
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
...
@@ -1005,6 +1018,43 @@ void Game::RefershBGMDir(std::wstring path, int scene) {
...
@@ -1005,6 +1018,43 @@ void Game::RefershBGMDir(std::wstring path, int scene) {
closedir
(
dir
);
closedir
(
dir
);
#endif
#endif
}
}
void
Game
::
RefreshBot
()
{
botInfo
.
clear
();
FILE
*
fp
=
fopen
(
"bot.conf"
,
"r"
);
char
linebuf
[
256
];
char
strbuf
[
256
];
if
(
fp
)
{
while
(
fgets
(
linebuf
,
256
,
fp
))
{
if
(
linebuf
[
0
]
==
'#'
)
continue
;
if
(
linebuf
[
0
]
==
'!'
)
{
BotInfo
newinfo
;
sscanf
(
linebuf
,
"!%240[^
\n
]"
,
strbuf
);
BufferIO
::
DecodeUTF8
(
strbuf
,
newinfo
.
internalname
);
fgets
(
linebuf
,
256
,
fp
);
sscanf
(
linebuf
,
"%240[^
\n
]"
,
strbuf
);
BufferIO
::
DecodeUTF8
(
strbuf
,
newinfo
.
name
);
fgets
(
linebuf
,
256
,
fp
);
sscanf
(
linebuf
,
"%240[^
\n
]"
,
strbuf
);
BufferIO
::
DecodeUTF8
(
strbuf
,
newinfo
.
desc
);
fgets
(
linebuf
,
256
,
fp
);
sscanf
(
linebuf
,
"%d"
,
&
newinfo
.
flag
);
if
((
chkBotOldRule
->
isChecked
()
&&
(
newinfo
.
flag
&
0x1
))
||
(
!
chkBotOldRule
->
isChecked
()
&&
(
newinfo
.
flag
&
0x2
)))
botInfo
.
push_back
(
newinfo
);
continue
;
}
}
fclose
(
fp
);
}
lstBotList
->
clear
();
stBotInfo
->
setText
(
L""
);
for
(
unsigned
int
i
=
0
;
i
<
botInfo
.
size
();
++
i
)
{
lstBotList
->
addItem
(
botInfo
[
i
].
name
);
}
if
(
botInfo
.
size
()
==
0
)
stBotInfo
->
setText
(
dataManager
.
GetSysString
(
1385
));
}
void
Game
::
LoadConfig
()
{
void
Game
::
LoadConfig
()
{
FILE
*
fp
=
fopen
(
"system.conf"
,
"r"
);
FILE
*
fp
=
fopen
(
"system.conf"
,
"r"
);
if
(
!
fp
)
if
(
!
fp
)
...
...
gframe/game.h
View file @
033ed689
...
@@ -74,6 +74,13 @@ struct DuelInfo {
...
@@ -74,6 +74,13 @@ struct DuelInfo {
unsigned
short
time_left
[
2
];
unsigned
short
time_left
[
2
];
};
};
struct
BotInfo
{
wchar_t
internalname
[
256
];
wchar_t
name
[
32
];
wchar_t
desc
[
256
];
int
flag
;
};
struct
FadingUnit
{
struct
FadingUnit
{
bool
signalAction
;
bool
signalAction
;
bool
isFadein
;
bool
isFadein
;
...
@@ -100,6 +107,7 @@ public:
...
@@ -100,6 +107,7 @@ public:
void
RefreshSingleplay
();
void
RefreshSingleplay
();
void
RefreshBGMList
();
void
RefreshBGMList
();
void
RefershBGMDir
(
std
::
wstring
path
,
int
scene
);
void
RefershBGMDir
(
std
::
wstring
path
,
int
scene
);
void
RefreshBot
();
void
DrawSelectionLine
(
irr
::
video
::
S3DVertex
*
vec
,
bool
strip
,
int
width
,
float
*
cv
);
void
DrawSelectionLine
(
irr
::
video
::
S3DVertex
*
vec
,
bool
strip
,
int
width
,
float
*
cv
);
void
DrawBackGround
();
void
DrawBackGround
();
void
DrawLinkedZones
(
ClientCard
*
pcard
);
void
DrawLinkedZones
(
ClientCard
*
pcard
);
...
@@ -154,6 +162,7 @@ public:
...
@@ -154,6 +162,7 @@ public:
std
::
vector
<
int
>
logParam
;
std
::
vector
<
int
>
logParam
;
std
::
wstring
chatMsg
[
8
];
std
::
wstring
chatMsg
[
8
];
std
::
vector
<
std
::
wstring
>
BGMList
[
8
];
std
::
vector
<
std
::
wstring
>
BGMList
[
8
];
std
::
vector
<
BotInfo
>
botInfo
;
int
hideChatTimer
;
int
hideChatTimer
;
bool
hideChat
;
bool
hideChat
;
...
@@ -241,7 +250,7 @@ public:
...
@@ -241,7 +250,7 @@ public:
//main menu
//main menu
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
irr
::
gui
::
IGUIButton
*
btnS
erver
Mode
;
irr
::
gui
::
IGUIButton
*
btnS
ingle
Mode
;
irr
::
gui
::
IGUIButton
*
btnReplayMode
;
irr
::
gui
::
IGUIButton
*
btnReplayMode
;
irr
::
gui
::
IGUIButton
*
btnTestMode
;
irr
::
gui
::
IGUIButton
*
btnTestMode
;
irr
::
gui
::
IGUIButton
*
btnDeckEdit
;
irr
::
gui
::
IGUIButton
*
btnDeckEdit
;
...
@@ -296,6 +305,14 @@ public:
...
@@ -296,6 +305,14 @@ public:
irr
::
gui
::
IGUIEditBox
*
ebRepStartTurn
;
irr
::
gui
::
IGUIEditBox
*
ebRepStartTurn
;
//single play
//single play
irr
::
gui
::
IGUIWindow
*
wSinglePlay
;
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
::
IGUIListBox
*
lstSinglePlayList
;
irr
::
gui
::
IGUIStaticText
*
stSinglePlayInfo
;
irr
::
gui
::
IGUIStaticText
*
stSinglePlayInfo
;
irr
::
gui
::
IGUIButton
*
btnLoadSinglePlay
;
irr
::
gui
::
IGUIButton
*
btnLoadSinglePlay
;
...
@@ -589,6 +606,9 @@ extern Game* mainGame;
...
@@ -589,6 +606,9 @@ extern Game* mainGame;
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_CANCEL 331
#define BUTTON_REPLAY_CANCEL 331
#define BUTTON_BOT_START 340
#define LISTBOX_BOT_LIST 341
#define CHECKBOX_BOT_OLD_RULE 342
#define LISTBOX_SINGLEPLAY_LIST 350
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define BUTTON_CANCEL_SINGLEPLAY 352
...
...
gframe/gframe.cpp
View file @
033ed689
...
@@ -10,6 +10,7 @@ int enable_log = 0;
...
@@ -10,6 +10,7 @@ int enable_log = 0;
bool
exit_on_return
=
false
;
bool
exit_on_return
=
false
;
bool
open_file
=
false
;
bool
open_file
=
false
;
wchar_t
open_file_name
[
256
]
=
L""
;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
#ifdef _WIN32
...
@@ -151,7 +152,7 @@ int main(int argc, char* argv[]) {
...
@@ -151,7 +152,7 @@ int main(int argc, char* argv[]) {
open_file
=
true
;
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
}
}
ClickButton
(
ygo
::
mainGame
->
btnS
erver
Mode
);
ClickButton
(
ygo
::
mainGame
->
btnS
ingle
Mode
);
if
(
open_file
)
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
break
;
break
;
...
...
gframe/menu_handler.cpp
View file @
033ed689
...
@@ -50,6 +50,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -50,6 +50,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_JOIN_HOST
:
{
case
BUTTON_JOIN_HOST
:
{
bot_mode
=
false
;
char
ip
[
20
];
char
ip
[
20
];
const
wchar_t
*
pstr
=
mainGame
->
ebJoinHost
->
getText
();
const
wchar_t
*
pstr
=
mainGame
->
ebJoinHost
->
getText
();
BufferIO
::
CopyWStr
(
pstr
,
ip
,
16
);
BufferIO
::
CopyWStr
(
pstr
,
ip
,
16
);
...
@@ -107,6 +108,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -107,6 +108,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_HOST_CONFIRM
:
{
case
BUTTON_HOST_CONFIRM
:
{
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
))
break
;
break
;
...
@@ -171,8 +173,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -171,8 +173,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
HideElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
else
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
false
);
if
(
exit_on_return
)
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
...
@@ -189,6 +196,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -189,6 +196,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
HideElement
(
mainGame
->
wMainMenu
);
mainGame
->
HideElement
(
mainGame
->
wMainMenu
);
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
mainGame
->
RefreshSingleplay
();
mainGame
->
RefreshSingleplay
();
mainGame
->
RefreshBot
();
break
;
break
;
}
}
case
BUTTON_LOAD_REPLAY
:
{
case
BUTTON_LOAD_REPLAY
:
{
...
@@ -231,6 +239,35 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -231,6 +239,35 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
ShowElement
(
mainGame
->
wMainMenu
);
mainGame
->
ShowElement
(
mainGame
->
wMainMenu
);
break
;
break
;
}
}
case
BUTTON_BOT_START
:
{
int
sel
=
mainGame
->
lstBotList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
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
\"
%d %d"
,
mainGame
->
botInfo
[
sel
].
internalname
,
(
mainGame
->
chkBotHand
->
isChecked
()
?
1
:
0
),
mainGame
->
gameConf
.
serverport
);
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
:
{
case
BUTTON_LOAD_SINGLEPLAY
:
{
if
(
!
open_file
&&
mainGame
->
lstSinglePlayList
->
getSelected
()
==
-
1
)
if
(
!
open_file
&&
mainGame
->
lstSinglePlayList
->
getSelected
()
==
-
1
)
break
;
break
;
...
@@ -321,6 +358,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -321,6 +358,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
(
wchar_t
*
)
repinfo
.
c_str
());
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
(
wchar_t
*
)
repinfo
.
c_str
());
break
;
break
;
}
}
case
LISTBOX_BOT_LIST
:
{
int
sel
=
mainGame
->
lstBotList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
mainGame
->
SetStaticText
(
mainGame
->
stBotInfo
,
200
,
mainGame
->
guiFont
,
mainGame
->
botInfo
[
sel
].
desc
);
break
;
}
}
}
break
;
break
;
}
}
...
@@ -345,6 +389,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -345,6 +389,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
break
;
break
;
}
}
case
CHECKBOX_BOT_OLD_RULE
:
{
mainGame
->
RefreshBot
();
break
;
}
}
}
break
;
break
;
}
}
...
...
strings.conf
View file @
033ed689
...
@@ -241,7 +241,7 @@
...
@@ -241,7 +241,7 @@
!
system
1163
灵摆召唤
!
system
1163
灵摆召唤
#menu
#menu
!
system
1200
联机模式
!
system
1200
联机模式
!
system
1201
残局
模式
!
system
1201
单人
模式
!
system
1202
观看录像
!
system
1202
观看录像
!
system
1203
N/A
!
system
1203
N/A
!
system
1204
编辑卡组
!
system
1204
编辑卡组
...
@@ -280,6 +280,8 @@
...
@@ -280,6 +280,8 @@
!
system
1244
单局模式
!
system
1244
单局模式
!
system
1245
比赛模式
!
system
1245
比赛模式
!
system
1246
TAG
!
system
1246
TAG
!
system
1247
标准对战
!
system
1248
自定义
!
system
1250
决斗准备
!
system
1250
决斗准备
!
system
1251
→决斗者
!
system
1251
→决斗者
!
system
1252
→观战
!
system
1252
→观战
...
@@ -299,8 +301,9 @@
...
@@ -299,8 +301,9 @@
!
system
1276
自动排列连锁顺序
!
system
1276
自动排列连锁顺序
!
system
1277
没有可连锁的卡时延迟回应
!
system
1277
没有可连锁的卡时延迟回应
!
system
1278
自动选择魔陷卡片位置
!
system
1278
自动选择魔陷卡片位置
!
system
1280
标准对战
!
system
1279
开启音效
!
system
1281
自定义
!
system
1280
开启音乐
!
system
1281
按场景切换音乐
!
system
1290
忽略对方发言
!
system
1290
忽略对方发言
!
system
1291
忽略观战者发言
!
system
1291
忽略观战者发言
!
system
1292
忽略时点
!
system
1292
忽略时点
...
@@ -373,9 +376,12 @@
...
@@ -373,9 +376,12 @@
!
system
1372
守备↑
!
system
1372
守备↑
!
system
1373
名称↓
!
system
1373
名称↓
!
system
1374
连接标记
!
system
1374
连接标记
!
system
1380
开启音效
!
system
1380
人机模式
!
system
1381
开启音乐
!
system
1381
残局模式
!
system
1382
按场景切换音乐
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1385
列表为空,可能未安装合适的人机
!
system
1390
等待行动中...
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
!
system
1392
等待行动中.....
...
@@ -515,6 +521,8 @@
...
@@ -515,6 +521,8 @@
!
counter
0
x1041
捕食指示物
!
counter
0
x1041
捕食指示物
!
counter
0
x42
指示物(爆竹鬼)
!
counter
0
x42
指示物(爆竹鬼)
!
counter
0
x43
缺陷指示物
!
counter
0
x43
缺陷指示物
!
counter
0
x44
指示物(弹带城壁龙)
!
counter
0
x1045
鳞粉指示物
#setnames, using tab for comment
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
!
setname
0
x2
次世代 ジェネクス
...
@@ -862,3 +870,10 @@
...
@@ -862,3 +870,10 @@
!
setname
0
x108
魔弹 魔弾
!
setname
0
x108
魔弹 魔弾
!
setname
0
x109
天气 天気
!
setname
0
x109
天气 天気
!
setname
0
x10a
珀耳修斯 パーシアス
!
setname
0
x10a
珀耳修斯 パーシアス
!
setname
0
x10b
廷达魔三角 ティンダングル
!
setname
0
x10c
机界骑士 ジャックナイツ
!
setname
0
x10d
魔导兽 魔導獣
!
setname
0
x10e
进化药 進化薬
!
setname
0
x10f
枪管 ヴァレル
!
setname
0
x110
眼纳祭神 アイズ・サクリファイス
!
setname
0
x111
武装龙 アームド・ドラゴン
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