Пример #1
0
/* ScriptEditorPanel::saveScripts
 * Saves the current content of the text editor to the scripts entry
 *******************************************************************/
void ScriptEditorPanel::saveScripts()
{
	// Write text to entry
	wxCharBuffer buf = text_editor->GetText().mb_str();
	entry_script->importMem(buf, buf.length());

	// Process ACS open scripts
	string lang = theGameConfiguration->scriptLanguage();
	if (entry_script->getSize() > 0 && (lang == "acs_hexen" || lang == "acs_zdoom"))
	{
		SLADEMap* map = &(theMapEditor->mapEditor().getMap());
		map->mapSpecials()->processACSScripts(entry_script);
		map->mapSpecials()->updateTaggedSectors(map);
	}
}
Пример #2
0
/* ScriptEditorPanel::saveScripts
 * Saves the current content of the text editor to the scripts entry
 *******************************************************************/
void ScriptEditorPanel::saveScripts()
{
	// Trim whitespace
	if (txed_trim_whitespace)
		text_editor->trimWhitespace();

	// Write text to entry
	wxCharBuffer buf = text_editor->GetText().mb_str();
	entry_script->importMem(buf, buf.length());

	// Process ACS open scripts
	string lang = Game::configuration().scriptLanguage();
	if (entry_script->getSize() > 0 && (lang == "acs_hexen" || lang == "acs_zdoom"))
	{
		SLADEMap* map = &(MapEditor::editContext().map());
		map->mapSpecials()->processACSScripts(entry_script);
		map->mapSpecials()->updateTaggedSectors(map);
	}
}
Пример #3
0
/* ScriptEditorPanel::openScripts
 * Opens script text from entry [scripts], and compiled script data
 * from [compiled]
 *******************************************************************/
bool ScriptEditorPanel::openScripts(ArchiveEntry* script, ArchiveEntry* compiled)
{
	// Clear current script data
	entry_script->clearData();
	entry_compiled->clearData();

	// Import script data
	if (script) entry_script->importEntry(script);
	if (compiled) entry_compiled->importEntry(compiled);

	// Process ACS open scripts
	string lang = theGameConfiguration->scriptLanguage();
	if (entry_script->getSize() > 0 && (lang == "acs_hexen" || lang == "acs_zdoom"))
	{
		SLADEMap* map = &(theMapEditor->mapEditor().getMap());
		map->mapSpecials()->processACSScripts(entry_script);
		map->mapSpecials()->updateTaggedSectors(map);
	}

	// Load script text
	return text_editor->loadEntry(entry_script);
}