- Nou diseny del treeview

This commit is contained in:
2024-07-24 13:34:41 +02:00
parent 3f6082328e
commit 087ed163cb

View File

@@ -424,6 +424,7 @@ namespace modules
} }
int line = -treeview_scroll; int line = -treeview_scroll;
/*
if (section==SECTION_GENERAL) if (section==SECTION_GENERAL)
{ {
draw::color(LIGHT+BLUE); draw::color(LIGHT+BLUE);
@@ -432,32 +433,50 @@ namespace modules
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) { if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
section = SECTION_GENERAL; section = SECTION_GENERAL;
} }
draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK); //draw::print("-THE POOL", 6, 4+line*9, LIGHT+WHITE, BLACK);
line++; //line++;
for (int i=0;i<64;++i) */
if (section==SECTION_ROOM)
{
for (int i=0;i<MAX_ROOMS;++i)
{ {
if (room::editor::roomExists(i)) if (room::editor::roomExists(i))
{ {
if (section==SECTION_ROOM && i == room::editor::getCurrentRoom()) if (i == room::editor::getCurrentRoom())
{ {
draw::color(LIGHT+BLUE); draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9); draw::fillrect(4, 2+line*9, 92, 9);
} }
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) { if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
if (i == room::editor::getCurrentRoom()) {
section = SECTION_ACTOR;
} else {
room::load(i); room::load(i);
section = SECTION_ROOM; }
} }
char num[] = "+ROOM 00"; char num[] = "+ROOM 00";
num[6] = int(i/10)+48; num[6] = int(i/10)+48;
num[7] = (i%10)+48; num[7] = (i%10)+48;
draw::print(num, 10, 4+line*9, LIGHT+WHITE, BLACK); line++; draw::print(num, 6, 4+line*9, LIGHT+WHITE, BLACK); line++;
}
if (i==room::editor::getCurrentRoom()) }
} else if (section==SECTION_ACTOR)
{ {
if ((mx>=2) && (mx<98) && (my>=2+line*9) && (my<2+9+line*9) && btnDown) {
section = SECTION_ROOM;
}
const int i = room::editor::getCurrentRoom();
char num[] = "-ROOM 00";
num[6] = int(i/10)+48;
num[7] = (i%10)+48;
draw::print(num, 6, 4+line*9, LIGHT+WHITE, BLACK); line++;
act = actor::getFirst(); act = actor::getFirst();
while (act) { while (act)
{
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) { if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR && (act->flags&FLAG_HERO)!=FLAG_HERO) {
if (section==SECTION_ACTOR && act==actor::getSelected()) { if (act==actor::getSelected()) {
draw::color(LIGHT+BLUE); draw::color(LIGHT+BLUE);
draw::fillrect(4, 2+line*9, 92, 9); draw::fillrect(4, 2+line*9, 92, 9);
} }
@@ -470,9 +489,6 @@ namespace modules
} }
act = act->next; act = act->next;
} }
}
}
} }
if ((line+treeview_scroll)>24) if ((line+treeview_scroll)>24)