Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
aa6cd81c
Commit
aa6cd81c
authored
Oct 25, 2019
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notouchHeight
parent
26016d46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
libcore/src/main/java/cn/garymb/ygomobile/interfaces/GameConfig.java
.../main/java/cn/garymb/ygomobile/interfaces/GameConfig.java
+26
-0
mobile/src/main/java/cn/garymb/ygomobile/App.java
mobile/src/main/java/cn/garymb/ygomobile/App.java
+1
-0
mobile/src/main/java/cn/garymb/ygomobile/LocalGameHost.java
mobile/src/main/java/cn/garymb/ygomobile/LocalGameHost.java
+5
-1
No files found.
libcore/src/main/java/cn/garymb/ygomobile/interfaces/GameConfig.java
View file @
aa6cd81c
...
...
@@ -29,6 +29,16 @@ public class GameConfig implements Parcelable {
private
boolean
enableSoundEffect
;
private
int
notouchHeight
;
public
int
getNotouchHeight
()
{
return
notouchHeight
;
}
public
void
setNotouchHeight
(
int
notouchHeight
)
{
this
.
notouchHeight
=
notouchHeight
;
}
public
NativeInitOptions
getNativeInitOptions
()
{
return
nativeInitOptions
;
}
...
...
@@ -103,6 +113,7 @@ public class GameConfig implements Parcelable {
return
Objects
.
hash
(
nativeInitOptions
,
lockScreenOrientation
,
sensorRefresh
,
keepScale
,
immerSiveMode
,
enableSoundEffect
);
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
@@ -116,6 +127,7 @@ public class GameConfig implements Parcelable {
dest
.
writeByte
(
this
.
keepScale
?
(
byte
)
1
:
(
byte
)
0
);
dest
.
writeByte
(
this
.
immerSiveMode
?
(
byte
)
1
:
(
byte
)
0
);
dest
.
writeByte
(
this
.
enableSoundEffect
?
(
byte
)
1
:
(
byte
)
0
);
dest
.
writeInt
(
this
.
notouchHeight
);
}
protected
GameConfig
(
Parcel
in
)
{
...
...
@@ -125,6 +137,7 @@ public class GameConfig implements Parcelable {
this
.
keepScale
=
in
.
readByte
()
!=
0
;
this
.
immerSiveMode
=
in
.
readByte
()
!=
0
;
this
.
enableSoundEffect
=
in
.
readByte
()
!=
0
;
this
.
notouchHeight
=
in
.
readInt
();
}
public
static
final
Creator
<
GameConfig
>
CREATOR
=
new
Creator
<
GameConfig
>()
{
...
...
@@ -138,4 +151,17 @@ public class GameConfig implements Parcelable {
return
new
GameConfig
[
size
];
}
};
@Override
public
String
toString
()
{
return
"GameConfig{"
+
"nativeInitOptions="
+
nativeInitOptions
+
", lockScreenOrientation="
+
lockScreenOrientation
+
", sensorRefresh="
+
sensorRefresh
+
", keepScale="
+
keepScale
+
", immerSiveMode="
+
immerSiveMode
+
", enableSoundEffect="
+
enableSoundEffect
+
", notouchHeight="
+
notouchHeight
+
'}'
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/App.java
View file @
aa6cd81c
...
...
@@ -70,6 +70,7 @@ public class App extends GameApplication {
public
static
GameConfig
genConfig
()
{
GameConfig
config
=
new
GameConfig
();
config
.
setNotouchHeight
(
AppsSettings
.
get
().
getNotchHeight
());
config
.
setNativeInitOptions
(
AppsSettings
.
get
().
getNativeInitOptions
());
config
.
setLockScreenOrientation
(
AppsSettings
.
get
().
isLockScreenOrientation
());
config
.
setSensorRefresh
(
AppsSettings
.
get
().
isSensorRefresh
());
...
...
mobile/src/main/java/cn/garymb/ygomobile/LocalGameHost.java
View file @
aa6cd81c
...
...
@@ -141,6 +141,9 @@ class LocalGameHost extends GameHost {
}
maxW
=
Math
.
max
(
w1
,
h1
);
maxH
=
Math
.
min
(
w1
,
h1
);
if
(
immerSiveMode
){
maxH
-=
config
.
getNotouchHeight
();
}
Log
.
i
(
"kk"
,
"real="
+
fullW
+
"x"
+
fullH
+
",cur="
+
actW
+
"x"
+
actH
+
",use="
+
maxW
+
"x"
+
maxH
);
float
sx
,
sy
,
scale
;
int
gw
,
gh
;
...
...
@@ -221,7 +224,8 @@ class LocalGameHost extends GameHost {
((
TextView
)
dlg
.
findViewById
(
R
.
id
.
tv_rom_ver
)).
setText
(
RomIdentifier
.
getRomInfo
(
activity
).
getVersion
());
((
TextView
)
dlg
.
findViewById
(
R
.
id
.
tv_cut_screen
)).
setText
(
ScreenUtil
.
hasNotchInformation
(
activity
)
?
"Yes"
:
"No"
);
((
TextView
)
dlg
.
findViewById
(
R
.
id
.
tv_nav_bar
)).
setText
(
ScreenUtil
.
isNavigationBarShown
(
activity
)
?
"Yes"
:
"No"
);
((
TextView
)
dlg
.
findViewById
(
R
.
id
.
tv_screen_size
)).
setText
(
String
.
format
(
"real:%dx%d, cur=%dx%d, game=%dx%d"
,
size
.
getFullW
(),
size
.
getFullH
(),
size
.
getActW
(),
size
.
getActH
(),
size
.
getWidth
(),
size
.
getHeight
()));
((
TextView
)
dlg
.
findViewById
(
R
.
id
.
tv_screen_size
)).
setText
(
String
.
format
(
"real:%dx%d, cur=%dx%d, game=%dx%d, notouch=%d"
,
size
.
getFullW
(),
size
.
getFullH
(),
size
.
getActW
(),
size
.
getActH
(),
size
.
getWidth
(),
size
.
getHeight
(),
config
.
getNotouchHeight
()));
dlg
.
findViewById
(
R
.
id
.
btn_ok
).
setOnClickListener
((
v
)
->
{
dlg
.
dismiss
();
});
...
...
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