[resource-pack-entry-widgets-v0] Comparator #5

Closed
opened 2024-07-19 11:10:31 +02:00 by AdamCalculator · 10 comments

add the ability for the developer to override the string to be compared in the comparator

?

if use a CONSTANT, it increase a performance instead of getting every render() a mod metadata...


public class ExampleWidget implements ResourcePackEntryWidget {

   /**
   * name may be different.
   **/
    @Override
    public boolean getCompareString(PackSelectionModel.Entry pack, boolean selectable) {
        return MyMod.MOD_ID; // return mod id 
        // if use a CONSTANT, it increase a performance instead of getting every render() a mod metadata...
        // if need change a order: "5" + MOD_ID = "5examplemod"
        // "漢" + MOD_ID (latest in order)
    }

   //...

add the ability for the developer to override the string to be compared in the comparator ? if use a CONSTANT, it increase a performance instead of getting every render() a mod metadata... ```java public class ExampleWidget implements ResourcePackEntryWidget { /** * name may be different. **/ @Override public boolean getCompareString(PackSelectionModel.Entry pack, boolean selectable) { return MyMod.MOD_ID; // return mod id // if use a CONSTANT, it increase a performance instead of getting every render() a mod metadata... // if need change a order: "5" + MOD_ID = "5examplemod" // "漢" + MOD_ID (latest in order) } //... ```
Owner

Ordering is only done once at startup, so performance really isn't a concern (and even if it were, this would change little).
Additionally, I still believe that every user will want to have the rightmost widget, making an API for ordering pointless.

Ordering is only done once at startup, so performance really isn't a concern (and even if it were, this would change little). Additionally, I still believe that every user will want to have the rightmost widget, making an API for ordering pointless.
Author

image

my mod to add a delete button, should the button be the latest? How can I do it???

![image](/attachments/8d51a48b-acfe-407e-b7d2-b0c8d1081d84) #### [my mod](https://github.com/AdamCalculator/RPDeleteButton) to add a delete button, should the button be the latest? How can I do it???
244 KiB
Author

delete button showing only while Shift hold so adding it to the end seems logical so that the rest of the buttons don’t move

delete button showing only while Shift hold so adding it to the end seems logical so that the rest of the buttons don’t move
Author

(I don’t know how the translator translated it, I mean the leftmost one should be a button with a trash can)

(I don’t know how the translator translated it, I mean the leftmost one should be a button with a trash can)
Author

please provide any method to solve this problem...

please provide any method to solve this problem...
Author
image

hmm it's really normal texture scale?

<img width="705" alt="image" src="/attachments/da5c7503-ea11-495c-a4e7-b2b2989bf9d7"> hmm it's really normal texture scale?
192 KiB
Author
image

hmm extension (edit: fold? fuck translate) doesn't work when the button appears only when you hold down the shift key..

<img width="1086" alt="image" src="/attachments/51fd4196-7678-4065-8b25-151b2b24dc75"> hmm extension (edit: fold? fuck translate) doesn't work when the button appears only when you hold down the shift key..
355 KiB
Author

maybe it’s good that when you hold down Shift the buttons appear immediately, yes, but fold behaves strangely
if enter to screen with hold shift and release shit after enter

maybe it’s good that when you hold down Shift the buttons appear immediately, yes, but fold behaves strangely if enter to screen with hold shift and release shit after enter
Owner

Folding only being used if too much space is used when entering the screen is intentional, since it prevents flickering, especially when widgets change their size.
Also, I should probably point out that removing files while they are "in use" (which resource packs almost certainly are) probably won't work on Windows.

Folding only being used if too much space is used when entering the screen is intentional, since it prevents flickering, especially when widgets change their size. Also, I should probably point out that removing files while they are "in use" (which resource packs almost certainly are) probably won't work on Windows.
Author

Folding only being used if too much space is used when entering the screen is intentional, since it prevents flickering, especially when widgets change their size.
Also, I should probably point out that removing files while they are "in use" (which resource packs almost certainly are) probably won't work on Windows.

yes, I encountered it unfortunately, if you use my mod in conjunction with the DynamicPack mod this will not happen (I had to tinker with it)

> Folding only being used if too much space is used when entering the screen is intentional, since it prevents flickering, especially when widgets change their size. > Also, I should probably point out that removing files while they are "in use" (which resource packs almost certainly are) probably won't work on Windows. yes, I encountered it unfortunately, if you use my mod in conjunction with the DynamicPack mod this will not happen (I had to tinker with it)
Comment
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JfMods/LibJF#5
No description provided.