diff --git a/dll/common_includes.h b/dll/common_includes.h index bf612c4..dbc218f 100644 --- a/dll/common_includes.h +++ b/dll/common_includes.h @@ -219,6 +219,8 @@ inline std::string ascii_to_lowercase(std::string data) { #define DEFAULT_LANGUAGE "english" +#define DEFAULT_UI_NOTIFICATION_POSITION "top right" + #define LOBBY_CONNECT_APPID ((uint32)-2) #define FRIEND_AVATAR_MAX_IMAGE_LENGTH (5 * 1024 * 1024) diff --git a/dll/settings.cpp b/dll/settings.cpp index a4f4045..8ca69c6 100644 --- a/dll/settings.cpp +++ b/dll/settings.cpp @@ -45,6 +45,8 @@ Settings::Settings(CSteamID steam_id, CGameID game_id, std::string name, std::st this->name = this->name + " "; } + this->ui_notification_position = ""; + auto lang = sanitize(language); std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower); lang.erase(std::remove(lang.begin(), lang.end(), ' '), lang.end()); @@ -476,3 +478,24 @@ void Settings::set_preferred_network_image_type(int new_type) }; return; } + +std::string Settings::get_ui_notification_position() +{ + return this->ui_notification_position; +} + +void Settings::set_ui_notification_position(char * pos) +{ + PRINT_DEBUG("%s 0x%p.\n", + "Settings::set_ui_notification_position", + pos); + if (pos != NULL) { + size_t len = strlen(pos); + if (len > 0) { + this->ui_notification_position = ""; + for (size_t x = 0; x < len && pos[x] != '\0'; x++) { + this->ui_notification_position += pos[x]; + } + } + } +} diff --git a/dll/settings.h b/dll/settings.h index 8b7e7c2..4c4b097 100644 --- a/dll/settings.h +++ b/dll/settings.h @@ -77,7 +77,7 @@ struct Settings_Background_Task { class Settings { CSteamID steam_id; CGameID game_id; - std::string name, language; + std::string name, language, ui_notification_position; CSteamID lobby_id; uint32 preferred_network_image_type; bool background_thread_exit; @@ -209,6 +209,10 @@ public: void set_show_achievement_desc_on_unlock(bool set) { this->showAchievementDescOnUnlock = set; } bool get_show_achievement_hidden_unearned() { return showAchievementHiddenUnearned; } void set_show_achievement_hidden_unearned(bool set) { this->showAchievementHiddenUnearned = set; } + + //UI + std::string get_ui_notification_position(); + void set_ui_notification_position(char * pos); }; #endif