Ejemplo n.º 1
0
    protected virtual void SellObject()
    {
        panel.Hide();
        room.info.objectsInRoom.Remove(GetComponent <Constructible>());
        if (objectToMerge != null && objectToMerge.GetComponent <SceneObject>())
        {
            room.info.objectsInRoom.Remove(objectToMerge.GetComponent <Constructible>());
            Destroy(objectToMerge.gameObject);
        }
        GameController.instance.player.resources.ChangeBalance(description.sellPrice);

        Destroy(gameObject);

        Abort();
    }
Ejemplo n.º 2
0
 public override void SetPanel()
 {
     if (constructor.isActive)
     {
         constructor.ConstructOFF();
     }
     if (descriptionPanel.lastTouched.lvl >= 2)
     {
         upgradeBtn.interactable = false;
         return;
     }
     descriptionPanel.Hide();
     gameObject.SetActive(true);
     GameController.instance.IsGameSceneEnabled = false;
     descriptionPanel.lastTouched.ConfirmUpgrade(this);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Help Button On Click handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HelpButton_Click(object sender, EventArgs e)
        {
            // Keep focus on game
            this.ActiveControl = null;
            HelpButton.TabStop = false;

            // Enable or disable panel
            if (!HelpPanel.Visible)
            {
                HelpPanel.Show();
            }
            else
            {
                HelpPanel.Hide();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor for the View.
        /// </summary>
        /// <param name="ctl"></param>
        public GameView(GameController ctl)
        {
            // Initalize
            InitializeComponent();
            FormClosed   += OnExit;
            theController = ctl;
            theWorld      = theController.GetWorld();
            HelpPanel.Hide();


            // Register handlers for the controller's events
            theController.Error         += ShowError;
            theController.UpdateArrived += OnFrame;
            theController.Connected     += HandleConnected;


            // Set up key handlers
            this.KeyDown += HandleKeyDown;
            this.KeyUp   += HandleKeyUp;
        }