|
|
|
@ -216,7 +216,7 @@ namespace MWGui
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWEffectList>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpellEffect>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWDynamicStat>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ExposedWindow>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Window>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWScrollBar>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<VideoWidget>("Widget");
|
|
|
|
|
MyGUI::FactoryManager::getInstance().registerFactory<BackgroundImage>("Widget");
|
|
|
|
@ -1235,10 +1235,14 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
for (std::map<MyGUI::Window*, std::string>::iterator it = mTrackedWindows.begin(); it != mTrackedWindows.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::IntPoint pos(static_cast<int>(Settings::Manager::getFloat(it->second + " x", "Windows") * x),
|
|
|
|
|
static_cast<int>( Settings::Manager::getFloat(it->second+ " y", "Windows") * y));
|
|
|
|
|
MyGUI::IntSize size(static_cast<int>(Settings::Manager::getFloat(it->second + " w", "Windows") * x),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(it->second + " h", "Windows") * y));
|
|
|
|
|
std::string settingName = it->second;
|
|
|
|
|
if (Settings::Manager::getBool(settingName + " maximized", "Windows"))
|
|
|
|
|
settingName += " maximized";
|
|
|
|
|
|
|
|
|
|
MyGUI::IntPoint pos(static_cast<int>(Settings::Manager::getFloat(settingName + " x", "Windows") * x),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(settingName + " y", "Windows") * y));
|
|
|
|
|
MyGUI::IntSize size(static_cast<int>(Settings::Manager::getFloat(settingName + " w", "Windows") * x),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(settingName + " h", "Windows") * y));
|
|
|
|
|
it->first->setPosition(pos);
|
|
|
|
|
it->first->setSize(size);
|
|
|
|
|
}
|
|
|
|
@ -1709,11 +1713,16 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
void WindowManager::trackWindow(Layout *layout, const std::string &name)
|
|
|
|
|
{
|
|
|
|
|
std::string settingName = name;
|
|
|
|
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
|
|
|
|
MyGUI::IntPoint pos(static_cast<int>(Settings::Manager::getFloat(name + " x", "Windows") * viewSize.width),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(name + " y", "Windows") * viewSize.height));
|
|
|
|
|
MyGUI::IntSize size (static_cast<int>(Settings::Manager::getFloat(name + " w", "Windows") * viewSize.width),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(name + " h", "Windows") * viewSize.height));
|
|
|
|
|
bool isMaximized = Settings::Manager::getBool(name + " maximized", "Windows");
|
|
|
|
|
if (isMaximized)
|
|
|
|
|
settingName += " maximized";
|
|
|
|
|
|
|
|
|
|
MyGUI::IntPoint pos(static_cast<int>(Settings::Manager::getFloat(settingName + " x", "Windows") * viewSize.width),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(settingName + " y", "Windows") * viewSize.height));
|
|
|
|
|
MyGUI::IntSize size (static_cast<int>(Settings::Manager::getFloat(settingName + " w", "Windows") * viewSize.width),
|
|
|
|
|
static_cast<int>(Settings::Manager::getFloat(settingName + " h", "Windows") * viewSize.height));
|
|
|
|
|
layout->mMainWidget->setPosition(pos);
|
|
|
|
|
layout->mMainWidget->setSize(size);
|
|
|
|
|
|
|
|
|
@ -1722,6 +1731,26 @@ namespace MWGui
|
|
|
|
|
mTrackedWindows[window] = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::toggleMaximized(Layout *layout)
|
|
|
|
|
{
|
|
|
|
|
MyGUI::Window* window = layout->mMainWidget->castType<MyGUI::Window>();
|
|
|
|
|
std::string setting = mTrackedWindows[window];
|
|
|
|
|
if (setting.empty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
bool maximized = !Settings::Manager::getBool(setting + " maximized", "Windows");
|
|
|
|
|
if (maximized)
|
|
|
|
|
setting += " maximized";
|
|
|
|
|
|
|
|
|
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
|
|
|
|
float x = Settings::Manager::getFloat(setting + " x", "Windows") * float(viewSize.width);
|
|
|
|
|
float y = Settings::Manager::getFloat(setting + " y", "Windows") * float(viewSize.height);
|
|
|
|
|
float w = Settings::Manager::getFloat(setting + " w", "Windows") * float(viewSize.width);
|
|
|
|
|
float h = Settings::Manager::getFloat(setting + " h", "Windows") * float(viewSize.height);
|
|
|
|
|
window->setCoord(x, y, w, h);
|
|
|
|
|
Settings::Manager::setBool(mTrackedWindows[window] + " maximized", "Windows", maximized);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::onWindowChangeCoord(MyGUI::Window *_sender)
|
|
|
|
|
{
|
|
|
|
|
std::string setting = mTrackedWindows[_sender];
|
|
|
|
@ -1734,6 +1763,9 @@ namespace MWGui
|
|
|
|
|
Settings::Manager::setFloat(setting + " y", "Windows", y);
|
|
|
|
|
Settings::Manager::setFloat(setting + " w", "Windows", w);
|
|
|
|
|
Settings::Manager::setFloat(setting + " h", "Windows", h);
|
|
|
|
|
bool maximized = Settings::Manager::getBool(setting + " maximized", "Windows");
|
|
|
|
|
if (maximized)
|
|
|
|
|
Settings::Manager::setBool(setting + " maximized", "Windows", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::clear()
|
|
|
|
|