Example #1
0
        void ShowWarning(bool show, string warningMessage = " ")
        {
            WarningGroup.SetHidden(!show);

            if (show)
            {
                TryAgainButton.SetTitle("try_again".LocalizedString("Title of the try again button"));
                WarningMessageLabel.SetText(warningMessage);
            }
        }
Example #2
0
    // Start is called before the first frame update
    private void Awake()
    {
        Screen.orientation = ScreenOrientation.Portrait;
        instance           = this;
        TryAgainButton.SetActive(false);
        RollButton.SetActive(true);
        planner.GetComponent <BoxCollider>().enabled = false;

        userName.text     = UserDetailsManager.userName;
        coins.text        = UserDetailsManager.userCoins.ToString();
        gamePlayText.text = UserDetailsManager.userName;
    }
Example #3
0
    void Start()
    {
        _backgroundManager = GameObject.FindGameObjectWithTag("Canvas").GetComponent <BackgroundManager>();
        _spriteManager     = GetComponent <SpriteManager>();
        _clariz            = GameObject.FindGameObjectWithTag("Clariz");
        _gerald            = GameObject.FindGameObjectWithTag("Gerald");

        _clarizRaycaster  = _clariz.GetComponent <ClarizRaycaster>();
        _clarizHealth     = _clariz.GetComponent <ClarizHealth>();
        _clarizAnimation  = _clariz.GetComponent <CharacterAnimation>();
        _characterControl = _clariz.GetComponent <CharacterControl>();
        _geraldAnimation  = _gerald.GetComponent <CharacterAnimation>();
        _geraldMovement   = _gerald.GetComponent <GeraldMovement>();
        _spawnManager     = GameObject.FindGameObjectWithTag("SpawnPoint").GetComponent <SpawnManager>();
        _tryAgainButton   = GameObject.FindGameObjectWithTag("TryAgainButton").GetComponent <TryAgainButton>();
        _loadingGiftText  = GameObject.FindGameObjectWithTag("LoadingGiftText");
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CreateWorkspaceButton.SetTitle(Resources.CreateNewWorkspace, UIControlState.Normal);
            HeadingLabel.Text = Resources.UhOh;
            TextLabel.Text    = Resources.NoWorkspaceErrorMessage;

            var screenWidth = UIScreen.MainScreen.Bounds.Width;

            PreferredContentSize = new CGSize
            {
                // ScreenWidth - 32 for 16pt margins on both sides
                Width  = screenWidth > 320 ? screenWidth - 32 : 312,
                Height = cardHeight
            };

            prepareViews();

            CreateWorkspaceButton.Rx()
            .BindAction(ViewModel.CreateWorkspaceWithDefaultName)
            .DisposedBy(DisposeBag);

            TryAgainButton.Rx()
            .BindAction(ViewModel.TryAgain)
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading
            .Invert()
            .Subscribe(CreateWorkspaceButton.Rx().Enabled())
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading
            .Invert()
            .Subscribe(TryAgainButton.Rx().IsVisibleWithFade())
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading.StartWith(false)
            .Subscribe(ActivityIndicatorView.Rx().IsVisibleWithFade())
            .DisposedBy(DisposeBag);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var screenWidth = UIScreen.MainScreen.Bounds.Width;

            PreferredContentSize = new CGSize
            {
                // ScreenWidth - 32 for 16pt margins on both sides
                Width  = screenWidth > 320 ? screenWidth - 32 : 312,
                Height = cardHeight
            };

            prepareViews();

            this.Bind(CreateWorkspaceButton.Rx().Tap(), ViewModel.CreateWorkspaceWithDefaultName);
            this.Bind(TryAgainButton.Rx().Tap(), ViewModel.TryAgain);

            this.Bind(ViewModel.IsLoading.Select(CommonFunctions.Invert), CreateWorkspaceButton.Rx().Enabled());
            this.Bind(ViewModel.IsLoading.Select(CommonFunctions.Invert), TryAgainButton.Rx().IsVisibleWithFade());
            this.Bind(ViewModel.IsLoading.StartWith(false), ActivityIndicatorView.Rx().IsVisibleWithFade());
        }
        void ReleaseDesignerOutlets()
        {
            if (CoffeeAnimationView != null)
            {
                CoffeeAnimationView.Dispose();
                CoffeeAnimationView = null;
            }

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

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

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

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

            if (TryAgainButton != null)
            {
                TryAgainButton.Dispose();
                TryAgainButton = null;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CreateWorkspaceButton.SetTitle(Resources.CreateNewWorkspace, UIControlState.Normal);
            HeadingLabel.Text = Resources.UhOh;
            TextLabel.Text    = Resources.NoWorkspaceErrorMessage;

            var tryAgainString = string.Format(Resources.NoWorkspaceOr, Resources.NoWorkspaceTryAgain);

            var rangeStart = tryAgainString.IndexOf(Resources.NoWorkspaceTryAgain, System.StringComparison.CurrentCulture);
            var rangeEnd   = Resources.NoWorkspaceTryAgain.Length;
            var range      = new NSRange(rangeStart, rangeEnd);

            var attributedString = new NSMutableAttributedString(
                tryAgainString,
                new UIStringAttributes {
                ForegroundColor = ColorAssets.Text
            });

            attributedString.AddAttributes(
                new UIStringAttributes {
                ForegroundColor = Colors.NoWorkspace.ActivityIndicator.ToNativeColor()
            },
                range);

            TryAgainButton.SetAttributedTitle(attributedString, UIControlState.Normal);

            var screenWidth = UIScreen.MainScreen.Bounds.Width;

            PreferredContentSize = new CGSize
            {
                // ScreenWidth - 32 for 16pt margins on both sides
                Width  = screenWidth > 320 ? screenWidth - 32 : 312,
                Height = cardHeight
            };

            prepareViews();

            CreateWorkspaceButton.Rx()
            .BindAction(ViewModel.CreateWorkspaceWithDefaultName)
            .DisposedBy(DisposeBag);

            TryAgainButton.Rx()
            .BindAction(ViewModel.TryAgain)
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading
            .Invert()
            .Subscribe(CreateWorkspaceButton.Rx().Enabled())
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading
            .Invert()
            .Subscribe(TryAgainButton.Rx().IsVisibleWithFade())
            .DisposedBy(DisposeBag);

            ViewModel.IsLoading.StartWith(false)
            .Subscribe(ActivityIndicatorView.Rx().IsVisibleWithFade())
            .DisposedBy(DisposeBag);
        }