From 3c7b16306db49fc256c977f4cf1f612ca9739f55 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 20 Sep 2025 11:27:41 -0500 Subject: [PATCH] fix datablock display to sync to selected instance. tie in frame selector frontend --- .../decalEditor/decalEditorActions.tscript | 3 ++- .../game/tools/decalEditor/decalEditorGui.gui | 20 ++++++++++++++++++- .../tools/decalEditor/decalEditorGui.tscript | 11 ++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorActions.tscript b/Templates/BaseGame/game/tools/decalEditor/decalEditorActions.tscript index 62f33dd9a..d61897654 100644 --- a/Templates/BaseGame/game/tools/decalEditor/decalEditorActions.tscript +++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorActions.tscript @@ -74,7 +74,8 @@ function ActionEditNodeDetails::doit(%this) %pos = getwords(%this.newTransformData,0,2); %tan = getwords(%this.newTransformData,3,5); %size = getword(%this.newTransformData,6); - %uvID = DecalEditorGui.getDecalFrame(%this.instanceId); + //%uvID = DecalEditorGui.getDecalFrame(%this.instanceId); + %uvID = DecalEditorDetailContainer-->frame.getText(); DecalEditorGui.editDecalDetails( %this.instanceId, %pos, %tan, %size, %uvID ); DecalEditorGui.syncNodeDetails(); DecalEditorGui.selectDecal( %this.instanceId ); diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui index c7f799fb8..7c9783f05 100644 --- a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui +++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.gui @@ -677,7 +677,7 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { new GuiContainer(DecalEditorDetailContainer){ Position = "0 202"; - Extent = "202 79"; + Extent = "202 100"; HorizSizing = "width"; VertSizing = "bottom"; isContainer = "1"; @@ -753,6 +753,24 @@ $guiContent = new GuiDecalEditorCtrl(DecalEditorGui) { Extent = "128 18"; text = ""; }; + new GuiTextCtrl(){ + Profile = "ToolsGuiTextRightProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + Position = "3 80"; + Extent = "47 16"; + text = "frame"; + }; + new GuiTextEditCtrl(){ // instance frame + Profile = "ToolsGuiTextEditProfile"; + internalName = "frame"; + HorizSizing = "width"; + VertSizing = "bottom"; + AltCommand = "DecalEditorGui.editNodeDetails();"; + Position = "54 80"; + Extent = "128 18"; + text = ""; + }; }; }; }; diff --git a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript index 92d20c209..09f44b702 100644 --- a/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript +++ b/Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript @@ -291,6 +291,9 @@ function DecalEditorGui::onSelectInstance( %this, %decalId, %lookupName ) %item = DecalEditorTreeView.findItemByName( %name ); DecalEditorTreeView.selectItem( %item ); DecalEditorGui.syncNodeDetails(); + + %dbListID = DecalDataList.findItemText(%lookupName); + DecalDataList.setCurSel( %dbListID ); } function DecalEditorGui::onCreateInstance( %this, %decalId, %lookupName ) @@ -363,6 +366,7 @@ function DecalEditorGui::syncNodeDetails( %this ) DecalEditorDetailContainer-->nodePosition.setText(getWords(%transformData, 0, 2)); DecalEditorDetailContainer-->nodeTangent.setText(getWords(%transformData, 3, 5)); DecalEditorDetailContainer-->nodeSize.setText(getWord(%transformData, 6)); + DecalEditorDetailContainer-->frame.setText(DecalEditorGui.getDecalFrame(DecalEditorGui.selDecalInstanceId)); } function DecalEditorGui::paletteSync( %this, %mode ) @@ -386,7 +390,8 @@ function DecalDataList::onSelect( %this, %id, %text ) $Tools::materialEditorList = %data.getId(); //Canvas.pushDialog( DecalEditDlg ); - DecalInspector.inspect( %data ); + DecalInspector.inspect( %data ); + DecalEditorDetailContainer-->frame.setText(%obj.frame); DecalEditorGui.updateDecalPreview( %data.materialAsset ); } @@ -560,7 +565,9 @@ function DecalInspector::onInspectorFieldModified( %this, %object, %fieldName, % DecalEditorGui.updateDecalPreview( %newValue ); // Same work to do as for the regular WorldEditor Inspector. - Inspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue ); + Inspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue ); + + warn( "modified "@ DecalEditorGui.selDecalInstanceId); //this is an array id, not an objectid if (%oldValue != %newValue || %oldValue !$= %newValue) %this.setDirty(%object);