UI fix from Ccomp5950

This commit is contained in:
Rob Nelson
2014-01-20 01:59:51 -05:00
committed by ZomgPonies
parent ff2d37265c
commit d31bc9def9
+7 -7
View File
@@ -129,13 +129,13 @@ var/global/list/datum/dna/gene/dna_genes[0]
SetUIValueRange(DNA_UI_BEARD_G, character.g_facial, 255, 1)
SetUIValueRange(DNA_UI_BEARD_B, character.b_facial, 255, 1)
SetUIValueRange(DNA_UI_BEARD_R, character.r_eyes, 255, 1)
SetUIValueRange(DNA_UI_BEARD_G, character.g_eyes, 255, 1)
SetUIValueRange(DNA_UI_BEARD_B, character.b_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_R, character.r_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_G, character.g_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_B, character.b_eyes, 255, 1)
SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative.
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
SetUIValueRange(DNA_UI_HAIR_STYLE, hair, hair_styles_list.len, 1)
SetUIValueRange(DNA_UI_BEARD_STYLE, beard, facial_hair_styles_list.len,1)
@@ -159,12 +159,12 @@ var/global/list/datum/dna/gene/dna_genes[0]
// Set a DNA UI block's value, given a value and a max possible value.
// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue,var/defer=0)
if (block<=0) return
ASSERT(maxvalue<=4095)
var/range = round(4095 / maxvalue)
var/range = (4095 / maxvalue)
if(value)
SetUIValue(block,value * range - rand(1,range-1))
SetUIValue(block,round(value * range),defer)
// Getter version of above.
/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue)