Skip to content

urqw/multiplugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Multiplugin

Version from 2025-11-06 for UrqW 1.1.

A plugin for UrqW that adds the ability to use multiple plugins and connect them from separate files using a command from the URQL code.

The plugin allows you to add multiple separate .css and .js files to a game package, and then apply them individually at the desired time. This may be necessary if the standard UrqW plugin mechanism is not flexible enough to handle the required tasks, or if there is a need to split the plugin into separate physical files.

The following JavaScript functions are available for calling using the javascript system variable:

  • addCSS(stylePath, elementID) - Add styles from a file to the <style> element.
    • The stylePath parameter is the path to the style file within the game package, relative to the main .qst file. This is a required parameter.
    • The elementID parameter is the ID of the <style> element in which the styles from the file at stylePath will be added. This is an optional parameter. By default, styles are added to <style id="additionalstyle">.
    • Return value: 1 if the styles were successfully added, 0 if the styles were not added (e.g., an element with the specified ID already exists and is not a <style>).
  • delCSS(elementID) - Delete the <style> element and all its styles.
    • The elementID parameter is the ID of the <style> element to be deleted along with all its contents. This is an optional parameter. By default, the <style id="additionalstyle"> element will be processed, but it will be cleared rather than deleted.
    • Return value: 1 if the styles were successfully removed, 0 if the styles were not removed (e.g., an element with the specified ID does not exist or is not a <style>).
  • evalJS(scriptPath) - execute JavaScript code from a file.
    • The scriptPath parameter is the path to the file containing the JavaScript code within the game package, relative to the main .qst file. This parameter is required.
    • Return value: The result of executing the last command from the file.

Note: The contents of all files will be read in UTF-8 encoding.

The plugin and an example of its use can be found in the urqw directory. A demo of the plugin can be viewed at https://urqw.github.io/UrqW#multiplugin

For other UrqW plugins, see the common repository.

Be careful, though: not all UrqW plugins can be easily combined.

About

Plugin for UrqW.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published