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
YGOPRO-520DIY
ygopro
Commits
e7b0c400
Commit
e7b0c400
authored
Aug 19, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MSG_PLAYER_HINT
parent
e825a8f7
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
144 additions
and
99 deletions
+144
-99
gframe/client_field.cpp
gframe/client_field.cpp
+4
-0
gframe/client_field.h
gframe/client_field.h
+2
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+14
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+94
-77
gframe/event_handler.h
gframe/event_handler.h
+0
-19
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+5
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+8
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+5
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+10
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/client_field.cpp
View file @
e7b0c400
...
...
@@ -380,6 +380,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CHAIN
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CARD
)
{
wchar_t
formatBuffer
[
2048
];
if
(
chain
&&
selectable_cards
[
i
]
->
is_conti
&&
!
selectable_cards
[
i
]
->
code
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
...
...
@@ -403,6 +404,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
}
}
else
{
if
(
sort_list
[
i
])
{
wchar_t
formatBuffer
[
2048
];
myswprintf
(
formatBuffer
,
L"%d"
,
sort_list
[
i
]);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
}
else
mainGame
->
stCardPos
[
i
]
->
setText
(
L""
);
...
...
@@ -447,6 +449,7 @@ void ClientField::ShowChainCard() {
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
selectable_cards
[
i
]
->
sequence
),
selectable_cards
[
i
]
->
sequence
+
1
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
...
...
@@ -501,6 +504,7 @@ void ClientField::ShowLocationCard() {
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
display_cards
[
i
]
->
overlayTarget
->
location
,
display_cards
[
i
]
->
overlayTarget
->
sequence
),
...
...
gframe/client_field.h
View file @
e7b0c400
...
...
@@ -65,6 +65,7 @@ public:
std
::
vector
<
ClientCard
*>
selectsum_all
;
std
::
vector
<
ClientCard
*>
display_cards
;
std
::
vector
<
int
>
sort_list
;
std
::
map
<
int
,
int
>
player_desc_hints
[
2
];
bool
grave_act
;
bool
remove_act
;
bool
deck_act
;
...
...
@@ -114,11 +115,11 @@ public:
int
command_location
;
size_t
command_sequence
;
ClientCard
*
hovered_card
;
int
hovered_player
;
ClientCard
*
clicked_card
;
ClientCard
*
command_card
;
ClientCard
*
highlighting_card
;
int
list_command
;
wchar_t
formatBuffer
[
2048
];
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
void
GetHoverField
(
int
x
,
int
y
);
...
...
gframe/duelclient.cpp
View file @
e7b0c400
...
...
@@ -2977,6 +2977,20 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
return
true
;
}
case
MSG_PLAYER_HINT
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
if
(
chtype
==
PHINT_DESC_ADD
)
{
player_desc_hints
[
value
]
++
;
}
else
if
(
chtype
==
PHINT_DESC_REMOVE
)
{
player_desc_hints
[
value
]
--
;
if
(
player_desc_hints
[
value
]
==
0
)
player_desc_hints
.
erase
(
value
);
}
return
true
;
}
case
MSG_MATCH_KILL
:
{
match_kill
=
BufferIO
::
ReadInt32
(
pbuf
);
return
true
;
...
...
gframe/event_handler.cpp
View file @
e7b0c400
This diff is collapsed.
Click to expand it.
gframe/event_handler.h
View file @
e7b0c400
...
...
@@ -5,23 +5,4 @@
#include "game.h"
#include "client_card.h"
namespace
ygo
{
class
EventHandler
:
public
irr
::
IEventReceiver
{
public:
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
void
GetHoverField
(
int
x
,
int
y
);
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
irr
::
gui
::
IGUIElement
*
panel
;
int
hovered_controler
;
int
hovered_location
;
int
hovered_sequence
;
ClientCard
*
hovered_card
;
ClientCard
*
clicked_card
;
wchar_t
formatBuffer
[
256
];
};
}
#endif //EVENT_HANDLER_H
gframe/replay_mode.cpp
View file @
e7b0c400
...
...
@@ -765,6 +765,11 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_MATCH_KILL
:
{
pbuf
+=
4
;
break
;
...
...
gframe/single_duel.cpp
View file @
e7b0c400
...
...
@@ -1289,6 +1289,14 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_MATCH_KILL
:
{
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
match_mode
)
{
...
...
gframe/single_mode.cpp
View file @
e7b0c400
...
...
@@ -601,6 +601,11 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_TAG_SWAP
:
{
player
=
pbuf
[
0
];
pbuf
+=
pbuf
[
2
]
*
4
+
pbuf
[
4
]
*
4
+
9
;
...
...
gframe/tag_duel.cpp
View file @
e7b0c400
...
...
@@ -1330,6 +1330,16 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
3
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
break
;
}
case
MSG_TAG_SWAP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int mcount = */
BufferIO
::
ReadInt8
(
pbuf
);
...
...
ocgcore
@
0c58f35e
Subproject commit
42c1de39dc2562d7485a962cef4cf494e36b900d
Subproject commit
0c58f35e90a3baa10af009776235a53e11eae620
script
@
4de8d409
Subproject commit
7362fd18381b3fadd0682ae97388dee3cfc79794
Subproject commit
4de8d4093e5767d90696c8abdd2f1d75215d6adb
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