Наследование: MonoBehaviour
Пример #1
0
 protected override void CreateAllButtonsByOrder()
 {
     m_ToggleSoundButton = new ToggleSoundButton(ScreenMenu);
     m_BgVolumeButton    = new BgVolumeButton(ScreenMenu);
     m_SeVolumeButton    = new SeVolumeButton(ScreenMenu);
     m_DoneButton        = new DoneButton(ScreenMenu, this);
 }
Пример #2
0
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

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

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

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

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

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

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

            if (webView != null)
            {
                webView.Dispose();
                webView = null;
            }
        }
Пример #4
0
    public void FinishPainting()
    {
        playerCharTransition.MakeTransition();
        DoneButton.SetActive(false);
        CameraController.camera.GetComponent <Es.InkPainter.Sample.MousePainter>().enabled = false;
        ReplayButton.SetActive(true);

        Texture texture = PaintWall.GetComponent <MeshRenderer>().materials[0].GetTexture("_BaseMap");

        RenderTexture.active = texture as RenderTexture;
        Texture2D tx = new Texture2D(texture.width, texture.height);

        tx.ReadPixels(new Rect(0, 0, tx.width, tx.height), 0, 0);
        tx.Apply();
        //Texture2D tx = texture as Texture2D;  // Texture2D.CreateExternalTexture(texture.width, texture.height, TextureFormat.RGBA32, true, false, texture.GetNativeTexturePtr());

        int redCount = 0;

        for (int x = 0; x < tx.width; x++)
        {
            for (int y = 0; y < tx.height; y++)
            {
                if (tx.GetPixel(x, y) == Color.red)
                {
                    redCount++;
                }
            }
        }
        float percent = redCount * 100 / (texture.width * texture.height);

        messager.ShowMessage("You've drawn " + percent + "% of the canvas", 10f);
        Debug.Log("You've drawn " + percent + "% of the canvas");
    }
Пример #5
0
 public AddTaskPage()
 {
     InitializeComponent();
     ToDoTitle.Completed += (s, e) => {
         DoneButton.Focus();
     };
 }
Пример #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            HeadingLabel.Text     = Resources.SelectCalendars;
            DescriptionLabel.Text = Resources.SelectCalendarsDescription;
            DoneButton.SetTitle(Resources.Done, UIControlState.Normal);

            var source = new SelectUserCalendarsTableViewSource(TableView);

            TableView.Source = source;

            DoneButton.Rx()
            .BindAction(ViewModel.Done)
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectCalendar.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.Done.Enabled
            .Subscribe(DoneButton.Rx().Enabled())
            .DisposedBy(DisposeBag);

            ViewModel.Done.Enabled
            .Select(alphaForEnabled)
            .Subscribe(DoneButton.Rx().AnimatedAlpha())
            .DisposedBy(DisposeBag);

            ViewModel.Calendars
            .Subscribe(TableView.Rx().ReloadSections(source))
            .DisposedBy(DisposeBag);
        }
Пример #7
0
 protected override void CreateAllButtonsByOrder()
 {
     m_WindowResizingButton  = new WindowResizingButton(ScreenMenu);
     m_FullScreenButton      = new FullScreenButton(ScreenMenu);
     m_MouseVisibilityButton = new MouseVisibilityButton(ScreenMenu);
     m_DoneButton            = new DoneButton(ScreenMenu, this);
 }
Пример #8
0
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

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

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

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

            if (textBox != null)
            {
                textBox.Dispose();
                textBox = null;
            }
        }
Пример #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CloseButton.SetCommand(ViewModel.CloseCommand);
            DoneButton.SetCommand(ViewModel.DoneCommand);
        }
 private void sampleRateTextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if ((e.Key == System.Windows.Input.Key.Enter) || (e.Key == System.Windows.Input.Key.Tab))
     {
         DoneButton.Focus(); // pass focus to another control
     }
 }
Пример #11
0
        void ReleaseDesignerOutlets()
        {
            if (AddButton != null)
            {
                AddButton.Dispose();
                AddButton = null;
            }

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

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

            if (TagTableView != null)
            {
                TagTableView.Dispose();
                TagTableView = null;
            }
        }
