From b89fdcfd27ef371b6e7036ec7fd400cab87a9229 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 24 Mar 2017 09:41:18 +0400 Subject: [PATCH 01/14] Vanilla style drowning widget (partially fixes bug #3801). --- apps/openmw/mwgui/hud.cpp | 5 ++-- .../mwmechanics/mechanicsmanagerimp.cpp | 3 +++ files/mygui/openmw_hud.layout | 9 ++++--- files/mygui/openmw_progress.skin.xml | 25 +++++++++++-------- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 19e032ff4..7ce2dfa8b 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -609,8 +609,9 @@ namespace MWGui if (mIsDrowning) { - float intensity = (cos(mDrowningFlashTheta) + 1.0f) / 2.0f; - mDrowningFlash->setColour(MyGUI::Colour(intensity, 0, 0)); + float intensity = (cos(mDrowningFlashTheta) + 2.0f) / 3.0f; + + mDrowningFlash->setAlpha(intensity); } } diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index ca5d40b4a..0fbc5f494 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -324,6 +324,9 @@ namespace MWMechanics winMgr->setValue(fbar, stats.getFatigue()); } + // FIXME: if game is just started and actor is already drowning (on savegame loading), + // drowning bar will be hidden, because + // getTimeToStartDrowning = mWatchedTimeToStartDrowning = 0. if(stats.getTimeToStartDrowning() != mWatchedTimeToStartDrowning) { const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get() diff --git a/files/mygui/openmw_hud.layout b/files/mygui/openmw_hud.layout index 0412860ea..8fe25a5dc 100644 --- a/files/mygui/openmw_hud.layout +++ b/files/mygui/openmw_hud.layout @@ -32,18 +32,19 @@ - + - + - + + - + diff --git a/files/mygui/openmw_progress.skin.xml b/files/mygui/openmw_progress.skin.xml index 95f5b378c..67ffeca5b 100644 --- a/files/mygui/openmw_progress.skin.xml +++ b/files/mygui/openmw_progress.skin.xml @@ -39,8 +39,18 @@ - - + + + + + + + + + + + + @@ -76,19 +86,12 @@ - - + + - - - - - - - From 76548a5e4c8380134fa4b9dc1556a8d5d70119cd Mon Sep 17 00:00:00 2001 From: Lennart Bernhardt Date: Fri, 24 Mar 2017 15:37:26 +0100 Subject: [PATCH 02/14] Ignore /deps (Feature #3795) Implements https://bugs.openmw.org/issues/3795 --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 9a24b0107..36c0b7697 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ makefile build* prebuilt +##windows build process +/deps + ## doxygen Doxygen From 4daa88351b30c673701431bc8d181481aba64768 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 24 Mar 2017 21:38:33 +0400 Subject: [PATCH 03/14] Vanilla style progress bars --- files/mygui/openmw_progress.skin.xml | 18 ++++++++++++------ files/mygui/openmw_windows.skin.xml | 4 ++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/files/mygui/openmw_progress.skin.xml b/files/mygui/openmw_progress.skin.xml index 67ffeca5b..428c7f7df 100644 --- a/files/mygui/openmw_progress.skin.xml +++ b/files/mygui/openmw_progress.skin.xml @@ -51,6 +51,12 @@ + + + + + + @@ -67,7 +73,7 @@ - + @@ -75,7 +81,7 @@ - + @@ -83,13 +89,13 @@ - + - + @@ -99,8 +105,8 @@ - - + + diff --git a/files/mygui/openmw_windows.skin.xml b/files/mygui/openmw_windows.skin.xml index 22270bb9f..423de14aa 100644 --- a/files/mygui/openmw_windows.skin.xml +++ b/files/mygui/openmw_windows.skin.xml @@ -9,6 +9,10 @@ + + + + From e383e4d023b5d20208572b195ba02c246d729bc2 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 25 Mar 2017 14:10:19 +0400 Subject: [PATCH 04/14] Disabled hit overlay for damage/absorb mana/fatigue spells --- apps/openmw/mwmechanics/spellcasting.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index d2532db12..3d8e25ce5 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -1064,18 +1064,22 @@ namespace MWMechanics adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::RestoreHealth, magnitude); break; case ESM::MagicEffect::DamageHealth: + receivedMagicDamage = true; + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); + break; case ESM::MagicEffect::DamageMagicka: case ESM::MagicEffect::DamageFatigue: - receivedMagicDamage = true; adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); break; case ESM::MagicEffect::AbsorbHealth: - case ESM::MagicEffect::AbsorbMagicka: - case ESM::MagicEffect::AbsorbFatigue: if (magnitude > 0.f) receivedMagicDamage = true; adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); break; + case ESM::MagicEffect::AbsorbMagicka: + case ESM::MagicEffect::AbsorbFatigue: + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); + break; case ESM::MagicEffect::DisintegrateArmor: { From 7bd0c74aa871d1ce25760bc787067f1f189bd0aa Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 25 Mar 2017 14:15:16 +0400 Subject: [PATCH 05/14] Fixes mWatchedTimeToStartDrowning initialization (fixes bug #3801) --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 0fbc5f494..aef9a03ca 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -232,8 +232,10 @@ namespace MWMechanics invStore.autoEquip(ptr); } + // mWatchedTimeToStartDrowning = -1 for correct drowning state check, + // if stats.getTimeToStartDrowning() == 0 already on game start MechanicsManager::MechanicsManager() - : mWatchedTimeToStartDrowning(0), mWatchedStatsEmpty (true), mUpdatePlayer (true), mClassSelected (false), + : mWatchedTimeToStartDrowning(-1), mWatchedStatsEmpty (true), mUpdatePlayer (true), mClassSelected (false), mRaceSelected (false), mAI(true) { //buildPlayer no longer here, needs to be done explicitly after all subsystems are up and running @@ -324,9 +326,6 @@ namespace MWMechanics winMgr->setValue(fbar, stats.getFatigue()); } - // FIXME: if game is just started and actor is already drowning (on savegame loading), - // drowning bar will be hidden, because - // getTimeToStartDrowning = mWatchedTimeToStartDrowning = 0. if(stats.getTimeToStartDrowning() != mWatchedTimeToStartDrowning) { const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get() From da6b28eb40c29de1d90e03c97b0c686e50f88e9d Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sat, 25 Mar 2017 15:20:37 +0100 Subject: [PATCH 06/14] Fix selling success chance (Fixes #3802) --- apps/openmw/mwmechanics/trading.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/trading.cpp b/apps/openmw/mwmechanics/trading.cpp index 08e4d097a..ede0d2de7 100644 --- a/apps/openmw/mwmechanics/trading.cpp +++ b/apps/openmw/mwmechanics/trading.cpp @@ -37,7 +37,7 @@ namespace MWMechanics int b = std::abs(playerOffer); int d = (buying) ? int(100 * (a - b) / a) - : int(100 * (b - a) / a); + : int(100 * (b - a) / b); int clampedDisposition = MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(merchant); From e56089aff469cace9afdf7495224a6a53dea1284 Mon Sep 17 00:00:00 2001 From: Lennart Bernhardt Date: Sat, 25 Mar 2017 15:26:14 +0100 Subject: [PATCH 07/14] Ignore /MSVC* (Feature #3795) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 36c0b7697..ca2c6502e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ prebuilt ##windows build process /deps +/MSVC* ## doxygen Doxygen From 860b55671339b1b1f407d4634d0f0cab17253cfb Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 25 Mar 2017 19:53:24 +0400 Subject: [PATCH 08/14] Disables explosion effect for 0-range projectiles (fixes #3730) --- apps/openmw/mwworld/worldimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 851b02ba8..48aeaaf19 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3275,6 +3275,9 @@ namespace MWWorld if (effectIt->mRange != rangeType || (effectIt->mArea <= 0 && !ignore.isEmpty() && ignore.getClass().isActor())) continue; // Not right range type, or not area effect and hit an actor + if (fromProjectile && effectIt->mArea <= 0) + continue; // Don't play explosion for projectiles with 0-area effects + if (!fromProjectile && effectIt->mRange == ESM::RT_Touch && (!ignore.isEmpty()) && (!ignore.getClass().isActor() && !ignore.getClass().canBeActivated(ignore))) continue; // Don't play explosion for touch spells on non-activatable objects except when spell is from the projectile enchantment From 6253a5218e55d180c7c5ab930c8a616fdd11e5e5 Mon Sep 17 00:00:00 2001 From: Allofich Date: Sun, 26 Mar 2017 16:51:32 +0900 Subject: [PATCH 09/14] Adjust AI follow distances (Fixes #3225) --- apps/openmw/mwmechanics/aifollow.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwmechanics/aifollow.cpp b/apps/openmw/mwmechanics/aifollow.cpp index 9d79d4ba9..fd3014298 100644 --- a/apps/openmw/mwmechanics/aifollow.cpp +++ b/apps/openmw/mwmechanics/aifollow.cpp @@ -92,16 +92,23 @@ bool AiFollow::execute (const MWWorld::Ptr& actor, CharacterController& characte ESM::Position pos = actor.getRefData().getPosition(); //position of the actor - float followDistance = 180; - // When there are multiple actors following the same target, they form a group with each group member at 180*(i+1) distance to the target - int i=0; + // The distances below are approximations based on observations of the original engine. + // If only one actor is following the target, it uses 186. + // If there are multiple actors following the same target, they form a group with each group member at 313 + (130 * i) distance to the target. + + short followDistance = 186; std::list followers = MWBase::Environment::get().getMechanicsManager()->getActorsFollowingIndices(target); - followers.sort(); - for (std::list::iterator it = followers.begin(); it != followers.end(); ++it) + if (followers.size() >= 2) { - if (*it == mFollowIndex) - followDistance *= (i+1); - ++i; + followDistance = 313; + short i = 0; + followers.sort(); + for (std::list::iterator it = followers.begin(); it != followers.end(); ++it) + { + if (*it == mFollowIndex) + followDistance += 130 * i; + ++i; + } } if (!mAlwaysFollow) //Update if you only follow for a bit @@ -139,7 +146,7 @@ bool AiFollow::execute (const MWWorld::Ptr& actor, CharacterController& characte if (!storage.mMoving) { - const float threshold = 10; // to avoid constant switching between moving/stopping + const short threshold = 10; // to avoid constant switching between moving/stopping followDistance += threshold; } From 658ab5e941460a2acbfad4f71f801f2ff7099db4 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 26 Mar 2017 22:56:36 +0400 Subject: [PATCH 10/14] Minor journal improvements --- apps/openmw/mwinput/inputmanagerimp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index b09c45860..234a17cc3 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -166,12 +166,12 @@ namespace MWInput void InputManager::setPlayerControlsEnabled(bool enabled) { - int nPlayerChannels = 17; + int nPlayerChannels = 18; int playerChannels[] = {A_Activate, A_AutoMove, A_AlwaysRun, A_ToggleWeapon, A_ToggleSpell, A_Rest, A_QuickKey1, A_QuickKey2, A_QuickKey3, A_QuickKey4, A_QuickKey5, A_QuickKey6, A_QuickKey7, A_QuickKey8, A_QuickKey9, A_QuickKey10, - A_Use}; + A_Use, A_Journal}; for(int i = 0; i < nPlayerChannels; i++) { int pc = playerChannels[i]; @@ -1031,6 +1031,7 @@ namespace MWInput } else if(MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Journal)) { + MWBase::Environment::get().getSoundManager()->playSound ("book close", 1.0, 1.0); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Journal); } } From b064dd29ccb7d60d44b11bcf9df806d0d13684b7 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 27 Mar 2017 02:51:23 +0200 Subject: [PATCH 11/14] Fix reset of blend function (Bug #3811) --- apps/openmw/mwrender/characterpreview.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 9dc1d6e77..dfb737d5e 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -95,7 +95,6 @@ namespace MWRender osg::BlendFunc* blendFunc = static_cast(stateset->getAttribute(osg::StateAttribute::BLENDFUNC)); osg::ref_ptr newBlendFunc = blendFunc ? new osg::BlendFunc(*blendFunc) : new osg::BlendFunc; newBlendFunc->setDestinationAlpha(osg::BlendFunc::ONE); - newBlendFunc->setDestinationRGB(osg::BlendFunc::ONE); newStateSet->setAttribute(newBlendFunc, osg::StateAttribute::ON); node.setStateSet(newStateSet); } From 7d09a5d644131e794db0d4d8e20c90ea55e4afc6 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 27 Mar 2017 13:33:28 +0400 Subject: [PATCH 12/14] Progress bars vertical alignment --- apps/openmw/mwgui/dialogue.hpp | 2 +- files/mygui/openmw_dialogue_window.layout | 6 ++++-- files/mygui/openmw_dialogue_window.skin.xml | 10 ---------- files/mygui/openmw_progress.skin.xml | 2 +- files/mygui/openmw_stats_window.layout | 19 +++++++++---------- files/mygui/openmw_text.skin.xml | 4 ++-- files/mygui/openmw_tooltips.layout | 4 ++-- .../openmw_wait_dialog_progressbar.layout | 5 ++--- 8 files changed, 21 insertions(+), 31 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp index 769c32af7..d34574e89 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -167,7 +167,7 @@ namespace MWGui Gui::MWList* mTopicsList; MyGUI::ScrollBar* mScrollBar; MyGUI::ProgressBar* mDispositionBar; - MyGUI::EditBox* mDispositionText; + MyGUI::TextBox* mDispositionText; PersuasionDialog mPersuasionDialog; }; diff --git a/files/mygui/openmw_dialogue_window.layout b/files/mygui/openmw_dialogue_window.layout index a0a4bf441..a85bd5b02 100644 --- a/files/mygui/openmw_dialogue_window.layout +++ b/files/mygui/openmw_dialogue_window.layout @@ -16,9 +16,11 @@ - - + + + diff --git a/files/mygui/openmw_dialogue_window.skin.xml b/files/mygui/openmw_dialogue_window.skin.xml index 3f7987f7a..33c1e7d62 100644 --- a/files/mygui/openmw_dialogue_window.skin.xml +++ b/files/mygui/openmw_dialogue_window.skin.xml @@ -1,14 +1,4 @@ - - - - - - - - - - diff --git a/files/mygui/openmw_progress.skin.xml b/files/mygui/openmw_progress.skin.xml index 428c7f7df..324307d67 100644 --- a/files/mygui/openmw_progress.skin.xml +++ b/files/mygui/openmw_progress.skin.xml @@ -59,7 +59,7 @@ - + diff --git a/files/mygui/openmw_stats_window.layout b/files/mygui/openmw_stats_window.layout index 1d9b75b9b..d9860ae20 100644 --- a/files/mygui/openmw_stats_window.layout +++ b/files/mygui/openmw_stats_window.layout @@ -20,9 +20,9 @@ - - - + + + @@ -40,10 +40,9 @@ - - - - + + + @@ -61,9 +60,9 @@ - - - + + + diff --git a/files/mygui/openmw_text.skin.xml b/files/mygui/openmw_text.skin.xml index b7a893580..89f3690ec 100644 --- a/files/mygui/openmw_text.skin.xml +++ b/files/mygui/openmw_text.skin.xml @@ -134,12 +134,12 @@ color_misc=0,205,205 # ???? - + - + diff --git a/files/mygui/openmw_tooltips.layout b/files/mygui/openmw_tooltips.layout index d47c27976..6d4421702 100644 --- a/files/mygui/openmw_tooltips.layout +++ b/files/mygui/openmw_tooltips.layout @@ -165,7 +165,7 @@ - + @@ -211,7 +211,7 @@ - + diff --git a/files/mygui/openmw_wait_dialog_progressbar.layout b/files/mygui/openmw_wait_dialog_progressbar.layout index 92fcb15cf..8147abbdf 100644 --- a/files/mygui/openmw_wait_dialog_progressbar.layout +++ b/files/mygui/openmw_wait_dialog_progressbar.layout @@ -4,10 +4,9 @@ - - + + - From c9cf0ec9771f0200213ec768d25690564a3c73aa Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 27 Mar 2017 14:38:40 +0400 Subject: [PATCH 13/14] Buttons and widgets captions vertical alignment --- files/mygui/openmw_button.skin.xml | 2 +- files/mygui/openmw_edit.skin.xml | 2 +- files/mygui/openmw_loading_screen.layout | 2 +- files/mygui/openmw_resources.xml | 2 +- files/mygui/openmw_savegame_dialog.layout | 1 + files/mygui/openmw_text.skin.xml | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/files/mygui/openmw_button.skin.xml b/files/mygui/openmw_button.skin.xml index 18055a7e5..09a4c0e39 100644 --- a/files/mygui/openmw_button.skin.xml +++ b/files/mygui/openmw_button.skin.xml @@ -81,7 +81,7 @@ - + diff --git a/files/mygui/openmw_edit.skin.xml b/files/mygui/openmw_edit.skin.xml index 5ec48f752..a53becdaa 100644 --- a/files/mygui/openmw_edit.skin.xml +++ b/files/mygui/openmw_edit.skin.xml @@ -23,7 +23,7 @@ - + diff --git a/files/mygui/openmw_loading_screen.layout b/files/mygui/openmw_loading_screen.layout index 92bc5aa4c..89b35d05e 100644 --- a/files/mygui/openmw_loading_screen.layout +++ b/files/mygui/openmw_loading_screen.layout @@ -6,7 +6,7 @@ - + diff --git a/files/mygui/openmw_resources.xml b/files/mygui/openmw_resources.xml index 9a6cfd038..662d78ab7 100644 --- a/files/mygui/openmw_resources.xml +++ b/files/mygui/openmw_resources.xml @@ -101,7 +101,7 @@ - + diff --git a/files/mygui/openmw_savegame_dialog.layout b/files/mygui/openmw_savegame_dialog.layout index 40288f0f5..ca11b65f8 100644 --- a/files/mygui/openmw_savegame_dialog.layout +++ b/files/mygui/openmw_savegame_dialog.layout @@ -45,6 +45,7 @@ + diff --git a/files/mygui/openmw_text.skin.xml b/files/mygui/openmw_text.skin.xml index 89f3690ec..e539347d0 100644 --- a/files/mygui/openmw_text.skin.xml +++ b/files/mygui/openmw_text.skin.xml @@ -21,7 +21,7 @@ color_misc=0,205,205 # ???? - + From a35d4334c386928645ebfbcbcf3b1e3750a4dfe5 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 27 Mar 2017 14:54:04 +0400 Subject: [PATCH 14/14] Encumberance text fix --- files/mygui/openmw_text.skin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/mygui/openmw_text.skin.xml b/files/mygui/openmw_text.skin.xml index e539347d0..e442e37ee 100644 --- a/files/mygui/openmw_text.skin.xml +++ b/files/mygui/openmw_text.skin.xml @@ -139,7 +139,7 @@ color_misc=0,205,205 # ???? - +