From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/scape/SubclumpShape.java | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 NET/worlds/scape/SubclumpShape.java (limited to 'NET/worlds/scape/SubclumpShape.java') diff --git a/NET/worlds/scape/SubclumpShape.java b/NET/worlds/scape/SubclumpShape.java new file mode 100644 index 0000000..000786f --- /dev/null +++ b/NET/worlds/scape/SubclumpShape.java @@ -0,0 +1,47 @@ +package NET.worlds.scape; + +public class SubclumpShape extends Shape implements ShapeLoaderListener { + private Material pendingMaterial = null; + private static final boolean debug = false; + + @Override + public void setMaterial(Material m) { + SuperRoot parentObj = this.getOwner(); + if (!(parentObj instanceof Shape)) { + super.setMaterial(m); + } else { + Shape parent = (Shape)parentObj; + if (!parent.isFullyLoaded()) { + parent.addLoadListener(this); + this.pendingMaterial = m; + } else { + super.setMaterial(m); + } + } + } + + @Override + protected synchronized void addRwChildren(WObject container) { + SuperRoot o = this.getOwner(); + if (o instanceof Shape) { + Shape parent = (Shape)o; + if (!parent.isFullyLoaded()) { + this.setState(LOADING, null); + parent.addLoadListener(this); + } + } + + super.addRwChildren(container); + } + + @Override + public void notifyShapeLoaded(Shape s) { + this.setState(NORMAL, null); + this.shapeRedraw(); + if (this.pendingMaterial != null) { + super.setMaterial(this.pendingMaterial); + } + + this.pendingMaterial = null; + } +} -- cgit v1.2.3