void SetupCostAndGold() { costPanel = DaggerfallUI.AddPanel(costPanelRect, NativePanel); costPanel.BackgroundTexture = costPanelTexture; costLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(28, 2), costPanel); goldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(68, 2), costPanel); }
protected override void Setup() { // Load textures LoadTextures(); // Create interface panel mainPanel.HorizontalAlignment = HorizontalAlignment.Center; mainPanel.VerticalAlignment = VerticalAlignment.Middle; mainPanel.BackgroundTexture = baseTexture; mainPanel.Position = mainPanelRect.position; mainPanel.Size = mainPanelRect.size; destinationPanel = DaggerfallUI.AddPanel(destinationPanelRect, mainPanel); destinationLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(1, 1), destinationPanel); destinationLabel.ShadowColor = DaggerfallUI.DaggerfallDefaultShadowColor; destinationLabel.HorizontalAlignment = HorizontalAlignment.Center; destinationLabel.Text = destinationName; // Yes button yesButton = DaggerfallUI.AddButton(yesButtonRect, mainPanel); yesButton.OnMouseClick += YesButton_OnMouseClick; yesButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.Yes); // No button noButton = DaggerfallUI.AddButton(noButtonRect, mainPanel); noButton.OnMouseClick += NoButton_OnMouseClick; noButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.No); NativePanel.Components.Add(mainPanel); }
void SetupLabels() { itemNameLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(52, 3), NativePanel); availableGoldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(71, 15), NativePanel); goldCostLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(64, 27), NativePanel); enchantmentCostLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(98, 39), NativePanel); }
void SetupLabels() { nameLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(52, 3), NativePanel); goldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(71, 15), NativePanel); costLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(64, 27), NativePanel); enchantLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(98, 39), NativePanel); }
protected override void Setup() { // Load textures LoadTextures(); // Create interface panel mainPanel.HorizontalAlignment = HorizontalAlignment.Center; mainPanel.VerticalAlignment = VerticalAlignment.Middle; mainPanel.BackgroundTexture = baseTexture; mainPanel.Position = new Vector2(0, 50); mainPanel.Size = new Vector2(baseTexture.width, baseTexture.height); destinationPanel = DaggerfallUI.AddPanel(destinationPanelRect, mainPanel); destinationLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(1, 1), destinationPanel); destinationLabel.ShadowColor = DaggerfallUI.DaggerfallDefaultShadowColor; destinationLabel.HorizontalAlignment = HorizontalAlignment.Center; destinationLabel.Text = destinationName; // Yes button yesButton = DaggerfallUI.AddButton(yesButtonRect, mainPanel); yesButton.OnMouseClick += YesButton_OnMouseClick; // No button noButton = DaggerfallUI.AddButton(noButtonRect, mainPanel); noButton.OnMouseClick += NoButton_OnMouseClick; NativePanel.Components.Add(mainPanel); }
public PaperDoll() { // Setup panels Size = new Vector2(paperDollWidth, paperDollHeight); characterPanel.Size = new Vector2(paperDollWidth, paperDollHeight); // Add panels Components.Add(backgroundPanel); Components.Add(characterPanel); // Set initial display flags backgroundPanel.Enabled = showBackgroundLayer; characterPanel.Enabled = showCharacterLayer; for (int bpIdx = 0; bpIdx < DaggerfallEntity.NumberBodyParts; bpIdx++) { armourLabelsB[bpIdx] = DaggerfallUI.AddDefaultShadowedTextLabel(armourLabelPosB[bpIdx], characterPanel); armourLabelsB[bpIdx].Text = ""; armourLabelsS[bpIdx] = DaggerfallUI.AddDefaultShadowedTextLabel(armourLabelPosS[bpIdx], characterPanel); armourLabelsS[bpIdx].Text = ""; armourLabelsP[bpIdx] = DaggerfallUI.AddDefaultShadowedTextLabel(armourLabelPosP[bpIdx], characterPanel); armourLabelsP[bpIdx].Text = ""; shieldLabels[bpIdx] = DaggerfallUI.AddDefaultShadowedTextLabel(shieldLabelsPos[bpIdx], characterPanel); shieldLabels[bpIdx].Text = ""; } }
public PaperDoll() { // Create target arrays paperDollColors = new Color32[paperDollWidth * paperDollHeight]; paperDollIndices = new byte[paperDollWidth * paperDollHeight]; // Setup panels Size = new Vector2(paperDollWidth, paperDollHeight); characterPanel.Size = new Vector2(paperDollWidth, paperDollHeight); // Add panels Components.Add(backgroundPanel); Components.Add(characterPanel); // Set initial display flags backgroundPanel.Enabled = showBackgroundLayer; characterPanel.Enabled = showCharacterLayer; for (int bpIdx = 0; bpIdx < DaggerfallEntity.NumberBodyParts; bpIdx++) { armourLabels[bpIdx] = DaggerfallUI.AddDefaultShadowedTextLabel(armourLabelPos[bpIdx], characterPanel); armourLabels[bpIdx].Text = "0"; } }
void SetupLabels() { nameLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(33, 185), NativePanel); //costLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(174, 185), NativePanel); goldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(237, 185), NativePanel); }
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.OnMouseClick += InventoryButton_OnMouseClick; //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.OnMouseClick += LogBookButton_OnMouseClick; //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; } statsRollout = new StatsRollout(true); statsRollout.OnStatChanged += StatsRollout_OnStatChanged; // Update player paper doll for first time UpdatePlayerValues(); 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 panelPos = new Vector2(141, 17); for (int i = 0; i < DaggerfallStats.Count; i++) { statPanels[i] = DaggerfallUI.AddPanel(new Rect(panelPos.x, panelPos.y, 28, 6), NativePanel); statLabels[i] = DaggerfallUI.AddDefaultShadowedTextLabel(Vector2.zero, statPanels[i]); statLabels[i].HorizontalAlignment = HorizontalAlignment.Center; panelPos.y += 24f; } // Name button Button nameButton = DaggerfallUI.AddButton(new Rect(4, 3, 132, 8), NativePanel); nameButton.OnMouseClick += NameButton_OnMouseClick; nameButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetName); // Level button Button levelButton = DaggerfallUI.AddButton(new Rect(4, 33, 132, 8), NativePanel); levelButton.OnMouseClick += LevelButton_OnMouseClick; levelButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetLevel); // Gold button Button goldButton = DaggerfallUI.AddButton(new Rect(4, 43, 132, 8), NativePanel); goldButton.OnMouseClick += GoldButton_OnMouseClick; goldButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetGold); // Health button Button healthButton = DaggerfallUI.AddButton(new Rect(4, 63, 128, 8), NativePanel); healthButton.OnMouseClick += HealthButton_OnMouseClick; healthButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetHealth); // Affiliations button Button affiliationsButton = DaggerfallUI.AddButton(new Rect(3, 84, 130, 8), NativePanel); affiliationsButton.OnMouseClick += AffiliationsButton_OnMouseClick; affiliationsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetAffiliations); // Primary skills button Button primarySkillsButton = DaggerfallUI.AddButton(new Rect(11, 106, 115, 8), NativePanel); primarySkillsButton.OnMouseClick += PrimarySkillsButton_OnMouseClick; primarySkillsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetPrimarySkills); // Major skills button Button majorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 116, 115, 8), NativePanel); majorSkillsButton.OnMouseClick += MajorSkillsButton_OnMouseClick; majorSkillsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetMajorSkills); // Minor skills button Button minorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 126, 115, 8), NativePanel); minorSkillsButton.OnMouseClick += MinorSkillsButton_OnMouseClick; minorSkillsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetMinorSkills); // Miscellaneous skills button Button miscSkillsButton = DaggerfallUI.AddButton(new Rect(11, 136, 115, 8), NativePanel); miscSkillsButton.OnMouseClick += MiscSkillsButton_OnMouseClick; miscSkillsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetMiscSkills); // Inventory button Button inventoryButton = DaggerfallUI.AddButton(new Rect(3, 151, 65, 12), NativePanel); inventoryButton.OnMouseClick += InventoryButton_OnMouseClick; inventoryButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetInventory); inventoryButton.OnKeyboardEvent += InventoryButton_OnKeyboardEvent; // Spellbook button Button spellBookButton = DaggerfallUI.AddButton(new Rect(69, 151, 65, 12), NativePanel); spellBookButton.OnMouseClick += SpellBookButton_OnMouseClick; spellBookButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetSpellbook); spellBookButton.OnKeyboardEvent += SpellBookButton_OnKeyboardEvent; // Logbook button Button logBookButton = DaggerfallUI.AddButton(new Rect(3, 165, 65, 12), NativePanel); logBookButton.OnMouseClick += LogBookButton_OnMouseClick; logBookButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetLogbook); logBookButton.OnKeyboardEvent += LogBookButton_OnKeyboardEvent; // History button Button historyButton = DaggerfallUI.AddButton(new Rect(69, 165, 65, 12), NativePanel); historyButton.OnMouseClick += HistoryButton_OnMouseClick; historyButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetHistory); historyButton.OnKeyboardEvent += HistoryButton_OnKeyboardEvent; // Exit button Button exitButton = DaggerfallUI.AddButton(new Rect(50, 179, 39, 19), NativePanel); exitButton.OnMouseClick += ExitButton_OnMouseClick; exitButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.CharacterSheetExit); exitButton.OnKeyboardEvent += ExitButton_OnKeyboardEvent; // Attribute popup text Vector2 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; } statsRollout = new StatsRollout(true); statsRollout.OnStatChanged += StatsRollout_OnStatChanged; // Update player paper doll for first time UpdatePlayerValues(); characterPortrait.Refresh(); // Store toggle closed binding for this window toggleClosedBinding = InputManager.Instance.GetBinding(InputManager.Actions.CharacterSheet); }