Esempio n. 1
0
    private void SetupHome()
    {
        var score = hero.gold;

        if (completionValue == 0)
        {
            score -= 5000;
        }
        else
        {
            score += completionValue * 5;
        }

        var i = 0;

        foreach (var item in hero.items)
        {
            if (item != null)
            {
                heroItemsSlots[i].sprite = item.Sprite;
                score += item.Score;
                Debug.Log(score);
            }

            i++;
        }

        scoreText.text           = string.Format("Your score is {0}", score);
        insideBackground.texture = insideTexture;

        OnShow?.Invoke();
    }
Esempio n. 2
0
 public void Show(string title, RenderFragment content)
 {
     // if (contentType.BaseType != typeof(ComponentBase))
     //    throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
     // var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.CloseComponent(); });
     OnShow?.Invoke(title, content);
 }
Esempio n. 3
0
        //public Task Show<TModel>(Type contentType, TModel model)
        //{
        //    if (contentType.BaseType != typeof(ComponentBase))
        //    {
        //        throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
        //    }

        //    var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.AddAttribute(2, "Model", model); x.CloseComponent(); });

        //    return Show(content);
        //}

        public async Task Show(RenderFragment content, string containerClass)
        {
            if (OnShow != null)
            {
                await OnShow.Invoke(content, containerClass);
            }
        }
Esempio n. 4
0
            public override void OnScrolled(RecyclerView recyclerView, int dx, int dy)
            {
                base.OnScrolled(recyclerView, dx, dy);

                var visibleItemCount  = recyclerView.ChildCount;
                var totalItemCount    = recyclerView.GetAdapter().ItemCount;
                var pastVisiblesItems = LayoutManager.FindFirstVisibleItemPosition();

                if ((visibleItemCount + pastVisiblesItems) >= totalItemCount && !IsLoading && dy > 0)
                {
                    LoadMoreEvent?.Invoke(this, null);
                }

                if (scrolledDistance > HIDE_THRESHOLD && controlsVisible)
                {
                    OnHide?.Invoke(this, null);
                    controlsVisible  = false;
                    scrolledDistance = 0;
                }

                else if (scrolledDistance < -HIDE_THRESHOLD && !controlsVisible)
                {
                    OnShow?.Invoke(this, null);
                    controlsVisible  = true;
                    scrolledDistance = 0;
                }

                if ((controlsVisible && dy > 0) || (!controlsVisible && dy < 0))
                {
                    scrolledDistance += dy;
                }
            }
Esempio n. 5
0
 /// <summary>
 /// Displays the banner ad with a specified <a href="../manual/MonetizationPlacements.html">Placement</a>, and no callbacks.
 /// </summary>
 /// <param name="placementId">The unique identifier for a specific Placement, found on the <a href="https://operate.dashboard.unity3d.com/">developer dashboard</a>.</param>
 public void Show(string placementId)
 {
     loaded        = true;
     m_placementId = placementId;
     m_showing     = true;
     OnShow?.Invoke(this, new StartEventArgs(placementId));
 }
Esempio n. 6
0
        public void Show(string title, long userId)
        {
            List <UserTweet> _tweets = new List <UserTweet>();
            var user         = User.GetUserFromId(userId);
            var userTimeline = user.GetUserTimeline(new UserTimelineParameters
            {
                ExcludeReplies = true,
                IncludeRTS     = false,
                MaximumNumberOfTweetsToRetrieve = 10
            });

            foreach (var tweet in userTimeline)
            {
                if (!tweet.IsRetweet && tweet.InReplyToScreenName == null)
                {
                    var keys = _client.AnalyseKeyPhrases(tweet.Text);

                    _tweets.Add(new UserTweet
                    {
                        Text = string.Join(" - ", keys),
                        URL  = tweet.Url,
                        Date = tweet.CreatedAt
                    });
                }
            }
            OnShow?.Invoke(title, _tweets);
        }
