Пример #1
0
        public NewPlayerScreen(Gamestate gamestate, PlayersManager playersManager, TextureManager textureManager) : base(gamestate, playersManager, ScreenType.NewPlayer)
        {
            PlayersManager.NewPlayer = new Player("", null, new Color(127, 127, 127), Gamestate, textureManager);

            Actors = new List <Actor>();
            Actors.Add(new TextInput(new Position(25, 25, 950, 100), Gamestate, new Vector2f(), 30, TextPosition.Middle, TextPosition.Middle, "Enter players name (4 to 10 characters):", HandleNameChange, 0));
            Actors.Add(new RangeInput(new Position(50, 140, 900, 50), Gamestate, PlayersManager, PlayersManager.NewPlayer.SymbolData.color.R, byte.MinValue, byte.MaxValue, Color.Red, HandleColorChange, 1));
            Actors.Add(new RangeInput(new Position(50, 205, 900, 50), Gamestate, PlayersManager, PlayersManager.NewPlayer.SymbolData.color.G, byte.MinValue, byte.MaxValue, Color.Green, HandleColorChange, 2));
            Actors.Add(new RangeInput(new Position(50, 270, 900, 50), Gamestate, PlayersManager, PlayersManager.NewPlayer.SymbolData.color.B, byte.MinValue, byte.MaxValue, Color.Blue, HandleColorChange, 3));

            if (textureManager.TexturesDictionary.ContainsKey(TextureType.Symbol))
            {
                int size        = 200;
                int marginOuter = 25;
                int marginInner = ((1000 - 2 * marginOuter) - (size * 4)) / 3;

                int i = 0;
                SymbolButtons = new List <SelectSymbolButton>();
                foreach (KeyValuePair <string, Texture> rawSymbol in textureManager.TexturesDictionary[TextureType.Symbol])
                {
                    Position curentPosition = new Position(marginOuter + i % 4 * (size + marginInner), 335 + (i / 4) * (size + marginInner), size, size);
                    SymbolButtons.Add(new SelectSymbolButton(curentPosition, Gamestate, PlayersManager, rawSymbol.Value, 0.8F, PlayersManager.NewPlayer.SymbolData.color));
                    i++;
                }
            }
            else
            {
                throw new Exception("Symbols have not been loaded");
            }

            CreatePlayerButton             = new ActionButton(new Position(150, 875, 825, 100), Gamestate, new Vector2f(), 40, TextPosition.Middle, TextPosition.Middle, "Save Player", SaveNewPlayer);
            CreatePlayerButton.ButtonState = ButtonState.Inactive;

            ReturnButton = new ReturnButton(new Position(25, 875, 100, 100), Gamestate, textureManager.TexturesDictionary[TextureType.Icon]["back"], Gamestate.PreviousScreen, Gamestate.SecondPreviousScreen);
        }
Пример #2
0
        /// <summary>
        /// The view for the SongSelect Screen.
        /// TODO: Cleanup this initializer
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="beatmaps">The list of beatmaps to show on this screen.</param>
        /// <param name="search">The starting string value of the SearchBar. Default is ""</param>
        public SongSelectionView(Screen screen, List <Beatmap> beatmaps, string search = "") : base(screen)
        {
            songSelectScreen = GetSongSelection();

            cards  = songSelectScreen.Cards;
            scores = new List <ScoreCard>();

            // Prepare backgrounds
            CurrentBackground = DefaultBackground;
            OldBackground     = DefaultBackground;

            // Set up beatmap cards
            for (int i = 0; i < beatmaps.Count; i++)
            {
                cards.Add(new BeatmapCard(beatmaps[i], i));
            }

            Anchor  searchBoxAnchor        = GetSkinnablePropertyAnchor("SearchBarAnchor");
            Vector2 searchBarStartPosition = Skin.GetConfigStartPosition("song_select", "Properties", "SearchBarStartPos");

            SearchBox = new SearchBox(search, searchBarStartPosition, searchBoxAnchor);

            int searchBarX = GetSkinnablePropertyInt("SearchBarX");
            int searchBarY = GetSkinnablePropertyInt("SearchBarY");

            SearchBox.Move(searchBarX, searchBarY);

            button_back = new ReturnButton("select_button_back", AnchorUtil.FindScreenPosition(Anchor.BottomLeft));
        }
Пример #3
0
 public void OnConnexionNonAnonymeClick()
 {
     EmailConnexion.SetActive(true);
     ReturnButton.SetActive(true);
     MenuButton.SetActive(false);
     ConnectedButton.SetActive(false);
 }
