mirror of
https://github.com/edubart/otclient.git
synced 2025-12-21 16:07:12 +01:00
init on screen center on first startup
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -48,10 +48,16 @@ void signal_handler(int sig)
|
||||
/// Default configurations
|
||||
void setDefaultConfigs()
|
||||
{
|
||||
g_config.setValue("window x", 0);
|
||||
g_config.setValue("window y", 0);
|
||||
g_config.setValue("window width", 640);
|
||||
g_config.setValue("window height", 480);
|
||||
// default size
|
||||
int defWidth = 640;
|
||||
int defHeight = 480;
|
||||
|
||||
// init on screen center
|
||||
g_config.setValue("window x", (Platform::getDisplayWidth() - defWidth)/2);
|
||||
g_config.setValue("window y", (Platform::getDisplayHeight() - defHeight)/2);
|
||||
|
||||
g_config.setValue("window width", defWidth);
|
||||
g_config.setValue("window height", defHeight);
|
||||
g_config.setValue("window maximized", false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user