Skip to content

Commit

Permalink
[ V1.0 ] First public release
Browse files Browse the repository at this point in the history
[ V1.0 ] First public release
First release of DBM-Extended actions, if you find any bugs please open an issue report.
Unlike DBM-Network, we will accept new mods even if they are modified versions of default actions or events, so you are welcome to make a pull request to add them into this repository.

We will accept any kind of improvements to the mods, this includes visual enhancements!
There are more to be released.
  • Loading branch information
Giingu authored May 22, 2022
1 parent 65c63ab commit 449bb18
Show file tree
Hide file tree
Showing 19 changed files with 3,850 additions and 0 deletions.
135 changes: 135 additions & 0 deletions actions/action_anchor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
module.exports = {
//---------------------------------------------------------------------
// Action Name
//
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Action Anchor",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "Other Stuff",

//---------------------------------------------------------------------
// Action Subtitle
//
// This function generates the subtitle displayed next to the name.
//---------------------------------------------------------------------

subtitle(data, presets) {
return data.description
? `<font color="${data.color}">${data.description}</font>`
: `Create ${
data.anchor_id
? `the "<font color="${data.color}">${data.anchorName}</font>" anchor at the current position!`
: 'an anchor!'
}`;
},

//---------------------------------------------------------------------
// Action Meta Data
//
// Helps check for updates and provides info if a custom mod.
// If this is a third-party mod, please set "author" and "authorUrl".
//
// It's highly recommended "preciseCheck" is set to false for third-party mods.
// This will make it so the patch version (0.0.X) is not checked.
//---------------------------------------------------------------------

meta: { version: "2.1.2", preciseCheck: true, author: "DBM Extended", authorUrl: "https://github.com/DBM-Extended/mods", downloadURL: "https://github.com/DBM-Extended/mods/tree/main/actions/action_anchor.js" },

//---------------------------------------------------------------------
// Action Fields
//
// These are the fields for the action. These fields are customized
// by creating elements with corresponding IDs in the HTML. These
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: ["anchorName", "color", "description"],

//---------------------------------------------------------------------
// Command HTML
//
// This function returns a string containing the HTML used for
// editing actions.
//
// The "isEvent" parameter will be true if this action is being used
// for an event. Due to their nature, events lack certain information,
// so edit the HTML to reflect this.
//---------------------------------------------------------------------

html(isEvent, data) {
return `
<span class="dbminputlabel">Anchor Name</span><br>
<input id="anchorName" class="round" type="text">
<div style="float: left; width: 24%;">
Anchor Color:<br>
<input type="color" id="color"><br>
</div>
<div>
<div style="float: left; width: 98%;">
Description:<br>
<input type="text" class="round" id="description">
</div>
</div>`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
this.callNextAction(cache);
},

//---------------------------------------------------------------------
// Action Bot Mod Init
//
// An optional function for action mods. Upon the bot's initialization,
// each command/event's actions are iterated through. This is to
// initialize responses to interactions created within actions
// (e.g. buttons and select menus for Send Message).
//
// If an action provides inputs for more actions within, be sure
// to call the `this.prepareActions` function to ensure all actions are
// recursively iterated through.
//---------------------------------------------------------------------

modInit(data, customData, index) {
if (!customData.anchors) {
customData.anchors = {};
}
customData.anchors[data.anchorName] = index;
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
132 changes: 132 additions & 0 deletions actions/action_container_color_comment_MOD.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
module.exports = {
//---------------------------------------------------------------------
// Action Name
//
// This is the name of the action displayed in the editor.
//---------------------------------------------------------------------

name: "Action Container",

//---------------------------------------------------------------------
// Action Section
//
// This is the section the action will fall into.
//---------------------------------------------------------------------

section: "Other Stuff",

//---------------------------------------------------------------------
// Action Subtitle
//
// This function generates the subtitle displayed next to the name.
//---------------------------------------------------------------------

subtitle(data, presets) {
return `<font color="${data.color}">${data.comment}</font>`;
},

//---------------------------------------------------------------------
// Action Meta Data
//
// Helps check for updates and provides info if a custom mod.
// If this is a third-party mod, please set "author" and "authorUrl".
//
// It's highly recommended "preciseCheck" is set to false for third-party mods.
// This will make it so the patch version (0.0.X) is not checked.
//---------------------------------------------------------------------


meta: { version: "2.1.2", preciseCheck: true, author: "DBM Extended", authorUrl: "https://github.com/DBM-Extended/mods", downloadURL: "https://github.com/DBM-Extended/mods/tree/main/actions/action_container_color_comment_MOD.js" },

//---------------------------------------------------------------------
// Action Fields
//
// These are the fields for the action. These fields are customized
// by creating elements with corresponding Ids in the HTML. These
// are also the names of the fields stored in the action's JSON data.
//---------------------------------------------------------------------

fields: ["comment", "actions", "color"],

//---------------------------------------------------------------------
// Command HTML
//
// This function returns a string containing the HTML used for
// editing actions.
//
// The "isEvent" parameter will be true if this action is being used
// for an event. Due to their nature, events lack certain information,
// so edit the HTML to reflect this.
//
// The "data" parameter stores constants for select elements to use.
// Each is an array: index 0 for commands, index 1 for events.
// The names are: sendTargets, members, roles, channels,
// messages, servers, variables
//---------------------------------------------------------------------

html(isEvent, data) {
return `
<div>
Text Color:<br>
<input type="color" id="color" value="#f2f2f2"></div>
Comment<br>
<input id="comment" class="round" type="text">
</div>
<br><br>
<action-list-input id="actions" height="calc(100vh - 345px)"></action-list-input>`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
const data = cache.actions[cache.index];
const actions = data.actions;
this.executeSubActionsThenNextAction(actions, cache);
},

//---------------------------------------------------------------------
// Action Bot Mod Init
//
// An optional function for action mods. Upon the bot's initialization,
// each command/event's actions are iterated through. This is to
// initialize responses to interactions created within actions
// (e.g. buttons and select menus for Send Message).
//
// If an action provides inputs for more actions within, be sure
// to call the `this.prepareActions` function to ensure all actions are
// recursively iterated through.
//---------------------------------------------------------------------

modInit(data) {
this.prepareActions(data.actions);
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
96 changes: 96 additions & 0 deletions actions/anchor_create_MOD.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
module.exports = {
name: 'Create Anchor',
section: 'Other Stuff',

meta: { version: "2.1.2", preciseCheck: true, author: "DBM Extended", authorUrl: "https://github.com/DBM-Extended/mods", downloadURL: "https://github.com/DBM-Extended/mods/tree/main/actions/anchor_create_MOD.js" },

subtitle(data) {
return data.description
? `<font color="${data.color}">${data.description}</font>`
: `Create ${
data.anchorName
? `the "<font color="${data.color}">${data.anchorName}</font>" anchor at the current position!`
: 'an anchor!'
}`;
},

fields: ['anchorName', 'color', 'description'],

html() {
return `
<div>
<p>
<u>Mod Info:</u><br>
This mod creates an anchor point for you to jump to without<br>
having to edit other jumps or skips.
</p>
</div><br>
<div style="float: left; width: 74%;">
Anchor Name:<br>
<input type="text" class="round" id="anchorName"><br>
</div>
<div style="float: left; width: 24%;">
Anchor Color:<br>
<input type="color" id="color"><br>
</div>
<div>
<div style="float: left; width: 98%;">
Description:<br>
<input type="text" class="round" id="description">
</div>
</div>`;
},

//---------------------------------------------------------------------
// Action Editor Init Code
//
// When the HTML is first applied to the action editor, this code
// is also run. This helps add modifications or setup reactionary
// functions for the DOM elements.
//---------------------------------------------------------------------

init() {},

//---------------------------------------------------------------------
// Action Bot Function
//
// This is the function for the action within the Bot's Action class.
// Keep in mind event calls won't have access to the "msg" parameter,
// so be sure to provide checks for variable existence.
//---------------------------------------------------------------------

action(cache) {
this.callNextAction(cache);
},

//---------------------------------------------------------------------
// Action Bot Mod Init
//
// An optional function for action mods. Upon the bot's initialization,
// each command/event's actions are iterated through. This is to
// initialize responses to interactions created within actions
// (e.g. buttons and select menus for Send Message).
//
// If an action provides inputs for more actions within, be sure
// to call the `this.prepareActions` function to ensure all actions are
// recursively iterated through.
//---------------------------------------------------------------------

modInit(data, customData, index) {
if (!customData.anchors) {
customData.anchors = {};
}
customData.anchors[data.anchorName] = index;
},

//---------------------------------------------------------------------
// Action Bot Mod
//
// Upon initialization of the bot, this code is run. Using the bot's
// DBM namespace, one can add/modify existing functions if necessary.
// In order to reduce conflicts between mods, be sure to alias
// functions you wish to overwrite.
//---------------------------------------------------------------------

mod() {},
};
Loading

0 comments on commit 449bb18

Please sign in to comment.