Пример #4
0
 protected override void SaveClick(object sender, EventArgs e)
 {
     lol = AC.AddAsync(_newStation.Text);
     ReturnButton.PerformClick();
     _name.Text       = "Podaj nową stacje";
     _newStation.Text = "";
 }
Пример #5
0
    public void InjectMetod(ReturnButton returnButton, IUserData user, TrainingBattel.Factory trainingFactory)
    {
        this.user            = user;
        this.trainingFactory = trainingFactory;
        this.returnButton    = returnButton;

        menuButtons.ForEach(x => x.SetListener(OnSelectBattel));
    }
Пример #6
0
    public void OnClassementClick()
    {
        connexion.GetMaxScoreValue();
        ClassementGUI.SetActive(true);
        ReturnButton.SetActive(true);
        MenuGUI.SetActive(false);
        MenuButton.SetActive(false);
        ConnectedButton.SetActive(false);

        ScoreManagerScript.Score = connexion.getMaxScore["MaxScore"];
    }
Пример #7
0
        private void AddButtons()
        {
            buttonBack     = new ReturnButton("result_button_back", AnchorUtil.FindScreenPosition(Anchor.BottomLeft));
            buttonRetry    = new RetryButton("result_button_retry", AnchorUtil.FindScreenPosition(Anchor.BottomRight));
            buttonAdvanced = new ButtonAdvanced(AnchorUtil.FindScreenPosition(Anchor.BottomLeft));

            // Move the advanced button to the right spot
            float width  = buttonAdvanced.Texture.Width;
            float height = buttonAdvanced.Texture.Height;

            buttonAdvanced.Move(new Vector2(width, -height));
        }
Пример #8
0
        public SettingsScreenView(Screen screen) : base(screen)
        {
            background  = new Background("settings_background");
            button_back = new ReturnButton("settings_button_back", AnchorUtil.FindScreenPosition(Anchor.BottomLeft));
            button_save = new SaveButton("settings_button_save", AnchorUtil.FindScreenPosition(Anchor.BottomRight));

            Groups = new List <SettingsGroup>();

            Groups.Add(new GameplaySettings(new Vector2(400, GetNextGroupPos())));
            Groups.Add(new AudioSettings(new Vector2(400, GetNextGroupPos())));
            Groups.Add(new BindingsSettings(new Vector2(400, GetNextGroupPos())));
        }
Пример #9
0
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        isChangingState                 = false;
        blackPanelAlpha.startValue      = 1f;
        blackPanelAlpha.endValue        = 0f;
        blackPanelAlpha.TweenCompleted += SceneFadeinFinishEvent;
        blackPanelAlpha.Begin();
        blackPanelAlpha.value = blackPanelAlpha.startValue;

        if (scene.buildIndex == (int)SCENE_INDEX.GAMESTAGE)
        {
            StageLoader.Instance().SetStage(StageLoader.NextStage);
            gameControlObj.SetActive(true);
            topCanvas.sortingOrder = 10;

            ReturnButton.SetActive(true);
            SettingShowButton.SetActive(true);

            if (StageLoader.CurrentStage == 1)
            {
                PlayerManager.Instance().playerController.isFainting = true;
            }

            GameManager.Instance().Time_LatestStartGame = DateTime.UtcNow;

            // #### TEST
            if (GameManager.Instance().IsTestMode)
            {
                testButton.gameObject.SetActive(true);
            }
            else
            {
                testButton.gameObject.SetActive(false);
            }
        }
        else
        {
            StageLoader.Instance().DisableStage();
            gameControlObj.SetActive(false);
            topCanvas.sortingOrder = 0;

            ReturnButton.SetActive(false);
            SettingShowButton.SetActive(false);

            testButton.gameObject.SetActive(false);
        }

        PlayerManager.Instance().IsTriggerEnding = false;

        StartBGM(scene);
        ChangeEnvironment(scene);
    }
Пример #10
0
    public void InjectMetod(List <IPanelUI> panels, ReturnButton returnButton, CollectionMenu collectionMenu)
    {
        (this.panels, this.returnButton) = (panels, returnButton);

        panels.ForEach(x => Customize(x));

        returnButton.SetListener(ToReturn);
        returnButton.transform.SetParent(transform, false);
        returnButton.transform.SetAsLastSibling();
        returnButton.SetActive(false);

        collectionMenu.SetListener(OpenPanel);
    }
