Example #1
0
        public void llSetClickAction(IScriptInstance script, int action)
        {
            if (script.Host is LLPrimitive)
            {
                LLPrimitive prim = (LLPrimitive)script.Host;

                ClickAction clickAction = (ClickAction)action;

                switch (clickAction)
                {
                case ClickAction.Buy:
                case ClickAction.OpenMedia:
                case ClickAction.OpenTask:
                case ClickAction.Pay:
                case ClickAction.PlayMedia:
                case ClickAction.Sit:
                case ClickAction.Touch:
                    prim.Prim.ClickAction = ClickAction.Buy;
                    break;

                default:
                    prim.Prim.ClickAction = ClickAction.Touch;
                    break;
                }
            }
        }
        public static bool StartAimAnnotationTool(IImageViewer currentImageViewer)
        {
            if (currentImageViewer == null)
            {
                return(false);
            }

            var        actionPath = new ActionPath(BUTTON_ACTION_PATH, new ResourceResolver(typeof(AimAnnotationTool), true));
            IActionSet actionSet  = currentImageViewer.ExportedActions.Select(action => action.Path.LocalizedPath == actionPath.LocalizedPath);

            if (actionSet != null)
            {
                foreach (IAction action in actionSet)
                {
                    ClickAction clickAction = action as ClickAction;
                    if (clickAction != null)
                    {
                        clickAction.Click();
                        return(true);
                    }
                }
            }

            return(false);
        }
Example #3
0
        private void mh_MouseClickEvent(object sender, MouseEventArgs e, bool?isUp)
        {
            if (!isUp.HasValue || isUp.Value)
            {
                return;
            }

            if (e.Button != MouseButtons.Left && e.Button != MouseButtons.Right)
            {
                return;
            }

            var newAction = new ClickAction()
            {
                X                   = e.X,
                Y                   = e.Y,
                ButtonClicked       = e.Button,
                MilisecondsEllapsed = Stopwatch.ElapsedMilliseconds
            };

            Actions.Add(newAction);
            Stopwatch.Reset();
            Stopwatch.Start();
            ShowActions();
        }
        private void StartLongAction(ClickAction clickAction)
        {
            switch (clickAction)
            {
            case ClickAction.LeftDrag:
            {
                isDragging = true;
                Point CursorPos = Cursor.Position;
                mouse_event(MOUSEEVENTF_LEFTDOWN, CursorPos.X, CursorPos.Y, 0, 0);

                if (CMSLogger.CanCreateLogEvent(false, false, false, "CMSLogClickEvent"))
                {
                    CMSLogClickEvent clickEvent = new CMSLogClickEvent();
                    if (clickEvent != null)
                    {
                        Point c = Cursor.Position;
                        clickEvent.X      = c.X;
                        clickEvent.Y      = c.Y;
                        clickEvent.Width  = CMSConstants.SCREEN_WIDTH;
                        clickEvent.Height = CMSConstants.SCREEN_HEIGHT;
                        clickEvent.ClickType
                            = GetXmlClickType(clickAction, true);
                        CMSLogger.SendLogEvent(clickEvent);
                    }
                }
            }
            break;

            default:
            {
                return;
            }
            }
        }
