-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor attempts at fixes, fix some camera issues, but there is still a…
… bug on the res loader
- Loading branch information
Retera
committed
Apr 23, 2022
1 parent
84d445f
commit 61faa91
Showing
38 changed files
with
1,574 additions
and
1,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
craft3data/src/com/hiveworkshop/wc3/gui/modeledit/creator/actions/DrawCameraAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.hiveworkshop.wc3.gui.modeledit.creator.actions; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.hiveworkshop.wc3.gui.modeledit.UndoAction; | ||
import com.hiveworkshop.wc3.gui.modeledit.actions.newsys.ModelStructureChangeListener; | ||
import com.hiveworkshop.wc3.mdl.Camera; | ||
import com.hiveworkshop.wc3.mdl.v2.ModelView; | ||
|
||
public class DrawCameraAction implements UndoAction { | ||
private final ModelView modelView; | ||
private final Camera camera; | ||
private final ModelStructureChangeListener modelStructureChangeListener; | ||
private final List<Camera> cameraAsList; | ||
|
||
public DrawCameraAction(final ModelView modelView, final ModelStructureChangeListener modelStructureChangeListener, | ||
final Camera camera) { | ||
this.modelView = modelView; | ||
this.camera = camera; | ||
this.modelStructureChangeListener = modelStructureChangeListener; | ||
cameraAsList = new ArrayList<>(); | ||
cameraAsList.add(camera); | ||
} | ||
|
||
@Override | ||
public void undo() { | ||
modelView.getModel().remove(camera); | ||
modelStructureChangeListener.camerasRemoved(cameraAsList); | ||
} | ||
|
||
@Override | ||
public void redo() { | ||
modelView.getModel().add(camera); | ||
modelStructureChangeListener.camerasAdded(cameraAsList); | ||
} | ||
|
||
@Override | ||
public String actionName() { | ||
return "add " + camera.getName(); | ||
} | ||
|
||
} |
Oops, something went wrong.