Esempio n. 1
0
        static bool Prefix(UIElement __instance)
        {
            if (!MenuManager.m_mp_lan_match)
            {
                return(true);
            }
            var uie = __instance;

            uie.DrawMenuBG();
            Vector2 position = uie.m_position;

            position.y = UIManager.UI_TOP + 75f;
            uie.DrawHeaderLarge(position, Loc.LS("SCOREBOARD"));
            position.y += 42f;
            MatchMode mode = NetworkMatch.GetMode();
            string    s    = NetworkMatch.GetModeString(mode) + " - " + GameplayManager.Level.DisplayName;

            uie.DrawSubHeader(s, position);
            position.y += 20f;
            uie.DrawMenuSeparator(position);
            position.y += 20f;
            position.x  = 0f;
            position.y += 10f;
            _UIElement_DrawMpScoreboardRaw_Method.Invoke(uie, new object[] { position });
            position.y = UIManager.UI_BOTTOM - 30f;
            uie.SelectAndDrawItem(Loc.LS("MULTIPLAYER MENU"), position, 100, false);
            position.y -= 62f;
            uie.SelectAndDrawItem(Loc.LS(NetworkMatch.m_match_req_password == "" ? "CREATE AGAIN" : "JOIN AGAIN"), position, 2, false);
            return(false);
        }
Esempio n. 2
0
        static bool Prefix(UIElement __instance, ref Vector2 pos)
        {
            if (!GameplayManager.IsMultiplayerActive || NetworkMatch.GetMode() == MatchMode.ANARCHY || MPTeams.NetworkMatchTeamCount == 2)
            {
                return(true);
            }

            var uie = __instance;

            pos.x -= 4f;
            pos.y -= 5f;
            Vector2 temp_pos;

            temp_pos.y = pos.y;
            temp_pos.x = pos.x - 100f;
            uie.DrawStringSmall(NetworkMatch.GetModeString(MatchMode.NUM), temp_pos, 0.4f, StringOffset.LEFT, UIManager.m_col_ub0, 1f, 130f);
            temp_pos.x = pos.x + 95f;
            int match_time_remaining = NetworkMatch.m_match_time_remaining;
            int num3 = (int)NetworkMatch.m_match_elapsed_seconds;

            uie.DrawDigitsTime(temp_pos, (float)match_time_remaining, 0.45f,
                               (num3 <= 10 || match_time_remaining >= 10) ? UIManager.m_col_ui2 : UIManager.m_col_em5, uie.m_alpha, false);
            temp_pos.x = pos.x - 100f;
            temp_pos.y = temp_pos.y - 20f;
            uie.DrawPing(temp_pos);
            pos.y += 24f;

            MpTeam myTeam = GameManager.m_local_player.m_mp_team;

            foreach (var team in MPTeams.TeamsByScore)
            {
                MPTeams.DrawTeamScoreSmall(__instance, pos, team, NetworkMatch.GetTeamScore(team), 98f, team == myTeam);
                pos.y += 28f;
            }
            pos.y += 6f - 28f;

            pos.y += 22f;

            pos.x += 100f;
            uie.DrawRecentKillsMP(pos);
            if (GameManager.m_player_ship.m_wheel_select_state == WheelSelectState.QUICK_CHAT)
            {
                pos.y = UIManager.UI_TOP + 128f;
                pos.x = -448f;
                uie.DrawQuickChatWheel(pos);
            }
            else
            {
                pos.y = UIManager.UI_TOP + 60f;
                pos.x = UIManager.UI_LEFT + 5f;
                uie.DrawQuickChatMP(pos);
            }

            return(false);
        }
Esempio n. 3
0
        public static void DrawPostgame(UIElement uie)
        {
            Vector2 pos = Vector2.zero;

            pos.y = -300f;
            Color  c     = UIManager.m_col_ui5;
            string s     = Loc.LS("MATCH OVER!");
            var    teams = TeamsByScore;

            if (teams.Length >= 2 && NetworkMatch.m_team_scores[(int)teams[0]] != NetworkMatch.m_team_scores[(int)teams[1]])
            {
                c = TeamColor(teams[0], 4);
                s = TeamName(teams[0]) + " WINS!";
            }
            float a = uie.m_alpha * uie.m_alpha * uie.m_alpha;

            uie.DrawWideBox(pos, 300f, 29f, c, a, 7);
            uie.DrawWideBox(pos, 300f, 25f, c, a, 11);
            uie.DrawStringSmall(s, pos, 1.35f, StringOffset.CENTER, UIManager.m_col_ub3, uie.m_alpha, -1f);
            pos.y = -200f;
            _UIElement_DrawMpScoreboardRaw_Method.Invoke(uie, new object[] { pos });
            pos.y = -290f;
            pos.x = 610f;
            uie.DrawStringSmall(NetworkMatch.GetModeString(MatchMode.NUM), pos, 0.75f, StringOffset.RIGHT, UIManager.m_col_ui5, 1f, -1f);
            pos.y += 25f;
            uie.DrawStringSmall(GameplayManager.Level.DisplayName, pos, 0.5f, StringOffset.RIGHT, UIManager.m_col_ui1, 1f, -1f);
            if (GameManager.m_player_ship.m_wheel_select_state == WheelSelectState.QUICK_CHAT)
            {
                pos.y = UIManager.UI_TOP + 158f;
                pos.x = -418f;
                uie.DrawQuickChatWheel(pos);
            }
            else
            {
                pos.y = UIManager.UI_TOP + 90f;
                pos.x = UIManager.UI_LEFT + 35f;
                uie.DrawQuickChatMP(pos);
            }
        }
