Commit fe1cc783cff85c108c190abf3db4d1c4dfa80e98

Authored by dg
1 parent a01a6305

Replacing inscriptions will keep existing keybind


git-svn-id: http://svn.net-core.org/repos/t-engine4@2898 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -394,7 +394,7 @@ end
394 394 function _M:updateCurrentChar()
395 395 if not self.party then return end
396 396 local player = self.party:findMember{main=true}
397   - profile:currentCharacter(self.__mod_info.name, ("%s the level %d %s %s"):format(player.name, player.level, player.descriptor.subrace, player.descriptor.subclass))
  397 + profile:currentCharacter(self.__mod_info.name, ("%s the level %d %s %s"):format(player.name, player.level, player.descriptor.subrace, player.descriptor.subclass), player.__te4_uuid)
398 398 end
399 399
400 400 function _M:getSaveDescription()
... ...
... ... @@ -83,12 +83,15 @@ function _M:setInscription(id, name, data, cooldown, vocal, src, bypass_max_same
83 83
84 84 -- Unlearn old talent
85 85 local oldname = self.inscriptions[id]
  86 + local oldpos = nil
86 87 if oldname then
  88 + for i = 1, 36 do
  89 + if self.hotkey[i] and self.hotkey[i][1] == "talent" and self.hotkey[i][2] == "T_"..oldname then oldpos = i break end
  90 + end
87 91 self:unlearnTalent(self["T_"..oldname])
88 92 self.inscriptions_data[oldname] = nil
89 93 end
90 94
91   --- for k, e in pairs(data) do print(" ****",k,e) end
92 95
93 96 -- Learn new talent
94 97 name = name.."_"..id
... ... @@ -103,6 +106,15 @@ function _M:setInscription(id, name, data, cooldown, vocal, src, bypass_max_same
103 106 if vocal then
104 107 game.logPlayer(self, "You are now inscribed with %s.", t.name)
105 108 end
  109 +
  110 + -- Hotkey
  111 + if oldpos then
  112 + for i = 1, 36 do
  113 + if self.hotkey[i] and self.hotkey[i][1] == "talent" and self.hotkey[i][2] == "T_"..name then self.hotkey[i] = nil end
  114 + end
  115 + self.hotkey[oldpos] = {"talent", "T_"..name}
  116 + end
  117 +
106 118 return true
107 119 end
108 120
... ...