Skip to content

Commit

Permalink
EW support
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Dec 6, 2021
1 parent 25e3778 commit 07e0ba2
Show file tree
Hide file tree
Showing 1,097 changed files with 32,594 additions and 28,750 deletions.
21 changes: 9 additions & 12 deletions xivdata/INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

```
# Extract icons
./SaintCoinach.Cmd.exe 'C:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY XIV Online' ui
./SaintCoinach.Cmd.exe 'C:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY XIV Online' uihd
# Move them to one folder
cd 2021.11.28.xxxx.yyyy/ui/icon
mkdir combined
mv whatever_path/*/*.png combined/
# Preview needed icons
# Action.csv = relevant data file, -f = which field represents the icon
# Just kidding, this doesn't properly handle commas in quotes
cut -f 4 -d, Action.csv | sort -n | uniq
# Actually copy them to a new folder
mkdir actions
cut -f 4 -d, Action.csv | sort -n | uniq | grep -E '[0-9]+' | awk '{printf "%06d\n", $0}' | xargs -n 1 -I '{}' mv '2021.08.17.0000.0000/ui/icon/combined/{}.png' actions/
# ^ filters out header ^ left pad ^ actual move
mv */*.png combined/
mkdir actions/
# Run ActionIcon.main or StatusEffectIcon.main, then
java <stuff> | xargs -n 1 -I '{}' cp 'combined/{}_hr1.png' actions/
# or just be lazy and copy and paste
cat | xargs -n 1 -I '{}' cp 'combined/{}_hr1.png' actions/
# (paste after starting the command, then ^D to end)
# Actually working versions: Run ActionIcon.main or StatusEffectIcon.main, then:
stuff | xargs -n 1 -I '{}' cp '2021.08.17.0000.0000/ui/icon/combined/{}.png' actions/
```
36 changes: 30 additions & 6 deletions xivdata/src/main/java/gg/xp/xivdata/jobs/ActionIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ActionIcon implements HasIconURL {

Expand All @@ -32,21 +34,43 @@ private static void readCsv() {
loaded = true;
}
arrays.forEach(row -> {
long id;
try {
long id = Long.parseLong(row[0]);
long imageId = Long.parseLong(row[3]);
if (imageId != 0) {
csvValues.put(id, imageId);
}
id = Long.parseLong(row[0]);
}
catch (NumberFormatException nfe) {
// Ignore the bad value at the top
return;
}
String rawImg = row[3];
if (rawImg.isEmpty()) {
return;
}
long imageId;
try {
imageId = Long.parseLong(rawImg);
}
catch (NumberFormatException nfe) {
// Ignore non-numeric
Matcher matcher = texFilePattern.matcher(rawImg);
if (matcher.find()) {
imageId = Long.parseLong(matcher.group(1));
}
else {
throw new RuntimeException("Invalid image specifier: " + rawImg);
// Ignore non-numeric
// return;
}
}
if (imageId != 0) {
csvValues.put(id, imageId);
}
});

// If we fail, it's always going to fail, so continue without icons.
}

private static final Pattern texFilePattern = Pattern.compile("(\\d+)\\.tex");

