@@ -27,7 +27,6 @@ SkillProgressOverlay.ATTRS {
2727 ' dwarfmode/ViewSheets/UNIT/Skills/Combat' ,
2828 ' dwarfmode/ViewSheets/UNIT/Skills/Social' ,
2929 ' dwarfmode/ViewSheets/UNIT/Skills/Other' ,
30-
3130 ' dungeonmode/ViewSheets/UNIT/Skills/Labor' ,
3231 ' dungeonmode/ViewSheets/UNIT/Skills/Combat' ,
3332 ' dungeonmode/ViewSheets/UNIT/Skills/Social' ,
@@ -79,6 +78,10 @@ function SkillProgressOverlay:preUpdateLayout(parent_rect)
7978 self .frame .h = parent_rect .height - 21
8079end
8180
81+ local function get_threshold (lvl )
82+ return 500 + lvl * 100
83+ end
84+
8285function SkillProgressOverlay :onRenderFrame (dc , rect )
8386 local annotations = {}
8487 local current_unit = df .unit .find (view_sheets .active_id )
@@ -104,7 +107,7 @@ function SkillProgressOverlay:onRenderFrame(dc, rect)
104107 table.insert (annotations , " \n\n\n\n " )
105108 goto continue
106109 end
107- local rating = df . skill_rating . attrs [ math.max ( df . skill_rating . Dabbling , math.min ( skill .rating , df . skill_rating . Legendary5 ))]
110+ local xp_threshold = get_threshold ( skill .rating )
108111 if experience then
109112 if not progress_bar then
110113 table.insert (annotations , NEWLINE )
@@ -122,7 +125,7 @@ function SkillProgressOverlay:onRenderFrame(dc, rect)
122125 pen = level_color ,
123126 })
124127 table.insert (annotations , {
125- text = (' %4d/%4d' ):format (skill .experience , rating . xp_threshold ),
128+ text = (' %4d/%4d' ):format (skill .experience , xp_threshold ),
126129 pen = level_color ,
127130 width = 9 ,
128131 rjustify = true ,
@@ -134,7 +137,7 @@ function SkillProgressOverlay:onRenderFrame(dc, rect)
134137 -- Progress Bar
135138 if progress_bar then
136139 table.insert (annotations , NEWLINE )
137- local percentage = skill .experience / rating . xp_threshold
140+ local percentage = skill .experience / xp_threshold
138141 local barstop = math.floor ((margin * percentage ) + 0.5 )
139142 for i = 0 , margin - 1 do
140143 local color = COLOR_LIGHTCYAN
0 commit comments