Giter Club home page Giter Club logo

bgswitch's Introduction

BGswitch

A helper for Celeste. Originally created by PenguinOwl and now maintained by the Communal Helper organization.

The release build can be downloaded here.

Head to our issues page to leave a bug report or feature request.

API

This mod uses a ModInterop API, which allows you to import methods into your own mods without referencing BGswitch directly. To use it, add BGswitch as an optional dependency and use the version where the methods you need were exported (or later).

Check out the API code for documentation on individual methods.

Basic usage guide and version info:

// Add somewhere in your mod. You only need to include delegates that you need.
[ModImportName("BGswitch")]
public static class BGswitchImports {
  // Added in v1.2.0
  public static Func<bool> IsBGMode;
  public static Action<bool, bool> SetBGMode;
  public static Func<Action<bool>, Component> GetBGModeListener;
}

// Add to YourModule.Load()
typeof(BGswitchImports).ModInterop();

// Example usages
public void LogMode(bool mode) {
  Logger.Log("MyMod", $"BG mode changed to: { mode }");
}

Component listener = GetBGModeListener?.Invoke(LogMode);
if (listener != null) {
  myEntity.Add(listener);
}

if (BGswitchImports.IsBGMode?.Invoke() ?? false) {
  Logger.Log("MyMod", "BG mode is active! Let's turn it off.");
  SetBGMode?.Invoke(false, false);
}

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.