Exemplo n.º 1
0
 private void ResetGame()
 {
     GuiBase.ShowDialog("Everything will be resetted to the base values.", "Do you really want to reset the game?", delegate
     {
         if (App.CurrentPlattform == Plattform.Kongregate)
         {
             MainUi.ExportToClipboard();
             MainUi.ResetGame();
             GuiBase.ShowToast("Game resetted and your gamestate is saved to the clipboard in case you still want to keep it somewhere.");
         }
         else if (App.CurrentPlattform == Plattform.Steam)
         {
             string text = "SaveBeforeReset";
             string str  = Application.dataPath + "\\" + text;
             Storage.SaveGameState(App.State, text);
             MainUi.ResetGame();
             GuiBase.ShowToast("Game resetted and your game is saved to " + str + " in case you still want to keep it somewhere.");
         }
         else
         {
             MainUi.ResetGame();
         }
     }, delegate
     {
     }, "Yes", "No", false, false);
 }
            public new void Draw()
            {
                base.Draw();
                double percent = this.CurrentHP.Double / this.MaxHp.Double;

                GuiBase.CreateBossHPBar(750, 560, 200f, 35f, percent, "Boss HP: " + this.CurrentHP.GuiText + " / " + this.MaxHp.GuiText);
            }
Exemplo n.º 3
0
        public static void ShowToolTip(string infotext = "")
        {
            if (Event.current.button != 1 && App.State.GameSettings.ShowToolTipsOnRightClick)
            {
                return;
            }
            if (GuiBase.toastIsShowing && !App.State.GameSettings.ShowToolTipsOnRightClick)
            {
                return;
            }
            string text = GUI.tooltip;

            if (!string.IsNullOrEmpty(infotext))
            {
                text = infotext;
            }
            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            if (App.State.GameSettings.ShowToolTipsOnTop && string.IsNullOrEmpty(infotext))
            {
                GuiBase.ShowTextBoxOnTop(text);
            }
            else
            {
                GuiBase.ShowTextBox(text, !string.IsNullOrEmpty(infotext));
            }
        }
 public void SetDifficulty(int level)
 {
     this.MissCount   = 0;
     this.hitAreaLeft = UnityEngine.Random.Range(20, (int)(this.totalWith - 30f));
     this.hitAreaWith = 20 - level / 8;
     if (this.hitAreaWith < 3)
     {
         this.hitAreaWith = 3;
     }
     this.hitAreaWith += App.State.PremiumBoni.TbsExtraPixels;
     if (this.TypeEnum == TBSUi.HitType.bottom || this.TypeEnum == TBSUi.HitType.top)
     {
         this.hitAreaWith = (int)GuiBase.Height((float)this.hitAreaWith);
     }
     else
     {
         this.hitAreaWith = (int)GuiBase.Width((float)this.hitAreaWith);
     }
     this.progressSpeed = 0.5f + 0.1f * (float)level / 5f;
     if (this.progressSpeed > 1.5f)
     {
         this.progressSpeed = 1.5f;
     }
     this.progressSpeed = this.progressSpeed * this.totalWith / 100f;
 }
Exemplo n.º 5
0
 protected void NumberInput(int marginLeft = 500, int marginTop = 200)
 {
     GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
     GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(350f), GuiBase.Height(50f)), GuiBase.NumberInputText);
     marginTop += 50;
     GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), GuiBase.NumberInputNumber.GuiText, Gui.ChosenSkin.textField);
     marginTop += 40;
     this.AddInputButton(marginLeft, marginTop, 1);
     this.AddInputButton(marginLeft + 70, marginTop, 2);
     this.AddInputButton(marginLeft + 140, marginTop, 3);
     this.AddInputButton(marginLeft, marginTop + 35, 4);
     this.AddInputButton(marginLeft + 70, marginTop + 35, 5);
     this.AddInputButton(marginLeft + 140, marginTop + 35, 6);
     this.AddInputButton(marginLeft, marginTop + 70, 7);
     this.AddInputButton(marginLeft + 70, marginTop + 70, 8);
     this.AddInputButton(marginLeft + 140, marginTop + 70, 9);
     this.AddInputButton(marginLeft, marginTop + 105, 0);
     this.AddInputButton(marginLeft + 70, marginTop + 105, -1);
     this.AddInputButton(marginLeft + 140, marginTop + 105, -2);
     if (GUI.Button(new Rect(GuiBase.Width((float)(marginLeft + 105)), GuiBase.Height((float)(marginTop + 145)), GuiBase.Width(95f), GuiBase.Height(30f)), "OK"))
     {
         GuiBase.NumberInputAction(GuiBase.NumberInputNumber);
         this.ResetNumberInput();
     }
     if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)(marginTop + 145)), GuiBase.Width(95f), GuiBase.Height(30f)), "Cancel"))
     {
         this.ResetNumberInput();
     }
 }
