Skip to content

Commit

Permalink
FIX: explore utility sprites while replacing deprecated ones. No succ…
Browse files Browse the repository at this point in the history
…ess yet with custom scaling
  • Loading branch information
LevFendi committed Nov 16, 2024
1 parent 9facb9e commit 0475da3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@ function on_tick(event)
end
elseif event.tick % 30 == 7 then
--Update menu visuals
--fa_graphics.update_menu_visuals()
fa_graphics.update_menu_visuals()
elseif event.tick % 30 == 8 then
--Play a sound for any player who is mining
for pindex, player in pairs(players) do
Expand Down
15 changes: 8 additions & 7 deletions scripts/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ local mod = {}
--Shows a GUI to demonstrate different sprites from the game files.
function mod.show_sprite_demo(pindex)
--Set these 5 sprites to sprites that you want to demo
local sprite1 = "item-group.intermediate-products"
local sprite2 = "item-group.effects"
local sprite3 = "item-group.environment"
local sprite4 = "item-group.other"
local sprite5 = "item.iron-gear-wheel"
local sprite1 = "utility.add"
local sprite2 = "utility.cable_editor_icon"
local sprite3 = "utility.center"
local sprite4 = "utility.change_recipe"
local sprite5 = "utility.bookmark"
--Let the gunction do the rest. Clear it with CTRL + ALT + R
local player = players[pindex]
local p = game.get_player(pindex)
Expand Down Expand Up @@ -57,6 +57,7 @@ function mod.update_menu_visuals()
elseif player.menu == "inventory" then
mod.update_overhead_sprite("item.wooden-chest", 2, 1.25, pindex)
mod.update_custom_GUI_sprite("item.wooden-chest", 3, pindex)
mod.show_sprite_demo(pindex) --todo delete this
if players[pindex].vanilla_mode then mod.update_custom_GUI_sprite(nil, 1, pindex) end
elseif player.menu == "crafting" then
mod.update_overhead_sprite("item.repair-pack", 2, 1.25, pindex)
Expand All @@ -71,8 +72,8 @@ function mod.update_menu_visuals()
mod.update_overhead_sprite("item.pistol", 2, 1.25, pindex)
mod.update_custom_GUI_sprite("item.pistol", 1, pindex)
elseif player.menu == "travel" then
mod.update_overhead_sprite("utility.downloading_white", 4, 1.25, pindex)
mod.update_custom_GUI_sprite("utility.downloading_white", 3, pindex)
mod.update_overhead_sprite("utility.bookmark", 3, 1.25, pindex)
mod.update_custom_GUI_sprite("utility.bookmark", 3, pindex)
elseif player.menu == "warnings" then
mod.update_overhead_sprite("utility.warning_white", 4, 1.25, pindex)
mod.update_custom_GUI_sprite("utility.warning_white", 3, pindex)
Expand Down

0 comments on commit 0475da3

Please sign in to comment.