コード例 #1
0
    public void InitControls()
    {
        mainMenuButton = (Godot.Button)Menu.Button("Main Menu", MainMenu);
        AddChild(mainMenuButton);

        serverButton = (Godot.Button)Menu.Button("Host", ShowServer);
        AddChild(serverButton);

        clientButton = (Godot.Button)Menu.Button("Join", ShowClient);
        AddChild(clientButton);

        selectionButton = (Godot.Button)Menu.Button("Back", ShowSelection);
        AddChild(selectionButton);

        portBox = (Godot.TextEdit)Menu.TextBox("" + NetworkSession.DefaultPort, false);
        AddChild(portBox);

        startServerButton = (Godot.Button)Menu.Button("Host Game", StartServer);
        AddChild(startServerButton);

        addressBox = (Godot.TextEdit)Menu.TextBox(NetworkSession.DefaultServerAddress, false);
        AddChild(addressBox);

        nameBox = (Godot.TextEdit)Menu.TextBox("Name", false);
        AddChild(nameBox);

        startClientButton = (Godot.Button)Menu.Button("Join Game", StartClient);
        AddChild(startClientButton);
    }
コード例 #2
0
    void InitControls()
    {
        background = Menu.BackgroundBox();
        AddChild(background);

        logo = Menu.TexturedButton("res://Textures/logo.jpg");
        AddChild(logo);

        newGameButton = Menu.Button(text: "New", onClick: NewGame);
        AddChild(newGameButton);

        if (CareerDb.SaveExists())
        {
            continueGameButton = Menu.Button(text: "Continue", onClick: ContinueGame);
            AddChild(continueGameButton);
        }

        quitButton = Menu.Button(text: "Quit", onClick: Quit);
        AddChild(quitButton);

        settingsButton = (Godot.Button)Menu.Button(text: "Settings", onClick: Settings);
        AddChild(settingsButton);

        Sound.PlayRandomSong(Sound.GetPlaylist(Sound.Playlists.Menu));
    }
コード例 #3
0
ファイル: LobbyMenu.cs プロジェクト: windsurfer/FPS_Project
    public void Init()
    {
        messageBox          = (Godot.TextEdit)Menu.TextBox();
        messageBox.Readonly = true;
        AddChild(messageBox);

        composeBox = (Godot.TextEdit)Menu.TextBox();
        AddChild(composeBox);

        sendButton = (Godot.Button)Menu.Button("Send", Send);
        AddChild(sendButton);

        mainMenuButton = (Godot.Button)Menu.Button("Main Menu", ReturnToMainMenu);
        AddChild(mainMenuButton);

        readyButton = (Godot.Button)Menu.Button("Ready", ToggleReady);
        AddChild(readyButton);

        playersBox          = (Godot.TextEdit)Menu.TextBox("");
        playersBox.Readonly = true;
        AddChild(playersBox);


        InitNetwork();

        ScaleControls();
    }
コード例 #4
0
ファイル: ArenaConfigMenu.cs プロジェクト: daela/FPS_Project
    void InitControls()
    {
        gamemodeLabel = (Godot.TextEdit)Menu.TextBox("Arena Config");
        AddChild(gamemodeLabel);


        botsSlider = Menu.HSlider(0f, 16f, config.bots, 1f);
        AddChild(botsSlider);
        botsSlider.Connect("value_changed", this, nameof(UpdateBots));
        botsLabel = Menu.TextBox("Bots: " + config.bots);
        AddChild(botsLabel);

        durationSlider = Menu.HSlider(0f, 60f, config.duration, 1f);
        AddChild(durationSlider);
        durationSlider.Connect("value_changed", this, nameof(UpdateDuration));
        durationLabel = Menu.TextBox("Duration: " + config.duration + " minutes");
        AddChild(durationLabel);


        powerupsButton = Menu.Button("Spawn powerups: " + config.usePowerups, TogglePowerups);
        AddChild(powerupsButton);

        kitsButton = Menu.Button("Spawn with kits: " + config.useKits, ToggleKits);
        AddChild(kitsButton);
    }
