- [NEW] Botó per a activar/desactivar l'edició

- [NEW] Seleccionar actors amb CTRL+Up/Down
This commit is contained in:
2024-06-13 13:29:13 +02:00
parent 50c768edb3
commit 46d46b93cf
2 changed files with 83 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
#include "jfile.h"
#include "jutil.h"
#include "actor.h"
#include "editor.h"
namespace room
{
@@ -95,9 +96,14 @@ namespace room
//void load(int x, int y, int8_t xp, int8_t xn, int8_t yp, int8_t yn, uint8_t col, uint8_t floor, uint8_t walls, uint8_t door, uint8_t walldoor)
void load(const int room)
{
if (modified) editor::save();
if (modified && ::editor::isEditing()) editor::save();
if (room > 64) { perror("ERROR: Nombre d'habitació massa gran! Eixint..."); exit(1); }
actor::actor_t *sel = actor::getSelected();
char selected_actor_name[16]; selected_actor_name[0] = 0;
if (sel) strcpy(selected_actor_name, sel->name);
init();
// Primer carreguem els valors per defecte
@@ -181,6 +187,8 @@ namespace room
}
current_room = room;
refresh();
actor::select(actor::find(selected_actor_name));
}
void update()