protected override void Setup() { // Load all the textures used by inventory system LoadTextures(); // Always dim background ParentPanel.BackgroundColor = ScreenDimColor; // Setup native panel background NativePanel.BackgroundTexture = baseTexture; // Character portrait NativePanel.Components.Add(characterPortrait); characterPortrait.Position = new Vector2(49, 13); characterPortrait.Refresh(); }
protected override void Setup() { // Load native texture nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName); if (!nativeTexture) { throw new Exception("DaggerfallCharacterSheetWindow: Could not load native texture."); } // Always dim background ParentPanel.BackgroundColor = ScreenDimColor; // Setup native panel background NativePanel.BackgroundTexture = nativeTexture; // Character portrait NativePanel.Components.Add(characterPortrait); characterPortrait.Position = new Vector2(200, 8); // Setup labels nameLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(41, 4), NativePanel); raceLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(41, 14), NativePanel); classLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(46, 24), NativePanel); levelLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(45, 34), NativePanel); //goldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(39, 44), NativePanel); fatigueLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(57, 54), NativePanel); healthLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(52, 64), NativePanel); //encumbranceLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(90, 74), NativePanel); // Setup stat labels Vector2 pos = new Vector2(150, 17); for (int i = 0; i < DaggerfallStats.Count; i++) { statLabels[i] = DaggerfallUI.AddDefaultShadowedTextLabel(pos, NativePanel); pos.y += 24f; } // Primary skills button Button primarySkillsButton = DaggerfallUI.AddButton(new Rect(11, 106, 115, 8), NativePanel); primarySkillsButton.OnMouseClick += PrimarySkillsButton_OnMouseClick; // Major skills button Button majorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 116, 115, 8), NativePanel); majorSkillsButton.OnMouseClick += MajorSkillsButton_OnMouseClick; // Minor skills button Button minorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 126, 115, 8), NativePanel); minorSkillsButton.OnMouseClick += MinorSkillsButton_OnMouseClick; // Miscellaneous skills button Button miscSkillsButton = DaggerfallUI.AddButton(new Rect(11, 136, 115, 8), NativePanel); miscSkillsButton.OnMouseClick += MiscSkillsButton_OnMouseClick; // Inventory button Button inventoryButton = DaggerfallUI.AddButton(new Rect(3, 151, 65, 12), NativePanel); inventoryButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // Spellbook button Button spellBookButton = DaggerfallUI.AddButton(new Rect(69, 151, 65, 12), NativePanel); spellBookButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // Logbook button Button logBookButton = DaggerfallUI.AddButton(new Rect(3, 165, 65, 12), NativePanel); logBookButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // History button Button historyButton = DaggerfallUI.AddButton(new Rect(69, 165, 65, 12), NativePanel); historyButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // Exit button Button exitButton = DaggerfallUI.AddButton(new Rect(50, 179, 39, 19), NativePanel); exitButton.OnMouseClick += ExitButton_OnMouseClick; // Attribute popup text pos = new Vector2(141, 6); for (int i = 0; i < DaggerfallStats.Count; i++) { Rect rect = new Rect(pos.x, pos.y, 28, 20); AddAttributePopupButton((DFCareer.Stats)i, rect); pos.y += 24f; } // Update player paper doll for first time UpdatePlayerValues(); characterPortrait.Refresh(); }