private void CommandButtons_TestButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     if (!KhaiosUtil.TestCommand(commandEntered, ref commandError))
     {
         commandTextError.SetText(commandError);
     }
     else
     {
         commandTextError.SetText("Success!");
     }
 }
Example #2
0
        public override void HitWire(int i, int j)
        {
            int entity = ModContent.GetInstance <CommandTileEntity>().Find(i, j);

            if (entity == -1)
            {
                return;
            }
            CommandTileEntity tileEntity = (CommandTileEntity)TileEntity.ByID[entity];

            if (Wiring.CheckMech(i, j, 20))
            {
                KhaiosUtil.ExecuteCommand(tileEntity.commandTileCommand, ref tileEntity);
            }
        }
 private void CommandButtons_ConfirmExecuteButtonClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     if (tile == null || tileEntity == null)
     {
         return;
     }
     tileEntity.commandTileCommand = commandEntered;
     if (!KhaiosUtil.TestCommand(commandEntered, ref commandError))
     {
         commandTextError.SetText(commandError);
         return;
     }
     KhaiosUtil.ExecuteCommand(commandEntered, ref tileEntity);
     caller.CloseCommand();
 }