mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 21:41:37 +00:00
Merge pull request #2347 from akortunov/pinning
Make pinnable windows hiding persistent
This commit is contained in:
commit
5e405ca679
3 changed files with 46 additions and 11 deletions
|
@ -100,6 +100,7 @@
|
||||||
Feature #4958: Support eight blood types
|
Feature #4958: Support eight blood types
|
||||||
Feature #4962: Add casting animations for magic items
|
Feature #4962: Add casting animations for magic items
|
||||||
Feature #4968: Scalable UI widget skins
|
Feature #4968: Scalable UI widget skins
|
||||||
|
Feature #4994: Persistent pinnable windows hiding
|
||||||
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
||||||
Task #4695: Optimize Distant Terrain memory consumption
|
Task #4695: Optimize Distant Terrain memory consumption
|
||||||
Task #4721: Add NMake support to the Windows prebuild script
|
Task #4721: Add NMake support to the Windows prebuild script
|
||||||
|
|
|
@ -1480,6 +1480,32 @@ namespace MWGui
|
||||||
if (getMode() != GM_Inventory)
|
if (getMode() != GM_Inventory)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::string settingName;
|
||||||
|
switch (wnd)
|
||||||
|
{
|
||||||
|
case GW_Inventory:
|
||||||
|
settingName = "inventory";
|
||||||
|
break;
|
||||||
|
case GW_Map:
|
||||||
|
settingName = "map";
|
||||||
|
break;
|
||||||
|
case GW_Magic:
|
||||||
|
settingName = "spells";
|
||||||
|
break;
|
||||||
|
case GW_Stats:
|
||||||
|
settingName = "stats";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!settingName.empty())
|
||||||
|
{
|
||||||
|
settingName += " hidden";
|
||||||
|
bool hidden = Settings::Manager::getBool(settingName, "Windows");
|
||||||
|
Settings::Manager::setBool(settingName, "Windows", !hidden);
|
||||||
|
}
|
||||||
|
|
||||||
mShown = (GuiWindow)(mShown ^ wnd);
|
mShown = (GuiWindow)(mShown ^ wnd);
|
||||||
updateVisible();
|
updateVisible();
|
||||||
}
|
}
|
||||||
|
@ -1929,12 +1955,20 @@ namespace MWGui
|
||||||
void WindowManager::updatePinnedWindows()
|
void WindowManager::updatePinnedWindows()
|
||||||
{
|
{
|
||||||
mInventoryWindow->setPinned(Settings::Manager::getBool("inventory pin", "Windows"));
|
mInventoryWindow->setPinned(Settings::Manager::getBool("inventory pin", "Windows"));
|
||||||
|
if (Settings::Manager::getBool("inventory hidden", "Windows"))
|
||||||
|
mShown = (GuiWindow)(mShown ^ GW_Inventory);
|
||||||
|
|
||||||
mMap->setPinned(Settings::Manager::getBool("map pin", "Windows"));
|
mMap->setPinned(Settings::Manager::getBool("map pin", "Windows"));
|
||||||
|
if (Settings::Manager::getBool("map hidden", "Windows"))
|
||||||
|
mShown = (GuiWindow)(mShown ^ GW_Map);
|
||||||
|
|
||||||
mSpellWindow->setPinned(Settings::Manager::getBool("spells pin", "Windows"));
|
mSpellWindow->setPinned(Settings::Manager::getBool("spells pin", "Windows"));
|
||||||
|
if (Settings::Manager::getBool("spells hidden", "Windows"))
|
||||||
|
mShown = (GuiWindow)(mShown ^ GW_Magic);
|
||||||
|
|
||||||
mStatsWindow->setPinned(Settings::Manager::getBool("stats pin", "Windows"));
|
mStatsWindow->setPinned(Settings::Manager::getBool("stats pin", "Windows"));
|
||||||
|
if (Settings::Manager::getBool("stats hidden", "Windows"))
|
||||||
|
mShown = (GuiWindow)(mShown ^ GW_Stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::pinWindow(GuiWindow window)
|
void WindowManager::pinWindow(GuiWindow window)
|
||||||
|
|
|
@ -484,24 +484,32 @@ stats x = 0.015
|
||||||
stats y = 0.015
|
stats y = 0.015
|
||||||
stats w = 0.4275
|
stats w = 0.4275
|
||||||
stats h = 0.45
|
stats h = 0.45
|
||||||
# Stats window pin status
|
|
||||||
stats pin = false
|
stats pin = false
|
||||||
|
stats hidden = false
|
||||||
|
|
||||||
# Spells window displaying powers, spells, and magical items.
|
# Spells window displaying powers, spells, and magical items.
|
||||||
spells x = 0.63
|
spells x = 0.63
|
||||||
spells y = 0.39
|
spells y = 0.39
|
||||||
spells w = 0.36
|
spells w = 0.36
|
||||||
spells h = 0.51
|
spells h = 0.51
|
||||||
# Spells window pin status
|
|
||||||
spells pin = false
|
spells pin = false
|
||||||
|
spells hidden = false
|
||||||
|
|
||||||
# Local and world map window.
|
# Local and world map window.
|
||||||
map x = 0.63
|
map x = 0.63
|
||||||
map y = 0.015
|
map y = 0.015
|
||||||
map w = 0.36
|
map w = 0.36
|
||||||
map h = 0.37
|
map h = 0.37
|
||||||
# Map window pin status
|
|
||||||
map pin = false
|
map pin = false
|
||||||
|
map hidden = false
|
||||||
|
|
||||||
|
# Player inventory window when explicitly opened.
|
||||||
|
inventory x = 0.015
|
||||||
|
inventory y = 0.54
|
||||||
|
inventory w = 0.45
|
||||||
|
inventory h = 0.38
|
||||||
|
inventory pin = false
|
||||||
|
inventory hidden = false
|
||||||
|
|
||||||
# Dialog window for talking with NPCs.
|
# Dialog window for talking with NPCs.
|
||||||
dialogue x = 0.15
|
dialogue x = 0.15
|
||||||
|
@ -521,14 +529,6 @@ console y = 0.015
|
||||||
console w = 1.0
|
console w = 1.0
|
||||||
console h = 0.5
|
console h = 0.5
|
||||||
|
|
||||||
# Player inventory window when explicitly opened.
|
|
||||||
inventory x = 0.015
|
|
||||||
inventory y = 0.54
|
|
||||||
inventory w = 0.45
|
|
||||||
inventory h = 0.38
|
|
||||||
# Inventory window pin status
|
|
||||||
inventory pin = false
|
|
||||||
|
|
||||||
# Player inventory window when searching a container.
|
# Player inventory window when searching a container.
|
||||||
inventory container x = 0.015
|
inventory container x = 0.015
|
||||||
inventory container y = 0.54
|
inventory container y = 0.54
|
||||||
|
|
Loading…
Reference in a new issue