mirror of
https://github.com/JonasunderscoreJones/Microcraft.git
synced 2025-10-24 20:29:17 +02:00
Added Board Pixelart and did some code Cleanup and package management
Introduction of Board Pixel-Art of Arduino Nano, Uno and Pro Mini Code Cleanup and Verbose Logger management
This commit is contained in:
parent
086b128551
commit
79fa4fbabc
24 changed files with 21 additions and 21 deletions
Binary file not shown.
|
After Width: | Height: | Size: 2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -18,14 +18,11 @@ public class ArduinoControls implements ClientModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
// register configs
|
||||
ModConfigs.registerConfigs();
|
||||
|
||||
//message from mod to confirm that it has been loaded
|
||||
LOGGER.info("UwU from Arduino Controls!");
|
||||
|
||||
//make verbose logger show that it is active
|
||||
VerboseLogger.info("Verbose Logger is now logging.");
|
||||
// register configs
|
||||
ModConfigs.registerConfigs();
|
||||
|
||||
//blink LED on startup
|
||||
/*try {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package me.jonasjones.arduinoctrls.config;
|
|||
import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import me.jonasjones.arduinoctrls.ArduinoControls;
|
||||
import me.jonasjones.arduinoctrls.util.VerboseLogger;
|
||||
|
||||
public class ModConfigs {
|
||||
public static SimpleConfig CONFIGMAIN;
|
||||
|
|
@ -17,6 +18,7 @@ public class ModConfigs {
|
|||
public static Boolean BOARDMELTING;
|
||||
public static Boolean VERBOSE = false; //needs to be set to false since the verbose logger is called before config file is fully loaded
|
||||
public static String EDITOR;
|
||||
public static String CUSTOMEDITOR;
|
||||
|
||||
//configList
|
||||
public static Boolean DISPLAYENTRYALL;
|
||||
|
|
@ -47,6 +49,11 @@ public class ModConfigs {
|
|||
CONFIGLISTS = SimpleConfig.of(ArduinoControls.MOD_ID + "-lists").provider(configLists).request();
|
||||
|
||||
assignConfigs();
|
||||
|
||||
//make verbose logger show that it is active and print configs to logger
|
||||
VerboseLogger.info("Verbose Logger is now logging.");
|
||||
VerboseLogger.info("Loaded config file CONFIGMAIN successfully: " + configMain.getConfigsList().size() + " configurations have been set properly");
|
||||
VerboseLogger.info("Loaded config file CONFIGMAIN successfully: " + configLists.getConfigsList().size() + " configurations have been set properly");
|
||||
}
|
||||
|
||||
private static void createConfigs() {
|
||||
|
|
@ -57,6 +64,7 @@ public class ModConfigs {
|
|||
configMain.addKeyValuePair(new Pair<>("fun.boardMelting", false), "Whether or not the board should have a flame overlay instead of being greyed out when not connected.");
|
||||
configMain.addKeyValuePair(new Pair<>("debug.verbose", false), "Toggle verbose console output.");
|
||||
configMain.addKeyValuePair(new Pair<>("editor.default", "ingame"), "The default editor for the board program. All valid default Editors can be found at: https://github.com/J-onasJones/MicrocontrollerMC/wiki/Board-Program-Editors#available-editors");
|
||||
configMain.addKeyValuePair(new Pair<>("editor.custom", "None"), "The editor to choose if 'editor.default' is set to 'custom'.");
|
||||
|
||||
//configLists
|
||||
configLists.addKeyValuePair(new Pair<>("displayEntry.all", false), "Whether or not to display all entries. This overrides all other states except for debug and experimental entries. More infos can be found at: https://github.com/J-onasJones/MicrocontrollerMC/wiki/Pin-Map-Entries#list-of-all-entries");
|
||||
|
|
@ -76,7 +84,6 @@ public class ModConfigs {
|
|||
configLists.addKeyValuePair(new Pair<>("displayEntryIs.playerWalkRight", true), "Display Is Player Walking Right Entry");
|
||||
configLists.addKeyValuePair(new Pair<>("displayEntryIs.playerWalkLeft", true), "Display Is Player Walking Left Entry");
|
||||
configLists.addKeyValuePair(new Pair<>("displayEntryIs.playerSneak", true), "Display Is Player Sneaking Entry");
|
||||
|
||||
}
|
||||
|
||||
private static void assignConfigs() {
|
||||
|
|
@ -86,6 +93,7 @@ public class ModConfigs {
|
|||
BOARDMELTING = CONFIGMAIN.getOrDefault("fun.boardMelting", false);
|
||||
VERBOSE = CONFIGMAIN.getOrDefault("debug.verbose", false);
|
||||
EDITOR = CONFIGMAIN.getOrDefault("editor.default", "ingame");
|
||||
CUSTOMEDITOR = CONFIGMAIN.getOrDefault("editor.custom", "None");
|
||||
|
||||
DISPLAYENTRYALL = CONFIGLISTS.getOrDefault("displayEntry.all", false);
|
||||
DISPLAYENTRYPLAYERJUMP = CONFIGLISTS.getOrDefault("displayEntry.playerJump", true);
|
||||
|
|
@ -104,7 +112,5 @@ public class ModConfigs {
|
|||
DISPLAYENTRYISPLAYERWALKRIGHT = CONFIGLISTS.getOrDefault("displayEntryIs.playerWalkRight", true);
|
||||
DISPLAYENTRYISPLAYERWALKLEFT = CONFIGLISTS.getOrDefault("displayEntryIs.playerWalkLeft", true);
|
||||
DISPLAYENTRYISPLAYERSNEAK = CONFIGLISTS.getOrDefault("displayEntryIs.playerSneak", true);
|
||||
|
||||
System.out.println("All " + configMain.getConfigsList().size() + " have been set properly");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ package me.jonasjones.arduinoctrls.config;
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import me.jonasjones.arduinoctrls.ArduinoControls;
|
||||
import me.jonasjones.arduinoctrls.util.VerboseLogger;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
|
|
@ -137,13 +138,13 @@ public class SimpleConfig {
|
|||
String identifier = "Config '" + request.filename + "'";
|
||||
|
||||
if( !request.file.exists() ) {
|
||||
VerboseLogger.info( identifier + " is missing, generating default one..." );
|
||||
ArduinoControls.LOGGER.info( identifier + " is missing, generating default one..." );
|
||||
|
||||
try {
|
||||
createConfig();
|
||||
} catch (IOException e) {
|
||||
VerboseLogger.error( identifier + " failed to generate!" );
|
||||
VerboseLogger.trace(String.valueOf(e));
|
||||
ArduinoControls.LOGGER.error( identifier + " failed to generate!" );
|
||||
ArduinoControls.LOGGER.trace(String.valueOf(e));
|
||||
broken = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -152,8 +153,8 @@ public class SimpleConfig {
|
|||
try {
|
||||
loadConfig();
|
||||
} catch (Exception e) {
|
||||
VerboseLogger.error( identifier + " failed to load!" );
|
||||
VerboseLogger.trace(String.valueOf(e));
|
||||
ArduinoControls.LOGGER.error( identifier + " failed to load!" );
|
||||
ArduinoControls.LOGGER.trace(String.valueOf(e));
|
||||
broken = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package me.jonasjones.arduinoctrls.gui;
|
||||
package me.jonasjones.arduinoctrls.gui.screens;
|
||||
|
||||
import me.jonasjones.arduinoctrls.gui.screens.ModSettings;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package me.jonasjones.arduinoctrls.gui.screens;
|
||||
|
||||
import me.jonasjones.arduinoctrls.gui.SelectDevice;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.option.SoundOptionsScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package me.jonasjones.arduinoctrls.gui;
|
||||
package me.jonasjones.arduinoctrls.gui.screens;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package me.jonasjones.arduinoctrls.mixin;
|
||||
|
||||
import me.jonasjones.arduinoctrls.gui.GuiHome;
|
||||
import me.jonasjones.arduinoctrls.gui.SelectDevice;
|
||||
import me.jonasjones.arduinoctrls.gui.screens.GuiHome;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package me.jonasjones.arduinoctrls.mixin;
|
||||
|
||||
import me.jonasjones.arduinoctrls.gui.GuiHome;
|
||||
import me.jonasjones.arduinoctrls.gui.screens.GuiHome;
|
||||
import net.minecraft.client.gui.screen.GameMenuScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
|
|
|
|||
BIN
src/main/resources/assets/arduinoctrls/boards/arduino-nano.png
Normal file
BIN
src/main/resources/assets/arduinoctrls/boards/arduino-nano.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/main/resources/assets/arduinoctrls/boards/arduino-uno.png
Normal file
BIN
src/main/resources/assets/arduinoctrls/boards/arduino-uno.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue