Skip to content

For Developers

Bobuxstation edited this page Jan 27, 2024 · 15 revisions

Creating a custom game repository

Game repositories serve as JSON files for showcasing games on the market page, hosted online or locally. Customize your JSON game repository using our template. While bundling custom coal launcher clients is possible, note that source code modifications may be necessary. Extensions add features, while themes personalize the experience.

Games:

{
    "items":[{
            "name": "", //the name of your game
            "Version": 1, //the version of your game, will be used in a future update
            "developer": "", //the name of the game publisher
            "feed": "false", //a feed or wiki for your game, set to false if not used
            "info": "", //description of your game
            "banner": "", //url to game banner
            "download": "", //url to the html file of the game, only supports single html files at the moment
            "type": "html5" //starting version 1.1.4, coal launcher will require the game type
        }]
}

Game feed

The game feed allows you to put guide and information to your game page. Note that the game feed uses an iframe and may not be supported or even allowed on some website hosting services.

Supported game types

Starting version 1.1.4, coal launcher supports launching executable and flash games. Here are all the supported game types:

  • html5
  • flash
  • executable
  • link

Extensions:

{
    "name":"HorangHill", // The name of the extension
    "developer": "Horang Studios", // The developer
    "info":"Easily play HorangHill on coal launcher!", // Description
    "banner":"https://horanghill.web.app/css/horanghillstartingplace.png", // Banner Art
    "link":"https://horanghill.web.app", // The website the extension will show when it is opened
    "icon":"fa-solid fa-square-h", // Fontawesome icon for the extensions tab icon
    "type" : "extension" // The type
},

Creating your first extension

Extensions are seamlessly integrated into the launcher interface, featuring their dedicated tab for easy access. You can create one by using HTML, CSS, and JavaScript, you can create extensions that enhance user experience and functionality. Access the Coal API here to unlock the full potential of your extensions.

Themes:

{
    "name":"Ocean Breeze", // Theme name
    "developer": "ABSTUDIO", // Developer
    "info":"This theme uses cool, blue-green tones to create a calming, oceanic feel.", // Description
    "banner":"assets/abpattern.png", // Banner Art
    "link":"https://bobuxstation.github.io/Coal-Web/themes/Ocean Breeze.css", // Link To CSS
    "type" : "theme" // The type
},

Creating your own theme

Themes allow the launcher to have its own unique look. To make a theme for the launcher, you can follow the CSS template below. An easy way to make a theme for the launcher is to use the built-in DevTools of the launcher and start experimenting!

/* The theme template for Coal-Launcher */

:root {
    /* Basic UI */
    --mainBackground: #1d1d1d;
    --mainTextColor: #ffffff;
    --navigationBackground: #2d2d2dee;
    --gameCardBackground: #1d1d1ddd;
    --defaultUIBorder: #4d4d4d;
    --gameCardTextShadow: #00000000;
    --mainBackgroundImage: url('../assets/abpattern.png');
    --mainFontFamily: Inter;

    /* Other UI Elements */
    --coalUIButton: #4d4d4d90;
    --coalUIButtonBorder: #5d5d5d90;

    --coalUIButtonHover: #5d5d5d90;

    --coalUIButtonActive: #3d3d3d;
    --coalUIButtonBorderActive: #5d5d5d;

    --sidebarNavigationButtonHover: #4d4d4d;
}

HTML5 player & extension API

Starting version 1.3.3, coal launcher has added an API for adding games, game providers, achievements or spawning a HTML5/Flash player from an extension or a player.

coalAPI.newMedal

coalAPI.newMedal({
    "game": String, 
    "title": String, 
    "desc": String, 
    "banner": String
})

A function to give an achievement to the player, stored on the achievement tab. (supported in both player and extensions)

game : Name of the game

title : Title of the achievement

desc : Description of the achievement

banner: Banner image URL

coalAPI.spawnPlayer

coalAPI.spawnPlayer({
    name: String,
    dir: String,
    banner: String
})

A function to spawn a HTML5 player window. (Supported only by extensions)

name : Name of the game

dir : URL to the website/HTML file

banner: Banner image URL

coalAPI.spawnFlashPlayer

coalAPI.spawnFlashPlayer({
    name: String,
    dir: String,
    banner: String
})

A function to spawn a Flash player window. (Only supports loading from websites, Supported only by extensions)

name : Name of the game

dir : URL to the SWF file

banner: Banner image URL

coalAPI.addProvider

coalAPI.addProvider({
    name: String,
    JSONDir: String
})

A function to add a game repository. (Supported only by extensions)

name : Name of the game repository

JSONDir : URL to the JSON file

coalAPI.addGame

coalAPI.addGame({
    name: String,
    feed: String,
    ver: Int,
    dev: String,
    banner: String,
    dir: String,
    type: String
})

A function to add a game. (Supported only by extensions)

name : Name of the game

feed : URL to the website/HTML file. refer to Game feed for more information

ver : Version of the game

dev : Developer name

banner : Banner image URL

dir : URL to the website/HTML file

type : type of the game. refer to Supported game types for more information