I mainly code Javascript for NodeJS projects, so I do understand I may be at fault for trying to incorrectly attempt to provide a solution to my needs.
I'm trying to implement a custom class that will handle all GUI interfaces and hopefully keep it as a standard with most of my projects to keep my workflow fast and if there are any breaking changes, all I have to do is edit this one class.
The following are the source code:
ScreenManager - https://pastebin.com/EBiYRukm
Screen - https://pastebin.com/Gc56fkQt
Please assume the main driver (Command) is running the following line.
new ScreenManager(plugin).get("Screen1", (Player) commandSender).display((Player) commandSender);
My interpretation is that I want the events handler to come up when necessary when this class is active, meaning it'll handle it's own click for it's own gui screen. When the command is finish, the class dispose itself as part of memory management and so does the listeners.
However I have encountered an issue that stops my code from running due to the fact that in my main plugin driver class, I register the events with a blank class instance of the ScreenManager and it actually doesn't parse it to the commands instance of the ScreenManager itself. (My fault here and this is where I'm kind of stuck)
I want some feedback in regards to how to encounter and develop a solution for this as I want to improve on myself and hopefully any new skills I pick up from here or any point of view I will be able to transfer it to other technologies and languages. Thank you for reading!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