Пример #11
0
 private void EmailText_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (TelefoneText.Enabled)
         {
             TelefoneText.Focus();
         }
         else
         {
             ReturnButton.Focus();
         }
     }
 }
Пример #12
0
    public void Start()
    {
        GameObject Satisfaction_gauge = GameObject.Find("Satisfaction_gauge");

        scene = Satisfaction_gauge.GetComponent <SatisfactionGauge>();
        SpriteRenderer spriteRenderer = gameObject.GetComponent <SpriteRenderer>();

        spriteRenderer.color = new Color32(0, 0, 0, 0);
        seflg = true;

        GameObject StartButton = GameObject.Find("StartButton");

        delete = StartButton.GetComponent <ReturnButton>();
    }
Пример #13
0
        /// <summary>
        /// Lists the button click.
        /// </summary>
        /// <returns>The button click.</returns>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.(the selected item)</param>
        protected virtual void listButton_Click(object sender, FileManagerTableSource.SelectedEventArgs e)
        {
            if (e.SelectedName.IsFile == true)
            {
                selectPath(e.SelectedName.Name);

                listButtonAction();
            }
            else
            {
                setQueryPath(e.SelectedName.Name);
                fileManagerDisplay();
                ReturnButton.SetTitle("<< " + e.SelectedName.Name, UIControlState.Normal);
            }
        }
Пример #14
0
    private void Awake()
    {
        var baseObjects = FindObjectsOfType <BaseMonoClass>();

        foreach (var item in baseObjects)
        {
            if (item is Interfaces.ICore)
            {
                (item as Interfaces.ICore).OnAwake();
            }
        }

        returnButton              = FindObjectOfType <ReturnButton>();
        SceneManager.sceneLoaded += SceneLoaded;
        DontDestroyOnLoad(this);
    }
Пример #15
0
        public PregameScreen(Gamestate gamestate, PlayersManager playersManager, TextureManager textureManager) : base(gamestate, playersManager, ScreenType.Pregame)
        {
            PlayersManager.NewPlayer = null;

            PlayerButtons = new List <TextButton>();
            PreparePlayerButtons();

            Text = new Text(new Position(25, 150, 950, 100), Gamestate, new Vector2f(), 50, TextPosition.Middle, TextPosition.Middle, "Select board size:");

            BoardSizeButtons = new List <ActionButton>();
            PrepareBoardSizeButtons();

            StartButton             = new ScreenChangeButton(new Position(25, BoardSizeButtons.Last().Position.Height + BoardSizeButtons.Last().Position.Y + 25, 950, 150), Gamestate, new Vector2f(), 60, TextPosition.Middle, TextPosition.Middle, "Start!", ScreenType.Game);
            StartButton.ButtonState = ButtonState.Inactive;

            ReturnButton = new ReturnButton(new Position(25, 875, 100, 100), Gamestate, textureManager.TexturesDictionary[TextureType.Icon]["back"], ScreenType.MenuScreen);
        }
Пример #16
0
    public void OnReturnClick()
    {
        ClassementGUI.SetActive(false);
        SuccesGUI.SetActive(false);
        ReturnButton.SetActive(false);
        EmailConnexion.SetActive(false);
        MenuGUI.SetActive(true);
        MenuButton.SetActive(true);
        ConnectedButton.SetActive(true);

        if (connexion.isconnectedWithAccount)
        {
            Compte.SetActive(false);
        }

        ScoreManagerScript.Score = 0;
        connexion.GetMaxScoreValue();
    }
Пример #17
0
 internal void UpdateReferences(NotificationBanner notiBanner, NotificationMenu notiMenu, ReturnButton retButton, Image quickNoti, TextMeshProUGUI quicknotitext, AuditionResultNotifications audResNots, MovieResultNotifications movResNot)
 {
     notificationBanner      = notiBanner;
     notificationMenu        = notiMenu;
     returnButton            = retButton;
     quickNotification       = quickNoti;
     quickNotiText           = quicknotitext;
     auditionResults         = audResNots;
     movieResults            = movResNot;
     notificationList        = new List <Notification>();
     onColor                 = quickNotification.color;
     offColor                = new Color(onColor.r, onColor.g, onColor.b, 0);
     quickNotification.color = offColor;
     onTextColor             = quickNotiText.color;
     offTextColor            = new Color(onTextColor.r, onTextColor.g, onTextColor.b, 0);
     quickNotiText.color     = offTextColor;
     quickNotification.transform.DOLocalMoveY(-1000, 0).SetDelay(2);
 }