コード例 #5
0
 public override void _Ready()
 {
     MainMenuButton = GetNode <Godot.Button>("HBoxContainer/VBoxContainer/MainMenu");
     if (GetTree().NetworkPeer != null)
     {
         MainMenuButton.Text = "Disconnect";
     }
 }
コード例 #6
0
ファイル: PauseMenu.cs プロジェクト: daela/FPS_Project
 public void SetQuitButton(Godot.Button button)
 {
     if (quitButton != null)
     {
         quitButton.QueueFree();
     }
     quitButton = button;
     AddChild(button);
 }
コード例 #7
0
ファイル: PauseMenu.cs プロジェクト: daela/FPS_Project
 public void SetMainMenuButton(Godot.Button button)
 {
     if (mainMenuButton != null)
     {
         quitButton.QueueFree();
     }
     mainMenuButton = button;
     AddChild(button);
 }
コード例 #8
0
ファイル: PauseMenu.cs プロジェクト: daela/FPS_Project
 public void SetResumeButton(Godot.Button button)
 {
     if (resumeButton != null)
     {
         resumeButton.QueueFree();
     }
     resumeButton = button;
     AddChild(button);
 }
コード例 #9
0
ファイル: MainMenu.cs プロジェクト: mortene/FPS_Project
 public void SetLobbyButton(Godot.Button button)
 {
     if (lobbyButton != null)
     {
         lobbyButton.QueueFree();
     }
     lobbyButton = button;
     AddChild(button);
 }
コード例 #10
0
 public void SetSinglePlayerButton(Godot.Button button)
 {
     if (startButton != null)
     {
         lobbyButton.QueueFree();
     }
     startButton = button;
     AddChild(button);
 }
コード例 #11
0
ファイル: LobbyMenu.cs プロジェクト: mortene/FPS_Project
 public void SetJoinButton(Godot.Button button)
 {
     if (joinButton != null)
     {
         joinButton.QueueFree();
     }
     joinButton = button;
     AddChild(button);
 }
コード例 #12
0
ファイル: LobbyMenu.cs プロジェクト: mortene/FPS_Project
 public void SetHostButton(Godot.Button button)
 {
     if (hostButton != null)
     {
         hostButton.QueueFree();
     }
     hostButton = button;
     AddChild(button);
 }
コード例 #13
0
ファイル: LobbyMenu.cs プロジェクト: mortene/FPS_Project
 public void SetSendButton(Godot.Button button)
 {
     if (sendButton != null)
     {
         sendButton.QueueFree();
     }
     sendButton = button;
     AddChild(button);
 }
コード例 #14
0
ファイル: MobileTextInput.cs プロジェクト: fuzzbuck/Casanova
        public override void _Ready()
        {
            texteditor = GetNode <TextEdit>("TextEdit");
            button     = texteditor.GetNode <Godot.Button>("Button");

            button.Connect("pressed", this, "_onButton");
            texteditor.Connect("text_changed", this, "_onTextEditChange");

            preview = GetNode("HBox").GetNode <RichTextLabel>("Preview");
        }
コード例 #15
0
    // Called when the node enters the scene tree for the first time.
    public override void _EnterTree()
    {
        this.FindChild <Label>().Text = Player.Hardcore ? "New Hardcore Top Score " + Player.score.ToString() : "New Top Score " + Player.score.ToString();
        input  = this.FindChild <TextEdit>();
        submit = this.FindChild <Button>();
        //input.Text = "";

        if (!Score.canEnterScore(Player.score))
        {
            QueueFree();
        }
    }