Пример #12
0
        private void SetupDebugHandlers()
        {
            PositionView.AddGestureRecognizer(new UITapGestureRecognizer(gr =>
            {
                var toRemove = _positionMaximised ? PositionViewMaximisedConstraints : PositionViewMiniConstraints;
                var toAdd    = _positionMaximised ? PositionViewMiniConstraints : PositionViewMaximisedConstraints;
                var fontSize = _positionMaximised ? MiniFont : MaxiFont;
                var radius   = _positionMaximised ? MiniRadius : MaxiRadius;

                UIView.AnimateNotify(.45, 0, .9f, 0, UIViewAnimationOptions.CurveEaseIn | UIViewAnimationOptions.AllowUserInteraction, () =>
                {
                    PositionView.Layer.CornerRadius = radius;
                    View.RemoveConstraints(toRemove);
                    View.AddConstraints(toAdd);
                    View.LayoutIfNeeded();
                }, null);

                UIView.Animate(.05,
                               () => PositionLabel.Alpha = 0,
                               () =>
                {
                    PositionLabel.Font = PositionLabel.Font.WithSize(fontSize);
                    UIView.Animate(.5, .1, UIViewAnimationOptions.CurveEaseOut, () => PositionLabel.Alpha = 1, null);
                });

                _positionMaximised = !_positionMaximised;
            }));

            TrackingStatusIndicator.AddGestureRecognizer(new UITapGestureRecognizer(gr => ToggleDebugOptions()));
            DoneButton.AddGestureRecognizer(new UITapGestureRecognizer(gr =>
            {
                DismissViewController(true, null);
                SoundManager.PlaySound("doorclose");
            }));
        }
Пример #13
0
 protected void Back()
 {
     NameLabel.Hide();
     NameBox.Hide();
     NameBox.Text = "";
     TypeLabeld.Hide();
     Typebox.Hide();
     OwnerLabel.Hide();
     OwnerBox.Hide();
     OwnerBox.Text = "";
     AddButton.Show();
     ViewButton.Show();
     BackButton.Hide();
     DoneButton.Hide();
     ScreenLabel.Hide();
     ScreenSpin.Hide();
     ScreenSpin.Text = "0";
     CatLabel.Hide();
     CatBox.Hide();
     ExcLabel.Hide();
     ExTablesButton.Hide();
     ExTablesButton.Active = false;
     HoursLabel.Hide();
     HoursBox.Hide();
     HoursBox.Text = "";
 }
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

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

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

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

            if (SkipButton != null)
            {
                SkipButton.Dispose();
                SkipButton = null;
            }
        }
Пример #15
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NameTakenErrorLabel.Text  = Resources.NameTakenError;
            TitleLabel.Text           = Resources.NewProject;
            NameTextField.Placeholder = Resources.ProjectName;
            DoneButton.SetTitle(Resources.Create, UIControlState.Normal);

            var heightConverter = new BoolToConstantValueConverter <nfloat>(nameAlreadyTakenHeight, 0);

            var bindingSet = this.CreateBindingSet <EditProjectViewController, EditProjectViewModel>();

            PrivateProjectSwitch.SetState(ViewModel.IsPrivate, false);

            //Commands
            bindingSet.Bind(DoneButton).To(vm => vm.DoneCommand);
            bindingSet.Bind(CloseButton).To(vm => vm.CloseCommand);
            bindingSet.Bind(ColorPickerOpeningView)
            .For(v => v.BindTap())
            .To(vm => vm.PickColorCommand);

            bindingSet.Bind(ClientLabel)
            .For(v => v.BindTap())
            .To(vm => vm.PickClientCommand);

            bindingSet.Bind(WorkspaceLabel)
            .For(v => v.BindTap())
            .To(vm => vm.PickWorkspaceCommand);

            bindingSet.Bind(ProjectNameUsedErrorTextHeight)
            .For(v => v.Constant)
            .To(vm => vm.IsNameAlreadyTaken)
            .WithConversion(heightConverter);

            bindingSet.Bind(PrivateProjectSwitch)
            .For(v => v.BindValueChanged())
            .To(vm => vm.TogglePrivateProjectCommand);

            //State
            bindingSet.Bind(NameTextField).To(vm => vm.Name);
            bindingSet.Bind(WorkspaceLabel).To(vm => vm.WorkspaceName);

            bindingSet.Bind(ColorCircleView)
            .For(v => v.BackgroundColor)
            .To(vm => vm.Color)
            .WithConversion(new MvxNativeColorValueConverter());

            bindingSet.Bind(DoneButton)
            .For(v => v.Enabled)
            .To(vm => vm.SaveEnabled);

            bindingSet.Bind(ClientLabel)
            .For(v => v.AttributedText)
            .To(vm => vm.ClientName)
            .WithConversion(new AddNewAttributedStringConverter(Resources.AddClient, ClientLabel.Font.CapHeight));

            bindingSet.Apply();
        }
Пример #16
0
 //adds UI buttons respective listeners
 void InitializeButtonListeners()
 {
     AddButton.GetComponent <Button>().onClick.AddListener(AddButtonClicked);
     RemoveButton.GetComponent <Button>().onClick.AddListener(RemoveButtonClicked);
     UndoButton.GetComponent <Button>().onClick.AddListener(UndoButtonClicked);
     DoneButton.GetComponent <Button>().onClick.AddListener(DoneButtonClicked);
     return;
 }
Пример #17
0
 private void BetInputEnterKey(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         e.Handled = true;
         DoneButton.PerformClick();
     }
 }
