コード例 #1
0
        public void ClanAllRecordData()
        {
            TextObject  textObject  = GameTexts.FindText("sms_battle_record_clear_all_data_sure", null);
            InquiryData inquiryData = new InquiryData(textObject.ToString(), string.Empty, true, true,
                                                      GameTexts.FindText("sms_sure", null).ToString(),
                                                      GameTexts.FindText("sms_cancel", null).ToString(), () =>
            {
                Campaign.Current.GetCampaignBehavior <SpousesStatsBehavior>().ClanAllData();
                this._parentView.CloseSettingView();
            }, () => { });

            InformationManager.ShowInquiry(inquiryData, false);
        }
コード例 #2
0
        public void OnDivorceClick()
        {
            if (null == this.SelectedCharacter)
            {
                return;
            }
            TextObject textObject = GameTexts.FindText("sms_divorce_sure", null);

            StringHelpers.SetCharacterProperties("SUE_HERO", this._selectedHero.CharacterObject, null, textObject);
            InquiryData inquiryData = new InquiryData(textObject.ToString(), string.Empty, true, true,
                                                      GameTexts.FindText("sms_sure", null).ToString(),
                                                      GameTexts.FindText("sms_cancel", null).ToString(), () =>
            {
                SpouseOperation.Divorce(this._selectedHero);
            }, null);

            InformationManager.ShowInquiry(inquiryData, false);
        }
コード例 #3
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            bool isReady = false;
            var  message = "Please Enter:";

            if (newInquiryData.CustomerId == 0)
            {
                message += $"\n  Customer Name."; isReady = true;
            }
            if (newInquiryData.ProjectName == null || newInquiryData.ProjectName == "")
            {
                message += $"\n  Project Name."; isReady = true;
            }

            if (!isReady)
            {
                using (SqlConnection connection = new SqlConnection(Database.ConnectionString))
                {
                    connection.Update <Inquiry>(newInquiryData);
                }

                if (WindowMode == Actions.New)
                {
                    if (InquiriesDataToUpdate != null)
                    {
                        InquiriesDataToUpdate.Insert(0, newInquiryData);
                    }
                }
                else if (WindowMode == Actions.Edit)
                {
                    InquiryData.Update(newInquiryData);
                }

                isSaving = true;
                this.Close();
            }
            else
            {
                MessageWindow.Show("Error", message, MessageWindowButton.OK, MessageWindowImage.Information);
            }
        }
コード例 #4
0
            public static void Prefix(ref InquiryData data)
            {
                var origAff = data.AffirmativeAction;
                var origNeg = data.NegativeAction;

                data = new InquiryData(
                    data.TitleText,
                    data.Text,
                    data.IsAffirmativeOptionShown,
                    data.IsNegativeOptionShown,
                    data.AffirmativeText,
                    data.NegativeText,
                    () =>
                {
                    try
                    {
                        origAff?.Invoke();
                    }
                    finally
                    {
                        UniversalCloseModule.IsInquaryVisible = true;
                        DebugLogger.Print("Called: InquiryData.AffirmativeAction");
                    }
                },
                    () =>
                {
                    try
                    {
                        origNeg?.Invoke();
                    }
                    finally
                    {
                        UniversalCloseModule.IsInquaryVisible = false;
                        DebugLogger.Print("Called: InquiryData.NegativeAction");
                    }
                },
                    data.SoundEventPath
                    );
            }
コード例 #5
0
        public void ApplyAssassinationFailedConsequences(Settlement settlement, Hero assassin, Hero victim)
        {
            ChangeRelationAction.ApplyRelationChangeBetweenHeroes(assassin, victim, -100, true);

            DeclareWarBetweenHeros(assassin, victim, out var declareWarMessage);

            TakeGoldFromHero(assassin, victim.Clan, out var goldLossMessage);

            TakeHeroCaptive(settlement, assassin, out var takeCaptiveMessage);

            var message = goldLossMessage.ToString()
                          + $"\n{declareWarMessage}"
                          + $"\n{takeCaptiveMessage}";

            var inquiry = new InquiryData(
                "Captured",
                message,
                true,
                false,
                "Continue",
                string.Empty,
                null,
                null
                );

            InformationManager.ShowInquiry(inquiry);

            _assassinationHistoryService.AddAssassinationEvent(new AssassinationEvent()
            {
                Settlement   = settlement,
                Assassin     = assassin,
                Victim       = victim,
                Succeeded    = false,
                CampaignTime = CampaignTime.Now
            });
        }
コード例 #6
0
ファイル: UX.cs プロジェクト: MatteNeri/CustomSpawns
 public static void DisplayInquiry(InquiryData inqDat, bool pause)
 {
     InformationManager.ShowInquiry(inqDat, pause);
 }
        public static void MessageBox(string text, string title, bool pause = false)
        {
            var inquiry = new InquiryData(title, text, true, false, "OK", null, null, null);

            InformationManager.ShowInquiry(inquiry, pause);
        }
コード例 #8
0
 public override void OnBehaviourInitialize()
 {
     base.OnBehaviourInitialize();
     this._retreatPopUpData     = new InquiryData("", GameTexts.FindText("str_retreat_question").ToString(), true, true, GameTexts.FindText("str_ok").ToString(), GameTexts.FindText("str_cancel").ToString(), new Action(this.OnEventAcceptSelectionWidget), new Action(this.OnEventCancelSelectionWidget));
     this.IsWarningWidgetOpened = false;
 }