コード例 #16
0
    public void InitControls()
    {
        activeFilter = Item.Categories.Weapons;

        closeButton = (Godot.Button)Menu.Button(text: "Close", onClick: Close);
        AddChild(closeButton);

        itemList = new ItemList();
        AddChild(itemList);
        itemList.AllowRmbSelect = true;
        itemList.Connect("item_selected", this, nameof(SelectItem));
        itemList.Connect("item_activated", this, nameof(UseItem));
        itemList.Connect("item_rmb_selected", this, nameof(DropItem));

        itemInfo          = (Godot.TextEdit)Menu.TextBox("");
        itemInfo.Readonly = true;
        itemInfo.Hide();
        AddChild(itemInfo);

        useButton = (Godot.Button)Menu.Button(text: "Use", onClick: UseItemAdapter);
        AddChild(useButton);
        useButton.Hide();

        dropButton = (Godot.Button)Menu.Button(text: "Drop", onClick: DropItemAdapter);
        AddChild(dropButton);
        dropButton.Hide();

        stashButton = (Godot.Button)Menu.Button(text: "Stash", onClick: StashItem);
        AddChild(stashButton);
        RefreshStashItemInfo();

        weaponsButton = (Godot.Button)Menu.Button(text: "Weapons", onClick: FilterWeapons);
        AddChild(weaponsButton);

        apparelButton = (Godot.Button)Menu.Button(text: "Apparel", onClick: FilterApparel);
        AddChild(apparelButton);

        aidButton = (Godot.Button)Menu.Button(text: "Aid", onClick: FilterAid);
        AddChild(aidButton);

        miscButton = (Godot.Button)Menu.Button(text: "Misc", onClick: FilterMisc);
        AddChild(miscButton);

        ammoButton = (Godot.Button)Menu.Button(text: "Ammo", onClick: FilterAmmo);
        AddChild(ammoButton);

        weightInfo          = (Godot.TextEdit)Menu.TextBox("WeightInfo");
        weightInfo.Readonly = true;
        AddChild(weightInfo);
    }
コード例 #17
0
ファイル: SingleplayerMenu.cs プロジェクト: daela/FPS_Project
    void InitControls()
    {
        startButton = Menu.Button("Start Game", StartGame);
        AddChild(startButton);

        mainMenuButton = Menu.Button("Main Menu", ReturnToMainMenu);
        AddChild(mainMenuButton);


        Node arenaConfigNode = Menu.SubMenuFactory(Menu.SubMenus.ArenaConfig);

        AddChild(arenaConfigNode);
        arenaConfig = arenaConfigNode as IMenu;
    }
コード例 #18
0
ファイル: SettingsMenu.cs プロジェクト: Rn4rc1s0/FPS_Project
    public void InitControls()
    {
        mainMenuButton = Menu.Button("Main Menu", MainMenu);
        AddChild(mainMenuButton);

        revertButton = Menu.Button("Revert", RevertSettings);
        AddChild(revertButton);

        saveButton = Menu.Button("Save", SaveSettings);
        AddChild(saveButton);

        masterVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.masterVolume, 0.05f);
        AddChild(masterVolumeSlider);
        masterVolumeSlider.Connect("value_changed", this, nameof(UpdateMasterVolume));

        masterVolumeLabel = (Godot.TextEdit)Menu.TextBox("Master Volume: " + Session.session.masterVolume, false);
        AddChild(masterVolumeLabel);

        sfxVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.sfxVolume, 0.05f);
        AddChild(sfxVolumeSlider);
        sfxVolumeSlider.Connect("value_changed", this, nameof(UpdateSfxVolume));

        sfxVolumeLabel = (Godot.TextEdit)Menu.TextBox("Sound Effects Volume: " + Session.session.sfxVolume, false);
        AddChild(sfxVolumeLabel);

        musicVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.musicVolume, 0.05f);
        AddChild(musicVolumeSlider);
        musicVolumeSlider.Connect("value_changed", this, nameof(UpdateMusicVolume));

        musicVolumeLabel = (Godot.TextEdit)Menu.TextBox("Music Volume: " + Session.session.musicVolume, false);
        AddChild(musicVolumeLabel);

        mouseXSlider = Menu.HSlider(0f, 1.0f, Session.session.mouseSensitivityX, 0.05f);
        AddChild(mouseXSlider);
        mouseXSlider.Connect("value_changed", this, nameof(UpdateMouseX));

        mouseXLabel = (Godot.TextEdit)Menu.TextBox("Mouse Sensitivity X: " + Session.session.mouseSensitivityX, false);
        AddChild(mouseXLabel);

        mouseYSlider = Menu.HSlider(0f, 1.0f, Session.session.mouseSensitivityY, 0.05f);
        AddChild(mouseYSlider);
        mouseYSlider.Connect("value_changed", this, nameof(UpdateMouseY));

        mouseYLabel = Menu.TextBox("Mouse Sensitivity Y: " + Session.session.mouseSensitivityY, false);
        AddChild(mouseYLabel);

        userNameBox = Menu.TextBox(Session.session.userName, false);
        AddChild(userNameBox);
    }
