1 class Head_Default
extends Head
3 bool m_handling_exception =
false;
20 ConfigGetTextArray(
"simpleHiddenSelections",m_HeadHairSelectionArray);
22 m_beard_idx = m_HeadHairSelectionArray.Find(
"beard");
23 m_hair_idx = m_HeadHairSelectionArray.Find(
"hair");
24 if (!ConfigIsExisting(
"HairHiding"))
25 m_handling_exception =
true;
27 InitSelectionTranslation();
30 void InitSelectionTranslation()
32 for (
int i = 0; i < m_HeadHairSelectionArray.Count(); i++)
35 selTran.SetSelectionState(
true);
36 m_HeadHairHidingStateMap.Insert(i,selTran);
42 selections = m_HeadHairSelectionArray;
56 int GetSelectionIndex(
string str)
58 return m_HeadHairSelectionArray.Find(str);
61 bool IsHandlingException()
63 return m_handling_exception;
69 bool m_SelectionState;
71 bool m_TranslationFinished =
false;
79 m_BasePath =
"cfgVehicles " + m_Head.GetType() +
" HairHiding";
80 InitTranslatedSelections(idx);
83 void InitTranslatedSelections(
int idx)
85 if ( !m_Head.ConfigIsExisting(
"HairHiding") )
89 int selectionIdx = -1;
93 path = m_BasePath +
" Group_Hair";
94 SearchAndTranslate(
path,idx);
96 path = m_BasePath +
" Group_Beard";
97 SearchAndTranslate(
path,idx);
99 path = m_BasePath +
" Group_HairBeard";
100 SearchAndTranslate(
path,idx);
103 for (
int i = 0; !m_TranslationFinished; i++)
105 path = m_BasePath +
" Group_" + i;
108 SearchAndTranslate(
path,idx);
112 m_TranslationFinished =
true;
117 bool SearchAndTranslate(
string path,
int idx)
123 g_Game.ConfigGetTextArray(
path +
" memberSelections", tempArrayStr);
124 int indexInOriginalArray = -2;
126 for (
int i = 0; i < tempArrayStr.Count(); i++)
128 indexInOriginalArray = m_Head.m_HeadHairSelectionArray.Find(tempArrayStr.Get(i));
129 if ( idx == indexInOriginalArray )
131 g_Game.ConfigGetTextArray(
path +
" simpleSelectionName", tempArrayStr);
132 for (i = 0; i < tempArrayStr.Count(); i++)
134 m_TranslatedSelections.Insert(m_Head.m_HeadHairSelectionArray.Find(tempArrayStr.Get(i)));
136 m_TranslationFinished =
true;
143 void SetSelectionState(
bool state)
145 m_SelectionState = state;
148 bool GetSelectionState()
150 return m_SelectionState;
155 return m_TranslatedSelections;