Coder Social home page Coder Social logo

ambersteel-foundryvtt's People

Contributors

codewringer avatar

Watchers

 avatar

ambersteel-foundryvtt's Issues

Ensure skill abilities are always 'proper' objects

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.

Fate-Card Limiting

Prevent adding more fate-cards, once limit is reached.
OR
Show a warning that the limit was exceeded.

Show composition and rules for any derived actor fields

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.

Enable picking up items from chat

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.

Cannot change any item image/icon

Two possible solutions:

  1. Use FoundryVTT's way of changing the image. This handles a file browser and pushing changes to the db.
    In their current form, fate-cards do not support this system, yet. How to change that has to be researched.
  2. Use Ambersteel's input component. This would require implementing a file browser or better, calling FoundryVTT's file browser, somehow.

Make debug dependent on build settings.

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.

Inline-rolling on sheets

A roll-result automatically replaces the button to roll.
This implies firing an update event on the underlying data property.

Input and property update logic is convoluted - clean it up

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.

Character Assets Tab

  • Item slot system
    • General
      • Items will only be added to the grid, if they can fit on it.
      • Test, on instantiation, if all items can still fit on grid.
        • Drop items that can no longer fit and notify the user.
      • Synchronize changes to the grid owner (actor)
        • Whenever an item is added to the grid or removed from it or moved on it.
          • Already implicitly handled, because changing any actor property or adding/removing items triggers a re-render.
      • If properties of an item have been edited, like its width or height, a test will have to be run again, to test whether the item can still fit on the grid.
    • Adding items
      • X Drag & drop onto canvas
        • From compendium or items directory.
        • X Prevent addition, if item couldn't be fit on grid.
          • X Display a warning for the user.
      • From property list
        • Via a button.
        • Remove from property list.
        • Prevent addition, if item couldn't be fit on grid.
          • Display a warning for the user.
      • From chat
        • Via a button.
        • X Remove button from chat message.
        • Prevent addition, if item couldn't be fit on grid.
          • X Display a warning for the user.
    • Removing items
      • By moving to property list
      • X By sending to chat
        • X Query who will be able to pick up -"nobody", "everyone" or (a) specific player(s).
      • By deletion
    • Moving items on grid
      • Validation of target location and rotation
        • Overlap is not allowed, unless if the overlapped items are completely enveloped by the item being moved.
        • Going past the edges of the grid is not allowed
      • Show a drag move indicator
        • Shows a symbol and a red outline, if the target location and rotation are not valid.
        • Shows no symbol and a green outline, if the target location and rotation are valid.
    • Editing items on grid
      • For now, it will suffice to open the item sheet and allow edits there.
    • Owned assets (not on person)
      • As a list
      • Adding
      • Removing
      • Updating

Add icons to list-item templates

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.

Make skill ability list visibility persistent

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.

Rules compendium/journal

  • Create rules compendium/journal for easy in-app lookup of the rules
  • Add context-dependent help buttons which link to specific rule-sections

Register key to rotate item on item grid to FoundryVTT's key map

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,
    });
}

Show dice composition on skill roll

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 message visibility option 'scene'

Add an option to all chat message functionality to only send to all others viewing the current scene.

  1. Grab the current user's game.user.viewedScene
  2. Loop through game.users looking at each one's viewedScene for matches
  3. Send a whispered message to the list of users who are viewing that scene currently

Make SkillAbility content dynamic

Refactor SkillAbility so it supports dynamically settable content.

Default content (= every SkillAbility has this):

  • Level
  • AP Cost
  • Description

Optional content (0:1 instance):

  • Ob
  • OpposedBy
  • Condition
  • Distance
  • AttackType

Optional content (0:n instance):

  • Damage + DamageType

Add ContextMenu to actor sheet

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);

Save version in world and support migrations

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,
});

Enable drag & drop onto item grid

When dragging an item onto an opened ItemGrid, attempt to fit it into the grid.

  • Make sure to track where on the grid the item was dropped and then prefer placing it there, but if that is not possible, instead place it on the nearest viable slot.
  • Make sure that an item can only be added to the grid, if it can at all fit onto it. If an item can't fit, add it to the property list, instead and display a warning that the item grid is full.

Add means of linking documents

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:

  • Injury & illness treatment skill
  • Skill ability 'opposed by' field

Chat messages don't register click events

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.