Merge pull request #242 from OpenMW/master

Add OpenMW commits up to 16 Jul 2017
0.6.1
David Cernat 8 years ago committed by GitHub
commit fd046e42ef

@ -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);

@ -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)

@ -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;
}

@ -45,20 +45,18 @@ int getRangeTypes (const ESM::EffectList& effects)
float suggestCombatRange(int rangeTypes)
{
static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatDistance")->getFloat();
static float fHandToHandReach = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().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<ESM::GameSetting>().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<ESM::Spell>().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;
}

@ -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);
}
};

@ -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
);
}
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 362 310" align="Center" name="_Main">
<Widget type="Window" skin="MW_DialogNoTransp" layer="Windows" position="0 0 362 310" align="Center" name="_Main">
<Widget type="ImageBox" skin="ImageBox" position="8 12 16 16" name="EffectImage">
</Widget>

@ -150,6 +150,19 @@
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
</Resource>
<Resource type="ResourceSkin" name="MW_PopupListNoTransp" size="516 516" align="Left Top">
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Property key="HeightLine" value="18"/>
<Child type="Widget" skin="FullBlackBG" offset="0 0 516 516" align="Stretch"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="MWScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right VStretch" name="VScroll"/>
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
</Resource>
<Resource type="ResourceSkin" name="MW_ItemView" size="516 516" align="Left Top">
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" position="0 0 330 370" layer="Windows" align="Center" name="_Main">
<Widget type="Window" skin="MW_DialogNoTransp" position="0 0 330 370" layer="Windows" align="Center" name="_Main">
<Widget type="TextBox" skin="SandText" position="8 8 292 24">
<Property key="Caption" value="#{sMagicSelectTitle}"/>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" position="0 0 16 154" layer="Windows" name="_Main">
<Widget type="Window" skin="MW_DialogNoTransp" position="0 0 16 154" layer="Windows" name="_Main">
<Widget type="TextBox" skin="SandText" position="8 8 0 18" name="Label">
<Property key="Caption" value="#{sQuickMenu1}"/>

@ -106,7 +106,7 @@
<Widget type="TextBox" skin="SandText" position="6 3 71 20" align="Stretch" name="Client">
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="ListBox" skin="MW_PopupList" position="65 38 100 200" style="Popup" layer="Popup" name="List">
<Widget type="ListBox" skin="MW_PopupListNoTransp" position="65 38 100 200" style="Popup" layer="Popup" name="List">
<Property key="Visible" value="false"/>
</Widget>
<Widget type="Button" skin="MW_ArrowDown" position="79 7 14 11" align="Right VCenter" name="Button"/>

Loading…
Cancel
Save