Lucky Shot
You are viewing a potentially older version of this package. View Latest Version
Install

Details

Date Uploaded
last week
Downloads
238
Size
213KB
Dependency string
LiamGaming-OpenShot-2.0.3

OpenShot Library

OpenShot is a core library and API for modding Lucky Shot. It provides shared tools and events so mods stay cleaner and conflict-free.

Features for Players

  • MODS main-menu card: Shoot the in-world MODS card on the main menu to configure installed mods (same diegetic style as COLLECTIONS / TRIALS).
  • Developer Console (~): Built-in command console (e.g. help).

Features for Developers

  • MainMenu API: Add or adapt shootable main-menu cards (MainMenu.AddButton, SetLabel, Hide, OnShot, WhenReady).
  • ModMenu hub: Fluent tabs with toggles, bools, sliders, ints, enums, buttons, and info lines (auto-grows / scrolls).
  • GameEvents: Subscribe to OnTargetSpawned, OnShotFired, OnShopTryBuy, OnAmmoDisplayUpdated, and more without writing your own Harmony patches.
  • AudioAPI: Play .wav / .ogg from disk via AudioAPI.PlaySound().
  • InputAPI: Register keybinds without cluttering Update().
  • Bullet & Asset Registry: Register custom bullets/prefabs with unique string IDs.
  • SaveAPI: Persist custom JSON across sessions.

Installation

  1. Install BepInEx.
  2. Extract OpenShot.dll into BepInEx/plugins.
  3. Start the game.

Developer Setup

Add OpenShot.dll as a project reference and declare the dependency:

using BepInEx;
using OpenShot; // OpenShotApi.Guid

[BepInDependency(OpenShotApi.Guid, BepInDependency.DependencyFlags.HardDependency)]
[BepInPlugin("com.you.mymod", "My Mod", "1.0.0")]
public class MyModPlugin : BaseUnityPlugin { }

Soft dependency: use SoftDependency and wrap UI registration in OpenShotApi.Try(...) or check OpenShotApi.IsLoaded.

Main-menu buttons (diegetic)

using OpenShot.UI;

MainMenu.AddButton("MY MOD", () => { /* shot */ });

MainMenu.SetLabel("COLLECTIONS", "SAMMLUNG");
MainMenu.Hide("TRIALS");
MainMenu.OnShot("STATS", hit => false); // false = also run original

MainMenu.WhenReady(() => {
    // menu cards are in the world now
});

Mod settings (MODS hub)

Fluent API. The panel grows with options and scrolls when a tab is tall. Float / Int without min/max read AcceptableValueRange from the config bind.

using BepInEx.Configuration;
using OpenShot.UI;

ModMenu.Tab("MyMod")
    .Toggle(enabledConfig)                          // master Enabled row
    .Info("— Shop —")
    .Bool("Weaker Shop", weakerShop)                // labeled ON/OFF
    .Slider("Cost Mult", shopMult, 0.05f)           // range from ConfigDescription
    .Int("Extra Targets", extraTargets)             // range from ConfigDescription
    .Enum("Mode", modeConfig)
    .Button("Reset", () => ResetDefaults());

Legacy RegisterTab / RegisterToggle / RegisterFloatSetting still work. [OpenShotMenuTab("MyMod")] on a static method still registers a hub tab name.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.