示例#1
0
 void connectSignals()
 {
     downButton.Connect("pressed", this, nameof(onDownButtonPressed));
     leftButton.Connect("pressed", this, nameof(onLeftButtonPressed));
     rightButton.Connect("pressed", this, nameof(onRightButtonPressed));
     upButton.Connect("pressed", this, nameof(onUpButtonPressed));
 }
示例#2
0
 void connectSignals()
 {
     switchDownButton.Connect("pressed", this, nameof(onSwitchDownButtonPressed));
     switchLeftButton.Connect("pressed", this, nameof(onSwitchLeftButtonPressed));
     switchRightButton.Connect("pressed", this, nameof(onSwitchRightButtonPressed));
     switchUpButton.Connect("pressed", this, nameof(onSwitchUpButtonPressed));
 }
示例#3
0
        /// <summary>
        /// Initializes the control.
        /// </summary>
        /// <param name="teammate">Teammate model to initialize the control from.</param>
        /// <param name="addIcon">Texture of the add icon.</param>
        /// <param name="removeIcon">Texture of the remove icon.</param>
        public void Init(Teammate teammate, Texture addIcon, Texture removeIcon)
        {
            Teammate = teammate;
            var actionIcon  = teammate.IsAddedToTeam ? removeIcon : addIcon;
            var usedTexture = teammate.IsAddedToTeam ? teammate.SmallTexture : teammate.BigTexture;

            _verticalContainer = GetNode <VBoxContainer>("VerticalContainer");
            _teammateButton    = _verticalContainer.GetNode <TextureButton>("TeammateButton");
            _actionIcon        = _teammateButton.GetNode <TextureRect>("ActionIcon");
            _teammateName      = _verticalContainer.GetNode <Label>("CenterContainer/TeammateName");

            _teammateButton.TextureNormal = usedTexture;

            var teammateButtonSize = _teammateButton.TextureNormal.GetSize();

            this.RectMinSize = _teammateButton.TextureNormal.GetSize();

            _teammateName.Text  = teammate.Name;
            _actionIcon.Texture = teammate.IsAddedToTeam ? actionIcon : actionIcon;

            var actionIconSize = _actionIcon.Texture.GetSize();

            _actionIcon.SetPosition(new Vector2(teammateButtonSize.x - actionIconSize.x, teammateButtonSize.y - actionIconSize.y));

            _teammateButton.Connect("pressed", this, nameof(OnClick));

            _verticalContainer.Set("custom_constants/separation", VerticalContainerSeparation);
            _teammateName.AddFontOverride("font", Font);

            if (LabelColor.HasValue)
            {
                _teammateName.AddColorOverride("font_color", LabelColor.Value);
            }
        }
    public override void _Ready()
    {
        camera      = GetNode <Camera>("Camera");
        floor_check = GetNode <RayCast>("floor_check");

        screen_lock_unlock_button = GetNode <TextureButton>("lock_button");
        screen_lock_unlock_button.Connect("pressed", this, nameof(screen_lock));
    }
示例#5
0
        public override void _Ready()
        {
            _resumeButton   = GetNode <TextureButton>(resumeButtonNodePath);
            _mainMenuButton = GetNode <TextureButton>(mainMenuButtonNodePath);

            _resumeButton.Connect("pressed", this, nameof(HidePauseMenu));
            _mainMenuButton.Connect("pressed", this, nameof(HandleMainMenuClicked));
        }
示例#6
0
 public override void _Ready()
 {
     _soundButton = GetNode <TextureButton>("SoundButton");
     _exitButton  = GetNode <Button>("ExitGame");
     _exitButton.Connect("pressed", this, nameof(exitGame));
     _soundButton.Connect("pressed", this, nameof(changeSpeaker));
     _speaker    = GetNode <Sprite>("Speaker");
     _speakerOff = GetNode <Sprite>("SpeakerOff");
 }
示例#7
0
    public override void _Ready()
    {
        // GetNode("Menu/CenterRow/Buttons").Connect("pressed", this, nameof(OnButtonPressed), new Godot.Collections.Array() { button.scene_to_load });
        this.game      = (Game)GetNode("/root/Game");
        this.replayBtn = (TextureButton)GetNode("UI/ReplayBtn");
        this.exitBtn   = (TextureButton)GetNode("UI/ExitBtn");

        replayBtn.Connect("pressed", this, nameof(replayButtonPressed));
        exitBtn.Connect("pressed", this, nameof(exitButtonPressed));
    }
