Skip to content

Commit 40cc915

Browse files
[hide] Added rebuildRenderProps to editContext2
1 parent 9a8022b commit 40cc915

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

hide_js/hide/prefab/EditContext.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ class HideJsEditContext2 extends hrt.prefab.EditContext2 {
217217
ctx.ide.openFile(path);
218218
}
219219

220+
public function rebuildRenderProps() {
221+
ctx.scene.editor.queueRefreshRenderProps();
222+
}
223+
220224
public function rebuildPrefabImpl(prefab:Prefab) {
221225
ctx.scene.editor.queueRebuild(prefab);
222226
}

hrt/prefab/EditContext2.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ abstract class EditContext2 {
6969
rebuildPrefabImpl(prefab);
7070
}
7171

72+
public
73+
7274
/**
7375
Implement this to support rebuild prefab
7476
**/
@@ -83,6 +85,8 @@ abstract class EditContext2 {
8385
rebuildTreeImpl();
8486
}
8587

88+
public abstract function rebuildRenderProps() : Void;
89+
8690
/**
8791
Implement this to support rebuilding the tree
8892
**/

hrt/prefab/RenderProps.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ class RenderProps extends Object3D {
137137
setProps(props);
138138
needSet = false;
139139
}
140-
shared.editor?.queueRefreshRenderProps();
140+
ctx.rebuildRenderProps();
141141
});
142142

143143
var editor = hide.prefab.propsEditor.AnyPropsEditor.makeEditor(renderer);
144144
editor.edit2(ctx, rendererCat, props);
145145

146-
shared.editor?.queueRefreshRenderProps();
146+
ctx.rebuildRenderProps();
147147
}
148148

149149
#if editor

hrt/ui/HuiPrefabEditor.hx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,11 @@ class EditContext extends hrt.prefab.EditContext2 {
958958
editor.refreshInspector();
959959
};
960960

961+
public function rebuildRenderProps() : Void {
962+
editor.makeRenderProps();
963+
}
964+
965+
961966
public function rebuildPrefabImpl(prefab: hrt.prefab.Prefab) : Void {
962967
if (prefab == null || prefab.parent == null) {
963968
editor.tryMake(editor.prefab);

0 commit comments

Comments
 (0)