*/}}
Jelajahi Sumber

Fix rack parent page missing in read

YimingWu 1 tahun lalu
induk
melakukan
2977d56d12
2 mengubah file dengan 12 tambahan dan 2 penghapusan
  1. 8 1
      resources/la_nodes_basic.c
  2. 4 1
      resources/la_properties.c

+ 8 - 1
resources/la_nodes_basic.c

@@ -1180,6 +1180,13 @@ void lapost_Node(laBaseNode *bn){
     }
 }
 
+extern laRackPage* DEBUG_READ_RACK_PAGE;
+void lapost_NodeRack(laNodeRack *rr){
+    if(!rr->ParentPage){
+        memAssignRef(rr,&rr->ParentPage,DEBUG_READ_RACK_PAGE);
+    }
+}
+
 void la_AddValuesNodeEnum(laProp* p){
     laAddEnumItemAs(p,"FLOAT","Float","Float value",LA_VALUES_NODE_FLOAT,0);
     laAddEnumItemAs(p,"INT","Int","Int value",LA_VALUES_NODE_INT,0);
@@ -1208,7 +1215,7 @@ void la_RegisterInputMapperOperators(){
     laCreateOperatorType("LA_remove_input_mapping_page", "Remove Page", "Remove a input mapper page",OPCHK_RemoveInputMappingPage,0,0,OPINV_RemoveInputMappingPage,OPMOD_FinishOnData,L'🗴',0)
         ->UiDefine=laui_RemoveInputMappingPage;
     
-    pc=laAddPropertyContainer("la_node_rack", "Input Rack", "Input rack for putting input mapping nodes",0,0,sizeof(laNodeRack),0,0,1);
+    pc=laAddPropertyContainer("la_node_rack", "Input Rack", "Input rack for putting input mapping nodes",0,0,sizeof(laNodeRack),lapost_NodeRack,0,1);
     laAddStringProperty(pc,"name","Name","Name of this rack",0,0,0,0,1,offsetof(laNodeRack,Name),0,0,0,0,LA_AS_IDENTIFIER);
     p=laAddSubGroup(pc,"nodes","Nodes","Nodes under this rack","la_base_node",laget_BaseNodeType,0,0,-1,0,0,0,0,0,0,offsetof(laNodeRack,Nodes),0);
     laSubGroupExtraFunctions(p,0,0,laget_NodeGetTheme,laget_BaseNodeGap,0);

+ 4 - 1
resources/la_properties.c

@@ -1041,6 +1041,9 @@ void lareset_RackPage(laRackPage* rp){
     }
 }
 
+laRackPage* DEBUG_READ_RACK_PAGE=0; // some files have rack parent page missing, this to fix.
+void lapost_RackPage(laRackPage* rp){ DEBUG_READ_RACK_PAGE=rp; }
+
 void la_RegisterTNSProps(){
     laPropContainer *p, *ip, *p2, *ip2, *sp1, *sp2;
     laProp *ep; laPropPack pp; laSubProp *sp; laKeyMapper *km;
@@ -1456,7 +1459,7 @@ void la_RegisterInternalProps(){
             //laSubGroupDetachable(sp,laget_FirstDriverPage,laget_ListNext);
         }
 
-        p = laAddPropertyContainer("la_rack_page", "Rack Page", "A page of nodes", 0,laui_IdentifierOnly, sizeof(laRackPage), 0,0,1);{
+        p = laAddPropertyContainer("la_rack_page", "Rack Page", "A page of nodes", 0,laui_IdentifierOnly, sizeof(laRackPage),lapost_RackPage,0,1);{
             LA_PC_RACK_PAGE = p;
             laPropContainerExtraFunctions(p,0,lareset_RackPage,0,0,0);
             laAddStringProperty(p, "name", "Name", "Name of the page", 0,0,0,0,1, offsetof(laRackPage, Name), 0,0,0,0,LA_AS_IDENTIFIER);