Merge branch 'next' of https://github.com/zinnschlag/openmw into spellcreation

Conflicts:
	apps/openmw/mwgui/dialogue.cpp
actorid
scrawl 12 years ago
commit ac0c1ea986

@ -226,7 +226,7 @@ int main(int argc, char**argv)
case REC_BOOK:
{
Book b;
b.load(esm);
b.load(esm, id);
if(quiet) break;
cout << " Name: " << b.name << endl;
cout << " Mesh: " << b.model << endl;

@ -30,6 +30,7 @@ add_openmw_dir (mwgui
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
enchantingdialog
)
add_openmw_dir (mwdialogue

@ -228,6 +228,7 @@ namespace MWBase
virtual bool getPlayerSleeping() = 0;
virtual void startSpellMaking(MWWorld::Ptr actor) = 0;
virtual void startEnchanting(MWWorld::Ptr actor) = 0;
};
}

@ -128,12 +128,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sQuality")->str + ": " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -152,13 +152,13 @@ namespace MWClass
if (typeGmst.empty())
return -1;
float iWeight = MWBase::Environment::get().getWorld()->getStore().gameSettings.find (typeGmst)->i;
float iWeight = MWBase::Environment::get().getWorld()->getStore().gameSettings.find (typeGmst)->getInt();
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fLightMaxMod")->f>=
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fLightMaxMod")->getFloat()>=
ref->base->data.weight)
return ESM::Skill::LightArmor;
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMedMaxMod")->f>=
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMedMaxMod")->getFloat()>=
ref->base->data.weight)
return ESM::Skill::MediumArmor;
@ -229,25 +229,23 @@ namespace MWClass
std::string text;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
// get armor type string (light/medium/heavy)
int armorType = getEquipmentSkill(ptr);
std::string typeText;
if (armorType == ESM::Skill::LightArmor)
typeText = store.gameSettings.search("sLight")->str;
typeText = "#{sLight}";
else if (armorType == ESM::Skill::MediumArmor)
typeText = store.gameSettings.search("sMedium")->str;
typeText = "#{sMedium}";
else
typeText = store.gameSettings.search("sHeavy")->str;
typeText = "#{sHeavy}";
text += "\n" + store.gameSettings.search("sArmorRating")->str + ": " + MWGui::ToolTips::toString(ref->base->data.armor);
text += "\n#{sArmorRating}: " + MWGui::ToolTips::toString(ref->base->data.armor);
/// \todo store the current armor health somewhere
text += "\n" + store.gameSettings.search("sCondition")->str + ": " + MWGui::ToolTips::toString(ref->base->data.health);
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->base->data.health);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight) + " (" + typeText + ")";
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight) + " (" + typeText + ")";
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -124,12 +124,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -193,12 +193,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -185,13 +185,11 @@ namespace MWClass
MWGui::ToolTipInfo info;
info.caption = ref->base->name;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
if (ref->ref.lockLevel > 0)
text += "\n" + store.gameSettings.search("sLockLevel")->str + ": " + MWGui::ToolTips::toString(ref->ref.lockLevel);
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->ref.lockLevel);
if (ref->ref.trap != "")
text += "\n" + store.gameSettings.search("sTrapped")->str;
text += "\n#{sTrapped}";
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -223,14 +223,14 @@ namespace MWClass
dest = region->name;
}
}
text += "\n" + store.gameSettings.search("sTo")->str;
text += "\n#{sTo}";
text += "\n"+dest;
}
if (ref->ref.lockLevel > 0)
text += "\n" + store.gameSettings.search("sLockLevel")->str + ": " + MWGui::ToolTips::toString(ref->ref.lockLevel);
text += "\n#{sLockLevel}: " + MWGui::ToolTips::toString(ref->ref.lockLevel);
if (ref->ref.trap != "")
text += "\n" + store.gameSettings.search("sTrapped")->str;
text += "\n#{sTrapped}";
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");

