Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | writer.SaveMap(pathname, | ||||
g_Renderer.GetWaterManager(), g_Renderer.GetSkyManager(), | g_Renderer.GetWaterManager(), g_Renderer.GetSkyManager(), | ||||
&g_LightEnv, g_Game->GetView()->GetCamera(), g_Game->GetView()->GetCinema(), | &g_LightEnv, g_Game->GetView()->GetCamera(), g_Game->GetView()->GetCinema(), | ||||
&g_Renderer.GetPostprocManager(), | &g_Renderer.GetPostprocManager(), | ||||
g_Game->GetSimulation2()); | g_Game->GetSimulation2()); | ||||
} | } | ||||
QUERYHANDLER(GetMapSettings) | QUERYHANDLER(GetMapSettings) | ||||
{ | { | ||||
msg->settings = g_Game->GetSimulation2()->GetMapSettingsString(); | msg->settings = g_Game->GetSimulation2()->GetSettingsFromInitAttributes(); | ||||
} | } | ||||
BEGIN_COMMAND(SetMapSettings) | BEGIN_COMMAND(SetMapSettings) | ||||
{ | { | ||||
std::string m_OldSettings, m_NewSettings; | std::string m_OldSettings, m_NewSettings; | ||||
void SetSettings(const std::string& settings) | void SetSettings(const std::string& settings) | ||||
{ | { | ||||
g_Game->GetSimulation2()->SetMapSettings(settings); | g_Game->GetSimulation2()->SetInitAttributesFromSettings(settings); | ||||
} | } | ||||
void Do() | void Do() | ||||
{ | { | ||||
m_OldSettings = g_Game->GetSimulation2()->GetMapSettingsString(); | m_OldSettings = g_Game->GetSimulation2()->GetSettingsFromInitAttributes(); | ||||
m_NewSettings = *msg->settings; | m_NewSettings = *msg->settings; | ||||
SetSettings(m_NewSettings); | SetSettings(m_NewSettings); | ||||
} | } | ||||
// TODO: we need some way to notify the Atlas UI when the settings are changed | // TODO: we need some way to notify the Atlas UI when the settings are changed | ||||
// externally, otherwise this will have no visible effect | // externally, otherwise this will have no visible effect | ||||
void Undo() | void Undo() | ||||
{ | { | ||||
// SetSettings(m_OldSettings); | // SetSettings(m_OldSettings); | ||||
} | } | ||||
void Redo() | void Redo() | ||||
{ | { | ||||
// SetSettings(m_NewSettings); | // SetSettings(m_NewSettings); | ||||
} | } | ||||
void MergeIntoPrevious(cSetMapSettings* prev) | void MergeIntoPrevious(cSetMapSettings* prev) | ||||
{ | { | ||||
prev->m_NewSettings = m_NewSettings; | prev->m_NewSettings = m_NewSettings; | ||||
} | } | ||||
}; | }; | ||||
END_COMMAND(SetMapSettings) | END_COMMAND(SetMapSettings) | ||||
MESSAGEHANDLER(LoadPlayerSettings) | MESSAGEHANDLER(ParsePlayerSettings) | ||||
{ | { | ||||
g_Game->GetSimulation2()->LoadPlayerSettings(msg->newplayers); | g_Game->GetSimulation2()->ParsePlayerSettings(msg->newplayers); | ||||
} | } | ||||
QUERYHANDLER(GetMapSizes) | QUERYHANDLER(GetMapSizes) | ||||
{ | { | ||||
msg->sizes = g_Game->GetSimulation2()->GetMapSizes(); | msg->sizes = g_Game->GetSimulation2()->GetMapSizes(); | ||||
} | } | ||||
QUERYHANDLER(RasterizeMinimap) | QUERYHANDLER(RasterizeMinimap) | ||||
▲ Show 20 Lines • Show All 357 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator