Compare commits
2 Commits
ef3397eeda
...
7111e62193
Author | SHA1 | Date | |
---|---|---|---|
7111e62193 | |||
42a412c11a |
@ -72,7 +72,7 @@ void Render() {
|
|||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (map is null && editor is null) {
|
if (map is null || editor is null) {
|
||||||
menu_visibility = false;
|
menu_visibility = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ void RenderMenu() {
|
|||||||
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
CGameCtnChallenge@ map = cast<CGameCtnChallenge>(GetApp().Challenge);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (map is null && editor is null) {
|
if (map is null || editor is null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,22 @@ 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) {
|
CGameUILayer@ findUILayer(const MwFastBuffer<CGameUILayer@> _UILayers, string _ManialinkId) {
|
||||||
for (uint i = 0; i < _UILayers.Length; i++) {
|
for (uint i = 0; i < _UILayers.Length; i++) {
|
||||||
string manialink = _UILayers[i].ManialinkPage;
|
string manialink = _UILayers[i].ManialinkPage;
|
||||||
@ -40,6 +56,8 @@ void Main() {
|
|||||||
if (network !is null && serverinfo !is null) {
|
if (network !is null && serverinfo !is null) {
|
||||||
if (Last_ServerLogin != serverinfo.ServerLogin) {
|
if (Last_ServerLogin != serverinfo.ServerLogin) {
|
||||||
Last_ServerLogin = serverinfo.ServerLogin;
|
Last_ServerLogin = serverinfo.ServerLogin;
|
||||||
|
@UILayer_LiveRanking = null;
|
||||||
|
@UILayer_TeamsScores = null;
|
||||||
HideInterfaces = false;
|
HideInterfaces = false;
|
||||||
InterfacesAreHidden = false;
|
InterfacesAreHidden = false;
|
||||||
}
|
}
|
||||||
@ -50,17 +68,17 @@ void Main() {
|
|||||||
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) {
|
||||||
@UILayer_LiveRanking = findUILayer(ManiaApp.UILayers, "UIModule_TMWTTeams_LiveRanking");
|
@UILayer_LiveRanking = findUILayer(ManiaApp.UILayers, "UIModule_TMWTCommon_LiveRanking");
|
||||||
}
|
}
|
||||||
if (UILayer_TeamsScores is null) {
|
if (UILayer_TeamsScores is null) {
|
||||||
@UILayer_TeamsScores = findUILayer(ManiaApp.UILayers, "UIModule_TMWTTeams_Header");
|
@UILayer_TeamsScores = findUILayer(ManiaApp.UILayers, "UIModule_TMWTCommon_Header");
|
||||||
}
|
}
|
||||||
if (UILayer_TeamsScores is null && UILayer_LiveRanking is null) {
|
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");
|
UI::ShowNotification("\\$77d" + Icons::User + " \\$fffTMWT Interfaces Remover", "Can't find Interfaces to hide, disabling the plugin");
|
||||||
HideInterfaces = false;
|
HideInterfaces = false;
|
||||||
InterfacesAreHidden = false;
|
InterfacesAreHidden = false;
|
||||||
}
|
}
|
||||||
if (HideInterfaces && !InterfacesAreHidden && ManiaApp.UI.UISequence == CGamePlaygroundUIConfig::EUISequence::Playing) {
|
if (HideInterfaces && !InterfacesAreHidden && IsPlaying() ) {
|
||||||
if (HideLiveRanking && UILayer_LiveRanking !is null) {
|
if (HideLiveRanking && UILayer_LiveRanking !is null) {
|
||||||
UILayer_LiveRanking.IsVisible = false;
|
UILayer_LiveRanking.IsVisible = false;
|
||||||
}
|
}
|
||||||
@ -68,7 +86,7 @@ void Main() {
|
|||||||
UILayer_TeamsScores.IsVisible = false;
|
UILayer_TeamsScores.IsVisible = false;
|
||||||
}
|
}
|
||||||
InterfacesAreHidden = true;
|
InterfacesAreHidden = true;
|
||||||
} else if (InterfacesAreHidden && (!HideInterfaces || ManiaApp.UI.UISequence != CGamePlaygroundUIConfig::EUISequence::Playing)) {
|
} else if (InterfacesAreHidden && (!HideInterfaces || !IsPlaying())) {
|
||||||
if (UILayer_LiveRanking !is null) {
|
if (UILayer_LiveRanking !is null) {
|
||||||
UILayer_LiveRanking.IsVisible = true;
|
UILayer_LiveRanking.IsVisible = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user