Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public TowerMenuScreen(td_Tower tower)
            : base(tower.ID)
        {
            this.tower = tower;

            // Create our menu entries.
            MenuEntry upgradeMenuEntry = new MenuEntry("Upgrade", this);
            MenuEntry closeMenuEntry = new MenuEntry("Close", this);

            // Hook up menu event handlers.
            upgradeMenuEntry.Selected += UpgradeMenuEntrySelected;
            closeMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(upgradeMenuEntry);
            MenuEntries.Add(closeMenuEntry);
        }
        /// <summary>
        /// Constructor automatically includes the standard "A=ok, B=cancel"
        /// usage text prompt.
        /// </summary>
        public TowerMenuBoxScreen(td_Tower tower)
        {
            this.tower = tower;

            // Create our menu entries.
            MenuEntry upgradeMenuEntry = new MenuEntry("Upgrade", this);
            MenuEntry closeMenuEntry = new MenuEntry("Close", this);

            // Hook up menu event handlers.
            upgradeMenuEntry.Selected += UpgradeMenuEntrySelected;
            closeMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(upgradeMenuEntry);
            MenuEntries.Add(closeMenuEntry);

            //IsPopup = true;

            TransitionOnTime = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0.2);
        }