Esempio n. 7
0
 public override void Init()
 {
     OnInit.AddListener(InitHealthPanel);
     OnShow.AddListener(ShowHealthPanel);
     OnClose.AddListener(CloseHealthPanel);
     base.Init();
 }
    public override void ShowElement()
    {
        gameObject.SetActive(true);
        StopAllCoroutines();

        switch (componentsToAnimate_SHOW)
        {
        case (ComponentsToAnimate.Transform):
            StartCoroutine(AnimateTransform_SHOW());
            break;

        case (ComponentsToAnimate.Graphic):
            StartCoroutine(AnimateGraphic_SHOW());
            break;

        case (ComponentsToAnimate.Both):
            StartCoroutine(AnimateTransformAndGraphic_SHOW());
            break;
        }

        if (OnShow != null)
        {
            OnShow.Invoke();
        }
    }
 protected async Task CallOnShow(TModel model, string containerClass)
 {
     if (OnShow != null)
     {
         await OnShow.Invoke(model, containerClass);
     }
 }
Esempio n. 10
0
 public override void Init()
 {
     OnInit.AddListener(InitToolTipPanel);
     OnShow.AddListener(ShowToolTipPanel);
     OnClose.AddListener(CloseToolTipPanel);
     base.Init();
 }
        /// <summary>
        /// Makes the element render and re-enables all of its functionality
        /// </summary>
        public virtual void Show()
        {
            Visible = true;
            _parent?.Append(this);

            OnShow?.Invoke(this);
        }
 internal async Task InternalShow()
 {
     if (OnShow.HasDelegate)
     {
         _ = OnShow.InvokeAsync(this);
     }
     _active = true;
 }
Esempio n. 13
0
 public void Show()
 {
     foreach (var data in FieldData.Cells)
     {
         Field.GetCell(data.FieldPosition);
     }
     OnShow?.Invoke();
 }
Esempio n. 14
0
 public void SetAsLoading()
 {
     // loading = true;
     // if (contentType.BaseType != typeof(ComponentBase))
     //    throw new ArgumentException($"{contentType.FullName} must be a Blazor Component");
     // var content = new RenderFragment(x => { x.OpenComponent(1, contentType); x.CloseComponent(); });
     OnShow?.Invoke();
 }
Esempio n. 15
0
 public void Show(int galaxiesAmount)
 {
     Amount = galaxiesAmount;
     transform.localScale = Vector3.one;
     gameObject.SetActive(true);
     amountField.text = Regex.Replace(amountField.text, "\\d+", galaxiesAmount.ToString());
     OnShow.Dispatch(galaxiesAmount);
 }
Esempio n. 16
0
 public void Show()
 {
     JSRuntime.InvokeVoidAsync("klazor.showModal", $"#{Id}");
     if (OnShow.HasDelegate)
     {
         OnShow.InvokeAsync(this);
     }
 }
Esempio n. 17
0
 public async Task Show(string Titulo, object DataSouce, string[] ColumnasMostar, bool PermiteAgregar,
                        bool PermiteEditar, bool PermiteEliminar, bool HabilitaPaginacion, bool HabilitarBuscadorColumna,
                        bool HabilitarMenuColumna, EventCallback <object> EnviarSeleccionado)
 {
     await OnShow?.Invoke(Titulo, DataSouce, ColumnasMostar, PermiteAgregar,
                          PermiteEditar, PermiteEliminar, HabilitaPaginacion, HabilitarBuscadorColumna,
                          HabilitarMenuColumna, EnviarSeleccionado);
 }
Esempio n. 18
0
        /// <summary>
        /// Shows toast by specified setting action.
        /// </summary>
        /// <param name="settingAction">The setting action.</param>
        public void Show(Action <ToastSetting> settingAction)
        {
            var setting = new ToastSetting();

            settingAction(setting);

            OnShow?.Invoke(setting);
        }
