Skip to content

Commit

Permalink
Renaming FileWatcher to LiveReload
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaskelly committed Apr 25, 2020
1 parent 15db596 commit 049433e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import com.interrupt.dungeoneer.editor.history.EditorHistory;
import com.interrupt.dungeoneer.editor.ui.EditorUi;
import com.interrupt.dungeoneer.editor.ui.TextureRegionPicker;
import com.interrupt.dungeoneer.editor.utils.FileWatcher;
import com.interrupt.dungeoneer.editor.utils.LiveReload;
import com.interrupt.dungeoneer.entities.*;
import com.interrupt.dungeoneer.entities.Entity.ArtType;
import com.interrupt.dungeoneer.entities.Entity.EditorState;
Expand Down Expand Up @@ -351,7 +351,7 @@ protected Decal newObject () {

Vector3 rayOutVector = new Vector3();

private FileWatcher watcher;
private LiveReload liveReload;
public AtomicBoolean needToReloadAssets = new AtomicBoolean(false);

public EditorApplication() {
Expand Down Expand Up @@ -396,8 +396,8 @@ public void init(){
unknownEntityMarker.tex = 1000;
unknownEntityMarker.artType = ArtType.hidden;

watcher = new FileWatcher();
watcher.init();
liveReload = new LiveReload();
liveReload.init();

StringManager.init();
Game.init();
Expand All @@ -418,7 +418,7 @@ public void dispose() {
gameApp.dispose();
}

watcher.dispose();
liveReload.dispose();

frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;

/** Subsystem for live reloading art assets. */
public class FileWatcher {
public class LiveReload {
private final Thread watcher;
private static final boolean created = false;

Expand All @@ -20,8 +20,8 @@ public class FileWatcher {

private final List<String> watchedExtensions = Arrays.asList("dat", "obj", "png", "frag", "vert");

public FileWatcher() {
if (FileWatcher.created) {
public LiveReload() {
if (LiveReload.created) {
throw new RuntimeException("FileWatcher instance already exists.");
}

Expand Down

0 comments on commit 049433e

Please sign in to comment.