forked from daviscook477/BaseMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'daviscook477/develop' into develop
- Loading branch information
Showing
7 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 28 additions & 1 deletion
29
...a/basemod/patches/com/megacrit/cardcrawl/actions/GameActionManager/GetNextActionHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
package basemod.patches.com.megacrit.cardcrawl.actions.GameActionManager; | ||
|
||
import java.util.ArrayList; | ||
|
||
import com.evacipated.cardcrawl.modthespire.lib.LineFinder; | ||
import com.evacipated.cardcrawl.modthespire.lib.Matcher; | ||
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertLocator; | ||
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch; | ||
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; | ||
import com.evacipated.cardcrawl.modthespire.patcher.PatchingException; | ||
import com.megacrit.cardcrawl.actions.GameActionManager; | ||
import com.megacrit.cardcrawl.cards.CardQueueItem; | ||
|
||
import basemod.BaseMod; | ||
import javassist.CannotCompileException; | ||
import javassist.CtBehavior; | ||
|
||
@SpirePatch(cls="com.megacrit.cardcrawl.actions.GameActionManager", method="getNextAction") | ||
public class GetNextActionHook { | ||
@SpireInsertPatch(rloc=49) | ||
|
||
|
||
@SpireInsertPatch() | ||
public static void Insert(Object __obj_instance) { | ||
GameActionManager actionManager = (GameActionManager) __obj_instance; | ||
BaseMod.publishOnCardUse(((CardQueueItem)actionManager.cardQueue.get(0)).card); | ||
} | ||
|
||
public static class Locator extends SpireInsertLocator | ||
{ | ||
public int[] Locate(CtBehavior ctMethodToPatch) throws CannotCompileException, PatchingException | ||
{ | ||
ArrayList<Matcher> prevMatches = new ArrayList<>(); | ||
prevMatches.add( | ||
new Matcher.FieldAccessMatcher( | ||
"com.megacrit.cardcrawl.actions.GameActionManager", | ||
"cardsPlayedThisTurn")); | ||
|
||
Matcher finalMatcher = new Matcher.MethodCallMatcher("java.util.ArrayList", "add"); | ||
|
||
return LineFinder.findInOrder(ctMethodToPatch, new ArrayList<Matcher>(), finalMatcher); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...basemod/patches/com/megacrit/cardcrawl/helpers/InputHelper/QuickSelectConsoleDisable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package basemod.patches.com.megacrit.cardcrawl.helpers.InputHelper; | ||
|
||
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; | ||
|
||
import javassist.CannotCompileException; | ||
import javassist.expr.ExprEditor; | ||
import javassist.expr.MethodCall; | ||
|
||
public class QuickSelectConsoleDisable { | ||
|
||
@SpirePatch(cls="com.megacrit.cardcrawl.helpers.InputHelper", method="getCardSelectedByHotkey") | ||
public static class GetCardSelectedByHotkeyFix { | ||
|
||
public static ExprEditor Instrument() { | ||
return new ExprEditor() { | ||
|
||
public void edit(MethodCall m) throws CannotCompileException { | ||
if (m.getClassName().equals("com.badlogic.gdx.Input") && m.getMethodName().equals("isKeyJustPressed")) { | ||
m.replace("{ $_ = !basemod.DevConsole.visible && $proceed($$); }"); | ||
} | ||
} | ||
|
||
}; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters