com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch Java Examples

The following examples show how to use com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DisableGdxForceExit.java    From ModTheSpire with MIT License 6 votes vote down vote up
@SpireInsertPatch(loc=248)
public static void Insert(LwjglApplication __instance)
{
    try {
        Field f = LwjglGraphics.class.getDeclaredField("config");
        f.setAccessible(true);
        LwjglApplicationConfiguration config = (LwjglApplicationConfiguration) f.get(Gdx.app.getGraphics());
        config.forceExit = false;
    } catch (NoSuchFieldException | IllegalAccessException e) {
        e.printStackTrace();
    } finally {
        System.out.println("Game closed.");
        if (!Loader.DEBUG) {
            Loader.closeWindow();
        }
    }
}
 
Example #2
Source File: ShovelClickPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpireInsertPatch(
        locator = Locator.class,
        localvars = {"r"}
)
public static void Insert(OverlayMenu __instance, AbstractRelic relic) {
    if (relic instanceof Shovel) {
        if (HitboxRightClick.rightClicked.get(relic.hb)) {
            AbstractDungeon.effectList.add(new ThoughtBubble(AbstractDungeon.player.dialogX, AbstractDungeon.player.dialogY, 3.0F, TEXT[0], true));
        }
    }
}
 
Example #3
Source File: InsertPatchInfo.java    From ModTheSpire with MIT License 5 votes vote down vote up
public InsertPatchInfo(SpireInsertPatch info, List<LineNumberAndPatchType> locs, CtBehavior ctMethodToPatch, CtMethod patchMethod)
{
    super(ctMethodToPatch, patchMethod);
    canSpireReturn = true;
    canByRefParams = true;
    this.info = info;
    this.locs = locs;
}
 
Example #4
Source File: MainMenuItem.java    From ModTheSpire with MIT License 5 votes vote down vote up
@SpireInsertPatch(
    rloc=4,
    localvars={"index"}
)
public static void Insert(Object __obj_instance, @ByRef int[] index)
{
    MainMenuScreen __instance = (MainMenuScreen)__obj_instance;
    __instance.buttons.add(new MenuButton(ModMenuButton.MODS, index[0]++));
}
 
Example #5
Source File: OpenEtherealFix.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@SpireInsertPatch(rloc = 17, localvars = {"c", "toAdd"})
public static void Insert(Object __obj_instance, AbstractCard c, AbstractCard toAdd) {
    if (!toAdd.isEthereal && c.isEthereal) {
        toAdd.isEthereal = true;
        toAdd.rawDescription = "Ethereal. " + toAdd.rawDescription;
        toAdd.initializeDescription();
    }
}
 
Example #6
Source File: GremlinMatchPatch.java    From FruityMod-StS with MIT License 4 votes vote down vote up
@SpireInsertPatch(rloc = 32, localvars = {"retVal"})
public static void Insert(Object __obj_instance, ArrayList<AbstractCard> retVal) {
    if (AbstractDungeon.player instanceof TheSeeker) {
        retVal.add(new AstralHaze());
    }
}