コード例 #19
0
    void InitControls()
    {
        SetQuitButton((Godot.Button)Menu.Button(text: "Quit", onClick: Quit));
        SetMainMenuButton((Godot.Button)Menu.Button(text: "Main Menu", onClick: QuitToMainMenu));
        SetResumeButton((Godot.Button)Menu.Button(text: "Resume", onClick: Resume));

        if (Session.session.adventure != null)
        {
            saveAdventureButton = Menu.Button("Save", SaveAdventure);
            AddChild(saveAdventureButton);

            loadAdventureButton = Menu.Button("Load", LoadAdventure);
            AddChild(loadAdventureButton);
        }
    }
コード例 #20
0
ファイル: MainMenu.cs プロジェクト: Rn4rc1s0/FPS_Project
    void InitControls()
    {
        localButton = Menu.Button(text: "Local", onClick: LocalGame);
        AddChild(localButton);

        onlineButton = Menu.Button(text: "Online", onClick: Online);
        AddChild(onlineButton);

        quitButton = Menu.Button(text: "Quit", onClick: Quit);
        AddChild(quitButton);

        settingsButton = (Godot.Button)Menu.Button(text: "Settings", onClick: Settings);
        AddChild(settingsButton);

        Sound.PlaySong(Sound.Songs.FloatingHorizons);
    }
コード例 #21
0
ファイル: LobbyMenu.cs プロジェクト: daela/FPS_Project
  void InitServerControls(){
    messageBox = (Godot.TextEdit)Menu.TextBox();
    messageBox.Readonly = true;
    AddChild(messageBox);
    
    
    mainMenuButton = (Godot.Button)Menu.Button("Main Menu", ReturnToMainMenu);
    AddChild(mainMenuButton);
    
    playersBox = (Godot.TextEdit)Menu.TextBox("");
    playersBox.Readonly = true;
    AddChild(playersBox);

    Node arenaConfigNode = Menu.SubMenuFactory(Menu.SubMenus.ArenaConfig);
    AddChild(arenaConfigNode);
    arenaConfig = arenaConfigNode as IMenu;
  }
コード例 #22
0
    public void InitControls()
    {
        savesList = new ItemList();
        AddChild(savesList);
        savesList.AllowRmbSelect = true;
        savesList.Connect("item_selected", this, nameof(SelectSave));
        savesList.Connect("item_activated", this, nameof(LoadSave));

        foreach (string save in SettingsDb.GetAllSaves("adventure"))
        {
            savesList.AddItem(save);
        }

        backButton = Menu.Button("back", Back);
        AddChild(backButton);

        loadButton = Menu.Button("load", Load);
        AddChild(loadButton);
    }
コード例 #23
0
    public void InitControls()
    {
        background = Menu.BackgroundBox();
        AddChild(background);

        logo = Menu.TexturedButton("res://Assets/Textures/logo.jpg");
        AddChild(logo);

        newGameButton = Menu.Button(text: "New", onClick: NewGame);
        AddChild(newGameButton);

        quitButton = Menu.Button(text: "Quit", onClick: Quit);
        AddChild(quitButton);

        settingsButton = (Godot.Button)Menu.Button(text: "Settings", onClick: Settings);
        AddChild(settingsButton);

        Sound.PlayRandomSong(Sound.GetPlaylist(Sound.Playlists.Menu));
    }
