Guest User

codpiece ClassicPlayerDisplay

a guest
Jul 30th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1.  
  2.  
  3. require "engine.class"
  4. local Mouse = require "engine.Mouse"
  5. local Button = require "engine.ui.Button"
  6. local TooltipsData = require "mod.class.interface.TooltipsData"
  7.  
  8. module(..., package.seeall, class.inherit(TooltipsData))
  9.  
  10. -- how much from the original file do I have to put here? just add new thing, not copy
  11.  
  12. function _M:display()
  13.     local player = game.player
  14.     if not player or not player.changed or not game.level then return end
  15.  
  16.     self.mouse:reset()
  17.     self.items = {}
  18.  
  19.     local cur_exp, max_exp = player.exp, player:getExpChart(player.level+1)
  20.     local h = 6
  21.     local x = 2
  22.    
  23.     -- hmm add cha somehow to this separate or with a group?
  24.     self:mouseTooltip(self.TOOLTIP_STRDEXCON, self:makeTexture(("Str/Dex/Con: #00ff00#%3d/%3d/%3d"):format(player:getStr(), player:getDex(), player:getCon()), x, h, 255, 255, 255)) h = h + self.font_h
  25.     self:mouseTooltip(self.TOOLTIP_MAGWILCUN, self:makeTexture(("Mag/Wil/Cun: #00ff00#%3d/%3d/%3d"):format(player:getMag(), player:getWil(), player:getCun()), x, h, 255, 255, 255)) h = h + self.font_h
  26.     self:mouseTooltip(self.TOOLTIP_CHA, self:makeTexture(("Cha: #00ff00#%3d"):format(player:getCha()), x, h, 255, 255, 255)) h = h + self.font_h
  27.     h = h + self.font_h
  28.    
  29.     if player:knowTalent(player.T_LIBIDO_POOL) then
  30.         local chance = player:libidoFailChance()
  31.         self:mouseTooltip(self.TOOLTIP_LIBIDO, self:makeTextureBar("#LIGHT_STEEL_BLUE#Libido:", ("%d/%d (%d%s)"):format(player:getModifiedLibido(), player:getLibido(), chance, "%%"), chance, 100, chance, x, h, 255, 255, 255,
  32.             {r=176 / 2, g=196 / 2, b=222 / 2},
  33.             {r=176 / 5, g=196 / 5, b=222 / 5}
  34.         )) h = h + self.font_h
  35.     end
  36. }
  37.    
  38.     --or as below but the above would be interesting, copied from paradox pool code. lol, so if libido gets too high weird things could happen.
  39.    
  40. --if player:knowTalent(player.T_PSI_POOL) then
  41.     --  self:mouseTooltip(self.TOOLTIP_PSI, self:makeTextureBar("#7fffd4#Psi:", nil, player:getPsi(), player.max_psi, player.psi_regen, x, h, 255, 255, 255,
  42.         --  {r=colors.BLUE.r / 2, g=colors.BLUE.g / 2, b=colors.BLUE.b / 2},
  43.         --  {r=colors.BLUE.r / 5, g=colors.BLUE.g / 5, b=colors.BLUE.b / 5}
  44.         --)) h = h + self.font_h
  45.     --end
Advertisement
Add Comment
Please, Sign In to add comment