Ejemplo n.º 1
0
        // Returns true when gameplay is active
        bool IsPlayingGame()
        {
            // Game not active when paused
            if (isGamePaused)
            {
                return(false);
            }

            // Game not active when SaveLoadManager not present
            if (SaveLoadManager.Instance == null)
            {
                return(false);
            }

            // Game not active when top window is neither null or HUD
            IUserInterfaceWindow topWindow = DaggerfallUI.UIManager.TopWindow;

            if (topWindow != null && !(topWindow is DaggerfallHUD))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
 public DaggerfallListPickerWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previous = null, DaggerfallFont font = null, int rowsDisplayed = 0)
     : base(uiManager, previous)
 {
     Font          = font;
     RowsDisplayed = rowsDisplayed;
 }
 public DaggerfallPopupWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager)
 {
     this.previousWindow = previousWindow;
 }
Ejemplo n.º 4
0
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, CommonMessageBoxButtons buttons, int textId, IUserInterfaceWindow previous = null, IMacroContextProvider mcp = null)
     : base(uiManager, previous)
 {
     SetupBox(textId, buttons, mcp);
 }
 public DaggerfallTravelPopUp(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null, DaggerfallTravelMapWindow travelWindow = null)
     : base(uiManager, previousWindow)
 {
     this.travelWindow = travelWindow;
 }
        public static void RepairMarkService(IUserInterfaceWindow window)
        {
            Debug.Log("Repair Recall Mark service.");

            DaggerfallUnityItem markOfRecall = FindRecallMark();

            if (markOfRecall == null)
            {
                if (GameManager.Instance.PlayerEntity.GetGoldAmount() < replaceMarkCost)
                {
                    DaggerfallUI.MessageBox(new string[] {
                        "You don't appear to have your Mark of Recall on you, or enough",
                        "for a replacement. If you have been careless and lost or broken",
                        "it, I can replace it for a price of 10,000 gold pieces. They're",
                        "expensive, and the guild only provides one free Mark per member."
                    });
                }
                else
                {
                    DaggerfallMessageBox replaceMarkBox = new DaggerfallMessageBox(DaggerfallUI.UIManager, window, true);
                    string[]             message        =
                    {
                        "   You don't appear to have your Mark of Recall on you.",
                        "   If you have been careless and lost or broken it, then",
                        "      I can replace it at a cost of 10,000 gold.",
                        "",
                        "      Would you like a replacement Mark of Recall?"
                    };
                    replaceMarkBox.SetText(message);
                    replaceMarkBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes);
                    replaceMarkBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No, true);
                    replaceMarkBox.OnButtonClick += ReplaceMarkBox_OnButtonClick;
                    replaceMarkBox.Show();
                }
            }
            else
            {
                int cost = CalculateRepairCost(markOfRecall);
                if (GameManager.Instance.PlayerEntity.GetGoldAmount() < cost)
                {
                    DaggerfallUI.MessageBox(notEnoughGoldId);
                }
                else if (cost == 0)
                {
                    if (HasLocationsBook())
                    {
                        DaggerfallUI.MessageBox("Your Mark of Recall shows no signs of wear that I can see.");
                    }
                    else
                    {
                        DaggerfallMessageBox replaceBookBox = new DaggerfallMessageBox(DaggerfallUI.UIManager, window, true);
                        string[]             message        =
                        {
                            "Your Mark of Recall shows no signs of wear that I can see.",
                            "",
                            "  However, you do appear to have misplaced your guild hall",
                            "      locations book. Would you like a replacement?"
                        };
                        replaceBookBox.SetText(message);
                        replaceBookBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Yes);
                        replaceBookBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.No, true);
                        replaceBookBox.OnButtonClick += ReplaceBookBox_OnButtonClick;
                        replaceBookBox.Show();
                    }
                }
                else
                {
                    string message = "Repairing your Mark of Recall will cost " + cost + " gp, okay?";
                    DaggerfallMessageBox confirmRepairBox = new DaggerfallMessageBox(DaggerfallUI.UIManager, DaggerfallMessageBox.CommonMessageBoxButtons.YesNo, message, window);
                    confirmRepairBox.OnButtonClick += ConfirmRepairBox_OnButtonClick;
                    confirmRepairBox.Show();
                }
            }
        }