Esempio n. 4
0
        static void Prefix(UIElement __instance)
        {
            if (!GameManager.m_local_player.m_spectator || !GameplayManager.ShowHud || Overload.NetworkManager.IsHeadless() ||
                GameManager.m_local_player.m_pregame)
            {
                return;
            }

            var   uie   = __instance;
            float alpha = uie.m_alpha;

            uie.m_alpha *= UIElement.HUD_ALPHA;
            uie.DrawMessages();

            Vector2 vector;

            if (!GameplayManager.ShowMpScoreboard)
            {
                vector.y    = UIManager.UI_TOP + 70f;
                vector.x    = UIManager.UI_RIGHT - 20f;
                uie.m_alpha = Mathf.Min(getAlphaEyeGaze(uie, "upperright"), uie.m_alpha);
                //uie.DrawXPTotalSmall(vector);
                vector.y += 26f;
                vector.x -= 89f;
                uie.DrawHUDScoreInfo(vector);
            }
            else
            {
                vector.y = -240f;
                vector.x = 0f;
                uie.DrawStringSmall(NetworkMatch.GetModeString(MatchMode.NUM), vector, 0.75f, StringOffset.CENTER, UIManager.m_col_ui5, 1f, -1f);
                vector.y += 25f;
                uie.DrawStringSmall(GameplayManager.Level.DisplayName, vector, 0.5f, StringOffset.CENTER, UIManager.m_col_ui1, 1f, -1f);
                vector.y += 35f;
                DrawMpScoreboardRaw(uie, vector);
            }
            uie.m_alpha = alpha;
        }
Esempio n. 5
0
        static void Prefix(UIElement __instance)
        {
            if (!GameManager.m_local_player.m_spectator || !GameplayManager.ShowHud || Overload.NetworkManager.IsHeadless() ||
                GameManager.m_local_player.m_pregame)
            {
                return;
            }

            var   uie   = __instance;
            float alpha = uie.m_alpha;

            uie.m_alpha *= UIElement.HUD_ALPHA;
            uie.DrawMessages();

            Vector2 vector;

            if (!GameplayManager.ShowMpScoreboard)
            {
                vector.y    = UIManager.UI_TOP + 70f;
                vector.x    = UIManager.UI_RIGHT - 20f;
                uie.m_alpha = Mathf.Min(getAlphaEyeGaze(uie, "upperright"), uie.m_alpha);
                //uie.DrawXPTotalSmall(vector);
                vector.y += 26f;
                vector.x -= 89f;
                uie.DrawHUDScoreInfo(vector);
            }
            else
            {
                vector.y = -240f;
                vector.x = 0f;
                uie.DrawStringSmall(NetworkMatch.GetModeString(MatchMode.NUM), vector, 0.75f, StringOffset.CENTER, UIManager.m_col_ui5, 1f, -1f);
                vector.y += 25f;
                uie.DrawStringSmall(GameplayManager.Level.DisplayName, vector, 0.5f, StringOffset.CENTER, UIManager.m_col_ui1, 1f, -1f);
                vector.y += 35f;
                DrawMpScoreboardRaw(uie, vector);
            }
            uie.m_alpha = alpha;

            if (MPObserver.ObservedPlayer == null)
            {
                return;
            }

            var player      = MPObserver.ObservedPlayer;
            var player_ship = player.c_player_ship;

            vector.x = UIManager.UI_RIGHT - 270f;
            vector.y = UIManager.UI_BOTTOM - 70f - 22f * 4;

            uie.DrawStringSmall("NOW OBSERVING:", vector, 0.35f, StringOffset.LEFT, UIManager.m_col_hi3, uie.m_alpha, -1f);
            vector.y += 22f;
            uie.DrawStringSmall("KILLS:", vector, 0.35f, StringOffset.LEFT, UIManager.m_col_hi3, uie.m_alpha, -1f);
            vector.y += 22f;
            uie.DrawStringSmall("ASSISTS:", vector, 0.35f, StringOffset.LEFT, UIManager.m_col_hi3, uie.m_alpha, -1f);
            vector.y += 22f;
            uie.DrawStringSmall("DEATHS:", vector, 0.35f, StringOffset.LEFT, UIManager.m_col_hi3, uie.m_alpha, -1f);

            vector.x = UIManager.UI_RIGHT - 20f;
            vector.y = UIManager.UI_BOTTOM - 70f - 22f * 4;

            uie.DrawStringSmall(player.m_mp_name, vector, 0.35f, StringOffset.RIGHT, UIManager.m_col_hi3, uie.m_alpha, -1f);
            vector.y += 22f;
            uie.DrawDigitsVariable(vector, player.m_kills, 0.4f, StringOffset.RIGHT, UIManager.m_col_hi3, uie.m_alpha);
            vector.y += 22f;
            uie.DrawDigitsVariable(vector, player.m_assists, 0.4f, StringOffset.RIGHT, UIManager.m_col_hi3, uie.m_alpha);
            vector.y += 22f;
            uie.DrawDigitsVariable(vector, player.m_deaths, 0.4f, StringOffset.RIGHT, UIManager.m_col_hi3, uie.m_alpha);

            if (player_ship.c_player == MPObserver.ObservedPlayer && !MPObserver.ThirdPerson && !player_ship.m_dead && !player_ship.m_dying)
            {
                DrawFullScreenEffects();
            }
        }
