Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: boazy/TWEditorEnhanced
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.1
Choose a base ref
...
head repository: boazy/TWEditorEnhanced
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 4 commits
  • 51 files changed
  • 4 contributors

Commits on Aug 3, 2020

  1. Change package name

    boazy committed Aug 3, 2020
    Copy the full SHA
    45eb7b6 View commit details
  2. difficulty support

    pl-zerocool authored and boazy committed Aug 3, 2020
    Copy the full SHA
    668cd06 View commit details

Commits on Aug 28, 2020

  1. Copy the full SHA
    6ab039f View commit details

Commits on Sep 29, 2020

  1. Merge pull request #9 from doofmars/encoding

    Set encoding to prevent errors with characters during gradle build
    boazy authored Sep 29, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ffdab0a View commit details
Showing with 401 additions and 199 deletions.
  1. +5 −0 README.md
  2. +5 −0 build.gradle
  3. +3 −2 gradle/wrapper/gradle-wrapper.properties
  4. +1 −1 src/main/java/{ → app/tweditor}/AlchemyIngredient.java
  5. +1 −1 src/main/java/{ → app/tweditor}/AttributesPanel.java
  6. +1 −1 src/main/java/{ → app/tweditor}/CategoryNode.java
  7. +1 −1 src/main/java/{ → app/tweditor}/CompressedSaveInputStream.java
  8. +1 −1 src/main/java/{ → app/tweditor}/CompressedSaveOutputStream.java
  9. +1 −1 src/main/java/{ → app/tweditor}/DBElement.java
  10. +1 −1 src/main/java/{ → app/tweditor}/DBElementValue.java
  11. +1 −1 src/main/java/{ → app/tweditor}/DBException.java
  12. +16 −1 src/main/java/{ → app/tweditor}/DBList.java
  13. +1 −1 src/main/java/{ → app/tweditor}/Database.java
  14. +1 −1 src/main/java/{ → app/tweditor}/DatabaseUpdateListener.java
  15. +183 −0 src/main/java/app/tweditor/DifficultyPanel.java
  16. +1 −1 src/main/java/{ → app/tweditor}/EquipPanel.java
  17. +1 −1 src/main/java/{ → app/tweditor}/ExamineDialog.java
  18. +1 −1 src/main/java/{ → app/tweditor}/InventoryItem.java
  19. +1 −1 src/main/java/{ → app/tweditor}/InventoryNode.java
  20. +1 −1 src/main/java/{ → app/tweditor}/InventoryPanel.java
  21. +1 −1 src/main/java/{ → app/tweditor}/ItemTemplate.java
  22. +1 −1 src/main/java/{ → app/tweditor}/KeyDatabase.java
  23. +1 −1 src/main/java/{ → app/tweditor}/KeyEntry.java
  24. +1 −1 src/main/java/{ → app/tweditor}/KeyInputStream.java
  25. +49 −15 src/main/java/{ → app/tweditor}/LoadFile.java
  26. +1 −3 src/main/java/{ → app/tweditor}/LoadTemplates.java
  27. +1 −1 src/main/java/{ → app/tweditor}/LocalizedString.java
  28. +1 −1 src/main/java/{ → app/tweditor}/LocalizedSubstring.java
  29. +9 −5 src/main/java/{ → app/tweditor}/Main.java
  30. +13 −3 src/main/java/{ → app/tweditor}/MainWindow.java
  31. +1 −1 src/main/java/{ → app/tweditor}/NumericDocument.java
  32. +1 −1 src/main/java/{ → app/tweditor}/NumericField.java
  33. +9 −36 src/main/java/{ → app/tweditor}/PackFile.java
  34. +1 −1 src/main/java/{ → app/tweditor}/ProgressDialog.java
  35. +1 −1 src/main/java/{ → app/tweditor}/Quest.java
  36. +1 −1 src/main/java/{ → app/tweditor}/QuestsPanel.java
  37. +1 −1 src/main/java/{ → app/tweditor}/ResourceDatabase.java
  38. +1 −1 src/main/java/{ → app/tweditor}/ResourceEntry.java
  39. +1 −1 src/main/java/{ → app/tweditor}/ResourceInputStream.java
  40. +23 −22 src/main/java/{ → app/tweditor}/SaveDatabase.java
  41. +30 −31 src/main/java/{ → app/tweditor}/SaveEntry.java
  42. +16 −42 src/main/java/{ → app/tweditor}/SaveFile.java
  43. +1 −1 src/main/java/{ → app/tweditor}/SaveInputStream.java
  44. +1 −1 src/main/java/{ → app/tweditor}/SaveOutputStream.java
  45. +1 −1 src/main/java/{ → app/tweditor}/SignsPanel.java
  46. +1 −1 src/main/java/{ → app/tweditor}/StatsPanel.java
  47. +1 −1 src/main/java/{ → app/tweditor}/StreamReader.java
  48. +1 −1 src/main/java/{ → app/tweditor}/StringsDatabase.java
  49. +1 −1 src/main/java/{ → app/tweditor}/StylesPanel.java
  50. +1 −1 src/main/java/{ → app/tweditor}/TextDatabase.java
  51. +2 −2 src/main/java/{ → app/tweditor}/UnpackSave.java
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ The 'Inventory' tab allows you to modify Geralt's inventory.