示例#8
0
 void connectSignals()
 {
     careerButton.Connect("pressed", this, nameof(onCareerButtonPressed));
     creditsButton.Connect("pressed", this, nameof(onCreditsButtonPressed));
     editStadiumButton.Connect("pressed", this, nameof(onEditStadiumButtonPressed));
     exitButton.Connect("pressed", this, nameof(onExitButtonPressed));
     quickMatchButton.Connect("pressed", this, nameof(onQuickMatchButtonPressed));
     settingsButton.Connect("pressed", this, nameof(onSettingsButtonPressed));
     tournamentButton.Connect("pressed", this, nameof(onTournamentButtonPressed));
     webButton.Connect("pressed", this, nameof(onWebButtonPressed));
 }
示例#9
0
    public override void _Ready()
    {
        randTurnOrder();
        Data.WaitingForMove = true;

        MoveButton = (TextureButton)GetNode("HUD").GetNode("MoveButton");
        hud        = (HUD)GetNode("HUD");
        pitch      = (Pitch)GetNode("Pitch");

        MoveButton.Connect("pressed", this, nameof(onMoved));
        Pitch.Scored += onScored;
    }
示例#10
0
    public void ConnectSignals()
    {
        PlayBtn.Connect("pressed", this, nameof(PlayStream));
        StopBtn.Connect("pressed", this, nameof(StopStream));
        NextBtn.Connect("pressed", this, nameof(NextStation));
        Radio.Connect("index_pressed", this, nameof(RadioPressed));
        VolumeBar.Connect("value_changed", this, nameof(ChangeVolume));
        AddStation.Connect("pressed", this, nameof(PopupAddStation));
        NewStation.Connect("confirmed", this, nameof(AddNewStation));

        StationHandler.Connect(nameof(StationHandler.AddNewStation), this, nameof(AddRadioItem));
    }
示例#11
0
        public override void _Ready()
        {
            Board = GetParent <UI>().GetParent <BoardNode>();

            Tcs = new TaskCompletionSource <Piece.PieceType>();

            Rook   = GetNode <TextureButton>("Choices/Rook");
            Knight = GetNode <TextureButton>("Choices/Knight");
            Bishop = GetNode <TextureButton>("Choices/Bishop");
            Queen  = GetNode <TextureButton>("Choices/Queen");

            Rook.Connect("pressed", this, nameof(RookChosen));
            Knight.Connect("pressed", this, nameof(KnightChosen));
            Bishop.Connect("pressed", this, nameof(BishopChosen));
            Queen.Connect("pressed", this, nameof(QueenChosen));
        }
示例#12
0
        /// <summary>
        /// Initializes the control.
        /// </summary>
        /// <param name="possibleValues">Array of possible values, typed as input model.</param>
        /// <param name="valuesShown">Number of values shown in the control.</param>
        /// <param name="canJumpBounds">Sets whether the control can scroll from last element to the first one.</param>
        /// <param name="leftButtonTexture">Texture of the left scroll button.</param>
        /// <param name="rightButtonTexture">Texture of the right scroll button.</param>
        public virtual void Init(U[] possibleValues, int valuesShown, bool canJumpBounds,
                                 Texture leftButtonTexture, Texture rightButtonTexture)
        {
            _canJumpBounds  = canJumpBounds;
            _possibleValues = TransformPossibleValues(possibleValues);
            _valuesShown    = valuesShown;
            _leftMostIndex  = 0;

            _leftButton.TextureNormal  = leftButtonTexture;
            _rightButton.TextureNormal = rightButtonTexture;

            SetContent();

            _leftButton.Connect("pressed", this, nameof(OnScrollLeft));
            _rightButton.Connect("pressed", this, nameof(OnScrollRight));
        }
示例#13
0
        public override void _Ready()
        {
            _confirmButton = GetNode <TextureButton>("ConfirmButton");
            _confirmButton.Connect("pressed", this, nameof(EndTaskButton));

            _correctComponentsPerSequence = new List <int>();
            _correctActionsStreaks        = new List <int>();
            _tasksTimeLeft = new List <float>();
            _currentCorrectActionStreak = 0;

            _gainedPointsPerSequence     = new List <int>();
            _perfectTaskBonusPerSequence = new List <int>();
            _savedTimeBonusPerSequence   = new List <int>();

            // _gameTimer = new Timer();
            // _gameTimer.WaitTime = 20;
            // _gameTimer.OneShot = true;
            // AddChild(_gameTimer);
            // _gameTimer.Start();
        }
