Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
9111477b
Commit
9111477b
authored
Sep 29, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server
parents
dcf1c266
c8f5fa9b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
138 additions
and
90 deletions
+138
-90
gframe/client_field.cpp
gframe/client_field.cpp
+37
-7
gframe/drawing.cpp
gframe/drawing.cpp
+2
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+14
-11
gframe/game.cpp
gframe/game.cpp
+7
-0
gframe/game.h
gframe/game.h
+3
-0
gframe/gframe.cpp
gframe/gframe.cpp
+69
-65
strings.conf
strings.conf
+1
-0
system.conf
system.conf
+3
-3
No files found.
gframe/client_field.cpp
View file @
9111477b
...
...
@@ -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/drawing.cpp
View file @
9111477b
...
...
@@ -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
)
{
...
...
gframe/duelclient.cpp
View file @
9111477b
...
...
@@ -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 @
9111477b
...
...
@@ -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,7 +979,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
mcard
->
controler
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
...
...
@@ -994,7 +994,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
mcard
->
controler
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
...
...
@@ -1411,12 +1411,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 +1460,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
();
...
...
@@ -1574,7 +1574,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
else
{
should_show_tip
=
false
;
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
[
mcard
->
controler
]);
mainGame
->
stName
->
setText
(
L""
);
mainGame
->
stInfo
->
setText
(
L""
);
mainGame
->
stDataInfo
->
setText
(
L""
);
...
...
@@ -1805,6 +1805,9 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
break
;
}
case
CHECKBOX_QUICK_ANIMATION
:
{
mainGame
->
gameConf
.
quick_animation
=
mainGame
->
chkQuickAnimation
->
isChecked
()
?
1
:
0
;
}
}
break
;
}
...
...
gframe/game.cpp
View file @
9111477b
...
...
@@ -300,6 +300,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
;
...
...
@@ -1091,6 +1094,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
;
...
...
@@ -1158,6 +1162,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
;
...
...
@@ -1230,6 +1236,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
));
...
...
gframe/game.h
View file @
9111477b
...
...
@@ -47,6 +47,7 @@ struct Config {
int
chkIgnoreDeckChanges
;
int
defaultOT
;
int
enable_bot_mode
;
int
quick_animation
;
bool
enable_sound
;
bool
enable_music
;
double
sound_volume
;
...
...
@@ -252,6 +253,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
;
...
...
@@ -642,6 +644,7 @@ extern HostInfo game_info;
#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 @
9111477b
...
...
@@ -13,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
;
...
...
@@ -53,11 +37,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
...
...
@@ -121,103 +109,114 @@ int main(int argc, char* argv[]) {
if
(
!
ygo
::
mainGame
->
Initialize
())
return
0
;
#ifdef _WIN32
int
wargc
;
wchar_t
**
wargv
=
CommandLineToArgvW
(
GetCommandLineW
(),
&
wargc
);
#else
int
wargc
=
argc
;
wchar_t
(
*
wargv
)[
256
]
=
new
wchar_t
[
wargc
][
256
];
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
);
...
...
@@ -225,6 +224,11 @@ int main(int argc, char* argv[]) {
}
}
}
#ifdef _WIN32
LocalFree
(
wargv
);
#else
delete
[]
wargv
;
#endif
ygo
::
mainGame
->
MainLoop
();
#ifdef _WIN32
WSACleanup
();
...
...
strings.conf
View file @
9111477b
...
...
@@ -320,6 +320,7 @@
!
system
1296
完成选择
!
system
1297
切洗手卡
!
system
1298
辅助功能
!
system
1299
加快动画效果
!
system
1300
禁限卡表:
!
system
1301
卡组列表:
!
system
1302
保存
...
...
system.conf
View file @
9111477b
...
...
@@ -3,7 +3,7 @@
use_d3d
=
0
use_image_scale
=
1
antialias
=
2
errorlog
=
1
errorlog
=
3
nickname
=
Player
gamename
=
Game
lastdeck
=
new
...
...
@@ -13,14 +13,14 @@ serverport = 7911
lasthost
=
127
.
0
.
0
.
1
lastport
=
7911
automonsterpos
=
0
autospellpos
=
1
autospellpos
=
0
randompos
=
0
autochain
=
0
waitchain
=
0
mute_opponent
=
0
mute_spectators
=
0
hide_setname
=
0
hide_hint_button
=
1
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
draw_field_spell
=
1
...
...
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