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
05ee5b66
Commit
05ee5b66
authored
Dec 13, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into regex_fh_
parents
13985af2
0939c8b5
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
502 additions
and
113 deletions
+502
-113
gframe/client_card.cpp
gframe/client_card.cpp
+2
-2
gframe/data_manager.cpp
gframe/data_manager.cpp
+35
-0
gframe/data_manager.h
gframe/data_manager.h
+3
-0
gframe/deck_con.cpp
gframe/deck_con.cpp
+4
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+4
-1
gframe/duelclient.h
gframe/duelclient.h
+1
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+6
-1
gframe/game.cpp
gframe/game.cpp
+18
-16
gframe/game.h
gframe/game.h
+6
-5
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+49
-0
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+3
-18
gframe/replay_mode.h
gframe/replay_mode.h
+0
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-10
gframe/single_duel.h
gframe/single_duel.h
+0
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-29
gframe/single_mode.h
gframe/single_mode.h
+0
-2
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-10
gframe/tag_duel.h
gframe/tag_duel.h
+0
-1
lflist.conf
lflist.conf
+362
-6
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+4
-4
No files found.
gframe/client_card.cpp
View file @
05ee5b66
...
@@ -132,7 +132,7 @@ void ClientCard::UpdateInfo(char* buf) {
...
@@ -132,7 +132,7 @@ void ClientCard::UpdateInfo(char* buf) {
int
l
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
)
,
l
,
s
);
equipTarget
=
ecard
;
equipTarget
=
ecard
;
ecard
->
equipped
.
insert
(
this
);
ecard
->
equipped
.
insert
(
this
);
}
}
...
@@ -143,7 +143,7 @@ void ClientCard::UpdateInfo(char* buf) {
...
@@ -143,7 +143,7 @@ void ClientCard::UpdateInfo(char* buf) {
int
l
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
)
,
l
,
s
);
cardTarget
.
insert
(
tcard
);
cardTarget
.
insert
(
tcard
);
tcard
->
ownerTarget
.
insert
(
this
);
tcard
->
ownerTarget
.
insert
(
this
);
}
}
...
...
gframe/data_manager.cpp
View file @
05ee5b66
...
@@ -6,6 +6,7 @@ namespace ygo {
...
@@ -6,6 +6,7 @@ namespace ygo {
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
wchar_t
DataManager
::
strBuffer
[
4096
];
wchar_t
DataManager
::
strBuffer
[
4096
];
byte
DataManager
::
scriptBuffer
[
0x20000
];
DataManager
dataManager
;
DataManager
dataManager
;
bool
DataManager
::
LoadDB
(
const
char
*
file
)
{
bool
DataManager
::
LoadDB
(
const
char
*
file
)
{
...
@@ -310,5 +311,39 @@ int DataManager::CardReader(int code, void* pData) {
...
@@ -310,5 +311,39 @@ int DataManager::CardReader(int code, void* pData) {
memset
(
pData
,
0
,
sizeof
(
CardData
));
memset
(
pData
,
0
,
sizeof
(
CardData
));
return
0
;
return
0
;
}
}
byte
*
DataManager
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
// default script name: ./script/c%d.lua
char
first
[
256
];
char
second
[
256
];
if
(
mainGame
->
gameConf
.
prefer_expansion_script
)
{
sprintf
(
first
,
"expansions/%s"
,
script_name
+
2
);
sprintf
(
second
,
"%s"
,
script_name
+
2
);
}
else
{
sprintf
(
first
,
"%s"
,
script_name
+
2
);
sprintf
(
second
,
"expansions/%s"
,
script_name
+
2
);
}
if
(
ScriptReader
(
first
,
slen
))
return
scriptBuffer
;
else
return
ScriptReader
(
second
,
slen
);
}
byte
*
DataManager
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
#ifdef _WIN32
wchar_t
fname
[
256
];
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
fp
=
_wfopen
(
fname
,
L"rb"
);
#else
fp
=
fopen
(
script_name
,
"rb"
);
#endif
if
(
!
fp
)
return
0
;
int
len
=
fread
(
scriptBuffer
,
1
,
sizeof
(
scriptBuffer
),
fp
);
fclose
(
fp
);
if
(
len
>=
sizeof
(
scriptBuffer
))
return
0
;
*
slen
=
len
;
return
scriptBuffer
;
}
}
}
gframe/data_manager.h
View file @
05ee5b66
...
@@ -49,8 +49,11 @@ public:
...
@@ -49,8 +49,11 @@ public:
wchar_t
lmBuffer
[
32
];
wchar_t
lmBuffer
[
32
];
static
wchar_t
strBuffer
[
4096
];
static
wchar_t
strBuffer
[
4096
];
static
byte
scriptBuffer
[
0x20000
];
static
const
wchar_t
*
unknown_string
;
static
const
wchar_t
*
unknown_string
;
static
int
CardReader
(
int
,
void
*
);
static
int
CardReader
(
int
,
void
*
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
};
};
...
...
gframe/deck_con.cpp
View file @
05ee5b66
...
@@ -676,14 +676,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -676,14 +676,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
return
false
;
return
false
;
}
}
void
DeckBuilder
::
GetHoveredCard
()
{
void
DeckBuilder
::
GetHoveredCard
()
{
int
pre_code
=
hovered_code
;
hovered_pos
=
0
;
hovered_code
=
0
;
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
if
(
root
->
getElementFromPoint
(
mouse_pos
)
!=
root
)
if
(
root
->
getElementFromPoint
(
mouse_pos
)
!=
root
)
return
;
return
;
int
x
=
mouse_pos
.
X
;
int
x
=
mouse_pos
.
X
;
int
y
=
mouse_pos
.
Y
;
int
y
=
mouse_pos
.
Y
;
int
pre_code
=
hovered_code
;
hovered_pos
=
0
;
hovered_code
=
0
;
is_lastcard
=
0
;
is_lastcard
=
0
;
if
(
x
>=
314
&&
x
<=
794
)
{
if
(
x
>=
314
&&
x
<=
794
)
{
if
(
y
>=
164
&&
y
<=
435
)
{
if
(
y
>=
164
&&
y
<=
435
)
{
...
@@ -842,8 +842,8 @@ void DeckBuilder::FilterCards() {
...
@@ -842,8 +842,8 @@ void DeckBuilder::FilterCards() {
element_start
++
;
element_start
++
;
}
}
if
(
element_start
<
str
.
size
())
{
if
(
element_start
<
str
.
size
())
{
element
.
setcode
=
dataManager
.
GetSetCode
(
element
.
keyword
.
c_str
());
element
.
keyword
=
str
.
substr
(
element_start
);
element
.
keyword
=
str
.
substr
(
element_start
);
element
.
setcode
=
dataManager
.
GetSetCode
(
element
.
keyword
.
c_str
());
query_elements
.
push_back
(
element
);
query_elements
.
push_back
(
element
);
}
}
}
}
...
...
gframe/duelclient.cpp
View file @
05ee5b66
...
@@ -24,6 +24,7 @@ char DuelClient::duel_client_read[0x2000];
...
@@ -24,6 +24,7 @@ char DuelClient::duel_client_read[0x2000];
char
DuelClient
::
duel_client_write
[
0x2000
];
char
DuelClient
::
duel_client_write
[
0x2000
];
bool
DuelClient
::
is_closing
=
false
;
bool
DuelClient
::
is_closing
=
false
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_unselect_hint
=
0
;
wchar_t
DuelClient
::
event_string
[
256
];
wchar_t
DuelClient
::
event_string
[
256
];
mtrandom
DuelClient
::
rnd
;
mtrandom
DuelClient
::
rnd
;
...
@@ -1452,7 +1453,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1452,7 +1453,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
std
::
sort
(
mainGame
->
dField
.
selectable_cards
.
begin
(),
mainGame
->
dField
.
selectable_cards
.
end
(),
ClientCard
::
client_card_sort
);
std
::
sort
(
mainGame
->
dField
.
selectable_cards
.
begin
(),
mainGame
->
dField
.
selectable_cards
.
end
(),
ClientCard
::
client_card_sort
);
if
(
select_hint
)
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetDesc
(
select_hint
),
select_unselect_hint
=
select_hint
;
if
(
select_unselect_hint
)
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetDesc
(
select_unselect_hint
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
else
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetSysString
(
560
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
else
myswprintf
(
textBuffer
,
L"%ls(%d-%d)"
,
dataManager
.
GetSysString
(
560
),
mainGame
->
dField
.
select_min
,
mainGame
->
dField
.
select_max
);
select_hint
=
0
;
select_hint
=
0
;
...
...
gframe/duelclient.h
View file @
05ee5b66
...
@@ -30,6 +30,7 @@ private:
...
@@ -30,6 +30,7 @@ private:
static
char
duel_client_write
[
0x2000
];
static
char
duel_client_write
[
0x2000
];
static
bool
is_closing
;
static
bool
is_closing
;
static
int
select_hint
;
static
int
select_hint
;
static
int
select_unselect_hint
;
static
wchar_t
event_string
[
256
];
static
wchar_t
event_string
[
256
];
static
mtrandom
rnd
;
static
mtrandom
rnd
;
public:
public:
...
...
gframe/event_handler.cpp
View file @
05ee5b66
...
@@ -1835,6 +1835,11 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1835,6 +1835,11 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
return
true
;
break
;
break
;
}
}
case
CHECKBOX_PREFER_EXPANSION
:
{
mainGame
->
gameConf
.
prefer_expansion_script
=
mainGame
->
chkPreferExpansionScript
->
isChecked
()
?
1
:
0
;
return
true
;
break
;
}
}
}
break
;
break
;
}
}
...
@@ -2208,7 +2213,7 @@ void ClientField::UpdateChainButtons() {
...
@@ -2208,7 +2213,7 @@ void ClientField::UpdateChainButtons() {
}
}
}
}
void
ClientField
::
ShowCancelOrFinishButton
(
int
buttonOp
)
{
void
ClientField
::
ShowCancelOrFinishButton
(
int
buttonOp
)
{
if
(
!
mainGame
->
chkHideHintButton
->
isChecked
()
&&
!
mainGame
->
dInfo
.
isReplay
)
{
if
(
!
mainGame
->
gameConf
.
hide_hint_button
&&
!
mainGame
->
dInfo
.
isReplay
)
{
switch
(
buttonOp
)
{
switch
(
buttonOp
)
{
case
1
:
case
1
:
mainGame
->
btnCancelOrFinish
->
setText
(
dataManager
.
GetSysString
(
1295
));
mainGame
->
btnCancelOrFinish
->
setText
(
dataManager
.
GetSysString
(
1295
));
...
...
gframe/game.cpp
View file @
05ee5b66
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include "single_mode.h"
#include "single_mode.h"
#include <regex>
#include <regex>
const
unsigned
short
PRO_VERSION
=
0x134
7
;
const
unsigned
short
PRO_VERSION
=
0x134
8
;
namespace
ygo
{
namespace
ygo
{
...
@@ -286,12 +286,6 @@ bool Game::Initialize() {
...
@@ -286,12 +286,6 @@ bool Game::Initialize() {
chkIgnore2
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1291
));
chkIgnore2
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1291
));
chkIgnore2
->
setChecked
(
gameConf
.
chkIgnore2
!=
0
);
chkIgnore2
->
setChecked
(
gameConf
.
chkIgnore2
!=
0
);
posY
+=
30
;
posY
+=
30
;
chkHideSetname
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1354
));
chkHideSetname
->
setChecked
(
gameConf
.
chkHideSetname
!=
0
);
posY
+=
30
;
chkHideHintButton
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1355
));
chkHideHintButton
->
setChecked
(
gameConf
.
chkHideHintButton
!=
0
);
posY
+=
30
;
chkIgnoreDeckChanges
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1357
));
chkIgnoreDeckChanges
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1357
));
chkIgnoreDeckChanges
->
setChecked
(
gameConf
.
chkIgnoreDeckChanges
!=
0
);
chkIgnoreDeckChanges
->
setChecked
(
gameConf
.
chkIgnoreDeckChanges
!=
0
);
posY
+=
30
;
posY
+=
30
;
...
@@ -301,9 +295,12 @@ bool Game::Initialize() {
...
@@ -301,9 +295,12 @@ bool Game::Initialize() {
chkMultiKeywords
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_MULTI_KEYWORDS
,
dataManager
.
GetSysString
(
1378
));
chkMultiKeywords
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_MULTI_KEYWORDS
,
dataManager
.
GetSysString
(
1378
));
chkMultiKeywords
->
setChecked
(
gameConf
.
search_multiple_keywords
>
0
);
chkMultiKeywords
->
setChecked
(
gameConf
.
search_multiple_keywords
>
0
);
posY
+=
30
;
posY
+=
30
;
chkRegex
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_REGEX
,
dataManager
.
GetSysString
(
13
79
));
chkRegex
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_REGEX
,
dataManager
.
GetSysString
(
13
86
));
chkRegex
->
setChecked
(
gameConf
.
search_regex
>
0
);
chkRegex
->
setChecked
(
gameConf
.
search_regex
>
0
);
posY
+=
30
;
posY
+=
30
;
chkPreferExpansionScript
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_PREFER_EXPANSION
,
dataManager
.
GetSysString
(
1379
));
chkPreferExpansionScript
->
setChecked
(
gameConf
.
prefer_expansion_script
!=
0
);
posY
+=
30
;
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable_sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1279
));
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable_sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1279
));
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
);
...
@@ -630,7 +627,7 @@ bool Game::Initialize() {
...
@@ -630,7 +627,7 @@ bool Game::Initialize() {
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabSingle
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabSingle
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
btnSinglePlayCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabSingle
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
btnSinglePlayCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabSingle
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1352
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabSingle
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1352
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabSingle
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
5
5
0
,
280
),
false
,
true
,
tabSingle
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
5
6
0
,
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
);
...
@@ -905,6 +902,7 @@ void Game::RefreshReplay() {
...
@@ -905,6 +902,7 @@ void Game::RefreshReplay() {
}
}
void
Game
::
RefreshSingleplay
()
{
void
Game
::
RefreshSingleplay
()
{
lstSinglePlayList
->
clear
();
lstSinglePlayList
->
clear
();
stSinglePlayInfo
->
setText
(
L""
);
FileSystem
::
TraversalDir
(
L"./single"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./single"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".lua"
,
4
))
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".lua"
,
4
))
lstSinglePlayList
->
addItem
(
name
);
lstSinglePlayList
->
addItem
(
name
);
...
@@ -979,8 +977,8 @@ void Game::LoadConfig() {
...
@@ -979,8 +977,8 @@ void Game::LoadConfig() {
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
chkHideS
etname
=
0
;
gameConf
.
hide_s
etname
=
0
;
gameConf
.
chkHideHintB
utton
=
0
;
gameConf
.
hide_hint_b
utton
=
0
;
gameConf
.
control_mode
=
0
;
gameConf
.
control_mode
=
0
;
gameConf
.
draw_field_spell
=
1
;
gameConf
.
draw_field_spell
=
1
;
gameConf
.
separate_clear_button
=
1
;
gameConf
.
separate_clear_button
=
1
;
...
@@ -992,6 +990,7 @@ void Game::LoadConfig() {
...
@@ -992,6 +990,7 @@ void Game::LoadConfig() {
gameConf
.
enable_bot_mode
=
0
;
gameConf
.
enable_bot_mode
=
0
;
gameConf
.
quick_animation
=
0
;
gameConf
.
quick_animation
=
0
;
gameConf
.
auto_save_replay
=
0
;
gameConf
.
auto_save_replay
=
0
;
gameConf
.
prefer_expansion_script
=
0
;
gameConf
.
enable_sound
=
true
;
gameConf
.
enable_sound
=
true
;
gameConf
.
sound_volume
=
0.5
;
gameConf
.
sound_volume
=
0.5
;
gameConf
.
enable_music
=
true
;
gameConf
.
enable_music
=
true
;
...
@@ -1042,9 +1041,9 @@ void Game::LoadConfig() {
...
@@ -1042,9 +1041,9 @@ void Game::LoadConfig() {
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
chkHideS
etname
=
atoi
(
valbuf
);
gameConf
.
hide_s
etname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
gameConf
.
chkHideHintB
utton
=
atoi
(
valbuf
);
gameConf
.
hide_hint_b
utton
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"control_mode"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"control_mode"
))
{
gameConf
.
control_mode
=
atoi
(
valbuf
);
gameConf
.
control_mode
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"draw_field_spell"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"draw_field_spell"
))
{
...
@@ -1067,6 +1066,8 @@ void Game::LoadConfig() {
...
@@ -1067,6 +1066,8 @@ void Game::LoadConfig() {
gameConf
.
quick_animation
=
atoi
(
valbuf
);
gameConf
.
quick_animation
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"auto_save_replay"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"auto_save_replay"
))
{
gameConf
.
auto_save_replay
=
atoi
(
valbuf
);
gameConf
.
auto_save_replay
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"prefer_expansion_script"
))
{
gameConf
.
prefer_expansion_script
=
atoi
(
valbuf
);
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
gameConf
.
enable_sound
=
atoi
(
valbuf
)
>
0
;
gameConf
.
enable_sound
=
atoi
(
valbuf
)
>
0
;
...
@@ -1128,8 +1129,8 @@ void Game::SaveConfig() {
...
@@ -1128,8 +1129,8 @@ 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
,
"hide_setname = %d
\n
"
,
(
chkHideSetname
->
isChecked
()
?
1
:
0
)
);
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
gameConf
.
hide_setname
);
fprintf
(
fp
,
"hide_hint_button = %d
\n
"
,
(
chkHideHintButton
->
isChecked
()
?
1
:
0
)
);
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
"
);
fprintf
(
fp
,
"control_mode = %d
\n
"
,
gameConf
.
control_mode
);
fprintf
(
fp
,
"control_mode = %d
\n
"
,
gameConf
.
control_mode
);
fprintf
(
fp
,
"draw_field_spell = %d
\n
"
,
gameConf
.
draw_field_spell
);
fprintf
(
fp
,
"draw_field_spell = %d
\n
"
,
gameConf
.
draw_field_spell
);
...
@@ -1144,6 +1145,7 @@ void Game::SaveConfig() {
...
@@ -1144,6 +1145,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
fprintf
(
fp
,
"quick_animation = %d
\n
"
,
gameConf
.
quick_animation
);
fprintf
(
fp
,
"quick_animation = %d
\n
"
,
gameConf
.
quick_animation
);
fprintf
(
fp
,
"auto_save_replay = %d
\n
"
,
(
chkAutoSaveReplay
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"auto_save_replay = %d
\n
"
,
(
chkAutoSaveReplay
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"prefer_expansion_script = %d
\n
"
,
gameConf
.
prefer_expansion_script
);
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
fprintf
(
fp
,
"enable_sound = %d
\n
"
,
(
chkEnableSound
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"enable_sound = %d
\n
"
,
(
chkEnableSound
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"enable_music = %d
\n
"
,
(
chkEnableMusic
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"enable_music = %d
\n
"
,
(
chkEnableMusic
->
isChecked
()
?
1
:
0
));
...
@@ -1170,7 +1172,7 @@ void Game::ShowCardInfo(int code) {
...
@@ -1170,7 +1172,7 @@ void Game::ShowCardInfo(int code) {
else
myswprintf
(
formatBuffer
,
L"%ls[%08d]"
,
dataManager
.
GetName
(
code
),
code
);
else
myswprintf
(
formatBuffer
,
L"%ls[%08d]"
,
dataManager
.
GetName
(
code
),
code
);
stName
->
setText
(
formatBuffer
);
stName
->
setText
(
formatBuffer
);
int
offset
=
0
;
int
offset
=
0
;
if
(
!
chkHideSetname
->
isChecked
()
)
{
if
(
!
gameConf
.
hide_setname
)
{
unsigned
long
long
sc
=
cd
.
setcode
;
unsigned
long
long
sc
=
cd
.
setcode
;
if
(
cd
.
alias
)
{
if
(
cd
.
alias
)
{
auto
aptr
=
dataManager
.
_datas
.
find
(
cd
.
alias
);
auto
aptr
=
dataManager
.
_datas
.
find
(
cd
.
alias
);
...
...
gframe/game.h
View file @
05ee5b66
...
@@ -33,8 +33,8 @@ struct Config {
...
@@ -33,8 +33,8 @@ struct Config {
int
chkWaitChain
;
int
chkWaitChain
;
int
chkIgnore1
;
int
chkIgnore1
;
int
chkIgnore2
;
int
chkIgnore2
;
int
chkHideS
etname
;
int
hide_s
etname
;
int
chkHideHintB
utton
;
int
hide_hint_b
utton
;
int
control_mode
;
int
control_mode
;
int
draw_field_spell
;
int
draw_field_spell
;
int
separate_clear_button
;
int
separate_clear_button
;
...
@@ -46,6 +46,7 @@ struct Config {
...
@@ -46,6 +46,7 @@ struct Config {
int
enable_bot_mode
;
int
enable_bot_mode
;
int
quick_animation
;
int
quick_animation
;
int
auto_save_replay
;
int
auto_save_replay
;
int
prefer_expansion_script
;
bool
enable_sound
;
bool
enable_sound
;
bool
enable_music
;
bool
enable_music
;
double
sound_volume
;
double
sound_volume
;
...
@@ -247,11 +248,10 @@ public:
...
@@ -247,11 +248,10 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSaveReplay
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSaveReplay
;
irr
::
gui
::
IGUICheckBox
*
chkHideSetname
;
irr
::
gui
::
IGUICheckBox
*
chkHideHintButton
;
irr
::
gui
::
IGUICheckBox
*
chkIgnoreDeckChanges
;
irr
::
gui
::
IGUICheckBox
*
chkIgnoreDeckChanges
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSearch
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSearch
;
irr
::
gui
::
IGUICheckBox
*
chkMultiKeywords
;
irr
::
gui
::
IGUICheckBox
*
chkMultiKeywords
;
irr
::
gui
::
IGUICheckBox
*
chkPreferExpansionScript
;
irr
::
gui
::
IGUICheckBox
*
chkRegex
;
irr
::
gui
::
IGUICheckBox
*
chkRegex
;
irr
::
gui
::
IGUICheckBox
*
chkEnableSound
;
irr
::
gui
::
IGUICheckBox
*
chkEnableSound
;
irr
::
gui
::
IGUICheckBox
*
chkEnableMusic
;
irr
::
gui
::
IGUICheckBox
*
chkEnableMusic
;
...
@@ -631,7 +631,8 @@ extern Game* mainGame;
...
@@ -631,7 +631,8 @@ extern Game* mainGame;
#define BUTTON_CANCEL_SINGLEPLAY 352
#define BUTTON_CANCEL_SINGLEPLAY 352
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_REGEX 373
#define CHECKBOX_PREFER_EXPANSION 373
#define CHECKBOX_REGEX 374
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
#define SCROLL_VOLUME 363
...
...
gframe/menu_handler.cpp
View file @
05ee5b66
...
@@ -457,6 +457,55 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -457,6 +457,55 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
repinfo
.
c_str
());
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
repinfo
.
c_str
());
break
;
break
;
}
}
case
LISTBOX_SINGLEPLAY_LIST
:
{
int
sel
=
mainGame
->
lstSinglePlayList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
const
wchar_t
*
name
=
mainGame
->
lstSinglePlayList
->
getListItem
(
sel
);
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
FILE
*
fp
;
#ifdef _WIN32
fp
=
_wfopen
(
fname
,
L"rb"
);
#else
char
filename
[
256
];
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
fp
=
fopen
(
filename
,
"rb"
);
#endif
if
(
!
fp
)
{
mainGame
->
stSinglePlayInfo
->
setText
(
L""
);
break
;
}
char
linebuf
[
1024
];
wchar_t
wlinebuf
[
1024
];
std
::
wstring
message
=
L""
;
bool
in_message
=
false
;
while
(
fgets
(
linebuf
,
1024
,
fp
))
{
if
(
!
strncmp
(
linebuf
,
"--[[message"
,
11
))
{
size_t
len
=
strlen
(
linebuf
);
char
*
msgend
=
strrchr
(
linebuf
,
']'
);
if
(
len
<=
13
)
{
in_message
=
true
;
continue
;
}
else
if
(
len
>
15
&&
msgend
)
{
*
(
msgend
-
1
)
=
'\0'
;
BufferIO
::
DecodeUTF8
(
linebuf
+
12
,
wlinebuf
);
message
.
append
(
wlinebuf
);
break
;
}
}
if
(
!
strncmp
(
linebuf
,
"]]"
,
2
))
{
in_message
=
false
;
break
;
}
if
(
in_message
)
{
BufferIO
::
DecodeUTF8
(
linebuf
,
wlinebuf
);
message
.
append
(
wlinebuf
);
}
}
mainGame
->
SetStaticText
(
mainGame
->
stSinglePlayInfo
,
200
,
mainGame
->
guiFont
,
message
.
c_str
());
break
;
}
case
LISTBOX_BOT_LIST
:
{
case
LISTBOX_BOT_LIST
:
{
int
sel
=
mainGame
->
lstBotList
->
getSelected
();
int
sel
=
mainGame
->
lstBotList
->
getSelected
();
if
(
sel
==
-
1
)
if
(
sel
==
-
1
)
...
...
gframe/replay_mode.cpp
View file @
05ee5b66
...
@@ -63,15 +63,9 @@ int ReplayMode::ReplayThread(void* param) {
...
@@ -63,15 +63,9 @@ int ReplayMode::ReplayThread(void* param) {
mainGame
->
dInfo
.
isSingleMode
=
!!
(
rh
.
flag
&
REPLAY_SINGLE_MODE
);
mainGame
->
dInfo
.
isSingleMode
=
!!
(
rh
.
flag
&
REPLAY_SINGLE_MODE
);
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
if
(
mainGame
->
dInfo
.
isSingleMode
)
{
set_script_reader
((
script_reader
)
DataManager
::
ScriptReaderEx
);
set_script_reader
((
script_reader
)
SingleMode
::
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
else
{
set_script_reader
((
script_reader
)
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
if
(
!
StartDuel
())
{
if
(
!
StartDuel
())
{
EndDuel
();
EndDuel
();
return
0
;
return
0
;
...
@@ -935,15 +929,6 @@ void ReplayMode::ReplayReload() {
...
@@ -935,15 +929,6 @@ void ReplayMode::ReplayReload() {
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
}
byte
*
ReplayMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
ReplayMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
ReplayMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/replay_mode.h
View file @
05ee5b66
...
@@ -47,7 +47,6 @@ public:
...
@@ -47,7 +47,6 @@ public:
static
void
ReplayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
ReplayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
ReplayReload
();
static
void
ReplayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
};
};
...
...
gframe/single_duel.cpp
View file @
05ee5b66
...
@@ -406,7 +406,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -406,7 +406,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
}
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
set_script_reader
((
script_reader
)
ScriptReaderEx
);
set_script_reader
((
script_reader
)
DataManager
::
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
SingleDuel
::
MessageHandler
);
set_message_handler
((
message_handler
)
SingleDuel
::
MessageHandler
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
@@ -1544,15 +1544,6 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
...
@@ -1544,15 +1544,6 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
NetServer
::
ReSendToPlayer
(
*
pit
);
NetServer
::
ReSendToPlayer
(
*
pit
);
}
}
}
}
byte
*
SingleDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
SingleDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
SingleDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/single_duel.h
View file @
05ee5b66
...
@@ -38,7 +38,6 @@ public:
...
@@ -38,7 +38,6 @@ public:
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
SingleTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
gframe/single_mode.cpp
View file @
05ee5b66
...
@@ -11,8 +11,6 @@ bool SingleMode::is_closing = false;
...
@@ -11,8 +11,6 @@ bool SingleMode::is_closing = false;
bool
SingleMode
::
is_continuing
=
false
;
bool
SingleMode
::
is_continuing
=
false
;
Replay
SingleMode
::
last_replay
;
Replay
SingleMode
::
last_replay
;
static
byte
buffer
[
0x20000
];
bool
SingleMode
::
StartPlay
()
{
bool
SingleMode
::
StartPlay
()
{
Thread
::
NewThread
(
SinglePlayThread
,
0
);
Thread
::
NewThread
(
SinglePlayThread
,
0
);
return
true
;
return
true
;
...
@@ -38,7 +36,7 @@ int SingleMode::SinglePlayThread(void* param) {
...
@@ -38,7 +36,7 @@ int SingleMode::SinglePlayThread(void* param) {
mtrandom
rnd
;
mtrandom
rnd
;
time_t
seed
=
time
(
0
);
time_t
seed
=
time
(
0
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
set_script_reader
((
script_reader
)
ScriptReaderEx
);
set_script_reader
((
script_reader
)
DataManager
::
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
pduel
=
create_duel
(
rnd
.
rand
());
pduel
=
create_duel
(
rnd
.
rand
());
...
@@ -852,32 +850,6 @@ void SingleMode::SinglePlayReload() {
...
@@ -852,32 +850,6 @@ void SingleMode::SinglePlayReload() {
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
}
byte
*
SingleMode
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
if
(
ScriptReader
(
sname
,
slen
))
return
buffer
;
else
return
ScriptReader
(
script_name
,
slen
);
}
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
#ifdef _WIN32
wchar_t
fname
[
256
];
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
fp
=
_wfopen
(
fname
,
L"rb"
);
#else
fp
=
fopen
(
script_name
,
"rb"
);
#endif
if
(
!
fp
)
return
0
;
int
len
=
fread
(
buffer
,
1
,
sizeof
(
buffer
),
fp
);
fclose
(
fp
);
if
(
len
>=
sizeof
(
buffer
))
return
0
;
*
slen
=
len
;
return
buffer
;
}
int
SingleMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
SingleMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/single_mode.h
View file @
05ee5b66
...
@@ -26,8 +26,6 @@ public:
...
@@ -26,8 +26,6 @@ public:
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
void
SinglePlayReload
();
static
void
SinglePlayReload
();
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
protected:
protected:
...
...
gframe/tag_duel.cpp
View file @
05ee5b66
...
@@ -381,7 +381,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
...
@@ -381,7 +381,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
}
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
set_script_reader
((
script_reader
)
ScriptReaderEx
);
set_script_reader
((
script_reader
)
DataManager
::
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
TagDuel
::
MessageHandler
);
set_message_handler
((
message_handler
)
TagDuel
::
MessageHandler
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
@@ -1661,15 +1661,6 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
...
@@ -1661,15 +1661,6 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
}
}
}
}
}
}
byte
*
TagDuel
::
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
)
{
char
sname
[
256
]
=
"./expansions"
;
strcat
(
sname
,
script_name
+
1
);
//default script name: ./script/c%d.lua
byte
*
buffer
=
default_script_reader
(
sname
,
slen
);
if
(
buffer
)
return
buffer
;
else
return
default_script_reader
(
script_name
,
slen
);
}
int
TagDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
int
TagDuel
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
if
(
!
enable_log
)
return
0
;
return
0
;
...
...
gframe/tag_duel.h
View file @
05ee5b66
...
@@ -38,7 +38,6 @@ public:
...
@@ -38,7 +38,6 @@ public:
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshExtra
(
int
player
,
int
flag
=
0x81fff
,
int
use_cache
=
1
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
void
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0xf81fff
);
static
byte
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
static
void
TagTimer
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
lflist.conf
View file @
05ee5b66
This diff is collapsed.
Click to expand it.
ocgcore
@
d5d91f86
Subproject commit
b4f974c781473481cfb8ee4e31754b44ba3768f2
Subproject commit
d5d91f86a177244c2ae1b88a4a74a5f59bf82ce5
script
@
9845ffd0
Subproject commit
87b2a039e3b02c8fad75aa53719095e60c866466
Subproject commit
9845ffd083503c65aed5b4660b3eb0c49b173fce
strings.conf
View file @
05ee5b66
...
@@ -382,8 +382,6 @@
...
@@ -382,8 +382,6 @@
!
system
1351
投降
!
system
1351
投降
!
system
1352
主要信息:
!
system
1352
主要信息:
!
system
1353
播放起始于回合:
!
system
1353
播放起始于回合:
!
system
1354
不显示卡片系列
!
system
1355
不显示提示按钮
!
system
1356
是否要放弃对卡组的修改?
!
system
1356
是否要放弃对卡组的修改?
!
system
1357
不提示保留对卡组的修改
!
system
1357
不提示保留对卡组的修改
!
system
1358
键入关键字后自动进行搜索
!
system
1358
键入关键字后自动进行搜索
...
@@ -401,13 +399,14 @@
...
@@ -401,13 +399,14 @@
!
system
1373
名称↓
!
system
1373
名称↓
!
system
1374
连接标记
!
system
1374
连接标记
!
system
1378
使用多个关键词搜索卡片
!
system
1378
使用多个关键词搜索卡片
!
system
1379
使用正则表达式搜索卡片
!
system
1379
启用扩展卡包调试模式
!
system
1380
人机模式
!
system
1380
人机模式
!
system
1381
残局模式
!
system
1381
残局模式
!
system
1382
人机信息:
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1384
电脑锁定出剪刀
!
system
1385
列表为空,可能未安装合适的人机
!
system
1385
列表为空,可能未安装合适的人机
!
system
1386
使用正则表达式搜索卡片
!
system
1390
等待行动中...
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
!
system
1392
等待行动中.....
...
@@ -742,7 +741,7 @@
...
@@ -742,7 +741,7 @@
!
setname
0
x82
怒怒怒 ドドド
!
setname
0
x82
怒怒怒 ドドド
!
setname
0
x83
机关傀儡 ギミック・パペット
!
setname
0
x83
机关傀儡 ギミック・パペット
!
setname
0
x84
燃烧拳击手
BK
(バーニングナックラー)
!
setname
0
x84
燃烧拳击手
BK
(バーニングナックラー)
!
setname
0
x85
超级防
御
机器人
SD
ロボ
!
setname
0
x85
超级防
卫
机器人
SD
ロボ
!
setname
0
x86
光天使
!
setname
0
x86
光天使
!
setname
0
x87
阴影 アンブラル
!
setname
0
x87
阴影 アンブラル
!
setname
0
x88
武神
!
setname
0
x88
武神
...
@@ -820,6 +819,7 @@
...
@@ -820,6 +819,7 @@
!
setname
0
xbf
灵使 霊使い
!
setname
0
xbf
灵使 霊使い
!
setname
0
xc0
凭依装着 憑依装着
!
setname
0
xc0
凭依装着 憑依装着
!
setname
0
xc1
PSY
骨架
PSY
フレーム
!
setname
0
xc1
PSY
骨架
PSY
フレーム
!
setname
0
x10c1
PSY
骨架装备
PSY
フレームギア
!
setname
0
xc2
动力工具 パワー・ツール
!
setname
0
xc2
动力工具 パワー・ツール
!
setname
0
xc3
锋利小鬼 エッジインプ
!
setname
0
xc3
锋利小鬼 エッジインプ
!
setname
0
xc4
神数 セフィラ
!
setname
0
xc4
神数 セフィラ
...
...
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