wxString MOPGActionSpecialProperty::ValueToString(wxVariant &value, int argFlags) const { // Get value as integer int special = value.GetInteger(); if (special == 0) return "0: None"; else { ActionSpecial* as = theGameConfiguration->actionSpecial(special); return S_FMT("%d: %s", special, CHR(as->getName())); } }
void doCheck() { for (unsigned a = 0; a < map->nLines(); a++) { // Get special and tag int special = map->getLine(a)->intProperty("special"); int tag = map->getLine(a)->intProperty("arg0"); // Get action special ActionSpecial* as = theGameConfiguration->actionSpecial(special); int tagged = as->needsTag(); // Check if tag is required but not set if (tagged != AS_TT_NO && tagged != AS_TT_SECTOR_BACK && tagged != AS_TT_SECTOR_OR_BACK && tag == 0) lines.push_back(map->getLine(a)); } }
void MOPGActionSpecialProperty::openObjects(vector<MapObject*>& objects) { // Reset arg property names for (unsigned a = 0; a < 5; a++) { if (args[a]) { args[a]->SetLabel(S_FMT("Arg%d", a+1)); args[a]->SetHelpString(""); } } // Set unspecified if no objects given if (objects.size() == 0) { SetValueToUnspecified(); return; } // Get property of first object int first = objects[0]->intProperty(GetName()); // Check whether all objects share the same value for (unsigned a = 1; a < objects.size(); a++) { if (objects[a]->intProperty(GetName()) != first) { // Different value found, set unspecified SetValueToUnspecified(); return; } } // Set to common value noupdate = true; if (!parent->showAll() && udmf_prop && !udmf_prop->showAlways() && udmf_prop->getDefaultValue().getIntValue() == first) Hide(true); else Hide(false); SetValue(first); noupdate = false; // Set arg property names ActionSpecial* as = theGameConfiguration->actionSpecial(first); for (unsigned a = 0; a < 5; a++) { if (!args[a]) continue; args[a]->SetLabel(as->getArg(a).name); args[a]->SetHelpString(as->getArg(a).desc); } }
string problemDesc(unsigned index) { if (index >= lines.size()) return "No missing special tags found"; int special = lines[index]->getSpecial(); ActionSpecial* as = theGameConfiguration->actionSpecial(special); return S_FMT("Line %d: Special %d (%s) requires a tag", lines[index]->getIndex(), special, as->getName()); }
/* MOPGActionSpecialProperty::getArgspec * Returns a little object describing the args for this thing type *******************************************************************/ const argspec_t MOPGActionSpecialProperty::getArgspec() { int special = m_value.GetInteger(); ActionSpecial* as = theGameConfiguration->actionSpecial(special); return as->getArgspec(); }