void MOPGThingTypeProperty::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 ThingType* tt = theGameConfiguration->thingType(first); for (unsigned a = 0; a < 5; a++) { if (!args[a]) continue; args[a]->SetLabel(tt->getArg(a).name); args[a]->SetHelpString(tt->getArg(a).desc); } }