private void ReloadLayout() { Children.Clear(); if (!LoadXml(Paths.GetLayoutFor("main"))) { Main.ForceQuit(this); } //find named controls saveLabel = GetControlByName("label_save", true) as UITextBlock; progressLabel = GetControlByName("label_progress", true) as UITextBlock; progressBar = GetControlByName("progress_bar", true) as UIProgressBar; progressBar?.SetMin(0); if (TrackerSettings.IsPostExplorationUpdate) { progressBar?.SetMax(AdvancementTracker.AdvancementCount); } else { progressBar?.SetMax(AchievementTracker.AchievementCount); } status = GetControlByName("enchantment_table", true) as UIEnchantmentTable; status?.SetTint(Color.White * 0.85f); settingsButton = GetControlByName("button_settings", true) as UIButton; if (settingsButton != null) { settingsButton.Click += OnClick; } patreonButton = GetControlByName("button_patreon", true) as UIButton; if (patreonButton != null) { patreonButton.UseCustomColor = true; patreonButton.SetTextColor(Color.Black); patreonButton.Click += OnClick; } grid = GetFirstOfType(typeof(UIGrid)) as UIGrid; UpdateCollapsedState(); }