EtiamNullam / Etiam-ONI-Modpack

A bunch of mods made for Klei's Oxygen Not Included.
28 stars 10 forks source link

[door icons] draw icons centered, regardless of door size #26

Open dan-oak opened 2 years ago

dan-oak commented 2 years ago

the icon offset is hardcoded https://github.com/EtiamNullam/Etiam-ONI-Modpack/blob/master/src/DoorIcons/IconManager.cs#L46 and so it doesn't draw nicely for tiny (half) doors form other mods. could you please make the mod create icons at positions dynamically determined?

image

EtiamNullam commented 2 years ago

I will certainly fix it when I find some spare time. Thank you for reporting it!

Did you find a way to reliably check building dimensions?

dan-oak commented 2 years ago

yeah, i have found it

var bdef = door.building.Def;
var wid  = bdef.WidthInCells;
var hei  = bdef.HeightInCells;

just divide by 2 and the rest is the same