Skip to content

Commit

Permalink
Fixed sound issue and added disable button
Browse files Browse the repository at this point in the history
Also changed gui layout to be a bit more friendly to small screens
  • Loading branch information
willowsokora committed May 23, 2015
1 parent c9f5492 commit 3353990
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "beta-1.2.1"
version = "beta-1.2.3"
group= "com.biggestnerd.civradar" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "[1.8]CivRadar"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/biggestnerd/civradar/CivRadar.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class CivRadar {
public final static String MODID = "civradar";
public final static String MODNAME = "CivRadar";
public final static String VERSION = "beta-1.2.2";
public final static String VERSION = "beta-1.2.3";
private RenderHandler renderHandler;
private Config radarConfig;
private File configFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public void updateScreen() {
} else {
pingVolumeSlider.updateDisplayString();
}
config.setPingVolume(pingVolumeSlider.getCurrentValue());
CivRadar.instance.saveConfig();
}

public void drawScreen(int i, int j, float k) {
Expand Down
27 changes: 17 additions & 10 deletions src/main/java/com/biggestnerd/civradar/gui/GuiRadarOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class GuiRadarOptions extends GuiScreen {
private GuiSlider scaleSlider;
private GuiButton coordToggle;
private GuiButton haxMode;
private GuiButton radarButton;

public GuiRadarOptions(GuiScreen parentScreen) {
this.parentScreen = parentScreen;
Expand All @@ -25,16 +26,17 @@ public GuiRadarOptions(GuiScreen parentScreen) {
public void initGui() {
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 - 16, "Reposition Radar"));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 8, "Edit Enabled Icons"));
this.buttonList.add(opacitySlider = new GuiSlider(3, this.width / 2 -100, this.height / 4 + 32, 1.0F, 0.0F, "Radar Opacity", CivRadar.instance.getConfig().getRadarOpacity()));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 56, "Edit Radar Color"));
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height /4 + 80, "Edit Player Options"));
this.buttonList.add(scaleSlider = new GuiSlider(6, this.width / 2 - 100, this.height / 4 + 104, 2.0F, 1.0F, "Radar Scale", CivRadar.instance.getConfig().getRadarScale()));
this.buttonList.add(coordToggle = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 128, "Coordinates: "));
this.buttonList.add(new GuiButton(8, this.width / 2 - 100, this.height / 4 + 152, "Waypoints and Waypoint Options"));
this.buttonList.add(haxMode = new GuiButton(9, this.width / 2 - 100, this.height / 4 + 176, "Hax mode: "));
this.buttonList.add(new GuiButton(100, this.width / 2 - 100, this.height / 4 + 200, "Done"));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 - 16, 100, 20, "Reposition Radar"));
this.buttonList.add(new GuiButton(1, this.width / 2 + 1, this.height / 4 - 16, 100, 20, "Edit Enabled Icons"));
this.buttonList.add(opacitySlider = new GuiSlider(3, this.width / 2 -100, this.height / 4 + 8, 1.0F, 0.0F, "Radar Opacity", CivRadar.instance.getConfig().getRadarOpacity()));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 32, 100, 20, "Edit Radar Color"));
this.buttonList.add(new GuiButton(5, this.width / 2 + 1, this.height /4 + 32, 100, 20, "Edit Player Options"));
this.buttonList.add(scaleSlider = new GuiSlider(6, this.width / 2 - 100, this.height / 4 + 56, 2.0F, 1.0F, "Radar Scale", CivRadar.instance.getConfig().getRadarScale()));
this.buttonList.add(coordToggle = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 80, 100, 20, "Coordinates: "));
this.buttonList.add(new GuiButton(8, this.width / 2 + 1, this.height / 4 + 80, 100, 20, "Waypoint Shizz"));
this.buttonList.add(radarButton = new GuiButton(10, this.width / 2 - 100, this.height / 4 + 104, 100, 20, "Radar: "));
this.buttonList.add(haxMode = new GuiButton(9, this.width / 2 + 1, this.height / 4 + 104, 100, 20, "Hax mode: "));
this.buttonList.add(new GuiButton(100, this.width / 2 - 100, this.height / 4 + 128, "Done"));
}

public void onGuiClosed() {
Expand Down Expand Up @@ -69,6 +71,10 @@ public void actionPerformed(GuiButton guiButton) {
CivRadar.instance.getConfig().setHaxMode(!CivRadar.instance.getConfig().isHaxMode());
CivRadar.instance.saveConfig();
}
if(id == 10) {
CivRadar.instance.getConfig().setEnabled(!CivRadar.instance.getConfig().isEnabled());
CivRadar.instance.saveConfig();
}
if(id == 100) {
mc.displayGuiScreen(parentScreen);
}
Expand All @@ -80,6 +86,7 @@ public void updateScreen() {
config.setRadarScale(scaleSlider.getCurrentValue());
coordToggle.displayString = "Coordinates: " + (CivRadar.instance.getConfig().isRenderCoordinates() ? "On" : "Off");
haxMode.displayString = "Hax Mode: " + (CivRadar.instance.getConfig().isHaxMode() ? "On":"Off");
radarButton.displayString = "Radar: " + (CivRadar.instance.getConfig().isEnabled() ? "On" : "Off");
CivRadar.instance.saveConfig();
opacitySlider.updateDisplayString();
scaleSlider.updateDisplayString();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "civradar",
"name": "CivRadar",
"description": "Radar mod for Civcraft",
"version": "beta-1.2.2",
"version": "beta-1.2.3",
"mcversion": "1.8",
"url": "",
"updateUrl": "",
Expand Down

0 comments on commit 3353990

Please sign in to comment.