MV/MZ SDJB_htmlACP

PluginName: SDJB_htmlACP
Author: ShadowDragon


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

Version + UPDATE'S
5-09-2023 Version 0.1.0 first release
09-04-2025 Version 0.2.0 re-factored and streamlined

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

I added function for my SDJB_CheatEngine to make this work with it. so place this plugin on
the top of all other plugins.

This plugin adds a HTML Custom Alert, Confirm or Prompt box, which is better than default,
it should work in MZ, but I could not test it, but should not conflict with any plugin!

this plugin can be used as stand alone or be used in any plugin using the same setup
or through a parameter.

(when using as stand alone, it can be used in your own plugin using the same setup).

(see spoilers how they look like and are highly customisable)

Spoiler: Custom Alert, Confirm, Prompt
Alert box with no title and with title
AlertWindow.png


Confirm Window with custom OK and Cancel names.
ConfirmWindow.png


Custom Prompt window through event or by calling the CheatEngine
PromptWindow.png


When you click outside the window from Alert, Confirm or Prompt Box
WindowFocus.gif

There are 2 setups, basic setup and Advanced setup (choose what you want!)
Basic Setup


Spoiler: Basic Alert
Basic Alert consist of "title" and "message"
JavaScript:
acp.open({
   title: "Give it a title",
   message: "Your message to show in the window"
})

Basic Prompt require "type" as default is "Alert"
JavaScript:
acp.open({
   type: "Prompt",
   title: "Give it a title",
   message: "Your message to show in the window",
   onAccept: (value) => {
      $gameVariables.setValue(x, value)
      $gameMessage.add("your variable x is \\v[4].")
   }
})

Keep in mind that "Prompt" and "Confirm" require JS knowledge to fire the onAccept function.
the same apply for onCancel function (leave empty if nothing happens.

the entire setup if you wish to use looks like this:
JavaScript:
acp.open({
     type: "Alert",
     title: "Give it a title",
     message: "Your message to show in the window",
     headercolor: "#FF0000",
     okText: "OK",
     cancelText: "Cancel",
     onAccept: () => console.log("Your function when pressed on OK"),
     onCancel: () => console.log("Your function when pressed on Cancel")
 })

Download from itch

You see you can change the headercolor (Red in this case), but you can use "rbga(255, 0, 0, 0.4)"
the last number is opacity (alpha color). use 1 for fully opacity.
broken download from itch link
@Atria not broken, completely forgotten to activate for public, it should
work now, sorry for the inconvenience.
while working on my new plugin SDJB_htmlMenu, this plugin
is going be re-coded as well and more streamlined.

included 2 little bugs being fixed.

this plugins is updated soon, so if you use it, please update it.
CSS styling are the same and untouched.

however, this require a special plugin to be added, so it's also more streamlined
for future plugins similar to this, as it makes HTML content more streamlined
for anyone dealing with it and make it far cleaner to use 🙂

I just hope that the Input and keyDown is the same as MZ for this.
if not, please help me update the main plugin so it works correctly.
Good evening @ShadowDragon, just tumbled to this thread. Nice to see more and more plugins that utilizes HTML and CSS in RPG Maker. I have always wondered why they are not utilized more.

Keep up the good work mate!
I have always wondered why they are not utilized more.
most is core based, but while its HTML running, it might not run on mobile nicely.
but dealing with HTML DOM on the game as it up and down.

like context menu is popping up (I disabled that by default),
same for autocomplete and aria-autocomplete which I made a observer from it.

this should disable it for the anything.

as working around, nothing is really targetted inside the game or its core,
so you need to bypass it to make it work correctly ^^

as default prompt box = browser default (IE, FF, MOZ, Oprah, Chrome) use
their own, this one is your own style and can suit your game what works 🙂

color of image use, only by image, you cannot use the encrypted one, so you
have to replace it to png.

no idea how to deal with that though, but its fun creating though.

re-factored code of this one is 54 less lines of code, so really streamlined,
also the hacky way for input is cleaned up.
Link updated, together with the plugin + css file 🙂
let me know if there is any issues found.
Hello makers =)

in the upcoming week, a new small update will be pushed out.
if you use it, do not update it behind it, if you didn't use it yet.

there is a small change (this to keep my other html manipulations equal.
what's going to be new?

Name from SDJB_AlertConfirmPrompt => SDJB_htmlACP

acp.open(option) => htmlACP.open(options).

css file from: SDJB_AlertConfirmPrompt => SDJB_htmlACP

this will streamline my html plugins, so don't worry, everything behind
that are the same for usage 🙂

Original thread: https://forums.rpgmakerweb.com/threads/sdjb_htmlacp.160985/