62 m_CopySoundset = ButtonWidget.Cast(root.FindAnyWidget(
"SoundsetCopy"));
63 m_PlaySoundset = ButtonWidget.Cast(root.FindAnyWidget(
"PlaySoundset"));
65 m_StopSoundset = ButtonWidget.Cast(root.FindAnyWidget(
"StopSoundset"));
96 if (lastSelection.
Contains(
"shoulder"))
112 super.OnChange(w,
x,
y, finished);
128 vector mousePos, worldPos;
132 vector playerPos =
g_Game.GetPlayer().GetWorldPosition();
135 worldPos[1] =
g_Game.SurfaceY(worldPos[0], worldPos[2]);
139 m_MouseCurPos.SetText(
"Mouse: "+ MiscGameplayFunctions.TruncateToS(worldPos[0]) +
", "+ MiscGameplayFunctions.TruncateToS(worldPos[1]) +
", "+ MiscGameplayFunctions.TruncateToS(worldPos[2]));
143 float dst = (worldPos - playerPos).Length();
145 m_MapDistWidget.SetText(
"Distance: " + MiscGameplayFunctions.TruncateToS(dst));
149 vector playerCamDir =
g_Game.GetCurrentCameraDirection();
162 filter.
Split(
" ", rawFilters);
164 foreach (
int i,
string f:rawFilters)
183 for (
int i = 0; i < classes.Count(); i++)
185 string config_path = classes.Get(i);
187 int objects_count =
g_Game.ConfigGetChildrenCount(config_path);
188 for (
int j = 0; j < objects_count; j++)
192 g_Game.ConfigGetChildName(config_path, j, child_name);
194 if (!filters.Count())
200 foreach (
int indx,
string filter:filters)
202 string child_name_lower = child_name;
205 if (child_name_lower.
Contains(filter))
213 itemsArray.Insert(child_name);
220 foreach (
string it:itemsArray)
222 widget.AddItem(it, NULL, 0);
232 foreach (
string f:filters)
238 foreach (
string itm: arr2)
240 int row = widget.AddItem(itm, NULL, 0);
251 super.Update(timeslice);
260 vector playerPos = player.GetWorldPosition();
278 if (selected_row_index != -1)
315 string attachments =
string.Empty;
317 attachments +=
"shoulder,";
319 attachments +=
"body,";
321 attachments +=
"back";
338 super.OnMouseButtonDown(w,
x,
y,button);
347 vector mousePos, worldPos;
348 mousePos[0] = mouseX;
349 mousePos[1] = mouseY;
351 worldPos[1] =
g_Game.SurfaceY(worldPos[0], worldPos[2]);
355 else if (button == 1 &&
g_Game.GetPlayer())
365 super.OnClick(w,
x,
y,button);
378 if (selected_row_index != -1)
439 super.OnDoubleClick(w,
x,
y, button);
Wrapper class for managing sound through SEffectManager.
Manager class for managing Effect (EffectParticle, EffectSound).
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
ImageWidget m_BBackgroundSoundWeapon
static string m_SelectedSoundEventType
override bool OnChange(Widget w, int x, int y, bool finished)
bool m_PlayerPosRefreshBlocked
ButtonWidget m_SetETSoundWeaponButton
ButtonWidget m_SetETSoundButton
override void Update(float timeslice)
ButtonWidget m_SetETSoundAttachmentButton
EditBoxWidget m_SoundFilter
TextWidget m_MapDistWidget
override bool OnDoubleClick(Widget w, int x, int y, int button)
void UpdateAttachmentSelection()
TextListboxWidget m_SoundsTextListbox
void SetMapPos(vector pos)
void UpdateSelectedColor(ImageWidget buttonBackground)
void PrepareFilters(string filter, out TStringArray filters)
ButtonWidget m_SetETSoundVoiceButton
CheckBoxWidget m_CheckBoxShoulderAtt
void ChangeFilter(TStringArray classes, TextListboxWidget widget, EditBoxWidget filterWidget, int categoryMask=-1, bool ignoreScope=false)
ButtonWidget m_PlaySoundset
CheckBoxWidget m_CheckBoxBackAtt
ImageWidget m_SelectedBackground
ref Timer m_RefreshFilterTimer
static EffectSound m_SoundSet
static string m_SelectedAttachments
ImageWidget m_BBackgroundSound
ImageWidget m_BBackgroundSoundAttachment
TextWidget m_MapHeadingWidget
TStringArray GetSoundClasses()
CheckBoxWidget m_CheckBoxBodyAtt
ImageWidget m_BBackgroundSoundVoice
ButtonWidget m_PlaySoundEventButton
ButtonWidget m_PlaySoundsetLooped
ButtonWidget m_CopySoundset
void ScriptConsoleSoundsTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
static float DEBUG_MAP_ZOOM
MapWidget m_DebugMapWidget
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
EditBoxWidget m_SoundEventIDBox
void ~ScriptConsoleSoundsTab(Widget root)
override bool OnClick(Widget w, int x, int y, int button)
ButtonWidget m_StopSoundset
PluginConfigDebugProfile m_ConfigDebugProfile
void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
proto string ToString(bool simple=true)
array< string > TStringArray
proto native int KeyState(KeyCode key)
Gets key state.
static proto float AngleFromPosition(vector origin, vector originDir, vector target)
Angle that a target is from the direction of an origin.
static const float RAD2DEG
proto void GetMousePos(out int x, out int y)
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
proto int ToLower()
Changes string to lowercase.