Exemple #1
0
        public override void Tick()
        {
            base.Tick();

            /**
             * -Evento de control
             *  -> Controllador:
             *      -> Iniciamos un nuevo ControllerEventArgs
             *      ->
             *      -> Recopila:
             *          -> Posicion y estado del raton
             *          -> Posicion y estado del teclado
             *      -> Pregunta GUI si quiere el evento
             *          -> Si la GUI no lo captura
             *              -> Le da el evento al mapa para que:
             *                  -> Detecte la celda
             *                  -> Detecte la entidad
             *                  -> Detecte las opciones
             *          -> Si la GUI lo captura
             *              -> Le da el evento a la GUI para que lo termine.
             *      -> Si el evento se tiene que enviar
             *          -> Se manda el nuevo evento.
             */

            if (work)
            {
                //Tactil = raton
                if (Input.simulateMouseWithTouches == false)
                {
                    Input.simulateMouseWithTouches = true;
                }

                ControllerEventArgs args = new ControllerEventArgs();

                // Recopilamos estado
                insertMouseConditions(args);
                insertKeyboardConditions(args);

                //Preguntamos a la GUI.
                IsoGUI gui = GUIManager.getGUICapturing(args);

                if (gui == null)
                {
                    MapManager.getInstance().fillControllerEvent(args);
                }
                else
                {
                    gui.fillControllerEvent(args);
                }

                if (args.send)
                {
                    onControllerEvent(args);
                }
            }
        }
Exemple #2
0
 public static void removeGUI(IsoGUI gui)
 {
     if (!isInTick)
     {
         guis.Remove(gui);
         priorities.Remove(gui);
     }
     else
     {
         toRemove.Add(gui);
     }
 }
Exemple #3
0
 public static void addGUI(IsoGUI newGUI, int priority)
 {
     if (!priorities.ContainsKey(newGUI))
     {
         priorities.Add(newGUI, priority);
     }
     if (!isInTick)
     {
         guis.Add(newGUI);
         guis.Sort(new PrioOrder(priorities));
     }
     else
     {
         toAdd.Add(newGUI);
     }
 }
Exemple #4
0
 public static void addGUI(IsoGUI newGUI)
 {
     addGUI(newGUI, DefaultPriority);
 }