Exemple #1
0
        void RemoveTeamUiForPlayer(BasePlayer player, IemUtils.IIemTeamGame teamGame)
        {
            string gui = "team_overlay_" + teamGame.GetGuid().ToString();

            CuiHelper.DestroyUi(player, gui);
            guiList.Remove(gui);
        }
Exemple #2
0
        void ShowTeamUiForPlayer(BasePlayer player, IemUtils.IIemTeamGame teamGame)
        {
            int teamSlot = 0;

            string gui = "team_overlay_" + teamGame.GetGuid().ToString();

            guiList.Add(gui);
            CuiHelper.DestroyUi(player, gui);

            var container = Hud.CreateElementContainer(
                gui,
                "0.3 0.3 0.3 0.0",
                "0.0 0.12",
                "1.0 1.0",
                false);

            string[,] teamSlots =
            {
                { "0.0 0.55",  "0.15 0.9"  },
                { "0.85 0.55", "1.0 0.9"   },
                { "0.0 0.1",   "0.15 0.50" },
                { "0.85 0.1",  "1.0 0.50"  }
            };

            foreach (IemUtils.IIemTeam team in teamGame.Teams.Values)
            {
                IemUtils.DLog(team.Name);
                string team_gui = "team_";
                //CuiHelper.DestroyUi(player, item.GetGuid().To);

                //IemUtils.DLog("teamSlots[teamSlot,0] = " + teamSlots[teamSlot, 0]);
                //IemUtils.DLog("teamSlots[teamSlot,1] = " + teamSlots[teamSlot, 1]);



                Hud.CreatePanel(ref container,
                                gui,
                                "1.0 1.0 1.0 0.6",
                                team.Name,
                                14,
                                teamSlots[teamSlot, 0],
                                teamSlots[teamSlot, 1],
                                TextAnchor.UpperCenter);

                Hud.CreateLabel(ref container,
                                gui,
                                GetColor(team.Color),
                                team.Name,
                                22,
                                teamSlots[teamSlot, 0],
                                teamSlots[teamSlot, 1],
                                TextAnchor.UpperCenter);



                string playerListString = "\n\n";
                foreach (var playerName in team.Players.Values)
                {
                    IemUtils.DLog("adding player: " + playerName.Name);
                    playerListString = playerListString + playerName.Name + "\n";
                }

                Hud.CreateLabel(ref container, gui, "",
                                $"{playerListString}",
                                18,
                                teamSlots[teamSlot, 0],
                                teamSlots[teamSlot, 1],
                                TextAnchor.UpperCenter);

                teamSlot++;
            }
            CuiHelper.AddUi(player, container);
        }