private async void CheckForUpdates() { HttpClient httpClient = new HttpClient(); try { string newVersion = await httpClient.GetStringAsync("https://gopong.dev/chaos/version.txt"); if (Info.VERSION != newVersion) { update = 1; update_available_button.Visibility = Visibility.Visible; } else { update = 0; update_available_label.Content = Lang.app_labels("no_update_available_label", lang_list.SelectedIndex); } } catch (HttpRequestException) { update = 2; update_available_label.Content = Lang.app_labels("update_error", lang_list.SelectedIndex); } }
private void lang_list_SelectionChanged(object sender, SelectionChangedEventArgs e) { WriteEffectsFile(); cacheLang = lang_list.SelectedIndex; this.Title = Lang.app_labels("title", lang_list.SelectedIndex); InitEffectsTreeView(); user_reset.Content = Lang.app_labels("user_reset", lang_list.SelectedIndex); user_save.Content = Lang.app_labels("user_save", lang_list.SelectedIndex); lang_label.Content = Lang.app_labels("lang_label", lang_list.SelectedIndex); effects_tab.Header = Lang.app_labels("effects_tab", lang_list.SelectedIndex); meta_tab.Header = Lang.app_labels("meta_tab", lang_list.SelectedIndex); misc_tab.Header = Lang.app_labels("misc_tab", lang_list.SelectedIndex); twitch_tab.Header = Lang.app_labels("twitch_tab", lang_list.SelectedIndex); more_tab.Header = Lang.app_labels("more_tab", lang_list.SelectedIndex); meta_normal_label.Content = Lang.app_labels("meta_cooldown_label", lang_list.SelectedIndex); meta_duration_label.Content = Lang.app_labels("meta_duration_label", lang_list.SelectedIndex); meta_short_label.Content = Lang.app_labels("meta_short_label", lang_list.SelectedIndex); effect_timer.Content = Lang.app_labels("effect_timer", lang_list.SelectedIndex); effect_duration.Content = Lang.app_labels("effect_duration", lang_list.SelectedIndex); effect_duration_short.Content = Lang.app_labels("effect_duration_short", lang_list.SelectedIndex); effects_seed.Content = Lang.app_labels("effects_seed", lang_list.SelectedIndex); timebar_color.Content = Lang.app_labels("timebar_color", lang_list.SelectedIndex); effect_textcolor.Content = Lang.app_labels("effect_textcolor", lang_list.SelectedIndex); effect_timer_color.Content = Lang.app_labels("effect_timer_color", lang_list.SelectedIndex); timebar_draw.Content = Lang.app_labels("effect_duration_short", lang_list.SelectedIndex); effect_text_draw.Content = Lang.app_labels("timebar_draw", lang_list.SelectedIndex); clear_effects.Content = Lang.app_labels("clear_effects", lang_list.SelectedIndex); mod_toggle.Content = Lang.app_labels("mod_toggle", lang_list.SelectedIndex); effect_menu.Content = Lang.app_labels("effect_menu", lang_list.SelectedIndex); timebar_pause.Content = Lang.app_labels("timebar_pause", lang_list.SelectedIndex); twitch_info.Content = Lang.app_labels("twitch_info", lang_list.SelectedIndex); twitch_user_agreed.Content = Lang.app_labels("twitch_user_agreed", lang_list.SelectedIndex); twitch_user_channel_name_label.Content = Lang.app_labels("twitch_user_channel_name_label", lang_list.SelectedIndex); twitch_user_user_name_label.Content = Lang.app_labels("twitch_user_user_name_label", lang_list.SelectedIndex); twitch_user_channel_oauth_label.Content = Lang.app_labels("twitch_user_channel_oauth_label", lang_list.SelectedIndex); twitch_user_effects_secs_before_chat_voting_label.Content = Lang.app_labels("twitch_user_effects_secs_before_chat_voting_label", lang_list.SelectedIndex); twitch_user_overlay_mode_label.Content = Lang.app_labels("twitch_user_overlay_mode_label", lang_list.SelectedIndex); twitch_user_random_voteable_enable_label.Content = Lang.app_labels("twitch_user_random_voteable_enable_label", lang_list.SelectedIndex); proportional_vote.Content = Lang.app_labels("proportional_vote", lang_list.SelectedIndex); twitch_user_chance_system_enable_label.Content = Lang.app_labels("twitch_user_chance_system_enable_label", lang_list.SelectedIndex); twitch_user_chance_system_retain_chance_enable_label.Content = Lang.app_labels("twitch_user_chance_system_retain_chance_enable_label", lang_list.SelectedIndex); mod_page.Content = Lang.app_labels("mod_page", lang_list.SelectedIndex); donation.Content = Lang.app_labels("donation", lang_list.SelectedIndex); contribute.Content = Lang.app_labels("contribute", lang_list.SelectedIndex); discord.Content = Lang.app_labels("discord", lang_list.SelectedIndex); if (lang_list.SelectedIndex != 0) { translatedby.Visibility = Visibility.Visible; translatedby.Content = Lang.app_labels("translatedby", lang_list.SelectedIndex); } else { translatedby.Visibility = Visibility.Hidden; translatedby.Content = ""; } if (update == 0) { update_available_label.Content = Lang.app_labels("no_update_available_label", lang_list.SelectedIndex); } else if (update == 1) { update_available_label.Content = Lang.app_labels("update_available_label", lang_list.SelectedIndex); } else { update_available_label.Content = Lang.app_labels("update_error", lang_list.SelectedIndex); } ParseEffectsFile(); }