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
YGOPRO-520DIY
ygopro
Commits
a65a474b
Commit
a65a474b
authored
Jun 27, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches
parent
02e1ddae
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
94 deletions
+81
-94
gframe/data_manager.cpp
gframe/data_manager.cpp
+52
-63
gframe/data_manager.h
gframe/data_manager.h
+4
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-0
gframe/game.cpp
gframe/game.cpp
+12
-12
gframe/game.h
gframe/game.h
+2
-4
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+10
-11
No files found.
gframe/data_manager.cpp
View file @
a65a474b
...
@@ -179,8 +179,6 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
...
@@ -179,8 +179,6 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
}
}
}
}
bool
DataManager
::
LoadServerList
(
const
char
*
file
)
{
bool
DataManager
::
LoadServerList
(
const
char
*
file
)
{
if
(
_serverStrings
.
empty
())
_serverStrings
.
emplace_back
(
GetSysString
(
1304
),
L""
);
FILE
*
fp
=
myfopen
(
file
,
"r"
);
FILE
*
fp
=
myfopen
(
file
,
"r"
);
if
(
!
fp
)
if
(
!
fp
)
return
false
;
return
false
;
...
@@ -192,8 +190,6 @@ bool DataManager::LoadServerList(const char* file) {
...
@@ -192,8 +190,6 @@ bool DataManager::LoadServerList(const char* file) {
return
true
;
return
true
;
}
}
bool
DataManager
::
LoadServerList
(
const
wchar_t
*
file
)
{
bool
DataManager
::
LoadServerList
(
const
wchar_t
*
file
)
{
if
(
_serverStrings
.
empty
())
_serverStrings
.
emplace_back
(
GetSysString
(
1304
),
L""
);
FILE
*
fp
=
mywfopen
(
file
,
"r"
);
FILE
*
fp
=
mywfopen
(
file
,
"r"
);
if
(
!
fp
)
if
(
!
fp
)
return
false
;
return
false
;
...
@@ -205,8 +201,6 @@ bool DataManager::LoadServerList(const wchar_t* file) {
...
@@ -205,8 +201,6 @@ bool DataManager::LoadServerList(const wchar_t* file) {
return
true
;
return
true
;
}
}
bool
DataManager
::
LoadServerList
(
irr
::
io
::
IReadFile
*
reader
)
{
bool
DataManager
::
LoadServerList
(
irr
::
io
::
IReadFile
*
reader
)
{
if
(
_serverStrings
.
empty
())
_serverStrings
.
emplace_back
(
GetSysString
(
1304
),
L""
);
char
ch
{};
char
ch
{};
std
::
string
linebuf
;
std
::
string
linebuf
;
while
(
reader
->
read
(
&
ch
,
1
))
{
while
(
reader
->
read
(
&
ch
,
1
))
{
...
@@ -222,52 +216,59 @@ bool DataManager::LoadServerList(irr::io::IReadFile* reader) {
...
@@ -222,52 +216,59 @@ bool DataManager::LoadServerList(irr::io::IReadFile* reader) {
return
true
;
return
true
;
}
}
void
DataManager
::
ReadServerConfLine
(
const
char
*
linebuf
)
{
void
DataManager
::
ReadServerConfLine
(
const
char
*
linebuf
)
{
char
*
buffer
=
const_cast
<
char
*>
(
linebuf
);
char
buffer
[
1024
];
std
::
strncpy
(
buffer
,
linebuf
,
sizeof
(
buffer
)
-
1
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
buffer
[
strcspn
(
buffer
,
"
\n
"
)]
=
'\0'
;
buffer
[
strcspn
(
buffer
,
"
\n
"
)]
=
'\0'
;
char
*
separator
=
strchr
(
buffer
,
'|'
);
if
(
separator
!=
nullptr
)
{
*
separator
=
'\0'
;
std
::
wstring
name
,
ip
;
wchar_t
wname
[
256
],
wip
[
256
];
if
(
mbstowcs
(
wname
,
buffer
,
256
)
!=
(
size_t
)
-
1
&&
mbstowcs
(
wip
,
separator
+
1
,
256
)
!=
(
size_t
)
-
1
)
{
ip
=
wip
;
name
=
wname
;
}
auto
it
=
std
::
find_if
(
_serverStrings
.
begin
(),
_serverStrings
.
end
(),
[
name
](
const
auto
&
pair
)
{
return
pair
.
first
==
name
;
}
);
if
(
it
!=
_serverStrings
.
end
())
char
*
sep1
=
std
::
strchr
(
buffer
,
'|'
);
it
->
second
=
ip
;
if
(
sep1
!=
nullptr
)
{
else
*
sep1
=
'\0'
;
_serverStrings
.
emplace_back
(
name
,
ip
);
char
*
addrPart
=
sep1
+
1
;
wchar_t
wname
[
256
],
wip
[
512
];
// read the server name
BufferIO
::
DecodeUTF8
(
buffer
,
wname
);
// replace the first '|' with ':'
char
*
sep2
=
std
::
strchr
(
addrPart
,
'|'
);
if
(
sep2
)
{
*
sep2
=
':'
;
}
BufferIO
::
DecodeUTF8
(
addrPart
,
wip
);
_serverStrings
.
emplace_back
(
wname
,
wip
);
}
}
}
}
bool
DataManager
::
Load
INI
(
const
char
*
file
)
{
bool
DataManager
::
Load
CorresSrvIni
(
const
char
*
file
)
{
FILE
*
fp
=
myfopen
(
file
,
"r"
);
FILE
*
fp
=
myfopen
(
file
,
"r"
);
if
(
!
fp
)
if
(
!
fp
)
return
false
;
return
false
;
char
linebuf
[
TEXT_LINE_SIZE
]{};
char
linebuf
[
TEXT_LINE_SIZE
]{};
while
(
std
::
fgets
(
linebuf
,
sizeof
linebuf
,
fp
))
{
while
(
std
::
fgets
(
linebuf
,
sizeof
linebuf
,
fp
))
{
Read
INI
(
linebuf
);
Read
CorresSrvIniLine
(
linebuf
);
}
}
std
::
fclose
(
fp
);
std
::
fclose
(
fp
);
InsertServerList
();
InsertServerList
();
return
true
;
return
true
;
}
}
bool
DataManager
::
Load
INI
(
const
wchar_t
*
file
)
{
bool
DataManager
::
Load
CorresSrvIni
(
const
wchar_t
*
file
)
{
FILE
*
fp
=
mywfopen
(
file
,
"r"
);
FILE
*
fp
=
mywfopen
(
file
,
"r"
);
if
(
!
fp
)
if
(
!
fp
)
return
false
;
return
false
;
char
linebuf
[
TEXT_LINE_SIZE
]{};
char
linebuf
[
TEXT_LINE_SIZE
]{};
while
(
std
::
fgets
(
linebuf
,
sizeof
linebuf
,
fp
))
{
while
(
std
::
fgets
(
linebuf
,
sizeof
linebuf
,
fp
))
{
Read
INI
(
linebuf
);
Read
CorresSrvIniLine
(
linebuf
);
}
}
std
::
fclose
(
fp
);
std
::
fclose
(
fp
);
InsertServerList
();
InsertServerList
();
return
true
;
return
true
;
}
}
bool
DataManager
::
Load
INI
(
irr
::
io
::
IReadFile
*
reader
)
{
bool
DataManager
::
Load
CorresSrvIni
(
irr
::
io
::
IReadFile
*
reader
)
{
char
ch
{};
char
ch
{};
std
::
string
linebuf
;
std
::
string
linebuf
;
while
(
reader
->
read
(
&
ch
,
1
))
{
while
(
reader
->
read
(
&
ch
,
1
))
{
...
@@ -275,7 +276,7 @@ bool DataManager::LoadINI(irr::io::IReadFile* reader) {
...
@@ -275,7 +276,7 @@ bool DataManager::LoadINI(irr::io::IReadFile* reader) {
break
;
break
;
linebuf
.
push_back
(
ch
);
linebuf
.
push_back
(
ch
);
if
(
ch
==
'\n'
||
linebuf
.
size
()
>=
TEXT_LINE_SIZE
-
1
)
{
if
(
ch
==
'\n'
||
linebuf
.
size
()
>=
TEXT_LINE_SIZE
-
1
)
{
Read
INI
(
linebuf
.
data
());
Read
CorresSrvIniLine
(
linebuf
.
data
());
linebuf
.
clear
();
linebuf
.
clear
();
}
}
}
}
...
@@ -283,7 +284,7 @@ bool DataManager::LoadINI(irr::io::IReadFile* reader) {
...
@@ -283,7 +284,7 @@ bool DataManager::LoadINI(irr::io::IReadFile* reader) {
InsertServerList
();
InsertServerList
();
return
true
;
return
true
;
}
}
void
DataManager
::
Read
INI
(
const
char
*
linebuf
)
{
void
DataManager
::
Read
CorresSrvIniLine
(
const
char
*
linebuf
)
{
std
::
wstring
name
=
GetINIValue
(
linebuf
,
"ServerName = "
);
std
::
wstring
name
=
GetINIValue
(
linebuf
,
"ServerName = "
);
std
::
wstring
host
=
GetINIValue
(
linebuf
,
"ServerHost = "
);
std
::
wstring
host
=
GetINIValue
(
linebuf
,
"ServerHost = "
);
std
::
wstring
port
=
GetINIValue
(
linebuf
,
"ServerPort = "
);
std
::
wstring
port
=
GetINIValue
(
linebuf
,
"ServerPort = "
);
...
@@ -313,30 +314,18 @@ std::wstring DataManager::GetINIValue(const char* line, const char* key) {
...
@@ -313,30 +314,18 @@ std::wstring DataManager::GetINIValue(const char* line, const char* key) {
std
::
string
narrowStr
(
valStart
,
valEnd
);
std
::
string
narrowStr
(
valStart
,
valEnd
);
if
(
narrowStr
.
empty
())
if
(
narrowStr
.
empty
())
return
L""
;
return
L""
;
size_t
requiredSize
=
mbstowcs
(
nullptr
,
narrowStr
.
c_str
(),
0
);
wchar_t
wbuf
[
1024
];
if
(
requiredSize
==
(
size_t
)
-
1
)
BufferIO
::
DecodeUTF8
(
narrowStr
.
c_str
(),
wbuf
);
return
L""
;
return
wbuf
;
std
::
wstring
wideStr
(
requiredSize
+
1
,
L'\0'
);
mbstowcs
(
&
wideStr
[
0
],
narrowStr
.
c_str
(),
requiredSize
+
1
);
wideStr
.
resize
(
requiredSize
);
return
wideStr
;
}
}
void
DataManager
::
InsertServerList
()
{
void
DataManager
::
InsertServerList
()
{
if
(
iniName
!=
L""
&&
iniHost
!=
L""
)
{
if
(
iniName
!=
L""
&&
iniHost
!=
L""
)
{
std
::
wstring
ip
=
iniHost
;
std
::
wstring
ip
=
iniHost
;
std
::
wstring
name
=
iniName
;
if
(
iniPort
!=
L""
)
{
if
(
iniPort
!=
L""
)
{
ip
+=
L":"
;
ip
+=
L":"
;
ip
+=
iniPort
;
ip
+=
iniPort
;
}
}
auto
it
=
std
::
find_if
(
_serverStrings
.
begin
(),
_serverStrings
.
end
(),
_serverStrings
.
emplace_back
(
iniName
,
ip
);
[
name
](
const
auto
&
pair
)
{
return
pair
.
first
==
name
;
}
);
if
(
it
!=
_serverStrings
.
end
())
it
->
second
=
ip
;
else
_serverStrings
.
emplace_back
(
name
,
ip
);
}
}
iniName
.
clear
();
iniName
.
clear
();
iniHost
.
clear
();
iniHost
.
clear
();
...
...
gframe/data_manager.h
View file @
a65a474b
...
@@ -54,10 +54,10 @@ public:
...
@@ -54,10 +54,10 @@ public:
bool
LoadServerList
(
const
wchar_t
*
file
);
bool
LoadServerList
(
const
wchar_t
*
file
);
bool
LoadServerList
(
irr
::
io
::
IReadFile
*
reader
);
bool
LoadServerList
(
irr
::
io
::
IReadFile
*
reader
);
void
ReadServerConfLine
(
const
char
*
linebuf
);
void
ReadServerConfLine
(
const
char
*
linebuf
);
bool
Load
INI
(
const
char
*
file
);
bool
Load
CorresSrvIni
(
const
char
*
file
);
bool
Load
INI
(
const
wchar_t
*
file
);
bool
Load
CorresSrvIni
(
const
wchar_t
*
file
);
bool
Load
INI
(
irr
::
io
::
IReadFile
*
reader
);
bool
Load
CorresSrvIni
(
irr
::
io
::
IReadFile
*
reader
);
void
Read
INI
(
const
char
*
linebuf
);
void
Read
CorresSrvIniLine
(
const
char
*
linebuf
);
std
::
wstring
GetINIValue
(
const
char
*
line
,
const
char
*
key
);
std
::
wstring
GetINIValue
(
const
char
*
line
,
const
char
*
key
);
void
InsertServerList
();
void
InsertServerList
();
bool
Error
(
sqlite3
*
pDB
,
sqlite3_stmt
*
pStmt
=
nullptr
);
bool
Error
(
sqlite3
*
pDB
,
sqlite3_stmt
*
pStmt
=
nullptr
);
...
...
gframe/duelclient.cpp
View file @
a65a474b
...
@@ -622,6 +622,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
...
@@ -622,6 +622,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wServerList
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
mainGame
->
ResizeChatInputWindow
();
mainGame
->
ResizeChatInputWindow
();
...
...
gframe/game.cpp
View file @
a65a474b
...
@@ -124,7 +124,7 @@ bool Game::Initialize() {
...
@@ -124,7 +124,7 @@ bool Game::Initialize() {
ErrorLog
(
"Failed to load strings!"
);
ErrorLog
(
"Failed to load strings!"
);
return
false
;
return
false
;
}
}
dataManager
.
LoadServerList
(
GetLocaleDir
(
"server.conf"
));
dataManager
.
LoadServerList
(
GetLocaleDir
(
"server
s
.conf"
));
dataManager
.
LoadDB
(
L"specials/special.cdb"
);
dataManager
.
LoadDB
(
L"specials/special.cdb"
);
env
=
device
->
getGUIEnvironment
();
env
=
device
->
getGUIEnvironment
();
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
numFont
=
irr
::
gui
::
CGUITTFont
::
createTTFont
(
env
,
gameConf
.
numfont
,
16
);
...
@@ -236,8 +236,8 @@ bool Game::Initialize() {
...
@@ -236,8 +236,8 @@ bool Game::Initialize() {
editbox_list
.
push_back
(
ebNickName
);
editbox_list
.
push_back
(
ebNickName
);
lstHostList
=
env
->
addListBox
(
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
60
,
570
,
320
),
wLanWindow
,
LISTBOX_LAN_HOST
,
true
);
lstHostList
=
env
->
addListBox
(
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
60
,
570
,
320
),
wLanWindow
,
LISTBOX_LAN_HOST
,
true
);
lstHostList
->
setItemHeight
(
18
);
lstHostList
->
setItemHeight
(
18
);
btnLanRefresh
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
1
70
,
325
,
27
0
,
350
),
wLanWindow
,
BUTTON_LAN_REFRESH
,
dataManager
.
GetSysString
(
1217
));
btnLanRefresh
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
1
50
,
325
,
25
0
,
350
),
wLanWindow
,
BUTTON_LAN_REFRESH
,
dataManager
.
GetSysString
(
1217
));
btnServerList
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
310
,
325
,
41
0
,
350
),
wLanWindow
,
BUTTON_SERVER_LIST
,
dataManager
.
GetSysString
(
1239
));
btnServerList
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
280
,
325
,
38
0
,
350
),
wLanWindow
,
BUTTON_SERVER_LIST
,
dataManager
.
GetSysString
(
1239
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1221
),
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
360
,
220
,
380
),
false
,
false
,
wLanWindow
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1221
),
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
360
,
220
,
380
),
false
,
false
,
wLanWindow
);
ebJoinHost
=
env
->
addEditBox
(
gameConf
.
lasthost
,
irr
::
core
::
rect
<
irr
::
s32
>
(
110
,
355
,
420
,
380
),
true
,
wLanWindow
);
ebJoinHost
=
env
->
addEditBox
(
gameConf
.
lasthost
,
irr
::
core
::
rect
<
irr
::
s32
>
(
110
,
355
,
420
,
380
),
true
,
wLanWindow
);
ebJoinHost
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
ebJoinHost
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
...
@@ -369,8 +369,7 @@ bool Game::Initialize() {
...
@@ -369,8 +369,7 @@ bool Game::Initialize() {
lstServerList
=
env
->
addListBox
(
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
20
,
290
,
270
),
wServerList
,
LISTBOX_SERVER_LIST
,
true
);
lstServerList
=
env
->
addListBox
(
irr
::
core
::
rect
<
irr
::
s32
>
(
10
,
20
,
290
,
270
),
wServerList
,
LISTBOX_SERVER_LIST
,
true
);
lstServerList
->
setItemHeight
(
18
);
lstServerList
->
setItemHeight
(
18
);
RefreshServerList
();
RefreshServerList
();
btnServerSelected
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
30
,
280
,
130
,
310
),
wServerList
,
BUTTON_SERVER_SELECTED
,
dataManager
.
GetSysString
(
1211
));
btnServerReturn
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
100
,
280
,
200
,
310
),
wServerList
,
BUTTON_SERVER_RETURN
,
dataManager
.
GetSysString
(
1210
));
btnServerCancel
=
env
->
addButton
(
irr
::
core
::
rect
<
irr
::
s32
>
(
170
,
280
,
270
,
310
),
wServerList
,
BUTTON_SERVER_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//img
//img
wCardImg
=
env
->
addStaticText
(
L""
,
irr
::
core
::
rect
<
irr
::
s32
>
(
1
,
1
,
1
+
CARD_IMG_WIDTH
+
20
,
1
+
CARD_IMG_HEIGHT
+
18
),
true
,
false
,
0
,
-
1
,
true
);
wCardImg
=
env
->
addStaticText
(
L""
,
irr
::
core
::
rect
<
irr
::
s32
>
(
1
,
1
,
1
+
CARD_IMG_WIDTH
+
20
,
1
+
CARD_IMG_HEIGHT
+
18
),
true
,
false
,
0
,
-
1
,
true
);
wCardImg
->
setBackgroundColor
(
0xc0c0c0c0
);
wCardImg
->
setBackgroundColor
(
0xc0c0c0c0
);
...
@@ -1258,7 +1257,7 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
...
@@ -1258,7 +1257,7 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
if
(
!
std
::
wcscmp
(
name
,
L"lflist.conf"
))
{
if
(
!
std
::
wcscmp
(
name
,
L"lflist.conf"
))
{
deckManager
.
LoadLFListSingle
(
fpath
,
true
);
deckManager
.
LoadLFListSingle
(
fpath
,
true
);
lflist_changed
=
true
;
lflist_changed
=
true
;
}
else
if
(
!
std
::
wcscmp
(
name
,
L"server.conf"
))
{
}
else
if
(
!
std
::
wcscmp
(
name
,
L"server
s
.conf"
))
{
dataManager
.
LoadServerList
(
fpath
);
dataManager
.
LoadServerList
(
fpath
);
server_list_changed
=
true
;
server_list_changed
=
true
;
}
else
{
}
else
{
...
@@ -1266,9 +1265,10 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
...
@@ -1266,9 +1265,10 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
}
}
return
;
return
;
}
}
if
(
IsExtension
(
name
,
L"
.ini"
))
{
if
(
!
std
::
wcscmp
(
name
,
L"corres_srv
.ini"
))
{
dataManager
.
LoadINI
(
fpath
);
dataManager
.
LoadCorresSrvIni
(
fpath
);
server_list_changed
=
true
;
server_list_changed
=
true
;
return
;
}
}
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
#ifdef _WIN32
#ifdef _WIN32
...
@@ -1308,7 +1308,7 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
...
@@ -1308,7 +1308,7 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
if
(
!
std
::
wcscmp
(
fname
,
L"lflist.conf"
))
{
if
(
!
std
::
wcscmp
(
fname
,
L"lflist.conf"
))
{
deckManager
.
LoadLFListSingle
(
reader
,
true
);
deckManager
.
LoadLFListSingle
(
reader
,
true
);
lflist_changed
=
true
;
lflist_changed
=
true
;
}
else
if
(
!
std
::
wcscmp
(
fname
,
L"server.conf"
))
{
}
else
if
(
!
std
::
wcscmp
(
fname
,
L"server
s
.conf"
))
{
dataManager
.
LoadServerList
(
reader
);
dataManager
.
LoadServerList
(
reader
);
server_list_changed
=
true
;
server_list_changed
=
true
;
}
else
{
}
else
{
...
@@ -1316,8 +1316,8 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
...
@@ -1316,8 +1316,8 @@ void Game::LoadExpansions(const wchar_t* expansions_path) {
}
}
continue
;
continue
;
}
}
if
(
IsExtension
(
fname
,
L"
.ini"
))
{
if
(
!
std
::
wcscmp
(
fname
,
L"corres_srv
.ini"
))
{
dataManager
.
Load
INI
(
createReader
());
dataManager
.
Load
CorresSrvIni
(
createReader
());
server_list_changed
=
true
;
server_list_changed
=
true
;
}
}
if
(
!
mywcsncasecmp
(
fname
,
L"pack/"
,
5
)
&&
IsExtension
(
fname
,
L".ydk"
))
{
if
(
!
mywcsncasecmp
(
fname
,
L"pack/"
,
5
)
&&
IsExtension
(
fname
,
L".ydk"
))
{
...
...
gframe/game.h
View file @
a65a474b
...
@@ -698,8 +698,7 @@ public:
...
@@ -698,8 +698,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnServerList
;
irr
::
gui
::
IGUIButton
*
btnServerList
;
irr
::
gui
::
IGUIWindow
*
wServerList
;
irr
::
gui
::
IGUIWindow
*
wServerList
;
irr
::
gui
::
IGUIListBox
*
lstServerList
;
irr
::
gui
::
IGUIListBox
*
lstServerList
;
irr
::
gui
::
IGUIButton
*
btnServerSelected
;
irr
::
gui
::
IGUIButton
*
btnServerReturn
;
irr
::
gui
::
IGUIButton
*
btnServerCancel
;
};
};
extern
Game
*
mainGame
;
extern
Game
*
mainGame
;
...
@@ -929,8 +928,7 @@ extern Game* mainGame;
...
@@ -929,8 +928,7 @@ extern Game* mainGame;
#define BUTTON_SERVER_LIST 392
#define BUTTON_SERVER_LIST 392
#define LISTBOX_SERVER_LIST 393
#define LISTBOX_SERVER_LIST 393
#define BUTTON_SERVER_SELECTED 394
#define BUTTON_SERVER_RETURN 394
#define BUTTON_SERVER_CANCEL 395
#define TEXTURE_DUEL 0
#define TEXTURE_DUEL 0
#define TEXTURE_DECK 1
#define TEXTURE_DECK 1
...
...
gframe/menu_handler.cpp
View file @
a65a474b
...
@@ -90,8 +90,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -90,8 +90,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_JOIN_CANCEL
:
{
case
BUTTON_JOIN_CANCEL
:
{
mainGame
->
HideElement
(
mainGame
->
wServerList
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wServerList
);
mainGame
->
ShowElement
(
mainGame
->
wMainMenu
);
mainGame
->
ShowElement
(
mainGame
->
wMainMenu
);
if
(
exit_on_return
)
if
(
exit_on_return
)
mainGame
->
device
->
closeDevice
();
mainGame
->
device
->
closeDevice
();
...
@@ -105,6 +105,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -105,6 +105,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
btnHostConfirm
->
setEnabled
(
true
);
mainGame
->
btnHostConfirm
->
setEnabled
(
true
);
mainGame
->
btnHostCancel
->
setEnabled
(
true
);
mainGame
->
btnHostCancel
->
setEnabled
(
true
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wServerList
);
mainGame
->
ShowElement
(
mainGame
->
wCreateHost
);
mainGame
->
ShowElement
(
mainGame
->
wCreateHost
);
break
;
break
;
}
}
...
@@ -490,16 +491,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -490,16 +491,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
PopupElement
(
mainGame
->
wServerList
);
mainGame
->
PopupElement
(
mainGame
->
wServerList
);
break
;
break
;
}
}
case
BUTTON_SERVER_SELECTED
:
{
case
BUTTON_SERVER_RETURN
:
{
int
sel
=
mainGame
->
lstServerList
->
getSelected
();
wcscpy
(
mainGame
->
gameConf
.
lasthost
,
sel
==
-
1
?
L""
:
dataManager
.
_serverStrings
[
sel
].
second
.
c_str
());
wchar_t
buf
[
256
];
myswprintf
(
buf
,
L"%s"
,
mainGame
->
gameConf
.
lasthost
);
mainGame
->
ebJoinHost
->
setText
(
buf
);
mainGame
->
HideElement
(
mainGame
->
wServerList
);
break
;
}
case
BUTTON_SERVER_CANCEL
:
{
mainGame
->
HideElement
(
mainGame
->
wServerList
);
mainGame
->
HideElement
(
mainGame
->
wServerList
);
break
;
break
;
}
}
...
@@ -614,6 +606,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -614,6 +606,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
cbBotDeck
->
setVisible
(
mainGame
->
botInfo
[
sel
].
select_deckfile
);
mainGame
->
cbBotDeck
->
setVisible
(
mainGame
->
botInfo
[
sel
].
select_deckfile
);
break
;
break
;
}
}
case
LISTBOX_SERVER_LIST
:
{
int
sel
=
mainGame
->
lstServerList
->
getSelected
();
auto
target
=
sel
==
-
1
?
L""
:
dataManager
.
_serverStrings
[
sel
].
second
.
c_str
();
wcscpy
(
mainGame
->
gameConf
.
lasthost
,
target
);
mainGame
->
ebJoinHost
->
setText
(
target
);
break
;
}
}
}
break
;
break
;
}
}
...
...
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