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
25d39a8f
Commit
25d39a8f
authored
Oct 06, 2021
by
kenan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/fallenstardust/YGOMobile-cn-ko-en
parents
5f03ee56
e6f5ed58
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
206 additions
and
236 deletions
+206
-236
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+4
-4
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+4
-4
Classes/gframe/game.h
Classes/gframe/game.h
+3
-5
Classes/gframe/gframe.cpp
Classes/gframe/gframe.cpp
+27
-30
Classes/gframe/netserver.cpp
Classes/gframe/netserver.cpp
+0
-1
Classes/gframe/utils.cpp
Classes/gframe/utils.cpp
+4
-4
Classes/gframe/utils.h
Classes/gframe/utils.h
+3
-2
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
+1
-0
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+0
-6
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
+13
-3
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
...c/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
+17
-23
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
...src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
+24
-22
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardFavorites.java
...main/java/cn/garymb/ygomobile/ui/cards/CardFavorites.java
+1
-18
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
.../main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
+2
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+4
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
...e/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
+10
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
...in/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
+13
-0
mobile/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
...le/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
+13
-26
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
...rc/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
+34
-46
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+4
-2
mobile/src/main/res/layout/activity_online_mycard.xml
mobile/src/main/res/layout/activity_online_mycard.xml
+17
-2
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+2
-2
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-1
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-2
mobile/src/main/res/xml/preference_about.xml
mobile/src/main/res/xml/preference_about.xml
+0
-25
mobile/src/main/res/xml/shortcuts.xml
mobile/src/main/res/xml/shortcuts.xml
+3
-0
No files found.
Classes/gframe/drawing.cpp
View file @
25d39a8f
...
...
@@ -200,10 +200,10 @@ void Game::DrawBackGround() {
}
else
{
driver
->
drawVertexPrimitiveList
(
matManager
.
vTotalAtkopT
,
4
,
matManager
.
iRectangle
,
2
);
DrawShadowText
(
numFont
,
dInfo
.
str_total_attack
[
1
],
recti
(
740
*
mainGame
->
xScale
,
295
*
mainGame
->
yScale
,
760
*
mainGame
->
xScale
,
315
*
mainGame
->
yScale
),
recti
(
0
,
1
,
2
,
0
),
dInfo
.
total_attack_color
[
1
],
0xff000000
,
true
,
false
,
0
);
}
}
//disabled field
{
/*float cv[4] = {0.0f, 0.0f, 1.0f, 1.0f};*/
...
...
@@ -475,7 +475,7 @@ void Game::DrawCard(ClientCard* pcard) {
}
void
Game
::
DrawShadowText
(
CGUITTFont
*
font
,
const
core
::
stringw
&
text
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
video
::
SColor
color
,
video
::
SColor
shadowcolor
,
bool
hcenter
,
bool
vcenter
,
const
core
::
rect
<
s32
>*
clip
)
{
core
::
rect
<
s32
>
shadowposition
=
recti
(
position
.
UpperLeftCorner
.
X
-
padding
.
UpperLeftCorner
.
X
,
position
.
UpperLeftCorner
.
Y
-
padding
.
UpperLeftCorner
.
Y
,
core
::
rect
<
s32
>
shadowposition
=
recti
(
position
.
UpperLeftCorner
.
X
-
padding
.
UpperLeftCorner
.
X
,
position
.
UpperLeftCorner
.
Y
-
padding
.
UpperLeftCorner
.
Y
,
position
.
LowerRightCorner
.
X
-
padding
.
LowerRightCorner
.
X
,
position
.
LowerRightCorner
.
Y
-
padding
.
LowerRightCorner
.
Y
);
font
->
draw
(
text
,
shadowposition
,
shadowcolor
,
hcenter
,
vcenter
,
clip
);
font
->
draw
(
text
,
position
,
color
,
hcenter
,
vcenter
,
clip
);
...
...
@@ -634,7 +634,7 @@ void Game::DrawMisc() {
DrawShadowText
(
numFont
,
dInfo
.
str_card_count
[
0
],
recti
(
550
*
mainGame
->
xScale
,
49
*
mainGame
->
yScale
,
575
*
mainGame
->
xScale
,
68
*
mainGame
->
yScale
),
recti
(
0
,
1
*
mainGame
->
yScale
,
2
*
mainGame
->
xScale
,
0
),
dInfo
.
card_count_color
[
0
],
0xff000000
,
true
,
false
,
0
);
DrawShadowText
(
numFont
,
dInfo
.
str_card_count
[
1
],
recti
(
757
*
mainGame
->
xScale
,
49
*
mainGame
->
yScale
,
782
*
mainGame
->
xScale
,
68
*
mainGame
->
yScale
),
recti
(
0
,
1
*
mainGame
->
yScale
,
2
*
mainGame
->
xScale
,
0
),
dInfo
.
card_count_color
[
1
],
0xff000000
,
true
,
false
,
0
);
/*
driver->draw2DRectangle(recti(525 * mainGame->xScale, 34 * mainGame->yScale, (525 + dInfo.time_left[0] * 100 / dInfo.time_limit) * mainGame->xScale, 44 * mainGame->yScale), 0xa0e0e0e0, 0xa0e0e0e0, 0xa0c0c0c0, 0xa0c0c0c0);
driver->draw2DRectangleOutline(recti(525 * mainGame->xScale, 34 * mainGame->yScale, 625 * mainGame->xScale, 44 * mainGame->yScale), 0xffffffff);
...
...
Classes/gframe/game.cpp
View file @
25d39a8f
...
...
@@ -83,14 +83,14 @@ void Game::onHandleAndroidCommand(ANDROID_APP app, int32_t cmd){
ygo
::
mainGame
->
playBGM
();
}
break
;
case
APP_CMD_INIT_WINDOW
:
case
APP_CMD_WINDOW_RESIZED
:
case
APP_CMD_STOP
:
case
APP_CMD_INIT_WINDOW
:
case
APP_CMD_SAVE_STATE
:
case
APP_CMD_TERM_WINDOW
:
case
APP_CMD_GAINED_FOCUS
:
case
APP_CMD_LOST_FOCUS
:
case
APP_CMD_DESTROY
:
case
APP_CMD_WINDOW_RESIZED
:
default:
break
;
}
...
...
@@ -131,7 +131,6 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
ILogger
*
logger
=
device
->
getLogger
();
// logger->setLogLevel(ELL_WARNING);
isPSEnabled
=
options
->
isPendulumScaleEnabled
();
soundManager
=
Utils
::
make_unique
<
SoundManager
>
();
dataManager
.
FileSystem
=
device
->
getFileSystem
();
((
CIrrDeviceAndroid
*
)
device
)
->
onAppCmd
=
onHandleAndroidCommand
;
...
...
@@ -1199,6 +1198,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnCancelOrFinish
=
env
->
addButton
(
rect
<
s32
>
(
200
*
yScale
,
205
*
yScale
,
310
*
yScale
,
255
*
yScale
),
0
,
BUTTON_CANCEL_OR_FINISH
,
dataManager
.
GetSysString
(
1295
));
ChangeToIGUIImageButton
(
btnCancelOrFinish
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnCancelOrFinish
->
setVisible
(
false
);
soundManager
=
Utils
::
make_unique
<
SoundManager
>
();
if
(
!
soundManager
->
Init
((
double
)
gameConf
.
sound_volume
/
100
,
(
double
)
gameConf
.
music_volume
/
100
,
gameConf
.
enable_sound
,
gameConf
.
enable_music
,
nullptr
))
{
chkEnableSound
->
setChecked
(
false
);
chkEnableSound
->
setEnabled
(
false
);
...
...
@@ -2079,7 +2079,7 @@ void Game::ChangeToIGUIImageButton(irr::gui::IGUIButton* button, irr::video::ITe
button
->
setOverrideFont
(
font
);
}
void
Game
::
OnGameClose
()
const
{
void
Game
::
OnGameClose
()
{
android
::
onGameExit
(
appMain
);
this
->
device
->
closeDevice
();
}
...
...
Classes/gframe/game.h
View file @
25d39a8f
...
...
@@ -6,8 +6,6 @@
#include "deck_con.h"
#include "menu_handler.h"
#include "sound_manager.h"
#include "deck_manager.h"
#include "image_manager.h"
#include <unordered_map>
#include <vector>
#include <list>
...
...
@@ -154,7 +152,7 @@ public:
void
DrawBackGround
();
void
DrawSelField
(
int
player
,
int
loc
,
size_t
seq
,
irr
::
video
::
ITexture
*
texture
,
bool
reverse
=
false
,
bool
spin
=
false
);
void
DrawLinkedZones
(
ClientCard
*
pcard
,
ClientCard
*
fcard
=
0
);
void
CheckMutual
(
ClientCard
*
pcard
,
int
mark
)
{}
void
CheckMutual
(
ClientCard
*
pcard
,
int
mark
)
;
void
DrawCards
();
void
DrawCard
(
ClientCard
*
pcard
);
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
core
::
stringw
&
text
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
video
::
SColor
color
=
0xffffffff
,
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
core
::
rect
<
s32
>*
clip
=
0
);
...
...
@@ -184,9 +182,9 @@ public:
void
CloseGameButtons
();
void
CloseGameWindow
();
void
CloseDuelWindow
();
void
OnGameClose
()
const
;
void
OnGameClose
();
void
ChangeToIGUIImageWindow
(
irr
::
gui
::
IGUIWindow
*
window
,
irr
::
gui
::
IGUIImage
*
bgwindow
,
irr
::
video
::
ITexture
*
image
);
static
void
ChangeToIGUIImageButton
(
irr
::
gui
::
IGUIButton
*
button
,
irr
::
video
::
ITexture
*
image
,
irr
::
video
::
ITexture
*
pressedImage
,
irr
::
gui
::
CGUITTFont
*
font
=
0
);
void
ChangeToIGUIImageButton
(
irr
::
gui
::
IGUIButton
*
button
,
irr
::
video
::
ITexture
*
image
,
irr
::
video
::
ITexture
*
pressedImage
,
irr
::
gui
::
CGUITTFont
*
font
=
0
);
int
LocalPlayer
(
int
player
);
const
wchar_t
*
LocalName
(
int
local_player
);
...
...
Classes/gframe/gframe.cpp
View file @
25d39a8f
...
...
@@ -45,14 +45,11 @@ void android_main(ANDROID_APP app) {
int
main
(
int
argc
,
char
*
argv
[])
{
#endif
evthread_use_pthreads
();
auto
game
=
new
ygo
::
Game
;
// if(ygo::mainGame != nullptr){
// delete ygo::mainGame;
// }
ygo
::
mainGame
=
game
;
ygo
::
Game
_game
;
ygo
::
mainGame
=
&
_game
;
#ifdef _IRR_ANDROID_PLATFORM_
android
::
InitOptions
*
options
=
android
::
getInitOptions
(
app
);
if
(
!
g
ame
->
Initialize
(
app
,
options
)){
if
(
!
ygo
::
mainG
ame
->
Initialize
(
app
,
options
)){
delete
options
;
return
;
}
...
...
@@ -87,22 +84,22 @@ int main(int argc, char* argv[]) {
keep_on_return
=
true
;
}
else
if
(
!
strcmp
(
arg
,
"-c"
))
{
// Create host
exit_on_return
=
!
keep_on_return
;
game
->
HideElement
(
g
ame
->
wMainMenu
);
ClickButton
(
g
ame
->
btnJoinHost
);
ygo
::
mainGame
->
HideElement
(
ygo
::
mainG
ame
->
wMainMenu
);
ClickButton
(
ygo
::
mainG
ame
->
btnJoinHost
);
break
;
}
else
if
(
!
strcmp
(
arg
,
"-j"
))
{
// Join host
exit_on_return
=
!
keep_on_return
;
game
->
HideElement
(
g
ame
->
wMainMenu
);
ClickButton
(
g
ame
->
btnJoinHost
);
ygo
::
mainGame
->
HideElement
(
ygo
::
mainG
ame
->
wMainMenu
);
ClickButton
(
ygo
::
mainG
ame
->
btnJoinHost
);
break
;
}
else
if
(
!
strcmp
(
arg
,
"-r"
))
{
// Replay
exit_on_return
=
!
keep_on_return
;
//显示录像窗口
game
->
HideElement
(
g
ame
->
wMainMenu
);
game
->
ShowElement
(
g
ame
->
wReplay
);
g
ame
->
ebRepStartTurn
->
setText
(
L"1"
);
g
ame
->
stReplayInfo
->
setText
(
L""
);
g
ame
->
RefreshReplay
();
ygo
::
mainGame
->
HideElement
(
ygo
::
mainG
ame
->
wMainMenu
);
ygo
::
mainGame
->
ShowElement
(
ygo
::
mainG
ame
->
wReplay
);
ygo
::
mainG
ame
->
ebRepStartTurn
->
setText
(
L"1"
);
ygo
::
mainG
ame
->
stReplayInfo
->
setText
(
L""
);
ygo
::
mainG
ame
->
RefreshReplay
();
int
index
=
-
1
;
if
((
i
+
1
)
<
argc
){
//下一个参数是录像名
#ifdef _IRR_ANDROID_PLATFORM_
...
...
@@ -113,24 +110,24 @@ int main(int argc, char* argv[]) {
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
name
,
fname
);
index
=
GetListBoxIndex
(
g
ame
->
lstReplayList
,
fname
);
index
=
GetListBoxIndex
(
ygo
::
mainG
ame
->
lstReplayList
,
fname
);
ALOGD
(
"open replay file:index=%d, name=%s"
,
index
,
name
);
}
game
->
HideElement
(
g
ame
->
wMainMenu
);
ClickButton
(
g
ame
->
btnReplayMode
);
ygo
::
mainGame
->
HideElement
(
ygo
::
mainG
ame
->
wMainMenu
);
ClickButton
(
ygo
::
mainG
ame
->
btnReplayMode
);
if
(
index
>=
0
)
{
g
ame
->
lstReplayList
->
setSelected
(
index
);
ClickButton
(
g
ame
->
btnLoadReplay
);
ygo
::
mainG
ame
->
lstReplayList
->
setSelected
(
index
);
ClickButton
(
ygo
::
mainG
ame
->
btnLoadReplay
);
}
break
;
//只播放一个
}
else
if
(
!
strcmp
(
arg
,
"-s"
))
{
// Single
exit_on_return
=
!
keep_on_return
;
//显示残局窗口
game
->
HideElement
(
g
ame
->
wMainMenu
);
game
->
ShowElement
(
g
ame
->
wSinglePlay
);
g
ame
->
RefreshSingleplay
();
g
ame
->
RefreshBot
();
ygo
::
mainGame
->
HideElement
(
ygo
::
mainG
ame
->
wMainMenu
);
ygo
::
mainGame
->
ShowElement
(
ygo
::
mainG
ame
->
wSinglePlay
);
ygo
::
mainG
ame
->
RefreshSingleplay
();
ygo
::
mainG
ame
->
RefreshBot
();
int
index
=
-
1
;
if
((
i
+
1
)
<
argc
){
//下一个参数是文件名
#ifdef _IRR_ANDROID_PLATFORM_
...
...
@@ -140,12 +137,12 @@ int main(int argc, char* argv[]) {
#endif
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
name
,
fname
);
index
=
GetListBoxIndex
(
g
ame
->
lstSinglePlayList
,
fname
);
index
=
GetListBoxIndex
(
ygo
::
mainG
ame
->
lstSinglePlayList
,
fname
);
ALOGD
(
"open single file:index=%d, name=%s"
,
index
,
name
);
}
if
(
index
>=
0
){
g
ame
->
lstSinglePlayList
->
setSelected
(
index
);
ClickButton
(
g
ame
->
btnLoadSinglePlay
);
ygo
::
mainG
ame
->
lstSinglePlayList
->
setSelected
(
index
);
ClickButton
(
ygo
::
mainG
ame
->
btnLoadSinglePlay
);
}
break
;
}
...
...
@@ -153,8 +150,8 @@ int main(int argc, char* argv[]) {
#ifdef _IRR_ANDROID_PLATFORM_
delete
options
;
#endif
g
ame
->
externalSignal
.
Set
();
g
ame
->
externalSignal
.
SetNoWait
(
true
);
g
ame
->
MainLoop
();
ygo
::
mainG
ame
->
externalSignal
.
Set
();
ygo
::
mainG
ame
->
externalSignal
.
SetNoWait
(
true
);
ygo
::
mainG
ame
->
MainLoop
();
return
;
}
Classes/gframe/netserver.cpp
View file @
25d39a8f
#include "netserver.h"
#include "single_duel.h"
#include "tag_duel.h"
#include "game.h"
namespace
ygo
{
std
::
unordered_map
<
bufferevent
*
,
DuelPlayer
>
NetServer
::
users
;
...
...
Classes/gframe/utils.cpp
View file @
25d39a8f
...
...
@@ -121,8 +121,8 @@ namespace ygo {
}
}
void
Utils
::
changeCursor
(
irr
::
IrrlichtDevice
*
device
,
irr
::
gui
::
ECURSOR_ICON
icon
)
{
irr
::
gui
::
ICursorControl
*
cursor
=
device
->
getCursorControl
();
void
Utils
::
changeCursor
(
irr
::
gui
::
ECURSOR_ICON
icon
)
{
irr
::
gui
::
ICursorControl
*
cursor
=
mainGame
->
device
->
getCursorControl
();
if
(
cursor
->
getActiveIcon
()
!=
icon
)
{
cursor
->
setActiveIcon
(
icon
);
}
...
...
@@ -205,8 +205,8 @@ namespace ygo {
return
res
;
}
irr
::
io
::
IReadFile
*
Utils
::
FindandOpenFileFromArchives
(
std
::
vector
<
Utils
::
IrrArchiveHelper
>
archives
,
const
path_string
&
path
,
const
path_string
&
name
)
{
for
(
auto
&
archive
:
archives
)
{
irr
::
io
::
IReadFile
*
Utils
::
FindandOpenFileFromArchives
(
const
path_string
&
path
,
const
path_string
&
name
)
{
for
(
auto
&
archive
:
mainGame
->
archives
)
{
int
res
=
-
1
;
Utils
::
FindfolderFiles
(
archive
,
path
,
[
match
=
&
name
,
&
res
](
int
index
,
path_string
name
,
bool
isdir
,
void
*
payload
)
->
bool
{
if
(
isdir
)
...
...
Classes/gframe/utils.h
View file @
25d39a8f
...
...
@@ -35,12 +35,13 @@ namespace ygo {
static
bool
Deletedirectory
(
const
path_string
&
source
);
static
void
CreateResourceFolders
();
static
void
takeScreenshot
(
irr
::
IrrlichtDevice
*
device
);
static
void
changeCursor
(
irr
::
IrrlichtDevice
*
device
,
irr
::
gui
::
ECURSOR_ICON
icon
);
static
void
ToggleFullscreen
();
static
void
changeCursor
(
irr
::
gui
::
ECURSOR_ICON
icon
);
static
void
FindfolderFiles
(
const
path_string
&
path
,
const
std
::
function
<
void
(
path_string
,
bool
,
void
*
)
>&
cb
,
void
*
payload
=
nullptr
);
static
std
::
vector
<
path_string
>
FindfolderFiles
(
const
path_string
&
path
,
std
::
vector
<
path_string
>
extensions
,
int
subdirectorylayers
=
0
);
static
void
FindfolderFiles
(
IrrArchiveHelper
&
archive
,
const
path_string
&
path
,
const
std
::
function
<
bool
(
int
,
path_string
,
bool
,
void
*
)
>&
cb
,
void
*
payload
=
nullptr
);
static
std
::
vector
<
int
>
FindfolderFiles
(
IrrArchiveHelper
&
archive
,
const
path_string
&
path
,
std
::
vector
<
path_string
>
extensions
,
int
subdirectorylayers
=
0
);
static
irr
::
io
::
IReadFile
*
FindandOpenFileFromArchives
(
std
::
vector
<
Utils
::
IrrArchiveHelper
>
archives
,
const
path_string
&
path
,
const
path_string
&
name
);
static
irr
::
io
::
IReadFile
*
FindandOpenFileFromArchives
(
const
path_string
&
path
,
const
path_string
&
name
);
static
std
::
wstring
NormalizePath
(
std
::
wstring
path
,
bool
trailing_slash
=
true
);
static
std
::
wstring
GetFileExtension
(
std
::
wstring
file
);
static
std
::
wstring
GetFilePath
(
std
::
wstring
file
);
...
...
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
View file @
25d39a8f
...
...
@@ -186,6 +186,7 @@ static void* join_game_thread(void* param) {
ygo
::
mainGame
->
gMutex
.
unlock
();
return
NULL
;
}
//auto exit when join game by mycard.
exit_on_return
=
true
;
irr
::
android
::
YGOGameOptions
options
=
irr
::
android
::
YGOGameOptions
(
param
);
irr
::
SEvent
event
;
...
...
mobile/build.gradle
View file @
25d39a8f
...
...
@@ -9,7 +9,7 @@ android {
minSdkVersion
21
//noinspection ExpiredTargetSdkVersion
targetSdkVersion
29
versionCode
38090100
1
versionCode
38090100
4
versionName
"3.8.9"
flavorDimensions
"versionCode"
vectorDrawables
.
useSupportLibrary
=
true
...
...
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
25d39a8f
...
...
@@ -687,10 +687,4 @@ public class AppsSettings {
// Log.i("kk", "saveTemp:" + array);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_ROOM_LIST
,
array
.
toString
());
}
@Deprecated
//获取收藏文件
public
File
getFavoriteFile
()
{
return
new
File
(
getResourcePath
(),
"/favorite.txt"
);
}
}
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
View file @
25d39a8f
...
...
@@ -19,12 +19,14 @@ import android.util.Base64;
import
android.util.Log
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.ui.cards.deck.DeckUtils
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
public
class
Deck
implements
Parcelable
{
...
...
@@ -146,15 +148,23 @@ public class Deck implements Parcelable {
int
mNum
=
Integer
.
valueOf
(
YGOUtil
.
getArrayString
(
bits
,
0
,
8
),
2
);
int
eNum
=
Integer
.
valueOf
(
YGOUtil
.
getArrayString
(
bits
,
8
,
12
),
2
);
int
sNum
=
Integer
.
valueOf
(
YGOUtil
.
getArrayString
(
bits
,
12
,
16
),
2
);
try
{
FileLogUtil
.
write
(
"种类数量"
+
mNum
+
" "
+
eNum
+
" "
+
sNum
+
" "
);
FileLogUtil
.
write
(
"m:"
+
YGOUtil
.
getArrayString
(
bits
,
0
,
8
));
FileLogUtil
.
write
(
"s:"
+
YGOUtil
.
getArrayString
(
bits
,
8
,
12
));
FileLogUtil
.
write
(
"e:"
+
YGOUtil
.
getArrayString
(
bits
,
12
,
16
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
Log
.
e
(
"Deck"
,
"种类数量"
+
mNum
+
" "
+
eNum
+
" "
+
sNum
+
" "
);
Log
.
e
(
"Deck"
,
"m:"
+
YGOUtil
.
getArrayString
(
bits
,
0
,
8
));
Log
.
e
(
"Deck"
,
"e:"
+
YGOUtil
.
getArrayString
(
bits
,
8
,
1
6
));
Log
.
e
(
"Deck"
,
"s:"
+
YGOUtil
.
getArrayString
(
bits
,
1
6
,
24
));
Log
.
e
(
"Deck"
,
"e:"
+
YGOUtil
.
getArrayString
(
bits
,
8
,
1
2
));
Log
.
e
(
"Deck"
,
"s:"
+
YGOUtil
.
getArrayString
(
bits
,
1
2
,
16
));
for
(
int
i
=
0
;
i
<
mNum
;
i
++)
{
int
cStart
=
16
+
(
i
*
29
);
int
cardNum
=
Integer
.
valueOf
(
YGOUtil
.
getArrayString
(
bits
,
cStart
,
cStart
+
2
),
2
);
int
cardId
=
Integer
.
valueOf
(
YGOUtil
.
getArrayString
(
bits
,
cStart
+
2
,
cStart
+
29
),
2
);
if
(
i
<
4
)
for
(
int
x
=
0
;
x
<
cardNum
;
x
++)
{
mainlist
.
add
(
cardId
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
View file @
25d39a8f
...
...
@@ -6,45 +6,39 @@ import cn.garymb.ygomobile.bean.TextSelect;
public
class
DeckFile
extends
TextSelect
{
private
String
name
;
private
String
path
;
private
Long
date
;
private
final
File
path
;
private
final
String
fullName
;
public
DeckFile
(
String
path
)
{
this
.
path
=
path
;
name
=
new
File
(
path
).
getName
();
int
end
=
name
.
lastIndexOf
(
"."
);
if
(
end
!=
-
1
)
name
=
name
.
substring
(
0
,
end
);
super
.
setName
(
name
);
setObject
(
this
);
this
(
new
File
(
path
));
}
public
DeckFile
(
File
file
)
{
path
=
file
.
getAbsolutePath
();
name
=
file
.
getName
();
name
=
name
.
substring
(
0
,
name
.
lastIndexOf
(
"."
));
date
=
file
.
lastModified
();
path
=
file
;
fullName
=
file
.
getName
();
String
name
=
fullName
;
int
index
=
name
.
lastIndexOf
(
"."
);
if
(
index
>
0
)
{
name
=
name
.
substring
(
0
,
index
);
}
super
.
setName
(
name
);
setObject
(
this
);
}
public
String
getName
()
{
return
n
ame
;
public
String
get
File
Name
()
{
return
fullN
ame
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
public
File
getPathFile
(
)
{
return
path
;
}
public
String
getPath
()
{
return
path
;
return
path
.
getAbsolutePath
()
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
public
Long
getDate
(
)
{
return
path
.
lastModified
()
;
}
public
Long
getDate
()
{
return
date
;
}
}
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
View file @
25d39a8f
...
...
@@ -7,6 +7,7 @@ import androidx.annotation.NonNull;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Locale
;
import
ocgcore.DataManager
;
import
ocgcore.data.Card
;
...
...
@@ -20,32 +21,33 @@ public class CardKeyWord {
public
CardKeyWord
(
String
word
)
{
this
.
word
=
word
;
if
(!
TextUtils
.
isEmpty
(
word
))
{
if
(
TextUtils
.
isDigitsOnly
(
word
)
&&
word
.
length
()
>
5
)
{
if
(
TextUtils
.
isDigitsOnly
(
word
)
&&
word
.
length
()
>
=
5
)
{
//搜索卡密
filterList
.
add
(
new
CodeFilter
(
Long
.
parseLong
(
word
)));
}
String
[]
ws
=
word
.
split
(
" "
);
for
(
String
w
:
ws
)
{
if
(
TextUtils
.
isEmpty
(
w
))
{
continue
;
}
boolean
exclude
=
false
;
if
(
w
.
startsWith
(
"-"
))
{
exclude
=
true
;
w
=
w
.
substring
(
1
);
}
boolean
onlyText
=
false
;
if
(
w
.
startsWith
(
"\""
)
||
w
.
startsWith
(
"“"
)
||
w
.
startsWith
(
"”"
))
{
//只搜索文字
onlyText
=
true
;
if
(
w
.
endsWith
(
"\""
)
||
w
.
endsWith
(
"“"
)
||
w
.
endsWith
(
"”"
))
{
w
=
w
.
substring
(
1
,
w
.
length
()
-
1
);
}
else
{
}
else
{
String
[]
ws
=
word
.
split
(
" "
);
for
(
String
w
:
ws
)
{
if
(
TextUtils
.
isEmpty
(
w
))
{
continue
;
}
boolean
exclude
=
false
;
if
(
w
.
startsWith
(
"-"
))
{
exclude
=
true
;
w
=
w
.
substring
(
1
);
}
boolean
onlyText
=
false
;
if
(
w
.
startsWith
(
"\""
)
||
w
.
startsWith
(
"“"
)
||
w
.
startsWith
(
"”"
))
{
//只搜索文字
onlyText
=
true
;
if
(
w
.
endsWith
(
"\""
)
||
w
.
endsWith
(
"“"
)
||
w
.
endsWith
(
"”"
))
{
w
=
w
.
substring
(
1
,
w
.
length
()
-
1
);
}
else
{
w
=
w
.
substring
(
1
);
}
}
Log
.
d
(
TAG
,
"filter:word="
+
w
+
", exclude="
+
exclude
+
", onlyText="
+
onlyText
);
filterList
.
add
(
new
NameFilter
(
w
,
exclude
,
onlyText
));
}
Log
.
d
(
TAG
,
"filter:word="
+
w
+
", exclude="
+
exclude
+
", onlyText="
+
onlyText
);
filterList
.
add
(
new
NameFilter
(
w
,
exclude
,
onlyText
));
}
}
empty
=
filterList
.
size
()
==
0
;
...
...
@@ -76,7 +78,7 @@ public class CardKeyWord {
public
NameFilter
(
@NonNull
String
word
,
boolean
exclude
,
boolean
onlyText
)
{
this
.
setcode
=
onlyText
?
0
:
DataManager
.
get
().
getStringManager
().
getSetCode
(
word
);
this
.
exclude
=
exclude
;
this
.
word
=
word
.
toLowerCase
();
this
.
word
=
word
.
toLowerCase
(
Locale
.
US
);
if
(
this
.
setcode
>
0
){
Log
.
d
(
TAG
,
"filter:setcode="
+
setcode
+
", exclude="
+
exclude
+
", word="
+
word
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardFavorites.java
View file @
25d39a8f
...
...
@@ -73,25 +73,8 @@ public class CardFavorites {
public
void
load
()
{
mList
.
clear
();
File
config
=
AppsSettings
.
get
().
getFavoriteFile
();
List
<
String
>
lines
;
if
(
config
.
exists
())
{
//重命名
if
(!
config
.
renameTo
(
AppsSettings
.
get
().
getSystemConfig
()))
{
Log
.
w
(
TAG
,
"copy txt to conf"
);
try
{
FileUtils
.
copyFile
(
AppsSettings
.
get
().
getFavoriteFile
().
getPath
(),
AppsSettings
.
get
().
getSystemConfig
().
getPath
());
}
catch
(
IOException
e
)
{
//TODO 复制失败,直接删除?
FileUtils
.
deleteFile
(
AppsSettings
.
get
().
getFavoriteFile
());
}
}
else
{
Log
.
d
(
TAG
,
"rename txt to conf"
);
}
config
=
AppsSettings
.
get
().
getSystemConfig
();
}
else
{
config
=
AppsSettings
.
get
().
getSystemConfig
();
}
File
config
=
AppsSettings
.
get
().
getSystemConfig
();
if
(!
config
.
exists
())
{
Log
.
w
(
TAG
,
"config is no exists:"
+
config
.
getPath
());
return
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
View file @
25d39a8f
...
...
@@ -26,7 +26,6 @@ import cn.garymb.ygomobile.ui.adapters.SimpleSpinnerAdapter;
import
cn.garymb.ygomobile.ui.adapters.SimpleSpinnerItem
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.ui.widget.SearchableSpinner
;
import
ocgcore.DataManager
;
import
ocgcore.LimitManager
;
import
ocgcore.StringManager
;
...
...
@@ -56,7 +55,7 @@ public class CardSearcher implements View.OnClickListener {
private
final
Spinner
typeMonsterSpinner2
;
private
final
Spinner
typeSpellSpinner
;
private
final
Spinner
typeTrapSpinner
;
private
final
S
earchableS
pinner
setCodeSpinner
;
private
final
Spinner
setCodeSpinner
;
private
final
Spinner
categorySpinner
;
private
final
Spinner
raceSpinner
;
private
final
Spinner
levelSpinner
;
...
...
@@ -441,7 +440,7 @@ public class CardSearcher implements View.OnClickListener {
private
void
initSetNameSpinners
(
Spinner
spinner
)
{
List
<
CardSet
>
setnames
=
mStringManager
.
getCardSets
();
List
<
SimpleSpinnerItem
>
items
=
new
ArrayList
<>();
items
.
add
(
new
SimpleSpinnerItem
(
0
,
mContext
.
getString
(
R
.
string
.
label_set
)));
items
.
add
(
new
SimpleSpinnerItem
(
0
,
getString
(
R
.
string
.
label_set
)));
for
(
CardSet
set
:
setnames
)
{
items
.
add
(
new
SimpleSpinnerItem
(
set
.
getCode
(),
set
.
getName
()));
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
25d39a8f
...
...
@@ -1122,7 +1122,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckSelect
(
DeckFile
deckFile
)
{
loadDeckFromFile
(
new
File
(
deckFile
.
getPath
()
));
loadDeckFromFile
(
deckFile
.
getPathFile
(
));
}
@Override
...
...
@@ -1132,7 +1132,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
return
;
String
currentDeckPath
=
deck
.
getAbsolutePath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
if
(
TextUtils
.
equals
(
deckFile
.
getPath
(),
currentDeckPath
))
{
List
<
File
>
files
=
getYdkFiles
();
File
file
=
null
;
if
(
files
!=
null
&&
files
.
size
()
>
0
)
{
...
...
@@ -1157,7 +1157,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
Name
()
+
".ydk"
));
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
FileName
()
));
return
;
}
}
...
...
@@ -1172,7 +1172,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
Name
()
+
".ydk"
));
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
get
FileName
()
));
return
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCard.java
View file @
25d39a8f
...
...
@@ -40,6 +40,8 @@ public class MyCard {
private
static
final
String
mArenaUrl
=
"https://mycard.moe/ygopro/arena/"
;
private
static
final
String
mCommunityUrl
=
"https://ygobbs.com/login"
;
private
static
final
String
return_sso_url
=
"https://mycard.moe/mobile/?"
;
private
static
final
String
HOST_MC
=
"mycard.moe"
;
private
static
final
String
MC_MAIN_URL
=
"https://mycard.moe/mobile/ygopro/lobby"
;
private
static
final
Charset
UTF_8
=
Charset
.
forName
(
"UTF-8"
);
private
final
DefWebViewClient
mDefWebViewClient
;
private
final
User
mUser
=
new
User
();
...
...
@@ -125,6 +127,14 @@ public class MyCard {
return
mCommunityUrl
;
}
public
String
getMcHost
()
{
return
HOST_MC
;
}
public
String
getMcMainUrl
()
{
return
MC_MAIN_URL
;
}
@SuppressLint
(
"AddJavascriptInterface"
)
public
void
attachWeb
(
MyCardWebView
webView
,
MyCardListener
myCardListener
)
{
mMyCardListener
=
myCardListener
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/MyCardActivity.java
View file @
25d39a8f
...
...
@@ -11,6 +11,7 @@ import android.os.Bundle;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.Gravity
;
import
android.view.MenuItem
;
import
android.view.View
;
...
...
@@ -67,6 +68,7 @@ public class MyCardActivity extends BaseActivity implements MyCard.MyCardListene
}
};
private
ProgressBar
mProgressBar
;
private
TextView
tv_back_mc
;
private
ValueCallback
<
Uri
>
uploadMessage
;
private
ValueCallback
<
Uri
[]>
mUploadCallbackAboveL
;
...
...
@@ -86,6 +88,7 @@ public class MyCardActivity extends BaseActivity implements MyCard.MyCardListene
mWebViewPlus
=
$
(
R
.
id
.
webbrowser
);
mDrawerlayout
=
$
(
R
.
id
.
drawer_layout
);
mProgressBar
=
$
(
R
.
id
.
progressBar
);
tv_back_mc
=
$
(
R
.
id
.
tv_back_mc
);
mProgressBar
.
setMax
(
100
);
NavigationView
navigationView
=
$
(
R
.
id
.
nav_main
);
...
...
@@ -96,6 +99,8 @@ public class MyCardActivity extends BaseActivity implements MyCard.MyCardListene
mStatusView
=
navHead
.
findViewById
(
R
.
id
.
tv_dp
);
//mWebViewPlus.enableHtml5();
tv_back_mc
.
setOnClickListener
(
view
->
onHome
());
WebSettings
settings
=
mWebViewPlus
.
getSettings
();
settings
.
setUserAgentString
(
settings
.
getUserAgentString
()
+
MessageFormat
.
format
(
" YGOMobile/{0} ({1} {2,number,#})"
,
...
...
@@ -109,6 +114,10 @@ public class MyCardActivity extends BaseActivity implements MyCard.MyCardListene
public
void
onProgressChanged
(
WebView
view
,
int
newProgress
)
{
if
(
newProgress
==
100
)
{
mProgressBar
.
setVisibility
(
View
.
GONE
);
if
(
view
.
getUrl
().
contains
(
mMyCard
.
getMcHost
()))
tv_back_mc
.
setVisibility
(
View
.
GONE
);
else
tv_back_mc
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
if
(
View
.
GONE
==
mProgressBar
.
getVisibility
())
{
mProgressBar
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -195,6 +204,10 @@ public class MyCardActivity extends BaseActivity implements MyCard.MyCardListene
closeDrawer
();
return
;
}
if
(
mWebViewPlus
.
getUrl
().
equals
(
mMyCard
.
getMcMainUrl
()))
{
finish
();
return
;
}
if
(
mWebViewPlus
.
canGoBack
())
{
mWebViewPlus
.
goBack
();
}
else
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/CardUtils.java
View file @
25d39a8f
...
...
@@ -10,33 +10,20 @@ public class CardUtils {
public
static
String
getAllTypeString
(
Card
card
,
StringManager
stringManager
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
CardType
[]
cardTypes
=
CardType
.
values
();
if
(
card
.
isType
(
CardType
.
Spell
)
||
card
.
isType
(
CardType
.
Trap
))
{
for
(
CardType
type
:
cardTypes
)
{
if
(
type
==
CardType
.
Spell
||
type
==
CardType
.
Trap
){
continue
;
boolean
isFirst
=
true
;
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFirst
)
{
stringBuilder
.
append
(
"/"
);
}
else
{
isFirst
=
false
;
}
if
(
card
.
isType
(
type
))
{
stringBuilder
.
append
(
stringManager
.
getTypeString
(
type
.
getId
()));
}
}
//先显示速攻,后显示魔法
stringBuilder
.
append
(
stringManager
.
getTypeString
(
CardType
.
Spell
.
getId
()));
}
else
{
boolean
isFrst
=
true
;
for
(
CardType
type
:
cardTypes
)
{
if
(
card
.
isType
(
type
))
{
if
(!
isFrst
)
{
stringBuilder
.
append
(
"/"
);
}
else
{
isFrst
=
false
;
}
String
str
=
stringManager
.
getTypeString
(
type
.
getId
());
if
(
TextUtils
.
isEmpty
(
str
))
{
stringBuilder
.
append
(
"0x"
);
stringBuilder
.
append
(
String
.
format
(
"%X"
,
type
.
getId
()));
}
else
{
stringBuilder
.
append
(
str
);
}
String
str
=
stringManager
.
getTypeString
(
type
.
getId
());
if
(
TextUtils
.
isEmpty
(
str
))
{
stringBuilder
.
append
(
"0x"
);
stringBuilder
.
append
(
String
.
format
(
"%X"
,
type
.
getId
()));
}
else
{
stringBuilder
.
append
(
str
);
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
View file @
25d39a8f
...
...
@@ -60,7 +60,8 @@ public class YGODialogUtil {
private
final
Dialog
ygoDialog
;
public
ViewHolder
(
Context
context
,
String
selectDeckPath
,
OnDeckMenuListener
onDeckMenuListener
){
View
viewDialog
=
DialogUtils
.
getdx
(
context
).
dialogBottomSheet
(
R
.
layout
.
dialog_deck_select
,
0
);
DialogUtils
du
=
DialogUtils
.
getdx
(
context
);
View
viewDialog
=
du
.
dialogBottomSheet
(
R
.
layout
.
dialog_deck_select
,
0
);
RecyclerView
rv_type
,
rv_deck
;
rv_deck
=
viewDialog
.
findViewById
(
R
.
id
.
rv_deck
);
...
...
@@ -129,7 +130,6 @@ public class YGODialogUtil {
public
void
onItemSelect
(
int
position
,
DeckType
item
)
{
clearDeckSelect
();
deckList
.
clear
();
Log
.
d
(
"kk-test"
,
"read path"
+
item
.
getPath
());
deckList
.
addAll
(
DeckUtil
.
getDeckList
(
item
.
getPath
()));
if
(
position
==
0
)
{
if
(
AppsSettings
.
get
().
isReadExpansions
())
{
...
...
@@ -176,12 +176,12 @@ public class YGODialogUtil {
ll_add
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
DialogUtils
.
getdx
(
context
)
.
dialogl
(
context
.
getString
(
R
.
string
.
new_deck
),
du
.
dialogl
(
context
.
getString
(
R
.
string
.
new_deck
),
new
String
[]{
context
.
getString
(
R
.
string
.
category_name
),
context
.
getString
(
R
.
string
.
deck_name
)},
R
.
drawable
.
radius
).
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
DialogUtils
.
getdx
(
context
)
.
dis
();
du
.
dis
();
switch
(
position
)
{
case
0
:
//if (deckList.size()>=8){
...
...
@@ -223,53 +223,43 @@ public class YGODialogUtil {
}
});
ll_move
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
List
<
DeckType
>
otherType
=
getOtherTypeList
();
DialogUtils
.
getdx
(
context
).
dialogl
(
context
.
getString
(
please_select_target_category
),
getStringType
(
otherType
),
R
.
drawable
.
radius
).
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
DialogUtils
.
getdx
(
context
).
dis
();
DeckType
toType
=
otherType
.
get
(
position
);
IOUtils
.
createFolder
(
new
File
(
toType
.
getPath
()));
List
<
DeckFile
>
deckFileList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
try
{
FileUtils
.
moveFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
).
getPath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
deckList
.
remove
(
deckFile
);
ll_move
.
setOnClickListener
(
v
->
{
List
<
DeckType
>
otherType
=
getOtherTypeList
();
du
.
dialogl
(
context
.
getString
(
please_select_target_category
),
getStringType
(
otherType
),
R
.
drawable
.
radius
).
setOnItemClickListener
((
parent
,
view
,
position
,
id
)
->
{
du
.
dis
();
DeckType
toType
=
otherType
.
get
(
position
);
IOUtils
.
createFolder
(
new
File
(
toType
.
getPath
()));
List
<
DeckFile
>
deckFileList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
try
{
FileUtils
.
moveFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getFileName
()).
getPath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
YGOUtil
.
show
(
context
.
getString
(
R
.
string
.
done
));
onDeckMenuListener
.
onDeckMove
(
deckAdp
.
getSelectList
(),
toType
);
clearDeckSelect
();
deckList
.
remove
(
deckFile
);
}
});
}
YGOUtil
.
show
(
context
.
getString
(
R
.
string
.
done
));
onDeckMenuListener
.
onDeckMove
(
deckAdp
.
getSelectList
(),
toType
);
clearDeckSelect
();
});
});
ll_copy
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
List
<
DeckType
>
otherType
=
getOtherTypeList
();
ll_copy
.
setOnClickListener
(
v
->
{
List
<
DeckType
>
otherType
=
getOtherTypeList
();
DialogUtils
.
getdx
(
context
).
dialogl
(
context
.
getString
(
please_select_target_category
),
getStringType
(
otherType
),
R
.
drawable
.
radius
).
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
DialogUtils
.
getdx
(
context
).
dis
();
du
.
dialogl
(
context
.
getString
(
please_select_target_category
),
getStringType
(
otherType
),
R
.
drawable
.
radius
).
setOnItemClickListener
((
parent
,
view
,
position
,
id
)
->
{
du
.
dis
();
DeckType
toType
=
otherType
.
get
(
position
);
IOUtils
.
createFolder
(
new
File
(
toType
.
getPath
()));
List
<
DeckFile
>
deckFileList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
try
{
FileUtils
.
copyFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
).
getPath
());
FileUtils
.
copyFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getFileName
()
).
getPath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -277,9 +267,7 @@ public class YGODialogUtil {
YGOUtil
.
show
(
context
.
getString
(
R
.
string
.
done
));
onDeckMenuListener
.
onDeckCopy
(
deckAdp
.
getSelectList
(),
toType
);
clearDeckSelect
();
}
});
}
});
});
ll_del
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -298,7 +286,7 @@ public class YGODialogUtil {
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
List
<
DeckFile
>
selectDeckList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
selectDeckList
)
{
new
File
(
deckFile
.
getPath
()
).
delete
();
deckFile
.
getPathFile
(
).
delete
();
deckList
.
remove
(
deckFile
);
}
YGOUtil
.
show
(
context
.
getString
(
R
.
string
.
done
));
...
...
@@ -317,7 +305,7 @@ public class YGODialogUtil {
}
});
ygoDialog
=
DialogUtils
.
getdx
(
context
)
.
getDialog
();
ygoDialog
=
du
.
getDialog
();
ygoDialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
25d39a8f
...
...
@@ -7,6 +7,8 @@ import android.text.TextUtils;
import
androidx.annotation.NonNull
;
import
java.util.Locale
;
import
ocgcore.enums.CardType
;
public
class
Card
extends
CardData
implements
Parcelable
{
...
...
@@ -153,11 +155,11 @@ public class Card extends CardData implements Parcelable {
}
public
boolean
containsName
(
String
key
){
return
Name
!=
null
&&
Name
.
toLowerCase
().
contains
(
key
);
return
Name
!=
null
&&
Name
.
toLowerCase
(
Locale
.
US
).
contains
(
key
);
}
public
boolean
containsDesc
(
String
key
){
return
Desc
!=
null
&&
Desc
.
toLowerCase
().
contains
(
key
);
return
Desc
!=
null
&&
Desc
.
toLowerCase
(
Locale
.
US
).
contains
(
key
);
}
/**
...
...
mobile/src/main/res/layout/activity_online_mycard.xml
View file @
25d39a8f
...
...
@@ -11,10 +11,25 @@
tools:openDrawer=
"left"
>
<RelativeLayout
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:visibility=
"gone"
android:id=
"@+id/tv_back_mc"
android:background=
"@drawable/click_background"
android:textColor=
"@color/black"
android:layout_width=
"match_parent"
android:text=
"返回萌卡大厅"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:gravity=
"center"
android:paddingTop=
"6dp"
android:paddingBottom=
"6dp"
android:layout_height=
"wrap_content"
/>
<cn.garymb.ygomobile.ui.mycard.MyCardWebView
android:id=
"@+id/webbrowser"
android:layout_width=
"match_parent"
...
...
@@ -28,7 +43,7 @@
</cn.garymb.ygomobile.ui.mycard.MyCardWebView>
</
Relative
Layout>
</
Linear
Layout>
<com.google.android.material.navigation.NavigationView
android:id=
"@+id/nav_main"
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
25d39a8f
...
...
@@ -316,6 +316,6 @@
<string
name=
"label_ot_All"
>
모든 카드
</string>
<string
name=
"label_ot_No_Exclusive"
>
ID 없는 카드
</string>
<string
name=
"label_ot_CUSTOM"
>
커스텀 카드
</string>
<string
name=
"settings_screen_padding"
>
曲面屏预留高度
</string>
<string
name=
"tip_load_cdb_error"
>
加载数据出错
</string>
<string
name=
"settings_screen_padding"
>
화면 스타일
</string>
<string
name=
"tip_load_cdb_error"
>
데이터를 불러오는 중에 오류가 발생했습니다.
</string>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
25d39a8f
...
...
@@ -316,6 +316,6 @@
<string
name=
"ask_delete_ex"
>
点击确认以清空
</string>
<string
name=
"about_delete_ex"
>
如果遇到拓展卡包问题时删除是个不错的办法
</string>
<string
name=
"file_installed"
>
文件已导入
</string>
<string
name=
"settings_screen_padding"
>
曲面
屏预留高度
</string>
<string
name=
"settings_screen_padding"
>
瀑布
屏预留高度
</string>
<string
name=
"tip_load_cdb_error"
>
加载数据出错
</string>
</resources>
mobile/src/main/res/values/strings.xml
View file @
25d39a8f
...
...
@@ -327,6 +327,5 @@
<string
name=
"label_ot_No_Exclusive"
>
No exclusive
</string>
<string
name=
"label_ot_SC_OCG"
>
SChinese OCG
</string>
<string
name=
"settings_screen_padding"
>
Reserved height of curved screen
</string>
<string
name=
"tip_load_cdb_error"
>
加载数据出错
</string>
<string
name=
"text_none"
translatable=
"false"
>
N/A
</string>
<string
name=
"tip_load_cdb_error"
>
Load database error
</string>
</resources>
mobile/src/main/res/xml/preference_about.xml
deleted
100644 → 0
View file @
5f03ee56
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<PreferenceCategory
android:title=
"@string/settings_about_sub_about"
>
<Preference
android:key=
"pref_key_about_author"
android:summary=
"@string/settings_author"
android:title=
"@string/settings_about_author_pref"
/>
<Preference
android:key=
"pref_key_about_version"
android:persistent=
"true"
android:title=
"@string/settings_about_version_pref"
/>
<Preference
android:key=
"pref_key_open_alipay"
android:persistent=
"true"
android:title=
"@string/donation"
/>
<Preference
android:key=
"pref_key_about_check_update"
android:persistent=
"true"
android:title=
"@string/settings_about_check_update"
/>
<Preference
android:key=
"pref_key_change_log"
android:title=
"@string/settings_about_change_log"
/>
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file
mobile/src/main/res/xml/shortcuts.xml
View file @
25d39a8f
...
...
@@ -12,6 +12,7 @@
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.mycard.MyCardActivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
</shortcut>
<shortcut
android:enabled=
"true"
...
...
@@ -25,6 +26,7 @@
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.CardSearchActivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
</shortcut>
<shortcut
android:enabled=
"true"
...
...
@@ -38,5 +40,6 @@
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
</shortcut>
</shortcuts>
\ No newline at end of file
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