Inheritance: MonoBehaviour, IPointerDownHandler
Ejemplo n.º 1
0
 public void Draw()
 {
     if (!IsVisible)
     {
         return;
     }
     DX.DrawBox(X - 1, Y - 1, X + Width + 1, Y + Height + 1, WindowBaseColor, DX.TRUE);
     DX.DrawBox(X - 1, Y - 1, X + Width + 1, Y + Height + 1, WindowFrameColor, DX.FALSE);
     ReloadButton.Draw();
     CloseButton.Draw();
     if (!IsHaveInfo)
     {
         FontAsset.Draw(TextFont, "Please Reload",
                        X + Width / 2 - FontAsset.GetDrawTextWidth(TextFont, "Please Reload") / 2,
                        Y + 60, TextColor
                        );
     }
     else if (IsReloading)
     {
         FontAsset.Draw(TextFont, "Loading...",
                        X + Width / 2 - FontAsset.GetDrawTextWidth(TextFont, "Loading...") / 2,
                        Y + 60, TextColor
                        );
     }
     else
     {
         foreach (var button in MatchesListButtons)
         {
             button.Draw();
             button.DrawText();
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新処理
 /// </summary>
 public void Update()
 {
     if (!IsVisible)
     {
         return;
     }
     if (ReloadButton.LeftClicked() && !IsReloading)
     {
         Task.Run(() => Reload());
     }
     if (CloseButton.LeftClicked())
     {
         IsVisible      = false;
         IsSelectedInfo = false;
         return;
     }
     if (IsReloading)
     {
         return;
     }
     foreach (var button in MatchesListButtons)
     {
         if (button.LeftClicked())
         {
             SelectedMatch  = Matches[button.Text];
             IsVisible      = false;
             IsSelectedInfo = true;
             break;
         }
     }
 }
Ejemplo n.º 3
0
 void Awake()
 {
     DontDestroyOnLoad(this);
     joystick     = GameObject.FindGameObjectWithTag("GameController").GetComponent <VirtualJoystick> ();
     mouseControl = GameObject.FindGameObjectWithTag("MouseArea").GetComponent <MouseController> ();
     fire         = GameObject.FindGameObjectWithTag("FireButton").GetComponent <UIbuttons> ();
     reload       = GameManagers.Instance.ReloadButton;
 }
        void ReleaseDesignerOutlets()
        {
            if (ApiLabel != null)
            {
                ApiLabel.Dispose();
                ApiLabel = null;
            }

            if (CalServiceLabel != null)
            {
                CalServiceLabel.Dispose();
                CalServiceLabel = null;
            }

            if (ConnectedToLabel != null)
            {
                ConnectedToLabel.Dispose();
                ConnectedToLabel = null;
            }

            if (ContentView != null)
            {
                ContentView.Dispose();
                ContentView = null;
            }

            if (CrmLabel != null)
            {
                CrmLabel.Dispose();
                CrmLabel = null;
            }

            if (ErrorButton != null)
            {
                ErrorButton.Dispose();
                ErrorButton = null;
            }

            if (NavigationBar != null)
            {
                NavigationBar.Dispose();
                NavigationBar = null;
            }

            if (ReloadButton != null)
            {
                ReloadButton.Dispose();
                ReloadButton = null;
            }

            if (VersonLabel != null)
            {
                VersonLabel.Dispose();
                VersonLabel = null;
            }
        }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     CheckForRootParent();
     if (rootParent != null && rootParent.tag == "Player")
     {
         ammoUI   = rootParent.Find("MainCanvas").Find("AmmunitionUI").GetComponent <Text>();
         reloadUI = rootParent.Find("MainCanvas").Find("ReloadButton").GetComponent <ReloadButton>();
         reloadUI.SetReloadValue(reloadTime);
         Reload();
     }
     InitializeSP();
 }
Ejemplo n.º 6
0
        private void MainForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F5)
            {
                ReloadButton.PerformClick();
            }

            if (e.KeyCode == Keys.L && e.Modifiers == Keys.Shift)
            {
                Columns    = new List <string>();
                Values     = new Dictionary <string, Dictionary <string, bool> >();
                HiddenRows = new HashSet <int>();

                FiltersButton.Enabled = false;
                ReloadButton.Enabled  = false;

                SelectFile();
                Settings = new SettingsController(this);
                ApplySettings();
            }
        }
Ejemplo n.º 7
0
        public override void LoadContent()
        {
            base.LoadContent();

            info_bulle           = "Your number of moves (min number of moves to succeed)";
            position_texte_score = new Vector2(16, 8);

            design_button   = new DesignButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\design"), new Vector2(4 * 32, 0));
            fire_button     = new FireButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\fire"), new Vector2(5 * 32, 0));
            water_button    = new WaterButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\water"), new Vector2(6 * 32, 0));
            music_button    = new MusicButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\music"), new Vector2(8 * 32, 0));
            sound_button    = new SoundButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\sound"), new Vector2(9 * 32, 0));
            refresh_button  = new ReloadButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\refresh"), new Vector2(11 * 32, 0));
            previous_button = new PreviousButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\previous"), new Vector2(13 * 32, 0));
            next_button     = new NextButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\next"), new Vector2(14 * 32, 0));
            menu_button     = new MenuButton(ScreenManager.Instance.Content.Load <Texture2D>(@"Graphics\Buttons\menu"), new Vector2(16 * 32, 0));

            MapManager.Instance.LoadContent();
            LevelManager.Instance.LoadContent();
            Actor.Instance.LoadContent();

            InitializeMusic();
        }
