mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Start server button - hidden into devmode
This commit is contained in:
@@ -82,7 +82,14 @@ public enum CHomeUI implements ICDoc {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
server.listen();
|
server.listen();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
VHomeUI.SINGLETON_INSTANCE.getLblStopServer().setCommand(new Command() {
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
server.stop();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ import forge.gui.home.variant.VSubmenuPlanechase;
|
|||||||
import forge.gui.home.variant.VSubmenuVanguard;
|
import forge.gui.home.variant.VSubmenuVanguard;
|
||||||
import forge.gui.toolbox.FLabel;
|
import forge.gui.toolbox.FLabel;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
import forge.view.FView;
|
import forge.view.FView;
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
private final FLabel lblExit = new FLabel.ButtonBuilder().text("Exit Forge").fontSize(14).build();
|
private final FLabel lblExit = new FLabel.ButtonBuilder().text("Exit Forge").fontSize(14).build();
|
||||||
private final FLabel lblEditor = new FLabel.ButtonBuilder().text("Deck Editor").fontSize(14).build();
|
private final FLabel lblEditor = new FLabel.ButtonBuilder().text("Deck Editor").fontSize(14).build();
|
||||||
private final FLabel lblStartServer = new FLabel.ButtonBuilder().text("Start Server").fontSize(14).build();
|
private final FLabel lblStartServer = new FLabel.ButtonBuilder().text("Start Server").fontSize(14).build();
|
||||||
|
private final FLabel lblStopServer = new FLabel.ButtonBuilder().text("Stop").fontSize(14).build();
|
||||||
|
|
||||||
private VHomeUI() {
|
private VHomeUI() {
|
||||||
pnlMenu.add(lblLogo, "w 150px!, h 150px!, gap 0 0 5px 10px, ax center");
|
pnlMenu.add(lblLogo, "w 150px!, h 150px!, gap 0 0 5px 10px, ax center");
|
||||||
@@ -151,14 +153,17 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JPanel pnlButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 2"));
|
JPanel pnlButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 3"));
|
||||||
pnlButtons.setOpaque(false);
|
pnlButtons.setOpaque(false);
|
||||||
|
|
||||||
pnlButtons.add(lblStartServer, "w 230px!, h 24px!, sx 2, gap 0 0 0 10px");
|
|
||||||
pnlButtons.add(lblExit, "w 110px!, h 30px!, gap 0 10px 0 0");
|
pnlButtons.add(lblExit, "w 110px!, h 30px!, gap 0 10px 0 0");
|
||||||
pnlButtons.add(lblEditor, "w 110px!, h 30px!");
|
pnlButtons.add(lblEditor, "w 110px!, h 30px!, sx 2");
|
||||||
|
|
||||||
|
if ( Singletons.getModel().getPreferences().getPrefBoolean(FPref.DEV_MODE_ENABLED) ) {
|
||||||
|
pnlButtons.add(lblStartServer, "w 170px!, h 25px!, gap 0 10px 10px 0, sx 2 ");
|
||||||
|
pnlButtons.add(lblStopServer, "w 50px!, h 25px!, gap 0 0 10px 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pnlMenu.add(pnlButtons, "w 230px!, gap 10px 0 10px 10px");
|
pnlMenu.add(pnlButtons, "w 230px!, gap 10px 0 10px 10px");
|
||||||
pnlDisplay.setBackground(FSkin.alphaColor(l00, 100));
|
pnlDisplay.setBackground(FSkin.alphaColor(l00, 100));
|
||||||
}
|
}
|
||||||
@@ -176,6 +181,10 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
public final FLabel getLblStartServer() {
|
public final FLabel getLblStartServer() {
|
||||||
return lblStartServer;
|
return lblStartServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final FLabel getLblStopServer() {
|
||||||
|
return lblStopServer;
|
||||||
|
}
|
||||||
|
|
||||||
/** @return {@link javax.swing.JPanel} */
|
/** @return {@link javax.swing.JPanel} */
|
||||||
public JPanel getPnlMenu() {
|
public JPanel getPnlMenu() {
|
||||||
|
|||||||
Reference in New Issue
Block a user