Fix FPS impact bug
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
				
			|||||||
[meta]
 | 
					[meta]
 | 
				
			||||||
name = "TMWT Interfaces Remover"
 | 
					name = "TMWT Interfaces Remover"
 | 
				
			||||||
category = "TMWT"
 | 
					category = "TMWT"
 | 
				
			||||||
version = "1.0"
 | 
					version = "1.1"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,6 +32,7 @@ CGameUILayer@ findUILayer(const MwFastBuffer<CGameUILayer@> _UILayers, string _M
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Main() {
 | 
					void Main() {
 | 
				
			||||||
    while(true) {
 | 
					    while(true) {
 | 
				
			||||||
 | 
					        yield();
 | 
				
			||||||
        auto app = cast<CTrackMania>(GetApp());
 | 
					        auto app = cast<CTrackMania>(GetApp());
 | 
				
			||||||
        auto network = cast<CTrackManiaNetwork>(app.Network);
 | 
					        auto network = cast<CTrackManiaNetwork>(app.Network);
 | 
				
			||||||
        auto serverinfo = cast<CTrackManiaNetworkServerInfo>(network.ServerInfo);
 | 
					        auto serverinfo = cast<CTrackManiaNetworkServerInfo>(network.ServerInfo);
 | 
				
			||||||
@@ -43,6 +44,9 @@ void Main() {
 | 
				
			|||||||
                InterfacesAreHidden = false;
 | 
					                InterfacesAreHidden = false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Prevent to continue the loop when not needed
 | 
				
			||||||
 | 
					            if (!HideInterfaces && !InterfacesAreHidden) continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            CGameManiaAppPlayground@ ManiaApp = cast<CGameManiaAppPlayground>(network.ClientManiaAppPlayground);
 | 
					            CGameManiaAppPlayground@ ManiaApp = cast<CGameManiaAppPlayground>(network.ClientManiaAppPlayground);
 | 
				
			||||||
            if (ManiaApp !is null) {
 | 
					            if (ManiaApp !is null) {
 | 
				
			||||||
                if (UILayer_LiveRanking is null) {
 | 
					                if (UILayer_LiveRanking is null) {
 | 
				
			||||||
@@ -51,6 +55,11 @@ void Main() {
 | 
				
			|||||||
                if (UILayer_TeamsScores is null) {
 | 
					                if (UILayer_TeamsScores is null) {
 | 
				
			||||||
                    @UILayer_TeamsScores = findUILayer(ManiaApp.UILayers, "UIModule_TMWTTeams_Header");
 | 
					                    @UILayer_TeamsScores = findUILayer(ManiaApp.UILayers, "UIModule_TMWTTeams_Header");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                if (UILayer_TeamsScores is null && UILayer_LiveRanking is null) {
 | 
				
			||||||
 | 
					                    UI::ShowNotification("\\$77d" + Icons::User + " \\$fffTMWT Interfaces Remover", "Can't find Interfaces to hide, disabling the plugin");
 | 
				
			||||||
 | 
					                    HideInterfaces = false;
 | 
				
			||||||
 | 
					                    InterfacesAreHidden = false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                if (HideInterfaces && !InterfacesAreHidden && ManiaApp.UI.UISequence == CGamePlaygroundUIConfig::EUISequence::Playing) {
 | 
					                if (HideInterfaces && !InterfacesAreHidden && ManiaApp.UI.UISequence == CGamePlaygroundUIConfig::EUISequence::Playing) {
 | 
				
			||||||
                    if (HideLiveRanking && UILayer_LiveRanking !is null) {
 | 
					                    if (HideLiveRanking && UILayer_LiveRanking !is null) {
 | 
				
			||||||
                        UILayer_LiveRanking.IsVisible = false;
 | 
					                        UILayer_LiveRanking.IsVisible = false;
 | 
				
			||||||
@@ -76,6 +85,6 @@ void Main() {
 | 
				
			|||||||
            @UILayer_LiveRanking = null;
 | 
					            @UILayer_LiveRanking = null;
 | 
				
			||||||
            @UILayer_TeamsScores = null;
 | 
					            @UILayer_TeamsScores = null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        yield();
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user