Skip to content

Commit

Permalink
Renamed invokeSuper to invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
ya-ilya committed Sep 14, 2023
1 parent d7195f7 commit a7bd287
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ operator fun DrawContext.invoke(block: DrawContextWrapper.() -> Unit) {
DrawContextWrapper(this).apply(block)
}

fun <S> DrawContext.invokeSuper(superRef: S, block: DrawContextWrapper.(S) -> Unit) {
fun <S> DrawContext.invoke(superRef: S, block: DrawContextWrapper.(S) -> Unit) {
DrawContextWrapper(this).also { block(it, superRef) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.progreso.client.gui.clickgui.element.AbstractChildElement
import org.progreso.client.gui.clickgui.element.AbstractChildListElement
import org.progreso.client.gui.clickgui.element.ParentElement
import org.progreso.client.gui.clickgui.element.elements.SettingElement.Companion.createSettingElement
import org.progreso.client.gui.invokeSuper
import org.progreso.client.gui.invoke
import java.awt.Color

class GroupElement(
Expand All @@ -24,7 +24,7 @@ class GroupElement(
)

header = object : AbstractChildElement(height, this@GroupElement) {
override fun render(context: DrawContext, mouseX: Int, mouseY: Int) = context.invokeSuper(this) {
override fun render(context: DrawContext, mouseX: Int, mouseY: Int) = context.invoke(this) {
drawTextRelatively(
setting.name,
it.parent.offsets.textOffset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.progreso.client.gui.clickgui.element.AbstractChildElement
import org.progreso.client.gui.clickgui.element.ParentElement
import org.progreso.client.gui.clickgui.element.data.ElementOffsets
import org.progreso.client.gui.drawRect
import org.progreso.client.gui.invokeSuper
import org.progreso.client.gui.invoke
import java.awt.Color

@Suppress("SuspiciousVarProperty")
Expand Down Expand Up @@ -105,7 +105,7 @@ abstract class AbstractWindow(
override fun render(context: DrawContext, mouseX: Int, mouseY: Int) {
super.render(context, mouseX, mouseY)

context.invokeSuper(this) {
context.invoke(this) {
drawHorizontalLine(it.x, it.x + it.width, it.y + it.height - 1, mainColor)
drawCenteredString(
header,
Expand Down

0 comments on commit a7bd287

Please sign in to comment.