Skip to content

Commit

Permalink
More space for achievements text, 3 per row
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius7309 committed Aug 5, 2024
1 parent 1616a20 commit fb6722d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--- MODULE CORE

SMODS = {}
MODDED_VERSION = "1.0.0-ALPHA-0805f-STEAMODDED"
MODDED_VERSION = "1.0.0-ALPHA-0805g-STEAMODDED"

-- Include lovely and nativefs modules
local nativefs = require "nativefs"
Expand Down
18 changes: 9 additions & 9 deletions core/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function buildAchievementsTab(mod, current_page)
current_page = current_page or 1
fetch_achievements()
local achievement_matrix = {{},{}}
local achievements_per_row = 4
local achievements_per_row = 3
local achievements_pool = {}
for k, v in pairs(G.ACHIEVEMENTS) do
if v.mod and v.mod.id == mod.id then achievements_pool[#achievements_pool+1] = v end
Expand All @@ -516,7 +516,7 @@ function buildAchievementsTab(mod, current_page)
for i = 1, achievements_per_row*2 do
local v = achievement_tab[i+((achievements_per_row*2)*(current_page-1))]
if not v then break end
local temp_achievement = Sprite(0,0,1.25,1.25,G.ASSET_ATLAS[v.atlas or "achievements"], v.earned and v.pos or {x=0, y=0})
local temp_achievement = Sprite(0,0,1.1,1.1,G.ASSET_ATLAS[v.atlas or "achievements"], v.earned and v.pos or {x=0, y=0})
temp_achievement:define_draw_steps({
{shader = 'dissolve', shadow_height = 0.05},
{shader = 'dissolve'}
Expand Down Expand Up @@ -556,7 +556,7 @@ function buildAchievementsTab(mod, current_page)

-- Description
local achievement_text = {}
local maxCharsPerLine = 25
local maxCharsPerLine = 30
local function wrapText(text, maxChars)
local wrappedText = {""}
local curr_line = 1
Expand Down Expand Up @@ -590,8 +590,8 @@ function buildAchievementsTab(mod, current_page)
end
max_lines = math.max(max_lines, #ability_text)
achievement_text[#achievement_text + 1] =
{n=G.UIT.R, config={align = "cm", emboss = 0.05, r = 0.1, minw = 3.5, maxw = 3.5, padding = 0.05, colour = G.C.WHITE, minh = 0.4*max_lines+0.1}, nodes={
ability_text[1] and {n=G.UIT.R, config={align = "cm", padding = 0.08, colour = G.C.GREY, r = 0.1, emboss = 0.05, minw = 3.4, maxw = 3.4, minh = 0.4*max_lines}, nodes=ability_text} or nil
{n=G.UIT.R, config={align = "cm", emboss = 0.05, r = 0.1, minw = 4, maxw = 4, padding = 0.05, colour = G.C.WHITE, minh = 0.4*max_lines+0.1}, nodes={
ability_text[1] and {n=G.UIT.R, config={align = "cm", padding = 0.08, colour = G.C.GREY, r = 0.1, emboss = 0.05, minw = 3.9, maxw = 3.9, minh = 0.4*max_lines}, nodes=ability_text} or nil
}}

table.insert(achievement_matrix[row], {
Expand All @@ -601,9 +601,9 @@ function buildAchievementsTab(mod, current_page)
{n=G.UIT.R, config = {align = "cm"}, nodes = {
{n=G.UIT.R, config = {align = "cm", padding = 0.1}, nodes = {{ n = G.UIT.O, config = { object = temp_achievement, focus_with_object = true }}}},
{
n=G.UIT.R, config = {align = "cm", minw = 3.5, maxw = 3.5, padding = 0.05}, nodes = {
n=G.UIT.R, config = {align = "cm", minw = 4, maxw = 4, padding = 0.05}, nodes = {
{n=G.UIT.R, config={align = "cm", emboss = 0.05, r = 0.1, padding = 0.1, minh = 0.6, colour = G.C.GREY}, nodes={
{n=G.UIT.O, config={align = "cm", maxw = 3.3, object = DynaText({string = loc_name, maxw = 3.3, colours = {G.C.UI.TEXT_LIGHT}, shadow = true, spacing = 1, bump = true, scale = 0.4})}},
{n=G.UIT.O, config={align = "cm", maxw = 3.8, object = DynaText({string = loc_name, maxw = 3.8, colours = {G.C.UI.TEXT_LIGHT}, shadow = true, spacing = 1, bump = true, scale = 0.4})}},
}},
{n=G.UIT.R, config={align = "cm"}, nodes=achievement_text},
},
Expand All @@ -627,8 +627,8 @@ function buildAchievementsTab(mod, current_page)
{n=G.UIT.C, config={}, nodes={
{n=G.UIT.C, config={align = "cm"}, nodes={
{n=G.UIT.R, config={align = "cm"}, nodes={
{n=G.UIT.R, config={align = "cm"}, nodes=achievement_matrix[1]},
{n=G.UIT.R, config={align = "cm"}, nodes=achievement_matrix[2]},
{n=G.UIT.R, config={align = "cm", padding = 0.1 }, nodes=achievement_matrix[1]},
{n=G.UIT.R, config={align = "cm", padding = 0.1 }, nodes=achievement_matrix[2]},
create_option_cycle({options = achievements_options, w = 4.5, cycle_shoulders = true, opt_callback = 'achievments_tab_page', focus_args = {snap_to = true, nav = 'wide'},current_option = current_page, colour = G.C.RED, no_pips = true})
}}
}}
Expand Down

0 comments on commit fb6722d

Please sign in to comment.