- [FIX] Ficar el push de moviment al especificar moviment en l'editor
This commit is contained in:
@@ -157,7 +157,7 @@ void btn_check(const int x, const int y, const char* label, uint8_t &flags, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void btn_check(const int x, const int y, const char* label, uint16_t &flags, const uint16_t value)
|
const bool btn_check(const int x, const int y, const char* label, uint16_t &flags, const uint16_t value)
|
||||||
{
|
{
|
||||||
int result=0;
|
int result=0;
|
||||||
if (flags & value) {
|
if (flags & value) {
|
||||||
@@ -172,10 +172,12 @@ void btn_check(const int x, const int y, const char* label, uint16_t &flags, con
|
|||||||
} else {
|
} else {
|
||||||
flags = flags | value;
|
flags = flags | value;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void btn_opt(const char* label, const int x, const int y, uint8_t &var, std::vector<uint8_t> values, std::vector<std::string> labels)
|
const bool btn_opt(const char* label, const int x, const int y, uint8_t &var, std::vector<uint8_t> values, std::vector<std::string> labels)
|
||||||
{
|
{
|
||||||
//draw::print(label, x, y+3, 15, 0);
|
//draw::print(label, x, y+3, 15, 0);
|
||||||
ui::label(label, x, y, 32, 11);
|
ui::label(label, x, y, 32, 11);
|
||||||
@@ -192,7 +194,9 @@ void btn_opt(const char* label, const int x, const int y, uint8_t &var, std::vec
|
|||||||
{
|
{
|
||||||
pos++; if (pos==values.size()) pos=0;
|
pos++; if (pos==values.size()) pos=0;
|
||||||
var = values[pos];
|
var = values[pos];
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool btn_opt2(const char* label, const int x, const int y, char *var, std::vector<std::string> values)
|
bool btn_opt2(const char* label, const int x, const int y, char *var, std::vector<std::string> values)
|
||||||
@@ -389,7 +393,7 @@ bool game::loop()
|
|||||||
draw::color(WHITE);
|
draw::color(WHITE);
|
||||||
draw::fillrect(0, 0, 100, 240);
|
draw::fillrect(0, 0, 100, 240);
|
||||||
|
|
||||||
bool room_changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
switch (section)
|
switch (section)
|
||||||
{
|
{
|
||||||
@@ -398,25 +402,26 @@ switch (section)
|
|||||||
|
|
||||||
case SECTION_ROOM:
|
case SECTION_ROOM:
|
||||||
|
|
||||||
room_changed |= btn("ROOM WIDTH:", 10, 40, room::editor::refWidth(), 0, 3);
|
changed |= btn("ROOM WIDTH:", 10, 40, room::editor::refWidth(), 0, 3);
|
||||||
room_changed |= btn("ROOM HEIGHT:", 10, 55, room::editor::refHeight(), 0, 3);
|
changed |= btn("ROOM HEIGHT:", 10, 55, room::editor::refHeight(), 0, 3);
|
||||||
|
|
||||||
draw::print("DOORS:", 10, 80, 15, 0);
|
draw::print("DOORS:", 10, 80, 15, 0);
|
||||||
room_changed |= btn_small(32, 80, room::editor::refDoor(XN), -1, 5);
|
changed |= btn_small(32, 80, room::editor::refDoor(XN), -1, 5);
|
||||||
room_changed |= btn_small(49, 80, room::editor::refDoor(YP), -1, 5);
|
changed |= btn_small(49, 80, room::editor::refDoor(YP), -1, 5);
|
||||||
room_changed |= btn_small(66, 80, room::editor::refDoor(XP), -1, 5);
|
changed |= btn_small(66, 80, room::editor::refDoor(XP), -1, 5);
|
||||||
room_changed |= btn_small(83, 80, room::editor::refDoor(YN), -1, 5);
|
changed |= btn_small(83, 80, room::editor::refDoor(YN), -1, 5);
|
||||||
|
|
||||||
room_changed |= btn("COLOR:", 10, 140, room::editor::refColor(), 5, 11);
|
changed |= btn("COLOR:", 10, 140, room::editor::refColor(), 5, 11);
|
||||||
room_changed |= btn("FLOOR:", 10, 155, room::editor::refFloorTex(), 0, 5);
|
changed |= btn("FLOOR:", 10, 155, room::editor::refFloorTex(), 0, 5);
|
||||||
room_changed |= btn("WALLS:", 10, 170, room::editor::refWallTex(), 0, 5);
|
changed |= btn("WALLS:", 10, 170, room::editor::refWallTex(), 0, 5);
|
||||||
room_changed |= btn("DOORS:", 10, 185, room::editor::refDoorTex(), 0, 4);
|
changed |= btn("DOORS:", 10, 185, room::editor::refDoorTex(), 0, 4);
|
||||||
room_changed |= btn("WDOORS:", 10, 200, room::editor::refWallDoorTex(), 0, 5);
|
changed |= btn("WDOORS:", 10, 200, room::editor::refWallDoorTex(), 0, 5);
|
||||||
|
|
||||||
if (room_changed) room::update();
|
if (changed) room::update();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SECTION_ACTOR:
|
case SECTION_ACTOR:
|
||||||
|
changed = false;
|
||||||
act = actor::getSelected();
|
act = actor::getSelected();
|
||||||
if (act)
|
if (act)
|
||||||
{
|
{
|
||||||
@@ -451,16 +456,18 @@ switch (section)
|
|||||||
btn_check(2, 64, "HERO", act->flags, FLAG_HERO);
|
btn_check(2, 64, "HERO", act->flags, FLAG_HERO);
|
||||||
btn_check(26, 64, "PUSH", act->flags, FLAG_PUSHABLE);
|
btn_check(26, 64, "PUSH", act->flags, FLAG_PUSHABLE);
|
||||||
btn_check(50, 64, "REAC", act->flags, FLAG_REACTIVE);
|
btn_check(50, 64, "REAC", act->flags, FLAG_REACTIVE);
|
||||||
btn_check(74, 64, "MOVI", act->flags, FLAG_MOVING);
|
changed |= btn_check(74, 64, "MOVI", act->flags, FLAG_MOVING);
|
||||||
btn_check(2, 74, "ANIM", act->flags, FLAG_ANIMATED);
|
btn_check(2, 74, "ANIM", act->flags, FLAG_ANIMATED);
|
||||||
btn_check(26, 74, "ORIE", act->flags, FLAG_ORIENTABLE);
|
btn_check(26, 74, "ORIE", act->flags, FLAG_ORIENTABLE);
|
||||||
btn_check(50, 74, "DEAD", act->flags, FLAG_DEADLY);
|
btn_check(50, 74, "DEAD", act->flags, FLAG_DEADLY);
|
||||||
btn_check(74, 74, "GRAV", act->flags, FLAG_GRAVITY);
|
btn_check(74, 74, "GRAV", act->flags, FLAG_GRAVITY);
|
||||||
|
|
||||||
btn_opt("ORIENT", 2, 86, act->orient, {PUSH_NONE, PUSH_XP, PUSH_XN, PUSH_YP, PUSH_YN, PUSH_ZP, PUSH_ZN}, {"NONE", "XP", "XN", "YP", "YN", "ZP", "ZN"});
|
changed |= btn_opt("ORIENT", 2, 86, act->orient, {PUSH_NONE, PUSH_XP, PUSH_XN, PUSH_YP, PUSH_YN, PUSH_ZP, PUSH_ZN}, {"NONE", "XP", "XN", "YP", "YN", "ZP", "ZN"});
|
||||||
btn_opt("MOVEMNT", 2, 96, act->movement, {MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_HUNT}, {"NONE", "X", "Y", "Z", "CW", "CCW", "RAND", "HUNT"});
|
changed |= btn_opt("MOVEMNT", 2, 96, act->movement, {MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_HUNT}, {"NONE", "X", "Y", "Z", "CW", "CCW", "RAND", "HUNT"});
|
||||||
btn_opt("ANIMCYC", 2, 106, act->anim_cycle, {0, 1}, {"0 1 0 2", "0 1 2 3"});
|
btn_opt("ANIMCYC", 2, 106, act->anim_cycle, {0, 1}, {"0 1 0 2", "0 1 2 3"});
|
||||||
|
|
||||||
|
if (changed) act->mov_push = act->orient;
|
||||||
|
|
||||||
//draw::print("ANIM SPEED:", 2, 156, 15, 0);
|
//draw::print("ANIM SPEED:", 2, 156, 15, 0);
|
||||||
ui::label("ANMSPED", 2, 116, 32, 11);
|
ui::label("ANMSPED", 2, 116, 32, 11);
|
||||||
btn_small(81, 116, act->anim_wait, 0, 10);
|
btn_small(81, 116, act->anim_wait, 0, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user