Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro for rd
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 for rd
Commits
061895d0
Commit
061895d0
authored
Oct 02, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/Fluorohydride/ygopro
parents
e93dd69c
1c456c5c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
48 additions
and
39 deletions
+48
-39
README.md
README.md
+1
-1
gframe/client_card.cpp
gframe/client_card.cpp
+0
-1
gframe/client_card.h
gframe/client_card.h
+0
-1
gframe/client_field.cpp
gframe/client_field.cpp
+10
-5
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/drawing.cpp
gframe/drawing.cpp
+1
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-4
gframe/event_handler.cpp
gframe/event_handler.cpp
+12
-6
gframe/game.cpp
gframe/game.cpp
+11
-11
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+2
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+2
-2
gframe/single_mode.cpp
gframe/single_mode.cpp
+2
-2
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+2
-2
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
README.md
View file @
061895d0
...
...
@@ -16,7 +16,7 @@ A script engine for "yu-gi-oh!" and sample gui
*
White = your card, Grey = your opponent's card
####Text:
Cards in
extra deck or removed
:
Cards in
deck, extra deck and banished zone
:
*
Black = face-up, Blue = face-down
Xyz materials:
...
...
gframe/client_card.cpp
View file @
061895d0
...
...
@@ -19,7 +19,6 @@ ClientCard::ClientCard() {
is_highlighting
=
false
;
is_disabled
=
false
;
is_reversed
=
false
;
is_conti
=
false
;
cmdFlag
=
0
;
code
=
0
;
chain_code
=
0
;
...
...
gframe/client_card.h
View file @
061895d0
...
...
@@ -63,7 +63,6 @@ public:
bool
is_showtarget
;
bool
is_highlighting
;
bool
is_reversed
;
bool
is_conti
;
u32
code
;
u32
chain_code
;
u32
alias
;
...
...
gframe/client_field.cpp
View file @
061895d0
...
...
@@ -23,6 +23,7 @@ ClientField::ClientField() {
pzone_act
[
1
]
=
false
;
conti_act
=
false
;
deck_reversed
=
false
;
conti_selecting
=
false
;
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
mzone
[
p
].
push_back
(
0
);
...
...
@@ -354,7 +355,6 @@ void ClientField::ClearChainSelect() {
(
*
cit
)
->
chain_code
=
0
;
(
*
cit
)
->
is_selectable
=
false
;
(
*
cit
)
->
is_selected
=
false
;
(
*
cit
)
->
is_conti
=
false
;
}
conti_cards
.
clear
();
grave_act
=
false
;
...
...
@@ -375,9 +375,10 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
}
for
(
size_t
i
=
0
;
i
<
ct
;
++
i
)
{
mainGame
->
stCardPos
[
i
]
->
enableOverrideColor
(
false
);
// image
if
(
selectable_cards
[
i
]
->
code
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
code
));
else
if
(
c
hain
)
else
if
(
c
onti_selecting
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
...
...
@@ -385,8 +386,9 @@ 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
)
{
// text
wchar_t
formatBuffer
[
2048
];
if
(
c
hain
&&
selectable_cards
[
i
]
->
is_conti
&&
!
selectable_cards
[
i
]
->
code
)
if
(
c
onti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
...
...
@@ -396,13 +398,16 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
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
);
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
// color
if
(
conti_selecting
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
selectable_cards
[
i
]
->
owner
!=
selectable_cards
[
i
]
->
overlayTarget
->
controler
)
mainGame
->
stCardPos
[
i
]
->
setOverrideColor
(
0xff0000ff
);
if
(
selectable_cards
[
i
]
->
overlayTarget
->
controler
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffd0d0d0
);
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_EXTRA
||
selectable_cards
[
i
]
->
location
==
LOCATION_REMOVED
)
{
}
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_
DECK
||
selectable_cards
[
i
]
->
location
==
LOCATION_
EXTRA
||
selectable_cards
[
i
]
->
location
==
LOCATION_REMOVED
)
{
if
(
selectable_cards
[
i
]
->
position
&
POS_FACEDOWN
)
mainGame
->
stCardPos
[
i
]
->
setOverrideColor
(
0xff0000ff
);
if
(
selectable_cards
[
i
]
->
controler
)
...
...
gframe/client_field.h
View file @
061895d0
...
...
@@ -77,6 +77,7 @@ public:
ChainInfo
current_chain
;
bool
last_chain
;
bool
deck_reversed
;
bool
conti_selecting
;
ClientField
();
void
Clear
();
...
...
gframe/drawing.cpp
View file @
061895d0
...
...
@@ -844,6 +844,7 @@ void Game::HideElement(irr::gui::IGUIElement * win, bool set_action) {
if
(
win
==
wCardSelect
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
btnCardSelect
[
i
]
->
setDrawImage
(
false
);
dField
.
conti_selecting
=
false
;
}
if
(
win
==
wCardDisplay
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
...
...
gframe/duelclient.cpp
View file @
061895d0
...
...
@@ -1217,13 +1217,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
flag
));
pcard
->
is_selected
=
false
;
if
(
flag
==
EDESC_OPERATION
)
{
pcard
->
is_conti
=
true
;
pcard
->
chain_code
=
code
;
mainGame
->
dField
.
conti_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
conti_act
=
true
;
conti_exist
=
true
;
}
else
{
pcard
->
chain_code
=
code
;
pcard
->
is_selectable
=
true
;
if
(
flag
==
EDESC_RESET
)
pcard
->
cmdFlag
|=
COMMAND_RESET
;
...
...
@@ -1426,7 +1424,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_SELECT_COUNTER
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_counter_type
=
BufferIO
::
ReadInt16
(
pbuf
);
mainGame
->
dField
.
select_counter_count
=
BufferIO
::
ReadInt
8
(
pbuf
);
mainGame
->
dField
.
select_counter_count
=
BufferIO
::
ReadInt
16
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
int
c
,
l
,
s
,
t
/*, code*/
;
...
...
@@ -1436,7 +1434,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
t
=
BufferIO
::
ReadInt
8
(
pbuf
);
t
=
BufferIO
::
ReadInt
16
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
mainGame
->
dField
.
selectable_cards
.
push_back
(
pcard
);
pcard
->
opParam
=
(
t
<<
16
)
|
t
;
...
...
gframe/event_handler.cpp
View file @
061895d0
...
...
@@ -460,7 +460,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
else
{
selectable_cards
.
clear
();
bool
conti_exist
=
false
;
conti_selecting
=
false
;
switch
(
command_location
)
{
case
LOCATION_DECK
:
{
for
(
size_t
i
=
0
;
i
<
deck
[
command_controler
].
size
();
++
i
)
...
...
@@ -488,11 +488,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
POSITION_HINT
:
{
selectable_cards
.
insert
(
selectable_cards
.
end
(),
conti_cards
.
begin
(),
conti_cards
.
end
());
conti_
exist
=
true
;
conti_
selecting
=
true
;
break
;
}
}
if
(
!
conti_
exist
)
{
if
(
!
conti_
selecting
)
{
mainGame
->
wCardSelect
->
setText
(
dataManager
.
GetSysString
(
566
));
list_command
=
COMMAND_ACTIVATE
;
}
else
{
...
...
@@ -910,11 +910,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
// draw selectable_cards[i + pos] in btnCardSelect[i]
mainGame
->
stCardPos
[
i
]
->
enableOverrideColor
(
false
);
// image
if
(
selectable_cards
[
i
+
pos
]
->
code
)
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
code
));
else
if
(
conti_selecting
)
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
// text
wchar_t
formatBuffer
[
2048
];
if
(
sort_list
.
size
())
{
if
(
sort_list
[
pos
+
i
]
>
0
)
...
...
@@ -922,7 +926,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else
myswprintf
(
formatBuffer
,
L""
);
}
else
{
if
(
selectable_cards
[
i
+
pos
]
->
is_conti
&&
!
selectable_cards
[
i
+
pos
]
->
code
)
if
(
conti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
...
...
@@ -933,17 +937,19 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
selectable_cards
[
i
+
pos
]
->
sequence
+
1
);
}
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
// color
if
(
conti_selecting
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
selectable_cards
[
i
+
pos
]
->
owner
!=
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
controler
)
mainGame
->
stCardPos
[
i
]
->
setOverrideColor
(
0xff0000ff
);
// BackgroundColor: controller of the xyz monster
if
(
selectable_cards
[
i
+
pos
]
->
is_selected
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffff00
);
else
if
(
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
controler
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffd0d0d0
);
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_EXTRA
||
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_REMOVED
)
{
}
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_
DECK
||
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_
EXTRA
||
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_REMOVED
)
{
if
(
selectable_cards
[
i
+
pos
]
->
position
&
POS_FACEDOWN
)
mainGame
->
stCardPos
[
i
]
->
setOverrideColor
(
0xff0000ff
);
if
(
selectable_cards
[
i
+
pos
]
->
is_selected
)
...
...
gframe/game.cpp
View file @
061895d0
...
...
@@ -70,17 +70,17 @@ bool Game::Initialize() {
device
->
setResizable
(
false
);
#ifdef _WIN32
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetModuleHandle
(
NULL
);
HICON
hSmallIcon
=
(
HICON
)
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
1
),
IMAGE_ICON
,
16
,
16
,
LR_DEFAULTCOLOR
);
HICON
hBigIcon
=
(
HICON
)
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
1
),
IMAGE_ICON
,
32
,
32
,
LR_DEFAULTCOLOR
);
HWND
hWnd
;
irr
::
video
::
SExposedVideoData
exposedData
=
driver
->
getExposedVideoData
();
if
(
gameConf
.
use_d3d
)
hWnd
=
reinterpret_cast
<
HWND
>
(
exposedData
.
D3D9
.
HWnd
);
else
hWnd
=
reinterpret_cast
<
HWND
>
(
exposedData
.
OpenGLWin32
.
HWnd
);
SendMessage
(
hWnd
,
WM_SETICON
,
ICON_SMALL
,
(
long
)
hSmallIcon
);
SendMessage
(
hWnd
,
WM_SETICON
,
ICON_BIG
,
(
long
)
hBigIcon
);
#endif
HICON
hSmallIcon
=
(
HICON
)
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
1
),
IMAGE_ICON
,
16
,
16
,
LR_DEFAULTCOLOR
);
HICON
hBigIcon
=
(
HICON
)
LoadImage
(
hInstance
,
MAKEINTRESOURCE
(
1
),
IMAGE_ICON
,
32
,
32
,
LR_DEFAULTCOLOR
);
HWND
hWnd
;
irr
::
video
::
SExposedVideoData
exposedData
=
driver
->
getExposedVideoData
();
if
(
gameConf
.
use_d3d
)
hWnd
=
reinterpret_cast
<
HWND
>
(
exposedData
.
D3D9
.
HWnd
);
else
hWnd
=
reinterpret_cast
<
HWND
>
(
exposedData
.
OpenGLWin32
.
HWnd
);
SendMessage
(
hWnd
,
WM_SETICON
,
ICON_SMALL
,
(
long
)
hSmallIcon
);
SendMessage
(
hWnd
,
WM_SETICON
,
ICON_BIG
,
(
long
)
hBigIcon
);
#endif
//main menu
wchar_t
strbuf
[
256
];
myswprintf
(
strbuf
,
L"YGOPro Version:%X.0%X.%X"
,
PRO_VERSION
>>
12
,
(
PRO_VERSION
>>
4
)
&
0xff
,
PRO_VERSION
&
0xf
);
...
...
gframe/replay_mode.cpp
View file @
061895d0
...
...
@@ -412,9 +412,9 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
3
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
9
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_SUM
:
{
...
...
gframe/single_duel.cpp
View file @
061895d0
...
...
@@ -717,9 +717,9 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
3
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
9
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
gframe/single_mode.cpp
View file @
061895d0
...
...
@@ -243,9 +243,9 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
3
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
9
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
...
...
gframe/tag_duel.cpp
View file @
061895d0
...
...
@@ -650,9 +650,9 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
3
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
9
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
ocgcore
@
706f7627
Subproject commit
9cce5ab37da7068372061c1b7a885f961b3860d7
Subproject commit
706f7627e76a5790322099d760d364c56b62bf0e
script
@
6747080c
Subproject commit
8628676ec9e8a89b91178796417690f3df4f89a
3
Subproject commit
6747080c00ee6c9d1474a23a0559f939dbe4798
3
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