diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua index c6ef664831ba2078df7082518f44b15db265c652..d3759b109f15eeb0b9878c69de7e04165ffe7f30 100644 --- a/game/engines/default/engine/Map.lua +++ b/game/engines/default/engine/Map.lua @@ -730,10 +730,11 @@ function _M:checkMapViewBounded() if self.my > self.h - self.viewport.mheight then self.my = self.h - self.viewport.mheight self.changed = true end -- Center if smaller than map viewport - if self.w < self.viewport.mwidth then self.mx = math.floor((self.w - self.viewport.mwidth) / 2) end - if self.h < self.viewport.mheight then self.my = math.floor((self.h - self.viewport.mheight) / 2) end + local centered = false + if self.w < self.viewport.mwidth then self.mx = math.floor((self.w - self.viewport.mwidth) / 2) centered = true end + if self.h < self.viewport.mheight then self.my = math.floor((self.h - self.viewport.mheight) / 2) centered = true end - self._map:setScroll(self.mx, self.my, self.smooth_scroll) + self._map:setScroll(self.mx, self.my, centered and 0 or self.smooth_scroll) end --- Gets the tile under the mouse diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index d618387a17ef3c4c45de7cc0ba967abb63284066..93c67551b61a86518622fb991a73bf28ed85c865 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -81,16 +81,15 @@ end function _M:run() self.flash = LogFlasher.new(0, 0, self.w, 20, nil, nil, nil, {255,255,255}, {0,0,0}) - self.logdisplay = LogDisplay.new(0, self.h * 0.8, self.w * 0.5 - 18, self.h * 0.2, nil, nil, nil, {255,255,255}, "/data/gfx/ui/message-log.png") + self.logdisplay = LogDisplay.new(0, self.h * 0.8 + 7, self.w * 0.5 - 30, self.h * 0.2 - 7, nil, nil, nil, {255,255,255}, "/data/gfx/ui/message-log.png") self.player_display = PlayerDisplay.new(0, 220, 200, self.h * 0.8 - 220, {30,30,0}) - self.hotkeys_display = HotkeysDisplay.new(nil, self.w * 0.5, self.h * 0.8, self.w * 0.5, self.h * 0.2, "/data/gfx/ui/talents-list.png") - self.npcs_display = ActorsSeenDisplay.new(nil, self.w * 0.5, self.h * 0.8, self.w * 0.5, self.h * 0.2, "/data/gfx/ui/talents-list.png") + self.hotkeys_display = HotkeysDisplay.new(nil, self.w * 0.5 + 30, self.h * 0.8 + 7, self.w * 0.5 - 30, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png") + self.npcs_display = ActorsSeenDisplay.new(nil, self.w * 0.5 + 30, self.h * 0.8 + 7, self.w * 0.5 - 30, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png") self.calendar = Calendar.new("/data/calendar_allied.lua", "Today is the %s %s of the %s year of the Age of Ascendancy of Maj'Eyal.\nThe time is %02d:%02d.", 122, 167) self.tooltip = Tooltip.new(nil, nil, {255,255,255}, {30,30,30}) self.flyers = FlyingText.new() self:setFlyingText(self.flyers) self.minimap_bg, self.minimap_bg_w, self.minimap_bg_h = core.display.loadImage("/data/gfx/ui/minimap.png"):glTexture() - self.icons = { display_x = game.w * 0.5 - 14, display_y = game.h * 0.8 + 3, w = 12, h = game.h * 0.2} self.nicer_tiles = NicerTiles.new() self:createSeparators() @@ -280,12 +279,6 @@ function _M:loaded() if self.player and config.settings.cheat then self.player.__cheated = true end end -function _M:createSeparators() - self.bottom_separator, self.bottom_separator_w, self.bottom_separator_h = self:createVisualSeparator("horizontal", self.w) - self.split_separator, self.split_separator_w, self.split_separator_h = self:createVisualSeparator("vertical", math.floor(self.h * 0.2)) - self.player_separator, self.player_separator_w, self.player_separator_h = self:createVisualSeparator("vertical", math.floor(self.h * 0.8) - 20) -end - function _M:setupDisplayMode(reboot) local gfx = config.settings.tome.gfx self:saveSettings("tome.gfx", ('tome.gfx = {tiles=%q, size=%q}\n'):format(gfx.tiles, gfx.size)) @@ -355,7 +348,8 @@ function _M:save() end function _M:getSaveDescription() - local player = self.player:resolveSource() + local player = self.party:findMember{main=true} + return { name = player.name, description = ([[%s the level %d %s %s. @@ -700,7 +694,7 @@ function _M:display(nb_keyframes) ) -- Minimap display - self.minimap_bg:toScreenFull(0, 20, 200, 200, self.minimap_bg_w, self.minimap_bg_h) + self.minimap_bg:toScreen(0, 20, 200, 200) self.level.map:minimapDisplay(0, 20, util.bound(self.player.x - 25, 0, self.level.map.w - 50), util.bound(self.player.y - 25, 0, self.level.map.h - 50), 50, 50, 1) end @@ -715,15 +709,8 @@ function _M:display(nb_keyframes) end if self.player then self.player.changed = false end - -- Separators - self.bottom_separator:toScreenFull(0, 20 - 3, self.w, 6, self.bottom_separator_w, self.bottom_separator_h) - self.bottom_separator:toScreenFull(0, self.h * 0.8 - 3, self.w, 6, self.bottom_separator_w, self.bottom_separator_h) - self.split_separator:toScreenFull(self.w * 0.5 - 3 - 15, self.h * 0.8, 6, self.h * 0.2, self.split_separator_w, self.split_separator_h) - self.split_separator:toScreenFull(self.w * 0.5 - 3, self.h * 0.8, 6, self.h * 0.2, self.split_separator_w, self.split_separator_h) - self.player_separator:toScreenFull(200 - 3, 20, 6, self.h * 0.8 - 20, self.player_separator_w, self.player_separator_h) - - -- Icons - self:displayUIIcons() + -- UI + self:displayUI() engine.GameTurnBased.display(self, nb_keyframes) @@ -1020,10 +1007,10 @@ function _M:setupMouse(reset) self.hotkeys_display:onMouse(button, mx, my, event == "button", function(text) self.tooltip:displayAtMap(nil, nil, self.w, self.h, text) end) end) -- Use icons - self.mouse:registerZone(self.icons.display_x, self.icons.display_y, self.icons.w, self.icons.h, function(button, mx, my, xrel, yrel, bx, by) - self:mouseIcon(bx, by) - if button == "left" then self:clickIcon(bx, by) end - end) +-- self.mouse:registerZone(self.icons.display_x, self.icons.display_y, self.icons.w, self.icons.h, function(button, mx, my, xrel, yrel, bx, by) +-- self:mouseIcon(bx, by) +-- if button == "left" then self:clickIcon(bx, by) end +-- end) -- Tooltip over the player pane self.mouse:registerZone(self.player_display.display_x, self.player_display.display_y, self.player_display.w, self.player_display.h, function(button, mx, my, xrel, yrel, bx, by, event) self.player_display.mouse:delegate(button, mx, my, xrel, yrel, bx, by, event) @@ -1164,29 +1151,21 @@ end --end --- Create a visual separator +--[[ local _sep_left = core.display.loadImage("/data/gfx/ui/separator-left.png") _sep_left:alpha() local _sep_right = core.display.loadImage("/data/gfx/ui/separator-right.png") _sep_right:alpha() -local _sep_horiz = core.display.loadImage("/data/gfx/ui/separator-hori.png") _sep_horiz:alpha() +local _sep_horiz, _sep_horiz_w, _sep_horiz_h = core.display.loadImage("/data/gfx/ui/separator-hori.png") local _sep_top = core.display.loadImage("/data/gfx/ui/separator-top.png") _sep_top:alpha() local _sep_bottom = core.display.loadImage("/data/gfx/ui/separator-bottom.png") _sep_bottom:alpha() -local _sep_vert = core.display.loadImage("/data/gfx/ui/separator-vert.png") _sep_vert:alpha() -function _M:createVisualSeparator(dir, size) - if dir == "horizontal" then - local sep = core.display.newSurface(size, 6) - sep:erase(0, 0, 0) - sep:merge(_sep_left, 0, 0) - for i = 7, size - 7, 9 do sep:merge(_sep_horiz, i, 0) end - sep:merge(_sep_right, size - 6, 0) - return sep:glTexture() - else - local sep = core.display.newSurface(6, size) - sep:erase(0, 0, 0) - sep:merge(_sep_top, 0, 0) - for i = 7, size - 7, 9 do sep:merge(_sep_vert, 0, i) end - sep:merge(_sep_bottom, 0, size - 6) - return sep:glTexture() - end -end +local _sep_vert, _sep_vert_w, _sep_vert_h = core.display.loadImage("/data/gfx/ui/separator-vert.png") _sep_vert:alpha() +]] +local _sep_horiz = {core.display.loadImage("/data/gfx/ui/separator-hori.png")} _sep_horiz.tex = {_sep_horiz[1]:glTexture()} +local _sep_vert = {core.display.loadImage("/data/gfx/ui/separator-vert.png")} _sep_vert.tex = {_sep_vert[1]:glTexture()} +local _sep_top = {core.display.loadImage("/data/gfx/ui/separator-top.png")} _sep_top.tex = {_sep_top[1]:glTexture()} +local _sep_bottom = {core.display.loadImage("/data/gfx/ui/separator-bottom.png")} _sep_bottom.tex = {_sep_bottom[1]:glTexture()} +local _sep_bottoml = {core.display.loadImage("/data/gfx/ui/separator-bottom_line_end.png")} _sep_bottoml.tex = {_sep_bottoml[1]:glTexture()} +local _sep_leftl = {core.display.loadImage("/data/gfx/ui/separator-left_line_end.png")} _sep_leftl.tex = {_sep_leftl[1]:glTexture()} +local _sep_rightl = {core.display.loadImage("/data/gfx/ui/separator-right_line_end.png")} _sep_rightl.tex = {_sep_rightl[1]:glTexture()} local _talents_icon, _talents_icon_w, _talents_icon_h = core.display.loadImage("/data/gfx/ui/talents-icon.png"):glTexture() local _actors_icon, _actors_icon_w, _actors_icon_h = core.display.loadImage("/data/gfx/ui/actors-icon.png"):glTexture() @@ -1194,13 +1173,57 @@ local _main_menu_icon, _main_menu_icon_w, _main_menu_icon_h = core.display.loadI local _inventory_icon, _inventory_icon_w, _inventory_icon_h = core.display.loadImage("/data/gfx/ui/inventory-icon.png"):glTexture() local _charsheet_icon, _charsheet_icon_w, _charsheet_icon_h = core.display.loadImage("/data/gfx/ui/charsheet-icon.png"):glTexture() -function _M:displayUIIcons() - local x, y = self.icons.display_x, self.icons.display_y - _talents_icon:toScreenFull(x, y, 12, 12, _talents_icon_w, _talents_icon_h) y = y + 12 - _actors_icon:toScreenFull(x, y, 12, 12, _actors_icon_w, _actors_icon_h) y = y + 12 - _inventory_icon:toScreenFull(x, y, 12, 12, _inventory_icon_w, _inventory_icon_h) y = y + 12 - _charsheet_icon:toScreenFull(x, y, 12, 12, _charsheet_icon_w, _charsheet_icon_h) y = y + 12 - _main_menu_icon:toScreenFull(x, y, 12, 12, _main_menu_icon_w, _main_menu_icon_h) y = y + 12 +function _M:displayUI() + local middle = self.w * 0.5 + local bottom = self.h * 0.8 + local bottom_h = self.h * 0.2 + local icon_x = middle - (_talents_icon_w) / 2 + local icon_x2 = middle + (_talents_icon_w) / 2 + local mid_min = icon_x - (_sep_vert[2]) + local mid_max = icon_x2 + + -- Icons + local x, y = icon_x, bottom + _sep_horiz[3] / 2 + _talents_icon:toScreenFull(x, y, _talents_icon_w, _talents_icon_h, _talents_icon_w, _talents_icon_h) y = y + _talents_icon_h + _actors_icon:toScreenFull(x, y, _actors_icon_w, _actors_icon_h, _actors_icon_w, _actors_icon_h) y = y + _actors_icon_h + _inventory_icon:toScreenFull(x, y, _inventory_icon_w, _inventory_icon_h, _inventory_icon_w, _inventory_icon_h) y = y + _inventory_icon_h + _charsheet_icon:toScreenFull(x, y, _charsheet_icon_w, _charsheet_icon_h, _charsheet_icon_w, _charsheet_icon_h) y = y + _charsheet_icon_h + _main_menu_icon:toScreenFull(x, y, _main_menu_icon_w, _main_menu_icon_h, _main_menu_icon_w, _main_menu_icon_h) y = y + _main_menu_icon_h + + -- Separators + _sep_horiz.tex[1]:toScreenFull(0, 20, self.w, _sep_horiz[3], _sep_horiz.tex[2], _sep_horiz.tex[3]) + _sep_horiz.tex[1]:toScreenFull(0, bottom - _sep_horiz[3] / 2, self.w, _sep_horiz[3], _sep_horiz.tex[2], _sep_horiz.tex[3]) + + _sep_vert.tex[1]:toScreenFull(mid_min, bottom, _sep_vert[2], bottom_h, _sep_vert.tex[2], _sep_vert.tex[3]) + _sep_vert.tex[1]:toScreenFull(mid_max, bottom, _sep_vert[2], bottom_h, _sep_vert.tex[2], _sep_vert.tex[3]) + + _sep_vert.tex[1]:toScreenFull(200, 20, _sep_vert[2], bottom - 20, _sep_vert.tex[2], _sep_vert.tex[3]) + + -- Ornaments + _sep_top.tex[1]:toScreenFull(mid_min - (-_sep_vert[2] + _sep_top[2]) / 2, bottom - 14, _sep_top[2], _sep_top[3], _sep_top.tex[2], _sep_top.tex[3]) + _sep_top.tex[1]:toScreenFull(mid_max - (-_sep_vert[2] + _sep_top[2]) / 2, bottom - 14, _sep_top[2], _sep_top[3], _sep_top.tex[2], _sep_top.tex[3]) + _sep_bottoml.tex[1]:toScreenFull(mid_min - (-_sep_vert[2] + _sep_bottoml[2]) / 2, self.h - _sep_bottoml[3], _sep_bottoml[2], _sep_bottoml[3], _sep_bottoml.tex[2], _sep_bottoml.tex[3]) + _sep_bottoml.tex[1]:toScreenFull(mid_max - (-_sep_vert[2] + _sep_bottoml[2]) / 2, self.h - _sep_bottoml[3], _sep_bottoml[2], _sep_bottoml[3], _sep_bottoml.tex[2], _sep_bottoml.tex[3]) + + _sep_leftl.tex[1]:toScreenFull(0, 20 - _sep_leftl[3] / 2 + 7, _sep_leftl[2], _sep_leftl[3], _sep_leftl.tex[2], _sep_leftl.tex[3]) + _sep_leftl.tex[1]:toScreenFull(0, bottom - _sep_leftl[3] / 2, _sep_leftl[2], _sep_leftl[3], _sep_leftl.tex[2], _sep_leftl.tex[3]) + + _sep_rightl.tex[1]:toScreenFull(self.w - _sep_rightl[2], 20 - _sep_rightl[3] / 2 + 7, _sep_rightl[2], _sep_rightl[3], _sep_rightl.tex[2], _sep_rightl.tex[3]) + _sep_rightl.tex[1]:toScreenFull(self.w - _sep_rightl[2], bottom - _sep_rightl[3] / 2, _sep_rightl[2], _sep_rightl[3], _sep_rightl.tex[2], _sep_rightl.tex[3]) + + _sep_top.tex[1]:toScreenFull(200 - (_sep_top[2] - _sep_vert[2]) / 2, 20 - 7, _sep_top[2], _sep_top[3], _sep_top.tex[2], _sep_top.tex[3]) + _sep_bottom.tex[1]:toScreenFull(200 - (_sep_bottom[2] - _sep_vert[2]) / 2, bottom - 25, _sep_bottom[2], _sep_bottom[3], _sep_bottom.tex[2], _sep_bottom.tex[3]) + +-- self.split_separator:toScreenFull(middle - 3 - 15, bottom, 6, bottom_h, self.split_separator_w, self.split_separator_h) +-- self.split_separator:toScreenFull(middle - 3, bottom, 6, bottom_h, self.split_separator_w, self.split_separator_h) +-- self.player_separator:toScreenFull(200 - 3, 20, 6, bottom - 20, self.player_separator_w, self.player_separator_h) + +end + +function _M:createSeparators() +-- self.bottom_separator, self.bottom_separator_w, self.bottom_separator_h = self:createVisualSeparator("horizontal", self.w) +-- self.split_separator, self.split_separator_w, self.split_separator_h = self:createVisualSeparator("vertical", math.floor(self.h * 0.2)) +-- self.player_separator, self.player_separator_w, self.player_separator_h = self:createVisualSeparator("vertical", math.floor(self.h * 0.8) - 20) end function _M:clickIcon(bx, by) diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 7140a04aa6881640dce50dfa07ae6bc7797214f0..800bd091027a2f598e4882cf044e8678b0430998 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -76,8 +76,8 @@ function _M:init(t, no_default) engine.interface.PlayerHotkeys.init(self, t) mod.class.interface.PlayerLore.init(self, t) - self.descriptor = {} - self.died_times = {} + self.descriptor = self.descriptor or {} + self.died_times = self.died_times or {} end function _M:onBirth(birther) @@ -235,7 +235,7 @@ function _M:updateMainShader() end -- Colorize shader - if self:attr("stealth") then game.fbo_shader:setUniform("colorize", {0.7,0.7,0.7}) + if self:attr("stealth") then game.fbo_shader:setUniform("colorize", {0.9,0.9,0.9}) elseif self:attr("invisible") then game.fbo_shader:setUniform("colorize", {0.4,0.5,0.7}) elseif self:attr("unstoppable") then game.fbo_shader:setUniform("colorize", {1,0.2,0}) elseif self:attr("lightning_speed") then game.fbo_shader:setUniform("colorize", {0.2,0.3,1}) diff --git a/game/modules/tome/class/PlayerDisplay.lua b/game/modules/tome/class/PlayerDisplay.lua index de163b38884224231f0fb46ffe4bd88f72c33e1b..03ace8058a3ae9cd0a2cde8f07a2e95e76723e1d 100644 --- a/game/modules/tome/class/PlayerDisplay.lua +++ b/game/modules/tome/class/PlayerDisplay.lua @@ -45,23 +45,15 @@ function _M:resize(x, y, w, h) self.bars_w = self.w - self.bars_x - 5 self.surface = core.display.newSurface(w, h) self.surface_line = core.display.newSurface(w, self.font_h) - self.surface_portrait = core.display.newSurface(36, 36) + self.surface_portrait = core.display.newSurface(40, 40) self.texture, self.texture_w, self.texture_h = self.surface:glTexture() - self.portrait = core.display.loadImage("/data/gfx/ui/party-portrait.png") - self.portrait_unsel = core.display.loadImage("/data/gfx/ui/party-portrait-unselect.png") - local tex_bg = core.display.loadImage("/data/gfx/ui/player-display.png") - local tex_up = core.display.loadImage("/data/gfx/ui/player-display-top.png") - local bw, bh = tex_bg:getSize() - self.bg_surface = core.display.newSurface(w, h) - local i = 0 - while i < h do - self.bg_surface:merge(tex_bg, 0, i) - i = i + bh - end - self.bg_surface:merge(tex_up, 0, 0) - self.bg = {self.bg_surface:glTexture()} - self.bg.w, self.bg.h = self.bg_surface:getSize() + self.top = {core.display.loadImage("/data/gfx/ui/party_end.png")} self.top.tex = {self.top[1]:glTexture()} + self.party = {core.display.loadImage("/data/gfx/ui/party_top.png")} self.party.tex = {self.party[1]:glTexture()} + self.bg = {core.display.loadImage("/data/gfx/ui/player-display.png")} self.bg.tex = {self.bg[1]:glTexture()} + + self.portrait = {core.display.loadImage("/data/gfx/ui/party-portrait.png"):glTexture()} + self.portrait_unsel = {core.display.loadImage("/data/gfx/ui/party-portrait-unselect.png"):glTexture()} self.items = {} end @@ -112,13 +104,11 @@ end function _M:makePortrait(a, current, x, y) local s = self.surface_portrait local def = game.party.members[a] - s:erase(0, 0, 0, 255) - s:merge(current and self.portrait or self.portrait_unsel, 0, 0) - s:erase(colors.VERY_DARK_RED.r, colors.VERY_DARK_RED.g, colors.VERY_DARK_RED.b, 255, 2, 2, 32, 32) + s:erase(colors.VERY_DARK_RED.r, colors.VERY_DARK_RED.g, colors.VERY_DARK_RED.b, 255, 6, 6, 32, 32) local hl = 32 * math.max(0, a.life) / a.max_life - s:erase(colors.DARK_RED.r, colors.DARK_RED.g, colors.DARK_RED.b, 255, 2, 34-hl, 32, hl) + s:erase(colors.DARK_RED.r, colors.DARK_RED.g, colors.DARK_RED.b, 255, 6, 32+6-hl, 32, hl) - self:mouseTooltip("#GOLD##{bold}#"..a.name.."\n#WHITE##{normal}#Level: "..a.level.."\n"..def.title, 36, 36, x, y, function() + self:mouseTooltip("#GOLD##{bold}#"..a.name.."\n#WHITE##{normal}#Level: "..a.level.."\n"..def.title, 40, 40, x, y, function() if def.control == "full" then game.party:select(a) end @@ -127,14 +117,23 @@ function _M:makePortrait(a, current, x, y) local item = { s:glTexture() } item.x = x item.y = y - item.w = 36 - item.h = 36 + item.w = 40 + item.h = 40 self.items[#self.items+1] = item local item = function(dx, dy) a:toScreen(nil, dx+x+2, dy+y+2, 32, 32) end self.items[#self.items+1] = item + + local p = current and self.portrait or self.portrait_unsel + + local item = { p[1], p[2], p[3], } + item.x = x + item.y = y + item.w = 40 + item.h = 40 + self.items[#self.items+1] = item end -- Displays the stats @@ -151,24 +150,41 @@ function _M:display() -- Party members if #game.party.m_list >= 2 and game.level then - local w = 0 + self.items[#self.items+1] = {unpack(self.party.tex)} + self.items[#self.items].w = self.party[2] + self.items[#self.items].h = self.party[3] + self.items[#self.items].x = 0 + self.items[#self.items].y = h + h = h + self.party[3] + 3 + + local nb = math.floor(self.w / 42) + local off = (self.w - nb * 42) /2 + + local w = (1 + nb > #game.party.m_list) and ((self.w - (#game.party.m_list - 0.5) * 42) / 2) or off + h = h + 42 for i = 1, #game.party.m_list do local a = game.party.m_list[i] - if a ~= player then - self:makePortrait(a, false, w, h) - w = w + 36 - if w + 36 > self.w then w = 0 h = h + 36 end + self:makePortrait(a, a == player, w, h - 42) + w = w + 42 + if w + 42 > self.w and i < #game.party.m_list then + w = (i + nb > #game.party.m_list) and ((self.w - (#game.party.m_list - i - 0.5) * 42) / 2) or off + h = h + 42 end end - h = h + 36 + h = h + 2 end + self.items[#self.items+1] = {unpack(self.top.tex)} + self.items[#self.items].w = self.top[2] + self.items[#self.items].h = self.top[3] + self.items[#self.items].x = 0 + self.items[#self.items].y = h + h = h + self.top[3] + 5 + -- Player - self:makePortrait(player, true, 0, h) self.font:setStyle("bold") - self:makeTexture(("%s#{normal}#"):format(player.name), 38, h + (36 - self.font_h) / 2, colors.GOLD.r, colors.GOLD.g, colors.GOLD.b, self.w - 40) h = h + self.font_h + self:makeTexture(("%s#{normal}#"):format(player.name), 0, h, colors.GOLD.r, colors.GOLD.g, colors.GOLD.b, self.w) h = h + self.font_h self.font:setStyle("normal") - h = h + 36 self:mouseTooltip(self.TOOLTIP_LEVEL, self:makeTexture("Level: #00ff00#"..player.level, x, h, 255, 255, 255)) h = h + self.font_h self:mouseTooltip(self.TOOLTIP_LEVEL, self:makeTexture(("Exp: #00ff00#%2d%%"):format(100 * cur_exp / max_exp), x, h, 255, 255, 255)) h = h + self.font_h @@ -334,7 +350,7 @@ end function _M:toScreen() self:display() - self.bg[1]:toScreenFull(self.display_x, self.display_y, self.bg.w, self.bg.h, self.bg[2], self.bg[3]) + self.bg.tex[1]:toScreenFull(self.display_x, self.display_y, self.w, self.h, self.bg.tex[2], self.bg[3] / self.bg.tex[3]) for i = 1, #self.items do local item = self.items[i] if type(item) == "table" then diff --git a/game/modules/tome/data/gfx/ui/actors-icon.png b/game/modules/tome/data/gfx/ui/actors-icon.png index 859dfe625aa6f9763be5e5c880bfa6ffa03920ac..b2865f18c2fcb2baa2f075b7d4fa01a29b95f17a 100644 Binary files a/game/modules/tome/data/gfx/ui/actors-icon.png and b/game/modules/tome/data/gfx/ui/actors-icon.png differ diff --git a/game/modules/tome/data/gfx/ui/charsheet-icon.png b/game/modules/tome/data/gfx/ui/charsheet-icon.png index ee67dcc2d3ed0d103d91f8d6d694b12cad8f5cb8..2d10a1dae40d49ca5463f6f9ecdbfd026ba99c03 100644 Binary files a/game/modules/tome/data/gfx/ui/charsheet-icon.png and b/game/modules/tome/data/gfx/ui/charsheet-icon.png differ diff --git a/game/modules/tome/data/gfx/ui/group_bg.png b/game/modules/tome/data/gfx/ui/group_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..b94d8765b49c22993ecf9f2f2740e174b9f50846 Binary files /dev/null and b/game/modules/tome/data/gfx/ui/group_bg.png differ diff --git a/game/modules/tome/data/gfx/ui/inventory-icon.png b/game/modules/tome/data/gfx/ui/inventory-icon.png index afe9bfd7938f8843252604ef4d08fd8748568327..fd13a0b7dfb1668646be5aac038ea27ec254977e 100644 Binary files a/game/modules/tome/data/gfx/ui/inventory-icon.png and b/game/modules/tome/data/gfx/ui/inventory-icon.png differ diff --git a/game/modules/tome/data/gfx/ui/main-menu-icon.png b/game/modules/tome/data/gfx/ui/main-menu-icon.png index 6550df409e7e8663cbb53fad0df0b51384ad3bf8..f0b7cb6c095049160565f6387d9734f967a6ad88 100644 Binary files a/game/modules/tome/data/gfx/ui/main-menu-icon.png and b/game/modules/tome/data/gfx/ui/main-menu-icon.png differ diff --git a/game/modules/tome/data/gfx/ui/message-log.png b/game/modules/tome/data/gfx/ui/message-log.png index 11019a0f68ce405a17c94d7c541389682b49dc31..8aa93708a2632db61bd7690b4a79d67b8bf9fff7 100644 Binary files a/game/modules/tome/data/gfx/ui/message-log.png and b/game/modules/tome/data/gfx/ui/message-log.png differ diff --git a/game/modules/tome/data/gfx/ui/minimap.png b/game/modules/tome/data/gfx/ui/minimap.png index 8c381a87c6da31f7d4d81a837746d68731747e57..555ae99badef3cff5d947e8513e2517b749c15f1 100644 Binary files a/game/modules/tome/data/gfx/ui/minimap.png and b/game/modules/tome/data/gfx/ui/minimap.png differ diff --git a/game/modules/tome/data/gfx/ui/party-portrait-unselect.png b/game/modules/tome/data/gfx/ui/party-portrait-unselect.png index 65d77981be81a7644bf183b8c230449fa411143b..ca480c020df17a48d2263044949493b418439acf 100644 Binary files a/game/modules/tome/data/gfx/ui/party-portrait-unselect.png and b/game/modules/tome/data/gfx/ui/party-portrait-unselect.png differ diff --git a/game/modules/tome/data/gfx/ui/party-portrait.png b/game/modules/tome/data/gfx/ui/party-portrait.png index c34d903f5383059b3c6fc910de138e4c33dcce5e..620841b4fd054e39bae6f843f48cb9ba77a885a2 100644 Binary files a/game/modules/tome/data/gfx/ui/party-portrait.png and b/game/modules/tome/data/gfx/ui/party-portrait.png differ diff --git a/game/modules/tome/data/gfx/ui/party_end.png b/game/modules/tome/data/gfx/ui/party_end.png new file mode 100644 index 0000000000000000000000000000000000000000..055ec25d1473f6f1c7accfe6786900bc3554730b Binary files /dev/null and b/game/modules/tome/data/gfx/ui/party_end.png differ diff --git a/game/modules/tome/data/gfx/ui/party_top.png b/game/modules/tome/data/gfx/ui/party_top.png new file mode 100644 index 0000000000000000000000000000000000000000..8f86be211b7ae8eafe02f1065a6373413407b40d Binary files /dev/null and b/game/modules/tome/data/gfx/ui/party_top.png differ diff --git a/game/modules/tome/data/gfx/ui/player-display.png b/game/modules/tome/data/gfx/ui/player-display.png index cc3501f9472be22023254b4652bfad23ac7f1f28..6b6030df6495af79a19c305011ac4ef53d440d88 100644 Binary files a/game/modules/tome/data/gfx/ui/player-display.png and b/game/modules/tome/data/gfx/ui/player-display.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-bottom.png b/game/modules/tome/data/gfx/ui/separator-bottom.png index ede41748130336efa1255d47ecd3f91b05528ccd..64bf2e6849c2360c81a8c03d8eb3f2c26d7e7ca8 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-bottom.png and b/game/modules/tome/data/gfx/ui/separator-bottom.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-bottom_line_end.png b/game/modules/tome/data/gfx/ui/separator-bottom_line_end.png new file mode 100644 index 0000000000000000000000000000000000000000..fea6f8760cebab7bd86f4ae84ad076c75ad8ece8 Binary files /dev/null and b/game/modules/tome/data/gfx/ui/separator-bottom_line_end.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-hori.png b/game/modules/tome/data/gfx/ui/separator-hori.png index 9597ea34cdb80fd0e6796a358d0fefa93eb0969a..038797dd388c27e464e7fd42007076bfc43f29f2 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-hori.png and b/game/modules/tome/data/gfx/ui/separator-hori.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-left.png b/game/modules/tome/data/gfx/ui/separator-left.png index 1e3b29052788153a0944afd9fa6857d513a00a6b..05ff9dd246e1988d277304b9c062ee1d73838b84 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-left.png and b/game/modules/tome/data/gfx/ui/separator-left.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-left_line_end.png b/game/modules/tome/data/gfx/ui/separator-left_line_end.png new file mode 100644 index 0000000000000000000000000000000000000000..882a188c62c046fa2895772e591eac35656b6695 Binary files /dev/null and b/game/modules/tome/data/gfx/ui/separator-left_line_end.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-right.png b/game/modules/tome/data/gfx/ui/separator-right.png index b87bda9c19d604e6ba7b39a2fc30f3ab1a4d71c6..2a364a71fb5771f438cc0d6d1170a362db481055 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-right.png and b/game/modules/tome/data/gfx/ui/separator-right.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-right_line_end.png b/game/modules/tome/data/gfx/ui/separator-right_line_end.png new file mode 100644 index 0000000000000000000000000000000000000000..38a113c86f1bc6be5e596d28442772e16022e896 Binary files /dev/null and b/game/modules/tome/data/gfx/ui/separator-right_line_end.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-top.png b/game/modules/tome/data/gfx/ui/separator-top.png index 649985a976aafabb0d42bd2b2dd6580915892bde..c838ade88db4819be68fa0647cea4bd3e51b0cdd 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-top.png and b/game/modules/tome/data/gfx/ui/separator-top.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-top_line_end.png b/game/modules/tome/data/gfx/ui/separator-top_line_end.png new file mode 100644 index 0000000000000000000000000000000000000000..f0eabb7929928feca82defcdb6d82419ec48d434 Binary files /dev/null and b/game/modules/tome/data/gfx/ui/separator-top_line_end.png differ diff --git a/game/modules/tome/data/gfx/ui/separator-vert.png b/game/modules/tome/data/gfx/ui/separator-vert.png index 380eb43cb20f5734efe316a23eb18f5d031c6a91..7efaae7e2823126a906efcfdf424f21ca6ed8c49 100644 Binary files a/game/modules/tome/data/gfx/ui/separator-vert.png and b/game/modules/tome/data/gfx/ui/separator-vert.png differ diff --git a/game/modules/tome/data/gfx/ui/talents-icon.png b/game/modules/tome/data/gfx/ui/talents-icon.png index fe9f69ec9f3bde0af031f046600b27e4aebc79b7..531793b49250750dde1a952a69d7f8425affe98f 100644 Binary files a/game/modules/tome/data/gfx/ui/talents-icon.png and b/game/modules/tome/data/gfx/ui/talents-icon.png differ diff --git a/game/modules/tome/data/gfx/ui/talents-list.png b/game/modules/tome/data/gfx/ui/talents-list.png index 3a1cce3a59dd8d23b87296791ad214c017d49f21..3a4a0e4e7083ac34b9aed67703b12f9f2b15cddc 100644 Binary files a/game/modules/tome/data/gfx/ui/talents-list.png and b/game/modules/tome/data/gfx/ui/talents-list.png differ diff --git a/src/core_lua.c b/src/core_lua.c index cafc563d91e3b98851de7ab8cdfe36f5ae1bca04..748bf225c34b6d23f0f048e8f9be2738b59c0f24 100644 --- a/src/core_lua.c +++ b/src/core_lua.c @@ -555,7 +555,10 @@ static int sdl_load_image(lua_State *L) *s = IMG_Load_RW(PHYSFSRWOPS_openRead(name), TRUE); if (!*s) return 0; - return 1; + lua_pushnumber(L, (*s)->w); + lua_pushnumber(L, (*s)->h); + + return 3; } static int sdl_free_surface(lua_State *L) diff --git a/src/map.c b/src/map.c index 0db75ae1035bf7fe2db3016b33b0815db07f6af2..f340436b0897c2837f39b88dad559f4fa323934b 100644 --- a/src/map.c +++ b/src/map.c @@ -436,6 +436,7 @@ static int map_new(lua_State *L) map->zdepth = zdepth; map->tile_w = tile_w; map->tile_h = tile_h; + map->move_max = 0; // Make up the map objects list, thus we can iterate them later lua_newtable(L);