Esempio n. 6
0
            public static bool DrawHUDScoreInfo(UIElement uie, Vector2 pos, Vector2 temp_pos)
            {
                pos.x     -= 4f;
                pos.y     -= 5f;
                temp_pos.y = pos.y;
                temp_pos.x = pos.x - 100f;
                uie.DrawStringSmall(NetworkMatch.GetModeString(MatchMode.NUM), temp_pos, 0.4f, StringOffset.LEFT, UIManager.m_col_ub0, 1f, 130f);
                temp_pos.x = pos.x + 95f;
                int match_time_remaining = NetworkMatch.m_match_time_remaining;
                int num3 = (int)NetworkMatch.m_match_elapsed_seconds;

                uie.DrawDigitsTime(temp_pos, (float)match_time_remaining, 0.45f, (num3 <= 10 || match_time_remaining >= 10) ? UIManager.m_col_ui2 : UIManager.m_col_em5, uie.m_alpha, false);
                temp_pos.x = pos.x - 100f;
                temp_pos.y = temp_pos.y - 20f;
                uie.DrawPing(temp_pos);
                pos.y += 24f;

                pos.y -= 12f;
                pos.x += 6f;
                UIManager.DrawQuadUI(pos, 100f, 1.2f, UIManager.m_col_ub1, uie.m_alpha, 21);
                pos.y     += 10f;
                temp_pos.x = pos.x;
                temp_pos.x = temp_pos.x + 90f;
                for (int i = 0; i < GameMod.Race.Players.Count; i++)
                {
                    temp_pos.y = pos.y;
                    Player player = GameMod.Race.Players[i].player;
                    if (player && (!player.m_spectator || GameMod.Race.Players[i].isFinished))
                    {
                        var   rp     = GameMod.Race.Players[i];
                        Color color3 = (!player.isLocalPlayer) ? UIManager.m_col_ui1 : UIManager.m_col_hi3;
                        float num4   = (!player.gameObject.activeInHierarchy) ? 0.3f : 1f;
                        uie.DrawDigitsVariable(temp_pos, rp.Laps.Count(), 0.4f, StringOffset.RIGHT, color3, uie.m_alpha * num4);
                        temp_pos.x = temp_pos.x - 35f;
                        uie.DrawStringSmall(player.m_mp_name, temp_pos, 0.35f, StringOffset.RIGHT, color3, num4, -1f);
                        temp_pos.x = temp_pos.x + 8f;
                        if (UIManager.ShouldDrawPlatformId(player.m_mp_platform))
                        {
                            UIManager.DrawSpriteUI(temp_pos, 0.1f, 0.1f, color3, num4 * 0.6f, (int)(226 + player.m_mp_platform));
                        }
                        temp_pos.x = temp_pos.x + 27f;
                        pos.y     += 16f;
                    }
                }
                pos.y -= 6f;
                UIManager.DrawQuadUI(pos, 100f, 1.2f, UIManager.m_col_ub1, uie.m_alpha, 21);
                pos.x -= 6f;
                pos.y -= 6f;

                pos.y += 22f;
                pos.x += 100f;
                uie.DrawRecentKillsMP(pos);
                if (GameManager.m_player_ship.m_wheel_select_state == WheelSelectState.QUICK_CHAT)
                {
                    pos.y = UIManager.UI_TOP + 128f;
                    pos.x = -448f;
                    uie.DrawQuickChatWheel(pos);
                }
                else
                {
                    pos.y = UIManager.UI_TOP + 60f;
                    pos.x = UIManager.UI_LEFT + 5f;
                    uie.DrawQuickChatMP(pos);
                }

                return(false);
            }