コード例 #24
0
ファイル: LobbyMenu.cs プロジェクト: Rn4rc1s0/FPS_Project
  void InitServerControls(){
    activeMode = Session.Gamemodes.Arena;

    messageBox = (Godot.TextEdit)Menu.TextBox();
    messageBox.Readonly = true;
    AddChild(messageBox); 
    
    mainMenuButton = (Godot.Button)Menu.Button("Main Menu", ReturnToMainMenu);
    AddChild(mainMenuButton);
    
    playersBox = (Godot.TextEdit)Menu.TextBox("");
    playersBox.Readonly = true;
    AddChild(playersBox);

    modeButton = Menu.Button("Gamemode: " + activeMode, ToggleMode);
    AddChild(modeButton);

    arenaConfig = Menu.SubMenuFactory(Menu.SubMenus.ArenaConfig) as IMenu;
    adventureConfig = Menu.SubMenuFactory(Menu.SubMenus.AdventureConfig) as IMenu;

    SetMenu(activeMode);
  }
コード例 #25
0
    public void InitControls()
    {
        background = Menu.BackgroundBox();
        AddChild(background);

        mainMenuButton = Menu.Button("Main Menu", MainMenu);
        AddChild(mainMenuButton);

        revertButton = Menu.Button("Revert", RevertSettings);
        AddChild(revertButton);

        saveButton = Menu.Button("Save", SaveSettings);
        AddChild(saveButton);

        masterVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.masterVolume, 0.05f);
        AddChild(masterVolumeSlider);
        masterVolumeSlider.Connect("value_changed", this, nameof(UpdateMasterVolume));

        masterVolumeLabel = (Godot.TextEdit)Menu.TextBox("Master Volume: " + Session.session.masterVolume, false);
        AddChild(masterVolumeLabel);

        sfxVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.sfxVolume, 0.05f);
        AddChild(sfxVolumeSlider);
        sfxVolumeSlider.Connect("value_changed", this, nameof(UpdateSfxVolume));

        sfxVolumeLabel = (Godot.TextEdit)Menu.TextBox("Sound Effects Volume: " + Session.session.sfxVolume, false);
        AddChild(sfxVolumeLabel);

        musicVolumeSlider = Menu.HSlider(0f, 1.0f, Session.session.musicVolume, 0.05f);
        AddChild(musicVolumeSlider);
        musicVolumeSlider.Connect("value_changed", this, nameof(UpdateMusicVolume));

        musicVolumeLabel = (Godot.TextEdit)Menu.TextBox("Music Volume: " + Session.session.musicVolume, false);
        AddChild(musicVolumeLabel);

        mouseXSlider = Menu.HSlider(0f, 5.0f, Session.session.mouseSensitivityX, 0.05f);
        AddChild(mouseXSlider);
        mouseXSlider.Connect("value_changed", this, nameof(UpdateMouseX));

        mouseXLabel = (Godot.TextEdit)Menu.TextBox("Mouse Sensitivity X: " + Session.session.mouseSensitivityX, false);
        AddChild(mouseXLabel);

        mouseYSlider = Menu.HSlider(0f, 5.0f, Session.session.mouseSensitivityY, 0.05f);
        AddChild(mouseYSlider);
        mouseYSlider.Connect("value_changed", this, nameof(UpdateMouseY));

        mouseYLabel = Menu.TextBox("Mouse Sensitivity Y: " + Session.session.mouseSensitivityY, false);
        AddChild(mouseYLabel);

        userNameBox = Menu.TextBox(Session.session.userName, false);
        AddChild(userNameBox);

        string deviceString = DeviceManager.DeviceName(Session.session.player1Device);

        deviceLabel = (Godot.TextEdit)Menu.TextBox("Device: " + deviceString, false);
        AddChild(deviceLabel);

        int deviceInt = (int)Session.session.player1Device;

        deviceSlider = Menu.HSlider(0f, 4.0f, (float)deviceInt, 1.0f);
        AddChild(deviceSlider);
        deviceSlider.Connect("value_changed", this, nameof(UpdateDevice));
    }
コード例 #26
0
ファイル: Button.cs プロジェクト: RemieRichards/RobustToolbox
 protected override void SetSceneControl(Godot.Control control)
 {
     base.SetSceneControl(control);
     SceneControl = (Godot.Button)control;
 }
コード例 #27
0
ファイル: Button.cs プロジェクト: RemieRichards/RobustToolbox
 public Button(Godot.Button button) : base(button)
 {
 }