public LotteryGMGump(Mobile from, LotteryBasket _basket) : base (100,100) { basket = _basket; if ( !from.Deleted && from != null && !basket.Deleted && basket != null ) { if (from.AccessLevel == AccessLevel.Counselor) AddBackground(0, 0, 420, 200, 2600); else AddBackground(0, 0, 420, 400, 2600); int y = 25; AddLabel(45, y, 133, "Defiance Lottery"); y += 15; AddLabel(45, y, 133, "GM Menu"); y += 20; if ( basket.Debug ) AddLabel(150, y, 133, "!!! DEBUG MODE ENABLED !!!"); y += 25; AddLabel(45, y, 2213, "Statistics"); y += 30; AddButton(45, y, 2152, 2154, 5, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Open statistics gump"); if (from.AccessLevel >= AccessLevel.GameMaster) { y += 50; AddLabel(45, y, 2213, "Settings"); y += 30; AddButton(45, y, 2152, 2154, 7, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Item prize true/false"); AddLabel(230, y, 902, "Currently: "+basket.ItemPrize); y += 30; AddLabel(90, y, 902, "Current publishing Item: "); y += 15; if ( basket.Board != null ) AddLabel(90, y, 902, ""+basket.Board); else AddLabel(90, y, 902, "none"); y += 15; AddLabel(90, y, 902, "(change this via [props)"); y += 50; AddLabel(45, y, 2213, "Preform a drawing"); y += 30; if (basket.Mode == LotteryBasketMode.Open) { AddButton(45, y, 2152, 2154, -1, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Close lottery and draw new numbers (GM)"); } else if (basket.Mode == LotteryBasketMode.Closed) { AddButton(45, y, 2152, 2154, -2, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Publish new drawing and re-open lottery"); } y += 20; AddLabel(90, y, 902, "Attention: This can not be undone!"); } } }
public LotteryBasketGump(Mobile from, LotteryBasket _basket) : base(200, 200) { basket = _basket; AddBackground(0, 0, 400, 260, 2600); int y = 25; AddLabel(45, y, 902, "Defiance Lottery"); y += 5; y += 30; ulong jp = basket.Award; foreach (ulong v in basket.Jackpot) jp += v; AddLabel(45, y, 902, "Current jackpot: " + jp + " gold"); y += 30; uint[] outcome = basket.Outcome; string lastDrawing; if (outcome == null) { lastDrawing = "none yet"; } else if (basket.Mode == LotteryBasketMode.Closed && from.AccessLevel <= AccessLevel.Counselor) { /* only GMs can see the new drawing until the * lottery is open again */ lastDrawing = "unknown yet"; } else { string[] text = new string[LotteryConstants.Picks]; for (int z = 0; z < LotteryConstants.Picks; z++) text[z] = "" + outcome[z]; lastDrawing = string.Join(", ", text); } AddLabel(45, y, 902, (basket.Mode == LotteryBasketMode.Closed ? "Next" : "Last") + " drawing: " + lastDrawing); y += 40; AddButton(45, y, 2152, 2154, 1, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Buy a ticket for " + LotteryConstants.TicketPrice + " gold"); y += 30; if (from.AccessLevel >= AccessLevel.Counselor) { AddButton(45, y, 2152, 2154, 3, GumpButtonType.Reply, 0); AddLabel(90, y, 133, "DFI Staff Functions"); } y += 30; AddButton(45, y, 2152, 2154, -1, GumpButtonType.Reply, 0); AddLabel(90, y, 902, "Cancel"); }
public LotteryStatisticsGump(Mobile from, LotteryBasket _basket) : base (100,100) { basket = _basket; if ( !from.Deleted && from != null && !basket.Deleted && basket != null ) { int height = 550; int lenght = 550; uint[] numbers = basket.Outcome; if ( numbers == null ) { height = 385; lenght = 450; } AddBackground(0, 0, lenght, height, 2600); int y = 25; AddLabel(45, y, 133, "Defiance Lottery"); y += 15; AddLabel(45, y, 133, "GM Menu - Statistics"); y += 40; AddLabel(45, y, 2213, "Global statistics"); y += 20; AddLabel(60, y, 2215, "Gold destroyed: "+basket.Destroyed); y += 20; AddLabel(60, y, 2215, "Gold given out: "+basket.Given); y += 30; AddLabel(45, y, 2213, "Drawing statistics"); y += 25; AddLabel(60, y, 2213, "Surrent drawing"); y += 20; AddLabel(60, y, 2215, "Drawing ID: "+basket.Drawing); ulong jp = basket.Award; foreach (ulong v in basket.Jackpot) jp += v; y += 20; AddLabel(60, y, 2215, "Jackpot: "+jp); y += 20; AddLabel(75, y, 2215, "Ticket sales revenue: "+basket.Award); ulong[] jps = new ulong[4]{basket.Jackpot6, basket.Jackpot5, basket.Jackpot4, basket.Jackpot3}; for ( uint cnt = 0; cnt < 4; cnt++ ) { y += 20; AddLabel(75, y, 2215, "Jackpot "+(6-cnt)+"-Rights: "+jps[cnt]); } y += 20; AddLabel(60, y, 2215, "Submitted tickets until now: "+basket.Participants); if ( numbers != null ) { y += 30; AddLabel(60, y, 2213, "Past drawing"); y += 20; AddLabel(60, y, 2215, "Drawing ID: "+(basket.Drawing-1)); y += 20; string outcome = ""; Array.Sort(numbers); string[] text = new string[6]; for (int z = 0; z < 6; z++) text[z] = "" + numbers[z]; outcome = string.Join(", ", text); AddLabel(60, y, 2215, "Drawn numbers: "+outcome); for ( uint cnt = 0; cnt < 4; cnt++ ) { y += 20; if ( basket.Awards[cnt] == 0 ) text[cnt] = "n/a"; else text[cnt] = ""+basket.Awards[cnt]; AddLabel(60, y, 2215, "Win with "+(6-cnt)+" rights: "+text[cnt]); if ( basket.Winners[cnt] > 0 ) AddLabel(400, y, 2215, "Winners: "+basket.Winners[cnt]); } y += 20; AddLabel(60, y, 2215, "Participants: "+basket.OldParticipants); } } }