diff --git a/AUTHORS.md b/AUTHORS.md index 7774b5afa2..2bd96e3a16 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -52,6 +52,7 @@ Programmers jeaye Jeffrey Haines (Jyby) Jengerer + Jiří Kuneš (kunesj) Joel Graff (graffy) John Blomberg (fstp) Jordan Ayers @@ -59,7 +60,6 @@ Programmers Julien Voisin (jvoisin/ap0) Karl-Felix Glatzer (k1ll) Kevin Poitra (PuppyKevin) - kunesj Lars Söderberg (Lazaroth) lazydev Leon Saunders (emoose) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 7307e6f871..1acbea6d7d 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -520,15 +520,13 @@ namespace MWGui void HUD::setCrosshairOwned(bool owned) { - MyGUI::Colour red = MyGUI::Colour(1.0, 0, 0); - MyGUI::Colour white = MyGUI::Colour(1.0, 1.0, 1.0); if(owned) { - mCrosshair->setColour(red); + mCrosshair->changeWidgetSkin("HUD_Crosshair_Owned"); } else { - mCrosshair->setColour(white); + mCrosshair->changeWidgetSkin("HUD_Crosshair"); } } diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 22d5d14f7c..dbf27ad91d 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -38,6 +38,7 @@ namespace MWGui , mLastMouseY(0) , mEnabled(true) , mFullHelp(false) + , mShowOwned(0) { getWidget(mDynamicToolTipBox, "DynamicToolTipBox"); @@ -55,6 +56,8 @@ namespace MWGui { mMainWidget->getChildAt(i)->setVisible(false); } + + mShowOwned = Settings::Manager::getInt("show owned", "Game"); } void ToolTips::setEnabled(bool enabled) @@ -369,6 +372,18 @@ namespace MWGui MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info) { mDynamicToolTipBox->setVisible(true); + + if(mShowOwned == 1 || mShowOwned == 3) + { + if(checkOwned()) + { + mDynamicToolTipBox->changeWidgetSkin("HUD_Box_NoTransp_Owned"); + } + else + { + mDynamicToolTipBox->changeWidgetSkin("HUD_Box_NoTransp"); + } + } std::string caption = info.caption; std::string image = info.icon; diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index bd4a81c32c..b2f172076f 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -122,6 +122,8 @@ namespace MWGui bool mEnabled; bool mFullHelp; + + int mShowOwned; }; } #endif diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 31eef5c016..4552c42f21 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -186,7 +186,7 @@ namespace MWGui , mRestAllowed(true) , mFPS(0.0f) , mFallbackMap(fallbackMap) - , mShowOwned(false) + , mShowOwned(0) , mVersionDescription(versionDescription) { float uiScale = Settings::Manager::getFloat("scaling factor", "GUI"); @@ -263,7 +263,7 @@ namespace MWGui MyGUI::ClipboardManager::getInstance().eventClipboardChanged += MyGUI::newDelegate(this, &WindowManager::onClipboardChanged); MyGUI::ClipboardManager::getInstance().eventClipboardRequested += MyGUI::newDelegate(this, &WindowManager::onClipboardRequested); - mShowOwned = Settings::Manager::getBool("show owned", "Game"); + mShowOwned = Settings::Manager::getInt("show owned", "Game"); } void WindowManager::initUI() @@ -1042,7 +1042,7 @@ namespace MWGui { mToolTips->setFocusObject(focus); - if(mShowOwned && mHud) + if(mHud && (mShowOwned == 2 || mShowOwned == 3)) { bool owned = mToolTips->checkOwned(); mHud->setCrosshairOwned(owned); @@ -1094,11 +1094,22 @@ namespace MWGui void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result) { std::string tag(_tag); + + std::string MyGuiPrefix = "setting="; + size_t MyGuiPrefixLength = MyGuiPrefix.length(); std::string tokenToFind = "sCell="; size_t tokenLength = tokenToFind.length(); - - if (tag.compare(0, tokenLength, tokenToFind) == 0) + + if(tag.compare(0, MyGuiPrefixLength, MyGuiPrefix) == 0) + { + tag = tag.substr(MyGuiPrefixLength, tag.length()); + std::string settingSection = tag.substr(0, tag.find(",")); + std::string settingTag = tag.substr(tag.find(",")+1, tag.length()); + + _result = Settings::Manager::getString(settingTag, settingSection); + } + else if (tag.compare(0, tokenLength, tokenToFind) == 0) { _result = mTranslationDataStorage.translateCellName(tag.substr(tokenLength)); } diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 7dae502094..336a2a19a6 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -487,7 +487,7 @@ namespace MWGui std::map mFallbackMap; - bool mShowOwned; + int mShowOwned; std::string mVersionDescription; @@ -495,6 +495,7 @@ namespace MWGui * Called when MyGUI tries to retrieve a tag's value. Tags must be denoted in #{tag} notation and will be replaced upon setting a user visible text/property. * Supported syntax: * #{GMSTName}: retrieves String value of the GMST called GMSTName + * #{setting=CATEGORY_NAME,SETTING_NAME}: retrieves String value of SETTING_NAME under category CATEGORY_NAME from settings.cfg * #{sCell=CellID}: retrieves translated name of the given CellID (used only by some Morrowind localisations, in others cell ID is == cell name) * #{fontcolour=FontColourName}: retrieves the value of the fallback setting "FontColor_color_" from openmw.cfg, * in the format "r g b a", float values in range 0-1. Useful for "Colour" and "TextColour" properties in skins. diff --git a/files/mygui/openmw_hud.layout b/files/mygui/openmw_hud.layout index dd114097e5..97b0184696 100644 --- a/files/mygui/openmw_hud.layout +++ b/files/mygui/openmw_hud.layout @@ -122,8 +122,7 @@ - - + diff --git a/files/mygui/openmw_hud_box.skin.xml b/files/mygui/openmw_hud_box.skin.xml index 4e63497680..33199d6aeb 100644 --- a/files/mygui/openmw_hud_box.skin.xml +++ b/files/mygui/openmw_hud_box.skin.xml @@ -31,5 +31,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/files/mygui/openmw_windows.skin.xml b/files/mygui/openmw_windows.skin.xml index e740383914..682d89ebcc 100644 --- a/files/mygui/openmw_windows.skin.xml +++ b/files/mygui/openmw_windows.skin.xml @@ -128,6 +128,14 @@ + + + + + + + + diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 4ec0c2480f..dcb9b8893e 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -36,6 +36,10 @@ werewolf overlay = true stretch menu background = false +# colour definitions (red green blue alpha) +color background owned = 0.15 0 0 1 +color crosshair owned = 1 0.15 0.15 1 + [General] # Camera field of view field of view = 55 @@ -162,8 +166,12 @@ best attack = false difficulty = 0 -# change crosshair color when pointing on owned object -show owned = false +# Change crosshair/toolTip color when pointing on owned object +#0: nothing changed +#1: tint toolTip +#2: tint crosshair +#3: both +show owned = 0 [Saves] character =