@@ -55,6 +55,9 @@ void LabelNode::update(float dt)
55
55
return this ->setString (fmt::format (" Error Compiling Script: {}" , res.getMessage ()).c_str ());
56
56
}
57
57
58
+ if (!GJBaseGameLayer::get ())
59
+ return ;
60
+
58
61
std::chrono::milliseconds duration (static_cast <long long >(ColourUtility::totalSessionTime * 1000 ));
59
62
60
63
auto hours = std::chrono::duration_cast<std::chrono::hours>(duration);
@@ -91,10 +94,30 @@ void LabelNode::update(float dt)
91
94
script->setVariable (" noclip_deaths" , rift::Value::integer (as<NoclipBaseGameLayer*>(GJBaseGameLayer::get ())->getNoclipDeaths ()));
92
95
script->setVariable (" noclip_accuracy" , rift::Value::floating (as<NoclipBaseGameLayer*>(GJBaseGameLayer::get ())->getNoclipAccuracy () * 100 ));
93
96
97
+ if (auto lvl = GJBaseGameLayer::get ()->m_level )
98
+ {
99
+ script->setVariable (" level_name" , rift::Value::string (lvl->m_levelName ));
100
+ script->setVariable (" level_creator" , rift::Value::string (lvl->m_creatorName ));
101
+ script->setVariable (" level_description" , rift::Value::string (lvl->getUnpackedLevelDescription ()));
102
+ script->setVariable (" level_upload" , rift::Value::string (lvl->m_uploadDate ));
103
+ script->setVariable (" level_update" , rift::Value::string (lvl->m_updateDate ));
104
+ script->setVariable (" level_likes" , rift::Value::integer (lvl->m_likes ));
105
+ script->setVariable (" level_downloads" , rift::Value::integer (lvl->m_downloads ));
106
+ script->setVariable (" level_id" , rift::Value::integer (lvl->m_levelID .value ()));
107
+ script->setVariable (" level_verified" , rift::Value::boolean (lvl->m_isVerifiedRaw ));
108
+ script->setVariable (" level_object_count" , rift::Value::integer (lvl->m_objectCount .value ()));
109
+ script->setVariable (" level_version" , rift::Value::integer (lvl->m_levelVersion ));
110
+ script->setVariable (" level_game_version" , rift::Value::integer (lvl->m_gameVersion ));
111
+
112
+ script->setVariable (" normal_best" , rift::Value::integer (GJBaseGameLayer::get ()->m_level ->m_normalPercent .value ()));
113
+ script->setVariable (" practice_best" , rift::Value::integer (GJBaseGameLayer::get ()->m_level ->m_practicePercent ));
114
+ }
115
+
94
116
if (PlayLayer::get ())
95
117
{
96
118
script->setVariable (" bestRun_from" , rift::Value::floating (as<BestPlayLayer*>(PlayLayer::get ())->m_fields ->bestFrom ));
97
119
script->setVariable (" bestRun_to" , rift::Value::floating (as<BestPlayLayer*>(PlayLayer::get ())->m_fields ->bestTo ));
120
+ script->setVariable (" percentage" , rift::Value::floating (PlayLayer::get ()->getCurrentPercent ()));
98
121
}
99
122
100
123
auto res2 = script->run ();
0 commit comments