Assorted cleanup.

This commit is contained in:
GJ 2012-03-31 18:19:24 -04:00
parent 9904eb0b0d
commit bb5a9826bc
4 changed files with 47 additions and 42 deletions

View File

@ -2,12 +2,12 @@ package com.gmail.nossr50.datatypes.buttons;
import org.getspout.spoutapi.gui.GenericButton; import org.getspout.spoutapi.gui.GenericButton;
public class ButtonEscape extends GenericButton public class ButtonEscape extends GenericButton {
{
public ButtonEscape() public ButtonEscape() {
{
this.setText("EXIT"); this.setText("EXIT");
this.setWidth(60).setHeight(20); this.setWidth(60);
this.setHeight(20);
this.setDirty(true); this.setDirty(true);
} }
} }

View File

@ -1,21 +1,14 @@
package com.gmail.nossr50.datatypes.buttons; package com.gmail.nossr50.datatypes.buttons;
import org.getspout.spoutapi.gui.GenericButton;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
public class ButtonHUDStyle extends GenericButton public class ButtonHUDStyle extends ButtonToggle {
{
public ButtonHUDStyle(PlayerProfile PP) public ButtonHUDStyle(PlayerProfile PP) {
{ super("HUD Type: ", PP.getHUDType().toString(), "Change your HUD style!");
this.setText("HUD Type: "+PP.getHUDType().toString());
this.setTooltip("Change your HUD style!");
this.setWidth(120).setHeight(20);
this.setDirty(true);
} }
public void updateText(PlayerProfile PP)
{ public void updateText(PlayerProfile PP) {
this.setText("HUD Type: "+PP.getHUDType().toString()); super.updateText("HUD Type: ", PP.getHUDType().toString());
this.setDirty(true);
} }
} }

View File

@ -1,21 +1,14 @@
package com.gmail.nossr50.datatypes.buttons; package com.gmail.nossr50.datatypes.buttons;
import org.getspout.spoutapi.gui.GenericButton;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
public class ButtonPartyToggle extends GenericButton public class ButtonPartyToggle extends ButtonToggle {
{
public ButtonPartyToggle(PlayerProfile PP) public ButtonPartyToggle(PlayerProfile PP) {
{ super("Party HUD: ", ((Boolean) PP.getPartyHUD()).toString(), "Toggle the Party HUD!");
this.setText("Party HUD: "+PP.getPartyHUD());
this.setTooltip("Toggle the Party HUD!");
this.setWidth(120).setHeight(20);
this.setDirty(true);
} }
public void updateText(PlayerProfile PP)
{ public void updateText(PlayerProfile PP) {
this.setText("Party HUD: "+PP.getPartyHUD()); super.updateText("Party HUD: ", ((Boolean) PP.getPartyHUD()).toString());
this.setDirty(true);
} }
} }

View File

@ -0,0 +1,19 @@
package com.gmail.nossr50.datatypes.buttons;
import org.getspout.spoutapi.gui.GenericButton;
public class ButtonToggle extends GenericButton{
public ButtonToggle(String text1, String text2, String tooltip) {
this.setText(text1 + text2);
this.setTooltip(tooltip);
this.setWidth(120);
this.setHeight(20);
this.setDirty(true);
}
public void updateText(String text1, String text2) {
this.setText(text1 + text2);
this.setDirty(true);
}
}