@ -145,12 +145,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -173,12 +173,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -137,16 +137,14 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
/// \todo store remaining uses somewhere
text += "\n" + store.gameSettings.search("sUses")->str + ": " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n" + store.gameSettings.search("sQuality")->str + ": " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -101,7 +101,7 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
ptr.get<ESM::Miscellaneous>();
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
{
return std::string("Item Gold Up");
}
@ -113,7 +113,7 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
ptr.get<ESM::Miscellaneous>();
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
if (ref->base->name == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
{
return std::string("Item Gold Down");
}
@ -147,7 +147,7 @@ namespace MWClass
int count = ptr.getRefData().getCount();
bool isGold = (ref->base->name == store.gameSettings.search("sGold")->str);
bool isGold = (ref->base->name == store.gameSettings.find("sGold")->getString());
if (isGold && count == 1)
count = ref->base->data.value;
@ -170,8 +170,8 @@ namespace MWClass
if (!isGold)
{
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
}
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
@ -192,7 +192,7 @@ namespace MWClass
const ESMS::ESMStore &store =
MWBase::Environment::get().getWorld()->getStore();
if (MWWorld::Class::get(ptr).getName(ptr) == store.gameSettings.search("sGold")->str) {
if (MWWorld::Class::get(ptr).getName(ptr) == store.gameSettings.find("sGold")->getString()) {
int goldAmount = ptr.getRefData().getCount();
std::string base = "Gold_001";

@ -129,12 +129,10 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->base->effects);
info.isPotion = true;

@ -136,16 +136,14 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
/// \todo store remaining uses somewhere
text += "\n" + store.gameSettings.search("sUses")->str + ": " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n" + store.gameSettings.search("sQuality")->str + ": " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -130,11 +130,10 @@ namespace MWClass
/// \todo store remaining uses somewhere
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
text += "\n" + store.gameSettings.search("sUses")->str + ": " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n" + store.gameSettings.search("sQuality")->str + ": " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sUses}: " + MWGui::ToolTips::toString(ref->base->data.uses);
text += "\n#{sQuality}: " + MWGui::ToolTips::toString(ref->base->data.quality);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");

@ -284,7 +284,7 @@ namespace MWClass
// weapon type & damage. arrows / bolts don't have his info.
if (ref->base->data.type < 12)
{
text += "\n" + store.gameSettings.search("sType")->str + " ";
text += "\n#{sType} ";
std::map <int, std::pair <std::string, std::string> > mapping;
mapping[ESM::Weapon::ShortBladeOneHand] = std::make_pair("sSkillShortblade", "sOneHanded");
@ -303,29 +303,29 @@ namespace MWClass
std::string type = mapping[ref->base->data.type].first;
std::string oneOrTwoHanded = mapping[ref->base->data.type].second;
text += store.gameSettings.search(type)->str +
((oneOrTwoHanded != "") ? ", " + store.gameSettings.search(oneOrTwoHanded)->str : "");
text += store.gameSettings.find(type)->getString() +
((oneOrTwoHanded != "") ? ", " + store.gameSettings.find(oneOrTwoHanded)->getString() : "");
// weapon damage
if (ref->base->data.type >= 9)
{
// marksman
text += "\n" + store.gameSettings.search("sAttack")->str + ": "
text += "\n#{sAttack}: "
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->data.chop[0]))
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->data.chop[1]));
}
else
{
// Chop
text += "\n" + store.gameSettings.search("sChop")->str + ": "
text += "\n#{sChop}: "
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->data.chop[0]))
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->data.chop[1]));
// Slash
text += "\n" + store.gameSettings.search("sSlash")->str + ": "
text += "\n#{sSlash}: "
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->data.slash[0]))
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->data.slash[1]));
// Thrust
text += "\n" + store.gameSettings.search("sThrust")->str + ": "
text += "\n#{sThrust}: "
+ MWGui::ToolTips::toString(static_cast<int>(ref->base->data.thrust[0]))
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->base->data.thrust[1]));
}
@ -333,10 +333,10 @@ namespace MWClass
/// \todo store the current weapon health somewhere
if (ref->base->data.type < 11) // thrown weapons and arrows/bolts don't have health, only quantity
text += "\n" + store.gameSettings.search("sCondition")->str + ": " + MWGui::ToolTips::toString(ref->base->data.health);
text += "\n#{sCondition}: " + MWGui::ToolTips::toString(ref->base->data.health);
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);
text += MWGui::ToolTips::getValueString(ref->base->data.value, "#{sValue}");
info.enchant = ref->base->enchant;

@ -801,6 +801,9 @@ namespace MWDialogue
if (services & ESM::NPC::Spellmaking)
windowServices |= MWGui::DialogueWindow::Service_CreateSpells;
if (services & ESM::NPC::Enchanting)
windowServices |= MWGui::DialogueWindow::Service_Enchant;
win->setServices (windowServices);
// sort again, because the previous sort was case-sensitive

@ -40,7 +40,7 @@ namespace MWDialogue
quest.addEntry (entry); // we are doing slicing on purpose here
std::vector<std::string> empty;
std::string notification = MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sJournalEntry")->str;
std::string notification = "#{sJournalEntry}";
MWBase::Environment::get().getWindowManager()->messageBox (notification, empty);
}

