prettyfied assignments
parent
7a8f7e1ea3
commit
0a16501f8d
|
@ -1,11 +0,0 @@
|
|||
package MoF;
|
||||
|
||||
import amidst.Options;
|
||||
import amidst.map.MapMarkers;
|
||||
|
||||
public class NetherMapObject extends MapObject {
|
||||
public NetherMapObject(int eX, int eY) {
|
||||
super(MapMarkers.NETHER_FORTRESS, eX, eY);
|
||||
model = Options.instance.showNetherFortresses;
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package MoF;
|
||||
|
||||
import amidst.map.MapMarkers;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Player extends MapObject {
|
||||
private String name;
|
||||
public boolean needSave;
|
||||
private BufferedImage marker;
|
||||
|
||||
public Player(String name, int x, int y) {
|
||||
super(MapMarkers.PLAYER, x , y);
|
||||
marker = type.image;
|
||||
needSave = false;
|
||||
this.setName(name);
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public int getWidth() {
|
||||
return (int)(marker.getWidth()*localScale*3);
|
||||
}
|
||||
public int getHeight() {
|
||||
return (int)(marker.getHeight()*localScale*3);
|
||||
}
|
||||
public void setPosition(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
needSave = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getImage() {
|
||||
return marker;
|
||||
}
|
||||
|
||||
public void setMarker(BufferedImage img) {
|
||||
this.marker = img;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Player \"" + name + "\" at (" + x + ", " + y + ")";
|
||||
}
|
||||
}
|
|
@ -29,16 +29,16 @@ public class AmidstMenu extends JMenuBar {
|
|||
public AmidstMenu(FinderWindow win) {
|
||||
this.window = win;
|
||||
|
||||
add(fileMenu = new FileMenu());
|
||||
// scriptMenu = new JMenu("Script") {{
|
||||
fileMenu = add(new FileMenu());
|
||||
// scriptMenu = add(new JMenu("Script") {{
|
||||
// setEnabled(false);
|
||||
// add(new JMenuItem("New"));
|
||||
// add(new JMenuItem("Open"));
|
||||
// add(new JMenuItem("Save"));
|
||||
// add(new JMenuItem("Run"));
|
||||
// }};
|
||||
add(mapMenu = new MapMenu());
|
||||
add(helpMenu = new HelpMenu());
|
||||
// }});
|
||||
mapMenu = add(new MapMenu());
|
||||
helpMenu = add(new HelpMenu());
|
||||
}
|
||||
|
||||
private class FileMenu extends JMenu {
|
||||
|
@ -162,16 +162,11 @@ public class AmidstMenu extends JMenuBar {
|
|||
String s = JOptionPane.showInputDialog(null, "Enter coordinates: (Ex. 123,456)", "Go To", JOptionPane.QUESTION_MESSAGE);
|
||||
if (s != null) {
|
||||
String[] c = s.split(",");
|
||||
long x = 0, y = 0;
|
||||
boolean w = true;
|
||||
try {
|
||||
x = Long.parseLong(c[0]) >> 2;
|
||||
y = Long.parseLong(c[1]) >> 2;
|
||||
} catch (Exception e) {
|
||||
w = false;
|
||||
}
|
||||
if (w)
|
||||
long x = Long.parseLong(c[0]) >> 2;
|
||||
long y = Long.parseLong(c[1]) >> 2;
|
||||
window.curProject.moveMapTo((int)x, (int)y);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ public class MapObject extends Point {
|
|||
public MapMarkers type;
|
||||
public int rx, ry;
|
||||
public double localScale = 1.0;
|
||||
@Deprecated
|
||||
public double tempDist = 0;
|
||||
protected JToggleButton.ToggleButtonModel model;
|
||||
|
||||
|
|
Loading…
Reference in New Issue