clean even more code

This commit is contained in:
Vincent Foulon 2020-12-29 11:47:31 +01:00
parent a0a51110a5
commit 4d7b985be1
2 changed files with 3 additions and 3 deletions

View File

@ -1395,7 +1395,7 @@ impl CharSelectionUi {
let selected_character = global_state.profile.get_selected_character(server_name);
// Load language
let i18n = &global_state.i18n.read();
let i18n = global_state.i18n.read();
// TODO: don't add default font twice
let font = ui::ice::load_font(&i18n.fonts.get("cyri").unwrap().asset_key);
@ -1478,7 +1478,7 @@ impl CharSelectionUi {
// TODO: do we need whole client here or just character list?
pub fn maintain(&mut self, global_state: &mut GlobalState, client: &Client) -> Vec<Event> {
let mut events = Vec::new();
let i18n = &global_state.i18n.read();
let i18n = global_state.i18n.read();
let (mut messages, _) = self.ui.maintain(
self.controls

View File

@ -262,7 +262,7 @@ impl PlayState for MainMenuState {
global_state.settings.language.selected_language =
new_language.language_identifier;
global_state.i18n = Localization::load_expect(&i18n_asset_key(
&global_state.settings.language.selected_language
&global_state.settings.language.selected_language,
));
global_state.i18n.read().log_missing_entries();
self.main_menu_ui