Esempio n. 19
0
        public virtual bool Maximize()
        {
            if (!GameManager.Is(FGameState.InGame | FGameState.GamePaused))
            {
                //Debug.Log("Can't maximize in " + name + ", not in game or paused");
                return(false);
            }

            if (Maximized || mMaximizing)
            {
                //Debug.Log("Already maximize in " + name + ", proceeding");
                return(true);
            }

            if (!ReadyToMaximize)
            {
                //Debug.Log("Not ready to maximize in " + name);
                return(false);
            }

            if (!GUIManager.Get.GetFocus(this))
            {
                //Debug.Log("Couldn't get focus to maximized in " + name);
                return(false);
            }

            mMaximizing = true;

            SendToggleInterfaceAction();

            GetPlayerAttention = false;

            if (MaximizeAvatarAction != AvatarAction.NoAction)
            {
                //Player.Get.AvatarActions.ReceiveAction (MaximizeAvatarAction, WorldClock.AdjustedRealTime);
            }

            for (int i = 0; i < MasterAnchors.Count; i++)
            {
                MasterAnchors[i].relativeOffset = Vector2.zero;
            }

            if (DisableGameObjectOnMinimize)
            {
                gameObject.SetActive(true);
            }

            MinimizeAllBut(Name);
            mMaximized = true;
            OnShow.SafeInvoke();

            //while we're here, run the garbage collector! players won't notice a slight lag
            System.GC.Collect();

            mLastTimeMaximized = WorldClock.RealTime;
            mMaximizing        = false;
            return(true);
        }
Esempio n. 20
0
 public void Show()
 {
     foreach (var gobj in items)
     {
         gobj.SetActive(true);
     }
     _active = true;
     OnShow?.Invoke();
 }
Esempio n. 21
0
        /// <summary>
        /// Shows the debug menu
        /// </summary>
        public void Show()
        {
            rootObject.SetActive(true);

            if (OnShow != null)
            {
                OnShow.Invoke();
            }
        }
Esempio n. 22
0
    private void InitializeStore()
    {
        carpenterCanvas.gameObject.SetActive(true);
        dialogText.text  = string.Format(welcomeDialog, currentCarpenter.houseTiers[currentHomeTier].value);
        audioSource.clip = openDoor;
        audioSource.Play();

        OnShow?.Invoke();
    }
Esempio n. 23
0
        internal async Task Show(int?overlayLeft = null, int?overlayTop = null)
        {
            if (_isOverlayShow || Trigger.Disabled)
            {
                return;
            }

            Element trigger = await JsInvokeAsync <Element>(JSInteropConstants.GetFirstChildDomInfo, Trigger.Ref);

            // fix bug in submenu: Overlay show when OvelayTrigger is not rendered complete.
            // I try to render Overlay when OvelayTrigger’s OnAfterRender is called, but is still get negative absoluteLeft
            // This may be a bad solution, but for now I can only do it this way.
            while (trigger.absoluteLeft <= 0 && trigger.clientWidth <= 0)
            {
                await Task.Delay(50);

                trigger = await JsInvokeAsync <Element>(JSInteropConstants.GetFirstChildDomInfo, Trigger.Ref);
            }

            _overlayLeft = overlayLeft;
            _overlayTop  = overlayTop;

            if (_isOverlayFirstRender)
            {
                _isWaitForOverlayFirstRender = true;

                StateHasChanged();
                return;
            }

            _isOverlayShow   = true;
            _isOverlayHiding = false;

            await UpdateParentOverlayState(true);

            await AddOverlayToBody();

            Element overlayElement = await JsInvokeAsync <Element>(JSInteropConstants.GetDomInfo, Ref);

            Element containerElement = await JsInvokeAsync <Element>(JSInteropConstants.GetDomInfo, Trigger.PopupContainerSelector);

            int left = GetOverlayLeft(trigger, overlayElement, containerElement);
            int top  = GetOverlayTop(trigger, overlayElement, containerElement);

            int zIndex = await JsInvokeAsync <int>(JSInteropConstants.GetMaxZIndex);

            _overlayStyle = $"z-index:{zIndex};left: {left}px;top: {top}px;{GetTransformOrigin()}";

            _overlayCls = Trigger.GetOverlayEnterClass();

            await Trigger.OnVisibleChange.InvokeAsync(true);

            StateHasChanged();

            OnShow?.Invoke();
        }
