diff --git a/game/engines/default/engine/Target.lua b/game/engines/default/engine/Target.lua index 9009969f83c679650ee3164c18d12de94cd60598..f525fbebb9671120e170f8829c0a7e2e3d1fddc5 100644 --- a/game/engines/default/engine/Target.lua +++ b/game/engines/default/engine/Target.lua @@ -30,10 +30,10 @@ function _M:init(map, source_actor) self.tile_w, self.tile_h = map.tile_w, map.tile_h self.active = false self.target_type = {} + self.cursor_rotate = 0 self.cursor = engine.Tiles:loadImage("target_cursor.png"):glTexture() self.arrow = engine.Tiles:loadImage("target_arrow.png"):glTexture() - self.targetshader = engine.Tiles:loadImage("ui/targetshader.png"):glTexture() self:createTextures() @@ -106,7 +106,7 @@ function _M:displayArrow(sx, sy, tx, ty, full) core.display.glMatrix(false) end -function _M:display(dispx, dispy, prevfbo) +function _M:display(dispx, dispy, prevfbo, rotate_keyframes) local ox, oy = self.display_x, self.display_y local sx, sy = game.level.map._map:getScroll() sx = sx + game.level.map.display_x @@ -127,7 +127,14 @@ function _M:display(dispx, dispy, prevfbo) end if not self.target_type.immediate_keys or firstx then - self.cursor:toScreen(self.display_x + (self.target.x - game.level.map.mx) * self.tile_w * Map.zoom, self.display_y + (self.target.y - game.level.map.my + util.hexOffset(self.target.x)) * self.tile_h * Map.zoom, self.tile_w * Map.zoom, self.tile_h * Map.zoom) + core.display.glMatrix(true) + core.display.glTranslate(self.display_x + (self.target.x - game.level.map.mx) * self.tile_w * Map.zoom + self.tile_w * Map.zoom / 2, self.display_y + (self.target.y - game.level.map.my + util.hexOffset(self.target.x)) * self.tile_h * Map.zoom + self.tile_h * Map.zoom / 2, 0) + if rotate_keyframes then + self.cursor_rotate = self.cursor_rotate - rotate_keyframes / 2 + core.display.glRotate(self.cursor_rotate, 0, 0, 1) + end + self.cursor:toScreen(-self.tile_w * Map.zoom / 2, -self.tile_h * Map.zoom / 2, self.tile_w * Map.zoom, self.tile_h * Map.zoom) + core.display.glMatrix(false) end if self.target_type.immediate_keys then diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index d465ae39792df171068b37bd7f6462f27a80e897..e08894c3da39c8e9da5d50dfe1887f4a22156a71 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1362,13 +1362,13 @@ function _M:displayMap(nb_keyframes) _2DNoise:bind(1, false) self.fbo2:toScreen(map.display_x, map.display_y, map.viewport.width, map.viewport.height, self.fbo_shader.shad) - if self.target then self.target:display(nil, nil, self.full_fbo) end + if self.target then self.target:display(nil, nil, self.full_fbo, nb_keyframes) end -- Basic display; no FBOs else if self.level.data.background then self.level.data.background(self.level, map.display_x, map.display_y, nb_keyframes) end map:display(nil, nil, nb_keyframes, config.settings.tome.smooth_fov) - if self.target then self.target:display(nil, nil, self.full_fbo) end + if self.target then self.target:display(nil, nil, self.full_fbo, nb_keyframes) end if self.level.data.foreground then self.level.data.foreground(self.level, map.display_x, map.display_y, nb_keyframes) end if self.level.data.weather_particle then self.state:displayWeather(self.level, self.level.data.weather_particle, nb_keyframes) end if self.level.data.weather_shader then self.state:displayWeatherShader(self.level, self.level.data.weather_shader, map.display_x, map.display_y, nb_keyframes) end diff --git a/game/modules/tome/data/gfx/shockbolt/target_cursor.png b/game/modules/tome/data/gfx/shockbolt/target_cursor.png index 94773df6d1f3753833ec3337e88792db9c84044b..653510f958797e801640ccb267eeb7b3a9898898 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/target_cursor.png and b/game/modules/tome/data/gfx/shockbolt/target_cursor.png differ diff --git a/game/modules/tome/data/gfx/ui/targetshader.png b/game/modules/tome/data/gfx/ui/targetshader.png index 4fcc408dd9298a1cce7fe60691e857d8a7d23367..222ab8111b2bf396519fa76512c2acb05cc5d016 100644 Binary files a/game/modules/tome/data/gfx/ui/targetshader.png and b/game/modules/tome/data/gfx/ui/targetshader.png differ