44 super.InitializeTab(root, console, button, parent);
64 m_CopySoundset = ButtonWidget.Cast(root.FindAnyWidget(
"SoundsetCopy"));
65 m_PlaySoundset = ButtonWidget.Cast(root.FindAnyWidget(
"PlaySoundset"));
67 m_StopSoundset = ButtonWidget.Cast(root.FindAnyWidget(
"StopSoundset"));
98 if (lastSelection.
Contains(
"shoulder"))
114 super.OnChange(w,
x,
y, finished);
130 vector mousePos, worldPos;
134 vector playerPos =
g_Game.GetPlayer().GetWorldPosition();
137 worldPos[1] =
g_Game.SurfaceY(worldPos[0], worldPos[2]);
141 m_MouseCurPos.SetText(
"Mouse: "+ MiscGameplayFunctions.TruncateToS(worldPos[0]) +
", "+ MiscGameplayFunctions.TruncateToS(worldPos[1]) +
", "+ MiscGameplayFunctions.TruncateToS(worldPos[2]));
145 float dst = (worldPos - playerPos).Length();
147 m_MapDistWidget.SetText(
"Distance: " + MiscGameplayFunctions.TruncateToS(dst));
151 vector playerCamDir =
g_Game.GetCurrentCameraDirection();
164 filter.
Split(
" ", rawFilters);
166 foreach (
int i,
string f:rawFilters)
185 for (
int i = 0; i < classes.Count(); i++)
187 string config_path = classes.Get(i);
189 int objects_count =
g_Game.ConfigGetChildrenCount(config_path);
190 for (
int j = 0; j < objects_count; j++)
194 g_Game.ConfigGetChildName(config_path, j, child_name);
196 if (!filters.Count())
202 foreach (
int indx,
string filter:filters)
204 string child_name_lower = child_name;
207 if (child_name_lower.
Contains(filter))
215 itemsArray.Insert(child_name);
222 foreach (
string it:itemsArray)
224 widget.AddItem(it, NULL, 0);
234 foreach (
string f:filters)
240 foreach (
string itm: arr2)
242 int row = widget.AddItem(itm, NULL, 0);
253 super.Update(timeslice);
262 vector playerPos = player.GetWorldPosition();
280 if (selected_row_index != -1)
317 string attachments =
string.Empty;
319 attachments +=
"shoulder,";
321 attachments +=
"body,";
323 attachments +=
"back";
340 super.OnMouseButtonDown(w,
x,
y,button);
349 vector mousePos, worldPos;
350 mousePos[0] = mouseX;
351 mousePos[1] = mouseY;
353 worldPos[1] =
g_Game.SurfaceY(worldPos[0], worldPos[2]);
357 else if (button == 1 &&
g_Game.GetPlayer())
367 super.OnClick(w,
x,
y,button);
380 if (selected_row_index != -1)
441 super.OnDoubleClick(w,
x,
y, button);
Wrapper class for managing sound through SEffectManager.
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.
Manager class for managing Effect (EffectParticle, EffectSound)
TextWidget m_MapHeadingWidget
ref Timer m_RefreshFilterTimer
override bool OnChange(Widget w, int x, int y, bool finished)
ImageWidget m_BBackgroundSoundVoice
MapWidget m_DebugMapWidget
ButtonWidget m_PlaySoundsetLooped
void UpdateAttachmentSelection()
ButtonWidget m_SetETSoundVoiceButton
ButtonWidget m_PlaySoundEventButton
override void InitializeTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
void ~ScriptConsoleSoundsTab(Widget root)
ButtonWidget m_SetETSoundButton
ButtonWidget m_CopySoundset
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
void ChangeFilter(TStringArray classes, TextListboxWidget widget, EditBoxWidget filterWidget, int categoryMask=-1, bool ignoreScope=false)
ImageWidget m_BBackgroundSound
EditBoxWidget m_SoundEventIDBox
static EffectSound m_SoundSet
CheckBoxWidget m_CheckBoxBodyAtt
EditBoxWidget m_SoundFilter
ImageWidget m_BBackgroundSoundWeapon
void UpdateSelectedColor(ImageWidget buttonBackground)
static string m_SelectedSoundEventType
ButtonWidget m_SetETSoundWeaponButton
CheckBoxWidget m_CheckBoxBackAtt
override bool OnClick(Widget w, int x, int y, int button)
ImageWidget m_SelectedBackground
void SetMapPos(vector pos)
CheckBoxWidget m_CheckBoxShoulderAtt
TextListboxWidget m_SoundsTextListbox
TStringArray GetSoundClasses()
override void OnSelected()
ButtonWidget m_StopSoundset
static string m_SelectedAttachments
TextWidget m_MapDistWidget
override void Update(float timeslice)
static float DEBUG_MAP_ZOOM
override bool OnDoubleClick(Widget w, int x, int y, int button)
bool m_PlayerPosRefreshBlocked
void PrepareFilters(string filter, out TStringArray filters)
ButtonWidget m_PlaySoundset
ImageWidget m_BBackgroundSoundAttachment
ButtonWidget m_SetETSoundAttachmentButton
PluginConfigDebugProfile m_ConfigDebugProfile
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
proto string ToString(bool simple=true)
class array< Class T > TStringArray
proto native int KeyState(KeyCode key)
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)
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
bool Contains(string sample)
Returns true if sample is substring of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
proto int ToLower()
Changes string to lowercase. Returns length.