Ejemplo n.º 8
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     ProcessListView.SmallImageList = new ImageList();
     ReloadButton.PerformClick();
 }
    // Start is called before the first frame update
    private void Start()
    {
        Debug.Log("Level Controller has started!");
        Debug.LogFormat("Object name of {0}", name);
        // _projectilesPerTargets = Math.Max(1, 6 - difficulty);

        /*
         * _targets = FindObjectsOfType<Target>();
         * _targetsLeft = _targetsStart = _targets.Count();
         * _projectilesLeft = _projectilesStart = _targetsLeft * _projectilesPerTargets;
         */
        GameObject sceneObject; // =

        if (sceneController == null)
        {
            sceneController = FindObjectOfType <SceneController>();
            if (sceneController == null)
            {
                if (_of.FindObject("Scene Controller", out sceneObject))//GameObject.Find("Scene Controller");
                {
                    sceneController = sceneObject.GetComponent <SceneController>();
                }
            }
            else
            {
                Debug.Log("SceneController has been found by FindObjectOfType!");
            }
        }
        // Get the canvas for all the button related stuff
        //  GameObject canvasObject = GameObject.Find("Canvas");
        // buttons
        if (resultButton == null)
        {
            if (_of.FindCanvasObject("Results", out sceneObject))//GameObject.Find("Scene Controller");
            {
                resultButton = sceneObject.GetComponent <UnityEngine.UI.Button>();
            }
        }
        // sceneObject = GameObject.Find("Results");
        if (reloadButton == null)
        {
            if (_of.FindCanvasObject("Reset", out sceneObject))//GameObject.Find("Scene Controller");
            {
                reloadButton = sceneObject.GetComponent <ReloadButton>();
            }
        }
        // sceneObject = GameObject.Find("Reset");
        // Texts from buttons
        if (_of.FindButtonChild("Results", "Win_Lose", out sceneObject)) //GameObject.Find("Scene Controller");
        {
            resultsText = sceneObject.GetComponent <Text>();
        }
        if (_of.FindButtonChild("Projectile Count", "Projectile Count", out sceneObject)) //GameObject.Find("Scene Controller");
        {
            projectilesLeftText = sceneObject.GetComponent <Text>();
        }
        if (_of.FindButtonChild("Customers Left", "Customers Left", out sceneObject)) //GameObject.Find("Scene Controller");
        {
            targetsLeftText = sceneObject.GetComponent <Text>();
        }

        /*
         * sceneObject = GameObject.Find("Win_Lose");
         * sceneObject = GameObject.Find("Projectile Count");
         * sceneObject = GameObject.Find("Customers Left");
         */

        SetCountTexts();

        // Button in this specific path, based on the Hierarchy view, will be returned.
        // resultButton = GameObject.Find("/Canvas/Result button");
        switch (resultButton)
        {
        case null:
            Debug.LogError("Could not find the Result button!");
            // Debug.Log("Could not find the Result button!");
            break;

        default:
            Debug.Log("Found the Result button!");
            // _resultText = resultButton.GetComponentInChildren<Text>();
            resultButton.gameObject.SetActive(false);
            break;
        }
    }
