Skip to content

Commit

Permalink
String Editor: Initialize new string entries with default flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed May 11, 2024
1 parent 46dd7cb commit 057e6e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/org/infinity/gui/StringEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,8 @@ protected Void doInBackground() throws Exception {
WindowBlocker blocker = new WindowBlocker(StringEditor.this);
try {
blocker.setBlocked(true);
showEntry(addEntry(new StringTable.StringEntry(null), new StringTable.StringEntry(null), true));
showEntry(addEntry(new StringTable.StringEntry(null, StringTable.FLAGS_DEFAULT),
new StringTable.StringEntry(null, StringTable.FLAGS_DEFAULT), true));
} finally {
blocker.setBlocked(false);
}
Expand Down
6 changes: 5 additions & 1 deletion src/org/infinity/util/StringTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public String format(String text, int strRef) {
/** String entry flag: Available tokens will be resolved */
public static final short FLAGS_HAS_TOKEN = 0x04;
/** The default flags value includes all supported bits */
public static final short FLAGS_DEFAULT = 0x07;
public static final short FLAGS_DEFAULT = FLAGS_HAS_TEXT | FLAGS_HAS_SOUND | FLAGS_HAS_TOKEN;

/** Strref start index for virtual strings referenced by ENGINEST.2DA (EE only) */
public static final int STRREF_VIRTUAL = 0xf00000;
Expand Down Expand Up @@ -1467,6 +1467,10 @@ public StringEntry(StringTable parent) {
resetModified();
}

public StringEntry(StringTable parent, short flags) {
this(parent, flags, "", 0, 0, "");
}

public StringEntry(StringTable parent, short flags, String soundRef, int volume, int pitch, String text) {
super(null, null, 0, 4);
this.parent = parent;
Expand Down

0 comments on commit 057e6e0

Please sign in to comment.