Exemplo n.º 6
0
        public void show()
        {
            GUIStyle style = GUI.skin.GetStyle("Label");

            style.alignment = TextAnchor.UpperLeft;
            style.fontSize  = GuiBase.FontSize(16);
            GUI.BeginGroup(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)));
            GUI.Box(new Rect(GuiBase.Width(0f), GuiBase.Height(0f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height(15f), GuiBase.Width(400f), GuiBase.Height(30f)), new GUIContent("For more in depth guides, please visit the forum"));
            if (GUI.Button(new Rect(GuiBase.Width(420f), GuiBase.Height(15f), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Forum", "In the Sticky: Game Guides there are various guides for the game.")))
            {
                App.OpenWebsite("http://www.kongregate.com/forums/2874-idling-to-rule-the-gods/topics/609942-game-guides");
            }
            if (GUI.Button(new Rect(GuiBase.Width(520f), GuiBase.Height(15f), GuiBase.Width(80f), GuiBase.Height(30f)), new GUIContent("Wiki", "A wiki with info and tips about this game.")))
            {
                App.OpenWebsite("http://itrtg.wikia.com/wiki/Idling_to_Rule_the_Gods_Wiki");
            }
            TextAsset textAsset = Resources.Load("faq") as TextAsset;
            string    text      = textAsset.text;
            GUIStyle  gUIStyle  = new GUIStyle();

            gUIStyle.richText = true;
            int num = (int)style.CalcHeight(new GUIContent(text), GuiBase.Width(590f));

            this.scrollPosition = GuiBase.TouchScrollView(new Rect(GuiBase.Width(0f), GuiBase.Height(55f), GuiBase.Width(640f), GuiBase.Height(400f)), this.scrollPosition, new Rect(0f, GuiBase.Height(15f), GuiBase.Width(620f), (float)num + GuiBase.Height(60f)));
            style.fontStyle     = FontStyle.Normal;
            style.alignment     = TextAnchor.UpperLeft;
            GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height(30f), GuiBase.Width(590f), (float)num + GuiBase.Height(60f)), text);
            GUI.EndScrollView();
            GUI.EndGroup();
        }
Exemplo n.º 7
0
        protected void AddInputButton(int marginLeft, int marginTop, int number)
        {
            string text = number.ToString();

            if (number == -1)
            {
                text = "Clear";
            }
            else if (number == -2)
            {
                text = "<-";
            }
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(60f), GuiBase.Height(30f)), text))
            {
                if (number == -1)
                {
                    GuiBase.NumberInputNumber = 0;
                }
                else if (number == -2)
                {
                    GuiBase.NumberInputNumber /= 10;
                    GuiBase.NumberInputNumber.Floor();
                }
                else
                {
                    GuiBase.NumberInputNumber = GuiBase.NumberInputNumber * 10 + number;
                    if (GuiBase.NumberInputNumber > GuiBase.NumberInputMaxNumber && GuiBase.NumberInputMaxNumber > 0)
                    {
                        GuiBase.NumberInputNumber = GuiBase.NumberInputMaxNumber;
                    }
                }
            }
        }
        private void ShowKongregateConnect(int marginLeft, int marginTop)
        {
            GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(230f)), "Please open the game on Kongregate an input the Kongregate Name and Id to the input-fields below.");
            marginTop += 60;
            GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(230f)), "Kongregate Id: ");
            string s = GUI.TextField(new Rect(GuiBase.Width((float)(marginLeft + 180)), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), ConnectArea.KongIdInput.ToString());

            long.TryParse(s, out ConnectArea.KongIdInput);
            marginTop += 40;
            GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(230f)), "Kongregate Name: ");
            ConnectArea.KongNameInput = GUI.TextField(new Rect(GuiBase.Width((float)(marginLeft + 180)), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), ConnectArea.KongNameInput);
            marginTop += 60;
            if (App.CurrentPlattform == Plattform.Steam)
            {
                GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(230f)), "If you get the Kongregate Save, you can't get achievements in Steam!");
                marginTop += 35;
            }
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(250f), GuiBase.Height(30f)), new GUIContent("Get Kongregate Save", "This will overwrite your current save, then import the online save from Kongregate, if the id and name are correct. Loading online in Kongregate will then connect your saves.")))
            {
                UpdateStats.LoadFromServer(UpdateStats.ServerSaveType.Automatic);
                UpdateStats.GetKongSaveAfterConnecting = true;
            }
            marginTop += 40;
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(250f), GuiBase.Height(30f)), new GUIContent("Overwrite Kongregate Save", "This will overwrite your Kongregate online save if the id and name are correct. Loading online in Kongregate will then move your current save to Kongregate and connect the saves.")))
            {
                UpdateStats.LoadFromServer(UpdateStats.ServerSaveType.Automatic);
                UpdateStats.OverwriteKongSave = true;
            }
        }
