private void MakeCompactGump() { Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); if (Game is BaseTeamGame) { AddAlphaRegion(0, 0, 300, 90 + ((BaseTeamGame)Game).TeamCount * 20); AddBackground(0, 0, 300, 90 + ((BaseTeamGame)Game).TeamCount * 20, 9250); } else { AddAlphaRegion(0, 0, 300, 90); AddBackground(0, 0, 300, 90, 9250); } AddLabel(15, 13, GreenHue, Game.GameName); if (m_Game.Running) { AddLabel(170, 13, LabelHue, "Game is running."); } else if (m_Game.Open) { AddLabel(170, 13, LabelHue, "Game is open."); } else { AddLabel(170, 13, LabelHue, "Game is closed."); } AddLabel(15, 45, GreenHue, "Time left: "); AddLabel(105, 45, LabelHue, m_Game.TimeLeft.Hours + ":" + m_Game.TimeLeft.Minutes + ":" + m_Game.TimeLeft.Seconds); AddLabel(15, 65, GreenHue, "Max score: "); AddLabel(105, 65, LabelHue, m_Game.MaxScore.ToString()); int x = 170; int y = 45; if (m_Game is BaseTeamGame) { BaseTeamGame TeamGame = m_Game as BaseTeamGame; foreach (BaseGameTeam team in TeamGame.Teams) { AddLabel(x, y, team.Hue, team.Name + ":"); AddLabel(x + 100, y, team.Hue, team.Score.ToString()); y += 20; } } y += 10; AddButton(15, y, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(45, y, LabelHue, "Disable"); AddButton(105, y, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0); AddLabel(135, y, LabelHue, "Extend"); }
private static void EventTeamSay_Command(CommandEventArgs e) { BaseGame Game = ((PlayerMobile)e.Mobile).CurrentEvent; if (Game != null && Game is BaseTeamGame) { BaseTeamGame TeamGame = Game as BaseTeamGame; BaseGameTeam team = TeamGame.GetTeam(e.Mobile); team.TeamMessage(e.Mobile, e.ArgString); } else { e.Mobile.SendAsciiMessage("You are not in a team event."); } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 1: { int hour, min, sec, score; if (Int32.TryParse(info.GetTextEntry(0).Text, out hour) && Int32.TryParse(info.GetTextEntry(1).Text, out min) && Int32.TryParse(info.GetTextEntry(2).Text, out sec)) { if (hour != m_Hours || min != m_Minutes || sec != m_Seconds) { Game.Length = new TimeSpan(hour, min, sec); } } if (Int32.TryParse(info.GetTextEntry(3).Text, out score)) { Game.MaxScore = score; } if (Game is BaseTeamGame) { int count = 4; BaseTeamGame teamgame = Game as BaseTeamGame; foreach (BaseGameTeam team in teamgame.Teams) { if (info.GetTextEntry(count) != null && Int32.TryParse(info.GetTextEntry(count++).Text, out score)) { team.Score = score; } foreach (Mobile player in team.Players) { if (info.GetTextEntry(player.Serial) != null && Int32.TryParse(info.GetTextEntry(player.Serial).Text, out score)) { Game.SetPlayerScore(player, score); } } } } from.SendGump(new GameAdminGump(from, m_Game)); break; } } }
private void MakeGump() { Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(0, 0, 550, 200, 9250); AddAlphaRegion(0, 0, 550, 200); if (!m_Game.Open) { AddButton(35, 45, 5601, 5605, 4, GumpButtonType.Reply, 0); AddLabel(60, 43, LabelHue, "Open game"); } else { AddButton(35, 45, 5601, 5605, 5, GumpButtonType.Reply, 0); AddLabel(60, 43, LabelHue, "Close game"); } if (m_Game.Open && !m_Game.Running) { AddButton(35, 65, 5601, 5605, 6, GumpButtonType.Reply, 0); AddLabel(60, 63, LabelHue, "Start game"); } else if (m_Game.Running) { AddButton(35, 65, 5601, 5605, 7, GumpButtonType.Reply, 0); AddLabel(60, 63, LabelHue, "End game"); } AddButton(35, 105, 5601, 5605, 1, GumpButtonType.Reply, 0); AddLabel(60, 103, LabelHue, "Edit props"); AddButton(35, 145, 5601, 5605, 2, GumpButtonType.Reply, 0); AddLabel(60, 143, LabelHue, "Edit supplier props"); if (m_Game.Supplier != null) { if (m_Game.Supplier.SupplyType == SupplyType.Custom) { AddButton(35, 165, 5601, 5605, 3, GumpButtonType.Reply, 0); AddLabel(60, 163, LabelHue, "Edit supplies"); } } AddLabel(60, 13, GreenHue, "Game stone gump"); if (m_Game.Running) { AddLabel(250, 13, LabelHue, "The game is currently running."); } else if (m_Game.Open) { AddLabel(250, 13, LabelHue, "The game is currently open."); } else { AddLabel(250, 13, LabelHue, "The game is currently closed."); } AddButton(250, 45, 5601, 5605, 8, GumpButtonType.Reply, 0); AddLabel(280, 43, LabelHue, "Game administration"); AddLabel(250, 65, GreenHue, "Time left: "); AddLabel(350, 65, LabelHue, m_Game.TimeLeft.Hours + ":" + m_Game.TimeLeft.Minutes + ":" + m_Game.TimeLeft.Seconds); AddLabel(250, 85, GreenHue, "Max score: "); AddLabel(350, 85, LabelHue, m_Game.MaxScore.ToString()); if (m_Game is BaseTeamGame) { int y = 105; BaseTeamGame TeamGame = m_Game as BaseTeamGame; foreach (BaseGameTeam team in TeamGame.Teams) { AddLabel(250, y, GreenHue, team.Name + ":"); AddLabel(350, y, LabelHue, team.Score.ToString()); y += 20; } } }
private void MakeGump(bool endgame) { Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); int x = 30; Y = 15; AddLabel(x, Y, GreenHue, Game.GameName); if (m_Game.Running) { AddLabel(x + 170, Y, LabelHue, "The game is currently running."); } else if (m_Game.Open) { AddLabel(x + 170, Y, LabelHue, "The game is currently open."); } else if (endgame) { AddLabel(x + 170, Y, LabelHue, "The game has ended."); } else { AddLabel(x + 170, Y, LabelHue, "The game is currently closed."); } Y = 45; AddLabel(x, Y, GreenHue, "Time left: "); AddLabel(x + 90, Y, LabelHue, m_Game.TimeLeft.Hours + ":" + m_Game.TimeLeft.Minutes + ":" + m_Game.TimeLeft.Seconds); Y += 20; AddLabel(x, Y, GreenHue, "Max score: "); AddLabel(x + 90, Y, LabelHue, m_Game.MaxScore.ToString()); Y = 45; x += 170; if (m_CustomGameFields.ContainsKey(Game)) { foreach (CustomGumpItem item in m_CustomGameFields[Game]) { AddLabel(x, Y, GreenHue, item.Label); AddLabel(x + 90, Y, LabelHue, item.Message); Y += 20; } } if (User is PlayerMobile && m_CustomPlayerFields.ContainsKey((PlayerMobile)User)) { foreach (CustomGumpItem item in m_CustomPlayerFields[(PlayerMobile)User]) { AddLabel(x, Y, GreenHue, item.Label); AddLabel(x + 90, Y, LabelHue, item.Message); Y += 20; } } x -= 170; int teamy = 0; if (m_Game is BaseTeamGame) { BaseTeamGame TeamGame = m_Game as BaseTeamGame; foreach (BaseGameTeam team in TeamGame.Teams) { if (Y < 105) { teamy = 105; } else { teamy = Y; } AddLabel(x, teamy, team.Hue, team.Name + ":"); AddLabel(x + 100, teamy, team.Hue, team.Score.ToString()); teamy += 20; foreach (Mobile player in team.Players) { if (player.SolidHueOverride != -1) { AddLabel(x, teamy, player.SolidHueOverride, player.Name); } else if (!player.Alive) { AddLabel(x, teamy, GreyHue, player.Name); } else { AddLabel(x, teamy, LabelHue, player.Name); } AddLabel(x + 100, teamy, LabelHue, Game.GetPlayerScore(player).ToString()); teamy += 20; } x += 170; } } Y += teamy + 30; x = 30; if (!endgame) { AddButton(x, Y, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(x + 30, Y, LabelHue, "Disable this gump"); AddButton(x + 160, Y, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0); AddLabel(x + 190, Y, LabelHue, "Compact gump"); } int width = 220; int height = 230; if (endgame) { height -= 30; } if (m_Game is BaseTeamGame) { BaseTeamGame TeamGame = m_Game as BaseTeamGame; int maxcount = 0; foreach (BaseGameTeam team in TeamGame.Teams) { if (team.Players.Count > maxcount) { maxcount = team.Players.Count; } } height += maxcount * 20; width += TeamGame.Teams.Count * 170 - 170; AddAlphaRegion(0, 0, width, Height + 40); AddBackground(0, 0, width, Height + 40, 9250); } else { AddAlphaRegion(0, 0, width, Height + 40); AddBackground(0, 0, width, Height + 40, 9250); } Entries.Reverse(); Entries.Reverse(2, Entries.Count - 2); }
public CTFTeam(BaseTeamGame game, string name) : base(game, name) { }
private void MakeGump() { Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); int x = 30; Y = 15; AddLabel(x, Y, GreenHue, Game.GameName); if (m_Game.Running) { AddLabel(x + 170, Y, LabelHue, "The game is currently running."); } else if (m_Game.Open) { AddLabel(x + 170, Y, LabelHue, "The game is currently open."); } else { AddLabel(x + 170, Y, LabelHue, "The game is currently closed."); } m_Hours = m_Game.TimeLeft.Hours; m_Minutes = m_Game.TimeLeft.Minutes; m_Seconds = m_Game.TimeLeft.Seconds; Y = 45; AddLabel(x, Y, GreenHue, "Time left: "); AddImageTiled(x + 100, Y, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 100, Y, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, 0, "" + m_Game.TimeLeft.Hours); AddImageTiled(x + 135, Y, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 135, Y, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, 1, "" + m_Game.TimeLeft.Minutes); AddImageTiled(x + 170, Y, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 170, Y, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, 2, "" + m_Game.TimeLeft.Seconds); Y += 20; AddLabel(x, Y, GreenHue, "Max score: "); AddImageTiled(x + 100, Y, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 100, Y, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, 3, "" + m_Game.MaxScore); int teamy = 0; if (m_Game is BaseTeamGame) { int count = 4; BaseTeamGame TeamGame = m_Game as BaseTeamGame; foreach (BaseGameTeam team in TeamGame.Teams) { if (Y < 105) { teamy = 105; } else { teamy = Y; } AddLabel(x, teamy, team.Hue, team.Name + ":"); AddImageTiled(x + 100, teamy, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 100, teamy, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, count++, "" + team.Score); teamy += 20; foreach (Mobile player in team.Players) { if (player.SolidHueOverride != -1) { AddLabel(x, teamy, player.SolidHueOverride, player.Name); } else if (!player.Alive) { AddLabel(x, teamy, GreyHue, player.Name); } else { AddLabel(x, teamy, LabelHue, player.Name); } AddImageTiled(x + 100, teamy, 30, PropsConfig.EntryHeight, PropsConfig.EntryGumpID); AddTextEntry(x + 100, teamy, 30, PropsConfig.EntryHeight, PropsConfig.TextHue, player.Serial, "" + Game.GetPlayerScore(player).ToString()); teamy += 20; } x += 170; } } Y += teamy + 30; x = 30; AddButton(x, Y, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(x + 30, Y, LabelHue, "Save changes"); int width = 220; int height = 210; if (m_Game is BaseTeamGame) { BaseTeamGame TeamGame = m_Game as BaseTeamGame; int maxcount = 0; foreach (BaseGameTeam team in TeamGame.Teams) { if (team.Players.Count > maxcount) { maxcount = team.Players.Count; } } height += maxcount * 20; width += TeamGame.Teams.Count * 170 - 170; AddAlphaRegion(0, 0, width, Height); AddBackground(0, 0, width, Height, 9250); } else { AddAlphaRegion(0, 0, width, Height); AddBackground(0, 0, width, Height, 9250); } Entries.Reverse(); Entries.Reverse(2, Entries.Count - 2); }
public CTFTeam( BaseTeamGame game, string name ) : base(game, name) { }