Skip to content
Snippets Groups Projects
Commit 1f171ec3 authored by DarkGod's avatar DarkGod
Browse files

Added a slight outline to currently moused over item on the map

parent 6389003d
No related branches found
No related tags found
No related merge requests found
......@@ -1711,11 +1711,27 @@ end
function _M:setupMouse(reset)
if reset == nil or reset then self.mouse:reset() end
local cur_obj = nil
local outline = Shader.new("objectsoutline").shad
self.mouse:registerZone(Map.display_x, Map.display_y, Map.viewport.width, Map.viewport.height, function(button, mx, my, xrel, yrel, bx, by, event, extra)
if not self.uiset:isLocked() then return end
if core.shader.allow("adv") and outline then
local tmx, tmy = game.level.map:getMouseTile(mx, my)
local o = self.level.map(tmx, tmy, Map.OBJECT)
if cur_obj and cur_obj._mo then cur_obj._mo:shader(nil) end
if o and o._mo and not o.shader then
outline:paramNumber2("textSize", Map.tile_w, Map.tile_h)
o._mo:shader(outline)
cur_obj = o
end
end
self.tooltip.add_map_str = extra and extra.log_str
if game.tooltip.locked then
if button == "wheelup" and event == "button" then
game.tooltip.container.scrollbar.pos = util.minBound(game.tooltip.container.scrollbar.pos - 1, 0, game.tooltip.container.scrollbar.max)
......@@ -1742,7 +1758,6 @@ function _M:setupMouse(reset)
-- Cheat kill
if config.settings.cheat and button == "right" and core.key.modState("ctrl") and core.key.modState("shift") and not xrel and not yrel and event == "button" and self.zone and not self.zone.wilderness then
local tmx, tmy = game.level.map:getMouseTile(mx, my)
local target = game.level.map(tmx, tmy, Map.ACTOR)
if target then
target:die(game.player)
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
return {
frag = "textoutline",
vert = nil,
args = {
tex = { texture = 0 },
textSize = textSize or {1, 1},
intensity = intensity or 0.3,
outlineSize = outlineSize or {2, 2},
outlineColor = outlineColor or {0, 1, 0.5, 0.4},
},
clone = false,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment