summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/CameraHeightAction.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/CameraHeightAction.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/CameraHeightAction.java')
-rw-r--r--NET/worlds/scape/CameraHeightAction.java116
1 files changed, 116 insertions, 0 deletions
diff --git a/NET/worlds/scape/CameraHeightAction.java b/NET/worlds/scape/CameraHeightAction.java
new file mode 100644
index 0000000..ad2e7b2
--- /dev/null
+++ b/NET/worlds/scape/CameraHeightAction.java
@@ -0,0 +1,116 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.IOException;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class CameraHeightAction
+/* */ extends Action
+/* */ {
+/* */ public float newEyeHeight;
+/* */
+/* */ public CameraHeightAction()
+/* */ {
+/* 24 */ this.newEyeHeight = 0.0F;
+/* */ }
+/* */
+/* */
+/* */ public Persister trigger(Event e, Persister seqID)
+/* */ {
+/* 30 */ Object owner = getOwner();
+/* 31 */ if ((owner == null) || (!(owner instanceof WObject))) {
+/* 32 */ return null;
+/* */ }
+/* 34 */ WObject o = (WObject)owner;
+/* */
+/* 36 */ Pilot pilot = Pilot.getActive();
+/* 37 */ if (pilot == null) {
+/* 38 */ return null;
+/* */ }
+/* */
+/* 41 */ if (pilot.getRoom() != o.getRoom()) {
+/* 42 */ return null;
+/* */ }
+/* 44 */ if ((pilot instanceof HoloPilot))
+/* */ {
+/* 46 */ HoloPilot hp = (HoloPilot)pilot;
+/* 47 */ hp.setEyeHeight(this.newEyeHeight);
+/* */ }
+/* */
+/* 50 */ return null;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public Object properties(int index, int offset, int mode, Object value)
+/* */ throws NoSuchPropertyException
+/* */ {
+/* 59 */ Object ret = null;
+/* 60 */ switch (index - offset) {
+/* */ case 0:
+/* 62 */ if (mode == 0)
+/* */ {
+/* 64 */ ret = FloatPropertyEditor.make(
+/* 65 */ new Property(this, index, "New Eye Height"));
+/* */ }
+/* 67 */ else if (mode == 1)
+/* */ {
+/* 69 */ ret = new Float(this.newEyeHeight);
+/* */ }
+/* 71 */ else if (mode == 2)
+/* */ {
+/* 73 */ this.newEyeHeight = ((Float)value).floatValue();
+/* */ }
+/* 75 */ break;
+/* */
+/* */ default:
+/* 78 */ ret = super.properties(index, offset + 1, mode, value);
+/* */ }
+/* */
+/* 81 */ return ret;
+/* */ }
+/* */
+/* */ public String toString()
+/* */ {
+/* 86 */ return
+/* 87 */ super.toString() + "[New Eye Height: " + this.newEyeHeight + "]";
+/* */ }
+/* */
+/* 90 */ private static Object classCookie = new Object();
+/* */
+/* */ public void saveState(Saver s) throws IOException
+/* */ {
+/* 94 */ s.saveVersion(0, classCookie);
+/* 95 */ super.saveState(s);
+/* 96 */ s.saveFloat(this.newEyeHeight);
+/* */ }
+/* */
+/* */ public void restoreState(Restorer r) throws IOException, TooNewException
+/* */ {
+/* 101 */ switch (r.restoreVersion(classCookie)) {
+/* */ case 0:
+/* 103 */ super.restoreState(r);
+/* 104 */ this.newEyeHeight = r.restoreFloat();
+/* 105 */ break;
+/* */ default:
+/* 107 */ throw new TooNewException();
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\CameraHeightAction.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file