Example #5
0
    private void display(TaskToDisplay toDisplay)
    {
        hideTaskWindow();
        displaying = true;

        GameObject subject = taskCompletedWindow;

        if (!toDisplay.success)
        {
            subject = taskFailedWindow;
        }

        GameObject canvas = ClickAction.FindObject(subject, "Canvas");

        Text  taskName    = ClickAction.FindObject(canvas, "TaskName").GetComponent <Text>();
        Text  description = ClickAction.FindObject(canvas, "TaskDescription").GetComponent <Text>();
        Text  reward      = ClickAction.FindObject(canvas, "TaskReward").GetComponent <Text>();
        Image image       = ClickAction.FindObject(canvas, "TaskImage").GetComponent <Image>();

        taskName.text    = toDisplay.name;
        description.text = toDisplay.description;
        reward.text      = $"+ {toDisplay.reward.getMoney()}";
        image.sprite     = toDisplay.image;

        subject.SetActive(true);
    }
    private void Start()
    {
        buttonsImages[(int)currentAction].overrideSprite = PoolMaster.gui_overridingSprite;
        for (int i = 0; i < buttonsImages.Length; i++)
        {
            ClickAction ca = (ClickAction)i;
            buttonsImages[i].GetComponent <Button>().onClick.AddListener(() => this.ChangeClickAction(ca));
        }
        materialButtonImage.uvRect = ResourceType.GetResourceIconRect(chosenMaterialId);
        materialNameTextField.text = Localization.GetResourceName(chosenMaterialId);
        if (saveSystem == null)
        {
            saveSystem = SaveSystemUI.Initialize(UIController.GetCurrent().GetCurrentCanvasTransform());
        }
        if (!actionsPanel.activeSelf)
        {
            ActionsPanel();
        }

        FollowingCamera.main.ResetTouchRightBorder();
        FollowingCamera.main.CameraRotationBlock(false);
        touchscreen = FollowingCamera.touchscreen;
        touchZone.SetActive(touchscreen);
        LocalizeTitles();
    }
 private void mouse_Up(object sender, MouseEventArgs e)
 {
     selectingArea  = false;
     RectangleDrawn = true;
     LeftButtonDown = false;
     CurrentAction  = ClickAction.NoClick;
 }
        private ClickType GetXmlClickType(ClickAction clickAction, bool start)
        {
            switch (clickAction)
            {
            case ClickAction.DoubleClick:
            {
                return(ClickType.DlClk);
            }

            case ClickAction.LeftClick:
            {
                return(ClickType.LClk);
            }

            case ClickAction.LeftDrag:
            {
                if (start)
                {
                    return(ClickType.LDn);
                }
                else
                {
                    return(ClickType.LUp);
                }
            }

            default:     //case ClickAction.RightClick
            {
                return(ClickType.RClk);
            }
            }
        }
Example #9
0
 public SetBlockClientPacket( Block block, ClickAction clickAction, int x, int y, int z )
     : base(OpCode.SetBlockClient)
 {
     Coordinates = new Vector3I( x, y, z );
     Block = block;
     ClickAction = clickAction;
 }
Example #10
0
        public void TestMethod2()
        {
            var clickAction = new ClickAction
            {
                ActionType = ClickAction.Type.Activity,
                Activity   = "qwer2",
                ConfirmUrl = true,
                Intent     = "dsagdsag",
                Url        = "dsahggdsah://1215"
            };

            var json1 = clickAction.ToString();
            var json2 = clickAction.ToDictionary().Serialize();

            Assert.IsTrue(json1 == json2, "(1)json1 == json2");
            Console.WriteLine(nameof(json1));
            Console.WriteLine(json1);
            Console.WriteLine();
            Console.WriteLine(nameof(json2));
            Console.WriteLine(json2);

            var jsonObj = json2.Deserialize <ClickAction>();

            json2 = jsonObj.Serialize();

            Assert.IsTrue(json1 == json2, "(2)json1 == json2");
        }
Example #11
0
 private void mouse_Up(object sender, MouseEventArgs e)
 {
     RectangleDrawn = true;
     LeftButtonDown = false;
     CurrentAction  = ClickAction.NoClick;
     SaveSelection(false);
 }
Example #12
0
        public void drawRectOnOpen()
        {
            selectionOn    = true;
            selectingArea  = false;
            RectangleDrawn = true;
            LeftButtonDown = false;
            CurrentAction  = ClickAction.NoClick;



            CurrentTopLeft.X     = CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectX;
            CurrentTopLeft.Y     = CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectY;
            CurrentBottomRight.X = CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectX + CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectWidth;
            CurrentBottomRight.Y = CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectY + CameraRig.rig[CameraRig.drawCam].cam.MotionDetector.rectHeight;


            //CurrentTopLeft.X = (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectX");
            //CurrentTopLeft.Y = (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectY");
            //CurrentBottomRight.X = (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectX") + (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectWidth");
            //CurrentBottomRight.Y = (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectY") + (int)CameraRig.rigInfoGet(bubble.profileInUse, "rectHeight");

            //CurrentTopLeft.X = config.getProfile(bubble.profileInUse).rectX;
            //CurrentTopLeft.Y = config.getProfile(bubble.profileInUse).rectY;
            //CurrentBottomRight.X = config.getProfile(bubble.profileInUse).rectX + config.getProfile(bubble.profileInUse).rectWidth;
            //CurrentBottomRight.Y = config.getProfile(bubble.profileInUse).rectY + config.getProfile(bubble.profileInUse).rectHeight;


            rectDrawn = true;
            this.Invalidate();
        }
Example #13
0
        private void AddActionButton(ClickAction clickAction, Vector2 vector2)
        {
            ToolboxButton b = new ToolboxButton(getButtonRectangle(vector2));

            buttons.Add(b);
            actionMappings.Add(b, clickAction);
        }
