Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
pluginsounddebug.c
Go to the documentation of this file.
1
class
PluginSoundDebug
extends
PluginBase
2
{
3
override
void
OnInit
()
4
{
5
m_TickTimer
=
new
Timer
();
6
m_TickTimer
.Run(0.1,
this
,
"OnGUITimer"
, NULL,
true
);
7
}
8
9
override
void
OnUpdate
(
float
delta_time)
10
{
11
;
12
}
13
14
override
void
OnDestroy
()
15
{
16
m_TickTimer
= NULL;
17
}
18
19
void
Show
()
20
{
21
m_TickTimer
=
new
Timer
();
22
m_TickTimer
.Run(0.1,
this
,
"OnGUITimer"
, NULL,
true
);
23
}
24
25
void
Hide
()
26
{
27
m_TickTimer
= NULL;
28
}
29
30
void
OnGUITimer
()
31
{
32
DbgUI
.
BeginCleanupScope
();
33
DbgUI
.
Begin
(
"Sound debug"
, 10, 10);
34
35
DbgUI
.
PushID_Str
(
"SoundParams"
);
36
DbgUI
.
Text
(
"SoundParams: "
);
37
DbgUI
.
SameLine
();
38
string
soundsetName =
"BearGrowl_SoundSet"
;
39
DbgUI
.
InputText
(
""
, soundsetName, 200);
40
DbgUI
.
PopID
();
41
42
DbgUI
.
PushID_Str
(
"Offset"
);
43
DbgUI
.
Text
(
"Offset pos: "
);
44
vector
posOffset =
"0 0 0"
;
45
float
posVal;
46
47
DbgUI
.
SameLine
();
48
DbgUI
.
PushID_Int
(1);
49
DbgUI
.
InputFloat
(
""
, posVal, 80);
50
DbgUI
.
PopID
();
51
posOffset[0] = posVal;
52
53
DbgUI
.
SameLine
();
54
DbgUI
.
PushID_Int
(2);
55
DbgUI
.
InputFloat
(
""
, posVal, 80);
56
DbgUI
.
PopID
();
57
posOffset[1] = posVal;
58
59
DbgUI
.
SameLine
();
60
DbgUI
.
PushID_Int
(3);
61
DbgUI
.
InputFloat
(
""
, posVal, 80);
62
DbgUI
.
PopID
();
63
posOffset[2] = posVal;
64
DbgUI
.
PopID
();
65
66
if
(
DbgUI
.
Button
(
"Create"
))
67
{
68
m_soundParams
=
new
SoundParams
(soundsetName);
69
m_soundBuilder
=
new
SoundObjectBuilder
(
m_soundParams
);
70
m_soundObject
=
m_soundBuilder
.BuildSoundObject();
71
m_soundObject
.SetPosition(
g_Game
.GetPlayer().GetPosition() + posOffset);
72
}
73
74
DbgUI
.
Text
(
"SoundObjectBuilder: "
);
75
76
DbgUI
.
Text
(
"SoundObject: "
);
77
78
DbgUI
.
Text
(
"AbstractWave: "
);
79
80
vector
posOffset2 =
"0 10 0"
;
81
82
if
(
m_soundParams
!= NULL)
83
{
84
DbgUI
.
Text
(
"FadeInFactor: "
);
85
DbgUI
.
SameLine
();
86
DbgUI
.
PushID_Str
(
"fadeIn"
);
87
DbgUI
.
InputFloat
(
""
,
fadeInVolume
, 80);
88
DbgUI
.
PopID
();
89
90
DbgUI
.
Text
(
"FadeOutFactor: "
);
91
DbgUI
.
SameLine
();
92
DbgUI
.
PushID_Str
(
"fadeOut"
);
93
DbgUI
.
InputFloat
(
""
,
fadeOutVolume
, 80);
94
DbgUI
.
PopID
();
95
96
DbgUI
.
PushID_Str
(
"Offset2"
);
97
DbgUI
.
Text
(
"Offset2 pos: "
);
98
float
posVal2;
99
100
DbgUI
.
SameLine
();
101
DbgUI
.
PushID_Int
(100);
102
posVal2 = posOffset2[0];
103
DbgUI
.
InputFloat
(
""
, posVal2, 80);
104
DbgUI
.
PopID
();
105
posOffset2[0] = posVal2;
106
107
DbgUI
.
SameLine
();
108
DbgUI
.
PushID_Int
(101);
109
posVal2 = posOffset2[1];
110
DbgUI
.
InputFloat
(
""
, posVal2, 80);
111
DbgUI
.
PopID
();
112
posOffset2[1] = posVal2;
113
114
DbgUI
.
SameLine
();
115
DbgUI
.
PushID_Int
(102);
116
posVal2 = posOffset2[2];
117
DbgUI
.
InputFloat
(
""
, posVal2, 80);
118
DbgUI
.
PopID
();
119
posOffset2[2] = posVal2;
120
DbgUI
.
PopID
();
121
122
DbgUI
.
Text
(
"skip: "
);
123
DbgUI
.
SameLine
();
124
float
skip = 0.0;
125
DbgUI
.
PushID_Int
(200);
126
DbgUI
.
InputFloat
(
""
, skip, 80);
127
DbgUI
.
PopID
();
128
129
if
(
DbgUI
.
Button
(
"Create and play"
))
130
{
131
m_wave
=
g_Game
.GetSoundScene().Play3D(
m_soundObject
,
m_soundBuilder
);
132
m_wave
.SetFadeInFactor(
fadeInVolume
);
133
m_wave
.Skip(skip);
134
m_wave
.SetPosition(
g_Game
.GetPlayer().GetPosition() + posOffset2);
135
}
136
}
137
138
if
(
m_wave
!= NULL)
139
{
140
DbgUI
.
Text
(
"Wave length: "
+
m_wave
.GetLength() +
"s"
);
141
142
//DbgUI.Text("Wave position: " + Math.Round(m_wave.GetCurrPosition() * 100) + "%");
143
DbgUI
.
Text
(
"Volume: "
);
144
DbgUI
.
SameLine
();
145
float
volume = 1.0;
146
DbgUI
.
InputFloat
(
" "
, volume, 80);
147
DbgUI
.
SameLine
();
148
if
(
DbgUI
.
Button
(
"SetVolume"
))
149
m_wave
.SetVolume(volume);
150
DbgUI
.
SameLine
();
151
if
(
DbgUI
.
Button
(
"SetVolumeRelative"
))
152
m_wave
.SetVolumeRelative(volume);
153
154
if
(
DbgUI
.
Button
(
"Play"
))
155
m_wave
.Play();
156
if
(
DbgUI
.
Button
(
"Stop"
))
157
m_wave
.Stop();
158
if
(
DbgUI
.
Button
(
"Restart"
))
159
m_wave
.Restart();
160
if
(
DbgUI
.
Button
(
"Repeat"
))
161
m_wave
.Loop(
true
);
162
if
(
DbgUI
.
Button
(
"StopRepeat"
))
163
m_wave
.Loop(
false
);
164
if
(
DbgUI
.
Button
(
"Set position"
))
165
m_wave
.SetPosition(
g_Game
.GetPlayer().GetPosition() + posOffset2);
166
}
167
168
DbgUI
.
End
();
169
DbgUI
.
EndCleanupScope
();
170
}
171
172
173
ref
Timer
m_TickTimer
;
174
175
ref
SoundParams
m_soundParams
;
176
ref
SoundObjectBuilder
m_soundBuilder
;
177
ref
SoundObject
m_soundObject
;
178
float
fadeInVolume
= 1.1;
179
float
fadeOutVolume
= 0.9;
180
AbstractWave
m_wave
;
181
}
DbgUI
Definition
dbgui.c:60
PluginBase
Class PluginMessageManager provides some basic Message Distribution mechanics, if you get instance of...
Definition
pluginbase.c:2
PluginBase::OnInit
override void OnInit()
Definition
pluginsounddebug.c:3
PluginBase::Hide
void Hide()
Definition
pluginsounddebug.c:25
PluginBase::m_TickTimer
ref Timer m_TickTimer
status refresh timer
Definition
plugindayzinfecteddebug.c:101
PluginBase::m_soundParams
ref SoundParams m_soundParams
Definition
pluginsounddebug.c:175
PluginBase::fadeInVolume
float fadeInVolume
Definition
pluginsounddebug.c:178
PluginBase::m_soundBuilder
ref SoundObjectBuilder m_soundBuilder
Definition
pluginsounddebug.c:176
PluginBase::OnDestroy
override void OnDestroy()
Definition
pluginsounddebug.c:14
PluginBase::m_wave
AbstractWave m_wave
Definition
pluginsounddebug.c:180
PluginBase::m_soundObject
ref SoundObject m_soundObject
Definition
pluginsounddebug.c:177
PluginBase::fadeOutVolume
float fadeOutVolume
Definition
pluginsounddebug.c:179
PluginBase::Show
void Show()
Definition
pluginsounddebug.c:19
PluginBase::OnUpdate
override void OnUpdate(float delta_time)
Definition
pluginsounddebug.c:9
PluginBase::OnGUITimer
void OnGUITimer()
Definition
pluginsounddebug.c:30
SoundObject
Definition
sound.c:112
Timer
Definition
dayzplayerimplement.c:39
vector
Definition
enconvert.c:119
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DbgUI::PushID_Int
static proto native void PushID_Int(int int_id)
DbgUI::Button
static proto native bool Button(string txt, int minWidth=0)
DbgUI::Begin
static proto native void Begin(string windowTitle, float x=0, float y=0)
DbgUI::BeginCleanupScope
static proto void BeginCleanupScope()
DbgUI::InputFloat
static proto void InputFloat(string txt, out float value, int pxWidth=150)
DbgUI::Text
static proto native void Text(string label)
DbgUI::PopID
static proto native void PopID()
DbgUI::EndCleanupScope
static proto native void EndCleanupScope()
DbgUI::InputText
static proto void InputText(string txt, out string value, int pxWidth=150)
DbgUI::End
static proto native void End()
DbgUI::PushID_Str
static proto native void PushID_Str(string str_id)
DbgUI::SameLine
static proto native void SameLine()
SoundObjectBuilder
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
AbstractWave
void AbstractWave()
Definition
sound.c:167
SoundParams
class SoundObject SoundParams(string name)
m_TickTimer
ref Timer m_TickTimer
Definition
plugindayzcreatureaidebug.c:86
Games
Dayz
scripts
4_world
plugins
pluginbase
pluginsounddebug.c
Generated by
1.17.0