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
List
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
xiaoye
ygopro
Commits
6aaa2af5
Commit
6aaa2af5
authored
Oct 01, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
parents
4b95741d
5807e78b
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
676 additions
and
264 deletions
+676
-264
gframe/bufferio.h
gframe/bufferio.h
+27
-3
gframe/client_field.cpp
gframe/client_field.cpp
+37
-7
gframe/config.h
gframe/config.h
+5
-3
gframe/deck_con.cpp
gframe/deck_con.cpp
+3
-1
gframe/drawing.cpp
gframe/drawing.cpp
+3
-3
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+17
-30
gframe/game.cpp
gframe/game.cpp
+17
-1
gframe/game.h
gframe/game.h
+4
-0
gframe/gframe.cpp
gframe/gframe.cpp
+67
-65
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-7
gframe/premake4.lua
gframe/premake4.lua
+1
-1
gframe/replay.cpp
gframe/replay.cpp
+6
-3
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+5
-9
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+6
-6
lflist.conf
lflist.conf
+470
-119
premake4.lua
premake4.lua
+1
-1
strings.conf
strings.conf
+1
-0
system.conf
system.conf
+2
-2
No files found.
gframe/bufferio.h
View file @
6aaa2af5
...
...
@@ -60,7 +60,7 @@ public:
*
pstr
=
0
;
return
l
;
}
// U
CS-
2 to UTF-8
// U
TF-16/UTF-3
2 to UTF-8
static
int
EncodeUTF8
(
const
wchar_t
*
wsrc
,
char
*
str
)
{
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
...
...
@@ -71,18 +71,35 @@ public:
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
str
[
1
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
2
;
}
else
{
}
else
if
(
*
wsrc
<
0x10000
&&
(
*
wsrc
<
0xd800
||
*
wsrc
>
0xdfff
))
{
str
[
0
]
=
((
*
wsrc
>>
12
)
&
0xf
)
|
0xe0
;
str
[
1
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
3
;
}
else
{
#ifdef _WIN32
unsigned
unicode
=
0
;
unicode
|=
(
*
wsrc
++
&
0x3ff
)
<<
10
;
unicode
|=
*
wsrc
&
0x3ff
;
unicode
+=
0x10000
;
str
[
0
]
=
((
unicode
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
unicode
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
unicode
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
unicode
)
&
0x3f
)
|
0x80
;
#else
str
[
0
]
=
((
*
wsrc
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
*
wsrc
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
#endif // _WIN32
str
+=
4
;
}
wsrc
++
;
}
*
str
=
0
;
return
str
-
pstr
;
}
// UTF-8 to U
CS-
2
// UTF-8 to U
TF-16/UTF-3
2
static
int
DecodeUTF8
(
const
char
*
src
,
wchar_t
*
wstr
)
{
const
char
*
p
=
src
;
wchar_t
*
wp
=
wstr
;
...
...
@@ -97,7 +114,14 @@ public:
*
wp
=
(((
unsigned
)
p
[
0
]
&
0xf
)
<<
12
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
2
]
&
0x3f
);
p
+=
3
;
}
else
if
((
*
p
&
0xf8
)
==
0xf0
)
{
#ifdef _WIN32
unsigned
unicode
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
unicode
-=
0x10000
;
*
wp
++
=
(
unicode
>>
10
)
|
0xd800
;
*
wp
=
(
unicode
&
0x3ff
)
|
0xdc00
;
#else
*
wp
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
#endif // _WIN32
p
+=
4
;
}
else
p
++
;
...
...
gframe/client_field.cpp
View file @
6aaa2af5
...
...
@@ -399,7 +399,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
else
if
(
conti_selecting
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
...
...
@@ -483,7 +483,7 @@ void ClientField::ShowChainCard() {
if
(
selectable_cards
[
i
]
->
code
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
...
...
@@ -538,7 +538,7 @@ void ClientField::ShowLocationCard() {
if
(
display_cards
[
i
]
->
code
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardDisplay
[
i
],
display_cards
[
i
]
->
code
));
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
]
->
controler
]);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
...
...
@@ -1424,8 +1424,23 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
ancard
.
push_back
(
trycode
);
return
;
}
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
return
;
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
{
std
::
vector
<
int
>
cache
;
cache
.
swap
(
ancard
);
int
sel
=
mainGame
->
lstANCard
->
getSelected
();
int
selcode
=
(
sel
==
-
1
)
?
0
:
cache
[
sel
];
mainGame
->
lstANCard
->
clear
();
for
(
const
auto
&
trycode
:
cache
)
{
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
is_declarable
(
cd
,
declarable_type
))
{
ancard
.
push_back
(
trycode
);
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
.
c_str
());
if
(
trycode
==
selcode
)
mainGame
->
lstANCard
->
setSelected
(
cstr
.
name
.
c_str
());
}
}
if
(
!
ancard
.
empty
())
return
;
}
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
...
...
@@ -1456,8 +1471,23 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
ancard
.
push_back
(
trycode
);
return
;
}
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
return
;
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
{
std
::
vector
<
int
>
cache
;
cache
.
swap
(
ancard
);
int
sel
=
mainGame
->
lstANCard
->
getSelected
();
int
selcode
=
(
sel
==
-
1
)
?
0
:
cache
[
sel
];
mainGame
->
lstANCard
->
clear
();
for
(
const
auto
&
trycode
:
cache
)
{
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
is_declarable
(
cd
,
opcode
))
{
ancard
.
push_back
(
trycode
);
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
.
c_str
());
if
(
trycode
==
selcode
)
mainGame
->
lstANCard
->
setSelected
(
cstr
.
name
.
c_str
());
}
}
if
(
!
ancard
.
empty
())
return
;
}
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
...
...
gframe/config.h
View file @
6aaa2af5
...
...
@@ -12,11 +12,9 @@
#include <ws2tcpip.h>
#ifdef _MSC_VER
#define myswprintf _swprintf
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else
#define myswprintf swprintf
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
#endif
...
...
@@ -44,7 +42,6 @@
#define SOCKET_ERRNO() (errno)
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
inline
int
_wtoi
(
const
wchar_t
*
s
)
{
...
...
@@ -53,6 +50,11 @@ inline int _wtoi(const wchar_t * s) {
}
#endif
template
<
size_t
N
,
typename
...
TR
>
inline
int
myswprintf
(
wchar_t
(
&
buf
)[
N
],
const
wchar_t
*
fmt
,
TR
...
args
)
{
return
swprintf
(
buf
,
N
,
fmt
,
args
...);
}
#include <irrlicht.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
...
...
gframe/deck_con.cpp
View file @
6aaa2af5
...
...
@@ -62,6 +62,7 @@ static bool check_set_code(const CardDataC& data, int set_code) {
void
DeckBuilder
::
Initialize
()
{
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
false
;
mainGame
->
ClearCardInfo
();
mainGame
->
wInfos
->
setVisible
(
true
);
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wDeckEdit
->
setVisible
(
true
);
...
...
@@ -91,6 +92,7 @@ void DeckBuilder::Initialize() {
}
void
DeckBuilder
::
Terminate
()
{
mainGame
->
is_building
=
false
;
mainGame
->
ClearCardInfo
();
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wCategories
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
...
...
@@ -234,7 +236,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1410
));
break
;
}
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]
);
mainGame
->
ClearCardInfo
(
);
char
deckbuf
[
1024
];
char
*
pdeck
=
deckbuf
;
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
main
.
size
()
+
deckManager
.
current_deck
.
extra
.
size
());
...
...
gframe/drawing.cpp
View file @
6aaa2af5
...
...
@@ -968,7 +968,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
FadingUnit
fu
;
fu
.
fadingSize
=
win
->
getRelativePosition
();
for
(
auto
fit
=
fadingList
.
begin
();
fit
!=
fadingList
.
end
();
++
fit
)
if
(
win
==
fit
->
guiFading
)
if
(
win
==
fit
->
guiFading
&&
win
!=
wOptions
)
// the size of wOptions is always setted by ClientField::ShowSelectOption before showing it
fu
.
fadingSize
=
fit
->
fadingSize
;
irr
::
core
::
position2di
center
=
fu
.
fadingSize
.
getCenter
();
fu
.
fadingDiff
.
X
=
fu
.
fadingSize
.
getWidth
()
/
10
;
...
...
@@ -1043,7 +1043,7 @@ void Game::PopupElement(irr::gui::IGUIElement * element, int hideframe) {
}
void
Game
::
WaitFrameSignal
(
int
frame
)
{
frameSignal
.
Reset
();
signalFrame
=
frame
;
signalFrame
=
(
gameConf
.
quick_animation
&&
frame
>=
12
)
?
12
:
frame
;
frameSignal
.
Wait
();
}
void
Game
::
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
)
{
...
...
@@ -1168,7 +1168,7 @@ void Game::DrawDeckBd() {
textFont
->
draw
(
textBuffer
,
recti
(
859
,
164
+
i
*
66
,
955
,
185
+
i
*
66
),
0xff000000
,
false
,
false
);
textFont
->
draw
(
textBuffer
,
recti
(
860
,
165
+
i
*
66
,
955
,
185
+
i
*
66
),
0xffffffff
,
false
,
false
);
if
(
!
(
ptr
->
second
.
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
ptr
->
second
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
textBuffer
,
L"%ls/%ls %ls%d"
,
dataManager
.
FormatAttribute
(
ptr
->
second
.
attribute
),
dataManager
.
FormatRace
(
ptr
->
second
.
race
),
form
,
ptr
->
second
.
level
);
textFont
->
draw
(
textBuffer
,
recti
(
859
,
186
+
i
*
66
,
955
,
207
+
i
*
66
),
0xff000000
,
false
,
false
);
...
...
gframe/duelclient.cpp
View file @
6aaa2af5
...
...
@@ -3382,7 +3382,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
ebANCard
->
setText
(
L""
);
mainGame
->
wANCard
->
setText
(
textBuffer
);
mainGame
->
dField
.
UpdateDeclarableCode
(
tru
e
);
mainGame
->
dField
.
UpdateDeclarableCode
(
fals
e
);
mainGame
->
PopupElement
(
mainGame
->
wANCard
);
mainGame
->
gMutex
.
Unlock
();
return
false
;
...
...
@@ -3421,7 +3421,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
ebANCard
->
setText
(
L""
);
mainGame
->
wANCard
->
setText
(
textBuffer
);
mainGame
->
dField
.
UpdateDeclarableCode
(
tru
e
);
mainGame
->
dField
.
UpdateDeclarableCode
(
fals
e
);
mainGame
->
PopupElement
(
mainGame
->
wANCard
);
mainGame
->
gMutex
.
Unlock
();
return
false
;
...
...
gframe/event_handler.cpp
View file @
6aaa2af5
...
...
@@ -855,7 +855,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else
if
(
conti_selecting
)
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
+
pos
]
->
controler
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
// text
wchar_t
formatBuffer
[
2048
];
...
...
@@ -916,7 +916,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
display_cards
[
i
+
pos
]
->
code
)
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
display_cards
[
i
+
pos
]
->
code
));
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
+
pos
]
->
controler
]);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
...
...
@@ -979,13 +979,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
mainGame
->
stSetName
->
setText
(
L""
);
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
ClearCardInfo
(
mcard
->
controler
);
}
}
if
(
id
>=
BUTTON_DISPLAY_0
&&
id
<=
BUTTON_DISPLAY_4
)
{
...
...
@@ -994,13 +988,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
mainGame
->
stSetName
->
setText
(
L""
);
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
ClearCardInfo
(
mcard
->
controler
);
}
}
break
;
...
...
@@ -1411,12 +1399,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
if
(
event
.
MouseInput
.
isLeftPressed
())
break
;
s32
x
=
event
.
MouseInput
.
X
;
s32
y
=
event
.
MouseInput
.
Y
;
irr
::
core
::
position2di
pos
(
x
,
y
);
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
if
(
root
->
getElementFromPoint
(
pos
)
==
mainGame
->
btnCancelOrFinish
)
mainGame
->
chkHideHintButton
->
setChecked
(
true
);
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
{
mainGame
->
ignore_chain
=
event
.
MouseInput
.
isRightPressed
();
mainGame
->
always_chain
=
false
;
...
...
@@ -1466,6 +1448,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
position
&
POS_FACEDOWN
)
mcard
=
0
;
}
}
else
if
(
hovered_location
==
LOCATION_EXTRA
)
{
if
(
extra
[
hovered_controler
].
size
())
{
mcard
=
extra
[
hovered_controler
].
back
();
if
(
mcard
->
position
&
POS_FACEDOWN
)
mcard
=
0
;
}
}
else
if
(
hovered_location
==
LOCATION_DECK
)
{
if
(
deck
[
hovered_controler
].
size
())
mcard
=
deck
[
hovered_controler
].
back
();
...
...
@@ -1522,7 +1510,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf
(
formatBuffer
,
L"
\n
%ls/%ls"
,
mcard
->
atkstring
,
mcard
->
defstring
);
str
.
append
(
formatBuffer
);
if
(
!
(
mcard
->
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
mcard
->
rank
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"
\n
%ls%d"
,
form
,
(
mcard
->
level
?
mcard
->
level
:
mcard
->
rank
));
str
.
append
(
formatBuffer
);
...
...
@@ -1574,13 +1562,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
else
{
should_show_tip
=
false
;
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
mainGame
->
stSetName
->
setText
(
L""
);
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
ClearCardInfo
(
mcard
->
controler
);
}
}
hovered_card
=
mcard
;
...
...
@@ -1805,6 +1787,11 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
break
;
}
case
CHECKBOX_QUICK_ANIMATION
:
{
mainGame
->
gameConf
.
quick_animation
=
mainGame
->
chkQuickAnimation
->
isChecked
()
?
1
:
0
;
return
true
;
break
;
}
}
break
;
}
...
...
gframe/game.cpp
View file @
6aaa2af5
...
...
@@ -269,6 +269,9 @@ bool Game::Initialize() {
posY
+=
30
;
chkWaitChain
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
-
1
,
dataManager
.
GetSysString
(
1277
));
chkWaitChain
->
setChecked
(
gameConf
.
chkWaitChain
!=
0
);
posY
+=
30
;
chkQuickAnimation
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
CHECKBOX_QUICK_ANIMATION
,
dataManager
.
GetSysString
(
1299
));
chkQuickAnimation
->
setChecked
(
gameConf
.
quick_animation
!=
0
);
//system
irr
::
gui
::
IGUITab
*
tabSystem
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1273
));
posY
=
20
;
...
...
@@ -1058,6 +1061,7 @@ void Game::LoadConfig() {
gameConf
.
chkIgnoreDeckChanges
=
0
;
gameConf
.
defaultOT
=
1
;
gameConf
.
enable_bot_mode
=
0
;
gameConf
.
quick_animation
=
0
;
gameConf
.
enable_sound
=
true
;
gameConf
.
sound_volume
=
0.5
;
gameConf
.
enable_music
=
true
;
...
...
@@ -1125,6 +1129,8 @@ void Game::LoadConfig() {
gameConf
.
defaultOT
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"enable_bot_mode"
))
{
gameConf
.
enable_bot_mode
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"quick_animation"
))
{
gameConf
.
quick_animation
=
atoi
(
valbuf
);
#ifdef YGOPRO_USE_IRRKLANG
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
gameConf
.
enable_sound
=
atoi
(
valbuf
)
>
0
;
...
...
@@ -1197,6 +1203,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"ignore_deck_changes = %d
\n
"
,
(
chkIgnoreDeckChanges
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"default_ot = %d
\n
"
,
gameConf
.
defaultOT
);
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
fprintf
(
fp
,
"quick_animation = %d
\n
"
,
gameConf
.
quick_animation
);
#ifdef YGOPRO_USE_IRRKLANG
fprintf
(
fp
,
"enable_sound = %d
\n
"
,
(
chkEnableSound
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"enable_music = %d
\n
"
,
(
chkEnableMusic
->
isChecked
()
?
1
:
0
));
...
...
@@ -1243,7 +1250,7 @@ void Game::ShowCardInfo(int code) {
myswprintf
(
formatBuffer
,
L"[%ls] %ls/%ls"
,
dataManager
.
FormatType
(
cd
.
type
),
dataManager
.
FormatRace
(
cd
.
race
),
dataManager
.
FormatAttribute
(
cd
.
attribute
));
stInfo
->
setText
(
formatBuffer
);
if
(
!
(
cd
.
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
cd
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"[%ls%d] "
,
form
,
cd
.
level
);
wchar_t
adBuffer
[
16
];
...
...
@@ -1287,6 +1294,15 @@ void Game::ShowCardInfo(int code) {
const
auto
&
tsize
=
stText
->
getRelativePosition
();
InitStaticText
(
stText
,
tsize
.
getWidth
(),
tsize
.
getHeight
(),
textFont
,
showingtext
);
}
void
Game
::
ClearCardInfo
(
int
player
)
{
imgCard
->
setImage
(
imageManager
.
tCover
[
player
]);
stName
->
setText
(
L""
);
stInfo
->
setText
(
L""
);
stDataInfo
->
setText
(
L""
);
stSetName
->
setText
(
L""
);
stText
->
setText
(
L""
);
scrCardText
->
setVisible
(
false
);
}
void
Game
::
AddChatMsg
(
wchar_t
*
msg
,
int
player
)
{
for
(
int
i
=
7
;
i
>
0
;
--
i
)
{
chatMsg
[
i
]
=
chatMsg
[
i
-
1
];
...
...
gframe/game.h
View file @
6aaa2af5
...
...
@@ -42,6 +42,7 @@ struct Config {
int
chkIgnoreDeckChanges
;
int
defaultOT
;
int
enable_bot_mode
;
int
quick_animation
;
bool
enable_sound
;
bool
enable_music
;
double
sound_volume
;
...
...
@@ -130,6 +131,7 @@ public:
void
LoadConfig
();
void
SaveConfig
();
void
ShowCardInfo
(
int
code
);
void
ClearCardInfo
(
int
player
=
0
);
void
AddChatMsg
(
wchar_t
*
msg
,
int
player
);
void
ClearChatMsg
();
void
AddDebugMsg
(
char
*
msgbuf
);
...
...
@@ -239,6 +241,7 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkRandomPos
;
irr
::
gui
::
IGUICheckBox
*
chkAutoChain
;
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkHideSetname
;
irr
::
gui
::
IGUICheckBox
*
chkHideHintButton
;
irr
::
gui
::
IGUICheckBox
*
chkIgnoreDeckChanges
;
...
...
@@ -623,6 +626,7 @@ extern Game* mainGame;
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
#define CHECKBOX_DISABLE_CHAT 364
#define CHECKBOX_QUICK_ANIMATION 369
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
...
...
gframe/gframe.cpp
View file @
6aaa2af5
...
...
@@ -2,6 +2,7 @@
#include "game.h"
#include "data_manager.h"
#include <event2/thread.h>
#include <memory>
#ifdef __APPLE__
#import <CoreFoundation/CoreFoundation.h>
#endif
...
...
@@ -12,22 +13,6 @@ bool open_file = false;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
wchar_t
arg1
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
BufferIO
::
EncodeUTF8
(
arg1
,
param
);
#else
strcpy
(
param
,
arg
);
#endif
}
void
GetParameterW
(
wchar_t
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
param
,
260
);
#else
BufferIO
::
DecodeUTF8
(
arg
,
param
);
#endif
}
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
irr
::
SEvent
event
;
event
.
EventType
=
irr
::
EET_GUI_EVENT
;
...
...
@@ -51,11 +36,15 @@ int main(int argc, char* argv[]) {
#endif //__APPLE__
#ifdef _WIN32
#ifndef _DEBUG
wchar_t
exepath
[
MAX_PATH
];
GetModuleFileNameW
(
NULL
,
exepath
,
MAX_PATH
);
wchar_t
*
p
=
wcsrchr
(
exepath
,
'\\'
);
*
p
=
'\0'
;
SetCurrentDirectoryW
(
exepath
);
char
*
pstrext
;
if
(
argc
==
2
&&
(
pstrext
=
strrchr
(
argv
[
1
],
'.'
))
&&
(
!
mystrncasecmp
(
pstrext
,
".ydk"
,
4
)
||
!
mystrncasecmp
(
pstrext
,
".yrp"
,
4
)))
{
wchar_t
exepath
[
MAX_PATH
];
GetModuleFileNameW
(
NULL
,
exepath
,
MAX_PATH
);
wchar_t
*
p
=
wcsrchr
(
exepath
,
'\\'
);
*
p
=
'\0'
;
SetCurrentDirectoryW
(
exepath
);
}
#endif //_DEBUG
#endif //_WIN32
#ifdef _WIN32
...
...
@@ -72,103 +61,116 @@ int main(int argc, char* argv[]) {
if
(
!
ygo
::
mainGame
->
Initialize
())
return
0
;
#ifdef _WIN32
int
wargc
;
std
::
unique_ptr
<
wchar_t
*
[],
void
(
*
)(
wchar_t
**
)
>
wargv
(
CommandLineToArgvW
(
GetCommandLineW
(),
&
wargc
),
[](
wchar_t
**
wargv
)
{
LocalFree
(
wargv
);
});
#else
int
wargc
=
argc
;
auto
wargv
=
std
::
make_unique
<
wchar_t
[][
256
]
>
(
wargc
);
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
BufferIO
::
DecodeUTF8
(
argv
[
i
],
wargv
[
i
]);
}
#endif //_WIN32
bool
keep_on_return
=
false
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e
'
)
{
for
(
int
i
=
1
;
i
<
w
argc
;
++
i
)
{
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L'\0
'
)
{
char
param
[
128
];
GetParameter
(
param
,
&
argv
[
i
][
2
]
);
BufferIO
::
EncodeUTF8
(
&
wargv
[
i
][
2
],
param
);
ygo
::
dataManager
.
LoadDB
(
param
);
continue
;
}
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
if
(
!
wcscmp
(
wargv
[
i
],
L
"-e"
))
{
// extra database
++
i
;
char
param
[
128
];
GetParameter
(
param
,
&
argv
[
i
][
0
]);
ygo
::
dataManager
.
LoadDB
(
param
);
if
(
i
<
wargc
)
{
char
param
[
128
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
],
param
);
ygo
::
dataManager
.
LoadDB
(
param
);
}
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-n"
))
{
// nickName
++
i
;
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebNickName
->
setText
(
param
);
if
(
i
<
wargc
)
ygo
::
mainGame
->
ebNickName
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-h"
))
{
// Host address
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-h"
))
{
// Host address
++
i
;
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinHost
->
setText
(
param
);
if
(
i
<
wargc
)
ygo
::
mainGame
->
ebJoinHost
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
// host Port
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-p"
))
{
// host Port
++
i
;
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinPort
->
setText
(
param
);
if
(
i
<
wargc
)
ygo
::
mainGame
->
ebJoinPort
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-w"
))
{
// host passWord
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-w"
))
{
// host passWord
++
i
;
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinPass
->
setText
(
param
);
if
(
i
<
wargc
)
ygo
::
mainGame
->
ebJoinPass
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-k"
))
{
// Keep on return
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-k"
))
{
// Keep on return
exit_on_return
=
false
;
keep_on_return
=
true
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-d"
))
{
// Deck
if
(
i
+
2
<
argc
)
{
// select deck
++
i
;
GetParameterW
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
&
argv
[
i
][
0
]);
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-d"
))
{
// Deck
++
i
;
if
(
i
+
1
<
wargc
)
{
// select deck
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
]);
continue
;
}
else
{
// open deck
exit_on_return
=
!
keep_on_return
;
if
(
i
<
argc
)
{
if
(
i
<
w
argc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
}
else
if
(
!
strcmp
(
argv
[
i
],
"-c"
))
{
// Create host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-c"
))
{
// Create host
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnHostConfirm
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
))
{
// Join host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-j"
))
{
// Join host
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-r"
))
{
// Replay
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-r"
))
{
// Replay
exit_on_return
=
!
keep_on_return
;
if
(
i
<
argc
)
{
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-s"
))
{
// Single
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-s"
))
{
// Single
exit_on_return
=
!
keep_on_return
;
if
(
i
<
argc
)
{
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
ClickButton
(
ygo
::
mainGame
->
btnSingleMode
);
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
break
;
}
else
if
(
argc
==
2
&&
strlen
(
argv
[
1
])
>=
4
)
{
char
*
pstrext
=
argv
[
1
]
+
strlen
(
argv
[
1
])
-
4
;
if
(
!
my
strncasecmp
(
pstrext
,
".ydk"
,
4
))
{
}
else
if
(
wargc
==
2
&&
wcslen
(
w
argv
[
1
])
>=
4
)
{
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
w
argv
[
1
])
-
4
;
if
(
!
my
wcsncasecmp
(
pstrext
,
L
".ydk"
,
4
))
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
1
][
0
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
if
(
!
my
strncasecmp
(
pstrext
,
".yrp"
,
4
))
{
if
(
!
my
wcsncasecmp
(
pstrext
,
L
".yrp"
,
4
))
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
1
][
0
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
...
...
gframe/menu_handler.cpp
View file @
6aaa2af5
...
...
@@ -222,16 +222,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
if
(
!
ReplayMode
::
cur_replay
.
OpenReplay
(
mainGame
->
lstReplayList
->
getListItem
(
mainGame
->
lstReplayList
->
getSelected
())))
break
;
}
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]
);
mainGame
->
ClearCardInfo
(
);
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wInfos
->
setVisible
(
true
);
mainGame
->
wReplay
->
setVisible
(
true
);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
mainGame
->
stSetName
->
setText
(
L""
);
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
wReplayControl
->
setVisible
(
true
);
mainGame
->
btnReplayStart
->
setVisible
(
false
);
mainGame
->
btnReplayPause
->
setVisible
(
true
);
...
...
gframe/premake4.lua
View file @
6aaa2af5
...
...
@@ -28,7 +28,7 @@ project "ygopro"
configuration
{
"windows"
,
"not vs*"
}
includedirs
{
"/mingw/include/irrlicht"
,
"/mingw/include/freetype2"
}
configuration
"not vs*"
buildoptions
{
"-std=
gnu++0x
"
,
"-fno-rtti"
}
buildoptions
{
"-std=
c++14
"
,
"-fno-rtti"
}
configuration
"not windows"
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.3"
,
"/usr/include/lua/5.3"
,
"/usr/include/irrlicht"
,
"/usr/include/freetype2"
}
excludes
{
"COSOperator.*"
}
...
...
gframe/replay.cpp
View file @
6aaa2af5
...
...
@@ -159,7 +159,10 @@ bool Replay::OpenReplay(const wchar_t* name) {
}
if
(
!
fp
)
return
false
;
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
);
if
(
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
)
<
1
)
{
fclose
(
fp
);
return
false
;
}
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
comp_size
=
fread
(
comp_data
,
1
,
0x1000
,
fp
);
fclose
(
fp
);
...
...
@@ -188,9 +191,9 @@ bool Replay::CheckReplay(const wchar_t* name) {
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
size_t
count
=
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
fclose
(
rfp
);
return
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
...
...
gframe/replay_mode.cpp
View file @
6aaa2af5
...
...
@@ -218,7 +218,7 @@ bool ReplayMode::StartDuel() {
size_t
slen
=
cur_replay
.
ReadInt16
();
cur_replay
.
ReadData
(
filename
,
slen
);
filename
[
slen
]
=
0
;
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
{
if
(
!
preload_script
(
pduel
,
filename
,
0
))
{
return
false
;
}
}
...
...
gframe/single_mode.cpp
View file @
6aaa2af5
...
...
@@ -50,17 +50,18 @@ int SingleMode::SinglePlayThread(void* param) {
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
BufferIO
::
CopyWStr
(
mainGame
->
ebNickName
->
getText
(),
mainGame
->
dInfo
.
hostname
,
20
);
mainGame
->
dInfo
.
clientname
[
0
]
=
0
;
mainGame
->
dInfo
.
player_type
=
0
;
mainGame
->
dInfo
.
turn
=
0
;
char
filename
[
256
];
size_t
slen
=
0
;
if
(
open_file
)
{
open_file
=
false
;
slen
=
BufferIO
::
EncodeUTF8
(
open_file_name
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
{
if
(
!
preload_script
(
pduel
,
filename
,
0
))
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
open_file_name
);
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
if
(
!
preload_script
(
pduel
,
filename
,
0
))
slen
=
0
;
}
}
else
{
...
...
@@ -68,7 +69,7 @@ int SingleMode::SinglePlayThread(void* param) {
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
if
(
!
preload_script
(
pduel
,
filename
,
0
))
slen
=
0
;
}
if
(
slen
==
0
)
{
...
...
@@ -82,16 +83,11 @@ int SingleMode::SinglePlayThread(void* param) {
rh
.
seed
=
seed
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ClearCardInfo
();
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wInfos
->
setVisible
(
true
);
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1210
));
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
mainGame
->
stSetName
->
setText
(
L""
);
mainGame
->
stText
->
setText
(
L""
);
mainGame
->
scrCardText
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
true
);
mainGame
->
dField
.
Clear
();
mainGame
->
dInfo
.
isFirst
=
true
;
...
...
gframe/tag_duel.cpp
View file @
6aaa2af5
...
...
@@ -1526,7 +1526,7 @@ void TagDuel::TimeConfirm(DuelPlayer* dp) {
event_add
(
etimer
,
&
timeout
);
}
void
TagDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1552,7 +1552,7 @@ void TagDuel::RefreshMzone(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshSzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1578,7 +1578,7 @@ void TagDuel::RefreshSzone(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshHand
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1606,7 +1606,7 @@ void TagDuel::RefreshHand(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshGrave
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1620,7 +1620,7 @@ void TagDuel::RefreshGrave(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshExtra
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1629,7 +1629,7 @@ void TagDuel::RefreshExtra(int player, int flag, int use_cache) {
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
3
);
}
void
TagDuel
::
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_CARD
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
lflist.conf
View file @
6aaa2af5
This diff is collapsed.
Click to expand it.
premake4.lua
View file @
6aaa2af5
...
...
@@ -25,7 +25,7 @@ solution "ygo"
configuration
"vs*"
flags
"EnableSSE2"
buildoptions
{
"-wd4996"
}
buildoptions
{
"-wd4996"
,
"/utf-8"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
configuration
"not vs*"
...
...
strings.conf
View file @
6aaa2af5
...
...
@@ -320,6 +320,7 @@
!
system
1296
完成选择
!
system
1297
切洗手卡
!
system
1298
辅助功能
!
system
1299
加快动画效果
!
system
1300
禁限卡表:
!
system
1301
卡组列表:
!
system
1302
保存
...
...
system.conf
View file @
6aaa2af5
...
...
@@ -3,7 +3,7 @@
use_d3d
=
0
use_image_scale
=
1
antialias
=
2
errorlog
=
1
errorlog
=
3
nickname
=
Player
gamename
=
Game
lastdeck
=
new
...
...
@@ -13,7 +13,7 @@ serverport = 7911
lasthost
=
127
.
0
.
0
.
1
lastport
=
7911
automonsterpos
=
0
autospellpos
=
1
autospellpos
=
0
randompos
=
0
autochain
=
0
waitchain
=
0
...
...
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