Compare commits

..

No commits in common. "7111e6219303a8c44f4132ece515c70d10cbf852" and "ef3397eeda3750261c0a124030405662cc47a25f" have entirely different histories.

2 changed files with 6 additions and 24 deletions

View File

@ -72,7 +72,7 @@ void Render() {
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
#endif
if (map is null || editor is null) {
if (map is null && editor is null) {
menu_visibility = false;
return;
}
@ -118,7 +118,7 @@ void RenderMenu() {
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
#endif
if (map is null || editor is null) {
if (map is null && editor is null) {
return;
}

View File

@ -15,22 +15,6 @@ void RenderMenu() {
}
}
bool IsPlaying() {
auto app = cast<CTrackMania>(GetApp());
auto CurrentPlayground = cast<CGamePlayground>(app.CurrentPlayground);
if (CurrentPlayground is null) return false;
if (CurrentPlayground.GameTerminals.Length < 1) return false;
if (CurrentPlayground.GameTerminals[0].ControlledPlayer is null) return false;
if (CurrentPlayground.GameTerminals[0].ControlledPlayer.User is null) return false;
if (CurrentPlayground.GameTerminals[0].GUIPlayer is null) return false;
if (CurrentPlayground.GameTerminals[0].GUIPlayer.User is null) return false;
if (CurrentPlayground.GameTerminals[0].ControlledPlayer.User.Login == CurrentPlayground.GameTerminals[0].GUIPlayer.User.Login) return true;
return false;
}
CGameUILayer@ findUILayer(const MwFastBuffer<CGameUILayer@> _UILayers, string _ManialinkId) {
for (uint i = 0; i < _UILayers.Length; i++) {
string manialink = _UILayers[i].ManialinkPage;
@ -56,8 +40,6 @@ void Main() {
if (network !is null && serverinfo !is null) {
if (Last_ServerLogin != serverinfo.ServerLogin) {
Last_ServerLogin = serverinfo.ServerLogin;
@UILayer_LiveRanking = null;
@UILayer_TeamsScores = null;
HideInterfaces = false;
InterfacesAreHidden = false;
}
@ -68,17 +50,17 @@ void Main() {
CGameManiaAppPlayground@ ManiaApp = cast<CGameManiaAppPlayground>(network.ClientManiaAppPlayground);
if (ManiaApp !is null) {
if (UILayer_LiveRanking is null) {
@UILayer_LiveRanking = findUILayer(ManiaApp.UILayers, "UIModule_TMWTCommon_LiveRanking");
@UILayer_LiveRanking = findUILayer(ManiaApp.UILayers, "UIModule_TMWTTeams_LiveRanking");
}
if (UILayer_TeamsScores is null) {
@UILayer_TeamsScores = findUILayer(ManiaApp.UILayers, "UIModule_TMWTCommon_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 && IsPlaying() ) {
if (HideInterfaces && !InterfacesAreHidden && ManiaApp.UI.UISequence == CGamePlaygroundUIConfig::EUISequence::Playing) {
if (HideLiveRanking && UILayer_LiveRanking !is null) {
UILayer_LiveRanking.IsVisible = false;
}
@ -86,7 +68,7 @@ void Main() {
UILayer_TeamsScores.IsVisible = false;
}
InterfacesAreHidden = true;
} else if (InterfacesAreHidden && (!HideInterfaces || !IsPlaying())) {
} else if (InterfacesAreHidden && (!HideInterfaces || ManiaApp.UI.UISequence != CGamePlaygroundUIConfig::EUISequence::Playing)) {
if (UILayer_LiveRanking !is null) {
UILayer_LiveRanking.IsVisible = true;
}