Exemplo n.º 1
0
 /**
  * Load data.
  */
 private void LoadSavedData(CampaignGameStarter obj)
 {
     if (_customDataMap != null)
     {
         foreach (var currentSettlement in Campaign.Current.Settlements)
         {
             if (_customDataMap.ContainsKey(currentSettlement.Id.ToString()))
             {
                 ToolsHelper.SetSettlementName(currentSettlement,
                                               _customDataMap[currentSettlement.Id.ToString()], false);
             }
         }
     }
 }
Exemplo n.º 2
0
        private void SettlementRename()
        {
            var curSettlement = Hero.MainHero.CurrentSettlement;
            var nameDialog    = new TextInquiryData($"Rename settlement {curSettlement.Name}",
                                                    "Enter Name:",
                                                    true,
                                                    true,
                                                    "Rename",
                                                    "Cancel",
                                                    (string s) => { ToolsHelper.SetSettlementName(curSettlement, s); },
                                                    (Action)(() => { }),
                                                    false,
                                                    (Func <string, bool>)(s => s.Length > 0 && s.All(x => char.IsLetterOrDigit(x) || char.IsWhiteSpace(x))),
                                                    (string)null);

            InformationManager.ShowTextInquiry(nameDialog, true);
        }