add united support
This commit is contained in:
parent
8df72e69d4
commit
14378c4b86
@ -6,31 +6,45 @@ int author_time;
|
|||||||
void Main() {}
|
void Main() {}
|
||||||
|
|
||||||
void validate(int author_time) {
|
void validate(int author_time) {
|
||||||
|
#if UNITED
|
||||||
|
CTrackManiaEditor@ editor = cast<CTrackManiaEditor>(cast<CTrackMania>(GetApp()).Editor);
|
||||||
|
#else
|
||||||
CGameCtnEditorFree@ editor = cast<CGameCtnEditorFree>(GetApp().Editor);
|
CGameCtnEditorFree@ editor = cast<CGameCtnEditorFree>(GetApp().Editor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if TMNEXT || MP4
|
#if TMNEXT || MP4
|
||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().RootMap);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().RootMap);
|
||||||
CGameEditorPluginMapMapType@ pluginmaptype = cast<CGameEditorPluginMapMapType>(editor.PluginMapType);
|
CGameEditorPluginMapMapType@ pluginmaptype = cast<CGameEditorPluginMapMapType>(editor.PluginMapType);
|
||||||
#elif TURBO
|
#elif TURBO
|
||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
||||||
CGameCtnEditorPluginMapType@ pluginmaptype = cast<CGameCtnEditorPluginMapType>(editor.EditorMapType);
|
CGameCtnEditorPluginMapType@ pluginmaptype = cast<CGameCtnEditorPluginMapType>(editor.EditorMapType);
|
||||||
|
#elif UNITED
|
||||||
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (editor is null) {
|
if (editor is null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginmaptype !is null) {
|
|
||||||
#if TMNEXT || MP4
|
#if TMNEXT || MP4
|
||||||
pluginmaptype.ValidationStatus = CGameEditorPluginMapMapType::EValidationStatus::Validated;
|
pluginmaptype.ValidationStatus = CGameEditorPluginMapMapType::EValidationStatus::Validated;
|
||||||
#elif TURBO
|
#elif TURBO
|
||||||
pluginmaptype.ValidationStatus = CGameCtnEditorPluginMapType::EValidationStatus::Validated;
|
pluginmaptype.ValidationStatus = CGameCtnEditorPluginMapType::EValidationStatus::Validated;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
|
||||||
if (map !is null) {
|
if (map !is null) {
|
||||||
|
#if UNITED
|
||||||
|
map.ChallengeParameters.AuthorTime = author_time;
|
||||||
|
map.ChallengeParameters.AuthorScore = author_time;
|
||||||
|
map.ChallengeParameters.GoldTime = Math::Floor((1000 + author_time + author_time * 0.06)/1000)*1000;
|
||||||
|
map.ChallengeParameters.SilverTime = Math::Floor((1000 + author_time + author_time * 0.2)/1000)*1000;
|
||||||
|
map.ChallengeParameters.BronzeTime = Math::Floor((1000 + author_time + author_time * 0.5)/1000)*1000;
|
||||||
|
#else
|
||||||
map.TMObjective_AuthorTime = author_time;
|
map.TMObjective_AuthorTime = author_time;
|
||||||
#if MP4 || TURBO
|
#endif
|
||||||
map.IdName = "";
|
|
||||||
|
#if MP4 || TURBO || UNITED
|
||||||
|
map.IdName = ""; // Remove the map UID, the game will generate it again when saving
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,14 +53,16 @@ void Render() {
|
|||||||
if (!menu_visibility) {
|
if (!menu_visibility) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if UNITED
|
||||||
|
CTrackManiaEditor@ editor = cast<CTrackManiaEditor>(cast<CTrackMania>(GetApp()).Editor);
|
||||||
|
#else
|
||||||
CGameCtnEditorFree@ editor = cast<CGameCtnEditorFree>(GetApp().Editor);
|
CGameCtnEditorFree@ editor = cast<CGameCtnEditorFree>(GetApp().Editor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if TMNEXT || MP4
|
#if TMNEXT || MP4
|
||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().RootMap);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().RootMap);
|
||||||
CGameEditorPluginMapMapType@ pluginmaptype = cast<CGameEditorPluginMapMapType>(editor.PluginMapType);
|
#elif TURBO || UNITED
|
||||||
#elif TURBO
|
|
||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
||||||
CGameCtnEditorPluginMapType@ pluginmaptype = cast<CGameCtnEditorPluginMapType>(editor.EditorMapType);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UI::Begin("\\$cf9" + Icons::Flag + "\\$z Map Validator###MapValidator", menu_visibility, UI::WindowFlags::NoResize | UI::WindowFlags::AlwaysAutoResize | UI::WindowFlags::NoCollapse);
|
UI::Begin("\\$cf9" + Icons::Flag + "\\$z Map Validator###MapValidator", menu_visibility, UI::WindowFlags::NoResize | UI::WindowFlags::AlwaysAutoResize | UI::WindowFlags::NoCollapse);
|
||||||
@ -70,6 +86,8 @@ void Render() {
|
|||||||
|
|
||||||
#if TURBO
|
#if TURBO
|
||||||
UI::Text("Note: your map must have a start and a finish\n(or a multilap + 1CP) to be validated with the plugin");
|
UI::Text("Note: your map must have a start and a finish\n(or a multilap + 1CP) to be validated with the plugin");
|
||||||
|
#elif UNITED
|
||||||
|
UI::Text("Note: for an unknown reason, it happens that the times of\nthe medals are not updated, I invite you to check by yourself");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
UI::Text("Open this plugin in the map editor");
|
UI::Text("Open this plugin in the map editor");
|
||||||
|
@ -4,7 +4,7 @@ author = "Beu"
|
|||||||
category = "Map Editor"
|
category = "Map Editor"
|
||||||
|
|
||||||
siteid = 91
|
siteid = 91
|
||||||
version = "1.3"
|
version = "1.5"
|
||||||
|
|
||||||
blocks = [ "Plugin_MapValidator" ]
|
blocks = [ "Plugin_MapValidator" ]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user