From 045ca00486e62c89a4da5f880f6f52016e4dd14a Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Mon, 25 Jul 2022 22:01:01 +0900 Subject: fix: stop using internal asset classes everywhere (#69) * fix: stop using internal asset classes everywhere new: add wrapper classes for NanoVG rendering and rename original Image wrapper to OneImage * I love regex Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> --- .../oneconfig/utils/dsl/RenderManagerDSL.kt | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main/kotlin/cc') diff --git a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt index 21c33f0..2665c7f 100644 --- a/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt +++ b/src/main/kotlin/cc/polyfrost/oneconfig/utils/dsl/RenderManagerDSL.kt @@ -3,8 +3,8 @@ package cc.polyfrost.oneconfig.utils.dsl import cc.polyfrost.oneconfig.config.data.InfoType import cc.polyfrost.oneconfig.renderer.RenderManager import cc.polyfrost.oneconfig.renderer.font.Font -import cc.polyfrost.oneconfig.internal.assets.Images -import cc.polyfrost.oneconfig.internal.assets.SVGs +import cc.polyfrost.oneconfig.renderer.Image +import cc.polyfrost.oneconfig.renderer.SVG import cc.polyfrost.oneconfig.utils.color.ColorUtils import org.lwjgl.nanovg.NVGColor @@ -161,16 +161,16 @@ fun Long.drawImage(filePath: String, x: Number, y: Number, width: Number, height fun VG.drawImage(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int) = instance.drawImage(filePath, x, y, width, height, color) -fun Long.drawImage(image: Images, x: Number, y: Number, width: Number, height: Number) = +fun Long.drawImage(image: Image, x: Number, y: Number, width: Number, height: Number) = RenderManager.drawImage(this, image, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat()) -fun VG.drawImage(image: Images, x: Number, y: Number, width: Number, height: Number) = +fun VG.drawImage(image: Image, x: Number, y: Number, width: Number, height: Number) = instance.drawImage(image, x, y, width, height) -fun Long.drawImage(image: Images, x: Number, y: Number, width: Number, height: Number, color: Int) = +fun Long.drawImage(image: Image, x: Number, y: Number, width: Number, height: Number, color: Int) = RenderManager.drawImage(this, image, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color) -fun VG.drawImage(image: Images, x: Number, y: Number, width: Number, height: Number, color: Int) = +fun VG.drawImage(image: Image, x: Number, y: Number, width: Number, height: Number, color: Int) = instance.drawImage(image, x, y, width, height, color) @@ -182,12 +182,12 @@ fun Long.drawRoundedImage(filePath: String, x: Number, y: Number, width: Number, fun VG.drawRoundedImage(filePath: String, x: Number, y: Number, width: Number, height: Number, radius: Number) = instance.drawRoundedImage(filePath, x, y, width, height, radius) -fun Long.drawRoundedImage(image: Images, x: Number, y: Number, width: Number, height: Number, radius: Number) = +fun Long.drawRoundedImage(image: Image, x: Number, y: Number, width: Number, height: Number, radius: Number) = RenderManager.drawRoundImage( this, image, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), radius.toFloat() ) -fun VG.drawRoundedImage(image: Images, x: Number, y: Number, width: Number, height: Number, radius: Number) = +fun VG.drawRoundedImage(image: Image, x: Number, y: Number, width: Number, height: Number, radius: Number) = instance.drawRoundedImage(image, x, y, width, height, radius) @@ -248,16 +248,16 @@ fun Long.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: fun VG.drawSVG(filePath: String, x: Number, y: Number, width: Number, height: Number, color: Int) = instance.drawSVG(filePath, x, y, width, height, color) -fun Long.drawSVG(svg: SVGs, x: Number, y: Number, width: Number, height: Number) = +fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number) = RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat()) -fun VG.drawSVG(svg: SVGs, x: Number, y: Number, width: Number, height: Number) = +fun VG.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number) = instance.drawSVG(svg, x, y, width, height) -fun Long.drawSVG(svg: SVGs, x: Number, y: Number, width: Number, height: Number, color: Int) = +fun Long.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, color: Int) = RenderManager.drawSvg(this, svg, x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat(), color) -fun VG.drawSVG(svg: SVGs, x: Number, y: Number, width: Number, height: Number, color: Int) = +fun VG.drawSVG(svg: SVG, x: Number, y: Number, width: Number, height: Number, color: Int) = instance.drawSVG(svg, x, y, width, height, color) -- cgit