Cursed Programable Filters deprecated

by L0771

Control+R to config fluid filters via GUI.

Utilities
5 years ago
0.16
7

b gui off screen

5 years ago

with angels, omni and a few other mods installed, this gui fills the screen and can't be clicked off. suggest utilizing a scrollbar with a set gui dimensions. so it doesn't extend too far depending on how many fluids a mod adds. (with all of omni mods + angels, it becomes a lot).

5 years ago

fixed by changing the columns from 7 to 15 for the bit that displays the fluids.

5 years ago

How much fluids?
I can set 7 if count of fluids < of 28 fluids and (math.ceil(fluids / 4)) if > of 28...
This show max 4 rows.

5 years ago
(updated 5 years ago)
5 years ago
(updated 5 years ago)

base game has 8 fluids: water, oil, heavy oil, petroleum, light oil, lubricant, steam, sulfuric acid.
add mods to that and it can go well over 240. not sure if lua has a square root function, but i'd use a variation on that... like take the square root of how many fluids there are, then add 1 and set the columns to that value. or you can do something like :
if count of fluids < nNumber then set number of columns to 7. else if number of fluids is greater than nNumber, take the squareRoot and add one to it and have that be set as the number of columns.
edit: technically, you can add 1 or subtract 1 and floor the result to get a less-square GUI. if however, you're dead set on there being a specific number of columns, check out how a few other mods have set up pages or scrolling in their guis.

New response