feat: adapt GMLIB 0.8.4

This commit is contained in:
Tsubasa6848
2024-02-21 23:52:24 +08:00
Unverified
parent e8d0052e51
commit b2737599c8
4 changed files with 360 additions and 6 deletions
+9 -5
View File
@@ -36,14 +36,18 @@ void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "getExperimentTranslatedName", [](int id) -> std::string {
auto map = GMLIB_Level::getAllExperimentsTranslateKeys();
if (map.count(id)) {
return map[id];
return std::string(map[id]);
}
return "";
});
RemoteCall::exportAs("GMLIB_API", "createFloatingText", [](std::pair<Vec3, int> pos, std::string text) -> int {
auto ft = new GMLIB::Server::FloatingText(text, pos.first, pos.second);
return ft->getRuntimeID();
});
RemoteCall::exportAs(
"GMLIB_API",
"createFloatingText",
[](std::pair<Vec3, int> pos, std::string text, bool papi) -> int {
auto ft = new GMLIB::Server::FloatingText(text, pos.first, pos.second, papi);
return ft->getRuntimeID();
}
);
RemoteCall::exportAs("GMLIB_API", "setFloatingTextData", [](int id, std::string text) -> bool {
auto ft = GMLIB::Server::FloatingText::getFloatingText(id);
if (ft) {