Exemplo n.º 9
0
        private static void ShowTextBoxOnTop(string infotext)
        {
            GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(10f), GuiBase.Width(660f), GuiBase.Height(95f)), string.Empty);
            GUIStyle style = GUI.skin.GetStyle("Label");

            style.fontSize  = GuiBase.FontSize(12);
            style.alignment = TextAnchor.UpperLeft;
            int num  = 12;
            int num2 = 300;
            int num3 = 650;

            string[] array = infotext.Split(new string[]
            {
                "lowerText"
            }, StringSplitOptions.None);
            string text = string.Empty;

            if (array.Length > 0)
            {
                text = array[0];
            }
            if (array.Length == 2)
            {
                text = text + "\n" + array[1].Replace("\n", " - ");
                if (text.Contains(" - Defense") || text.Contains("Clones) - "))
                {
                    text = text.Replace(" - Defense", "\nDefense:");
                    text = text.Replace("Clones) - ", "Clones)\n");
                }
            }
            GUI.Label(new Rect(GuiBase.Width((float)num2), GuiBase.Height((float)num), GuiBase.Width((float)num3), GuiBase.Height(110f)), text);
        }
Exemplo n.º 10
0
        protected void showToast()
        {
            if (!GuiBase.toastIsShowing)
            {
                return;
            }
            long num  = DateTime.Now.Ticks / 10000L;
            long num2 = num - GuiBase.toasttimer;

            if (num2 < 2500L)
            {
                if (App.State.GameSettings.ShowToolTipsOnRightClick)
                {
                    GuiBase.ShowTextBoxOnTop(GuiBase.toastTest);
                }
                else
                {
                    GuiBase.ShowTextBox(GuiBase.toastTest, false);
                }
            }
            else
            {
                GuiBase.toastIsShowing = false;
            }
        }
Exemplo n.º 11
0
 private static void ShowTextBox(string textToShow, bool isFromInfoArea = false)
 {
     if (!string.IsNullOrEmpty(textToShow))
     {
         GUIStyle style = GUI.skin.GetStyle("Label");
         style.fontSize  = GuiBase.FontSize(15);
         style.alignment = TextAnchor.UpperLeft;
         float    x      = Input.mousePosition.x;
         float    num    = (float)Screen.height - Input.mousePosition.y;
         Vector2  vector = new Vector2(x, num);
         float    num2   = GuiBase.Width(275f);
         float    width  = GuiBase.Width(260f);
         string   text   = string.Empty;
         string   text2  = string.Empty;
         string[] array  = textToShow.Split(new string[]
         {
             "lowerText"
         }, StringSplitOptions.None);
         if (array.Length != 2)
         {
             text = textToShow;
         }
         else
         {
             text  = array[0];
             text2 = array[1];
         }
         float num3 = style.CalcHeight(new GUIContent(text), width) + GuiBase.Height(10f);
         float num4 = 0f;
         if (!string.IsNullOrEmpty(text2))
         {
             num4 = style.CalcHeight(new GUIContent(text2), width) + GuiBase.Height(10f);
         }
         float num5 = vector.x - num2 - 5f;
         float num6 = vector.y - num3 - num4 + GuiBase.Height(20f);
         float num7 = num2;
         if (x < num7 || AfkUi.Instance.ShowAfk)
         {
             num5 = vector.x + GuiBase.Width(20f);
         }
         if (num < num3 + num4)
         {
             num6 = vector.y - GuiBase.Height(10f);
         }
         if (isFromInfoArea)
         {
             num5  = GuiBase.Width(10f);
             num6 -= GuiBase.Height(30f);
         }
         GUI.Box(new Rect(num5, num6, num2, num3), string.Empty);
         GUI.Label(new Rect(num5 + GuiBase.Width(10f), num6 + GuiBase.Height(5f), width, num3 - GuiBase.Height(10f)), text);
         if (!string.IsNullOrEmpty(text2))
         {
             style.fontSize = GuiBase.FontSize(13);
             num4           = style.CalcHeight(new GUIContent(text2), width) + GuiBase.Height(10f);
             GUI.Box(new Rect(num5, num6 + num3, num2, num4), string.Empty);
             GUI.Label(new Rect(num5 + GuiBase.Width(10f), num6 + num3 + GuiBase.Height(5f), width, num4), text2);
         }
     }
 }
