Skip to content

Commit ed4a014

Browse files
authored
Merge pull request #1441 from myk002/myk_readable_english
adapt to longer strings returned from getReadableName
2 parents 3ea6b88 + be763fa commit ed4a014

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

gui/family-affairs.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ end
777777
FamilyAffairs = defclass(FamilyAffairs, widgets.Window)
778778
FamilyAffairs.ATTRS {
779779
frame_title='Family manager',
780-
frame={w=50, h=30, r=2, t=18},
780+
frame={w=65, h=30, r=2, t=18},
781781
frame_inset={t=1, l=1, r=1},
782782
resizable=true,
783783
initial_tab=DEFAULT_NIL,

gui/manipulator.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -709,11 +709,11 @@ function Spreadsheet:init()
709709
},
710710
DataColumn{
711711
view_id='name',
712-
frame={w=30},
712+
frame={w=45},
713713
label='Name',
714714
label_inset=8,
715715
data_fn=dfhack.units.getReadableName,
716-
data_width=30,
716+
data_width=45,
717717
shared=self.shared,
718718
},
719719
cols,

gui/sitemap.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818
Sitemap = defclass(Sitemap, widgets.Window)
1919
Sitemap.ATTRS {
2020
frame_title='Sitemap',
21-
frame={w=57, r=2, t=18, h=25},
21+
frame={w=67, r=2, t=18, h=25},
2222
resizable=true,
2323
resize_min={w=44, h=20},
2424
frame_inset={l=1, t=1, r=0, b=0},

gui/unit-info-viewer.lua

+3-13
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ local function get_name_chunk(unit)
179179
}
180180
end
181181

182-
local function get_translated_name_chunk(unit)
183-
local tname = dfhack.translation.translateName(dfhack.units.getVisibleName(unit), true)
184-
if #tname == 0 then return '' end
185-
return ('"%s"'):format(tname)
186-
end
187-
188182
local function get_description_chunk(unit)
189183
local desc = dfhack.units.getCasteRaw(unit).description
190184
if #desc == 0 then return end
@@ -458,15 +452,12 @@ function UnitInfo:init()
458452
self:addviews{
459453
widgets.Label{
460454
view_id='nameprof',
461-
frame={t=0, l=0},
462-
},
463-
widgets.Label{
464-
view_id='translated_name',
465-
frame={t=1, l=0},
455+
frame={t=0, l=0, h=1},
456+
auto_height=false,
466457
},
467458
widgets.Label{
468459
view_id='chunks',
469-
frame={t=3, l=0, b=0, r=0},
460+
frame={t=2, l=0, b=0, r=0},
470461
auto_height=false,
471462
text='Please select a unit.',
472463
},
@@ -492,7 +483,6 @@ end
492483
function UnitInfo:refresh(unit, width)
493484
self.unit_id = unit.id
494485
self.subviews.nameprof:setText{get_name_chunk(unit)}
495-
self.subviews.translated_name:setText{get_translated_name_chunk(unit)}
496486

497487
local chunks = {}
498488
add_chunk(chunks, get_description_chunk(unit), width)

0 commit comments

Comments
 (0)