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); }
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); }
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)); }