The 'Quests' tab shows the game quests (Started, Completed, Failed and Not Started). The 'Examine' button will display a description of the current quest stage (if the stage has a description).

The 'Difficulty' tab allows you to modify difficulty level.

Installation
============
@@ -99,6 +100,10 @@ Version 2.1:
============
Support equipped items.

Version 2.2:
============
Difficulty support.

Version 3.0.1
=============
Provide a JAR and DMG file
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -4,8 +4,13 @@ plugins {
id 'edu.sc.seis.macAppBundle' version "2.3.0"
}

dependencies {
implementation 'com.google.guava:guava:29.0-jre'
}

mainClassName = "TWEditor.Main"
version = "3.0.1"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

launch4j {
mainClassName = project.mainClassName
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Aug 03 17:15:08 JST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.util.List;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import javax.swing.tree.DefaultMutableTreeNode;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.IOException;
import java.io.InputStream;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.IOException;
import java.io.OutputStream;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

public class DBElement
implements Cloneable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

public abstract class DBElementValue
implements Cloneable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

public class DBException extends Exception
{
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.util.ArrayList;
import java.util.HashMap;
@@ -33,6 +33,21 @@ public boolean addElement(DBElement element)
return true;
}

public boolean insertElement(int index,DBElement element) {
String label = element.getLabel();
if (label.length() == 0) {
this.elementList.add(index, element);
return true;
}

if (this.labelMap.get(label) != null) {
return false;
}
this.elementList.add(index, element);
this.labelMap.put(label, element);
return true;
}

public DBElement removeElement(int index)
{
DBElement element = (DBElement)this.elementList.get(index);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.File;
import java.io.FileInputStream;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
183 changes: 183 additions & 0 deletions src/main/java/app/tweditor/DifficultyPanel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
package app.tweditor;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class DifficultyPanel extends JPanel
implements ActionListener
{
private final String EASY = "Easy";
private final String MEDIUM = "Medium";
private final String HARD = "Hard";

private final String EASY_DIFF = "Difficulty_easy";
private final String MEDIUM_DIFF = "Difficulty_normal";

private final int EASY_INT = 0;
private final int MEDIUM_INT = 1;
private final int HARD_INT = 2;

private JRadioButton easyButton, mediumButton, hardButton;
private String level;

public DifficultyPanel()
{
easyButton = new JRadioButton(EASY);
easyButton.setActionCommand(EASY);
easyButton.addActionListener(this);

mediumButton = new JRadioButton(MEDIUM);
mediumButton.setActionCommand(MEDIUM);
mediumButton.addActionListener(this);

hardButton = new JRadioButton(HARD);
hardButton.setActionCommand(HARD);
hardButton.addActionListener(this);

ButtonGroup group = new ButtonGroup();
group.add(easyButton);
group.add(mediumButton);
group.add(hardButton);

JPanel panel = new JPanel(new GridLayout(0, 3, 5, 5));
panel.add(easyButton);
panel.add(mediumButton);
panel.add(hardButton);

panel.setBorder(BorderFactory.createTitledBorder("Level"));

add(panel);
}

private void processCharAbilities(DBList list, String cmd) {
try {
DBList abilityList = (DBList)list.getElement("CharAbilities").getValue();

if(level.equals(EASY) || level.equals(MEDIUM)) {
for (int i = 0; i < abilityList.getElementCount(); i++) {
DBList fieldList = (DBList)abilityList.getElement(i).getValue();

DBElement e = fieldList.getElement(0);
Object value = e.getValue();
if(value.equals(EASY_DIFF) || value.equals(MEDIUM_DIFF)) {
if(cmd.equals(EASY)) {
fieldList.setString("RnAbName", EASY_DIFF);
} else if(cmd.equals(MEDIUM)) {
fieldList.setString("RnAbName", MEDIUM_DIFF);
} else {
abilityList.removeElement(i);
}

break;
}
}
} else {
for (int i = 0; i < abilityList.getElementCount(); i++) {
DBList fieldList = (DBList)abilityList.getElement(i).getValue();

DBElement e = fieldList.getElement(0);
Object value = e.getValue();
if(value.equals("StyleSilverGroup1")) {
DBList levelList = new DBList(2);
if(cmd.equals(EASY)) {
levelList.addElement(new DBElement(10, 0, "RnAbName", EASY_DIFF));
} else if(cmd.equals(MEDIUM)) {
levelList.addElement(new DBElement(10, 0, "RnAbName", MEDIUM_DIFF));
}
levelList.addElement(new DBElement(0, 0, "RnAbStk", new Integer(0)));

abilityList.insertElement(i + 1, new DBElement(14, 48879, "", levelList));
break;
}
}
}

level = cmd;
Main.dataModified = true;
} catch (DBException exc) {
Main.logException("Unable to update database field", exc);
} catch (Throwable exc) {
Main.logException("Exception while processing action event", exc);
}
}

private void processGameDiffSetting(DBList list, String cmd) {
try {
if(cmd.equals(EASY)) {
list.setInteger("GameDiffSetting", EASY_INT);
} else if(cmd.equals(MEDIUM)) {
list.setInteger("GameDiffSetting", MEDIUM_INT);
} else {
list.setInteger("GameDiffSetting", HARD_INT);
}
} catch (DBException exc) {
Main.logException("Unable to update database field", exc);
} catch (Throwable exc) {
Main.logException("Exception while processing action event", exc);
}
}

public void actionPerformed(ActionEvent ae)
{
if ((!(ae.getSource() instanceof JRadioButton)) || (Main.dataChanging)) {
return;
}

String cmd = ae.getActionCommand();

if(cmd.equals(level)) {
return;
}

DBList top = (DBList)Main.database.getTopLevelStruct().getValue();
DBList mod = (DBList)top.getElement("Mod_PlayerList").getValue();
DBList modPlayerList = (DBList)mod.getElement(0).getValue();
processCharAbilities(modPlayerList, cmd);

DBList playerList = (DBList)Main.playerDatabase.getTopLevelStruct().getValue();
processCharAbilities(playerList, cmd);

DBList smm = (DBList)Main.smmDatabase.getTopLevelStruct().getValue();
processGameDiffSetting(smm, cmd);
}

private void print(DBElement e) {
System.out.println(e.getType() + " " + e.getLabel() + " " + e.getID());
}

public void setFields(DBList list)
throws DBException
{
level = HARD;
hardButton.setSelected(true);

DBElement element = list.getElement("CharAbilities");
if (element == null) {
throw new DBException("CharAbilities field not found");
}
DBList abilityList = (DBList)element.getValue();
for (int i = 0; i < abilityList.getElementCount(); i++) {
DBList fieldList = (DBList)abilityList.getElement(i).getValue();

DBElement e = fieldList.getElement(0);
Object value = e.getValue();
if(value.equals(EASY_DIFF)) {
level = EASY;
easyButton.setSelected(true);
break;
} else if(value.equals(MEDIUM_DIFF)) {
level = MEDIUM;
mediumButton.setSelected(true);
break;
}
}
}

public void getFields(DBList list)
throws DBException
{
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.awt.BorderLayout;
import java.awt.Dimension;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

public class InventoryItem
implements Comparable<InventoryItem>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import javax.swing.tree.DefaultMutableTreeNode;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.awt.BorderLayout;
import java.awt.Dimension;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

public class ItemTemplate
implements Comparable<ItemTemplate>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.File;
import java.io.IOException;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.IOException;
import java.io.InputStream;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package TWEditor;
package app.tweditor;

import java.io.EOFException;
import java.io.File;
Loading