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
e3f96e18
Commit
e3f96e18
authored
Jul 22, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
启动录像,残局前先刷新加载列表
parent
0604b102
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
Classes/gframe/gframe.cpp
Classes/gframe/gframe.cpp
+23
-17
No files found.
Classes/gframe/gframe.cpp
View file @
e3f96e18
...
...
@@ -19,17 +19,17 @@ char* sub_string(const char* str, int start, int count=-1){
char
*
tmp
=
new
char
[
1024
];
int
len
=
strlen
(
str
);
int
index
=
0
;
if
(
count
<
0
){
if
(
count
<
0
)
{
count
=
len
-
start
;
}
}
for
(
int
j
=
start
;
j
<
len
&&
count
>
0
;
count
--
,
j
++
)
{
tmp
[
index
++
]
=
str
[
j
];
}
}
tmp
[
index
]
=
'\0'
;
return
tmp
;
}
#ifdef _IRR_ANDROID_PLATFORM_
int
GetListBoxIndex
(
IGUIListBox
*
listbox
,
const
wchar_t
*
target
){
int
GetListBoxIndex
(
IGUIListBox
*
listbox
,
const
wchar_t
*
target
){
int
count
=
listbox
->
getItemCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++
){
auto
item
=
listbox
->
getListItem
(
i
);
...
...
@@ -37,7 +37,7 @@ int GetListBoxIndex(IGUIListBox* listbox, const wchar_t* target){
return
i
;
}
}
return
0
;
return
-
1
;
}
void
android_main
(
ANDROID_APP
app
)
{
app
->
inputPollSource
.
process
=
android
::
process_input
;
...
...
@@ -61,9 +61,9 @@ int main(int argc, char* argv[]) {
* -j: join host (host info from system.conf)
* -d: deck edit
* -r: replay
* -s:single
*/
bool
keep_on_return
=
false
;
bool
open_file
=
false
;
#ifdef _IRR_ANDROID_PLATFORM_
__android_log_print
(
ANDROID_LOG_WARN
,
"ygo"
,
"handle args %d"
,
argc
);
__android_log_print
(
ANDROID_LOG_WARN
,
"ygo"
,
"handle args %s"
,
argv
);
...
...
@@ -96,7 +96,13 @@ int main(int argc, char* argv[]) {
break
;
}
else
if
(
!
strcmp
(
arg
,
"-r"
))
{
// Replay
exit_on_return
=
!
keep_on_return
;
int
index
=
0
;
//显示录像窗口
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ygo
::
mainGame
->
ShowElement
(
ygo
::
mainGame
->
wReplay
);
ygo
::
mainGame
->
ebRepStartTurn
->
setText
(
L"1"
);
ygo
::
mainGame
->
stReplayInfo
->
setText
(
L""
);
ygo
::
mainGame
->
RefreshReplay
();
int
index
=
-
1
;
if
((
i
+
1
)
<
argc
){
//下一个参数是录像名
#ifdef _IRR_ANDROID_PLATFORM_
const
char
*
name
=
argv
[
i
+
1
].
c_str
();
...
...
@@ -105,21 +111,24 @@ int main(int argc, char* argv[]) {
#endif
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
name
,
fname
);
open_file
=
true
;
index
=
GetListBoxIndex
(
ygo
::
mainGame
->
lstReplayList
,
fname
);
__android_log_print
(
ANDROID_LOG_DEBUG
,
"ygo"
,
"open replay file:index=%d, name=%s"
,
index
,
name
);
}
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
if
(
open_file
)
{
if
(
index
>=
0
)
{
ygo
::
mainGame
->
lstReplayList
->
setSelected
(
index
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
}
break
;
//只播放一个
}
else
if
(
!
strcmp
(
arg
,
"-s"
))
{
// Single
exit_on_return
=
!
keep_on_return
;
int
index
=
0
;
//显示残局窗口
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ygo
::
mainGame
->
ShowElement
(
ygo
::
mainGame
->
wSinglePlay
);
ygo
::
mainGame
->
RefreshSingleplay
();
ygo
::
mainGame
->
RefreshBot
();
int
index
=
-
1
;
if
((
i
+
1
)
<
argc
){
//下一个参数是文件名
#ifdef _IRR_ANDROID_PLATFORM_
const
char
*
name
=
argv
[
i
+
1
].
c_str
();
...
...
@@ -128,13 +137,10 @@ int main(int argc, char* argv[]) {
#endif
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
name
,
fname
);
open_file
=
true
;
index
=
GetListBoxIndex
(
ygo
::
mainGame
->
lstSinglePlayList
,
fname
);
__android_log_print
(
ANDROID_LOG_DEBUG
,
"ygo"
,
"open single file:index=%d, name=%s"
,
index
,
name
);
}
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnSingleMode
);
if
(
open_file
){
if
(
index
>=
0
){
ygo
::
mainGame
->
lstSinglePlayList
->
setSelected
(
index
);
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
}
...
...
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