Exemplo n.º 12
0
 private static int AddItem(string text, string dialogText, int marginTop, int cost, GUIStyle labelStyle, Action result)
 {
     GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)marginTop), GuiBase.Width(390f), GuiBase.Height(130f)), text);
     GUI.Label(new Rect(GuiBase.Width(590f), GuiBase.Height((float)marginTop), GuiBase.Width(32f), GuiBase.Height(32f)), GodPowerUi.godPower);
     if (GUI.Button(new Rect(GuiBase.Width(420f), GuiBase.Height((float)marginTop), GuiBase.Width(140f), GuiBase.Height(28f)), new GUIContent("Get it for " + cost)))
     {
         GuiBase.ShowDialog("Are you sure?", string.Concat(new object[]
         {
             "This will use up ",
             cost,
             " god power and ",
             dialogText
         }), delegate
         {
             if (GodPowerUi.SpendGodPower(cost))
             {
                 result();
                 App.SaveGameState();
             }
         }, delegate
         {
         }, "Yes", "No", false, false);
     }
     return(marginTop + 30);
 }
 internal void Update()
 {
     if (this.skillToSelectKey != null)
     {
         IEnumerator enumerator = Enum.GetValues(typeof(KeyCode)).GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 KeyCode keyCode = (KeyCode)enumerator.Current;
                 if (Input.GetKeyDown(keyCode) && this.skillsToShow != null)
                 {
                     if (keyCode != KeyCode.Mouse0 && keyCode != KeyCode.Mouse1)
                     {
                         KeyCode keyPress = this.skillToSelectKey.Extension.KeyPress;
                         this.skillToSelectKey.Extension.KeyPress = keyCode;
                         GuiBase.ShowToast(this.skillToSelectKey.Name + " is now bound to " + keyCode.ToString());
                         foreach (Skill current in this.skillsToShow)
                         {
                             if (current != this.skillToSelectKey && current.Extension.KeyPress == keyCode)
                             {
                                 current.Extension.KeyPress = keyPress;
                             }
                         }
                     }
                     this.skillToSelectKey = null;
                 }
             }
         }
         finally
         {
             IDisposable disposable;
             if ((disposable = (enumerator as IDisposable)) != null)
             {
                 disposable.Dispose();
             }
         }
     }
     if (!this.Battle.IsFighting)
     {
         return;
     }
     if (this.skillsToShow != null)
     {
         foreach (Skill current2 in this.skillsToShow)
         {
             if (Input.GetKey(current2.Extension.KeyPress))
             {
                 if (!this.Battle.IsFighting)
                 {
                     GuiBase.ShowToast("Start the fight first!");
                 }
                 else if (current2.Extension.CoolDownCurrent <= 0L && current2.IsAvailable)
                 {
                     this.Battle.UseSkill(current2, true);
                 }
             }
         }
     }
 }
 private int AddLine(int marginTop, string left, string right, string info, int height = 30)
 {
     GUI.Label(new Rect(GuiBase.Width(20f), GuiBase.Height((float)marginTop), GuiBase.Width(300f), GuiBase.Height((float)height)), new GUIContent(left, info));
     GUI.Label(new Rect(GuiBase.Width(320f), GuiBase.Height((float)marginTop), GuiBase.Width(300f), GuiBase.Height((float)height)), new GUIContent(right, info));
     marginTop += 23;
     return(marginTop);
 }
        private int addBPRow(string name, ref int marginTop, int value)
        {
            int result = value;

            GUI.Label(new Rect(GuiBase.Width(40f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), name);
            GUI.Label(new Rect(GuiBase.Width(180f), GuiBase.Height((float)marginTop), GuiBase.Width(150f), GuiBase.Height(30f)), "level: " + value);
            if (App.State.HomePlanet.BaalPower >= 1 && GUI.Button(new Rect(GuiBase.Width(300f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+1"))
            {
                App.State.HomePlanet.BaalPower--;
                result = value + 1;
            }
            if (App.State.HomePlanet.BaalPower >= 5 && GUI.Button(new Rect(GuiBase.Width(350f), GuiBase.Height((float)marginTop), GuiBase.Width(40f), GuiBase.Height(30f)), "+5"))
            {
                App.State.HomePlanet.BaalPower -= 5;
                result = value + 5;
            }
            if (App.State.HomePlanet.BaalPower >= 10 && GUI.Button(new Rect(GuiBase.Width(400f), GuiBase.Height((float)marginTop), GuiBase.Width(45f), GuiBase.Height(30f)), "+10"))
            {
                App.State.HomePlanet.BaalPower -= 10;
                result = value + 10;
            }
            if (App.State.HomePlanet.BaalPower >= 50 && GUI.Button(new Rect(GuiBase.Width(455f), GuiBase.Height((float)marginTop), GuiBase.Width(45f), GuiBase.Height(30f)), "+50"))
            {
                App.State.HomePlanet.BaalPower -= 50;
                result = value + 50;
            }
            marginTop += 30;
            return(result);
        }
Exemplo n.º 16
0
 protected override void ShowLabels(int marginTop, GUIStyle labelStyle)
 {
     labelStyle.alignment = TextAnchor.MiddleLeft;
     labelStyle.fontStyle = FontStyle.Normal;
     labelStyle.fontSize  = GuiBase.FontSize(16);
     GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height(40f), GuiBase.Width(200f), GuiBase.Height(30f)), new GUIContent("Stop after finish", "If this is on, clones will be removed from monuments when it is finished. This will ignore the number in 'Stop at'."));
     App.State.GameSettings.StopMonumentBuilding = GUI.Toggle(new Rect(GuiBase.Width(200f), GuiBase.Height(47f), GuiBase.Width(300f), GuiBase.Height(30f)), App.State.GameSettings.StopMonumentBuilding, new GUIContent(string.Empty));
     if (App.State.IsBuyUnlocked)
     {
         string text = "If this is on, missing creations will be bought automatically if you have enough divinity.";
         if (App.State.PremiumBoni.AutoBuyCostReduction < 20)
         {
             text = string.Concat(new object[]
             {
                 text,
                 "\nBut beware: there is an additional ",
                 20 - App.State.PremiumBoni.AutoBuyCostReduction,
                 "% transaction fee!"
             });
         }
         GUI.Label(new Rect(GuiBase.Width(365f), GuiBase.Height(40f), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Auto buy missing creations", text));
         App.State.GameSettings.AutoBuyCreationsForMonuments = GUI.Toggle(new Rect(GuiBase.Width(593f), GuiBase.Height(47f), GuiBase.Width(300f), GuiBase.Height(30f)), App.State.GameSettings.AutoBuyCreationsForMonuments, new GUIContent(string.Empty));
     }
     labelStyle.alignment = TextAnchor.UpperCenter;
     labelStyle.fontStyle = FontStyle.Bold;
     labelStyle.fontSize  = GuiBase.FontSize(18);
     marginTop           += 5;
     GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), new GUIContent("Monument", "All monuments share the same multiplier. That means, if one monument multiplies a stat with 1 + 200 and another one multiplies it with 1 + 400, it would be a total multiplier of 601."));
     GUI.Label(new Rect(GuiBase.Width(220f), GuiBase.Height((float)marginTop), GuiBase.Width(80f), GuiBase.Height(30f)), "Count", labelStyle);
     GUI.Label(new Rect(GuiBase.Width(290f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Next At", "If your monument count is at least as much as the count in the input-field, the clones will be moved to the next monument if the next monument has neither 0 as an input nor the level has reached that number. '0' is not limited."), labelStyle);
     GUI.Label(new Rect(GuiBase.Width(380f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Clones", labelStyle);
     labelStyle.fontSize = GuiBase.FontSize(16);
 }
Exemplo n.º 17
0
 public override bool Init()
 {
     this.scrollViewHeight = 50 + App.State.AllFights.Count * 35;
     if (this.IsAchievement)
     {
         GuiBase.ShowAchievements(App.State.FightingAchievements, "battle");
     }
     return(this.IsAchievement);
 }
 public override bool Init()
 {
     this.scrollViewHeight = 20 + App.State.AllSkills.Count * 35;
     if (this.IsAchievement)
     {
         GuiBase.ShowAchievements(App.State.SkillAchievements, "mystic");
     }
     return(this.IsAchievement);
 }
Exemplo n.º 19
0
        public static void ShowDialog(string header, string text, Action leftButton, Action rightButton, string leftButtonText = "Yes", string rightButtonText = "No", bool fullScreen = false, bool notInMainThread = false)
        {
            GuiBase.FullScreenDialogIsShowing = fullScreen;
            GuiBase.LeftDialogIsShowing       = !fullScreen;
            GuiBase.leftAction       = leftButton;
            GuiBase.rightAction      = rightButton;
            GuiBase.leftDialogHeader = header;
            GuiBase.leftDialogText   = text;
            GuiBase.lButtonText      = leftButtonText;
            GuiBase.rButtonText      = rightButtonText;
            if (notInMainThread)
            {
                return;
            }
            GUIStyle style = GUI.skin.GetStyle("Label");

            style.fontSize = GuiBase.FontSize(16);
            float width = GuiBase.Width(255f);
            float num   = style.CalcHeight(new GUIContent(text), width);
            float num2  = num + GuiBase.Height(100f);

            if (fullScreen)
            {
                GUI.Box(new Rect(GuiBase.Width(0f), GuiBase.Height(0f), (float)Screen.width, (float)Screen.height), string.Empty);
                GUI.BeginGroup(new Rect(GuiBase.Width(342f), (float)(Screen.height / 2) - num2 / 2f, GuiBase.Width(275f), num2));
                GUI.Box(new Rect(0f, 0f, GuiBase.Width(275f), num2), string.Empty);
            }
            else
            {
                GUI.BeginGroup(new Rect(GuiBase.Width(10f), (float)(Screen.height / 2) - num2 / 2f + GuiBase.Height(40f), GuiBase.Width(285f), num2));
                GUI.Box(new Rect(0f, 0f, GuiBase.Width(275f), num2), string.Empty);
            }
            style.fontSize  = GuiBase.FontSize(18);
            style.alignment = TextAnchor.MiddleCenter;
            style.fontStyle = FontStyle.Bold;
            GUI.Label(new Rect(GuiBase.Width(10f), GuiBase.Height(5f), GuiBase.Width(255f), GuiBase.Height(50f)), header);
            style.fontSize  = GuiBase.FontSize(16);
            style.fontStyle = FontStyle.Normal;
            style.alignment = TextAnchor.UpperLeft;
            GUI.Label(new Rect(GuiBase.Width(10f), GuiBase.Height(50f), width, num), text);
            if (GUI.Button(new Rect(GuiBase.Width(10f), num + GuiBase.Height(60f), GuiBase.Width(125f), GuiBase.Height(30f)), GuiBase.lButtonText))
            {
                GuiBase.FullScreenDialogIsShowing = false;
                GuiBase.LeftDialogIsShowing       = false;
                leftButton();
            }
            if (GUI.Button(new Rect(GuiBase.Width(140f), num + GuiBase.Height(60f), GuiBase.Width(125f), GuiBase.Height(30f)), rightButtonText))
            {
                GuiBase.FullScreenDialogIsShowing = false;
                GuiBase.LeftDialogIsShowing       = false;
                if (rightButton != null)
                {
                    rightButton();
                }
            }
            GUI.EndGroup();
        }
Exemplo n.º 20
0
 public override bool Init()
 {
     this.scrollViewHeight = 20 + App.State.AllTrainings.Count * 35;
     if (this.IsAchievement)
     {
         GuiBase.ShowAchievements(App.State.TrainingAchievements, "physical");
     }
     return(this.IsAchievement);
 }
 private static void AddHeader(string text, int marginTop, GUIStyle labelStyle)
 {
     labelStyle.fontStyle = FontStyle.Bold;
     labelStyle.alignment = TextAnchor.UpperCenter;
     labelStyle.fontSize  = GuiBase.FontSize(18);
     GUI.Label(new Rect(0f, GuiBase.Height((float)marginTop), GuiBase.Width(600f), GuiBase.Height(30f)), text);
     labelStyle.fontSize  = GuiBase.FontSize(15);
     labelStyle.alignment = TextAnchor.UpperLeft;
     labelStyle.fontStyle = FontStyle.Normal;
 }
 private int AddStoryPartButton(KeyValuePair <string, string> part, int marginTop, int marginLeft, int index)
 {
     if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(280f), GuiBase.Height(30f)), part.Key.Replace("Chapter ", string.Empty).Replace(" Part ", "-")))
     {
         this.shownIndex     = index;
         this.scrollPosition = Vector2.zero;
         this.shownTitle     = part.Key;
         TextAsset textAsset = Resources.Load("Story/" + part.Value) as TextAsset;
         this.shownStory = textAsset.text;
     }
     return(marginTop + 35);
 }
Exemplo n.º 23
0
        private static void addTextField(ref CDouble value, int godPowerleft)
        {
            int    num  = value.ToInt();
            string s    = GUI.TextField(new Rect(GuiBase.Width(180f), GuiBase.Height((float)GodPowerUi.marginTop), GuiBase.Width(60f), GuiBase.Height(25f)), value.ToString());
            int    num2 = 0;

            int.TryParse(s, out num2);
            if (num2 >= 0 && num2 <= godPowerleft + num)
            {
                value = num2;
            }
        }
        private void AddLvUpButtons(AfkyGame game, int marginLeft, int marginTop, ref AfkyGame.StatExp power, Action askDialog = null)
        {
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(30f), GuiBase.Height(25f)), new GUIContent(" + ", "Cost: " + power.ExpCostNextLevel.GuiText + " experience.")))
            {
                game.Exp -= power.LevelUp(game.Exp, 1, false);
                this.CheckHighestPower(game);
            }
            marginLeft += 35;
            bool flag = power.ExpCostNext10000Levels > 0 && game.Exp > power.ExpCostNext10000Levels;

            if (!flag)
            {
                if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), new GUIContent(" + 10", "Cost: " + power.ExpCostNext10Levels.GuiText + " experience.")))
                {
                    game.Exp -= power.LevelUp(game.Exp, 10, false);
                    this.CheckHighestPower(game);
                }
                marginLeft += 60;
            }
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), new GUIContent(" + 100", "Cost: " + power.ExpCostNext100Levels.GuiText + " experience.")))
            {
                game.Exp -= power.LevelUp(game.Exp, 100, false);
                this.CheckHighestPower(game);
            }
            marginLeft += 60;
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), new GUIContent(" + 1k", "Cost: " + power.ExpCostNext1000Levels.GuiText + " experience.")))
            {
                game.Exp -= power.LevelUp(game.Exp, 1000, false);
                this.CheckHighestPower(game);
            }
            if (flag)
            {
                marginLeft += 60;
                if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(55f), GuiBase.Height(25f)), new GUIContent(" + 10k", "Cost: " + power.ExpCostNext10000Levels.GuiText + " experience.")))
                {
                    game.Exp -= power.LevelUp(game.Exp, 10000, false);
                    this.CheckHighestPower(game);
                }
            }
            marginLeft += 60;
            if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(60f), GuiBase.Height(25f)), new GUIContent(" + Max", "Almost all your experience.")))
            {
                if (askDialog != null)
                {
                    askDialog();
                }
                else
                {
                    game.Exp -= power.LevelUp(game.Exp, 0, true);
                    this.CheckHighestPower(game);
                }
            }
        }
