Compare commits

...

8 Commits
1.3.2 ... 1.3.3

3 changed files with 38 additions and 23 deletions

View File

@ -31,7 +31,7 @@ To enable it: `i3_progressive_mode = true` in `minetest.conf`.*
#### Recommendations #### Recommendations
To use this mod in the best conditions, it's recommended to follow these recommendations: To use this mod in the best conditions:
- Use LuaJIT - Use LuaJIT
- Use a HiDPI widescreen display - Use a HiDPI widescreen display

View File

@ -44,7 +44,7 @@ local to_compress = {
["default:mese_post_light"] = { ["default:mese_post_light"] = {
replace = "mese_post_light", replace = "mese_post_light",
by = { by = {
"mese_post_light_acacia", "mese_post_light_acacia_wood",
"mese_post_light_aspen_wood", "mese_post_light_aspen_wood",
"mese_post_light_junglewood", "mese_post_light_junglewood",
"mese_post_light_pine_wood", "mese_post_light_pine_wood",

View File

@ -1550,7 +1550,7 @@ local function get_model_fs(fs, data, def, model_alias)
_name = fmt("%s^[multiply:%s", v.name, v.color) _name = fmt("%s^[multiply:%s", v.name, v.color)
end end
elseif v.animation then elseif v.animation then
_name = fmt("%s^[verticalframe:%u:0", v.name, v.animation.aspect_h) _name = fmt("%s^[verticalframe:%u:0", v.name, v.animation.frames_h or v.animation.aspect_h)
end end
t[#t + 1] = _name or v.name or v t[#t + 1] = _name or v.name or v
@ -1706,7 +1706,7 @@ local function get_items_fs(fs, data, full_height)
data.items = new data.items = new
end end
local items = data.alt_items or data.items local items = data.alt_items or data.items or {}
local rows, lines = 8, 12 local rows, lines = 8, 12
local ipp = rows * lines local ipp = rows * lines
local size = 0.85 local size = 0.85
@ -2416,6 +2416,14 @@ local function rcp_fields(player, data, fields)
elseif fields.craft_rcp or fields.craft_usg then elseif fields.craft_rcp or fields.craft_usg then
craft_stack(player, data, fields.craft_rcp) craft_stack(player, data, fields.craft_rcp)
if fields.craft_rcp then
data.export_rcp = nil
data.scrbar_rcp = 1
else
data.export_usg = nil
data.scrbar_usg = 1
end
else else
select_item(player, name, data, fields) select_item(player, name, data, fields)
end end
@ -2745,8 +2753,6 @@ if rawget(_G, "awards") then
local player = core.get_player_by_name(name) local player = core.get_player_by_name(name)
set_fs(player) set_fs(player)
end) end)
core.register_on_dieplayer(set_fs)
end end
core.register_on_chatcommand(function(name) core.register_on_chatcommand(function(name)
@ -3022,11 +3028,13 @@ core.register_on_dieplayer(function(player)
local data = pdata[name] local data = pdata[name]
if not data then return end if not data then return end
if data.bag_size then
data.bag_size = nil data.bag_size = nil
data.bag:set_list("main", {}) data.bag:set_list("main", {})
local inv = player:get_inventory() local inv = player:get_inventory()
inv:set_size("main", INV_SIZE) inv:set_size("main", INV_SIZE)
end
set_fs(player) set_fs(player)
end) end)
@ -3046,7 +3054,7 @@ local function save_data(player_name)
if not META_SAVES[dat] then if not META_SAVES[dat] then
_pdata[name][dat] = nil _pdata[name][dat] = nil
if player_name then if player_name and pdata[player_name] then
pdata[player_name][dat] = nil -- To free up some memory pdata[player_name][dat] = nil -- To free up some memory
end end
end end
@ -3229,6 +3237,7 @@ if progressive_mode then
number = 0xffffff, number = 0xffffff,
text = "", text = "",
z_index = 0xDEAD, z_index = 0xDEAD,
style = 1,
}, },
} }
end end
@ -3256,7 +3265,8 @@ if progressive_mode then
end end
player:hud_change(data.hud.text, "text", player:hud_change(data.hud.text, "text",
S("@1 new recipe(s) discovered!", data.discovered)) fmt("%u new recipe%s discovered!",
data.discovered, data.discovered > 1 and "s" or ""))
elseif data.show_hud == false then elseif data.show_hud == false then
if data.hud_timer >= HUD_TIMER_MAX then if data.hud_timer >= HUD_TIMER_MAX then
@ -3314,19 +3324,17 @@ if progressive_mode then
poll_new_items() poll_new_items()
if singleplayer then
core.register_globalstep(function() core.register_globalstep(function()
local players = core.get_connected_players() local name = "singleplayer"
local player = core.get_player_by_name(name)
for i = 1, #players do
local player = players[i]
local name = player:get_player_name()
local data = pdata[name] local data = pdata[name]
if data and data.show_hud ~= nil and singleplayer then if data and data.show_hud ~= nil then
show_hud_success(player, data) show_hud_success(player, data)
end end
end
end) end)
end
i3.add_recipe_filter("Default progressive filter", progressive_filter) i3.add_recipe_filter("Default progressive filter", progressive_filter)
@ -3338,12 +3346,19 @@ if progressive_mode then
data.inv_items = data.inv_items or {} data.inv_items = data.inv_items or {}
data.known_recipes = data.known_recipes or 0 data.known_recipes = data.known_recipes or 0
local oldknown = data.known_recipes
local items = get_filtered_items(player, data) local items = get_filtered_items(player, data)
data.discovered = data.known_recipes - oldknown
data.items_raw = items data.items_raw = items
search(data) search(data)
if singleplayer then if singleplayer then
init_hud(player, data) init_hud(player, data)
if data.show_hud == nil and data.discovered > 0 then
data.show_hud = true
end
end end
end) end)
end end