Esempio n. 24
0
    public void OnDestroy()
    {
        if (OnFocus != null)
        {
            foreach (Delegate d in OnFocus.GetInvocationList())
            {
                OnFocus -= (Action <IDialog>)d;
            }
            OnFocus = null;
        }

        if (OnBlur != null)
        {
            foreach (Delegate d in OnBlur.GetInvocationList())
            {
                OnBlur -= (Action <IDialog>)d;
            }
            OnBlur = null;
        }

        if (OnShow != null)
        {
            foreach (Delegate d in OnShow.GetInvocationList())
            {
                OnShow -= (Action <IDialog>)d;
            }
            OnShow = null;
        }

        if (OnHide != null)
        {
            foreach (Delegate d in OnHide.GetInvocationList())
            {
                OnHide -= (Action <IDialog>)d;
            }
            OnHide = null;
        }

        if (OnClose != null)
        {
            foreach (Delegate d in OnClose.GetInvocationList())
            {
                OnClose -= (Action <IDialog>)d;
            }
            OnClose = null;
        }

        if (OnCancel != null)
        {
            foreach (Delegate d in OnCancel.GetInvocationList())
            {
                OnCancel -= (Action <IDialog>)d;
            }
            OnCancel = null;
        }
    }
Esempio n. 25
0
 public override void Init()
 {
     OnInit.AddListener(InitDialogPanel);
     OnShow.AddListener(ShowDialogPanel);
     OnClose.AddListener(CloseDialogPanel);
     GameManager.Singleton.dialogMgr.OnTyping.AddListener(ShowDialog);
     GameManager.Singleton.dialogMgr.OnNextSentence.AddListener(ClearDialog);
     GameManager.Singleton.dialogMgr.OnOff.AddListener(RecycleDialogPanel);
     base.Init();
 }
Esempio n. 26
0
 public void Show()
 {
     Shown = true;
     if (StateHasChanged == null)
     {
         throw new ArgumentNullException(nameof(StateHasChanged));
     }
     StateHasChanged.Invoke();
     OnShow?.Invoke();
 }
Esempio n. 27
0
 public SearchConfiguration(string title, string director, string genre, string cast, int year, string award, OnShow isOnShow)
 {
     Title    = title;
     Director = director;
     Genre    = genre;
     Cast     = cast;
     Year     = year;
     Award    = award;
     IsOnShow = isOnShow;
 }
Esempio n. 28
0
        public void Show()
        {
            if (!mInitialized)
            {
                return;
            }

            OnShow.SafeInvoke();
            SetSelection(DefaultPanel);
        }
Esempio n. 29
0
        protected void Show(string message, ToastType type)
        {
            var toast = new Toast
            {
                Id   = Guid.NewGuid(),
                Body = message,
                Type = type
            };

            OnShow?.Invoke(toast);
        }
Esempio n. 30
0
        /// <summary>
        /// Shows the modal using the specified <paramref name="title"/> and <paramref name="componentType"/>,
        /// passing the specified <paramref name="parameters"/> and setting a custom CSS style.
        /// </summary>
        /// <param name="title">Modal title.</param>
        /// <param name="componentType">Type of component to display.</param>
        /// <param name="parameters">Key/Value collection of parameters to pass to component being displayed.</param>
        /// <param name="options">Options to configure the modal.</param>
        public void Show(string title, Type componentType, ModalParameters parameters, ModalOptions options)
        {
            if (!typeof(ComponentBase).IsAssignableFrom(componentType))
            {
                throw new ArgumentException($"{componentType.FullName} must be a Blazor Component");
            }

            var content = new RenderFragment(x => { x.OpenComponent(1, componentType); x.CloseComponent(); });

            OnShow?.Invoke(title, content, parameters, options);
        }