Coder Social home page Coder Social logo

commander07 / hydrogen Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 122 KB

HML Is a feature rich modding framework for all your python needs.

Home Page: http://bit.ly/HydroMod

License: MIT License

Python 100.00%
python3 python modding mods eventhandler events

hydrogen's Introduction

Hydrogen Mod Loader (HML)

HML Is a feature rich modding framework for all your python needs.

Features

  • EventHandler
    • Automated events
    • Manual event calling
    • Event return values
    • Custom Events
  • Static and Dynamic mod loading
  • Mod meta data
  • User friendly api
  • Drag & drop infrastructure

Installation

Download your wanted version here and extract it and move everything in the 'src' folder to your project root.

Usage

Importing mods

Multiple mods

from mods.hydrogen import utils, events

# Import all mods in 'mods' folder.
utils.import_mods()

Single mod

from mods.hydrogen import utils, events

# Import mod 'example'.
utils.import_mod("example")

Get mod instance

from mods.hydrogen import utils, events

# Get mod 'example'.
utils.get("example")

Calling events

from mods.hydrogen import utils, events


# Object to store event data.
class data:
  name = "Zombie"


# Call event OnKill in all mods with the data from the data object.
return_value = utils.call_event(events.OnKill, data)

Creating events

In 'mods/__config__.py' you will find a class named 'events' if you want to add events you just simply want to add a line following the syntax shown in the example.

from dataclasses import dataclass


class events:
  @dataclass
  class Event:
    __name__: str

    def __call__(self, mod_instance):
      self.__self__ = mod_instance
      return self

  # Creates an 'OnKill' event
  OnKill = Event("OnKill")

hydrogen's People

Contributors

commander07 avatar

Watchers

 avatar  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.