Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
wind2009
ygopro
Commits
fe5ab42e
Commit
fe5ab42e
authored
May 10, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch '233/patch-side-chat' into develop
parents
7c3757a2
39bbff56
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
130 additions
and
100 deletions
+130
-100
gframe/CGUITTFont.cpp
gframe/CGUITTFont.cpp
+19
-20
gframe/deck_con.cpp
gframe/deck_con.cpp
+1
-0
gframe/drawing.cpp
gframe/drawing.cpp
+92
-73
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+11
-5
gframe/game.h
gframe/game.h
+1
-0
No files found.
gframe/CGUITTFont.cpp
View file @
fe5ab42e
...
@@ -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
;
...
...
gframe/deck_con.cpp
View file @
fe5ab42e
...
@@ -94,6 +94,7 @@ void DeckBuilder::Terminate() {
...
@@ -94,6 +94,7 @@ void DeckBuilder::Terminate() {
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
false
);
mainGame
->
btnBigCardClose
->
setVisible
(
false
);
mainGame
->
btnBigCardClose
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
PopupElement
(
mainGame
->
wMainMenu
);
mainGame
->
PopupElement
(
mainGame
->
wMainMenu
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
wACMessage
->
setVisible
(
false
);
mainGame
->
wACMessage
->
setVisible
(
false
);
...
...
gframe/drawing.cpp
View file @
fe5ab42e
This diff is collapsed.
Click to expand it.
gframe/duelclient.cpp
View file @
fe5ab42e
...
@@ -213,6 +213,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
...
@@ -213,6 +213,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
);
...
@@ -377,7 +378,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -377,7 +378,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
->
wChat
->
setVisible
(
false
);
mainGame
->
ResizeChatInputWindow
(
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
...
@@ -493,6 +494,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -493,6 +494,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
();
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
...
@@ -604,6 +606,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -604,6 +606,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
())
{
...
@@ -676,6 +679,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, unsigned int len) {
...
@@ -676,6 +679,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
);
...
...
gframe/event_handler.cpp
View file @
fe5ab42e
...
@@ -1904,7 +1904,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1904,7 +1904,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
CHECKBOX_DISABLE_CHAT
:
{
case
CHECKBOX_DISABLE_CHAT
:
{
bool
show
=
mainGame
->
is_building
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
bool
show
=
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
mainGame
->
wChat
->
setVisible
(
show
);
mainGame
->
wChat
->
setVisible
(
show
);
if
(
!
show
)
if
(
!
show
)
mainGame
->
ClearChatMsg
();
mainGame
->
ClearChatMsg
();
...
...
gframe/game.cpp
View file @
fe5ab42e
...
@@ -699,7 +699,7 @@ bool Game::Initialize() {
...
@@ -699,7 +699,7 @@ bool Game::Initialize() {
btnShuffleDeck
=
env
->
addButton
(
rect
<
s32
>
(
5
,
99
,
55
,
120
),
wDeckEdit
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnShuffleDeck
=
env
->
addButton
(
rect
<
s32
>
(
5
,
99
,
55
,
120
),
wDeckEdit
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSortDeck
=
env
->
addButton
(
rect
<
s32
>
(
60
,
99
,
110
,
120
),
wDeckEdit
,
BUTTON_SORT_DECK
,
dataManager
.
GetSysString
(
1305
));
btnSortDeck
=
env
->
addButton
(
rect
<
s32
>
(
60
,
99
,
110
,
120
),
wDeckEdit
,
BUTTON_SORT_DECK
,
dataManager
.
GetSysString
(
1305
));
btnClearDeck
=
env
->
addButton
(
rect
<
s32
>
(
115
,
99
,
165
,
120
),
wDeckEdit
,
BUTTON_CLEAR_DECK
,
dataManager
.
GetSysString
(
1304
));
btnClearDeck
=
env
->
addButton
(
rect
<
s32
>
(
115
,
99
,
165
,
120
),
wDeckEdit
,
BUTTON_CLEAR_DECK
,
dataManager
.
GetSysString
(
1304
));
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
510
,
40
,
82
0
,
80
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
btnSideOK
=
env
->
addButton
(
rect
<
s32
>
(
400
,
40
,
71
0
,
80
),
0
,
BUTTON_SIDE_OK
,
dataManager
.
GetSysString
(
1334
));
btnSideOK
->
setVisible
(
false
);
btnSideOK
->
setVisible
(
false
);
btnSideShuffle
=
env
->
addButton
(
rect
<
s32
>
(
310
,
100
,
370
,
130
),
0
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSideShuffle
=
env
->
addButton
(
rect
<
s32
>
(
310
,
100
,
370
,
130
),
0
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
btnSideShuffle
->
setVisible
(
false
);
btnSideShuffle
->
setVisible
(
false
);
...
@@ -1131,7 +1131,7 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth,
...
@@ -1131,7 +1131,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
;
}
}
...
@@ -1790,6 +1790,7 @@ void Game::CloseDuelWindow() {
...
@@ -1790,6 +1790,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
{
...
@@ -1914,7 +1915,7 @@ void Game::OnResize() {
...
@@ -1914,7 +1915,7 @@ void Game::OnResize() {
stStar
->
setRelativePosition
(
Resize
(
10
,
62
+
100
/
6
,
70
,
82
+
100
/
6
));
stStar
->
setRelativePosition
(
Resize
(
10
,
62
+
100
/
6
,
70
,
82
+
100
/
6
));
stSearch
->
setRelativePosition
(
Resize
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
));
stSearch
->
setRelativePosition
(
Resize
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
));
stScale
->
setRelativePosition
(
Resize
(
105
,
62
+
100
/
6
,
165
,
82
+
100
/
6
));
stScale
->
setRelativePosition
(
Resize
(
105
,
62
+
100
/
6
,
165
,
82
+
100
/
6
));
btnSideOK
->
setRelativePosition
(
Resize
(
510
,
40
,
82
0
,
80
));
btnSideOK
->
setRelativePosition
(
Resize
(
400
,
40
,
71
0
,
80
));
btnSideShuffle
->
setRelativePosition
(
Resize
(
310
,
100
,
370
,
130
));
btnSideShuffle
->
setRelativePosition
(
Resize
(
310
,
100
,
370
,
130
));
btnSideSort
->
setRelativePosition
(
Resize
(
375
,
100
,
435
,
130
));
btnSideSort
->
setRelativePosition
(
Resize
(
375
,
100
,
435
,
130
));
btnSideReload
->
setRelativePosition
(
Resize
(
440
,
100
,
500
,
130
));
btnSideReload
->
setRelativePosition
(
Resize
(
440
,
100
,
500
,
130
));
...
@@ -2005,8 +2006,7 @@ void Game::OnResize() {
...
@@ -2005,8 +2006,7 @@ void Game::OnResize() {
btnM2
->
setRelativePosition
(
Resize
(
160
,
0
,
210
,
20
));
btnM2
->
setRelativePosition
(
Resize
(
160
,
0
,
210
,
20
));
btnEP
->
setRelativePosition
(
Resize
(
320
,
0
,
370
,
20
));
btnEP
->
setRelativePosition
(
Resize
(
320
,
0
,
370
,
20
));
wChat
->
setRelativePosition
(
recti
(
wInfos
->
getRelativePosition
().
LowerRightCorner
.
X
+
6
,
window_size
.
Height
-
25
,
window_size
.
Width
,
window_size
.
Height
));
ResizeChatInputWindow
();
ebChatInput
->
setRelativePosition
(
recti
(
3
,
2
,
window_size
.
Width
-
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
-
6
,
22
));
btnLeaveGame
->
setRelativePosition
(
Resize
(
205
,
5
,
295
,
80
));
btnLeaveGame
->
setRelativePosition
(
Resize
(
205
,
5
,
295
,
80
));
wReplayControl
->
setRelativePosition
(
Resize
(
205
,
143
,
295
,
273
));
wReplayControl
->
setRelativePosition
(
Resize
(
205
,
143
,
295
,
273
));
...
@@ -2029,6 +2029,12 @@ void Game::OnResize() {
...
@@ -2029,6 +2029,12 @@ void Game::OnResize() {
btnBigCardZoomOut
->
setRelativePosition
(
Resize
(
205
,
180
,
295
,
215
));
btnBigCardZoomOut
->
setRelativePosition
(
Resize
(
205
,
180
,
295
,
215
));
btnBigCardClose
->
setRelativePosition
(
Resize
(
205
,
230
,
295
,
265
));
btnBigCardClose
->
setRelativePosition
(
Resize
(
205
,
230
,
295
,
265
));
}
}
void
Game
::
ResizeChatInputWindow
()
{
s32
x
=
wInfos
->
getRelativePosition
().
LowerRightCorner
.
X
+
6
;
if
(
is_building
)
x
=
802
*
xScale
;
wChat
->
setRelativePosition
(
recti
(
x
,
window_size
.
Height
-
25
,
window_size
.
Width
,
window_size
.
Height
));
ebChatInput
->
setRelativePosition
(
recti
(
3
,
2
,
window_size
.
Width
-
wChat
->
getRelativePosition
().
UpperLeftCorner
.
X
-
6
,
22
));
}
recti
Game
::
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
recti
Game
::
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
)
{
x
=
x
*
xScale
;
x
=
x
*
xScale
;
y
=
y
*
yScale
;
y
=
y
*
yScale
;
...
...
gframe/game.h
View file @
fe5ab42e
...
@@ -185,6 +185,7 @@ public:
...
@@ -185,6 +185,7 @@ public:
}
}
void
OnResize
();
void
OnResize
();
void
ResizeChatInputWindow
();
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
position2di
Resize
(
s32
x
,
s32
y
);
position2di
Resize
(
s32
x
,
s32
y
);
...
...
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