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
MobiusMei
ygopro
Commits
f0ee4725
Commit
f0ee4725
authored
Oct 25, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/Fluorohydride/ygopro
into server
parents
c02ad0ff
a23e3c96
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
296 additions
and
172 deletions
+296
-172
README.md
README.md
+45
-0
gframe/client_field.cpp
gframe/client_field.cpp
+111
-121
gframe/deck_con.cpp
gframe/deck_con.cpp
+12
-4
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+2
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+14
-12
gframe/event_handler.cpp
gframe/event_handler.cpp
+98
-20
gframe/game.cpp
gframe/game.cpp
+3
-3
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+4
-3
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+5
-5
No files found.
README.md
0 → 100644
View file @
f0ee4725
## ygopro
A script engine for "yu-gi-oh!" and sample gui
[
中文说明
](
https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E
)
###Keys:
*
ESC: Minimize the window.
*
A: Holding down this button will let the system stop at every timing.
*
S: Holding down this button will let the system skip every timing.
*
R: Fix the font error.
*
F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials.
*
F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials.
###Color:
*
Background:
*
White = your card, Grey = your opponent's card
*
Text:
*
Black = default, Blue = the owner of the xyz material is different from its controller
###Sequence:
*
Monster Zone: 1~5, starting from the left hand side.
*
Spell & Trap Zone: 1~5, starting from the left hand side.
*
Field Zone: 6
*
Pendulum Zone: 7~8, starting from the left hand side.
*
The others: 1~n, starting from the bottom.
###Deck edit page:
*
All numeric textboxs: They support >, =,
<
,
>
=, <= signs.
*
Card name: Search card names and texts by default, and $foo will only search foo in card names.
### Command-line options:
*
-j: Join the host in system.conf file.
*
-d: Enter the deck edit page.
*
-r: Enter the replay mode page.
*
-s: Enter the single mode page.
*
-efoo: Load foo as the extra database.
### Directories:
*
pics: .jpg card images(177
*
254).
*
pics
\t
humbnail: .jpg thumbnail images(44
*
64).
*
script: .lua script files.
*
textures: Other image files.
*
deck: .ydk deck files.
*
replay: .yrp replay files.
*
expansions:
*
.cdb will be loaded as extra databases.
gframe/client_field.cpp
View file @
f0ee4725
This diff is collapsed.
Click to expand it.
gframe/deck_con.cpp
View file @
f0ee4725
...
...
@@ -336,6 +336,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
dragx
=
event
.
MouseInput
.
X
;
dragy
=
event
.
MouseInput
.
Y
;
draging_pointer
=
dataManager
.
GetCodePointer
(
hovered_code
);
if
(
draging_pointer
==
dataManager
.
_datas
.
end
())
break
;
unsigned
int
limitcode
=
draging_pointer
->
second
.
alias
?
draging_pointer
->
second
.
alias
:
draging_pointer
->
first
;
if
(
hovered_pos
==
4
)
{
int
limit
=
3
;
...
...
@@ -438,6 +440,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if
(
hovered_pos
==
0
||
hovered_seq
==
-
1
)
break
;
draging_pointer
=
dataManager
.
GetCodePointer
(
hovered_code
);
if
(
draging_pointer
==
dataManager
.
_datas
.
end
())
break
;
if
(
hovered_pos
==
1
)
{
if
(
deckManager
.
current_deck
.
side
.
size
()
<
20
)
{
deckManager
.
current_deck
.
main
.
erase
(
deckManager
.
current_deck
.
main
.
begin
()
+
hovered_seq
);
...
...
@@ -464,8 +468,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
if
(
hovered_pos
==
0
||
hovered_seq
==
-
1
)
break
;
if
(
!
is_draging
)
if
(
!
is_draging
)
{
draging_pointer
=
dataManager
.
GetCodePointer
(
hovered_code
);
if
(
draging_pointer
==
dataManager
.
_datas
.
end
())
break
;
}
if
(
hovered_pos
==
1
)
{
if
(
!
is_draging
)
deckManager
.
current_deck
.
main
.
erase
(
deckManager
.
current_deck
.
main
.
begin
()
+
hovered_seq
);
...
...
@@ -621,12 +628,13 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
!
event
.
KeyInput
.
PressedDown
)
if
(
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
)
)
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
case
irr
:
:
KEY_ESCAPE
:
{
mainGame
->
device
->
minimizeWindow
();
if
(
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
device
->
minimizeWindow
();
break
;
}
default:
break
;
...
...
@@ -642,7 +650,7 @@ void DeckBuilder::FilterCards() {
const
wchar_t
*
pstr
=
mainGame
->
ebCardName
->
getText
();
int
trycode
=
BufferIO
::
GetVal
(
pstr
);
if
(
dataManager
.
GetData
(
trycode
,
0
))
{
auto
ptr
=
dataManager
.
GetCodePointer
(
trycode
);
auto
ptr
=
dataManager
.
GetCodePointer
(
trycode
);
// verified by GetData()
results
.
push_back
(
ptr
);
mainGame
->
scrFilter
->
setVisible
(
false
);
mainGame
->
scrFilter
->
setPos
(
0
);
...
...
gframe/deck_manager.cpp
View file @
f0ee4725
...
...
@@ -128,7 +128,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
else
if
(
cd
.
type
&
0x802040
&&
deck
.
extra
.
size
()
<
15
)
{
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
else
if
(
deck
.
main
.
size
()
<
60
)
{
deck
.
main
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
}
...
...
@@ -140,7 +140,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
if
(
deck
.
side
.
size
()
<
15
)
deck
.
side
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
deck
.
side
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
}
bool
DeckManager
::
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
)
{
...
...
gframe/duelclient.cpp
View file @
f0ee4725
...
...
@@ -916,7 +916,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
cmdFlag
|=
COMMAND_ACTIVATE
;
if
(
pcard
->
location
==
LOCATION_GRAVE
)
mainGame
->
dField
.
grave_act
=
true
;
if
(
pcard
->
location
==
LOCATION_REMOVED
)
else
if
(
pcard
->
location
==
LOCATION_REMOVED
)
mainGame
->
dField
.
remove_act
=
true
;
}
mainGame
->
dField
.
attackable_cards
.
clear
();
...
...
@@ -974,13 +974,13 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
SetCode
(
code
);
mainGame
->
dField
.
deck_act
=
true
;
}
if
(
pcard
->
location
==
LOCATION_GRAVE
)
else
if
(
pcard
->
location
==
LOCATION_GRAVE
)
mainGame
->
dField
.
grave_act
=
true
;
if
(
pcard
->
location
==
LOCATION_REMOVED
)
else
if
(
pcard
->
location
==
LOCATION_REMOVED
)
mainGame
->
dField
.
remove_act
=
true
;
if
(
pcard
->
location
==
LOCATION_EXTRA
)
else
if
(
pcard
->
location
==
LOCATION_EXTRA
)
mainGame
->
dField
.
extra_act
=
true
;
if
(
pcard
->
location
==
LOCATION_SZONE
&&
pcard
->
sequence
==
6
)
else
if
(
pcard
->
location
==
LOCATION_SZONE
&&
pcard
->
sequence
==
6
)
mainGame
->
dField
.
pzone_act
[
pcard
->
controler
]
=
true
;
}
mainGame
->
dField
.
reposable_cards
.
clear
();
...
...
@@ -1031,7 +1031,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
cmdFlag
|=
COMMAND_ACTIVATE
;
if
(
pcard
->
location
==
LOCATION_GRAVE
)
mainGame
->
dField
.
grave_act
=
true
;
if
(
pcard
->
location
==
LOCATION_REMOVED
)
else
if
(
pcard
->
location
==
LOCATION_REMOVED
)
mainGame
->
dField
.
remove_act
=
true
;
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
...
...
@@ -1062,8 +1062,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
BufferIO
::
ReadInt8
(
pbuf
);
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
highlighting_card
=
pcard
;
if
(
l
!=
LOCATION_DECK
)
{
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
highlighting_card
=
pcard
;
}
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
200
),
dataManager
.
FormatLocation
(
l
,
s
),
dataManager
.
GetName
(
code
));
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
textBuffer
);
...
...
@@ -1190,11 +1192,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
cmdFlag
|=
COMMAND_ACTIVATE
;
if
(
l
==
LOCATION_GRAVE
)
mainGame
->
dField
.
grave_act
=
true
;
if
(
l
==
LOCATION_REMOVED
)
else
if
(
l
==
LOCATION_REMOVED
)
mainGame
->
dField
.
remove_act
=
true
;
if
(
l
==
LOCATION_EXTRA
)
else
if
(
l
==
LOCATION_EXTRA
)
mainGame
->
dField
.
extra_act
=
true
;
if
(
l
==
LOCATION_OVERLAY
)
else
if
(
l
==
LOCATION_OVERLAY
)
panelmode
=
true
;
}
}
...
...
@@ -2373,7 +2375,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
else
mainGame
->
WaitFrameSignal
(
30
);
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1610
),
dataManager
.
GetName
(
pcard
->
code
),
dataManager
.
FormatLocation
(
l
,
s
),
s
);
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1610
),
dataManager
.
GetName
(
pcard
->
code
),
dataManager
.
FormatLocation
(
l
,
s
),
s
+
1
);
mainGame
->
lstLog
->
addItem
(
textBuffer
);
mainGame
->
logParam
.
push_back
(
pcard
->
code
);
pcard
->
is_highlighting
=
false
;
...
...
gframe/event_handler.cpp
View file @
f0ee4725
This diff is collapsed.
Click to expand it.
gframe/game.cpp
View file @
f0ee4725
...
...
@@ -17,7 +17,7 @@
#include <unistd.h>
#endif
const
unsigned
short
PRO_VERSION
=
0x133
6
;
const
unsigned
short
PRO_VERSION
=
0x133
7
;
namespace
ygo
{
...
...
@@ -381,7 +381,7 @@ bool Game::Initialize() {
wCardSelect
->
getCloseButton
()
->
setVisible
(
false
);
wCardSelect
->
setVisible
(
false
);
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
stCardPos
[
i
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
40
+
125
*
i
,
30
,
139
+
125
*
i
,
50
),
true
,
false
,
wCardSelect
,
-
1
,
true
);
stCardPos
[
i
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
30
+
125
*
i
,
30
,
150
+
125
*
i
,
50
),
true
,
false
,
wCardSelect
,
-
1
,
true
);
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
stCardPos
[
i
]
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
btnCardSelect
[
i
]
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
30
+
125
*
i
,
55
,
150
+
125
*
i
,
225
),
wCardSelect
,
BUTTON_CARD_0
+
i
);
...
...
@@ -394,7 +394,7 @@ bool Game::Initialize() {
wCardDisplay
->
getCloseButton
()
->
setVisible
(
false
);
wCardDisplay
->
setVisible
(
false
);
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
stDisplayPos
[
i
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
40
+
125
*
i
,
30
,
139
+
125
*
i
,
50
),
true
,
false
,
wCardDisplay
,
-
1
,
true
);
stDisplayPos
[
i
]
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
30
+
125
*
i
,
30
,
150
+
125
*
i
,
50
),
true
,
false
,
wCardDisplay
,
-
1
,
true
);
stDisplayPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
stDisplayPos
[
i
]
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
btnCardDisplay
[
i
]
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
30
+
125
*
i
,
55
,
150
+
125
*
i
,
225
),
wCardDisplay
,
BUTTON_DISPLAY_0
+
i
);
...
...
gframe/menu_handler.cpp
View file @
f0ee4725
...
...
@@ -307,7 +307,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
}
BufferIO
::
CopyWStr
(
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
()),
mainGame
->
gameConf
.
lastdeck
,
20
);
mainGame
->
gameConf
.
lastdeck
,
64
);
char
deckbuf
[
1024
];
char
*
pdeck
=
deckbuf
;
BufferIO
::
WriteInt32
(
pdeck
,
deckManager
.
current_deck
.
main
.
size
()
+
deckManager
.
current_deck
.
extra
.
size
());
...
...
@@ -364,12 +364,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
!
event
.
KeyInput
.
PressedDown
)
if
(
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
)
)
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
case
irr
:
:
KEY_ESCAPE
:
{
mainGame
->
device
->
minimizeWindow
();
if
(
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
device
->
minimizeWindow
();
break
;
}
default:
break
;
...
...
ocgcore
@
1a179ceb
Subproject commit
909d844e4a36fda3699e79fc030c9216c0ba6d2b
Subproject commit
1a179cebde187c00b28e47394e4104ba6f0d103a
script
@
57598a08
Subproject commit
8223ac0d56574d27c10bd6a128f0bef0417cdf32
Subproject commit
57598a0854fbea5cc0ad9aa631a3255df7e1e513
strings.conf
View file @
f0ee4725
...
...
@@ -75,13 +75,13 @@
!
system
510
请选择要盖放的卡
!
system
511
请选择融合召唤的素材
!
system
512
请选择同调召唤的素材
!
system
513
请选择超
量
召唤的素材
!
system
513
请选择超
维
召唤的素材
!
system
514
请选择表侧表示的卡
!
system
515
请选择里侧表示的卡
!
system
516
请选择攻击表示的怪兽
!
system
517
请选择守备表示的怪兽
!
system
518
请选择要装备的卡
!
system
519
请选择要取除的超
量
素材
!
system
519
请选择要取除的超
维
素材
!
system
520
请选择要改变控制权的怪兽
!
system
521
请选择要代替破坏的卡
!
system
522
请选择表侧攻击表示的怪兽
...
...
@@ -94,7 +94,7 @@
!
system
529
请选择自己的卡
!
system
530
请选择对方的卡
!
system
531
请选择上级召唤用需要解放的怪兽:
!
system
532
请选择要取除超
量
素材的怪兽
!
system
532
请选择要取除超
维
素材的怪兽
!
system
550
请选择要发动的效果
!
system
551
请选择效果的对象
!
system
552
请选择硬币的正反面
...
...
@@ -173,7 +173,7 @@
!
system
1070
反击
!
system
1071
反转
!
system
1072
卡通
!
system
1073
超
量
!
system
1073
超
维
!
system
1074
灵摆
!
system
1080
(
N
/
A
)
#GUI
...
...
@@ -207,7 +207,7 @@
!
system
1127
幸运
!
system
1128
融合相关
!
system
1129
同调相关
!
system
1130
超
量
相关
!
system
1130
超
维
相关
!
system
1131
效果无效
#actions
!
system
1150
发动
...
...
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