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
c915371c
Commit
c915371c
authored
Mar 13, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置字体大小
但刷新出来有延迟
parent
e256e800
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
29 deletions
+29
-29
Classes/gframe/CGUITTFont.h
Classes/gframe/CGUITTFont.h
+4
-1
Classes/gframe/duelclient.cpp
Classes/gframe/duelclient.cpp
+1
-1
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+20
-2
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+4
-25
No files found.
Classes/gframe/CGUITTFont.h
View file @
c915371c
...
@@ -218,7 +218,10 @@ public:
...
@@ -218,7 +218,10 @@ public:
virtual
void
setMaxPageTextureSize
(
const
core
::
dimension2du
&
texture_size
)
{
virtual
void
setMaxPageTextureSize
(
const
core
::
dimension2du
&
texture_size
)
{
max_page_texture_size
=
texture_size
;
max_page_texture_size
=
texture_size
;
}
}
//! Set the font size.
virtual
void
setFontSize
(
u32
new_size
)
{
size
=
new_size
;
}
//! Get the font size.
//! Get the font size.
virtual
u32
getFontSize
()
const
{
virtual
u32
getFontSize
()
const
{
return
size
;
return
size
;
...
...
Classes/gframe/duelclient.cpp
View file @
c915371c
...
@@ -1471,7 +1471,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1471,7 +1471,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
highlighting_card
=
0
;
mainGame
->
dField
.
highlighting_card
=
0
;
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
390
*
mainGame
->
xScale
,
mainGame
->
text
Font
,
dataManager
.
GetDesc
(
desc
));
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
390
*
mainGame
->
xScale
,
mainGame
->
gui
Font
,
dataManager
.
GetDesc
(
desc
));
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
return
false
;
return
false
;
...
...
Classes/gframe/event_handler.cpp
View file @
c915371c
...
@@ -226,11 +226,29 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -226,11 +226,29 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_REDUCE_CARD_TEXT
:
{
case
BUTTON_REDUCE_CARD_TEXT
:
{
mainGame
->
gameConf
.
textfontsize
=
mainGame
->
gameConf
.
textfontsize
-
2
;
if
(
mainGame
->
gameConf
.
textfontsize
<
24
)
{
mainGame
->
btnEnlargeCardText
->
setEnabled
(
true
);
if
(
mainGame
->
gameConf
.
textfontsize
=
16
)
mainGame
->
btnReduceCardText
->
setEnabled
(
false
);
}
else
{
mainGame
->
gameConf
.
textfontsize
=
mainGame
->
gameConf
.
textfontsize
-
2
;
mainGame
->
textFont
->
setFontSize
(
mainGame
->
gameConf
.
textfontsize
*
mainGame
->
yScale
);
const
auto
&
tsize
=
mainGame
->
stText
->
getRelativePosition
();
mainGame
->
InitStaticText
(
mainGame
->
stText
,
tsize
.
getWidth
(),
tsize
.
getHeight
(),
mainGame
->
textFont
,
mainGame
->
showingtext
);
}
break
;
break
;
}
}
case
BUTTON_ENLARGE_CARD_TEXT
:
{
case
BUTTON_ENLARGE_CARD_TEXT
:
{
mainGame
->
gameConf
.
textfontsize
=
mainGame
->
gameConf
.
textfontsize
+
2
;
if
(
mainGame
->
gameConf
.
textfontsize
=
24
)
{
mainGame
->
btnEnlargeCardText
->
setEnabled
(
false
);
if
(
mainGame
->
gameConf
.
textfontsize
>
16
)
mainGame
->
btnReduceCardText
->
setEnabled
(
true
);
}
else
{
mainGame
->
gameConf
.
textfontsize
=
mainGame
->
gameConf
.
textfontsize
+
2
;
mainGame
->
textFont
->
setFontSize
(
mainGame
->
gameConf
.
textfontsize
*
mainGame
->
yScale
);
const
auto
&
tsize
=
mainGame
->
stText
->
getRelativePosition
();
mainGame
->
InitStaticText
(
mainGame
->
stText
,
tsize
.
getWidth
(),
tsize
.
getHeight
(),
mainGame
->
textFont
,
mainGame
->
showingtext
);
}
break
;
break
;
}
}
case
BUTTON_CHAIN_IGNORE
:
{
case
BUTTON_CHAIN_IGNORE
:
{
...
...
Classes/gframe/game.cpp
View file @
c915371c
...
@@ -110,13 +110,10 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
...
@@ -110,13 +110,10 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
params
.
ZBufferBits
=
16
;
params
.
ZBufferBits
=
16
;
params
.
AntiAlias
=
0
;
params
.
AntiAlias
=
0
;
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
0
,
0
);
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
0
,
0
);
#endif
device
=
irr
::
createDeviceEx
(
params
);
device
=
irr
::
createDeviceEx
(
params
);
if
(
!
device
)
if
(
!
device
)
return
false
;
return
false
;
#ifdef _IRR_ANDROID_PLATFORM_
if
(
!
android
::
perfromTrick
(
app
))
{
if
(
!
android
::
perfromTrick
(
app
))
{
return
false
;
return
false
;
}
}
...
@@ -496,8 +493,8 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
...
@@ -496,8 +493,8 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
scrCardText
->
setLargeStep
(
1
);
scrCardText
->
setLargeStep
(
1
);
scrCardText
->
setSmallStep
(
1
);
scrCardText
->
setSmallStep
(
1
);
scrCardText
->
setVisible
(
false
);
scrCardText
->
setVisible
(
false
);
btnReduceCardText
=
env
->
addButton
(
rect
<
s32
>
(
140
*
yScale
,
34
5
*
yScale
,
165
*
yScale
,
370
*
yScale
),
wInfos
,
BUTTON_REDUCE_CARD_TEXT
,
L"A-"
);
btnReduceCardText
=
env
->
addButton
(
rect
<
s32
>
(
140
*
yScale
,
34
0
*
yScale
,
165
*
yScale
,
365
*
yScale
),
wInfos
,
BUTTON_REDUCE_CARD_TEXT
,
L"A-"
);
btnEnlargeCardText
=
env
->
addButton
(
rect
<
s32
>
(
175
*
yScale
,
34
5
*
yScale
,
200
*
yScale
,
370
*
yScale
),
wInfos
,
BUTTON_ENLARGE_CARD_TEXT
,
L"A+"
);
btnEnlargeCardText
=
env
->
addButton
(
rect
<
s32
>
(
175
*
yScale
,
34
0
*
yScale
,
200
*
yScale
,
365
*
yScale
),
wInfos
,
BUTTON_ENLARGE_CARD_TEXT
,
L"A+"
);
//imageButtons pallet
//imageButtons pallet
wPallet
=
env
->
addWindow
(
rect
<
s32
>
(
262
*
xScale
,
275
*
yScale
,
307
*
xScale
,
639
*
yScale
),
false
,
L""
);
wPallet
=
env
->
addWindow
(
rect
<
s32
>
(
262
*
xScale
,
275
*
yScale
,
307
*
xScale
,
639
*
yScale
),
false
,
L""
);
wPallet
->
getCloseButton
()
->
setVisible
(
false
);
wPallet
->
getCloseButton
()
->
setVisible
(
false
);
...
@@ -1406,12 +1403,6 @@ void Game::MainLoop() {
...
@@ -1406,12 +1403,6 @@ void Game::MainLoop() {
DrawGUI
();
DrawGUI
();
DrawSpec
();
DrawSpec
();
driver
->
enableMaterial2D
(
false
);
driver
->
enableMaterial2D
(
false
);
#else
}
else
{
DrawBackImage
(
imageManager
.
tBackGround_menu
);
}
DrawGUI
();
DrawSpec
();
#endif
#endif
gMutex
.
unlock
();
gMutex
.
unlock
();
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
...
@@ -1447,15 +1438,6 @@ void Game::MainLoop() {
...
@@ -1447,15 +1438,6 @@ void Game::MainLoop() {
str
+=
(
s32
)
device
->
getVideoDriver
()
->
getFPS
();
str
+=
(
s32
)
device
->
getVideoDriver
()
->
getFPS
();
stat
->
setText
(
str
.
c_str
()
);
stat
->
setText
(
str
.
c_str
()
);
}
}
#else
if
(
cur_time
<
fps
*
17
-
20
)
#ifdef _WIN32
Sleep
(
20
);
#else
usleep
(
20000
);
#endif
myswprintf
(
cap
,
L"FPS: %d"
,
fps
);
device
->
setWindowCaption
(
cap
);
#endif
#endif
fps
=
0
;
fps
=
0
;
cur_time
-=
1000
;
cur_time
-=
1000
;
...
@@ -1473,11 +1455,8 @@ void Game::MainLoop() {
...
@@ -1473,11 +1455,8 @@ void Game::MainLoop() {
DuelClient
::
StopClient
(
true
);
DuelClient
::
StopClient
(
true
);
if
(
dInfo
.
isSingleMode
)
if
(
dInfo
.
isSingleMode
)
SingleMode
::
StopPlay
(
true
);
SingleMode
::
StopPlay
(
true
);
#ifdef _WIN32
Sleep
(
500
);
#else
usleep
(
500000
);
usleep
(
500000
);
#endif
SaveConfig
();
SaveConfig
();
usleep
(
500000
);
usleep
(
500000
);
// device->drop();
// device->drop();
...
@@ -1519,7 +1498,7 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
...
@@ -1519,7 +1498,7 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
env
->
removeFocus
(
scrCardText
);
env
->
removeFocus
(
scrCardText
);
return
;
return
;
}
}
format_text
=
SetStaticText
(
pControl
,
cWidth
-
int
(
2
5
*
xScale
),
font
,
text
);
format_text
=
SetStaticText
(
pControl
,
cWidth
-
int
(
1
5
*
xScale
),
font
,
text
);
u32
fontheight
=
font
->
getDimension
(
L"A"
).
Height
+
font
->
getKerningHeight
();
u32
fontheight
=
font
->
getDimension
(
L"A"
).
Height
+
font
->
getKerningHeight
();
u32
step
=
(
font
->
getDimension
(
format_text
.
c_str
()).
Height
-
cHeight
)
/
fontheight
+
1
;
u32
step
=
(
font
->
getDimension
(
format_text
.
c_str
()).
Height
-
cHeight
)
/
fontheight
+
1
;
scrCardText
->
setVisible
(
true
);
scrCardText
->
setVisible
(
true
);
...
...
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