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
1
Merge Requests
1
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
b0bf19e4
Commit
b0bf19e4
authored
Apr 10, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4d3563de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
gframe/event_handler.cpp
gframe/event_handler.cpp
+0
-4
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+17
-11
gframe/sound_manager.h
gframe/sound_manager.h
+2
-2
No files found.
gframe/event_handler.cpp
View file @
b0bf19e4
...
@@ -1898,14 +1898,12 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1898,14 +1898,12 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
return
true
;
break
;
break
;
}
}
#ifdef YGOPRO_USE_AUDIO
case
CHECKBOX_ENABLE_MUSIC
:
{
case
CHECKBOX_ENABLE_MUSIC
:
{
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
())
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
())
soundManager
.
StopBGM
();
soundManager
.
StopBGM
();
return
true
;
return
true
;
break
;
break
;
}
}
#endif
case
CHECKBOX_DISABLE_CHAT
:
{
case
CHECKBOX_DISABLE_CHAT
:
{
bool
show
=
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
bool
show
=
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
?
false
:
!
mainGame
->
chkIgnore1
->
isChecked
();
mainGame
->
wChat
->
setVisible
(
show
);
mainGame
->
wChat
->
setVisible
(
show
);
...
@@ -1998,7 +1996,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1998,7 +1996,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
return
true
;
break
;
break
;
}
}
#ifdef YGOPRO_USE_AUDIO
case
SCROLL_VOLUME
:
{
case
SCROLL_VOLUME
:
{
mainGame
->
gameConf
.
sound_volume
=
(
double
)
mainGame
->
scrSoundVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
sound_volume
=
(
double
)
mainGame
->
scrSoundVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
music_volume
=
(
double
)
mainGame
->
scrMusicVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
music_volume
=
(
double
)
mainGame
->
scrMusicVolume
->
getPos
()
/
100
;
...
@@ -2007,7 +2004,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -2007,7 +2004,6 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
return
true
;
break
;
break
;
}
}
#endif
case
SCROLL_TAB_HELPER
:
{
case
SCROLL_TAB_HELPER
:
{
irr
::
core
::
rect
<
irr
::
s32
>
pos
=
mainGame
->
tabHelper
->
getRelativePosition
();
irr
::
core
::
rect
<
irr
::
s32
>
pos
=
mainGame
->
tabHelper
->
getRelativePosition
();
mainGame
->
tabHelper
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabHelper
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
mainGame
->
tabHelper
->
setRelativePosition
(
irr
::
core
::
recti
(
0
,
mainGame
->
scrTabHelper
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
...
...
gframe/sound_manager.cpp
View file @
b0bf19e4
...
@@ -227,6 +227,7 @@ void SoundManager::PlaySoundEffect(int sound) {
...
@@ -227,6 +227,7 @@ void SoundManager::PlaySoundEffect(int sound) {
#endif // YGOPRO_USE_AUDIO
#endif // YGOPRO_USE_AUDIO
}
}
void
SoundManager
::
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
)
{
void
SoundManager
::
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
)
{
#ifdef YGOPRO_USE_AUDIO
if
(
element
==
mainGame
->
wMessage
)
{
if
(
element
==
mainGame
->
wMessage
)
{
PlaySoundEffect
(
SOUND_INFO
);
PlaySoundEffect
(
SOUND_INFO
);
}
else
if
(
element
==
mainGame
->
wQuery
)
{
}
else
if
(
element
==
mainGame
->
wQuery
)
{
...
@@ -248,15 +249,24 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
...
@@ -248,15 +249,24 @@ void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
}
else
if
(
element
==
mainGame
->
wFTSelect
)
{
}
else
if
(
element
==
mainGame
->
wFTSelect
)
{
PlaySoundEffect
(
SOUND_QUESTION
);
PlaySoundEffect
(
SOUND_QUESTION
);
}
}
#endif // YGOPRO_USE_AUDIO
}
}
bool
SoundManager
::
Is
CurrentlyPlaying
(
wchar_t
*
music
)
{
bool
SoundManager
::
Is
PlayingMusic
(
wchar_t
*
music
)
{
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
return
currentPlayingMusic
[
0
]
&&
!
mywcsncasecmp
(
currentPlayingMusic
,
music
,
1024
)
&&
ma_sound_is_playing
(
&
soundBGM
);
if
(
music
)
{
return
!
mywcsncasecmp
(
currentPlayingMusic
,
music
,
1024
)
&&
ma_sound_is_playing
(
&
soundBGM
);
}
else
{
return
ma_sound_is_playing
(
&
soundBGM
);
}
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
char
cmusic
[
1024
];
if
(
music
)
{
BufferIO
::
EncodeUTF8
(
music
,
cmusic
);
char
cmusic
[
1024
];
return
engineMusic
->
isCurrentlyPlaying
(
cmusic
);
BufferIO
::
EncodeUTF8
(
music
,
cmusic
);
return
engineMusic
->
isCurrentlyPlaying
(
cmusic
);
}
else
{
return
soundBGM
&&
!
soundBGM
->
isFinished
();
}
#endif
#endif
return
false
;
return
false
;
}
}
...
@@ -264,7 +274,7 @@ void SoundManager::PlayMusic(wchar_t* music, bool loop) {
...
@@ -264,7 +274,7 @@ void SoundManager::PlayMusic(wchar_t* music, bool loop) {
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
())
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
())
return
;
return
;
if
(
!
Is
CurrentlyPlaying
(
music
))
{
if
(
!
Is
PlayingMusic
(
music
))
{
StopBGM
();
StopBGM
();
SetMusicVolume
(
mainGame
->
gameConf
.
music_volume
);
SetMusicVolume
(
mainGame
->
gameConf
.
music_volume
);
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
...
@@ -287,11 +297,7 @@ void SoundManager::PlayBGM(int scene) {
...
@@ -287,11 +297,7 @@ void SoundManager::PlayBGM(int scene) {
return
;
return
;
if
(
!
mainGame
->
chkMusicMode
->
isChecked
())
if
(
!
mainGame
->
chkMusicMode
->
isChecked
())
scene
=
BGM_ALL
;
scene
=
BGM_ALL
;
#if defined(YGOPRO_USE_MINIAUDIO)
if
(
scene
!=
bgm_scene
||
!
IsPlayingMusic
())
{
if
(
scene
!=
bgm_scene
||
!
IsCurrentlyPlaying
(
currentPlayingMusic
))
{
#elif defined(YGOPRO_USE_IRRKLANG)
if
(
scene
!=
bgm_scene
||
(
soundBGM
&&
soundBGM
->
isFinished
()))
{
#endif
int
count
=
BGMList
[
scene
].
size
();
int
count
=
BGMList
[
scene
].
size
();
if
(
count
<=
0
)
if
(
count
<=
0
)
return
;
return
;
...
...
gframe/sound_manager.h
View file @
b0bf19e4
...
@@ -15,7 +15,7 @@ namespace ygo {
...
@@ -15,7 +15,7 @@ namespace ygo {
class
SoundManager
{
class
SoundManager
{
private:
private:
std
::
vector
<
std
::
wstring
>
BGMList
[
8
];
std
::
vector
<
std
::
wstring
>
BGMList
[
8
];
int
bgm_scene
;
int
bgm_scene
{}
;
mt19937
rnd
;
mt19937
rnd
;
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_config
engineConfig
;
ma_engine_config
engineConfig
;
...
@@ -40,7 +40,7 @@ public:
...
@@ -40,7 +40,7 @@ public:
void
RefreshBGMList
();
void
RefreshBGMList
();
void
PlaySoundEffect
(
int
sound
);
void
PlaySoundEffect
(
int
sound
);
void
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
);
void
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
);
bool
Is
CurrentlyPlaying
(
wchar_t
*
music
);
bool
Is
PlayingMusic
(
wchar_t
*
music
=
0
);
void
PlayMusic
(
wchar_t
*
music
,
bool
loop
);
void
PlayMusic
(
wchar_t
*
music
,
bool
loop
);
void
PlayBGM
(
int
scene
);
void
PlayBGM
(
int
scene
);
void
StopBGM
();
void
StopBGM
();
...
...
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