Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
1a960e99
Commit
1a960e99
authored
Jul 03, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
53b0d09d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
57 deletions
+60
-57
gframe/event_handler.cpp
gframe/event_handler.cpp
+4
-4
gframe/game.cpp
gframe/game.cpp
+42
-38
gframe/game.h
gframe/game.h
+11
-10
system.conf
system.conf
+3
-5
No files found.
gframe/event_handler.cpp
View file @
1a960e99
...
@@ -2012,10 +2012,10 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -2012,10 +2012,10 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
SCROLL_VOLUME
:
{
case
SCROLL_VOLUME
:
{
mainGame
->
gameConf
.
sound
volume
=
(
double
)
mainGame
->
src
SoundVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
sound
_volume
=
(
double
)
mainGame
->
scr
SoundVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
music
volume
=
(
double
)
mainGame
->
src
MusicVolume
->
getPos
()
/
100
;
mainGame
->
gameConf
.
music
_volume
=
(
double
)
mainGame
->
scr
MusicVolume
->
getPos
()
/
100
;
mainGame
->
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
soundvolume
);
mainGame
->
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound
_
volume
);
mainGame
->
engineMusic
->
setSoundVolume
(
mainGame
->
gameConf
.
musicvolume
);
mainGame
->
engineMusic
->
setSoundVolume
(
mainGame
->
gameConf
.
music
_
volume
);
break
;
break
;
}
}
}
}
...
...
gframe/game.cpp
View file @
1a960e99
...
@@ -272,26 +272,29 @@ bool Game::Initialize() {
...
@@ -272,26 +272,29 @@ bool Game::Initialize() {
chkIgnoreDeckChanges
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1357
));
chkIgnoreDeckChanges
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1357
));
chkIgnoreDeckChanges
->
setChecked
(
gameConf
.
chkIgnoreDeckChanges
!=
0
);
chkIgnoreDeckChanges
->
setChecked
(
gameConf
.
chkIgnoreDeckChanges
!=
0
);
posY
+=
30
;
posY
+=
30
;
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
2
25
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
2
60
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
posY
+=
30
;
posY
+=
30
;
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enablesound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1380
));
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable
_
sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1380
));
chkEnableSound
->
setChecked
(
gameConf
.
enablesound
);
chkEnableSound
->
setChecked
(
gameConf
.
enable
_
sound
);
s
rc
SoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
s
cr
SoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
s
rc
SoundVolume
->
setMax
(
100
);
s
cr
SoundVolume
->
setMax
(
100
);
s
rc
SoundVolume
->
setMin
(
0
);
s
cr
SoundVolume
->
setMin
(
0
);
s
rcSoundVolume
->
setPos
(
gameConf
.
sound
volume
*
100
);
s
crSoundVolume
->
setPos
(
gameConf
.
sound_
volume
*
100
);
s
rc
SoundVolume
->
setLargeStep
(
1
);
s
cr
SoundVolume
->
setLargeStep
(
1
);
s
rc
SoundVolume
->
setSmallStep
(
1
);
s
cr
SoundVolume
->
setSmallStep
(
1
);
posY
+=
30
;
posY
+=
30
;
chkEnableMusic
=
env
->
addCheckBox
(
gameConf
.
enablemusic
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
CHECKBOX_ENABLE_MUSIC
,
dataManager
.
GetSysString
(
1381
));
chkEnableMusic
=
env
->
addCheckBox
(
gameConf
.
enable_music
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
CHECKBOX_ENABLE_MUSIC
,
dataManager
.
GetSysString
(
1381
));
chkEnableMusic
->
setChecked
(
gameConf
.
enablemusic
);
chkEnableMusic
->
setChecked
(
gameConf
.
enable_music
);
srcMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
srcMusicVolume
->
setMax
(
100
);
scrMusicVolume
->
setMax
(
100
);
srcMusicVolume
->
setMin
(
0
);
scrMusicVolume
->
setMin
(
0
);
srcMusicVolume
->
setPos
(
gameConf
.
musicvolume
*
100
);
scrMusicVolume
->
setPos
(
gameConf
.
music_volume
*
100
);
srcMusicVolume
->
setLargeStep
(
1
);
scrMusicVolume
->
setLargeStep
(
1
);
srcMusicVolume
->
setSmallStep
(
1
);
scrMusicVolume
->
setSmallStep
(
1
);
posY
+=
30
;
chkMusicMode
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1382
));
chkMusicMode
->
setChecked
(
gameConf
.
music_mode
!=
0
);
//
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
...
@@ -992,11 +995,11 @@ void Game::LoadConfig() {
...
@@ -992,11 +995,11 @@ void Game::LoadConfig() {
gameConf
.
separate_clear_button
=
1
;
gameConf
.
separate_clear_button
=
1
;
gameConf
.
auto_search_limit
=
-
1
;
gameConf
.
auto_search_limit
=
-
1
;
gameConf
.
chkIgnoreDeckChanges
=
0
;
gameConf
.
chkIgnoreDeckChanges
=
0
;
gameConf
.
enablesound
=
true
;
gameConf
.
enable
_
sound
=
true
;
gameConf
.
soundvolume
=
0.5
;
gameConf
.
sound
_
volume
=
0.5
;
gameConf
.
enablemusic
=
true
;
gameConf
.
enable
_
music
=
true
;
gameConf
.
musicvolume
=
0.5
;
gameConf
.
music
_
volume
=
0.5
;
gameConf
.
BGM_index
=
-
1
;
gameConf
.
music_mode
=
1
;
fseek
(
fp
,
0
,
SEEK_END
);
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
fseek
(
fp
,
0
,
SEEK_SET
);
...
@@ -1058,13 +1061,15 @@ void Game::LoadConfig() {
...
@@ -1058,13 +1061,15 @@ void Game::LoadConfig() {
}
else
if
(
!
strcmp
(
strbuf
,
"ignore_deck_changes"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"ignore_deck_changes"
))
{
gameConf
.
chkIgnoreDeckChanges
=
atoi
(
valbuf
);
gameConf
.
chkIgnoreDeckChanges
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
gameConf
.
enablesound
=
atoi
(
valbuf
)
>
0
;
gameConf
.
enable
_
sound
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"soundvolume"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"sound
_
volume"
))
{
gameConf
.
soundvolume
=
atof
(
valbuf
)
/
100
;
gameConf
.
sound
_
volume
=
atof
(
valbuf
)
/
100
;
}
else
if
(
!
strcmp
(
strbuf
,
"enable_music"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"enable_music"
))
{
gameConf
.
enablemusic
=
atoi
(
valbuf
)
>
0
;
gameConf
.
enable_music
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"musicvolume"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"music_volume"
))
{
gameConf
.
musicvolume
=
atof
(
valbuf
)
/
100
;
gameConf
.
music_volume
=
atof
(
valbuf
)
/
100
;
}
else
if
(
!
strcmp
(
strbuf
,
"music_mode"
))
{
gameConf
.
music_mode
=
atoi
(
valbuf
);
}
else
{
}
else
{
// options allowing multiple words
// options allowing multiple words
sscanf
(
linebuf
,
"%s = %240[^
\n
]"
,
strbuf
,
valbuf
);
sscanf
(
linebuf
,
"%s = %240[^
\n
]"
,
strbuf
,
valbuf
);
...
@@ -1125,20 +1130,19 @@ void Game::SaveConfig() {
...
@@ -1125,20 +1130,19 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"enable_sound = %d
\n
"
,
((
mainGame
->
chkEnableSound
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"enable_sound = %d
\n
"
,
((
mainGame
->
chkEnableSound
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"enable_music = %d
\n
"
,
((
mainGame
->
chkEnableMusic
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"enable_music = %d
\n
"
,
((
mainGame
->
chkEnableMusic
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"#Volume of sound and music, between 0 and 100
\n
"
);
fprintf
(
fp
,
"#Volume of sound and music, between 0 and 100
\n
"
);
int
vol
=
gameConf
.
soundvolume
*
100
;
int
vol
=
gameConf
.
sound
_
volume
*
100
;
if
(
vol
<
0
)
vol
=
0
;
else
if
(
vol
>
100
)
vol
=
100
;
if
(
vol
<
0
)
vol
=
0
;
else
if
(
vol
>
100
)
vol
=
100
;
fprintf
(
fp
,
"soundvolume = %d
\n
"
,
vol
);
fprintf
(
fp
,
"sound
_
volume = %d
\n
"
,
vol
);
vol
=
gameConf
.
musicvolume
*
100
;
vol
=
gameConf
.
music
_
volume
*
100
;
if
(
vol
<
0
)
vol
=
0
;
else
if
(
vol
>
100
)
vol
=
100
;
if
(
vol
<
0
)
vol
=
0
;
else
if
(
vol
>
100
)
vol
=
100
;
fprintf
(
fp
,
"musicvolume = %d
\n
"
,
vol
);
fprintf
(
fp
,
"music_volume = %d
\n
"
,
vol
);
fprintf
(
fp
,
"#playing the music corresponding to the sequence(start from 0) under folder /BGM
\n
#-1 means playing one of them randomly
\n
"
);
fprintf
(
fp
,
"music_mode = %d
\n
"
,
((
mainGame
->
chkMusicMode
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"BGM_index = %d
\n
"
,
gameConf
.
BGM_index
);
fclose
(
fp
);
fclose
(
fp
);
}
}
void
Game
::
PlaySoundEffect
(
char
*
sound
)
{
void
Game
::
PlaySoundEffect
(
char
*
sound
)
{
if
(
mainGame
->
chkEnableSound
->
isChecked
())
{
if
(
mainGame
->
chkEnableSound
->
isChecked
())
{
engineSound
->
play2D
(
sound
);
engineSound
->
play2D
(
sound
);
engineSound
->
setSoundVolume
(
gameConf
.
soundvolume
);
engineSound
->
setSoundVolume
(
gameConf
.
sound
_
volume
);
}
}
}
}
void
Game
::
PlayMusic
(
char
*
song
,
bool
loop
)
{
void
Game
::
PlayMusic
(
char
*
song
,
bool
loop
)
{
...
@@ -1146,7 +1150,7 @@ void Game::PlayMusic(char* song, bool loop) {
...
@@ -1146,7 +1150,7 @@ void Game::PlayMusic(char* song, bool loop) {
if
(
!
engineMusic
->
isCurrentlyPlaying
(
song
))
{
if
(
!
engineMusic
->
isCurrentlyPlaying
(
song
))
{
engineMusic
->
stopAllSounds
();
engineMusic
->
stopAllSounds
();
engineMusic
->
play2D
(
song
,
loop
);
engineMusic
->
play2D
(
song
,
loop
);
engineMusic
->
setSoundVolume
(
gameConf
.
musicvolume
);
engineMusic
->
setSoundVolume
(
gameConf
.
music
_
volume
);
}
}
}
}
}
}
...
@@ -1160,7 +1164,7 @@ void Game::PlayBGM() {
...
@@ -1160,7 +1164,7 @@ void Game::PlayBGM() {
int
count
=
BGMList
.
size
();
int
count
=
BGMList
.
size
();
if
(
count
<=
0
)
if
(
count
<=
0
)
return
;
return
;
int
bgm
=
(
gameConf
.
BGM_index
>=
0
)
?
gameConf
.
BGM_index
:
rand
()
%
count
;
int
bgm
=
(
gameConf
.
music_mode
>=
0
)
?
0
:
rand
()
%
count
;
auto
name
=
BGMList
[
bgm
].
c_str
();
auto
name
=
BGMList
[
bgm
].
c_str
();
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./sound/BGM/%ls"
,
name
);
myswprintf
(
fname
,
L"./sound/BGM/%ls"
,
name
);
...
@@ -1169,7 +1173,7 @@ void Game::PlayBGM() {
...
@@ -1169,7 +1173,7 @@ void Game::PlayBGM() {
if
(
!
engineMusic
->
isCurrentlyPlaying
(
strBuffer
))
{
if
(
!
engineMusic
->
isCurrentlyPlaying
(
strBuffer
))
{
engineMusic
->
stopAllSounds
();
engineMusic
->
stopAllSounds
();
engineMusic
->
play2D
(
strBuffer
,
true
);
engineMusic
->
play2D
(
strBuffer
,
true
);
engineMusic
->
setSoundVolume
(
gameConf
.
musicvolume
);
engineMusic
->
setSoundVolume
(
gameConf
.
music
_
volume
);
is_playing
=
true
;
is_playing
=
true
;
}
}
}
}
...
...
gframe/game.h
View file @
1a960e99
...
@@ -39,11 +39,11 @@ struct Config {
...
@@ -39,11 +39,11 @@ struct Config {
int
separate_clear_button
;
int
separate_clear_button
;
int
auto_search_limit
;
int
auto_search_limit
;
int
chkIgnoreDeckChanges
;
int
chkIgnoreDeckChanges
;
bool
enablesound
;
bool
enable
_
sound
;
bool
enablemusic
;
bool
enable
_
music
;
double
soundvolume
;
double
sound
_
volume
;
double
musicvolume
;
double
music
_
volume
;
int
BGM_index
;
int
music_mode
;
};
};
struct
DuelInfo
{
struct
DuelInfo
{
...
@@ -214,6 +214,9 @@ public:
...
@@ -214,6 +214,9 @@ public:
irr
::
gui
::
IGUIStaticText
*
stSetName
;
irr
::
gui
::
IGUIStaticText
*
stSetName
;
irr
::
gui
::
IGUIStaticText
*
stText
;
irr
::
gui
::
IGUIStaticText
*
stText
;
irr
::
gui
::
IGUIScrollBar
*
scrCardText
;
irr
::
gui
::
IGUIScrollBar
*
scrCardText
;
irr
::
gui
::
IGUIListBox
*
lstLog
;
irr
::
gui
::
IGUIButton
*
btnClearLog
;
irr
::
gui
::
IGUIButton
*
btnSaveLog
;
irr
::
gui
::
IGUICheckBox
*
chkMAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkMAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkSTAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkSTAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkRandomPos
;
irr
::
gui
::
IGUICheckBox
*
chkRandomPos
;
...
@@ -225,11 +228,9 @@ public:
...
@@ -225,11 +228,9 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkAutoSearch
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSearch
;
irr
::
gui
::
IGUICheckBox
*
chkEnableSound
;
irr
::
gui
::
IGUICheckBox
*
chkEnableSound
;
irr
::
gui
::
IGUICheckBox
*
chkEnableMusic
;
irr
::
gui
::
IGUICheckBox
*
chkEnableMusic
;
irr
::
gui
::
IGUIListBox
*
lstLog
;
irr
::
gui
::
IGUIScrollBar
*
scrSoundVolume
;
irr
::
gui
::
IGUIButton
*
btnClearLog
;
irr
::
gui
::
IGUIScrollBar
*
scrMusicVolume
;
irr
::
gui
::
IGUIButton
*
btnSaveLog
;
irr
::
gui
::
IGUICheckBox
*
chkMusicMode
;
irr
::
gui
::
IGUIScrollBar
*
srcSoundVolume
;
irr
::
gui
::
IGUIScrollBar
*
srcMusicVolume
;
//main menu
//main menu
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
...
...
system.conf
View file @
1a960e99
...
@@ -30,8 +30,6 @@ prompt_to_discard_deck_changes = 1
...
@@ -30,8 +30,6 @@ prompt_to_discard_deck_changes = 1
enable_sound
=
1
enable_sound
=
1
enable_music
=
1
enable_music
=
1
#Volume of sound and music, between 0 and 100
#Volume of sound and music, between 0 and 100
soundvolume
=
50
sound_volume
=
50
musicvolume
=
50
music_volume
=
50
#playing the music corresponding to the sequence(start from 0) under folder /BGM
music_mode
=
1
#-1 means playing one of them randomly
BGM_index
= -
1
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