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
a32b127d
Commit
a32b127d
authored
Nov 16, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into resize
parents
b93c8175
ea45f43d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
28 deletions
+63
-28
gframe/client_card.cpp
gframe/client_card.cpp
+8
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+19
-11
gframe/event_handler.cpp
gframe/event_handler.cpp
+2
-0
gframe/game.cpp
gframe/game.cpp
+9
-2
gframe/game.h
gframe/game.h
+2
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+2
-2
gframe/single_mode.cpp
gframe/single_mode.cpp
+18
-11
strings.conf
strings.conf
+3
-0
No files found.
gframe/client_card.cpp
View file @
a32b127d
...
...
@@ -126,7 +126,7 @@ void ClientCard::UpdateInfo(char* buf) {
if
(
flag
&
QUERY_REASON
)
reason
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_REASON_CARD
)
BufferIO
::
ReadInt32
(
buf
)
;
buf
+=
4
;
if
(
flag
&
QUERY_EQUIP_CARD
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
ReadInt8
(
buf
);
...
...
@@ -212,8 +212,14 @@ bool ClientCard::client_card_sort(ClientCard* c1, ClientCard* c2) {
return
c1
->
overlayTarget
->
sequence
<
c2
->
overlayTarget
->
sequence
;
else
return
c1
->
sequence
<
c2
->
sequence
;
else
{
if
(
c1
->
location
&
0x71
)
if
(
c1
->
location
&
(
LOCATION_DECK
|
LOCATION_GRAVE
|
LOCATION_REMOVED
|
LOCATION_EXTRA
))
{
for
(
size_t
i
=
0
;
i
<
mainGame
->
dField
.
chains
.
size
();
++
i
)
{
auto
chit
=
mainGame
->
dField
.
chains
[
i
];
if
(
c1
==
chit
.
chain_card
||
chit
.
target
.
find
(
c1
)
!=
chit
.
target
.
end
())
return
true
;
}
return
c1
->
sequence
>
c2
->
sequence
;
}
else
return
c1
->
sequence
<
c2
->
sequence
;
}
...
...
gframe/duelclient.cpp
View file @
a32b127d
...
...
@@ -681,18 +681,26 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H-%M-%S"
,
localedtime
);
size_t
size
=
strlen
(
timebuf
)
+
1
;
wchar_t
timetext
[
80
];
mbstowcs
(
timetext
,
timebuf
,
size
);
tm
*
localedtime
=
localtime
(
&
nowtime
);
wchar_t
timetext
[
40
];
wcsftime
(
timetext
,
40
,
L"%Y-%m-%d %H-%M-%S"
,
localedtime
);
mainGame
->
ebRSName
->
setText
(
timetext
);
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
if
(
!
mainGame
->
chkAutoSaveReplay
->
isChecked
())
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
}
else
{
mainGame
->
actionParam
=
1
;
wchar_t
msgbuf
[
256
];
myswprintf
(
msgbuf
,
dataManager
.
GetSysString
(
1367
),
timetext
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
guiFont
,
msgbuf
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
30
);
}
if
(
mainGame
->
actionParam
||
!
is_host
)
{
char
*
prep
=
pdata
;
Replay
new_replay
;
...
...
gframe/event_handler.cpp
View file @
a32b127d
...
...
@@ -424,6 +424,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
wCardSelect
->
setText
(
dataManager
.
GetSysString
(
568
));
list_command
=
COMMAND_OPERATION
;
}
std
::
sort
(
selectable_cards
.
begin
(),
selectable_cards
.
end
(),
ClientCard
::
client_card_sort
);
ShowSelectCard
(
true
,
true
);
}
break
;
...
...
@@ -580,6 +581,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
list_command
=
COMMAND_LIST
;
std
::
sort
(
selectable_cards
.
begin
(),
selectable_cards
.
end
(),
ClientCard
::
client_card_sort
);
ShowSelectCard
(
true
);
break
;
}
...
...
gframe/game.cpp
View file @
a32b127d
...
...
@@ -283,7 +283,10 @@ bool Game::Initialize() {
posY
+=
30
;
chkQuickAnimation
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
CHECKBOX_QUICK_ANIMATION
,
dataManager
.
GetSysString
(
1299
));
chkQuickAnimation
->
setChecked
(
gameConf
.
quick_animation
!=
0
);
elmTabHelperLast
=
chkQuickAnimation
;
posY
+=
30
;
chkAutoSaveReplay
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
-
1
,
dataManager
.
GetSysString
(
1366
));
chkAutoSaveReplay
->
setChecked
(
gameConf
.
auto_save_replay
!=
0
);
elmTabHelperLast
=
chkAutoSaveReplay
;
//system
irr
::
gui
::
IGUITab
*
_tabSystem
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1273
));
_tabSystem
->
setRelativePosition
(
recti
(
16
,
49
,
299
,
362
));
...
...
@@ -1014,6 +1017,7 @@ void Game::LoadConfig() {
gameConf
.
defaultOT
=
1
;
gameConf
.
enable_bot_mode
=
0
;
gameConf
.
quick_animation
=
0
;
gameConf
.
auto_save_replay
=
0
;
gameConf
.
enable_sound
=
true
;
gameConf
.
sound_volume
=
0.5
;
gameConf
.
enable_music
=
true
;
...
...
@@ -1087,6 +1091,8 @@ void Game::LoadConfig() {
gameConf
.
enable_bot_mode
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"quick_animation"
))
{
gameConf
.
quick_animation
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"auto_save_replay"
))
{
gameConf
.
auto_save_replay
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"window_maximized"
))
{
gameConf
.
window_maximized
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"window_width"
))
{
...
...
@@ -1168,6 +1174,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"default_ot = %d
\n
"
,
gameConf
.
defaultOT
);
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
fprintf
(
fp
,
"quick_animation = %d
\n
"
,
gameConf
.
quick_animation
);
fprintf
(
fp
,
"auto_save_replay = %d
\n
"
,
(
chkAutoSaveReplay
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"window_maximized = %d
\n
"
,
(
gameConf
.
window_maximized
?
1
:
0
));
fprintf
(
fp
,
"window_width = %d
\n
"
,
gameConf
.
window_width
);
fprintf
(
fp
,
"window_height = %d
\n
"
,
gameConf
.
window_height
);
...
...
@@ -1348,7 +1355,7 @@ void Game::ErrorLog(const char* msg) {
if
(
!
fp
)
return
;
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H:%M:%S"
,
localedtime
);
fprintf
(
fp
,
"[%s]%s
\n
"
,
timebuf
,
msg
);
...
...
gframe/game.h
View file @
a32b127d
...
...
@@ -43,6 +43,7 @@ struct Config {
int
defaultOT
;
int
enable_bot_mode
;
int
quick_animation
;
int
auto_save_replay
;
bool
enable_sound
;
bool
enable_music
;
double
sound_volume
;
...
...
@@ -270,6 +271,7 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkAutoChain
;
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSaveReplay
;
irr
::
gui
::
IGUIWindow
*
tabSystem
;
irr
::
gui
::
IGUIElement
*
elmTabSystemLast
;
irr
::
gui
::
IGUIScrollBar
*
scrTabSystem
;
...
...
gframe/menu_handler.cpp
View file @
a32b127d
...
...
@@ -439,7 +439,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
std
::
wstring
repinfo
;
time_t
curtime
=
ReplayMode
::
cur_replay
.
pheader
.
seed
;
tm
*
st
=
localtime
(
&
curtime
);
myswprintf
(
infobuf
,
L"%d/%d/%d %02d:%02d:%02d
\n
"
,
st
->
tm_year
+
1900
,
st
->
tm_mon
+
1
,
st
->
tm_mday
,
st
->
tm_hour
,
st
->
tm_min
,
st
->
tm_sec
);
wcsftime
(
infobuf
,
256
,
L"%Y/%m/%d %H:%M:%S
\n
"
,
st
);
repinfo
.
append
(
infobuf
);
wchar_t
namebuf
[
4
][
20
];
ReplayMode
::
cur_replay
.
ReadName
(
namebuf
[
0
]);
...
...
@@ -454,7 +454,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
myswprintf
(
infobuf
,
L"%ls
\n
===VS===
\n
%ls
\n
"
,
namebuf
[
0
],
namebuf
[
1
]);
repinfo
.
append
(
infobuf
);
mainGame
->
ebRepStartTurn
->
setText
(
L"1"
);
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
(
wchar_t
*
)
repinfo
.
c_str
());
mainGame
->
SetStaticText
(
mainGame
->
stReplayInfo
,
180
,
mainGame
->
guiFont
,
repinfo
.
c_str
());
break
;
}
case
LISTBOX_BOT_LIST
:
{
...
...
gframe/single_mode.cpp
View file @
a32b127d
...
...
@@ -128,18 +128,25 @@ int SingleMode::SinglePlayThread(void* param) {
}
last_replay
.
EndRecord
();
time_t
nowtime
=
time
(
NULL
);
struct
tm
*
localedtime
=
localtime
(
&
nowtime
);
char
timebuf
[
40
];
strftime
(
timebuf
,
40
,
"%Y-%m-%d %H-%M-%S"
,
localedtime
);
size_t
size
=
strlen
(
timebuf
)
+
1
;
wchar_t
timetext
[
80
];
mbstowcs
(
timetext
,
timebuf
,
size
);
tm
*
localedtime
=
localtime
(
&
nowtime
);
wchar_t
timetext
[
40
];
wcsftime
(
timetext
,
40
,
L"%Y-%m-%d %H-%M-%S"
,
localedtime
);
mainGame
->
ebRSName
->
setText
(
timetext
);
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
if
(
!
mainGame
->
chkAutoSaveReplay
->
isChecked
())
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
}
else
{
mainGame
->
actionParam
=
1
;
wchar_t
msgbuf
[
256
];
myswprintf
(
msgbuf
,
dataManager
.
GetSysString
(
1367
),
timetext
);
mainGame
->
SetStaticText
(
mainGame
->
stACMessage
,
310
,
mainGame
->
guiFont
,
msgbuf
);
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
WaitFrameSignal
(
30
);
}
if
(
mainGame
->
actionParam
)
last_replay
.
SaveReplay
(
mainGame
->
ebRSName
->
getText
());
end_duel
(
pduel
);
...
...
strings.conf
View file @
a32b127d
...
...
@@ -391,6 +391,8 @@
!
system
1363
是否删除这个录像?
!
system
1364
重命名录像
!
system
1365
重命名失败,可能存在同名文件
!
system
1366
自动保存录像
!
system
1367
录像已自动保存为%
ls
.
yrp
!
system
1370
星数↑
!
system
1371
攻击↑
!
system
1372
守备↑
...
...
@@ -928,3 +930,4 @@
!
setname
0
x121
魔妖
!
setname
0
x122
女武神
Valkyrie
!
setname
0
x123
蔷薇龙 ローズ・ドラゴン
!
setname
0
x124
机械天使 機械天使
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