MajorVictory

Whetstone Theme Register - Draft 0.3

Sep 16th, 2020
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hooks.once('WhetstoneReady', () => {
  2.     console.log('Whetstone | Ready');
  3.  
  4.      game.Whetstone.themes.register('Whetstone', {
  5.         id: 'OceanBlues',
  6.         name: 'OceanBlues',
  7.         title: 'Ocean Blues',
  8.         description: 'An example Style for Whetstone with static colors',
  9.         version: '1.0.0',
  10.         authors: [{ name: 'MajorVictory', contact: 'https://github.com/MajorVictory', url: 'https://github.com/MajorVictory' }],
  11.         styles: ['modules/Whetstone/styles/OceanBlues.css'],
  12.         variables: [
  13.             {
  14.                 name: '--OceanBlues-bg-color',
  15.                 title: 'Background Color',
  16.                 hint: 'Used in sheet headers, tinges the background.',
  17.                 value: '#3d5a80', type: 'color', presets: 'palette'
  18.             },
  19.             {
  20.                 name: '--OceanBlues-text-light-color',
  21.                 title: 'Text Color - Light',
  22.                 hint: 'Used for text on dark background.',
  23.                 value: '#98c1d9', type: 'color', presets: 'palette'},
  24.             {
  25.                 name: '--OceanBlues-text-dark-color',
  26.                 title: 'Text Color - Dark',
  27.                 hint: 'Used for text on light backgrounds.',
  28.                 value: '#102632', type: 'color', presets: 'palette'},
  29.             {
  30.                 name: '--OceanBlues-text-highlight-color',
  31.                 title: 'Text Highlight Color',
  32.                 hint: '',
  33.                 value: '#72b9d5', type: 'color', presets: 'palette'},
  34.             {
  35.                 name: '--OceanBlues-text-selection-color',
  36.                 title: 'Text Selection Color',
  37.                 hint: '',
  38.                 value: '#b0c2bd', type: 'color', presets: 'palette'},
  39.             {
  40.                 name: '--OceanBlues-fg-color',
  41.                 title: 'Foreground Color',
  42.                 hint: 'Used for textboxes and input fields',
  43.                 value: '#e0fbfc', type: 'color', presets: 'palette'},
  44.             {
  45.                 name: '--OceanBlues-highlight-color',
  46.                 title: 'Highlight Color',
  47.                 hint: 'Used for highlighter colro when hovering over hyperlinks or interface elements.',
  48.                 value: '#ee6c4d', type: 'color', presets: 'palette'},
  49.             {
  50.                 name: '--OceanBlues-border-color',
  51.                 title: 'Border Color',
  52.                 hint: '',
  53.                 value: '#293241', type: 'color', presets: 'palette'},
  54.             {
  55.                 name: '--OceanBlues-padding',
  56.                 title: 'Text Value Entry',
  57.                 hint: 'This option is used to text the text value input control',
  58.                 value: '4px', type: String}
  59.         ],
  60.         presets: {
  61.             palette: {
  62.                 '#3d5a80': 'Bdazzled Blue',
  63.                 '#98c1d9': 'Pale Cerulean',
  64.                 '#102632': 'Charcoal',
  65.                 '#72b9d5': 'Dark Sky Blue',
  66.                 '#b0c2bd': 'Opal',
  67.                 '#e0fbfc': 'Light Cyan',
  68.                 '#ee6c4d': 'Burnt Sienna',
  69.                 '#293241': 'Gunmetal'
  70.             }
  71.         },
  72.         dialog: '',
  73.         config: '',
  74.         img: 'modules/Whetstone/images/Whetstone-thumb.png',
  75.         preview: 'modules/Whetstone/images/OceanBlues-preview.png',
  76.         dependencies: {},
  77.         systems: { 'core': '0.6.6' },
  78.         compatible: {},
  79.         conflicts: {}
  80.     });
  81.  
  82.     // Register that this theme has a menu
  83.     // WhetstoneThemeConfigDialog is provided by Whetstone core
  84.     game.Whetstone.settings.registerMenu('Whetstone', 'OceanBlues', {
  85.         name: game.i18n.localize('WHETSTONE.Config'),
  86.         label: game.i18n.localize('WHETSTONE.ConfigTitle'),
  87.         hint: game.i18n.localize('WHETSTONE.ConfigHint'),
  88.         icon: 'fas fa-paint-brush',
  89.         type: WhetstoneThemeConfigDialog,
  90.         restricted: false
  91.     });
  92.  
  93.     // Register that this theme's config storage value
  94.     // WhetstoneThemeConfig is provided by Whetstone core
  95.     game.Whetstone.settings.register('Whetstone', 'OceanBlues', {
  96.         name: game.i18n.localize('WHETSTONE.Config'),
  97.         scope: 'client',
  98.         default: WhetstoneThemeConfig.getDefaults,
  99.         type: Object,
  100.         config: false,
  101.         onChange: settings => {
  102.             WhetstoneThemeConfig.apply(settings);
  103.         }
  104.     });
  105. });
Add Comment
Please, Sign In to add comment