Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
1d22b933
Commit
1d22b933
authored
Jul 21, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jni记录最后分类和卡组
parent
5b51aedb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+11
-6
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+4
-3
libcore/android/android_tools.cpp
libcore/android/android_tools.cpp
+11
-1
libcore/android/android_tools.h
libcore/android/android_tools.h
+6
-0
No files found.
Classes/gframe/deck_con.cpp
View file @
1d22b933
...
...
@@ -173,16 +173,21 @@ void DeckBuilder::Terminate() {
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
wACMessage
->
setVisible
(
false
);
mainGame
->
ClearTextures
();
mainGame
->
SaveConfig
();
mainGame
->
scrFilter
->
setVisible
(
false
);
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
char
linebuf
[
256
];
if
(
catesel
>=
0
)
BufferIO
::
CopyWStr
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
,
64
);
BufferIO
::
CopyWStr
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
,
64
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastcategory
,
linebuf
);
android
::
setLastCategory
(
mainGame
->
appMain
,
linebuf
);
//irr:os::Printer::log("setLastCategory", linebuf);
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
char
linebuf
[
256
];
if
(
decksel
>=
0
)
if
(
decksel
>=
0
)
BufferIO
::
CopyWStr
(
mainGame
->
cbDBDecks
->
getItem
(
decksel
),
mainGame
->
gameConf
.
lastdeck
,
64
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastdeck
,
linebuf
);
android
::
setLastDeck
(
mainGame
->
appMain
,
linebuf
);
//os::Printer::log("setLastDeck", linebuf);
mainGame
->
SaveConfig
();
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
}
...
...
@@ -1037,8 +1042,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
refreshDeckList
();
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
)
break
;
//
if(mainGame->cbCategorySelect->getSelected() == -1 || mainGame->cbDeckSelect->getSelected() == -1)
//
break;
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
changeCategory
(
catesel
);
...
...
Classes/gframe/game.cpp
View file @
1d22b933
...
...
@@ -1392,11 +1392,12 @@ void Game::LoadConfig() {
gameConf
.
textfontsize
=
16
;
gameConf
.
nickname
[
0
]
=
0
;
gameConf
.
gamename
[
0
]
=
0
;
gameConf
.
bot_deck_path
[
0
]
=
0
;
gameConf
.
lastcategory
[
0
]
=
0
;
BufferIO
::
DecodeUTF8
(
android
::
getLastCategory
(
appMain
).
c_str
(),
wstr
);;
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastcategory
,
64
);
//irr:os::Printer::log("getLastCategory", android::getLastCategory(appMain).c_str());
BufferIO
::
DecodeUTF8
(
android
::
getLastDeck
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastdeck
,
64
);
irr:
os
::
Printer
::
log
(
android
::
getFontPath
(
appMain
).
c_str
());
//
os::Printer::log(android::getFontPath(appMain).c_str());
BufferIO
::
DecodeUTF8
(
android
::
getFontPath
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
numfont
,
256
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
textfont
,
256
);
...
...
libcore/android/android_tools.cpp
View file @
1d22b933
...
...
@@ -363,6 +363,11 @@ irr::io::path getLastDeck(ANDROID_APP app) {
return
getSetting
(
app
,
"lastdeck"
);
}
//Retrive last category name.
irr
::
io
::
path
getLastCategory
(
ANDROID_APP
app
)
{
return
getSetting
(
app
,
"lastcategory"
);
}
irr
::
io
::
path
getSetting
(
ANDROID_APP
app
,
const
char
*
key
)
{
irr
::
io
::
path
ret
;
if
(
!
app
||
!
app
->
activity
||
!
app
->
activity
->
vm
)
...
...
@@ -403,6 +408,11 @@ void setLastDeck(ANDROID_APP app, const char* deckname) {
saveSetting
(
app
,
"lastdeck"
,
deckname
);
}
//save last category name.
void
setLastCategory
(
ANDROID_APP
app
,
const
char
*
catename
)
{
saveSetting
(
app
,
"lastcategory"
,
catename
);
}
int
getIntSetting
(
ANDROID_APP
app
,
const
char
*
key
,
int
defvalue
){
if
(
!
app
||
!
app
->
activity
||
!
app
->
activity
->
vm
)
return
defvalue
;
...
...
@@ -938,4 +948,4 @@ void runWindbot(ANDROID_APP app, const char* args) {
}
}
// namespace android
}
// namespace irr
}
// namespace irr
\ No newline at end of file
libcore/android/android_tools.h
View file @
1d22b933
...
...
@@ -147,6 +147,9 @@ extern irr::io::path getFontPath(ANDROID_APP app);
//Retrive last deck name.
extern
irr
::
io
::
path
getLastDeck
(
ANDROID_APP
app
);
//Retrive last catagory name.
extern
irr
::
io
::
path
getLastCategory
(
ANDROID_APP
app
);
extern
int
getIntSetting
(
ANDROID_APP
app
,
const
char
*
key
,
int
defvalue
);
extern
irr
::
io
::
path
getSetting
(
ANDROID_APP
app
,
const
char
*
key
);
...
...
@@ -154,6 +157,9 @@ extern irr::io::path getSetting(ANDROID_APP app, const char* key);
//save last deck name.
extern
void
setLastDeck
(
ANDROID_APP
app
,
const
char
*
deckname
);
//save last category name.
extern
void
setLastCategory
(
ANDROID_APP
app
,
const
char
*
catename
);
extern
void
saveIntSetting
(
ANDROID_APP
app
,
const
char
*
key
,
int
value
);
extern
void
saveSetting
(
ANDROID_APP
app
,
const
char
*
key
,
const
char
*
value
);
...
...
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