Exemplo n.º 1
0
void MOPGSPACTriggerProperty::openObjects(vector<MapObject*>& objects) {
	// Set unspecified if no objects given
	if (objects.size() == 0) {
		SetValueToUnspecified();
		return;
	}

	// Get property of first object
	int map_format = theMapEditor->currentMapDesc().format;
	string first = theGameConfiguration->spacTriggerString((MapLine*)objects[0], map_format);

	// Check whether all objects share the same value
	for (unsigned a = 1; a < objects.size(); a++) {
		if (theGameConfiguration->spacTriggerString((MapLine*)objects[a], map_format) != 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;
}
Exemplo n.º 2
0
void MOPGSectorSpecialProperty::openObjects(vector<MapObject*>& objects) {
	// 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;
}
Exemplo n.º 3
0
void MOPGColourProperty::openObjects(vector<MapObject*>& objects) {
	// 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;
	wxColor col(first);
	col.Set(col.Blue(), col.Green(), col.Red());
	wxVariant var_value;
	var_value << col;
	SetValue(var_value);
	noupdate = false;
}
Exemplo n.º 4
0
void MOPGThingFlagProperty::openObjects(vector<MapObject*>& objects) {
	// Set unspecified if no objects given
	if (objects.size() == 0) {
		SetValueToUnspecified();
		return;
	}

	// Check flag against first object
	bool first = theGameConfiguration->thingFlagSet(index, (MapThing*)objects[0]);

	// Check whether all objects share the same flag setting
	for (unsigned a = 1; a < objects.size(); a++) {
		if (theGameConfiguration->thingFlagSet(index, (MapThing*)objects[a]) != 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().getBoolValue() == first)
		Hide(true);
	else
		Hide(false);
	SetValue(first);
	noupdate = false;
}
Exemplo n.º 5
0
/* MOPGAngleProperty::openObjects
 * Reads the value of this angle property from [objects]
 * (if the value differs between objects, it is set to unspecified)
 *******************************************************************/
void MOPGAngleProperty::openObjects(vector<MapObject*>& objects)
{
	// 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;
	SetValue(first);
	updateVisibility();
	noupdate = false;
}
Exemplo n.º 6
0
/* MOPGThingFlagProperty::openObjects
 * Reads the value of this thing flag property from [objects]
 * (if the value differs between objects, it is set to unspecified)
 *******************************************************************/
void MOPGThingFlagProperty::openObjects(vector<MapObject*>& objects)
{
	// Set unspecified if no objects given
	if (objects.size() == 0)
	{
		SetValueToUnspecified();
		return;
	}

	// Check flag against first object
	bool first = theGameConfiguration->thingFlagSet(index, (MapThing*)objects[0]);

	// Check whether all objects share the same flag setting
	for (unsigned a = 1; a < objects.size(); a++)
	{
		if (theGameConfiguration->thingFlagSet(index, (MapThing*)objects[a]) != first)
		{
			// Different value found, set unspecified
			SetValueToUnspecified();
			return;
		}
	}

	// Set to common value
	noupdate = true;
	SetValue(first);
	updateVisibility();
	noupdate = false;
}
Exemplo n.º 7
0
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);
	}
}