示例#14
0
    public override void _Ready()
    {
        _headline = GetNode <Label>("Headline");

        _category1   = GetNode <Control>("Category1");
        _name1       = _category1.GetNode <Label>("Name");
        _comparison1 = _category1.GetNode <TextureRect>("Comparison");

        _category2   = GetNode <Control>("Category2");
        _name2       = _category2.GetNode <Label>("Name");
        _comparison2 = _category2.GetNode <TextureRect>("Comparison");

        _category3   = GetNode <Control>("Category3");
        _name3       = _category3.GetNode <Label>("Name");
        _comparison3 = _category3.GetNode <TextureRect>("Comparison");

        _confirmButton = GetNode <TextureButton>("ConfirmButton");

        _confirmButton.Connect("pressed", this, nameof(ConfirmButtonOnClick));
    }
示例#15
0
    public void LoadNodes()
    {
        StationHandler = (StationHandler)GetNode("/root/StationHandler");

        PlayContainer = GetNode <VBoxContainer>("HBoxContainer/VBoxContainer");
        StopContainer = GetNode <VBoxContainer>("HBoxContainer/VBoxContainer2");
        PlayBtn       = GetNode <TextureButton>("HBoxContainer/VBoxContainer/Play");
        StopBtn       = GetNode <TextureButton>("HBoxContainer/VBoxContainer2/Stop");
        PreviousBtn   = GetNode <TextureButton>("HBoxContainer2/Previous");
        NextBtn       = GetNode <TextureButton>("HBoxContainer2/Next");
        PreviousBtn.Connect("pressed", this, nameof(PreviousStation));
        RadioList   = GetNode <MenuButton>("HBoxContainer2/MenuButton");
        VolumeValue = GetNode <Label>("HBoxContainer3/Value");
        VolumeBar   = GetNode <HSlider>("HBoxContainer3/VolumeBar");
        AddStation  = GetNode <ToolButton>("AddStation");
        NewStation  = GetNode <ConfirmationDialog>("NewStation");

        StationName = GetNode <LineEdit>("NewStation/VBoxContainer/LineEdit");
        StationURL  = GetNode <LineEdit>("NewStation/VBoxContainer/LineEdit2");

        Radio = RadioList.GetPopup();
    }
示例#16
0
    public override void _Ready()
    {
        globals     = GetTree().Root.GetNode("Globals") as Globals;
        titleScreen = GetNode <VBoxContainer>("Title Screen");
        mainMenu    = titleScreen.GetNode <VBoxContainer>("Main Menu");
        play        = mainMenu.GetNode <TextureButton>("Play");
        menu        = mainMenu.GetNode <TextureButton>("Menu");
        exit        = mainMenu.GetNode <TextureButton>("Exit");

        optionsMenu = titleScreen.GetNode <VBoxContainer>("Options Menu");
        bgm         = optionsMenu.GetNode <HBoxContainer>("Music").GetNode <HSlider>("Slider");
        playerSfx   = optionsMenu.GetNode <HBoxContainer>("Player SFX").GetNode <HSlider>("Slider");
        enemySfx    = optionsMenu.GetNode <HBoxContainer>("Enemy SFX").GetNode <HSlider>("Slider");
        optionsMenu.Hide();

        play.Connect("pressed", this, "_OnPlayPressed");
        menu.Connect("pressed", this, "_OnMenuPressed");
        exit.Connect("pressed", this, "_OnExitPressed");

        bgm.Connect("value_changed", this, "_OnBgmDbChanged");
        playerSfx.Connect("value_changed", this, "_OnPlayerSfxDbChanged");
        enemySfx.Connect("value_changed", this, "_OnEnemySfxDbChanged");

        bgm.Value       = globals.MusicDb;
        playerSfx.Value = globals.PlayerSfxDb;
        enemySfx.Value  = globals.EnemySfxDb;

        bgm.MaxValue       = 15f;
        bgm.Value          = globals.MusicDb;
        bgm.MinValue       = globals.minDb;
        playerSfx.MaxValue = 15;
        playerSfx.Value    = globals.PlayerSfxDb;
        playerSfx.MinValue = globals.minDb;
        enemySfx.MaxValue  = 15f;
        enemySfx.Value     = globals.EnemySfxDb;
        enemySfx.MinValue  = globals.minDb;
    }
示例#17
0
 void connectSignals()
 {
     acceptButton.Connect("pressed", this, nameof(onAcceptButtonPressed));
 }