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
1be54d6f
Commit
1be54d6f
authored
May 11, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change side chat drawing
parent
d6da1e2f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
93 deletions
+140
-93
Classes/gframe/CGUITTFont.cpp
Classes/gframe/CGUITTFont.cpp
+19
-20
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+1
-0
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+98
-67
Classes/gframe/duelclient.cpp
Classes/gframe/duelclient.cpp
+5
-0
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+1
-1
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+13
-4
Classes/gframe/game.h
Classes/gframe/game.h
+3
-1
No files found.
Classes/gframe/CGUITTFont.cpp
View file @
1be54d6f
...
@@ -527,29 +527,28 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
...
@@ -527,29 +527,28 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
core
::
ustring
::
const_iterator
iter
(
utext
);
core
::
ustring
::
const_iterator
iter
(
utext
);
while
(
!
iter
.
atEnd
())
{
while
(
!
iter
.
atEnd
())
{
uchar32_t
currentChar
=
*
iter
;
uchar32_t
currentChar
=
*
iter
;
bool
lineBreak
=
false
;
if
(
currentChar
==
L'\r'
)
{
// Mac or Windows breaks
lineBreak
=
true
;
if
(
*
(
iter
+
1
)
==
L'\n'
)
// Windows line breaks.
currentChar
=
*
(
++
iter
);
}
else
if
(
currentChar
==
L'\n'
)
{
// Unix breaks
lineBreak
=
true
;
}
if
(
lineBreak
)
{
previousChar
=
0
;
offset
.
Y
+=
supposed_line_height
;
//font_metrics.ascender / 64;
offset
.
X
=
position
.
UpperLeftCorner
.
X
;
if
(
hcenter
)
offset
.
X
+=
(
position
.
getWidth
()
-
textDimension
.
Width
)
>>
1
;
++
iter
;
continue
;
}
n
=
getGlyphIndexByChar
(
currentChar
);
n
=
getGlyphIndexByChar
(
currentChar
);
bool
visible
=
(
Invisible
.
findFirst
(
currentChar
)
==
-
1
);
bool
visible
=
(
Invisible
.
findFirst
(
currentChar
)
==
-
1
);
if
(
n
>
0
&&
visible
)
{
if
(
n
>
0
&&
visible
)
{
bool
lineBreak
=
false
;
if
(
currentChar
==
L'\r'
)
{
// Mac or Windows breaks
lineBreak
=
true
;
if
(
*
(
iter
+
1
)
==
(
uchar32_t
)
'\n'
)
// Windows line breaks.
currentChar
=
*
(
++
iter
);
}
else
if
(
currentChar
==
(
uchar32_t
)
'\n'
)
{
// Unix breaks
lineBreak
=
true
;
}
if
(
lineBreak
)
{
previousChar
=
0
;
offset
.
Y
+=
supposed_line_height
;
//font_metrics.ascender / 64;
offset
.
X
=
position
.
UpperLeftCorner
.
X
;
if
(
hcenter
)
offset
.
X
+=
(
position
.
getWidth
()
-
textDimension
.
Width
)
>>
1
;
++
iter
;
continue
;
}
// Calculate the glyph offset.
// Calculate the glyph offset.
s32
offx
=
Glyphs
[
n
-
1
].
offset
.
X
;
s32
offx
=
Glyphs
[
n
-
1
].
offset
.
X
;
s32
offy
=
(
font_metrics
.
ascender
/
64
)
-
Glyphs
[
n
-
1
].
offset
.
Y
;
s32
offy
=
(
font_metrics
.
ascender
/
64
)
-
Glyphs
[
n
-
1
].
offset
.
Y
;
...
...
Classes/gframe/deck_con.cpp
View file @
1be54d6f
...
@@ -114,6 +114,7 @@ void DeckBuilder::Terminate() {
...
@@ -114,6 +114,7 @@ void DeckBuilder::Terminate() {
mainGame
->
btnShuffleDeck
->
setVisible
(
false
);
mainGame
->
btnShuffleDeck
->
setVisible
(
false
);
mainGame
->
btnSortDeck
->
setVisible
(
false
);
mainGame
->
btnSortDeck
->
setVisible
(
false
);
mainGame
->
btnClearDeck
->
setVisible
(
false
);
mainGame
->
btnClearDeck
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
imgChat
->
setVisible
(
true
);
mainGame
->
imgChat
->
setVisible
(
true
);
mainGame
->
imgQuickAnimation
->
setVisible
(
true
);
mainGame
->
imgQuickAnimation
->
setVisible
(
true
);
mainGame
->
wSettings
->
setVisible
(
false
);
mainGame
->
wSettings
->
setVisible
(
false
);
...
...
Classes/gframe/drawing.cpp
View file @
1be54d6f
This diff is collapsed.
Click to expand it.
Classes/gframe/duelclient.cpp
View file @
1be54d6f
...
@@ -215,6 +215,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -215,6 +215,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
is_building
=
false
;
mainGame
->
ResizeChatInputWindow
();
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
...
@@ -381,6 +382,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -381,6 +382,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
is_building
=
true
;
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
CloseGameWindow
();
mainGame
->
CloseGameWindow
();
mainGame
->
ResizeChatInputWindow
();
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
imgChat
->
setVisible
(
false
);
mainGame
->
imgChat
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
...
@@ -500,6 +502,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -500,6 +502,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
deckBuilder
.
prev_category
=
mainGame
->
cbCategorySelect
->
getSelected
();
mainGame
->
deckBuilder
.
prev_category
=
mainGame
->
cbCategorySelect
->
getSelected
();
mainGame
->
deckBuilder
.
prev_deck
=
mainGame
->
cbDeckSelect
->
getSelected
();
mainGame
->
deckBuilder
.
prev_deck
=
mainGame
->
cbDeckSelect
->
getSelected
();
wchar_t
cate
[
256
];
wchar_t
cate
[
256
];
...
@@ -624,6 +627,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -624,6 +627,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
wChat
->
setVisible
(
true
);
if
(
mainGame
->
chkDefaultShowChain
->
isChecked
())
{
if
(
mainGame
->
chkDefaultShowChain
->
isChecked
())
{
...
@@ -696,6 +700,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -696,6 +700,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnStartBot
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
if
(
bot_mode
)
if
(
bot_mode
)
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wSinglePlay
);
...
...
Classes/gframe/event_handler.cpp
View file @
1be54d6f
...
@@ -2011,7 +2011,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -2011,7 +2011,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
mainGame
->
imgChat
->
setImage
(
imageManager
.
tShut
);
mainGame
->
imgChat
->
setImage
(
imageManager
.
tShut
);
}
}
mainGame
->
chkIgnore1
->
setChecked
(
mainGame
->
gameConf
.
chkIgnore1
);
mainGame
->
chkIgnore1
->
setChecked
(
mainGame
->
gameConf
.
chkIgnore1
);
bool
show
=
(
!
mainGame
->
dInfo
.
isStarted
||
mainGame
->
is_buil
ding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
bool
show
=
(
mainGame
->
is_building
&&
!
mainGame
->
is_si
ding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
mainGame
->
wChat
->
setVisible
(
show
);
mainGame
->
wChat
->
setVisible
(
show
);
if
(
!
show
)
if
(
!
show
)
mainGame
->
ClearChatMsg
();
mainGame
->
ClearChatMsg
();
...
...
Classes/gframe/game.cpp
View file @
1be54d6f
...
@@ -964,7 +964,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
...
@@ -964,7 +964,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnShuffleDeck
->
setVisible
(
false
);
btnShuffleDeck
->
setVisible
(
false
);
btnSortDeck
->
setVisible
(
false
);
btnSortDeck
->
setVisible
(
false
);
btnClearDeck
->
setVisible
(
false
);
btnClearDeck
->
setVisible
(
false
);
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
510
*
xScale
,
40
*
yScale
,
82
0
*
xScale
,
80
*
yScale
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
400
*
xScale
,
40
*
yScale
,
71
0
*
xScale
,
80
*
yScale
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
ChangeToIGUIImageButton
(
btnSideOK
,
imageManager
.
tButton_L
,
imageManager
.
tButton_L_pressed
);
ChangeToIGUIImageButton
(
btnSideOK
,
imageManager
.
tButton_L
,
imageManager
.
tButton_L_pressed
);
btnSideOK
->
setVisible
(
false
);
btnSideOK
->
setVisible
(
false
);
btnSideShuffle
=
env
->
addButton
(
rect
<
s32
>
(
310
*
xScale
,
100
*
yScale
,
370
*
xScale
,
130
*
yScale
),
0
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSideShuffle
=
env
->
addButton
(
rect
<
s32
>
(
310
*
xScale
,
100
*
yScale
,
370
*
xScale
,
130
*
yScale
),
0
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
...
@@ -1582,7 +1582,7 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth,
...
@@ -1582,7 +1582,7 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth,
strBuffer
[
pbuffer
++
]
=
c
;
strBuffer
[
pbuffer
++
]
=
c
;
}
}
strBuffer
[
pbuffer
]
=
0
;
strBuffer
[
pbuffer
]
=
0
;
pControl
->
setText
(
strBuffer
);
if
(
pControl
)
pControl
->
setText
(
strBuffer
);
ret
.
assign
(
strBuffer
);
ret
.
assign
(
strBuffer
);
return
ret
;
return
ret
;
}
}
...
@@ -1777,10 +1777,10 @@ void Game::LoadConfig() {
...
@@ -1777,10 +1777,10 @@ void Game::LoadConfig() {
gameConf
.
gamename
[
0
]
=
0
;
gameConf
.
gamename
[
0
]
=
0
;
BufferIO
::
DecodeUTF8
(
android
::
getLastCategory
(
appMain
).
c_str
(),
wstr
);;
BufferIO
::
DecodeUTF8
(
android
::
getLastCategory
(
appMain
).
c_str
(),
wstr
);;
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastcategory
,
64
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastcategory
,
64
);
//irr:os::Printer::log("getLastCategory", android::getLastCategory(appMain).c_str());
BufferIO
::
DecodeUTF8
(
android
::
getLastDeck
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
DecodeUTF8
(
android
::
getLastDeck
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastdeck
,
64
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
lastdeck
,
64
);
//os::Printer::log(android::getFontPath(appMain).c_str());
BufferIO
::
DecodeUTF8
(
android
::
getFontPath
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
DecodeUTF8
(
android
::
getFontPath
(
appMain
).
c_str
(),
wstr
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
numfont
,
256
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
numfont
,
256
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
textfont
,
256
);
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
textfont
,
256
);
...
@@ -2128,6 +2128,7 @@ void Game::CloseDuelWindow() {
...
@@ -2128,6 +2128,7 @@ void Game::CloseDuelWindow() {
lstHostList
->
clear
();
lstHostList
->
clear
();
DuelClient
::
hosts
.
clear
();
DuelClient
::
hosts
.
clear
();
ClearTextures
();
ClearTextures
();
ResizeChatInputWindow
();
closeDoneSignal
.
Set
();
closeDoneSignal
.
Set
();
}
}
int
Game
::
LocalPlayer
(
int
player
)
const
{
int
Game
::
LocalPlayer
(
int
player
)
const
{
...
@@ -2171,6 +2172,14 @@ int Game::ChatLocalPlayer(int player) {
...
@@ -2171,6 +2172,14 @@ int Game::ChatLocalPlayer(int player) {
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
}
}
void
Game
::
ResizeChatInputWindow
()
{
s32
x
=
305
*
xScale
;
if
(
is_building
)
x
=
802
*
xScale
;
//305 * xScale, 610 * yScale, 1020 * xScale, 640 * yScale
wChat
->
setRelativePosition
(
recti
(
x
,
(
GAME_HEIGHT
-
30
)
*
xScale
,
GAME_WIDTH
*
xScale
,
GAME_HEIGHT
*
yScale
));
//3 * xScale, 2 * yScale, 710 * xScale, 28 * yScale
ebChatInput
->
setRelativePosition
(
recti
(
3
*
xScale
,
2
*
yScale
,
(
GAME_WIDTH
-
6
)
*
xScale
-
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
,
28
*
xScale
));
}
void
Game
::
ChangeToIGUIImageWindow
(
irr
::
gui
::
IGUIWindow
*
window
,
irr
::
gui
::
IGUIImage
**
pWindowBackground
,
irr
::
video
::
ITexture
*
image
)
{
void
Game
::
ChangeToIGUIImageWindow
(
irr
::
gui
::
IGUIWindow
*
window
,
irr
::
gui
::
IGUIImage
**
pWindowBackground
,
irr
::
video
::
ITexture
*
image
)
{
window
->
setDrawBackground
(
false
);
window
->
setDrawBackground
(
false
);
recti
pos
=
window
->
getRelativePosition
();
recti
pos
=
window
->
getRelativePosition
();
...
...
Classes/gframe/game.h
View file @
1be54d6f
...
@@ -210,7 +210,7 @@ public:
...
@@ -210,7 +210,7 @@ public:
editbox
->
setText
(
text
.
c_str
());
editbox
->
setText
(
text
.
c_str
());
}
}
void
ResizeChatInputWindow
();
template
<
typename
T
>
template
<
typename
T
>
static
std
::
vector
<
T
>
TokenizeString
(
T
input
,
const
T
&
token
);
static
std
::
vector
<
T
>
TokenizeString
(
T
input
,
const
T
&
token
);
...
@@ -262,6 +262,8 @@ public:
...
@@ -262,6 +262,8 @@ public:
bool
is_building
;
bool
is_building
;
bool
is_siding
;
bool
is_siding
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
ClientField
dField
;
ClientField
dField
;
DeckBuilder
deckBuilder
;
DeckBuilder
deckBuilder
;
MenuHandler
menuHandler
;
MenuHandler
menuHandler
;
...
...
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