ajustos de qualitat, canvi de tecles, persistencia de opcions, etc
This commit is contained in:
@@ -82,127 +82,23 @@ assets:
|
|||||||
tilesets:
|
tilesets:
|
||||||
BITMAP:
|
BITMAP:
|
||||||
- ${PREFIX}/data/tilesets/neighborhood.gif
|
- ${PREFIX}/data/tilesets/neighborhood.gif
|
||||||
|
- ${PREFIX}/data/tilesets/city.gif
|
||||||
|
- ${PREFIX}/data/tilesets/forest.gif
|
||||||
|
- ${PREFIX}/data/tilesets/lab.gif
|
||||||
|
- ${PREFIX}/data/tilesets/sewers.gif
|
||||||
- ${PREFIX}/data/tilesets/cave.gif
|
- ${PREFIX}/data/tilesets/cave.gif
|
||||||
- ${PREFIX}/data/tilesets/collision.gif
|
- ${PREFIX}/data/tilesets/collision.gif
|
||||||
|
|
||||||
# ENEMIES
|
# ENEMIES
|
||||||
enemies:
|
enemies:
|
||||||
ANIMATION:
|
ANIMATION:
|
||||||
- ${PREFIX}/data/enemies/abad_bell.yaml
|
|
||||||
- ${PREFIX}/data/enemies/abad.yaml
|
|
||||||
- ${PREFIX}/data/enemies/amstrad_cs.yaml
|
|
||||||
- ${PREFIX}/data/enemies/flying_arounder.yaml
|
|
||||||
- ${PREFIX}/data/enemies/stopped_arounder.yaml
|
|
||||||
- ${PREFIX}/data/enemies/walking_arounder.yaml
|
|
||||||
- ${PREFIX}/data/enemies/arounders_door.yaml
|
|
||||||
- ${PREFIX}/data/enemies/arounders_machine.yaml
|
|
||||||
- ${PREFIX}/data/enemies/bat.yaml
|
|
||||||
- ${PREFIX}/data/enemies/batman_bell.yaml
|
|
||||||
- ${PREFIX}/data/enemies/batman_fire.yaml
|
|
||||||
- ${PREFIX}/data/enemies/batman.yaml
|
|
||||||
- ${PREFIX}/data/enemies/bell.yaml
|
|
||||||
- ${PREFIX}/data/enemies/bin.yaml
|
- ${PREFIX}/data/enemies/bin.yaml
|
||||||
- ${PREFIX}/data/enemies/bird.yaml
|
|
||||||
- ${PREFIX}/data/enemies/breakout.yaml
|
|
||||||
- ${PREFIX}/data/enemies/bry.yaml
|
|
||||||
- ${PREFIX}/data/enemies/chip.yaml
|
|
||||||
- ${PREFIX}/data/enemies/code.yaml
|
- ${PREFIX}/data/enemies/code.yaml
|
||||||
- ${PREFIX}/data/enemies/congo.yaml
|
|
||||||
- ${PREFIX}/data/enemies/crosshair.yaml
|
|
||||||
- ${PREFIX}/data/enemies/demon.yaml
|
|
||||||
- ${PREFIX}/data/enemies/dimallas.yaml
|
|
||||||
- ${PREFIX}/data/enemies/floppy.yaml
|
|
||||||
- ${PREFIX}/data/enemies/dong.yaml
|
|
||||||
- ${PREFIX}/data/enemies/guitar.yaml
|
|
||||||
- ${PREFIX}/data/enemies/heavy.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jailer1.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jailer2.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jailer3.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jailbattle_alien.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jailbattle_human.yaml
|
|
||||||
- ${PREFIX}/data/enemies/jeannine.yaml
|
|
||||||
- ${PREFIX}/data/enemies/lamp.yaml
|
|
||||||
- ${PREFIX}/data/enemies/lord_abad.yaml
|
|
||||||
- ${PREFIX}/data/enemies/matatunos.yaml
|
|
||||||
- ${PREFIX}/data/enemies/mummy.yaml
|
|
||||||
- ${PREFIX}/data/enemies/paco.yaml
|
|
||||||
- ${PREFIX}/data/enemies/elsa.yaml
|
|
||||||
- ${PREFIX}/data/enemies/qvoid.yaml
|
|
||||||
- ${PREFIX}/data/enemies/robot.yaml
|
|
||||||
- ${PREFIX}/data/enemies/sam.yaml
|
|
||||||
- ${PREFIX}/data/enemies/shock.yaml
|
|
||||||
- ${PREFIX}/data/enemies/sigmasua.yaml
|
|
||||||
- ${PREFIX}/data/enemies/spark.yaml
|
|
||||||
- ${PREFIX}/data/enemies/special/aerojailer.yaml
|
|
||||||
- ${PREFIX}/data/enemies/special/arounder.yaml
|
|
||||||
- ${PREFIX}/data/enemies/special/pepe_rosita_job.yaml
|
|
||||||
- ${PREFIX}/data/enemies/special/shooting_star.yaml
|
|
||||||
- ${PREFIX}/data/enemies/spider.yaml
|
|
||||||
- ${PREFIX}/data/enemies/tree_thing.yaml
|
|
||||||
- ${PREFIX}/data/enemies/tuno.yaml
|
|
||||||
- ${PREFIX}/data/enemies/tv_panel.yaml
|
|
||||||
- ${PREFIX}/data/enemies/tv.yaml
|
|
||||||
- ${PREFIX}/data/enemies/upv_student.yaml
|
- ${PREFIX}/data/enemies/upv_student.yaml
|
||||||
- ${PREFIX}/data/enemies/wave.yaml
|
|
||||||
- ${PREFIX}/data/enemies/z80.yaml
|
|
||||||
BITMAP:
|
BITMAP:
|
||||||
- ${PREFIX}/data/enemies/abad_bell.gif
|
|
||||||
- ${PREFIX}/data/enemies/abad.gif
|
|
||||||
- ${PREFIX}/data/enemies/amstrad_cs.gif
|
|
||||||
- ${PREFIX}/data/enemies/flying_arounder.gif
|
|
||||||
- ${PREFIX}/data/enemies/stopped_arounder.gif
|
|
||||||
- ${PREFIX}/data/enemies/walking_arounder.gif
|
|
||||||
- ${PREFIX}/data/enemies/arounders_door.gif
|
|
||||||
- ${PREFIX}/data/enemies/arounders_machine.gif
|
|
||||||
- ${PREFIX}/data/enemies/bat.gif
|
|
||||||
- ${PREFIX}/data/enemies/batman_bell.gif
|
|
||||||
- ${PREFIX}/data/enemies/batman_fire.gif
|
|
||||||
- ${PREFIX}/data/enemies/batman.gif
|
|
||||||
- ${PREFIX}/data/enemies/bell.gif
|
|
||||||
- ${PREFIX}/data/enemies/bin.gif
|
- ${PREFIX}/data/enemies/bin.gif
|
||||||
- ${PREFIX}/data/enemies/bird.gif
|
|
||||||
- ${PREFIX}/data/enemies/breakout.gif
|
|
||||||
- ${PREFIX}/data/enemies/bry.gif
|
|
||||||
- ${PREFIX}/data/enemies/chip.gif
|
|
||||||
- ${PREFIX}/data/enemies/code.gif
|
- ${PREFIX}/data/enemies/code.gif
|
||||||
- ${PREFIX}/data/enemies/congo.gif
|
|
||||||
- ${PREFIX}/data/enemies/crosshair.gif
|
|
||||||
- ${PREFIX}/data/enemies/demon.gif
|
|
||||||
- ${PREFIX}/data/enemies/dimallas.gif
|
|
||||||
- ${PREFIX}/data/enemies/floppy.gif
|
|
||||||
- ${PREFIX}/data/enemies/dong.gif
|
|
||||||
- ${PREFIX}/data/enemies/guitar.gif
|
|
||||||
- ${PREFIX}/data/enemies/heavy.gif
|
|
||||||
- ${PREFIX}/data/enemies/jailer1.gif
|
|
||||||
- ${PREFIX}/data/enemies/jailer2.gif
|
|
||||||
- ${PREFIX}/data/enemies/jailer3.gif
|
|
||||||
- ${PREFIX}/data/enemies/jailbattle_alien.gif
|
|
||||||
- ${PREFIX}/data/enemies/jailbattle_human.gif
|
|
||||||
- ${PREFIX}/data/enemies/jeannine.gif
|
|
||||||
- ${PREFIX}/data/enemies/lamp.gif
|
|
||||||
- ${PREFIX}/data/enemies/lord_abad.gif
|
|
||||||
- ${PREFIX}/data/enemies/matatunos.gif
|
|
||||||
- ${PREFIX}/data/enemies/mummy.gif
|
|
||||||
- ${PREFIX}/data/enemies/paco.gif
|
|
||||||
- ${PREFIX}/data/enemies/elsa.gif
|
|
||||||
- ${PREFIX}/data/enemies/qvoid.gif
|
|
||||||
- ${PREFIX}/data/enemies/robot.gif
|
|
||||||
- ${PREFIX}/data/enemies/sam.gif
|
|
||||||
- ${PREFIX}/data/enemies/shock.gif
|
|
||||||
- ${PREFIX}/data/enemies/sigmasua.gif
|
|
||||||
- ${PREFIX}/data/enemies/spark.gif
|
|
||||||
- ${PREFIX}/data/enemies/special/aerojailer.gif
|
|
||||||
- ${PREFIX}/data/enemies/special/arounder.gif
|
|
||||||
- ${PREFIX}/data/enemies/special/pepe_rosita_job.gif
|
|
||||||
- ${PREFIX}/data/enemies/special/shooting_star.gif
|
|
||||||
- ${PREFIX}/data/enemies/spider.gif
|
|
||||||
- ${PREFIX}/data/enemies/tree_thing.gif
|
|
||||||
- ${PREFIX}/data/enemies/tuno.gif
|
|
||||||
- ${PREFIX}/data/enemies/tv_panel.gif
|
|
||||||
- ${PREFIX}/data/enemies/tv.gif
|
|
||||||
- ${PREFIX}/data/enemies/upv_student.gif
|
- ${PREFIX}/data/enemies/upv_student.gif
|
||||||
- ${PREFIX}/data/enemies/wave.gif
|
|
||||||
- ${PREFIX}/data/enemies/z80.gif
|
|
||||||
|
|
||||||
# PLATFORMS
|
# PLATFORMS
|
||||||
platforms:
|
platforms:
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ tilemap:
|
|||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
||||||
- [1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1]
|
- [1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
||||||
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
room:
|
room:
|
||||||
zone: cave
|
zone: forest
|
||||||
|
|
||||||
# Conexiones de la habitación (null = sin conexión)
|
# Conexiones de la habitación (null = sin conexión)
|
||||||
connections:
|
connections:
|
||||||
@@ -8,21 +8,12 @@ room:
|
|||||||
left: null
|
left: null
|
||||||
right: 01.yaml
|
right: 01.yaml
|
||||||
|
|
||||||
# Colores de los objetos
|
|
||||||
itemColor1: 11
|
|
||||||
itemColor2: 12
|
|
||||||
|
|
||||||
# Dirección de la cinta transportadora: left, none, right
|
|
||||||
conveyorBelt: none
|
|
||||||
|
|
||||||
# Tilemap: 21 filas x 32 columnas @ 8px/tile
|
# Tilemap: 21 filas x 32 columnas @ 8px/tile
|
||||||
tilemap:
|
tilemap:
|
||||||
# Mapa de dibujo (indices de tiles, -1 = vacio)
|
# Mapa de dibujo (indices de tiles, -1 = vacio)
|
||||||
draw:
|
draw:
|
||||||
- [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]
|
- [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]
|
||||||
- [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]
|
- [13, 14, 13, 14, 13, 13, 13, 14, 13, 13, 13, 13, 14, 13, 13, 13, 14, 13, 14, 13, 14, 13, 13, 13, 13, 14, 14, 13, 13, 13, 14, 13]
|
||||||
- [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]
|
|
||||||
- [49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49]
|
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
@@ -34,19 +25,21 @@ tilemap:
|
|||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 25]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 25, 25]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 25, 25, 25]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 1]
|
||||||
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, 25, 25, 25, 25]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 11, 57]
|
||||||
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 11, 57, 25]
|
||||||
|
- [54, 54, 55, 61, 54, 55, 56, 54, 61, 55, 54, 55, 62, 54, 61, 61, 54, 54, 54, 54, 54, 61, 61, 54, 55, 56, 54, 9, 11, 57, 25, 25]
|
||||||
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25]
|
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25]
|
||||||
- [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]
|
- [25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25]
|
||||||
# Mapa de colisiones (0 = vacio, 1 = solido)
|
# Mapa de colisiones (0 = vacio, 1 = solido)
|
||||||
collision:
|
collision:
|
||||||
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
- [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
- [0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
|
|||||||
BIN
data/tilesets/city.gif
Normal file
BIN
data/tilesets/city.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
BIN
data/tilesets/forest.gif
Normal file
BIN
data/tilesets/forest.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
BIN
data/tilesets/lab.gif
Normal file
BIN
data/tilesets/lab.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
BIN
data/tilesets/sewers.gif
Normal file
BIN
data/tilesets/sewers.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
@@ -7,7 +7,29 @@ zones:
|
|||||||
- name: neighborhood
|
- name: neighborhood
|
||||||
tileSetFile: neighborhood.gif
|
tileSetFile: neighborhood.gif
|
||||||
music: 574070_KUVO_Farewell_to_school.ogg
|
music: 574070_KUVO_Farewell_to_school.ogg
|
||||||
|
bgColor: 0
|
||||||
|
|
||||||
- name: cave
|
- name: cave
|
||||||
tileSetFile: cave.gif
|
tileSetFile: cave.gif
|
||||||
music: 574071_EA_DTV.ogg
|
music: 574071_EA_DTV.ogg
|
||||||
|
bgColor: 0
|
||||||
|
|
||||||
|
- name: forest
|
||||||
|
tileSetFile: forest.gif
|
||||||
|
music: 574070_KUVO_Farewell_to_school.ogg
|
||||||
|
bgColor: 35
|
||||||
|
|
||||||
|
- name: sewers
|
||||||
|
tileSetFile: sewers.gif
|
||||||
|
music: 574071_EA_DTV.ogg
|
||||||
|
bgColor: 0
|
||||||
|
|
||||||
|
- name: lab
|
||||||
|
tileSetFile: lab.gif
|
||||||
|
music: 574071_EA_DTV.ogg
|
||||||
|
bgColor: 0
|
||||||
|
|
||||||
|
- name: city
|
||||||
|
tileSetFile: city.gif
|
||||||
|
music: 574071_EA_DTV.ogg
|
||||||
|
bgColor: 0
|
||||||
@@ -9,6 +9,9 @@
|
|||||||
#include "core/locale/locale.hpp" // Para Locale
|
#include "core/locale/locale.hpp" // Para Locale
|
||||||
#include "core/rendering/render_info.hpp" // Para RenderInfo
|
#include "core/rendering/render_info.hpp" // Para RenderInfo
|
||||||
#include "core/rendering/screen.hpp" // Para Screen
|
#include "core/rendering/screen.hpp" // Para Screen
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#include "core/system/debug.hpp" // Para Debug (persistencia de render_info en debug.yaml)
|
||||||
|
#endif
|
||||||
#include "game/options.hpp" // Para Options, options, OptionsVideo, Section
|
#include "game/options.hpp" // Para Options, options, OptionsVideo, Section
|
||||||
#include "game/scene_manager.hpp" // Para SceneManager
|
#include "game/scene_manager.hpp" // Para SceneManager
|
||||||
#include "game/ui/console.hpp" // Para Console
|
#include "game/ui/console.hpp" // Para Console
|
||||||
@@ -292,7 +295,16 @@ namespace GlobalInputs {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case InputAction::TOGGLE_INFO:
|
case InputAction::TOGGLE_INFO:
|
||||||
if (RenderInfo::get() != nullptr) { RenderInfo::get()->toggle(); }
|
if (RenderInfo::get() != nullptr) {
|
||||||
|
// Leemos la intención antes del toggle: isActive() incluye la
|
||||||
|
// animación VANISHING, así que justo después de un toggle ACTIVE→OFF
|
||||||
|
// seguiría devolviendo true y la persistencia no detectaría el cambio.
|
||||||
|
const bool WAS_ACTIVE = RenderInfo::get()->isActive();
|
||||||
|
RenderInfo::get()->toggle();
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (Debug::get() != nullptr) { Debug::get()->setRenderInfoEnabled(!WAS_ACTIVE); }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case InputAction::NONE:
|
case InputAction::NONE:
|
||||||
|
|||||||
@@ -178,6 +178,13 @@ void Debug::loadFromFile() {
|
|||||||
if (needs_save) { saveToFile(); }
|
if (needs_save) { saveToFile(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Persiste el estado del overlay RenderInfo en debug.yaml
|
||||||
|
void Debug::setRenderInfoEnabled(bool value) {
|
||||||
|
if (render_info_enabled_ == value) { return; }
|
||||||
|
render_info_enabled_ = value;
|
||||||
|
saveToFile();
|
||||||
|
}
|
||||||
|
|
||||||
// Guarda la configuración de debug en debug.yaml
|
// Guarda la configuración de debug en debug.yaml
|
||||||
void Debug::saveToFile() const {
|
void Debug::saveToFile() const {
|
||||||
std::ofstream file(debug_file_path_);
|
std::ofstream file(debug_file_path_);
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class Debug {
|
|||||||
void setInitialScene(SceneManager::Scene s) { initial_scene_ = s; } // Establece la escena inicial de debug
|
void setInitialScene(SceneManager::Scene s) { initial_scene_ = s; } // Establece la escena inicial de debug
|
||||||
[[nodiscard]] auto getLazyLoading() const -> bool { return lazy_loading_; } // Indica si el modo lazy de recursos está activo
|
[[nodiscard]] auto getLazyLoading() const -> bool { return lazy_loading_; } // Indica si el modo lazy de recursos está activo
|
||||||
[[nodiscard]] auto getRenderInfoEnabled() const -> bool { return render_info_enabled_; } // Indica si el overlay RenderInfo arranca activo
|
[[nodiscard]] auto getRenderInfoEnabled() const -> bool { return render_info_enabled_; } // Indica si el overlay RenderInfo arranca activo
|
||||||
|
void setRenderInfoEnabled(bool value); // Persiste el estado del overlay RenderInfo en debug.yaml
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Debug* debug; // [SINGLETON] Objeto privado
|
static Debug* debug; // [SINGLETON] Objeto privado
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "core/resources/resource_cache.hpp" // Para Resource::Cache
|
#include "core/resources/resource_cache.hpp" // Para Resource::Cache
|
||||||
#include "core/resources/resource_list.hpp" // Para Resource::List
|
#include "core/resources/resource_list.hpp" // Para Resource::List
|
||||||
#include "core/resources/resource_types.hpp" // Para RoomResource
|
#include "core/resources/resource_types.hpp" // Para RoomResource
|
||||||
|
#include "core/system/debug.hpp" // Para Debug (persistencia de render_info)
|
||||||
#include "external/fkyaml_node.hpp" // Para fkyaml::node (loadSettings)
|
#include "external/fkyaml_node.hpp" // Para fkyaml::node (loadSettings)
|
||||||
#include "game/editor/editor_statusbar.hpp" // Para EditorStatusBar
|
#include "game/editor/editor_statusbar.hpp" // Para EditorStatusBar
|
||||||
#include "game/entities/player.hpp" // Para Player
|
#include "game/entities/player.hpp" // Para Player
|
||||||
@@ -76,7 +77,6 @@ void MapEditor::loadSettings() {
|
|||||||
try {
|
try {
|
||||||
auto yaml = fkyaml::node::deserialize(content);
|
auto yaml = fkyaml::node::deserialize(content);
|
||||||
if (yaml.contains("grid")) { settings_.grid = yaml["grid"].get_value<bool>(); }
|
if (yaml.contains("grid")) { settings_.grid = yaml["grid"].get_value<bool>(); }
|
||||||
if (yaml.contains("show_render_info")) { settings_.show_render_info = yaml["show_render_info"].get_value<bool>(); }
|
|
||||||
if (yaml.contains("minimap_bg")) {
|
if (yaml.contains("minimap_bg")) {
|
||||||
if (yaml["minimap_bg"].is_integer()) {
|
if (yaml["minimap_bg"].is_integer()) {
|
||||||
settings_.minimap_bg = static_cast<Uint8>(yaml["minimap_bg"].get_value<int>());
|
settings_.minimap_bg = static_cast<Uint8>(yaml["minimap_bg"].get_value<int>());
|
||||||
@@ -106,19 +106,17 @@ void MapEditor::saveSettings() const {
|
|||||||
|
|
||||||
file << "# Map Editor Settings\n";
|
file << "# Map Editor Settings\n";
|
||||||
file << "grid: " << (settings_.grid ? "true" : "false") << "\n";
|
file << "grid: " << (settings_.grid ? "true" : "false") << "\n";
|
||||||
file << "show_render_info: " << (settings_.show_render_info ? "true" : "false") << "\n";
|
|
||||||
file << "minimap_bg: " << static_cast<int>(settings_.minimap_bg) << "\n";
|
file << "minimap_bg: " << static_cast<int>(settings_.minimap_bg) << "\n";
|
||||||
file << "minimap_conn: " << static_cast<int>(settings_.minimap_conn) << "\n";
|
file << "minimap_conn: " << static_cast<int>(settings_.minimap_conn) << "\n";
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Muestra/oculta render info (persistente)
|
// Muestra/oculta render info (persistente en debug.yaml, fuente de verdad global)
|
||||||
auto MapEditor::showInfo(bool show) -> std::string {
|
auto MapEditor::showInfo(bool show) -> std::string {
|
||||||
settings_.show_render_info = show;
|
|
||||||
if (RenderInfo::get()->isActive() != show) {
|
if (RenderInfo::get()->isActive() != show) {
|
||||||
RenderInfo::get()->toggle();
|
RenderInfo::get()->toggle();
|
||||||
}
|
}
|
||||||
saveSettings();
|
if (Debug::get() != nullptr) { Debug::get()->setRenderInfoEnabled(show); }
|
||||||
return show ? "Info ON" : "Info OFF";
|
return show ? "Info ON" : "Info OFF";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,18 +201,12 @@ void MapEditor::enter(std::shared_ptr<Room> room, std::shared_ptr<Player> player
|
|||||||
if (!reenter_) {
|
if (!reenter_) {
|
||||||
// Solo guardar estado previo en el primer enter (no en re-enter tras cambio de room)
|
// Solo guardar estado previo en el primer enter (no en re-enter tras cambio de room)
|
||||||
invincible_before_editor_ = Options::cheats.invincible;
|
invincible_before_editor_ = Options::cheats.invincible;
|
||||||
render_info_before_editor_ = RenderInfo::get()->isActive();
|
|
||||||
}
|
}
|
||||||
reenter_ = false;
|
reenter_ = false;
|
||||||
|
|
||||||
// Forzar invencibilidad
|
// Forzar invencibilidad
|
||||||
Options::cheats.invincible = Options::Cheat::State::ENABLED;
|
Options::cheats.invincible = Options::Cheat::State::ENABLED;
|
||||||
|
|
||||||
// Aplicar el setting de render_info del editor
|
|
||||||
if (settings_.show_render_info != RenderInfo::get()->isActive()) {
|
|
||||||
RenderInfo::get()->toggle();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Activar scope de la consola para el editor
|
// Activar scope de la consola para el editor
|
||||||
Console::get()->setScope("editor");
|
Console::get()->setScope("editor");
|
||||||
|
|
||||||
@@ -256,10 +248,6 @@ void MapEditor::exit() {
|
|||||||
if (!reenter_) {
|
if (!reenter_) {
|
||||||
// Solo restaurar en el exit final (no en cambio de room)
|
// Solo restaurar en el exit final (no en cambio de room)
|
||||||
Options::cheats.invincible = invincible_before_editor_;
|
Options::cheats.invincible = invincible_before_editor_;
|
||||||
|
|
||||||
if (RenderInfo::get()->isActive() != render_info_before_editor_) {
|
|
||||||
RenderInfo::get()->toggle();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restaurar prompt y scope de la consola
|
// Restaurar prompt y scope de la consola
|
||||||
@@ -443,8 +431,13 @@ void MapEditor::render() {
|
|||||||
|
|
||||||
// Maneja eventos del editor
|
// Maneja eventos del editor
|
||||||
void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-function-cognitive-complexity)
|
void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-function-cognitive-complexity)
|
||||||
// Si el tile picker está abierto, los eventos van a él
|
// Si el tile picker está abierto, los eventos van a él.
|
||||||
|
// Excepción: la T lo cierra como toggle (sin tocar el brush).
|
||||||
if (tile_picker_.isOpen()) {
|
if (tile_picker_.isOpen()) {
|
||||||
|
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_T && static_cast<int>(event.key.repeat) == 0) {
|
||||||
|
tile_picker_.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
tile_picker_.handleEvent(event);
|
tile_picker_.handleEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -528,7 +521,7 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// T: abrir TilePicker
|
// T: abrir TilePicker (el cierre con T también se gestiona arriba, antes de delegar al picker)
|
||||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_T && static_cast<int>(event.key.repeat) == 0) {
|
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_T && static_cast<int>(event.key.repeat) == 0) {
|
||||||
// Deseleccionar entidades
|
// Deseleccionar entidades
|
||||||
selection_.clear();
|
selection_.clear();
|
||||||
@@ -1464,7 +1457,8 @@ void MapEditor::updateStatusBarInfo() { // NOLINT(readability-function-cognitiv
|
|||||||
// Propiedades de la habitación
|
// Propiedades de la habitación
|
||||||
std::string ts_marker = room_data_.tile_set_overridden ? " (ts*)" : "";
|
std::string ts_marker = room_data_.tile_set_overridden ? " (ts*)" : "";
|
||||||
std::string mu_marker = room_data_.music_overridden ? " (mu*)" : "";
|
std::string mu_marker = room_data_.music_overridden ? " (mu*)" : "";
|
||||||
line2 = "zone:" + room_data_.zone + ts_marker + mu_marker;
|
std::string bg_marker = room_data_.bg_color_overridden ? "*" : "";
|
||||||
|
line2 = "zone:" + room_data_.zone + ts_marker + mu_marker + " bg:" + std::to_string(room_data_.bg_color) + bg_marker;
|
||||||
line3 = "u:" + conn(room_data_.upper_room) + " d:" + conn(room_data_.lower_room) +
|
line3 = "u:" + conn(room_data_.upper_room) + " d:" + conn(room_data_.lower_room) +
|
||||||
" l:" + conn(room_data_.left_room) + " r:" + conn(room_data_.right_room);
|
" l:" + conn(room_data_.left_room) + " r:" + conn(room_data_.right_room);
|
||||||
break;
|
break;
|
||||||
@@ -1509,7 +1503,7 @@ auto MapEditor::getSetCompletions() const -> std::vector<std::string> {
|
|||||||
case EntityType::DOOR:
|
case EntityType::DOOR:
|
||||||
return {"ID", "ANIMATION"};
|
return {"ID", "ANIMATION"};
|
||||||
default:
|
default:
|
||||||
return {"ZONE", "TILESET", "MUSIC", "UP", "DOWN", "LEFT", "RIGHT"};
|
return {"ZONE", "TILESET", "MUSIC", "BGCOLOR", "UP", "DOWN", "LEFT", "RIGHT"};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1733,6 +1727,10 @@ auto MapEditor::setRoomProperty(const std::string& property, const std::string&
|
|||||||
if (!room_data_.music_overridden) {
|
if (!room_data_.music_overridden) {
|
||||||
room_data_.music = zone->music;
|
room_data_.music = zone->music;
|
||||||
}
|
}
|
||||||
|
if (!room_data_.bg_color_overridden) {
|
||||||
|
room_data_.bg_color = zone->bg_color;
|
||||||
|
room_->setBgColor(zone->bg_color);
|
||||||
|
}
|
||||||
autosave();
|
autosave();
|
||||||
return "zone: " + val;
|
return "zone: " + val;
|
||||||
}
|
}
|
||||||
@@ -1758,6 +1756,30 @@ auto MapEditor::setRoomProperty(const std::string& property, const std::string&
|
|||||||
return "tileset: " + tileset;
|
return "tileset: " + tileset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (property == "BGCOLOR") {
|
||||||
|
// "reset" / "none" limpia el override y vuelve a heredar de la zona
|
||||||
|
if (val == "reset" || val == "none") {
|
||||||
|
room_data_.bg_color_overridden = false;
|
||||||
|
const Zone::Data* zone = ZoneManager::get()->getZone(room_data_.zone);
|
||||||
|
if (zone != nullptr) {
|
||||||
|
room_data_.bg_color = zone->bg_color;
|
||||||
|
room_->setBgColor(zone->bg_color);
|
||||||
|
}
|
||||||
|
autosave();
|
||||||
|
return "bgcolor: (inherit from zone)";
|
||||||
|
}
|
||||||
|
int color = 0;
|
||||||
|
try {
|
||||||
|
color = std::stoi(val);
|
||||||
|
} catch (...) { return "usage: set bgcolor <0-255|reset>"; }
|
||||||
|
if (color < 0 || color > 255) { return "bgcolor must be 0-255"; }
|
||||||
|
room_data_.bg_color = static_cast<Uint8>(color);
|
||||||
|
room_data_.bg_color_overridden = true;
|
||||||
|
room_->setBgColor(static_cast<Uint8>(color));
|
||||||
|
autosave();
|
||||||
|
return "bgcolor: " + std::to_string(color);
|
||||||
|
}
|
||||||
|
|
||||||
if (property == "MUSIC") {
|
if (property == "MUSIC") {
|
||||||
// "reset" / "none" limpia el override y vuelve a heredar de la zona
|
// "reset" / "none" limpia el override y vuelve a heredar de la zona
|
||||||
if (val == "reset" || val == "none") {
|
if (val == "reset" || val == "none") {
|
||||||
@@ -1875,7 +1897,7 @@ auto MapEditor::setRoomProperty(const std::string& property, const std::string&
|
|||||||
return toLower(property) + ": " + connection;
|
return toLower(property) + ": " + connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Unknown property: " + property + " (use: zone, itemcolor1, itemcolor2, conveyor, tileset, music, up, down, left, right)";
|
return "Unknown property: " + property + " (use: zone, itemcolor1, itemcolor2, conveyor, tileset, music, bgcolor, up, down, left, right)";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crea una nueva habitación
|
// Crea una nueva habitación
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ class MapEditor {
|
|||||||
// Opciones persistentes del editor
|
// Opciones persistentes del editor
|
||||||
struct Settings {
|
struct Settings {
|
||||||
bool grid{false};
|
bool grid{false};
|
||||||
bool show_render_info{false};
|
|
||||||
Uint8 minimap_bg{2};
|
Uint8 minimap_bg{2};
|
||||||
Uint8 minimap_conn{14};
|
Uint8 minimap_conn{14};
|
||||||
};
|
};
|
||||||
@@ -257,8 +256,7 @@ class MapEditor {
|
|||||||
|
|
||||||
// Estado previo (para restaurar al salir)
|
// Estado previo (para restaurar al salir)
|
||||||
Options::Cheat::State invincible_before_editor_{Options::Cheat::State::DISABLED};
|
Options::Cheat::State invincible_before_editor_{Options::Cheat::State::DISABLED};
|
||||||
bool render_info_before_editor_{false};
|
bool reenter_{false}; // true cuando es un re-enter tras cambio de room
|
||||||
bool reenter_{false}; // true cuando es un re-enter tras cambio de room (no tocar render_info)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DEBUG
|
#endif // _DEBUG
|
||||||
|
|||||||
@@ -198,6 +198,17 @@ void Room::setTileSet(const std::string& tile_set_file) {
|
|||||||
bg_color_);
|
bg_color_);
|
||||||
tilemap_renderer_->initialize(collision_map_->getCollisionTileMap());
|
tilemap_renderer_->initialize(collision_map_->getCollisionTileMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cambia el color de fondo en vivo (para editor)
|
||||||
|
void Room::setBgColor(Uint8 bg_color) {
|
||||||
|
bg_color_ = bg_color;
|
||||||
|
tilemap_renderer_ = std::make_unique<TilemapRenderer>(
|
||||||
|
tile_map_,
|
||||||
|
tile_set_width_,
|
||||||
|
surface_,
|
||||||
|
bg_color_);
|
||||||
|
tilemap_renderer_->initialize(collision_map_->getCollisionTileMap());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Actualiza las variables y objetos de la habitación
|
// Actualiza las variables y objetos de la habitación
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class Room {
|
|||||||
std::string music; // Resuelto: zona o override del yaml
|
std::string music; // Resuelto: zona o override del yaml
|
||||||
bool tile_set_overridden{false}; // True si el yaml tenía tileSetFile explícito
|
bool tile_set_overridden{false}; // True si el yaml tenía tileSetFile explícito
|
||||||
bool music_overridden{false}; // True si el yaml tenía music explícito
|
bool music_overridden{false}; // True si el yaml tenía music explícito
|
||||||
|
bool bg_color_overridden{false}; // True si el yaml tenía bgColor explícito
|
||||||
std::vector<int> tile_map;
|
std::vector<int> tile_map;
|
||||||
std::vector<int> collision_tile_map;
|
std::vector<int> collision_tile_map;
|
||||||
std::vector<Enemy::Data> enemies;
|
std::vector<Enemy::Data> enemies;
|
||||||
@@ -85,6 +86,7 @@ class Room {
|
|||||||
void setCollisionTile(int index, int value);
|
void setCollisionTile(int index, int value);
|
||||||
void setConnection(Border border, const std::string& room_name);
|
void setConnection(Border border, const std::string& room_name);
|
||||||
void setTileSet(const std::string& tile_set_file);
|
void setTileSet(const std::string& tile_set_file);
|
||||||
|
void setBgColor(Uint8 bg_color);
|
||||||
[[nodiscard]] auto getTileSetWidth() const -> int { return tile_set_width_; }
|
[[nodiscard]] auto getTileSetWidth() const -> int { return tile_set_width_; }
|
||||||
#endif
|
#endif
|
||||||
void update(float delta_time);
|
void update(float delta_time);
|
||||||
|
|||||||
@@ -136,6 +136,14 @@ void RoomFormat::parseRoomConfig(const fkyaml::node& yaml, Room::Data& room, con
|
|||||||
room.music = zone->music;
|
room.music = zone->music;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bgColor: zona, override si está en el yaml
|
||||||
|
if (room_node.contains("bgColor")) {
|
||||||
|
room.bg_color = readColorNode(room_node["bgColor"]);
|
||||||
|
room.bg_color_overridden = true;
|
||||||
|
} else if (zone != nullptr) {
|
||||||
|
room.bg_color = zone->bg_color;
|
||||||
|
}
|
||||||
|
|
||||||
// Room connections
|
// Room connections
|
||||||
if (room_node.contains("connections")) {
|
if (room_node.contains("connections")) {
|
||||||
parseRoomConnections(room_node["connections"], room);
|
parseRoomConnections(room_node["connections"], room);
|
||||||
@@ -508,15 +516,17 @@ auto RoomFormat::loadFromString(const std::string& yaml_content, const std::stri
|
|||||||
auto RoomFormat::createDefault() -> Room::Data {
|
auto RoomFormat::createDefault() -> Room::Data {
|
||||||
Room::Data data;
|
Room::Data data;
|
||||||
|
|
||||||
// Zona por defecto (resuelve tile_set_file y music desde ZoneManager)
|
// Zona por defecto (resuelve tile_set_file, music y bg_color desde ZoneManager)
|
||||||
const Zone::Data* zone = ZoneManager::get()->getDefaultZone();
|
const Zone::Data* zone = ZoneManager::get()->getDefaultZone();
|
||||||
if (zone != nullptr) {
|
if (zone != nullptr) {
|
||||||
data.zone = zone->name;
|
data.zone = zone->name;
|
||||||
data.tile_set_file = zone->tile_set_file;
|
data.tile_set_file = zone->tile_set_file;
|
||||||
data.music = zone->music;
|
data.music = zone->music;
|
||||||
|
data.bg_color = zone->bg_color;
|
||||||
}
|
}
|
||||||
data.tile_set_overridden = false;
|
data.tile_set_overridden = false;
|
||||||
data.music_overridden = false;
|
data.music_overridden = false;
|
||||||
|
data.bg_color_overridden = false;
|
||||||
|
|
||||||
// Conexiones a cero
|
// Conexiones a cero
|
||||||
data.upper_room = "0";
|
data.upper_room = "0";
|
||||||
@@ -559,6 +569,11 @@ auto RoomFormat::buildContent(const Room::Data& room_data) -> std::string { //
|
|||||||
out << " music: " << room_data.music << "\n";
|
out << " music: " << room_data.music << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bgColor solo si es override explícito del valor heredado de la zona
|
||||||
|
if (room_data.bg_color_overridden) {
|
||||||
|
out << " bgColor: " << static_cast<int>(room_data.bg_color) << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Conexiones
|
// Conexiones
|
||||||
out << "\n";
|
out << "\n";
|
||||||
out << " # Conexiones de la habitación (null = sin conexión)\n";
|
out << " # Conexiones de la habitación (null = sin conexión)\n";
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <SDL3/SDL.h>
|
||||||
|
|
||||||
#include <string> // Para string
|
#include <string> // Para string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,6 +19,7 @@ namespace Zone {
|
|||||||
std::string name; // Nombre único de la zona (ej. "neighborhood", "cave")
|
std::string name; // Nombre único de la zona (ej. "neighborhood", "cave")
|
||||||
std::string tile_set_file; // Fichero de tileset por defecto (ej. "neighborhood.gif")
|
std::string tile_set_file; // Fichero de tileset por defecto (ej. "neighborhood.gif")
|
||||||
std::string music; // Pista de música por defecto (ej. "574070_KUVO_Farewell_to_school.ogg")
|
std::string music; // Pista de música por defecto (ej. "574070_KUVO_Farewell_to_school.ogg")
|
||||||
|
Uint8 bg_color{0}; // Color de fondo por defecto (índice de paleta)
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Zone
|
} // namespace Zone
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ void ZoneManager::loadFromFile(const std::string& file_path) {
|
|||||||
if (zone_node.contains("music")) {
|
if (zone_node.contains("music")) {
|
||||||
zone.music = zone_node["music"].get_value<std::string>();
|
zone.music = zone_node["music"].get_value<std::string>();
|
||||||
}
|
}
|
||||||
|
if (zone_node.contains("bgColor")) {
|
||||||
|
zone.bg_color = static_cast<Uint8>(zone_node["bgColor"].get_value<int>());
|
||||||
|
}
|
||||||
|
|
||||||
if (zone.name.empty()) {
|
if (zone.name.empty()) {
|
||||||
std::cerr << "ZoneManager: skipping zone without name\n";
|
std::cerr << "ZoneManager: skipping zone without name\n";
|
||||||
|
|||||||
@@ -850,6 +850,9 @@ static auto cmdShow(const std::vector<std::string>& args) -> std::string {
|
|||||||
#endif
|
#endif
|
||||||
if (RenderInfo::get()->isActive()) { return "Info overlay already ON"; }
|
if (RenderInfo::get()->isActive()) { return "Info overlay already ON"; }
|
||||||
RenderInfo::get()->toggle();
|
RenderInfo::get()->toggle();
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (Debug::get() != nullptr) { Debug::get()->setRenderInfoEnabled(true); }
|
||||||
|
#endif
|
||||||
return "Info overlay ON";
|
return "Info overlay ON";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,6 +861,9 @@ static auto cmdHide(const std::vector<std::string>& args) -> std::string {
|
|||||||
if (args.empty() || args[0] != "INFO") { return "usage: hide [info]"; }
|
if (args.empty() || args[0] != "INFO") { return "usage: hide [info]"; }
|
||||||
if (!RenderInfo::get()->isActive()) { return "Info overlay already OFF"; }
|
if (!RenderInfo::get()->isActive()) { return "Info overlay already OFF"; }
|
||||||
RenderInfo::get()->toggle();
|
RenderInfo::get()->toggle();
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (Debug::get() != nullptr) { Debug::get()->setRenderInfoEnabled(false); }
|
||||||
|
#endif
|
||||||
return "Info overlay OFF";
|
return "Info overlay OFF";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,6 +1093,7 @@ void CommandRegistry::registerHandlers() { // NOLINT(readability-function-cogni
|
|||||||
};
|
};
|
||||||
dynamic_providers_["SET ITEMCOLOR1"] = color_provider;
|
dynamic_providers_["SET ITEMCOLOR1"] = color_provider;
|
||||||
dynamic_providers_["SET ITEMCOLOR2"] = color_provider;
|
dynamic_providers_["SET ITEMCOLOR2"] = color_provider;
|
||||||
|
dynamic_providers_["SET BGCOLOR"] = color_provider;
|
||||||
|
|
||||||
// SET ANIMATION: animaciones disponibles para la entidad seleccionada en
|
// SET ANIMATION: animaciones disponibles para la entidad seleccionada en
|
||||||
// el editor. La lista la calcula MapEditor escaneando data/<carpeta>/ del
|
// el editor. La lista la calcula MapEditor escaneando data/<carpeta>/ del
|
||||||
|
|||||||
Reference in New Issue
Block a user