show github link in playfield
This commit is contained in:
@@ -960,6 +960,23 @@ public class Options {
|
||||
}
|
||||
},
|
||||
|
||||
DANCE_HIDE_WATERMARK ("Hide watermark", "HideWaterMark", "Hide the githublink in the top left corner of the playfield", false) {
|
||||
@Override
|
||||
public String getValueString() {
|
||||
return Dancer.hidewatermark ? "Yes" : "No";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void click(GameContainer container) {
|
||||
Dancer.hidewatermark = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showRWM() {
|
||||
return !Dancer.hidewatermark;
|
||||
}
|
||||
},
|
||||
|
||||
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", Pippi.enabled) {
|
||||
@Override
|
||||
public void click(GameContainer container) {
|
||||
@@ -1131,6 +1148,8 @@ public class Options {
|
||||
*/
|
||||
public String getDescription() { return description; }
|
||||
|
||||
public boolean showRWM() { return false; } // this is probably a shitty way to implement this :)
|
||||
|
||||
/**
|
||||
* Returns the boolean value for the option, if applicable.
|
||||
* @return the boolean value
|
||||
|
||||
@@ -108,6 +108,10 @@ public class Updater {
|
||||
/** The download object. */
|
||||
private Download download;
|
||||
|
||||
public String getCurrentVersion() {
|
||||
return currentVersion.getMajorVersion() + "." + currentVersion.getMinorVersion() + "." + currentVersion.getIncrementalVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,7 @@ import itdelatrisu.opsu.beatmap.HitObject;
|
||||
import itdelatrisu.opsu.beatmap.TimingPoint;
|
||||
import itdelatrisu.opsu.db.BeatmapDB;
|
||||
import itdelatrisu.opsu.db.ScoreDB;
|
||||
import itdelatrisu.opsu.downloads.Updater;
|
||||
import itdelatrisu.opsu.objects.Circle;
|
||||
import itdelatrisu.opsu.objects.DummyObject;
|
||||
import itdelatrisu.opsu.objects.GameObject;
|
||||
@@ -630,6 +631,10 @@ public class Game extends BasicGameState {
|
||||
UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, Utils.isGameKeyPressed());
|
||||
else
|
||||
UI.draw(g);
|
||||
|
||||
if (!Dancer.hidewatermark) {
|
||||
Fonts.SMALL.drawString(0.3f, 0.3f, "opsu!dance " + Updater.get().getCurrentVersion() + " by robin_be | https://github.com/yugecin/opsu-dance");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.newdawn.slick.state.StateBasedGame;
|
||||
import org.newdawn.slick.state.transition.FadeInTransition;
|
||||
import org.newdawn.slick.state.transition.EmptyTransition;
|
||||
import yugecin.opsudance.ui.ItemList;
|
||||
import yugecin.opsudance.ui.RWM;
|
||||
|
||||
/**
|
||||
* "Game Options" state.
|
||||
@@ -129,6 +130,7 @@ public class OptionsMenu extends BasicGameState {
|
||||
GameOption.DANCE_REMOVE_BG,
|
||||
GameOption.DANCE_HIDE_OBJECTS,
|
||||
GameOption.DANCE_HIDE_UI,
|
||||
GameOption.DANCE_HIDE_WATERMARK,
|
||||
}),
|
||||
PIPPI ("Pippi", new GameOption[] {
|
||||
GameOption.PIPPI_ENABLE,
|
||||
@@ -203,16 +205,19 @@ public class OptionsMenu extends BasicGameState {
|
||||
private final int state;
|
||||
|
||||
private final ItemList list;
|
||||
private final RWM rwm;
|
||||
|
||||
public OptionsMenu(int state) {
|
||||
this.state = state;
|
||||
list = new ItemList();
|
||||
rwm = new RWM();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(GameContainer container, StateBasedGame game)
|
||||
throws SlickException {
|
||||
list.init(container);
|
||||
rwm.init(container);
|
||||
|
||||
this.container = container;
|
||||
this.game = game;
|
||||
@@ -288,6 +293,9 @@ public class OptionsMenu extends BasicGameState {
|
||||
if (list.isVisible()) {
|
||||
list.render(container, game, g);
|
||||
}
|
||||
if (rwm.isVisible()) {
|
||||
rwm.render(container, game, g);
|
||||
}
|
||||
|
||||
UI.getBackButton().draw();
|
||||
|
||||
@@ -311,6 +319,7 @@ public class OptionsMenu extends BasicGameState {
|
||||
@Override
|
||||
public void update(GameContainer container, StateBasedGame game, int delta)
|
||||
throws SlickException {
|
||||
rwm.update(delta);
|
||||
UI.update(delta);
|
||||
MusicController.loopTrackIfEnded(false);
|
||||
int mouseX = input.getMouseX(), mouseY = input.getMouseY();
|
||||
@@ -325,6 +334,9 @@ public class OptionsMenu extends BasicGameState {
|
||||
if (list.isVisible()) {
|
||||
list.mouseReleased(button, x, y);
|
||||
}
|
||||
if (rwm.isVisible()) {
|
||||
rwm.mouseReleased(button, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -333,6 +345,9 @@ public class OptionsMenu extends BasicGameState {
|
||||
list.mousePressed(button, x, y);
|
||||
return;
|
||||
}
|
||||
if (rwm.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// key entry state
|
||||
if (keyEntryLeft || keyEntryRight) {
|
||||
@@ -367,7 +382,11 @@ public class OptionsMenu extends BasicGameState {
|
||||
if (option != null) {
|
||||
Object[] listItems = option.getListItems();
|
||||
if (listItems == null) {
|
||||
option.click(container);
|
||||
if (option.showRWM()) {
|
||||
rwm.show();
|
||||
} else {
|
||||
option.click(container);
|
||||
}
|
||||
} else {
|
||||
list.setItems(listItems);
|
||||
list.setClickListener(new Observer() {
|
||||
@@ -396,6 +415,9 @@ public class OptionsMenu extends BasicGameState {
|
||||
list.mouseDragged(oldx, oldy, newx, newy);
|
||||
return;
|
||||
}
|
||||
if (rwm.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// key entry state
|
||||
if (keyEntryLeft || keyEntryRight)
|
||||
@@ -437,6 +459,10 @@ public class OptionsMenu extends BasicGameState {
|
||||
list.keyPressed(key, c);
|
||||
return;
|
||||
}
|
||||
if (rwm.isVisible()) {
|
||||
rwm.keyPressed(key, c);
|
||||
return;
|
||||
}
|
||||
|
||||
// key entry state
|
||||
if (keyEntryLeft || keyEntryRight) {
|
||||
|
||||
Reference in New Issue
Block a user