Пример #18
0
 public AddBookmark(string title, string url, MainWindow mw)
 {
     InitializeComponent();
     TitleBox.Text = title;
     _url          = url;
     DoneButton.Text("DONE");
     CloseButton.ImageSource("close_button.png");
     CloseButton.SetRippleMargin(1);
     CloseButton.SetImageScale(16);
     DoneButton.ChangeTextColor("#FF1ABC9C");
     mainWindow = mw;
 }
        public void Do_order_and_confirm(string _remark)
        {
            OrderDetailButton.TouchNoScroll();
            InsertButton.TouchNoScroll();

            ProductListTable.Input_to_cell_of_first_row_by_index(COL_CASE, "1");
            SubmitButton.TouchNoScroll();
            DoneButton.TouchNoScroll();

            DeliveryNote = _remark;
            SubmitButton.TouchNoScroll();
        }
 void ReleaseDesignerOutlets()
 {
     if (DetailsLabel != null)
     {
         DetailsLabel.Dispose();
         DetailsLabel = null;
     }
     if (DoneButton != null)
     {
         DoneButton.Dispose();
         DoneButton = null;
     }
 }
Пример #21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var source = new SelectUserCalendarsTableViewSource(TableView, ViewModel.Calendars);

            TableView.Source = source;

            this.Bind(DoneButton.Rx().Tap(), ViewModel.DoneAction);
            this.Bind(source.ItemSelected, ViewModel.SelectCalendarAction);
            this.Bind(ViewModel.DoneAction.Enabled, DoneButton.Rx().Enabled());
            this.Bind(ViewModel.DoneAction.Enabled.Select(alphaForEnabled), DoneButton.Rx().AnimatedAlpha());
        }
Пример #22
0
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (Grid != null)
            {
                Grid.Dispose();
                Grid = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (WaterTxtInput != null)
            {
                WaterTxtInput.Dispose();
                WaterTxtInput = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (ViewMeTextField != null)
            {
                ViewMeTextField.Dispose();
                ViewMeTextField = null;
            }
        }
Пример #26
0
        void SetupMethod()
        {
            AddPlayerButton.Show();
            NameLabel.Show();
            NameField.Show();
            DoneButton.Show();

            CurrentGame.Setup();

            DoneButton.Hide();
            AddPlayerButton.Hide();
            NameLabel.Hide();
            NameField.Hide();
            SetupGameButton.Hide();
            RunGameButton.Show();
        }
Пример #27
0
 protected void OnAddButtonClicked(object sender, EventArgs e)
 {
     DoneLabel.Hide();
     NameLabel.Show();
     NameBox.Show();
     TypeLabeld.Show();
     Typebox.Show();
     OwnerLabel.Show();
     OwnerBox.Show();
     AddButton.Hide();
     ViewButton.Hide();
     BackButton.Show();
     DoneButton.Show();
     HoursBox.Show();
     HoursLabel.Show();
 }
Пример #28
0
    private void OnLevelWasLoaded(int level)
    {
        _scoreDisplay = FindObjectOfType <ScoreDisplay>();
        _doneButton   = FindObjectOfType <DoneButton>();

        _requiredReceivers.Clear();
        _requiredReceivers.AddRange(FindObjectsOfType <SignalReceiver>());
        foreach (var receiver in _requiredReceivers)
        {
            receiver.OnReceiveStatusChanged.AddListener(CheckCompletion);
        }

        _levelCompleteScreen = FindObjectOfType <LevelCompleteScreen>();

        _scoreDisplay.SetLevelTitle(ActiveLevelId, _activeLevel.sceneTitle);

        _doneButton.Deactivate();
    }
Пример #29
0
 void AddPlayerMethod()
 {
     if (CurrentGame.Players.Count < 5)
     {
         HumanPlayer tempPlayer = new HumanPlayer(NameField.Text, RANDOM.Next());
         tempPlayer.OnTakingTurn      += TakingTurn;
         tempPlayer.OnGuessingGoal    += Guessing;
         tempPlayer.OnCoinValueChange += UpdateCoinDisplay;
         CurrentGame.Players.Add(tempPlayer);
         WriteLine(NameField.Text + " joined the game!");
         NameField.Clear();
         DoneButton.Show();
     }
     else
     {
         WriteLine("Cannot add new player.");
     }
 }
Пример #30
0
        private void prepareDisableConfirmationButtonOnboardingStep()
        {
            greyCheckmarkButtonImage = UIImage.FromBundle("icCheckGrey");
            greenCheckmarkButtonImage = UIImage.FromBundle("doneGreen");

            var disabledConfirmationButtonOnboardingStep
                = new DisabledConfirmationButtonOnboardingStep(
                    ViewModel.OnboardingStorage,
                    isDescriptionEmptySubject.AsObservable());

            disabledConfirmationButtonOnboardingDisposable
                = disabledConfirmationButtonOnboardingStep
                    .ShouldBeVisible
                    .Subscribe(visible => InvokeOnMainThread(() =>
                    {
                        var image = visible ? greyCheckmarkButtonImage : greenCheckmarkButtonImage;
                        DoneButton.SetImage(image, UIControlState.Normal);
                    }));
        }