Example #14
0
        public virtual async Task Click(IPlayer player, int slotIndex, ClickAction clickAction, Slot clickedItem)
        {
            switch (clickAction)
            {
            case ClickAction.LeftMouseClick:
            case ClickAction.RightMouseClick:

            case ClickAction.LeftMouseDragBegin:
            case ClickAction.LeftMouseAddSlot:
            case ClickAction.LeftMouseDragEnd:

            case ClickAction.RightMouseDragBegin:
            case ClickAction.RightMouseAddSlot:
            case ClickAction.RightMouseDragEnd:

            case ClickAction.DoubleClick:
                var slot = GlobalSlotIndexToLocal(slotIndex);
                await slot.SlotArea.Click(player, SlotAreas, slotIndex, slot.SlotIndex, clickAction, clickedItem);

                break;

            default:
                break;
            }
        }
Example #15
0
 public SetBlockClientPacket( SetBlockServerPacket packet, ClickAction clickAction )
     : base(OpCode.SetBlockClient)
 {
     Coordinates = packet.Coordinates;
     Block = packet.Block;
     ClickAction = clickAction;
 }
Example #16
0
 public SetBlockClientPacket( Block block, ClickAction clickAction, Vector3I coordinates )
     : base(OpCode.SetBlockClient)
 {
     Coordinates = coordinates;
     Block = block;
     ClickAction = clickAction;
 }
 private void InitializeProcedurePlanSummaryActionHandlers()
 {
     _procedurePlanActionHandler = new SimpleActionModel(new ResourceResolver(this.GetType().Assembly));
     _startAction       = _procedurePlanActionHandler.AddAction("start", SR.TitleStartMps, "Icons.StartToolSmall.png", SR.TitleStartMps, StartModalityProcedureSteps);
     _discontinueAction = _procedurePlanActionHandler.AddAction("discontinue", SR.TitleDiscontinueMps, "Icons.DeleteToolSmall.png", SR.TitleDiscontinueMps, DiscontinueModalityProcedureSteps);
     UpdateActionEnablement();
 }
Example #18
0
 void FillUnitItems(StateUnitModel unit, ClickAction <ItemModel> onClick, List <ItemModel> result)
 {
     foreach (var state in GetItemStates(unit))
     {
         result.Add(CreateModel(state, onClick));
     }
 }
Example #19
0
 public NavMenuItem()
 {
     ItemSelectedCommand = new RelayCommand(() =>
     {
         ClickAction.Invoke();
     });
 }
Example #20
0
        public static void RaisePlayerClickedEvent(Player player, Vector3I coords,
                                                   ClickAction action, Block block)
        {
            var handler = Clicked;

            handler?.Invoke(null, new PlayerClickedEventArgs(player, coords, action, block));
        }
Example #21
0
 internal PlayerClickedEventArgs([NotNull] Player player, Vector3I coords, ClickAction action, Block block)
 {
     Player = player ?? throw new ArgumentNullException(nameof(player));
     Coords = coords;
     Block  = block;
     Action = action;
 }
Example #22
0
        public void Set(string title, int idButton, ClickAction action)
        {
            m_Title.text = title;
            m_IdButton   = idButton;
            if (action != null)
            {
                EventTrigger.Entry entry = new EventTrigger.Entry();
                entry.eventID = EventTriggerType.PointerClick;
                entry.callback.AddListener((eventData) => { action(this); });

                if (m_EventTrigger != null)
                {
                    for (int i = m_EventTrigger.triggers.Count - 1; i >= 0; i--)
                    {
                        m_EventTrigger.triggers.RemoveAt(i);
                    }

                    m_EventTrigger.triggers.Add(entry);
                }
            }

            // Set pointer trigger

            /*EventTrigger.Entry entry = new EventTrigger.Entry();
             * entry.eventID = EventTriggerType.PointerClick;
             * entry.callback.AddListener((eventData) => { OnButtonClicked(this); });
             *
             * if (m_EventTrigger != null)
             * {
             *  m_EventTrigger.triggers.Remove(entry);
             *  m_EventTrigger.triggers.Add(entry);
             * }  */
        }
Example #23
0
        public async Task SendConditionMessage()
        {
            var app = AGConnectApp.Create(new AppOptions()
            {
                ClientId     = "11111111",
                ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
            });

            var msg = AGConnectMessaging.GetMessaging(app);

            await msg.SendAsync(new Message()
            {
                Notification = new Notification()
                {
                    Title = "Test Message",
                    Body  = "Detail Message",
                },
                Android = new AndroidConfig()
                {
                    Notification = new AndroidNotification()
                    {
                        ClickAction = ClickAction.OpenUrl("http://example.com")
                    }
                },
                Token = new string[] { "yyyyyyyyyyyyyyyyyy" }
            });
        }
