menu cleanup
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
856e0a6b22
commit
4e0459e460
@ -51,9 +51,9 @@ public class MenuGenerators {
|
||||
//need to log client in
|
||||
Globals.clientUsername = "username";
|
||||
Globals.clientPassword = AuthenticationManager.getHashedString("password");
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER, null);
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER);
|
||||
Globals.loadingThreadsList.add(clientThread);
|
||||
LoadingThread serverThread = new LoadingThread(LoadingThread.LOAD_MAIN_GAME, null);
|
||||
LoadingThread serverThread = new LoadingThread(LoadingThread.LOAD_MAIN_GAME);
|
||||
Globals.loadingThreadsList.add(serverThread);
|
||||
Globals.RUN_CLIENT = true;
|
||||
Globals.RUN_SERVER = true;
|
||||
@ -87,8 +87,6 @@ public class MenuGenerators {
|
||||
public static Element createWorldCreationMenu(){
|
||||
FormElement rVal = new FormElement();
|
||||
int screenTop = 150;
|
||||
// List<String> saveNames = SaveUtils.getSaves();
|
||||
int verticalPosition = 125;
|
||||
|
||||
//TODO: add text input to name world
|
||||
//text entry (address)
|
||||
@ -119,7 +117,6 @@ public class MenuGenerators {
|
||||
|
||||
public static Element createSaveCreationMenu(){
|
||||
FormElement rVal = new FormElement();
|
||||
int screenTop = 150;
|
||||
|
||||
//button (save)
|
||||
Button saveButton = new Button();
|
||||
@ -149,9 +146,6 @@ public class MenuGenerators {
|
||||
|
||||
public static Element createCharacterCreationMenu(){
|
||||
FormElement rVal = new FormElement();
|
||||
int screenTop = 150;
|
||||
// List<String> saveNames = SaveUtils.getSaves();
|
||||
int verticalPosition = 125;
|
||||
|
||||
//TODO: add text input to name world
|
||||
|
||||
@ -168,9 +162,6 @@ public class MenuGenerators {
|
||||
|
||||
public static Element createFinalizeSaveCreationMenu(){
|
||||
FormElement rVal = new FormElement();
|
||||
int screenTop = 150;
|
||||
// List<String> saveNames = SaveUtils.getSaves();
|
||||
int verticalPosition = 125;
|
||||
|
||||
//TODO: add text input to name world
|
||||
|
||||
@ -186,7 +177,6 @@ public class MenuGenerators {
|
||||
|
||||
public static Element createMultiplayerMenu(){
|
||||
FormElement rVal = new FormElement();
|
||||
int screenTop = 150;
|
||||
|
||||
//button (host)
|
||||
Button hostButton = new Button();
|
||||
@ -195,9 +185,9 @@ public class MenuGenerators {
|
||||
hostButton.addChild(hostLabel);
|
||||
rVal.addChild(hostButton);
|
||||
hostButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER, null);
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER);
|
||||
Globals.loadingThreadsList.add(clientThread);
|
||||
LoadingThread serverThread = new LoadingThread(LoadingThread.LOAD_MAIN_GAME, null);
|
||||
LoadingThread serverThread = new LoadingThread(LoadingThread.LOAD_MAIN_GAME);
|
||||
Globals.loadingThreadsList.add(serverThread);
|
||||
Globals.RUN_CLIENT = true;
|
||||
Globals.RUN_SERVER = true;
|
||||
@ -287,7 +277,7 @@ public class MenuGenerators {
|
||||
NetUtils.setPort(Integer.parseInt(portInput.getText()));
|
||||
Globals.clientUsername = usernameInput.getText();
|
||||
Globals.clientPassword = AuthenticationManager.getHashedString(passwordInput.getText());
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER, null);
|
||||
LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_CHARACTER_SERVER);
|
||||
Globals.loadingThreadsList.add(clientThread);
|
||||
Globals.RUN_CLIENT = true;
|
||||
Globals.RUN_SERVER = false;
|
||||
|
||||
@ -1,90 +0,0 @@
|
||||
package electrosphere.menu.mainmenu;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import electrosphere.engine.Globals;
|
||||
import electrosphere.menu.WindowStrings;
|
||||
import electrosphere.menu.WindowUtils;
|
||||
import electrosphere.renderer.debug.DebugRendering;
|
||||
import electrosphere.renderer.ui.WidgetUtils;
|
||||
import electrosphere.renderer.ui.elements.Label;
|
||||
import electrosphere.renderer.ui.elements.ScrollableContainer;
|
||||
import electrosphere.renderer.ui.elements.Window;
|
||||
import electrosphere.renderer.ui.elementtypes.ClickableElement;
|
||||
import electrosphere.renderer.ui.elementtypes.ContainerElement;
|
||||
import electrosphere.renderer.ui.elementtypes.Element;
|
||||
import electrosphere.renderer.ui.events.ClickEvent;
|
||||
|
||||
/**
|
||||
* Debug menu generation functions
|
||||
*/
|
||||
public class MenuGeneratorsDebug {
|
||||
|
||||
static final int X_OFFSET = 1000;
|
||||
|
||||
public static Window createTopLevelDebugMenu(){
|
||||
Window rVal = new Window(Globals.renderingEngine.getOpenGLState(),X_OFFSET,100,800,800,true);
|
||||
|
||||
//label (title)
|
||||
Label titleLabel = new Label(1.0f);
|
||||
titleLabel.setText("DEBUG");
|
||||
rVal.addChild(titleLabel);
|
||||
|
||||
//show ui tree
|
||||
rVal.addChild(WidgetUtils.createLabelButton("Lst UI Elements",100,150,1.0f,new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
WindowUtils.replaceWindowContents(WindowStrings.WINDOW_DEBUG, MenuGeneratorsDebug.createListUIElements());
|
||||
return false;
|
||||
}}));
|
||||
|
||||
//show ui tree
|
||||
rVal.addChild(WidgetUtils.createLabelButton("Debug UI",100,250,1.0f,new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
WindowUtils.replaceWindowContents(WindowStrings.WINDOW_DEBUG, MenuGeneratorsDebug.createDebugUIMenu());
|
||||
return false;
|
||||
}}));
|
||||
|
||||
|
||||
|
||||
return rVal;
|
||||
}
|
||||
|
||||
public static Element createDebugUIMenu(){
|
||||
ScrollableContainer rVal = new ScrollableContainer(Globals.renderingEngine.getOpenGLState(), 0, 0, 800, 800);
|
||||
rVal.addChild(WidgetUtils.createLabelButton("Toggle UI Outline",100,150,1.0f,new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
DebugRendering.toggleOutlineMask();
|
||||
return false;
|
||||
}}));
|
||||
return rVal;
|
||||
}
|
||||
|
||||
public static Element createListUIElements(){
|
||||
ScrollableContainer rVal = new ScrollableContainer(Globals.renderingEngine.getOpenGLState(), 0, 0, 800, 800);
|
||||
int verticalOffset = 0;
|
||||
int horizontalOffset = 0;
|
||||
List<Element> elementsToAdd = new LinkedList<Element>();
|
||||
for(Element window : Globals.elementManager.getWindowList()){
|
||||
verticalOffset = verticalOffset + recursivelyAppendElementTree(elementsToAdd, verticalOffset, horizontalOffset, rVal);
|
||||
}
|
||||
for(Element toAdd : elementsToAdd){
|
||||
rVal.addChild(toAdd);
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
static int recursivelyAppendElementTree(List<Element> toAddList, int verticalOffset, int horizontalOffset, Element child){
|
||||
Label currentWindowLabel = new Label(0.5f);
|
||||
currentWindowLabel.setText(child.toString());
|
||||
toAddList.add(currentWindowLabel);
|
||||
if(child instanceof ContainerElement){
|
||||
int cummulativeOffset = 1;
|
||||
ContainerElement childCast = (ContainerElement) child;
|
||||
for(Element childOfChild : childCast.getChildren()){
|
||||
cummulativeOffset = cummulativeOffset + recursivelyAppendElementTree(toAddList, verticalOffset + cummulativeOffset, horizontalOffset + 1, childOfChild);
|
||||
}
|
||||
return cummulativeOffset;
|
||||
} else {
|
||||
return verticalOffset + 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -35,11 +35,6 @@ public class MenuGeneratorsTitleMenu {
|
||||
rVal.addChild(singleplayerButton);
|
||||
singleplayerButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
||||
// LoadingThread clientThread = new LoadingThread(LoadingThread.LOAD_MAIN_GAME);
|
||||
// Globals.loadingThreadsList.add(clientThread);
|
||||
// Globals.RUN_CLIENT = true;
|
||||
// Globals.RUN_SERVER = true;
|
||||
// clientThread.start();
|
||||
return false;
|
||||
}});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user