Rework MapValidator + add human readable format
This commit is contained in:
		
							
								
								
									
										30
									
								
								MapValidator/Source/Games/MP4.as
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								MapValidator/Source/Games/MP4.as
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| #if MP4 | ||||
| CGameCtnEditorFree@ getEditor() { | ||||
| 	return cast<CGameCtnEditorFree>(GetApp().Editor); | ||||
| } | ||||
|  | ||||
| CGameCtnChallenge@ getMap() { | ||||
| 	return cast<CGameCtnChallenge>(GetApp().RootMap);; | ||||
| } | ||||
|  | ||||
| uint getAuthorTime(CGameCtnChallenge@ _Map) { | ||||
|     return _Map.TMObjective_AuthorTime; | ||||
| } | ||||
|  | ||||
| void setAuthorTime(CGameCtnChallenge@ _Map, uint _AuthorTime) { | ||||
|     _Map.TMObjective_AuthorTime = _AuthorTime; | ||||
|  | ||||
|     // Remove the map UID, the game will generate it again when saving | ||||
|     _Map.IdName = ""; | ||||
| } | ||||
|  | ||||
| void setValidationStatus(CGameCtnEditorFree@ _Editor) { | ||||
|     CGameEditorPluginMapMapType@ pluginmaptype = cast<CGameEditorPluginMapMapType>(_Editor.PluginMapType); | ||||
|     if (pluginmaptype is null) return; | ||||
|     pluginmaptype.ValidationStatus = CGameEditorPluginMapMapType::EValidationStatus::Validated; | ||||
| } | ||||
|  | ||||
| string GetWarning() { | ||||
|     return ""; | ||||
| } | ||||
| #endif | ||||
							
								
								
									
										27
									
								
								MapValidator/Source/Games/TMNEXT.as
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								MapValidator/Source/Games/TMNEXT.as
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| #if TMNEXT | ||||
| CGameCtnEditorFree@ getEditor() { | ||||
| 	return cast<CGameCtnEditorFree>(GetApp().Editor); | ||||
| } | ||||
|  | ||||
| CGameCtnChallenge@ getMap() { | ||||
| 	return cast<CGameCtnChallenge>(GetApp().RootMap);; | ||||
| } | ||||
|  | ||||
| uint getAuthorTime(CGameCtnChallenge@ _Map) { | ||||
|     return _Map.TMObjective_AuthorTime; | ||||
| } | ||||
|  | ||||
| void setAuthorTime(CGameCtnChallenge@ _Map, uint _AuthorTime) { | ||||
|     _Map.TMObjective_AuthorTime = _AuthorTime; | ||||
| } | ||||
|  | ||||
| void setValidationStatus(CGameCtnEditorFree@ _Editor) { | ||||
|     CGameEditorPluginMapMapType@ pluginmaptype = cast<CGameEditorPluginMapMapType>(_Editor.PluginMapType); | ||||
|     if (pluginmaptype is null) return; | ||||
|     pluginmaptype.ValidationStatus = CGameEditorPluginMapMapType::EValidationStatus::Validated; | ||||
| } | ||||
|  | ||||
| string GetWarning() { | ||||
|     return ""; | ||||
| } | ||||
| #endif | ||||
							
								
								
									
										30
									
								
								MapValidator/Source/Games/TURBO.as
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								MapValidator/Source/Games/TURBO.as
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| #if TURBO | ||||
| CGameCtnEditorFree@ getEditor() { | ||||
| 	return cast<CGameCtnEditorFree>(GetApp().Editor); | ||||
| } | ||||
|  | ||||
| CGameCtnChallenge@ getMap() { | ||||
| 	return cast<CGameCtnChallenge>(GetApp().Challenge); | ||||
| } | ||||
|  | ||||
| uint getAuthorTime(CGameCtnChallenge@ _Map) { | ||||
|     return _Map.TMObjective_AuthorTime; | ||||
| } | ||||
|  | ||||
| void setAuthorTime(CGameCtnChallenge@ _Map, uint _AuthorTime) { | ||||
|     _Map.TMObjective_AuthorTime = _AuthorTime; | ||||
|  | ||||
|     // Remove the map UID, the game will generate it again when saving | ||||
|     _Map.IdName = ""; | ||||
| } | ||||
|  | ||||
| void setValidationStatus(CGameCtnEditorFree@ _Editor) { | ||||
| 	CGameCtnEditorPluginMapType@ pluginmaptype = cast<CGameCtnEditorPluginMapType>(_Editor.EditorMapType); | ||||
|     if (pluginmaptype is null) return; | ||||
|     pluginmaptype.ValidationStatus = CGameCtnEditorPluginMapType::EValidationStatus::Validated; | ||||
| } | ||||
|  | ||||
| string GetWarning() { | ||||
|     return "Note: your map must have a start and a finish\n(or a multilap + 1CP) to be validated with the plugin"; | ||||
| } | ||||
| #endif | ||||
							
								
								
									
										32
									
								
								MapValidator/Source/Games/UNITED.as
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								MapValidator/Source/Games/UNITED.as
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| #if UNITED | ||||
| CTrackManiaEditor@ getEditor() { | ||||
| 	return cast<CTrackManiaEditor>(cast<CTrackMania>(GetApp()).Editor); | ||||
| } | ||||
|  | ||||
| CGameCtnChallenge@ getMap() { | ||||
| 	return cast<CGameCtnChallenge>(GetApp().Challenge); | ||||
| } | ||||
|  | ||||
| uint getAuthorTime(CGameCtnChallenge@ _Map) { | ||||
|     return _Map.ChallengeParameters.AuthorTime; | ||||
| } | ||||
|  | ||||
| void setAuthorTime(CGameCtnChallenge@ _Map, uint _AuthorTime) { | ||||
|     _Map.ChallengeParameters.AuthorTime = _AuthorTime; | ||||
|     _Map.ChallengeParameters.AuthorScore = _AuthorTime; | ||||
|     _Map.ChallengeParameters.GoldTime = Math::Floor((1000 + _AuthorTime + _AuthorTime * 0.06)/1000)*1000; | ||||
|     _Map.ChallengeParameters.SilverTime = Math::Floor((1000 + _AuthorTime + _AuthorTime * 0.2)/1000)*1000; | ||||
|     _Map.ChallengeParameters.BronzeTime = Math::Floor((1000 + _AuthorTime + _AuthorTime * 0.5)/1000)*1000; | ||||
|  | ||||
|     // Remove the map UID, the game will generate it again when saving | ||||
|     _Map.IdName = ""; | ||||
| } | ||||
|  | ||||
| void setValidationStatus(CTrackManiaEditor@ _Editor) { | ||||
|     return; // doesn't exists in UNITED | ||||
| } | ||||
|  | ||||
| string GetWarning() { | ||||
|     return "Note: for an unknown reason, it happens that the times of\nthe medals are not updated, I invite you to check by yourself"; | ||||
| } | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user