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
fe5a197c
Commit
fe5a197c
authored
Jan 04, 2020
by
mercury233
Committed by
GitHub
Jan 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update new rule (#2257)
* update new rule option * update bot rule select * customize default rule
parent
b7bea21d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
9 deletions
+31
-9
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+18
-4
gframe/game.h
gframe/game.h
+4
-2
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+6
-1
strings.conf
strings.conf
+1
-1
system.conf
system.conf
+1
-0
No files found.
gframe/duelclient.cpp
View file @
fe5a197c
...
@@ -131,7 +131,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -131,7 +131,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
cscg
.
info
.
draw_count
=
1
;
cscg
.
info
.
draw_count
=
1
;
cscg
.
info
.
time_limit
=
0
;
cscg
.
info
.
time_limit
=
0
;
cscg
.
info
.
lflist
=
0
;
cscg
.
info
.
lflist
=
0
;
cscg
.
info
.
duel_rule
=
mainGame
->
c
hkBotOldRule
->
isChecked
()
?
DEFAULT_DUEL_RULE
-
1
:
DEFAULT_DUEL_RULE
;
cscg
.
info
.
duel_rule
=
mainGame
->
c
bBotRule
->
getSelected
()
+
3
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkBotNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_check_deck
=
mainGame
->
chkBotNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkBotNoShuffleDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkBotNoShuffleDeck
->
isChecked
();
}
}
...
...
gframe/game.cpp
View file @
fe5a197c
...
@@ -155,7 +155,8 @@ bool Game::Initialize() {
...
@@ -155,7 +155,8 @@ bool Game::Initialize() {
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1261
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1261
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1262
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1262
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1263
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1263
));
cbDuelRule
->
setSelected
(
DEFAULT_DUEL_RULE
-
1
);
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1264
));
cbDuelRule
->
setSelected
(
gameConf
.
default_rule
-
1
);
chkNoCheckDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
210
,
170
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1229
));
chkNoCheckDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
210
,
170
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1229
));
chkNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
180
,
210
,
360
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1230
));
chkNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
180
,
210
,
360
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1230
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1231
),
rect
<
s32
>
(
20
,
240
,
320
,
260
),
false
,
false
,
wCreateHost
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1231
),
rect
<
s32
>
(
20
,
240
,
320
,
260
),
false
,
false
,
wCreateHost
);
...
@@ -662,7 +663,11 @@ bool Game::Initialize() {
...
@@ -662,7 +663,11 @@ bool Game::Initialize() {
btnBotCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabBot
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
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
);
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
);
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
));
cbBotRule
=
env
->
addComboBox
(
rect
<
s32
>
(
360
,
165
,
560
,
190
),
tabBot
,
COMBOBOX_BOT_RULE
);
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1262
));
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1263
));
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1264
));
cbBotRule
->
setSelected
(
gameConf
.
default_rule
-
3
);
chkBotHand
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
200
,
560
,
220
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1384
));
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
));
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
));
chkBotNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
260
,
560
,
280
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1230
));
...
@@ -1022,8 +1027,11 @@ void Game::RefreshBot() {
...
@@ -1022,8 +1027,11 @@ void Game::RefreshBot() {
fgets
(
linebuf
,
256
,
fp
);
fgets
(
linebuf
,
256
,
fp
);
newinfo
.
support_master_rule_3
=
!!
strstr
(
linebuf
,
"SUPPORT_MASTER_RULE_3"
);
newinfo
.
support_master_rule_3
=
!!
strstr
(
linebuf
,
"SUPPORT_MASTER_RULE_3"
);
newinfo
.
support_new_master_rule
=
!!
strstr
(
linebuf
,
"SUPPORT_NEW_MASTER_RULE"
);
newinfo
.
support_new_master_rule
=
!!
strstr
(
linebuf
,
"SUPPORT_NEW_MASTER_RULE"
);
if
((
chkBotOldRule
->
isChecked
()
&&
newinfo
.
support_master_rule_3
)
newinfo
.
support_master_rule_2020
=
!!
strstr
(
linebuf
,
"SUPPORT_MASTER_RULE_2020"
);
||
(
!
chkBotOldRule
->
isChecked
()
&&
newinfo
.
support_new_master_rule
))
int
rule
=
cbBotRule
->
getSelected
()
+
3
;
if
((
rule
==
3
&&
newinfo
.
support_master_rule_3
)
||
(
rule
==
4
&&
newinfo
.
support_new_master_rule
)
||
(
rule
==
5
&&
newinfo
.
support_master_rule_2020
))
botInfo
.
push_back
(
newinfo
);
botInfo
.
push_back
(
newinfo
);
continue
;
continue
;
}
}
...
@@ -1067,6 +1075,7 @@ void Game::LoadConfig() {
...
@@ -1067,6 +1075,7 @@ void Game::LoadConfig() {
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
gameConf
.
hide_setname
=
0
;
gameConf
.
hide_setname
=
0
;
gameConf
.
hide_hint_button
=
0
;
gameConf
.
hide_hint_button
=
0
;
gameConf
.
control_mode
=
0
;
gameConf
.
control_mode
=
0
;
...
@@ -1133,6 +1142,10 @@ void Game::LoadConfig() {
...
@@ -1133,6 +1142,10 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore1
=
atoi
(
valbuf
);
gameConf
.
chkIgnore1
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"default_rule"
))
{
gameConf
.
default_rule
=
atoi
(
valbuf
);
if
(
gameConf
.
default_rule
<=
0
)
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
hide_setname
=
atoi
(
valbuf
);
gameConf
.
hide_setname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
...
@@ -1228,6 +1241,7 @@ void Game::SaveConfig() {
...
@@ -1228,6 +1241,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"waitchain = %d
\n
"
,
(
chkWaitChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"waitchain = %d
\n
"
,
(
chkWaitChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_opponent = %d
\n
"
,
(
chkIgnore1
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_opponent = %d
\n
"
,
(
chkIgnore1
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_spectators = %d
\n
"
,
(
chkIgnore2
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_spectators = %d
\n
"
,
(
chkIgnore2
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"default_rule = %d
\n
"
,
gameConf
.
default_rule
==
DEFAULT_DUEL_RULE
?
0
:
gameConf
.
default_rule
);
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
gameConf
.
hide_setname
);
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
gameConf
.
hide_setname
);
fprintf
(
fp
,
"hide_hint_button = %d
\n
"
,
gameConf
.
hide_hint_button
);
fprintf
(
fp
,
"hide_hint_button = %d
\n
"
,
gameConf
.
hide_hint_button
);
fprintf
(
fp
,
"#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
\n
"
);
fprintf
(
fp
,
"#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
\n
"
);
...
...
gframe/game.h
View file @
fe5a197c
...
@@ -33,6 +33,7 @@ struct Config {
...
@@ -33,6 +33,7 @@ struct Config {
int
chkWaitChain
;
int
chkWaitChain
;
int
chkIgnore1
;
int
chkIgnore1
;
int
chkIgnore2
;
int
chkIgnore2
;
int
default_rule
;
int
hide_setname
;
int
hide_setname
;
int
hide_hint_button
;
int
hide_hint_button
;
int
control_mode
;
int
control_mode
;
...
@@ -90,6 +91,7 @@ struct BotInfo {
...
@@ -90,6 +91,7 @@ struct BotInfo {
wchar_t
desc
[
256
];
wchar_t
desc
[
256
];
bool
support_master_rule_3
;
bool
support_master_rule_3
;
bool
support_new_master_rule
;
bool
support_new_master_rule
;
bool
support_master_rule_2020
;
};
};
struct
FadingUnit
{
struct
FadingUnit
{
...
@@ -354,7 +356,7 @@ public:
...
@@ -354,7 +356,7 @@ public:
irr
::
gui
::
IGUIStaticText
*
stBotInfo
;
irr
::
gui
::
IGUIStaticText
*
stBotInfo
;
irr
::
gui
::
IGUIButton
*
btnStartBot
;
irr
::
gui
::
IGUIButton
*
btnStartBot
;
irr
::
gui
::
IGUIButton
*
btnBotCancel
;
irr
::
gui
::
IGUIButton
*
btnBotCancel
;
irr
::
gui
::
IGUIC
heckBox
*
chkBotOld
Rule
;
irr
::
gui
::
IGUIC
omboBox
*
cbBot
Rule
;
irr
::
gui
::
IGUICheckBox
*
chkBotHand
;
irr
::
gui
::
IGUICheckBox
*
chkBotHand
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoCheckDeck
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoCheckDeck
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoShuffleDeck
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoShuffleDeck
;
...
@@ -594,7 +596,7 @@ extern Game* mainGame;
...
@@ -594,7 +596,7 @@ extern Game* mainGame;
#define BUTTON_CANCEL_SINGLEPLAY 152
#define BUTTON_CANCEL_SINGLEPLAY 152
#define LISTBOX_BOT_LIST 153
#define LISTBOX_BOT_LIST 153
#define BUTTON_BOT_START 154
#define BUTTON_BOT_START 154
#define C
HECKBOX_BOT_OLD_RULE
155
#define C
OMBOBOX_BOT_RULE
155
#define EDITBOX_CHAT 199
#define EDITBOX_CHAT 199
#define BUTTON_MSG_OK 200
#define BUTTON_MSG_OK 200
...
...
gframe/menu_handler.cpp
View file @
fe5a197c
...
@@ -538,7 +538,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -538,7 +538,12 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
break
;
break
;
}
}
case
CHECKBOX_BOT_OLD_RULE
:
{
}
break
;
}
case
irr
:
:
gui
::
EGET_COMBO_BOX_CHANGED
:
{
switch
(
id
)
{
case
COMBOBOX_BOT_RULE
:
{
mainGame
->
RefreshBot
();
mainGame
->
RefreshBot
();
break
;
break
;
}
}
...
...
strings.conf
View file @
fe5a197c
...
@@ -311,6 +311,7 @@
...
@@ -311,6 +311,7 @@
!
system
1261
大师规则2
!
system
1261
大师规则2
!
system
1262
大师规则3
!
system
1262
大师规则3
!
system
1263
新大师规则
!
system
1263
新大师规则
!
system
1264
大师规则
2020
!
system
1270
卡片信息
!
system
1270
卡片信息
!
system
1271
消息记录
!
system
1271
消息记录
!
system
1272
清除记录
!
system
1272
清除记录
...
@@ -412,7 +413,6 @@
...
@@ -412,7 +413,6 @@
!
system
1380
人机模式
!
system
1380
人机模式
!
system
1381
残局模式
!
system
1381
残局模式
!
system
1382
人机信息:
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1384
电脑锁定出剪刀
!
system
1385
列表为空,可能未安装合适的人机
!
system
1385
列表为空,可能未安装合适的人机
!
system
1390
等待行动中...
!
system
1390
等待行动中...
...
...
system.conf
View file @
fe5a197c
...
@@ -19,6 +19,7 @@ autochain = 0
...
@@ -19,6 +19,7 @@ autochain = 0
waitchain
=
0
waitchain
=
0
mute_opponent
=
0
mute_opponent
=
0
mute_spectators
=
0
mute_spectators
=
0
default_rule
=
0
hide_setname
=
0
hide_setname
=
0
hide_hint_button
=
0
hide_hint_button
=
0
#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
...
...
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