Exemplo n.º 25
0
        public static bool SpendGodPower(CDouble cdCount)
        {
            int num = cdCount.ToInt();

            if (App.State.PremiumBoni.GodPower >= num)
            {
                CDouble cDouble  = num;
                CDouble cDouble2 = App.State.PremiumBoni.GodPower - App.State.PremiumBoni.GpBoniPhysical - App.State.PremiumBoni.GpBoniMystic - App.State.PremiumBoni.GpBoniBattle - App.State.PremiumBoni.GpBoniCreating;
                cDouble2.Round();
                if (cDouble2 > 0)
                {
                    cDouble = num - cDouble2;
                    if (cDouble < 0)
                    {
                        cDouble = 0;
                    }
                }
                App.State.PremiumBoni.GpBoniPhysical -= cDouble;
                cDouble = 0;
                if (App.State.PremiumBoni.GpBoniPhysical < 0)
                {
                    cDouble = App.State.PremiumBoni.GpBoniPhysical * -1;
                    App.State.PremiumBoni.GpBoniPhysical = 0;
                }
                App.State.PremiumBoni.GpBoniMystic -= cDouble;
                cDouble = 0;
                if (App.State.PremiumBoni.GpBoniMystic < 0)
                {
                    cDouble = App.State.PremiumBoni.GpBoniMystic * -1;
                    App.State.PremiumBoni.GpBoniMystic = 0;
                }
                App.State.PremiumBoni.GpBoniBattle -= cDouble;
                cDouble = 0;
                if (App.State.PremiumBoni.GpBoniBattle < 0)
                {
                    cDouble = App.State.PremiumBoni.GpBoniBattle * -1;
                    App.State.PremiumBoni.GpBoniBattle = 0;
                }
                App.State.PremiumBoni.GpBoniCreating -= cDouble;
                cDouble = 0;
                if (App.State.PremiumBoni.GpBoniCreating < 0)
                {
                    cDouble = App.State.PremiumBoni.GpBoniCreating * -1;
                    App.State.PremiumBoni.GpBoniCreating = 0;
                }
                App.State.PremiumBoni.TotalGodPowerSpent += num;
                App.State.PremiumBoni.GodPower           -= num;
                App.State.PremiumBoni.permanentGPSpent    = 0;
                return(true);
            }
            GuiBase.ShowToast("You don't have enough god power!");
            return(false);
        }
