예제 #1
0
/* ThingPropsPanel::onSpriteClicked
 * Called when the thing type sprite canvas is clicked
 *******************************************************************/
void ThingPropsPanel::onSpriteClicked(wxMouseEvent& e)
{
	ThingTypeBrowser browser(this, type_current);
	if (browser.ShowModal() == wxID_OK)
	{
		// Get selected type
		type_current = browser.getSelectedType();
		ThingType* tt = theGameConfiguration->thingType(type_current);

		// Update sprite
		gfx_sprite->setSprite(tt);
		label_type->SetLabel(tt->getName());

		// Update args
		if (panel_args)
		{
			argspec_t as = tt->getArgspec();
			panel_args->setup(&as, (theMapEditor->currentMapDesc().format == MAP_UDMF));
		}

		// Update layout
		Layout();
		Refresh();
	}
}
예제 #2
0
/* MOPGThingTypeProperty::getArgspec
 * Returns a little object describing the args for this thing type
 *******************************************************************/
const argspec_t MOPGThingTypeProperty::getArgspec()
{
	int type = m_value.GetInteger();
	ThingType* tt = theGameConfiguration->thingType(type);
	return tt->getArgspec();
}