@ -110,7 +110,7 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender)
}
else
{
std::string message = MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sTake")->str;
std::string message = "#{sTake}";
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
dialog->open(MWWorld::Class::get(object).getName(object), message, count);
dialog->eventOkClicked.clear();
@ -130,18 +130,17 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender)
// the player is trying to sell an item, check if the merchant accepts it
// also, don't allow selling gold (let's be better than Morrowind at this, can we?)
if (!MWBase::Environment::get().getWindowManager()->getTradeWindow()->npcAcceptsItem(object)
|| MWWorld::Class::get(object).getName(object) == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
|| MWWorld::Class::get(object).getName(object) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
{
// user notification "i don't buy this item"
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarterDialog4")->str, std::vector<std::string>());
messageBox("#{sBarterDialog4}", std::vector<std::string>());
return;
}
}
bool buying = isTradeWindow(); // buying or selling?
std::string message = buying ? MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sQuanityMenuMessage02")->str
: MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sQuanityMenuMessage01")->str;
std::string message = buying ? "#{sQuanityMenuMessage02}" : "#{sQuanityMenuMessage01}";
if (std::find(mBoughtItems.begin(), mBoughtItems.end(), object) != mBoughtItems.end())
{
@ -279,7 +278,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
{
// user notification
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sContentsMessage2")->str, std::vector<std::string>());
messageBox("#{sContentsMessage2}", std::vector<std::string>());
return;
}
}
@ -302,7 +301,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
object.getRefData().setCount(origCount);
// user notification
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sContentsMessage3")->str, std::vector<std::string>());
messageBox("#{sContentsMessage3}", std::vector<std::string>());
return;
}
else
@ -363,7 +362,7 @@ void ContainerBase::drawItems()
int maxHeight = mItemView->getSize().height - 58;
bool onlyMagic = false;
int categories;
int categories = 0;
if (mFilter == Filter_All)
categories = MWWorld::ContainerStore::Type_All;
else if (mFilter == Filter_Weapon)

