start working on the options menu
BIN
data/ui/options/apply_d.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
data/ui/options/apply_h.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
data/ui/options/apply_i.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
data/ui/options/apply_n.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
data/ui/options/audio_drivers.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/bar.png
Normal file
|
After Width: | Height: | Size: 905 B |
BIN
data/ui/options/bind_d.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
data/ui/options/bind_h.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
data/ui/options/bind_i.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
data/ui/options/bind_n.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
data/ui/options/delete_d.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/delete_h.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/delete_i.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
data/ui/options/delete_n.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/dropdown-large.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/dropdown-medium.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
data/ui/options/dropdown-small.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/dropdown-xlarge.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/ui/options/dropdown_d.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/dropdown_h.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/dropdown_i.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
data/ui/options/dropdown_n.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/encode_d.png
Normal file
|
After Width: | Height: | Size: 5 KiB |
BIN
data/ui/options/encode_h.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/ui/options/encode_i.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
data/ui/options/encode_n.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/ui/options/general_d.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
data/ui/options/general_h.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
data/ui/options/general_i.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
data/ui/options/general_n.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
data/ui/options/greenscroll.png
Normal file
|
After Width: | Height: | Size: 729 B |
BIN
data/ui/options/home_d.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/home_h.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
data/ui/options/home_i.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
data/ui/options/home_n.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
data/ui/options/hotkeys_d.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
data/ui/options/hotkeys_h.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
data/ui/options/hotkeys_i.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
data/ui/options/hotkeys_n.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
data/ui/options/online_d.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
data/ui/options/online_h.png
Normal file
|
After Width: | Height: | Size: 7 KiB |
BIN
data/ui/options/online_i.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
data/ui/options/online_n.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
data/ui/options/optionsBase.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
data/ui/options/optionsExtras/apply_d.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
data/ui/options/optionsExtras/apply_h.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
data/ui/options/optionsExtras/apply_n.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
data/ui/options/optionsExtras/defaults_d.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
data/ui/options/optionsExtras/defaults_h.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
data/ui/options/optionsExtras/defaults_n.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
data/ui/options/optionsExtras/fastoptions.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
data/ui/options/optionsExtras/fovText.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
data/ui/options/optionsExtras/fpsText.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
data/ui/options/optionsExtras/itemcollision.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
data/ui/options/optionsExtras/loadingbars.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/optionsExtras/oeDlgBase.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
data/ui/options/optionsExtras/oobText.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
data/ui/options/optionsExtras/powerupparticles.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
data/ui/options/optionsExtras/scorepredictor.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
data/ui/options/optionsExtras/sliderBase.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
data/ui/options/optionsExtras/sliderControl.png
Normal file
|
After Width: | Height: | Size: 786 B |
BIN
data/ui/options/optionsExtras/tabcompletions.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/ui/options/optionsExtras/text.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
data/ui/options/optionsExtras/title.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
data/ui/options/optionsExtras/trailparticles.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
data/ui/options/optionsExtras/tweening.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/ui/options/optionsGuiGraphics.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/ui/options/record_d.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
data/ui/options/record_h.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
data/ui/options/record_n.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
data/ui/options/remap.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
data/ui/options/rename_d.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
data/ui/options/rename_h.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
data/ui/options/rename_i.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
data/ui/options/rename_n.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
data/ui/options/serverpop_d.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
data/ui/options/serverpop_h.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
data/ui/options/serverpop_i.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
data/ui/options/serverpop_n.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
data/ui/options/slider.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
data/ui/options/textentry.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
data/ui/options/textentrylarge-disabled.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
data/ui/options/textentrylarge.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
data/ui/options/window.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
|
|
@ -54,7 +54,7 @@ class AudioManager {
|
||||||
|
|
||||||
public static function playShell() {
|
public static function playShell() {
|
||||||
AudioManager.manager.stopByName("music");
|
AudioManager.manager.stopByName("music");
|
||||||
var sndres = ResourceLoader.getAudio("data/sound/shell.ogg");
|
var sndres = ResourceLoader.getAudio("data/sound/pianoforte.ogg");
|
||||||
if (sndres == null)
|
if (sndres == null)
|
||||||
return;
|
return;
|
||||||
sndres.acquire();
|
sndres.acquire();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@ class GuiButtonText extends GuiButton {
|
||||||
public function setExtent(extent:Vector) {
|
public function setExtent(extent:Vector) {
|
||||||
this.extent = extent;
|
this.extent = extent;
|
||||||
txtCtrl.extent = extent;
|
txtCtrl.extent = extent;
|
||||||
txtCtrl.position.y = 5 * extent.y / 16; // Weird ratio shit that makes it as centered as possible
|
txtCtrl.position.y = 4 * extent.y / 16; // Weird ratio shit that makes it as centered as possible
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import h2d.filter.DropShadow;
|
||||||
|
import h2d.Text;
|
||||||
import gui.GuiControl.MouseState;
|
import gui.GuiControl.MouseState;
|
||||||
import src.AudioManager;
|
import src.AudioManager;
|
||||||
import hxd.Key;
|
import hxd.Key;
|
||||||
|
|
@ -17,7 +19,7 @@ class OptionsDlg extends GuiImage {
|
||||||
var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void;
|
var musicSliderFunc:(dt:Float, mouseState:MouseState) -> Void;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
var img = ResourceLoader.getImage("data/ui/background.jpg");
|
var img = ResourceLoader.getImage('data/ui/backgrounds/platinum/${cast (Math.floor(Util.lerp(1, 28, Math.random())), Int)}.jpg');
|
||||||
super(img.resource.toTile());
|
super(img.resource.toTile());
|
||||||
this.horizSizing = Width;
|
this.horizSizing = Width;
|
||||||
this.vertSizing = Height;
|
this.vertSizing = Height;
|
||||||
|
|
@ -36,12 +38,139 @@ class OptionsDlg extends GuiImage {
|
||||||
return [normal, hover, pressed];
|
return [normal, hover, pressed];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var window = new GuiImage(ResourceLoader.getResource("data/ui/options/window.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
window.horizSizing = Center;
|
||||||
|
window.vertSizing = Center;
|
||||||
|
window.position = new Vector(-72, -47);
|
||||||
|
window.extent = new Vector(784, 573);
|
||||||
|
this.addChild(window);
|
||||||
|
|
||||||
|
var generalBtn = new GuiButton(loadButtonImages('data/ui/options/general'));
|
||||||
|
generalBtn.position = new Vector(102, 19);
|
||||||
|
generalBtn.extent = new Vector(134, 65);
|
||||||
|
window.addChild(generalBtn);
|
||||||
|
|
||||||
|
var hotkeysBtn = new GuiButton(loadButtonImages('data/ui/options/hotkeys'));
|
||||||
|
hotkeysBtn.position = new Vector(325, 19);
|
||||||
|
hotkeysBtn.extent = new Vector(134, 65);
|
||||||
|
window.addChild(hotkeysBtn);
|
||||||
|
|
||||||
|
var onlineBtn = new GuiImage(ResourceLoader.getResource("data/ui/options/online_i.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
onlineBtn.position = new Vector(548, 19);
|
||||||
|
onlineBtn.extent = new Vector(134, 65);
|
||||||
|
window.addChild(onlineBtn);
|
||||||
|
|
||||||
|
var applyFunc:Void->Void = () -> {};
|
||||||
|
|
||||||
|
var homeBtn = new GuiButton(loadButtonImages('data/ui/options/home'));
|
||||||
|
homeBtn.position = new Vector(292, 482);
|
||||||
|
homeBtn.extent = new Vector(94, 46);
|
||||||
|
homeBtn.pressedAction = (sender) -> {
|
||||||
|
applyFunc();
|
||||||
|
MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
|
}
|
||||||
|
window.addChild(homeBtn);
|
||||||
|
|
||||||
|
var applyBtn = new GuiButton(loadButtonImages('data/ui/options/apply'));
|
||||||
|
applyBtn.position = new Vector(398, 482);
|
||||||
|
applyBtn.extent = new Vector(94, 46);
|
||||||
|
applyBtn.pressedAction = (sender) -> {
|
||||||
|
applyFunc();
|
||||||
|
}
|
||||||
|
window.addChild(applyBtn);
|
||||||
|
|
||||||
|
var generalPanel = new GuiControl();
|
||||||
|
generalPanel.position = new Vector(30, 88);
|
||||||
|
generalPanel.extent = new Vector(726, 394);
|
||||||
|
window.addChild(generalPanel);
|
||||||
|
|
||||||
|
var hotkeysPanel = new GuiControl();
|
||||||
|
hotkeysPanel.position = new Vector(30, 88);
|
||||||
|
hotkeysPanel.extent = new Vector(726, 394);
|
||||||
|
|
||||||
|
var markerFelt32fontdata = ResourceLoader.getFileEntry("data/font/MarkerFelt.fnt");
|
||||||
|
var markerFelt32b = new BitmapFont(markerFelt32fontdata.entry);
|
||||||
|
@:privateAccess markerFelt32b.loader = ResourceLoader.loader;
|
||||||
|
var markerFelt32 = markerFelt32b.toSdfFont(cast 26 * Settings.uiScale, MultiChannel);
|
||||||
|
var markerFelt24 = markerFelt32b.toSdfFont(cast 18 * Settings.uiScale, MultiChannel);
|
||||||
|
var markerFelt18 = markerFelt32b.toSdfFont(cast 14 * Settings.uiScale, MultiChannel);
|
||||||
|
|
||||||
|
var optBtns = [];
|
||||||
|
var optSliders = [];
|
||||||
|
|
||||||
|
function makeOption(text:String, value:String, yPos:Float, parent:GuiControl, right:Bool = false) {
|
||||||
|
var textObj = new GuiText(markerFelt32);
|
||||||
|
textObj.position = new Vector(right ? 388 : 7, yPos);
|
||||||
|
textObj.extent = new Vector(212, 14);
|
||||||
|
textObj.text.text = text;
|
||||||
|
textObj.text.textColor = 0xFFFFFF;
|
||||||
|
textObj.text.filter = new DropShadow(1.414, 0.785, 0x0000000F, 1, 0, 0.4, 1, true);
|
||||||
|
parent.addChild(textObj);
|
||||||
|
|
||||||
|
var optDropdown = new GuiButtonText(loadButtonImages('data/ui/options/dropdown'), markerFelt24);
|
||||||
|
optDropdown.position = new Vector(right ? 552 : 222, yPos - 12);
|
||||||
|
optDropdown.setExtent(new Vector(163, 56));
|
||||||
|
optDropdown.txtCtrl.text.text = value;
|
||||||
|
optDropdown.txtCtrl.text.textColor = 0;
|
||||||
|
parent.addChild(optDropdown);
|
||||||
|
|
||||||
|
optBtns.push(optDropdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeSlider(text:String, value:Float, yPos:Float, parent:GuiControl, onChange:Float->Void, right:Bool = false) {
|
||||||
|
var textObj = new GuiText(markerFelt32);
|
||||||
|
textObj.position = new Vector(right ? 388 : 7, yPos);
|
||||||
|
textObj.extent = new Vector(212, 14);
|
||||||
|
textObj.text.text = text;
|
||||||
|
textObj.text.textColor = 0xFFFFFF;
|
||||||
|
textObj.text.filter = new DropShadow(1.414, 0.785, 0x0000000F, 1, 0, 0.4, 1, true);
|
||||||
|
parent.addChild(textObj);
|
||||||
|
|
||||||
|
var sliderBar = new GuiImage(ResourceLoader.getResource("data/ui/options/bar.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
sliderBar.position = new Vector(right ? 552 : 226, yPos + 3 + 5);
|
||||||
|
sliderBar.extent = new Vector(154, 19);
|
||||||
|
parent.addChild(sliderBar);
|
||||||
|
|
||||||
|
var optSlider = new GuiSlider(ResourceLoader.getResource("data/ui/options/slider.png", ResourceLoader.getImage, this.imageResources).toTile());
|
||||||
|
optSlider.position = new Vector(right ? 550 : 220, yPos - 8 + 5);
|
||||||
|
optSlider.extent = new Vector(150, 41);
|
||||||
|
optSlider.sliderValue = value;
|
||||||
|
optSlider.pressedAction = (sender) -> {
|
||||||
|
onChange(optSlider.sliderValue);
|
||||||
|
}
|
||||||
|
parent.addChild(optSlider);
|
||||||
|
|
||||||
|
optSliders.push(optSlider);
|
||||||
|
}
|
||||||
|
|
||||||
|
makeOption("Screen Resolution:", '${Settings.optionsSettings.screenWidth} x ${Settings.optionsSettings.screenHeight}', 18, generalPanel);
|
||||||
|
makeOption("Screen Style:", '${Settings.optionsSettings.isFullScreen ? "Full Screen" : "Windowed"}', 18, generalPanel, true);
|
||||||
|
makeOption("Frame Rate:", 'Visible', 74, generalPanel);
|
||||||
|
makeOption("OoB Insults:", 'Disabled', 74, generalPanel, true);
|
||||||
|
makeOption("Free-Look:", '${Settings.controlsSettings.alwaysFreeLook ? "Enabled" : "Disabled"}', 130, generalPanel);
|
||||||
|
makeOption("Invert Y:", '${Settings.controlsSettings.invertYAxis ? "Yes" : "No"}', 130, generalPanel, true);
|
||||||
|
makeOption("Reflective Marble:", "Enabled", 186, generalPanel);
|
||||||
|
makeOption("Vertical Sync:", '${Settings.optionsSettings.vsync ? "Enabled" : "Disabled"}', 186, generalPanel, true);
|
||||||
|
makeSlider("Music Volume:", Settings.optionsSettings.musicVolume, 242, generalPanel, (val) -> {
|
||||||
|
Settings.optionsSettings.musicVolume = val;
|
||||||
|
AudioManager.updateVolumes();
|
||||||
|
});
|
||||||
|
makeSlider("Sound Volume:", Settings.optionsSettings.soundVolume, 242, generalPanel, (val) -> {
|
||||||
|
Settings.optionsSettings.soundVolume = val;
|
||||||
|
AudioManager.updateVolumes();
|
||||||
|
}, true);
|
||||||
|
makeSlider("Field of View:", (Settings.optionsSettings.fov - 60) / (140 - 60), 298, generalPanel, (val) -> {
|
||||||
|
Settings.optionsSettings.fov = cast(60 + val * (140 - 60));
|
||||||
|
});
|
||||||
|
makeSlider("Mouse Speed:", (Settings.controlsSettings.cameraSensitivity - 0.2) / (3 - 0.2), 298, generalPanel, (val) -> {
|
||||||
|
Settings.controlsSettings.cameraSensitivity = cast(0.2 + val * (3 - 0.2));
|
||||||
|
}, true);
|
||||||
|
|
||||||
var tabs = new GuiControl();
|
var tabs = new GuiControl();
|
||||||
tabs.horizSizing = Center;
|
tabs.horizSizing = Center;
|
||||||
tabs.vertSizing = Center;
|
tabs.vertSizing = Center;
|
||||||
tabs.position = new Vector(60, 15);
|
tabs.position = new Vector(60, 15);
|
||||||
tabs.extent = new Vector(520, 450);
|
tabs.extent = new Vector(520, 450);
|
||||||
this.addChild(tabs);
|
|
||||||
|
|
||||||
var setTab:String->Void = null;
|
var setTab:String->Void = null;
|
||||||
|
|
||||||
|
|
@ -73,8 +202,6 @@ class OptionsDlg extends GuiImage {
|
||||||
mainPane.extent = new Vector(520, 480);
|
mainPane.extent = new Vector(520, 480);
|
||||||
mainPane.horizSizing = Center;
|
mainPane.horizSizing = Center;
|
||||||
mainPane.vertSizing = Center;
|
mainPane.vertSizing = Center;
|
||||||
this.addChild(mainPane);
|
|
||||||
|
|
||||||
// GRAPHICS PANEL
|
// GRAPHICS PANEL
|
||||||
var graphicsPane = new GuiControl();
|
var graphicsPane = new GuiControl();
|
||||||
graphicsPane.position = new Vector(35, 110);
|
graphicsPane.position = new Vector(35, 110);
|
||||||
|
|
|
||||||