Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ export const WALLPAPERS: IWallpaperConfig[] = [
/**
* TODO: Maybe include (sub)cathegories (Already included in name [0])
*/
c;
13 changes: 9 additions & 4 deletions src/interfaces/IWallpaperConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import {
string_url_image,
} from '@collboard/modules-sdk';

export interface IWallpaperConfig {
// !!! To maker file

export interface IWallpaperConfig /* !!! Extends IModuleManifest*/{
/* !!! Remove
/**
* Unique name of the wallpaper in a module name
*/
* /
name: string;

/**
Expand All @@ -20,14 +23,16 @@ export interface IWallpaperConfig {

/**
* Title to display in the UI and module store
*/
* /
title: IStringMessage;

/**
* Description to display in the module store
*/
* /
description: IStringMessage;

*/

/**
* Source of the wallpaper
*/
Expand Down
69 changes: 69 additions & 0 deletions src/makers/makeBackgroundWallpaperModule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { BackgroundWallpaperArt, IModuleDefinition, IModuleManifest, ISystems } from '@collboard/modules-sdk';
import { IWallpaperConfig } from '../interfaces/IWallpaperConfig';

/**
* Makes a module which places a wallpaper
*
*/
export function makeBackgroundWallpaperModule(
wallpaperModuleManifest: IModuleManifest & IWallpaperConfig,
): IModuleDefinition {
const { manifest, place, order, createElement } = wallpaperModuleManifest;

return {
manifest: wallpaperModuleManifest,
async setup(systems: ISystems) {
const { virtualArtVersioningSystem } = await systems.request('virtualArtVersioningSystem');

return virtualArtVersioningSystem
.createPrimaryOperation()
.newArts(new BackgroundWallpaperArt(wallpaperModuleManifest.src))
.persist();
},
};
}

/*


{
manifest: {
name: `${packageName}/space`,
version,
deprecatedNames: 'SpaceBackground',
title: { en: 'Space', cs: 'Vesmír' },
description: { en: 'Changes white background to space.', cs: 'Vymění bílé pozadí za vesmírné.' },

categories: [
'Wallpaper',
'Geography',
'Space',
'Education' /* Not template because to user do not seem so * /,
],
icon: '🌌', // TODO: Icon because other planets than Earth and Moon do not have emoji icon
screenshots: [
/*TODO:* /
],
author: Authors.hejny,
},

async setup(systems) {

},
}











*/

/**
* TODO: Should makers recieve object with manifest OR extended manifest?
*/