Exemplo n.º 1
0
        private void SelectPost(UIAbstractStickyContainer sticky)
        {
            if (!AcceptSelections)
            {
                return;
            }
            var item = (UIMediumBulletinSummary)sticky;

            if (item.Item == null)
            {
                return;                    //or mode is edit
            }
            else
            {
                HIT.HITVM.Get().PlaySoundEvent(Model.UISounds.Click);
                HIT.HITVM.Get().PlaySoundEvent(Model.UISounds.Whoosh);
                //cancel tweens repositioning the bulletin items
                MayorTween?.Complete();
                SystemTween?.Complete();
                CommunityTween?.Complete();

                ScrollMayorLeft.Disabled     = true;
                ScrollSystemLeft.Disabled    = true;
                ScrollCommunityLeft.Disabled = true;

                ScrollMayorRight.Disabled     = true;
                ScrollSystemRight.Disabled    = true;
                ScrollCommunityRight.Disabled = true;

                GameFacade.Screens.Tween.To(item, 0.66f, new Dictionary <string, float>()
                {
                    { "X", (Size.X - item.Size.X * 3) / 2 },
                    { "Y", (Size.Y - (item.Size.Y * 3 - 30)) / 2 },
                    { "ScaleX", 3f }, { "ScaleY", 3f }
                }, TweenQuad.EaseOut);

                DynamicOverlay.SendToFront(item);

                OnSelection?.Invoke(item.Item);
            }
        }