commit
510674aa5e
@ -0,0 +1,881 @@
|
||||
#include "labels.hpp"
|
||||
|
||||
#include <components/esm/loadbody.hpp>
|
||||
#include <components/esm/loadcell.hpp>
|
||||
#include <components/esm/loadcont.hpp>
|
||||
#include <components/esm/loadcrea.hpp>
|
||||
#include <components/esm/loadlevlist.hpp>
|
||||
#include <components/esm/loadligh.hpp>
|
||||
#include <components/esm/loadmgef.hpp>
|
||||
#include <components/esm/loadnpc.hpp>
|
||||
#include <components/esm/loadrace.hpp>
|
||||
#include <components/esm/loadspel.hpp>
|
||||
#include <components/esm/loadweap.hpp>
|
||||
#include <components/esm/aipackage.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
std::string bodyPartLabel(char idx)
|
||||
{
|
||||
const char *bodyPartLabels[] = {
|
||||
"Head",
|
||||
"Hair",
|
||||
"Neck",
|
||||
"Cuirass",
|
||||
"Groin",
|
||||
"Skirt",
|
||||
"Right Hand",
|
||||
"Left Hand",
|
||||
"Right Wrist",
|
||||
"Left Wrist",
|
||||
"Shield",
|
||||
"Right Forearm",
|
||||
"Left Forearm",
|
||||
"Right Upperarm",
|
||||
"Left Upperarm",
|
||||
"Right Foot",
|
||||
"Left Foot",
|
||||
"Right Ankle",
|
||||
"Left Ankle",
|
||||
"Right Knee",
|
||||
"Left Knee",
|
||||
"Right Leg",
|
||||
"Left Leg",
|
||||
"Right Shoulder",
|
||||
"Left Shoulder",
|
||||
"Weapon",
|
||||
"Tail"
|
||||
};
|
||||
|
||||
if ((int)idx >= 0 && (int)(idx) <= 26)
|
||||
return bodyPartLabels[(int)(idx)];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string meshPartLabel(char idx)
|
||||
{
|
||||
const char *meshPartLabels[] = {
|
||||
"Head",
|
||||
"Hair",
|
||||
"Neck",
|
||||
"Chest",
|
||||
"Groin",
|
||||
"Hand",
|
||||
"Wrist",
|
||||
"Forearm",
|
||||
"Upperarm",
|
||||
"Foot",
|
||||
"Ankle",
|
||||
"Knee",
|
||||
"Upper Leg",
|
||||
"Clavicle",
|
||||
"Tail"
|
||||
};
|
||||
|
||||
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MP_Tail)
|
||||
return meshPartLabels[(int)(idx)];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string meshTypeLabel(char idx)
|
||||
{
|
||||
const char *meshTypeLabels[] = {
|
||||
"Skin",
|
||||
"Clothing",
|
||||
"Armor"
|
||||
};
|
||||
|
||||
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MT_Armor)
|
||||
return meshTypeLabels[(int)(idx)];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string clothingTypeLabel(int idx)
|
||||
{
|
||||
const char *clothingTypeLabels[] = {
|
||||
"Pants",
|
||||
"Shoes",
|
||||
"Shirt",
|
||||
"Belt",
|
||||
"Robe",
|
||||
"Right Glove",
|
||||
"Left Glove",
|
||||
"Skirt",
|
||||
"Ring",
|
||||
"Amulet"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 9)
|
||||
return clothingTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string armorTypeLabel(int idx)
|
||||
{
|
||||
const char *armorTypeLabels[] = {
|
||||
"Helmet",
|
||||
"Cuirass",
|
||||
"Left Pauldron",
|
||||
"Right Pauldron",
|
||||
"Greaves",
|
||||
"Boots",
|
||||
"Left Gauntlet",
|
||||
"Right Gauntlet",
|
||||
"Shield",
|
||||
"Left Bracer",
|
||||
"Right Bracer"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 10)
|
||||
return armorTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string dialogTypeLabel(int idx)
|
||||
{
|
||||
const char *dialogTypeLabels[] = {
|
||||
"Topic",
|
||||
"Voice",
|
||||
"Greeting",
|
||||
"Persuasion",
|
||||
"Journal"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 4)
|
||||
return dialogTypeLabels[idx];
|
||||
else if (idx == -1)
|
||||
return "Deleted";
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string questStatusLabel(int idx)
|
||||
{
|
||||
const char *questStatusLabels[] = {
|
||||
"None",
|
||||
"Name",
|
||||
"Finished",
|
||||
"Restart",
|
||||
"Deleted"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 4)
|
||||
return questStatusLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string creatureTypeLabel(int idx)
|
||||
{
|
||||
const char *creatureTypeLabels[] = {
|
||||
"Creature",
|
||||
"Daedra",
|
||||
"Undead",
|
||||
"Humanoid",
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 3)
|
||||
return creatureTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string soundTypeLabel(int idx)
|
||||
{
|
||||
const char *soundTypeLabels[] = {
|
||||
"Left Foot",
|
||||
"Right Foot",
|
||||
"Swim Left",
|
||||
"Swim Right",
|
||||
"Moan",
|
||||
"Roar",
|
||||
"Scream",
|
||||
"Land"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 7)
|
||||
return soundTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string weaponTypeLabel(int idx)
|
||||
{
|
||||
const char *weaponTypeLabels[] = {
|
||||
"Short Blade One Hand",
|
||||
"Long Blade One Hand",
|
||||
"Long Blade Two Hand",
|
||||
"Blunt One Hand",
|
||||
"Blunt Two Close",
|
||||
"Blunt Two Wide",
|
||||
"Spear Two Wide",
|
||||
"Axe One Hand",
|
||||
"Axe Two Hand",
|
||||
"Marksman Bow",
|
||||
"Marksman Crossbow",
|
||||
"Marksman Thrown",
|
||||
"Arrow",
|
||||
"Bolt"
|
||||
};
|
||||
|
||||
if (idx >= 0 && idx <= 13)
|
||||
return weaponTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string aiTypeLabel(int type)
|
||||
{
|
||||
if (type == ESM::AI_Wander) return "Wander";
|
||||
else if (type == ESM::AI_Travel) return "Travel";
|
||||
else if (type == ESM::AI_Follow) return "Follow";
|
||||
else if (type == ESM::AI_Escort) return "Escort";
|
||||
else if (type == ESM::AI_Activate) return "Activate";
|
||||
else return "Invalid";
|
||||
}
|
||||
|
||||
std::string magicEffectLabel(int idx)
|
||||
{
|
||||
const char* magicEffectLabels [] = {
|
||||
"Water Breathing",
|
||||
"Swift Swim",
|
||||
"Water Walking",
|
||||
"Shield",
|
||||
"Fire Shield",
|
||||
"Lightning Shield",
|
||||
"Frost Shield",
|
||||
"Burden",
|
||||
"Feather",
|
||||
"Jump",
|
||||
"Levitate",
|
||||
"SlowFall",
|
||||
"Lock",
|
||||
"Open",
|
||||
"Fire Damage",
|
||||
"Shock Damage",
|
||||
"Frost Damage",
|
||||
"Drain Attribute",
|
||||
"Drain Health",
|
||||
"Drain Magicka",
|
||||
"Drain Fatigue",
|
||||
"Drain Skill",
|
||||
"Damage Attribute",
|
||||
"Damage Health",
|
||||
"Damage Magicka",
|
||||
"Damage Fatigue",
|
||||
"Damage Skill",
|
||||
"Poison",
|
||||
"Weakness to Fire",
|
||||
"Weakness to Frost",
|
||||
"Weakness to Shock",
|
||||
"Weakness to Magicka",
|
||||
"Weakness to Common Disease",
|
||||
"Weakness to Blight Disease",
|
||||
"Weakness to Corprus Disease",
|
||||
"Weakness to Poison",
|
||||
"Weakness to Normal Weapons",
|
||||
"Disintegrate Weapon",
|
||||
"Disintegrate Armor",
|
||||
"Invisibility",
|
||||
"Chameleon",
|
||||
"Light",
|
||||
"Sanctuary",
|
||||
"Night Eye",
|
||||
"Charm",
|
||||
"Paralyze",
|
||||
"Silence",
|
||||
"Blind",
|
||||
"Sound",
|
||||
"Calm Humanoid",
|
||||
"Calm Creature",
|
||||
"Frenzy Humanoid",
|
||||
"Frenzy Creature",
|
||||
"Demoralize Humanoid",
|
||||
"Demoralize Creature",
|
||||
"Rally Humanoid",
|
||||
"Rally Creature",
|
||||
"Dispel",
|
||||
"Soultrap",
|
||||
"Telekinesis",
|
||||
"Mark",
|
||||
"Recall",
|
||||
"Divine Intervention",
|
||||
"Almsivi Intervention",
|
||||
"Detect Animal",
|
||||
"Detect Enchantment",
|
||||
"Detect Key",
|
||||
"Spell Absorption",
|
||||
"Reflect",
|
||||
"Cure Common Disease",
|
||||
"Cure Blight Disease",
|
||||
"Cure Corprus Disease",
|
||||
"Cure Poison",
|
||||
"Cure Paralyzation",
|
||||
"Restore Attribute",
|
||||
"Restore Health",
|
||||
"Restore Magicka",
|
||||
"Restore Fatigue",
|
||||
"Restore Skill",
|
||||
"Fortify Attribute",
|
||||
"Fortify Health",
|
||||
"Fortify Magicka",
|
||||
"Fortify Fatigue",
|
||||
"Fortify Skill",
|
||||
"Fortify Maximum Magicka",
|
||||
"Absorb Attribute",
|
||||
"Absorb Health",
|
||||
"Absorb Magicka",
|
||||
"Absorb Fatigue",
|
||||
"Absorb Skill",
|
||||
"Resist Fire",
|
||||
"Resist Frost",
|
||||
"Resist Shock",
|
||||
"Resist Magicka",
|
||||
"Resist Common Disease",
|
||||
"Resist Blight Disease",
|
||||
"Resist Corprus Disease",
|
||||
"Resist Poison",
|
||||
"Resist Normal Weapons",
|
||||
"Resist Paralysis",
|
||||
"Remove Curse",
|
||||
"Turn Undead",
|
||||
"Summon Scamp",
|
||||
"Summon Clannfear",
|
||||
"Summon Daedroth",
|
||||
"Summon Dremora",
|
||||
"Summon Ancestral Ghost",
|
||||
"Summon Skeletal Minion",
|
||||
"Summon Bonewalker",
|
||||
"Summon Greater Bonewalker",
|
||||
"Summon Bonelord",
|
||||
"Summon Winged Twilight",
|
||||
"Summon Hunger",
|
||||
"Summon Golden Saint",
|
||||
"Summon Flame Atronach",
|
||||
"Summon Frost Atronach",
|
||||
"Summon Storm Atronach",
|
||||
"Fortify Attack",
|
||||
"Command Creature",
|
||||
"Command Humanoid",
|
||||
"Bound Dagger",
|
||||
"Bound Longsword",
|
||||
"Bound Mace",
|
||||
"Bound Battle Axe",
|
||||
"Bound Spear",
|
||||
"Bound Longbow",
|
||||
"EXTRA SPELL",
|
||||
"Bound Cuirass",
|
||||
"Bound Helm",
|
||||
"Bound Boots",
|
||||
"Bound Shield",
|
||||
"Bound Gloves",
|
||||
"Corprus",
|
||||
"Vampirism",
|
||||
"Summon Centurion Sphere",
|
||||
"Sun Damage",
|
||||
"Stunted Magicka",
|
||||
"Summon Fabricant",
|
||||
"sEffectSummonCreature01",
|
||||
"sEffectSummonCreature02",
|
||||
"sEffectSummonCreature03",
|
||||
"sEffectSummonCreature04",
|
||||
"sEffectSummonCreature05"
|
||||
};
|
||||
if (idx >= 0 && idx <= 143)
|
||||
return magicEffectLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string attributeLabel(int idx)
|
||||
{
|
||||
const char* attributeLabels [] = {
|
||||
"Strength",
|
||||
"Intelligence",
|
||||
"Willpower",
|
||||
"Agility",
|
||||
"Speed",
|
||||
"Endurance",
|
||||
"Personality",
|
||||
"Luck"
|
||||
};
|
||||
if (idx >= 0 && idx <= 7)
|
||||
return attributeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string spellTypeLabel(int idx)
|
||||
{
|
||||
const char* spellTypeLabels [] = {
|
||||
"Spells",
|
||||
"Abilities",
|
||||
"Blight Disease",
|
||||
"Disease",
|
||||
"Curse",
|
||||
"Powers"
|
||||
};
|
||||
if (idx >= 0 && idx <= 5)
|
||||
return spellTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string specializationLabel(int idx)
|
||||
{
|
||||
const char* specializationLabels [] = {
|
||||
"Combat",
|
||||
"Magic",
|
||||
"Stealth"
|
||||
};
|
||||
if (idx >= 0 && idx <= 2)
|
||||
return specializationLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string skillLabel(int idx)
|
||||
{
|
||||
const char* skillLabels [] = {
|
||||
"Block",
|
||||
"Armorer",
|
||||
"Medium Armor",
|
||||
"Heavy Armor",
|
||||
"Blunt Weapon",
|
||||
"Long Blade",
|
||||
"Axe",
|
||||
"Spear",
|
||||
"Athletics",
|
||||
"Enchant",
|
||||
"Destruction",
|
||||
"Alteration",
|
||||
"Illusion",
|
||||
"Conjuration",
|
||||
"Mysticism",
|
||||
"Restoration",
|
||||
"Alchemy",
|
||||
"Unarmored",
|
||||
"Security",
|
||||
"Sneak",
|
||||
"Acrobatics",
|
||||
"Light Armor",
|
||||
"Short Blade",
|
||||
"Marksman",
|
||||
"Mercantile",
|
||||
"Speechcraft",
|
||||
"Hand-to-hand"
|
||||
};
|
||||
if (idx >= 0 && idx <= 27)
|
||||
return skillLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string apparatusTypeLabel(int idx)
|
||||
{
|
||||
const char* apparatusTypeLabels [] = {
|
||||
"Mortar",
|
||||
"Alembic",
|
||||
"Calcinator",
|
||||
"Retort",
|
||||
};
|
||||
if (idx >= 0 && idx <= 3)
|
||||
return apparatusTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string rangeTypeLabel(int idx)
|
||||
{
|
||||
const char* rangeTypeLabels [] = {
|
||||
"Self",
|
||||
"Touch",
|
||||
"Target"
|
||||
};
|
||||
if (idx >= 0 && idx <= 3)
|
||||
return rangeTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string schoolLabel(int idx)
|
||||
{
|
||||
const char* schoolLabels [] = {
|
||||
"Alteration",
|
||||
"Conjuration",
|
||||
"Destruction",
|
||||
"Illusion",
|
||||
"Mysticism",
|
||||
"Restoration"
|
||||
};
|
||||
if (idx >= 0 && idx <= 5)
|
||||
return schoolLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string enchantTypeLabel(int idx)
|
||||
{
|
||||
const char* enchantTypeLabels [] = {
|
||||
"Cast Once",
|
||||
"Cast When Strikes",
|
||||
"Cast When Used",
|
||||
"Constant Effect"
|
||||
};
|
||||
if (idx >= 0 && idx <= 3)
|
||||
return enchantTypeLabels[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
std::string ruleFunction(int idx)
|
||||
{
|
||||
std::string ruleFunctions[] = {
|
||||
"Reaction Low",
|
||||
"Reaction High",
|
||||
"Rank Requirement",
|
||||
"NPC? Reputation",
|
||||
"Health Percent",
|
||||
"Player Reputation",
|
||||
"NPC Level",
|
||||
"Player Health Percent",
|
||||
"Player Magicka",
|
||||
"Player Fatigue",
|
||||
"Player Attribute Strength",
|
||||
"Player Skill Block",
|
||||
"Player Skill Armorer",
|
||||
"Player Skill Medium Armor",
|
||||
"Player Skill Heavy Armor",
|
||||
"Player Skill Blunt Weapon",
|
||||
"Player Skill Long Blade",
|
||||
"Player Skill Axe",
|
||||
"Player Skill Spear",
|
||||
"Player Skill Athletics",
|
||||
"Player Skill Enchant",
|
||||
"Player Skill Destruction",
|
||||
"Player Skill Alteration",
|
||||
"Player Skill Illusion",
|
||||
"Player Skill Conjuration",
|
||||
"Player Skill Mysticism",
|
||||
"Player SKill Restoration",
|
||||
"Player Skill Alchemy",
|
||||
"Player Skill Unarmored",
|
||||
"Player Skill Security",
|
||||
"Player Skill Sneak",
|
||||
"Player Skill Acrobatics",
|
||||
"Player Skill Light Armor",
|
||||
"Player Skill Short Blade",
|
||||
"Player Skill Marksman",
|
||||
"Player Skill Mercantile",
|
||||
"Player Skill Speechcraft",
|
||||
"Player Skill Hand to Hand",
|
||||
"Player Gender",
|
||||
"Player Expelled from Faction",
|
||||
"Player Diseased (Common)",
|
||||
"Player Diseased (Blight)",
|
||||
"Player Clothing Modifier",
|
||||
"Player Crime Level",
|
||||
"Player Same Sex",
|
||||
"Player Same Race",
|
||||
"Player Same Faction",
|
||||
"Faction Rank Difference",
|
||||
"Player Detected",
|
||||
"Alarmed",
|
||||
"Choice Selected",
|
||||
"Player Attribute Intelligence",
|
||||
"Player Attribute Willpower",
|
||||
"Player Attribute Agility",
|
||||
"Player Attribute Speed",
|
||||
"Player Attribute Endurance",
|
||||
"Player Attribute Personality",
|
||||
"Player Attribute Luck",
|
||||
"Player Diseased (Corprus)",
|
||||
"Weather",
|
||||
"Player is a Vampire",
|
||||
"Player Level",
|
||||
"Attacked",
|
||||
"NPC Talked to Player",
|
||||
"Player Health",
|
||||
"Creature Target",
|
||||
"Friend Hit",
|
||||
"Fight",
|
||||
"Hello",
|
||||
"Alarm",
|
||||
"Flee",
|
||||
"Should Attack",
|
||||
//Unkown but causes NPCs to growl and roar.
|
||||
"UNKNOWN 72"
|
||||
};
|
||||
if (idx >= 0 && idx <= 72)
|
||||
return ruleFunctions[idx];
|
||||
else
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
// The "unused flag bits" should probably be defined alongside the
|
||||
// defined bits in the ESM component. The names of the flag bits are
|
||||
// very inconsistent.
|
||||
|
||||
std::string bodyPartFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::BodyPart::BPF_Female) properties += "Female ";
|
||||
if (flags & ESM::BodyPart::BPF_Playable) properties += "Playable ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::BodyPart::BPF_Female|
|
||||
ESM::BodyPart::BPF_Playable));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string cellFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::Cell::HasWater) properties += "HasWater ";
|
||||
if (flags & ESM::Cell::Interior) properties += "Interior ";
|
||||
if (flags & ESM::Cell::NoSleep) properties += "NoSleep ";
|
||||
if (flags & ESM::Cell::QuasiEx) properties += "QuasiEx ";
|
||||
// This used value is not in the ESM component.
|
||||
if (flags & 0x00000040) properties += "Unknown ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Cell::HasWater|
|
||||
ESM::Cell::Interior|
|
||||
ESM::Cell::NoSleep|
|
||||
ESM::Cell::QuasiEx|
|
||||
0x00000040));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string containerFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::Container::Unknown) properties += "Unknown ";
|
||||
if (flags & ESM::Container::Organic) properties += "Organic ";
|
||||
if (flags & ESM::Container::Respawn) properties += "Respawn ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Container::Unknown|
|
||||
ESM::Container::Organic|
|
||||
ESM::Container::Respawn));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string creatureFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::Creature::None) properties += "All ";
|
||||
if (flags & ESM::Creature::Walks) properties += "Walks ";
|
||||
if (flags & ESM::Creature::Swims) properties += "Swims ";
|
||||
if (flags & ESM::Creature::Flies) properties += "Flies ";
|
||||
if (flags & ESM::Creature::Biped) properties += "Biped ";
|
||||
if (flags & ESM::Creature::Respawn) properties += "Respawn ";
|
||||
if (flags & ESM::Creature::Weapon) properties += "Weapon ";
|
||||
if (flags & ESM::Creature::Skeleton) properties += "Skeleton ";
|
||||
if (flags & ESM::Creature::Metal) properties += "Metal ";
|
||||
if (flags & ESM::Creature::Essential) properties += "Essential ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Creature::None|
|
||||
ESM::Creature::Walks|
|
||||
ESM::Creature::Swims|
|
||||
ESM::Creature::Flies|
|
||||
ESM::Creature::Biped|
|
||||
ESM::Creature::Respawn|
|
||||
ESM::Creature::Weapon|
|
||||
ESM::Creature::Skeleton|
|
||||
ESM::Creature::Metal|
|
||||
ESM::Creature::Essential));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string landFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
// The ESM component says that this first four bits are used, but
|
||||
// only the first three bits are used as far as I can tell.
|
||||
// There's also no enumeration of the bit in the ESM component.
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & 0x00000001) properties += "Unknown1 ";
|
||||
if (flags & 0x00000004) properties += "Unknown3 ";
|
||||
if (flags & 0x00000002) properties += "Unknown2 ";
|
||||
if (flags & 0xFFFFFFF8) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string leveledListFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::LeveledListBase::AllLevels) properties += "AllLevels ";
|
||||
// This flag apparently not present on creature lists...
|
||||
if (flags & ESM::LeveledListBase::Each) properties += "Each ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::LeveledListBase::AllLevels|
|
||||
ESM::LeveledListBase::Each));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string lightFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::Light::Dynamic) properties += "Dynamic ";
|
||||
if (flags & ESM::Light::Fire) properties += "Fire ";
|
||||
if (flags & ESM::Light::Carry) properties += "Carry ";
|
||||
if (flags & ESM::Light::Flicker) properties += "Flicker ";
|
||||
if (flags & ESM::Light::FlickerSlow) properties += "FlickerSlow ";
|
||||
if (flags & ESM::Light::Pulse) properties += "Pulse ";
|
||||
if (flags & ESM::Light::PulseSlow) properties += "PulseSlow ";
|
||||
if (flags & ESM::Light::Negative) properties += "Negative ";
|
||||
if (flags & ESM::Light::OffDefault) properties += "OffDefault ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Light::Dynamic|
|
||||
ESM::Light::Fire|
|
||||
ESM::Light::Carry|
|
||||
ESM::Light::Flicker|
|
||||
ESM::Light::FlickerSlow|
|
||||
ESM::Light::Pulse|
|
||||
ESM::Light::PulseSlow|
|
||||
ESM::Light::Negative|
|
||||
ESM::Light::OffDefault));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string magicEffectFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
// Enchanting & SpellMaking occur on the same list of effects.
|
||||
// "EXTRA SPELL" appears in the construction set under both the
|
||||
// spell making and enchanting tabs as an allowed effect. Since
|
||||
// most of the effects without this flags are defective in various
|
||||
// ways, it's still very unclear what these flag bits are.
|
||||
if (flags & ESM::MagicEffect::SpellMaking) properties += "SpellMaking ";
|
||||
if (flags & ESM::MagicEffect::Enchanting) properties += "Enchanting ";
|
||||
if (flags & 0x00000040) properties += "RangeNoSelf ";
|
||||
if (flags & 0x00000080) properties += "RangeTouch ";
|
||||
if (flags & 0x00000100) properties += "RangeTarget ";
|
||||
if (flags & 0x00001000) properties += "Unknown2 ";
|
||||
if (flags & 0x00000001) properties += "AffectSkill ";
|
||||
if (flags & 0x00000002) properties += "AffectAttribute ";
|
||||
if (flags & ESM::MagicEffect::NoDuration) properties += "NoDuration ";
|
||||
if (flags & 0x00000008) properties += "NoMagnitude ";
|
||||
if (flags & 0x00000010) properties += "Negative ";
|
||||
if (flags & 0x00000020) properties += "Unknown1 ";
|
||||
// ESM componet says 0x800 is negative, but none of the magic
|
||||
// effects have this flags set.
|
||||
if (flags & ESM::MagicEffect::Negative) properties += "Unused ";
|
||||
// Since only Chameleon has this flag it could be anything
|
||||
// that uniquely distinguishes Chameleon.
|
||||
if (flags & 0x00002000) properties += "Chameleon ";
|
||||
if (flags & 0x00004000) properties += "Bound ";
|
||||
if (flags & 0x00008000) properties += "Summon ";
|
||||
// Calm, Demoralize, Frenzy, Lock, Open, Rally, Soultrap, Turn Unded
|
||||
if (flags & 0x00010000) properties += "Unknown3 ";
|
||||
if (flags & 0x00020000) properties += "Absorb ";
|
||||
if (flags & 0xFFFC0000) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string npcFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
// Mythicmods and the ESM component differ. Mythicmods says
|
||||
// 0x8=None and 0x10=AutoCalc, while our code defines 0x8 as
|
||||
// AutoCalc. The former seems to be correct. All Bethesda
|
||||
// records have bit 0x8 set. A suspiciously large portion of
|
||||
// females have autocalc turned off.
|
||||
if (flags & ESM::NPC::Autocalc) properties += "Unknown ";
|
||||
if (flags & 0x00000010) properties += "Autocalc ";
|
||||
if (flags & ESM::NPC::Female) properties += "Female ";
|
||||
if (flags & ESM::NPC::Respawn) properties += "Respawn ";
|
||||
if (flags & ESM::NPC::Essential) properties += "Essential ";
|
||||
// These two flags do not appear on any NPCs and may have been
|
||||
// confused with the flags for creatures.
|
||||
if (flags & ESM::NPC::Skeleton) properties += "Skeleton ";
|
||||
if (flags & ESM::NPC::Metal) properties += "Metal ";
|
||||
// Whether corpses persist is a bit that is unaccounted for,
|
||||
// however the only unknown bit occurs on ALL records, and
|
||||
// relatively few NPCs have this bit set.
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::NPC::Autocalc|
|
||||
0x00000010|
|
||||
ESM::NPC::Female|
|
||||
ESM::NPC::Respawn|
|
||||
ESM::NPC::Essential|
|
||||
ESM::NPC::Skeleton|
|
||||
ESM::NPC::Metal));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string raceFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
// All races have the playable flag set in Bethesda files.
|
||||
if (flags & ESM::Race::Playable) properties += "Playable ";
|
||||
if (flags & ESM::Race::Beast) properties += "Beast ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Race::Playable|
|
||||
ESM::Race::Beast));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string spellFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
if (flags & ESM::Spell::F_Autocalc) properties += "Autocalc ";
|
||||
if (flags & ESM::Spell::F_PCStart) properties += "PCStart ";
|
||||
if (flags & ESM::Spell::F_Always) properties += "Always ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Spell::F_Autocalc|
|
||||
ESM::Spell::F_PCStart|
|
||||
ESM::Spell::F_Always));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
||||
|
||||
std::string weaponFlags(int flags)
|
||||
{
|
||||
std::string properties = "";
|
||||
if (flags == 0) properties += "[None] ";
|
||||
// The interpretation of the flags are still unclear to me.
|
||||
// Apparently you can't be Silver without being Magical? Many of
|
||||
// the "Magical" weapons don't have enchantments of any sort.
|
||||
if (flags & ESM::Weapon::Magical) properties += "Magical ";
|
||||
if (flags & ESM::Weapon::Silver) properties += "Silver ";
|
||||
int unused = (0xFFFFFFFF ^
|
||||
(ESM::Weapon::Magical|
|
||||
ESM::Weapon::Silver));
|
||||
if (flags & unused) properties += "Invalid ";
|
||||
properties += str(boost::format("(0x%08X)") % flags);
|
||||
return properties;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
#ifndef OPENMW_ESMTOOL_LABELS_H
|
||||
#define OPENMW_ESMTOOL_LABELS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string bodyPartLabel(char idx);
|
||||
std::string meshPartLabel(char idx);
|
||||
std::string meshTypeLabel(char idx);
|
||||
std::string clothingTypeLabel(int idx);
|
||||
std::string armorTypeLabel(int idx);
|
||||
std::string dialogTypeLabel(int idx);
|
||||
std::string questStatusLabel(int idx);
|
||||
std::string creatureTypeLabel(int idx);
|
||||
std::string soundTypeLabel(int idx);
|
||||
std::string weaponTypeLabel(int idx);
|
||||
|
||||
// This function's a bit different because the types are record types,
|
||||
// not consecutive values.
|
||||
std::string aiTypeLabel(int type);
|
||||
|
||||
// This one's also a bit different, because it enumerates dialog
|
||||
// select rule functions, not types. Structurally, it still converts
|
||||
// indexes to strings for display.
|
||||
std::string ruleFunction(int idx);
|
||||
|
||||
// The labels below here can all be loaded from GMSTs, but are not
|
||||
// currently because among other things, that requires loading the
|
||||
// GMSTs before dumping any of the records.
|
||||
|
||||
// If the data format supported ordered lists of GMSTs (post 1.0), the
|
||||
// lists could define the valid values, their localization strings,
|
||||
// and the indexes for referencing the types in other records in the
|
||||
// database. Then a single label function could work for all types.
|
||||
|
||||
std::string magicEffectLabel(int idx);
|
||||
std::string attributeLabel(int idx);
|
||||
std::string spellTypeLabel(int idx);
|
||||
std::string specializationLabel(int idx);
|
||||
std::string skillLabel(int idx);
|
||||
std::string apparatusTypeLabel(int idx);
|
||||
std::string rangeTypeLabel(int idx);
|
||||
std::string schoolLabel(int idx);
|
||||
std::string enchantTypeLabel(int idx);
|
||||
|
||||
// The are the flag functions that convert a bitmask into a list of
|
||||
// human readble strings representing the set bits.
|
||||
|
||||
std::string bodyPartFlags(int flags);
|
||||
std::string cellFlags(int flags);
|
||||
std::string containerFlags(int flags);
|
||||
std::string creatureFlags(int flags);
|
||||
std::string landFlags(int flags);
|
||||
std::string leveledListFlags(int flags);
|
||||
std::string lightFlags(int flags);
|
||||
std::string magicEffectFlags(int flags);
|
||||
std::string npcFlags(int flags);
|
||||
std::string raceFlags(int flags);
|
||||
std::string spellFlags(int flags);
|
||||
std::string weaponFlags(int flags);
|
||||
|
||||
// Missing flags functions:
|
||||
// aiServicesFlags, possibly more
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
||||
#include "enchantingdialog.hpp"
|
||||
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
|
||||
EnchantingDialog::EnchantingDialog(MWBase::WindowManager &parWindowManager)
|
||||
: WindowBase("openmw_enchanting_dialog.layout", parWindowManager)
|
||||
, EffectEditorBase(parWindowManager)
|
||||
{
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
getWidget(mAvailableEffectsList, "AvailableEffects");
|
||||
getWidget(mUsedEffectsView, "UsedEffects");
|
||||
|
||||
setWidgets(mAvailableEffectsList, mUsedEffectsView);
|
||||
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EnchantingDialog::onCancelButtonClicked);
|
||||
}
|
||||
|
||||
void EnchantingDialog::open()
|
||||
{
|
||||
center();
|
||||
}
|
||||
|
||||
void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
|
||||
{
|
||||
mPtr = actor;
|
||||
|
||||
startEditing ();
|
||||
}
|
||||
|
||||
void EnchantingDialog::onReferenceUnavailable ()
|
||||
{
|
||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
||||
}
|
||||
|
||||
void EnchantingDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
||||
{
|
||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
#ifndef MWGUI_ENCHANTINGDIALOG_H
|
||||
#define MWGUI_ENCHANTINGDIALOG_H
|
||||
|
||||
#include "window_base.hpp"
|
||||
#include "referenceinterface.hpp"
|
||||
#include "spellcreationdialog.hpp"
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
class EnchantingDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
||||
{
|
||||
public:
|
||||
EnchantingDialog(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
virtual void open();
|
||||
void startEnchanting(MWWorld::Ptr actor);
|
||||
|
||||
protected:
|
||||
virtual void onReferenceUnavailable();
|
||||
|
||||
void onCancelButtonClicked(MyGUI::Widget* sender);
|
||||
|
||||
MyGUI::Button* mCancelButton;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,513 @@
|
||||
#include "spellcreationdialog.hpp"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include "../mwmechanics/spells.hpp"
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
|
||||
#include "tooltips.hpp"
|
||||
#include "widgets.hpp"
|
||||
#include "class.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
bool sortMagicEffects (short id1, short id2)
|
||||
{
|
||||
return MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(ESM::MagicEffect::effectIdToString (id1))->getString()
|
||||
< MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(ESM::MagicEffect::effectIdToString (id2))->getString();
|
||||
}
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
EditEffectDialog::EditEffectDialog(MWBase::WindowManager &parWindowManager)
|
||||
: WindowModal("openmw_edit_effect.layout", parWindowManager)
|
||||
, mEditing(false)
|
||||
{
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
getWidget(mOkButton, "OkButton");
|
||||
getWidget(mDeleteButton, "DeleteButton");
|
||||
getWidget(mRangeButton, "RangeButton");
|
||||
getWidget(mMagnitudeMinValue, "MagnitudeMinValue");
|
||||
getWidget(mMagnitudeMaxValue, "MagnitudeMaxValue");
|
||||
getWidget(mDurationValue, "DurationValue");
|
||||
getWidget(mAreaValue, "AreaValue");
|
||||
getWidget(mMagnitudeMinSlider, "MagnitudeMinSlider");
|
||||
getWidget(mMagnitudeMaxSlider, "MagnitudeMaxSlider");
|
||||
getWidget(mDurationSlider, "DurationSlider");
|
||||
getWidget(mAreaSlider, "AreaSlider");
|
||||
getWidget(mEffectImage, "EffectImage");
|
||||
getWidget(mEffectName, "EffectName");
|
||||
getWidget(mAreaText, "AreaText");
|
||||
getWidget(mDurationBox, "DurationBox");
|
||||
getWidget(mAreaBox, "AreaBox");
|
||||
getWidget(mMagnitudeBox, "MagnitudeBox");
|
||||
|
||||
mRangeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onRangeButtonClicked);
|
||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onOkButtonClicked);
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onCancelButtonClicked);
|
||||
mDeleteButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onDeleteButtonClicked);
|
||||
|
||||
mMagnitudeMinSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &EditEffectDialog::onMagnitudeMinChanged);
|
||||
mMagnitudeMaxSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &EditEffectDialog::onMagnitudeMaxChanged);
|
||||
mDurationSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &EditEffectDialog::onDurationChanged);
|
||||
mAreaSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &EditEffectDialog::onAreaChanged);
|
||||
}
|
||||
|
||||
void EditEffectDialog::open()
|
||||
{
|
||||
WindowModal::open();
|
||||
center();
|
||||
}
|
||||
|
||||
void EditEffectDialog::newEffect (const ESM::MagicEffect *effect)
|
||||
{
|
||||
setMagicEffect(effect);
|
||||
mEditing = false;
|
||||
|
||||
mDeleteButton->setVisible (false);
|
||||
|
||||
mEffect.mRange = ESM::RT_Self;
|
||||
|
||||
onRangeButtonClicked(mRangeButton);
|
||||
|
||||
mMagnitudeMinSlider->setScrollPosition (0);
|
||||
mMagnitudeMaxSlider->setScrollPosition (0);
|
||||
mAreaSlider->setScrollPosition (0);
|
||||
mDurationSlider->setScrollPosition (0);
|
||||
|
||||
mDurationValue->setCaption("1");
|
||||
mMagnitudeMinValue->setCaption("1");
|
||||
mMagnitudeMaxValue->setCaption("- 1");
|
||||
mAreaValue->setCaption("0");
|
||||
|
||||
mEffect.mMagnMin = 1;
|
||||
mEffect.mMagnMax = 1;
|
||||
mEffect.mDuration = 1;
|
||||
mEffect.mArea = 0;
|
||||
}
|
||||
|
||||
void EditEffectDialog::editEffect (ESM::ENAMstruct effect)
|
||||
{
|
||||
const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(effect.mEffectID);
|
||||
|
||||
setMagicEffect(magicEffect);
|
||||
|
||||
mEffect = effect;
|
||||
mEditing = true;
|
||||
|
||||
mDeleteButton->setVisible (true);
|
||||
|
||||
mMagnitudeMinSlider->setScrollPosition (effect.mMagnMin-1);
|
||||
mMagnitudeMaxSlider->setScrollPosition (effect.mMagnMax-1);
|
||||
mAreaSlider->setScrollPosition (effect.mArea);
|
||||
mDurationSlider->setScrollPosition (effect.mDuration-1);
|
||||
|
||||
onMagnitudeMinChanged (mMagnitudeMinSlider, effect.mMagnMin-1);
|
||||
onMagnitudeMaxChanged (mMagnitudeMinSlider, effect.mMagnMax-1);
|
||||
onAreaChanged (mAreaSlider, effect.mArea);
|
||||
onDurationChanged (mDurationSlider, effect.mDuration-1);
|
||||
}
|
||||
|
||||
void EditEffectDialog::setMagicEffect (const ESM::MagicEffect *effect)
|
||||
{
|
||||
std::string icon = effect->mIcon;
|
||||
icon[icon.size()-3] = 'd';
|
||||
icon[icon.size()-2] = 'd';
|
||||
icon[icon.size()-1] = 's';
|
||||
icon = "icons\\" + icon;
|
||||
|
||||
mEffectImage->setImageTexture (icon);
|
||||
|
||||
mEffectName->setCaptionWithReplacing("#{"+ESM::MagicEffect::effectIdToString (effect->mIndex)+"}");
|
||||
|
||||
mEffect.mEffectID = effect->mIndex;
|
||||
|
||||
mMagicEffect = effect;
|
||||
|
||||
updateBoxes();
|
||||
}
|
||||
|
||||
void EditEffectDialog::updateBoxes()
|
||||
{
|
||||
static int startY = mMagnitudeBox->getPosition().top;
|
||||
int curY = startY;
|
||||
|
||||
mMagnitudeBox->setVisible (false);
|
||||
mDurationBox->setVisible (false);
|
||||
mAreaBox->setVisible (false);
|
||||
|
||||
if (!(mMagicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
||||
{
|
||||
mMagnitudeBox->setPosition(mMagnitudeBox->getPosition().left, curY);
|
||||
mMagnitudeBox->setVisible (true);
|
||||
curY += mMagnitudeBox->getSize().height;
|
||||
}
|
||||
if (!(mMagicEffect->mData.mFlags & ESM::MagicEffect::NoDuration))
|
||||
{
|
||||
mDurationBox->setPosition(mDurationBox->getPosition().left, curY);
|
||||
mDurationBox->setVisible (true);
|
||||
curY += mDurationBox->getSize().height;
|
||||
}
|
||||
if (mEffect.mRange == ESM::RT_Target)
|
||||
{
|
||||
mAreaBox->setPosition(mAreaBox->getPosition().left, curY);
|
||||
mAreaBox->setVisible (true);
|
||||
curY += mAreaBox->getSize().height;
|
||||
}
|
||||
}
|
||||
|
||||
void EditEffectDialog::onRangeButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
mEffect.mRange = (mEffect.mRange+1)%3;
|
||||
|
||||
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}");
|
||||
|
||||
mAreaSlider->setVisible (mEffect.mRange != ESM::RT_Self);
|
||||
mAreaText->setVisible (mEffect.mRange != ESM::RT_Self);
|
||||
|
||||
// cycle through range types until we find something that's allowed
|
||||
if (mEffect.mRange == ESM::RT_Target && !(mMagicEffect->mData.mFlags & ESM::MagicEffect::CastTarget))
|
||||
onRangeButtonClicked(sender);
|
||||
if (mEffect.mRange == ESM::RT_Self && !(mMagicEffect->mData.mFlags & ESM::MagicEffect::CastSelf))
|
||||
onRangeButtonClicked(sender);
|
||||
if (mEffect.mRange == ESM::RT_Touch && !(mMagicEffect->mData.mFlags & ESM::MagicEffect::CastTouch))
|
||||
onRangeButtonClicked(sender);
|
||||
|
||||
updateBoxes();
|
||||
}
|
||||
|
||||
void EditEffectDialog::onDeleteButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
setVisible(false);
|
||||
|
||||
eventEffectRemoved(mEffect);
|
||||
}
|
||||
|
||||
void EditEffectDialog::onOkButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
setVisible(false);
|
||||
|
||||
if (mEditing)
|
||||
eventEffectModified(mEffect);
|
||||
else
|
||||
eventEffectAdded(mEffect);
|
||||
}
|
||||
|
||||
void EditEffectDialog::onCancelButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
void EditEffectDialog::setSkill (int skill)
|
||||
{
|
||||
mEffect.mSkill = skill;
|
||||
}
|
||||
|
||||
void EditEffectDialog::setAttribute (int attribute)
|
||||
{
|
||||
mEffect.mAttribute = attribute;
|
||||
}
|
||||
|
||||
void EditEffectDialog::onMagnitudeMinChanged (MyGUI::ScrollBar* sender, size_t pos)
|
||||
{
|
||||
mMagnitudeMinValue->setCaption(boost::lexical_cast<std::string>(pos+1));
|
||||
mEffect.mMagnMin = pos+1;
|
||||
|
||||
// trigger the check again (see below)
|
||||
onMagnitudeMaxChanged(mMagnitudeMaxSlider, mMagnitudeMaxSlider->getScrollPosition ());
|
||||
}
|
||||
|
||||
void EditEffectDialog::onMagnitudeMaxChanged (MyGUI::ScrollBar* sender, size_t pos)
|
||||
{
|
||||
// make sure the max value is actually larger or equal than the min value
|
||||
size_t magnMin = std::abs(mEffect.mMagnMin); // should never be < 0, this is just here to avoid the compiler warning
|
||||
if (pos+1 < magnMin)
|
||||
{
|
||||
pos = mEffect.mMagnMin-1;
|
||||
sender->setScrollPosition (pos);
|
||||
}
|
||||
|
||||
mEffect.mMagnMax = pos+1;
|
||||
|
||||
mMagnitudeMaxValue->setCaption("- " + boost::lexical_cast<std::string>(pos+1));
|
||||
}
|
||||
|
||||
void EditEffectDialog::onDurationChanged (MyGUI::ScrollBar* sender, size_t pos)
|
||||
{
|
||||
mDurationValue->setCaption(boost::lexical_cast<std::string>(pos+1));
|
||||
mEffect.mDuration = pos+1;
|
||||
}
|
||||
|
||||
void EditEffectDialog::onAreaChanged (MyGUI::ScrollBar* sender, size_t pos)
|
||||
{
|
||||
mAreaValue->setCaption(boost::lexical_cast<std::string>(pos));
|
||||
mEffect.mArea = pos;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
SpellCreationDialog::SpellCreationDialog(MWBase::WindowManager &parWindowManager)
|
||||
: WindowBase("openmw_spellcreation_dialog.layout", parWindowManager)
|
||||
, EffectEditorBase(parWindowManager)
|
||||
{
|
||||
getWidget(mNameEdit, "NameEdit");
|
||||
getWidget(mMagickaCost, "MagickaCost");
|
||||
getWidget(mSuccessChance, "SuccessChance");
|
||||
getWidget(mAvailableEffectsList, "AvailableEffects");
|
||||
getWidget(mUsedEffectsView, "UsedEffects");
|
||||
getWidget(mPriceLabel, "PriceLabel");
|
||||
getWidget(mBuyButton, "BuyButton");
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onCancelButtonClicked);
|
||||
mBuyButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onBuyButtonClicked);
|
||||
|
||||
setWidgets(mAvailableEffectsList, mUsedEffectsView);
|
||||
}
|
||||
|
||||
void SpellCreationDialog::startSpellMaking (MWWorld::Ptr actor)
|
||||
{
|
||||
mPtr = actor;
|
||||
|
||||
startEditing();
|
||||
}
|
||||
|
||||
void SpellCreationDialog::onCancelButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
mWindowManager.removeGuiMode (MWGui::GM_SpellCreation);
|
||||
}
|
||||
|
||||
void SpellCreationDialog::onBuyButtonClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SpellCreationDialog::open()
|
||||
{
|
||||
center();
|
||||
}
|
||||
|
||||
void SpellCreationDialog::onReferenceUnavailable ()
|
||||
{
|
||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
||||
mWindowManager.removeGuiMode (GM_SpellCreation);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
EffectEditorBase::EffectEditorBase(MWBase::WindowManager& parWindowManager)
|
||||
: mAddEffectDialog(parWindowManager)
|
||||
, mSelectAttributeDialog(NULL)
|
||||
, mSelectSkillDialog(NULL)
|
||||
{
|
||||
mAddEffectDialog.eventEffectAdded += MyGUI::newDelegate(this, &EffectEditorBase::onEffectAdded);
|
||||
mAddEffectDialog.eventEffectModified += MyGUI::newDelegate(this, &EffectEditorBase::onEffectModified);
|
||||
mAddEffectDialog.eventEffectRemoved += MyGUI::newDelegate(this, &EffectEditorBase::onEffectRemoved);
|
||||
|
||||
mAddEffectDialog.setVisible (false);
|
||||
}
|
||||
|
||||
void EffectEditorBase::startEditing ()
|
||||
{
|
||||
// get the list of magic effects that are known to the player
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
||||
MWMechanics::Spells& spells = stats.getSpells();
|
||||
|
||||
std::vector<short> knownEffects;
|
||||
|
||||
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
||||
{
|
||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||
|
||||
// only normal spells count
|
||||
if (spell->mData.mType != ESM::Spell::ST_Spell)
|
||||
continue;
|
||||
|
||||
const std::vector<ESM::ENAMstruct>& list = spell->mEffects.mList;
|
||||
for (std::vector<ESM::ENAMstruct>::const_iterator it2 = list.begin(); it2 != list.end(); ++it2)
|
||||
{
|
||||
if (std::find(knownEffects.begin(), knownEffects.end(), it2->mEffectID) == knownEffects.end())
|
||||
knownEffects.push_back(it2->mEffectID);
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(knownEffects.begin(), knownEffects.end(), sortMagicEffects);
|
||||
|
||||
mAvailableEffectsList->clear ();
|
||||
|
||||
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||
{
|
||||
mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||
ESM::MagicEffect::effectIdToString (*it))->getString());
|
||||
}
|
||||
mAvailableEffectsList->adjustSize ();
|
||||
|
||||
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||
{
|
||||
std::string name = MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||
ESM::MagicEffect::effectIdToString (*it))->getString();
|
||||
MyGUI::Widget* w = mAvailableEffectsList->getItemWidget(name);
|
||||
w->setUserData(*it);
|
||||
|
||||
ToolTips::createMagicEffectToolTip (w, *it);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectEditorBase::setWidgets (Widgets::MWList *availableEffectsList, MyGUI::ScrollView *usedEffectsView)
|
||||
{
|
||||
mAvailableEffectsList = availableEffectsList;
|
||||
mUsedEffectsView = usedEffectsView;
|
||||
|
||||
mAvailableEffectsList->eventWidgetSelected += MyGUI::newDelegate(this, &EffectEditorBase::onAvailableEffectClicked);
|
||||
}
|
||||
|
||||
void EffectEditorBase::onSelectAttribute ()
|
||||
{
|
||||
mAddEffectDialog.setVisible(true);
|
||||
mAddEffectDialog.setAttribute (mSelectAttributeDialog->getAttributeId());
|
||||
MWBase::Environment::get().getWindowManager ()->removeDialog (mSelectAttributeDialog);
|
||||
mSelectAttributeDialog = 0;
|
||||
}
|
||||
|
||||
void EffectEditorBase::onSelectSkill ()
|
||||
{
|
||||
mAddEffectDialog.setVisible(true);
|
||||
mAddEffectDialog.setSkill (mSelectSkillDialog->getSkillId ());
|
||||
MWBase::Environment::get().getWindowManager ()->removeDialog (mSelectSkillDialog);
|
||||
mSelectSkillDialog = 0;
|
||||
}
|
||||
|
||||
void EffectEditorBase::onAttributeOrSkillCancel ()
|
||||
{
|
||||
if (mSelectSkillDialog)
|
||||
MWBase::Environment::get().getWindowManager ()->removeDialog (mSelectSkillDialog);
|
||||
if (mSelectAttributeDialog)
|
||||
MWBase::Environment::get().getWindowManager ()->removeDialog (mSelectAttributeDialog);
|
||||
|
||||
mSelectSkillDialog = 0;
|
||||
mSelectAttributeDialog = 0;
|
||||
}
|
||||
|
||||
void EffectEditorBase::onAvailableEffectClicked (MyGUI::Widget* sender)
|
||||
{
|
||||
|
||||
short effectId = *sender->getUserData<short>();
|
||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(effectId);
|
||||
|
||||
mAddEffectDialog.newEffect (effect);
|
||||
|
||||
if (effect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
||||
{
|
||||
delete mSelectSkillDialog;
|
||||
mSelectSkillDialog = new SelectSkillDialog(*MWBase::Environment::get().getWindowManager ());
|
||||
mSelectSkillDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
||||
mSelectSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectSkill);
|
||||
mSelectSkillDialog->setVisible (true);
|
||||
}
|
||||
else if (effect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
||||
{
|
||||
delete mSelectAttributeDialog;
|
||||
mSelectAttributeDialog = new SelectAttributeDialog(*MWBase::Environment::get().getWindowManager ());
|
||||
mSelectAttributeDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
||||
mSelectAttributeDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectAttribute);
|
||||
mSelectAttributeDialog->setVisible (true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mAddEffectDialog.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectEditorBase::onEffectModified (ESM::ENAMstruct effect)
|
||||
{
|
||||
mEffects[mSelectedEffect] = effect;
|
||||
|
||||
updateEffectsView();
|
||||
}
|
||||
|
||||
void EffectEditorBase::onEffectRemoved (ESM::ENAMstruct effect)
|
||||
{
|
||||
mEffects.erase(mEffects.begin() + mSelectedEffect);
|
||||
updateEffectsView();
|
||||
}
|
||||
|
||||
void EffectEditorBase::updateEffectsView ()
|
||||
{
|
||||
MyGUI::EnumeratorWidgetPtr oldWidgets = mUsedEffectsView->getEnumerator ();
|
||||
MyGUI::Gui::getInstance ().destroyWidgets (oldWidgets);
|
||||
|
||||
MyGUI::IntSize size(0,0);
|
||||
|
||||
int i = 0;
|
||||
for (std::vector<ESM::ENAMstruct>::const_iterator it = mEffects.begin(); it != mEffects.end(); ++it)
|
||||
{
|
||||
Widgets::SpellEffectParams params;
|
||||
params.mEffectID = it->mEffectID;
|
||||
params.mSkill = it->mSkill;
|
||||
params.mAttribute = it->mAttribute;
|
||||
params.mDuration = it->mDuration;
|
||||
params.mMagnMin = it->mMagnMin;
|
||||
params.mMagnMax = it->mMagnMax;
|
||||
params.mRange = it->mRange;
|
||||
params.mArea = it->mArea;
|
||||
|
||||
MyGUI::Button* button = mUsedEffectsView->createWidget<MyGUI::Button>("", MyGUI::IntCoord(0, size.height, 0, 24), MyGUI::Align::Default);
|
||||
button->setUserData(i);
|
||||
button->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onEditEffect);
|
||||
button->setNeedMouseFocus (true);
|
||||
|
||||
Widgets::MWSpellEffectPtr effect = button->createWidget<Widgets::MWSpellEffect>("MW_EffectImage", MyGUI::IntCoord(0,0,0,24), MyGUI::Align::Default);
|
||||
|
||||
effect->setNeedMouseFocus (false);
|
||||
effect->setWindowManager (MWBase::Environment::get().getWindowManager ());
|
||||
effect->setSpellEffect (params);
|
||||
|
||||
effect->setSize(effect->getRequestedWidth (), 24);
|
||||
button->setSize(effect->getRequestedWidth (), 24);
|
||||
|
||||
size.width = std::max(size.width, effect->getRequestedWidth ());
|
||||
size.height += 24;
|
||||
++i;
|
||||
}
|
||||
|
||||
mUsedEffectsView->setCanvasSize(size);
|
||||
}
|
||||
|
||||
void EffectEditorBase::onEffectAdded (ESM::ENAMstruct effect)
|
||||
{
|
||||
mEffects.push_back(effect);
|
||||
|
||||
updateEffectsView();
|
||||
}
|
||||
|
||||
void EffectEditorBase::onEditEffect (MyGUI::Widget *sender)
|
||||
{
|
||||
int id = *sender->getUserData<int>();
|
||||
|
||||
mSelectedEffect = id;
|
||||
|
||||
mAddEffectDialog.editEffect (mEffects[id]);
|
||||
mAddEffectDialog.setVisible (true);
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
#ifndef MWGUI_SPELLCREATION_H
|
||||
#define MWGUI_SPELLCREATION_H
|
||||
|
||||
#include "window_base.hpp"
|
||||
#include "referenceinterface.hpp"
|
||||
#include "list.hpp"
|
||||
#include "widgets.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
class SelectSkillDialog;
|
||||
class SelectAttributeDialog;
|
||||
|
||||
class EditEffectDialog : public WindowModal
|
||||
{
|
||||
public:
|
||||
EditEffectDialog(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
virtual void open();
|
||||
|
||||
void setSkill(int skill);
|
||||
void setAttribute(int attribute);
|
||||
|
||||
void newEffect (const ESM::MagicEffect* effect);
|
||||
void editEffect (ESM::ENAMstruct effect);
|
||||
|
||||
typedef MyGUI::delegates::CMultiDelegate1<ESM::ENAMstruct> EventHandle_Effect;
|
||||
|
||||
EventHandle_Effect eventEffectAdded;
|
||||
EventHandle_Effect eventEffectModified;
|
||||
EventHandle_Effect eventEffectRemoved;
|
||||
|
||||
protected:
|
||||
MyGUI::Button* mCancelButton;
|
||||
MyGUI::Button* mOkButton;
|
||||
MyGUI::Button* mDeleteButton;
|
||||
|
||||
MyGUI::Button* mRangeButton;
|
||||
|
||||
MyGUI::Widget* mDurationBox;
|
||||
MyGUI::Widget* mMagnitudeBox;
|
||||
MyGUI::Widget* mAreaBox;
|
||||
|
||||
MyGUI::TextBox* mMagnitudeMinValue;
|
||||
MyGUI::TextBox* mMagnitudeMaxValue;
|
||||
MyGUI::TextBox* mDurationValue;
|
||||
MyGUI::TextBox* mAreaValue;
|
||||
|
||||
MyGUI::ScrollBar* mMagnitudeMinSlider;
|
||||
MyGUI::ScrollBar* mMagnitudeMaxSlider;
|
||||
MyGUI::ScrollBar* mDurationSlider;
|
||||
MyGUI::ScrollBar* mAreaSlider;
|
||||
|
||||
MyGUI::TextBox* mAreaText;
|
||||
|
||||
MyGUI::ImageBox* mEffectImage;
|
||||
MyGUI::TextBox* mEffectName;
|
||||
|
||||
bool mEditing;
|
||||
|
||||
protected:
|
||||
void onRangeButtonClicked (MyGUI::Widget* sender);
|
||||
void onDeleteButtonClicked (MyGUI::Widget* sender);
|
||||
void onOkButtonClicked (MyGUI::Widget* sender);
|
||||
void onCancelButtonClicked (MyGUI::Widget* sender);
|
||||
|
||||
void onMagnitudeMinChanged (MyGUI::ScrollBar* sender, size_t pos);
|
||||
void onMagnitudeMaxChanged (MyGUI::ScrollBar* sender, size_t pos);
|
||||
void onDurationChanged (MyGUI::ScrollBar* sender, size_t pos);
|
||||
void onAreaChanged (MyGUI::ScrollBar* sender, size_t pos);
|
||||
|
||||
void setMagicEffect(const ESM::MagicEffect* effect);
|
||||
|
||||
void updateBoxes();
|
||||
|
||||
protected:
|
||||
ESM::ENAMstruct mEffect;
|
||||
|
||||
const ESM::MagicEffect* mMagicEffect;
|
||||
};
|
||||
|
||||
|
||||
class EffectEditorBase
|
||||
{
|
||||
public:
|
||||
EffectEditorBase(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
|
||||
protected:
|
||||
Widgets::MWList* mAvailableEffectsList;
|
||||
MyGUI::ScrollView* mUsedEffectsView;
|
||||
|
||||
EditEffectDialog mAddEffectDialog;
|
||||
SelectAttributeDialog* mSelectAttributeDialog;
|
||||
SelectSkillDialog* mSelectSkillDialog;
|
||||
|
||||
int mSelectedEffect;
|
||||
|
||||
std::vector<ESM::ENAMstruct> mEffects;
|
||||
|
||||
void onEffectAdded(ESM::ENAMstruct effect);
|
||||
void onEffectModified(ESM::ENAMstruct effect);
|
||||
void onEffectRemoved(ESM::ENAMstruct effect);
|
||||
|
||||
void onAvailableEffectClicked (MyGUI::Widget* sender);
|
||||
|
||||
void onAttributeOrSkillCancel();
|
||||
void onSelectAttribute();
|
||||
void onSelectSkill();
|
||||
|
||||
void onEditEffect(MyGUI::Widget* sender);
|
||||
|
||||
void updateEffectsView();
|
||||
|
||||
void startEditing();
|
||||
void setWidgets (Widgets::MWList* availableEffectsList, MyGUI::ScrollView* usedEffectsView);
|
||||
|
||||
};
|
||||
|
||||
class SpellCreationDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
||||
{
|
||||
public:
|
||||
SpellCreationDialog(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
virtual void open();
|
||||
|
||||
void startSpellMaking(MWWorld::Ptr actor);
|
||||
|
||||
protected:
|
||||
virtual void onReferenceUnavailable ();
|
||||
|
||||
void onCancelButtonClicked (MyGUI::Widget* sender);
|
||||
void onBuyButtonClicked (MyGUI::Widget* sender);
|
||||
|
||||
|
||||
MyGUI::EditBox* mNameEdit;
|
||||
MyGUI::TextBox* mMagickaCost;
|
||||
MyGUI::TextBox* mSuccessChance;
|
||||
MyGUI::Button* mBuyButton;
|
||||
MyGUI::Button* mCancelButton;
|
||||
MyGUI::TextBox* mPriceLabel;
|
||||
|
||||
Widgets::MWEffectList* mUsedEffectsList;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,159 @@
|
||||
#include "trainingwindow.hpp"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <openengine/ogre/fader.hpp>
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwworld/player.hpp"
|
||||
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "inventorywindow.hpp"
|
||||
#include "tradewindow.hpp"
|
||||
#include "tooltips.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
TrainingWindow::TrainingWindow(MWBase::WindowManager &parWindowManager)
|
||||
: WindowBase("openmw_trainingwindow.layout", parWindowManager)
|
||||
, mFadeTimeRemaining(0)
|
||||
{
|
||||
getWidget(mTrainingOptions, "TrainingOptions");
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
getWidget(mPlayerGold, "PlayerGold");
|
||||
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onCancelButtonClicked);
|
||||
}
|
||||
|
||||
void TrainingWindow::open()
|
||||
{
|
||||
center();
|
||||
}
|
||||
|
||||
void TrainingWindow::startTraining (MWWorld::Ptr actor)
|
||||
{
|
||||
mPtr = actor;
|
||||
|
||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
||||
|
||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats (actor);
|
||||
|
||||
// NPC can train you in his best 3 skills
|
||||
std::vector< std::pair<int, int> > bestSkills;
|
||||
bestSkills.push_back (std::make_pair(-1, -1));
|
||||
bestSkills.push_back (std::make_pair(-1, -1));
|
||||
bestSkills.push_back (std::make_pair(-1, -1));
|
||||
|
||||
for (int i=0; i<ESM::Skill::Length; ++i)
|
||||
{
|
||||
int value = npcStats.getSkill (i).getBase ();
|
||||
|
||||
for (int j=0; j<3; ++j)
|
||||
{
|
||||
if (value > bestSkills[j].second)
|
||||
{
|
||||
if (j<2)
|
||||
{
|
||||
bestSkills[j+1] = bestSkills[j];
|
||||
}
|
||||
bestSkills[j] = std::make_pair(i, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MyGUI::EnumeratorWidgetPtr widgets = mTrainingOptions->getEnumerator ();
|
||||
MyGUI::Gui::getInstance ().destroyWidgets (widgets);
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
|
||||
for (int i=0; i<3; ++i)
|
||||
{
|
||||
/// \todo mercantile skill
|
||||
int price = pcStats.getSkill (bestSkills[i].first).getBase() * MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find("iTrainingMod")->getInt ();
|
||||
|
||||
std::string skin = (price > mWindowManager.getInventoryWindow ()->getPlayerGold ()) ? "SandTextGreyedOut" : "SandTextButton";
|
||||
|
||||
MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(skin,
|
||||
MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default);
|
||||
|
||||
button->setUserData(bestSkills[i].first);
|
||||
button->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onTrainingSelected);
|
||||
|
||||
button->setCaptionWithReplacing("#{" + ESM::Skill::sSkillNameIds[bestSkills[i].first] + "} - " + boost::lexical_cast<std::string>(price));
|
||||
|
||||
button->setSize(button->getTextSize ().width+12, button->getSize().height);
|
||||
|
||||
ToolTips::createSkillToolTip (button, bestSkills[i].first);
|
||||
}
|
||||
|
||||
center();
|
||||
}
|
||||
|
||||
void TrainingWindow::onReferenceUnavailable ()
|
||||
{
|
||||
mWindowManager.removeGuiMode(GM_Training);
|
||||
}
|
||||
|
||||
void TrainingWindow::onCancelButtonClicked (MyGUI::Widget *sender)
|
||||
{
|
||||
mWindowManager.removeGuiMode (GM_Training);
|
||||
}
|
||||
|
||||
void TrainingWindow::onTrainingSelected (MyGUI::Widget *sender)
|
||||
{
|
||||
int skillId = *sender->getUserData<int>();
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ();
|
||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
|
||||
/// \todo mercantile skill
|
||||
int price = pcStats.getSkill (skillId).getBase() * MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find("iTrainingMod")->getInt ();
|
||||
|
||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
||||
return;
|
||||
|
||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mPtr).getNpcStats (mPtr);
|
||||
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
|
||||
{
|
||||
mWindowManager.messageBox ("#{sServiceTrainingWords}", std::vector<std::string>());
|
||||
return;
|
||||
}
|
||||
|
||||
// increase skill
|
||||
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
|
||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||
playerRef->base->mClass);
|
||||
pcStats.increaseSkill (skillId, *class_, true);
|
||||
|
||||
// remove gold
|
||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
||||
|
||||
// go back to game mode
|
||||
mWindowManager.removeGuiMode (GM_Training);
|
||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
||||
|
||||
// advance time
|
||||
MWBase::Environment::get().getWorld ()->advanceTime (2);
|
||||
|
||||
MWBase::Environment::get().getWorld ()->getFader()->fadeOut(0.25);
|
||||
mFadeTimeRemaining = 0.5;
|
||||
}
|
||||
|
||||
void TrainingWindow::onFrame(float dt)
|
||||
{
|
||||
if (mFadeTimeRemaining <= 0)
|
||||
return;
|
||||
|
||||
mFadeTimeRemaining -= dt;
|
||||
|
||||
if (mFadeTimeRemaining <= 0)
|
||||
MWBase::Environment::get().getWorld ()->getFader()->fadeIn(0.25);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
#ifndef MWGUI_TRAININGWINDOW_H
|
||||
#define MWGUI_TRAININGWINDOW_H
|
||||
|
||||
#include "window_base.hpp"
|
||||
#include "referenceinterface.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
class TrainingWindow : public WindowBase, public ReferenceInterface
|
||||
{
|
||||
public:
|
||||
TrainingWindow(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
virtual void open();
|
||||
|
||||
void startTraining(MWWorld::Ptr actor);
|
||||
|
||||
void onFrame(float dt);
|
||||
|
||||
protected:
|
||||
virtual void onReferenceUnavailable ();
|
||||
|
||||
void onCancelButtonClicked (MyGUI::Widget* sender);
|
||||
void onTrainingSelected(MyGUI::Widget* sender);
|
||||
|
||||
MyGUI::Widget* mTrainingOptions;
|
||||
MyGUI::Button* mCancelButton;
|
||||
MyGUI::TextBox* mPlayerGold;
|
||||
|
||||
float mFadeTimeRemaining;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,187 @@
|
||||
#include "travelwindow.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <libs/openengine/ogre/fader.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/soundmanager.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/manualref.hpp"
|
||||
|
||||
#include "../mwmechanics/spells.hpp"
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
|
||||
#include "inventorywindow.hpp"
|
||||
#include "tradewindow.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
const int TravelWindow::sLineHeight = 18;
|
||||
|
||||
TravelWindow::TravelWindow(MWBase::WindowManager& parWindowManager) :
|
||||
WindowBase("openmw_travel_window.layout", parWindowManager)
|
||||
, mCurrentY(0)
|
||||
, mLastPos(0)
|
||||
{
|
||||
setCoord(0, 0, 450, 300);
|
||||
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
getWidget(mPlayerGold, "PlayerGold");
|
||||
getWidget(mSelect, "Select");
|
||||
getWidget(mDestinations, "Travel");
|
||||
getWidget(mDestinationsView, "DestinationsView");
|
||||
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onCancelButtonClicked);
|
||||
|
||||
mDestinations->setCoord(450/2-mDestinations->getTextSize().width/2,
|
||||
mDestinations->getTop(),
|
||||
mDestinations->getTextSize().width,
|
||||
mDestinations->getHeight());
|
||||
mSelect->setCoord(8,
|
||||
mSelect->getTop(),
|
||||
mSelect->getTextSize().width,
|
||||
mSelect->getHeight());
|
||||
}
|
||||
|
||||
void TravelWindow::addDestination(const std::string& travelId,ESM::Position pos,bool interior)
|
||||
{
|
||||
int price = 0;
|
||||
|
||||
if(interior)
|
||||
{
|
||||
price = MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fMagesGuildTravel")->getFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||
price = d/MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelMult")->getFloat();
|
||||
}
|
||||
|
||||
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
||||
mCurrentY += sLineHeight;
|
||||
/// \todo price adjustment depending on merchantile skill
|
||||
if(interior)
|
||||
toAdd->setUserString("interior","y");
|
||||
else
|
||||
toAdd->setUserString("interior","n");
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << price;
|
||||
toAdd->setUserString("price",oss.str());
|
||||
|
||||
toAdd->setCaptionWithReplacing(travelId+" - "+boost::lexical_cast<std::string>(price)+"#{sgp}");
|
||||
toAdd->setSize(toAdd->getTextSize().width,sLineHeight);
|
||||
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &TravelWindow::onMouseWheel);
|
||||
toAdd->setUserString("Destination", travelId);
|
||||
toAdd->setUserData(pos);
|
||||
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onTravelButtonClick);
|
||||
mDestinationsWidgetMap.insert(std::make_pair (toAdd, travelId));
|
||||
}
|
||||
|
||||
void TravelWindow::clearDestinations()
|
||||
{
|
||||
mDestinationsView->setViewOffset(MyGUI::IntPoint(0,0));
|
||||
mCurrentY = 0;
|
||||
while (mDestinationsView->getChildCount())
|
||||
MyGUI::Gui::getInstance().destroyWidget(mDestinationsView->getChildAt(0));
|
||||
mDestinationsWidgetMap.clear();
|
||||
}
|
||||
|
||||
void TravelWindow::startTravel(const MWWorld::Ptr& actor)
|
||||
{
|
||||
center();
|
||||
mPtr = actor;
|
||||
clearDestinations();
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
||||
for(unsigned int i = 0;i<mPtr.get<ESM::NPC>()->base->mTransport.size();i++)
|
||||
{
|
||||
std::string cellname = mPtr.get<ESM::NPC>()->base->mTransport[i].mCellName;
|
||||
bool interior = true;
|
||||
int x,y;
|
||||
MWBase::Environment::get().getWorld()->positionToIndex(mPtr.get<ESM::NPC>()->base->mTransport[i].mPos.pos[0],
|
||||
mPtr.get<ESM::NPC>()->base->mTransport[i].mPos.pos[1],x,y);
|
||||
if(cellname == "") {cellname = MWBase::Environment::get().getWorld()->getExterior(x,y)->cell->mName; interior= false;}
|
||||
addDestination(cellname,mPtr.get<ESM::NPC>()->base->mTransport[i].mPos,interior);
|
||||
}
|
||||
|
||||
updateLabels();
|
||||
mDestinationsView->setCanvasSize (MyGUI::IntSize(mDestinationsView->getWidth(), std::max(mDestinationsView->getHeight(), mCurrentY)));
|
||||
}
|
||||
|
||||
void TravelWindow::onTravelButtonClick(MyGUI::Widget* _sender)
|
||||
{
|
||||
std::istringstream iss(_sender->getUserString("price"));
|
||||
int price;
|
||||
iss >> price;
|
||||
|
||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
||||
return;
|
||||
|
||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(1);
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
ESM::Position pos = *_sender->getUserData<ESM::Position>();
|
||||
std::string cellname = _sender->getUserString("Destination");
|
||||
int x,y;
|
||||
bool interior = _sender->getUserString("interior") == "y";
|
||||
MWBase::Environment::get().getWorld()->positionToIndex(pos.pos[0],pos.pos[1],x,y);
|
||||
MWWorld::CellStore* cell;
|
||||
if(interior) cell = MWBase::Environment::get().getWorld()->getInterior(cellname);
|
||||
else
|
||||
{
|
||||
cell = MWBase::Environment::get().getWorld()->getExterior(x,y);
|
||||
ESM::Position PlayerPos = player.getRefData().getPosition();
|
||||
float d = sqrt( pow(pos.pos[0] - PlayerPos.pos[0],2) + pow(pos.pos[1] - PlayerPos.pos[1],2) + pow(pos.pos[2] - PlayerPos.pos[2],2) );
|
||||
int time = int(d /MWBase::Environment::get().getWorld()->getStore().gameSettings.find("fTravelTimeMult")->getFloat());
|
||||
for(int i = 0;i < time;i++)
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager ()->restoreDynamicStats ();
|
||||
}
|
||||
MWBase::Environment::get().getWorld()->advanceTime(time);
|
||||
}
|
||||
MWBase::Environment::get().getWorld()->moveObject(player,*cell,pos.pos[0],pos.pos[1],pos.pos[2]);
|
||||
mWindowManager.removeGuiMode(GM_Travel);
|
||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
|
||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(1);
|
||||
}
|
||||
|
||||
void TravelWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
mWindowManager.removeGuiMode(GM_Travel);
|
||||
}
|
||||
|
||||
void TravelWindow::updateLabels()
|
||||
{
|
||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
||||
mPlayerGold->setCoord(8,
|
||||
mPlayerGold->getTop(),
|
||||
mPlayerGold->getTextSize().width,
|
||||
mPlayerGold->getHeight());
|
||||
}
|
||||
|
||||
void TravelWindow::onReferenceUnavailable()
|
||||
{
|
||||
mWindowManager.removeGuiMode(GM_Travel);
|
||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
||||
}
|
||||
|
||||
void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||
{
|
||||
if (mDestinationsView->getViewOffset().top + _rel*0.3 > 0)
|
||||
mDestinationsView->setViewOffset(MyGUI::IntPoint(0, 0));
|
||||
else
|
||||
mDestinationsView->setViewOffset(MyGUI::IntPoint(0, mDestinationsView->getViewOffset().top + _rel*0.3));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
#ifndef MWGUI_TravelWINDOW_H
|
||||
#define MWGUI_TravelWINDOW_H
|
||||
|
||||
#include "container.hpp"
|
||||
#include "window_base.hpp"
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
namespace MyGUI
|
||||
{
|
||||
class Gui;
|
||||
class Widget;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
}
|
||||
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class TravelWindow : public ReferenceInterface, public WindowBase
|
||||
{
|
||||
public:
|
||||
TravelWindow(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
void startTravel(const MWWorld::Ptr& actor);
|
||||
|
||||
protected:
|
||||
MyGUI::Button* mCancelButton;
|
||||
MyGUI::TextBox* mPlayerGold;
|
||||
MyGUI::TextBox* mDestinations;
|
||||
MyGUI::TextBox* mSelect;
|
||||
|
||||
MyGUI::ScrollView* mDestinationsView;
|
||||
|
||||
std::map<MyGUI::Widget*, std::string> mDestinationsWidgetMap;
|
||||
|
||||
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
||||
void onTravelButtonClick(MyGUI::Widget* _sender);
|
||||
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
||||
void addDestination(const std::string& destinationID,ESM::Position pos,bool interior);
|
||||
void clearDestinations();
|
||||
int mLastPos,mCurrentY;
|
||||
|
||||
static const int sLineHeight;
|
||||
|
||||
void updateLabels();
|
||||
|
||||
virtual void onReferenceUnavailable();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -1 +1 @@
|
||||
Subproject commit ffd078843c11586107024ccbc2493d0ec2df896c
|
||||
Subproject commit f17c4ebab0e7a1f3bbb25fd9b3dbef2bd742536a
|
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 362 310" name="_Main">
|
||||
|
||||
<Widget type="ImageBox" skin="ImageBox" position="8 12 16 16" name="EffectImage">
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="36 8 400 24" name="EffectName">
|
||||
<Property key="TextAlign" value="Left HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<!-- Range -->
|
||||
<Widget type="TextBox" skin="NormalText" position="8 36 400 24">
|
||||
<Property key="Caption" value="#{sRange}"/>
|
||||
<Property key="TextAlign" value="Left HCenter"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="130 36 0 24" name="RangeButton">
|
||||
<Property key="Caption" value="#{sRangeTouch}"/>
|
||||
</Widget>
|
||||
|
||||
<!-- Magnitude -->
|
||||
<Widget type="Widget" position="8 80 400 70" name="MagnitudeBox">
|
||||
<Widget type="TextBox" skin="NormalText" position="0 0 400 24">
|
||||
<Property key="Caption" value="#{sMagnitude}"/>
|
||||
<Property key="TextAlign" value="Left HCenter"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="122 0 210 20" name="MagnitudeMinValue">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="0"/>
|
||||
</Widget>
|
||||
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="MagnitudeMinSlider">
|
||||
<Property key="Range" value="100"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="122 32 210 20" name="MagnitudeMaxValue">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="0"/>
|
||||
</Widget>
|
||||
<Widget type="ScrollBar" skin="MW_HSlider" position="122 52 210 13" name="MagnitudeMaxSlider">
|
||||
<Property key="Range" value="100"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
|
||||
<!-- Duration -->
|
||||
<Widget type="Widget" position="8 153 400 40" name="DurationBox">
|
||||
<Widget type="TextBox" skin="NormalText" position="0 20 400 24">
|
||||
<Property key="Caption" value="#{sDuration}"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="122 0 210 20" name="DurationValue">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="0"/>
|
||||
</Widget>
|
||||
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="DurationSlider">
|
||||
<Property key="Range" value="1440"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Area -->
|
||||
<Widget type="Widget" position="8 197 400 40" name="AreaBox">
|
||||
<Widget type="TextBox" skin="NormalText" position="0 20 400 24" name="AreaText">
|
||||
<Property key="Caption" value="#{sArea}"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="122 0 210 20" name="AreaValue">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="0"/>
|
||||
</Widget>
|
||||
<Widget type="ScrollBar" skin="MW_HSlider" position="122 20 210 13" name="AreaSlider">
|
||||
<Property key="Range" value="51"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<Widget type="HBox" position="8 266 336 24">
|
||||
<Widget type="Widget">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="DeleteButton">
|
||||
<Property key="Caption" value="#{sDelete}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton">
|
||||
<Property key="Caption" value="#{sOk}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
|
||||
<Property key="Caption" value="#{sCancel}"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
@ -0,0 +1,110 @@
|
||||
<?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 type="HBox" position="12 12 250 30">
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sName}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="EditBox" skin="MW_TextEdit" position="0 0 30 30" name="NameEdit">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="Widget">
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
<!-- Item -->
|
||||
|
||||
<Widget type="HBox" position="12 48 400 59">
|
||||
<Property key="Spacing" value="8"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sItem}"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="MW_Box" position="0 0 60 59" name="ItemBox"/>
|
||||
|
||||
<Widget type="Widget" position="0 0 8 0"/>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sSoulGem}"/>
|
||||
</Widget>
|
||||
<Widget type="Button" skin="MW_Box" position="0 0 60 59" name="SoulBox"/>
|
||||
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="320 0 300 24">
|
||||
<Property key="Caption" value="#{sEnchantmentMenu3}:"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="280 0 258 24" name="Enchantment">
|
||||
<Property key="Caption" value="1"/>
|
||||
<Property key="TextAlign" value="Right HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="320 24 300 24">
|
||||
<Property key="Caption" value="#{sCastCost}:"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="280 24 258 24" name="CastCost">
|
||||
<Property key="Caption" value="39"/>
|
||||
<Property key="TextAlign" value="Right HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="320 48 300 24">
|
||||
<Property key="Caption" value="#{sCharges}"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="280 48 258 24" name="Charge">
|
||||
<Property key="Caption" value="39"/>
|
||||
<Property key="TextAlign" value="Right HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<!-- Available effects -->
|
||||
<Widget type="TextBox" skin="NormalText" position="12 148 300 24">
|
||||
<Property key="Caption" value="#{sMagicEffects}"/>
|
||||
</Widget>
|
||||
<Widget type="MWList" skin="MW_SimpleList" position="12 176 202 169" name="AvailableEffects">
|
||||
</Widget>
|
||||
|
||||
<!-- Used effects -->
|
||||
<Widget type="TextBox" skin="NormalText" position="226 148 300 24">
|
||||
<Property key="Caption" value="#{sEffects}"/>
|
||||
</Widget>
|
||||
<Widget type="Widget" skin="MW_Box" position="226 176 316 169">
|
||||
<Widget type="ScrollView" skin="MW_ScrollViewH" position="4 4 308 161" name="UsedEffects">
|
||||
<Property key="CanvasAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<Widget type="HBox" position="0 340 560 60">
|
||||
<Property key="Padding" value="16"/>
|
||||
|
||||
<Widget type="Widget" position="0 0 0 0">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sBarterDialog7}"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" name="PriceLabel">
|
||||
<Property key="Caption" value="30"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="BuyButton">
|
||||
<Property key="Caption" value="#{sBuy}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
|
||||
<Property key="Caption" value="#{sCancel}"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
@ -0,0 +1,81 @@
|
||||
<?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 type="HBox" position="12 12 250 30">
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sName}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="EditBox" skin="MW_TextEdit" position="0 0 30 30" name="NameEdit">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="Widget">
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="280 0 300 24">
|
||||
<Property key="Caption" value="#{sEnchantmentMenu4}"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="280 0 258 24" name="MagickaCost">
|
||||
<Property key="Caption" value="1"/>
|
||||
<Property key="TextAlign" value="Right HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="280 24 300 24">
|
||||
<Property key="Caption" value="#{sSpellmakingMenu1}"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="280 24 258 24" name="SuccessChance">
|
||||
<Property key="Caption" value="39"/>
|
||||
<Property key="TextAlign" value="Right HCenter"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<!-- Available effects -->
|
||||
<Widget type="TextBox" skin="NormalText" position="12 48 300 24">
|
||||
<Property key="Caption" value="#{sMagicEffects}"/>
|
||||
</Widget>
|
||||
<Widget type="MWList" skin="MW_SimpleList" position="12 76 202 269" name="AvailableEffects">
|
||||
</Widget>
|
||||
|
||||
<!-- Used effects -->
|
||||
<Widget type="TextBox" skin="NormalText" position="226 48 300 24">
|
||||
<Property key="Caption" value="#{sEffects}"/>
|
||||
</Widget>
|
||||
<Widget type="Widget" skin="MW_Box" position="226 76 316 269">
|
||||
<Widget type="ScrollView" skin="MW_ScrollViewH" position="4 4 308 261" name="UsedEffects">
|
||||
<Property key="CanvasAlign" value="Left Top"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<Widget type="HBox" position="0 340 560 60">
|
||||
<Property key="Padding" value="16"/>
|
||||
|
||||
<Widget type="Widget" position="0 0 0 0">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||
<Property key="Caption" value="#{sBarterDialog7}"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" name="PriceLabel">
|
||||
<Property key="Caption" value="30"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="BuyButton">
|
||||
<Property key="Caption" value="#{sBuy}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
|
||||
<Property key="Caption" value="#{sCancel}"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 319 200" name="_Main">
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="0 5 319 24" name="Select" align="Right Top">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="#{sServiceTrainingTitle}"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="5 30 319 24" name="Travel" align="Right Top">
|
||||
<Property key="TextAlign" value="Left"/>
|
||||
<Property key="Caption" value="#{sTrainingServiceTitle}"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="Widget" skin="MW_Box" position="6 54 299 100" align="Left Top" name="TrainingOptions">
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="8 161 200 24" name="PlayerGold" align="Right Top">
|
||||
<Property key="TextAlign" value="Left"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="244 161 60 24" name="CancelButton" align="Right Top">
|
||||
<Property key="ExpandDirection" value="Left"/>
|
||||
<Property key="Caption" value="#{sCancel}"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
</MyGUI>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 450 300" name="_Main">
|
||||
<Property key="Visible" value="false"/>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="8 10 24 24" name="Select" align="Right Top">
|
||||
<Property key="TextAlign" value="Right"/>
|
||||
<Property key="Caption" value="#{sTravelServiceTitle}"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="SandText" position="0 0 24 24" name="Travel" align="Right Top">
|
||||
<Property key="TextAlign" value="Right"/>
|
||||
<Property key="Caption" value="#D8C09A#{sTravel}"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="Widget" skin="MW_Box" position="6 31 430 225" align="ALIGN_LEFT ALIGN_STRETCH">
|
||||
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 422 217" align="ALIGN_LEFT ALIGN_TOP ALIGN_STRETCH" name="DestinationsView">
|
||||
<Property key="CanvasAlign" value="Left"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="8 255 24 24" name="PlayerGold" align="Right Top">
|
||||
<Property key="TextAlign" value="Right"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="375 260 60 24" name="CancelButton" align="Right Top">
|
||||
<Property key="ExpandDirection" value="Left"/>
|
||||
<Property key="Caption" value="#{sOK}"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
</MyGUI>
|
Loading…
Reference in New Issue