Ejemplo n.º 1
0
/* ScriptEditorPanel::handleAction
 * Handles the action [id]. Returns true if the action was handled,
 * false otherwise
 *******************************************************************/
bool ScriptEditorPanel::handleAction(string name)
{
	// Compile Script
	if (name == "mapw_script_compile")
	{
		// Save script
		saveScripts();

		// Compile depending on language
		string lang = Game::configuration().scriptLanguage();
		if (lang == "acs_hexen")
			EntryOperations::compileACS(entry_script, true, entry_compiled, (wxFrame*)MapEditor::windowWx());
		else if (lang == "acs_zdoom")
			EntryOperations::compileACS(entry_script, false, entry_compiled, (wxFrame*)MapEditor::windowWx());
	}

	// Save Script
	else if (name == "mapw_script_save")
		saveScripts();

	// Toggle language list
	else if (name == "mapw_script_togglelanguage")
	{
		list_words->Show(script_show_language_list);
		Layout();
		Refresh();
	}

	// Not handled
	else
		return false;

	return true;
}
Ejemplo n.º 2
0
/* ScriptEditorPanel::handleAction
 * Handles the action [id]. Returns true if the action was handled,
 * false otherwise
 *******************************************************************/
bool ScriptEditorPanel::handleAction(string name)
{
	// Compile Script
	if (name == "mapw_script_compile")
	{
		// Save script
		saveScripts();

		// Compile depending on language
		string lang = theGameConfiguration->scriptLanguage();
		if (lang == "acs_hexen")
			EntryOperations::compileACS(entry_script, true, entry_compiled, theMapEditor);
		else if (lang == "acs_zdoom")
			EntryOperations::compileACS(entry_script, false, entry_compiled, theMapEditor);
	}

	// Save Script
	else if (name == "mapw_script_save")
		saveScripts();

	// Jump To
	else if (name == "mapw_script_jumpto")
		text_editor->openJumpToDialog();

	// Toggle language list
	else if (name == "mapw_script_togglelanguage")
	{
		script_show_language_list = !script_show_language_list;
		list_words->Show(script_show_language_list);
		Layout();
		Refresh();
	}

	// Not handled
	else
		return false;

	return true;
}