Exemplo n.º 26
0
        protected override void ShowLabels(int marginTop, GUIStyle labelStyle)
        {
            labelStyle.alignment = TextAnchor.MiddleLeft;
            labelStyle.fontStyle = FontStyle.Normal;
            labelStyle.fontSize  = GuiBase.FontSize(16);
            if (this.totalPhysicalGain == null)
            {
                this.totalPhysicalGain = new CDouble();
            }
            GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height(42f), GuiBase.Width(340f), GuiBase.Height(30f)), new GUIContent("Total Physical / s: " + this.totalPhysicalGain.ToGuiText(true), "The total amount of physical you receive each second from all physical trainings."), labelStyle);
            string text = "Next at";

            if (App.State.GameSettings.UseStopAt)
            {
                text = "Stop at";
            }
            GUI.Label(new Rect(GuiBase.Width(390f), GuiBase.Height(42f), GuiBase.Width(60f), GuiBase.Height(30f)), new GUIContent(text, "Clones will be removed automatically if the level on the right input field is reached. \nIt is not that useful, but some people like to have even numbers."));
            if (App.CurrentPlattform == Plattform.Android)
            {
                GUIStyle textField = Gui.ChosenSkin.textField;
                if (GUI.Button(new Rect(GuiBase.Width(470f), GuiBase.Height(43f), GuiBase.Width(100f), GuiBase.Height(25f)), this.StopAtString, textField))
                {
                    base.ShowNumberInput(text, App.State.GameSettings.StopClonesAtTrainings, 9223372036854775807L, delegate(CDouble x)
                    {
                        this.StopAtString = x.ToString();
                        if (App.State.GameSettings.SyncTrainingSkill)
                        {
                            App.State.GameSettings.StopClonesAtSkills = App.State.GameSettings.StopClonesAtTrainings;
                        }
                    });
                }
            }
            else
            {
                this.StopAtString = GUI.TextField(new Rect(GuiBase.Width(470f), GuiBase.Height(43f), GuiBase.Width(100f), GuiBase.Height(25f)), this.StopAtString);
                if (App.State.GameSettings.SyncTrainingSkill)
                {
                    App.State.GameSettings.StopClonesAtSkills = App.State.GameSettings.StopClonesAtTrainings;
                }
            }
            App.State.GameSettings.IsStopAtOnTrainings = GUI.Toggle(new Rect(GuiBase.Width(593f), GuiBase.Height(46f), GuiBase.Width(60f), GuiBase.Height(30f)), App.State.GameSettings.IsStopAtOnTrainings, string.Empty);
            marginTop           += 5;
            labelStyle.alignment = TextAnchor.UpperCenter;
            labelStyle.fontStyle = FontStyle.Bold;
            labelStyle.fontSize  = GuiBase.FontSize(18);
            GUI.Label(new Rect(GuiBase.Width(15f), GuiBase.Height((float)marginTop), GuiBase.Width(220f), GuiBase.Height(30f)), "Training");
            GUI.Label(new Rect(GuiBase.Width(230f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Level", labelStyle);
            GUI.Label(new Rect(GuiBase.Width(330f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), "Clones", labelStyle);
            labelStyle.fontSize = GuiBase.FontSize(16);
            GUI.Label(new Rect(GuiBase.Width(510f), GuiBase.Height((float)marginTop), GuiBase.Width(100f), GuiBase.Height(30f)), new GUIContent("Sync", "If is this is on, clicking + or - will automatically add or remove the same number of clones from skills, if there are clones on the skill, and the skill is unlocked."), labelStyle);
            App.State.GameSettings.SyncTrainingSkill = GUI.Toggle(new Rect(GuiBase.Width(593f), GuiBase.Height((float)(marginTop + 4)), GuiBase.Width(60f), GuiBase.Height(30f)), App.State.GameSettings.SyncTrainingSkill, string.Empty);
        }
 private void Start()
 {
     try
     {
         GuiBase.InitImages();
         MainUi.Instance.Init(false);
     }
     catch (Exception ex)
     {
         Log.Error("Error while initializing: " + ex.Message);
         GuiBase.InitImages();
         MainUi.Instance.Init(false);
     }
 }
 private static void addPurchaseButton(int left, int top, Purchase purchaseId, int count)
 {
     if (GUI.Button(new Rect(GuiBase.Width((float)left), GuiBase.Height((float)top), GuiBase.Width(180f), GuiBase.Height(32f)), new GUIContent(string.Concat(new object[]
     {
         "Buy ",
         count,
         " for ",
         //Purchases.GetPriceText(purchaseId)
     }))))
     {
         SteamHelper.TimerSinceStarted = UpdateStats.CurrentTimeMillis();
         SteamHelper.PurchaseItem(purchaseId);
     }
 }
Exemplo n.º 29
0
 public new void Show(bool isAchievement)
 {
     if (!App.State.IsMonumentUnlocked)
     {
         GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
         GUIStyle style = GUI.skin.GetStyle("Label");
         style.fontSize  = GuiBase.FontSize(16);
         style.alignment = TextAnchor.MiddleCenter;
         GUI.Label(new Rect(GuiBase.Width(310f), GuiBase.Height(150f), GuiBase.Width(640f), GuiBase.Height(30f)), "You need to defeat Diana to unlock monuments.", style);
         return;
     }
     this.IsAchievement = isAchievement;
     base.Show(false);
 }
        private void show()
        {
            GUIStyle style = GUI.skin.GetStyle("Label");

            GUI.BeginGroup(new Rect(GuiBase.Width(280f), GuiBase.Height(110f), GuiBase.Width(670f), GuiBase.Height(480f)));
            GUI.Box(new Rect(GuiBase.Width(10f), GuiBase.Height(0f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
            style.fontSize  = GuiBase.FontSize(18);
            style.fontStyle = FontStyle.Bold;
            style.alignment = TextAnchor.UpperCenter;
            GUI.Label(new Rect(GuiBase.Width(30f), GuiBase.Height(20f), GuiBase.Width(660f), GuiBase.Height(40f)), "Keyboard Shortcuts");
            style.fontSize  = GuiBase.FontSize(16);
            style.fontStyle = FontStyle.Normal;
            style.alignment = TextAnchor.UpperLeft;
            int num = 50;

            this.AddInfoLabel("F1 : Show Shortcuts", ref num, 30);
            this.AddInfoLabel("F2 : Show FAQ", ref num, 30);
            this.AddInfoLabel("F3 : Open the Chat", ref num, 30);
            this.AddInfoLabel("1 : Show Create", ref num, 30);
            this.AddInfoLabel("2 : Show Monuments", ref num, 30);
            this.AddInfoLabel("3 : Show Divinity", ref num, 30);
            this.AddInfoLabel("4 : Show Planet", ref num, 30);
            this.AddInfoLabel("5 : Show Physical", ref num, 30);
            this.AddInfoLabel("6 : Show Skills", ref num, 30);
            this.AddInfoLabel("7 : Show Might", ref num, 30);
            this.AddInfoLabel("8 : Show TBS", ref num, 30);
            this.AddInfoLabel("9 : Show Monster", ref num, 30);
            this.AddInfoLabel("0 : Show Gods", ref num, 30);
            num = 50;
            this.AddInfoLabel("Shift + 1 : Show Special", ref num, 300);
            this.AddInfoLabel("Shift + 2 : Show Statistics", ref num, 300);
            this.AddInfoLabel("Shift + 3 : Show Settings", ref num, 300);
            this.AddInfoLabel("Shift + 4 : Show Story", ref num, 300);
            this.AddInfoLabel("Shift + 5 : Show Pets", ref num, 300);
            if (App.CurrentPlattform == Plattform.Steam)
            {
                this.AddInfoLabel("Esc: Change resolution or quit game", ref num, 300);
            }
            this.AddInfoLabel("Some well-known code: ???", ref num, 300);
            GUI.Label(new Rect(GuiBase.Width(300f), GuiBase.Height((float)num), GuiBase.Width(360f), GuiBase.Height(70f)), "Shift + r : Remove all shadow clones from Monument, Might, Divinity and Planet");
            num += 50;
            GUI.Label(new Rect(GuiBase.Width(300f), GuiBase.Height((float)num), GuiBase.Width(360f), GuiBase.Height(70f)), "Shift + a : Set Clones to add / remove to 'Max'");
            num += 30;
            GUI.Label(new Rect(GuiBase.Width(300f), GuiBase.Height((float)num), GuiBase.Width(360f), GuiBase.Height(70f)), "Right click a number button: reduce the current number by that count.");
            num += 50;
            GUI.Label(new Rect(GuiBase.Width(300f), GuiBase.Height((float)num), GuiBase.Width(360f), GuiBase.Height(70f)), "Right click + at physical / skills: add 28 clones");
            num += 50;
            GUI.EndGroup();
        }