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
697a6f7a
Commit
697a6f7a
authored
May 24, 2020
by
mercury233
Committed by
GitHub
May 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update & fix hiding elements (#2295)
parent
a4ee4586
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
52 deletions
+35
-52
gframe/drawing.cpp
gframe/drawing.cpp
+2
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+9
-30
gframe/event_handler.cpp
gframe/event_handler.cpp
+2
-9
gframe/game.cpp
gframe/game.cpp
+18
-10
gframe/game.h
gframe/game.h
+3
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-2
No files found.
gframe/drawing.cpp
View file @
697a6f7a
...
...
@@ -992,6 +992,8 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
fadingList
.
push_back
(
fu
);
}
void
Game
::
HideElement
(
irr
::
gui
::
IGUIElement
*
win
,
bool
set_action
)
{
if
(
!
win
->
isVisible
()
&&
!
set_action
)
return
;
FadingUnit
fu
;
fu
.
fadingSize
=
win
->
getRelativePosition
();
for
(
auto
fit
=
fadingList
.
begin
();
fit
!=
fadingList
.
end
();
++
fit
)
...
...
gframe/duelclient.cpp
View file @
697a6f7a
...
...
@@ -369,24 +369,17 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
dField
.
Clear
();
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
true
;
mainGame
->
CloseGameWindow
();
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
stTip
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSideOK
->
setVisible
(
true
);
mainGame
->
btnSideShuffle
->
setVisible
(
true
);
mainGame
->
btnSideSort
->
setVisible
(
true
);
mainGame
->
btnSideReload
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
...
...
@@ -486,12 +479,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
SetStaticText
(
mainGame
->
stHostPrepRule
,
180
,
mainGame
->
guiFont
,
str
.
c_str
());
mainGame
->
RefreshDeck
(
mainGame
->
cbDeckSelect
);
mainGame
->
cbDeckSelect
->
setEnabled
(
true
);
if
(
mainGame
->
wCreateHost
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
else
if
(
mainGame
->
wLanWindow
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
else
if
(
mainGame
->
wSinglePlay
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
HideElement
(
mainGame
->
wCreateHost
);
mainGame
->
HideElement
(
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wSinglePlay
);
mainGame
->
ShowElement
(
mainGame
->
wHostPrepare
);
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
...
...
@@ -649,12 +639,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
gMutex
.
lock
();
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
wSurrender
->
setVisible
(
false
);
mainGame
->
CloseGameButtons
();
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
...
...
@@ -688,14 +673,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
case
STOC_REPLAY
:
{
mainGame
->
gMutex
.
lock
();
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wSurrender
->
setVisible
(
false
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnChainIgnore
->
setVisible
(
false
);
mainGame
->
btnChainAlways
->
setVisible
(
false
);
mainGame
->
btnChainWhenAvail
->
setVisible
(
false
);
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
mainGame
->
btnShuffle
->
setVisible
(
false
);
mainGame
->
CloseGameButtons
();
char
*
prep
=
pdata
;
Replay
new_replay
;
memcpy
(
&
new_replay
.
pheader
,
prep
,
sizeof
(
ReplayHeader
));
...
...
@@ -2390,8 +2370,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
mainGame
->
btnLeaveGame
->
setVisible
(
true
);
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
mainGame
->
btnChainIgnore
->
setVisible
(
true
);
...
...
gframe/event_handler.cpp
View file @
697a6f7a
...
...
@@ -129,13 +129,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
wCardImg
->
setVisible
(
false
);
mainGame
->
wInfos
->
setVisible
(
false
);
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
mainGame
->
btnSpectatorSwap
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
false
);
mainGame
->
CloseDuelWindow
();
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
...
...
@@ -1459,8 +1453,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
if
(
mainGame
->
wSurrender
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
mainGame
->
fadingList
.
size
())
break
;
...
...
gframe/game.cpp
View file @
697a6f7a
...
...
@@ -1478,7 +1478,17 @@ void Game::ClearTextures() {
}
imageManager
.
ClearTexture
();
}
void
Game
::
CloseDuelWindow
()
{
void
Game
::
CloseGameButtons
()
{
btnChainIgnore
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnCancelOrFinish
->
setVisible
(
false
);
btnSpectatorSwap
->
setVisible
(
false
);
btnShuffle
->
setVisible
(
false
);
wSurrender
->
setVisible
(
false
);
}
void
Game
::
CloseGameWindow
()
{
CloseGameButtons
();
for
(
auto
wit
=
fadingList
.
begin
();
wit
!=
fadingList
.
end
();
++
wit
)
{
if
(
wit
->
isFadein
)
wit
->
autoFadeoutFrame
=
1
;
...
...
@@ -1488,34 +1498,32 @@ void Game::CloseDuelWindow() {
wANCard
->
setVisible
(
false
);
wANNumber
->
setVisible
(
false
);
wANRace
->
setVisible
(
false
);
wCardImg
->
setVisible
(
false
);
wCardSelect
->
setVisible
(
false
);
wCardDisplay
->
setVisible
(
false
);
wCmdMenu
->
setVisible
(
false
);
wFTSelect
->
setVisible
(
false
);
wHand
->
setVisible
(
false
);
wInfos
->
setVisible
(
false
);
wMessage
->
setVisible
(
false
);
wOptions
->
setVisible
(
false
);
wPhase
->
setVisible
(
false
);
wPosSelect
->
setVisible
(
false
);
wQuery
->
setVisible
(
false
);
wSurrender
->
setVisible
(
false
);
wReplayControl
->
setVisible
(
false
);
wReplaySave
->
setVisible
(
false
);
stHintMsg
->
setVisible
(
false
);
stTip
->
setVisible
(
false
);
}
void
Game
::
CloseDuelWindow
()
{
CloseGameWindow
();
wCardImg
->
setVisible
(
false
);
wInfos
->
setVisible
(
false
);
wChat
->
setVisible
(
false
);
btnSideOK
->
setVisible
(
false
);
btnSideShuffle
->
setVisible
(
false
);
btnSideSort
->
setVisible
(
false
);
btnSideReload
->
setVisible
(
false
);
btnLeaveGame
->
setVisible
(
false
);
btnSpectatorSwap
->
setVisible
(
false
);
btnChainIgnore
->
setVisible
(
false
);
btnChainAlways
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnCancelOrFinish
->
setVisible
(
false
);
btnShuffle
->
setVisible
(
false
);
wChat
->
setVisible
(
false
);
lstLog
->
clear
();
logParam
.
clear
();
lstHostList
->
clear
();
...
...
gframe/game.h
View file @
697a6f7a
...
...
@@ -148,7 +148,9 @@ public:
void
ClearChatMsg
();
void
AddDebugMsg
(
const
char
*
msgbuf
);
void
ErrorLog
(
const
char
*
msgbuf
);
void
ClearTextures
();
void
ClearTextures
();
void
CloseGameButtons
();
void
CloseGameWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
...
...
gframe/replay_mode.cpp
View file @
697a6f7a
...
...
@@ -230,8 +230,7 @@ void ReplayMode::EndDuel() {
mainGame
->
actionSignal
.
Reset
();
mainGame
->
gMutex
.
lock
();
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1501
));
if
(
mainGame
->
wCardSelect
->
isVisible
())
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
mainGame
->
HideElement
(
mainGame
->
wCardSelect
);
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
actionSignal
.
Wait
();
...
...
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