Skip to content

Commit

Permalink
merged S into Var
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Dec 5, 2023
1 parent 7f933f6 commit d84d807
Show file tree
Hide file tree
Showing 29 changed files with 96 additions and 110 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
val settings = localConfig
allprojects {
group = "net.liplum"
version = "5.1"
version = "6.0"
repositories {
mavenCentral()
maven {
Expand Down
11 changes: 0 additions & 11 deletions main/src/net/liplum/S.java

This file was deleted.

2 changes: 2 additions & 0 deletions main/src/net/liplum/Var.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import net.liplum.ui.NavigationService
import plumy.dsl.WorldXY

object Var {
@JvmField var Hologram = R.C.Holo
@JvmField var HologramDark = R.C.HoloDark
@JvmField var ContentSpecific = ContentSpec.Vanilla
@JvmField var CurDebugLevel = DebugLevel.Any
@JvmField var ExperimentalMode = false
Expand Down
6 changes: 2 additions & 4 deletions main/src/net/liplum/api/cyber/NetworkNodeH.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import mindustry.graphics.Layer
import mindustry.graphics.Pal
import net.liplum.DebugOnly
import net.liplum.R
import net.liplum.S
import net.liplum.Var
import net.liplum.api.cyber.SideLinks.Companion.coordinates
import net.liplum.api.cyber.SideLinks.Companion.reflect
Expand All @@ -34,7 +33,6 @@ import net.liplum.input.smoothPlacing
import net.liplum.input.smoothSelect
import plumy.animation.ContextDraw.Draw
import plumy.animation.ContextDraw.DrawSize
import net.liplum.render.*
import net.liplum.registry.SD
import net.liplum.render.G
import net.liplum.render.Text
Expand Down Expand Up @@ -245,7 +243,7 @@ fun INetworkNode.drawLinkInfo() = building.run {
if (sendingProgress > 0f) {
val width = 25f
Fill.rect(x, y, width, 5f)
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
Fill.rect(x - width * (1f - sendingProgress) / 2f, y, width * sendingProgress, 5f)
Draw.color()
}
Expand Down Expand Up @@ -311,7 +309,7 @@ fun INetworkNode.drawRail(beamTR: TR, beamEndTR: TR) {
val oy = this.building.y
val widthHalf = Var.NetworkNodeRailWidth / 2f
val thickness = Var.NetworkRailThickness
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
links.forEachNodeWithSide { side, t ->
val time = linkingTime[side]
val dir = coordinates[side]
Expand Down
6 changes: 3 additions & 3 deletions main/src/net/liplum/blocks/cyberion/CyberionMixerDrawer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import arc.util.Time
import mindustry.gen.Building
import mindustry.graphics.Layer
import mindustry.world.draw.DrawBlock
import net.liplum.S
import net.liplum.Var
import plumy.dsl.DrawLayer
import plumy.core.math.smooth

class DrawCyberionAgglomeration : DrawBlock() {
var flameColor: Color = S.HologramDark
var midColor: Color = S.Hologram
var flameColor: Color = Var.HologramDark
var midColor: Color = Var.Hologram
var flameRad = 1f
var flameRadiusScl = 5f
var circleStroke = 1.5f
Expand Down
4 changes: 2 additions & 2 deletions main/src/net/liplum/blocks/decentralizer/Decentralizer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import mindustry.type.ItemStack
import mindustry.world.Block
import net.liplum.CLog
import net.liplum.DebugOnly
import net.liplum.S
import net.liplum.Var
import net.liplum.blocks.decentralizer.RecipeCenter.AllRecipes
import net.liplum.blocks.decentralizer.RecipeCenter.calcuID
import net.liplum.common.util.getF
Expand Down Expand Up @@ -138,7 +138,7 @@ open class Decentralizer(name: String) : Block(name) {
override fun draw() {
super.draw()
DebugOnly {
"$curRecipe".postToastTextOn(this, S.Hologram, faded = false)
"$curRecipe".postToastTextOn(this, Var.Hologram, faded = false)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions main/src/net/liplum/blocks/deleter/DeleterWave.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import mindustry.entities.Effect
import mindustry.entities.bullet.BasicBulletType
import mindustry.gen.*
import mindustry.graphics.Layer
import net.liplum.S
import net.liplum.Var
import net.liplum.api.IExecutioner
import net.liplum.math.quadratic
import plumy.animation.ContextDraw.DrawScale
Expand All @@ -31,8 +31,8 @@ open class DeleterWave(

init {
hitEffect = Fx.hitLancer
frontColor = S.Hologram
backColor = S.HologramDark
frontColor = Var.Hologram
backColor = Var.HologramDark
pierce = true
pierceCap = 10
lightRadius = 1f
Expand Down
4 changes: 2 additions & 2 deletions main/src/net/liplum/holo/HoloForceField.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import mindustry.graphics.Layer
import mindustry.graphics.Pal
import mindustry.ui.Bar
import net.liplum.Meta
import net.liplum.S
import net.liplum.Var
import net.liplum.common.shader.use
import net.liplum.utils.healthPct
import net.liplum.utils.localized
import net.liplum.registry.SD

open class HoloForceField(
val radius: Float, val regen: Float, val max: Float, val cooldown: Float,
val color: Color = S.Hologram,
val color: Color = Var.Hologram,
) : Ability() {
override fun update(unit: Unit) {
if (unit.shield < max) {
Expand Down
12 changes: 6 additions & 6 deletions main/src/net/liplum/holo/HoloFx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ import mindustry.Vars
import mindustry.entities.Effect
import mindustry.graphics.Drawf
import mindustry.graphics.Layer
import net.liplum.S
import net.liplum.Var
import net.liplum.common.shader.on
import net.liplum.registry.SD

object HoloFx {
val heal = Effect(11f) {
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
Lines.stroke(it.fout() * 2f)
Lines.circle(it.x, it.y, 2f + it.finpow() * 7f)
}
val healWaveDynamic = Effect(22f) {
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
Lines.stroke(it.fout() * 2f)
Lines.circle(it.x, it.y, 4f + it.finpow() * it.rotation)
}
val hitLaser = Effect(8f) {
Draw.color(Color.white, S.Hologram, it.fin())
Draw.color(Color.white, Var.Hologram, it.fin())
Lines.stroke(0.5f + it.fout())
Lines.circle(it.x, it.y, it.fin() * 5f)
Drawf.light(it.x, it.y, 23f, S.Hologram, it.fout() * 0.7f)
Drawf.light(it.x, it.y, 23f, Var.Hologram, it.fout() * 0.7f)
}
val shootHeal = Effect(8f) {
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
val w = 1f + 5 * it.fout()
Drawf.tri(it.x, it.y, w, 17f * it.fout(), it.rotation)
Drawf.tri(it.x, it.y, w, 4f * it.fout(), it.rotation + 180f)
Expand Down
4 changes: 2 additions & 2 deletions main/src/net/liplum/holo/HoloProjectingSection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import arc.math.geom.Vec2
import arc.util.Tmp
import mindustry.gen.Building
import mindustry.graphics.Layer
import net.liplum.S
import net.liplum.Var
import net.liplum.render.G
import net.liplum.render.*
import plumy.dsl.DrawLayer
Expand All @@ -14,7 +14,7 @@ class HoloProjectingSection<T> : DrawSection<T>() where T : Building {
val v = Vec2()
var center: T.() -> Vec2 = { v.set(x, y) }
var alphaProgress: SectionProgress<T> = Sections.warmupSmooth
var color = S.Hologram
var color = Var.Hologram
var x = 0f
var y = 0f
var width = 6f
Expand Down
8 changes: 4 additions & 4 deletions main/src/net/liplum/holo/HoloProjector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import mindustry.world.meta.BlockGroup
import mindustry.world.meta.Stat
import net.liplum.DebugOnly
import net.liplum.R
import net.liplum.S
import net.liplum.Var
import net.liplum.UndebugOnly
import net.liplum.common.util.percentI
import net.liplum.utils.CalledBySync
Expand Down Expand Up @@ -211,7 +211,7 @@ open class HoloProjector(name: String) : Block(name) {
override fun buildConfiguration(table: Table) {
val options = Seq.with(plans).map {
it.unitType
}.filter {
}.retainAll {
it.unlockedNow() && !it.isBanned
}
if (options.any()) {
Expand Down Expand Up @@ -378,13 +378,13 @@ open class HoloProjector(name: String) : Block(name) {
DebugOnly {
AddBar<HoloProjectorBuild>("progress",
{ "${"bar.progress".bundle}: ${progress.percentI}" },
{ S.Hologram },
{ Var.Hologram },
{ progress }
)
}.Else {
AddBar<HoloProjectorBuild>("progress",
{ "bar.progress".bundle },
{ S.Hologram },
{ Var.Hologram },
{ progress }
)
}
Expand Down
10 changes: 5 additions & 5 deletions main/src/net/liplum/holo/HoloUnit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import mindustry.world.blocks.ConstructBlock.ConstructBuild
import mindustry.world.blocks.payloads.BuildPayload
import mindustry.world.blocks.payloads.Payload
import mindustry.world.blocks.power.PowerGraph
import net.liplum.S
import net.liplum.Var
import net.liplum.common.persistence.*
import net.liplum.holo.HoloProjector.HoloProjectorBuild
import net.liplum.mixin.PayloadMixin
Expand Down Expand Up @@ -136,7 +136,7 @@ open class HoloUnit : UnitEntity(), PayloadMixin, IRevisionable {
HoloFx.shieldBreak.at(
x, y,
cacheRange,
S.Hologram, this
Var.Hologram, this
)
}
}
Expand Down Expand Up @@ -170,7 +170,7 @@ open class HoloUnit : UnitEntity(), PayloadMixin, IRevisionable {
val size = if (plan.breaking) if (active) tile.block().size else lastSize else plan.block.size
val tx = plan.drawx()
val ty = plan.drawy()
Lines.stroke(1.0f, S.Hologram)
Lines.stroke(1.0f, Var.Hologram)
Draw.z(Layer.buildBeam)
Draw.alpha(buildAlpha)
if (!active && tile.build !is ConstructBuild) {
Expand All @@ -193,7 +193,7 @@ open class HoloUnit : UnitEntity(), PayloadMixin, IRevisionable {
val ox = mineTile.worldx()
val oy = mineTile.worldy()
Draw.z(115.1f)
Draw.color(S.Hologram)
Draw.color(Var.Hologram)
val size = mineTile.overlay().size.worldXY
DrawLayer(Layer.buildBeam) {
Fill.poly(ox, oy, 8, size, Time.time)
Expand All @@ -217,7 +217,7 @@ open class HoloUnit : UnitEntity(), PayloadMixin, IRevisionable {
ruvikTipAlpha -= 0.5f / holoType.ruvikShootingTipTime
}
if (ruvikTipAlpha > 0f) {
G.dashCircleBreath(x, y, holoType.ruvikTipRange, color = S.Hologram, alpha = ruvikTipAlpha)
G.dashCircleBreath(x, y, holoType.ruvikTipRange, color = Var.Hologram, alpha = ruvikTipAlpha)
}
}
}
Expand Down
25 changes: 12 additions & 13 deletions main/src/net/liplum/holo/HoloUnitType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import mindustry.world.meta.Env
import mindustry.world.meta.Stat
import net.liplum.DebugOnly
import net.liplum.R
import net.liplum.S
import net.liplum.Var
import net.liplum.common.shader.use
import plumy.dsl.bundle
Expand Down Expand Up @@ -89,13 +88,13 @@ open class HoloUnitType(name: String) : UnitType(name) {
var researchReq: Array<ItemStack> = emptyArray()

init {
//outlineColor = S.HologramDark
//outlineColor = Var.HologramDark
allowedInPayloads = false
lightColor = S.Hologram
engineColor = S.Hologram
healColor = S.Hologram
engineColorInner = S.HologramDark
mechLegColor = S.HologramDark
lightColor = Var.Hologram
engineColor = Var.Hologram
healColor = Var.Hologram
engineColorInner = Var.HologramDark
mechLegColor = Var.HologramDark
wreckRegions = emptyArray()
fallEffect = Fx.none
fallEngineEffect = Fx.none
Expand All @@ -117,7 +116,7 @@ open class HoloUnitType(name: String) : UnitType(name) {
val layers = listOf(
Layer(Core.atlas.getPixmap(rawIcon).toLayerBuffer()),
Layer(Core.atlas.getPixmap(rawIcon).toLayerBuffer()) {
+TintLerpLayerProcessor(S.Hologram, Var.HoloUnitTintAlpha)
+TintLerpLayerProcessor(Var.Hologram, Var.HoloUnitTintAlpha)
}
)
val baked = maker.bake(layers).createPixmap()
Expand Down Expand Up @@ -264,13 +263,13 @@ open class HoloUnitType(name: String) : UnitType(name) {
DebugOnly {
bars.add(Bar(
{ R.Bar.RestLifeFigure.bundle(unit.restLife.toSecond) },
{ S.Hologram },
{ Var.Hologram },
{ unit.restLifePercent }
))
}.Else {
bars.add(Bar(
{ R.Bar.RestLife.bundle },
{ S.Hologram },
{ Var.Hologram },
{ unit.restLifePercent }
))
}
Expand Down Expand Up @@ -322,7 +321,7 @@ open class HoloUnitType(name: String) : UnitType(name) {
else "${Iconc.cancel}"
}, {
val p = unit.projectorPos.castBuild<HoloProjectorBuild>()
if (p != null) S.Hologram
if (p != null) Var.Hologram
else Color.gray
}, {
(unit.projectorPos.castBuild<HoloProjectorBuild>() != null).toFloat()
Expand All @@ -335,7 +334,7 @@ open class HoloUnitType(name: String) : UnitType(name) {
if (p != null) "${Iconc.home}"
else "${Iconc.cancel}"
}, {
S.Hologram
Var.Hologram
}, {
(unit.projectorPos.castBuild<HoloProjectorBuild>() != null).toFloat()
})
Expand Down Expand Up @@ -373,7 +372,7 @@ open class HoloUnitType(name: String) : UnitType(name) {
Fill.light(
unit.x, unit.y, Lines.circleVertices(radius), radius,
Color.clear,
Tmp.c2.set(S.Hologram)
Tmp.c2.set(Var.Hologram)
.lerp(Color.white, Mathf.clamp(unit.hitTime() / 2f))
.a(0.7f * alpha)
)
Expand Down
Loading

0 comments on commit d84d807

Please sign in to comment.