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
REIKAI
ygopro
Commits
8e595c99
Commit
8e595c99
authored
Aug 01, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish locale
parent
eff5191e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
1 deletion
+56
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+11
-0
gframe/game.cpp
gframe/game.cpp
+40
-0
gframe/game.h
gframe/game.h
+3
-0
strings.conf
strings.conf
+2
-1
No files found.
gframe/event_handler.cpp
View file @
8e595c99
...
...
@@ -1906,6 +1906,17 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_COMBO_BOX_CHANGED
:
{
switch
(
id
)
{
case
COMBOBOX_LOCALE
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
mainGame
->
cbLocale
->
getItem
(
mainGame
->
cbLocale
->
getSelected
()));
mainGame
->
SaveConfig
();
return
true
;
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_CHAT
:
{
...
...
gframe/game.cpp
View file @
8e595c99
...
...
@@ -340,6 +340,10 @@ bool Game::Initialize() {
posY
+=
30
;
chkEnablePScale
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1287
));
chkEnablePScale
->
setChecked
(
gameConf
.
chkEnablePScale
!=
0
);
posY
+=
30
;
env
->
addStaticText
(
dataManager
.
GetSysString
(
1288
),
rect
<
s32
>
(
posX
+
23
,
posY
+
3
,
posX
+
160
,
posY
+
28
),
false
,
false
,
tabSystem
);
cbLocale
=
env
->
addComboBox
(
rect
<
s32
>
(
posX
+
160
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
COMBOBOX_LOCALE
);
RefreshLocales
();
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -1050,6 +1054,41 @@ void Game::RefreshSingleplay() {
closedir
(
dir
);
#endif
}
void
Game
::
RefreshLocales
()
{
cbLocale
->
clear
();
cbLocale
->
addItem
(
L"default"
);
#ifdef _WIN32
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
L"./locales/*"
,
&
fdataw
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
;
do
{
if
((
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
&&
wcscmp
(
fdataw
.
cFileName
,
L"."
)
&&
wcscmp
(
fdataw
.
cFileName
,
L".."
))
cbLocale
->
addItem
(
fdataw
.
cFileName
);
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
#else
DIR
*
dir
;
struct
dirent
*
dirp
;
if
((
dir
=
opendir
(
"./locales/"
))
==
NULL
)
return
;
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
wchar_t
wname
[
256
];
BufferIO
::
DecodeUTF8
(
dirp
->
d_name
,
wname
);
if
(
!
wcscmp
(
wname
,
L"."
)
||
!
wcscmp
(
wname
,
L".."
))
continue
;
cbLocale
->
addItem
(
wname
);
}
closedir
(
dir
);
#endif
for
(
size_t
i
=
0
;
i
<
cbLocale
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
cbLocale
->
getItem
(
i
),
gameConf
.
locale
))
{
cbLocale
->
setSelected
(
i
);
break
;
}
}
}
void
Game
::
RefreshBot
()
{
if
(
!
gameConf
.
enable_bot_mode
)
return
;
...
...
@@ -1822,6 +1861,7 @@ void Game::OnResize() {
//sound / music volume bar
scrSoundVolume
->
setRelativePosition
(
recti
(
20
+
126
,
230
+
4
,
20
+
(
300
*
xScale
)
-
40
,
230
+
21
));
scrMusicVolume
->
setRelativePosition
(
recti
(
20
+
126
,
260
+
4
,
20
+
(
300
*
xScale
)
-
40
,
260
+
21
));
cbLocale
->
setRelativePosition
(
recti
(
20
+
160
,
350
+
4
,
20
+
(
300
*
xScale
)
-
40
,
350
+
21
));
if
(
gameConf
.
resize_popup_menu
)
{
int
width
=
100
*
mainGame
->
xScale
;
...
...
gframe/game.h
View file @
8e595c99
...
...
@@ -125,6 +125,7 @@ public:
void
RefreshReplay
();
void
RefreshSingleplay
();
void
RefreshBot
();
void
RefreshLocales
();
void
DrawSelectionLine
(
irr
::
video
::
S3DVertex
*
vec
,
bool
strip
,
int
width
,
float
*
cv
);
void
DrawSelectionLine
(
irr
::
gui
::
IGUIElement
*
element
,
int
width
,
irr
::
video
::
SColor
color
);
void
DrawBackGround
();
...
...
@@ -295,6 +296,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnWinResizeL
;
irr
::
gui
::
IGUIButton
*
btnWinResizeXL
;
irr
::
gui
::
IGUICheckBox
*
chkEnablePScale
;
irr
::
gui
::
IGUIComboBox
*
cbLocale
;
//main menu
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
...
...
@@ -691,6 +693,7 @@ extern Game* mainGame;
#define BUTTON_WINDOW_RESIZE_M 366
#define BUTTON_WINDOW_RESIZE_L 367
#define BUTTON_WINDOW_RESIZE_XL 368
#define COMBOBOX_LOCALE 369
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
...
...
strings.conf
View file @
8e595c99
...
...
@@ -314,7 +314,8 @@
!
system
1285
大
!
system
1286
特大
!
system
1287
数字灵摆图片
!
system
1288
语言(重启后生效):
!
system
1288
语言(重启后生效)
!
system
1289
默认
!
system
1290
忽略对方发言
!
system
1291
忽略观战者发言
!
system
1292
忽略时点
...
...
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