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
fe56a18c
Commit
fe56a18c
authored
Jul 24, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享文件名加拓展名
BUTTON_SHARE_REPLAY
parent
43dd2bb9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
13 deletions
+38
-13
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+4
-2
Classes/gframe/game.h
Classes/gframe/game.h
+2
-0
Classes/gframe/gframe.cpp
Classes/gframe/gframe.cpp
+1
-1
Classes/gframe/menu_handler.cpp
Classes/gframe/menu_handler.cpp
+18
-0
libcore/android/android_tools.cpp
libcore/android/android_tools.cpp
+4
-4
libcore/android/android_tools.h
libcore/android/android_tools.h
+1
-1
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+4
-4
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
...rc/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
+1
-1
mobile/assets/data/conf/strings.conf
mobile/assets/data/conf/strings.conf
+1
-0
mobile/assets_en/data/conf/strings.conf
mobile/assets_en/data/conf/strings.conf
+1
-0
mobile/assets_ko/data/conf/strings.conf
mobile/assets_ko/data/conf/strings.conf
+1
-0
No files found.
Classes/gframe/game.cpp
View file @
fe56a18c
...
...
@@ -1002,11 +1002,13 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
ChangeToIGUIImageButton
(
btnReplayCancel
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1349
),
rect
<
s32
>
(
320
*
xScale
,
30
*
yScale
,
550
*
xScale
,
50
*
yScale
),
false
,
true
,
wReplay
);
stReplayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
320
*
xScale
,
60
*
yScale
,
570
*
xScale
,
315
*
yScale
),
false
,
true
,
wReplay
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1353
),
rect
<
s32
>
(
320
*
xScale
,
240
*
yScale
,
550
*
xScale
,
26
0
*
yScale
),
false
,
true
,
wReplay
);
ebRepStartTurn
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
320
*
xScale
,
2
60
*
yScale
,
430
*
xScale
,
30
0
*
yScale
),
wReplay
,
-
1
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1353
),
rect
<
s32
>
(
320
*
xScale
,
180
*
yScale
,
550
*
xScale
,
20
0
*
yScale
),
false
,
true
,
wReplay
);
ebRepStartTurn
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
320
*
xScale
,
2
10
*
yScale
,
430
*
xScale
,
25
0
*
yScale
),
wReplay
,
-
1
);
ebRepStartTurn
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
btnExportDeck
=
env
->
addButton
(
rect
<
s32
>
(
440
*
xScale
,
260
*
yScale
,
550
*
xScale
,
300
*
yScale
),
wReplay
,
BUTTON_EXPORT_DECK
,
dataManager
.
GetSysString
(
1282
));
ChangeToIGUIImageButton
(
btnExportDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnShareReplay
=
env
->
addButton
(
rect
<
s32
>
(
320
*
xScale
,
260
*
yScale
,
430
*
xScale
,
300
*
yScale
),
wReplay
,
BUTTON_SHARE_REPLAY
,
dataManager
.
GetSysString
(
1368
));
ChangeToIGUIImageButton
(
btnShareReplay
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//single play window
wSinglePlay
=
env
->
addWindow
(
rect
<
s32
>
(
220
*
xScale
,
100
*
yScale
,
800
*
xScale
,
520
*
yScale
),
false
,
dataManager
.
GetSysString
(
1201
));
wSinglePlay
->
getCloseButton
()
->
setVisible
(
false
);
...
...
Classes/gframe/game.h
View file @
fe56a18c
...
...
@@ -384,6 +384,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnRenameReplay
;
//
irr
::
gui
::
IGUIButton
*
btnReplayCancel
;
//
irr
::
gui
::
IGUIButton
*
btnExportDeck
;
//
irr
::
gui
::
IGUIButton
*
btnShareReplay
;
//
irr
::
gui
::
IGUIEditBox
*
ebRepStartTurn
;
//single play
irr
::
gui
::
IGUIWindow
*
wSinglePlay
;
...
...
@@ -732,6 +733,7 @@ private:
#define BUTTON_DELETE_REPLAY 133
#define BUTTON_RENAME_REPLAY 134
#define BUTTON_EXPORT_DECK 135
#define BUTTON_SHARE_REPLAY 136
#define BUTTON_REPLAY_START 140
#define BUTTON_REPLAY_PAUSE 141
#define BUTTON_REPLAY_STEP 142
...
...
Classes/gframe/gframe.cpp
View file @
fe56a18c
...
...
@@ -15,7 +15,7 @@ void ClickButton(irr::gui::IGUIElement* btn) {
event
.
GUIEvent
.
Caller
=
btn
;
ygo
::
mainGame
->
device
->
postEventFromUser
(
event
);
}
char
*
sub_string
(
const
char
*
str
,
int
start
,
int
count
=
-
1
){
char
*
sub_string
(
const
char
*
str
,
int
start
,
int
count
=
-
1
){
char
*
tmp
=
new
char
[
1024
];
int
len
=
strlen
(
str
);
int
index
=
0
;
...
...
Classes/gframe/menu_handler.cpp
View file @
fe56a18c
...
...
@@ -273,6 +273,24 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
prev_sel
=
sel
;
break
;
}
case
BUTTON_SHARE_REPLAY
:
{
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
mainGame
->
gMutex
.
lock
();
wchar_t
textBuffer
[
256
];
char
name
[
1024
];
char
*
fname
=
name
;
myswprintf
(
textBuffer
,
L"%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
sel
));
BufferIO
::
EncodeUTF8
(
textBuffer
,
fname
);
__android_log_print
(
ANDROID_LOG_DEBUG
,
"ygo"
,
"1share replay file=%s"
,
fname
);
android
::
OnShareFile
(
mainGame
->
appMain
,
fname
,
"yrp"
);
__android_log_print
(
ANDROID_LOG_DEBUG
,
"ygo"
,
"2after share replay file:index=%s"
,
fname
);
mainGame
->
gMutex
.
unlock
();
prev_operation
=
id
;
prev_sel
=
sel
;
break
;
}
case
BUTTON_RENAME_REPLAY
:
{
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
if
(
sel
==
-
1
)
...
...
libcore/android/android_tools.cpp
View file @
fe56a18c
...
...
@@ -807,7 +807,7 @@ int getLocalAddr(ANDROID_APP app) {
return
addr
;
}
void
OnShareFile
(
ANDROID_APP
app
,
char
*
title
,
char
*
path
){
void
OnShareFile
(
ANDROID_APP
app
,
char
*
title
,
char
*
ext
){
if
(
!
app
||
!
app
->
activity
||
!
app
->
activity
->
vm
)
return
;
JNIEnv
*
jni
=
nullptr
;
...
...
@@ -817,10 +817,10 @@ void OnShareFile(ANDROID_APP app, char* title, char* path){
jmethodID
MethodGetAddr
=
jni
->
GetMethodID
(
ClassNativeActivity
,
"shareFile"
,
"(Ljava/lang/String;Ljava/lang/String;)V"
);
jstring
s_title
=
jni
->
NewStringUTF
(
title
);
jstring
s_
path
=
jni
->
NewStringUTF
(
path
);
jni
->
CallVoidMethod
(
lNativeActivity
,
MethodGetAddr
,
s_title
,
s_
path
);
jstring
s_
ext
=
jni
->
NewStringUTF
(
ext
);
jni
->
CallVoidMethod
(
lNativeActivity
,
MethodGetAddr
,
s_title
,
s_
ext
);
jni
->
ReleaseStringUTFChars
(
s_title
,
title
);
jni
->
ReleaseStringUTFChars
(
s_
path
,
path
);
jni
->
ReleaseStringUTFChars
(
s_
ext
,
ext
);
jni
->
DeleteLocalRef
(
ClassNativeActivity
);
app
->
activity
->
vm
->
DetachCurrentThread
();
}
...
...
libcore/android/android_tools.h
View file @
fe56a18c
...
...
@@ -98,7 +98,7 @@ extern float getScreenWidth(ANDROID_APP app);
extern
float
getScreenHeight
(
ANDROID_APP
app
);
extern
void
OnShareFile
(
ANDROID_APP
app
,
char
*
title
,
char
*
path
);
extern
void
OnShareFile
(
ANDROID_APP
app
,
char
*
title
,
char
*
ext
);
// Get SDCard path.
extern
irr
::
io
::
path
getExternalStorageDir
(
ANDROID_APP
app
);
...
...
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
fe56a18c
...
...
@@ -530,20 +530,20 @@ public class YGOMobileActivity extends NativeActivity implements
}
@Override
public
void
shareFile
(
final
String
title
,
final
String
path
)
{
public
void
shareFile
(
final
String
title
,
final
String
ext
)
{
Log
.
i
(
"看看"
,
title
+
"."
+
ext
);
//TODO 分享文件
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
YGOMobileActivity
.
this
);
builder
.
setTitle
(
title
);
builder
.
setMessage
(
path
);
builder
.
setMessage
(
ext
);
builder
.
setNeutralButton
(
android
.
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
Intent
shareIntent
=
new
Intent
(
Intent
.
ACTION_SEND
);
shareIntent
.
putExtra
(
Intent
.
EXTRA_STREAM
,
Uri
.
fromFile
(
new
File
(
path
)));
shareIntent
.
putExtra
(
Intent
.
EXTRA_STREAM
,
Uri
.
fromFile
(
new
File
(
ext
)));
shareIntent
.
setType
(
"*/*"
);
//此处可发送多种文件
startActivity
(
Intent
.
createChooser
(
shareIntent
,
"分享到"
));
dialog
.
dismiss
();
...
...
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
View file @
fe56a18c
...
...
@@ -217,7 +217,7 @@ public final class IrrlichtBridge {
void
showComboBoxCompat
(
String
[]
items
,
boolean
isShow
,
int
mode
);
void
shareFile
(
String
title
,
String
path
);
void
shareFile
(
String
title
,
String
ext
);
void
performHapticFeedback
();
...
...
mobile/assets/data/conf/strings.conf
View file @
fe56a18c
...
...
@@ -410,6 +410,7 @@
!
system
1365
重命名失败,可能存在同名文件
!
system
1366
自动保存录像
!
system
1367
录像已自动保存为%
ls
.
yrp
!
system
1368
分享录像
!
system
1370
星数↑
!
system
1371
攻击↑
!
system
1372
守备↑
...
...
mobile/assets_en/data/conf/strings.conf
View file @
fe56a18c
...
...
@@ -409,6 +409,7 @@
!
system
1365
Fail
to
rename
,
maybe
there
'
re
replay
with
same
name
.
!
system
1366
Auto
Save
Replay
!
system
1367
Replay
already
saved
as
%
ls
.
yrp
!
system
1368
Replay
share
!
system
1370
Level
↑
!
system
1371
ATK
↑
!
system
1372
DEF
↑
...
...
mobile/assets_ko/data/conf/strings.conf
View file @
fe56a18c
...
...
@@ -409,6 +409,7 @@
!
system
1365
리플레이 이름을 바꾸는 중에 오류가 났습니다. 입력한 이름과 동일한 파일이 존재합니다.
!
system
1366
자동으로 리플레이 저장
!
system
1367
다음과 같이 저장되었습니다. %
ls
.
yrp
!
system
1368
함께 나누다
!
system
1370
레벨↑
!
system
1371
공격력↑
!
system
1372
수비력↑
...
...
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