Ejemplo n.º 7
0
 public DaggerfallCourtWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
 public DaggerfallQuestPopupWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
 /// <summary>
 /// Checks stack for a specific window.
 /// </summary>
 /// <param name="window">Window to look for.</param>
 /// <returns>True if window exists on stack.</returns>
 public bool ContainsWindow(IUserInterfaceWindow window)
 {
     return(windows.Contains(window));
 }
 public DaggerfallListPickerWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
 }
Ejemplo n.º 11
0
 public DaggerfallPopupWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager)
 {
     this.previousWindow = previousWindow;
 }
 public DaggerfallPauseOptionsWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Creates a new Daggerfall potion recipe reader window, which can be displayed like any other DaggerfallMessageBox.
 /// Daggerfall stores the ID of the potion recipe in the "typeDependentData" field.
 /// If an incorrect value of typeDependentData is provided the recipe won't be found.
 /// </summary>
 /// <param name="uiManager">The IUserInterfaceManager</param>
 /// <param name="typeDependentData">The typeDependentData variable that is the ID of the potion recipe</param>
 /// <param name="previous">The previous IUserInterfaceWindow</param>
 /// <returns>DaggerfallUnityItem.</returns>
 public DaggerfallPotionRecipeWindow(IUserInterfaceManager uiManager, int typeDependentData, IUserInterfaceWindow previous = null)
     :base(uiManager, previous)
 {
     this.recipeID = typeDependentData;
 }
 public DaggerfallTravelPopUp(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null, DaggerfallTravelMapWindow travelWindow = null)
     : base(uiManager, previousWindow)
 {
     this.travelWindow = travelWindow;
 }
Ejemplo n.º 15
0
 public UserInterfaceWindowEventArgs(IUserInterfaceWindow window)
 {
     this.Window = window;
 }
 public DaggerfallLoadClassicGameWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
Ejemplo n.º 17
0
 public DaggerfallLoadSavedGameWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
Ejemplo n.º 18
0
 public CreateCharReputationWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
 }
Ejemplo n.º 19
0
 public CreateCharSpecialAdvantageWindow(IUserInterfaceManager uiManager, List <SpecialAdvDis> advDisList, List <SpecialAdvDis> otherList, DFCareer careerData, IUserInterfaceWindow previous = null, bool isDisadvantages = false)
     : base(uiManager, previous)
 {
     this.isDisadvantages = isDisadvantages;
     this.advDisList      = advDisList;
     this.otherList       = otherList;
     this.advantageData   = careerData;
 }
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
 }
 public DaggerfallPopupWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null, int screenWidth = 320, int screenHeight = 200)
     : base(uiManager, screenWidth, screenHeight)
 {
     this.previousWindow   = previousWindow;
     this.screenDimColor.a = 0; //DaggerfallUnity.Settings.DimAlphaStrength;
 }
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
 }
