- [NEW] Scrollbar rudimentaria per al treeview

This commit is contained in:
2024-06-19 13:57:39 +02:00
parent 6adc44e9d6
commit 96b9b92d53
9 changed files with 299 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 651 B

View File

@@ -7,18 +7,10 @@ floor-texture: 0
wall-texture: 2
door-texture: 0
under-door-texture: 0
exit-xp: 5
exit-xn: 1
exit-zn: 2
actor{
name: PLATFORM00
bmp: test.gif
bmp-rect: 64 0 32 24
bmp-offset: 0 24
pos: 8 28 0
size: 8 8 4
}
actor{
name: PLATFORM02
bmp: test.gif
@@ -28,6 +20,15 @@ actor{
size: 8 8 4
}
actor{
name: PLATFORM00
bmp: test.gif
bmp-rect: 64 0 32 24
bmp-offset: 0 24
pos: 8 28 0
size: 8 8 4
}
actor{
name: PLATFORM01
bmp: test.gif

View File

@@ -8,6 +8,7 @@ wall-texture: 2
door-texture: 0
under-door-texture: 2
exit-xn: 3
exit-yp: 4
exit-zp: 0
actor{

250
data/rooms/04.txt Normal file
View File

@@ -0,0 +1,250 @@
width: 2
height: 3
door-height-yp: 2
door-height-yn: 2
color: GREEN
floor-texture: 1
wall-texture: 5
door-texture: 4
under-door-texture: 0
exit-yn: 2
actor{
name: BOX
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX02
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 16 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX03
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 24 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX20
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 8 0
size: 8 8 8
movement: CW
}
actor{
name: BOX01
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 16 0
size: 8 8 8
movement: CW
}
actor{
name: BOX11
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 24 0
size: 8 8 8
movement: CW
}
actor{
name: BOX12
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 32 0
size: 8 8 8
movement: CW
}
actor{
name: BOX13
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 40 0
size: 8 8 8
movement: CW
}
actor{
name: BOX14
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 48 0
size: 8 8 8
movement: CW
}
actor{
name: BOX21
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 8 56 0
size: 8 8 8
movement: CW
}
actor{
name: BOX15
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 16 56 0
size: 8 8 8
movement: CW
}
actor{
name: BOX16
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 24 56 0
size: 8 8 8
movement: CW
}
actor{
name: BOX04
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 32 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX17
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 32 56 0
size: 8 8 8
movement: CW
}
actor{
name: BOX05
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 40 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX22
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 0 0
size: 8 8 8
movement: CW
}
actor{
name: BOX06
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 8 0
size: 8 8 8
movement: CW
}
actor{
name: BOX07
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 16 0
size: 8 8 8
movement: CW
}
actor{
name: BOX08
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 24 0
size: 8 8 8
movement: CW
}
actor{
name: BOX09
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 32 0
size: 8 8 8
movement: CW
}
actor{
name: BOX10
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 40 0
size: 8 8 8
movement: CW
}
actor{
name: BOX19
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 48 0
size: 8 8 8
movement: CW
}
actor{
name: BOX18
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 40 56 0
size: 8 8 8
movement: CW
}
actor{
name: BOX23
bmp: caixes.gif
bmp-rect: 64 64 32 32
bmp-offset: 0 32
pos: 48 56 0
size: 8 8 8
movement: CW
}

9
data/rooms/05.txt Normal file
View File

@@ -0,0 +1,9 @@
width: 2
height: 2
door-height-xn: 0
color: YELLOW
floor-texture: 8
wall-texture: 8
door-texture: 5
under-door-texture: 0
exit-xn: 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -26,6 +26,8 @@ int room_walldoors = 0;
std::vector<std::string> gifs;
int treeview_scroll = 0;
void restart()
{
room::load(0); //room_w, room_h, room_xp, room_xn, room_yp, room_yn, room_color, room_floor, room_walls, room_doors, room_walldoors);
@@ -424,13 +426,25 @@ bool game::loop()
draw::color(PAPER);
draw::rect(2, 15, 96, 223);
draw::setViewport(0, 15, 100, 225);
draw::setViewport(0, 15, 100, 222);
const int mx = draw::getLocalX(input::mouseX());
const int my = draw::getLocalY(input::mouseY());
const bool btnDown = input::mouseBtn(1) || input::mouseBtn(3);
int line = 0;
if (mx>=0 && mx <=100 && my>=0 && my<=221)
{
treeview_scroll -= input::mouseWheel();
if (treeview_scroll<0) treeview_scroll=0;
}
switch (section)
{
case SECTION_GENERAL: treeview_scroll = 0; break;
case SECTION_ROOM: if (treeview_scroll > room::editor::getCurrentRoom()+1) treeview_scroll = room::editor::getCurrentRoom()+1;
}
int line = -treeview_scroll;
if (section==SECTION_GENERAL)
{
draw::color(LIGHT+BLUE);
@@ -483,6 +497,14 @@ bool game::loop()
}
}
if ((line+treeview_scroll)>24)
{
const float total_size = float(line+treeview_scroll);
int ascensor_length = 222.0f/(total_size/24.0f);
int ascensor_pos = 222.0f/(total_size/treeview_scroll);
draw::color(WHITE);
draw::fillrect(95, ascensor_pos, 2, ascensor_length);
}
/*
break;
case 1:

View File

@@ -10,6 +10,10 @@ x Gràfics de taula
- Grafics de cadires
- Gràfics de conveyor belt
x Gràfics de consoles i comps
- Gràfics de nevera
- Gràfics de bancada de cuina
- Gràfics de sofà?
- Gràfics de Plantes, arbres...
- Decidir objectes de habilitats
- Motxilla, espardenyes...
@@ -18,7 +22,7 @@ x Gràfics de consoles i comps
- Implementar eixides per dalt
x Implementar eixides per baix
- Implementar pickar objectes
x Implementar pickar objectes
- Implementar inventari
- Menus