DayZ 1.24
Loading...
Searching...
No Matches
OptionSelectorMultistate.c File Reference

Go to the source code of this file.

Classes

class  OptionSelector
 

Functions

void OptionSelectorMultistateCharacterMenu (Widget parent, int current_index, ScriptedWidgetEventHandler parent_c, bool disabled, notnull array< string > options)
 
void SetDisplayNameText (string value, string appendix)
 
void SetTextSmart (string value)
 
bool InheritsFrom (string value, string baseclass)
 
override void SetNextOption ()
 
override void SetPrevOption ()
 
override void SetValue (int value, bool fire_event=true)
 
override void SetValue (string value, bool fire_event=true)
 
override void SetRandomValue ()
 
override void SetStringOption (string option, bool fire_event=true)
 

Variables

class OptionSelectorMultistate extends OptionSelector class_name
 
string path = "cfgVehicles " + class_name + " displayName"
 
string displayname
 

Function Documentation

◆ InheritsFrom()

bool InheritsFrom ( string value,
string baseclass )

Definition at line 171 of file OptionSelectorMultistate.c.

172 {
173 string child = value;
174 string parent;
175 while (GetGame().ConfigGetBaseName("cfgVehicles " + child, parent))
176 {
177 if (parent == baseclass)
178 return true;
179 child = parent;
180 }
181 return false;
182 }
proto native CGame GetGame()

References GetGame().

Referenced by SetTextSmart().

◆ OptionSelectorMultistateCharacterMenu()

void OptionSelectorMultistateCharacterMenu ( Widget parent,
int current_index,
ScriptedWidgetEventHandler parent_c,
bool disabled,
notnull array< string > options )

Definition at line 124 of file OptionSelectorMultistate.c.

125 {
126 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
127 }
void SetTextSmart(string value)

References SetTextSmart().

Referenced by UIScriptedMenu::Init().

◆ SetDisplayNameText()

void SetDisplayNameText ( string value,
string appendix )

Definition at line 129 of file OptionSelectorMultistate.c.

130 {
131 path = "cfgVehicles " + class_name + " displayName";
132 GetGame().ConfigGetText(path, displayname);
133 if (value == "Male")
134 m_SelectedOption.SetText("#str_cfgvehicles_survivorM0");
135 else if (value == "Female")
136 m_SelectedOption.SetText("#str_cfgvehicles_survivorF0");
137 else if (appendix != "")
138 {
139 if (value == "")
140 m_SelectedOption.SetText("NO ITEM - localization needed!");
141 else
142 m_SelectedOption.SetText("" + displayname + " " + appendix); //characters
143 }
144 else
145 m_SelectedOption.SetText(displayname);
146 }
string displayname
class OptionSelectorMultistate extends OptionSelector class_name

References class_name, displayname, GetGame(), and path.

Referenced by SetTextSmart().

◆ SetNextOption()

override void SetNextOption ( )

Definition at line 184 of file OptionSelectorMultistate.c.

185 {
186 super.SetNextOption();
187 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
188 }

References SetTextSmart().

◆ SetPrevOption()

override void SetPrevOption ( )

Definition at line 190 of file OptionSelectorMultistate.c.

191 {
192 super.SetPrevOption();
193 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
194 }

References SetTextSmart().

◆ SetRandomValue()

override void SetRandomValue ( )

Definition at line 208 of file OptionSelectorMultistate.c.

209 {
210 super.SetRandomValue();
211 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
212 }

References SetTextSmart().

◆ SetStringOption()

override void SetStringOption ( string option,
bool fire_event = true )

Definition at line 214 of file OptionSelectorMultistate.c.

215 {
216 super.SetStringOption(option, fire_event);
217 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
218 }

References SetTextSmart().

◆ SetTextSmart()

void SetTextSmart ( string value)

Definition at line 148 of file OptionSelectorMultistate.c.

