mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-05-21 05:40:35 +00:00
17e6da40f8
1. Follows advice from https://sol2.readthedocs.io/en/latest/functions.html to use `set_function` when binding functions. 2. Adds autocomplete support for userdata methods. 3. Simplifies property bindings and improves string handling.
42 lines
914 B
C++
42 lines
914 B
C++
#ifdef _DEBUG
|
|
#include "lua/modules/dev/level/map.hpp"
|
|
|
|
#include <string>
|
|
|
|
#include <sol/sol.hpp>
|
|
|
|
#include "automap.h"
|
|
#include "lua/metadoc.hpp"
|
|
|
|
namespace devilution {
|
|
namespace {
|
|
|
|
std::string DebugCmdMapReveal()
|
|
{
|
|
for (int x = 0; x < DMAXX; x++)
|
|
for (int y = 0; y < DMAXY; y++)
|
|
UpdateAutomapExplorer({ x, y }, MAP_EXP_SHRINE);
|
|
return "Automap fully explored.";
|
|
}
|
|
|
|
std::string DebugCmdMapHide()
|
|
{
|
|
for (int x = 0; x < DMAXX; x++)
|
|
for (int y = 0; y < DMAXY; y++)
|
|
AutomapView[x][y] = MAP_EXP_NONE;
|
|
return "Automap exploration removed.";
|
|
}
|
|
|
|
} // namespace
|
|
|
|
sol::table LuaDevLevelMapModule(sol::state_view &lua)
|
|
{
|
|
sol::table table = lua.create_table();
|
|
LuaSetDocFn(table, "hide", "()", "Hide the map.", &DebugCmdMapHide);
|
|
LuaSetDocFn(table, "reveal", "()", "Reveal the map.", &DebugCmdMapReveal);
|
|
return table;
|
|
}
|
|
|
|
} // namespace devilution
|
|
#endif // _DEBUG
|