From b885ddf99f73a5a86b72d60264a46bb2c4b0b995 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Wed, 17 Dec 2008 21:15:26 +0100 Subject: Remember windows visibility. (cherry picked from eathena client repository, commits 88af5cb15a02a26f4a5990ba3ef4df46e572bff4, 19ee623c0a1fdd333ef5b945ea887c983c829b1e, f924885ea0db5842b080610ec63e61a4bcc2a30c) Conflicts: src/gui/itemshortcutwindow.cpp src/gui/window.cpp --- src/game.cpp | 16 ++++++++++++---- src/gui/window.cpp | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 11712f6b..fc9d89eb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -219,10 +219,18 @@ void createGuiWindows() //buddyWindow->setPosition(10, minimap->getHeight() + 30); // Set initial window visibility - chatWindow->setVisible(true); - miniStatusWindow->setVisible(true); - menuWindow->setVisible(true); - itemShortcutWindow->setVisible(true); + chatWindow->setVisible((bool) config.getValue( + chatWindow->getWindowName() + "Visible", true)); + miniStatusWindow->setVisible((bool) config.getValue( + miniStatusWindow->getWindowName() + "Visible", + true)); + buyDialog->setVisible(false); + sellDialog->setVisible(false); + tradeWindow->setVisible(false); + menuWindow->setVisible((bool) config.getValue( + menuWindow->getWindowName() + "Visible", true)); + itemShortcutWindow->setVisible((bool) config.getValue( + itemShortcutWindow->getWindowName() + "Visible", true)); if (config.getValue("logToChat", 0)) { diff --git a/src/gui/window.cpp b/src/gui/window.cpp index c40f8a25..582e4a67 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -135,6 +135,7 @@ Window::~Window() // Saving X, Y and Width and Height for resizables in the config config.setValue(name + "WinX", getX()); config.setValue(name + "WinY", getY()); + config.setValue(name + "Visible", isVisible()); if (mGrip) { @@ -473,6 +474,7 @@ void Window::loadWindowState() setPosition((int) config.getValue(name + "WinX", mDefaultX), (int) config.getValue(name + "WinY", mDefaultY)); + setVisible((bool) config.getValue(name + "Visible", false)); if (mGrip) { -- cgit v1.2.3-70-g09d2