Page 1 of 1
Removing the Green ammo durability bar
Posted: Sun Jul 07, 2024 2:28 am
by PrestonLeeC
I'm changing all the data.raw.item to data.raw.tool so I can use them as science packs.
Any ideas on how to remove the green bar?
Thank you!

Re: Removing the Green ammo durability bar
Posted: Sun Jul 07, 2024 1:35 pm
by PrestonLeeC
Some things I've tried, but I haven't been able to get rid of those green bars even when I am able to delete literally the rest of the user interface:
[*]delete all the pixel data from gui.png and gui-new.png
[*]loop through every table in data.raw["gui-style"]["default"] and do things like color = {a=0}, or horizontally_stretchable = "off".
Nothing affects those green bars...

Re: Removing the Green ammo durability bar
Posted: Sun Jul 07, 2024 2:51 pm
by PrestonLeeC
Next, I tried setting infinite = true, so the bars go away. Obviously, in order for science to work properly, I'd have to use control.lua to deplete the items from labs if the labs are working.
Edit: Got it "working", but now the problem is, it depletes an item every second even if that item hasn't produced a full bar of research progress yet...
Code: Select all
script.on_nth_tick(60, function()
local surface = game.surfaces[1]
local labs = surface.find_entities_filtered{type="lab"}
for _, lab in pairs(labs) do
if lab.status == defines.entity_status.working then
local inventory = lab.get_inventory(defines.inventory.lab_input)
for tool_name, tool_count in pairs(inventory.get_contents()) do
inventory.remove({name=tool_name, count=1})
end
end
end
end)
Re: Removing the Green ammo durability bar
Posted: Sun Jul 07, 2024 8:23 pm
by PrestonLeeC
Alright, I wrote a bunch more code (that I'm quite proud of) and everything seems to work perfectly. Although I imagine there are others who would still love a simple solution to this.