Skip to content

Commit

Permalink
Add skill and skill_key page placeholders for level_progression menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Oct 9, 2024
1 parent 23d1fa0 commit e729748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {

dependencies {
api(project(":api"))
api("dev.aurelium:slate:1.1.8") {
api("dev.aurelium:slate:1.1.9-SNAPSHOT") {
exclude("org.yaml", "snakeyaml")
exclude("org.spongepowered", "configurate-yaml")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public void build(MenuBuilder menu) {
"start_level", 1,
"track", SkillLevelItem.getDefaultTrack()));

menu.replaceTitle("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));
menu.replace("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));
menu.replace("skill_key", p -> ((Skill) p.menu().getProperty("skill")).getId().getKey());

menu.replaceTitle("page", p -> String.valueOf(p.menu().getCurrentPage() + 1));

menu.properties(m -> {
Expand Down Expand Up @@ -111,8 +113,6 @@ public void build(MenuBuilder menu) {
});

menu.item("sources", item -> {
item.replace("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));

item.onClick(c -> {
BuiltMenu sourcesMenu = plugin.getSlate().getBuiltMenu("sources");
MenuInfo info = new MenuInfo(plugin.getSlate(), c.player(), c.menu());
Expand All @@ -121,8 +121,6 @@ public void build(MenuBuilder menu) {
});

menu.item("abilities", item -> {
item.replace("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));

item.onClick(c -> {
BuiltMenu abilitiesMenu = plugin.getSlate().getBuiltMenu("abilities");
MenuInfo info = new MenuInfo(plugin.getSlate(), c.player(), c.menu());
Expand All @@ -144,7 +142,6 @@ public void build(MenuBuilder menu) {
});

menu.item("job", item -> {
item.replace("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));
// Hide if jobs are disabled
item.modify(i -> {
Skill skill = (Skill) i.menu().getProperty("skill");
Expand Down Expand Up @@ -180,8 +177,6 @@ public void build(MenuBuilder menu) {
});

menu.component("job_select", null, component -> {
component.replace("skill", p -> ((Skill) p.menu().getProperty("skill")).getDisplayName(p.locale(), false));

component.shouldShow(t -> {
User user = plugin.getUser(t.player());
Skill skill = (Skill) t.menu().getProperty("skill");
Expand Down

0 comments on commit e729748

Please sign in to comment.