Example #24
0
 public void EnrollAction(ClickAction clickAction)
 {
     if (clickActions == null)
     {
         clickActions = new List <ClickAction>();
     }
     clickActions.Add(clickAction);
 }
Example #25
0
 public void addClickAction(ClickAction clickActionToAdd)
 {
     //Adds clickActionToAdd if it does not exist in the List already
     if (!clickActions.Contains(clickActionToAdd))
     {
         clickActions.Add(clickActionToAdd);
     }
 }
Example #26
0
 public void removeClickAction(ClickAction clickActionToAdd)
 {
     //Removes clickActionToAdd if it exist in the List
     if (clickActions.Contains(clickActionToAdd))
     {
         clickActions.Add(clickActionToAdd);
     }
 }
Example #27
0
 public static void RaisePlayerClickedEvent( Player player, Vector3I coords,
                                      ClickAction action, Block block )
 {
     var handler = Clicked;
     if( handler != null ) {
         handler( null, new PlayerClickedEventArgs( player, coords, action, block ) );
     }
 }
        protected void RowClick(object sender, EventArgs e)
        {
            var senderView = sender as View;
            var position   = (int)senderView.GetTag(Resource.Id.Object_Position);
            var viewModel  = Items[position];

            ClickAction?.Invoke(viewModel, position);
        }
Example #29
0
 UnitModel CreateModel(int index, List <UnitState> states, ClickAction <UnitModel> onUnit, ClickAction <UnitModel> onPlaceholder)
 {
     if (states.Count > index)
     {
         return(CreateModel(states[index], index, onUnit));
     }
     return(CreatePlaceholder(index, onPlaceholder));
 }
    // Start is called before the first frame update
    void Start()
    {
        //init map reference
        map = GetComponent <SH_Map>();

        //init empty click action
        nextClickAction = ClickAction.none;
    }
        public async Task ClickWindow(byte windowId, short slot, ClickAction clickAction, short actionNumber, Slot clickedItem)
        {
            var window = GetWindow(windowId);
            await window.Window.Click(AttachedObject, slot, clickAction, clickedItem);

            await AttachedObject.GetComponent <ClientboundPacketComponent>().GetGenerator()
            .ConfirmTransaction(windowId, window.ActionNumber++, true);
        }
Example #32
0
        public List <ItemModel> GetAllUnitItems(StateUnitModel unit, ClickAction <ItemModel> onItem, ClickAction <ItemModel> onPlaceholder)
        {
            var result = new List <ItemModel>();

            FillUnitItems(unit, onItem, result);
            FillUnitPlaceholders(unit, onPlaceholder, result);
            return(result);
        }
 public void Start()
 {
     this.buttons = new bool[] { false, false, false, false }; // Buttons on the Falcon
     if (this.falcon = GameObject.Find("Tip"))
     {
         this.falconpos = Vector3.zero;
         eventListener  = GameObject.Find("Canvas").GetComponent <ClickAction>();
     }
 }
        public override void OnGUI()
        {
            var content = new GUIContent(Title, Icon);

            if (GUILayout.Button(content, EditorStyles.toolbarButton))
            {
                ClickAction?.Invoke();
            }
        }
Example #35
0
 public Button(Texture2D tex, Vector2 pos, ClickAction callback, Color tintOnHover, Color tintOnClick)
     : base(true)
 {
     _callback = callback;
     _texture = tex;
     _position = pos;
     _hoverTint = tintOnHover;
     _clickTint = tintOnClick;
     _clickableArea = new Rectangle((int)pos.X, (int)pos.Y, tex.Width, tex.Height);
 }
Example #36
0
 public Button(Texture2D tex, int x, int y, ClickAction callback, Color tintOnHover, Color tintOnClick)
     : base(true)
 {
     _callback = callback;
     _texture = tex;
     _position = new Vector2((float)x, (float)y);
     _hoverTint = tintOnHover;
     _clickTint = tintOnClick;
     _clickableArea = new Rectangle(x, y, tex.Width, tex.Height);
 }
 public bool SetButtonClickAction(ClickAction clickAction, string uri)
 {
     if (uri != null && clickAction == ClickAction.URI) {
     ButtonClickAction = clickAction;
     URI = uri;
     return true;
       } else {
     return SetButtonClickAction(clickAction);
       }
 }
 public bool SetButtonClickAction(ClickAction clickAction)
 {
     if (clickAction != ClickAction.URI) {
     ButtonClickAction = clickAction;
     URI = null;
     return true;
       } else {
     Debug.LogError("A non-null URI is required in order to set the ButtonClickAction to URI.");
     return false;
       }
 }
