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
nanahira
ygopro
Commits
553330c7
Commit
553330c7
authored
Dec 13, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add reading single puzzle message
parent
fdab949e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
gframe/game.cpp
gframe/game.cpp
+2
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+49
-0
No files found.
gframe/game.cpp
View file @
553330c7
...
...
@@ -623,7 +623,7 @@ bool Game::Initialize() {
btnLoadSinglePlay
=
env
->
addButton
(
rect
<
s32
>
(
459
,
301
,
569
,
326
),
tabSingle
,
BUTTON_LOAD_SINGLEPLAY
,
dataManager
.
GetSysString
(
1211
));
btnSinglePlayCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabSingle
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1352
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabSingle
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
5
5
0
,
280
),
false
,
true
,
tabSingle
);
stSinglePlayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
5
6
0
,
280
),
false
,
true
,
tabSingle
);
//replay save
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -898,6 +898,7 @@ void Game::RefreshReplay() {
}
void
Game
::
RefreshSingleplay
()
{
lstSinglePlayList
->
clear
();
stSinglePlayInfo
->
setText
(
L""
);
FileSystem
::
TraversalDir
(
L"./single"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".lua"
,
4
))
lstSinglePlayList
->
addItem
(
name
);
...
...
gframe/menu_handler.cpp
View file @
553330c7
...
...
@@ -457,6 +457,55 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
repinfo
.
c_str
());
break
;
}
case
LISTBOX_SINGLEPLAY_LIST
:
{
int
sel
=
mainGame
->
lstSinglePlayList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
const
wchar_t
*
name
=
mainGame
->
lstSinglePlayList
->
getListItem
(
sel
);
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
FILE
*
fp
;
#ifdef _WIN32
fp
=
_wfopen
(
fname
,
L"rb"
);
#else
char
filename
[
256
];
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
fp
=
fopen
(
filename
,
"rb"
);
#endif
if
(
!
fp
)
{
mainGame
->
stSinglePlayInfo
->
setText
(
L""
);
break
;
}
char
linebuf
[
1024
];
wchar_t
wlinebuf
[
1024
];
std
::
wstring
message
=
L""
;
bool
in_message
=
false
;
while
(
fgets
(
linebuf
,
1024
,
fp
))
{
if
(
!
strnicmp
(
linebuf
,
"--[[message"
,
11
))
{
size_t
len
=
strlen
(
linebuf
);
char
*
msgend
=
strrchr
(
linebuf
,
']'
);
if
(
len
<=
13
)
{
in_message
=
true
;
continue
;
}
else
if
(
len
>
15
&&
msgend
)
{
*
(
msgend
-
1
)
=
'\0'
;
BufferIO
::
DecodeUTF8
(
linebuf
+
12
,
wlinebuf
);
message
.
append
(
wlinebuf
);
break
;
}
}
if
(
!
strncmp
(
linebuf
,
"]]"
,
2
))
{
in_message
=
false
;
break
;
}
if
(
in_message
)
{
BufferIO
::
DecodeUTF8
(
linebuf
,
wlinebuf
);
message
.
append
(
wlinebuf
);
}
}
mainGame
->
SetStaticText
(
mainGame
->
stSinglePlayInfo
,
200
,
mainGame
->
guiFont
,
message
.
c_str
());
break
;
}
case
LISTBOX_BOT_LIST
:
{
int
sel
=
mainGame
->
lstBotList
->
getSelected
();
if
(
sel
==
-
1
)
...
...
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