Skip to content

Commit

Permalink
Adjustments to ui fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Jul 26, 2024
1 parent 150091a commit 16bced1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class PlayerEXScreen : BaseUIModelScreen<FlowLayout>(FlowLayout::class.java, Dat
result = (player.experienceLevel.toDouble() / PlayerEXUtil.getRequiredXpForNextLevel(player)) * 100
}
footer.childById(BoxComponent::class, "progress")!!
.horizontalSizing().animate(2, Easing.SINE, Sizing.fill(result.toInt())).forwards()
.horizontalSizing().animate(1000, Easing.CUBIC, Sizing.fill(result.toInt())).forwards()
}

override fun build(rootComponent: FlowLayout) {
Expand All @@ -134,7 +134,6 @@ class PlayerEXScreen : BaseUIModelScreen<FlowLayout>(FlowLayout::class.java, Dat

this.onLevelUpdated(player.level.toInt())
this.onPagesUpdated()
updateProgressBar(player)

pageCounter.text(Text.of("${currentPage + 1}/${pages.size}"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ import com.bibireden.data_attributes.api.attribute.StackingFormula
import com.bibireden.playerex.components.player.IPlayerDataComponent
import com.bibireden.playerex.ext.id
import com.bibireden.playerex.ui.PlayerEXScreen.AttributeButtonComponentType
import com.bibireden.playerex.ui.childById
import com.bibireden.playerex.ui.components.buttons.AttributeButtonComponent
import com.bibireden.playerex.ui.components.labels.AttributeLabelComponent
import com.bibireden.playerex.ui.util.Colors
import io.wispforest.owo.ui.component.Components
import io.wispforest.owo.ui.component.LabelComponent
import io.wispforest.owo.ui.container.Containers
import io.wispforest.owo.ui.container.FlowLayout
import io.wispforest.owo.ui.core.*
import net.minecraft.entity.attribute.EntityAttribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.bibireden.playerex.ext.level
import com.bibireden.playerex.ui.components.MenuComponent
import com.bibireden.playerex.ui.components.AttributeComponent
import com.bibireden.playerex.ui.components.labels.AttributeLabelComponent
import com.bibireden.playerex.util.PlayerEXUtil
import io.wispforest.owo.ui.component.Components
import io.wispforest.owo.ui.container.Containers
import io.wispforest.owo.ui.container.FlowLayout
Expand Down Expand Up @@ -40,6 +41,9 @@ class AttributesMenu : MenuComponent(Sizing.fill(100), Sizing.fill(100), Algorit
child(Components.label(Text.translatable("playerex.ui.category.primary_attributes")))
child(
Components.textBox(Sizing.fixed(27))
.also {
it.setMaxLength(4)
}
.text("1")
.verticalSizing(Sizing.fixed(10))
.positioning(Positioning.relative(100, 0))
Expand All @@ -50,7 +54,7 @@ class AttributesMenu : MenuComponent(Sizing.fill(100), Sizing.fill(100), Algorit
children(PlayerEXAttributes.PRIMARY_ATTRIBUTE_IDS.mapNotNull(Registries.ATTRIBUTE::get).map { AttributeComponent(it, player, component) })
})

padding(Insets.both(4, 4))
padding(Insets.both(12, 12))



Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/assets/playerex/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

"playerex.ui.main.title":[
{"text": "\uD83D\uDDB3 ", "color": "#F0C25E"},
{"text": "PlayerEX • Leveling Screen", "color": "white"}
{"text": "PlayerEX • Main Screen", "color": "white"}
],

"playerex.ui.main.exit": "Exit",
"playerex.ui.main.exit.tooltip": "Exits from the window.",

"playerex.ui.main.skill_points_header": "SKILL POINTS",
"playerex.ui.main.modified_attributes": [ {"text": "❤ Modified Attributes", "color": "#F6CB3B"} ],
"playerex.ui.main.modified_attributes": [ {"text": "", "color": "#48D19B"}, {"text": "Modified Attributes", "color": "white"} ],

"playerex.ui.category.primary_attributes": "Attributes",


"playerex.ui.current_level": [
{"text": "", "color": "#F0C25E"},
{"text": "Level: ", "color": "white"},
Expand Down

0 comments on commit 16bced1

Please sign in to comment.