Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
359b4cb5
Commit
359b4cb5
authored
Jun 26, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加按钮方法
parent
1953b551
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+5
-0
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+23
-0
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+2
-2
No files found.
Classes/gframe/deck_con.cpp
View file @
359b4cb5
...
@@ -311,6 +311,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -311,6 +311,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
Terminate
();
Terminate
();
break
;
break
;
}
}
case
BUTTON_SETTINGS
:
{
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
BUTTON
);
mainGame
->
ShowElement
(
mainGame
->
wSettings
);
break
;
}
case
BUTTON_EFFECT_FILTER
:
{
case
BUTTON_EFFECT_FILTER
:
{
mainGame
->
PopupElement
(
mainGame
->
wCategories
);
mainGame
->
PopupElement
(
mainGame
->
wCategories
);
break
;
break
;
...
...
Classes/gframe/event_handler.cpp
View file @
359b4cb5
...
@@ -167,6 +167,29 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -167,6 +167,29 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
ShowElement
(
mainGame
->
wSettings
);
mainGame
->
ShowElement
(
mainGame
->
wSettings
);
break
;
break
;
}
}
case
BUTTON_BGM
:
{
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
BUTTON
);
if
(
mainGame
->
gameConf
.
enable_music
)
{
mainGame
->
gameConf
.
enable_music
=
false
;
mainGame
->
soundManager
->
StopBGM
();
mainGame
->
imgVol
->
setImage
(
imageManager
.
tMute
);
}
else
{
mainGame
->
gameConf
.
enable_music
=
true
;
if
(
mainGame
->
dInfo
.
isFinished
&&
mainGame
->
showcardcode
==
1
)
{
mainGame
->
soundManager
->
PlayBGM
(
SoundManager
::
BGM
::
WIN
);
}
else
if
(
mainGame
->
dInfo
.
isFinished
&&
(
mainGame
->
showcardcode
==
2
||
mainGame
->
showcardcode
==
3
))
{
mainGame
->
soundManager
->
PlayBGM
(
SoundManager
::
BGM
::
LOSE
);
}
else
if
(
mainGame
->
dInfo
.
lp
[
0
]
>
0
&&
mainGame
->
dInfo
.
lp
[
0
]
<=
mainGame
->
dInfo
.
lp
[
1
]
/
2
)
{
mainGame
->
soundManager
->
PlayBGM
(
SoundManager
::
BGM
::
DISADVANTAGE
);
}
else
if
(
mainGame
->
dInfo
.
lp
[
0
]
>
0
&&
mainGame
->
dInfo
.
lp
[
0
]
>=
mainGame
->
dInfo
.
lp
[
1
]
*
2
)
{
mainGame
->
soundManager
->
PlayBGM
(
SoundManager
::
BGM
::
ADVANTAGE
);
}
else
{
mainGame
->
soundManager
->
PlayBGM
(
SoundManager
::
BGM
::
DUEL
);
}
}
mainGame
->
imgVol
->
setImage
(
imageManager
.
tPlay
);
break
;
}
case
BUTTON_CHAIN_IGNORE
:
{
case
BUTTON_CHAIN_IGNORE
:
{
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
BUTTON
);
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
BUTTON
);
mainGame
->
ignore_chain
=
mainGame
->
btnChainIgnore
->
isPressed
();
mainGame
->
ignore_chain
=
mainGame
->
btnChainIgnore
->
isPressed
();
...
...
Classes/gframe/game.cpp
View file @
359b4cb5
...
@@ -396,11 +396,11 @@ bool Game::Initialize() {
...
@@ -396,11 +396,11 @@ bool Game::Initialize() {
wPallet
->
setDrawBackground
(
false
);
wPallet
->
setDrawBackground
(
false
);
wPallet
->
setVisible
(
false
);
wPallet
->
setVisible
(
false
);
//Logs
//Logs
imgLog
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
0
*
yScale
,
65
*
yScale
,
45
*
yScale
,
11
0
*
yScale
),
wPallet
,
BUTTON_SHOW_LOG
);
imgLog
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
0
*
yScale
,
55
*
yScale
,
45
*
yScale
,
10
0
*
yScale
),
wPallet
,
BUTTON_SHOW_LOG
);
imgLog
->
setImage
(
imageManager
.
tLogs
);
imgLog
->
setImage
(
imageManager
.
tLogs
);
imgLog
->
setImageSize
(
core
::
dimension2di
(
yScale
,
yScale
));
imgLog
->
setImageSize
(
core
::
dimension2di
(
yScale
,
yScale
));
//vol play/mute
//vol play/mute
imgVol
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
0
*
yScale
,
319
*
yScale
,
45
*
yScale
,
364
*
yScale
),
wPallet
,
BUTTON_BGM
);
imgVol
=
irr
::
gui
::
CGUIImageButton
::
addImageButton
(
env
,
rect
<
s32
>
(
0
*
yScale
,
110
*
yScale
,
45
*
yScale
,
155
*
yScale
),
wPallet
,
BUTTON_BGM
);
if
(
gameConf
.
enable_music
)
{
if
(
gameConf
.
enable_music
)
{
imgVol
->
setImage
(
imageManager
.
tPlay
);
imgVol
->
setImage
(
imageManager
.
tPlay
);
}
else
{
}
else
{
...
...
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