summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorxemplum <morxemplum+github@gmail.com>2020-08-10 01:55:49 -0700
committerMorxemplum <morxemplum+github@gmail.com>2020-08-10 01:55:49 -0700
commitb52022f73d22ebba06b35271493e44ad965a81d2 (patch)
tree8526692e9bdedc777b1daa8f6904604af438b025
parent51083f55e76208b519bc958f851ddd5cdb663386 (diff)
Add Lua function that grabs the current version of Open Hexagonadd_getVersion
-rw-r--r--src/SSVOpenHexagon/Core/HGScripting.cpp6
-rw-r--r--src/SSVOpenHexagon/Core/MenuGame.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/SSVOpenHexagon/Core/HGScripting.cpp b/src/SSVOpenHexagon/Core/HGScripting.cpp
index 04d86bcb..09daf087 100644
--- a/src/SSVOpenHexagon/Core/HGScripting.cpp
+++ b/src/SSVOpenHexagon/Core/HGScripting.cpp
@@ -223,6 +223,12 @@ void HexagonGame::initLua_Utils()
.doc(
"Force-swaps (180 degrees) the player when invoked. If `$0` is "
"`true`, the swap sound will be played.");
+
+ addLuaFn("u_getVersion", //
+ [this] { return Config::getVersion(); })
+ .doc(
+ "Gets the current version of the game. Useful for executing code "
+ "that would only work in a beta branch.");
}
void HexagonGame::initLua_Messages()
diff --git a/src/SSVOpenHexagon/Core/MenuGame.cpp b/src/SSVOpenHexagon/Core/MenuGame.cpp
index 481ae22d..5d43e01a 100644
--- a/src/SSVOpenHexagon/Core/MenuGame.cpp
+++ b/src/SSVOpenHexagon/Core/MenuGame.cpp
@@ -712,7 +712,7 @@ void MenuGame::initLua(Lua::LuaContext& mLua)
"u_isFastSpinning", "u_setPlayerAngle", "u_forceIncrement",
"u_kill", "u_eventKill", "u_haltTime", "u_timelineWait",
"u_clearWalls", "u_setMusic", "u_setMusicSegment",
- "u_setMusicSeconds",
+ "u_setMusicSeconds", "u_getVersion",
"m_messageAdd", "m_messageAddImportant",
"m_messageAddImportantSilent", "m_clearMessages",