Example #39
0
 private void FindButtonComponent(Transform obj, ClickAction callback)
 {
     foreach(var component in obj.gameObject.GetComponents<Component>())
     {
         IButton buttonComponent = component as IButton;
         if(buttonComponent != null)
         {
             callback(buttonComponent);
         }
     }
 }
Example #40
0
		private void CreateActionSet()
		{
			_allActions = new List<IAction>();

			for (int i = 0; i < _actionSetup.Length / 3; ++i)
			{ 
				string actionId = _actionSetup[i, 0];
				string actionPath = _actionSetup[i, 1];
				string groupHint = _actionSetup[i, 2];

				ClickAction action = new ClickAction(actionId, new ActionPath(actionPath, null), ClickActionFlags.None, null);
				action.GroupHint = new GroupHint(groupHint);
				action.Persistent = true;

				_allActions.Add(action);
			}
		}
 private void DoAction(Tile tile, Tile nearest, ClickAction action)
 {
     Contract.Requires(tile != null);
     if (MapInfo == null)
     { return; }
     switch (action)
     {
         case ClickAction.ToggleWallBlocksLOS:
             if (nearest == null) { return; }
             if (tile.NoLOSBetweenTiles.Contains(nearest))
             {
                 tile.NoLOSBetweenTiles.Remove(nearest);
                 nearest.NoLOSBetweenTiles.Remove(tile);
             }
             else
             {
                 tile.NoLOSBetweenTiles.Remove(nearest);
                 nearest.NoLOSBetweenTiles.Remove(tile);
                 tile.NoLOSBetweenTiles.Add(nearest);
                 nearest.NoLOSBetweenTiles.Add(tile);
             }
             break;
         case ClickAction.ToggleSecret:
             if (!tile.HasSecret) { return; }
             bool newState = !tile.IsRevealed;
             foreach (Tile t in tile.Search(5, false, (t => t.HasSecret && t.IsRevealed != newState)).Flatten())
             {
                 t.IsRevealed = newState;
             }
             break;
         case ClickAction.MovePlayerMarker1:
             Tile start = MapInfo.PositionOfPlayer(1);
             if (start != null)
             {
                 bool animate = AnimatePlayerMovement;
                 IEnumerable<Tile> path = start.FindShortestPath(tile);
                 if (path != null)
                 {
                     int count = 0;
                     foreach (Tile step in path)
                     {
                         count++;
                         if (count % 2 != 0 && !animate)
                         { continue; }
                         if (animate)
                         { PlayerFollowingPath.Enqueue(step); }
                         else
                         {
                             MapInfo.MovePlayer(1, step);
                             MapInfo.RecalculateLightAndLineOfSight(true);
                         }
                     }
                 }
                 if (!animate || path == null)
                 { MapInfo.MovePlayer(1, tile); }
             }
             else
             { MapInfo.MovePlayer(1, tile); }
             ScrollTileToCenter(tile);
             break;
         case ClickAction.MovePlayerMarker2:
             MapInfo.MovePlayer(2, tile);
             break;
         case ClickAction.MovePlayerMarker3:
             MapInfo.MovePlayer(3, tile);
             break;
         case ClickAction.ToggleLightCustom:
             tile.LightSource = tile.LightSource == CustomLightLevel ? 0 : CustomLightLevel;
             break;
         case ClickAction.ToggleLight100:
             tile.LightSource = tile.LightSource == 20 ? 0 : 20;
             break;
         case ClickAction.ToggleLight50:
             tile.LightSource = tile.LightSource == 10 ? 0 : 10;
             break;
         case ClickAction.ToggleLight10:
             tile.LightSource = tile.LightSource == 5 ? 0 : 5;
             break;
         default:
             //do nothing
             break;
     }
     MapInfo.RecalculateLightAndLineOfSight();
     Refresh();
 }
