starting with stairways, show more info in edit special list
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include "skills_traits.hpp"
|
#include "skills_traits.hpp"
|
||||||
#include "damage.hpp"
|
#include "damage.hpp"
|
||||||
#include "fields.hpp"
|
#include "fields.hpp"
|
||||||
|
#include "scenario.hpp"
|
||||||
|
|
||||||
bool cTimer::is_valid() const {
|
bool cTimer::is_valid() const {
|
||||||
if(time < 0) return false;
|
if(time < 0) return false;
|
||||||
@@ -529,6 +530,22 @@ void cSpecial::import_legacy(legacy::special_node_type& old){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In the editor node list, be as helpful as possible about what the specific node instance does
|
||||||
|
std::string cSpecial::editor_hint(const cScenario& scenario) const {
|
||||||
|
std::string hint = (*type).name();
|
||||||
|
|
||||||
|
switch(type){
|
||||||
|
case eSpecType::TOWN_STAIR:
|
||||||
|
case eSpecType::TOWN_GENERIC_STAIR:
|
||||||
|
hint += " to ";
|
||||||
|
if(ex2a < scenario.towns.size()) hint += scenario.towns[ex2a]->loc_str(loc(ex1a, ex1b));
|
||||||
|
else hint += "INVALID TOWN";
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return hint;
|
||||||
|
}
|
||||||
|
|
||||||
static eSpecCat getNodeCategory(eSpecType node) {
|
static eSpecCat getNodeCategory(eSpecType node) {
|
||||||
for(int i = 0; i <= int(eSpecCat::OUTDOOR); i++) {
|
for(int i = 0; i <= int(eSpecCat::OUTDOOR); i++) {
|
||||||
eSpecCat cat = eSpecCat(i);
|
eSpecCat cat = eSpecCat(i);
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
#include "dialogxml/widgets/pictypes.hpp"
|
#include "dialogxml/widgets/pictypes.hpp"
|
||||||
|
|
||||||
namespace legacy { struct special_node_type; };
|
namespace legacy { struct special_node_type; };
|
||||||
|
class cScenario;
|
||||||
|
|
||||||
static const short SDF_COMPLETE = 250;
|
static const short SDF_COMPLETE = 250;
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool operator!=(const cSpecial& other) const { return !(*this == other); }
|
bool operator!=(const cSpecial& other) const { return !(*this == other); }
|
||||||
|
std::string editor_hint(const cScenario& scenario) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class eSpecCtxType {
|
enum class eSpecCtxType {
|
||||||
|
@@ -535,15 +535,15 @@ static void apply_mode_buttons() {
|
|||||||
std::ostringstream strb;
|
std::ostringstream strb;
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case 0:
|
case 0:
|
||||||
strb << i << " - " << (*scenario.scen_specials[i].type).name();
|
strb << i << " - " << scenario.scen_specials[i].editor_hint(scenario);
|
||||||
set_rb(i,RB_SCEN_SPEC, i, strb.str());
|
set_rb(i,RB_SCEN_SPEC, i, strb.str());
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
strb << i << " - " << (*current_terrain->specials[i].type).name();
|
strb << i << " - " << current_terrain->specials[i].editor_hint(scenario);
|
||||||
set_rb(i,RB_OUT_SPEC, i, strb.str());
|
set_rb(i,RB_OUT_SPEC, i, strb.str());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
strb << i << " - " << (*town->specials[i].type).name();
|
strb << i << " - " << town->specials[i].editor_hint(scenario);
|
||||||
set_rb(i,RB_TOWN_SPEC, i, strb.str());
|
set_rb(i,RB_TOWN_SPEC, i, strb.str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user