@ -27,7 +27,7 @@ namespace MWGui
{
setVisible(true);
mLabelText->setCaption(message);
mLabelText->setCaptionWithReplacing(message);
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();

@ -126,22 +126,27 @@ void DialogueWindow::onSelectTopic(std::string topic)
{
if (!mEnabled) return;
if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarter")->str)
if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sBarter")->getString())
{
/// \todo check if the player is allowed to trade with this actor (e.g. faction rank high enough)?
mWindowManager.pushGuiMode(GM_Barter);
mWindowManager.getTradeWindow()->startTrade(mPtr);
}
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpells")->str)
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpells")->getString())
{
mWindowManager.pushGuiMode(GM_SpellBuying);
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
}
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpellMakingMenuTitle")->str)
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellMakingMenuTitle")->getString())
{
mWindowManager.pushGuiMode(GM_SpellCreation);
mWindowManager.startSpellMaking (mPtr);
}
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString())
{
mWindowManager.pushGuiMode(GM_Enchanting);
mWindowManager.startEnchanting (mPtr);
}
else
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
}
@ -165,13 +170,16 @@ void DialogueWindow::setKeywords(std::list<std::string> keyWords)
bool anyService = mServices > 0;
if (mServices & Service_Trade)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarter")->str);
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sBarter")->getString());
if (mServices & Service_BuySpells)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpells")->str);
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpells")->getString());
if (mServices & Service_CreateSpells)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpellmakingMenuTitle")->str);
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellmakingMenuTitle")->getString());
if (mServices & Service_Enchant)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString());
if (anyService)
mTopicsList->addSeparator();
@ -276,7 +284,7 @@ void DialogueWindow::updateOptions()
void DialogueWindow::goodbye()
{
mHistory->addDialogText("\n#572D21" + MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGoodbye")->str);
mHistory->addDialogText("\n#572D21" + MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGoodbye")->getString());
mTopicsList->setEnabled(false);
mEnabled = false;
}

@ -56,7 +56,8 @@ namespace MWGui
{
Service_Trade = 0x01,
Service_BuySpells = 0x02,
Service_CreateSpells = 0x04
Service_CreateSpells = 0x04,
Service_Enchant = 0x08
};
protected:

@ -0,0 +1,30 @@
#include "enchantingdialog.hpp"
namespace MWGui
{
EnchantingDialog::EnchantingDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_enchanting_dialog.layout", parWindowManager)
{
}
void EnchantingDialog::open()
{
center();
}
void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
{
mPtr = actor;
}
void EnchantingDialog::onReferenceUnavailable ()
{
mWindowManager.removeGuiMode (GM_Dialogue);
mWindowManager.removeGuiMode (GM_Enchanting);
}
}

@ -0,0 +1,26 @@
#ifndef MWGUI_ENCHANTINGDIALOG_H
#define MWGUI_ENCHANTINGDIALOG_H
#include "window_base.hpp"
#include "referenceinterface.hpp"
#include "../mwbase/windowmanager.hpp"
namespace MWGui
{
class EnchantingDialog : public WindowBase, public ReferenceInterface
{
public:
EnchantingDialog(MWBase::WindowManager& parWindowManager);
virtual void open();
void startEnchanting(MWWorld::Ptr actor);
protected:
virtual void onReferenceUnavailable();
};
}
#endif

@ -224,6 +224,9 @@ void LocalMapBase::setPlayerPos(const float x, const float y)
{
if (x == mLastPositionX && y == mLastPositionY)
return;
notifyPlayerUpdate ();
MyGUI::IntSize size = mLocalMap->getCanvasSize();
MyGUI::IntPoint middle = MyGUI::IntPoint((1/3.f + x/3.f)*size.width,(1/3.f + y/3.f)*size.height);
MyGUI::IntCoord viewsize = mLocalMap->getCoord();
@ -239,6 +242,9 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
{
if (x == mLastDirectionX && y == mLastDirectionY)
return;
notifyPlayerUpdate ();
MyGUI::ISubWidget* main = mCompass->getSubWidgetMain();
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
@ -407,3 +413,9 @@ void MapWindow::globalMapUpdatePlayer ()
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
mGlobalMap->setViewOffset(viewoffs);
}
void MapWindow::notifyPlayerUpdate ()
{
if (mGlobal)
globalMapUpdatePlayer ();
}

@ -49,6 +49,8 @@ namespace MWGui
void onMarkerFocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
virtual void notifyPlayerUpdate() {}
OEngine::GUI::Layout* mLayout;
bool mMapDragAndDrop;
@ -93,6 +95,8 @@ namespace MWGui
protected:
virtual void onPinToggled();
virtual void notifyPlayerUpdate();
};
}
#endif

@ -23,6 +23,7 @@ namespace MWGui
GM_RestBed,
GM_SpellBuying,
GM_SpellCreation,
GM_Enchanting,
GM_Levelup,

@ -33,11 +33,6 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
getWidget(mPreviewImage, "PreviewImage");
MWBase::Environment::get().getWorld ()->setupExternalRendering (mPreview);
mPreview.update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
getWidget(mHeadRotate, "HeadRotate");
mHeadRotate->setScrollRange(50);
mHeadRotate->setScrollPosition(25);
@ -107,6 +102,12 @@ void RaceDialog::open()
updateRaces();
updateSkills();
updateSpellPowers();
mPreview = new MWRender::RaceSelectionPreview();
MWBase::Environment::get().getWorld ()->setupExternalRendering (*mPreview);
mPreview->update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
}
@ -138,6 +139,12 @@ int wrap(int index, int max)
return index;
}
void RaceDialog::close()
{
delete mPreview;
mPreview = 0;
}
// widget controls
void RaceDialog::onOkClicked(MyGUI::Widget* _sender)
@ -154,7 +161,7 @@ void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position)
{
float angle = (float(_position) / 49.f - 0.5) * 3.14 * 2;
float diff = angle - mCurrentAngle;
mPreview.update (diff);
mPreview->update (diff);
mCurrentAngle += diff;
}

@ -46,6 +46,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
virtual void open();
virtual void close();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
@ -94,7 +95,7 @@ namespace MWGui
float mCurrentAngle;
MWRender::RaceSelectionPreview mPreview;
MWRender::RaceSelectionPreview* mPreview;
};
}
#endif

