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
b5001317
Commit
b5001317
authored
May 26, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch-check' of github.com:salix5/ygopro into develop
parents
b262c5da
447e38c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
17 deletions
+22
-17
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+11
-3
gframe/replay.cpp
gframe/replay.cpp
+10
-12
gframe/replay.h
gframe/replay.h
+0
-1
No files found.
gframe/game.cpp
View file @
b5001317
...
@@ -1265,7 +1265,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
...
@@ -1265,7 +1265,7 @@ void Game::RefreshDeck(const wchar_t* deckpath, const std::function<void(const w
void
Game
::
RefreshReplay
()
{
void
Game
::
RefreshReplay
()
{
lstReplayList
->
clear
();
lstReplayList
->
clear
();
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./replay"
,
[
this
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
)
&&
Replay
::
CheckReplay
(
name
)
)
if
(
!
isdir
&&
IsExtension
(
name
,
L".yrp"
))
lstReplayList
->
addItem
(
name
);
lstReplayList
->
addItem
(
name
);
});
});
}
}
...
...
gframe/menu_handler.cpp
View file @
b5001317
...
@@ -523,10 +523,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -523,10 +523,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
case
LISTBOX_REPLAY_LIST
:
{
case
LISTBOX_REPLAY_LIST
:
{
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
int
sel
=
mainGame
->
lstReplayList
->
getSelected
();
if
(
sel
==
-
1
)
if
(
sel
<
0
)
break
;
auto
filename
=
mainGame
->
lstReplayList
->
getListItem
(
sel
);
if
(
!
filename
)
break
;
break
;
wchar_t
replay_path
[
256
]{};
wchar_t
replay_path
[
256
]{};
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
sel
)
);
myswprintf
(
replay_path
,
L"./replay/%ls"
,
filename
);
if
(
!
temp_replay
.
OpenReplay
(
replay_path
))
{
if
(
!
temp_replay
.
OpenReplay
(
replay_path
))
{
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
break
;
break
;
...
@@ -536,8 +539,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -536,8 +539,13 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
time_t
curtime
;
time_t
curtime
;
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
curtime
=
temp_replay
.
pheader
.
start_time
;
curtime
=
temp_replay
.
pheader
.
start_time
;
else
else
{
curtime
=
temp_replay
.
pheader
.
seed
;
curtime
=
temp_replay
.
pheader
.
seed
;
wchar_t
version_info
[
256
]{};
myswprintf
(
version_info
,
L"version 0x%X"
,
temp_replay
.
pheader
.
version
);
repinfo
.
append
(
version_info
);
repinfo
.
append
(
L"
\n
"
);
}
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
repinfo
.
append
(
infobuf
);
repinfo
.
append
(
infobuf
);
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
if
(
temp_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
...
...
gframe/replay.cpp
View file @
b5001317
...
@@ -111,7 +111,16 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -111,7 +111,16 @@ bool Replay::OpenReplay(const wchar_t* name) {
return
false
;
return
false
;
Reset
();
Reset
();
if
(
std
::
fread
(
&
pheader
,
sizeof
pheader
,
1
,
rfp
)
<
1
)
{
bool
correct_header
=
true
;
if
(
std
::
fread
(
&
pheader
,
sizeof
pheader
,
1
,
rfp
)
<
1
)
correct_header
=
false
;
else
if
(
pheader
.
id
!=
0x31707279
)
correct_header
=
false
;
else
if
(
pheader
.
version
<
0x12d0u
)
correct_header
=
false
;
else
if
(
pheader
.
version
>=
0x1353u
&&
!
(
pheader
.
flag
&
REPLAY_UNIFORM
))
correct_header
=
false
;
if
(
!
correct_header
)
{
std
::
fclose
(
rfp
);
std
::
fclose
(
rfp
);
return
false
;
return
false
;
}
}
...
@@ -142,17 +151,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
...
@@ -142,17 +151,6 @@ bool Replay::OpenReplay(const wchar_t* name) {
data_position
=
0
;
data_position
=
0
;
return
true
;
return
true
;
}
}
bool
Replay
::
CheckReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
FILE
*
rfp
=
mywfopen
(
fname
,
"rb"
);
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
size_t
count
=
std
::
fread
(
&
rheader
,
sizeof
rheader
,
1
,
rfp
);
std
::
fclose
(
rfp
);
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0u
&&
(
rheader
.
version
<
0x1353u
||
(
rheader
.
flag
&
REPLAY_UNIFORM
));
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
myswprintf
(
fname
,
L"./replay/%ls"
,
name
);
...
...
gframe/replay.h
View file @
b5001317
...
@@ -53,7 +53,6 @@ public:
...
@@ -53,7 +53,6 @@ public:
void
SaveReplay
(
const
wchar_t
*
name
);
void
SaveReplay
(
const
wchar_t
*
name
);
// play
// play
static
bool
CheckReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
DeleteReplay
(
const
wchar_t
*
name
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
RenameReplay
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
static
size_t
GetDeckPlayer
(
size_t
deck_index
)
{
...
...
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