Пример #1
0
    public static void StopDigging()
    {
        MusicPlayer.FadeOut();

        // check for any emails to send
        DebtProgression.UpdateProgression();
        StoryProgression.UpdateProgression();
        AdvertisementProgression.CheckEmails();
        NewsProgression.UpdateNews();

        SaveData.Get().madePaymentToday = false; // set this AFTER email checks... just in case we send an email based on missing payments

        // Load the Computer scene
        singleton.isComputerScene = true;
        singleton.computerView.gameObject.SetActive(true);
        // Go to the "gem sale" tab
        if (isFirstTimeComputing)
        {
            // email
            singleton.computerView.GetComponentInChildren <WebBrowser>().SetTab(1);
            isFirstTimeComputing = false;
        }
        else
        {
            // gem selling!
            singleton.computerView.GetComponentInChildren <WebBrowser>().SetTab(0);
        }
    }
Пример #2
0
 private void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
 }
Пример #3
0
            protected override bool PrivatePerform()
            {
                if (!AcceptCancelDialog.Show(Localize("Prompt")))
                {
                    return(false);
                }

                StoryProgression.Reset();
                return(true);
            }
Пример #4
0
        public override string ToString()
        {
            Common.StringBuilder text = new Common.StringBuilder();

            text += StoryProgression.Localize("Accounting:Header", false, new object[] { SimClock.ElapsedCalendarDays() - mStartDay });

            mValues.Sort(new Comparison <Value>(Value.SortByName));

            string result = null;

            int net = 0;

            foreach (Value value in mValues)
            {
                if (value.Amount > 0)
                {
                    result += value.ToString();

                    net += value.Amount;
                }
            }

            if (!string.IsNullOrEmpty(result))
            {
                text += Common.NewLine + Common.NewLine + StoryProgression.Localize("Accounting:Gain");
                text += result;
            }

            result = null;

            foreach (Value value in mValues)
            {
                if (value.Amount < 0)
                {
                    result += value.ToString();

                    net += value.Amount;
                }
            }

            if (!string.IsNullOrEmpty(result))
            {
                text += Common.NewLine + Common.NewLine + StoryProgression.Localize("Accounting:Loss");
                text += result;
            }

            text += Common.NewLine + Common.NewLine + StoryProgression.Localize("Accounting:Net", false, new object[] { net });

            return(text.ToString());
        }
Пример #5
0
        protected SimDescription GetSelection()
        {
            if (Sim.ActiveActor == null)
            {
                return(null);
            }

            SimSelection sims = SimSelection.Create(this);

            if (sims.IsEmpty)
            {
                SimpleMessageDialog.Show(Name, StoryProgression.Localize("SimID:Error"));
                return(null);
            }

            return(sims.SelectSingle());
        }
Пример #6
0
        protected override bool PrivatePerform()
        {
            string text = StringInputDialog.Show(Name, GetPrompt(), Value.ToString(), 256, StringInputDialog.Validation.None);

            if (string.IsNullOrEmpty(text))
            {
                return(false);
            }

            int iValue = 0;

            if (!int.TryParse(text, out iValue))
            {
                SimpleMessageDialog.Show(Name, StoryProgression.Localize("Integer:Error"));
                return(false);
            }

            SetValue(Validate(iValue));
            return(true);
        }
Пример #7
0
        public static InteractionInstance GetWorkInteraction(Career job)
        {
            InteractionInstance instance = null;

            try
            {
                if (OnWorkInteraction != null)
                {
                    instance = OnWorkInteraction(job);
                }
                else
                {
                    instance = job.CreateWorkInteractionInstance();
                }
            }
            catch (Exception e)
            {
                StoryProgression.DebugException(job.OwnerDescription, e);
            }

            return(instance);
        }
Пример #8
0
        public override void ApplyOverride(IGenericLevelOption paramOption, OverrideStyle style)
        {
            if ((style & OverrideStyle.MergeSet) == OverrideStyle.MergeSet)
            {
                AccountingData value = Value;
                if (value == null)
                {
                    return;
                }

                string result = Manager.House.Name;

                result += Common.NewLine + value.ToString();

                int assets = GetValue <AssetsOption, int>();
                int debt   = GetValue <DebtOption, int>();

                result += Common.NewLine + StoryProgression.Localize("Accounting:Assets", false, new object[] { assets });
                result += Common.NewLine + StoryProgression.Localize("Accounting:Debts", false, new object[] { debt });

                Common.Notify(result);
            }
        }
Пример #9
0
        protected override bool PrivatePerform()
        {
            string text = StringInputDialog.Show(Name, Localize("Prompt"), Value.x.ToString() + " : " + Value.y.ToString(), 256, StringInputDialog.Validation.None);

            if (text == null)
            {
                return(false);
            }

            string[] range = text.Split(':');

            if (range.Length != 2)
            {
                SimpleMessageDialog.Show(Name, StoryProgression.Localize("Range:FormatError"));
                return(false);
            }

            float min;

            if (!float.TryParse(range[0].Trim(), out min))
            {
                SimpleMessageDialog.Show(Name, StoryProgression.Localize("Range:MinError"));
                return(false);
            }

            float max;

            if (!float.TryParse(range[1].Trim(), out max))
            {
                SimpleMessageDialog.Show(Name, StoryProgression.Localize("Range:MaxError"));
                return(false);
            }

            SetValue(Adjust(min, max));
            return(true);
        }
Пример #10
0
 public override string ToString()
 {
     return(StoryProgression.Localize("Accounting:Body", false, new object[] { StoryProgression.Localize("AccountingValue:" + mKey), mValue }));
 }