private void RemoteItemsUpButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     remoteItemsScrollBar.ScrollIndex--;
 }
 void RerollButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     Reroll();
 }
        private void PaperDoll_OnMouseClick(BaseScreenComponent sender, Vector2 position)
        {
            // Get equip value
            byte value = paperDoll.GetEquipIndex((int)position.x, (int)position.y);
            if (value == 0xff)
                return;

            // Get item
            EquipSlots slot = (EquipSlots)value;
            DaggerfallUnityItem item = playerEntity.ItemEquipTable.GetItem(slot);
            if (item == null)
                return;

            // Handle click based on action
            if (selectedActionMode == ActionModes.Equip)
            {
                UnequipItem(item);
            }
            else if (selectedActionMode == ActionModes.Use)
            {
                NextVariant(item);
            }
            else if (selectedActionMode == ActionModes.Info)
            {
                ShowInfoPopup(item);
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="parent">Base component hosting this collection.</param>
 public ScreenComponentCollection(BaseScreenComponent parent)
     : base()
 {
     this.parent = parent;
 }
 void PreviousButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     listBox.SelectPrevious();
 }
 private void SwitchClassicButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     uiManager.PushWindow(new DaggerfallLoadClassicGameWindow(uiManager));
 }
 /// <summary>
 /// Adds a component to collection.
 /// </summary>
 /// <param name="component">Component to add.</param>
 public void Add(BaseScreenComponent component)
 {
     components.Add(component);
     component.Parent = parent;
     RaiseComponentAddedEvent(component);
 }
示例#8
0
 void LoanRepayButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick);
     ToggleTransactionInput(TransactionType.Repaying_loan);
 }
示例#9
0
        protected override void MouseLeave(BaseScreenComponent sender)
        {
            ActiveMouseOverLargeHUD = false;

            base.MouseLeave(sender);
        }
示例#10
0
 void DepoLOCButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick);
     GeneratePopup(TransactionResult.DEPOSIT_LOC);
 }
示例#11
0
 void DrawLOCButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick);
     ToggleTransactionInput(TransactionType.Withdrawing_Letter);
 }
示例#12
0
 //bank window button handlers
 void DepoGoldButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick);
     ToggleTransactionInput(TransactionType.Depositing_gold);
 }
 void ItemButton_OnRightMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     ItemButton_OnClick(sender, position, true);
 }
 void ItemButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     ItemButton_OnClick(sender, position, false);
 }
 private void CancelButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     CloseWindow();
 }
 /// <summary>
 /// Sets parent panel.
 /// Should only be used at setup, never to move components between collections.
 /// </summary>
 /// <param name="parent">Parent.</param>
 private void SetParent(BaseScreenComponent parent)
 {
     this.parent = parent;
 }
        private void SaveLoadEventHandler(BaseScreenComponent sender, Vector2 position)
        {
            if (mode == Modes.SaveGame)
            {
                // Must have a save name
                if (saveNameTextBox.Text.Length == 0)
                {
                    DaggerfallUI.MessageBox(HardStrings.youMustEnterASaveName);
                    return;
                }

                // Get save key and confirm if already exists
                int key = GameManager.Instance.SaveLoadManager.FindSaveFolderByNames(currentPlayerName, saveNameTextBox.Text);
                if (key != -1)
                {
                    DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this);
                    messageBox.SetText(HardStrings.confirmOverwriteSave, "");
                    messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes);
                    messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No);
                    messageBox.OnButtonClick += ConfirmOverwrite_OnButtonClick;
                    uiManager.PushWindow(messageBox);
                }
                else
                {
                    SaveGame();
                }
            }
            else if (mode == Modes.LoadGame)
            {
                // Must have a save name
                if (saveNameTextBox.Text.Length == 0)
                {
                    DaggerfallUI.MessageBox(HardStrings.youMustSelectASaveName);
                    return;
                }

                LoadGame();
            }
        }
