Skip to content

Commit 8dfd2ec

Browse files
committed
room-list: use getRoomDescription()
1 parent f76e417 commit 8dfd2ec

1 file changed

Lines changed: 5 additions & 26 deletions

File tree

gui/room-list.lua

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,18 @@ local gui = require 'gui'
1717
local guidm = require 'gui.dwarfmode'
1818

1919
local room_type_table = {
20-
[df.building_bedst] = { token = 'bed', qidx = 2, tile = 233 },
21-
[df.building_tablest] = { token = 'table', qidx = 3, tile = 209 },
22-
[df.building_chairst] = { token = 'chair', qidx = 4, tile = 210 },
23-
[df.building_coffinst] = { token = 'coffin', qidx = 5, tile = 48 },
24-
}
25-
26-
local room_quality_table = {
27-
{ 1, 'Meager Quarters', 'Meager Dining Room', 'Meager Office', 'Grave' },
28-
{ 100, 'Modest Quarters', 'Modest Dining Room', 'Modest Office', "Servant's Burial Chamber" },
29-
{ 250, 'Quarters', 'Dining Room', 'Office', 'Burial Chamber' },
30-
{ 500, 'Decent Quarters', 'Decent Dining Room', 'Decent Office', 'Tomb' },
31-
{ 1000, 'Fine Quarters', 'Fine Dining Room', 'Splendid Office', 'Fine Tomb' },
32-
{ 1500, 'Great Bedroom', 'Great Dining Room', 'Throne Room', 'Mausoleum' },
33-
{ 2500, 'Grand Bedroom', 'Grand Dining Room', 'Opulent Throne Room', 'Grand Mausoleum' },
34-
{ 10000, 'Royal Bedroom', 'Royal Dining Room', 'Royal Throne Room', 'Royal Mausoleum' }
20+
[df.building_bedst] = { token = 'bed', tile = 233 },
21+
[df.building_tablest] = { token = 'table', tile = 209 },
22+
[df.building_chairst] = { token = 'chair', tile = 210 },
23+
[df.building_coffinst] = { token = 'coffin', tile = 48 },
3524
}
3625

3726
function getRoomName(building, unit)
3827
local info = room_type_table[building._type]
3928
if not info or not building.is_room then
4029
return utils.getBuildingName(building)
4130
end
42-
43-
local quality = building:getRoomValue(unit)
44-
local row = room_quality_table[1]
45-
for _,v in ipairs(room_quality_table) do
46-
if v[1] <= quality then
47-
row = v
48-
else
49-
break
50-
end
51-
end
52-
return row[info.qidx]
31+
return dfhack.buildings.getRoomDescription(building, unit)
5332
end
5433

5534
function makeRoomEntry(bld, unit, is_spouse)

0 commit comments

Comments
 (0)