Skip to content

Instantly share code, notes, and snippets.

@zeel01
zeel01 / proposal.md
Last active March 8, 2022 04:22
Placeable Rendering Abstraction Proposal

Placeable Abstractions

Rationale

Presently the PlaceableObject class is the direct ancestor of all scene-placeable objects. In order to create a new placeable, one must either inherit from PlaceableOject and implement all of the rendering methods, or inherit from an existing type of object and prune away parts of its functionality that are not needed.

In the first approach, the developer must have a firm grasp of PIXI/canvas programming in order to produce useful results, or they may copy large portions of Core code and modify it to suit their needs. In the second, the developer surrenders basically all control of how rendering is done and simply creates a new kind of "Tile" or "Token" with slightly different features.

In issue #6475 it is proposed that a new kind of canvas layer be introduced which does not require a document in order to function. Along with that, it would be wonderful to have a set of flexible abstractions for PlaceableObjects in order to implement more customized objects wit

@zeel01
zeel01 / animation-test.md
Last active September 17, 2022 13:30
WebP Animation Test

WebP Animation Test

Butterfly

@zeel01
zeel01 / LICENSE
Last active June 7, 2021 21:56
Pride CSS
MIT License
Copyright (c) 2019 Verbond van Klei-etende Autisten
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@zeel01
zeel01 / basic-doc.md
Last active April 26, 2021 17:10
Basic Document Proposal

Basic Document

Introduce a new document type, BasicDocument which implements Document along with a BasicDocumentData which implements DocumentData. The new BasicDocument would funtion like any other document, however it would not poses any special-purpose properties. Instead, its primary purpose would be to contain a flags property into which arbitrary data is stored.

The primary thing that would set BasicDocument apart from other Document types, is that it would be inaccessible to the end-user. There would be no sidebar tab for BasicDocuments, and compendiums of this type would not appear in the user interface.

Rationale

At the moment in order for a module to store its own data it must do so either within a game setting, or within the flags of some existing Document. This is fine for modules like character sheets which store data on an Actor. However, many modules have a need for data storage that doesn't fit well into any of the existing document types.

It's not uncommon for modules

@zeel01
zeel01 / container-queries.md
Last active April 21, 2021 16:08
SWADE "Container Queries" Plan

Container Queries

Provide a means to adjust sheet layout based on the sheet's current size by means of specially named classes applied to the application.

Implementation

Add a new intermediary class:

class SwadeActorSheet extends ActorSheet
@zeel01
zeel01 / custom-css-props.md
Last active April 16, 2021 21:58
Custom CSS Properties Proposal

Implement Custom CSS Properties in the Foundry Core stylesheet.

Rationale

It is common that a system developer, module developer, or user may wish to make minor changes to the over-all Foundry UI. This may be personal preference, or to evoke a certain feel for a given system or setting. However, it can be intimidating and challenging to make even simple changes to override the Core CSS. An excellent example would be a user that isn't a big fan of orange, as a test I wrote a custom stylesheet to replace all the orange and red in the Foundry UI with blue instead. This requires 120 lines of CSS to replace the 24 case of the color #ff6400 and numerous accompanying cases of red. And in doing so, there are new many many border and shadow styles being re-declaired, meaning that future changes to the Core codebase could conflic with this custom style in unanticipated ways, or result in new instances of the orange color that will need to be dealt with.

This proposal seeks to address these issues making it

@zeel01
zeel01 / module.json
Last active April 8, 2021 03:14
Invalid Manifest
{
"name": "module",
"scripts": "ascript.js",
"author": "zeel",
"authors": "zeel",
"packs": [{
"module": "module-name"
}]
}
@zeel01
zeel01 / subgrids.js
Last active September 6, 2020 05:08
Subgrids
/**
* @example
* let theBoat = startBoat(2000, 3000, 1000, 1000, 140)
* theBoat.addObject(_token)
* theBoat.sailTo(1900, 2400)
* theBoat.pullObjects()
*/
/**
* Main class for Sub Grids
@zeel01
zeel01 / MyForm.js
Last active September 6, 2020 02:04
Form Application
class MyForm extends FormApplication {
constructor(chatMSG, ...args) {
super(...args);
this.chatMSG = chatMSG;
}
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ['form'],
popOut: true,
@zeel01
zeel01 / languageCounter.js
Last active August 2, 2020 21:27
FVTT Module Language Support Counter
// This script can be used to generate an HTML list of modules that support localization
// each entry will have a list of transalations, and each translation will indicate
// how many strings are defined within. For translations that appear to be missing
// strings, a list of missing strings will be created.
//
// It is recommended that you pipe the output of this script into an HTML file to
// be viewed in your browser.
//
// Thanks to KaKaRoTo for his help on this