diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 63cc14d98..619540cff 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -370,7 +370,8 @@ namespace MWGui mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(mParent, &QuickKeysMenu::onCancelButtonClicked); - int maxWidth = mItemButton->getTextSize ().width + 24; + int maxWidth = mLabel->getTextSize ().width + 24; + maxWidth = std::max(maxWidth, mItemButton->getTextSize ().width + 24); maxWidth = std::max(maxWidth, mMagicButton->getTextSize ().width + 24); maxWidth = std::max(maxWidth, mUnassignButton->getTextSize ().width + 24); maxWidth = std::max(maxWidth, mCancelButton->getTextSize ().width + 24); diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index 22c7fc437..d5b291b3c 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -181,11 +181,20 @@ namespace MWGui mAreaSlider->setScrollPosition (effect.mArea); mDurationSlider->setScrollPosition (effect.mDuration-1); + if (mEffect.mRange == ESM::RT_Self) + mRangeButton->setCaptionWithReplacing ("#{sRangeSelf}"); + else if (mEffect.mRange == ESM::RT_Target) + mRangeButton->setCaptionWithReplacing ("#{sRangeTarget}"); + else if (mEffect.mRange == ESM::RT_Touch) + mRangeButton->setCaptionWithReplacing ("#{sRangeTouch}"); + onMagnitudeMinChanged (mMagnitudeMinSlider, effect.mMagnMin-1); onMagnitudeMaxChanged (mMagnitudeMinSlider, effect.mMagnMax-1); onAreaChanged (mAreaSlider, effect.mArea); onDurationChanged (mDurationSlider, effect.mDuration-1); eventEffectModified(mEffect); + + updateBoxes(); } void EditEffectDialog::setMagicEffect (const ESM::MagicEffect *effect) diff --git a/apps/openmw/mwgui/spellview.cpp b/apps/openmw/mwgui/spellview.cpp index 9932cddfa..ebda8873c 100644 --- a/apps/openmw/mwgui/spellview.cpp +++ b/apps/openmw/mwgui/spellview.cpp @@ -96,9 +96,9 @@ namespace MWGui if (spell.mType == Spell::Type_Power) addGroup("#{sPowers}", ""); else if (spell.mType == Spell::Type_Spell) - addGroup("#{sSpells}", "#{sCostChance}"); + addGroup("#{sSpells}", mShowCostColumn ? "#{sCostChance}" : ""); else - addGroup("#{sMagicItem}", "#{sCostCharge}"); + addGroup("#{sMagicItem}", mShowCostColumn ? "#{sCostCharge}" : ""); curType = spell.mType; } diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 46d37eb3d..aad0baae8 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -45,20 +45,18 @@ int getRangeTypes (const ESM::EffectList& effects) float suggestCombatRange(int rangeTypes) { + static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get().find("fCombatDistance")->getFloat(); + static float fHandToHandReach = MWBase::Environment::get().getWorld()->getStore().get().find("fHandToHandReach")->getFloat(); + + // This distance is a possible distance of melee attack + static float distance = fCombatDistance * std::max(2.f, fHandToHandReach); + if (rangeTypes & Touch) { - static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get().find("fCombatDistance")->getFloat(); return fCombatDistance; } - else if (rangeTypes & Target) - { - return 1000.f; - } - else - { - // For Self spells, distance doesn't matter, so back away slightly to avoid enemy hits - return 600.f; - } + + return distance * 4; } int numEffectsToDispel (const MWWorld::Ptr& actor, int effectFilter=-1, bool negative = true) @@ -640,7 +638,7 @@ namespace MWMechanics const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get().find(mSpellId); int types = getRangeTypes(spell->mEffects); - isRanged = (types & Target); + isRanged = (types & Target) | (types & Self); return suggestCombatRange(types); } @@ -660,7 +658,8 @@ namespace MWMechanics float ActionPotion::getCombatRange(bool& isRanged) const { - // distance doesn't matter, so back away slightly to avoid enemy hits + // Distance doesn't matter since this action has no animation + // If we want to back away slightly to avoid enemy hits, we should set isRanged to "true" return 600.f; } diff --git a/apps/openmw/mwscript/soundextensions.cpp b/apps/openmw/mwscript/soundextensions.cpp index 71ca2d1f9..5645fc296 100644 --- a/apps/openmw/mwscript/soundextensions.cpp +++ b/apps/openmw/mwscript/soundextensions.cpp @@ -108,7 +108,7 @@ namespace MWScript std::string sound = runtime.getStringLiteral (runtime[0].mInteger); runtime.pop(); - MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0); + MWBase::Environment::get().getSoundManager()->playSound(sound, 1.0, 1.0, MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_NoEnv); } }; @@ -127,7 +127,7 @@ namespace MWScript Interpreter::Type_Float pitch = runtime[0].mFloat; runtime.pop(); - MWBase::Environment::get().getSoundManager()->playSound (sound, volume, pitch); + MWBase::Environment::get().getSoundManager()->playSound(sound, volume, pitch, MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_NoEnv); } }; diff --git a/apps/openmw/mwworld/action.cpp b/apps/openmw/mwworld/action.cpp index 92e959e41..468207e81 100644 --- a/apps/openmw/mwworld/action.cpp +++ b/apps/openmw/mwworld/action.cpp @@ -4,6 +4,7 @@ #include "../mwbase/world.hpp" #include "../mwbase/soundmanager.hpp" +#include "../mwbase/windowmanager.hpp" #include "../mwmechanics/actorutil.hpp" @@ -26,9 +27,18 @@ void MWWorld::Action::execute (const Ptr& actor, bool noSound) { if(!mSoundId.empty() && !noSound) { + MWBase::SoundManager::PlayMode envType = MWBase::SoundManager::Play_Normal; + + // Action sounds should not have a distortion in GUI mode + // example: take an item or drink a potion underwater + if (actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWindowManager()->isGuiMode()) + { + envType = MWBase::SoundManager::Play_NoEnv; + } + if(mKeepSound && actor == MWMechanics::getPlayer()) MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0, - MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Normal, mSoundOffset + MWBase::SoundManager::Play_TypeSfx, envType, mSoundOffset ); else { @@ -37,12 +47,12 @@ void MWWorld::Action::execute (const Ptr& actor, bool noSound) MWBase::Environment::get().getSoundManager()->playSound3D( (local ? actor : mTarget).getRefData().getPosition().asVec3(), mSoundId, 1.0, 1.0, MWBase::SoundManager::Play_TypeSfx, - MWBase::SoundManager::Play_Normal, mSoundOffset + envType, mSoundOffset ); else MWBase::Environment::get().getSoundManager()->playSound3D(local ? actor : mTarget, mSoundId, 1.0, 1.0, MWBase::SoundManager::Play_TypeSfx, - MWBase::SoundManager::Play_Normal, mSoundOffset + envType, mSoundOffset ); } } diff --git a/files/mygui/openmw_edit_effect.layout b/files/mygui/openmw_edit_effect.layout index 387c01231..376e87efa 100644 --- a/files/mygui/openmw_edit_effect.layout +++ b/files/mygui/openmw_edit_effect.layout @@ -1,7 +1,7 @@ - + diff --git a/files/mygui/openmw_list.skin.xml b/files/mygui/openmw_list.skin.xml index 8a238879c..5b6f14dd5 100644 --- a/files/mygui/openmw_list.skin.xml +++ b/files/mygui/openmw_list.skin.xml @@ -150,6 +150,19 @@ + + + + + + + + + + + + + diff --git a/files/mygui/openmw_magicselection_dialog.layout b/files/mygui/openmw_magicselection_dialog.layout index 5301ecfe9..027250d7a 100644 --- a/files/mygui/openmw_magicselection_dialog.layout +++ b/files/mygui/openmw_magicselection_dialog.layout @@ -1,6 +1,6 @@ - + diff --git a/files/mygui/openmw_quickkeys_menu_assign.layout b/files/mygui/openmw_quickkeys_menu_assign.layout index 4bbd9f1fa..2c80fefcd 100644 --- a/files/mygui/openmw_quickkeys_menu_assign.layout +++ b/files/mygui/openmw_quickkeys_menu_assign.layout @@ -1,6 +1,6 @@ - + diff --git a/files/mygui/openmw_resources.xml b/files/mygui/openmw_resources.xml index ef11d10a0..811fa4f7f 100644 --- a/files/mygui/openmw_resources.xml +++ b/files/mygui/openmw_resources.xml @@ -106,7 +106,7 @@ - +