Display View and Type value per screen.

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent 9766e0544a
commit 4a5c8508ff
  1. BIN
      bin/RabiClone.jar
  2. 18
      src/sig/map/Maps.java
  3. 4
      src/sig/map/Tile.java
  4. 9
      src/sig/map/Type.java
  5. 2
      src/sig/objects/EditorRenderer.java

Binary file not shown.

@ -37,4 +37,22 @@ public enum Maps {
return Tile.values()[this.map.tiles[index]];
}
}
public View getView(int x,int y) {
int index = (y/Tile.TILE_SCREEN_COUNT_Y)*(Map.MAP_WIDTH/Tile.TILE_WIDTH)+x/Tile.TILE_SCREEN_COUNT_X;
if (index<0||index>=this.map.views.length) {
return View.DIRECT_FOLLOW;
} else {
return View.values()[this.map.views[index]];
}
}
public Type getType(int x,int y) {
int index = (y/Tile.TILE_SCREEN_COUNT_Y)*(Map.MAP_WIDTH/Tile.TILE_WIDTH)+x/Tile.TILE_SCREEN_COUNT_X;
if (index<0||index>=this.map.types.length) {
return Type.NONE;
} else {
return Type.values()[this.map.types[index]];
}
}
}

@ -1,5 +1,7 @@
package sig.map;
import sig.RabiClone;
public enum Tile {
VOID(0,0,true,CollisionType.NONE), //File is populated by 0s by default. This represents the void.
WALL(0,0,CollisionType.BLOCK),
@ -11,6 +13,8 @@ public enum Tile {
final public static int TILE_WIDTH=32;
final public static int TILE_HEIGHT=32;
final public static int TILE_SCREEN_COUNT_X=RabiClone.BASE_WIDTH/TILE_WIDTH;
final public static int TILE_SCREEN_COUNT_Y=RabiClone.BASE_HEIGHT/TILE_HEIGHT;
int spriteSheetX,spriteSheetY;
boolean invisible;

@ -0,0 +1,9 @@
package sig.map;
public enum Type {
NONE,
POI,
SAVE,
WARP,
SPECIAL_ITEM;
}

@ -114,6 +114,8 @@ public class EditorRenderer extends LevelRenderer{
double tileY = y*Tile.TILE_HEIGHT-this.getY();
DrawTransparentTile(tileX,tileY,selectedTile,Alpha.ALPHA160);
Draw_Text(tileX+2,tileY-Font.PROFONT_12.getGlyphHeight()-2,new StringBuilder(selectedTile.toString()),Font.PROFONT_12);
Draw_Text(tileX+2,tileY+2,new StringBuilder("View: ").append(PaletteColor.EMERALD).append(RabiClone.CURRENT_MAP.getView(x,y).ordinal()),Font.PROFONT_12);
Draw_Text(tileX+2,tileY+Font.PROFONT_12.getGlyphHeight()+2,new StringBuilder("Type: ").append(PaletteColor.MIDNIGHT_BLUE).append(RabiClone.CURRENT_MAP.getType(x,y).ordinal()),Font.PROFONT_12);
Draw_Text_Ext(tileX+2,tileY+Tile.TILE_HEIGHT+2,new StringBuilder(RabiClone.CURRENT_MAP.getTile(x,y).toString()),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.CRIMSON);
}
}

Loading…
Cancel
Save