示例#18
0
 void MinorSkills_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectMinorSkill((int)sender.Tag);
 }
 /// <summary>
 /// Sets parent panel.
 /// Should only be used at setup, never to move components between collections.
 /// </summary>
 /// <param name="parent">Parent.</param>
 private void SetParent(BaseScreenComponent parent)
 {
     this.parent = parent;
 }
示例#20
0
 void ReflexButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SetPlayerReflexes((PlayerReflexes)sender.Tag);
 }
        /// <summary>
        /// Raise component removed event.
        /// </summary>
        protected virtual void RaiseComponentRemovedEvent(BaseScreenComponent component)
        {
            // Raise event
            if (OnComponentRemoved != null)
            {
                // Popuate event arguments
                ComponentEventArgs e = new ComponentEventArgs()
                {
                    Component = component,
                };

                // Raise event
                OnComponentRemoved(this, e);
            }
        }
示例#22
0
 //bank window button handlers
 void DepoGoldButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     ToggleTransactionInput(TransactionType.Depositing_gold);
 }
 private void ConfirmButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     if (confirmEnabled)
         RaiseOnConfirmPathEvent();
     else
         FolderList_OnUseSelectedItem();
 }
示例#24
0
 void DepoLOCButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     GeneratePopup(TransactionResult.DEPOSIT_LOC);
 }
 void LoadRoll_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     if (rollSaved)
     {
         statsRollout.SetStats(savedRolledStats, savedWorkingStats, savedBonusPool);
         UpdateSecondaryStatLabels();
     }
 }
示例#26
0
 void DrawLOCButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     ToggleTransactionInput(TransactionType.Withdrawing_Letter);
 }
 void UpDownButtons_OnMouseUp(BaseScreenComponent sender, Vector2 position)
 {
     action = Action.None;
 }
示例#28
0
 void LoanRepayButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     ToggleTransactionInput(TransactionType.Repaying_loan);
 }
        private void RemoteItemsButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
        {
            // Get index
            int index = remoteItemsScrollBar.ScrollIndex + (int)sender.Tag;
            if (index >= remoteItemsFiltered.Count)
                return;

            // Get item
            DaggerfallUnityItem item = remoteItemsFiltered[index];
            if (item == null)
                return;

            // Handle click based on action
            if (selectedActionMode == ActionModes.Equip)
            {
                // Transfer to local items
                if (localItems != null)
                    TransferItem(item, remoteItems, localItems);

                EquipItem(item);
            }
            else if (selectedActionMode == ActionModes.Use)
            {
                NextVariant(item);
            }
            else if (selectedActionMode == ActionModes.Remove)
            {
                TransferItem(item, remoteItems, localItems);
            }
            else if (selectedActionMode == ActionModes.Info)
            {
                ShowInfoPopup(item);
            }
        }
示例#30
0
 void ExitButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     CloseWindow();
 }
 private void RemoveButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectActionMode(ActionModes.Remove);
 }
示例#32
0
 void ItemsDownButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     itemListScrollBar.ScrollIndex += scrollNum;
 }
        private void DeleteSaveButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
        {
            // Must have a save selected
            if (savesList.SelectedIndex < 0)
                return;

            // Confirmation
            DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this);
            messageBox.SetText(HardStrings.confirmDeleteSave, "");
            messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Delete);
            messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Cancel);
            messageBox.OnButtonClick += ConfirmDelete_OnButtonClick;
            uiManager.PushWindow(messageBox);
        }