Пример #18
0
    public void OnSuccesClick()
    {
        connexion.GetMaxScoreValue();
        SuccesGUI.SetActive(true);
        ReturnButton.SetActive(true);
        MenuGUI.SetActive(false);
        MenuButton.SetActive(false);
        ConnectedButton.SetActive(false);

        if (connexion.getMaxScore["MaxScore"] >= 10)
        {
            Succes[0].SetActive(true);
            if (connexion.getMaxScore["MaxScore"] >= 50)
            {
                Succes[1].SetActive(true);
                if (connexion.getMaxScore["MaxScore"] >= 100)
                {
                    Succes[2].SetActive(true);
                }
            }
        }
    }
Пример #19
0
        public PlayerSelectionScreen(Gamestate gamestate, PlayersManager playersManager, TextureManager textureManager, StatisticsManager statisticsManager) : base(gamestate, playersManager, ScreenType.PlayerSelectionScreen)
        {
            TextureManager    = textureManager;
            StatisticsManager = statisticsManager;

            PlayersManager.NewPlayer = null;

            CurrentPage = 0;

            CreatePlayerButton = new ScreenChangeButton(new Position(25, 25, 950, 100), Gamestate, new Vector2f(0, 0), 30, TextPosition.Middle, TextPosition.Middle, "Create new player", ScreenType.NewPlayer);

            GeneratePlayerButtons();

            PageButtons = new List <ChangePageButton>
            {
                new ChangePageButton(new Position(550, 875, 200, 100), Gamestate, new Vector2f(0, 0), 30, TextPosition.Middle, TextPosition.Middle, "Prev Page", ChangePage, false),
                new ChangePageButton(new Position(775, 875, 200, 100), Gamestate, new Vector2f(0, 0), 30, TextPosition.Middle, TextPosition.Middle, "Next Page", ChangePage, true)
            };
            RefreshPageButtonsState();

            ReturnButton = new ReturnButton(new Position(25, 875, 100, 100), Gamestate, TextureManager.TexturesDictionary[TextureType.Icon]["back"], Gamestate.PreviousScreen);
        }
Пример #20
0
        /// <summary>
        /// Returns the button click.
        /// </summary>
        /// <returns>The button click.</returns>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void returnButton_Click(object sender, EventArgs e)
        {
            char[]   seperater    = { '/' };
            string[] pathTemp     = _pathRightNow.Split(seperater);
            string   pathForQuery = string.Empty;

            if (pathTemp.Length > 2)
            {
                for (int i = 1; i < pathTemp.Length - 1; i++)
                {
                    pathForQuery += "/";
                    pathForQuery += pathTemp[i];
                }
            }
            else
            {
                pathForQuery += "/";
            }
            setQueryPath(pathForQuery);
            fileManagerDisplay();
            ReturnButton.SetTitle("<< " + pathForQuery, UIControlState.Normal);
        }
Пример #21
0
 private void UpdateQuests()
 {
     foreach (QuestObject activeQuest in activeQuestList)
     {
         if (!activeQuest.isCompleted)
         {
             //Debug.Log("spawn Length is " + activeQuest.GetQuestLocation().Count);
             markerObject.GetComponent <QuestMarkerScript>().MarkerPos(activeQuest.GetQuestLocation());
             if (activeQuest.CheckObjective())
             {
                 activeQuest.NextObjective();
                 isAnnounced = true;
             }
         }
         else
         {
             Destroy(markerObject);
             ReturnButton.GetComponent <ChangeButtonColor>().ChangeColor();
             ReturnButton.GetComponentInChildren <ReturnToHubText>().ChangeText();
             //completeQuestText.ChangeText();
             //completeQuestColor.ChangeColor();
         }
     }
 }
Пример #22
0
 public void Initialize(ICardFactory <ICard> cardFactory, ICollectionCardsData collection,
                        IFractionsData fractions, IUserData userDecks, FractionsMenu fractionMenu, ReturnButton returnButton) =>
 (this.cardFactory, this.collection, this.fractions, this.userDecks, this.fractionMenu, this.returnButton)
Пример #23
0
 public void InjectMetod(ReturnButton returnButton)
 {
     this.returnButton = returnButton;
     menuButtons.ForEach(x => x.SetListener(OnOpenSubPanel));
     quitGame.onClick.AddListener(QuitGame);
 }