Coder Social home page Coder Social logo

labystudio / desktopmodules Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 0.0 1.37 MB

DesktopModules is an application to create overlays like a Spotify track display for your operating system or games.

Java 100.00%
overlays addons modding modding-framework overlayed-app api

desktopmodules's Introduction

DesktopModules

DesktopModules is an application that allows you to create overlays for your operating system.
The modules are displayed over all your programs and games and are freely movable.

preview

Available Addons

Feel free to add your addons!

Installation

  1. Make sure you have Java 16 installed.
  2. Download the latest executable file here.
  3. Execute the DesktopModules.exe
  4. Right-click the DesktopModules tray icon in your task bar and click on Open addons directory
  5. Place your addon jars in the opened directory (C:/Users/<name>/AppData/Roaming/DesktopModules/addons/)
  6. Close the DesktopModules application. (Right-click the tray icon -> Exit)
  7. Execute the DesktopModules.exe again to load all addons

Settings

You can left-click on the tray icon to manage your installed addons.
You can exit the application by right-clicking the tray icon and selecting "Exit"

settings

Create your own addon

Setup gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.LabyStudio:desktopmodules:2.5.5:all'
}

Setup your code

The main class of your addon. You have to register your modules in the onEnable method.

import de.labystudio.desktopmodules.core.addon.Addon;

public class TestAddon extends Addon {

    @Override
    public void onInitialize() throws Exception {
        // Config example
        if (!this.config.has("flag")) {
            this.config.addProperty("flag", true);

            System.out.println("This addon started for the first time. My config can remember that!");
        }

        // Another config example with default values
        String startupMessage = getConfigValue(this.config, "startup_message", "Hello World!");
        System.out.println(startupMessage);
        
        // Register your modules
        registerModule(TestModule.class);
    }

    @Override
    public void onEnable() {
        // Called when at least one module of the addon activates
        System.out.println("Test addon enabled!");
    }

    @Override
    public void onDisable() {
        // Called when all modules of the addon are disabled
        System.out.println("Test addon disabled!");
    }
}

You can create multiple modules for one addon

import de.labystudio.desktopmodules.core.addon.Addon;
import de.labystudio.desktopmodules.core.loader.TextureLoader;
import de.labystudio.desktopmodules.core.module.Module;
import de.labystudio.desktopmodules.core.module.render.IModuleRenderer;
import de.labystudio.desktopmodules.core.renderer.IRenderContext;

import java.awt.*;
import java.awt.image.BufferedImage;

public class TestModule extends Module<TestAddon> {

    private BufferedImage testTexture;

    public TestModule() {
        super(250, 60); // The fixed size of the module
    }

    @Override
    public void onTick() {
        // Do backend stuff..
    }

    @Override
    public void onRender(IRenderContext context, int width, int height) {
        context.drawRect(0, 0, width - 1, height - 1, new Color(50, 50, 50, 130));
        context.drawImage(this.testTexture, 0, 0, height, height);

        // Render your module...
    }
    
    @Override
    public void loadTextures(TextureLoader textureLoader) {
        this.testTexture = textureLoader.loadTexture("textures/test/test.png"); // Load a texture
    }
    
    @Override
    protected String getIconPath() {
        return "textures/test/test.png"; // The settings icon of the module
    }

    @Override
    public String getDisplayName() {
        return "Test Module"; // The setting name of the module
    }
}

Test your addon

Launch the main class Start with the program parameter your.package.name.TestAddon

Build your addon

To make it available as a jar file, you have to define the addon class name in the /addon.json

{
  "main": "your.package.name.TestAddon"
}

To use your addon, put the jar file into the following directory: C:/Users/<name>/AppData/Roaming/DesktopModules/addons/

desktopmodules's People

Contributors

labystudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.