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
REIKAI
ygopro
Commits
324a1b5c
Commit
324a1b5c
authored
Sep 10, 2021
by
Yuzurisa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --deck-category
parent
7c71bf63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
gframe/config.h
gframe/config.h
+1
-0
gframe/gframe.cpp
gframe/gframe.cpp
+15
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-1
No files found.
gframe/config.h
View file @
324a1b5c
...
@@ -92,6 +92,7 @@ extern int enable_log;
...
@@ -92,6 +92,7 @@ extern int enable_log;
extern
bool
exit_on_return
;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name_with_category
[
256
];
extern
bool
bot_mode
;
extern
bool
bot_mode
;
#endif
#endif
gframe/gframe.cpp
View file @
324a1b5c
...
@@ -11,6 +11,7 @@ int enable_log = 0;
...
@@ -11,6 +11,7 @@ int enable_log = 0;
bool
exit_on_return
=
false
;
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""
;
wchar_t
open_file_name_with_category
[
256
]
=
L""
;
bool
bot_mode
=
false
;
bool
bot_mode
=
false
;
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
...
@@ -75,6 +76,7 @@ int main(int argc, char* argv[]) {
...
@@ -75,6 +76,7 @@ int main(int argc, char* argv[]) {
#endif //_WIN32
#endif //_WIN32
bool
keep_on_return
=
false
;
bool
keep_on_return
=
false
;
bool
deckCategorySpecified
=
false
;
for
(
int
i
=
1
;
i
<
wargc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
wargc
;
++
i
)
{
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L'\0'
)
{
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L'\0'
)
{
ygo
::
dataManager
.
LoadDB
(
&
wargv
[
i
][
2
]);
ygo
::
dataManager
.
LoadDB
(
&
wargv
[
i
][
2
]);
...
@@ -109,9 +111,16 @@ int main(int argc, char* argv[]) {
...
@@ -109,9 +111,16 @@ int main(int argc, char* argv[]) {
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-k"
))
{
// Keep on return
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-k"
))
{
// Keep on return
exit_on_return
=
false
;
exit_on_return
=
false
;
keep_on_return
=
true
;
keep_on_return
=
true
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--deck-category"
))
{
++
i
;
if
(
i
<
wargc
)
{
deckCategorySpecified
=
true
;
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
]);
}
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
++
i
;
++
i
;
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
if
(
!
deckCategorySpecified
)
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
if
(
i
+
1
<
wargc
)
{
// select deck
if
(
i
+
1
<
wargc
)
{
// select deck
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
]);
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
]);
continue
;
continue
;
...
@@ -120,6 +129,11 @@ int main(int argc, char* argv[]) {
...
@@ -120,6 +129,11 @@ int main(int argc, char* argv[]) {
if
(
i
<
wargc
)
{
if
(
i
<
wargc
)
{
open_file
=
true
;
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcscpy
(
open_file_name
,
wargv
[
i
]);
if
(
deckCategorySpecified
)
{
swprintf
(
open_file_name_with_category
,
256
,
L"%ls/%ls"
,
ygo
::
mainGame
->
gameConf
.
lastcategory
,
open_file_name
);
}
else
{
wcscpy
(
open_file_name_with_category
,
open_file_name
);
}
}
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
break
;
...
...
gframe/menu_handler.cpp
View file @
324a1b5c
...
@@ -399,7 +399,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -399,7 +399,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
case
BUTTON_DECK_EDIT
:
{
case
BUTTON_DECK_EDIT
:
{
mainGame
->
RefreshCategoryDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
RefreshCategoryDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
if
(
open_file
&&
deckManager
.
LoadDeck
(
open_file_name
))
{
if
(
open_file
&&
deckManager
.
LoadDeck
(
open_file_name
_with_category
))
{
#ifdef WIN32
#ifdef WIN32
wchar_t
*
dash
=
wcsrchr
(
open_file_name
,
L'\\'
);
wchar_t
*
dash
=
wcsrchr
(
open_file_name
,
L'\\'
);
#else
#else
...
...
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