public WndResurrect(Ankh ankh, object causeOfDeath) { Instance = this; CauseOfDeath = causeOfDeath; var titlebar = new IconTitle(); titlebar.Icon(new ItemSprite(ankh.image, null)); titlebar.Label(ankh.Name); titlebar.SetRect(0, 0, WIDTH, 0); Add(titlebar); var message = PixelScene.CreateMultiline(TxtMessage, 6); message.MaxWidth = WIDTH; message.Measure(); message.Y = titlebar.Bottom() + Gap; Add(message); var btnYes = new RedButton(TxtYes); btnYes.ClickAction = button => { Hide(); Statistics.AnkhsUsed++; InterlevelScene.mode = InterlevelScene.Mode.RESURRECT; Game.SwitchScene <InterlevelScene>(); }; btnYes.SetRect(0, message.Y + message.Height + Gap, WIDTH, BtnHeight); Add(btnYes); var btnNo = new RedButton(TxtNo); btnNo.ClickAction = button => { Hide(); Rankings.Instance.Submit(false); Hero.ReallyDie(causeOfDeath); }; btnNo.SetRect(0, btnYes.Bottom() + Gap, WIDTH, BtnHeight); Add(btnNo); Resize(WIDTH, (int)btnNo.Bottom()); }
public override void Destroy() { base.Destroy(); Instance = null; }