Example #1
0
 private UI(Terraria.UI parentUI, CategorySelector categoryWidget, IAttributeWidget[] attributes)
 {
     this.parentUI       = parentUI;
     this.categoryWidget = categoryWidget;
     this.attributes     = attributes;
     uiDelay             = 0;
     rnd       = new FastRandom();
     textFont  = Terraria.UI.fontBig;
     textScale = 0.5f;
 }
Example #2
0
        public static UI Create(Terraria.UI parentUI)
        {
            CategorySelector categorySelector = new CategorySelector(Assets.CATEGORY_ICONS, Assets.CATEGORY_BACKGROUND, Assets.CATEGORY_BACKGROUND_SELECTED, new Vector2(54f, 0f));

            IAttributeWidget[] array = new IAttributeWidget[10];
            array[1] = HairAttributeWidget.Create(PlayerModifier.Hair, new Vector2i(4, 1), Lang.controls(Lang.CONTROLS.HAIR_TYPE), Lang.controls(Lang.CONTROLS.SELECT_TYPE));
            array[2] = ColorAttributeWidget.Create(PlayerModifier.HairColor, new Vector2i(4, 6), Lang.controls(Lang.CONTROLS.HAIR_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[5] = ColorAttributeWidget.Create(PlayerModifier.Shirt, new Vector2i(4, 2), Lang.controls(Lang.CONTROLS.SHIRT_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[6] = ColorAttributeWidget.Create(PlayerModifier.Undershirt, new Vector2i(2, 6), Lang.controls(Lang.CONTROLS.UNDERSHIRT_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[7] = ColorAttributeWidget.Create(PlayerModifier.Pants, new Vector2i(9, 7), Lang.controls(Lang.CONTROLS.PANTS_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[8] = ColorAttributeWidget.Create(PlayerModifier.Shoes, new Vector2i(0, 0), Lang.controls(Lang.CONTROLS.SHOE_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[3] = ColorAttributeWidget.Create(PlayerModifier.Eyes, new Vector2i(9, 2), Lang.controls(Lang.CONTROLS.EYE_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[4] = ColorAttributeWidget.Create(PlayerModifier.Skin, new Vector2i(3, 3), Lang.controls(Lang.CONTROLS.SKIN_COLOR), Lang.controls(Lang.CONTROLS.SELECT_COLOR));
            array[0] = GenderAttributeWidget.Create(PlayerModifier.Gender, GenderAttributeWidget.Gender.MALE, Lang.controls(Lang.CONTROLS.GENDER), Lang.controls(Lang.CONTROLS.SELECT_GENDER));
            array[9] = DifficultyAttributeWidget.Create(PlayerModifier.Difficulty, Difficulty.SOFTCORE, Lang.controls(Lang.CONTROLS.DIFFICULTY), Lang.controls(Lang.CONTROLS.SELECT_DIFFICULTY));
            return(new UI(parentUI, categorySelector, array));
        }