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
f35ecc7d
Commit
f35ecc7d
authored
Dec 31, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update & fix
parent
9ca19022
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
23 deletions
+38
-23
gframe/gframe.cpp
gframe/gframe.cpp
+38
-23
No files found.
gframe/gframe.cpp
View file @
f35ecc7d
...
@@ -8,27 +8,21 @@ bool exit_on_return = false;
...
@@ -8,27 +8,21 @@ bool exit_on_return = false;
bool
open_file
=
false
;
bool
open_file
=
false
;
wchar_t
open_file_name
[
256
]
=
L""
;
wchar_t
open_file_name
[
256
]
=
L""
;
const
char
*
GetParameter
(
const
char
*
arg
)
{
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
#ifdef _WIN32
wchar_t
arg1
[
260
];
wchar_t
arg1
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
char
arg2
[
260
];
BufferIO
::
EncodeUTF8
(
arg1
,
param
);
BufferIO
::
EncodeUTF8
(
arg1
,
arg2
);
return
arg2
;
#else
#else
return
arg
;
strcpy
(
param
,
arg1
)
;
#endif
#endif
}
}
const
wchar_t
*
GetParameterW
(
const
char
*
arg
)
{
void
GetParameterW
(
wchar_t
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
#ifdef _WIN32
wchar_t
arg1
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
param
,
260
);
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
return
arg1
;
#else
#else
wchar_t
arg2
[
260
];
BufferIO
::
DecodeUTF8
(
arg
,
param
);
BufferIO
::
DecodeUTF8
(
arg
,
arg2
);
return
arg2
;
#endif
#endif
}
}
...
@@ -58,41 +52,62 @@ int main(int argc, char* argv[]) {
...
@@ -58,41 +52,62 @@ int main(int argc, char* argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
++
i
;
++
i
;
ygo
::
dataManager
.
LoadDB
(
GetParameter
(
&
argv
[
i
][
0
]));
char
param
[
128
];
GetParameter
(
param
,
&
argv
[
i
][
0
]);
ygo
::
dataManager
.
LoadDB
(
param
);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
++
i
;
++
i
;
ygo
::
mainGame
->
ebNickName
->
setText
(
GetParameterW
(
&
argv
[
i
][
0
]));
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebNickName
->
setText
(
param
);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-h"
))
{
// Host address
}
else
if
(
!
strcmp
(
argv
[
i
],
"-h"
))
{
// Host address
++
i
;
++
i
;
ygo
::
mainGame
->
ebJoinIP
->
setText
(
GetParameterW
(
&
argv
[
i
][
0
]));
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinIP
->
setText
(
param
);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
// host Port
}
else
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
// host Port
++
i
;
++
i
;
ygo
::
mainGame
->
ebJoinPort
->
setText
(
GetParameterW
(
&
argv
[
i
][
0
]));
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinPort
->
setText
(
param
);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-w"
))
{
// host passWord
}
else
if
(
!
strcmp
(
argv
[
i
],
"-w"
))
{
// host passWord
++
i
;
++
i
;
ygo
::
mainGame
->
ebJoinPass
->
setText
(
GetParameterW
(
&
argv
[
i
][
0
]));
wchar_t
param
[
128
];
GetParameterW
(
param
,
&
argv
[
i
][
0
]);
ygo
::
mainGame
->
ebJoinPass
->
setText
(
param
);
}
else
if
(
!
strcmp
(
argv
[
i
],
"-x"
))
{
// eXit on return
}
else
if
(
!
strcmp
(
argv
[
i
],
"-x"
))
{
// eXit on return
exit_on_return
=
true
;
exit_on_return
=
true
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
))
{
// Join host
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
))
{
// Join host
ClickButton
(
ygo
::
mainGame
->
btnLanMode
);
ClickButton
(
ygo
::
mainGame
->
btnLanMode
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
break
;
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-o"
))
{
// Open file
open_file
=
true
;
++
i
;
wcscpy
(
open_file_name
,
GetParameterW
(
&
argv
[
i
][
0
]));
}
else
if
(
!
strcmp
(
argv
[
i
],
"-d"
))
{
// Deck
}
else
if
(
!
strcmp
(
argv
[
i
],
"-d"
))
{
// Deck
if
(
i
<
argc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-r"
))
{
// Replay
}
else
if
(
!
strcmp
(
argv
[
i
],
"-r"
))
{
// Replay
if
(
i
<
argc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
}
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
break
;
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-s"
))
{
// Single
}
else
if
(
!
strcmp
(
argv
[
i
],
"-s"
))
{
// Single
if
(
i
<
argc
)
{
open_file
=
true
;
GetParameterW
(
open_file_name
,
&
argv
[
i
+
1
][
0
]);
}
ClickButton
(
ygo
::
mainGame
->
btnServerMode
);
ClickButton
(
ygo
::
mainGame
->
btnServerMode
);
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
break
;
break
;
}
}
}
}
ygo
::
mainGame
->
MainLoop
();
ygo
::
mainGame
->
MainLoop
();
#ifdef _WIN32
#ifdef _WIN32
...
...
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