From a0a7a78061c3ae9daa44d4dab4342ac4381015aa Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 18 Nov 2025 22:49:30 +0100 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20Ajustat=20el=20color=20del=20proper?= =?UTF-8?q?tygrid=20-=20[NEW]=20Seccions=20en=20el=20propertygrid=20-=20[N?= =?UTF-8?q?EW]=20JA=20es=20mostren=20les=20propietats=20b=C3=A0siques=20de?= =?UTF-8?q?=20les=20habitacions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/main.cpp | 21 ++++++++++++++++++--- source/propertygrid.cpp | 39 ++++++++++++++++++++++++++++----------- source/propertygrid.h | 1 + 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index abb7214..191496a 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -122,10 +122,25 @@ bool loop() tilemap::start(); tilemap::draw(); - + char tmp[256]; propertygrid::start(); - propertygrid::stringProperty("Peiv", "Teib"); - propertygrid::stringProperty("Peiv", "Teib"); + if (treeview::getSelected(0) > -1) { + if (treeview::getSelected(2) == -1) { + propertygrid::sectionProperty("ROOM:"); + propertygrid::stringProperty("NAME", room["room"]["name"].get_value()); + propertygrid::stringProperty("BGCOLOR", room["room"]["bgColor"].get_value()); + propertygrid::stringProperty("BORDER", room["room"]["border"].get_value()); + propertygrid::stringProperty("TILESET", room["room"]["tileSetFile"].get_value()); + propertygrid::stringProperty("ITEMCOL1", room["room"]["itemColor1"].get_value()); + propertygrid::stringProperty("ITEMCOL2", room["room"]["itemColor2"].get_value()); + propertygrid::stringProperty("CONVEYOR", SDL_itoa(room["room"]["autoSurface"].get_value(), tmp, 10)); + propertygrid::sectionProperty("CONNECTIONS:"); + propertygrid::stringProperty("UP", room["room"]["connections"]["up"].is_null()?"null":room["room"]["connections"]["up"].get_value()+": "+rooms[room["room"]["connections"]["up"].get_value()]); + propertygrid::stringProperty("DOWN", room["room"]["connections"]["down"].is_null()?"null":room["room"]["connections"]["down"].get_value()+": "+rooms[room["room"]["connections"]["down"].get_value()]); + propertygrid::stringProperty("LEFT", room["room"]["connections"]["left"].is_null()?"null":room["room"]["connections"]["left"].get_value()+": "+rooms[room["room"]["connections"]["left"].get_value()]); + propertygrid::stringProperty("RIGHT", room["room"]["connections"]["right"].is_null()?"null":room["room"]["connections"]["right"].get_value()+": "+rooms[room["room"]["connections"]["right"].get_value()]); + } + } propertygrid::end(); /*x1 += 6; x2 = x1 + font::len("FILE")+6; diff --git a/source/propertygrid.cpp b/source/propertygrid.cpp index f31435e..c6b4ef3 100644 --- a/source/propertygrid.cpp +++ b/source/propertygrid.cpp @@ -8,22 +8,24 @@ namespace propertygrid int width = 200; int scroll = 0; int line = 0; + int y = 0; int element = 0; int max_elements = 0; void start() { + y = 48; const SDL_Point win_size = draw::getWindowSize(); - draw::setClip(win_size.x-propertygrid::width,48,propertygrid::width, win_size.y-48); + draw::setClip(win_size.x-propertygrid::width,y,propertygrid::width, win_size.y-y); draw::setColor(0xff181818); - draw::fillrect(win_size.x-propertygrid::width,48,propertygrid::width, win_size.y-48); + draw::fillrect(win_size.x-propertygrid::width,y,propertygrid::width, win_size.y-y); //current[0] = current[1] = current[2] = line = element = 0; - max_elements = (win_size.y-48) / 24; + max_elements = (win_size.y-y) / 24; int mx = input::mouseX(); int my = input::mouseY(); - if (mx>=win_size.x-propertygrid::width && my>=48 && mx=win_size.x-propertygrid::width && my>=y && mx