public static void main(String[] args) {
readCsv();
csvValues.values().stream().distinct().sorted().map(s -> String.format("%06d", s)).forEach(System.out::println);
Expand Down
2 changes: 0 additions & 2 deletions xivdata/src/main/java/gg/xp/xivdata/jobs/Cooldown.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import static gg.xp.xivdata.jobs.Job.PLD;
import static gg.xp.xivdata.jobs.Job.RDM;
import static gg.xp.xivdata.jobs.Job.SCH;
import static gg.xp.xivdata.jobs.Job.SMN;
import static gg.xp.xivdata.jobs.Job.WAR;
import static gg.xp.xivdata.jobs.Job.WHM;
import static gg.xp.xivdata.jobs.JobType.CASTER;
Expand Down Expand Up @@ -47,7 +46,6 @@ public enum Cooldown {
Brotherhood(MNK, 90.0, "Brotherhood", CooldownType.OFFENSIVE, 0x1ce4, -1),
DragonSight(DRG, 120.0, "Dragon Sight", CooldownType.OFFENSIVE, 0x1ce6, -1),
Troubadour(BRD, 120.0, "Troubadour", CooldownType.PARTY_TODO_CATEGORIZE_ME, 0x1ced, -1),
Aetherpact(SMN, 180.0, "Aetherpact", CooldownType.OFFENSIVE, 0x1cff, -1),
ChainStratagem(SCH, 120.0, "Chain Stratagem", CooldownType.OFFENSIVE, 0x1d0c, -1),
Embolden(RDM, 120.0, "Embolden", CooldownType.OFFENSIVE, 0x1d60, -1),
Rampart(TANK, 90.0, "Rampart", CooldownType.DEFENSIVE, 0x1d6b, -1),
Expand Down
21 changes: 6 additions & 15 deletions xivdata/src/main/java/gg/xp/xivdata/jobs/DotBuff.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@

import java.util.Set;

import static gg.xp.xivdata.jobs.Job.AST;
import static gg.xp.xivdata.jobs.Job.BLM;
import static gg.xp.xivdata.jobs.Job.BLU;
import static gg.xp.xivdata.jobs.Job.BRD;
import static gg.xp.xivdata.jobs.Job.DRG;
import static gg.xp.xivdata.jobs.Job.MNK;
import static gg.xp.xivdata.jobs.Job.NIN;
import static gg.xp.xivdata.jobs.Job.PLD;
import static gg.xp.xivdata.jobs.Job.SAM;
import static gg.xp.xivdata.jobs.Job.SCH;
import static gg.xp.xivdata.jobs.Job.SMN;
import static gg.xp.xivdata.jobs.Job.WHM;
import static gg.xp.xivdata.jobs.Job.*;

public enum DotBuff {
// List of ALL buffs to track - WL/BL will be done by user settings
Expand All @@ -28,9 +17,11 @@ public enum DotBuff {
PLD_GoringBlade(PLD, "Goring Blade", 0x2d5L),
SAM_Higanbana(SAM, "Higanbana", 0x4ccL),
SCH_Bio(SCH, "Bio/II/Biolysis", 0xb3L, 0xbdL, 0x767L),
SMN_Bio(SMN, "Bio/II/III", 0xb3L, 0xbdL, 0x4beL),
SMN_Miasma(SMN, "Miasma/II/III", 0xb4L, 0xbcL, 0x4bfL),
WHM_Aero(WHM, "Aero/II/III/Dia", 0x8fL, 0x90L, 0x31eL, 0x74fL);
// SMN_Bio(SMN, "Bio/II/III", 0xb3L, 0xbdL, 0x4beL),
// SMN_Miasma(SMN, "Miasma/II/III", 0xb4L, 0xbcL, 0x4bfL),
WHM_Aero(WHM, "Aero/II/III/Dia", 0x8fL, 0x90L, 0x31eL, 0x74fL),
SGE_Dosis(SGE, "Dosis", 2614L, 2615L, 2616L),
RPR_Death(RPR, "Death's Design", 2586L);

private final Job job;
private final String label;
Expand Down
36 changes: 30 additions & 6 deletions xivdata/src/main/java/gg/xp/xivdata/jobs/StatusEffectIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StatusEffectIcon implements HasIconURL {

Expand All @@ -36,21 +38,43 @@ private static void readCsv() {
loaded = true;
}
arrays.forEach(row -> {
long id;
try {
long id = Long.parseLong(row[0]);
long imageId = Long.parseLong(row[3]);
if (imageId != 0) {
csvValues.put(id, imageId);
}
id = Long.parseLong(row[0]);
}
catch (NumberFormatException nfe) {
// Ignore the bad value at the top
return;
}
String rawImg = row[3];
if (rawImg.isEmpty()) {
return;
}
long imageId;
try {
imageId = Long.parseLong(rawImg);
}
catch (NumberFormatException nfe) {
// Ignore non-numeric
Matcher matcher = texFilePattern.matcher(rawImg);
if (matcher.find()) {
imageId = Long.parseLong(matcher.group(1));
}
else {
throw new RuntimeException("Invalid image specifier: " + rawImg);
// Ignore non-numeric
// return;
}
}
if (imageId != 0) {
csvValues.put(id, imageId);
}
});

// If we fail, it's always going to fail, so continue without icons.
}

private static final Pattern texFilePattern = Pattern.compile("(\\d+)\\.tex");

public static void main(String[] args) {
readCsv();
csvValues.values().stream().distinct().sorted().map(s -> String.format("%06d", s)).forEach(System.out::println);
Expand Down
Loading

0 comments on commit 07e0ba2

Please sign in to comment.