Skip to content

Commit

Permalink
reorganise resources
Browse files Browse the repository at this point in the history
  • Loading branch information
nextdayy committed Jun 3, 2024
1 parent ee1dcc3 commit abcc71f
Show file tree
Hide file tree
Showing 47 changed files with 102 additions and 104 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pgt = "0.5.2"
shadow = "8.1.1"
licenser = "2.0.1"

polyui = "1.2.01"
polyui = "1.2.1"

log4j-api = "2.0-beta9" # used because this is the version that 1.8.9 supports, so we have to compile against the same (annoying)
log4j-impl = "2.23.1" # unvulnerable version
Expand Down Expand Up @@ -72,4 +72,4 @@ pgt-defaults-repo = { id = "org.polyfrost.defaults.repo", version.ref = "pgt" }
pgt-defaults-java = { id = "org.polyfrost.defaults.java", version.ref = "pgt" }

shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
licenser = { id = "org.quiltmc.gradle.licenser", version.ref = "licenser" }
licenser = { id = "org.quiltmc.gradle.licenser", version.ref = "licenser" }
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import org.polyfrost.polyui.color.PolyColor.Companion.TRANSPARENT
import org.polyfrost.polyui.component.*
import org.polyfrost.polyui.component.impl.*
import org.polyfrost.polyui.event.Event
import org.polyfrost.polyui.input.Translator
import org.polyfrost.polyui.operations.DrawableOp
import org.polyfrost.polyui.operations.Fade
import org.polyfrost.polyui.operations.Move
Expand Down Expand Up @@ -192,13 +193,16 @@ object HudManager {
}.register()
}

private val settings = Settings().apply {
cleanupAfterInit = false
debug = false
}

