Fix compilation when ENABLE_SCRIPTING is defined

This commit is contained in:
David Capello 2019-05-08 15:53:55 -03:00
parent 7d3e6f2ad3
commit bd18248be9

View File

@ -11,11 +11,14 @@
#include "app/commands/new_params.h"
#include "app/doc_exporter.h"
#include "app/script/luacpp.h"
#include "app/sprite_sheet_type.h"
#include "base/convert_to.h"
#include "base/string.h"
#ifdef ENABLE_SCRIPTING
#include "app/script/luacpp.h"
#endif
namespace app {
template<>
@ -106,19 +109,6 @@ void Param<app::DocExporter::DataFormat>::fromLua(lua_State* L, int index)
setValue((app::DocExporter::DataFormat)lua_tointeger(L, index));
}
void CommandWithNewParamsBase::onLoadParams(const Params& params)
{
if (m_skipLoadParams) {
m_skipLoadParams = false;
return;
}
onResetValues();
for (const auto& pair : params) {
if (ParamBase* p = onGetParam(pair.first))
p->fromString(pair.second);
}
}
void CommandWithNewParamsBase::loadParamsFromLuaTable(lua_State* L, int index)
{
onResetValues();
@ -137,4 +127,19 @@ void CommandWithNewParamsBase::loadParamsFromLuaTable(lua_State* L, int index)
#endif
void CommandWithNewParamsBase::onLoadParams(const Params& params)
{
#ifdef ENABLE_SCRIPTING
if (m_skipLoadParams) {
m_skipLoadParams = false;
return;
}
#endif
onResetValues();
for (const auto& pair : params) {
if (ParamBase* p = onGetParam(pair.first))
p->fromString(pair.second);
}
}
} // namespace app