codewringer / ambersteel-foundryvtt Goto Github PK
View Code? Open in Web Editor NEWAmbersteel system for FoundryVTT
License: MIT License
Ambersteel system for FoundryVTT
License: MIT License
Currently, all data handling of a skill ability object is handled through its parent skill item. Ideally, this would be refactored, so that the templates and the code can work with the skill ability object, directly.
In order to do so, during initialization of skill items (embedded or otherwise), all skill abilities (found in <skill item instance>.data.data.abilities
) must be converted into SkillAbility
objects. Also, the SkillAbility
class must provide:
update
method which updates the skill ability on its parent skill item.delete
method which deletes the skill ability from its parent item.sendToChat
and getChatData
, which allow sending the skill ability to chat.Change template to turn <table>
into <ol>
Prevent adding more fate-cards, once limit is reached.
OR
Show a warning that the limit was exceeded.
Currently, when an item's shape changes or the number of item slots on the item grid is reduced far enough, items are dropped, automatically. The process works, but under the hood, multiple re-renders appear to occur. Possibly once for every item dropped.
Ideally, there would only ever be one update.
For example, many of the input components still register a helper that can instantiate their view model. These helpers are no longer in use and can probably be safely removed.
Ideally, this should be a small pop-up window or a hover-tooltip which shows up when the read-only value field is clicked.
In the pop-up, a short explanation of how the total came to be and a list of the sourced values should be displayed.
The dialog should specify the type of and name of item or actor being deleted. For example: "Delete skill 'Acrobatics'?"
When items are sent to chat, the user sending the item should be prompted for whether anyone else may pick the item up. Note: By default, no one should be selected.
It should be possible to select multiple other users. Make sure to only include users who own an actor.
Upon sending the item, it should be removed from the source (item grid).
Enforcing that only one recipient can pick the item up would be fairly complex to implement, for very little benefit. Players shouldn't cheat and while the software can enforce rules fairly strictly, this doesn't mirror the trust-relationship of an in-person game. A player who decides to pick an item up a lot more times than allowed by their GM, is going to be difficult, regardless of software.
Add inputs to the health tab that allow tracking current and maximum magic stamina.
Too many classes rely on global constants - make those inject-able, instead.
Two possible solutions:
For a debug build, game.ambersteel.debug should be set to true.
For a production build, game.ambersteel.debug should be set to false. Or perhaps that could could be stripped from production code, altogether.
A roll-result automatically replaces the button to roll.
This implies firing an update event on the underlying data property.
Ideally, the object to edit would be passed to the input component, instead of its host.
For example, in order to change properties of an embedded document (e. g. a 'skill'), the owning actor and the embedded document's id are passed to the input component. This is a confusing step of indirection, which shouldn't be necessary.
Ideally, the embedded document (= the skill) would be passed directly to the input component.
Currently, an item's icon is shown both on its dedicated item sheet, as well as on its chat message. It is, however, missing from its list-item variant. Add the icon that variant. Ideally, the icon could also be editable.
Change template to turn <table>
into <ol>
For example, when changing any property of a skill ability, the sheet will reload and the list of skill abilities will be collapsed, again. Instead, the view state should be retained, meaning that after a reload, the skill ability list should be in whatever state it was before the reload.
For example, a deletion button's title (tooltip) should say "Delete skill ability 'Wind out of it'", instead of "Delete".
Replace all references to property-utility#isObject with validation-utility#isObject and then delete the method from property-utility.
Only an 'owner' is allowed to use these buttons.
When pressing 'r', the currently dragged item on the item grid is rotated. The key is currently hard-coded, but should be configurable, instead.
The following code snippet might help.
function registerSystemSettings() {
/* Register the settings for the system. */
/* Setup how damage types are to be handled. If Simple is selected, each weapon defaults
to their highest value. */
game.settings.register("cd10", "systemDamageTypes", {
config: true,
scope: "world",
name: "SETTINGS.damageTypes.name",
hint: "SETTINGS.damageTypes.label",
type: String,
choices: {
"simple": "Single damage type",
"standard": "Slash, Blunt, Pierce",
"complex": "Slash, Blunt, Pierce, Energy"
},
default: "b",
});
game.settings.register("cd10", "systemModernity", {
config: true,
scope: "world",
name: "SETTINGS.modernity.name",
hint: "SETTINGS.modernity.label",
type: Boolean,
default: false,
});
}
When clicking the button, the respective skill's sheet should open.
When rolling a skill, some dice come from the related attribute, on top of the dice for the skill itself.
Currently, only the total number of dice rolled is displayed in a dice roll result. Change it so it displays how that total came to be.
E.g.:
Number of dice: 6 (2 from agility, 3 from acrobatics, 1 bonus)
Add an option to all chat message functionality to only send to all others viewing the current scene.
game.user.viewedScene
game.users
looking at each one's viewedScene
for matchesThe wrong template and view model seem to be being sent to chat.
Refactor SkillAbility so it supports dynamically settable content.
Default content (= every SkillAbility has this):
Optional content (0:1 instance):
Optional content (0:n instance):
Show respective context menus on right click on items.
See also: https://foundryvtt.com/api/ContextMenu.html
/**
* @type {ContextMenu}
* @private
*/
_contextMenu = undefined;
// Show
this._contextMenu.render(this.element);
// Hide
this._contextMenu.close({ animate: true });
// In activateListeners
const menuItems = [{
name: "a localized text",
icon: "either an empty string, or an icon element in raw HTML",
condition: () => { return true; }, // If this returns true, the menu item will be visible.
callback: () => { doStuff(); } // The actual callback that gets invoked when the menu item is clicked.
}];
this._contextMenu = new ContextMenu(html, this.id, menuItems);
The game settings might be usable for this:
game.settings.register("wod", "worldVersion", {
name: "World Version",
hint: "Used to know if World patch is needed",
scope: "world",
config: true,
default: "1",
type: String,
});
When dragging an item onto an opened ItemGrid, attempt to fit it into the grid.
The 'plus' icon should be centered and about twice as large. Also, an entire empty fate-card area should be clickable.
The current text field input should be replaced with a read-only field displaying the name of the linked document.
Next to the name should be a button that opens the sheet of the linked document. This button should be disabled, if there is no linked document yet defined.
Additionally, in edit mode:
Next to the name should be a button that opens a dialog. The user can then select a document from the dialog. The selected skill is then set as the linked document.
For use in:
In order to solve this one, chat messages each need to be assigned a view model and its activateListeners
must be invoked.
On that view model, a view model collection may be necessary, in order to be able to register buttons and input components.
The difficulty lies in re-instantiating the view models as necessary (for example, after a page re-load), because at that point the existing view models are purged and the data originally used to create them is no longer easily accessible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.