private void RegisterOwnSettings() { try { var pack = Settings.GetModSettings(ModIdentifier); pack.EntryName = "HugsLib_ownSettingsName".Translate(); pack.DisplayPriority = ModSettingsPack.ListPriority.Lowest; pack.AlwaysExpandEntry = true; updateNewsSetting = pack.GetHandle("modUpdateNews", "HugsLib_setting_showNews_label".Translate(), "HugsLib_setting_showNews_desc".Translate(), true); var allNewsHandle = pack.GetHandle("showAllNews", "HugsLib_setting_allNews_label".Translate(), "HugsLib_setting_allNews_desc".Translate(), false); allNewsHandle.Unsaved = true; allNewsHandle.CustomDrawer = rect => { if (Widgets.ButtonText(rect, "HugsLib_setting_allNews_button".Translate())) { if (!UpdateFeatures.TryShowDialog(true)) { Find.WindowStack.Add(new Dialog_MessageBox("HugsLib_setting_allNews_fail".Translate())); } } return(false); }; QuickstartController.RegisterSettings(pack); } catch (Exception e) { Logger.ReportException(e); } }
private void OnMapLoaded(Map map) { try { DoLater.OnMapLoaded(map); for (int i = 0; i < childMods.Count; i++) { try { childMods[i].MapLoaded(map); } catch (Exception e) { Logger.ReportException(e, childMods[i].LogIdentifierSafe); } } // show update news dialog UpdateFeatures.TryShowDialog(false); } catch (Exception e) { Logger.ReportException(e); } }
private void OnMapLoaded(Map map) { try { for (int i = 0; i < childMods.Count; i++) { try { childMods[i].MapLoaded(map); } catch (Exception e) { Logger.ReportException(e, childMods[i].ModIdentifier); } } // show update news dialog if (updateNewsSetting.Value) { UpdateFeatures.TryShowDialog(); } } catch (Exception e) { Logger.ReportException(e); } }