Ejemplo n.º 23
0
        public static void CustomArmorService(IUserInterfaceWindow window)
        {
            Debug.Log("Custom Armor service.");

            PlayerEntity playerEntity = GameManager.Instance.PlayerEntity;
            ItemHelper   itemHelper   = DaggerfallUnity.Instance.ItemHelper;

            if (playerEntity.Level < 9)
            {
                DaggerfallUI.MessageBox("Sorry I have not yet sourced enough rare materials to make you armor.");
                return;
            }
            ItemCollection armorItems = new ItemCollection();
            Array          armorTypes = itemHelper.GetEnumArray(ItemGroups.Armor);

            foreach (ArmorMaterialTypes material in customArmorMaterials)
            {
                if (playerEntity.Level < 9 ||
                    (playerEntity.Level < 12 && material >= ArmorMaterialTypes.Adamantium) ||
                    (playerEntity.Level < 15 && material >= ArmorMaterialTypes.Orcish) ||
                    (playerEntity.Level < 18 && material >= ArmorMaterialTypes.Daedric))
                {
                    break;
                }

                for (int i = 0; i < armorTypes.Length; i++)
                {
                    Armor        armorType    = (Armor)armorTypes.GetValue(i);
                    ItemTemplate itemTemplate = itemHelper.GetItemTemplate(ItemGroups.Armor, i);
                    int          vs           = 0;
                    int          vf           = 0;
                    switch (armorType)
                    {
                    case Armor.Cuirass:
                    case Armor.Left_Pauldron:
                    case Armor.Right_Pauldron:
                        vs = 1;
                        vf = 3;
                        break;

                    case Armor.Greaves:
                        vs = 2;
                        vf = 5;
                        break;

                    case Armor.Gauntlets:
                        vs = 1;
                        vf = 1;
                        break;

                    case Armor.Boots:
                    case Armor.Helm:
                        vs = 1;
                        vf = itemTemplate.variants - 1;
                        break;

                    default:
                        continue;
                    }
                    for (int v = vs; v <= vf; v++)
                    {
                        armorItems.AddItem(ItemBuilder.CreateArmor(playerEntity.Gender, playerEntity.Race, armorType, material, v));
                    }
                }
                int[] customItemTemplates = itemHelper.GetCustomItemsForGroup(ItemGroups.Armor);
                for (int i = 0; i < customItemTemplates.Length; i++)
                {
                    DaggerfallUnityItem item = ItemBuilder.CreateItem(ItemGroups.Armor, customItemTemplates[i]);
                    ItemBuilder.ApplyArmorSettings(item, playerEntity.Gender, playerEntity.Race, material);
                    armorItems.AddItem(item);
                }
            }

            DaggerfallTradeWindow tradeWindow = (DaggerfallTradeWindow)
                                                UIWindowFactory.GetInstanceWithArgs(UIWindowType.Trade, new object[] { DaggerfallUI.UIManager, null, DaggerfallTradeWindow.WindowModes.Buy, null });

            tradeWindow.MerchantItems = armorItems;
            DaggerfallUI.UIManager.PushWindow(tradeWindow);
        }
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, CommonMessageBoxButtons buttons, int textId, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
     SetupBox(textId, buttons);
 }
 public DaggerfallJoystickControlsWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
Ejemplo n.º 26
0
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, CommonMessageBoxButtons buttons, TextFile.Token[] tokens, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
     SetupBox(tokens, buttons);
 }
Ejemplo n.º 27
0
 public DaggerfallMessageBox(IUserInterfaceManager uiManager, CommonMessageBoxButtons buttons, string text, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
     SetupBox(text, buttons);
 }
Ejemplo n.º 28
0
 public TravelOptionsPopUp(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null, DaggerfallTravelMapWindow travelWindow = null)
     : base(uiManager, previousWindow, travelWindow)
 {
 }
 public DaggerfallPopupWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null, int screenWidth = 320, int screenHeight = 200)
     : base(uiManager, screenWidth, screenHeight)
 {
     this.previousWindow = previousWindow;
 }
Ejemplo n.º 30
0
 public UIItem(object jobId, IUserInterfaceWindow ui)
 {
     this.JobId = jobId;
     this.Value = ui;
 }
Ejemplo n.º 31
0
 public DaggerfallPauseOptionsWindow(IUserInterfaceManager uiManager, IUserInterfaceWindow previousWindow = null)
     : base(uiManager, previousWindow)
 {
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Creates a new Daggerfall potion recipe reader window, which can be displayed like any other DaggerfallMesasageBox
 /// Daggerfall stores the ID of the potion recipe in the "hits3" field, so it's critical that a real value be passed in.
 /// The recipe lookup is later performed using a helper function (ItemHelper.getPotionRecipesByHits3)
 /// If the incorrect value of hits3 is provided the recipe won't be found
 /// </summary>
 /// <param name="uiManager">The IUserInterfaceManager</param>
 /// <param name="hits3">The hits3 variable that encodes the ID of the potion recipe</param>
 /// <param name="previous">The previous IUserInterfaceWindow</param>
 /// <returns>DaggerfallUnityItem.</returns>
 public DaggerfallPotionRecipeWindow(IUserInterfaceManager uiManager, int hits3, IUserInterfaceWindow previous = null)
     : base(uiManager, previous)
 {
     this.hits3 = hits3;
 }