├── _build.bat ├── src └── main │ ├── resources │ ├── img │ │ ├── badge.png │ │ ├── BlankButton.png │ │ └── ModPanelBg.png │ └── font │ │ └── FantasqueSansMono │ │ ├── FantasqueSansMono-Regular.ttf │ │ └── OFL.txt │ └── java │ ├── basemod │ ├── interfaces │ │ ├── PreUpdateSubscriber.java │ │ ├── PostUpdateSubscriber.java │ │ ├── PostInitializeSubscriber.java │ │ ├── RenderSubscriber.java │ │ └── PostRenderSubscriber.java │ ├── ModButton.java │ ├── ConsoleInputProcessor.java │ ├── ModPanel.java │ ├── ModBadge.java │ ├── BaseMod.java │ └── DevConsole.java │ └── com │ └── megacrit │ └── cardcrawl │ └── com.megacrit.cardcrawl.diff ├── _diff.bat ├── .gitignore ├── LICENSE ├── pom.xml └── README.md /_build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call mvn package 3 | cp target/BaseMod.jar ../_ModTheSpire/mods 4 | pause -------------------------------------------------------------------------------- /src/main/resources/img/badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeStarfall/BaseMod/HEAD/src/main/resources/img/badge.png -------------------------------------------------------------------------------- /src/main/resources/img/BlankButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeStarfall/BaseMod/HEAD/src/main/resources/img/BlankButton.png -------------------------------------------------------------------------------- /src/main/resources/img/ModPanelBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeStarfall/BaseMod/HEAD/src/main/resources/img/ModPanelBg.png -------------------------------------------------------------------------------- /src/main/java/basemod/interfaces/PreUpdateSubscriber.java: -------------------------------------------------------------------------------- 1 | package basemod.interfaces; 2 | 3 | public interface PreUpdateSubscriber { 4 | public void receivePreUpdate(); 5 | } -------------------------------------------------------------------------------- /src/main/java/basemod/interfaces/PostUpdateSubscriber.java: -------------------------------------------------------------------------------- 1 | package basemod.interfaces; 2 | 3 | public interface PostUpdateSubscriber { 4 | public void receivePostUpdate(); 5 | } -------------------------------------------------------------------------------- /src/main/java/basemod/interfaces/PostInitializeSubscriber.java: -------------------------------------------------------------------------------- 1 | package basemod.interfaces; 2 | 3 | public interface PostInitializeSubscriber { 4 | public void receivePostInitialize(); 5 | } -------------------------------------------------------------------------------- /src/main/resources/font/FantasqueSansMono/FantasqueSansMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyeStarfall/BaseMod/HEAD/src/main/resources/font/FantasqueSansMono/FantasqueSansMono-Regular.ttf -------------------------------------------------------------------------------- /src/main/java/basemod/interfaces/RenderSubscriber.java: -------------------------------------------------------------------------------- 1 | package basemod.interfaces; 2 | 3 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 4 | 5 | public interface RenderSubscriber { 6 | public void receiveRender(SpriteBatch sb); 7 | } -------------------------------------------------------------------------------- /_diff.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | diff -ru "../_lib/decompiled/com/megacrit/cardcrawl" "src/main/java/com/megacrit/cardcrawl" | sed '/^Only in/d' | sed 's@../_lib/decompiled@src/main/java@g' > "src/main/java/com/megacrit/cardcrawl/com.megacrit.cardcrawl.diff" 3 | -------------------------------------------------------------------------------- /src/main/java/basemod/interfaces/PostRenderSubscriber.java: -------------------------------------------------------------------------------- 1 | package basemod.interfaces; 2 | 3 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 4 | 5 | public interface PostRenderSubscriber { 6 | public void receivePostRender(SpriteBatch sb); 7 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.ear 17 | *.zip 18 | *.tar.gz 19 | *.rar 20 | 21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 22 | hs_err_pid* 23 | 24 | # Custom 25 | src/main/java/com/megacrit/**/*.java 26 | target/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 t-larson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | basemod 5 | basemod 6 | 1.1.1 7 | jar 8 | 9 | BaseMod 10 | Provides hooks and a console 11 | 12 | 13 | 14 | com.megacrit.cardcrawl 15 | slaythespire 16 | 012 17 | system 18 | ${basedir}/../_lib/desktop-1.0.jar 19 | 20 | 21 | 22 | 23 | BaseMod 24 | 25 | 26 | org.apache.maven.plugins 27 | maven-compiler-plugin 28 | 3.7.0 29 | 30 | 1.8 31 | 1.8 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BaseMod # 2 | BaseMod provides a number of hooks and a console. 3 | 4 | ## Requirements ## 5 | #### General Use #### 6 | * Java 8+ 7 | 8 | #### Development #### 9 | * Java 8+ 10 | * Maven 11 | 12 | ## Building ## 13 | 1. Run `mvn package` 14 | 15 | ## Installation ## 16 | 1. Copy `target/BaseMod.jar` to your ModTheSpire mods directory. 17 | 18 | ## Console ## 19 | Default hotkey is `` ` ``, can be changed from BaseMod's settings screen. 20 | * `info` toggle Settings.isInfo 21 | * `relic [id]` generate relic 22 | * `relic r [id]` lose relic 23 | 24 | ## For Modders ## 25 | ### Hooks ### 26 | #### Subscription handling #### 27 | * `BaseMod.subscribeTo...(this)` 28 | * `BaseMod.unsubscribeFrom...(this)` 29 | 30 | #### Subscriptions #### 31 | Implement the appropriate interface (ex. `basemod.interfaces.PostInitializeSubscription`) 32 | * `receivePostInitialize()` - One time only, at the end of `CardCrawlGame.initialize()` 33 | * `receiveRender(SpriteBatch)` - Under tips and the cursor, above everything else 34 | * `receivePostRender(SpriteBatch)` - Above everything 35 | * `receivePreUpdate()` - Immediately after input is handled 36 | * `receivePostUpdate()` - Immediately before input is disposed 37 | 38 | ### Mod Badges ### 39 | Currently only has full support for the badges themselves. Clicking any will open the BaseMod settings page for now. 40 | * `BaseMod.registerModBadge(Texture texture, String modName, String author, String description)` 41 | 42 | ## Changelog ## 43 | #### v1.0.0 #### 44 | * Initial release 45 | 46 | #### v1.0.1 #### 47 | * Scale console by Settings.scale 48 | * Prevent game hotkeys from activating while console is visible 49 | 50 | #### v1.1.0 #### 51 | * Add mod badges 52 | * Add initial support for mod settings screens 53 | * Add `relic` console command 54 | * Add option to change console keybind on BaseMod settings screen 55 | 56 | #### v1.1.1 ##### 57 | * Scale mod badges by Settings.scale 58 | * Scale mod settings screens by Settings.scale -------------------------------------------------------------------------------- /src/main/java/basemod/ModButton.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.graphics.Color; 5 | import com.badlogic.gdx.graphics.Texture; 6 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 7 | import com.megacrit.cardcrawl.core.CardCrawlGame; 8 | import com.megacrit.cardcrawl.core.Settings; 9 | import com.megacrit.cardcrawl.helpers.FontHelper; 10 | import com.megacrit.cardcrawl.helpers.Hitbox; 11 | import com.megacrit.cardcrawl.helpers.InputHelper; 12 | import java.util.function.Consumer; 13 | 14 | public class ModButton { 15 | private static final float HB_SHRINK = 14.0f; 16 | 17 | private Consumer click; 18 | private Hitbox hb; 19 | private String text; 20 | private Texture texture; 21 | private float x; 22 | private float y; 23 | private float w; 24 | private float h; 25 | 26 | public ModPanel parent; 27 | 28 | public ModButton(float xPos, float yPos, ModPanel p, Consumer c) { 29 | texture = new Texture(Gdx.files.internal("img/BlankButton.png")); 30 | x = xPos; 31 | y = yPos; 32 | w = texture.getWidth(); 33 | h = texture.getHeight(); 34 | hb = new Hitbox(x+(HB_SHRINK*Settings.scale), y+(HB_SHRINK*Settings.scale), (w-(2*HB_SHRINK))*Settings.scale, (h-(2*HB_SHRINK))*Settings.scale); 35 | 36 | parent = p; 37 | click = c; 38 | } 39 | 40 | public void render(SpriteBatch sb) { 41 | sb.setColor(Color.WHITE); 42 | sb.draw(texture, x, y, w*Settings.scale, h*Settings.scale); 43 | hb.render(sb); 44 | } 45 | 46 | public void update() { 47 | hb.update(); 48 | 49 | if (hb.justHovered) { 50 | CardCrawlGame.sound.playV("UI_HOVER", 0.75f); 51 | } 52 | 53 | if (hb.hovered) { 54 | if (InputHelper.justClickedLeft) { 55 | CardCrawlGame.sound.playA("UI_CLICK_1", -0.1f); 56 | hb.clickStarted = true; 57 | } 58 | } 59 | 60 | if (hb.clicked) { 61 | hb.clicked = false; 62 | onClick(); 63 | } 64 | } 65 | 66 | private void onClick() { 67 | BaseMod.logger.info("onClick"); 68 | click.accept(this); 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/basemod/ConsoleInputProcessor.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import com.badlogic.gdx.Input.Keys; 4 | import com.badlogic.gdx.InputProcessor; 5 | import java.awt.event.KeyEvent; 6 | 7 | public class ConsoleInputProcessor implements InputProcessor { 8 | @Override 9 | public boolean keyDown(int keycode) { 10 | switch (keycode) { 11 | case Keys.ENTER: { 12 | DevConsole.execute(); 13 | return true; 14 | } 15 | case Keys.BACKSPACE: { 16 | DevConsole.backspaceWait = 0; 17 | DevConsole.backspace = true; 18 | return true; 19 | } 20 | } 21 | return false; 22 | } 23 | 24 | @Override 25 | public boolean keyUp(int keycode) { 26 | switch (keycode) { 27 | case Keys.BACKSPACE: { 28 | DevConsole.backspace = false; 29 | DevConsole.backspaceWait = 0; 30 | return true; 31 | } 32 | } 33 | return false; 34 | } 35 | 36 | @Override 37 | public boolean keyTyped(char character) { 38 | Character.UnicodeBlock block = Character.UnicodeBlock.of(character); 39 | 40 | boolean badBlock = (block == null || block == Character.UnicodeBlock.SPECIALS); 41 | boolean isToggle = (character == DevConsole.toggleKey); 42 | boolean isControl = (Character.isISOControl(character) || character == KeyEvent.CHAR_UNDEFINED); 43 | if (badBlock || isToggle || isControl) { 44 | return false; 45 | } 46 | 47 | DevConsole.currentText += character; 48 | return true; 49 | } 50 | 51 | @Override 52 | public boolean touchDown(int screenX, int screenY, int pointer, int button) { 53 | return false; 54 | } 55 | 56 | @Override 57 | public boolean touchUp(int screenX, int screenY, int pointer, int button) { 58 | return false; 59 | } 60 | 61 | @Override 62 | public boolean touchDragged(int screenX, int screenY, int pointer) { 63 | return false; 64 | } 65 | 66 | @Override 67 | public boolean mouseMoved(int screenX, int screenY) { 68 | return false; 69 | } 70 | 71 | @Override 72 | public boolean scrolled(int amount) { 73 | return false; 74 | } 75 | } -------------------------------------------------------------------------------- /src/main/java/basemod/ModPanel.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.Input.Keys; 5 | import com.badlogic.gdx.InputAdapter; 6 | import com.badlogic.gdx.InputProcessor; 7 | import com.badlogic.gdx.graphics.Color; 8 | import com.badlogic.gdx.graphics.Texture; 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 10 | import com.megacrit.cardcrawl.core.CardCrawlGame; 11 | import com.megacrit.cardcrawl.core.Settings; 12 | import com.megacrit.cardcrawl.helpers.FontHelper; 13 | import com.megacrit.cardcrawl.helpers.ImageMaster; 14 | import com.megacrit.cardcrawl.helpers.InputHelper; 15 | import com.megacrit.cardcrawl.screens.mainMenu.MainMenuScreen; 16 | 17 | public class ModPanel { 18 | private static Texture texture; 19 | 20 | private boolean waitingOnKey; 21 | private InputProcessor oldInputProcessor = null; 22 | private ModButton consoleKeyButton; 23 | public String consoleKeyLabel; 24 | 25 | public boolean isUp = false; 26 | 27 | public ModPanel() { 28 | texture = new Texture(Gdx.files.internal("img/ModPanelBg.png")); 29 | consoleKeyLabel = "Change console hotkey (" + Keys.toString(DevConsole.toggleKey) + ")"; 30 | 31 | consoleKeyButton = new ModButton(350.0f*Settings.scale, 650.0f*Settings.scale, this, (me) -> { 32 | waitingOnKey = true; 33 | oldInputProcessor = Gdx.input.getInputProcessor(); 34 | Gdx.input.setInputProcessor(new InputAdapter() { 35 | @Override 36 | public boolean keyUp(int keycode) { 37 | DevConsole.toggleKey = keycode; 38 | waitingOnKey = false; 39 | Gdx.input.setInputProcessor(oldInputProcessor); 40 | return true; 41 | } 42 | }); 43 | }); 44 | } 45 | 46 | public void render(SpriteBatch sb) { 47 | renderBg(sb); 48 | renderText(sb); 49 | renderButtons(sb); 50 | } 51 | 52 | private void renderBg(SpriteBatch sb) { 53 | sb.setColor(Color.WHITE); 54 | sb.draw(texture, (float)Settings.WIDTH / 2.0f - 682.0f, Settings.OPTION_Y - 376.0f, 682.0f, 376.0f, 1364.0f, 752.0f, Settings.scale, Settings.scale, 0.0f, 0, 0, 1364, 752, false, false); 55 | } 56 | 57 | private void renderText(SpriteBatch sb) { 58 | FontHelper.renderFontLeftDownAligned(sb, FontHelper.buttonLabelFont, consoleKeyLabel, 475.0f*Settings.scale, 700.0f*Settings.scale, Color.WHITE); 59 | } 60 | 61 | private void renderButtons(SpriteBatch sb) { 62 | consoleKeyButton.render(sb); 63 | } 64 | 65 | public void update() { 66 | updateText(); 67 | updateButtons(); 68 | 69 | if (InputHelper.pressedEscape) { 70 | InputHelper.pressedEscape = false; 71 | BaseMod.modSettingsUp = false; 72 | } 73 | 74 | if (!BaseMod.modSettingsUp) { 75 | waitingOnKey = false; 76 | Gdx.input.setInputProcessor(oldInputProcessor); 77 | CardCrawlGame.mainMenuScreen.lighten(); 78 | CardCrawlGame.mainMenuScreen.screen = MainMenuScreen.CurScreen.MAIN_MENU; 79 | CardCrawlGame.cancelButton.hideInstantly(); 80 | isUp = false; 81 | } 82 | } 83 | 84 | private void updateText() { 85 | consoleKeyLabel = waitingOnKey ? "Press key" : "Change console hotkey (" + Keys.toString(DevConsole.toggleKey) + ")"; 86 | } 87 | 88 | private void updateButtons() { 89 | consoleKeyButton.update(); 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/basemod/ModBadge.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import basemod.interfaces.RenderSubscriber; 4 | import basemod.interfaces.PreUpdateSubscriber; 5 | import com.badlogic.gdx.graphics.Color; 6 | import com.badlogic.gdx.graphics.Texture; 7 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 8 | import com.megacrit.cardcrawl.core.CardCrawlGame; 9 | import com.megacrit.cardcrawl.core.Settings; 10 | import com.megacrit.cardcrawl.helpers.Hitbox; 11 | import com.megacrit.cardcrawl.helpers.InputHelper; 12 | import com.megacrit.cardcrawl.helpers.TipHelper; 13 | import com.megacrit.cardcrawl.screens.mainMenu.EarlyAccessPopup; 14 | import com.megacrit.cardcrawl.screens.mainMenu.MainMenuScreen; 15 | import java.util.ArrayList; 16 | 17 | public class ModBadge implements RenderSubscriber, PreUpdateSubscriber { 18 | private Texture texture; 19 | private String modName; 20 | private String author; 21 | private String description; 22 | private String tip; 23 | 24 | private float x; 25 | private float y; 26 | private float w; 27 | private float h; 28 | 29 | private Hitbox hb; 30 | private ModPanel modPanel; 31 | 32 | public ModBadge(Texture t, float xPos, float yPos, String name, String auth, String desc) { 33 | modName = name; 34 | author = auth; 35 | description = desc; 36 | tip = author + " NL " + description; 37 | 38 | texture = t; 39 | x = xPos; 40 | y = yPos; 41 | w = t.getWidth(); 42 | h = t.getHeight(); 43 | 44 | hb = new Hitbox(x, y, w*Settings.scale, h*Settings.scale); 45 | modPanel = new ModPanel(); 46 | 47 | BaseMod.subscribeToRender(this); 48 | BaseMod.subscribeToPreUpdate(this); 49 | } 50 | 51 | public void receiveRender(SpriteBatch sb) { 52 | if (CardCrawlGame.mainMenuScreen != null && CardCrawlGame.mainMenuScreen.screen == MainMenuScreen.CurScreen.MAIN_MENU && !EarlyAccessPopup.isUp && !BaseMod.modSettingsUp) { 53 | sb.setColor(Color.WHITE); 54 | sb.draw(texture, x, y, w*Settings.scale, h*Settings.scale); 55 | hb.render(sb); 56 | } else if (modPanel.isUp) { 57 | modPanel.render(sb); 58 | } 59 | } 60 | 61 | public void receivePreUpdate() { 62 | if (CardCrawlGame.mainMenuScreen != null && CardCrawlGame.mainMenuScreen.screen == MainMenuScreen.CurScreen.MAIN_MENU && !EarlyAccessPopup.isUp && !BaseMod.modSettingsUp) { 63 | hb.update(); 64 | 65 | if (hb.justHovered) { 66 | CardCrawlGame.sound.playV("UI_HOVER", 0.75f); 67 | } 68 | 69 | if (hb.hovered) { 70 | TipHelper.renderGenericTip(x+(2*w), y+h, modName, tip); 71 | 72 | if (InputHelper.justClickedLeft) { 73 | CardCrawlGame.sound.playA("UI_CLICK_1", -0.1f); 74 | hb.clickStarted = true; 75 | } 76 | } 77 | 78 | if (hb.clicked) { 79 | hb.clicked = false; 80 | onClick(); 81 | } 82 | } else if (modPanel.isUp) { 83 | modPanel.update(); 84 | } 85 | } 86 | 87 | private void onClick() { 88 | BaseMod.modSettingsUp = true; 89 | modPanel.isUp = true; 90 | 91 | CardCrawlGame.mainMenuScreen.darken(); 92 | CardCrawlGame.mainMenuScreen.hideMenuButtons(); 93 | CardCrawlGame.mainMenuScreen.screen = MainMenuScreen.CurScreen.SETTINGS; 94 | CardCrawlGame.cancelButton.show("Close"); 95 | } 96 | } -------------------------------------------------------------------------------- /src/main/resources/font/FantasqueSansMono/OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016, Jany Belluz (jany.belluz@hotmail.fr) 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | 8 | ----------------------------------------------------------- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | ----------------------------------------------------------- 11 | 12 | PREAMBLE 13 | The goals of the Open Font License (OFL) are to stimulate worldwide 14 | development of collaborative font projects, to support the font creation 15 | efforts of academic and linguistic communities, and to provide a free and 16 | open framework in which fonts may be shared and improved in partnership 17 | with others. 18 | 19 | The OFL allows the licensed fonts to be used, studied, modified and 20 | redistributed freely as long as they are not sold by themselves. The 21 | fonts, including any derivative works, can be bundled, embedded, 22 | redistributed and/or sold with any software provided that any reserved 23 | names are not used by derivative works. The fonts and derivatives, 24 | however, cannot be released under any other type of license. The 25 | requirement for fonts to remain under this license does not apply 26 | to any document created using the fonts or their derivatives. 27 | 28 | DEFINITIONS 29 | "Font Software" refers to the set of files released by the Copyright 30 | Holder(s) under this license and clearly marked as such. This may 31 | include source files, build scripts and documentation. 32 | 33 | "Reserved Font Name" refers to any names specified as such after the 34 | copyright statement(s). 35 | 36 | "Original Version" refers to the collection of Font Software components as 37 | distributed by the Copyright Holder(s). 38 | 39 | "Modified Version" refers to any derivative made by adding to, deleting, 40 | or substituting -- in part or in whole -- any of the components of the 41 | Original Version, by changing formats or by porting the Font Software to a 42 | new environment. 43 | 44 | "Author" refers to any designer, engineer, programmer, technical 45 | writer or other person who contributed to the Font Software. 46 | 47 | PERMISSION & CONDITIONS 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 50 | redistribute, and sell modified and unmodified copies of the Font 51 | Software, subject to the following conditions: 52 | 53 | 1) Neither the Font Software nor any of its individual components, 54 | in Original or Modified Versions, may be sold by itself. 55 | 56 | 2) Original or Modified Versions of the Font Software may be bundled, 57 | redistributed and/or sold with any software, provided that each copy 58 | contains the above copyright notice and this license. These can be 59 | included either as stand-alone text files, human-readable headers or 60 | in the appropriate machine-readable metadata fields within text or 61 | binary files as long as those fields can be easily viewed by the user. 62 | 63 | 3) No Modified Version of the Font Software may use the Reserved Font 64 | Name(s) unless explicit written permission is granted by the corresponding 65 | Copyright Holder. This restriction only applies to the primary font name as 66 | presented to the users. 67 | 68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 69 | Software shall not be used to promote, endorse or advertise any 70 | Modified Version, except to acknowledge the contribution(s) of the 71 | Copyright Holder(s) and the Author(s) or with their explicit written 72 | permission. 73 | 74 | 5) The Font Software, modified or unmodified, in part or in whole, 75 | must be distributed entirely under this license, and must not be 76 | distributed under any other license. The requirement for fonts to 77 | remain under this license does not apply to any document created 78 | using the Font Software. 79 | 80 | TERMINATION 81 | This license becomes null and void if any of the above conditions are 82 | not met. 83 | 84 | DISCLAIMER 85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 93 | OTHER DEALINGS IN THE FONT SOFTWARE. 94 | -------------------------------------------------------------------------------- /src/main/java/basemod/BaseMod.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import basemod.interfaces.*; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.graphics.Texture; 6 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 7 | import com.megacrit.cardcrawl.core.CardCrawlGame; 8 | import com.megacrit.cardcrawl.core.Settings; 9 | import com.megacrit.cardcrawl.screens.mainMenu.MainMenuScreen; 10 | import java.util.ArrayList; 11 | import org.apache.logging.log4j.Logger; 12 | import org.apache.logging.log4j.LogManager; 13 | 14 | public class BaseMod { 15 | public static final Logger logger = LogManager.getLogger(BaseMod.class.getName()); 16 | 17 | private static final int BADGES_PER_ROW = 16; 18 | private static final float BADGES_X = 640.0f; 19 | private static final float BADGES_Y = 250.0f; 20 | public static final float BADGE_W = 40.0f; 21 | public static final float BADGE_H = 40.0f; 22 | 23 | private static ArrayList modBadges; 24 | private static ArrayList postInitializeSubscribers; 25 | private static ArrayList renderSubscribers; 26 | private static ArrayList postRenderSubscribers; 27 | private static ArrayList preUpdateSubscribers; 28 | private static ArrayList postUpdateSubscribers; 29 | 30 | public static DevConsole console; 31 | public static boolean modSettingsUp = false; 32 | 33 | // initialize - 34 | public static void initialize() { 35 | logger.info("========================= BASEMOD INIT ========================="); 36 | logger.info("isModded: " + Settings.isModded); 37 | 38 | modBadges = new ArrayList(); 39 | postInitializeSubscribers = new ArrayList(); 40 | renderSubscribers = new ArrayList(); 41 | postRenderSubscribers = new ArrayList(); 42 | preUpdateSubscribers = new ArrayList(); 43 | postUpdateSubscribers = new ArrayList(); 44 | 45 | console = new DevConsole(); 46 | 47 | logger.info("================================================================"); 48 | } 49 | 50 | // 51 | // Mod badges 52 | // 53 | public static void registerModBadge(Texture t, String name, String author, String desc) { 54 | int modBadgeCount = modBadges.size(); 55 | int col = (modBadgeCount%BADGES_PER_ROW); 56 | int row = (modBadgeCount/BADGES_PER_ROW); 57 | float x = (BADGES_X*Settings.scale) + (col*BADGE_W*Settings.scale); 58 | float y = (BADGES_Y*Settings.scale) - (row*BADGE_H*Settings.scale); 59 | 60 | ModBadge badge = new ModBadge(t, x, y, name, author, desc); 61 | modBadges.add(badge); 62 | } 63 | 64 | // 65 | // Publishers 66 | // 67 | 68 | // publishPostInitialize - 69 | public static void publishPostInitialize() { 70 | // BaseMod post initialize handling 71 | Texture badgeTexture = new Texture(Gdx.files.internal("img/badge.png")); 72 | registerModBadge(badgeTexture, "BaseMod", "t-larson", "v1.1.1 NL Provides hooks and a console"); 73 | 74 | // Publish 75 | for (PostInitializeSubscriber sub : postInitializeSubscribers) { 76 | sub.receivePostInitialize(); 77 | } 78 | } 79 | 80 | // publishRender - 81 | public static void publishRender(SpriteBatch sb) { 82 | for (RenderSubscriber sub : renderSubscribers) { 83 | sub.receiveRender(sb); 84 | } 85 | } 86 | 87 | // publishPostRender - 88 | public static void publishPostRender(SpriteBatch sb) { 89 | for (PostRenderSubscriber sub : postRenderSubscribers) { 90 | sub.receivePostRender(sb); 91 | } 92 | } 93 | 94 | // publishPreUpdate - 95 | public static void publishPreUpdate() { 96 | for (PreUpdateSubscriber sub : preUpdateSubscribers) { 97 | sub.receivePreUpdate(); 98 | } 99 | } 100 | 101 | // publishPostUpdate - 102 | public static void publishPostUpdate() { 103 | for (PostUpdateSubscriber sub : postUpdateSubscribers) { 104 | sub.receivePostUpdate(); 105 | } 106 | } 107 | 108 | // 109 | // Subsciption handlers 110 | // 111 | 112 | // subscribeToPostInitialize - 113 | public static void subscribeToPostInitialize(PostInitializeSubscriber sub) { 114 | postInitializeSubscribers.add(sub); 115 | } 116 | 117 | // unsubscribeFromPostRender - 118 | public static void unsubscribeFromPostInitialize(PostInitializeSubscriber sub) { 119 | postInitializeSubscribers.remove(sub); 120 | } 121 | 122 | // subscribeToRender - 123 | public static void subscribeToRender(RenderSubscriber sub) { 124 | renderSubscribers.add(sub); 125 | } 126 | 127 | // unsubscribeFromRender - 128 | public static void unsubscribeFromRender(RenderSubscriber sub) { 129 | renderSubscribers.remove(sub); 130 | } 131 | 132 | // subscribeToPostRender - 133 | public static void subscribeToPostRender(PostRenderSubscriber sub) { 134 | postRenderSubscribers.add(sub); 135 | } 136 | 137 | // unsubscribeFromPostRender - 138 | public static void unsubscribeFromPostRender(PostRenderSubscriber sub) { 139 | postRenderSubscribers.remove(sub); 140 | } 141 | 142 | // subscribeToPreUpdate - 143 | public static void subscribeToPreUpdate(PreUpdateSubscriber sub) { 144 | preUpdateSubscribers.add(sub); 145 | } 146 | 147 | // unsubscribeFromPreUpdate - 148 | public static void unsubscribeFromPreUpdate(PreUpdateSubscriber sub) { 149 | preUpdateSubscribers.remove(sub); 150 | } 151 | 152 | // subscribeToPostUpdate - 153 | public static void subscribeToPostUpdate(PostUpdateSubscriber sub) { 154 | postUpdateSubscribers.add(sub); 155 | } 156 | 157 | // unsubscribeFromUpdate - 158 | public static void unsubscribeFromPostUpdate(PostUpdateSubscriber sub) { 159 | postUpdateSubscribers.remove(sub); 160 | } 161 | } -------------------------------------------------------------------------------- /src/main/java/basemod/DevConsole.java: -------------------------------------------------------------------------------- 1 | package basemod; 2 | 3 | import basemod.interfaces.*; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.Input.Keys; 6 | import com.badlogic.gdx.InputProcessor; 7 | import com.badlogic.gdx.graphics.Color; 8 | import com.badlogic.gdx.graphics.g2d.BitmapFont; 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 10 | import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator; 11 | import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter; 12 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer; 13 | import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; 14 | import com.megacrit.cardcrawl.core.Settings; 15 | import com.megacrit.cardcrawl.dungeons.AbstractDungeon; 16 | import com.megacrit.cardcrawl.helpers.*; 17 | import com.megacrit.cardcrawl.relics.AbstractRelic; 18 | import com.megacrit.cardcrawl.cards.AbstractCard; 19 | import com.megacrit.cardcrawl.actions.common.*; 20 | import java.util.Arrays; 21 | import org.apache.logging.log4j.Logger; 22 | import org.apache.logging.log4j.LogManager; 23 | 24 | public class DevConsole implements PostInitializeSubscriber, PostRenderSubscriber, PostUpdateSubscriber { 25 | public static final Logger logger = LogManager.getLogger(BaseMod.class.getName()); 26 | private static final float CONSOLE_X = 75.0f; 27 | private static final float CONSOLE_Y = 75.0f; 28 | private static final float CONSOLE_W = 800.0f; 29 | private static final float CONSOLE_H = 40.0f; 30 | private static final float CONSOLE_PAD_X = 15.0f; 31 | private static final int CONSOLE_TEXT_SIZE = 30; 32 | private static final int BACKSPACE_INTERVAL = 4; 33 | 34 | private static BitmapFont consoleFont = null; 35 | private static Color consoleColor = Color.BLACK; 36 | private static InputProcessor consoleInputProcessor; 37 | private static InputProcessor otherInputProcessor = null; 38 | 39 | public static boolean backspace = false; 40 | public static boolean visible = false; 41 | public static int backspaceWait = 0; 42 | public static int toggleKey = Keys.GRAVE; 43 | public static String currentText = ""; 44 | 45 | public DevConsole() { 46 | BaseMod.subscribeToPostInitialize(this); 47 | BaseMod.subscribeToPostRender(this); 48 | BaseMod.subscribeToPostUpdate(this); 49 | } 50 | 51 | public static void execute() { 52 | String[] tokens = currentText.split(" "); 53 | currentText = ""; 54 | 55 | if (tokens.length < 1) return; 56 | for (int i = 0; i < tokens.length; i++) { 57 | tokens[i] = tokens[i].trim(); 58 | } 59 | 60 | switch (tokens[0].toLowerCase()) { 61 | case "relic": { 62 | cmdRelic(tokens); 63 | break; 64 | } 65 | case "card": { 66 | cmdCard(tokens); 67 | break; 68 | } 69 | case "info": { 70 | Settings.isInfo = !Settings.isInfo; 71 | break; 72 | } 73 | default: { 74 | // TODO: Implement command hook 75 | break; 76 | } 77 | } 78 | } 79 | 80 | private static void cmdRelic(String[] tokens) { 81 | if (AbstractDungeon.player != null) { 82 | if (tokens.length < 3) { 83 | return; 84 | } 85 | 86 | if (tokens[1].equals("r") && tokens.length > 2) { 87 | String[] relicNameArray = Arrays.copyOfRange(tokens, 2, tokens.length); 88 | String relicName = String.join(" ", relicNameArray); 89 | AbstractDungeon.player.loseRelic(relicName); 90 | } else if (tokens[1].equals("add") && tokens.length > 2) { 91 | String[] relicNameArray = Arrays.copyOfRange(tokens, 2, tokens.length); 92 | String relicName = String.join(" ", relicNameArray); 93 | AbstractDungeon.getCurrRoom().spawnRelicAndObtain(Settings.WIDTH / 2, Settings.HEIGHT / 2, RelicLibrary.getRelic(relicName).makeCopy()); 94 | } 95 | } 96 | } 97 | 98 | private static void cmdCard(String[] tokens) { 99 | if (AbstractDungeon.player != null) { 100 | if (tokens.length < 3) { 101 | return; 102 | } 103 | logger.info("" + String.join(" ", tokens)); 104 | logger.info("" + tokens[1]); 105 | 106 | if (tokens[1].equals("add") && tokens.length > 2) { 107 | String[] cardNameArray = Arrays.copyOfRange(tokens, 2, tokens.length); 108 | String cardName = String.join(" ", cardNameArray); 109 | logger.info("" + cardName); 110 | AbstractCard c = CardLibrary.getCard(cardName); 111 | if (c != null) { 112 | c = c.makeCopy(); 113 | AbstractDungeon.actionManager.addToBottom(new MakeTempCardInHandAction(c, true)); 114 | } 115 | } else if (tokens[1].equals("r") && tokens.length > 2){ 116 | String[] cardNameArray = Arrays.copyOfRange(tokens, 2, tokens.length); 117 | String cardName = String.join(" ", cardNameArray); 118 | logger.info("" + cardName); 119 | 120 | boolean removed = false; 121 | AbstractCard toRemove = null; 122 | for (AbstractCard c : AbstractDungeon.player.hand.group) { 123 | logger.info("" + c.cardID); 124 | if(removed) break; 125 | if(c.cardID.equals(cardName)){ 126 | toRemove = c; 127 | removed = true; 128 | } 129 | } 130 | if(removed) AbstractDungeon.player.hand.moveToExhaustPile(toRemove); 131 | } 132 | } 133 | } 134 | 135 | public void receivePostInitialize() { 136 | consoleInputProcessor = new ConsoleInputProcessor(); 137 | 138 | // Console font 139 | FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font/FantasqueSansMono/FantasqueSansMono-Regular.ttf")); 140 | FreeTypeFontParameter parameter = new FreeTypeFontParameter(); 141 | parameter.size = (int) (CONSOLE_TEXT_SIZE * Settings.scale); 142 | consoleFont = generator.generateFont(parameter); 143 | generator.dispose(); 144 | } 145 | 146 | public void receivePostRender(SpriteBatch sb) { 147 | if (visible && consoleFont != null) { 148 | // Since we need a shape renderer, need to end then restart the SpriteBatch 149 | // Should probably just make a background texture for the console so this doesn't need to be done 150 | sb.end(); 151 | 152 | ShapeRenderer consoleBackground = new ShapeRenderer(); 153 | consoleBackground.begin(ShapeType.Filled); 154 | consoleBackground.setColor(consoleColor); 155 | consoleBackground.rect(CONSOLE_X, CONSOLE_Y, (CONSOLE_W * Settings.scale), (CONSOLE_H * Settings.scale)); 156 | consoleBackground.end(); 157 | 158 | sb.begin(); 159 | 160 | float x = (CONSOLE_X + (CONSOLE_PAD_X * Settings.scale)); 161 | float y = (CONSOLE_Y + (float) Math.floor(CONSOLE_TEXT_SIZE * Settings.scale)); 162 | consoleFont.draw(sb, currentText, x, y); 163 | } 164 | } 165 | 166 | public void receivePostUpdate() { 167 | --backspaceWait; 168 | 169 | if (backspace && currentText.length() > 0) { 170 | if (backspaceWait <= 0) { 171 | currentText = currentText.substring(0, currentText.length()-1); 172 | backspaceWait = BACKSPACE_INTERVAL; 173 | } 174 | } 175 | 176 | if (Gdx.input.isKeyJustPressed(toggleKey)) { 177 | if (visible) { 178 | currentText = ""; 179 | } else { 180 | otherInputProcessor = Gdx.input.getInputProcessor(); 181 | } 182 | 183 | Gdx.input.setInputProcessor(visible ? otherInputProcessor : consoleInputProcessor); 184 | visible = !visible; 185 | } 186 | } 187 | } -------------------------------------------------------------------------------- /src/main/java/com/megacrit/cardcrawl/com.megacrit.cardcrawl.diff: -------------------------------------------------------------------------------- 1 | diff -ru src/main/java/com/megacrit/cardcrawl/core/CardCrawlGame.java src/main/java/com/megacrit/cardcrawl/core/CardCrawlGame.java 2 | --- src/main/java/com/megacrit/cardcrawl/core/CardCrawlGame.java 2018-01-19 20:30:39.812725800 -0800 3 | +++ src/main/java/com/megacrit/cardcrawl/core/CardCrawlGame.java 2018-01-21 01:09:49.853437200 -0800 4 | @@ -113,6 +113,9 @@ 5 | import org.apache.logging.log4j.LogManager; 6 | import org.apache.logging.log4j.Logger; 7 | 8 | +// BaseMod imports 9 | +import basemod.BaseMod; 10 | + 11 | public class CardCrawlGame 12 | implements ApplicationListener { 13 | public static String VERSION_NUM = "[EARLY_ACCESS_012] (01-18-2018)"; 14 | @@ -252,6 +255,9 @@ 15 | if (Settings.isDebug) { 16 | CardCrawlGame.splashScreen.isDone = true; 17 | } 18 | + 19 | + // BaseMod hook 20 | + BaseMod.publishPostInitialize(); 21 | } 22 | catch (Exception e) { 23 | ExceptionHandler.handleException(e, logger); 24 | @@ -287,9 +293,9 @@ 25 | public void migrateHelper(String file) { 26 | Preferences p = Gdx.app.getPreferences(file); 27 | Prefs p2 = SaveHelper.getPrefs(file); 28 | - Map map = p.get(); 29 | + Map map = p.get(); 30 | for (Map.Entry c : map.entrySet()) { 31 | - p2.putString(c.getKey(), p.getString(c.getKey())); 32 | + p2.putString((String)c.getKey(), p.getString((String)c.getKey())); 33 | } 34 | p2.flush(); 35 | } 36 | @@ -340,6 +346,10 @@ 37 | } 38 | } 39 | DrawMaster.draw(this.sb); 40 | + 41 | + // BaseMod hook 42 | + BaseMod.publishRender(sb); 43 | + 44 | if (CardCrawlGame.cardPopup.isOpen) { 45 | cardPopup.render(this.sb); 46 | } 47 | @@ -371,7 +381,11 @@ 48 | this.sb.draw(ImageMaster.WHITE_SQUARE_IMG, 0.0f, 0.0f, (float)(- Settings.VERT_LETTERBOX_AMT), (float)Settings.HEIGHT); 49 | this.sb.draw(ImageMaster.WHITE_SQUARE_IMG, (float)Settings.WIDTH, 0.0f, (float)Settings.VERT_LETTERBOX_AMT, (float)Settings.HEIGHT); 50 | } 51 | - this.sb.end(); 52 | + 53 | + // BaseMod hook 54 | + BaseMod.publishPostRender(sb); 55 | + 56 | + this.sb.end(); 57 | } 58 | catch (Exception e) { 59 | ExceptionHandler.handleException(e, logger); 60 | @@ -505,7 +519,7 @@ 61 | mysteryMachine = 0; 62 | } 63 | 64 | - public void update() { 65 | + public void update() { 66 | cursor.update(); 67 | screenShake.update(viewport); 68 | if (mode != GameMode.SPLASH) { 69 | @@ -532,6 +546,10 @@ 70 | this.displayCursor = !this.displayCursor; 71 | } 72 | InputHelper.updateFirst(); 73 | + 74 | + // BaseMod hook 75 | + BaseMod.publishPreUpdate(); 76 | + 77 | if (CardCrawlGame.cardPopup.isOpen) { 78 | cardPopup.update(); 79 | } 80 | @@ -650,7 +668,11 @@ 81 | default: { 82 | logger.info("Unknown Game Mode: " + mode.name()); 83 | } 84 | - } 85 | + } 86 | + 87 | + // BaseMod hook 88 | + BaseMod.publishPostUpdate(); 89 | + 90 | this.updateDebugSwitch(); 91 | InputHelper.updateLast(); 92 | if (Settings.isInfo) { 93 | diff -ru src/main/java/com/megacrit/cardcrawl/ui/buttons/CancelButton.java src/main/java/com/megacrit/cardcrawl/ui/buttons/CancelButton.java 94 | --- src/main/java/com/megacrit/cardcrawl/ui/buttons/CancelButton.java 2018-01-21 01:02:58.518447800 -0800 95 | +++ src/main/java/com/megacrit/cardcrawl/ui/buttons/CancelButton.java 2018-01-21 03:51:12.472275000 -0800 96 | @@ -29,6 +29,9 @@ 97 | import com.megacrit.cardcrawl.screens.stats.StatsScreen; 98 | import com.megacrit.cardcrawl.screens.trial.TrialScreen; 99 | 100 | +// BaseModm imports 101 | +import basemod.BaseMod; 102 | + 103 | public class CancelButton { 104 | private static final UIStrings uiStrings = CardCrawlGame.languagePack.getUIString("Cancel Button"); 105 | public static final String[] TEXT = CancelButton.uiStrings.TEXT; 106 | @@ -95,6 +98,16 @@ 107 | this.hide(); 108 | return; 109 | } 110 | + 111 | + // BaseMod modification 112 | + if (BaseMod.modSettingsUp) { 113 | + BaseMod.modSettingsUp = false; 114 | + //CardCrawlGame.mainMenuScreen.lighten(); 115 | + //CardCrawlGame.mainMenuScreen.screen = MainMenuScreen.CurScreen.MAIN_MENU; 116 | + hide(); 117 | + return; 118 | + } 119 | + 120 | if (this.buttonText.equals(TEXT[0])) { 121 | return; 122 | } 123 | diff -ru src/main/java/com/megacrit/cardcrawl/ui/buttons/EndTurnButton.java src/main/java/com/megacrit/cardcrawl/ui/buttons/EndTurnButton.java 124 | --- src/main/java/com/megacrit/cardcrawl/ui/buttons/EndTurnButton.java 2018-01-19 20:30:45.726395900 -0800 125 | +++ src/main/java/com/megacrit/cardcrawl/ui/buttons/EndTurnButton.java 2018-01-19 21:16:48.864194100 -0800 126 | @@ -32,6 +32,9 @@ 127 | import java.util.ArrayList; 128 | import java.util.Iterator; 129 | 130 | +// BaseMod imports 131 | +import basemod.DevConsole; 132 | + 133 | public class EndTurnButton { 134 | private static final TutorialStrings tutorialStrings = CardCrawlGame.languagePack.getTutorialString("End Turn Tip"); 135 | public static final String[] MSG = EndTurnButton.tutorialStrings.TEXT; 136 | @@ -91,7 +94,9 @@ 137 | } 138 | } 139 | } 140 | - if (this.hitbox.clicked || Gdx.input.isKeyJustPressed(33) && !this.isDisabled && this.enabled) { 141 | + 142 | + // BaseMod modification 143 | + if (this.hitbox.clicked || (!DevConsole.visible && Gdx.input.isKeyJustPressed(33)) && !this.isDisabled && this.enabled) { 144 | this.hitbox.clicked = false; 145 | if (!this.isDisabled && !AbstractDungeon.isScreenUp) { 146 | this.disable(true); 147 | diff -ru src/main/java/com/megacrit/cardcrawl/ui/panels/DiscardPilePanel.java src/main/java/com/megacrit/cardcrawl/ui/panels/DiscardPilePanel.java 148 | --- src/main/java/com/megacrit/cardcrawl/ui/panels/DiscardPilePanel.java 2018-01-19 20:30:45.853517300 -0800 149 | +++ src/main/java/com/megacrit/cardcrawl/ui/panels/DiscardPilePanel.java 2018-01-19 21:27:37.917842600 -0800 150 | @@ -36,6 +36,9 @@ 151 | import java.util.ArrayList; 152 | import java.util.Iterator; 153 | 154 | +// BaseMod imports 155 | +import basemod.DevConsole; 156 | + 157 | public class DiscardPilePanel 158 | extends AbstractPanel { 159 | private static final TutorialStrings tutorialStrings = CardCrawlGame.languagePack.getTutorialString("Discard Tip"); 160 | @@ -89,12 +92,14 @@ 161 | if (InputHelper.justClickedLeft && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.DISCARD_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 162 | this.openDiscardPile(); 163 | } 164 | - } else if (Gdx.input.isKeyJustPressed(47) && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.GAME_DECK_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 165 | + // BaseMod modification 166 | + } else if (!DevConsole.visible && Gdx.input.isKeyJustPressed(47) && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.GAME_DECK_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 167 | this.openDiscardPile(); 168 | return; 169 | } 170 | if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.DISCARD_VIEW) { 171 | - if (this.bannerHitbox.hovered && InputHelper.justClickedLeft || Gdx.input.isKeyJustPressed(47)) { 172 | + // BaseMod modification 173 | + if (this.bannerHitbox.hovered && InputHelper.justClickedLeft || (!DevConsole.visible && Gdx.input.isKeyJustPressed(47))) { 174 | this.hitbox.hovered = false; 175 | this.bannerHitbox.hovered = false; 176 | InputHelper.justClickedLeft = false; 177 | diff -ru src/main/java/com/megacrit/cardcrawl/ui/panels/DrawPilePanel.java src/main/java/com/megacrit/cardcrawl/ui/panels/DrawPilePanel.java 178 | --- src/main/java/com/megacrit/cardcrawl/ui/panels/DrawPilePanel.java 2018-01-19 20:30:45.866530600 -0800 179 | +++ src/main/java/com/megacrit/cardcrawl/ui/panels/DrawPilePanel.java 2018-01-19 21:28:25.853573500 -0800 180 | @@ -39,6 +39,9 @@ 181 | import java.util.ArrayList; 182 | import java.util.Iterator; 183 | 184 | +// BaseMod imports 185 | +import basemod.DevConsole; 186 | + 187 | public class DrawPilePanel 188 | extends AbstractPanel { 189 | private static final TutorialStrings tutorialStrings = CardCrawlGame.languagePack.getTutorialString("Draw Tip"); 190 | @@ -91,12 +94,14 @@ 191 | if (InputHelper.justClickedLeft && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.GAME_DECK_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 192 | this.openDrawPile(); 193 | } 194 | - } else if (Gdx.input.isKeyJustPressed(29) && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.GAME_DECK_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 195 | + // BaseMod modification 196 | + } else if (!DevConsole.visible && Gdx.input.isKeyJustPressed(29) && AbstractDungeon.getMonsters() != null && !AbstractDungeon.isScreenUp && AbstractDungeon.screen != AbstractDungeon.CurrentScreen.GAME_DECK_VIEW && !AbstractDungeon.getMonsters().areMonstersDead()) { 197 | this.openDrawPile(); 198 | return; 199 | } 200 | if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.GAME_DECK_VIEW) { 201 | - if (this.bannerHitbox.hovered && InputHelper.justClickedLeft || Gdx.input.isKeyJustPressed(29)) { 202 | + // BaseMod modification 203 | + if (this.bannerHitbox.hovered && InputHelper.justClickedLeft || (!DevConsole.visible && Gdx.input.isKeyJustPressed(29))) { 204 | this.hitbox.hovered = false; 205 | this.bannerHitbox.hovered = false; 206 | InputHelper.justClickedLeft = false; 207 | diff -ru src/main/java/com/megacrit/cardcrawl/ui/panels/TopPanel.java src/main/java/com/megacrit/cardcrawl/ui/panels/TopPanel.java 208 | --- src/main/java/com/megacrit/cardcrawl/ui/panels/TopPanel.java 2018-01-19 20:30:45.961622700 -0800 209 | +++ src/main/java/com/megacrit/cardcrawl/ui/panels/TopPanel.java 2018-01-19 21:41:05.589296700 -0800 210 | @@ -45,6 +45,9 @@ 211 | import com.megacrit.cardcrawl.ui.panels.PotionPopUp; 212 | import java.util.ArrayList; 213 | 214 | +// BaseMod imports 215 | +import basemod.DevConsole; 216 | + 217 | public class TopPanel { 218 | private static final TutorialStrings tutorialStrings = CardCrawlGame.languagePack.getTutorialString("Top Panel Tips"); 219 | public static final String[] MSG = TopPanel.tutorialStrings.TEXT; 220 | @@ -324,7 +327,8 @@ 221 | this.deckButtonDisabled = true; 222 | this.deckHb.hovered = false; 223 | } 224 | - if (this.deckHb.hovered && InputHelper.justClickedLeft || Gdx.input.isKeyJustPressed(32)) { 225 | + // BaseMod modification 226 | + if (this.deckHb.hovered && InputHelper.justClickedLeft || (!DevConsole.visible && Gdx.input.isKeyJustPressed(32))) { 227 | if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.COMBAT_REWARD) { 228 | AbstractDungeon.closeCurrentScreen(); 229 | AbstractDungeon.deckViewScreen.open(); 230 | @@ -383,7 +387,8 @@ 231 | this.mapButtonDisabled = true; 232 | this.mapHb.hovered = false; 233 | } 234 | - if (this.mapHb.hovered && InputHelper.justClickedLeft || Gdx.input.isKeyJustPressed(41)) { 235 | + // BaseMod modification 236 | + if (this.mapHb.hovered && InputHelper.justClickedLeft || (!DevConsole.visible && Gdx.input.isKeyJustPressed(41))) { 237 | if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.MAP && !AbstractDungeon.dungeonMapScreen.dismissable) { 238 | CardCrawlGame.sound.play("CARD_REJECT"); 239 | } else if (!AbstractDungeon.isScreenUp) { 240 | --------------------------------------------------------------------------------