val polyUI: PolyUI = PolyUI(
renderer = UIManager.INSTANCE.renderer,
size = 1920f by 1080f,
settings = Settings().apply {
cleanupAfterInit = false
debug = false
}
translator = Translator(settings, "").also { it.addDelegate("assets/oneconfig/hud") },
settings = settings
).also {
it.master.rawResize = true
it.resize(Platform.screen().windowWidth().toFloat(), Platform.screen().windowHeight().toFloat())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ private fun interactiveAlignment(hud: Hud<out Drawable>): Drawable {
var s2 = 0f
return Block(
Image(
"assets/oneconfig/ico/align/alignment3.svg".image(),
"assets/oneconfig/hud/align/alignment3.svg".image(),
alignment = alignC,
children = arrayOf(
Image(
"assets/oneconfig/ico/align/alignment2.svg".image(),
"assets/oneconfig/hud/align/alignment2.svg".image(),
alignment = alignC,
children = arrayOf(
Block(
Image("assets/oneconfig/ico/align/alignment1.svg".image()).withStates(true).setPalette {
Image("assets/oneconfig/hud/align/alignment1.svg".image()).withStates(true).setPalette {
Colors.Palette(
text.primary.normal,
brand.fg.normal,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
oneconfig.huds.info=World & Server
oneconfig.huds.player=Player

oneconfig.hudeditor.title=HUD Editor
oneconfig.hudeditor.general.title=Background Options
oneconfig.hudeditor.choosesomething=Click on an element to continue.
oneconfig.hudeditor.cantedit.aslegacy=This HUD is running in legacy compatibility mode and cannot be edited.

oneconfig.hudeditor.padding.title=ALIGNMENT & PADDING
oneconfig.hudeditor.padding.info=These settings control the distance between the edge of the background and the HUD, as well as its alignment.
oneconfig.hudeditor.padding.mode.main=Main-axis alignment
oneconfig.hudeditor.padding.mode.cross=Cross-axis alignment
oneconfig.hudeditor.padding.main=Main-axis padding
oneconfig.hudeditor.padding.cross=Cross-axis padding

oneconfig.hudeditor.component.title=Component settings
oneconfig.hudeditor.component.info=These settings control the size and alignment of the component.

oneconfig.hudeditor.color.fill=Fill color
oneconfig.hudeditor.color.border=Border color

oneconfig.hudeditor.opacity=Opacity
oneconfig.hudeditor.rotation=Rotation
oneconfig.hudeditor.radii=Corner radius
oneconfig.hudeditor.skew=Skew

oneconfig.hudeditor.text.title=TEXT OPTIONS
oneconfig.hudeditor.text.example=The quick brown fox jumps over the lazy dog
oneconfig.hudeditor.text.size=Font size
oneconfig.hudeditor.text.weight=Weight
oneconfig.hudeditor.text.font=Font
oneconfig.hudeditor.text.effects=Case type
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ object OneConfigUI {
fun open() {
val vertical = Align(cross = Align.Cross.Start, mode = Align.Mode.Vertical)
val builder = PolyUIBuilder.builder().blurs().backgroundColor(rgba(21, 21, 21)).atResolution(1920f by 1080f).size(1400f by 700f)
builder.translatorDelegate("assets/oneconfig")
builder.onClose { _ ->
for (t in ConfigManager.active().trees()) {
ConfigManager.active().save(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import org.polyfrost.polyui.utils.radii
import org.polyfrost.polyui.utils.translated

private val heart = PolyImage("assets/oneconfig/ico/plus.svg")
private val defaultModImage = "chatting.svg".image()
private val defaultModImage = "assets/oneconfig/ico/default_mod.svg".image()
private val modBoxTopRad = radii(8f, 8f, 0f, 0f)
private val modBoxBotRad = radii(0f, 0f, 8f, 8f)
private val modBoxAlign = Align(cross = Align.Cross.Start, mode = Align.Mode.Vertical, padding = Vec2.ZERO)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
oneconfig.sidebar.title.options=OPTIONS
oneconfig.mods=Mods
oneconfig.profiles=Profiles
oneconfig.keybinds=Keybinds
oneconfig.sidebar.title.personal=PERSONALIZATION
oneconfig.themes=Themes
oneconfig.preferences=Preferences
oneconfig.sidebar.title.extra=HELP & FEEDBACK
oneconfig.changelog=Changelog
oneconfig.edithud=Edit HUD

oneconfig.mods.none=No mods installed!
oneconfig.mods.none.desc=You don't have any compatible mods installed.\nInstall some to configure them here. Visit https://polyfrost.org/mods to get some!

oneconfig.feedback=Feedback

oneconfig.beta=BETA
oneconfig.soon=SOON
oneconfig.readmore=Read more
oneconfig.writtenby=Written by {0}

oneconfig.all=All
oneconfig.pvp=PvP
File renamed without changes
1 change: 1 addition & 0 deletions modules/ui/api/ui.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public final class org/polyfrost/oneconfig/api/ui/v1/PolyUIBuilder {
public fun settings (Lorg/polyfrost/polyui/property/Settings;)Lorg/polyfrost/oneconfig/api/ui/v1/PolyUIBuilder;
public fun size (Lorg/polyfrost/polyui/unit/Vec2;)Lorg/polyfrost/oneconfig/api/ui/v1/PolyUIBuilder;
public fun translator (Lorg/polyfrost/polyui/input/Translator;)Lorg/polyfrost/oneconfig/api/ui/v1/PolyUIBuilder;
public fun translatorDelegate (Ljava/lang/String;)Lorg/polyfrost/oneconfig/api/ui/v1/PolyUIBuilder;
}

public abstract interface class org/polyfrost/oneconfig/api/ui/v1/TinyFD {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public PolyUIBuilder translator(Translator translator) {
return this;
}

public PolyUIBuilder translatorDelegate(String translationDir) {
Translator translator = this.translator == null ? this.translator = new Translator(settings, "", null) : this.translator;
translator.addDelegate(translationDir);
return this;
}

public PolyUIBuilder align(Align alignment) {
this.alignment = alignment;
return this;
Expand Down
24 changes: 24 additions & 0 deletions modules/ui/src/main/resources/en_default.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
polyui.color.solid=Solid color
polyui.color.gradient=Gradient color
polyui.color.chroma=Chroma color
polyui.color.hex=HEX

oneconfig.search.placeholder=Search for something...
oneconfig.button.default=Click

oneconfig.align=Align
oneconfig.align.start=Start
oneconfig.align.center=Center
oneconfig.align.end=End
oneconfig.align.spacebetween=Space Between
oneconfig.align.spaceevenly=Space Evenly

oneconfig.fweight.100=Thin
oneconfig.fweight.200=Extra light
oneconfig.fweight.300=Light
oneconfig.fweight.400=Regular
oneconfig.fweight.500=Medium
oneconfig.fweight.600=Semi bold
oneconfig.fweight.700=Bold
oneconfig.fweight.800=Extra bold
oneconfig.fweight.900=Black
88 changes: 0 additions & 88 deletions versions/src/main/resources/en_default.lang

This file was deleted.

Binary file removed versions/src/main/resources/err.png
Diff not rendered.
7 changes: 1 addition & 6 deletions versions/src/main/resources/licenses/BlurMC-License.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------

The proof of permission is listed in this
folder, feel free to view it if you wish
SOFTWARE.

0 comments on commit abcc71f

Please sign in to comment.