Commit 314ae8933501db08da2e273f9b26fab378abea15

Authored by DarkGod
1 parent 7fadcf9f

better

... ... @@ -2522,19 +2522,6 @@ do return end
2522 2522 LUA_CONSOLE = self.key.virtuals.LUA_CONSOLE,
2523 2523 }
2524 2524 engine.interface.PlayerHotkeys:bindAllHotkeys(self.key, function(i)
2525   - local kind, id = self.player:getHotkeyInfo(i)
2526   - if kind == "talent" then
2527   - local t = self.player:getTalentFromId(id)
2528   - if (not t) or (not t.allow_use_worldmap and not self.player.allow_talents_worldmap and (not self.zone or self.zone.wilderness)) then
2529   - self.logPlayer(self.player, "You cannot do that on the world map.")
2530   - return
2531   - end
2532   - else
2533   - if not self.zone or self.zone.wilderness then
2534   - self.logPlayer(self.player, "You cannot do that on the world map.")
2535   - return
2536   - end
2537   - end
2538 2525 self:targetTriggerHotkey(i)
2539 2526 self.player:activateHotkey(i)
2540 2527 end)
... ...
... ... @@ -1319,6 +1319,20 @@ end
1319 1319 --- Uses an hotkeyed talent
1320 1320 -- This requires the ActorTalents interface to use talents and a method player:playerUseItem(o, item, inven) to use inventory objects
1321 1321 function _M:activateHotkey(id)
  1322 + local kind, tid = self:getHotkeyInfo(id)
  1323 + if kind == "talent" then
  1324 + local t = self:getTalentFromId(tid)
  1325 + if (not t) or (not t.allow_use_worldmap and not self.allow_talents_worldmap and (not game.zone or game.zone.wilderness)) then
  1326 + game.logPlayer(self, "You cannot do that on the world map.")
  1327 + return false
  1328 + end
  1329 + else
  1330 + if not game.zone or game.zone.wilderness then
  1331 + game.logPlayer(self, "You cannot do that on the world map.")
  1332 + return false
  1333 + end
  1334 + end
  1335 +
1322 1336 -- Visual feedback to show whcih key was pressed
1323 1337 if config.settings.tome.visual_hotkeys and game.uiset.hotkeys_display and game.uiset.hotkeys_display.clics and game.uiset.hotkeys_display.clics[id] and self.hotkey[id] then
1324 1338 local zone = game.uiset.hotkeys_display.clics[id]
... ...
... ... @@ -1809,7 +1809,7 @@ function _M:displayHotkeys(scale, bx, by)
1809 1809 return
1810 1810 end
1811 1811
1812   - if event == "button" and button == "left" and ((game.zone and game.zone.wilderness and not game.player.allow_talents_worldmap) or (game.key ~= game.normal_key)) then return end
  1812 + -- if event == "button" and button == "left" and ((game.zone and game.zone.wilderness and not game.player.allow_talents_worldmap) or (game.key ~= game.normal_key)) then return end
1813 1813 self.hotkeys_display:onMouse(button, mx, my, event == "button",
1814 1814 function(text)
1815 1815 text = text:toTString()
... ...