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
ac1b6f8d
Commit
ac1b6f8d
authored
Jan 28, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server
parents
947cf9b0
2f3ef6a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
13 deletions
+79
-13
gframe/client_field.cpp
gframe/client_field.cpp
+4
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+3
-2
gframe/game.cpp
gframe/game.cpp
+63
-8
strings.conf
strings.conf
+9
-1
No files found.
gframe/client_field.cpp
View file @
ac1b6f8d
...
...
@@ -445,7 +445,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame
->
stCardPos
[
i
]
->
setOverrideColor
(
0xff0000ff
);
if
(
selectable_cards
[
i
]
->
overlayTarget
->
controler
)
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffd0d0d0
);
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
else
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
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
);
...
...
@@ -465,7 +466,8 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
wchar_t
formatBuffer
[
2048
];
myswprintf
(
formatBuffer
,
L"%d"
,
sort_list
[
i
]);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
}
else
mainGame
->
stCardPos
[
i
]
->
setText
(
L""
);
}
else
mainGame
->
stCardPos
[
i
]
->
setText
(
L""
);
mainGame
->
stCardPos
[
i
]
->
setBackgroundColor
(
0xffffffff
);
}
mainGame
->
stCardPos
[
i
]
->
setVisible
(
true
);
...
...
gframe/event_handler.cpp
View file @
ac1b6f8d
...
...
@@ -881,8 +881,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
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
)
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SORT_CARD
)
{
if
(
sort_list
[
pos
+
i
])
myswprintf
(
formatBuffer
,
L"%d"
,
sort_list
[
pos
+
i
]);
else
myswprintf
(
formatBuffer
,
L""
);
...
...
@@ -2541,6 +2541,7 @@ void ClientField::CancelOrFinish() {
if
(
mainGame
->
wCardSelect
->
isVisible
())
{
DuelClient
::
SetResponseI
(
-
1
);
mainGame
->
HideElement
(
mainGame
->
wCardSelect
,
true
);
sort_list
.
clear
();
}
break
;
}
...
...
gframe/game.cpp
View file @
ac1b6f8d
...
...
@@ -98,14 +98,70 @@ bool Game::Initialize() {
dataManager
.
LoadStrings
(
"./expansions/strings.conf"
);
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
48
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
if
(
!
numFont
)
{
const
wchar_t
*
numFontPaths
[]
=
{
L"C:/Windows/Fonts/arialbd.ttf"
,
L"/usr/share/fonts/truetype/DroidSansFallbackFull.ttf"
,
L"/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc"
,
L"/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc"
,
L"/System/Library/Fonts/SFNSTextCondensed-Bold.otf"
,
L"/System/Library/Fonts/SFNS.ttf"
,
L"./fonts/numFont.ttf"
,
L"./fonts/numFont.ttc"
,
L"./fonts/numFont.otf"
};
for
(
const
wchar_t
*
path
:
numFontPaths
)
{
myswprintf
(
gameConf
.
numfont
,
path
);
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
if
(
numFont
)
break
;
}
}
textFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
if
(
!
textFont
)
{
const
wchar_t
*
textFontPaths
[]
=
{
L"C:/Windows/Fonts/msyh.ttc"
,
L"C:/Windows/Fonts/msyh.ttf"
,
L"C:/Windows/Fonts/simsun.ttc"
,
L"/usr/share/fonts/truetype/DroidSansFallbackFull.ttf"
,
L"/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc"
,
L"/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"
,
L"/System/Library/Fonts/PingFang.ttc"
,
L"./fonts/textFont.ttf"
,
L"./fonts/textFont.ttc"
,
L"./fonts/textFont.otf"
};
for
(
const
wchar_t
*
path
:
textFontPaths
)
{
myswprintf
(
gameConf
.
textfont
,
path
);
textFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
if
(
textFont
)
break
;
}
}
if
(
!
numFont
||
!
textFont
)
{
ErrorLog
(
"Failed to load font(s)!"
);
return
false
;
wchar_t
fpath
[
1024
];
fpath
[
0
]
=
0
;
FileSystem
::
TraversalDir
(
L"./fonts"
,
[
&
fpath
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
(
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".ttf"
,
4
)
||
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".ttc"
,
4
)
||
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".otf"
,
4
)))
{
myswprintf
(
fpath
,
L"./fonts/%ls"
,
name
);
}
});
if
(
fpath
[
0
]
==
0
)
{
ErrorLog
(
"Failed to load font(s)!"
);
return
false
;
}
if
(
!
numFont
)
{
myswprintf
(
gameConf
.
numfont
,
fpath
);
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
}
if
(
!
textFont
)
{
myswprintf
(
gameConf
.
textfont
,
fpath
);
textFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
}
}
adFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
12
);
lpcFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
48
);
guiFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
textfont
,
gameConf
.
textfontsize
);
smgr
=
device
->
getSceneManager
();
device
->
setWindowCaption
(
L"YGOPro"
);
device
->
setResizable
(
true
);
...
...
@@ -789,7 +845,6 @@ bool Game::Initialize() {
stCardListTip
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stCardListTip
->
setVisible
(
false
);
device
->
setEventReceiver
(
&
menuHandler
);
LoadConfig
();
if
(
!
soundManager
.
Init
())
{
chkEnableSound
->
setChecked
(
false
);
chkEnableSound
->
setEnabled
(
false
);
...
...
@@ -1113,7 +1168,7 @@ void Game::LoadConfig() {
gameConf
.
use_image_scale
=
1
;
gameConf
.
antialias
=
0
;
gameConf
.
serverport
=
7911
;
gameConf
.
textfontsize
=
1
2
;
gameConf
.
textfontsize
=
1
4
;
gameConf
.
nickname
[
0
]
=
0
;
gameConf
.
gamename
[
0
]
=
0
;
gameConf
.
lastdeck
[
0
]
=
0
;
...
...
@@ -1166,7 +1221,7 @@ void Game::LoadConfig() {
enable_log
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"textfont"
))
{
BufferIO
::
DecodeUTF8
(
valbuf
,
wstr
);
int
textfontsize
;
int
textfontsize
=
gameConf
.
textfontsize
;
sscanf
(
linebuf
,
"%s = %s %d"
,
strbuf
,
valbuf
,
&
textfontsize
);
gameConf
.
textfontsize
=
textfontsize
;
BufferIO
::
CopyWStr
(
wstr
,
gameConf
.
textfont
,
256
);
...
...
strings.conf
View file @
ac1b6f8d
...
...
@@ -601,6 +601,7 @@
!
counter
0
x56
炎星指示物
!
counter
0
x57
幻魔指示物
!
counter
0
x58
指示物(祢须三破鸣比)
!
counter
0
x59
落魂指示物
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -776,7 +777,9 @@
!
setname
0
x7c
炎舞
!
setname
0
x7d
阳炎 ヘイズ
!
setname
0
x107d
阳炎兽 陽炎獣
!
setname
0
x7e
异热同心武器
ZW
(ゼアル・ウェポン)
!
setname
0
x7e
异热同心 ゼアル
!
setname
0
x107e
异热同心武器
ZW
(ゼアル・ウェポン)
!
setname
0
x207e
异热同心从者
ZS
(ゼアル・サーバス)
!
setname
0
x7f
霍普 ホープ
!
setname
0
x107f
希望皇 霍普 希望皇ホープ
!
setname
0
x207f
未来皇 霍普 未来皇ホープ
...
...
@@ -1052,3 +1055,8 @@
!
setname
0
x1158
圣蔓 サンヴァイン
!
setname
0
x2158
圣天树 サンアバロン
!
setname
0
x159
圣夜骑士 ホーリーナイツ
!
setname
0
x15a
人偶怪兽 ドール・モンスター
!
setname
0
x15b
惊乐 アメイズメント
!
setname
0
x15c
游乐设施 アトラクション
!
setname
0
x15d
烙印
!
setname
0
x15e
降阶魔法
RDM
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