Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
c6a5ebac
Commit
c6a5ebac
authored
May 16, 2013
by
Fluorohydride
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #528 from matteoserva/master
improved chat box
parents
e4153e29
f489892d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
9 deletions
+46
-9
gframe/drawing.cpp
gframe/drawing.cpp
+23
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+7
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+4
-0
gframe/game.cpp
gframe/game.cpp
+6
-4
gframe/game.h
gframe/game.h
+6
-3
No files found.
gframe/drawing.cpp
View file @
c6a5ebac
...
...
@@ -666,10 +666,31 @@ void Game::DrawSpec() {
if
(
attack_sv
>
28
)
attack_sv
=
0
;
}
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
static
unsigned
int
chatColor
[
11
]
=
{
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xff8080ff
,
0xffff4040
,
0xffff4040
};
bool
showChat
=
true
;
if
(
hideChat
)
{
showChat
=
false
;
hideChatTimer
=
10
;
}
else
if
(
hideChatTimer
>
0
)
{
showChat
=
false
;
hideChatTimer
--
;
}
int
maxChatLines
=
mainGame
->
dInfo
.
isStarted
?
5
:
8
;
for
(
int
i
=
0
;
i
<
maxChatLines
;
++
i
)
{
static
unsigned
int
chatColor
[]
=
{
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xff8080ff
,
0xffff4040
,
0xffff4040
,
0xffff4040
,
0xff40ff40
,
0xff4040ff
,
0xff40ffff
,
0xffff40ff
,
0xffffff40
,
0xffffffff
,
0xff808080
,
0xff404040
};
if
(
chatTiming
[
i
])
{
chatTiming
[
i
]
--
;
if
(
!
showChat
&&
i
>
2
)
continue
;
int
w
=
textFont
->
getDimension
(
chatMsg
[
i
].
c_str
()).
Width
;
driver
->
draw2DRectangle
(
recti
(
305
,
596
-
20
*
i
,
307
+
w
,
616
-
20
*
i
),
0xa0000000
,
0xa0000000
,
0xa0000000
,
0xa0000000
);
textFont
->
draw
(
chatMsg
[
i
].
c_str
(),
rect
<
s32
>
(
305
,
595
-
20
*
i
,
1020
,
615
-
20
*
i
),
0xff000000
,
false
,
false
);
...
...
gframe/duelclient.cpp
View file @
c6a5ebac
...
...
@@ -592,6 +592,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
AddChatMsg
(
msg
,
8
);
mainGame
->
gMutex
.
Unlock
();
}
else
if
(
pkt
->
player
>=
11
&&
pkt
->
player
<=
19
)
{
//system custom message.
BufferIO
::
CopyWStr
(
pkt
->
msg
,
msg
,
256
);
msg
[(
len
-
3
)
/
2
]
=
0
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
AddChatMsg
(
msg
,
pkt
->
player
);
mainGame
->
gMutex
.
Unlock
();
}
else
{
if
(
mainGame
->
chkIgnore2
->
isChecked
())
break
;
...
...
gframe/event_handler.cpp
View file @
c6a5ebac
...
...
@@ -1304,6 +1304,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
hovered_card
->
location
==
LOCATION_HAND
&&
!
mainGame
->
dInfo
.
is_shuffling
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_SHUFFLE_HAND
)
{
hovered_card
->
is_hovered
=
false
;
MoveCard
(
hovered_card
,
5
);
if
(
hovered_controler
==
0
)
mainGame
->
hideChat
=
false
;
}
if
(
hovered_card
->
equipTarget
)
hovered_card
->
equipTarget
->
is_showequip
=
false
;
...
...
@@ -1323,6 +1325,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
hovered_location
==
LOCATION_HAND
)
{
mcard
->
is_hovered
=
true
;
MoveCard
(
mcard
,
5
);
if
(
hovered_controler
==
0
)
mainGame
->
hideChat
=
true
;
}
if
(
mcard
->
equipTarget
)
mcard
->
equipTarget
->
is_showequip
=
true
;
...
...
gframe/game.cpp
View file @
c6a5ebac
...
...
@@ -222,7 +222,7 @@ bool Game::Initialize() {
chkWaitChain
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
110
,
280
,
135
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1277
));
chkIgnore1
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
170
,
280
,
195
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1290
));
chkIgnore2
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
200
,
280
,
225
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1291
));
chkIgnore2
->
setChecked
(
tru
e
);
chkIgnore2
->
setChecked
(
fals
e
);
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -484,6 +484,8 @@ bool Game::Initialize() {
col
.
setAlpha
(
224
);
env
->
getSkin
()
->
setColor
((
EGUI_DEFAULT_COLOR
)
i
,
col
);
}
hideChat
=
false
;
hideChatTimer
=
0
;
return
true
;
}
void
Game
::
MainLoop
()
{
...
...
@@ -492,7 +494,7 @@ void Game::MainLoop() {
irr
::
core
::
matrix4
mProjection
;
BuildProjectionMatrix
(
mProjection
,
-
0.81
f
,
0.44
f
,
-
0.42
f
,
0.42
f
,
1.0
f
,
100.0
f
);
camera
->
setProjectionMatrix
(
mProjection
);
mProjection
.
buildCameraLookAtMatrixLH
(
vector3df
(
3.95
f
,
8.0
f
,
7.8
f
),
vector3df
(
3.95
f
,
0
,
0
),
vector3df
(
0
,
0
,
1
));
camera
->
setViewMatrixAffector
(
mProjection
);
smgr
->
setAmbientLight
(
SColorf
(
1.0
f
,
1.0
f
,
1.0
f
));
...
...
@@ -823,7 +825,7 @@ void Game::ShowCardInfo(int code) {
SetStaticText
(
stText
,
270
,
textFont
,
(
wchar_t
*
)
dataManager
.
GetText
(
code
));
}
void
Game
::
AddChatMsg
(
wchar_t
*
msg
,
int
player
)
{
for
(
int
i
=
4
;
i
>
0
;
--
i
)
{
for
(
int
i
=
7
;
i
>
0
;
--
i
)
{
chatMsg
[
i
]
=
chatMsg
[
i
-
1
];
chatTiming
[
i
]
=
chatTiming
[
i
-
1
];
chatType
[
i
]
=
chatType
[
i
-
1
];
...
...
@@ -831,7 +833,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
chatMsg
[
0
].
clear
();
chatTiming
[
0
]
=
1200
;
chatType
[
0
]
=
player
;
switch
(
player
)
{
if
(
player
<
11
||
player
>
19
)
switch
(
player
)
{
case
0
:
//from host
chatMsg
[
0
].
append
(
dInfo
.
hostname
);
chatMsg
[
0
].
append
(
L": "
);
...
...
gframe/game.h
View file @
c6a5ebac
...
...
@@ -109,9 +109,12 @@ public:
std
::
list
<
FadingUnit
>
fadingList
;
std
::
vector
<
int
>
logParam
;
std
::
wstring
chatMsg
[
5
];
int
chatTiming
[
5
];
int
chatType
[
5
];
std
::
wstring
chatMsg
[
8
];
int
hideChatTimer
;
bool
hideChat
;
int
chatTiming
[
8
];
int
chatType
[
8
];
unsigned
short
linePattern
;
int
waitFrame
;
int
signalFrame
;
...
...
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