Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class gui rp support #17

Closed
wants to merge 21 commits into from

Conversation

mYstoRi
Copy link

@mYstoRi mYstoRi commented Apr 7, 2024

RP support tags for class selection page!
I did some syntax debugging to ensure there are at least no syntax error, but didn't manage to compile onto sdk to test. If there are any changes, I'm all ears.

class selection page

  • added gui identifier
  • added tag for summaryItem
  • added tag for resetItem
  • added tag for triggersItem
  • added tag for specItem (reset spec)

skill selection page

  • added gui identifier
  • shifted the locations of pre-enhancement menu left one to match the texture.
  • added tag for backButton for both p2 and p3
  • added tag for specItem (reset spec)
  • added tag for enhancement point slot by updating createEnhanceItem
  • added tags for the level items in skill selection pages
    • this creates an overload of createLevelItem method with an additional parameter specifying if the skill is a spec skill
  • added tags for the items that shows how many unassigned skill points you gave

spec skill selection page

  • added gui identifier
  • added tags for the level items
  • added tags for the items that shows how many unassigned skill points you gave

trigger page (choose trigger to tweak)

  • added gui identifier
  • added tag for back button
  • added tag for help sign
  • added tag for reset trigger button

trigger detail page (tweak certain skill trigger)

  • added gui identifier
  • added tag for back button
  • added tag for "extras" indicator
  • added tag for the scroll forward/back button
  • added tag for confirm/cancel button
  • added tag for the revert button
  • added tag for the enabled/disabled toggle button
  • added tags for double click, sneaking, sprinting, on ground, looking, fall through buttons
  • added tag for the activate key button
  • added tags for all the keyOptions.

cross gui items

  • change the base item of remaining skill point indicator from grass_block to rooted_dirt
  • change the base item of on ground option from grass_block to rooted_dirt

API changes

  • added a function in GUIUtils.createGuiIdentifierItem that creates a filler with a gui tag.
  • added a new field in AbilityTrigger.KeyOptions: mGuiTag for rp tag
    • added an overload to KeyOptions constructor to support new tag
    • added a method getGuiTag to retrieve the tag

- shifted the locations of pre-enhancement menu left one to match the texture.
- added tag for summaryItem
- added tag for resetItem
- added tag for specItem
- added tag for triggersItem
- added tag for `backButton` for both p2 and p3
- added tag for `specItem` (reset spec) for both p2 and p3
- added tag for enhancement point slot by updating `createEnhanceItem`
- added tags for the level items in skill selection pages
  - by adding a new function `createSkillLevelItem` which does almost the same thing as `createLevelItem` but adds rp support tag to it. Reason being skill/spec level items are all generated by the latter but they will have different rp textures.
- fix a place in `createEnhancementItem` where a type declaration is missed out.
- there is no new function anymore. Instead, there is a new overload with one extra boolean that indicates if the level item is a spec skill or a normal skill.
note: maybe it'll be easier to identify if a skill is a spec skill rather than an additional parameter to the method.
- added tags for levelItem in spec skill selection page (page 4)
- added tags for backButton in spec skill selection page (page 4)
- added tags for the items that shows how many unassigned skill points you gave
- added a function in `GUIUtils.createGuiIdentifierItem` that creates a filler with a gui tag.
- class selection, skill selection (both r1 and r3), spec skill selection pages now have a gui identifier item.
- trigger (choose which skill trigger to tweak):
  - added tag for back button
  - added tag for help sign
  - added tag for reset trigger button

- trigger detail (settings for one of the skill trigger):
  - added tag for back button
  - added tag for "extras" indicator
  - added tag for the scroll forward/back button
  - added tag for confirm/cancel button
  - added tag for the revert button
- added tags for all the keyOptions.
  - by adding a new field in `AbilityTrigger` enumerated structure: `mGuiTag` and new method `getGuiTag`.
  - assign the mGuiTag of each current keyoptions.
- added tag for the enabled/disabled toggle button
- added tag for the activate key button
- added tags for double click, sneaking, sprinting, on ground, looking, fall through buttons
- added tags for gui identifiers in trigger page
- change the base item of remaining skill point indicator from grass_block to rooted_dirt
- change the base item of on ground option from grass_block to rooted_dirt
- separate tag for the gui identifier for class selection gui and depth ability summary gui
- fixed various places missing brackets for ? : statements
- fixed various places where switch doesn't have a default, and a missing colon after a switch statement
Copy link
Contributor

