Commit 0ca5ca6c99ab3a51e4a3951a191c166ef8d663a0

Authored by DarkGod
2 parents e9cc327c 97bf59c7

Merge branch 'monster_inscription_display' into 'master'

fix: makes sure charactersheet display all of NPC's inscriptions

since NPCs do not care about inscription slots, they only display the first three runes before.

See merge request !785
... ... @@ -843,9 +843,10 @@ The amount of %s automatically gained or lost each turn.]]):tformat(res_def.name
843 843 h = h + self.font_h
844 844
845 845 local nb_inscriptions = 0
846   - for i = 1, player.max_inscriptions do if player.inscriptions[i] then nb_inscriptions = nb_inscriptions + 1 end end
847   - self:mouseTooltip(self.TOOLTIP_INSCRIPTIONS, s:drawColorStringBlended(self.font, ("#AQUAMARINE#Inscriptions (%d/%d)"):tformat(nb_inscriptions, player.max_inscriptions), w, h, 255, 255, 255, true)) h = h + self.font_h
848   - for i = 1, player.max_inscriptions do if player.inscriptions[i] then
  846 + local max_inscriptions = (player == game.player) and player.max_inscriptions or 6
  847 + for i = 1, max_inscriptions do if player.inscriptions[i] then nb_inscriptions = nb_inscriptions + 1 end end
  848 + self:mouseTooltip(self.TOOLTIP_INSCRIPTIONS, s:drawColorStringBlended(self.font, ("#AQUAMARINE#Inscriptions (%d/%d)"):tformat(nb_inscriptions, math.max(nb_inscriptions, player.max_inscriptions)), w, h, 255, 255, 255, true)) h = h + self.font_h
  849 + for i = 1, max_inscriptions do if player.inscriptions[i] then
849 850 local t = player:getTalentFromId("T_"..player.inscriptions[i])
850 851 local desc = player:getTalentFullDescription(t)
851 852 self:mouseTooltip("#GOLD##{bold}#"..t.name.."#{normal}##WHITE#\n"..tostring(desc), s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s"):format(t.name), w, h, 255, 255, 255, true)) h = h + self.font_h
... ...