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
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
Commits
117aa906
Commit
117aa906
authored
May 01, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server
parents
da47f8a6
03bd9b95
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
28 deletions
+41
-28
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/data_manager.cpp
gframe/data_manager.cpp
+3
-1
gframe/data_manager.h
gframe/data_manager.h
+0
-1
gframe/deck_con.cpp
gframe/deck_con.cpp
+1
-3
gframe/event_handler.cpp
gframe/event_handler.cpp
+8
-7
gframe/game.cpp
gframe/game.cpp
+20
-14
gframe/game.h
gframe/game.h
+1
-1
lflist.conf
lflist.conf
+0
-1
strings.conf
strings.conf
+7
-0
No files found.
gframe/client_field.h
View file @
117aa906
...
...
@@ -42,6 +42,7 @@ public:
std
::
vector
<
ClientCard
*>
conti_cards
;
std
::
vector
<
std
::
pair
<
int
,
int
>>
activatable_descs
;
std
::
vector
<
int
>
select_options
;
std
::
vector
<
int
>
select_options_index
;
std
::
vector
<
ChainInfo
>
chains
;
int
extra_p_count
[
2
];
...
...
gframe/data_manager.cpp
View file @
117aa906
...
...
@@ -5,7 +5,6 @@
namespace
ygo
{
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
wchar_t
DataManager
::
strBuffer
[
4096
];
byte
DataManager
::
scriptBuffer
[
0x20000
];
#ifndef YGOPRO_SERVER_MODE
IFileSystem
*
DataManager
::
FileSystem
;
...
...
@@ -14,6 +13,7 @@ DataManager dataManager;
bool
DataManager
::
LoadDB
(
const
wchar_t
*
wfile
)
{
char
file
[
256
];
wchar_t
strBuffer
[
4096
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
#ifdef YGOPRO_SERVER_MODE
sqlite3
*
pDB
;
...
...
@@ -146,6 +146,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
return
;
char
strbuf
[
256
];
int
value
;
wchar_t
strBuffer
[
4096
];
sscanf
(
linebuf
,
"!%s"
,
strbuf
);
if
(
!
strcmp
(
strbuf
,
"system"
))
{
sscanf
(
&
linebuf
[
7
],
"%d %240[^
\n
]"
,
&
value
,
strbuf
);
...
...
@@ -175,6 +176,7 @@ bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) {
}
#else
bool
DataManager
::
Error
(
spmemvfs_db_t
*
pDB
,
sqlite3_stmt
*
pStmt
)
{
wchar_t
strBuffer
[
4096
];
BufferIO
::
DecodeUTF8
(
sqlite3_errmsg
(
pDB
->
handle
),
strBuffer
);
if
(
pStmt
)
sqlite3_finalize
(
pStmt
);
...
...
gframe/data_manager.h
View file @
117aa906
...
...
@@ -58,7 +58,6 @@ public:
wchar_t
scBuffer
[
128
];
wchar_t
lmBuffer
[
32
];
static
wchar_t
strBuffer
[
4096
];
static
byte
scriptBuffer
[
0x20000
];
static
const
wchar_t
*
unknown_string
;
static
int
CardReader
(
int
,
void
*
);
...
...
gframe/deck_con.cpp
View file @
117aa906
...
...
@@ -88,9 +88,7 @@ void DeckBuilder::Initialize() {
is_starting_dragging
=
false
;
prev_deck
=
mainGame
->
cbDBDecks
->
getSelected
();
prev_category
=
mainGame
->
cbDBCategory
->
getSelected
();
readonly
=
prev_category
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
!
readonly
);
RefreshReadonly
(
prev_category
);
prev_operation
=
0
;
prev_sel
=
-
1
;
is_modified
=
false
;
...
...
gframe/event_handler.cpp
View file @
117aa906
...
...
@@ -364,22 +364,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
wCmdMenu
->
setVisible
(
false
);
ShowCancelOrFinishButton
(
0
);
if
(
!
list_command
)
{
int
index
=
-
1
;
select_options
.
clear
();
select_options_index
.
clear
();
for
(
size_t
i
=
0
;
i
<
activatable_cards
.
size
();
++
i
)
{
if
(
activatable_cards
[
i
]
==
clicked_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
continue
;
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
else
if
(
activatable_descs
[
i
].
second
==
EDESC_RESET
)
{
if
(
id
==
BUTTON_CMD_ACTIVATE
)
continue
;
}
else
{
if
(
id
==
BUTTON_CMD_RESET
)
continue
;
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
@@ -648,9 +649,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
if
(
list_command
==
COMMAND_ACTIVATE
||
list_command
==
COMMAND_OPERATION
)
{
int
index
=
-
1
;
command_card
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
mainGame
->
scrCardList
->
getPos
()
/
10
];
select_options
.
clear
();
select_options_index
.
clear
();
for
(
size_t
i
=
0
;
i
<
activatable_cards
.
size
();
++
i
)
{
if
(
activatable_cards
[
i
]
==
command_card
)
{
if
(
activatable_descs
[
i
].
second
==
EDESC_OPERATION
)
{
...
...
@@ -659,10 +660,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
list_command
==
COMMAND_OPERATION
)
continue
;
}
select_options
.
push_back
(
activatable_descs
[
i
].
first
);
if
(
index
==
-
1
)
index
=
i
;
select_options_index
.
push_back
(
i
)
;
}
}
if
(
select_options
.
size
()
==
1
)
{
int
index
=
select_options_index
[
0
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
@@ -2412,8 +2414,7 @@ void ClientField::SetResponseSelectedOption() const {
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
DuelClient
::
SetResponseI
(
selected_option
);
}
else
{
int
index
=
0
;
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
int
index
=
select_options_index
[
selected_option
];
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
...
...
gframe/game.cpp
View file @
117aa906
...
...
@@ -281,8 +281,8 @@ bool Game::Initialize() {
chkHostPrepReady
[
i
]
->
setEnabled
(
false
);
}
btnHostPrepOB
=
env
->
addButton
(
rect
<
s32
>
(
10
,
180
,
110
,
205
),
wHostPrepare
,
BUTTON_HP_OBSERVER
,
dataManager
.
GetSysString
(
1252
));
myswprintf
(
dataManager
.
strBuffer
,
L"%ls%d"
,
dataManager
.
GetSysString
(
1253
),
0
);
stHostPrepOB
=
env
->
addStaticText
(
dataManager
.
strBuffer
,
rect
<
s32
>
(
10
,
285
,
270
,
305
),
false
,
false
,
wHostPrepare
);
myswprintf
(
strbuf
,
L"%ls%d"
,
dataManager
.
GetSysString
(
1253
),
0
);
stHostPrepOB
=
env
->
addStaticText
(
strbuf
,
rect
<
s32
>
(
10
,
285
,
270
,
305
),
false
,
false
,
wHostPrepare
);
stHostPrepRule
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
280
,
30
,
460
,
230
),
false
,
true
,
wHostPrepare
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1254
),
rect
<
s32
>
(
10
,
210
,
110
,
230
),
false
,
false
,
wHostPrepare
);
cbCategorySelect
=
env
->
addComboBox
(
rect
<
s32
>
(
10
,
230
,
138
,
255
),
wHostPrepare
,
COMBOBOX_HP_CATEGORY
);
...
...
@@ -736,7 +736,7 @@ bool Game::Initialize() {
btnStartFilter
->
setRelativePosition
(
rect
<
s32
>
(
260
,
80
+
125
/
6
,
390
,
100
+
125
/
6
));
btnClearFilter
=
env
->
addButton
(
rect
<
s32
>
(
205
,
80
+
125
/
6
,
255
,
100
+
125
/
6
),
wFilter
,
BUTTON_CLEAR_FILTER
,
dataManager
.
GetSysString
(
1304
));
}
wCategories
=
env
->
addWindow
(
rect
<
s32
>
(
600
,
60
,
1000
,
305
),
false
,
dataManager
.
strBuffer
);
wCategories
=
env
->
addWindow
(
rect
<
s32
>
(
600
,
60
,
1000
,
305
),
false
,
L""
);
wCategories
->
getCloseButton
()
->
setVisible
(
false
);
wCategories
->
setDrawTitlebar
(
false
);
wCategories
->
setDraggable
(
false
);
...
...
@@ -754,7 +754,7 @@ bool Game::Initialize() {
wCategories
->
setRelativePosition
(
rect
<
s32
>
(
1000
-
wcatewidth
,
60
,
1000
,
305
));
btnCategoryOK
->
setRelativePosition
(
recti
(
wcatewidth
/
2
-
50
,
210
,
wcatewidth
/
2
+
50
,
235
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
190
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
wLinkMarks
=
env
->
addWindow
(
rect
<
s32
>
(
700
,
30
,
820
,
150
),
false
,
dataManager
.
strBuffer
);
wLinkMarks
=
env
->
addWindow
(
rect
<
s32
>
(
700
,
30
,
820
,
150
),
false
,
L""
);
wLinkMarks
->
getCloseButton
()
->
setVisible
(
false
);
wLinkMarks
->
setDrawTitlebar
(
false
);
wLinkMarks
->
setDraggable
(
false
);
...
...
@@ -1040,25 +1040,29 @@ void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32
mProjection
[
14
]
=
znear
*
zfar
/
(
znear
-
zfar
);
}
void
Game
::
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
)
{
SetStaticText
(
pControl
,
cWidth
,
font
,
text
);
if
(
font
->
getDimension
(
dataManager
.
strBuffer
).
Height
<=
cHeight
)
{
std
::
wstring
format_text
;
format_text
=
SetStaticText
(
pControl
,
cWidth
,
font
,
text
);
if
(
font
->
getDimension
(
format_text
.
c_str
()).
Height
<=
cHeight
)
{
scrCardText
->
setVisible
(
false
);
if
(
env
->
hasFocus
(
scrCardText
))
env
->
removeFocus
(
scrCardText
);
return
;
}
SetStaticText
(
pControl
,
cWidth
-
25
,
font
,
text
);
format_text
=
SetStaticText
(
pControl
,
cWidth
-
25
,
font
,
text
);
u32
fontheight
=
font
->
getDimension
(
L"A"
).
Height
+
font
->
getKerningHeight
();
u32
step
=
(
font
->
getDimension
(
dataManager
.
strBuffer
).
Height
-
cHeight
)
/
fontheight
+
1
;
u32
step
=
(
font
->
getDimension
(
format_text
.
c_str
()
).
Height
-
cHeight
)
/
fontheight
+
1
;
scrCardText
->
setVisible
(
true
);
scrCardText
->
setMin
(
0
);
scrCardText
->
setMax
(
step
);
scrCardText
->
setPos
(
0
);
}
void
Game
::
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
)
{
std
::
wstring
Game
::
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
)
{
int
pbuffer
=
0
;
u32
_width
=
0
,
_height
=
0
;
wchar_t
prev
=
0
;
wchar_t
strBuffer
[
4096
];
std
::
wstring
ret
;
for
(
size_t
i
=
0
;
text
[
i
]
!=
0
&&
i
<
wcslen
(
text
);
++
i
)
{
wchar_t
c
=
text
[
i
];
u32
w
=
font
->
getCharDimension
(
c
).
Width
+
font
->
getKerningWidth
(
c
,
prev
);
...
...
@@ -1066,7 +1070,7 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
if
(
text
[
i
]
==
L'\r'
)
{
continue
;
}
else
if
(
text
[
i
]
==
L'\n'
)
{
dataManager
.
strBuffer
[
pbuffer
++
]
=
L'\n'
;
strBuffer
[
pbuffer
++
]
=
L'\n'
;
_width
=
0
;
_height
++
;
prev
=
0
;
...
...
@@ -1074,7 +1078,7 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pbuffer
=
0
;
continue
;
}
else
if
(
_width
>
0
&&
_width
+
w
>
cWidth
)
{
dataManager
.
strBuffer
[
pbuffer
++
]
=
L'\n'
;
strBuffer
[
pbuffer
++
]
=
L'\n'
;
_width
=
0
;
_height
++
;
prev
=
0
;
...
...
@@ -1082,10 +1086,12 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pbuffer
=
0
;
}
_width
+=
w
;
dataManager
.
strBuffer
[
pbuffer
++
]
=
c
;
strBuffer
[
pbuffer
++
]
=
c
;
}
dataManager
.
strBuffer
[
pbuffer
]
=
0
;
pControl
->
setText
(
dataManager
.
strBuffer
);
strBuffer
[
pbuffer
]
=
0
;
pControl
->
setText
(
strBuffer
);
ret
.
assign
(
strBuffer
);
return
ret
;
}
#endif //YGOPRO_SERVER_MODE
void
Game
::
LoadExpansions
()
{
...
...
gframe/game.h
View file @
117aa906
...
...
@@ -132,7 +132,7 @@ public:
void
MainLoop
();
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
std
::
wstring
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
void
LoadExpansions
();
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
...
...
lflist.conf
View file @
117aa906
...
...
@@ -188,7 +188,6 @@
!
2021
.
1
#forbidden
62472614
0
--疫病(
tmp
)
91869203
0
--アマゾネスの射手
20663556
0
--イレカエル
44910027
0
--ヴィクトリー・ドラゴン
...
...
strings.conf
View file @
117aa906
...
...
@@ -627,6 +627,8 @@
!
counter
0
x59
落魂指示物
!
counter
0
x5a
指示物(岩战之试炼)
!
counter
0
x5b
指示物(北极天熊北斗星)
!
counter
0
x105c
燃烧指示物
!
counter
0
x5d
指示物(机巧传-神使记纪图)
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -1090,3 +1092,8 @@
!
setname
0
x161
溟界
!
setname
0
x162
七音服 ドレミコード
!
setname
0
x163
北极天熊 ベアルクティ
!
setname
0
x164
死狱乡 デスピア
!
setname
0
x165
魔键 魔鍵
!
setname
0
x166
军贯 軍貫
!
setname
0
x1167
森之圣兽 森の聖獣
!
setname
0
x2167
森之圣灵 森の聖霊
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