Example #42
0
    /// <summary>
    /// 提供TOOLBAR按鈕單獨控制狀態
    /// </summary>
    /// <param name="BtnType">選取按鈕型態</param>
    /// <param name="IsEnable">按鈕是否有作用(資料巡覽列輸入任何值都由內部設定)</param>
    /// <param name="URL">如有需要URL,請輸入URL,否則輸入空白(資料巡覽列請輸入空白)</param>
    /// <param name="Btn">請輸入按鈕ID名稱,否則輸入null(資料巡覽列請輸入null)</param>
    /// <param name="CA">清輸入按鈕的行為,URL或是表單按鈕(資料巡覽列請輸入表單按鈕)</param>
    public void ButtonEnableControl(ButtonType BtnType,
                                    bool IsEnable,
                                    string URL,
                                    Button Btn,
                                    ClickAction CA
                                    )
    {
        switch (BtnType)
        {
            case ButtonType.Find:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnFindURL = URL;
                        _BtnFindControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnFindURL = "";
                        _BtnFindControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnFindEnable = IsEnable;                
                break;
            case ButtonType.FindExport:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnFindExportURL = URL;
                        _BtnFindExportControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnFindExportURL = "";
                        _BtnFindExportControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnFindExportEnable = IsEnable;                
                break;
            case ButtonType.New:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnNewURL = URL;
                        _BtnNewControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnNewURL = "";
                        _BtnNewControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnNewEnable = IsEnable;                
                break;
            case ButtonType.Copy:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnCopyURL = URL;
                        _BtnCopyControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnCopyURL = "";
                        _BtnCopyControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnCopyEnable = IsEnable;                
                break;
            case ButtonType.Edit:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnEditURL = URL;
                        _BtnEditControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnEditURL = "";
                        _BtnEditControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnEditEnable = IsEnable;                
                break;
            case ButtonType.Save:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnSaveURL = URL;
                        _BtnSaveControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnSaveURL = "";
                        _BtnSaveControlID = Btn;
                        break;
                    default:
                        break;
                }                
                BtnSaveEnable = IsEnable;                
                break;
            case ButtonType.Delete:
                switch (CA)
                {
                    case ClickAction.LinkURL:
                        _BtnDeleteURL = URL;
                        _BtnDeleteControlID = null;
                        break;
                    case ClickAction.ButtonClick:
                        _BtnDeleteURL = "";
                        _BtnDeleteControlID = Btn;
                        break;
                    default:
                        break;
                }                  
                BtnDeleteEnable = IsEnable;                
                break;
            case ButtonType.NavigateBarFirstRecord:
                BtnRecFirstEnable = false;
                BtnRecPreEnable = false;
                BtnRecNextEnable = true;
                BtnRecLastEnable = true;                
                break;
            case ButtonType.NavigateBarCenterRecord:
                BtnRecFirstEnable = true;
                BtnRecPreEnable = true;
                BtnRecNextEnable = true;
                BtnRecLastEnable = true;                
                break;
            case ButtonType.NavigateBarLastRecord:
                BtnRecFirstEnable = true;
                BtnRecPreEnable = true;
                BtnRecNextEnable = false;
                BtnRecLastEnable = false;                
                break;
            case ButtonType.NavigateBarJustOneRecord:
                BtnRecFirstEnable = false;
                BtnRecPreEnable = false;
                BtnRecNextEnable = false;
                BtnRecLastEnable = false;                
                break;
            default:
                break;
        }

        //無論是否開啟,最後都需加入權限判斷
        ProcessAuthority();
    }
