BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
334 stars 137 forks source link

more button click type support #2531

Open Noogear opened 4 days ago

Noogear commented 4 days ago

Is your feature request related to a problem?

I am using Oraxen to design a more beautiful GUI interface, but I realized that the type of the button is fixed. There is no way to execute commands or close the GUI. I really need a button that can execute commands so that I can jump to the main menu.

Describe the solution you'd like.

A button that can execute commands

Describe alternatives you've considered.

none

Agreements

Other

No response

tastybento commented 4 days ago

I'm sorry, you'll have to give me more background and context because I don't understand. How does this related to BentoBox? Isn't this an Oraxen question? Also, what "button" do you mean? Where is the button and what does it do now?

Noogear commented 4 days ago

I'm sorry, you'll have to give me more background and context because I don't understand. How does this related to BentoBox? Isn't this an Oraxen question? Also, what "button" do you mean? Where is the button and what does it do now?

I'm very sorry. What I mean is that I need to add a button on the GUI interface of the addons to execute instructions and close the GUI in order to achieve a more highly customizable menu.

Noogear commented 4 days ago

Screenshot_2024-10-08-07-09-15-414_mark via

Regarding this, I found that there are only these types of button. I hope to add a button for executing instructions or closing the GUI.

tastybento commented 4 days ago

This is pretty advanced API and used when programming a new addon in Java. I'm not sure this is correct.

Just stepping back, can you explain more what you are doing with Oraxen to make a GUI?

What commands would you be running? In the latest BentoBox 2.6.0, there is the ability to add commands to text shown to users (see the release notes). Maybe this can be used?

Noogear commented 4 days ago

This is pretty advanced API and used when programming a new addon in Java. I'm not sure this is correct.

Just stepping back, can you explain more what you are doing with Oraxen to make a GUI?

What commands would you be running? In the latest BentoBox 2.6.0, there is the ability to add commands to text shown to users (see the release notes). Maybe this can be used?

It has little to do with Oraxen. In fact, it's just a pattern. For example, I used a menu plugin to create a main interface. There is a button in it. Clicking on it can execute the command "/is challenge" to open the challenge interface. But at this time, I can only choose to close it by pressing Esc. There is no button that can be clicked to execute the command to return to the main interface.

tastybento commented 4 days ago

Aha. Okay. Hmm. Let me think about this. Not sure if it could be done. What command would you run if you did have this? You can now add commands to text but it's chat text not GUI text. Hmmm.

Noogear commented 4 days ago

Aha. Okay. Hmm. Let me think about this. Not sure if it could be done. What command would you run if you did have this? You can now add commands to text but it's chat text not GUI text. Hmmm.

The meaning of "text" is not significant. I bound the command to open the menu to the clock. Players can right-click the clock to open the menu, and then perform various operations, including managing their islands. I searched on Google for "bentobox's custom gui by ia or oraxen", and I found that no one has done it, while many people have drawn graphical interfaces for similar plugins. I tried to make it and found that it just lacks an extra button that can execute commands for achieving interactivity with other menu plugins. For example, use a command to switch to another GUI interface. Isn't this a disadvantage of Bentobox? I think it is very necessary.

Noogear commented 4 days ago

Aha. Okay. Hmm. Let me think about this. Not sure if it could be done. What command would you run if you did have this? You can now add commands to text but it's chat text not GUI text. Hmmm.

https://builtbybit.com/resources/deluxe-skyblock-premium-server-setup.40342/?ref=discover The expression I made might not be clear. You can have a look at these. Nowadays, many servers use menus to cover almost all the commands. This is a trend. And the interactivity of the menus is the most valued aspect by current servers, including switching menus, returning to the previous level, and closing the menus.

Noogear commented 4 days ago

Then I also realized that the menu does not implement the caching function for the head skins, resulting in the need to load the heads every time the menu is opened. I'm not sure if this is difficult to implement, but referring to other plugins, caching should be done when the menu is opened for the first time, and then when the player opens the menu subsequently, it should detect whether the cache needs to be updated instead of reloading the heads all over again. Could this be my obsessive-compulsive disorder? But currently, in an era of scarce gameplay, the involution of UI is very common.

tastybento commented 3 days ago

I just woke up and read everything you wrote. I'm still trying to work out what it is that you are trying to do. Where does this GUI exist? In-game? Who is it for? Admins? What features and functions are you trying to make it do? You mention sophisticated elements like head caching (which we do) but I don't actually know what it is you are trying to make.

BentoBox has a number of GUIs for various functions. One way to approach this is to understand what you are trying to do and then I can suggest a way to solve it or implement it. Right now, I feel like we are discussing the solution without knowing what the problem is.

Thanks.

Noogear commented 3 days ago

I just woke up and read everything you wrote. I'm still trying to work out what it is that you are trying to do. Where does this GUI exist? In-game? Who is it for? Admins? What features and functions are you trying to make it do? You mention sophisticated elements like head caching (which we do) but I don't actually know what it is you are trying to make.

BentoBox has a number of GUIs for various functions. One way to approach this is to understand what you are trying to do and then I can suggest a way to solve it or implement it. Right now, I feel like we are discussing the solution without knowing what the problem is.

Thanks.

QQ_1728398222987 This is the island settings. It's very simple. For example, a button can be added at the place indicated by the arrow in the screenshot to execute instructions. That's all. This instruction can be executed by the player or the console. I need a button to switch the menu.

Noogear commented 3 days ago

Regarding the head cache, it has nothing to do with this issue. I might consider opening a new question. There are often inexplicable problems with the head cache. Let's wait until I encounter them.

Noogear commented 1 day ago
1:
  icon: tipped_arrow
  title: "Back"
  description: "Left click to back."
  data:
    type: COMMAND
  action:
    left:
      type: COMMAND
      command: 
        # Close the menu.
        - close
        # Delay for 1 tick before performing the next action.
        - delay: 1
        # Execute the command as a player. Here are the instructions of other menu plugins executed.
        - player: menu open main
        # Execute the command as the console.
        - "console: tell %player% \'you back to the main menu.\'"