149 {
150 if (value == "Male" || value == "Female")
151 {
153 return;
154 }
155
157 int index = m_Options.Find(value);
158 if (InheritsFrom(class_name, "Clothing_Base"))
160 else if (InheritsFrom(class_name, "SurvivorBase"))
161 {
162 if (InheritsFrom(class_name, "SurvivorMale_Base"))
163 SetDisplayNameText("#str_cfgvehicles_survivorM0", (m_SelectedOptionIndex + 1).ToString());
164 else if (InheritsFrom(class_name, "SurvivorFemale_Base"))
165 SetDisplayNameText("#str_cfgvehicles_survivorF0", (m_SelectedOptionIndex + 1).ToString());
166 }
167 else
169 }
proto string ToString()
bool InheritsFrom(string value, string baseclass)
void SetDisplayNameText(string value, string appendix)

References class_name, InheritsFrom(), SetDisplayNameText(), and ToString().

Referenced by OptionSelectorMultistateCharacterMenu(), SetNextOption(), SetPrevOption(), SetRandomValue(), SetStringOption(), SetValue(), and SetValue().

◆ SetValue() [1/2]

override void SetValue ( int value,
bool fire_event = true )

◆ SetValue() [2/2]

override void SetValue ( string value,
bool fire_event = true )

Definition at line 202 of file OptionSelectorMultistate.c.

203 {
204 super.SetValue(value, fire_event);
205 SetTextSmart(m_Options.Get(m_SelectedOptionIndex));
206 }

References SetTextSmart().

Variable Documentation

◆ class_name

◆ displayname

string displayname

Definition at line 122 of file OptionSelectorMultistate.c.

Referenced by SetDisplayNameText().

◆ path

string path = "cfgVehicles " + class_name + " displayName"

Definition at line 121 of file OptionSelectorMultistate.c.

Referenced by BillboardSet(), PPEClassBase::ChangeMaterialPathUsed(), ChangePPEMaterial(), CGame::ConfigGetTextOut(), CreateMission(), ReplaceItemWithNewLambdaBase::CreateNewEntity(), CreateParticleByPath(), CGame::DayZGame(), ScriptConsoleConfigTab::DumpParam(), ItemBase::EEItemAttached(), ItemBase::EEItemDetached(), PluginBase::GetBaseClasses(), GetComponentNamesFromDamageZone(), PluginBase::GetConfigRecursive(), GetDamageZoneMap(), UIScriptedMenu::GetData(), JsonMissionLoaderData::GetData(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::GetHierarchyPath(), Attachments::GetItemSlots(), ParticleSource::GetParticle(), ParticleSource::GetParticleID(), ParticleSource::GetParticleIDLegacy(), ParticleList::GetParticlePath(), GetPathFromSlotID(), DayZPlayer::HandleView(), SoundSetMap::Init(), Init(), AttachmentCategoriesRow::Init(), ItemOptics::Init2DPreloadType(), Attachments::InitAttachmentGrid(), ItemOptics::InitCameraOverrideProperties(), Entity::InitDamageZoneDisplayNameMapping(), InitData(), ItemOptics::InitDOFAvailability(), ZombieContainer::InitGhostSlots(), InventoryItemSuper::InitMapState(), ItemOptics::InitOpticsPP(), ItemOptics::InitReddotData(), SelectionTranslation::InitTranslatedSelections(), ScriptedWidgetEventHandler::InitVideoLoading(), BillboardSetHandler::LoadBillboardConfigs(), LoadConfig(), PlayerSpawnHandler::LoadData(), SoundLookupTable::LoadTable(), ScriptedWidgetEventHandler::LoadVideo(), ScriptedWidgetEventHandler::LoadVideoFile(), ModStructure::ModStructure(), ScriptConsoleConfigTab::OnClick(), Entity::OnDebugSpawn(), ActionUnpackBox::OnFinishProgressServer(), ItemBase::ParticleTest(), PlayerContainer::PlayerContainer(), ReplaceItemWithNewLambdaBase::PrepareLocations(), GameplayEffectWidgets_base::RegisterLayouts(), MapMarkerTypes::RegisterMarkerType(), ParticleList::RegisterParticle(), UIPopupScript::RenderVariables(), ScriptConsoleConfigTab::RenderVariables(), ActionRepairTent::RepairDamageTransfer(), OpenDirPlugin::Run(), DayZTool::RunDayZBat(), SelectionTranslation::SearchAndTranslate(), SetDisplayNameText(), CGame::SetMissionPath(), ParticleSource::SetParticle(), ObjectSpawnerHandler::SpawnObjects(), ManBase::UpdateCorpseStateVisual(), and ObjectSpawnerHandler::ValidatePath().