Example #43
0
 public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
 {
     WindowId = stream.ReadInt8();
     SlotIndex = stream.ReadInt16();
     MouseButton = stream.ReadUInt8();
     TransactionId = stream.ReadInt16();
     Mode = stream.ReadUInt8();
     ClickedItem = ItemStack.FromStream(stream);
     if (Mode == 0)
     {
         if (MouseButton == 0)
         {
             if (SlotIndex == -999)
                 Action = ClickAction.DropAll;
             else
                 Action = ClickAction.LeftClick;
         }
         else if (MouseButton == 1)
         {
             if (SlotIndex == -999)
                 Action = ClickAction.Drop;
             else
                 Action = ClickAction.RightClick;
         }
         else
             Action = ClickAction.Invalid;
     }
     else if (Mode == 1)
     {
         if (MouseButton == 0)
             Action = ClickAction.ShiftLeftClick;
         else if (MouseButton == 1)
             Action = ClickAction.ShiftRightClick;
         else
             Action = ClickAction.Invalid;
     }
     else if (Mode == 2)
     {
         if (MouseButton == 0)
             Action = ClickAction.NumKey1;
         else if (MouseButton == 1)
             Action = ClickAction.NumKey2;
         else if (MouseButton == 2)
             Action = ClickAction.NumKey3;
         else if (MouseButton == 3)
             Action = ClickAction.NumKey4;
         else if (MouseButton == 4)
             Action = ClickAction.NumKey5;
         else if (MouseButton == 5)
             Action = ClickAction.NumKey6;
         else if (MouseButton == 6)
             Action = ClickAction.NumKey7;
         else if (MouseButton == 7)
             Action = ClickAction.NumKey8;
         else if (MouseButton == 8)
             Action = ClickAction.NumKey9;
         else
             Action = ClickAction.Invalid;
     }
     else if (Mode == 3)
     {
         if (MouseButton == 2)
             Action = ClickAction.MiddleClick;
         else
             Action = ClickAction.Invalid;
     }
     else if (Mode == 4)
     {
         if (SlotIndex == -999)
         {
             if (Mode == 0)
                 Action = ClickAction.LeftClickEdgeWithEmptyHand;
             else if (Mode == 1)
                 Action = ClickAction.RightClickEdgeWithEmptyHand;
             else
                 Action = ClickAction.Invalid;
         }
         else
         {
             if (Mode == 0)
                 Action = ClickAction.Drop;
             else if (Mode == 1)
                 Action = ClickAction.DropAll;
             else
                 Action = ClickAction.Invalid;
         }
     }
     else if (Mode == 5)
     {
         if (MouseButton == 0)
             Action = ClickAction.StartLeftClickPaint;
         else if (MouseButton == 1)
             Action = ClickAction.LeftMousePaintProgress;
         else if (MouseButton == 2)
             Action = ClickAction.EndLeftMousePaint;
         else if (MouseButton == 4)
             Action = ClickAction.StartRightClickPaint;
         else if (MouseButton == 5)
             Action = ClickAction.RightMousePaintProgress;
         else if (MouseButton == 6)
             Action = ClickAction.EndRightMousePaint;
         else
             Action = ClickAction.Invalid;
     }
     else if (Mode == 6)
         Action = ClickAction.DoubleClick;
     else
         Action = ClickAction.Invalid;
     return mode;
 }
Example #44
0
 private void ScreenArea_Load(object sender, EventArgs e)
 {
     if (Area != Rectangle.Empty)
     {
         CurrentTopLeft.X = Area.X;
         CurrentTopLeft.Y = Area.Y;
         RectangleWidth = Area.Width;
         RectangleHeight = Area.Height;
         CurrentBottomRight.X = CurrentTopLeft.X + RectangleWidth;
         CurrentBottomRight.Y = CurrentTopLeft.Y + RectangleHeight;
         ClickPoint = new Point(CurrentTopLeft.X, CurrentTopLeft.Y);
         RectangleDrawn = true;
         CurrentAction = ClickAction.NoClick;
     }
 }
Example #45
0
 internal PlayerClickedEventArgs( [NotNull] Player player, Vector3I coords, ClickAction action, Block block ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     Player = player;
     Coords = coords;
     Block = block;
     Action = action;
 }
 private void SetClickAction(Point cursor)
 {
     if (CursorPosition(cursor) == CursPos.BottomLine)
     {
         CurrentAction = ClickAction.BottomSizing;
     }
     if (CursorPosition(cursor) == CursPos.TopLine)
     {
         CurrentAction = ClickAction.TopSizing;
     }
     if (CursorPosition(cursor) == CursPos.LeftLine)
     {
         CurrentAction = ClickAction.LeftSizing;
     }
     if (CursorPosition(cursor) == CursPos.TopLeft)
     {
         CurrentAction = ClickAction.TopLeftSizing;
     }
     if (CursorPosition(cursor) == CursPos.BottomLeft)
     {
         CurrentAction = ClickAction.BottomLeftSizing;
     }
     if (CursorPosition(cursor) == CursPos.RightLine)
     {
         CurrentAction = ClickAction.RightSizing;
     }
     if (CursorPosition(cursor) == CursPos.TopRight)
     {
         CurrentAction = ClickAction.TopRightSizing;
     }
     if (CursorPosition(cursor) == CursPos.BottomRight)
     {
         CurrentAction = ClickAction.BottomRightSizing;
     }
     if (CursorPosition(cursor) == CursPos.WithinSelectionArea)
     {
         CurrentAction = ClickAction.Dragging;
     }
     if (CursorPosition(cursor) == CursPos.OutsideSelectionArea)
     {
         CurrentAction = ClickAction.Outside;
     }
 }
 private void mouse_Up(object sender, MouseEventArgs e)
 {
     selectingArea = false;
     RectangleDrawn = true;
     LeftButtonDown = false;
     CurrentAction = ClickAction.NoClick;
 }
 internal AboutToAbortRightClickState(ClickAction cursorAction)
     : base(cursorAction)
 {
 }
 internal AboutToAbortLeftDoubleClickState(ClickAction cursorAction)
     : base(cursorAction)
 {
 }
 private void OnMouseUp(object sender, MouseEventArgs e)
 {
     RectangleDrawn = true;
     LeftButtonDown = false;
     CurrentAction = ClickAction.NoClick;
 }
        private void SetClickAction()
        {
            switch (CursorPosition())
            {
                case CursPos.BottomLine:
                    CurrentAction = ClickAction.BottomSizing;
                    break;

                case CursPos.TopLine:
                    CurrentAction = ClickAction.TopSizing;
                    break;

                case CursPos.LeftLine:
                    CurrentAction = ClickAction.LeftSizing;
                    break;

                case CursPos.TopLeft:
                    CurrentAction = ClickAction.TopLeftSizing;
                    break;

                case CursPos.BottomLeft:
                    CurrentAction = ClickAction.BottomLeftSizing;
                    break;

                case CursPos.RightLine:
                    CurrentAction = ClickAction.RightSizing;
                    break;

                case CursPos.TopRight:
                    CurrentAction = ClickAction.TopRightSizing;
                    break;

                case CursPos.BottomRight:
                    CurrentAction = ClickAction.BottomRightSizing;
                    break;

                case CursPos.WithinSelectionArea:
                    CurrentAction = ClickAction.Dragging;
                    break;

                case CursPos.OutsideSelectionArea:
                    CurrentAction = ClickAction.Outside;
                    break;
            }
        }