示例#34
0
 void ItemsListPanel_OnMouseScrollDown(BaseScreenComponent sender)
 {
     itemListScrollBar.ScrollIndex += scrollNum;
 }
        private void SwitchCharButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
        {
            DaggerfallListPickerWindow picker = new DaggerfallListPickerWindow(uiManager, this);

            // Get ordered list of character names
            List<string> names = new List<string>();
            names.AddRange(GameManager.Instance.SaveLoadManager.CharacterNames);
            List<string> orderedNames = names.OrderBy(o => o).ToList();

            // Add to picker list
            foreach (string name in orderedNames)
            {
                picker.ListBox.AddItem(name);
            }

            // Select current character
            picker.ListBox.SelectedIndex = picker.ListBox.FindIndex(currentPlayerName);

            // Add event for selection
            picker.OnItemPicked += Picker_OnItemPicked;

            // Show window
            uiManager.PushWindow(picker);
        }
 void ItemsListPanel_OnMouseLeave(BaseScreenComponent sender)
 {
     UpdateItemsDisplay(false);
 }
        /// <summary>
        /// Offsets position of component relative to another component.
        /// </summary>
        /// <param name="component">Component to offset against.</param>
        /// <param name="side">The side of the component to offset from.</param>
        /// <param name="distance">Distance between offset components.</param>
        public void OffsetFrom(BaseScreenComponent component, Sides side, int distance)
        {
            // Exit if invalid offset
            if (component == null || side == Sides.None)
                return;

            // Get rectangles
            Rect myRect = Rectangle;
            Rect otherRect = component.Rectangle;

            // Offset based on side
            switch (side)
            {
                case Sides.Left:
                    position.x = otherRect.xMin - distance - myRect.width;
                    break;
                case Sides.Right:
                    position.x = otherRect.xMax + distance;
                    break;
                case Sides.Top:
                    position.y = otherRect.yMin - distance - myRect.height;
                    break;
                case Sides.Bottom:
                    position.y = otherRect.yMax + distance;
                    break;
            }
        }
 void RightButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     RaiseOnRightButtonClicked();
 }
示例#39
0
 void ReflexButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SetPlayerReflexes((PlayerReflexes)sender.Tag);
 }
示例#40
0
 void StatButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectStat((int)sender.Tag);
 }
 public void Remove(BaseScreenComponent component)
 {
     components.Remove(component);
     RaiseComponentRemovedEvent(component);
 }
示例#42
0
 private void DropdownButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SetDropdownExpand(!dropdownPanel.Enabled);
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 public ScreenComponentCollection()
 {
     this.parent = null;
 }
示例#44
0
 protected override void MouseLeave(BaseScreenComponent sender)
 {
     highlightedIndex = -1;
 }
 void OkButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     AcceptName();
 }
        private void GoldButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
        {
            // Get text tokens
            TextFile.Token[] textTokens = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(goldToDropID);

            // Hack to set gold pieces in text token for now
            textTokens[0].text = textTokens[0].text.Replace("%gii", GameManager.Instance.PlayerEntity.GoldPieces.ToString());

            // Show message box
            DaggerfallInputMessageBox mb = new DaggerfallInputMessageBox(uiManager, this);
            mb.SetTextTokens(textTokens);
            mb.TextPanelDistance = 0;
            mb.TextBox.Numeric = true;
            mb.OnGotUserInput += DropGoldPopup_OnGotUserInput;
            mb.Show();
        }
 void NextButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     listBox.SelectNext();
 }
 private void Ingredients_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectTabPage(TabPages.Ingredients);
 }
示例#49
0
 void StatButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectStat((int)sender.Tag);
 }
 private void LocalItemsDownButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     localItemsScrollBar.ScrollIndex++;
 }
 void OkButton_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     if (statsRollout.BonusPool > 0)
     {
         DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this);
         messageBox.SetTextTokens(strYouMustDistributeYourBonusPoints);
         messageBox.ClickAnywhereToClose = true;
         messageBox.Show();
     }
     else
     {
         CloseWindow();
     }
 }
 private void MagicItems_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     SelectTabPage(TabPages.MagicItems);
 }
 void SaveRoll_OnMouseClick(BaseScreenComponent sender, Vector2 position)
 {
     savedRolledStats.Copy(statsRollout.StartingStats);
     savedWorkingStats.Copy(statsRollout.WorkingStats);
     savedBonusPool = statsRollout.BonusPool;
     rollSaved = true;
 }
 void DownButton_OnMouseDown(BaseScreenComponent sender, Vector2 position)
 {
     action = Action.Down;
 }