Skip to content

Commit

Permalink
Merge pull request #55 from Cokemonkey11/reforged_entry2
Browse files Browse the repository at this point in the history
add reforged entry to GameDirFinder
  • Loading branch information
WaterKnight authored May 9, 2020
2 parents 8565d16 + 53ac5b5 commit fd4b2fd
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ public Wc3ReforgedEntry(@Nonnull String key, @Nonnull EntryType entryType) {
}

/** Of the form `"C:\Program Files\Warcraft III\x86_64\Warcraft III.exe",0` */
public final static Wc3ReforgedEntry APPLICATION_ICON = new Wc3ReforgedEntry("ApplicationIcon", EntryType.REG_SZ);
public final static Wc3Entry APPLICATION_ICON = new Wc3Entry("ApplicationIcon", EntryType.REG_SZ);

/** Of the form `"C:\Program Files\Warcraft III\x86_64\Warcraft III.exe",0` */
public final static Wc3ReforgedEntry INSTALL_PATH = APPLICATION_ICON;
public final static Wc3Entry INSTALL_PATH = APPLICATION_ICON;
}

/** A warcraft3-specific registry entry. Present on wc3 versions before 1.32 (reforged). */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package net.moonlightflower.wc3libs.port;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;

public abstract class GameDirFinder extends Finder<File> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.moonlightflower.wc3libs.port;

import javax.annotation.Nonnull;
import java.io.File;

public abstract class GameExeFinder extends Finder<File> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import net.moonlightflower.wc3libs.port.mac.MacGameExeFinder;
import net.moonlightflower.wc3libs.port.win.WinGameExeFinder;
import net.moonlightflower.wc3libs.port.win.registry.WinRegistryGameExeFinder;

import javax.annotation.Nonnull;
import java.io.File;
import java.util.Arrays;
import java.util.List;

public class StdGameExeFinder extends GameExeFinder {
public StdGameExeFinder() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.moonlightflower.wc3libs.port.win;

import net.moonlightflower.wc3libs.port.AlreadyTriedException;
import net.moonlightflower.wc3libs.port.GameDirFinder;
import net.moonlightflower.wc3libs.port.NotFoundException;
import net.moonlightflower.wc3libs.port.win.registry.WinRegistryGameDirFinder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.moonlightflower.wc3libs.port.win;

import net.moonlightflower.wc3libs.port.*;
import net.moonlightflower.wc3libs.port.win.registry.WinRegistryGameDirFinder;
import net.moonlightflower.wc3libs.port.win.registry.WinRegistryGameExeFinder;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -33,7 +32,8 @@ protected GameVersionFinder getGameVersionFinder() {
}

@Nonnull
public static File fromDir(@Nonnull File dir, @Nonnull GameVersion version, @Nonnull Orient.WinArch arch) throws NotFoundException {
public static File fromDir(
@Nonnull File dir, @Nonnull GameVersion version, @Nonnull Orient.WinArch arch) throws NotFoundException {
if (version.compareTo(GameVersion.VERSION_1_31) >= 0) {
switch (arch) {
case X86:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public File find() throws NotFoundException {
WinRegistryHandler.Wc3Entry.INSTALL_PATH_X,
WinRegistryHandler.Wc3LocalMachineEntry.INSTALL_PATH,
WinRegistryHandler.Wc3LocalMachineEntry.INSTALL_PATH_X,
WinRegistryHandler.Wc3LocalMachineEntry.WAR3_INSTALL_PATH
WinRegistryHandler.Wc3LocalMachineEntry.WAR3_INSTALL_PATH,
WinRegistryHandler.Wc3ReforgedEntry.INSTALL_PATH
);

for (WinRegistryHandler.Wc3Entry entry : entries) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.moonlightflower.wc3libs.port.win.registry;

import net.moonlightflower.wc3libs.misc.WinRegistryHandler;
import net.moonlightflower.wc3libs.misc.WinRegistryHandler.Wc3Entry;
import net.moonlightflower.wc3libs.port.GameExeFinder;
import net.moonlightflower.wc3libs.port.NotFoundException;

Expand All @@ -16,7 +17,7 @@ public WinRegistryGameExeFinder() {
@Override
public File find() throws NotFoundException {
try {
String fileS = getRegistryHandler().get("HKCU\\Software\\Blizzard Entertainment\\Warcraft III", "Program");
String fileS = getRegistryHandler().get(Wc3Entry.PROGRAM);

if (fileS == null) throw new NotFoundException();

Expand Down

0 comments on commit fd4b2fd

Please sign in to comment.