1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::*;

pub(super) fn widget(
    mut args: In<(&mut egui::Ui, &mut SettingsState, bool)>,
    meta: Root<GameMeta>,
    localization: Localization<GameMeta>,
) {
    let (ui, state, should_reset) = &mut *args;

    let normal_font = meta
        .theme
        .font_styles
        .normal
        .with_color(meta.theme.panel.font_color);

    if *should_reset {
        state.modified_settings.fullscreen = meta.default_settings.fullscreen;
    }

    ui.add_space(normal_font.size / 2.0);

    #[cfg(not(target_arch = "wasm32"))]
    ui.horizontal(|ui| {
        ui.add_space(normal_font.size * 3.0);
        ui.checkbox(
            &mut state.modified_settings.fullscreen,
            normal_font.rich(localization.get("fullscreen")),
        );
    });

    #[cfg(target_arch = "wasm32")]
    ui.label(normal_font.rich(localization.get("no-graphics-settings-on-web")));
}