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
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
Commits
0b1e8a8c
Commit
0b1e8a8c
authored
Oct 11, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check lastcategory, lastdeck
parent
73565591
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
gframe/deck_con.cpp
gframe/deck_con.cpp
+4
-4
gframe/gframe.cpp
gframe/gframe.cpp
+2
-2
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+11
-8
No files found.
gframe/deck_con.cpp
View file @
0b1e8a8c
...
@@ -105,11 +105,11 @@ void DeckBuilder::Terminate() {
...
@@ -105,11 +105,11 @@ void DeckBuilder::Terminate() {
mainGame
->
scrPackCards
->
setVisible
(
false
);
mainGame
->
scrPackCards
->
setVisible
(
false
);
mainGame
->
scrPackCards
->
setPos
(
0
);
mainGame
->
scrPackCards
->
setPos
(
0
);
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
if
(
catesel
>=
0
)
if
(
catesel
>=
0
)
BufferIO
::
CopyW
Str
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
,
64
);
BufferIO
::
CopyW
ideString
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
);
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
decksel
>=
0
)
if
(
decksel
>=
0
)
BufferIO
::
CopyW
Str
(
mainGame
->
cbDBDecks
->
getItem
(
decksel
),
mainGame
->
gameConf
.
lastdeck
,
64
);
BufferIO
::
CopyW
ideString
(
mainGame
->
cbDBDecks
->
getItem
(
decksel
),
mainGame
->
gameConf
.
lastdeck
);
if
(
exit_on_return
)
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
}
}
...
...
gframe/gframe.cpp
View file @
0b1e8a8c
...
@@ -115,14 +115,14 @@ int main(int argc, char* argv[]) {
...
@@ -115,14 +115,14 @@ int main(int argc, char* argv[]) {
++
i
;
++
i
;
if
(
i
<
wargc
)
{
if
(
i
<
wargc
)
{
deckCategorySpecified
=
true
;
deckCategorySpecified
=
true
;
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
ygo
::
mainGame
->
gameConf
.
lastcategory
);
}
}
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
++
i
;
++
i
;
if
(
!
deckCategorySpecified
)
if
(
!
deckCategorySpecified
)
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
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
]
);
BufferIO
::
CopyWideString
(
wargv
[
i
],
ygo
::
mainGame
->
gameConf
.
lastdeck
);
continue
;
continue
;
}
else
{
// open deck
}
else
{
// open deck
exit_on_return
=
!
keep_on_return
;
exit_on_return
=
!
keep_on_return
;
...
...
gframe/menu_handler.cpp
View file @
0b1e8a8c
...
@@ -13,11 +13,13 @@
...
@@ -13,11 +13,13 @@
namespace
ygo
{
namespace
ygo
{
void
UpdateDeck
()
{
void
UpdateDeck
()
{
BufferIO
::
CopyWStr
(
mainGame
->
cbCategorySelect
->
getItem
(
mainGame
->
cbCategorySelect
->
getSelected
()),
auto
category
=
mainGame
->
cbCategorySelect
->
getItem
(
mainGame
->
cbCategorySelect
->
getSelected
());
mainGame
->
gameConf
.
lastcategory
,
64
);
if
(
category
)
BufferIO
::
CopyWStr
(
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
()),
BufferIO
::
CopyWideString
(
category
,
mainGame
->
gameConf
.
lastcategory
);
mainGame
->
gameConf
.
lastdeck
,
64
);
auto
deckname
=
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
());
unsigned
char
deckbuf
[
1024
];
if
(
deckname
)
BufferIO
::
CopyWideString
(
deckname
,
mainGame
->
gameConf
.
lastdeck
);
unsigned
char
deckbuf
[
1024
]{};
auto
pdeck
=
deckbuf
;
auto
pdeck
=
deckbuf
;
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
main
.
size
()
+
deckManager
.
current_deck
.
extra
.
size
());
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
main
.
size
()
+
deckManager
.
current_deck
.
extra
.
size
());
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
side
.
size
());
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
side
.
size
());
...
@@ -448,7 +450,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -448,7 +450,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
wcsncpy
(
deck_name
,
dash
+
1
,
256
);
wcsncpy
(
deck_name
,
dash
+
1
,
256
);
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
deck_name
))
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
deck_name
))
{
wcscpy
(
mainGame
->
gameConf
.
lastdeck
,
deck_name
);
BufferIO
::
CopyWideString
(
deck_name
,
mainGame
->
gameConf
.
lastdeck
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
break
;
break
;
}
}
...
@@ -456,14 +458,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -456,14 +458,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
else
{
// only deck name
}
else
{
// only deck name
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
open_file_name
))
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
open_file_name
))
{
wcscpy
(
mainGame
->
gameConf
.
lastdeck
,
open_file_name
);
BufferIO
::
CopyWideString
(
open_file_name
,
mainGame
->
gameConf
.
lastdeck
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
break
;
break
;
}
}
}
}
}
}
open_file
=
false
;
open_file
=
false
;
}
else
if
(
mainGame
->
cbDBCategory
->
getSelected
()
!=
-
1
&&
mainGame
->
cbDBDecks
->
getSelected
()
!=
-
1
)
{
}
else
if
(
mainGame
->
cbDBCategory
->
getSelected
()
!=
-
1
&&
mainGame
->
cbDBDecks
->
getSelected
()
!=
-
1
)
{
deckManager
.
LoadCurrentDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
deckManager
.
LoadCurrentDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
ebDeckname
->
setText
(
L""
);
mainGame
->
ebDeckname
->
setText
(
L""
);
}
}
...
...
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