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
YGOPRO-520DIY
ygopro
Commits
f8ad44e6
Commit
f8ad44e6
authored
Sep 10, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'param-deck-category' of /home/nanahira/ygo/versions/ygopro-yuzu
parents
55ed1e12
324a1b5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
3 deletions
+29
-3
gframe/config.h
gframe/config.h
+1
-0
gframe/gframe.cpp
gframe/gframe.cpp
+15
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+3
-2
gframe/myfilesystem.h
gframe/myfilesystem.h
+10
-0
No files found.
gframe/config.h
View file @
f8ad44e6
...
@@ -93,6 +93,7 @@ extern bool exit_on_return;
...
@@ -93,6 +93,7 @@ extern bool exit_on_return;
extern
bool
auto_watch_mode
;
extern
bool
auto_watch_mode
;
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 @
f8ad44e6
...
@@ -12,6 +12,7 @@ bool exit_on_return = false;
...
@@ -12,6 +12,7 @@ bool exit_on_return = false;
bool
auto_watch_mode
=
false
;
bool
auto_watch_mode
=
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
)
{
...
@@ -76,6 +77,7 @@ int main(int argc, char* argv[]) {
...
@@ -76,6 +77,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
]);
...
@@ -112,9 +114,16 @@ int main(int argc, char* argv[]) {
...
@@ -112,9 +114,16 @@ int main(int argc, char* argv[]) {
keep_on_return
=
true
;
keep_on_return
=
true
;
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--auto-watch"
))
{
// Auto watch mode
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"--auto-watch"
))
{
// Auto watch mode
auto_watch_mode
=
true
;
auto_watch_mode
=
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
;
...
@@ -123,6 +132,11 @@ int main(int argc, char* argv[]) {
...
@@ -123,6 +132,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 @
f8ad44e6
...
@@ -313,7 +313,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -313,7 +313,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
int
extra
=
replay
.
ReadInt32
();
int
extra
=
replay
.
ReadInt32
();
for
(
int
j
=
0
;
j
<
extra
;
++
j
)
for
(
int
j
=
0
;
j
<
extra
;
++
j
)
tmp_deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
replay
.
ReadInt32
()));
tmp_deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
replay
.
ReadInt32
()));
myswprintf
(
filename
,
L"./deck/%ls %ls.ydk"
,
ex_filename
,
namebuf
[
i
]);
FileSystem
::
SafeFileName
(
namebuf
[
i
]);
myswprintf
(
filename
,
L"deck/%ls-%d %ls.ydk"
,
ex_filename
,
i
+
1
,
namebuf
[
i
]);
deckManager
.
SaveDeck
(
tmp_deck
,
filename
);
deckManager
.
SaveDeck
(
tmp_deck
,
filename
);
}
}
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1335
));
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1335
));
...
@@ -402,7 +403,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -402,7 +403,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
...
...
gframe/myfilesystem.h
View file @
f8ad44e6
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
class
FileSystem
{
class
FileSystem
{
public:
public:
static
void
SafeFileName
(
wchar_t
*
wfile
)
{
while
((
wfile
=
wcspbrk
(
wfile
,
L"<>:
\"
/
\\
|?*"
))
!=
NULL
)
*
wfile
++
=
'_'
;
}
static
bool
IsFileExists
(
const
wchar_t
*
wfile
)
{
static
bool
IsFileExists
(
const
wchar_t
*
wfile
)
{
DWORD
attr
=
GetFileAttributesW
(
wfile
);
DWORD
attr
=
GetFileAttributesW
(
wfile
);
return
attr
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
);
return
attr
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
);
...
@@ -112,6 +117,11 @@ public:
...
@@ -112,6 +117,11 @@ public:
class
FileSystem
{
class
FileSystem
{
public:
public:
static
void
SafeFileName
(
wchar_t
*
wfile
)
{
while
((
wfile
=
wcspbrk
(
wfile
,
L"/"
))
!=
NULL
)
*
wfile
++
=
'_'
;
}
static
bool
IsFileExists
(
const
char
*
file
)
{
static
bool
IsFileExists
(
const
char
*
file
)
{
struct
stat
fileStat
;
struct
stat
fileStat
;
return
(
stat
(
file
,
&
fileStat
)
==
0
)
&&
!
S_ISDIR
(
fileStat
.
st_mode
);
return
(
stat
(
file
,
&
fileStat
)
==
0
)
&&
!
S_ISDIR
(
fileStat
.
st_mode
);
...
...
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