@ -50,12 +50,12 @@ namespace MWGui
void SpellBuyingWindow::addSpell(const std::string& spellId)
{
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(spellId);
int price = spell->data.cost*MWBase::Environment::get().getWorld()->getStore().gameSettings.search("fSpellValueMult")->f;
int price = spell->data.cost*MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fSpellValueMult")->getFloat();
MyGUI::Button* toAdd = mSpellsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SpellText", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
mCurrentY += sLineHeight;
/// \todo price adjustment depending on merchantile skill
toAdd->setUserData(price);
toAdd->setCaption(spell->name+" - "+boost::lexical_cast<std::string>(price)+MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sgp")->str);
toAdd->setCaptionWithReplacing(spell->name+" - "+boost::lexical_cast<std::string>(price)+"#{sgp}");
toAdd->setSize(toAdd->getTextSize().width,sLineHeight);
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &SpellBuyingWindow::onMouseWheel);
toAdd->setUserString("ToolTipType", "Spell");
@ -126,8 +126,7 @@ namespace MWGui
void SpellBuyingWindow::updateLabels()
{
mPlayerGold->setCaption(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str
+ ": " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
mPlayerGold->setCoord(8,
mPlayerGold->getTop(),
mPlayerGold->getTextSize().width,

@ -57,7 +57,7 @@ StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
for (int i=0; names[i][0]; ++i)
{
setText (names[i][0], store.gameSettings.find (names[i][1])->str);
setText (names[i][0], store.gameSettings.find (names[i][1])->getString());
}
getWidget(mSkillView, "SkillView");
@ -475,8 +475,6 @@ void StatsWindow::updateSkillArea()
text += "\n#BF9959";
for (int i=0; i<6; ++i)
{
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(faction->data.skillID[i]);
assert(skill);
text += "#{"+ESM::Skill::sSkillNameIds[faction->data.skillID[i]]+"}";
if (i<5)
text += ", ";

@ -368,19 +368,19 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
if (text.size() > 0 && text[0] == '\n')
text.erase(0, 1);
const ESM::Enchantment* enchant;
const ESM::Enchantment* enchant = 0;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
if (info.enchant != "")
{
enchant = store.enchants.search(info.enchant);
if (enchant->data.type == ESM::Enchantment::CastOnce)
text += "\n" + store.gameSettings.search("sItemCastOnce")->str;
text += "\n#{sItemCastOnce}";
else if (enchant->data.type == ESM::Enchantment::WhenStrikes)
text += "\n" + store.gameSettings.search("sItemCastWhenStrikes")->str;
text += "\n#{sItemCastWhenStrikes}";
else if (enchant->data.type == ESM::Enchantment::WhenUsed)
text += "\n" + store.gameSettings.search("sItemCastWhenUsed")->str;
text += "\n#{sItemCastWhenUsed}";
else if (enchant->data.type == ESM::Enchantment::ConstantEffect)
text += "\n" + store.gameSettings.search("sItemCastConstant")->str;
text += "\n#{sItemCastConstant}";
}
// this the maximum width of the tooltip before it starts word-wrapping
@ -405,7 +405,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
textWidget->setProperty("Static", "true");
textWidget->setProperty("MultiLine", "true");
textWidget->setProperty("WordWrap", "true");
textWidget->setCaption(text);
textWidget->setCaptionWithReplacing(text);
textWidget->setTextAlign(Align::HCenter | Align::Top);
IntSize textSize = textWidget->getTextSize();
@ -440,6 +440,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
if (info.enchant != "")
{
assert(enchant);
Widget* enchantArea = mDynamicToolTipBox->createWidget<Widget>("",
IntCoord(0, totalSize.height, 300, 300-totalSize.height),
Align::Stretch, "ToolTipEnchantArea");
@ -466,7 +467,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
const int chargeWidth = 204;
TextBox* chargeText = enchantArea->createWidget<TextBox>("SandText", IntCoord(0, 0, 10, 18), Align::Default, "ToolTipEnchantChargeText");
chargeText->setCaption(store.gameSettings.search("sCharges")->str);
chargeText->setCaptionWithReplacing("#{sCharges}");
const int chargeTextWidth = chargeText->getTextSize().width + 5;
const int chargeAndTextWidth = chargeWidth + chargeTextWidth;

@ -110,7 +110,7 @@ namespace MWGui
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
it != playerStore.end(); ++it)
{
if (MWWorld::Class::get(*it).getName(*it) == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
if (MWWorld::Class::get(*it).getName(*it) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
{
goldFound = true;
gold = *it;
@ -138,7 +138,7 @@ namespace MWGui
{
// user notification
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarterDialog11")->str, std::vector<std::string>());
messageBox("#{sBarterDialog11}", std::vector<std::string>());
return;
}
@ -147,7 +147,7 @@ namespace MWGui
{
// user notification
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarterDialog1")->str, std::vector<std::string>());
messageBox("#{sBarterDialog1}", std::vector<std::string>());
return;
}
@ -170,7 +170,7 @@ namespace MWGui
{
// user notification
MWBase::Environment::get().getWindowManager()->
messageBox(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarterDialog2")->str, std::vector<std::string>());
messageBox("#{sBarterDialog2}", std::vector<std::string>());
return;
}
@ -200,17 +200,16 @@ namespace MWGui
void TradeWindow::updateLabels()
{
mPlayerGold->setCaption(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sYourGold")->str
+ " " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
if (mCurrentBalance > 0)
{
mTotalBalanceLabel->setCaption(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sTotalSold")->str);
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalSold}");
mTotalBalance->setCaption(boost::lexical_cast<std::string>(mCurrentBalance));
}
else
{
mTotalBalanceLabel->setCaption(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sTotalCost")->str);
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalCost}");
mTotalBalance->setCaption(boost::lexical_cast<std::string>(-mCurrentBalance));
}
@ -229,8 +228,7 @@ namespace MWGui
merchantgold = ref->base->data.gold;
}
mMerchantGold->setCaption(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSellerGold")->str
+ " " + boost::lexical_cast<std::string>(merchantgold));
mMerchantGold->setCaptionWithReplacing("#{sSellerGold} " + boost::lexical_cast<std::string>(merchantgold));
}
std::vector<MWWorld::Ptr> TradeWindow::getEquippedItems()

@ -47,6 +47,7 @@
#include "levelupdialog.hpp"
#include "waitdialog.hpp"
#include "spellcreationdialog.hpp"
#include "enchantingdialog.hpp"
using namespace MWGui;
@ -77,6 +78,7 @@ WindowManager::WindowManager(
, mLevelupDialog(NULL)
, mWaitDialog(NULL)
, mSpellCreationDialog(NULL)
, mEnchantingDialog(NULL)
, mPlayerClass()
, mPlayerName()
, mPlayerRaceId()
@ -158,6 +160,7 @@ WindowManager::WindowManager(
mLevelupDialog = new LevelupDialog(*this);
mWaitDialog = new WaitDialog(*this);
mSpellCreationDialog = new SpellCreationDialog(*this);
mEnchantingDialog = new EnchantingDialog(*this);
mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this);
mLoadingScreen->onResChange (w,h);
@ -214,6 +217,7 @@ WindowManager::~WindowManager()
delete mLevelupDialog;
delete mWaitDialog;
delete mSpellCreationDialog;
delete mEnchantingDialog;
cleanupGarbage();
@ -264,6 +268,7 @@ void WindowManager::updateVisible()
mLevelupDialog->setVisible(false);
mWaitDialog->setVisible(false);
mSpellCreationDialog->setVisible(false);
mEnchantingDialog->setVisible(false);
mHud->setVisible(true);
@ -367,6 +372,9 @@ void WindowManager::updateVisible()
case GM_SpellCreation:
mSpellCreationDialog->setVisible(true);
break;
case GM_Enchanting:
mEnchantingDialog->setVisible(true);
break;
case GM_InterMessageBox:
break;
case GM_Journal:
@ -530,7 +538,7 @@ int WindowManager::readPressedButton ()
const std::string &WindowManager::getGameSettingString(const std::string &id, const std::string &default_)
{
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(id);
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.find(id);
if (setting && setting->type == ESM::VT_String)
return setting->str;
return default_;
@ -689,7 +697,7 @@ void WindowManager::setDragDrop(bool dragDrop)
void WindowManager::onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result)
{
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.search(_tag);
const ESM::GameSetting *setting = MWBase::Environment::get().getWorld()->getStore().gameSettings.find(_tag);
if (setting && setting->type == ESM::VT_String)
_result = setting->str;
else
@ -974,3 +982,8 @@ void WindowManager::startSpellMaking(MWWorld::Ptr actor)
{
mSpellCreationDialog->startSpellMaking (actor);
}
void WindowManager::startEnchanting (MWWorld::Ptr actor)
{
mEnchantingDialog->startEnchanting (actor);
}

@ -65,7 +65,7 @@ namespace MWGui
class LevelupDialog;
class WaitDialog;
class SpellCreationDialog;
class EnchantingDialog;
class WindowManager : public MWBase::WindowManager
{
@ -213,6 +213,7 @@ namespace MWGui
virtual bool getPlayerSleeping();
virtual void startSpellMaking(MWWorld::Ptr actor);
virtual void startEnchanting(MWWorld::Ptr actor);
private:
OEngine::GUI::MyGUIManager *mGuiManager;
@ -242,6 +243,7 @@ namespace MWGui
LevelupDialog* mLevelupDialog;
WaitDialog* mWaitDialog;
SpellCreationDialog* mSpellCreationDialog;
EnchantingDialog* mEnchantingDialog;
CharacterCreation* mCharGen;

@ -97,13 +97,13 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
}
float typeFactor =
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMiscSkillBonus")->f;
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMiscSkillBonus")->getFloat();
for (int i=0; i<5; ++i)
if (class_.data.skills[i][0]==skillIndex)
{
typeFactor =
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMinorSkillBonus")->f;
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMinorSkillBonus")->getFloat();
break;
}
@ -112,7 +112,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
if (class_.data.skills[i][1]==skillIndex)
{
typeFactor =
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMajorSkillBonus")->f;
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMajorSkillBonus")->getFloat();
break;
}
@ -125,7 +125,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
if (skill->data.specialization==class_.data.specialization)
{
specialisationFactor =
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fSpecialSkillBonus")->f;
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fSpecialSkillBonus")->getFloat();
if (specialisationFactor<=0)
throw std::runtime_error ("invalid skill specialisation factor");
@ -227,3 +227,13 @@ int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const
else
return 5;
}
void MWMechanics::NpcStats::flagAsUsed (const std::string& id)
{
mUsedIds.insert (id);
}
bool MWMechanics::NpcStats::hasBeenUsed (const std::string& id) const
{
return mUsedIds.find (id)!=mUsedIds.end();
}

@ -50,6 +50,8 @@ namespace MWMechanics
std::vector<int> mSkillIncreases; // number of skill increases for each attribute
std::set<std::string> mUsedIds;
public:
NpcStats();
@ -86,6 +88,10 @@ namespace MWMechanics
int getLevelupAttributeMultiplier(int attribute) const;
void levelUp();
void flagAsUsed (const std::string& id);
bool hasBeenUsed (const std::string& id) const;
};
}

@ -25,6 +25,7 @@ namespace MWRender
, mPosition(position)
, mLookAt(lookAt)
, mCharacter(character)
, mAnimation(NULL)
{
}
@ -53,10 +54,13 @@ namespace MWRender
mCamera->setNearClipDistance (0.01);
mCamera->setFarClipDistance (1000);
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mTexture = Ogre::TextureManager::getSingleton().getByName (mName);
if (mTexture.isNull ())
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
mRenderTarget->removeAllViewports ();
mViewport = mRenderTarget->addViewport(mCamera);
mViewport->setOverlaysEnabled(false);
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
@ -71,7 +75,7 @@ namespace MWRender
CharacterPreview::~CharacterPreview ()
{
Ogre::TextureManager::getSingleton().remove(mName);
//Ogre::TextureManager::getSingleton().remove(mName);
mSceneMgr->destroyCamera (mName);
delete mAnimation;
}

@ -323,6 +323,7 @@ namespace MWRender
bool Player::getPosition(Ogre::Vector3 &player, Ogre::Vector3 &camera)
{
float xch;
mCamera->getParentSceneNode ()->needUpdate(true);
camera = mCamera->getRealPosition();
xch = camera.z, camera.z = camera.y, camera.y = -xch;
player = mPlayerNode->getPosition();

@ -35,22 +35,21 @@ namespace MWWorld
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
}
/*
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
// Skill gain from books
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length)
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length
&& !npcStats.hasBeenUsed (ref->base->id))
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
playerRef->base->cls);
npcStats.increaseSkill (ref->base->data.skillID, *class_, true);
/// \todo Remove skill from the book. Right now you can read as many times as you want
/// and the skill will still increase.
npcStats.flagAsUsed (ref->base->id);
}
*/
}
}

@ -76,7 +76,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& ptr)
// gold needs special handling: when it is inserted into a container, the base object automatically becomes Gold_001
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
if (MWWorld::Class::get(ptr).getName(ptr) == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
if (MWWorld::Class::get(ptr).getName(ptr) == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
{
MWWorld::LiveCellRef<ESM::Miscellaneous> *gold =
ptr.get<ESM::Miscellaneous>();

@ -41,7 +41,8 @@ const float WeatherGlobals::mThunderSoundDelay = 0.25;
WeatherManager::WeatherManager(MWRender::RenderingManager* rendering) :
mHour(14), mCurrentWeather("clear"), mFirstUpdate(true), mWeatherUpdateTime(0),
mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50), mThunderSoundDelay(0),
mRemainingTransitionTime(0), mMonth(0), mDay(0)
mRemainingTransitionTime(0), mMonth(0), mDay(0),
mTimePassed(0)
{
mRendering = rendering;
@ -487,7 +488,10 @@ WeatherResult WeatherManager::transition(float factor)
void WeatherManager::update(float duration)
{
mWeatherUpdateTime -= duration * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
float timePassed = mTimePassed;
mTimePassed = 0;
mWeatherUpdateTime -= timePassed;
bool exterior = (MWBase::Environment::get().getWorld()->isCellExterior() || MWBase::Environment::get().getWorld()->isCellQuasiExterior());
@ -558,7 +562,7 @@ void WeatherManager::update(float duration)
if (mNextWeather != "")
{
mRemainingTransitionTime -= duration * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
mRemainingTransitionTime -= timePassed;
if (mRemainingTransitionTime < 0)
{
mCurrentWeather = mNextWeather;

@ -231,6 +231,11 @@ namespace MWWorld
void setDate(const int day, const int month);
void advanceTime(double hours)
{
mTimePassed += hours*3600;
}
unsigned int getWeatherID() const;
private:
@ -261,6 +266,8 @@ namespace MWWorld
float mThunderChanceNeeded;
float mThunderSoundDelay;
double mTimePassed; // time passed since last update
WeatherResult transition(const float factor);
WeatherResult getResult(const Ogre::String& weather);

@ -366,6 +366,8 @@ namespace MWWorld
void World::advanceTime (double hours)
{
mWeatherManager->advanceTime (hours);
hours += mGlobalVariables->getFloat ("gamehour");
setHour (hours);
@ -526,7 +528,7 @@ namespace MWWorld
std::pair<std::string, float> result = mPhysics->getFacedHandle (*this);
if (result.first.empty() ||
result.second>getStore().gameSettings.find ("iMaxActivateDist")->i)
result.second>getStore().gameSettings.find ("iMaxActivateDist")->getInt())
return "";
return result.first;

@ -3,7 +3,7 @@
namespace ESM
{
void Book::load(ESMReader &esm)
void Book::load(ESMReader &esm, const std::string& recordId)
{
model = esm.getHNString("MODL");
name = esm.getHNOString("FNAM");
@ -12,6 +12,7 @@ void Book::load(ESMReader &esm)
icon = esm.getHNOString("ITEX");
text = esm.getHNOString("TEXT");
enchant = esm.getHNOString("ENAM");
id = recordId;
}
}

@ -20,8 +20,9 @@ struct Book
BKDTstruct data;
std::string name, model, icon, script, enchant, text;
std::string id;
void load(ESMReader &esm);
void load(ESMReader &esm, const std::string& recordId);
};
}
#endif

@ -34,7 +34,7 @@ namespace ESMS
RecListT<Apparatus> appas;
RecListT<Armor> armors;
RecListT<BodyPart> bodyParts;
RecListT<Book> books;
RecListWithIDT<Book> books;
RecListT<BirthSign> birthSigns;
RecListT<Class> classes;
RecListT<Clothing> clothes;

@ -193,7 +193,8 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
// affecting the entire subtree of this node
Nif::NiStringExtraData *sd = (Nif::NiStringExtraData*)e;
if (sd->string == "NCO")
// not sure what the difference between NCO and NCC is, or if there even is one
if (sd->string == "NCO" || sd->string == "NCC")
{
// No collision. Use an internal flag setting to mark this.
flags |= 0x800;

@ -77,6 +77,7 @@ set(MYGUI_FILES
openmw_wait_dialog_progressbar.layout
openmw_spellcreation_dialog.layout
openmw_edit_effect.layout
openmw_enchanting_dialog.layout
smallbars.png
VeraMono.ttf
markers.png

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 560 400" name="_Main">
</Widget>
</MyGUI>

@ -303,16 +303,11 @@ namespace Physic
+ boost::lexical_cast<std::string>(y);
// find the minimum and maximum heights (needed for bullet)
float minh;
float maxh;
float minh = heights[0];
float maxh = heights[0];
for (int i=0; i<sqrtVerts*sqrtVerts; ++i)
{
float h = heights[i];
if (i==0)
{
minh = h;
maxh = h;
}
if (h>maxh) maxh = h;
if (h<minh) minh = h;

@ -171,11 +171,11 @@ bool PM_SlideMove( bool gravity )
Ogre::Vector3 clipVelocity;
int i, j, k;
struct traceResults trace;
Ogre::Vector3 end;
Ogre::Vector3 end(0,0,0);
float time_left;
float into;
Ogre::Vector3 endVelocity;
Ogre::Vector3 endClipVelocity;
Ogre::Vector3 endVelocity(0,0,0);
Ogre::Vector3 endClipVelocity(0,0,0);
numbumps = 4;

@ -13,8 +13,8 @@
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBHalfExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass) //Traceobj was a Aedra Object
{
static float lastyaw = 0.0f;
static float lastpitch = 0.0f;
//static float lastyaw = 0.0f;
//static float lastpitch = 0.0f;
//if (!traceobj)
// return;

Loading…
Cancel
Save