- [NEW] Mode d'edició flotant (amb tecla M).

- [FIX] la copa de actors (sobre tot per a templates) també copia la surface.
- [FIX] El push de reacció se li ha de passar al que espenta, no al aspentat.
- [FIX] La posició del cursor en l'editor de posició en bitmap ha de resetejar-se al soltar el botó.
- [NEW] Gràfics del cabronet.
- [NEW] Montons de objectes "templatechats" pa anar editant més apresa.
This commit is contained in:
2024-09-20 13:53:09 +02:00
parent 81b9791144
commit 66241e6a6a
13 changed files with 395 additions and 60 deletions

View File

@@ -26,6 +26,7 @@ namespace actor
draw::surface *brilli;
int current_tag = 0;
bool floating_editing = false;
void resetTag()
{
@@ -96,7 +97,7 @@ namespace actor
{
actor_t *new_act = createEmptyActor();
actor::templates::copy(new_act, act);
new_act->surface = draw::getSurface(new_act->bmp);
//new_act->surface = draw::getSurface(new_act->bmp);
new_act->prev = new_act->next = new_act->above = new_act->below = nullptr;
return new_act;
}
@@ -997,7 +998,7 @@ namespace actor
// ...i encara està baix...
if (is_above(act, act->below)) {
// ...li pase a ell el push, neteje el meu flag, canvie direcció si pertoca i me ane
act->below->push |= push(act, act->below, PUSH_ZN);
act->push |= push(act, act->below, PUSH_ZN); // [RZC 20/09/2024] Canvie "act->below->push" per "act->push". Se li deu passar la reacció al que la inicia
act->push &= ~PUSH_ZN;
if ( (act->flags & FLAG_MOVING) && (act->movement==MOV_Z) ) changeMoving(act);
return;
@@ -1017,7 +1018,7 @@ namespace actor
act->below = below;
below->above = act;
// ... i li passem el push, netejem el meu flag i gonnem
act->below->push |= push(act, act->below, PUSH_ZN);
act->push |= push(act, act->below, PUSH_ZN); // [RZC 20/09/2024] Canvie "act->below->push" per "act->push". Se li deu passar la reacció al que la inicia
act->push &= ~PUSH_ZN;
if ( (act->flags & FLAG_MOVING) && (act->movement==MOV_Z) ) changeMoving(act);
return;
@@ -1317,6 +1318,15 @@ namespace actor
selected = nullptr;
}
void setFloatingEditing(const bool value)
{
floating_editing = value;
}
const bool getFloatingEditing()
{
return floating_editing;
}
namespace templates
{
std::vector<actor_t> templates;
@@ -1447,6 +1457,7 @@ namespace actor
dest->react_push = source->react_push;
dest->movement = source->movement;
dest->template_category = source->template_category;
dest->surface = source->surface;
}
void add(actor_t *act)
@@ -1454,8 +1465,7 @@ namespace actor
// Fem una copia del actor
actor_t new_template;
copy(&new_template, act);
// Li fiquem la categoria per defecte
new_template.template_category = 0;
// Netejem el nom de numerets
cleanName(&new_template);
@@ -1464,9 +1474,11 @@ namespace actor
{
// ... la actualitzem amb les dades del actor seleccionat
actor_t *existing_template = actor::templates::getByName(act->name);
new_template.template_category = existing_template->template_category; // Li fiquem la categoria que tenia abans
copy(existing_template, &new_template);
} else {
// ... i sinó, afegim el actor seleccionat a la llista de plantilles
new_template.template_category = 0; // Li fiquem la categoria per defecte
templates.push_back(new_template);
}
save();