public static DresserDTO Create(Pawn pawn, Job job, CurrentEditorEnum selectedEditor) { List <CurrentEditorEnum> editors = Building_ChangeMirror.SupportedEditors; if (AlienRaceUtil.IsAlien(pawn)) { List <CurrentEditorEnum> alienEditors = new List <CurrentEditorEnum>(editors.Count + 2); foreach (CurrentEditorEnum ed in editors) { alienEditors.Add(ed); if (ed == CurrentEditorEnum.ChangeMirrorBody) { alienEditors.Add(CurrentEditorEnum.ChangeMirrorAlienSkinColor); } /*else if (ed == CurrentEditorEnum.ChangeDresserHair) * { * alienEditors.Add(CurrentEditorEnum.ChangeDresserAlienHairColor); * }*/ } editors = alienEditors; return(new AlienDresserDTO(pawn, selectedEditor, editors)); } return(new DresserDTO(pawn, selectedEditor, editors)); }
public DresserDTO(Pawn pawn, CurrentEditorEnum currentEditorEnum, List <CurrentEditorEnum> editors) { this.Pawn = pawn; this.originalAgeBioTicks = pawn.ageTracker.AgeBiologicalTicks; this.originalAgeChronTicks = pawn.ageTracker.AgeChronologicalTicks; this.CurrentEditorEnum = currentEditorEnum; this.EditorTypeSelectionDto = new EditorTypeSelectionDTO(this.CurrentEditorEnum, editors); this.EditorTypeSelectionDto.SelectionChangeListener += delegate(object sender) { this.CurrentEditorEnum = (CurrentEditorEnum)this.EditorTypeSelectionDto.SelectedItem; }; this.BodyTypeSelectionDto = new BodyTypeSelectionDTO(this.Pawn.story.bodyType, this.Pawn.gender); this.HairStyleSelectionDto = new HairStyleSelectionDTO(this.Pawn.story.hairDef, this.Pawn.gender); this.HeadTypeSelectionDto = new HeadTypeSelectionDTO(this.Pawn.story.HeadGraphicPath, this.Pawn.gender); this.GenderSelectionDto = new GenderSelectionDTO(this.Pawn.gender); this.GenderSelectionDto.SelectionChangeListener += delegate(object sender) { this.BodyTypeSelectionDto.Gender = (Gender)this.GenderSelectionDto.SelectedItem; this.HairStyleSelectionDto.Gender = (Gender)this.GenderSelectionDto.SelectedItem; this.HeadTypeSelectionDto.Gender = (Gender)this.GenderSelectionDto.SelectedItem; }; this.HairColorSelectionDto = new HairColorSelectionDTO(this.Pawn.story.hairColor, IOUtil.LoadColorPresets(ColorPresetType.Hair)); this.ApparelSelectionsContainer = new ApparelSelectionsContainer(this.Pawn.apparel.WornApparel, IOUtil.LoadColorPresets(ColorPresetType.Apparel)); this.SkinColorSliderDto = new SliderWidgetDTO(this.Pawn.story.melanin, 0, 1); }
public void SetSelectedEditor(CurrentEditorEnum editor) { base.index = 0; for (int i = 0; i < this.editors.Count; ++i) { if (this.editors[i] == editor) { base.index = i; break; } } }
public EditorTypeSelectionDTO(CurrentEditorEnum currentEditor, List <CurrentEditorEnum> editors) : base() { this.editors = new List <CurrentEditorEnum>(editors); for (int i = 0; i < this.editors.Count; ++i) { if (this.editors[i] == currentEditor) { base.index = i; break; } } }
public static DresserDTO Create(Pawn pawn, Job job, CurrentEditorEnum selectedEditor) { List <CurrentEditorEnum> editors; if (job.targetA.Thing is Building_Dresser) { editors = Building_Dresser.SupportedEditors; } else { editors = Building_ChangeMirror.SupportedEditors; } return(new DresserDTO(pawn, selectedEditor, editors)); }
//public HairColorSelectionDTO AlienHairColorPrimary { get; protected set; } //public HairColorSelectionDTO AlienHairColorSecondary { get; protected set; } public DresserDTO(Pawn pawn, CurrentEditorEnum currentEditorEnum, IEnumerable <CurrentEditorEnum> editors) { this.Pawn = pawn; this.CurrentEditorEnum = currentEditorEnum; this.EditorTypeSelectionDto = new EditorTypeSelectionDTO(this.CurrentEditorEnum, new List <CurrentEditorEnum>(editors)); this.EditorTypeSelectionDto.SelectionChangeListener += delegate(object sender) { this.CurrentEditorEnum = (CurrentEditorEnum)this.EditorTypeSelectionDto.SelectedItem; if (this.CurrentEditorEnum == CurrentEditorEnum.ChangeDresserHair) { Prefs.HatsOnlyOnMap = true; } else { Prefs.HatsOnlyOnMap = false; } }; this.HasHair = true; this.BodyTypeSelectionDto = null; this.GenderSelectionDto = null; this.HairStyleSelectionDto = null; this.HairColorSelectionDto = null; this.GradientHairColorSelectionDto = null; this.SkinColorSliderDto = null; this.HeadTypeSelectionDto = null; this.AlienSkinColorPrimary = null; this.AlienSkinColorSecondary = null; //this.AlienHairColorPrimary = null; //this.AlienHairColorSecondary = null; if (this.EditorTypeSelectionDto.Contains(CurrentEditorEnum.ChangeDresserApparelColor)) { this.ApparelSelectionsContainer = new ApparelColorSelectionsContainer(this.Pawn.apparel.WornApparel, IOUtil.LoadColorPresets(ColorPresetType.Apparel)); } if (this.EditorTypeSelectionDto.Contains(CurrentEditorEnum.ChangeDresserApparelLayerColor)) { this.ApparelLayerSelectionsContainer = new ApparelLayerSelectionsContainer(this.Pawn, IOUtil.LoadColorPresets(ColorPresetType.Apparel)); } this.Initialize(); }
public static DresserDTO Create(Pawn pawn, Job job, CurrentEditorEnum selectedEditor) { bool isAlien = AlienRaceUtil.IsAlien(pawn); IEnumerable <CurrentEditorEnum> editors; if (job.targetA.Thing is Building_ChangeMirror) { editors = Building_ChangeMirror.GetSupportedEditors(isAlien); } else { editors = Building_ChangeMirror.GetSupportedEditors(isAlien); } if (isAlien) { return(new AlienDresserDTO(pawn, selectedEditor, editors)); } return(new DresserDTO(pawn, selectedEditor, editors)); }
public AlienDresserDTO(Pawn pawn, CurrentEditorEnum currentEditorEnum, List <CurrentEditorEnum> editors) : base(pawn, currentEditorEnum, editors) { base.EditorTypeSelectionDto.SetSelectedEditor(currentEditorEnum); }
internal bool Contains(CurrentEditorEnum currentEditorEnum) { return(this.editors.Contains(currentEditorEnum)); }
public EditorTypeSelectionDTO(CurrentEditorEnum currentEditor, List <CurrentEditorEnum> editors) : base() { this.editors = new List <CurrentEditorEnum>(editors); this.SetSelectedEditor(currentEditor); }