forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
9109162030
9 changed files with 61 additions and 37 deletions
|
@ -61,6 +61,7 @@ Launcher::MainDialog::MainDialog(QWidget *parent)
|
|||
QString revision(OPENMW_VERSION_COMMITHASH);
|
||||
QString tag(OPENMW_VERSION_TAGHASH);
|
||||
|
||||
versionLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
if (!revision.isEmpty() && !tag.isEmpty())
|
||||
{
|
||||
if (revision == tag) {
|
||||
|
|
|
@ -671,4 +671,14 @@ namespace MWGui
|
|||
mEnemyHealthTimer = -1;
|
||||
}
|
||||
|
||||
void HUD::customMarkerCreated(MyGUI::Widget *marker)
|
||||
{
|
||||
marker->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onMapClicked);
|
||||
}
|
||||
|
||||
void HUD::doorMarkerCreated(MyGUI::Widget *marker)
|
||||
{
|
||||
marker->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onMapClicked);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -119,6 +119,10 @@ namespace MWGui
|
|||
void onMagicClicked(MyGUI::Widget* _sender);
|
||||
void onMapClicked(MyGUI::Widget* _sender);
|
||||
|
||||
// LocalMapBase
|
||||
virtual void customMarkerCreated(MyGUI::Widget* marker);
|
||||
virtual void doorMarkerCreated(MyGUI::Widget* marker);
|
||||
|
||||
void updateEnemyHealthBar();
|
||||
|
||||
void updatePositions();
|
||||
|
|
|
@ -102,6 +102,31 @@ namespace MWGui
|
|||
updateSpells();
|
||||
}
|
||||
|
||||
void SpellWindow::askDeleteSpell(const std::string &spellId)
|
||||
{
|
||||
// delete spell, if allowed
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
|
||||
if (spell->mData.mFlags & ESM::Spell::F_Always
|
||||
|| spell->mData.mType == ESM::Spell::ST_Power)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sDeleteSpellError}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// ask for confirmation
|
||||
mSpellToDelete = spellId;
|
||||
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||
std::string question = MWBase::Environment::get().getWindowManager()->getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
|
||||
question = boost::str(boost::format(question) % spell->mName);
|
||||
dialog->open(question);
|
||||
dialog->eventOkClicked.clear();
|
||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &SpellWindow::onDeleteSpellAccept);
|
||||
dialog->eventCancelClicked.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void SpellWindow::onModelIndexSelected(SpellModel::ModelIndex index)
|
||||
{
|
||||
const Spell& spell = mSpellView->getModel()->getItem(index);
|
||||
|
@ -111,43 +136,19 @@ namespace MWGui
|
|||
}
|
||||
else
|
||||
{
|
||||
onSpellSelected(spell.mId);
|
||||
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
||||
askDeleteSpell(spell.mId);
|
||||
else
|
||||
onSpellSelected(spell.mId);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellWindow::onSpellSelected(const std::string& spellId)
|
||||
{
|
||||
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
||||
{
|
||||
// delete spell, if allowed
|
||||
const ESM::Spell* spell =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(spellId);
|
||||
|
||||
if (spell->mData.mFlags & ESM::Spell::F_Always
|
||||
|| spell->mData.mType == ESM::Spell::ST_Power)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sDeleteSpellError}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// ask for confirmation
|
||||
mSpellToDelete = spellId;
|
||||
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||
std::string question = MWBase::Environment::get().getWindowManager()->getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
|
||||
question = boost::str(boost::format(question) % spell->mName);
|
||||
dialog->open(question);
|
||||
dialog->eventOkClicked.clear();
|
||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &SpellWindow::onDeleteSpellAccept);
|
||||
dialog->eventCancelClicked.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||
store.setSelectedEnchantItem(store.end());
|
||||
MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
||||
}
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||
store.setSelectedEnchantItem(store.end());
|
||||
MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
||||
|
||||
updateSpells();
|
||||
}
|
||||
|
@ -184,6 +185,10 @@ namespace MWGui
|
|||
return;
|
||||
selected = (selected + itemcount) % itemcount;
|
||||
|
||||
onModelIndexSelected(selected);
|
||||
const Spell& spell = mSpellView->getModel()->getItem(selected);
|
||||
if (spell.mType == Spell::Type_EnchantedItem)
|
||||
onEnchantedItemSelected(spell.mItem, spell.mActive);
|
||||
else
|
||||
onSpellSelected(spell.mId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace MWGui
|
|||
void onSpellSelected(const std::string& spellId);
|
||||
void onModelIndexSelected(SpellModel::ModelIndex index);
|
||||
void onDeleteSpellAccept();
|
||||
void askDeleteSpell(const std::string& spellId);
|
||||
|
||||
virtual void onPinToggled();
|
||||
virtual void onTitleDoubleClicked();
|
||||
|
|
|
@ -594,6 +594,7 @@ namespace MWMechanics
|
|||
value.restore(magnitude);
|
||||
target.getClass().getCreatureStats(target).setAttribute(attribute, value);
|
||||
}
|
||||
// TODO: refactor the effect tick functions in Actors so they can be reused here
|
||||
else if (effectId == ESM::MagicEffect::DamageHealth)
|
||||
{
|
||||
applyDynamicStatsEffect(0, target, magnitude * -1);
|
||||
|
@ -683,7 +684,7 @@ namespace MWMechanics
|
|||
void CastSpell::applyDynamicStatsEffect(int attribute, const MWWorld::Ptr& target, float magnitude)
|
||||
{
|
||||
DynamicStat<float> value = target.getClass().getCreatureStats(target).getDynamic(attribute);
|
||||
value.modify(magnitude);
|
||||
value.setCurrent(value.getCurrent()+magnitude, attribute == 2);
|
||||
target.getClass().getCreatureStats(target).setDynamic(attribute, value);
|
||||
}
|
||||
|
||||
|
|
1
components/nif/.gitignore
vendored
1
components/nif/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
old_d
|
|
@ -112,7 +112,8 @@
|
|||
<Property key="ImageTexture" value="textures\compass.dds"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="Button" skin="" position="0 0 1536 1536" name="MiniMapButton" align="Right Bottom">
|
||||
<Widget type="Button" skin="" position_real="0 0 1 1" name="MiniMapButton" align="Stretch">
|
||||
<Property key="Depth" value="10"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
|
|
@ -235,7 +235,9 @@
|
|||
|
||||
<!-- Player skills, factions, birthsign and reputation -->
|
||||
<Widget type="Widget" skin="MW_Box" position="8 8 248 292" align="Left Stretch" name="Skills">
|
||||
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 240 284" align="Left Top Stretch" name="SkillView"/>
|
||||
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 240 284" align="Left Top Stretch" name="SkillView">
|
||||
<Property key="CanvasAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
|
Loading…
Reference in a new issue