Example #52
0
 static void RaisePlayerClickedEvent( Player player, Vector3I coords,
                                      ClickAction action, Block block ) {
     var handler = Clicked;
     if( handler != null ) {
         handler( null, new PlayerClickedEventArgs( player, coords, action, block ) );
     }
     player.Info.LastWorld = player.World.ClassyName;
     player.Info.LastWorldPos = player.Position.ToString();
 }        
        public void drawRectOnOpen()
        {
            selectionOn = true;
            selectingArea = false;
            RectangleDrawn = true;
            LeftButtonDown = false;
            CurrentAction = ClickAction.NoClick;

            CurrentTopLeft.X = CameraRig.rig[CameraRig.drawCam].cam.rectX;
            CurrentTopLeft.Y = CameraRig.rig[CameraRig.drawCam].cam.rectY;
            CurrentBottomRight.X = CameraRig.rig[CameraRig.drawCam].cam.rectX + CameraRig.rig[CameraRig.drawCam].cam.rectWidth;
            CurrentBottomRight.Y = CameraRig.rig[CameraRig.drawCam].cam.rectY + CameraRig.rig[CameraRig.drawCam].cam.rectHeight;

            rectDrawn = true;
            this.Invalidate();
        }
 internal AboutToAbortClickState(ClickAction cursorAction)
     : base(cursorAction)
 {
     this.MaxErrorMilliseconds = 300;
 }
Example #55
0
        void LeftClickHandler(MouseState mouseState)
        {
            bool uiClicked = false;

            // Send input to the UI
            uiClicked = UI.getInstance().Click(mouseState);

            // Find out if we clicked on any Actors
            if (!uiClicked)
            {
                bool actorClicked = false;

                actorClicked = MonsterManager.getInstance().Click(mouseState) || actorClicked;

                // If we didn't click on an Actor, we must be trying to move the currently selected actor to this location
                if (!actorClicked)
                {
                    Coordinate mapCoordinate = MouseToMap(mouseState);

                    if (this.clickAction == ClickAction.MOVE_MONSTER)
                    {
                        foreach (Actor actor in monsterManager.monsterCollection)
                        {
                            if (actor.Selected)
                            {
                                actor.SetDestination(Convert.ToInt32(mapCoordinate.x), Convert.ToInt32(mapCoordinate.y));
                                Map.getInstance().previewRoute = null;
                            }
                        }
                        this.clickAction = ClickAction.NO_ACTION;
                    }
                    else if (this.clickAction == ClickAction.SUMMON_MONSTER)
                    {
                        if (Map.getInstance().IsSummonLocation(Convert.ToInt32(mapCoordinate.x), Convert.ToInt32(mapCoordinate.y)))
                        {
                            monsterManager.Spawn(summonType, Convert.ToInt32(mapCoordinate.x), Convert.ToInt32(mapCoordinate.y), PlayerManager.getInstance().currentPlayer);
                            this.clickAction = ClickAction.NO_ACTION;
                        }
                    }
                }
            }
        }