@dmdinnc dmdinnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the CSGUI changes, the RP specific things are ok but left comments on the alterations to the actual design and vanilla view of the GUI that need to be addressed.

@@ -40,12 +40,21 @@ public class ClassSelectionCustomInventory extends CustomInventory {
private static final int P1_RESET_CLASS_LOC = 47;
private static final int P1_RESET_SPEC_LOC = 49;
private static final int P1_CHANGE_TRIGGERS_LOC = 51;
public static final ArrayList<Integer> P2_ABILITY_LOCS = new ArrayList<>(Arrays.asList(10, 14, 19, 23, 28, 32, 37, 41));
public static final ArrayList<Integer> P2_ABILITY_LOCS = new ArrayList<>(Arrays.asList(9, 14, 18, 23, 27, 32, 36, 41));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want to worsen the vanilla experience in support of modded here, better to change the RP to have a seperate background for the non-r3 version, since using an r3 background on the r1/2 version is going to make it both look on with and without the RP

summaryItem.setAmount(currentSpecCount > 0 ? currentSpecCount : 1);
mInventory.setItem(COMMON_REMAINING_SPEC_LOC, summaryItem);
}
int currentSkillCount = ScoreboardUtils.getScoreboardValue(player, AbilityUtils.REMAINING_SKILL);
ItemStack summaryItem = GUIUtils.createBasicItem(currentSkillCount == 0 ? Material.BARRIER : Material.GRASS_BLOCK, "Skill Points", NamedTextColor.WHITE, false,
ItemStack summaryItem = GUIUtils.createBasicItem(currentSkillCount == 0 ? Material.BARRIER : Material.ROOTED_DIRT, "Skill Points", NamedTextColor.WHITE, false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this done? RP shouldn't be impacted by this as far as i'm aware, and grass seems more fitting for r1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is related to something about multi layered grass or something, move to the Orin GUI item for the valley please, since it's a standard for the purpose

} else {
GUIUtils.setGuiNbtTag(newItem, "texture", "skill_select_en_unlit");
}
return newItem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can check the material type here instead, re-simplifying the case statement above

private static final int P2_GUI_IDENTIFIER_LOC = 45;
private static final int P3_GUI_IDENTIFIER_LOC = 45;
private static final int P4_GUI_IDENTIFIER_LOC = 45;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need 4 of these if they all identify the same location, just use GUI_IDENTIFIER_LOC for all

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are for potentially in the future the slots are used and needed to move elsewhere - but yeah leaving these as one should work for now. Will change.

@@ -588,6 +626,30 @@ public void addSpecItem(PlayerClass playerClass, PlayerSpec spec, PlayerSpec oth
}
}

public ItemStack createLevelItem(PlayerClass theClass, AbilityInfo<?> ability, int level, Player player, boolean isSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used in this gui, no need to override and have 2 versions do the same actions, just use the new parameter to define new work within the same function

- Reverted the change that shifts region 1/2 skill selection right
- Changed the base item for skill point remaining item from rooted_dirt to green_concrete (currently on play uses grass_block)
- unified constant GUI_IDENTIFIER_LOC into one. All guis have their identifiers at the bottom left corner.
- Deleted overload createLevelItem that does pretty much the same thing.
- Simplified createEnhanceItem by detecting the material instead of a local boolean
- level item now has 2 new tags:
  - `GUI.skill` value is the display name of the skill
  - `level` value is 1 or 2, the two level items can be distinguished using this tag
- gui identifier now has 2 new tags:
  - `class` value is the name of the class
  - `spec` value is the name of the specialization
- Fixed AbilityTrigger.KeyOptions.getGuiTag returns "_true" instead of "true", similarly for "false"
- split the gui identifiers in two slots for full 256x texture support (previously only 192x is possible and for reference the vanilla texture is 176x width)
- fixed gui identifiers in trigger pages  are in the wrong places and make them use a static constant for locations (GUI_IDENTIFIER_LOC_L/R) like in class gui
@MistHelix MistHelix closed this May 20, 2024
@MistHelix
Copy link
Collaborator

Added to private repo but wont show up here for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants