Ejemplo n.º 1
0
// This is called from main() to start up the Radiant stuff.
void Radiant_Initialise (void)
{
	// Load the ColourSchemes from the registry
	ColourSchemes().loadColourSchemes();

	// Load the other modules
	Radiant_Construct(GlobalRadiantModuleServer());

	g_VFSModuleObserver.realise();
	GlobalTextureBrowser().createWidget();

	// Rebuild the map path basing on the userGamePath
	std::string newMapPath = GlobalRadiant().getFullGamePath() + "maps/";
	g_mkdir_with_parents(newMapPath.c_str(), 0755);
	Environment::Instance().setMapsPath(newMapPath);

	g_gameToolsPathObservers.realise();
	g_gameModeObservers.realise();

	GlobalUMPSystem().init();

	// Construct the MRU commands and menu structure
	GlobalMRU().constructMenu();

	// Initialise the most recently used files list
	GlobalMRU().loadRecentFiles();

	gtkutil::MultiMonitor::printMonitorInfo();
}
Ejemplo n.º 2
0
const std::string MaterialSystem::getMaterialFilename () const
{
	const std::string& mapname = GlobalMap().getName();
	const std::string umpname = GlobalUMPSystem().getUMPFilename(mapname);
	std::string materialFilename;
	if (umpname.empty())
		materialFilename = os::getFilenameFromPath(mapname);
	else
		materialFilename = os::getFilenameFromPath(umpname);
	std::string relativePath = "materials/" + os::stripExtension(materialFilename) + ".mat";
	return relativePath;
}
Ejemplo n.º 3
0
/**
 * Method recreates rma tile menu adding entries for all tiles in current rma if available
 */
void UMPMenu::addItems()
{
	IMenuManager* menuManager = GlobalUIManager().getMenuManager();
	menuManager->remove(MENU_PATH);

	std::string umpFilename = GlobalUMPSystem().getUMPFilename(GlobalMap().getName());
	if (umpFilename.empty())
		return;
	map::ump::UMPFile file = map::ump::UMPFile(umpFilename);
	if (!file.load())
		return;

	// Create the sub menu item in the map menu
	menuManager->add(MENU_MAP_PATH, MENU_UMP_NAME, ui::menuFolder, _("RMA tiles"), MENU_ICON, "");

	UMPTileToMenuItemVisitor visitor(file);
	file.forEachTile(visitor);
}