You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val sizeFile =ConfigManager.internal().folder.resolve("hudLock.lock")
121
-
val size =Vec2(if (sizeFile.exists()) sizeFile.readText().toLong() else0L)
122
-
// todo size stuff (upstream in polyui) AHHH
122
+
val sizeFile =ConfigManager.internal().folder.resolve("size.lock")
123
+
val size =Vec2(if (sizeFile.exists()) sizeFile.readText().toLongOrNull() ?:0Lelse0L)
124
+
val prevSize:Vec2
125
+
if (size.isPositive) {
126
+
prevSize = polyUI.size
127
+
polyUI.resize(size.x, size.y)
128
+
} else {
129
+
LOGGER.warn("Failed to read previous size from size.lock: HUD positions may be inaccurate. If this is first start, you may ignore this message.")
130
+
prevSize =Vec2.ZERO
131
+
}
123
132
124
133
// todo use for inspections
125
134
// it.master.onClick { (x, y) ->
126
135
// val obj = polyUI.inputManager.rayCheckUnsafe(this, x, y) ?: return@onClick false
127
136
// return@onClick false
128
137
// }
129
-
val used =HashSet<Class<outHud<outDrawable>>>(hudProviders.size)
138
+
val used =HashSet<Class<Hud<Drawable>>>(hudProviders.size)
139
+
var i =0
130
140
ConfigManager.active().gatherAll("huds").forEach { data ->
131
141
try {
132
142
val clsName = data.getProp("hudClass").get() as?String?:throwIllegalArgumentException("hud tree ${data.id} is missing class name, will be ignored")
133
-
val cls =Class.forName(clsName) as?Class<Hud<outDrawable>> ?:throwIllegalArgumentException("hud class $clsName is not a subclass of org.polyfrost.oneconfig.api.v1.hud.Hud, will be ignored")
143
+
val cls =Class.forName(clsName) as?Class<Hud<Drawable>> ?:throwIllegalArgumentException("hud class $clsName is not a subclass of org.polyfrost.oneconfig.api.v1.hud.Hud, will be ignored")
134
144
// asm: the documentation of Hud states that code should not be run in the constructor
135
145
// so, we are fine to (potentially) malloc the HUD here
136
146
// note that this is stored in a map separate to the loaded hud list.
0 commit comments