/** * Copyright (c) 2026 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #pragma once #include "error/error.h" #include "ui/widget/uimenu.h" #include "uisettings.h" #define UI_SETTINGS_GENERAL_ITEM_COUNT 3 #define UI_SETTINGS_GENERAL_INDEX_LANGUAGE 0 #define UI_SETTINGS_GENERAL_INDEX_LANGUAGE_DETAIL 1 #define UI_SETTINGS_GENERAL_INDEX_APPLY 2 #define UI_SETTINGS_GENERAL_LOCALE_COUNT 3 #define UI_SETTINGS_GENERAL_LABEL_MAX 32 #define UI_SETTINGS_GENERAL_INFO_MAX 64 typedef struct { uimenu_t menu; uimenuitem_t items[UI_SETTINGS_GENERAL_ITEM_COUNT]; const char_t *localeNames[UI_SETTINGS_GENERAL_LOCALE_COUNT]; char_t languageLabel[UI_SETTINGS_GENERAL_LABEL_MAX]; char_t labelInfo[UI_SETTINGS_GENERAL_INFO_MAX]; } uisettingsgeneral_t; extern uisettingsgeneral_t UI_SETTINGS_GENERAL; /** * Initializes the general settings page. * * @return Any error that occurs. */ errorret_t uiSettingsGeneralInit(void); /** * Loads the page's widgets from the current engine general settings. */ void uiSettingsGeneralLoad(void); /** * Applies the page's widget values to the engine general settings. */ void uiSettingsGeneralApply(void); /** * Returns whether any widget's value differs from what was loaded. * * @returns True if there are unsaved changes. */ bool_t uiSettingsGeneralHasChanges(void);