├── .gitignore ├── LICENSE ├── PokEditor.iml ├── README.md ├── WinLaF.jar ├── pom.xml └── src └── main ├── java └── io │ └── github │ └── turtleisaac │ └── pokeditor │ ├── DataManager.java │ ├── Main.java │ ├── framework │ ├── ArrayModifier.java │ ├── ArrayProcessor.java │ ├── BitStream.java │ ├── BitVector.java │ ├── CsvReader.java │ ├── Directory.java │ ├── InvalidStringException.java │ ├── JarClassLoader.java │ ├── SheetException.java │ ├── SheetExceptionFactory.java │ └── XmlReader.java │ ├── gui │ ├── ConsoleWindow.java │ ├── ConsoleWindow.jfd │ ├── EditorComboBox.java │ ├── PokeditorManager.java │ ├── editors │ │ ├── data │ │ │ ├── DefaultDataEditor.java │ │ │ ├── DefaultDataEditorPanel.java │ │ │ ├── DefaultDataEditorPanel.jfd │ │ │ ├── EditorDataModel.java │ │ │ └── formats │ │ │ │ ├── pokemon_sprite │ │ │ │ ├── PokemonSpriteEditor.java │ │ │ │ └── PokemonSpriteEditor.jfd │ │ │ │ ├── scripts │ │ │ │ ├── ScriptDocument.java │ │ │ │ ├── ScriptPane.java │ │ │ │ └── field │ │ │ │ │ ├── FieldScriptEditor.java │ │ │ │ │ └── FieldScriptEditor.jfd │ │ │ │ └── trainer_sprite │ │ │ │ ├── TrainerSpriteEditor.java │ │ │ │ └── TrainerSpriteEditor.jfd │ │ └── general │ │ │ ├── GeneralEditorPanel.java │ │ │ ├── GeneralEditorPanel.jfd │ │ │ └── starters │ │ │ ├── StarterEditor.java │ │ │ └── StarterEditor.jfd │ └── sheets │ │ ├── DefaultSheetPanel.java │ │ ├── DefaultSheetPanel.jfd │ │ ├── FindDialog.java │ │ ├── FindDialog.jfd │ │ └── tables │ │ ├── DefaultTable.java │ │ ├── FormatModel.java │ │ ├── FrozenColumnTable.java │ │ ├── cells │ │ ├── CellTypes.java │ │ ├── editors │ │ │ ├── BitfieldComboBoxEditor.java │ │ │ ├── CheckBoxEditor.java │ │ │ ├── ComboBoxCellEditor.java │ │ │ └── NumberOnlyCellEditor.java │ │ └── renderers │ │ │ ├── BitfieldStringCellRenderer.java │ │ │ ├── CheckBoxRenderer.java │ │ │ ├── DefaultSheetCellRenderer.java │ │ │ ├── IndexedStringCellRenderer.java │ │ │ └── MultiLineTableHeaderRenderer.java │ │ └── formats │ │ ├── EvolutionsTable.java │ │ ├── ItemsTable.java │ │ ├── LearnsetsTable.java │ │ ├── MovesTable.java │ │ ├── PersonalTable.java │ │ └── TmCompatibilityTable.java │ ├── gui_old │ ├── CircleButton.java │ ├── JCheckboxTree.java │ ├── JRoundButton.java │ ├── editors │ │ ├── encounters │ │ │ ├── SearchResultsFrame.java │ │ │ ├── SearchResultsFrame.jfd │ │ │ ├── johto │ │ │ │ └── JohtoEncounterPanel.jfd │ │ │ └── sinnoh │ │ │ │ └── SinnohEncounterPanel.jfd │ │ └── trainers │ │ │ ├── SmogonFrame.java │ │ │ ├── SmogonFrame.jfd │ │ │ ├── TrainerPanel.jfd │ │ │ ├── TrainerPokemonPanel.jfd │ │ │ ├── classes │ │ │ ├── ClassPanel.java │ │ │ └── ClassPanel.jfd │ │ │ └── text │ │ │ ├── TrainerTextEntryPanel.java │ │ │ ├── TrainerTextEntryPanel.jfd │ │ │ ├── TrainerTextFrame.java │ │ │ └── TrainerTextFrame.jfd │ └── tutorial │ │ ├── TutorialFrame.java │ │ └── TutorialFrame.jfd │ └── utilities │ └── TrainerPersonalityCalculator.java └── resources └── pokeditor ├── icons ├── arrowdown.png ├── arrowleft.png ├── arrowright.png ├── arrowup.png ├── background.png ├── black.png ├── black2.png ├── building_editor.png ├── clearflag.png ├── closemsg.png ├── cross.png ├── diamond.png ├── dualslot_encounters.png ├── egg.png ├── error.png ├── event_editor.png ├── folder_warning.png ├── give_badge.png ├── give_pokedex.png ├── give_pokegear.png ├── give_shoes.png ├── giveitem.png ├── givemom.png ├── good_rod_encounters.png ├── health_opponent.png ├── health_you.png ├── heartgold.png ├── icon.png ├── legendary_battle.png ├── map_editor.png ├── map_header.png ├── matrix_editor.png ├── message.png ├── money.png ├── old_rod_encounters.png ├── open_file.png ├── pearl.png ├── platform_opponent.png ├── platform_you.png ├── platinum.png ├── pokeball.png ├── pokéradar_encounters.png ├── radio_encounters.png ├── rock_smash_encounters.png ├── save_rom.png ├── script_editor.png ├── setflag.png ├── shadow_large.png ├── shadow_medium.png ├── shadow_small.png ├── soulsilver.png ├── super_rod_encounters.png ├── svg │ ├── clipboard-copy.svg │ ├── copy.svg │ ├── list-search.svg │ ├── row-insert-bottom.svg │ ├── row-remove.svg │ ├── table-export.svg │ └── table-import.svg ├── symbol_female.png ├── symbol_male.png ├── takeitem.png ├── takemom.png ├── takemoney.png ├── text_bar.png ├── text_editor.png ├── texture_background.png ├── tick.png ├── tileset_editor.png ├── trainer_battle.png ├── underwater_background.png ├── walking_encounters_dppt.png ├── walking_encounters_hgss.png ├── white.png ├── white2.png ├── wild_battle.png └── wild_editor.png ├── sheet_panel.properties ├── sheet_strings.properties ├── sheet_strings_fr.properties └── sheet_strings_zh.properties /.gitignore: -------------------------------------------------------------------------------- 1 | /src/META-INF/ 2 | /button.png 3 | /Platinum.nds 4 | /pokeditor_config 5 | /TestProject.nds 6 | /lib/ 7 | /Master Template Projects/ 8 | /NewProject/ 9 | /out/ 10 | /PokEditor/ 11 | /Program Files/ 12 | /releases/ 13 | /roms/ 14 | /PokEditor/ 15 | /doNotInclude/ 16 | /extracted/ 17 | /Found/ 18 | /Gen 5 Editing Information/ 19 | /GoogleSheetsAPI/out/ 20 | -------------------------------------------------------------------------------- /PokEditor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PokEditor v3 2 | 3 | **Author: Turtleisaac** 4 | 5 | Multifunctional in-depth editor for Pokémon Gen IV (4) game data. 6 | 7 | Written entirely in Java and is completely OS-agnostic. 8 | 9 | **Java 20 is required.** Newer versions may work, but if older classes have been deprecated or removed in those versions, then it may not work for those higher versions of Java. 10 | * The majority of the backend can be found in my other library, [PokEditor-Core](https://github.com/turtleisaac/PokEditor-Core). 11 | * Also powered by my other libraries, [Nds4j](https://github.com/turtleisaac/Nds4j) and [Nds4j-ToolUI](https://github.com/turtleisaac/Nds4j-ToolUI). 12 | * This tool is still in active development and will receive periodic updates as improvements are made and bugs are found, time permitting. 13 | * Please join [this Discord server](https://discord.gg/zAtqJDW2jC) for help with using PokEditor v3 or for help with any questions relating to Pokémon Gen 4 and 5 hacking. 14 | * Currently can be used in English and has partial French and Chinese support. 15 | 16 | image 17 | 18 | image 19 | 20 | image 21 | 22 | 23 | # Usage 24 | 25 | Builds are available in the [Releases page here on GitHub](https://github.com/turtleisaac/PokEditor/releases). Simply download the most recent release, unzip the zip file, and double click the file contained within with the name **PokEditor.jar**! 26 | 27 | Unlike prior versions of PokEditor, v3 is intended to fully be used within the tool. No more exporting sheets or editing them elsewhere. Additionally, there is very little effort required by the user to get it set up this time around. No more annoying sheets setup process, it should just automatically load everything into the sheets the instant you open a project. 28 | 29 | # List of Spreadsheet-Based Editors 30 | 31 | * Personal Data Editor 32 | 33 | * TM Learnset Editor) 34 | 35 | * Level-Up Learnset Editor 36 | 37 | [//]: # () 38 | [//]: # (* Encounter Editor (also has a GUI-based editor) (currently incomplete)) 39 | 40 | * Evolutions Editor 41 | 42 | [//]: # () 43 | [//]: # (* Item Editor) 44 | 45 | * Move Editor 46 | 47 | [//]: # () 48 | [//]: # (* Move Tutor Editor (moves taught and compatibility)) 49 | 50 | [//]: # () 51 | [//]: # (* Baby Form Editor (what hatches from an egg)) 52 | 53 | [//]: # () 54 | [//]: # (* Trainer Editor (also has a GUI-based editor)) 55 | 56 | # GUI-Based Editors 57 | 58 | [//]: # () 59 | [//]: # (* Trainer Editor) 60 | 61 | [//]: # ( * Trainer Text Editor) 62 | 63 | [//]: # ( * Nature & IV Calculator) 64 | 65 | [//]: # ( * Smogon Format Team Import/Export) 66 | 67 | * Pokémon Sprite Editor 68 | 69 | [//]: # ( * Palette Editor) 70 | 71 | [//]: # ( * Sprite XY-Coordinate Placement Editor) 72 | 73 | [//]: # ( * Sprite Shadow Placement Editor) 74 | 75 | [//]: # ( * Sprite Shadow Size Editor) 76 | 77 | [//]: # ( * Send-out Movement/Animation Editor) 78 | -------------------------------------------------------------------------------- /WinLaF.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/WinLaF.jar -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.github.turtleisaac 8 | PokEditor 9 | 3.0-SNAPSHOT 10 | 11 | 12 | 20 13 | 20 14 | UTF-8 15 | 16 | 17 | 18 | 19 | org.junit.jupiter 20 | junit-jupiter 21 | 5.9.2 22 | test 23 | 24 | 25 | junit 26 | junit 27 | 4.13.2 28 | test 29 | 30 | 31 | org.assertj 32 | assertj-core 33 | 3.24.2 34 | test 35 | 36 | 37 | 38 | 39 | com.formdev 40 | flatlaf 41 | 3.2.1 42 | 43 | 44 | 45 | 46 | com.formdev 47 | flatlaf-intellij-themes 48 | 3.2.1 49 | 50 | 51 | 52 | com.formdev 53 | flatlaf-extras 54 | 3.2.1 55 | 56 | 57 | 58 | com.github.weisj 59 | jsvg 60 | 1.2.0 61 | 62 | 63 | 64 | 65 | com.miglayout 66 | miglayout 67 | 3.7.4 68 | 69 | 70 | 71 | 72 | com.jidesoft 73 | jide-oss 74 | 3.6.18 75 | 76 | 77 | 78 | 79 | org.eclipse.jgit 80 | org.eclipse.jgit 81 | 6.7.0.202309050840-r 82 | 83 | 84 | 85 | com.fasterxml.jackson.dataformat 86 | jackson-dataformat-xml 87 | 2.15.2 88 | 89 | 90 | 91 | com.google.inject 92 | guice 93 | 7.0.0 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | io.github.turtleisaac 107 | Nds4j 108 | 0.1.0 109 | 110 | 111 | io.github.turtleisaac 112 | PokEditor-Core 113 | 1.0-SNAPSHOT 114 | 115 | 116 | io.github.turtleisaac 117 | Nds4j-ToolUI 118 | 1.0-SNAPSHOT 119 | 120 | 121 | io.github.turtleisaac 122 | VariableTracker 123 | 1.0-SNAPSHOT 124 | 125 | 126 | 127 | 128 | 129 | 130 | io.github.turtleisaac 131 | WinLaF 132 | 1.0.0 133 | system 134 | ${project.basedir}/WinLaF.jar 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/Main.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor; 2 | 3 | import com.formdev.flatlaf.intellijthemes.*; 4 | import io.github.turtleisaac.nds4j.ui.ProgramType; 5 | import io.github.turtleisaac.nds4j.ui.Tool; 6 | import io.github.turtleisaac.pokeditor.gui.PokeditorManager; 7 | import io.github.turtleisaac.pokeditor.gui.ConsoleWindow; 8 | 9 | import java.io.IOException; 10 | import java.nio.charset.StandardCharsets; 11 | 12 | /** 13 | * @author turtleisaac 14 | */ 15 | public class Main 16 | { 17 | private static ConsoleWindow console; 18 | private static final String jokesPath = "/pokeditor/jokes.txt"; 19 | 20 | public static void main(String[] args) throws IOException 21 | { 22 | String[] mainMenuJokes = new String(Main.class.getResourceAsStream(jokesPath).readAllBytes(), StandardCharsets.UTF_8).split("\n"); 23 | 24 | // Locale.setDefault(Locale.CHINA); 25 | Tool tool = Tool.create(); 26 | tool.setType(ProgramType.PROJECT) 27 | .setName("PokEditor") 28 | .setVersion("3.1.1") 29 | // .setFlavorText("Did you know that Jay likes Moemon?") 30 | .setFlavorText(mainMenuJokes[(int) (Math.random()*(mainMenuJokes.length))]) 31 | .setAuthor("Developed by Turtleisaac") 32 | .setGitEnabled(true) 33 | .addLookAndFeel(new FlatArcOrangeIJTheme()) 34 | .addLookAndFeel(new FlatDarkPurpleIJTheme()) 35 | // .addLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()) 36 | .addGame("Pokémon Platinum", "CPU") 37 | .addGame("Pokémon HeartGold","IPK") 38 | .addGame("Pokémon SoulSilver","IPG") 39 | .addPanelManager(() -> new PokeditorManager(tool)) 40 | .init(); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/ArrayModifier.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | import java.util.Arrays; 4 | 5 | public class ArrayModifier 6 | { 7 | public static Object[][] trim(Object[][] arr, int rows, int cols) 8 | { 9 | arr= Arrays.copyOfRange(arr,rows,arr.length); 10 | 11 | for(int i= 0; i < arr.length; i++) 12 | { 13 | // System.out.println(Arrays.toString(arr[i])); 14 | arr[i]= Arrays.copyOfRange(arr[i], cols, arr[i].length); 15 | // System.out.println(Arrays.toString(arr[i]) + "\n"); 16 | } 17 | 18 | return arr; 19 | } 20 | 21 | public static Object[] getColumn(Object[][] arr, int col) 22 | { 23 | Object[] ret= new Object[arr.length]; 24 | Arrays.fill(ret, ""); 25 | for(int i= 0; i < arr.length; i++) 26 | { 27 | if (col >= arr[i].length) 28 | break; 29 | 30 | ret[i]= arr[i][col]; 31 | } 32 | 33 | return ret; 34 | } 35 | 36 | public static String[] accommodateLength(String[] arr, int targetLength) 37 | { 38 | arr= Arrays.copyOf(arr,targetLength); 39 | 40 | for(int i= 0; i < arr.length; i++) 41 | { 42 | if(arr[i] == null) 43 | arr[i]= "" + i; 44 | } 45 | 46 | return arr; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/ArrayProcessor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | public class ArrayProcessor 8 | { 9 | private List data; 10 | private String line; 11 | private int numColumns; 12 | 13 | public ArrayProcessor() 14 | { 15 | data= new ArrayList<>(); 16 | numColumns= 0; 17 | } 18 | 19 | public ArrayProcessor(String str) 20 | { 21 | data= new ArrayList<>(); 22 | line= str; 23 | numColumns= 0; 24 | } 25 | 26 | public ArrayProcessor(int numColumns) 27 | { 28 | data= new ArrayList<>(); 29 | this.numColumns= numColumns; 30 | } 31 | 32 | public void append(String str) 33 | { 34 | if(line == null) 35 | line= str; 36 | else 37 | line+= str; 38 | } 39 | 40 | public void substring(int start, int end) 41 | { 42 | line= line.substring(start,end); 43 | } 44 | 45 | public void substring(int start) 46 | { 47 | line= line.substring(start); 48 | } 49 | 50 | public void newLine() 51 | { 52 | String[] arr; 53 | // System.out.println(Arrays.toString(line.split(","))); 54 | if(line.endsWith(",")) 55 | line= line.substring(0,line.length()-1); 56 | 57 | if(numColumns != 0) 58 | { 59 | arr= new String[numColumns]; 60 | Arrays.fill(arr,""); 61 | System.arraycopy(line.split(","),0,arr,0,line.split(",").length); 62 | } 63 | else 64 | arr= line.split(","); 65 | 66 | data.add(arr); 67 | line= ""; 68 | } 69 | 70 | public Object[][] getTable() 71 | { 72 | Object[][] table= new Object[data.size()][]; 73 | 74 | for(int i= 0; i < data.size(); i++) 75 | { 76 | table[i]= data.get(i); 77 | } 78 | 79 | return table; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/BitStream.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | import java.util.Arrays; 4 | 5 | public class BitStream { 6 | 7 | private byte[] bytes; 8 | private int nextBit; 9 | 10 | private static final int DEFAULT_CAPACITY = 1024*Byte.SIZE; 11 | private static final String STRING_ZEROS = "0000000"; 12 | 13 | public BitStream() { 14 | this(DEFAULT_CAPACITY); 15 | } 16 | 17 | public BitStream(int initialCapacity) { 18 | nextBit = 0; 19 | if (initialCapacity%Byte.SIZE != 0) { 20 | ++initialCapacity; 21 | } 22 | bytes = new byte[initialCapacity]; 23 | } 24 | 25 | public void append(boolean value) { 26 | ensureSize(); 27 | if (value) { 28 | bytes[nextBit / Byte.SIZE] |= 1 << (nextBit % Byte.SIZE); 29 | } 30 | ++nextBit; 31 | } 32 | 33 | public void append(byte b) { 34 | for (int i=0; i fileLines= new ArrayList<>(); 51 | BufferedReader reader= new BufferedReader(new FileReader(filePath)); 52 | String line; 53 | while((line= reader.readLine()) != null) 54 | { 55 | fileLines.add(line); 56 | } 57 | reader.close(); 58 | for(; firstY != 0; firstY--) 59 | { 60 | fileLines.remove(0); 61 | } 62 | 63 | 64 | String[][] fileData= new String[fileLines.size()][]; 65 | int x; 66 | for(int i= 0; i < fileLines.size(); i++) 67 | { 68 | x= firstX; 69 | String thisLine= fileLines.get(i); 70 | for(; x != 0; x--) 71 | { 72 | thisLine= thisLine.substring(thisLine.indexOf(",")+1); 73 | } 74 | thisLine= thisLine.replaceAll("×","x"); 75 | fileData[i]= thisLine.split(","); 76 | } 77 | return fileData; 78 | } 79 | 80 | public String[] next() 81 | { 82 | if(line == in.length) 83 | { 84 | return null; 85 | } 86 | else 87 | { 88 | return in[line++]; 89 | } 90 | } 91 | 92 | public int length() 93 | { 94 | return in.length; 95 | } 96 | 97 | public void skipLine() { 98 | next(); 99 | } 100 | 101 | public String[][] getCsv() 102 | { 103 | return in; 104 | } 105 | 106 | public String getCell(int row, int col) 107 | { 108 | return in[row][col]; 109 | } 110 | 111 | public void print() 112 | { 113 | String cyan= "\u001b[36m"; 114 | String red= "\u001b[31m"; 115 | String reset= "\u001b[0m"; 116 | 117 | int[] columnWidths= new int[in.length]; 118 | Arrays.fill(columnWidths,Integer.MIN_VALUE); 119 | 120 | for (String[] strings : in) 121 | { 122 | for (int y = 0; y < strings.length; y++) 123 | { 124 | if (columnWidths[y] < strings[y].length()) { 125 | columnWidths[y]= strings[y].length(); 126 | } 127 | } 128 | } 129 | 130 | for(int i= 0; i < columnWidths.length; i++) 131 | { 132 | columnWidths[i]= Math.min(columnWidths[i], 15); 133 | } 134 | 135 | StringBuilder line; 136 | for(int x= 0; x < in.length; x++) 137 | { 138 | line= new StringBuilder(); 139 | for(int y= 0; y < in[x].length; y++) 140 | { 141 | line.append("│"); 142 | if(in[x][y].length() <= 15) 143 | { 144 | line.append(fixString(in[x][y],columnWidths[y])); 145 | } 146 | else 147 | { 148 | line.append(fixString(in[x][y].substring(0,10) + "...",columnWidths[y])); 149 | } 150 | 151 | if(y == in[x].length-1) 152 | { 153 | line.append("│"); 154 | } 155 | } 156 | 157 | if(x == 0) 158 | { 159 | 160 | for(int i= 0; i < line.toString().length(); i++) 161 | { 162 | if(line.toString().charAt(i) == '│') 163 | { 164 | System.out.print(cyan + "┼" + reset); 165 | } 166 | else 167 | { 168 | final String substring = line.toString().substring(i, i + 1); 169 | if(!substring.equals(cyan) && !substring.equals(red) && !substring.equals(reset)) 170 | { 171 | System.out.print(cyan + "-" + reset); 172 | } 173 | } 174 | } 175 | System.out.println(); 176 | } 177 | 178 | System.out.println(line.toString()); 179 | for(int i= 0; i < line.toString().length(); i++) 180 | { 181 | if(line.toString().charAt(i) == '│') 182 | { 183 | System.out.print(cyan + "┼" + reset); 184 | } 185 | else 186 | { 187 | System.out.print(cyan + "-" + reset); 188 | } 189 | } 190 | System.out.println(); 191 | } 192 | } 193 | 194 | private String fixString(String str, int targetLength) 195 | { 196 | StringBuilder strBuilder = new StringBuilder(str); 197 | while(strBuilder.length() != targetLength){ 198 | strBuilder.append(" "); 199 | } 200 | str = strBuilder.toString(); 201 | return str; 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/Directory.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | import java.io.File; 4 | import java.util.Objects; 5 | 6 | public class Directory extends File 7 | { 8 | public Directory(String pathname) 9 | { 10 | super(pathname); 11 | } 12 | 13 | @Override 14 | public boolean delete() 15 | { 16 | clearDirectory(this); 17 | return true; 18 | } 19 | 20 | private void clearDirectory(File directory) 21 | { 22 | for(File subfile : Objects.requireNonNull(directory.listFiles())) 23 | { 24 | if(subfile.isDirectory()) 25 | { 26 | clearDirectory(subfile); 27 | } 28 | else 29 | { 30 | subfile.delete(); 31 | } 32 | } 33 | directory.delete(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/InvalidStringException.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | public class InvalidStringException extends RuntimeException 4 | { 5 | public InvalidStringException(String error) { 6 | super(error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/JarClassLoader.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | /* 4 | * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * - Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * - Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * - Neither the name of Oracle or the names of its 18 | * contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 22 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 25 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 28 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | import java.net.URL; 35 | import java.net.URLClassLoader; 36 | import java.net.JarURLConnection; 37 | import java.lang.reflect.Method; 38 | import java.lang.reflect.Modifier; 39 | import java.lang.reflect.InvocationTargetException; 40 | import java.util.jar.Attributes; 41 | import java.io.IOException; 42 | 43 | /** 44 | * A class loader for loading jar files, both local and remote. 45 | */ 46 | class JarClassLoader extends URLClassLoader { 47 | private URL url; 48 | 49 | /** 50 | * Creates a new JarClassLoader for the specified url. 51 | * 52 | * @param url the url of the jar file 53 | */ 54 | public JarClassLoader(URL url) { 55 | super(new URL[] { url }); 56 | this.url = url; 57 | } 58 | 59 | /** 60 | * Returns the name of the jar file main class, or null if 61 | * no "Main-Class" manifest attributes was defined. 62 | */ 63 | public String getMainClassName() throws IOException { 64 | URL u = new URL("jar", "", url + "!/"); 65 | JarURLConnection uc = (JarURLConnection)u.openConnection(); 66 | Attributes attr = uc.getMainAttributes(); 67 | return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null; 68 | } 69 | 70 | /** 71 | * Invokes the application in this jar file given the name of the 72 | * main class and an array of arguments. The class must define a 73 | * static method "main" which takes an array of String arguemtns 74 | * and is of return type "void". 75 | * 76 | * @param name the name of the main class 77 | * @param args the arguments for the application 78 | * @exception ClassNotFoundException if the specified class could not 79 | * be found 80 | * @exception NoSuchMethodException if the specified class does not 81 | * contain a "main" method 82 | * @exception InvocationTargetException if the application raised an 83 | * exception 84 | */ 85 | public void invokeClass(String name, String[] args) 86 | throws ClassNotFoundException, 87 | NoSuchMethodException, 88 | InvocationTargetException 89 | { 90 | Class c = loadClass(name); 91 | Method m = c.getMethod("main", new Class[] { args.getClass() }); 92 | m.setAccessible(true); 93 | int mods = m.getModifiers(); 94 | if (m.getReturnType() != void.class || !Modifier.isStatic(mods) || 95 | !Modifier.isPublic(mods)) { 96 | throw new NoSuchMethodException("main"); 97 | } 98 | try { 99 | m.invoke(null, new Object[] { args }); 100 | } catch (IllegalAccessException e) { 101 | // This should not happen, as we have disabled access checks 102 | } 103 | } 104 | 105 | } -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/SheetException.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | public class SheetException extends RuntimeException 4 | { 5 | SheetException(String error) { 6 | super(error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/SheetExceptionFactory.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | public class SheetExceptionFactory 4 | { 5 | /** 6 | * generates and returns a SheetException for use when a sheet has an invalid string value in a cell 7 | * @param classifier the kind of value which is incorrect (species, move, item, etc...) 8 | * @param invalid the string which was entered that is incorrect 9 | * @param lineIdentifier a string which identifies the line the error occurred on, usually the species or move name 10 | * @param line the line the error occurred on 11 | * @return a SheetException 12 | */ 13 | public static SheetException generateInvalidNameSheetException(Class editor, String classifier, String invalid, String lineIdentifierClassifier, String lineIdentifier, int line) 14 | { 15 | SheetException e = new SheetException(editor.getSimpleName() + ": You have an invalid " + classifier + " name entered, \"" + invalid + "\", for " + classifier + " \"" + lineIdentifier + "\" on line #" + line); 16 | StackTraceElement[] arr = e.getStackTrace(); 17 | System.arraycopy(arr, 1, arr, 0, arr.length - 1); 18 | e.setStackTrace(arr); 19 | return e; 20 | } 21 | 22 | /** 23 | * generates and returns a SheetException for use when a sheet has a missing value 24 | * @param classifier the kind of value for which the paired data is missing (species, move, item, level, etc...) 25 | * @param missingClassifier the kind of value which is missing 26 | * @param pairedData the string paired with the data which was missing (for example, if a move was missing a level in a learnset, it would be the move name) 27 | * @param lineIdentifierClassifier the kind of value which the line identifier is (for example, a species or move name) 28 | * @param lineIdentifier a string which identifies the line the error occurred on, usually the species or move name 29 | * @param line the line the error occurred on 30 | * @return a SheetException 31 | */ 32 | public static SheetException generateMissingValueSheetException(Class editor, String classifier, String missingClassifier, String pairedData, String lineIdentifierClassifier, String lineIdentifier, int line) 33 | { 34 | SheetException e = new SheetException(editor.getSimpleName() + ": You are missing a defined " + missingClassifier + " for " + classifier + " \"" + pairedData + "\" for " + lineIdentifierClassifier + " \"" + lineIdentifier + "\" on line #" + line); 35 | StackTraceElement[] arr = e.getStackTrace(); 36 | System.arraycopy(arr, 1, arr, 0, arr.length - 1); 37 | e.setStackTrace(arr); 38 | return e; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/framework/XmlReader.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.framework; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.File; 5 | import java.io.FileReader; 6 | import java.io.IOException; 7 | import java.nio.file.Path; 8 | import java.util.HashMap; 9 | 10 | public class XmlReader 11 | { 12 | private String file; 13 | 14 | public XmlReader(String file) 15 | { 16 | this.file= file; 17 | } 18 | 19 | public XmlReader(File file) 20 | { 21 | this.file= file.toString(); 22 | } 23 | 24 | public XmlReader(Path path) 25 | { 26 | this.file= path.toString(); 27 | } 28 | 29 | public HashMap readFile() throws IOException 30 | { 31 | HashMap ret= new HashMap<>(); 32 | 33 | BufferedReader reader= new BufferedReader(new FileReader(file)); 34 | String line; 35 | boolean first= true; 36 | boolean second= true; 37 | 38 | while((line= reader.readLine()) != null) 39 | { 40 | if(first) 41 | { 42 | first= false; 43 | } 44 | else if(second) 45 | { 46 | ret.put("program",line.substring(1,line.length()-1)); 47 | System.out.println("Program: " + line.substring(1,line.length()-1)); 48 | second= false; 49 | } 50 | else 51 | { 52 | if(!line.equals("<\\" + ret.get("program") + ">")) 53 | { 54 | ret.put(line.substring(3,line.indexOf('>')),line.substring(line.indexOf('>')+1,line.lastIndexOf('<'))); 55 | System.out.println(line.substring(3,line.indexOf('>')) + ": " + line.substring(line.indexOf('>')+1,line.lastIndexOf('<'))); 56 | } 57 | 58 | } 59 | } 60 | 61 | return ret; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/ConsoleWindow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner on Sun Jan 03 23:43:53 EST 2021 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui; 6 | 7 | import java.awt.*; 8 | import java.io.*; 9 | import javax.swing.*; 10 | import net.miginfocom.swing.*; 11 | 12 | /** 13 | * @author turtleisaac 14 | */ 15 | public class ConsoleWindow extends JFrame { 16 | 17 | PrintStream originalOut; 18 | PrintStream originalErr; 19 | PrintStream newOut; 20 | PrintStream newErr; 21 | BufferedWriter consoleOut; 22 | 23 | public ConsoleWindow() { 24 | initComponents(); 25 | setVisible(false); 26 | 27 | originalOut = System.out; 28 | originalErr = System.err; 29 | 30 | consoleOut= new BufferedWriter(new OutputStreamWriter(originalOut)); 31 | 32 | // redirectSystemStreams(); 33 | 34 | setPreferredSize(new Dimension(500,500)); 35 | setMinimumSize(new Dimension(500,500)); 36 | pack(); 37 | } 38 | 39 | private void initComponents() { 40 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents 41 | // Generated using JFormDesigner non-commercial license 42 | scrollPane1 = new JScrollPane(); 43 | textArea1 = new JTextArea(); 44 | 45 | //======== this ======== 46 | setTitle("Console"); 47 | var contentPane = getContentPane(); 48 | contentPane.setLayout(new MigLayout( 49 | "hidemode 3", 50 | // columns 51 | "[grow,fill]", 52 | // rows 53 | "[grow,fill]")); 54 | 55 | //======== scrollPane1 ======== 56 | { 57 | 58 | //---- textArea1 ---- 59 | textArea1.setEditable(false); 60 | scrollPane1.setViewportView(textArea1); 61 | } 62 | contentPane.add(scrollPane1, "cell 0 0,grow"); 63 | pack(); 64 | setLocationRelativeTo(getOwner()); 65 | // JFormDesigner - End of component initialization //GEN-END:initComponents 66 | } 67 | 68 | 69 | private synchronized void updateTextArea(final String text) { 70 | SwingUtilities.invokeLater(() -> textArea1.append(text)); 71 | } 72 | 73 | private synchronized void redirectSystemStreams() { 74 | OutputStream out = new OutputStream() { 75 | @Override 76 | public void write(int b) 77 | { 78 | updateTextArea(String.valueOf((char) b)); 79 | // try{ 80 | // consoleOut.write(String.valueOf((char) b)); 81 | // } 82 | // catch(IOException e) { 83 | // e.printStackTrace(); 84 | // } 85 | } 86 | 87 | @Override 88 | public void write(byte[] b, int off, int len){ 89 | updateTextArea(new String(b, off, len)); 90 | } 91 | 92 | @Override 93 | public void write(byte[] b) throws IOException { 94 | write(b, 0, b.length); 95 | } 96 | }; 97 | 98 | newOut = new PrintStream(out, true); 99 | newErr = new PrintStream(out, true); 100 | 101 | System.setOut(newOut); 102 | System.setErr(newErr); 103 | } 104 | 105 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables 106 | private JScrollPane scrollPane1; 107 | private JTextArea textArea1; 108 | // JFormDesigner - End of variables declaration //GEN-END:variables 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/ConsoleWindow.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.2.6.321" Java: "11.0.9" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[grow,fill]" 9 | "$rowConstraints": "[grow,fill]" 10 | } ) { 11 | name: "this" 12 | "title": "Console" 13 | add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { 14 | name: "scrollPane1" 15 | add( new FormComponent( "javax.swing.JTextArea" ) { 16 | name: "textArea1" 17 | "editable": false 18 | } ) 19 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 20 | "value": "cell 0 0,grow" 21 | } ) 22 | }, new FormLayoutConstraints( null ) { 23 | "location": new java.awt.Point( 0, 0 ) 24 | "size": new java.awt.Dimension( 400, 300 ) 25 | } ) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/EditorComboBox.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui; 2 | 3 | import com.jidesoft.swing.ComboBoxSearchable; 4 | 5 | import javax.swing.*; 6 | import java.util.Arrays; 7 | 8 | public class EditorComboBox extends JComboBox 9 | { 10 | private final ComboBoxSearchable searchable; 11 | 12 | public EditorComboBox() 13 | { 14 | super(); 15 | searchable= new ComboBoxSearchable(this); 16 | } 17 | 18 | public EditorComboBox(String[] items) 19 | { 20 | super(Arrays.stream(items).map(ComboBoxItem::new).toArray(ComboBoxItem[]::new)); 21 | searchable= new ComboBoxSearchable(this); 22 | } 23 | 24 | public EditorComboBox(ComboBoxItem[] model) 25 | { 26 | super(model); 27 | searchable= new ComboBoxSearchable(this); 28 | } 29 | 30 | public EditorComboBox(ComboBoxModel model) 31 | { 32 | super(model); 33 | searchable= new ComboBoxSearchable(this); 34 | } 35 | 36 | public static class ComboBoxItem 37 | { 38 | private String str; 39 | 40 | public ComboBoxItem(String str) 41 | { 42 | this.str= str; 43 | } 44 | 45 | public ComboBoxItem(int num) 46 | { 47 | str= "" + num; 48 | } 49 | 50 | public void setName(String str) {this.str= str;} 51 | 52 | @Override 53 | public String toString() 54 | { 55 | return str; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/DefaultDataEditor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.editors.data; 2 | 3 | import io.github.turtleisaac.pokeditor.formats.BytesDataContainer; 4 | import io.github.turtleisaac.pokeditor.formats.GenericFileData; 5 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.FormatModel; 6 | 7 | import javax.swing.*; 8 | import java.awt.event.ActionEvent; 9 | import java.util.Set; 10 | 11 | public abstract class DefaultDataEditor> extends JPanel 12 | { 13 | private EditorDataModel model; 14 | private int selectedIndex; 15 | 16 | public DefaultDataEditor(EditorDataModel model) 17 | { 18 | this.model = model; 19 | selectedIndex = -1; 20 | } 21 | 22 | public EditorDataModel getModel() 23 | { 24 | return model; 25 | } 26 | 27 | public void setModel(EditorDataModel model) 28 | { 29 | this.model = model; 30 | } 31 | 32 | public void selectedIndexedChanged(int idx, ActionEvent e) 33 | { 34 | selectedIndex = idx; 35 | } 36 | 37 | public int getSelectedIndex() 38 | { 39 | return selectedIndex; 40 | } 41 | 42 | public void addNewEntry() 43 | { 44 | JOptionPane.showMessageDialog(this, "Rowan's words echoed...\n\"There's a time and place for everything but not now!\"", "This function has not been implemented yet", JOptionPane.WARNING_MESSAGE); 45 | } 46 | 47 | public void deleteCurrentEntry() 48 | { 49 | JOptionPane.showMessageDialog(this, "Rowan's words echoed...\n\"There's a time and place for everything but not now!\"", "This function has not been implemented yet", JOptionPane.WARNING_MESSAGE); 50 | } 51 | 52 | public abstract Class getDataClass(); 53 | 54 | public abstract Set getEnabledToolbarButtons(); 55 | 56 | public BytesDataContainer writeSelectedEntryForCopy() 57 | { 58 | if (getModel() instanceof FormatModel formatModel) 59 | return formatModel.getData().get(selectedIndex).save(); 60 | return null; 61 | } 62 | 63 | public void applyCopiedEntry(BytesDataContainer bytesDataContainer) 64 | { 65 | try { 66 | if (getModel() instanceof FormatModel formatModel) 67 | formatModel.getData().get(selectedIndex).setData(bytesDataContainer); 68 | } catch (Exception exception) { 69 | exception.printStackTrace(); 70 | JOptionPane.showMessageDialog(this, "An error occurred while pasting the copied data.", "PokEditor", JOptionPane.ERROR_MESSAGE); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/DefaultDataEditorPanel.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.autoExternalize": true 5 | "i18n.bundlePackage": "pokeditor" 6 | "i18n.bundleName": "sheet_panel" 7 | "i18n.keyPrefix": "DefaultEditorPanel" 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 11 | "$layoutConstraints": "hidemode 3" 12 | "$columnConstraints": "[grow,fill]" 13 | "$rowConstraints": "[][grow]" 14 | } ) { 15 | name: "this" 16 | add( new FormComponent( "javax.swing.JSeparator" ) { 17 | name: "separator4" 18 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 19 | "value": "cell 0 0" 20 | } ) 21 | add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { 22 | name: "toolBar1" 23 | "floatable": false 24 | add( new FormComponent( "io.github.turtleisaac.pokeditor.gui.EditorComboBox" ) { 25 | name: "entrySelectorComboBox" 26 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "selectedEntryChanged", true ) ) 27 | } ) 28 | add( new FormComponent( "javax.swing.JButton" ) { 29 | name: "saveButton" 30 | "text": new FormMessage( null, "DefaultSheetPanel.saveSheetButton.text" ) 31 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveButtonPressed", true ) ) 32 | } ) 33 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 34 | name: "separator2" 35 | } ) 36 | add( new FormComponent( "javax.swing.JButton" ) { 37 | name: "resetChangesButton" 38 | "text": new FormMessage( null, "DefaultSheetPanel.reloadSheetButton.text" ) 39 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "reloadDataButtonPressed", true ) ) 40 | } ) 41 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 42 | name: "separator1" 43 | } ) 44 | add( new FormComponent( "javax.swing.JButton" ) { 45 | name: "addButton" 46 | "text": new FormMessage( null, "DefaultEditorPanel.addButton.text" ) 47 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "addEntryButtonPressed", true ) ) 48 | } ) 49 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 50 | name: "separator3" 51 | auxiliary() { 52 | "JavaCodeGenerator.variableLocal": false 53 | } 54 | } ) 55 | add( new FormComponent( "javax.swing.JButton" ) { 56 | name: "deleteButton" 57 | "text": new FormMessage( null, "DefaultEditorPanel.deleteButton.text" ) 58 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "deleteEntryButtonPressed", true ) ) 59 | } ) 60 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 61 | name: "separator6" 62 | auxiliary() { 63 | "JavaCodeGenerator.variableLocal": false 64 | } 65 | } ) 66 | add( new FormComponent( "javax.swing.JButton" ) { 67 | name: "copyEntryButton" 68 | "text": new FormMessage( null, "DefaultEditorPanel.copyEntryButton.text" ) 69 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "copyEntryButtonPressed", true ) ) 70 | } ) 71 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 72 | name: "separator5" 73 | auxiliary() { 74 | "JavaCodeGenerator.variableLocal": false 75 | } 76 | } ) 77 | add( new FormComponent( "javax.swing.JButton" ) { 78 | name: "pasteEntryButton" 79 | "text": new FormMessage( null, "DefaultEditorPanel.pasteEntryButton.text" ) 80 | "enabled": false 81 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "pasteEntryButtonPressed", true ) ) 82 | } ) 83 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 84 | name: "separator7" 85 | auxiliary() { 86 | "JavaCodeGenerator.variableLocal": false 87 | } 88 | } ) 89 | add( new FormComponent( "javax.swing.JButton" ) { 90 | name: "exportFileButton" 91 | "text": new FormMessage( null, "DefaultEditorPanel.exportFileButton.text" ) 92 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "exportFileButtonPressed", true ) ) 93 | } ) 94 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 95 | name: "separator8" 96 | auxiliary() { 97 | "JavaCodeGenerator.variableLocal": false 98 | } 99 | } ) 100 | add( new FormComponent( "javax.swing.JButton" ) { 101 | name: "importFileButton" 102 | "text": new FormMessage( null, "DefaultEditorPanel.importFileButton.text" ) 103 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "importFileButtonPressed", true ) ) 104 | } ) 105 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 106 | "value": "north" 107 | } ) 108 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) { 109 | "alignment": 0 110 | } ) { 111 | name: "contentPanel" 112 | "border": sfield com.jformdesigner.model.FormObject NULL_VALUE 113 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 114 | "value": "cell 0 1,grow" 115 | } ) 116 | }, new FormLayoutConstraints( null ) { 117 | "location": new java.awt.Point( 5, 5 ) 118 | "size": new java.awt.Dimension( 1200, 720 ) 119 | } ) 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/EditorDataModel.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.editors.data; 2 | 3 | public interface EditorDataModel> 4 | { 5 | Object getValueFor(int entryIdx, E property); 6 | void setValueFor(Object aValue, int entryIdx, E property); 7 | int getEntryCount(); 8 | String getEntryName(int entryIdx); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/formats/scripts/ScriptPane.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.editors.data.formats.scripts; 2 | 3 | import javax.swing.*; 4 | import javax.swing.text.*; 5 | import java.awt.*; 6 | import java.awt.event.InputEvent; 7 | import java.awt.event.KeyAdapter; 8 | import java.awt.event.KeyEvent; 9 | import java.awt.event.MouseEvent; 10 | 11 | public class ScriptPane extends JTextPane 12 | { 13 | private ScriptDocument scriptDocument; 14 | private JTextPane lineNumberPane; 15 | private JScrollPane scrollPane; 16 | 17 | public ScriptPane() 18 | { 19 | addKeyListener(new KeyAdapter() 20 | { 21 | @Override 22 | public void keyPressed(KeyEvent e) 23 | { 24 | if (e.isMetaDown() || e.isControlDown()) 25 | { 26 | int offset = viewToModel2D(getMousePosition()); 27 | highlight(offset); 28 | } 29 | } 30 | 31 | @Override 32 | public void keyReleased(KeyEvent e) 33 | { 34 | try { 35 | scriptDocument.setSyntaxAttributes(); 36 | } 37 | catch(BadLocationException ex) { 38 | throw new RuntimeException(ex); 39 | } 40 | } 41 | }); 42 | } 43 | 44 | @Override 45 | public void setStyledDocument(StyledDocument doc) 46 | { 47 | super.setStyledDocument(doc); 48 | } 49 | 50 | public void setScriptDocument(ScriptDocument scriptDocument) 51 | { 52 | this.scriptDocument = scriptDocument; 53 | super.setStyledDocument(scriptDocument); 54 | } 55 | 56 | public ScriptDocument getScriptDocument() 57 | { 58 | return scriptDocument; 59 | } 60 | 61 | @Override 62 | public JToolTip createToolTip() 63 | { 64 | return super.createToolTip(); 65 | } 66 | 67 | @Override 68 | public String getToolTipText(MouseEvent event) 69 | { 70 | if (scriptDocument == null) 71 | return null; 72 | 73 | int offset = viewToModel2D(event.getPoint()); 74 | 75 | ScriptDocument.ElementRange elementRange = scriptDocument.getScriptElementList().find(offset); 76 | 77 | if (elementRange != null) 78 | { 79 | return elementRange.getToolTipText(); 80 | } 81 | return null; 82 | } 83 | 84 | private void highlight(int offset) 85 | { 86 | ScriptDocument.ElementRange elementRange = scriptDocument.getScriptElementList().find(offset); 87 | if (elementRange != null && elementRange.getElementType() == ScriptDocument.ElementType.LABEL) 88 | { 89 | String text = null; 90 | try { 91 | text = scriptDocument.getText(0, scriptDocument.getLength()); 92 | } 93 | catch(BadLocationException ex) { 94 | throw new RuntimeException(ex); 95 | } 96 | 97 | scriptDocument.setCharacterAttributes(elementRange.getMin(), elementRange.getMaxExclusive() - elementRange.getMin() + 1, scriptDocument.getStyle(ScriptDocument.GOTO_LABEL), true); 98 | } 99 | } 100 | 101 | @Override 102 | protected void processMouseEvent(MouseEvent e) 103 | { 104 | int modifiers = e.getModifiersEx(); 105 | 106 | if (e.getClickCount() != 0) 107 | { 108 | getHighlighter().removeAllHighlights(); 109 | } 110 | 111 | if ((modifiers & (MouseEvent.CTRL_DOWN_MASK | MouseEvent.META_DOWN_MASK)) != 0 && (modifiers & MouseEvent.SHIFT_DOWN_MASK) == 0) 112 | { 113 | int offset = viewToModel2D(e.getPoint()); 114 | 115 | if (e.getClickCount() == 0) 116 | { 117 | highlight(offset); 118 | return; 119 | } 120 | 121 | ScriptDocument.ElementRange elementRange = scriptDocument.getScriptElementList().find(offset); 122 | if (elementRange != null && elementRange.getElementType() == ScriptDocument.ElementType.LABEL) 123 | { 124 | String text = null; 125 | try { 126 | text = scriptDocument.getText(0, scriptDocument.getLength()); 127 | } 128 | catch(BadLocationException ex) { 129 | throw new RuntimeException(ex); 130 | } 131 | String labelName = text.substring(elementRange.getMin(), elementRange.getMaxExclusive()); 132 | int definitionOffset = text.indexOf(labelName + ":"); 133 | 134 | // JPopupMenu popupMenu = new JPopupMenu(); 135 | // popupMenu.setPopupSize(500, 500); 136 | // popupMenu.show(this, 0, e.getY()); 137 | 138 | if ((modifiers & MouseEvent.MOUSE_CLICKED) != 0 && e.getClickCount() == 1) 139 | { 140 | gotoStartOfLine(this, getLineAtOffset(this, definitionOffset)); 141 | centerLineInScrollPane(this); 142 | try { 143 | scriptDocument.setSyntaxAttributes(); 144 | 145 | DefaultHighlighter.DefaultHighlightPainter highlightPainter = new DefaultHighlighter.DefaultHighlightPainter(Color.YELLOW); 146 | getHighlighter().addHighlight(definitionOffset, definitionOffset + labelName.length(), highlightPainter); 147 | } 148 | catch(BadLocationException ex) { 149 | throw new RuntimeException(ex); 150 | } 151 | } 152 | } 153 | } 154 | 155 | super.processMouseEvent(e); 156 | } 157 | 158 | public void setLineNumberPane(JTextPane lineNumberPane) throws BadLocationException 159 | { 160 | this.lineNumberPane = lineNumberPane; 161 | lineNumberPane.setFont(Font.getFont("Monospaced")); 162 | lineNumberPane.setEnabled(false); 163 | lineNumberPane.setEditable(false); 164 | Document doc = lineNumberPane.getDocument(); 165 | doc.remove(0, doc.getLength()); 166 | } 167 | 168 | public void setScrollPane(JScrollPane scrollPane) 169 | { 170 | this.scrollPane = scrollPane; 171 | } 172 | 173 | public JTextPane getLineNumberPane() 174 | { 175 | return lineNumberPane; 176 | } 177 | 178 | /* 179 | * Position the caret at the start of a line. 180 | */ 181 | public static void gotoStartOfLine(JTextComponent component, int line) 182 | { 183 | Element root = component.getDocument().getDefaultRootElement(); 184 | line = Math.max(line, 1); 185 | line = Math.min(line, root.getElementCount()); 186 | int startOfLineOffset = root.getElement( line - 1 ).getStartOffset(); 187 | component.setCaretPosition( startOfLineOffset ); 188 | } 189 | 190 | /* 191 | * Return the line number at the Caret position. 192 | */ 193 | public static int getLineAtCaret(JTextComponent component) 194 | { 195 | int caretPosition = component.getCaretPosition(); 196 | Element root = component.getDocument().getDefaultRootElement(); 197 | 198 | return root.getElementIndex( caretPosition ) + 1; 199 | } 200 | 201 | /* 202 | * Return the line number at the Caret position. 203 | */ 204 | public static int getLineAtOffset(JTextComponent component, int offset) 205 | { 206 | // int caretPosition = component.getCaretPosition(); 207 | Element root = component.getDocument().getDefaultRootElement(); 208 | 209 | // for (int i = 0; i < root.getElementCount(); i++) 210 | // { 211 | // Element line = root.getElement(i); 212 | // if (line.getStartOffset() <= offset && line.getEndOffset() >= offset) 213 | // { 214 | // 215 | // } 216 | // } 217 | 218 | return root.getElementIndex(offset) + 1; 219 | 220 | // return root.getElementIndex( caretPosition ) + 1; 221 | } 222 | 223 | /* 224 | * Attempt to center the line containing the caret at the center of the 225 | * scroll pane. 226 | * 227 | * @param component the text component in the sroll pane 228 | */ 229 | public static void centerLineInScrollPane(JTextComponent component) 230 | { 231 | Container container = SwingUtilities.getAncestorOfClass(JViewport.class, component); 232 | 233 | if (container == null) return; 234 | 235 | try 236 | { 237 | Rectangle r = component.modelToView(component.getCaretPosition()); 238 | JViewport viewport = (JViewport)container; 239 | int extentHeight = viewport.getExtentSize().height; 240 | int viewHeight = viewport.getViewSize().height; 241 | 242 | int y = Math.max(0, r.y - ((extentHeight - r.height) / 2)); 243 | y = Math.min(y, viewHeight - extentHeight); 244 | 245 | viewport.setViewPosition(new Point(0, y)); 246 | } 247 | catch(BadLocationException ble) {} 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/formats/trainer_sprite/TrainerSpriteEditor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui.editors.data.formats.trainer_sprite; 6 | 7 | import javax.swing.*; 8 | import net.miginfocom.swing.*; 9 | 10 | /** 11 | * @author turtleisaac 12 | */ 13 | public class TrainerSpriteEditor extends JPanel { 14 | public TrainerSpriteEditor() { 15 | initComponents(); 16 | } 17 | 18 | private void initComponents() { 19 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off 20 | // Generated using JFormDesigner non-commercial license 21 | //======== this ======== 22 | setLayout(new MigLayout( 23 | "hidemode 3", 24 | // columns 25 | "[fill]" + 26 | "[fill]", 27 | // rows 28 | "[]" + 29 | "[]" + 30 | "[]")); 31 | // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on 32 | } 33 | 34 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off 35 | // Generated using JFormDesigner non-commercial license 36 | // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/data/formats/trainer_sprite/TrainerSpriteEditor.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.autoExternalize": true 5 | "i18n.bundlePackage": "pokeditor" 6 | "i18n.bundleName": "sheet_panel" 7 | "i18n.keyPrefix": "TrainerSpriteEditor" 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 11 | "$layoutConstraints": "hidemode 3" 12 | "$columnConstraints": "[fill][fill]" 13 | "$rowConstraints": "[][][]" 14 | } ) { 15 | name: "this" 16 | }, new FormLayoutConstraints( null ) { 17 | "location": new java.awt.Point( 0, 0 ) 18 | "size": new java.awt.Dimension( 400, 300 ) 19 | } ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/general/GeneralEditorPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui.editors.general; 6 | 7 | import java.util.*; 8 | import javax.swing.*; 9 | import net.miginfocom.swing.*; 10 | 11 | /** 12 | * @author turtleisaac 13 | */ 14 | public class GeneralEditorPanel extends JPanel { 15 | public GeneralEditorPanel() { 16 | initComponents(); 17 | } 18 | 19 | private void initComponents() { 20 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off 21 | // Generated using JFormDesigner non-commercial license 22 | ResourceBundle bundle = ResourceBundle.getBundle("pokeditor.sheet_panel"); 23 | toolBar1 = new JToolBar(); 24 | saveChangesButton = new JButton(); 25 | resetChangesButton = new JButton(); 26 | contentPanel = new JPanel(); 27 | 28 | //======== this ======== 29 | setLayout(new MigLayout( 30 | "hidemode 3", 31 | // columns 32 | "[grow,fill]", 33 | // rows 34 | "[grow]")); 35 | 36 | //======== toolBar1 ======== 37 | { 38 | toolBar1.setFloatable(false); 39 | 40 | //---- saveChangesButton ---- 41 | saveChangesButton.setText(bundle.getString("DefaultSheetPanel.saveSheetButton.text")); 42 | toolBar1.add(saveChangesButton); 43 | toolBar1.addSeparator(); 44 | 45 | //---- resetChangesButton ---- 46 | resetChangesButton.setText(bundle.getString("DefaultSheetPanel.reloadSheetButton.text")); 47 | toolBar1.add(resetChangesButton); 48 | } 49 | add(toolBar1, "north"); 50 | 51 | //======== contentPanel ======== 52 | { 53 | contentPanel.setLayout(new MigLayout( 54 | "fill,insets 0,hidemode 3", 55 | // columns 56 | "[fill]", 57 | // rows 58 | "[grow,fill]")); 59 | } 60 | add(contentPanel, "cell 0 0,grow"); 61 | // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on 62 | } 63 | 64 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off 65 | // Generated using JFormDesigner non-commercial license 66 | private JToolBar toolBar1; 67 | private JButton saveChangesButton; 68 | private JButton resetChangesButton; 69 | private JPanel contentPanel; 70 | // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/general/GeneralEditorPanel.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.autoExternalize": true 5 | "i18n.bundlePackage": "pokeditor" 6 | "i18n.bundleName": "sheet_panel" 7 | "i18n.keyPrefix": "GeneralEditorPanel" 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 11 | "$layoutConstraints": "hidemode 3" 12 | "$columnConstraints": "[grow,fill]" 13 | "$rowConstraints": "[grow]" 14 | } ) { 15 | name: "this" 16 | add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { 17 | name: "toolBar1" 18 | "floatable": false 19 | add( new FormComponent( "javax.swing.JButton" ) { 20 | name: "saveChangesButton" 21 | "text": new FormMessage( null, "DefaultSheetPanel.saveSheetButton.text" ) 22 | } ) 23 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 24 | name: "separator1" 25 | } ) 26 | add( new FormComponent( "javax.swing.JButton" ) { 27 | name: "resetChangesButton" 28 | "text": new FormMessage( null, "DefaultSheetPanel.reloadSheetButton.text" ) 29 | } ) 30 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 31 | "value": "north" 32 | } ) 33 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 34 | "$layoutConstraints": "fill,insets 0,hidemode 3" 35 | "$columnConstraints": "[fill]" 36 | "$rowConstraints": "[grow,fill]" 37 | } ) { 38 | name: "contentPanel" 39 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 40 | "value": "cell 0 0,grow" 41 | } ) 42 | }, new FormLayoutConstraints( null ) { 43 | "location": new java.awt.Point( 0, 0 ) 44 | "size": new java.awt.Dimension( 400, 300 ) 45 | } ) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/general/starters/StarterEditor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui.editors.general.starters; 6 | 7 | import java.util.*; 8 | import javax.swing.*; 9 | import io.github.turtleisaac.pokeditor.gui.*; 10 | import net.miginfocom.swing.*; 11 | 12 | /** 13 | * @author turtleisaac 14 | */ 15 | public class StarterEditor extends JPanel { 16 | public StarterEditor() { 17 | initComponents(); 18 | } 19 | 20 | private void initComponents() { 21 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off 22 | // Generated using JFormDesigner non-commercial license 23 | ResourceBundle bundle = ResourceBundle.getBundle("pokeditor.sheet_panel"); 24 | starterLabel1 = new JLabel(); 25 | starterLabel2 = new JLabel(); 26 | starterLabel3 = new JLabel(); 27 | starterComboBox1 = new EditorComboBox(); 28 | starterComboBox2 = new EditorComboBox(); 29 | starterComboBox3 = new EditorComboBox(); 30 | 31 | //======== this ======== 32 | setLayout(new MigLayout( 33 | "hidemode 3", 34 | // columns 35 | "[grow,fill]" + 36 | "[grow,fill]" + 37 | "[grow,fill]", 38 | // rows 39 | "[]" + 40 | "[grow]")); 41 | 42 | //---- starterLabel1 ---- 43 | starterLabel1.setText(bundle.getString("StarterEditorPanel.starterLabel1.text")); 44 | starterLabel1.setHorizontalAlignment(SwingConstants.CENTER); 45 | add(starterLabel1, "cell 0 0,alignx center,growx 0"); 46 | 47 | //---- starterLabel2 ---- 48 | starterLabel2.setText(bundle.getString("StarterEditorPanel.starterLabel2.text")); 49 | starterLabel2.setHorizontalAlignment(SwingConstants.CENTER); 50 | add(starterLabel2, "cell 1 0,alignx center,growx 0"); 51 | 52 | //---- starterLabel3 ---- 53 | starterLabel3.setText(bundle.getString("StarterEditorPanel.starterLabel3.text")); 54 | starterLabel3.setHorizontalAlignment(SwingConstants.CENTER); 55 | add(starterLabel3, "cell 2 0,alignx center,growx 0"); 56 | add(starterComboBox1, "cell 0 1,aligny top,growy 0"); 57 | add(starterComboBox2, "cell 1 1,aligny top,growy 0"); 58 | add(starterComboBox3, "cell 2 1,aligny top,growy 0"); 59 | // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on 60 | } 61 | 62 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off 63 | // Generated using JFormDesigner non-commercial license 64 | private JLabel starterLabel1; 65 | private JLabel starterLabel2; 66 | private JLabel starterLabel3; 67 | private EditorComboBox starterComboBox1; 68 | private EditorComboBox starterComboBox2; 69 | private EditorComboBox starterComboBox3; 70 | // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/editors/general/starters/StarterEditor.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.autoExternalize": true 5 | "i18n.bundlePackage": "pokeditor" 6 | "i18n.bundleName": "sheet_panel" 7 | "i18n.keyPrefix": "StarterEditorPanel" 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 11 | "$layoutConstraints": "hidemode 3" 12 | "$columnConstraints": "[grow,fill][grow,fill][grow,fill]" 13 | "$rowConstraints": "[][grow]" 14 | } ) { 15 | name: "this" 16 | add( new FormComponent( "javax.swing.JLabel" ) { 17 | name: "starterLabel1" 18 | "text": new FormMessage( null, "StarterEditorPanel.starterLabel1.text" ) 19 | "horizontalAlignment": 0 20 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 21 | "value": "cell 0 0,alignx center,growx 0" 22 | } ) 23 | add( new FormComponent( "javax.swing.JLabel" ) { 24 | name: "starterLabel2" 25 | "text": new FormMessage( null, "StarterEditorPanel.starterLabel2.text" ) 26 | "horizontalAlignment": 0 27 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 28 | "value": "cell 1 0,alignx center,growx 0" 29 | } ) 30 | add( new FormComponent( "javax.swing.JLabel" ) { 31 | name: "starterLabel3" 32 | "text": new FormMessage( null, "StarterEditorPanel.starterLabel3.text" ) 33 | "horizontalAlignment": 0 34 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 35 | "value": "cell 2 0,alignx center,growx 0" 36 | } ) 37 | add( new FormComponent( "io.github.turtleisaac.pokeditor.gui.EditorComboBox" ) { 38 | name: "starterComboBox1" 39 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 40 | "value": "cell 0 1,aligny top,growy 0" 41 | } ) 42 | add( new FormComponent( "io.github.turtleisaac.pokeditor.gui.EditorComboBox" ) { 43 | name: "starterComboBox2" 44 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 45 | "value": "cell 1 1,aligny top,growy 0" 46 | } ) 47 | add( new FormComponent( "io.github.turtleisaac.pokeditor.gui.EditorComboBox" ) { 48 | name: "starterComboBox3" 49 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 50 | "value": "cell 2 1,aligny top,growy 0" 51 | } ) 52 | }, new FormLayoutConstraints( null ) { 53 | "location": new java.awt.Point( 0, 0 ) 54 | "size": new java.awt.Dimension( 400, 300 ) 55 | } ) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/DefaultSheetPanel.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.bundlePackage": "pokeditor" 5 | "i18n.bundleName": "sheet_panel" 6 | "i18n.keyPrefix": "DefaultSheetPanel" 7 | "i18n.autoExternalize": true 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 11 | "$layoutConstraints": "insets 0,hidemode 3" 12 | "$columnConstraints": "[grow,fill]" 13 | "$rowConstraints": "[grow,fill]" 14 | } ) { 15 | name: "this" 16 | add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { 17 | name: "toolBar1" 18 | add( new FormComponent( "javax.swing.JButton" ) { 19 | name: "saveSheetButton" 20 | "text": new FormMessage( null, "DefaultSheetPanel.saveSheetButton.text" ) 21 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveSheetButtonPressed", true ) ) 22 | } ) 23 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 24 | name: "separator1" 25 | } ) 26 | add( new FormComponent( "javax.swing.JButton" ) { 27 | name: "reloadSheetButton" 28 | "text": new FormMessage( null, "DefaultSheetPanel.reloadSheetButton.text" ) 29 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "reloadSheetButtonPressed", true ) ) 30 | } ) 31 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 32 | name: "separator2" 33 | } ) 34 | add( new FormComponent( "javax.swing.JButton" ) { 35 | name: "addRowButton" 36 | "text": new FormMessage( null, "DefaultSheetPanel.addRowButton.text" ) 37 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "addRowButtonPressed", true ) ) 38 | } ) 39 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 40 | name: "separator6" 41 | } ) 42 | add( new FormComponent( "javax.swing.JButton" ) { 43 | name: "deleteRowButton" 44 | "text": new FormMessage( null, "DefaultSheetPanel.deleteRowButton.text" ) 45 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "deleteRowButtonPressed", true ) ) 46 | } ) 47 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 48 | name: "separator5" 49 | } ) 50 | add( new FormComponent( "javax.swing.JButton" ) { 51 | name: "findButton" 52 | "text": new FormMessage( null, "DefaultSheetPanel.findButton.text" ) 53 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "findButtonPressed", true ) ) 54 | } ) 55 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 56 | name: "separator7" 57 | } ) 58 | add( new FormComponent( "javax.swing.JToggleButton" ) { 59 | name: "copyModeButton" 60 | "text": new FormMessage( null, "DefaultSheetPanel.copyModeButton.text" ) 61 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "copyModeButtonPressed", true ) ) 62 | } ) 63 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 64 | name: "separator8" 65 | } ) 66 | add( new FormComponent( "javax.swing.JButton" ) { 67 | name: "exportSheetButton" 68 | "text": new FormMessage( null, "DefaultSheetPanel.exportSheetButton.text" ) 69 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "exportSheetButtonPressed", true ) ) 70 | } ) 71 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 72 | name: "separator3" 73 | } ) 74 | add( new FormComponent( "javax.swing.JButton" ) { 75 | name: "importSheetButton" 76 | "text": new FormMessage( null, "DefaultSheetPanel.importSheetButton.text" ) 77 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "importSheetButtonPressed", true ) ) 78 | } ) 79 | add( new FormComponent( "javax.swing.JToolBar$Separator" ) { 80 | name: "separator4" 81 | } ) 82 | add( new FormComponent( "com.jformdesigner.designer.wrapper.HSpacer" ) { 83 | name: "hSpacer1" 84 | } ) 85 | add( new FormComponent( "javax.swing.JButton" ) { 86 | name: "zoomOutButton" 87 | "icon": new com.jformdesigner.model.SwingIcon( 2, "InternalFrame.minimizeIcon" ) 88 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomOutButtonPressed", true ) ) 89 | } ) 90 | add( new FormComponent( "javax.swing.JButton" ) { 91 | name: "zoomInButton" 92 | "icon": new com.jformdesigner.model.SwingIcon( 2, "InternalFrame.maximizeIcon" ) 93 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomInButtonPressed", true ) ) 94 | } ) 95 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 96 | "value": "north" 97 | } ) 98 | add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { 99 | name: "scrollPane1" 100 | "horizontalScrollBarPolicy": 32 101 | "verticalScrollBarPolicy": 22 102 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 103 | "value": "cell 0 0,grow" 104 | } ) 105 | }, new FormLayoutConstraints( null ) { 106 | "location": new java.awt.Point( 0, 0 ) 107 | "size": new java.awt.Dimension( 1060, 680 ) 108 | } ) 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/FindDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui.sheets; 6 | 7 | import java.awt.*; 8 | import java.util.*; 9 | import javax.swing.*; 10 | import net.miginfocom.swing.*; 11 | 12 | /** 13 | * @author turtleisaac 14 | */ 15 | public class FindDialog extends JFrame { 16 | public FindDialog(DefaultSheetPanel parent) { 17 | super(); 18 | initComponents(); 19 | setPreferredSize(dialogPane.getPreferredSize()); 20 | setMinimumSize(dialogPane.getPreferredSize()); 21 | setMaximumSize(dialogPane.getPreferredSize()); 22 | setVisible(true); 23 | pack(); 24 | setLocationRelativeTo(parent); 25 | } 26 | 27 | private void initComponents() { 28 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off 29 | // Generated using JFormDesigner non-commercial license 30 | ResourceBundle bundle = ResourceBundle.getBundle("pokeditor.sheet_panel"); 31 | dialogPane = new JPanel(); 32 | contentPanel = new JPanel(); 33 | findLabel = new JLabel(); 34 | findTextField = new JTextField(); 35 | panel1 = new JPanel(); 36 | label1 = new JLabel(); 37 | textField1 = new JTextField(); 38 | radioButton1 = new JRadioButton(); 39 | matchCaseCheckbox = new JCheckBox(); 40 | matchEntireContentsCheckbox = new JCheckBox(); 41 | buttonBar = new JPanel(); 42 | findButton = new JButton(); 43 | doneButton = new JButton(); 44 | 45 | //======== this ======== 46 | setTitle(bundle.getString("FindDialog.this.title")); 47 | var contentPane = getContentPane(); 48 | contentPane.setLayout(new BorderLayout()); 49 | 50 | //======== dialogPane ======== 51 | { 52 | dialogPane.setLayout(new BorderLayout()); 53 | 54 | //======== contentPanel ======== 55 | { 56 | contentPanel.setLayout(new MigLayout( 57 | "insets dialog,hidemode 3", 58 | // columns 59 | "[fill]" + 60 | "[grow,fill]", 61 | // rows 62 | "[]" + 63 | "[grow]")); 64 | 65 | //---- findLabel ---- 66 | findLabel.setText(bundle.getString("FindDialog.findLabel.text")); 67 | findLabel.setLabelFor(findTextField); 68 | contentPanel.add(findLabel, "cell 0 0"); 69 | contentPanel.add(findTextField, "cell 1 0"); 70 | 71 | //======== panel1 ======== 72 | { 73 | panel1.setLayout(new MigLayout( 74 | "hidemode 3", 75 | // columns 76 | "[grow,fill]" + 77 | "[fill]", 78 | // rows 79 | "[]" + 80 | "[]" + 81 | "[]")); 82 | 83 | //---- label1 ---- 84 | label1.setText(bundle.getString("FindDialog.label1.text")); 85 | panel1.add(label1, "cell 0 0,alignx left,growx 0"); 86 | panel1.add(textField1, "cell 0 0"); 87 | panel1.add(radioButton1, "cell 1 0"); 88 | 89 | //---- matchCaseCheckbox ---- 90 | matchCaseCheckbox.setText(bundle.getString("FindDialog.matchCaseCheckbox.text")); 91 | panel1.add(matchCaseCheckbox, "cell 0 1"); 92 | 93 | //---- matchEntireContentsCheckbox ---- 94 | matchEntireContentsCheckbox.setText(bundle.getString("FindDialog.matchEntireContentsCheckbox.text")); 95 | panel1.add(matchEntireContentsCheckbox, "cell 0 2"); 96 | } 97 | contentPanel.add(panel1, "cell 0 1 2 1"); 98 | } 99 | dialogPane.add(contentPanel, BorderLayout.CENTER); 100 | 101 | //======== buttonBar ======== 102 | { 103 | buttonBar.setLayout(new MigLayout( 104 | "insets dialog,alignx right", 105 | // columns 106 | "[fill]" + 107 | "[button,fill]", 108 | // rows 109 | null)); 110 | 111 | //---- findButton ---- 112 | findButton.setText(bundle.getString("FindDialog.findButton.text")); 113 | buttonBar.add(findButton, "cell 0 0"); 114 | 115 | //---- doneButton ---- 116 | doneButton.setText(bundle.getString("FindDialog.doneButton.text")); 117 | buttonBar.add(doneButton, "cell 1 0"); 118 | } 119 | dialogPane.add(buttonBar, BorderLayout.SOUTH); 120 | } 121 | contentPane.add(dialogPane, BorderLayout.CENTER); 122 | pack(); 123 | setLocationRelativeTo(getOwner()); 124 | // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on 125 | } 126 | 127 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off 128 | // Generated using JFormDesigner non-commercial license 129 | private JPanel dialogPane; 130 | private JPanel contentPanel; 131 | private JLabel findLabel; 132 | private JTextField findTextField; 133 | private JPanel panel1; 134 | private JLabel label1; 135 | private JTextField textField1; 136 | private JRadioButton radioButton1; 137 | private JCheckBox matchCaseCheckbox; 138 | private JCheckBox matchEntireContentsCheckbox; 139 | private JPanel buttonBar; 140 | private JButton findButton; 141 | private JButton doneButton; 142 | // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on 143 | } 144 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/FindDialog.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "8.0.5.0.268" Java: "17.0.8" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | "i18n.autoExternalize": true 5 | "i18n.bundlePackage": "pokeditor" 6 | "i18n.bundleName": "sheet_panel" 7 | "i18n.keyPrefix": "FindDialog" 8 | contentType: "form/swing" 9 | root: new FormRoot { 10 | add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class java.awt.BorderLayout ) ) { 11 | name: "this" 12 | "title": new FormMessage( null, "FindDialog.this.title" ) 13 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { 14 | name: "dialogPane" 15 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 16 | "$layoutConstraints": "insets dialog,hidemode 3" 17 | "$columnConstraints": "[fill][grow,fill]" 18 | "$rowConstraints": "[][grow]" 19 | } ) { 20 | name: "contentPanel" 21 | add( new FormComponent( "javax.swing.JLabel" ) { 22 | name: "findLabel" 23 | "text": new FormMessage( null, "FindDialog.findLabel.text" ) 24 | "labelFor": new FormReference( "findTextField" ) 25 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 26 | "value": "cell 0 0" 27 | } ) 28 | add( new FormComponent( "javax.swing.JTextField" ) { 29 | name: "findTextField" 30 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 31 | "value": "cell 1 0" 32 | } ) 33 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 34 | "$layoutConstraints": "hidemode 3" 35 | "$columnConstraints": "[grow,fill][fill]" 36 | "$rowConstraints": "[][][]" 37 | } ) { 38 | name: "panel1" 39 | add( new FormComponent( "javax.swing.JLabel" ) { 40 | name: "label1" 41 | "text": new FormMessage( null, "FindDialog.label1.text" ) 42 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 43 | "value": "cell 0 0,alignx left,growx 0" 44 | } ) 45 | add( new FormComponent( "javax.swing.JTextField" ) { 46 | name: "textField1" 47 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 48 | "value": "cell 0 0" 49 | } ) 50 | add( new FormComponent( "javax.swing.JRadioButton" ) { 51 | name: "radioButton1" 52 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 53 | "value": "cell 1 0" 54 | } ) 55 | add( new FormComponent( "javax.swing.JCheckBox" ) { 56 | name: "matchCaseCheckbox" 57 | "text": new FormMessage( null, "FindDialog.matchCaseCheckbox.text" ) 58 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 59 | "value": "cell 0 1" 60 | } ) 61 | add( new FormComponent( "javax.swing.JCheckBox" ) { 62 | name: "matchEntireContentsCheckbox" 63 | "text": new FormMessage( null, "FindDialog.matchEntireContentsCheckbox.text" ) 64 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 65 | "value": "cell 0 2" 66 | } ) 67 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 68 | "value": "cell 0 1 2 1" 69 | } ) 70 | }, new FormLayoutConstraints( class java.lang.String ) { 71 | "value": "Center" 72 | } ) 73 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 74 | "$layoutConstraints": "insets dialog,alignx right" 75 | "$columnConstraints": "[fill][button,fill]" 76 | "$rowSpecs": "[fill]" 77 | } ) { 78 | name: "buttonBar" 79 | add( new FormComponent( "javax.swing.JButton" ) { 80 | name: "findButton" 81 | "text": new FormMessage( null, "FindDialog.findButton.text" ) 82 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 83 | "value": "cell 0 0" 84 | } ) 85 | add( new FormComponent( "javax.swing.JButton" ) { 86 | name: "doneButton" 87 | "text": new FormMessage( null, "FindDialog.doneButton.text" ) 88 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 89 | "value": "cell 1 0" 90 | } ) 91 | }, new FormLayoutConstraints( class java.lang.String ) { 92 | "value": "South" 93 | } ) 94 | }, new FormLayoutConstraints( class java.lang.String ) { 95 | "value": "Center" 96 | } ) 97 | }, new FormLayoutConstraints( null ) { 98 | "location": new java.awt.Point( 0, 0 ) 99 | "size": new java.awt.Dimension( 400, 300 ) 100 | } ) 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/FormatModel.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables; 2 | 3 | import io.github.turtleisaac.pokeditor.DataManager; 4 | import io.github.turtleisaac.pokeditor.formats.GenericFileData; 5 | import io.github.turtleisaac.pokeditor.formats.text.TextBankData; 6 | import io.github.turtleisaac.pokeditor.gui.editors.data.EditorDataModel; 7 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.CellTypes; 8 | 9 | import javax.swing.table.AbstractTableModel; 10 | import java.util.List; 11 | import java.util.ResourceBundle; 12 | 13 | public abstract class FormatModel> extends AbstractTableModel implements EditorDataModel 14 | { 15 | private final List data; 16 | private final List textBankData; 17 | private final String[] columnNames; 18 | 19 | private boolean copyPasteModeEnabled; 20 | 21 | public FormatModel(List data, List textBankData) 22 | { 23 | this.data = data; 24 | this.textBankData = textBankData; 25 | this.columnNames = new String[getColumnCount() + getNumFrozenColumns()]; 26 | 27 | ResourceBundle bundle = ResourceBundle.getBundle(DataManager.SHEET_STRINGS_PATH); 28 | 29 | int lastValid = 0; 30 | for (int idx = 0; idx < columnNames.length; idx++) 31 | { 32 | int adjusted = idx-getNumFrozenColumns(); 33 | String columnNameKey = getColumnNameKey(adjusted); 34 | if (columnNameKey == null) 35 | { 36 | columnNames[idx] = bundle.getString(getColumnNameKey(adjusted % (lastValid + 1))); // this will cause columns to repeat as much as needed for the sheets which need them 37 | } 38 | else { 39 | columnNames[idx] = bundle.getString(columnNameKey); 40 | lastValid = adjusted; 41 | } 42 | 43 | } 44 | 45 | copyPasteModeEnabled = false; 46 | } 47 | 48 | public int getNumFrozenColumns() { 49 | return 0; 50 | } 51 | 52 | public abstract String getColumnNameKey(int columnIndex); 53 | 54 | @Override 55 | public String getColumnName(int column) 56 | { 57 | return columnNames[column + getNumFrozenColumns()]; 58 | } 59 | 60 | public void toggleCopyPasteMode(boolean state) 61 | { 62 | copyPasteModeEnabled = state; 63 | } 64 | 65 | @Override 66 | public boolean isCellEditable(int rowIndex, int columnIndex) 67 | { 68 | return !copyPasteModeEnabled; 69 | } 70 | 71 | @Override 72 | public int getRowCount() 73 | { 74 | return getEntryCount(); 75 | } 76 | 77 | @Override 78 | public int getEntryCount() 79 | { 80 | return data.size(); 81 | } 82 | 83 | @Override 84 | public String getEntryName(int entryIdx) 85 | { 86 | return "" + entryIdx; 87 | } 88 | 89 | public List getData() 90 | { 91 | return data; 92 | } 93 | 94 | public List getTextBankData() 95 | { 96 | return textBankData; 97 | } 98 | 99 | protected CellTypes getCellType(int columnIndex) 100 | { 101 | return CellTypes.STRING; 102 | } 103 | 104 | public abstract FormatModel getFrozenColumnModel(); 105 | 106 | public Object prepareObjectForWriting(Object aValue, CellTypes cellType) 107 | { 108 | if (aValue instanceof String) 109 | { 110 | if (cellType == CellTypes.CHECKBOX) 111 | aValue = Boolean.parseBoolean(((String) aValue).trim()); 112 | else if (cellType != CellTypes.STRING) 113 | aValue = Integer.parseInt(((String) aValue).trim()); 114 | } 115 | return aValue; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/FrozenColumnTable.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables; 2 | 3 | import io.github.turtleisaac.pokeditor.formats.GenericFileData; 4 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers.DefaultSheetCellRenderer; 5 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers.MultiLineTableHeaderRenderer; 6 | 7 | import javax.swing.*; 8 | import javax.swing.table.DefaultTableModel; 9 | import javax.swing.table.TableColumn; 10 | import javax.swing.table.TableModel; 11 | import java.awt.*; 12 | import java.util.Enumeration; 13 | 14 | public class FrozenColumnTable extends JTable 15 | { 16 | public FrozenColumnTable(TableModel model) 17 | { 18 | super(model); 19 | 20 | setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 21 | 22 | setRowMargin(1); 23 | getColumnModel().setColumnMargin(1); 24 | setShowGrid(true); 25 | setGridColor(Color.black); 26 | setShowHorizontalLines(true); 27 | setShowVerticalLines(true); 28 | 29 | TableColumn col = getColumnModel().getColumn(0); 30 | col.setWidth(35); 31 | col.setPreferredWidth(35); 32 | 33 | 34 | // for (int i = 0; i < getColumnCount(); i++) 35 | // { 36 | // CellTypes c = cellTypes[i]; 37 | // TableColumn col = getColumnModel().getColumn(i); 38 | // col.setWidth(widths[i]); 39 | // col.setPreferredWidth(widths[i]); 40 | // } 41 | 42 | MultiLineTableHeaderRenderer renderer = new MultiLineTableHeaderRenderer(); 43 | Enumeration enumK = getColumnModel().getColumns(); 44 | while (enumK.hasMoreElements()) 45 | { 46 | ((TableColumn) enumK.nextElement()).setHeaderRenderer(renderer); 47 | } 48 | 49 | // setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); 50 | getTableHeader().setReorderingAllowed(false); 51 | setDragEnabled(false); 52 | setRowSelectionAllowed(true); 53 | setColumnSelectionAllowed(true); 54 | setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); 55 | setDefaultRenderer(Object.class, new DefaultSheetCellRenderer()); 56 | } 57 | 58 | public JTable getCornerTableHeader() 59 | { 60 | TableModel model = new DefaultTableModel() { 61 | @Override 62 | public int getColumnCount() 63 | { 64 | return getColumnModel().getColumnCount(); 65 | } 66 | 67 | @Override 68 | public int getRowCount() 69 | { 70 | return 1; 71 | } 72 | 73 | @Override 74 | public Object getValueAt(int row, int column) 75 | { 76 | return getModel().getColumnName(column - getColumnModel().getColumnCount()); 77 | } 78 | 79 | @Override 80 | public boolean isCellEditable(int rowIndex, int columnIndex) 81 | { 82 | return false; 83 | } 84 | }; 85 | 86 | JTable corner = new JTable(model); 87 | corner.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 88 | corner.setRowMargin(1); 89 | corner.getColumnModel().setColumnMargin(1); 90 | corner.setShowGrid(true); 91 | corner.setShowHorizontalLines(true); 92 | corner.setShowVerticalLines(true); 93 | corner.setRowSelectionAllowed(false); 94 | corner.getColumnModel().setColumnSelectionAllowed(false); 95 | corner.getTableHeader().setReorderingAllowed(false); 96 | corner.setDragEnabled(false); 97 | 98 | corner.setRowHeight(39); 99 | 100 | MultiLineTableHeaderRenderer renderer = new MultiLineTableHeaderRenderer(); 101 | Enumeration enumK = corner.getColumnModel().getColumns(); 102 | while (enumK.hasMoreElements()) 103 | { 104 | TableColumn c = ((TableColumn) enumK.nextElement()); 105 | c.setCellRenderer(renderer); 106 | } 107 | corner.getColumnModel().getColumn(0).setWidth(21); 108 | corner.getColumnModel().getColumn(0).setPreferredWidth(21); 109 | 110 | return corner; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/CellTypes.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells; 2 | 3 | import javax.swing.table.TableCellEditor; 4 | import javax.swing.table.TableCellRenderer; 5 | 6 | public enum CellTypes 7 | { 8 | INTEGER, 9 | STRING, 10 | COMBO_BOX, 11 | COLORED_COMBO_BOX, 12 | BITFIELD_COMBO_BOX, 13 | CHECKBOX, 14 | CUSTOM; 15 | 16 | 17 | public interface CustomCellFunctionSupplier { 18 | 19 | TableCellEditor getEditor(String[]... strings); 20 | TableCellRenderer getRenderer(String[]... strings); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/editors/BitfieldComboBoxEditor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.editors; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | public class BitfieldComboBoxEditor extends ComboBoxCellEditor 7 | { 8 | public BitfieldComboBoxEditor(String[] items) 9 | { 10 | super(items); 11 | } 12 | 13 | @Override 14 | public Object getCellEditorValue() 15 | { 16 | int val = comboBox.getSelectedIndex(); 17 | if (val == 0) 18 | return 0; 19 | 20 | return (1 << val - 1); 21 | } 22 | 23 | @Override 24 | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) 25 | { 26 | int val = (Integer) value; 27 | if (val == 0) 28 | comboBox.setSelectedIndex(0); 29 | else { 30 | val = (int) (Math.log(val) / Math.log(2)) + 1; 31 | comboBox.setSelectedIndex(val); 32 | } 33 | 34 | return comboBox; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/editors/CheckBoxEditor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.editors; 2 | 3 | import javax.swing.*; 4 | import javax.swing.table.TableCellEditor; 5 | import java.awt.*; 6 | 7 | public class CheckBoxEditor extends AbstractCellEditor implements TableCellEditor 8 | { 9 | JPanel panel = new JPanel(); 10 | JCheckBox checkBox; 11 | 12 | public CheckBoxEditor() 13 | { 14 | super(); 15 | checkBox = new JCheckBox(); 16 | panel.add(checkBox); 17 | } 18 | 19 | @Override 20 | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) 21 | { 22 | checkBox.setSelected((Boolean) value); 23 | return panel; 24 | } 25 | 26 | @Override 27 | public Object getCellEditorValue() 28 | { 29 | return checkBox.isSelected(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/editors/ComboBoxCellEditor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.editors; 2 | 3 | import io.github.turtleisaac.pokeditor.gui.EditorComboBox; 4 | 5 | import javax.swing.*; 6 | import javax.swing.table.TableCellEditor; 7 | import java.awt.*; 8 | 9 | public class ComboBoxCellEditor extends AbstractCellEditor implements TableCellEditor 10 | { 11 | 12 | EditorComboBox comboBox; 13 | 14 | public ComboBoxCellEditor(String[] items) 15 | { 16 | comboBox = new EditorComboBox(items); 17 | } 18 | 19 | public void setItems(String[] items) 20 | { 21 | comboBox = new EditorComboBox(items); 22 | } 23 | 24 | @Override 25 | public Object getCellEditorValue() 26 | { 27 | return comboBox.getSelectedIndex(); 28 | } 29 | 30 | @Override 31 | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) 32 | { 33 | comboBox.setSelectedIndex((Integer) value); 34 | return comboBox; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/editors/NumberOnlyCellEditor.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.editors; 2 | 3 | import javax.swing.*; 4 | import javax.swing.table.TableCellEditor; 5 | import javax.swing.text.AbstractDocument; 6 | import javax.swing.text.AttributeSet; 7 | import javax.swing.text.BadLocationException; 8 | import javax.swing.text.DocumentFilter; 9 | import java.awt.*; 10 | 11 | public class NumberOnlyCellEditor extends AbstractCellEditor implements TableCellEditor 12 | { 13 | private final JTextField textField; 14 | private Object lastValue; 15 | 16 | public NumberOnlyCellEditor() 17 | { 18 | textField = new JTextField(); 19 | ((AbstractDocument) textField.getDocument()).setDocumentFilter(new DocumentFilter() { 20 | @Override 21 | public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException 22 | { 23 | fb.insertString(offset, string.replaceAll("\\D++", ""), attr); 24 | } 25 | 26 | @Override 27 | public void replace(FilterBypass fb, int off, int len, String str, AttributeSet attr) 28 | throws BadLocationException { 29 | fb.replace(off, len, str.replaceAll("\\D++", ""), attr); 30 | } 31 | }); 32 | } 33 | 34 | @Override 35 | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) 36 | { 37 | lastValue = String.valueOf(value); 38 | if (value instanceof String) 39 | textField.setText((String) value); 40 | else if (value instanceof Integer) 41 | textField.setText(((Integer) value).toString()); 42 | return textField; 43 | } 44 | 45 | @Override 46 | public Object getCellEditorValue() 47 | { 48 | int val = Integer.parseInt((String) lastValue); 49 | if (val >= 0 || val <= 255) 50 | return textField.getText(); 51 | return lastValue; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/renderers/BitfieldStringCellRenderer.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | public class BitfieldStringCellRenderer extends IndexedStringCellRenderer 7 | { 8 | public BitfieldStringCellRenderer(String[] items) 9 | { 10 | super(items); 11 | } 12 | 13 | @Override 14 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 15 | { 16 | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 17 | 18 | if (value != null) { 19 | if (value instanceof Integer val) 20 | { 21 | if (val == 0) { 22 | setText(items[0]); 23 | return this; 24 | } 25 | 26 | val = (int) (Math.log(val) / Math.log(2) + 1); 27 | if (val < items.length) { 28 | this.setText(items[val]); 29 | } 30 | } 31 | } 32 | 33 | return this; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/renderers/CheckBoxRenderer.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | public class CheckBoxRenderer extends DefaultSheetCellRenderer 7 | { 8 | JPanel panel; 9 | JCheckBox checkBox; 10 | 11 | public CheckBoxRenderer() 12 | { 13 | super(); 14 | panel = new JPanel(); 15 | checkBox = new JCheckBox(); 16 | panel.add(checkBox); 17 | // checkBox.setVisible(true); 18 | // add(panel); 19 | // add(checkBox); 20 | // add(checkBox); 21 | // add(new JButton()); 22 | setPreferredSize(getPreferredSize()); 23 | setHorizontalAlignment(CENTER); 24 | } 25 | 26 | @Override 27 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 28 | { 29 | super.getTableCellRendererComponent(table, "", isSelected, hasFocus, row, column); 30 | checkBox.setSelected((Boolean) value); 31 | return panel; 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/renderers/DefaultSheetCellRenderer.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers; 2 | 3 | import javax.swing.*; 4 | import javax.swing.border.Border; 5 | import javax.swing.table.DefaultTableCellRenderer; 6 | import java.awt.*; 7 | 8 | public class DefaultSheetCellRenderer extends DefaultTableCellRenderer 9 | { 10 | public DefaultSheetCellRenderer() 11 | { 12 | super(); 13 | } 14 | 15 | @Override 16 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 17 | { 18 | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 19 | 20 | if (isSelected || table.getSelectedRow() == row) { 21 | Border border = UIManager.getBorder("Table.focusCellHighlightBorder"); 22 | setBorder(border); 23 | if (!isSelected) 24 | { 25 | setBackground(UIManager.getColor("Table.selectionInactiveBackground")); 26 | } 27 | else 28 | { 29 | setBackground(UIManager.getColor("Component.custom.borderColor")); 30 | } 31 | 32 | } 33 | else { 34 | if (row % 2 == 0) 35 | setBackground(table.getBackground()); 36 | else 37 | setBackground(UIManager.getColor("TableHeader.pressedBackground")); 38 | } 39 | 40 | // if (isSelected || table.getSelectedRow() == row) { 41 | // setBackground(table.getSelectionBackground()); 42 | // } else { 43 | // setForeground(getForeground()); 44 | 45 | // } 46 | // setBorder(BorderFactory.createCompoundBorder()); 47 | 48 | return this; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/renderers/IndexedStringCellRenderer.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | public class IndexedStringCellRenderer extends DefaultSheetCellRenderer 7 | { 8 | String[] items; 9 | 10 | public IndexedStringCellRenderer(String[] items) 11 | { 12 | this.items = items; 13 | } 14 | 15 | public void setItems(String[] items) 16 | { 17 | this.items = items; 18 | } 19 | 20 | @Override 21 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 22 | { 23 | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 24 | 25 | if (value != null) 26 | { 27 | if (value instanceof Integer val) 28 | { 29 | if (val < items.length) 30 | { 31 | this.setText(items[val]); 32 | } 33 | } 34 | else if (value instanceof String s) 35 | { 36 | int val = Integer.parseInt(s); 37 | if (val < items.length) 38 | { 39 | this.setText(items[val]); 40 | } 41 | } 42 | } 43 | 44 | return this; 45 | } 46 | 47 | public static class ColoredIndexedStringCellRenderer extends IndexedStringCellRenderer 48 | { 49 | private final Color[] colors; 50 | 51 | public ColoredIndexedStringCellRenderer(String[] items, Color[] colors) 52 | { 53 | super(items); 54 | this.colors = colors; 55 | } 56 | 57 | @Override 58 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 59 | { 60 | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 61 | // Border border = getBorder(); 62 | if (!isSelected && value != null) 63 | { 64 | if (value instanceof Integer) 65 | { 66 | this.setBackground(colors[(int) value]); // always in bounds because of earlier check 67 | // this.setForeground(Color.black); 68 | // setBorder(border); 69 | } 70 | } 71 | return this; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/cells/renderers/MultiLineTableHeaderRenderer.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.renderers; 2 | 3 | import javax.swing.*; 4 | import javax.swing.table.TableCellRenderer; 5 | import java.awt.*; 6 | 7 | public class MultiLineTableHeaderRenderer extends JTextArea implements TableCellRenderer 8 | { 9 | public MultiLineTableHeaderRenderer() 10 | { 11 | setEditable(false); 12 | setLineWrap(true); 13 | setOpaque(false); 14 | setFocusable(false); 15 | setWrapStyleWord(true); 16 | LookAndFeel.installBorder(this, "TableHeader.cellBorder"); 17 | } 18 | 19 | @Override 20 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 21 | { 22 | int width = table.getColumnModel().getColumn(column).getWidth(); 23 | setText(String.valueOf(value)); 24 | setSize(width, getPreferredSize().height); 25 | if (table.getSelectedColumn() == column) 26 | { 27 | setForeground(UIManager.getColor("Component.custom.borderColor")); 28 | } 29 | else { 30 | setForeground(UIManager.getColor("TableHeader.foreground")); 31 | } 32 | return this; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/formats/LearnsetsTable.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.formats; 2 | 3 | import io.github.turtleisaac.pokeditor.formats.learnsets.LearnsetData; 4 | import io.github.turtleisaac.pokeditor.formats.text.TextBankData; 5 | import io.github.turtleisaac.pokeditor.gamedata.TextFiles; 6 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.CellTypes; 7 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.DefaultTable; 8 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.FormatModel; 9 | 10 | import java.util.LinkedList; 11 | import java.util.List; 12 | import java.util.Queue; 13 | 14 | public class LearnsetsTable extends DefaultTable 15 | { 16 | public static final int[] columnWidths = new int[] {40, 100, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65, 140, 65}; 17 | 18 | public LearnsetsTable(List data, List textData) 19 | { 20 | super(new LearnsetsModel(data, textData), textData, columnWidths, null); 21 | } 22 | 23 | @Override 24 | public Queue obtainTextSources(List textData) 25 | { 26 | Queue textSources = new LinkedList<>(); 27 | 28 | String[] moveNames = textData.get(TextFiles.MOVE_NAMES.getValue()).getStringList().toArray(String[]::new); 29 | 30 | for (int i = 0; i < 20; i++) 31 | { 32 | textSources.add(moveNames); 33 | } 34 | 35 | return textSources; 36 | } 37 | 38 | @Override 39 | public Class getDataClass() 40 | { 41 | return LearnsetData.class; 42 | } 43 | 44 | static class LearnsetsModel extends FormatModel 45 | { 46 | 47 | public LearnsetsModel(List data, List textBankData) 48 | { 49 | super(data, textBankData); 50 | } 51 | 52 | @Override 53 | public int getNumFrozenColumns() 54 | { 55 | return 2; 56 | } 57 | 58 | @Override 59 | public String getColumnNameKey(int columnIndex) 60 | { 61 | return LearnsetsColumn.getColumn(columnIndex).key; 62 | } 63 | 64 | @Override 65 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 66 | { 67 | if (columnIndex >= 0) 68 | { 69 | LearnsetsColumn c = LearnsetsColumn.getColumn(columnIndex % LearnsetsColumn.NUMBER_OF_COLUMNS.idx); 70 | c.repetition = columnIndex; 71 | setValueFor(aValue, rowIndex, c); 72 | } 73 | else 74 | { 75 | setValueFor(aValue, rowIndex, LearnsetsColumn.getColumn(columnIndex)); 76 | } 77 | 78 | } 79 | 80 | @Override 81 | public void setValueFor(Object aValue, int rowIdx, LearnsetsColumn property) 82 | { 83 | LearnsetData learnset = getData().get(rowIdx); 84 | 85 | aValue = prepareObjectForWriting(aValue, property.cellType); 86 | 87 | if (property.idx >= 0) 88 | { 89 | int entryIdx = property.repetition / LearnsetsColumn.NUMBER_OF_COLUMNS.idx; 90 | while (entryIdx > learnset.size()) 91 | { 92 | learnset.add(new LearnsetData.LearnsetEntry()); 93 | } 94 | LearnsetData.LearnsetEntry entry = learnset.get(entryIdx); 95 | 96 | switch (property) { 97 | case MOVE -> entry.setMoveID((Integer) aValue); 98 | case LEVEL -> entry.setLevel((Integer) aValue); 99 | } 100 | } 101 | } 102 | 103 | @Override 104 | public int getColumnCount() 105 | { 106 | return LearnsetData.MAX_NUM_ENTRIES * LearnsetsColumn.NUMBER_OF_COLUMNS.idx; 107 | } 108 | 109 | @Override 110 | public Object getValueAt(int rowIndex, int columnIndex) 111 | { 112 | if (columnIndex >= 0) { 113 | LearnsetsColumn c = LearnsetsColumn.getColumn(columnIndex % LearnsetsColumn.NUMBER_OF_COLUMNS.idx); 114 | c.repetition = columnIndex; 115 | return getValueFor(rowIndex, c); 116 | } 117 | return getValueFor(rowIndex, LearnsetsColumn.getColumn(columnIndex)); 118 | } 119 | 120 | @Override 121 | public Object getValueFor(int rowIndex, LearnsetsColumn property) 122 | { 123 | TextBankData speciesNames = getTextBankData().get(TextFiles.SPECIES_NAMES.getValue()); 124 | LearnsetData learnset = getData().get(rowIndex); 125 | 126 | if (property.idx >= 0) 127 | { 128 | int entryIdx = property.repetition / LearnsetsColumn.NUMBER_OF_COLUMNS.idx; 129 | while (entryIdx >= learnset.size()) 130 | { 131 | learnset.add(new LearnsetData.LearnsetEntry()); 132 | } 133 | LearnsetData.LearnsetEntry entry = learnset.get(entryIdx); 134 | 135 | switch (property) { 136 | case MOVE -> { 137 | return entry.getMoveID(); 138 | } 139 | case LEVEL -> { 140 | return entry.getLevel(); 141 | } 142 | } 143 | } 144 | else if (property == LearnsetsColumn.ID) 145 | { 146 | return rowIndex; 147 | } 148 | else if (property == LearnsetsColumn.NAME) 149 | { 150 | if(rowIndex < speciesNames.size()) 151 | return speciesNames.get(rowIndex).getText(); 152 | else 153 | return ""; 154 | } 155 | 156 | return null; 157 | } 158 | 159 | @Override 160 | protected CellTypes getCellType(int columnIndex) 161 | { 162 | if (columnIndex >= 0) 163 | { 164 | return LearnsetsColumn.getColumn(columnIndex % LearnsetsColumn.NUMBER_OF_COLUMNS.idx).cellType; 165 | } 166 | 167 | return LearnsetsColumn.getColumn(columnIndex).cellType; 168 | } 169 | 170 | @Override 171 | public FormatModel getFrozenColumnModel() 172 | { 173 | return new LearnsetsTable.LearnsetsModel(getData(), getTextBankData()) { 174 | @Override 175 | public int getColumnCount() 176 | { 177 | return super.getNumFrozenColumns(); 178 | } 179 | 180 | @Override 181 | public Object getValueAt(int rowIndex, int columnIndex) 182 | { 183 | return super.getValueAt(rowIndex, columnIndex - super.getNumFrozenColumns()); 184 | } 185 | 186 | @Override 187 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 188 | { 189 | super.setValueAt(aValue, rowIndex, columnIndex - super.getNumFrozenColumns()); 190 | } 191 | 192 | @Override 193 | public boolean isCellEditable(int rowIndex, int columnIndex) 194 | { 195 | return false; 196 | } 197 | }; 198 | } 199 | } 200 | 201 | enum LearnsetsColumn 202 | { 203 | ID(-2, "id", CellTypes.INTEGER), 204 | NAME(-1, "name", CellTypes.STRING), 205 | MOVE(0, "move", CellTypes.COMBO_BOX), 206 | LEVEL(1, "level", CellTypes.INTEGER), 207 | NUMBER_OF_COLUMNS(2, null, null); 208 | 209 | private final int idx; 210 | private final String key; 211 | private final CellTypes cellType; 212 | int repetition; 213 | 214 | LearnsetsColumn(int idx, String key, CellTypes cellType) 215 | { 216 | this.idx = idx; 217 | this.key = key; 218 | this.cellType = cellType; 219 | } 220 | 221 | static LearnsetsColumn getColumn(int idx) 222 | { 223 | for (LearnsetsColumn column : LearnsetsColumn.values()) 224 | { 225 | if (column.idx == idx) { 226 | return column; 227 | } 228 | } 229 | return NUMBER_OF_COLUMNS; 230 | } 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/formats/MovesTable.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.formats; 2 | 3 | import io.github.turtleisaac.pokeditor.formats.moves.MoveData; 4 | import io.github.turtleisaac.pokeditor.formats.text.TextBankData; 5 | import io.github.turtleisaac.pokeditor.gamedata.TextFiles; 6 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.CellTypes; 7 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.DefaultTable; 8 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.FormatModel; 9 | 10 | import java.util.LinkedList; 11 | import java.util.List; 12 | import java.util.Queue; 13 | 14 | public class MovesTable extends DefaultTable 15 | { 16 | public static final int[] columnWidths = new int[] {40, 100, 500, 100, 65, 100, 65, 65, 120, 160, 65, 65, 80, 80, 80, 80, 80, 80, 80, 80, 65, 65}; 17 | private static final String[] categoryKeys = new String[] {"category.physical", "category.special", "category.status"}; 18 | private static final String[] targetKeys = new String[] {"target.selected", "target.automatic", "target.random", "target.bothFoes", "target.allExceptUser", "target.user", "target.userSide", "target.entireField", "target.foeSide", "target.ally", "target.userOrAlly", "target.MOVE_TARGET_ME_FIRST"}; 19 | 20 | public MovesTable(List data, List textData) 21 | { 22 | super(new MovesModel(data, textData), textData, columnWidths, null); 23 | } 24 | 25 | @Override 26 | public Queue obtainTextSources(List textData) 27 | { 28 | Queue textSources = new LinkedList<>(); 29 | 30 | String[] categories = DefaultTable.loadStringsFromKeys(categoryKeys); 31 | 32 | String[] typeNames = textData.get(TextFiles.TYPE_NAMES.getValue()).getStringList().toArray(String[]::new); 33 | 34 | String[] targets = DefaultTable.loadStringsFromKeys(targetKeys); 35 | 36 | // String[] arr = new String[500]; 37 | // Arrays.fill(arr, "Moo"); 38 | 39 | textSources.add(categories); 40 | textSources.add(typeNames); 41 | textSources.add(targets); 42 | // textSources.add(arr); 43 | 44 | return textSources; 45 | } 46 | 47 | @Override 48 | public Class getDataClass() 49 | { 50 | return MoveData.class; 51 | } 52 | 53 | static class MovesModel extends FormatModel 54 | { 55 | 56 | public MovesModel(List data, List textBankData) 57 | { 58 | super(data, textBankData); 59 | } 60 | 61 | @Override 62 | public int getNumFrozenColumns() 63 | { 64 | return 2; 65 | } 66 | 67 | @Override 68 | public String getColumnNameKey(int columnIndex) 69 | { 70 | return MovesColumn.getColumn(columnIndex).key; 71 | } 72 | 73 | @Override 74 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 75 | { 76 | setValueFor(aValue, rowIndex, MovesColumn.getColumn(columnIndex)); 77 | } 78 | 79 | @Override 80 | public void setValueFor(Object aValue, int entryIdx, MovesColumn property) 81 | { 82 | MoveData entry = getData().get(entryIdx); 83 | TextBankData moveNames = getTextBankData().get(TextFiles.MOVE_NAMES.getValue()); 84 | 85 | aValue = prepareObjectForWriting(aValue, property.cellType); 86 | 87 | switch (property) { 88 | case ID -> {} 89 | case NAME -> { 90 | TextBankData.Message message = moveNames.get(entryIdx); 91 | message.setText((String) aValue); 92 | } 93 | case EFFECT -> entry.setEffect((Integer) aValue); 94 | case CATEGORY -> entry.setCategory((Integer) aValue); 95 | case POWER -> entry.setPower((Integer) aValue); 96 | case TYPE -> entry.setType((Integer) aValue); 97 | case ACCURACY -> entry.setAccuracy((Integer) aValue); 98 | case PP -> entry.setPp((Integer) aValue); 99 | case EFFECT_CHANCE -> entry.setEffectChance((Integer) aValue); 100 | case TARGET -> entry.setTarget((Integer) aValue); 101 | case PRIORITY -> entry.setPriority((Integer) aValue); 102 | case MAKES_CONTACT, BLOCKED_BY_PROTECT, REFLECTED_BY_MAGIC_COAT, AFFECTED_BY_SNATCH, AFFECTED_BY_MIRROR_MOVE, TRIGGERS_KINGS_ROCK, HIDES_HP_BARS, REMOVE_TARGET_SHADOW -> entry.getFlags()[property.idx - MovesColumn.MAKES_CONTACT.idx] = (Boolean) aValue; 103 | case CONTEST_EFFECT -> entry.setContestEffect((Integer) aValue); 104 | case CONTEST_TYPE -> entry.setContestType((Integer) aValue); 105 | } 106 | } 107 | 108 | @Override 109 | public int getColumnCount() 110 | { 111 | return MovesColumn.NUMBER_OF_COLUMNS.idx; 112 | } 113 | 114 | @Override 115 | public Object getValueAt(int rowIndex, int columnIndex) 116 | { 117 | return getValueFor(rowIndex, MovesColumn.getColumn(columnIndex)); 118 | } 119 | 120 | @Override 121 | public Object getValueFor(int rowIndex, MovesColumn property) 122 | { 123 | TextBankData moveNames = getTextBankData().get(TextFiles.MOVE_NAMES.getValue()); 124 | MoveData entry = getData().get(rowIndex); 125 | 126 | switch (property) { 127 | case ID -> { 128 | return rowIndex; 129 | } 130 | case NAME -> { 131 | if(rowIndex < moveNames.size()) 132 | return moveNames.get(rowIndex).getText(); 133 | else 134 | return ""; 135 | } 136 | case EFFECT -> { 137 | return entry.getEffect(); 138 | } 139 | case CATEGORY -> { 140 | return entry.getCategory(); 141 | } 142 | case POWER -> { 143 | return entry.getPower(); 144 | } 145 | case TYPE -> { 146 | return entry.getType(); 147 | } 148 | case ACCURACY -> { 149 | return entry.getAccuracy(); 150 | } 151 | case PP -> { 152 | return entry.getPp(); 153 | } 154 | case EFFECT_CHANCE -> { 155 | return entry.getEffectChance(); 156 | } 157 | case TARGET -> { 158 | return entry.getTarget(); 159 | } 160 | case PRIORITY -> { 161 | return entry.getPriority(); 162 | } 163 | case MAKES_CONTACT, BLOCKED_BY_PROTECT, REFLECTED_BY_MAGIC_COAT, AFFECTED_BY_SNATCH, AFFECTED_BY_MIRROR_MOVE, TRIGGERS_KINGS_ROCK, HIDES_HP_BARS, REMOVE_TARGET_SHADOW -> { 164 | return entry.getFlags()[property.idx - MovesColumn.MAKES_CONTACT.idx]; 165 | } 166 | case CONTEST_EFFECT -> { 167 | return entry.getContestEffect(); 168 | } 169 | case CONTEST_TYPE -> { 170 | return entry.getContestType(); 171 | } 172 | } 173 | 174 | return null; 175 | } 176 | 177 | @Override 178 | protected CellTypes getCellType(int columnIndex) 179 | { 180 | return MovesColumn.getColumn(columnIndex).cellType; 181 | } 182 | 183 | @Override 184 | public FormatModel getFrozenColumnModel() 185 | { 186 | return new MovesModel(getData(), getTextBankData()) { 187 | @Override 188 | public int getColumnCount() 189 | { 190 | return super.getNumFrozenColumns(); 191 | } 192 | 193 | @Override 194 | public Object getValueAt(int rowIndex, int columnIndex) 195 | { 196 | return super.getValueAt(rowIndex, columnIndex - super.getNumFrozenColumns()); 197 | } 198 | 199 | @Override 200 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 201 | { 202 | super.setValueAt(aValue, rowIndex, columnIndex - super.getNumFrozenColumns()); 203 | } 204 | 205 | @Override 206 | protected CellTypes getCellType(int columnIndex) 207 | { 208 | return super.getCellType(columnIndex - super.getNumFrozenColumns()); 209 | } 210 | 211 | @Override 212 | public boolean isCellEditable(int rowIndex, int columnIndex) 213 | { 214 | return columnIndex != 0; 215 | } 216 | }; 217 | } 218 | } 219 | 220 | enum MovesColumn 221 | { 222 | ID(-2, "id", CellTypes.INTEGER), 223 | NAME(-1, "name", CellTypes.STRING), 224 | EFFECT(0, "moves.effect", CellTypes.INTEGER), 225 | CATEGORY(1, "category", CellTypes.COMBO_BOX), 226 | POWER(2, "power", CellTypes.INTEGER), 227 | TYPE(3, "type", CellTypes.COLORED_COMBO_BOX), 228 | ACCURACY(4, "accuracy", CellTypes.INTEGER), 229 | PP(5, "pp", CellTypes.INTEGER), 230 | EFFECT_CHANCE(6, "moves.effectChance", CellTypes.INTEGER), 231 | TARGET(7, "target", CellTypes.BITFIELD_COMBO_BOX), 232 | PRIORITY(8, "priority", CellTypes.INTEGER), 233 | MAKES_CONTACT(9, "moves.makesContact", CellTypes.CHECKBOX), 234 | BLOCKED_BY_PROTECT(10, "moves.blockedByProtect", CellTypes.CHECKBOX), 235 | REFLECTED_BY_MAGIC_COAT(11, "moves.reflectedByMagicCoat", CellTypes.CHECKBOX), 236 | AFFECTED_BY_SNATCH(12, "moves.affectedBySnatch", CellTypes.CHECKBOX), 237 | AFFECTED_BY_MIRROR_MOVE(13, "moves.affectedByMirrorMove", CellTypes.CHECKBOX), 238 | TRIGGERS_KINGS_ROCK(14, "moves.triggersKingsRock", CellTypes.CHECKBOX), 239 | HIDES_HP_BARS(15, "moves.hidesHpBars", CellTypes.CHECKBOX), 240 | REMOVE_TARGET_SHADOW(16, "moves.removeTargetShadow", CellTypes.CHECKBOX), 241 | CONTEST_EFFECT(17, "moves.contestEffect", CellTypes.INTEGER), 242 | CONTEST_TYPE(18, "moves.contestType", CellTypes.INTEGER), 243 | NUMBER_OF_COLUMNS(19, null, null); 244 | 245 | private final int idx; 246 | private final String key; 247 | private final CellTypes cellType; 248 | 249 | MovesColumn(int idx, String key, CellTypes cellType) 250 | { 251 | this.idx = idx; 252 | this.key = key; 253 | this.cellType = cellType; 254 | } 255 | 256 | static MovesColumn getColumn(int idx) 257 | { 258 | for (MovesColumn column : MovesColumn.values()) 259 | { 260 | if (column.idx == idx) { 261 | return column; 262 | } 263 | } 264 | return NUMBER_OF_COLUMNS; 265 | } 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui/sheets/tables/formats/TmCompatibilityTable.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui.sheets.tables.formats; 2 | 3 | import com.formdev.flatlaf.extras.components.FlatPopupMenu; 4 | import io.github.turtleisaac.pokeditor.DataManager; 5 | import io.github.turtleisaac.pokeditor.formats.moves.MoveData; 6 | import io.github.turtleisaac.pokeditor.formats.personal.PersonalData; 7 | import io.github.turtleisaac.pokeditor.formats.personal.PersonalParser; 8 | import io.github.turtleisaac.pokeditor.formats.text.TextBankData; 9 | import io.github.turtleisaac.pokeditor.gamedata.TextFiles; 10 | import io.github.turtleisaac.pokeditor.gui.EditorComboBox; 11 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.cells.CellTypes; 12 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.DefaultTable; 13 | import io.github.turtleisaac.pokeditor.gui.sheets.tables.FormatModel; 14 | 15 | import javax.swing.*; 16 | import javax.swing.table.*; 17 | import java.awt.*; 18 | import java.awt.event.MouseAdapter; 19 | import java.awt.event.MouseEvent; 20 | import java.util.*; 21 | import java.util.List; 22 | 23 | public class TmCompatibilityTable extends DefaultTable 24 | { 25 | //todo 0xF0BFC is address of TMs table 26 | static final int[] columnWidths = new int[102]; 27 | static { 28 | Arrays.fill(columnWidths, 120); 29 | } 30 | 31 | public TmCompatibilityTable(List data, List textData) 32 | { 33 | super(new TmCompatibilityModel(data, textData), textData, columnWidths, null); 34 | String[] moveNames = textData.get(TextFiles.MOVE_NAMES.getValue()).getStringList().toArray(String[]::new); 35 | 36 | TableCellRenderer renderer = new DefaultTableCellRenderer() { 37 | @Override 38 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 39 | { 40 | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 41 | 42 | if (value != null) 43 | { 44 | if (value instanceof Integer val) 45 | { 46 | if (val < moveNames.length) 47 | { 48 | this.setText(moveNames[val]); 49 | } 50 | } 51 | else if (value instanceof String s) 52 | { 53 | int val = Integer.parseInt(s); 54 | if (val < moveNames.length) 55 | { 56 | this.setText(moveNames[val]); 57 | } 58 | } 59 | } 60 | 61 | return this; 62 | } 63 | }; 64 | 65 | Enumeration columns = getColumnModel().getColumns(); 66 | while (columns.hasMoreElements()) 67 | { 68 | columns.nextElement().setHeaderRenderer(renderer); 69 | } 70 | setupEditableHeader(); 71 | } 72 | 73 | @Override 74 | public Queue obtainTextSources(List textData) 75 | { 76 | Queue textSources = new LinkedList<>(); 77 | return textSources; 78 | } 79 | 80 | @Override 81 | public Class getDataClass() 82 | { 83 | return PersonalData.class; 84 | } 85 | 86 | public static class TmCompatibilityModel extends FormatModel 87 | { 88 | 89 | public TmCompatibilityModel(List data, List textBankData) 90 | { 91 | super(data, textBankData); 92 | } 93 | 94 | @Override 95 | public int getNumFrozenColumns() 96 | { 97 | return 2; 98 | } 99 | 100 | @Override 101 | public String getColumnNameKey(int columnIndex) 102 | { 103 | return TmCompatibilityColumns.getColumn(columnIndex).key; 104 | } 105 | 106 | @Override 107 | public String getColumnName(int column) 108 | { 109 | if (column < 0) 110 | return super.getColumnName(column); 111 | return "" + PersonalParser.tmMoveIdNumbers[column]; 112 | } 113 | 114 | @Override 115 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 116 | { 117 | if (columnIndex >= 0) { 118 | TmCompatibilityColumns c = TmCompatibilityColumns.getColumn(0); 119 | c.repetition = columnIndex; 120 | setValueFor(aValue, rowIndex, c); 121 | } 122 | } 123 | 124 | @Override 125 | public void setValueFor(Object aValue, int entryIdx, TmCompatibilityColumns property) 126 | { 127 | PersonalData entry = getData().get(entryIdx); 128 | 129 | if (property == TmCompatibilityColumns.TM) 130 | { 131 | aValue = prepareObjectForWriting(aValue, property.cellType); 132 | entry.getTmCompatibility()[property.repetition] = (boolean) aValue; 133 | } 134 | } 135 | 136 | @Override 137 | public int getColumnCount() 138 | { 139 | return 100; 140 | } 141 | 142 | @Override 143 | public Object getValueAt(int rowIndex, int columnIndex) 144 | { 145 | if (columnIndex >= 0) { 146 | TmCompatibilityColumns c = TmCompatibilityColumns.getColumn(0); 147 | c.repetition = columnIndex; 148 | return getValueFor(rowIndex, c); 149 | } 150 | return getValueFor(rowIndex, TmCompatibilityColumns.getColumn(columnIndex)); 151 | } 152 | 153 | @Override 154 | public Object getValueFor(int entryIdx, TmCompatibilityColumns property) 155 | { 156 | TextBankData speciesNames = getTextBankData().get(TextFiles.SPECIES_NAMES.getValue()); 157 | PersonalData entry = getData().get(entryIdx); 158 | 159 | switch (property) 160 | { 161 | case ID -> { 162 | return entryIdx; 163 | } 164 | case NAME -> { 165 | if(entryIdx < speciesNames.size()) 166 | return speciesNames.get(entryIdx).getText(); 167 | else 168 | return ""; 169 | } 170 | case TM -> { 171 | return entry.getTmCompatibility()[property.repetition]; 172 | } 173 | } 174 | return null; 175 | } 176 | 177 | @Override 178 | protected CellTypes getCellType(int columnIndex) 179 | { 180 | return CellTypes.CHECKBOX; 181 | } 182 | 183 | @Override 184 | public FormatModel getFrozenColumnModel() 185 | { 186 | return new TmCompatibilityModel(getData(), getTextBankData()) { 187 | @Override 188 | public int getColumnCount() 189 | { 190 | return super.getNumFrozenColumns(); 191 | } 192 | 193 | @Override 194 | public Object getValueAt(int rowIndex, int columnIndex) 195 | { 196 | return super.getValueAt(rowIndex, columnIndex - super.getNumFrozenColumns()); 197 | } 198 | 199 | @Override 200 | public void setValueAt(Object aValue, int rowIndex, int columnIndex) 201 | { 202 | super.setValueAt(aValue, rowIndex, columnIndex - super.getNumFrozenColumns()); 203 | } 204 | 205 | @Override 206 | public boolean isCellEditable(int rowIndex, int columnIndex) 207 | { 208 | return false; 209 | } 210 | }; 211 | } 212 | } 213 | 214 | public enum TmCompatibilityColumns { 215 | ID(-2, "id", CellTypes.INTEGER), 216 | NAME(-1, "name", CellTypes.STRING), 217 | TM(0, "name", CellTypes.CHECKBOX), 218 | NUMBER_OF_COLUMNS(1, null, null); 219 | 220 | private final int idx; 221 | private final String key; 222 | private final CellTypes cellType; 223 | int repetition; 224 | 225 | TmCompatibilityColumns(int idx, String key, CellTypes cellType) 226 | { 227 | this.idx = idx; 228 | this.key = key; 229 | this.cellType = cellType; 230 | } 231 | 232 | static TmCompatibilityColumns getColumn(int idx) 233 | { 234 | for (TmCompatibilityColumns column : TmCompatibilityColumns.values()) 235 | { 236 | if (column.idx == idx) { 237 | return column; 238 | } 239 | } 240 | return NUMBER_OF_COLUMNS; 241 | } 242 | } 243 | 244 | public void setupEditableHeader() 245 | { 246 | String[] moveNames = getFormatModel().getTextBankData().get(TextFiles.MOVE_NAMES.getValue()).getStringList().toArray(String[]::new); 247 | tableHeader.setEnabled(true); 248 | 249 | tableHeader.addMouseListener(new MouseAdapter(){ 250 | @Override 251 | public void mouseClicked(MouseEvent event) 252 | { 253 | if (event.getClickCount() == 2) 254 | { 255 | int columnIndex = tableHeader.columnAtPoint(event.getPoint()); 256 | 257 | if (columnIndex >= 0) 258 | { 259 | TableColumn column = tableHeader.getColumnModel().getColumn(columnIndex); 260 | 261 | Rectangle rect = tableHeader.getHeaderRect(columnIndex); 262 | 263 | JPopupMenu popupMenu = new JPopupMenu(); 264 | 265 | DefaultListModel items = new DefaultListModel<>(); 266 | for (String moveName : moveNames) { 267 | items.addElement(new EditorComboBox.ComboBoxItem(moveName)); 268 | } 269 | JList list = new JList<>(items); 270 | list.setSelectedIndex(PersonalParser.tmMoveIdNumbers[columnIndex]); 271 | 272 | list.addListSelectionListener(e -> { 273 | PersonalParser.updateTmType(columnIndex, list.getSelectedIndex(), DataManager.getData(null, MoveData.class)); 274 | column.setHeaderValue(list.getSelectedIndex()); 275 | }); 276 | 277 | popupMenu.setPreferredSize( 278 | new Dimension(rect.width, rect.height * 5)); 279 | 280 | popupMenu.add(new JScrollPane(list)); 281 | list.scrollRectToVisible(list.getCellBounds(list.getSelectedIndex(), list.getSelectedIndex())); 282 | popupMenu.show(tableHeader, rect.x, 0); 283 | } 284 | } 285 | } 286 | }); 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/CircleButton.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui_old; 2 | 3 | import javax.swing.JButton; 4 | import java.awt.Graphics; 5 | import java.awt.Color; 6 | import java.awt.Dimension; 7 | import java.awt.geom.Point2D; 8 | import java.awt.FontMetrics; 9 | import java.awt.event.MouseAdapter; 10 | import java.awt.event.MouseEvent; 11 | 12 | public class CircleButton extends JButton 13 | { 14 | 15 | private boolean mouseOver = false; 16 | private boolean mousePressed = false; 17 | 18 | public CircleButton(){ 19 | super(); 20 | setOpaque(false); 21 | setFocusPainted(false); 22 | setBorderPainted(false); 23 | 24 | MouseAdapter mouseListener = new MouseAdapter(){ 25 | 26 | @Override 27 | public void mousePressed(MouseEvent me){ 28 | if(contains(me.getX(), me.getY())){ 29 | mousePressed = true; 30 | repaint(); 31 | } 32 | } 33 | 34 | @Override 35 | public void mouseReleased(MouseEvent me){ 36 | mousePressed = false; 37 | repaint(); 38 | } 39 | 40 | @Override 41 | public void mouseExited(MouseEvent me){ 42 | mouseOver = false; 43 | mousePressed = false; 44 | repaint(); 45 | } 46 | 47 | @Override 48 | public void mouseMoved(MouseEvent me){ 49 | mouseOver = contains(me.getX(), me.getY()); 50 | repaint(); 51 | } 52 | }; 53 | 54 | addMouseListener(mouseListener); 55 | addMouseMotionListener(mouseListener); 56 | } 57 | 58 | private int getDiameter(){ 59 | int diameter = Math.min(getWidth(), getHeight()); 60 | return diameter; 61 | } 62 | 63 | @Override 64 | public Dimension getPreferredSize(){ 65 | FontMetrics metrics = getGraphics().getFontMetrics(getFont()); 66 | int minDiameter = 10 + Math.max(metrics.stringWidth(getText()), metrics.getHeight()); 67 | return new Dimension(minDiameter, minDiameter); 68 | } 69 | 70 | @Override 71 | public boolean contains(int x, int y){ 72 | int radius = getDiameter()/2; 73 | return Point2D.distance(x, y, getWidth()/2, getHeight()/2) < radius; 74 | } 75 | 76 | @Override 77 | public void paintComponent(Graphics g){ 78 | 79 | int diameter = getDiameter(); 80 | int radius = diameter/2; 81 | 82 | if(mousePressed){ 83 | g.setColor(Color.LIGHT_GRAY); 84 | } 85 | else{ 86 | g.setColor(Color.WHITE); 87 | } 88 | g.fillOval(getWidth()/2 - radius, getHeight()/2 - radius, diameter, diameter); 89 | 90 | if(mouseOver){ 91 | g.setColor(Color.BLUE); 92 | } 93 | else{ 94 | g.setColor(Color.BLACK); 95 | } 96 | g.drawOval(getWidth()/2 - radius, getHeight()/2 - radius, diameter, diameter); 97 | 98 | g.setColor(Color.BLACK); 99 | g.setFont(getFont()); 100 | FontMetrics metrics = g.getFontMetrics(getFont()); 101 | int stringWidth = metrics.stringWidth(getText()); 102 | int stringHeight = metrics.getHeight(); 103 | g.drawString(getText(), getWidth()/2 - stringWidth/2, getHeight()/2 + stringHeight/4); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/JRoundButton.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.gui_old; 2 | 3 | import javax.swing.*; 4 | import javax.swing.border.Border; 5 | import java.awt.*; 6 | 7 | public class JRoundButton extends JButton 8 | { 9 | public JRoundButton() 10 | { 11 | super(); 12 | // this.setBorder(new RoundedBorder(10)); 13 | 14 | this.setOpaque(false); 15 | this.setFocusPainted(false); 16 | this.setBorderPainted(false); 17 | this.setContentAreaFilled(false); 18 | setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); // Especially important 19 | } 20 | 21 | private static class RoundedBorder implements Border 22 | { 23 | private int radius; 24 | 25 | RoundedBorder (int radius) 26 | { 27 | this.radius= radius; 28 | } 29 | 30 | @Override 31 | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) 32 | { 33 | g.drawRoundRect(x, y, width-1, height-1, radius, radius); 34 | } 35 | 36 | @Override 37 | public Insets getBorderInsets(Component c) 38 | { 39 | return new Insets(this.radius+1, this.radius+1, this.radius+2, this.radius); 40 | } 41 | 42 | @Override 43 | public boolean isBorderOpaque() 44 | { 45 | return true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/encounters/SearchResultsFrame.java: -------------------------------------------------------------------------------- 1 | ///* 2 | // * Created by JFormDesigner on Sun Sep 12 14:52:43 CDT 2021 3 | // */ 4 | // 5 | //package io.github.turtleisaac.pokeditor.gui.editors.encounters; 6 | // 7 | //import java.awt.*; 8 | //import java.awt.event.*; 9 | //import java.util.ArrayList; 10 | //import javax.swing.*; 11 | // 12 | //import io.github.turtleisaac.pokeditor.gui.editors.encounters.johto.JohtoEncounterPanel; 13 | //import io.github.turtleisaac.pokeditor.gui.editors.encounters.sinnoh.SinnohEncounterPanel; 14 | //import net.miginfocom.swing.*; 15 | // 16 | ///** 17 | // * @author turtleisaac 18 | // */ 19 | //public class SearchResultsFrame extends JFrame 20 | //{ 21 | // private boolean sinnohAccess; 22 | // private SinnohEncounterPanel sinnohPanel; 23 | // private JohtoEncounterPanel johtoPanel; 24 | // 25 | // 26 | // public SearchResultsFrame(boolean sinnohAccess, JPanel encounterPanel, ArrayList searchResults) 27 | // { 28 | // initComponents(); 29 | // 30 | // this.sinnohAccess= sinnohAccess; 31 | // 32 | // if(sinnohAccess) 33 | // { 34 | // sinnohPanel= (SinnohEncounterPanel) encounterPanel; 35 | // } 36 | // else 37 | // { 38 | // johtoPanel= (JohtoEncounterPanel) encounterPanel; 39 | // } 40 | // 41 | // searchResultsList.setModel(new AbstractListModel() 42 | // { 43 | // final String[] values= searchResults.toArray(new String[0]); 44 | // @Override 45 | // public int getSize() { return values.length; } 46 | // @Override 47 | // public String getElementAt(int i) { return values[i]; } 48 | // }); 49 | // } 50 | // 51 | // private void goToSelectionButtonActionPerformed(ActionEvent e) 52 | // { 53 | // int targetFile= Integer.parseInt(searchResultsList.getSelectedValue().split(":")[0]); 54 | // dispose(); 55 | // 56 | // if(sinnohAccess) 57 | // { 58 | // sinnohPanel.changeSelectedEncounterData(targetFile); 59 | // } 60 | // else 61 | // { 62 | // // TODO add code for Johto encounter editor 63 | // } 64 | // } 65 | // 66 | // private void initComponents() 67 | // { 68 | // // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents 69 | // // Generated using JFormDesigner non-commercial license 70 | // scrollPane1 = new JScrollPane(); 71 | // searchResultsList = new JList<>(); 72 | // goToSelectionButton = new JButton(); 73 | // 74 | // //======== this ======== 75 | // setTitle("Search Results"); 76 | // Container contentPane = getContentPane(); 77 | // contentPane.setLayout(new MigLayout( 78 | // "hidemode 3", 79 | // // columns 80 | // "[grow,fill]", 81 | // // rows 82 | // "[grow]" + 83 | // "[]")); 84 | // 85 | // //======== scrollPane1 ======== 86 | // { 87 | // 88 | // //---- searchResultsList ---- 89 | // searchResultsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 90 | // searchResultsList.setModel(new AbstractListModel() { 91 | // String[] values = { 92 | // "Default1", 93 | // "Default2", 94 | // "Default3" 95 | // }; 96 | // @Override 97 | // public int getSize() { return values.length; } 98 | // @Override 99 | // public String getElementAt(int i) { return values[i]; } 100 | // }); 101 | // scrollPane1.setViewportView(searchResultsList); 102 | // } 103 | // contentPane.add(scrollPane1, "cell 0 0,grow"); 104 | // 105 | // //---- goToSelectionButton ---- 106 | // goToSelectionButton.setText("Jump to Selection"); 107 | // goToSelectionButton.addActionListener(e -> goToSelectionButtonActionPerformed(e)); 108 | // contentPane.add(goToSelectionButton, "cell 0 1"); 109 | // pack(); 110 | // setLocationRelativeTo(getOwner()); 111 | // // JFormDesigner - End of component initialization //GEN-END:initComponents 112 | // } 113 | // 114 | // 115 | // 116 | // // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables 117 | // // Generated using JFormDesigner non-commercial license 118 | // private JScrollPane scrollPane1; 119 | // private JList searchResultsList; 120 | // private JButton goToSelectionButton; 121 | // // JFormDesigner - End of variables declaration //GEN-END:variables 122 | //} 123 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/encounters/SearchResultsFrame.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.4.0.360" Java: "11.0.9" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[grow,fill]" 9 | "$rowConstraints": "[grow][]" 10 | } ) { 11 | name: "this" 12 | "title": "Search Results" 13 | add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { 14 | name: "scrollPane1" 15 | add( new FormComponent( "javax.swing.JList" ) { 16 | name: "searchResultsList" 17 | "selectionMode": 0 18 | "model": new javax.swing.DefaultListModel { 19 | addElement( "Default1" ) 20 | addElement( "Default2" ) 21 | addElement( "Default3" ) 22 | } 23 | } ) 24 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 25 | "value": "cell 0 0,grow" 26 | } ) 27 | add( new FormComponent( "javax.swing.JButton" ) { 28 | name: "goToSelectionButton" 29 | "text": "Jump to Selection" 30 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "goToSelectionButtonActionPerformed", true ) ) 31 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 32 | "value": "cell 0 1" 33 | } ) 34 | }, new FormLayoutConstraints( null ) { 35 | "location": new java.awt.Point( 0, 0 ) 36 | "size": new java.awt.Dimension( 770, 705 ) 37 | } ) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/SmogonFrame.java: -------------------------------------------------------------------------------- 1 | ///* 2 | // * Created by JFormDesigner on Wed Jan 27 21:53:11 EST 2021 3 | // */ 4 | // 5 | //package io.github.turtleisaac.pokeditor.gui.editors.trainers; 6 | // 7 | //import java.awt.event.*; 8 | //import javax.swing.*; 9 | //import net.miginfocom.swing.*; 10 | // 11 | ///** 12 | // * @author turtleisaac 13 | // */ 14 | //public class SmogonFrame extends JFrame 15 | //{ 16 | // private TrainerPanel parent; 17 | // public SmogonFrame(TrainerPanel parent) { 18 | // initComponents(); 19 | // this.parent= parent; 20 | // } 21 | // 22 | // private void applyButtonActionPerformed(ActionEvent e) 23 | // { 24 | // JOptionPane.showMessageDialog(this, "Not implemented yet", "Smogon Import", JOptionPane.ERROR_MESSAGE); 25 | //// String[] arr= teamTextArea.getText().split("\n"); 26 | //// parent.importSmogonButtonActionPerformed(arr); 27 | // } 28 | // 29 | // private void initComponents() { 30 | // // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents 31 | // // Generated using JFormDesigner non-commercial license 32 | // scrollPane1 = new JScrollPane(); 33 | // teamTextArea = new JTextArea(); 34 | // applyButton = new JButton(); 35 | // 36 | // //======== this ======== 37 | // setTitle("Smogon Import/ Export"); 38 | // var contentPane = getContentPane(); 39 | // contentPane.setLayout(new MigLayout( 40 | // "hidemode 3", 41 | // // columns 42 | // "[grow,fill]", 43 | // // rows 44 | // "[grow]" + 45 | // "[]")); 46 | // 47 | // //======== scrollPane1 ======== 48 | // { 49 | // scrollPane1.setViewportView(teamTextArea); 50 | // } 51 | // contentPane.add(scrollPane1, "cell 0 0,grow"); 52 | // 53 | // //---- applyButton ---- 54 | // applyButton.setText("Apply Changes"); 55 | // applyButton.addActionListener(e -> applyButtonActionPerformed(e)); 56 | // contentPane.add(applyButton, "cell 0 1"); 57 | // pack(); 58 | // setLocationRelativeTo(getOwner()); 59 | // // JFormDesigner - End of component initialization //GEN-END:initComponents 60 | // } 61 | // 62 | // // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables 63 | // // Generated using JFormDesigner non-commercial license 64 | // private JScrollPane scrollPane1; 65 | // private JTextArea teamTextArea; 66 | // private JButton applyButton; 67 | // // JFormDesigner - End of variables declaration //GEN-END:variables 68 | // 69 | // public void append(String str) 70 | // { 71 | // teamTextArea.append(str); 72 | // } 73 | // 74 | // public void setText(String text) 75 | // { 76 | // teamTextArea.setText(text); 77 | // } 78 | // 79 | // public String getText() 80 | // { 81 | // return teamTextArea.getText(); 82 | // } 83 | // 84 | // public void setParent(TrainerPanel parent) 85 | // { 86 | // this.parent= parent; 87 | // } 88 | //} 89 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/SmogonFrame.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.2.6.321" Java: "11.0.9" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[grow,fill]" 9 | "$rowConstraints": "[grow][]" 10 | } ) { 11 | name: "this" 12 | "title": "Smogon Import/ Export" 13 | add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { 14 | name: "scrollPane1" 15 | add( new FormComponent( "javax.swing.JTextArea" ) { 16 | name: "teamTextArea" 17 | } ) 18 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 19 | "value": "cell 0 0,grow" 20 | } ) 21 | add( new FormComponent( "javax.swing.JButton" ) { 22 | name: "applyButton" 23 | "text": "Apply Changes" 24 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "applyButtonActionPerformed", true ) ) 25 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 26 | "value": "cell 0 1" 27 | } ) 28 | }, new FormLayoutConstraints( null ) { 29 | "location": new java.awt.Point( 0, 0 ) 30 | "size": new java.awt.Dimension( 400, 300 ) 31 | } ) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/classes/ClassPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by JFormDesigner on Fri Jan 29 16:17:22 EST 2021 3 | */ 4 | 5 | package io.github.turtleisaac.pokeditor.gui_old.editors.trainers.classes; 6 | 7 | import javax.swing.*; 8 | import javax.swing.border.*; 9 | import net.miginfocom.swing.*; 10 | 11 | /** 12 | * @author turtleisaac 13 | */ 14 | public class ClassPanel extends JPanel { 15 | public ClassPanel() { 16 | initComponents(); 17 | } 18 | 19 | private void initComponents() { 20 | // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents 21 | panel1 = new JPanel(); 22 | label1 = new JLabel(); 23 | slider1 = new JSlider(); 24 | label2 = new JLabel(); 25 | panel2 = new JPanel(); 26 | label3 = new JLabel(); 27 | spinner1 = new JSpinner(); 28 | label4 = new JLabel(); 29 | spinner2 = new JSpinner(); 30 | 31 | //======== this ======== 32 | setLayout(new MigLayout( 33 | "hidemode 3", 34 | // columns 35 | "[grow,fill]", 36 | // rows 37 | "[]" + 38 | "[]" + 39 | "[]")); 40 | 41 | //======== panel1 ======== 42 | { 43 | panel1.setBorder(new TitledBorder("Gender")); 44 | panel1.setLayout(new MigLayout( 45 | "hidemode 3", 46 | // columns 47 | "[fill]" + 48 | "[grow,fill]" + 49 | "[fill]", 50 | // rows 51 | "[]")); 52 | 53 | //---- label1 ---- 54 | label1.setText("Female"); 55 | panel1.add(label1, "cell 0 0,align center center,grow 0 0"); 56 | 57 | //---- slider1 ---- 58 | slider1.setMaximum(1); 59 | slider1.setMajorTickSpacing(1); 60 | slider1.setSnapToTicks(true); 61 | slider1.setValue(0); 62 | panel1.add(slider1, "cell 1 0"); 63 | 64 | //---- label2 ---- 65 | label2.setText("Male"); 66 | panel1.add(label2, "cell 2 0,align center center,grow 0 0"); 67 | } 68 | add(panel1, "cell 0 0"); 69 | 70 | //======== panel2 ======== 71 | { 72 | panel2.setBorder(new TitledBorder("Misc")); 73 | panel2.setLayout(new MigLayout( 74 | "hidemode 3", 75 | // columns 76 | "[fill]" + 77 | "[grow,fill]" + 78 | "[fill]" + 79 | "[grow,fill]", 80 | // rows 81 | "[]")); 82 | 83 | //---- label3 ---- 84 | label3.setText("Prize Money"); 85 | panel2.add(label3, "cell 0 0"); 86 | panel2.add(spinner1, "cell 1 0"); 87 | 88 | //---- label4 ---- 89 | label4.setText("Song"); 90 | panel2.add(label4, "cell 2 0"); 91 | panel2.add(spinner2, "cell 3 0"); 92 | } 93 | add(panel2, "cell 0 1"); 94 | // JFormDesigner - End of component initialization //GEN-END:initComponents 95 | } 96 | 97 | // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables 98 | private JPanel panel1; 99 | private JLabel label1; 100 | private JSlider slider1; 101 | private JLabel label2; 102 | private JPanel panel2; 103 | private JLabel label3; 104 | private JSpinner spinner1; 105 | private JLabel label4; 106 | private JSpinner spinner2; 107 | // JFormDesigner - End of variables declaration //GEN-END:variables 108 | } 109 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/classes/ClassPanel.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.2.6.321" Java: "11.0.9" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[grow,fill]" 9 | "$rowConstraints": "[][][]" 10 | } ) { 11 | name: "this" 12 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 13 | "$layoutConstraints": "hidemode 3" 14 | "$columnConstraints": "[fill][grow,fill][fill]" 15 | "$rowConstraints": "[]" 16 | } ) { 17 | name: "panel1" 18 | "border": new javax.swing.border.TitledBorder( "Gender" ) 19 | add( new FormComponent( "javax.swing.JLabel" ) { 20 | name: "label1" 21 | "text": "Female" 22 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 23 | "value": "cell 0 0,align center center,grow 0 0" 24 | } ) 25 | add( new FormComponent( "javax.swing.JSlider" ) { 26 | name: "slider1" 27 | "maximum": 1 28 | "majorTickSpacing": 1 29 | "snapToTicks": true 30 | "value": 0 31 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 32 | "value": "cell 1 0" 33 | } ) 34 | add( new FormComponent( "javax.swing.JLabel" ) { 35 | name: "label2" 36 | "text": "Male" 37 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 38 | "value": "cell 2 0,align center center,grow 0 0" 39 | } ) 40 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 41 | "value": "cell 0 0" 42 | } ) 43 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 44 | "$layoutConstraints": "hidemode 3" 45 | "$columnConstraints": "[fill][grow,fill][fill][grow,fill]" 46 | "$rowConstraints": "[]" 47 | } ) { 48 | name: "panel2" 49 | "border": new javax.swing.border.TitledBorder( "Misc" ) 50 | add( new FormComponent( "javax.swing.JLabel" ) { 51 | name: "label3" 52 | "text": "Prize Money" 53 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 54 | "value": "cell 0 0" 55 | } ) 56 | add( new FormComponent( "javax.swing.JSpinner" ) { 57 | name: "spinner1" 58 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 59 | "value": "cell 1 0" 60 | } ) 61 | add( new FormComponent( "javax.swing.JLabel" ) { 62 | name: "label4" 63 | "text": "Song" 64 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 65 | "value": "cell 2 0" 66 | } ) 67 | add( new FormComponent( "javax.swing.JSpinner" ) { 68 | name: "spinner2" 69 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 70 | "value": "cell 3 0" 71 | } ) 72 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 73 | "value": "cell 0 1" 74 | } ) 75 | }, new FormLayoutConstraints( null ) { 76 | "location": new java.awt.Point( 0, 0 ) 77 | "size": new java.awt.Dimension( 400, 300 ) 78 | } ) 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/text/TrainerTextEntryPanel.java: -------------------------------------------------------------------------------- 1 | ///* 2 | // * Created by JFormDesigner on Thu Oct 13 13:37:39 CDT 2022 3 | // */ 4 | // 5 | //package io.github.turtleisaac.pokeditor.gui.editors.trainers.text; 6 | // 7 | //import javax.swing.*; 8 | // 9 | //import com.jidesoft.swing.ComboBoxSearchable; 10 | //import io.github.turtleisaac.pokeditor.editors.trainers.gen4.TrainerText; 11 | //import net.miginfocom.swing.*; 12 | // 13 | //public class TrainerTextEntryPanel extends JPanel { 14 | // 15 | // public TrainerTextEntryPanel(TrainerTextFrame trainerTextFrame, TrainerText text) { 16 | // initComponents(); 17 | // 18 | // activationComboBox.setSelectedIndex(TrainerTextFrame.activationConditionToId.indexOf(text.getCondition())); 19 | // trainerTextArea.setText(text.getText()); 20 | // 21 | // ComboBoxSearchable searchable= new ComboBoxSearchable(activationComboBox); 22 | // } 23 | // 24 | // public String getText() 25 | // { 26 | // return trainerTextArea.getText(); 27 | // } 28 | // 29 | // public int getActivationCondition() 30 | // { 31 | // return TrainerTextFrame.activationConditionToId.get(activationComboBox.getSelectedIndex()); 32 | // } 33 | // 34 | // private void initComponents() { 35 | // // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents 36 | // // Generated using JFormDesigner non-commercial license 37 | // activationLabel = new JLabel(); 38 | // activationComboBox = new JComboBox<>(); 39 | // textLabel = new JLabel(); 40 | // trainerTextArea = new JTextArea(); 41 | // 42 | // //======== this ======== 43 | // setLayout(new MigLayout( 44 | // "hidemode 3", 45 | // // columns 46 | // "[fill]" + 47 | // "[grow,fill]", 48 | // // rows 49 | // "[]" + 50 | // "[]" + 51 | // "[grow,fill]")); 52 | // 53 | // //---- activationLabel ---- 54 | // activationLabel.setText("Activation Condition:"); 55 | // add(activationLabel, "cell 0 0"); 56 | // 57 | // //---- activationComboBox ---- 58 | // activationComboBox.setModel(new DefaultComboBoxModel<>(TrainerTextFrame.activationConditions.toArray(new String[0]))); 59 | // add(activationComboBox, "cell 1 0,growx"); 60 | // 61 | // //---- textLabel ---- 62 | // textLabel.setText("Text:"); 63 | // add(textLabel, "cell 0 1"); 64 | // 65 | // //---- trainerTextArea ---- 66 | // trainerTextArea.setLineWrap(true); 67 | // trainerTextArea.setWrapStyleWord(true); 68 | // add(trainerTextArea, "cell 0 2 2 1,grow"); 69 | // // JFormDesigner - End of component initialization //GEN-END:initComponents 70 | // } 71 | // 72 | // // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables 73 | // // Generated using JFormDesigner non-commercial license 74 | // private JLabel activationLabel; 75 | // private JComboBox activationComboBox; 76 | // private JLabel textLabel; 77 | // private JTextArea trainerTextArea; 78 | // // JFormDesigner - End of variables declaration //GEN-END:variables 79 | //} 80 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/text/TrainerTextEntryPanel.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.5.1.409" Java: "11.0.13" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[fill][grow,fill]" 9 | "$rowConstraints": "[][][grow,fill]" 10 | } ) { 11 | name: "this" 12 | add( new FormComponent( "javax.swing.JLabel" ) { 13 | name: "activationLabel" 14 | "text": "Activation Condition:" 15 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 16 | "value": "cell 0 0" 17 | } ) 18 | add( new FormComponent( "javax.swing.JComboBox" ) { 19 | name: "activationComboBox" 20 | auxiliary() { 21 | "JavaCodeGenerator.preInitCode": "activationComboBox.setModel(new DefaultComboBoxModel<>(TrainerTextFrame.activationConditions.toArray(new String[0])));" 22 | } 23 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 24 | "value": "cell 1 0,growx" 25 | } ) 26 | add( new FormComponent( "javax.swing.JLabel" ) { 27 | name: "textLabel" 28 | "text": "Text:" 29 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 30 | "value": "cell 0 1" 31 | } ) 32 | add( new FormComponent( "javax.swing.JTextArea" ) { 33 | name: "trainerTextArea" 34 | "lineWrap": true 35 | "wrapStyleWord": true 36 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 37 | "value": "cell 0 2 2 1,grow" 38 | } ) 39 | }, new FormLayoutConstraints( null ) { 40 | "location": new java.awt.Point( 0, 0 ) 41 | "size": new java.awt.Dimension( 400, 300 ) 42 | } ) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/gui_old/editors/trainers/text/TrainerTextFrame.jfd: -------------------------------------------------------------------------------- 1 | JFDML JFormDesigner: "7.0.5.1.409" Java: "11.0.13" encoding: "UTF-8" 2 | 3 | new FormModel { 4 | contentType: "form/swing" 5 | root: new FormRoot { 6 | add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { 7 | "$layoutConstraints": "hidemode 3" 8 | "$columnConstraints": "[grow,center][grow,center][grow,center][grow,center]" 9 | "$rowConstraints": "[][grow,fill]" 10 | } ) { 11 | name: "this" 12 | "minimumSize": new java.awt.Dimension( 600, 250 ) 13 | "title": "Trainer Text Editor" 14 | "defaultCloseOperation": 2 15 | addEvent( new FormEvent( "java.awt.event.WindowListener", "windowClosed", "thisWindowClosed", true ) ) 16 | add( new FormComponent( "javax.swing.JButton" ) { 17 | name: "saveTrainerButton" 18 | "text": "Save Trainer" 19 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveActionPerformed", true ) ) 20 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 21 | "value": "cell 0 0,growx" 22 | } ) 23 | add( new FormComponent( "javax.swing.JButton" ) { 24 | name: "addButton" 25 | "text": "Add" 26 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "addActionPerformed", true ) ) 27 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 28 | "value": "cell 1 0,growx" 29 | } ) 30 | add( new FormComponent( "javax.swing.JButton" ) { 31 | name: "removeButton" 32 | "text": "Remove" 33 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "removeActionPerformed", true ) ) 34 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 35 | "value": "cell 2 0,growx" 36 | } ) 37 | add( new FormComponent( "javax.swing.JButton" ) { 38 | name: "reloadButton" 39 | "text": "Reload" 40 | addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "reloadActionPerformed", true ) ) 41 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 42 | "value": "cell 3 0,growx" 43 | } ) 44 | add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { 45 | name: "entryTabbedPane" 46 | "tabLayoutPolicy": 1 47 | }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { 48 | "value": "cell 0 1 4 1,grow" 49 | } ) 50 | }, new FormLayoutConstraints( null ) { 51 | "location": new java.awt.Point( 0, 0 ) 52 | "size": new java.awt.Dimension( 600, 250 ) 53 | } ) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/io/github/turtleisaac/pokeditor/utilities/TrainerPersonalityCalculator.java: -------------------------------------------------------------------------------- 1 | package io.github.turtleisaac.pokeditor.utilities; 2 | 3 | public class TrainerPersonalityCalculator 4 | { 5 | private static final String[] natures= {"Hardy","Lonely","Brave","Adamant","Naughty","Bold","Docile","Relaxed","Impish","Lax","Timid","Hasty","Serious","Jolly","Naive","Modest","Mild","Quiet","Bashful","Rash","Calm","Gentle","Sassy","Careful","Quirky"}; 6 | 7 | public static void main(String[] args) 8 | { 9 | int trainerIdx= 320; 10 | int classIdx= 79; 11 | boolean male= true; 12 | int speciesIdx= 466; 13 | int level= 50; 14 | int difficultyValue= 2500; 15 | 16 | int pid= generatePid(trainerIdx,classIdx,male,speciesIdx,level,difficultyValue, 0, false); 17 | 18 | paraSet(difficultyValue*31.0/255, pid); 19 | 20 | // System.out.println(calculateShiny(pid,30055,31231,128)); 21 | } 22 | 23 | public static int bruteForcePid(int targetPid, int trainerIdx, int trainerClassIdx, boolean trainerClassMale, int speciesIdx, int level) 24 | { 25 | for(int i= 0; i < 65535; i++) 26 | { 27 | if(generatePid(trainerIdx,trainerClassIdx,trainerClassMale,speciesIdx,level,i, 0, false) == targetPid) 28 | { 29 | return i; 30 | } 31 | } 32 | return -1; 33 | } 34 | 35 | 36 | public static int generatePid(int trainerIdx, int trainerClassIdx, boolean trainerClassMale, int speciesIdx, int level, int difficultyValue, int abilityValue, boolean abilityFunctional) 37 | { 38 | long rnd= trainerIdx+speciesIdx+level+difficultyValue; 39 | setRandom(rnd); 40 | for(;trainerClassIdx > 0; trainerClassIdx--) 41 | { 42 | rnd= random(); 43 | } 44 | rnd= (rnd >> 16) & 0xffff; 45 | rnd*= 256; 46 | rnd+= trainerClassMale ? 136 : 120; 47 | 48 | if(abilityFunctional) 49 | { 50 | rnd+= abilityValue; 51 | } 52 | 53 | //TODO look at how the ability value stuff functions 54 | 55 | String result= Long.toHexString((int)rnd); 56 | // System.out.println("PID: 0x00" + (result.length() == 6 ? result : "0" + result)); 57 | // System.out.println("Nature: " + natures[(int)(rnd%100)%25] + "\n"); 58 | 59 | return (int)rnd; 60 | } 61 | 62 | public static long rndFlagCall() 63 | { 64 | return (random() | (random() << 16)); 65 | // return ((random() << 16) | random()); 66 | } 67 | 68 | public static long idSetCall(long id, int pid) 69 | { 70 | long tid; 71 | long sid; 72 | 73 | do 74 | { 75 | id= rndFlagCall(); 76 | tid= (id >> 16) & 0xffff; 77 | sid= id & 0xffff; 78 | System.out.println("TID: " + tid); 79 | System.out.println("SID: " + sid); 80 | } 81 | while(calculateShiny(pid, tid, sid,8)); 82 | 83 | return id; 84 | } 85 | 86 | public static void ivCalculation() 87 | { 88 | long i= random(); 89 | int j= (int) ((i & (0x001f))); 90 | System.out.println(" Hp IV: " + j); 91 | j= (int) (i&(0x001f << 5))>> 5; 92 | System.out.println(" Atk IV: " + j); 93 | j= (int) (i&(0x001f << 10))>> 10; 94 | System.out.println(" Def IV: " + j); 95 | i= random(); 96 | j= (int) ((i & (0x001f))); 97 | System.out.println(" Speed IV: " + j); 98 | j= (int) (i&(0x001f << 5))>> 5; 99 | System.out.println(" SpAtk IV: " + j); 100 | j= (int) (i&(0x001f << 10))>> 10; 101 | System.out.println(" SpDef IV: " + j); 102 | } 103 | 104 | public static void paraSet(double difficulty, int pid) 105 | { 106 | // long localSeed= seed; 107 | // 108 | // 109 | // long id; 110 | // long tid; 111 | // long sid; 112 | // seed= localSeed; 113 | // int x; 114 | // for(x= 0; x < i; x++) 115 | // { 116 | // id= rndFlagCall(); 117 | // tid= (id >> 16) & 0xffff; 118 | // sid= id & 0xffff; 119 | // if(tid == 55963) 120 | // { 121 | // System.out.println(x + ": " + tid + ", " + sid); 122 | // } 123 | // } 124 | 125 | 126 | 127 | 128 | // pid= (int) rndFlagCall(); 129 | 130 | long id= idSetCall(0, pid); 131 | 132 | if(difficulty <= 31) 133 | { 134 | System.out.println(" Hp IV: " + (int) difficulty); 135 | System.out.println(" Atk IV: " + (int) difficulty); 136 | System.out.println(" Def IV: " + (int) difficulty); 137 | System.out.println(" Spe IV: " + (int) difficulty); 138 | System.out.println(" SpAtk IV: " + (int) difficulty); 139 | System.out.println(" SpDef IV: " + (int) difficulty); 140 | 141 | } 142 | else 143 | { 144 | ivCalculation(); 145 | } 146 | 147 | } 148 | 149 | public static boolean calculateShiny(int pid, long tid, long sid, int rateDenominator) 150 | { 151 | int p1= (pid >> 16) & 0xffff; 152 | // System.out.println("p1: " + Integer.toHexString(p1)); 153 | int p2= pid & 0xffff; 154 | // System.out.println("p2: " + Integer.toHexString(p2)); 155 | 156 | long shiny= tid ^ sid ^ p1 ^ p2; 157 | System.out.println("TID= " + tid + ", Shiny Value: " + shiny); 158 | 159 | return shiny < rateDenominator; 160 | } 161 | 162 | 163 | /** 164 | * Random function code 165 | */ 166 | 167 | private static long seed; 168 | 169 | public static void setRandom(long newSeed) 170 | { 171 | seed= newSeed; 172 | } 173 | 174 | public static long random() 175 | { 176 | long result= 0x41c64e6d * seed + 0x6073; 177 | seed= result & 0xffffffffL; 178 | return result; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/arrowdown.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/arrowleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/arrowleft.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/arrowright.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/arrowup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/arrowup.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/background.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/black.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/black2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/black2.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/building_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/building_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/clearflag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/clearflag.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/closemsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/closemsg.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/cross.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/diamond.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/dualslot_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/dualslot_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/egg.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/error.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/event_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/event_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/folder_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/folder_warning.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/give_badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/give_badge.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/give_pokedex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/give_pokedex.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/give_pokegear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/give_pokegear.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/give_shoes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/give_shoes.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/giveitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/giveitem.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/givemom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/givemom.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/good_rod_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/good_rod_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/health_opponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/health_opponent.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/health_you.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/health_you.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/heartgold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/heartgold.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/icon.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/legendary_battle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/legendary_battle.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/map_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/map_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/map_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/map_header.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/matrix_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/matrix_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/message.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/money.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/old_rod_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/old_rod_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/open_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/open_file.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/pearl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/pearl.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/platform_opponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/platform_opponent.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/platform_you.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/platform_you.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/platinum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/platinum.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/pokeball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/pokeball.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/pokéradar_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/pokéradar_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/radio_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/radio_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/rock_smash_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/rock_smash_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/save_rom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/save_rom.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/script_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/script_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/setflag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/setflag.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/shadow_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/shadow_large.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/shadow_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/shadow_medium.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/shadow_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/shadow_small.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/soulsilver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/soulsilver.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/super_rod_encounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/super_rod_encounters.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/clipboard-copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/list-search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/row-insert-bottom.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/row-remove.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/table-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/svg/table-import.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/symbol_female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/symbol_female.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/symbol_male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/symbol_male.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/takeitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/takeitem.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/takemom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/takemom.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/takemoney.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/takemoney.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/text_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/text_bar.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/text_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/text_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/texture_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/texture_background.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/tick.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/tileset_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/tileset_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/trainer_battle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/trainer_battle.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/underwater_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/underwater_background.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/walking_encounters_dppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/walking_encounters_dppt.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/walking_encounters_hgss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/walking_encounters_hgss.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/white.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/white2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/white2.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/wild_battle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/wild_battle.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/icons/wild_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/icons/wild_editor.png -------------------------------------------------------------------------------- /src/main/resources/pokeditor/sheet_panel.properties: -------------------------------------------------------------------------------- 1 | 2 | DefaultEditorPanel.exportFileButton.text=Export File 3 | DefaultEditorPanel.importFileButton.text=Import File 4 | DefaultEditorPanel.copyEntryButton.text=Copy Entry 5 | DefaultEditorPanel.pasteEntryButton.text=Paste Entry 6 | DefaultSheetPanel.reloadSheetButton.text=Reset Changes 7 | DefaultSheetPanel.saveSheetButton.text=Save Changes 8 | DefaultEditorPanel.addButton.text=Add Entry 9 | DefaultEditorPanel.deleteButton.text=Delete Entry 10 | DefaultSheetPanel.addRowButton.text=Add Row 11 | DefaultSheetPanel.copyModeButton.text=Copy/Paste Mode 12 | DefaultSheetPanel.findButton.text=Find 13 | DefaultSheetPanel.deleteRowButton.text=Delete Row 14 | DefaultSheetPanel.exportSheetButton.text=Export 15 | DefaultSheetPanel.importSheetButton.text=Import 16 | FieldScriptEditor.addButton.text=Add 17 | FieldScriptEditor.variableTrackerButton.text=Open Variable Tracker 18 | FieldScriptEditor.flagTrackerButton.text=Open Flag Tracker 19 | FieldScriptEditor.saveFieldScriptButton.text=Parse Script 20 | FieldScriptEditor.displayOnlyLabelsRadioButton.text=Labels 21 | FieldScriptEditor.configLabel.text=Config 22 | FieldScriptEditor.confirmButton.text=Confirm 23 | FieldScriptEditor.paddingCheckbox.text=Word-alignment Padding 24 | FieldScriptEditor.displayOnlyScriptsRadioButton.text=Scripts 25 | FieldScriptEditor.displayOnlyActionLabelsRadioButton.text=Actions 26 | FieldScriptEditor.removeButton.text=Remove 27 | FieldScriptEditor.scriptLabel.text=Script ID to trigger 28 | FieldScriptEditor.valueLabel.text=Expected Value 29 | FieldScriptEditor.variableLabel.text=Variable to Watch 30 | FieldScriptEditor.discardButton.text=Discard 31 | FieldScriptEditor.errorsLabel.text=Errors 32 | FieldScriptEditor.labelJumpListLabel.text=Contents 33 | FindDialog.findButton.text=Find 34 | FindDialog.label1.text=Range 35 | FindDialog.matchCaseCheckbox.text=Match case 36 | FindDialog.matchEntireContentsCheckbox.text=Match entire cell contents 37 | FindDialog.findLabel.text=Find 38 | FindDialog.doneButton.text=Done 39 | FindDialog.this.title=Find 40 | PokemonSpriteEditor.globalFrontYLabel.text=Global Front Y 41 | PokemonSpriteEditor.femaleBackYLabel.text=Female Back -Y 42 | PokemonSpriteEditor.femaleFrontYLabel.text=Female Front -Y 43 | PokemonSpriteEditor.maleBackYLabel.text=Male Back -Y 44 | PokemonSpriteEditor.maleFrontYLabel.text=Male Front -Y 45 | PokemonSpriteEditor.movementLabel.text=Movement 46 | PokemonSpriteEditor.shadowXLabel.text=Shadow X 47 | PokemonSpriteEditor.shadowSizeLabel.text=Shadow Size 48 | PokemonSpriteEditor.partyIconPaletteIdLabel.text=Palette ID 49 | PokemonSpriteEditor.palettePanel.tab.title=Normal 50 | PokemonSpriteEditor.shinyPalettePanel.tab.title=Shiny 51 | PokemonSpriteEditor.toggleGenderButton.text=Toggle Gender 52 | PokemonSpriteEditor.toggleFrameButton.text=Toggle Frame 53 | PokemonSpriteEditor.swapFramesButton.text=Swap 54 | PokemonSpriteEditor.importButton.text=Import 55 | PokemonSpriteEditor.exportButton.text=Export 56 | PokemonSpriteEditor.femaleBackPanel.text=Female Back 57 | PokemonSpriteEditor.maleBackPanel.text=Male Back 58 | PokemonSpriteEditor.femaleFrontPanel.text=Female Front 59 | PokemonSpriteEditor.maleFrontPanel.text=Male Front 60 | PokemonSpriteEditor.partyIconPanel.text=Party Icon 61 | StarterEditorPanel.starterLabel1.text=Starter 1 62 | StarterEditorPanel.starterLabel2.text=Starter 2 63 | StarterEditorPanel.starterLabel3.text=Starter 3 64 | FieldScriptEditor.newEntryDialog.text=Choose an option for the new file. 65 | FieldScriptEditor.newEntryDialog.option1.text=Field Script 66 | FieldScriptEditor.newEntryDialog.option2.text=Level Script 67 | VariableTracker.button1.text=Options 68 | VariableTracker.button2.text=Help 69 | VariableTracker.label1.text=Search 70 | VariableTracker.label2.text=Selected\: 71 | VariableTracker.label3.text=Variables 72 | VariableTracker.variableDescriptionLabel.text=Description 73 | -------------------------------------------------------------------------------- /src/main/resources/pokeditor/sheet_strings.properties: -------------------------------------------------------------------------------- 1 | id=ID 2 | name=Name 3 | hp=HP 4 | atk=Atk 5 | def=Def 6 | speed=Speed 7 | spAtk=Sp. Atk 8 | spDef=Sp. Def 9 | type=Type 10 | personal.type1=Type 1 11 | personal.type2=Type 2 12 | catchRate=Catch Rate 13 | expDrop=Exp Drop 14 | hpEvYield=HP EV 15 | atkEvYield=Atk EV 16 | defEvYield=Def EV 17 | speedEvYield=Speed EV 18 | spAtkEvYield=Sp. Atk EV 19 | spDefEvYield=Sp. Def EV 20 | uncommonHeldItem=Uncommon Held Item 21 | rareHeldItem=Rare Held Item 22 | genderRatio=Gender Ratio\: 23 | hatchMultiplier=Hatch Mult. 24 | baseHappiness=Base Happiness 25 | growthRate=Growth Rate 26 | growthRate.erratic=Erratic 27 | growthRate.fast=Fast 28 | growthRate.mediumFast=Medium Fast 29 | growthRate.mediumSlow=Medium Slow 30 | growthRate.slow=Slow 31 | growthRate.fluctuating=Fluctuating 32 | eggGroup=Egg Group 33 | personal.eggGroup1=Egg Group 1 34 | personal.eggGroup2=Egg Group 2 35 | eggGroup.null=~ 36 | eggGroup.monster=Monster 37 | eggGroup.water1=Water 1 38 | eggGroup.bug=Bug 39 | eggGroup.flying=Flying 40 | eggGroup.field=Field 41 | eggGroup.fairy=Fairy 42 | eggGroup.grass=Grass 43 | eggGroup.humanLike=Human-Like 44 | eggGroup.water3=Water 3 45 | eggGroup.mineral=Mineral 46 | eggGroup.amorphous=Amorphous 47 | eggGroup.water2=Water 2 48 | eggGroup.ditto=Ditto 49 | eggGroup.dragon=Dragon 50 | eggGroup.undiscovered=Undiscovered 51 | ability=Ability 52 | personal.ability1=Ability 1 53 | personal.ability2=Ability 2 54 | runChance=Run Chance 55 | color=Color 56 | flip=Flip 57 | evolutionMethod=Method 58 | evolutionRequirement=Requirement 59 | evolutionResultSpecies=Result Species 60 | evolutionMethod.none=None 61 | evolutionMethod.happiness=Level-Up (Happiness) 62 | evolutionMethod.happinessDay=Level-Up (Happiness) (Day) 63 | evolutionMethod.happinessNight=Level-Up (Happiness) (Night) 64 | evolutionMethod.reachLevel=Reach Level 65 | evolutionMethod.trade=Trade 66 | evolutionMethod.tradeItem=Trade (Item) 67 | evolutionMethod.useItem=Use Item 68 | evolutionMethod.levelAttackGreaterThanDefense=Reach Level (Attack > Defense) 69 | evolutionMethod.levelAttackEqualToDefense=Reach Level (Attack = Defense) 70 | evolutionMethod.levelAttackLessThanDefense=Reach Level (Attack < Defense) 71 | evolutionMethod.levelPIDLessThan5=Reach Level (PID < 5) 72 | evolutionMethod.levelPIDGreaterThan5=Reach Level (PID > 5) 73 | evolutionMethod.levelNincada1=Reach Level (Nincada) (1 of 2) 74 | evolutionMethod.levelNincada2=Reach Level (Nincada) (2 of 2) 75 | evolutionMethod.beauty=Level-Up (Max Beauty) 76 | evolutionMethod.useItemMale=Use Item (Male) 77 | evolutionMethod.useItemFemale=Use Item (Female) 78 | evolutionMethod.heldItemLevelUpDay=Level-Up (Held Item) (Day) 79 | evolutionMethod.heldItemLevelUpNight=Level-Up (Held Item) (Night) 80 | evolutionMethod.moveKnown=Level-Up (Move Known) 81 | evolutionMethod.speciesInParty=Level-Up (Species in Party) 82 | evolutionMethod.levelMale=Reach Level (Male) 83 | evolutionMethod.levelFemale=Reach Level (Female) 84 | evolutionMethod.levelElectricField=Level-Up (Electric Field) 85 | evolutionMethod.levelMossyRock=Level-Up (Mossy Rock) 86 | evolutionMethod.levelIcyRock=Level-Up (Icy Rock) 87 | move=Move 88 | level=Level 89 | moves.effect=Effect 90 | category=Category 91 | category.physical=Physical 92 | category.special=Special 93 | category.status=Status 94 | power=Power 95 | accuracy=Accuracy 96 | pp=PP 97 | moves.effectChance=Effect Chance (%) 98 | target=Target(s) 99 | priority=Priority 100 | moves.makesContact=Makes Contact 101 | moves.blockedByProtect=Blocked by Protect 102 | moves.reflectedByMagicCoat=Reflected by Magic Coat 103 | moves.affectedBySnatch=Affected by Snatch 104 | moves.affectedByMirrorMove=Affected by Mirror Move 105 | moves.triggersKingsRock=Triggers Kings Rock 106 | moves.hidesHpBars=Hides HP Bars 107 | moves.removeTargetShadow=Removes Target's Shadow 108 | moves.contestEffect=Contest Effect 109 | moves.contestType=Contest Type 110 | target.selected=Single target 111 | target.automatic=Automatic 112 | target.random=Random 113 | target.bothFoes=Both opponents 114 | target.allExceptUser=All except User 115 | target.user=User 116 | target.userSide=User's side of field 117 | target.entireField=Entire field 118 | target.foeSide=Opponent's side of field 119 | target.ally=Ally 120 | target.userOrAlly=User or Ally 121 | target.MOVE_TARGET_ME_FIRST 122 | moveEffectHit 123 | moveEffectStatusSleep 124 | moveEffectPoisonHit 125 | moveEffectRecoverHalfDamageDelt 126 | moveEffectBurnHit 127 | moveEffectFreezeHit 128 | moveEffectParalyzeHit 129 | moveEffectHalveDefense 130 | moveEffectRecoverDamageSleep 131 | moveEffectCopyMove 132 | moveEffectAtkUp 133 | moveEffectDefUp 134 | moveEffectSpeedUp 135 | moveEffectSpAtkUp 136 | moveEffectSpDefUp 137 | moveEffectAccUp 138 | moveEffectEvaUp 139 | moveEffectBypassAccuracy 140 | moveEffectAtkDown 141 | moveEffectDefDown 142 | moveEffectSpeedDown 143 | moveEffectSpAtkDown 144 | moveEffectSpDefDown 145 | moveEffectAccDown 146 | moveEffectEvaDown 147 | moveEffectResetStatChanges 148 | moveEffectBide 149 | moveEffectContinueAndConfuseSelf 150 | moveEffectForceSwitch 151 | moveEffectMultiHit 152 | moveEffectConversion 153 | moveEffectFlinchHit 154 | moveEffectRestoreHalfHp 155 | moveEffectStatusBadlyPoison 156 | moveEffectIncreasePrizeMoney 157 | moveEffectSetLightScreen 158 | moveEffectRandomPrimaryStatusHit 159 | moveEffectOneHitKo 160 | moveEffectChargeTurnHighCrit 161 | moveEffectHalveHp 162 | moveEffect40DamageFlat 163 | moveEffectBindHit 164 | moveEffectHighCritical 165 | moveEffectHitTwice 166 | moveEffectCrashOnMiss 167 | moveEffectPreventStatReduction 168 | moveEffectCritUp2 169 | moveEffectRecoilQuarterDamageDelt 170 | moveEffectStatusConfuse 171 | moveEffectAtkUp2 172 | moveEffectDefUp2 173 | moveEffectSpeedUp2 174 | moveEffectSpAtkUp2 175 | moveEffectSpDefUp2 176 | moveEffectAccUp2 177 | moveEffectEvaUp2 178 | moveEffectTransform 179 | moveEffectAtkDown2 180 | moveEffectDefDown2 181 | moveEffectSpeedDown2 182 | moveEffectSpAtkDown2 183 | moveEffectAccDown2 184 | moveEffectEvaDown2 185 | moveEffectSpDefDown2 186 | moveEffectSetReflect 187 | moveEffectStatusPoison 188 | moveEffectStatusParalyze 189 | moveEffectLowerAttackHit 190 | moveEffectLowerDefenseHit 191 | moveEffectLowerSpeedHit 192 | moveEffectLowerSpAtkHit 193 | moveEffectLowerSpDefHit 194 | moveEffectLowerAccuracyHit 195 | moveEffectLowerEvasionHit 196 | moveEffectChargeTurnHighCritFlinch 197 | moveEffectConfuseHit 198 | moveEffectPoisonMultiHit 199 | moveEffectPriorityNeg1BypassAccuracy 200 | moveEffectSetSubstitute 201 | moveEffectRechargeAfter 202 | moveEffectRaiseAtkWhenHit 203 | moveEffectCopyMoveForBattle 204 | moveEffectCallRandomMove 205 | moveEffectStatusLeechSeed 206 | moveEffectDoNothing 207 | moveEffectDisable 208 | moveEffectLevelDamageFlat 209 | moveEffectRandomDamage1To150Level 210 | moveEffectCounter 211 | moveEffectEncore 212 | moveEffectAverageHp 213 | moveEffectDamageWhileAsleep 214 | moveEffectConversion2 215 | moveEffectNextAttackAlwaysHits 216 | moveEffectLearnMovePermanent 217 | moveEffectUnused96 218 | moveEffectUseRandomLearnedMoveSleep 219 | moveEffectKoMonThatDefeatedUser 220 | moveEffectIncreasePowerWithLessHp 221 | moveEffectDecreaseLastMovePp 222 | moveEffectLeaveWith1Hp 223 | moveEffectCurePartyStatus 224 | moveEffectPriority1 225 | moveEffectHitThreeTimes 226 | moveEffectStealHeldItem 227 | moveEffectPreventEscape 228 | moveEffectStatusNightmare 229 | moveEffectEvaUp2Minimize 230 | moveEffectCurse 231 | moveEffectUnused110 232 | moveEffectProtect 233 | moveEffectSetSpikes 234 | moveEffectIgnoreEvasionRemoveGhostImmune 235 | moveEffectAllFaint3Turns 236 | moveEffectWeatherSandstorm 237 | moveEffectSurviveWith1Hp 238 | moveEffectDoublePowerEachTurnLockInto 239 | moveEffectAtkUp2StatusConfusion 240 | moveEffectDoublePowerEachTurn 241 | moveEffectInfatuate 242 | moveEffectPowerBasedOnFriendship 243 | moveEffectRandomPowerMaybeHeal 244 | moveEffectPowerBasedOnLowFriendship 245 | moveEffectPreventStatus 246 | moveEffectThawAndBurnHit 247 | moveEffectRandomPower10Cases 248 | moveEffectPassStatsAndStatus 249 | moveEffectHitBeforeSwitch 250 | moveEffectRemoveHazardsAndBinding 251 | moveEffect10DamageFlat 252 | moveEffectUnused131 253 | moveEffectHealHalfMoreInSun 254 | moveEffectUnused133 255 | moveEffectUnused134 256 | moveEffectRandomPowerBasedOnIvs 257 | moveEffectWeatherRain 258 | moveEffectWeatherSun 259 | moveEffectRaiseDefHit 260 | moveEffectRaiseAttackHit 261 | moveEffectRaiseAllStatsHit 262 | moveEffectUnused141 263 | moveEffectMaxAtkLoseHalfMaxHp 264 | moveEffectCopyStatChanges 265 | moveEffectMirrorCoat 266 | moveEffectChargeTurnDefUp 267 | moveEffectFlinchDoubleDamageFlyOrBounce 268 | moveEffectDoubleDamageDig 269 | moveEffectHitIn3Turns 270 | moveEffectDoubleDamageFlyOrBounce 271 | moveEffectFlinchMinimizeDoubleHit 272 | moveEffect151 273 | moveEffectThunder 274 | moveEffectFleeFromWildBattle 275 | moveEffectBeatUp 276 | moveEffectFly 277 | moveEffectDefUpDoubleRolloutPower 278 | moveEffectUnused157 279 | moveEffectAlwaysFlinchFirstTurnOnly 280 | moveEffectUproar 281 | moveEffectStockpile 282 | moveEffectSpitUp 283 | moveEffectSwallow 284 | moveEffectUnused163 285 | moveEffectWeatherHail 286 | moveEffectTorment 287 | moveEffectSpAtkUpCauseConfusion 288 | moveEffectStatusBurn 289 | moveEffectFaintAndAtkSpAtkDown2 290 | moveEffectDoublePowerWhenStatused 291 | moveEffectHitLastWhiffIfHit 292 | moveEffectDoublePowerAndCureParalysis 293 | moveEffectMakeGlobalTarget 294 | moveEffectNaturePower 295 | moveEffectSpDefUpDoubleElectricPower 296 | moveEffectTaunt 297 | moveEffectBoostAllyPowerBy50Percent 298 | moveEffectSwitchHeldItems 299 | moveEffectCopyAbility 300 | moveEffectHealIn3Turns 301 | moveEffectUseRandomAllyMove 302 | moveEffectGroundTrapUserContinuousHeal 303 | moveEffectRemoveScreens 304 | moveEffectStatusSleepNextTurn 305 | moveEffectRemoveHeldItem 306 | moveEffectSetHpEqualToUser 307 | moveEffectDecreasePowerWithLessUserHp 308 | moveEffectSwitchAbilities 309 | moveEffectMakeSharedMovesUnuseabl 310 | moveEffectHealStatus 311 | moveEffectRemoveAllPpOnDefeat 312 | moveEffectStealStatusMove 313 | moveEffectIncreasePowerWithWeight 314 | moveEffectSecretPower 315 | moveEffectRecoilThird 316 | moveEffectHighCriticalBurnHit 317 | moveEffectHalveElectricDamage 318 | moveEffectFlinchPoisonHit 319 | moveEffectChangeTypeWithWeather 320 | moveEffectUserSpAtkDown2 321 | moveEffectAtkDefDown 322 | moveEffectDefSpdUp 323 | moveEffectHitFly 324 | moveEffectAtkDefUp 325 | moveEffectHighCriticalPoisonHit 326 | moveEffectHalveFireDamage 327 | moveEffectSpAtkSpDefUp 328 | moveEffectAtkSpdUp 329 | moveEffectCamouflage 330 | moveEffectHealHalfRemoveFlyingType 331 | moveEffectGravity 332 | moveEffectIgnoreEvationRemoveDarkImmune 333 | moveEffectDoublePowerHealSleep 334 | moveEffectSpeedDownHit 335 | moveEffectPowerBasedOnLowSpeed 336 | moveEffectFaintAndFullHealNextMon 337 | moveEffectDoublePowerWhenBelowHalf 338 | moveEffectNaturalGift 339 | moveEffectRemoveProtect 340 | moveEffectEatBerry 341 | moveEffectDoubleSpeed3Turns 342 | moveEffectRandomStatUp2 343 | moveEffectMetalBurst 344 | moveEffectSwitchHit 345 | moveEffectDefSpdDownHit 346 | moveEffectDoublePowerIfHit 347 | moveEffectDoublePowerIfTargetHit 348 | moveEffectPreventItemUse 349 | moveEffectFling 350 | moveEffectTransferStatus 351 | moveEffectHigherPowerWhenLowPp 352 | moveEffectPreventHealing 353 | moveEffectIncreasePowerWithMoreHp 354 | moveEffectSwapAtkDef 355 | moveEffectSupressAbility 356 | moveEffectPreventCrits 357 | moveEffectUseMoveFirst 358 | moveEffectUseLastUsedMove 359 | moveEffectSwapAtkSpAtkStatChanges 360 | moveEffectSwapDefSpDefStatChanges 361 | moveEffectIncreasePowerWithMoreStatUp 362 | moveEffectFailIfNotUsedAllOtherMoves 363 | moveEffectSetAbilityToInsomnia 364 | moveEffectHitFirstIfTargetAttacking 365 | moveEffectToxicSpikes 366 | moveEffectSwapStatChanges 367 | moveEffectRestoreHpEveryTurn 368 | moveEffectGiveGroundImmunity 369 | moveEffectRecoilBurnHit 370 | moveEffectStruggle 371 | moveEffectDive 372 | moveEffectDig 373 | moveEffectDoubleDamageDive 374 | moveEffectRemoveHazardsScreensEvaDown 375 | moveEffectTrickRoom 376 | moveEffectBlizzard 377 | moveEffectWhirlpool 378 | moveEffectRecoilParalyzeHit 379 | moveEffectBounce 380 | moveEffectUnused264 381 | moveEffectSpAtkDown2OppositeGender 382 | moveEffectStealthRock 383 | moveEffectChatter 384 | moveEffectJudgement 385 | moveEffectRecoilHalf 386 | moveEffectFaintFullRestoreNextMon 387 | moveEffectLowerSpDef2Hit 388 | moveEffectShadowForce 389 | moveEffectFlinchBurnHit 390 | moveEffectFlinchFreezeHit 391 | moveEffectFlinchParalyzeHit 392 | moveEffectRaiseSpAtkHit -------------------------------------------------------------------------------- /src/main/resources/pokeditor/sheet_strings_fr.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turtleisaac/PokEditor/21584a153bb0de0673cfed7e5b62905053927a73/src/main/resources/pokeditor/sheet_strings_fr.properties -------------------------------------------------------------------------------- /src/main/resources/pokeditor/sheet_strings_zh.properties: -------------------------------------------------------------------------------- 1 | id=ID No. 2 | name=名字 3 | hp=体力 4 | atk=攻击力 5 | def=防御力 6 | speed=速度 7 | spAtk=特攻 8 | spDef=特防 9 | type=属性 10 | personal.type1=属性一 11 | personal.type2=属性二 12 | hpEvYield=体力的基础点数 13 | atkEvYield=攻击力的基础点数 14 | defEvYield=防御力的基础点数 15 | speedEvYield=速度的基础点数 16 | spAtkEvYield=特攻的基础点数 17 | spDefEvYield=特防的基础点数 18 | uncommonHeldItem=少见的道具 19 | rareHeldItem=罕见的道具 20 | genderRatio=性别比例 21 | baseHappiness=开始的亲密度 22 | eggGroup=蛋群 23 | personal.eggGroup1=蛋群一 24 | personal.eggGroup2=蛋群二 25 | ability=特性 26 | personal.ability1=特性一 27 | personal.ability2=特性二 28 | color=色 29 | move=技能 30 | level=等级 31 | power=威力 32 | accuracy=命中 33 | priority=先制招式 --------------------------------------------------------------------------------