*/}}
1
0
Quellcode durchsuchen

material ui small stuff fix

YimingWu vor 1 Jahr
Ursprung
Commit
f36bde65ce
4 geänderte Dateien mit 24 neuen und 10 gelöschten Zeilen
  1. 4 6
      la_kernel.c
  2. 2 2
      la_tns_kernel.c
  3. 2 0
      resources/la_properties.c
  4. 16 2
      resources/la_templates.c

+ 4 - 6
la_kernel.c

@@ -4428,25 +4428,23 @@ int la_DoExpression(laUiConditionNode *Expression, int *IResult, real *FResult,
         case LA_PROP_INT:
             *IResult = laGetInt(&Expression->PP);
             if (*IResult) return LA_CONDITION_INT;
-            else
-                return 0;
+            else return 0;
         case LA_PROP_FLOAT:
             *FResult = laGetFloat(&Expression->PP);
             if (*FResult) return 1;
-            else
-                return 0;
+            else return 0;
             break;
         case LA_PROP_STRING:
             laGetString(&Expression->PP, _StrResult, &StrResult);
             if (StrResult[0]) return 1;
-            else
-                return 0;
+            else return 0;
             break;
         case LA_PROP_ENUM:
             ei = laGetEnum(&Expression->PP);
             if (!ei) return 0;
             /*if(ei) */ *IResult = ei->Index;
             if (*IResult) return LA_CONDITION_INT;
+            else return 0;
             break;
         case LA_PROP_SUB:
             if (!Expression->PP.Go) Instance = Expression->PP.EndInstance;

+ 2 - 2
la_tns_kernel.c

@@ -3483,7 +3483,6 @@ tnsObject *tnsCreateRootObject(char *name){
 }
 void tnsDestroyRootObject(tnsObject *root){
     tnsWorld *w = T->World;
-    tnsObject *o, *NextO;
     memAssignRef(w,&w->ActiveRoot,root->Item.pPrev ? root->Item.pPrev : root->Item.pNext ? root->Item.pNext : 0);
 
     root->Evaluated.Done=root->EvaluatedPlay.Done=0;
@@ -3501,7 +3500,8 @@ void tnsDestroyRootObject(tnsObject *root){
     memLeave(root->Drivers); // root->Drivers=0; never reset address for single, see la_GiveDiffCommand()
 
     lstRemoveItem(&w->RootObjects, root);
-    while (lstPopPointerLeave(&root->ChildObjects));
+    tnsObject*co;
+    while(co=lstPopPointerLeave(&root->ChildObjects)){ tnsDestroyObject(co); }
     strSafeDestroy(&root->Name);
     memLeave(root);
 }

+ 2 - 0
resources/la_properties.c

@@ -679,6 +679,8 @@ void lapost_Panel(laPanel *p){
     p->PP.EndInstance = p;
     p->PP.LastPs = &p->FakePS;
     p->PP.LastPs->p = _LA_PROP_PANEL;
+    p->PP.LastPs->UseInstance = p;
+    p->PP.LastPs->Type = U'.';
 
     la_EnsurePanelExtras(p);
 

+ 16 - 2
resources/la_templates.c

@@ -1787,7 +1787,13 @@ void tnsui_Material(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, l
     if(!context){
         laShowLabel(uil,cl,"Name",0,0); laShowItem(uil,cr,This,"name");
     }
-    laShowLabel(uil,cl,"Color",0,0);
+    b=laBeginRow(uil,cl,0,0);
+    laShowLabel(uil,cl,"Color",0,0)->Expand=1;
+    b1=laOnConditionThat(uil,cl,laOr(laPropExpression(This,"shader_page.racks"),
+                                    laPropExpression(This,"shader_page.use_script")));{
+        laShowLabel(uil,cl,"🎨",0,0);
+    }laEndCondition(uil,b1);
+    laEndRow(uil,b);
     laShowItemFull(uil,cr,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_COLORFUL;
     laShowItemFull(uil,cr,This,"colorful",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0);
 }
@@ -1796,15 +1802,23 @@ void tnsui_MaterialListItem(laUiList *uil, laPropPack *This, laPropPack *UNUSED_
     b=laBeginRow(uil,c,0,0);
     laShowItemFull(uil,c,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON;
     laUiItem* ui=laShowItem(uil,c,This,"name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
+    b1=laOnConditionThat(uil,c,laOr(laPropExpression(This,"shader_page.racks"),
+                                    laPropExpression(This,"shader_page.use_script")));{
+        laShowLabel(uil,c,"🎨",0,0);
+    }laEndCondition(uil,b1);
     laEndRow(uil,b);
 }
 void tnsui_MaterialSlot(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
-    laColumn* c=laFirstColumn(uil); laUiItem* b,*b1;
+    laColumn* c=laFirstColumn(uil); laUiItem* b,*b1,*b2;
     b1=laOnConditionThat(uil,c,laPropExpression(This,"material"));{
         b=laBeginRow(uil,c,0,0);
         laShowItemFull(uil,c,This,"material.color",LA_WIDGET_FLOAT_COLOR,0,0,0)
             ->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON|LA_UI_FLAGS_COLORFUL;
         laUiItem* ui=laShowItem(uil,c,This,"material.name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
+        b2=laOnConditionThat(uil,c,laOr(laPropExpression(This,"material.shader_page.racks"),
+                                    laPropExpression(This,"material.shader_page.use_script")));{
+            laShowLabel(uil,c,"🎨",0,0);
+        }laEndCondition(uil,b2);
         laEndRow(uil,b);
     }laElse(uil,b1);{
         laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_DISABLED;