6 self.warningStep = 0.02
13 local
title = "Information"
14 local
subtitle = "Enter your character's general info."
19 local labelX =
middleX + xPadding - 5
23 self.recommendedNameLength = 8
24 self.descriptionLimit = 256
25 self.recommendedDescriptionLength = 24
27 -- 9 fields (1
double height) = 9 * 30 + 75 = 345
33 self.
title = ISLabel:new(
self.
uiHelper.GetMiddle(
self.
width, UIFont.Title,
title),
yOffset, 25,
title, 1, 1, 1, 1, UIFont.Title, true)
39 self.
subtitle = ISLabel:new(
self.
uiHelper.GetMiddle(
self.
width, UIFont.Large,
subtitle),
yOffset, 25,
subtitle, 1, 1, 1, 1, UIFont.Large, true)
45 self.genderLabel = ISLabel:new(labelX,
yOffset, 25, "Gender:", 1, 1, 1, 1, UIFont.Large, false)
46 self.genderLabel:initialise()
50 self.genderDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25,
self,
self.onGenderChanged)
51 self.genderDropdown:addOption("Male")
52 self.genderDropdown:addOption("Female")
57 self.nameLabel = ISLabel:new(labelX,
yOffset, 25, "Name (32):", 1, 1, 1, 1, UIFont.Large, false)
58 self.nameLabel:initialise()
61 self.nameEntry = ISTextEntryBox:new("", entryX,
yOffset, entryWidth, 25)
63 self.nameEntry.borderColor = {r=1, g=0, b=0,
a=1.0}
64 self.nameEntry:initialise()
65 self.nameEntry:instantiate()
74 self.descriptionEntry = ISTextEntryBox:new("", entryX,
yOffset, entryWidth, 100)
76 self.descriptionEntry.borderColor = {r=1, g=0, b=0,
a=1}
77 self.descriptionEntry:initialise()
78 self.descriptionEntry:instantiate()
79 self.descriptionEntry:setMultipleLine(true)
80 self.descriptionEntry:setMaxLines(0)
85 self.ageLabel = ISLabel:new(labelX,
yOffset, 25, "Age (25):", 1, 1, 1, 1, UIFont.Large, false)
86 self.ageLabel:initialise()
89 self.ageSlider = ISSliderPanel:new(entryX,
yOffset, entryWidth, 25,
self,
self.onAgeChanged)
90 self.ageSlider.currentValue = 25
93 self.ageSlider.stepValue = 1
96 --[[
self.ageDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
97 self.ageDropdown:addOption("18")
98 self.ageDropdown:addOption("19")
99 self.ageDropdown:addOption("20")
100 -- Add more age
options as needed
105 self.heightLabel = ISLabel:new(labelX,
yOffset, 25, "Height (5'10\"):", 1, 1, 1, 1, UIFont.Large, false)
106 self.heightLabel:initialise()
109 self.heightSlider = ISSliderPanel:new(entryX,
yOffset, entryWidth, 25,
self,
self.onHeightChanged)
110 self.heightSlider.currentValue = 70
113 self.heightSlider.stepValue = 1
116 --[[
self.heightFeetDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
117 self.heightFeetDropdown:addOption("5")
118 self.heightFeetDropdown:addOption("6")
120 self:addChild(
self.heightFeetDropdown)--]]
125 self.heightInchesLabel = ISLabel:new(labelX,
yOffset, 25, "Height (10\"):", 1, 1, 1, 1, UIFont.Large, false)
126 self.heightInchesLabel:initialise()
127 self:addChild(
self.heightInchesLabel)
129 self.heightInchesSlider = ISSliderPanel:new(entryX,
yOffset, entryWidth, 25,
self,
self.onHeightInchesChanged)
130 self.heightInchesSlider.currentValue = 10
131 self.heightInchesSlider.minValue = 0
132 self.heightInchesSlider.maxValue = 11
133 self.heightInchesSlider.stepValue = 1
134 self:addChild(
self.heightInchesSlider)
137 --[[
self.heightInchesDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
138 self.heightInchesDropdown:addOption("0")
139 self.heightInchesDropdown:addOption("1")
141 self:addChild(
self.heightInchesDropdown)--]]
145 self.weightLabel = ISLabel:new(labelX,
yOffset, 25, "Weight (150 lb):", 1, 1, 1, 1, UIFont.Large, false)
146 self.weightLabel:initialise()
149 self.weightSlider = ISSliderPanel:new(entryX,
yOffset, entryWidth, 25,
self,
self.onWeightChanged)
150 self.weightSlider.currentValue = 150
153 self.weightSlider.stepValue = 5
158 self.physiqueLabel = ISLabel:new(labelX,
yOffset, 25, "Physique:", 1, 1, 1, 1, UIFont.Large, false)
159 self.physiqueLabel:initialise()
162 self.physiqueDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
163 self.physiqueDropdown:addOption("Skinny")
164 self.physiqueDropdown:addOption("Slim")
165 self.physiqueDropdown:addOption("Average")
166 self.physiqueDropdown:addOption("Muscular")
167 self.physiqueDropdown:addOption("Overweight")
168 self.physiqueDropdown:addOption("Obese")
169 self.physiqueDropdown:initialise()
171 self:addChild(
self.physiqueDropdown)
175 self.eyeColorLabel = ISLabel:new(labelX,
yOffset, 25, "Eye Color:", 1, 1, 1, 1, UIFont.Large, false)
176 self.eyeColorLabel:initialise()
179 self.eyeColorDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
180 self.eyeColorDropdown:addOption("Blue")
181 self.eyeColorDropdown:addOption("Brown")
182 self.eyeColorDropdown:addOption("Gray")
183 self.eyeColorDropdown:addOption("Green")
184 self.eyeColorDropdown:addOption("Heterochromatic")
186 self:addChild(
self.eyeColorDropdown)
190 self.hairColorLabel = ISLabel:new(labelX,
yOffset, 25, "Hair Color:", 1, 1, 1, 1, UIFont.Large, false)
191 self.hairColorLabel:initialise()
194 self.hairColorDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
195 self.hairColorDropdown:addOptionWithData("Black", {r = HAIR_COLOR_BLACK_R, g = HAIR_COLOR_BLACK_G, b = HAIR_COLOR_BLACK_B})
196 self.hairColorDropdown:addOptionWithData(
"Blonde", {r = HAIR_COLOR_BLONDE_R, g = HAIR_COLOR_BLONDE_G, b = HAIR_COLOR_BLONDE_B})
197 self.hairColorDropdown:addOptionWithData(
"Brown", {r = HAIR_COLOR_BROWN_R, g = HAIR_COLOR_BROWN_G, b = HAIR_COLOR_BROWN_B})
198 self.hairColorDropdown:addOptionWithData(
"Gray", {r = HAIR_COLOR_GRAY_R, g = HAIR_COLOR_GRAY_G, b = HAIR_COLOR_GRAY_B})
199 self.hairColorDropdown:addOptionWithData(
"Red", {r = HAIR_COLOR_RED_R, g = HAIR_COLOR_RED_G, b = HAIR_COLOR_RED_B})
200 self.hairColorDropdown:addOptionWithData(
"White", {r = HAIR_COLOR_WHITE_R, g = HAIR_COLOR_WHITE_G, b = HAIR_COLOR_WHITE_B})
201 self:addChild(
self.hairColorDropdown)
205 self.skinColorLabel = ISLabel:new(labelX,
yOffset, 25,
"Skin Color:", 1, 1, 1, 1, UIFont.Large, false)
206 self.skinColorLabel:initialise()
209 self.skinColorDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
210 self.skinColorDropdown:addOptionWithData(
"Pale", SKIN_COLOR_PALE)
211 self.skinColorDropdown:addOptionWithData(
"White", SKIN_COLOR_WHITE)
212 self.skinColorDropdown:addOptionWithData(
"Tanned", SKIN_COLOR_TANNED)
213 self.skinColorDropdown:addOptionWithData(
"Brown", SKIN_COLOR_BROWN)
214 self.skinColorDropdown:addOptionWithData(
"Dark Brown", SKIN_COLOR_DARK_BROWN)
215 self:addChild(
self.skinColorDropdown)
219 -- HL2RP abnormal stuff
221 local warningText1 =
"Your character would be considered abnormal."
222 local warningText2 =
"The Combine will target you."
224 self.abnormalLabel1 = ISLabel:new(
self.
uiHelper.GetMiddle(
self.
width, UIFont.Large, warningText1),
yOffset, 50, warningText1, 1, 1, 1, 1, UIFont.Large, true)
225 self.abnormalLabel1:initialise()
226 self.abnormalLabel1:setVisible(false)
231 self.abnormalLabel2 = ISLabel:new(
self.
uiHelper.GetMiddle(
self.
width, UIFont.Large, warningText2),
yOffset, 50, warningText2, 1, 1, 1, 1, UIFont.Large, true)
232 self.abnormalLabel2:initialise()
233 self.abnormalLabel2:setVisible(false)
237 --[[
self.weightDropdown = ISComboBox:new(entryX,
yOffset, entryWidth, 25)
238 self.weightDropdown:addOption(
"0")
239 self.weightDropdown:addOption(
"25")
241 self:addChild(
self.weightDropdown)--]]
251 -- HL2RP abnormal stuff
254 self.isAbnormal = true
255 self.abnormalLabel1:setVisible(true)
256 self.abnormalLabel2:setVisible(true)
258 self.isAbnormal = false
259 self.abnormalLabel1:setVisible(false)
260 self.abnormalLabel2:setVisible(false)
266 local feet = math.floor(
newValue / 12)
269 self.heightLabel:setName(
"Height (" .. feet ..
"' " .. inches ..
"\"):")
271 -- HL2RP abnormal stuff
274 self.isAbnormal = true
275 self.abnormalLabel1:setVisible(true)
276 self.abnormalLabel2:setVisible(true)
278 self.isAbnormal = false
279 self.abnormalLabel1:setVisible(false)
280 self.abnormalLabel2:setVisible(false)
286 self.weightLabel:setName(
"Weight (" ..
newValue ..
" lb):")
288 -- HL2RP abnormal stuff
291 self.isAbnormal = true
292 self.abnormalLabel1:setVisible(true)
293 self.abnormalLabel2:setVisible(true)
295 self.isAbnormal = false
296 self.abnormalLabel1:setVisible(false)
297 self.abnormalLabel2:setVisible(false)
309 -- HL2RP abnormal stuff
311 if
self.abnormalLabel1 and
self.abnormalLabel2 and
self.abnormalLabel1:getIsVisible() == true and
self.abnormalLabel2:getIsVisible() == true then
333 if
self.nameLabel and
self.nameEntry then
338 self.nameEntry:setText(string.sub(
self.nameEntry:getText(), 1,
self.nameLimit))
353 red = math.max(0, math.min(1, ratio * 0.5))
354 green = math.max(0, math.min(1, 1 - ratio * 0.5))
362 if self.descriptionLabel and
self.descriptionEntry then
367 self.descriptionEntry:setText(string.sub(
self.descriptionEntry:getText(), 1,
self.descriptionLimit))
381 local ratio = (
usedCharacters -
self.recommendedDescriptionLength) / (
self.descriptionLimit -
self.recommendedDescriptionLength)
382 red = math.max(0, math.min(1, ratio * 0.5))
383 green = math.max(0, math.min(1, 1 - ratio * 0.5))
395 o = ISPanel:
new(parameters.x, parameters.y, parameters.width, parameters.height)
396 setmetatable(o,
self)
398 o.backgroundColor = {r=0, g=0, b=0,
a=0}
399 o.borderColor = {r=0, g=0, b=0,
a=0}
400 o.moveWithMouse =
false
401 o.playerObject = parameters.playerObject
void local descriptionLabel()
void self warningTurningRed()
void local usedCharacters()
void FrameworkZ UI CreateCharacterInfo()
void local remainingCharacters()
void processingNotification backgroundColor a()
void self playerListPanel prerender()
void button borderColor()
void button backgroundColor()
void onGenderChanged(dropdown)
void onWeightChanged(newValue, slider)
void onAgeChanged(newValue, slider)
void onHeightChanged(newValue, slider)
Contains all of the User Interfaces for FrameworkZ.