diff --git a/gfx/fonts/stat_font.png b/gfx/fonts/stat_font.png index c4d56c4..9f64b03 100644 Binary files a/gfx/fonts/stat_font.png and b/gfx/fonts/stat_font.png differ diff --git a/gfx/ui/icons/atk.png b/gfx/ui/icons/atk.png new file mode 100644 index 0000000..13969bb Binary files /dev/null and b/gfx/ui/icons/atk.png differ diff --git a/gfx/ui/icons/def.png b/gfx/ui/icons/def.png new file mode 100644 index 0000000..d2ca8ff Binary files /dev/null and b/gfx/ui/icons/def.png differ diff --git a/gfx/ui/icons/reg.png b/gfx/ui/icons/reg.png new file mode 100644 index 0000000..981e28b Binary files /dev/null and b/gfx/ui/icons/reg.png differ diff --git a/gfx/ui/icons/spd.png b/gfx/ui/icons/spd.png new file mode 100644 index 0000000..3941008 Binary files /dev/null and b/gfx/ui/icons/spd.png differ diff --git a/gfx/ui/icons/vit.png b/gfx/ui/icons/vit.png new file mode 100644 index 0000000..3e354b8 Binary files /dev/null and b/gfx/ui/icons/vit.png differ diff --git a/gfx/ui/icons/wis.png b/gfx/ui/icons/wis.png new file mode 100644 index 0000000..741d857 Binary files /dev/null and b/gfx/ui/icons/wis.png differ diff --git a/gfx/ui/item_info/base.png b/gfx/ui/item_info/base.png new file mode 100644 index 0000000..6427925 Binary files /dev/null and b/gfx/ui/item_info/base.png differ diff --git a/gfx/ui/item_info/special_icon.png b/gfx/ui/item_info/special_icon.png new file mode 100644 index 0000000..e5f7f4c Binary files /dev/null and b/gfx/ui/item_info/special_icon.png differ diff --git a/gfx/ui/item_info/tier_color.png b/gfx/ui/item_info/tier_color.png new file mode 100644 index 0000000..11c1b1a Binary files /dev/null and b/gfx/ui/item_info/tier_color.png differ diff --git a/hud.lua b/hud.lua index 5231739..29a5b9f 100644 --- a/hud.lua +++ b/hud.lua @@ -338,9 +338,22 @@ function hud.draw() love.graphics.setShader(_shader) love.graphics.push() love.graphics.translate(x, y) - love.graphics.draw(gfx.ui.itemInfo, 0, 0) - font = fonts.stats + love.graphics.draw(gfx.ui.itemInfo.base, 0, 0) + love.graphics.setColor(200/255, 88/255, 9/255) + love.graphics.draw(gfx.ui.itemInfo.tierColor, 5, 6) + love.graphics.setColor(1, 1, 1) + love.graphics.draw(gfx.items[item.imageId], 7, 8) + love.graphics.draw(gfx.ui.icons.atk, 14, 29) + love.graphics.draw(gfx.ui.icons.wis, 57, 29) + love.graphics.draw(gfx.ui.icons.spd, 14, 51) + love.graphics.draw(gfx.ui.icons.reg, 57, 51) + local font = fonts.stats love.graphics.setFont(font) + love.graphics.setColor(193/255, 193/255, 193/255) + text.print('"TOOLTIP WOULD GO\nHERE"', 26, 9) + love.graphics.setColor(1, 1, 1) + love.graphics.draw(gfx.ui.itemInfo.specialIcon, 9, 74) + text.print('25% CHANCE TO BURN', 16, 74) local playerWeapon = items.client.getItem(p.inventory.items[2]) if isSword[item.imageId] and item.atk then if playerWeapon and playerWeapon.atk then @@ -354,6 +367,10 @@ function hud.draw() else text.print('100', 35, 34) end + love.graphics.setColor(1, 1, 1) + text.print('100', 78, 34) + text.print('100', 35, 56) + text.print('100', 78, 56) love.graphics.pop() end diff --git a/items.lua b/items.lua index 5eec779..803c4aa 100644 --- a/items.lua +++ b/items.lua @@ -9,6 +9,15 @@ items = { } } +local imageId2Type = { + armor0Helmet = 'helmet', armor1Helmet = 'helmet', + armor0Chest = 'chest', armor1Chest = 'chest', + armor0Pants = 'pants', armor1Pants = 'pants' +} +for _, v in ipairs{'sword0', 'sword1', 'sword2', 'sword3', 'sword4'} do + imageId2Type[v] = 'sword' +end + function items.server.newItem(data) if not data.id then data.id = lume.uuid() @@ -17,19 +26,8 @@ function items.server.newItem(data) data.imageId = 'apple' end if not data.type then - data.type = data.imageId - if isSword[data.imageId] then - data.type = 'sword' - end - if data.imageId == 'armor0Helmet' or data.imageId == 'armor1Helmet' then - data.type = 'helmet' - end - if data.imageId == 'armor0Chest' or data.imageId == 'armor1Chest' then - data.type = 'chest' - end - if data.imageId == 'armor0Pants' or data.imageId == 'armor1Pants' then - data.type = 'pants' - end + data.type = imageId2Type[data.imageId] + data.type = data.type or data.imageId end items.server.container[data.id] = data return data.id diff --git a/loadassets.lua b/loadassets.lua index 325cb03..17e942d 100644 --- a/loadassets.lua +++ b/loadassets.lua @@ -21,6 +21,14 @@ gfx = { logo = love.graphics.newImage('gfx/logo.png'), logoAnim = love.graphics.newImage('gfx/logo_anim.png'), ui = { + icons = { + vit = love.graphics.newImage('gfx/ui/icons/vit.png'), + atk = love.graphics.newImage('gfx/ui/icons/atk.png'), + spd = love.graphics.newImage('gfx/ui/icons/spd.png'), + wis = love.graphics.newImage('gfx/ui/icons/wis.png'), + def = love.graphics.newImage('gfx/ui/icons/def.png'), + reg = love.graphics.newImage('gfx/ui/icons/reg.png') + }, buttons = { up = love.graphics.newImage('gfx/ui/buttons/up.png'), down = love.graphics.newImage('gfx/ui/buttons/down.png'), @@ -28,7 +36,11 @@ gfx = { right = love.graphics.newImage('gfx/ui/buttons/right.png') }, bag = love.graphics.newImage('gfx/ui/bagui.png'), - itemInfo = love.graphics.newImage('gfx/ui/item_info.png'), + itemInfo = { + base = love.graphics.newImage('gfx/ui/item_info/base.png'), + tierColor = love.graphics.newImage('gfx/ui/item_info/tier_color.png'), + specialIcon = love.graphics.newImage('gfx/ui/item_info/special_icon.png') + }, quest = love.graphics.newImage('gfx/ui/questui.png') }, hud = { @@ -296,7 +308,7 @@ fonts = { c13 = love.graphics.newImageFont('gfx/fonts/small_font.png', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`\'*#=[]"|~@$^_{}<>'), c17 = love.graphics.newImageFont('gfx/fonts/big_font.png', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`\'*#=[]"|~@$^_{}<>'), - stats = love.graphics.newImageFont('gfx/fonts/stat_font.png', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/') + stats = love.graphics.newImageFont('gfx/fonts/stat_font.png', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/\'"%') } -- todo: test -- love.graphics.newFont([filename, ] size, "mono")