Ejemplo n.º 10
0
        protected override void InitBindings()
        {
            Bindings.Add(this.SetBinding(() => ViewModel.CurrentData)
                         .WhenSourceChanges(async() =>
            {
                ProfilePageGeneralTabScrollingContainer.ScrollY = 0;

                if (string.IsNullOrEmpty(ViewModel.CurrentData.User.ImgUrl))
                {
                    ProfilePageGeneralTabAnimeUserImg.Visibility     = ViewStates.Invisible;
                    ProfilePageGeneralTabImagePlaceholder.Visibility = ViewStates.Visible;
                }
                else
                {
                    ProfilePageGeneralTabAnimeUserImg.Into(ViewModel.CurrentData.User.ImgUrl);
                    ProfilePageGeneralTabImagePlaceholder.Visibility = ViewStates.Gone;
                }


                ProfilePageGeneralTabDetailsList.SetAdapter(
                    ViewModel.CurrentData.Details.GetAdapter(GetDetailTemplateDelegate));

                ProfilePageGeneralTabFriendsGrid.ItemHeight    =
                    ProfilePageGeneralTabFriendsGrid.ItemWidth = DimensionsHelper.DpToPx(65);
                ProfilePageGeneralTabFriendsGrid.SetColumnWidth((int)ProfilePageGeneralTabFriendsGrid.ItemWidth);
                if (ViewModel.CurrentData.Friends.Any())
                {
                    ProfilePageGeneralTabFriendsGrid.Adapter =
                        ViewModel.CurrentData.Friends.GetAdapter(GetFriendTemplateDelegate);
                    ProfilePageGeneralTabFriendsEmptyNotice.Visibility = ViewStates.Gone;
                    ProfilePageGeneralTabMoreFriendsButton.Visibility  = ViewStates.Visible;
                }
                else
                {
                    ProfilePageGeneralTabFriendsGrid.Adapter           = null;
                    ProfilePageGeneralTabFriendsEmptyNotice.Visibility = ViewStates.Visible;
                    ProfilePageGeneralTabMoreFriendsButton.Visibility  = ViewStates.Gone;
                }

                await Task.Delay(500);
                PopulateComments();
            }));

            Bindings.Add(
                this.SetBinding(() => ViewModel.EmptyCommentsNoticeVisibility,
                                () => ProfilePageGeneralTabCommentsEmptyNotice.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibility));

            Bindings.Add(this.SetBinding(() => ViewModel.LoadingOhersLibrariesProgressVisiblity).WhenSourceChanges(() =>
            {
                if (ViewModel.LoadingOhersLibrariesProgressVisiblity)
                {
                    ProfilePageGeneralTabCompareList.Enabled = false;
                }
                else
                {
                    ProfilePageGeneralTabCompareList.Enabled = true;
                }
            }));

            Bindings.Add(this.SetBinding(() => ViewModel.CommentInputBoxVisibility).WhenSourceChanges(() =>
            {
                if (ViewModel.CommentInputBoxVisibility)
                {
                    ProfilePageGeneralTabCommentInput.Visibility      = ViewStates.Visible;
                    ProfilePageGeneralTabSendCommentButton.Visibility = ViewStates.Visible;
                }
                else
                {
                    ProfilePageGeneralTabCommentInput.Visibility      = ViewStates.Gone;
                    ProfilePageGeneralTabSendCommentButton.Visibility = ViewStates.Gone;
                }
            }));

            Bindings.Add(
                this.SetBinding(() => ViewModel.IsMyProfile,
                                () => ProfilePageGeneralTabCompareList.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibilityInverted));



            Bindings.Add(
                this.SetBinding(() => ViewModel.CommentText,
                                () => ProfilePageGeneralTabCommentInput.Text, BindingMode.TwoWay));

            Bindings.Add(
                this.SetBinding(() => ViewModel.PinProfileVisibility,
                                () => PinButton.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));

            Bindings.Add(
                this.SetBinding(() => ViewModel.LoadingCommentsVisiblity,
                                () => UpdateSpinner.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibility));


            Bindings.Add(this.SetBinding(() => ViewModel.IsPinned).WhenSourceChanges(() =>
            {
                if (!ViewModel.PinProfileVisibility)
                {
                    return;
                }

                if (ViewModel.IsPinned)
                {
                    PinButton.SetBackgroundColor(new Color(ResourceExtension.AccentColour));
                    PinButtonIcon.Rotation = 0;
                    PinButtonIcon.SetImageResource(Resource.Drawable.icon_unpin);
                }
                else
                {
                    PinButton.SetBackgroundColor(new Color(ResourceExtension.OpaqueAccentColour));
                    PinButtonIcon.Rotation = 45;
                    PinButtonIcon.SetImageResource(Resource.Drawable.icon_pin);
                }
            }));


            PinButton.SetOnClickListener(new OnClickListener(view =>
            {
                ViewModel.IsPinned     = !ViewModel.IsPinned;
                PinButtonIcon.Rotation = ViewModel.IsPinned ? 0 : 45;
            }));
            ProfilePageGeneralTabAnimeListButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateAnimeListCommand.Execute(null)));
            ProfilePageGeneralTabMangaListButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateMangaListCommand.Execute(null)));
            ProfilePageGeneralTabHistoryButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateHistoryCommand.Execute(null)));
            ProfilePageGeneralTabSendCommentButton.SetOnClickListener(new OnClickListener(v => ViewModel.SendCommentCommand.Execute(null)));
            ProfilePageGeneralTabActionButton.SetOnClickListener(new OnClickListener(v => ProfilePageGeneralTabActionButtonOnClick()));
            ProfilePageGeneralTabCompareList.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateComparisonCommand.Execute(null)));
            ProfilePageGeneralTabMoreFriendsButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateFriendsCommand.Execute(null)));
            ProfilePageGeneralTabMoreFriendsButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateFriendsCommand.Execute(null)));
            ReloadButton.SetOnClickListener(new OnClickListener(view => ViewModel.RefreshCommentsCommand.Execute(null)));


            PopulateComments();
            ProfilePageGeneralTabScrollingContainer.ViewTreeObserver.ScrollChanged -= ViewTreeObserverOnScrollChanged;
            ProfilePageGeneralTabScrollingContainer.ViewTreeObserver.ScrollChanged += ViewTreeObserverOnScrollChanged;
            ProfilePageGeneralTabScrollingContainer.Touch -= RootViewOnTouch;
            ProfilePageGeneralTabScrollingContainer.Touch += RootViewOnTouch;
            ProfilePageGeneralTabCommentsList.Touch       -= RootViewOnTouch;
            ProfilePageGeneralTabCommentsList.Touch       += RootViewOnTouch;
        }