Several tweaks and fixes

Bugs:
- Arrow keys activated the arrow buttons in the list-mode edit string dialog
- Graphics classification was not saved correctly in some cases
- Contact info was not correctly saved/loaded
- Place Monster node didn't have a choose button for the monster type
- Alt-Backspace and Alt-Delete did not work correctly in dialog text fields
- When clicking Edit Terrain Types, sometimes the list of items or monsters would appear instead
- Fix monster 0 being selectable in the choose monster dialog
- Fix the hotspots of all the cursors to be more intuitive

New:
- When interrupting a special node sequence with Cmd-. / Ctrl-C, the dialog that appears is more relevant.
- In the choose sound dialog, the sound now plays when you select a choice, so you can hear what it will sound like
- Added a tiny icon so you can distinguish fire and force barriers in the editor
This commit is contained in:
2015-06-04 15:43:16 -04:00
parent 49ec6278d3
commit 6c5e2b5118
19 changed files with 95 additions and 52 deletions

View File

@@ -159,7 +159,7 @@ bool load_scenario_v1(fs::path file_to_load, cScenario& scenario){
else if(i == 1 || i == 2)
scenario.who_wrote[i-1] = temp_str;
else if(i == 3)
scenario.contact_info = temp_str;
scenario.contact_info[1] = temp_str;
else if(i >= 4 && i < 10)
scenario.intro_strs[i-4] = temp_str;
else if(i >= 10 && i < 60)
@@ -619,11 +619,8 @@ static void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) {
} else if(type == "language") {
// This is currently unused; there's nowhere to store the value, and it's hardcoded to "en-US" on save
} else if(type == "author") {
// TODO: Store name and email in separate locations
std::string name, email;
elem->FirstChild("name")->GetValue(&name);
elem->FirstChild("email")->GetValue(&email);
scenario.contact_info = name + " " + email;
elem->FirstChildElement("name")->GetText(&scenario.contact_info[0], false);
elem->FirstChildElement("email")->GetText(&scenario.contact_info[1], false);
} else if(type == "text") {
Iterator<Element> info;
int found_teasers = 0, found_intro = 0;
@@ -763,6 +760,7 @@ static void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) {
} else if(type == "last-town") {
edit->GetText(&scenario.last_town_edited);
} else if(type == "graphics") {
static const std::set<int> valid_pictypes = {1,2,3,4,5,7,10,11,12,13,15,16,23,43,63};
if(num_pics > 0)
throw xBadNode(type, edit->Row(), edit->Column(), fname);
Iterator<Element> pic;
@@ -772,6 +770,7 @@ static void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) {
throw xBadNode(type, pic->Row(), pic->Column(), fname);
int i = -1, pictype;
pic->GetText(&pictype);
if(pictype == 0) continue; // As a special case, treat 0 as equivalent to 11 (ie, unclassified)
for(attr = attr.begin(pic.Get()); attr != attr.end(); attr++) {
attr->GetName(&name);
if(name != "index")
@@ -782,6 +781,8 @@ static void readScenarioFromXml(ticpp::Document&& data, cScenario& scenario) {
}
if(i < 0)
throw xMissingAttr(type, "index", pic->Row(), pic->Column(), fname);
if(!valid_pictypes.count(pictype))
throw xBadVal(type, "pic", std::to_string(pictype), pic->Row(), pic->Column(), fname);
scenario.custom_graphics[i] = ePicType(pictype);
num_pics++;
}

View File

@@ -47,13 +47,13 @@ namespace ResMgr {
template<> inline CursorRsrc* resLoader<CursorRsrc>::operator() (std::string fname) {
// TODO: Store the hotspots on disk instead of hardcoded here
static const std::map<std::string,location> cursor_hs = {
{"wand", {1, 4}}, {"eyedropper", {14, 1}}, {"brush", {13, 5}}, {"spraycan", {8, 8}},
{"eraser", {8, 8}}, {"topleft", {8, 8}}, {"bottomright", {8, 8}}, {"hand", {0, 14}},
{"NW", {3, 12}}, {"N", {7, 13}}, {"NE", {3, 12}},
{"W", {3, 9}}, {"wait", {8, 8}}, {"E", {8, 3}},
{"SW", {3, 12}}, {"S", {7, 13}}, {"SE", {3, 12}},
{"sword", {1, 1}}, {"boot", {7, 3}}, {"drop", {0, 14}}, {"target", {8, 8}},
{"talk", {6, 7}}, {"key", {3, 2}}, {"look", {7, 6}}, {"watch", {7,8}},
{"wand", {4, 1}}, {"eyedropper", {1, 14}}, {"brush", {5, 13}}, {"spraycan", {8, 8}},
{"eraser", {8, 8}}, {"topleft", {8, 8}}, {"bottomright", {8, 8}}, {"hand", {14, 0}},
{"NW", {3, 3}}, {"N", {9, 3}}, {"NE", {12, 3}},
{"W", {2, 7}}, {"wait", {8, 8}}, {"E", {14, 7}},
{"SW", {3, 12}}, {"S", {9, 12}}, {"SE", {12, 12}},
{"sword", {1, 1}}, {"boot", {2, 6}}, {"drop", {14, 0}}, {"target", {8, 8}},
{"talk", {2, 13}}, {"key", {3, 2}}, {"look", {7, 6}}, {"watch", {8,8}},
};
fs::path fpath = resPool<CursorRsrc>::rel2abs(fname + ".gif");
fs::path hotpath = resPool<CursorRsrc>::rel2abs(fname + ".hot");