MV/MZ SDJB_htmlMenu

PluginName: SDJB_ htmlMenu
Author: ShadowDragon

htmlMenu.gif

Spoiler: Official layout (default Main Menu)
htmlMenu.gif

Spoiler: Help File
Code:
 Open the plugin to make your HTML Commands in the "initHtmlMenu".
 using the scriptcall: $gameSystem.initHtmlMenu(); will reset it back!

 How it works
  ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 htmlMenu.open() 
 To open the menu (closes automatically) when you click the command.
 
 htmlMenu.debugMenu()
 To debug the menu if it works correctly.

 htmlMenu.changeLabel(id, newLabel);
 This change the label of the command to a new one, by using its id.

 Example:
 id: "equipment", label: "???"
 htmlMenu.changeLabel("equipment", "Super Gear");

 becomes:
 id: "equipment", label: "Super Gear"

 htmlMenu.enableCmd(id);
 Unlocks all parents leading to this command

 htmlMenu.disableCmd(id);
 Only disables the one you set

 htmlMenu.removeCmd(id)
 Remove the target ID and all its childs if it has any.

 htmlMenu.addMenuItem(newItems, overwrite);
   This add new menu commands, if it exist.
   → if exist, it adds a new item to the id/submenu or change.
     The best thing is it starts from the ID if its deep nested!.
   → if exist, but change the action, it updates it.
   → if it doesn't exist, it adds the command(s)/subcommands

 → newItems is a new entry, while overwrite = false by default.
   When overwrite is true, it delete everything on the existing label
   and remake the entry.

 Example how to use:
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 The following adds a new command, or update if exist.
    htmlMenu.addMenuItem([{
       id: "equipment", label: "Equipment",
       action: () => console.log("New Command clicked"),
       disabled: false,
       subMenu: [{
           id: "uniqueId", label: "New Command",
           action: () => console.log("New Command clicked"),
           disabled: false
       }]
   }]);


 The following overwrite the entire command
    htmlMenu.addMenuItem([{
       id: "equipment", label: "Equipment",
       action: () => console.log("New Command clicked"),
       disabled: false,
       subMenu: [{
           id: "uniqueId", label: "New Command",
           action: () => console.log("New Command clicked"),
           disabled: false
       }]
   }], true)

Change Log:
This update is HUGE, and a pain!
- Change Structure built and able to save them Save Files!
- Added "id" which should be UNIQUE (with safe-guard to print out duplicated)
- Added "disabled" to easy disable the command.
- Altered AddMenuCmd to be more powerful for use!
- Added enableCmd(id) and will unlock EACH command in its path if nested.
- Added disableCmd(id) to disable 1 item with the ID
- Added removeCmd to remove the ID from the list.
- Added changeLabel(id, newName) to change it on the fly!
- Enhanced Debug just in case (html.debugMenu() ).
- Added warn if you add duplicated or add a new command that exist.


=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB

Version + UPDATE'S
09-04-2025 Version 0.1.0 first release
21-04-2025 Vesion 1.0.0 BIG UPDATE

=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.

Download from itch
Updated with the Default official Main Menu layout
htmlMenu.gif


while its fully CSS styling, the gif is "hover", but you can make it "click" version
if you like.

while I don't have much time for different layouts at this point, you could share
your layout after CSS styling it nicely. (horizontal or vertically)

I would like to get your CSS style if you like to share yours with other.
DM the style and I put it on the DM to download (together with the GIF made on my end).

available later today on itch (all HTML plugins on 1 spot on itch).
htmlMenu is released, if any issues or bugs found, let me know =)

Show me your css styling as well when used or messed around with it.
updating the htmlMenu with new features.

- Add commands, and subs, but this time ENDLESS subcommands!!!
- Enable command, if a command in a sub is locked, it unlock each command in its path
- Disable command that is used, last in its path is disabled.
- Remove commands on its path, if first command and has subs, its destroy all of it!

this version is almost finished, old structure doesn't work and wont add backwards
combability to it as it can destroy more as the structure of it is changed too!.

as this update is massive, the CSS styling is changed too in some ways.
specially the subs to allow easy changing and even its depth subcommands effects!

Stay tuned for it, as its gonna be amazing update.

just need a few things to do.

auto detection on edge to swap direction (fail safe) you never know what you do!
css disable color fix to work correctly.
htmlMenuUpgrade.gif
htmlMenu.gif

Change Log:
This update is HUGE, and a pain!
- Change Structure built and able to save them Save Files!
- Added "id" which should be UNIQUE (with safe-guard to print out duplicated)
- Added "disabled" to easy disable the command.
- Altered AddMenuCmd to be more powerful for use!
- Added enableCmd(id) and will unlock EACH command in its path if nested.
- Added disableCmd(id) to disable 1 item with the ID
- Added removeCmd to remove the ID from the list.
- Added changeLabel(id, newName) to change it on the fly!
- Enhanced Debug just in case (html.debugMenu() ).
- Added warn if you add duplicated or add a new command that exist.

Soon updated, after helpfile (include css that is updated with all the changes made).
Plugin Updated to itch, if you use it, the structure is changed.
make sure you save your own, and alter to the new version correctly.

there might be another update, because of a oversight, by adding
new commands, this will be done this week, but the majority is working.

enjoy.

Original thread: https://forums.rpgmakerweb.com/threads/sdjb_htmlmenu.176794/