*/}}

la_templates.c 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073
  1. /*
  2. * LaGUI: A graphical application framework.
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "../la_5.h"
  19. extern LA MAIN;
  20. extern struct _tnsMain *T;
  21. extern const char* LA_UDF_EXTENSION_STRINGS[];
  22. int laget_InstanceModified(void* instance);
  23. void laget_TimeString(laTimeInfo *ti, char *result, char** resultdirect);
  24. void laui_DefaultPropDetails(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  25. laColumn *c;
  26. laUiItem *b;
  27. c = laFirstColumn(uil);
  28. laSafeString* s=0;
  29. if(Extra&&Extra->EndInstance){ //button
  30. laGeneralUiExtraData* ex=Extra->EndInstance;
  31. laUiItem* ui=ex->ui;
  32. if(This&&This->LastPs&&This->EndInstance){
  33. laProp* p=This->LastPs->p; laPropContainer* pc=p->Container; void* inst=This->LastPs->UseInstance;
  34. char FullPath[256]={0}; la_GetPropPackFullPath(This, FullPath);
  35. strSafePrint(&s,"%s", FullPath); if(ui->ExtraInstructions){ strSafePrint(&s,"(%s)", ui->ExtraInstructions->Ptr); }
  36. laShowLabel(uil,c,p->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  37. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  38. }else{
  39. laShowLabel(uil,c,ui->AT->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  40. strSafePrint(&s,"%s", ui->AT->Identifier); if(ui->ExtraInstructions){ strSafePrint(&s,"(%s)", ui->ExtraInstructions->Ptr); }
  41. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  42. }
  43. }else{
  44. if(!This || !This->LastPs){ laShowLabel(uil,c,"Can't access property details.",0,0); return; }
  45. char FullPath[256]={0}; la_GetPropPackFullPath(This, FullPath);
  46. laProp* p=This->LastPs->p; laPropContainer* pc=p->Container; void* inst=This->LastPs->UseInstance;
  47. laShowLabel(uil,c,p->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  48. if(p->PropertyType==(LA_PROP_ENUM)||(LA_PROP_ARRAY|LA_PROP_ENUM)){
  49. laEnumItem* ei=laGetEnumArrayIndexed(This,This->LastIndex);
  50. if(ei){ strSafeSet(&s,0);strSafePrint(&s,"Current: %s", ei->Description);laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_TEXT_LINE_WRAP; }
  51. }
  52. laShowLabel(uil,c,FullPath,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  53. if(inst && !pc->OtherAlloc){
  54. laShowSeparator(uil,c); strSafeSet(&s,0); strSafePrint(&s,"[ %s ]", pc->Name?pc->Name:pc->Identifier, inst);
  55. int Level=0; laMemNodeHyper* m=memGetHead(inst,&Level);
  56. laListHandle* users=memGetUserList(inst);
  57. if(users){ strSafePrint(&s," %d Users", lstCountElements(users)); }
  58. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  59. if(Level==2){
  60. strSafeSet(&s,0);strSafePrint(&s, m->NUID.String);
  61. if(laget_InstanceModified(inst)){ strSafePrint(&s, " 🌑 Modified"); }else{ strSafePrint(&s, " Clean"); }
  62. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  63. laget_TimeString(&m->TimeCreated, FullPath, 0);
  64. strSafeSet(&s,0); strSafePrint(&s, "Created at %s", FullPath);
  65. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  66. }
  67. if(m){
  68. if(Level==2){
  69. laShowSeparator(uil,c);
  70. if(m->FromFile){
  71. //strSafeSet(&s,0); strSafePrint(&s,"File:\n%s", m->FromFile->BaseName);
  72. //laShowLabel(uil,c,s->Ptr,0,0);
  73. char safepath[256]; strEscapePath(safepath, m->FromFile->BaseName->Ptr);
  74. strSafeSet(&s,0); strSafePrint(&s,"la.managed_udfs@basename=%s.__self", safepath);
  75. laShowItemFull(uil,c,0,s->Ptr,0,0,laui_ManagedUDFItem,0)->Flags|=LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL;
  76. }else{
  77. laShowLabel(uil,c,"<Not saved yet>",0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  78. }
  79. }
  80. }
  81. }
  82. }
  83. strSafeDestroy(&s);
  84. }
  85. void laui_DefaultNodeOperationsPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  86. laColumn *c = laFirstColumn(uil); laColumn* cl,*cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  87. laShowItemFull(uil, c, This, "base.name",LA_WIDGET_STRING_PLAIN,0,0,0);
  88. laShowItemFull(uil, cl, This, "base.move",0,"direction=left;text=Move Left;icon=🡰;",0,0);
  89. laShowItemFull(uil, cr, This, "base.move",0,"text=Move Right;icon=🡲;",0,0);
  90. laShowItemFull(uil, c, This, "base.delete",0,0,0,0);
  91. }
  92. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  93. laColumn *c;
  94. laProp *p, *gp;
  95. if (OperatorProps && OperatorProps->LastPs){
  96. c = laFirstColumn(uil); gp = OperatorProps->LastPs->p;
  97. for (p = gp->SubProp->Props.pFirst; p; p = p->Item.pNext){
  98. if(p->PropertyType!=LA_PROP_OPERATOR) continue;
  99. laShowItem(uil, c, OperatorProps, p->Identifier);
  100. }
  101. }
  102. if (!This || !This->LastPs) return;
  103. c = laFirstColumn(uil); gp = This->LastPs->p;
  104. for (p = gp->SubProp->Props.pFirst; p; p = p->Item.pNext){
  105. //la_ShowGeneralPropItem(uil, c, This, gp, p, 0, 0, 0);
  106. laShowItem(uil, c, This, p->Identifier);
  107. }
  108. }
  109. void laui_StringPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  110. laColumn *c;
  111. laProp *p, *gp;
  112. if (!This || !This->LastPs) return;
  113. c = laFirstColumn(uil);
  114. gp = This->LastPs->p;
  115. if(Extra){
  116. laShowItem(uil, c, Extra, "copy_selection");
  117. }else{
  118. laShowItem(uil, c, This, "copy");
  119. }
  120. laShowItem(uil, c, This, "paste");
  121. laShowItem(uil, c, This, "restore");
  122. if(gp->Tag&LA_PROP_IS_FILE){ laShowItem(uil, c, This, "get_file_path"); }
  123. if(gp->Tag&LA_PROP_IS_FOLDER){ laShowItem(uil, c, This, "get_folder_path"); }
  124. }
  125. void laui_IdentifierOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  126. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  127. laUiItem *ui;
  128. c = laFirstColumn(uil);
  129. laShowItemFull(uil, c, This, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  130. }
  131. void laRebuildPathRecursive(laProp *p, char *buf){
  132. if (p->Container){
  133. laRebuildPathRecursive(p->Container, buf);
  134. sprintf(buf, ".%s", p->Identifier);
  135. }else
  136. sprintf(buf, "%s", p->Identifier);
  137. }
  138. void laui_IntPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  139. laColumn *col, *cl, *cr;
  140. laUiItem *b1,*b2;
  141. laUiList *tuil;
  142. col = laFirstColumn(uil);
  143. laSplitColumn(uil, col, 0.2);
  144. cl = laLeftColumn(col, 1);
  145. cr = laRightColumn(col, 0);
  146. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  147. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  148. for(laProp* p=MAIN.ContainerInt->Props.pFirst;p;p=p->Item.pNext){
  149. laShowItem(uil,cr,Base,p->Identifier);
  150. }
  151. }laEndCondition(uil,b1);
  152. }
  153. void laui_FloatPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  154. laColumn *col, *cl, *cr;
  155. laUiItem *b1,*b2;
  156. laUiList *tuil;
  157. col = laFirstColumn(uil);
  158. laSplitColumn(uil, col, 0.2);
  159. cl = laLeftColumn(col, 1);
  160. cr = laRightColumn(col, 0);
  161. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  162. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  163. for(laProp* p=MAIN.ContainerFloat->Props.pFirst;p;p=p->Item.pNext){
  164. laShowItem(uil,cr,Base,p->Identifier);
  165. }
  166. }laEndCondition(uil,b1);
  167. }
  168. void laui_SubPropInfoDefault(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  169. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  170. laUiItem *bracket, *b1, *b2;
  171. laPropContainer *pc;
  172. laProp *p;
  173. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  174. c = laFirstColumn(uil);
  175. laSplitColumn(uil, c, 0.2); cl = laLeftColumn(c, 1); cr = laRightColumn(c, 0);
  176. laSplitColumn(uil, cr, 0.5); crrl = laLeftColumn(cr, 1*6); crrr = laRightColumn(cr, 0);
  177. laPropContainer* subc=Base->LastPs->p->SubProp;
  178. if (!((laSubProp*)Base->LastPs->p)->GetType){
  179. if (!subc) subc = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  180. if (!subc) return; Base->LastPs->p->SubProp=subc;
  181. }else{
  182. subc=((laSubProp*)Base->LastPs->p)->GetType(Base->EndInstance);
  183. }
  184. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  185. laShowItem(uil, cr, Base, "identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  186. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  187. }
  188. for (p = subc->Props.pFirst; p; p = p->Item.pNext){
  189. if (!(p->PropertyType & LA_PROP_SUB)){
  190. buf[0] = 0;
  191. sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  192. laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN,0, 0, 0);
  193. laShowItem(uil, crrr, Base, p->Identifier);
  194. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crl, 0, buf, 0, laui_SubPropInfoDefault, 0);
  195. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.description", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crr, 0, buf, 0, laui_SubPropInfoDefault, 0);
  196. laShowSeparator(uil, c);
  197. }else{
  198. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  199. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crl, 0, buf, 0, laui_SubPropInfoDefault, 0);
  200. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.description", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crr, 0, buf, 0, laui_SubPropInfoDefault, 0);
  201. if (p->UDFIsRefer) laShowLabel(uil, crrr, "🠞", 0, 0);
  202. elif (p->UDFNoCreate) laShowLabel(uil, crrr, "n", 0, 0);
  203. else laShowLabel(uil, crrr, "🗇", 0, 0);
  204. buf[0] = 0;
  205. sprintf(buf, "la.prop_containers#%s.icon_id", ((laSubProp *)p)->TargetID);
  206. laShowIcon(uil, cl, 0, buf, 0);
  207. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{ b1->Flags|=LA_TEXT_ALIGN_LEFT;
  208. sprintf(buf, "text=...%s;", p->Name);
  209. strSafeSet(&b1->ExtraInstructions, buf);
  210. laUiDefineFunc f=laui_SubPropInfoDefault;
  211. //if(!context) f=((laSubProp*)p)->GetType?0:(p->UiDefine?p->UiDefine:(p->SubProp&&p->SubProp->UiDefine?p->SubProp->UiDefine:laui_SubPropInfoDefault));
  212. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, f, context);
  213. }
  214. laEndCondition(uil, b1);
  215. laShowSeparator(uil, c);
  216. }
  217. }
  218. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  219. laEndCondition(uil, bracket);
  220. }
  221. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  222. //p = Base->LastPs->p->SubProp->Props.pFirst;
  223. }
  224. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  225. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  226. laUiItem *bracket, *b1, *b2;
  227. laPropContainer *pc;
  228. laProp *p;
  229. laPropPack *pp;
  230. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  231. c = laFirstColumn(uil);
  232. laSplitColumn(uil, c, 0.2);
  233. cl = laLeftColumn(c, 1);
  234. cr = laRightColumn(c, 0);
  235. laSplitColumn(uil, cr, 0.8);
  236. crl = laLeftColumn(cr, 0);
  237. crr = laRightColumn(cr, 100);
  238. laSplitColumn(uil, crl, 0.5);
  239. crrl = laLeftColumn(crl, 150);
  240. crrr = laRightColumn(crl, 0);
  241. if (!Base->LastPs->p->SubProp) Base->LastPs->p->SubProp = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  242. if (!Base->LastPs->p->UDFIsRefer){
  243. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  244. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  245. }
  246. for (p = Base->LastPs->p->SubProp->Props.pFirst; p; p = p->Item.pNext){
  247. if (p->PropertyType == LA_PROP_SUB){
  248. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  249. //laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  250. buf[0] = 0;
  251. sprintf(buf, "identifier=%s;", p->Identifier);
  252. laShowItemFull(uil, crrr, Base, "put_data_block", 0, buf, 0, 0);
  253. //laShowLabel(uil, crr, "PUT", 0, 0);
  254. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{
  255. buf[0] = 0; sprintf(buf, "text=...%s;", p->Name); strSafeSet(&b1->ExtraInstructions, buf);
  256. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, laui_SubPropSelection, 0)->Flags|=LA_TEXT_ALIGN_LEFT;
  257. }
  258. laEndCondition(uil, b1);
  259. laShowSeparator(uil, c);
  260. }
  261. }
  262. if (!Base->LastPs->p->UDFIsRefer){
  263. laEndCondition(uil, bracket);
  264. }
  265. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  266. //p = Base->LastPs->p->SubProp->Props.pFirst;
  267. }
  268. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  269. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  270. laUiItem *bracket, *b1, *b2;
  271. laPropContainer *pc;
  272. laProp *p;
  273. laPropPack *pp;
  274. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  275. c = laFirstColumn(uil);
  276. laSplitColumn(uil, c, 0.4);
  277. cl = laLeftColumn(c, 1);
  278. cr = laRightColumn(c, 0);
  279. b1=laBeginRow(uil,cr,0,0);
  280. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  281. laShowIcon(uil, cr, Base, "pp.last_ps.property.sub_icon_id", 0);
  282. laEndRow(uil,b1);
  283. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  284. laShowItemFull(uil, cr, Base, "instances", 0,0, laui_LinkerSelectionInstance, 0);
  285. }
  286. bracket->State=LA_BT_ACTIVE;
  287. laEndCondition(uil, bracket);
  288. }
  289. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  290. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  291. laUiItem *bracket, *b1, *b2;
  292. laPropContainer *pc;
  293. laProp *p;
  294. laPropPack *pp;
  295. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  296. c = laFirstColumn(uil);
  297. laSplitColumn(uil, c, 0.4);
  298. cl = laLeftColumn(c, 1);
  299. cr = laRightColumn(c, 0);
  300. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  301. b1 = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  302. laShowItemFull(uil, cr, Base, "children", 0,0, laui_LinkerSelectionProp, 0);
  303. }
  304. laEndCondition(uil, b1);
  305. }
  306. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header){
  307. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *cb1, *cb2, *cb3;
  308. laUiItem *bracket, *b1, *b2;
  309. c = laFirstColumn(uil);
  310. laSplitColumn(uil, c, 0.3);
  311. cl = laLeftColumn(c, 1);
  312. cr = laRightColumn(c, 0);
  313. b1=laBeginRow(uil,cr,0,0);
  314. laUiItem* tu=laShowItemFull(uil, cr, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  315. laShowItem(uil, cr, Base, "hide")->Flags|=LA_UI_FLAGS_ICON;
  316. laShowItem(uil, cr, Base, "dock")->Flags|=LA_UI_FLAGS_ICON;
  317. laShowItem(uil, cr, Base, "close")->Flags|=LA_UI_FLAGS_ICON;
  318. laEndRow(uil,b1);
  319. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  320. if(!Extra->LastPs->p->SubProp->Props.pFirst){
  321. laShowLabel(uil, cr, "Panel doesn't have configurable property.", 0, 0);
  322. }else{
  323. if(header){
  324. laShowLabel(uil, cr, "Panel properties:", 0, 0);
  325. header(uil, Base, Extra, cr, 0);
  326. }else{
  327. for(laProp* p = Extra->LastPs->p->SubProp->Props.pFirst;p;p=p->Item.pNext){
  328. if(p->PropertyType&LA_PROP_SUB){
  329. laShowItemFull(uil, cr, Extra, p->Identifier, LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  330. }else{ laShowItem(uil, cr, Extra, p->Identifier); }
  331. }
  332. }
  333. }
  334. //laShowItem(uil, cr, 0,"la.example_int");
  335. laShowSeparator(uil, c);
  336. //laShowLabel(uil, c, "Position:", 0, 0);
  337. //laShowItemFull(uil, c, Base, "position", LA_WIDGET_INT, 0, 0);
  338. //laShowLabel(uil, c, "Size:", 0, 0);
  339. //laShowItemFull(uil, c, Base, "size", LA_WIDGET_INT, 0, 0);
  340. //laShowLabel(uil, c, "Snapping:", 0, 0);
  341. //laShowItem(uil, c, Base, "snap_enable")->Flags=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_TRANSPOSE;
  342. //laShowItemFull(uil, c, Base, "snap", LA_WIDGET_INT, 0, 0);
  343. }
  344. laEndCondition(uil, bracket);
  345. }
  346. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  347. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr;
  348. laUiItem *bracket, *b1, *b2;
  349. c = laFirstColumn(uil);
  350. b1 = laBeginRow(uil,c,0,0);
  351. laUiItem* tu=laShowItemFull(uil, c, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  352. laShowItem(uil, c, 0, "LA_cancel");//->Flags|=LA_UI_FLAGS_ICON;
  353. laEndRow(uil, b1);
  354. }
  355. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  356. laColumn *c0, *c, *cl, *cr, *cll, *clr, *crl, *crr, *clll, *cllr, *cll2, *clr2;
  357. laUiItem *bracket, *b1, *b2;
  358. c0 = laFirstColumn(uil);
  359. laSplitColumn(uil, c0, 0.8);
  360. cll = laLeftColumn(c0, 80);
  361. c = laRightColumn(c0, 0);
  362. laSplitColumn(uil, c, 0.7);
  363. cl = laLeftColumn(c, 0);
  364. cr = laRightColumn(c, 200);
  365. laSplitColumn(uil, cr, 0.5);
  366. crl = laLeftColumn(cr, 0);
  367. crr = laRightColumn(cr, 70);
  368. laSplitColumn(uil, cll, 0.5);
  369. clll = laLeftColumn(cll, 1);
  370. cllr = laRightColumn(cll, 0);
  371. laSplitColumn(uil, cl, 0.5);
  372. cll2 = laLeftColumn(cl, 0);
  373. clr2 = laRightColumn(cl, 70);
  374. //laShowItem(uil, c, Base, "self");
  375. bracket = laOnConditionThat(uil, crr, laPropExpression(0, "live_editor.current_ui")); // laOnConditionThat(uil, 0, "live_editor", la_LiveEditAllowShow);
  376. laShowItemFull(uil, cll, Base, "select_column", 0, "text=Select;", 0, 0);
  377. laEndCondition(uil, bracket);
  378. bracket = laOnConditionThat(uil, c, laPropExpression(Base, "sub_left"));{ //laOnConditionThat(uil, Base, 0, laui_SnapButtonShow); {
  379. laShowItem(uil, cll2, Base, "split_at");
  380. laShowItemFull(uil, clr2, Base, "merge_column", 0, "text=Merge;", 0, 0);
  381. b1 = laOnConditionThat(uil, c, laPropExpression(Base, "snap_state"));{
  382. laShowItem(uil, crl, Base, "snap_width");
  383. }
  384. laElse(uil, b1);{
  385. laShowLabel(uil, crl, "Align:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  386. }
  387. laEndCondition(uil, b1);
  388. laShowItem(uil, crr, Base, "snap_state");
  389. laShowSeparator(uil, c0);
  390. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  391. laShowItemFull(uil, c, Base, "sub_left", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  392. }
  393. laElse(uil, b1);{
  394. laShowLabel(uil, cllr, "Left", 0, 0);
  395. }
  396. laEndCondition(uil, b1);
  397. laShowSeparator(uil, c0);
  398. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  399. laShowItemFull(uil, c, Base, "sub_right", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  400. }
  401. laElse(uil, b1);{
  402. laShowLabel(uil, cllr, "Right", 0, 0);
  403. }
  404. laEndCondition(uil, b1);
  405. }
  406. laElse(uil, bracket);{
  407. laShowItem(uil, c, Base, "split_column");
  408. }
  409. laEndCondition(uil, bracket);
  410. }
  411. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  412. laColumn* c=laFirstColumn(uil);
  413. laShowLabel(uil, c, "Function Test", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  414. laShowItem(uil, c, 0, "LA_pure_yes_no");
  415. laShowItem(uil, c, 0, "LA_file_dialog");
  416. laShowItem(uil, c, 0, "LA_udf_read");
  417. laShowItemFull(uil, c, 0, "LA_udf_read",0,"mode=append;text=Append",0,0);
  418. laShowItem(uil, c, 0, "LA_managed_save");
  419. laShowItem(uil, c, 0, "LA_manage_udf");
  420. laShowLabel(uil, c, "Other Entries", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  421. laShowItem(uil, c, 0, "LA_terminate_program");
  422. }
  423. void laui_DefaultMenuButtonsEditEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  424. laColumn* c=laFirstColumn(uil);
  425. laShowLabel(uil, c, "History", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  426. laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  427. laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  428. laShowSeparator(uil,c);
  429. laShowItemFull(uil, c, 0, "LA_panel_activator",0,"panel_id=LAUI_histories;text=Histories",0,0);
  430. }
  431. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  432. laColumn* c=laFirstColumn(uil);
  433. laShowLabel(uil, c, "Settings", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  434. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_user_preferences;", 0, 0);
  435. laShowLabel(uil, c, "Information", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  436. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_about;text=About;", 0, 0);
  437. }
  438. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  439. laUiList *muil; laColumn *mc,*c = laFirstColumn(uil);
  440. muil = laMakeMenuPage(uil, c, "File");{
  441. mc = laFirstColumn(muil); laui_DefaultMenuButtonsFileEntries(muil,pp,actinst,extracol,0);
  442. }
  443. if(MAIN.InitArgs.HasHistories){
  444. muil = laMakeMenuPage(uil, c, "Edit");{
  445. mc = laFirstColumn(muil); laui_DefaultMenuButtonsEditEntries(muil,pp,actinst,extracol,0);
  446. }
  447. }
  448. muil = laMakeMenuPage(uil, c, "Options"); {
  449. mc = laFirstColumn(muil); laui_DefaultMenuButtonsOptionEntries(muil,pp,actinst,extracol,0);
  450. }
  451. }
  452. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  453. laColumn *c = laFirstColumn(uil);
  454. laShowLabel(uil, c, MAIN.MenuProgramName, 0, 0)->Expand=1;
  455. }
  456. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  457. laUiList *muil;
  458. laColumn *c,*mc;
  459. laUiItem* bb;
  460. c = laFirstColumn(uil);
  461. laUiItem* row=laBeginRow(uil,c,0,0);
  462. bb=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.operator_hints"));{
  463. laShowItem(uil,c,0,"la.windows.operator_hints");
  464. }laElse(uil,bb);{
  465. laShowItem(uil, c, 0, "LA_new_panel")->Flags=LA_UI_FLAGS_ICON;
  466. if(MAIN.MenuButtons){ MAIN.MenuButtons(uil,0,0,0,0); }
  467. laShowSeparator(uil,c);
  468. laUiItem* mui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_ui"));{
  469. laShowItemFull(uil,c,0,"LA_canvas_ui_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  470. }laElse(uil,mui);{
  471. laUiItem* ui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_block"));{
  472. laShowItemFull(uil,c,0,"LA_block_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  473. }laElse(uil,ui);{
  474. laShowItemFull(uil, c, 0, "LA_switch_layout", 0, "icon=🞐;show_list=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  475. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡰;reverse=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  476. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡲;", 0,0)->Flags|=LA_UI_FLAGS_ICON;
  477. laShowItem(uil, c, 0, "la.windows.layouts.identifier");
  478. laShowItem(uil,c,0,"LA_new_window")->Flags|=LA_UI_FLAGS_ICON;
  479. }laEndCondition(uil, ui);
  480. }laEndCondition(uil,mui);
  481. laUiItem* uc=laOnConditionThat(uil,c,laPropExpression(0,"la.user_preferences.enable_color_management"));{
  482. laShowSeparator(uil,c);
  483. laShowItem(uil,c,0,"la.windows.output_color_space");
  484. laShowItemFull(uil,c,0,"la.windows.output_show_overflow",0,"text=🟩;",0,0);
  485. laShowItemFull(uil,c,0,"la.windows.use_composing",0,"text=☀",0,0);
  486. laUiItem* cmp=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.use_composing"));{
  487. muil = laMakeMenuPage(uil, c, "⯆");{ mc = laFirstColumn(muil);
  488. laUiItem*b,*ui;
  489. b=laBeginRow(muil,mc,0,0); laShowLabel(muil,mc,"γ",0,0);
  490. ui=laShowItem(muil, mc, 0, "la.windows.composing_gamma"); ui->Expand=1;
  491. laShowItem(muil,mc,&ui->PP,"restore")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON; laEndRow(muil,b);
  492. b=laBeginRow(muil,mc,0,0); laShowLabel(muil,mc,"◩",0,0);
  493. ui=laShowItem(muil, mc, 0, "la.windows.composing_blackpoint"); ui->Expand=1;
  494. laShowItem(muil,mc,&ui->PP,"restore")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON; laEndRow(muil,b);
  495. }
  496. }laEndCondition(uil, cmp);
  497. }laEndCondition(uil, uc);
  498. if(MAIN.MenuExtras){ laShowSeparator(uil,c); MAIN.MenuExtras(uil,0,0,0,0); }
  499. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.panels_hidden"));
  500. laShowSeparator(uil,c);
  501. muil = laMakeMenuPage(uil, c, "🡻 Minimized");{
  502. mc = laFirstColumn(muil);
  503. laShowItemFull(muil, mc, 0, "la.windows.panels_hidden", 0,0, laui_IdentifierOnly,0);
  504. }
  505. laEndCondition(uil, b1);
  506. b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.is_fullscreen"));{
  507. laShowItemFull(uil,c,0,"LA_fullscreen",0,"restore=true;text=Restore;icon=🡷",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  508. }laElse(uil,b1);{
  509. laShowItemFull(uil,c,0,"LA_fullscreen",0,0,0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  510. }laEndCondition(uil, b1);
  511. }laEndCondition(uil,bb);
  512. laEndRow(uil,row);
  513. }
  514. void laui_DefaultMenuBar(laWindow *w){
  515. laPanel *p;
  516. p =laCreateTopPanel(w, 0, 0, 0, 0, LA_RH, 0, 0, 0, 0, -1, -1, -1, 0);
  517. p->IsMenuPanel = 1;
  518. laui_DefaultMenuBarActual(&p->TitleBar, &p->PP, &p->PropLinkPP, 0, 0);
  519. }
  520. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  521. laColumn *col, *cl, *cr;
  522. laUiItem *bracket;
  523. col = laFirstColumn(uil);
  524. bracket = laBeginRow(uil,col,0,0);
  525. laShowItemFull(uil, col, Base, "name", LA_WIDGET_STRING_PLAIN,0, 0, 0)->Expand=1;
  526. laShowItemFull(uil, col, Base, "author", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  527. laEndRow(uil,bracket);
  528. }
  529. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  530. laColumn *col, *cl, *cr, *cll, *clr;
  531. laUiItem *sui;
  532. laUiList *tuil;
  533. laUiItem *ui;
  534. //col = laFirstColumn(uil);
  535. //tuil = laMakeGroup(uil, col, "����ժҪ", 0, 0)->Page; {
  536. // col = laFirstColumn(tuil);
  537. // laSplitColumn(tuil, col, 0.7);
  538. // cl = laLeftColumn(col, 0);
  539. // cr = laRightColumn(col, 0);
  540. // laSplitColumn(tuil, cr, 0.6);
  541. // crl = laLeftColumn(cr, 0);
  542. // crr = laRightColumn(cr, 70);
  543. // laShowItemFull(tuil, cl, 0, "themes.name", 0, 0, 0);
  544. // laShowItemFull(tuil, crl, 0, "themes.author", 0, 0, 0);
  545. // laShowLabel(tuil, crr, 0, "EXEC", 0, 0, 0);
  546. //}
  547. col = laFirstColumn(uil); laSplitColumn(uil,col,0.5);
  548. cl=laLeftColumn(col,0); cr=laRightColumn(col,0);
  549. ui=laBeginRow(uil,col, 0,0);
  550. laShowItem(uil,col,Base, "delete");
  551. laShowItem(uil,col,Base, "name")->Expand=1;
  552. laEndRow(uil, ui);
  553. laShowLabel(uil, col, "Basics:",0,0);
  554. laShowLabel(uil, cl, "Base Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "color");
  555. laShowLabel(uil, cl, "Accent Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "accent_color");
  556. laShowItem(uil, cr, Base, "cursor_alpha");
  557. laShowItem(uil, cr, Base, "selection_alpha");
  558. laShowItem(uil, cr, Base, "inactive_mix");
  559. laShowItem(uil, cr, Base, "inactive_saturation");
  560. laShowLabel(uil, col, "Nodes:",0,0);
  561. laShowItem(uil, cr, Base, "wire_brightness");
  562. laShowItem(uil, cr, Base, "wire_saturation");
  563. laShowItem(uil, cr, Base, "wire_transparency");
  564. laShowLabel(uil, col, "Meshes:",0,0);
  565. laShowItem(uil, cl, Base, "edge_transparency");
  566. laShowItem(uil, cl, Base, "edge_brightness");
  567. laShowItem(uil, cr, Base, "vertex_transparency");
  568. laShowItem(uil, cr, Base, "vertex_brightness");
  569. laShowItem(uil, col, Base, "svertex_transparency");
  570. laShowItem(uil, col, Base, "sedge_transparency");
  571. laShowItem(uil, col, Base, "sface_transparency");
  572. laShowLabel(uil, col, "Widgets:",0,0);
  573. laShowItem(uil, col, Base, "boxed_themes")->Flags|=(LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP);
  574. }
  575. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  576. laColumn *col, *cl, *cr, *crl,*crr;
  577. laUiItem *bracket;
  578. laUiList *tuil;
  579. col = laFirstColumn(uil);
  580. laSplitColumn(uil, col, 0.8);
  581. cl = laLeftColumn(col, 1);
  582. cr = laRightColumn(col, 0);
  583. laSplitColumn(uil, cr, 0.5);
  584. crl = laLeftColumn(cr, 0);
  585. crr = laRightColumn(cr, 0);
  586. laShowItemFull(uil, cr, Base, "name", LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  587. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  588. laShowItem(uil, cr, Base, "normal");
  589. laShowItem(uil, cr, Base, "active");
  590. laShowItem(uil, cr, Base, "border");
  591. laShowItem(uil, cr, Base, "text");
  592. laShowItem(uil, cr, Base, "text_active");
  593. laShowItem(uil, cr, Base, "alpha");
  594. laShowLabel(uil,crl,"Margins:",0,0);
  595. laShowItem(uil, crl, Base, "margins")->Flags=LA_UI_FLAGS_TRANSPOSE;
  596. laShowLabel(uil,crr,"Paddings:",0,0);
  597. laShowItem(uil, crr, Base, "paddings")->Flags=LA_UI_FLAGS_TRANSPOSE;
  598. }
  599. laEndCondition(uil, bracket);
  600. }
  601. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  602. laColumn *col, *cl, *cr, *crl, *crr, *cll, *clr, *crrl, *crrr;
  603. laUiItem *bracket;
  604. laUiList *tuil;
  605. col = laFirstColumn(uil);
  606. laSplitColumn(uil, col, 0.5);
  607. cl = laLeftColumn(col, 60);
  608. cr = laRightColumn(col, 0);
  609. laSplitColumn(uil, cr, 0.25);
  610. crl = laLeftColumn(cr, 0);
  611. crr = laRightColumn(cr, 0);
  612. laSplitColumn(uil, crr, 0.3);
  613. crrl = laLeftColumn(crr, 0);
  614. crrr = laRightColumn(crr, 0);
  615. laShowLabel(uil, cl, "Select", 0, 0);
  616. laShowLabel(uil, crl, "Identifier", 0, 0);
  617. laShowLabel(uil, crrl, "Name", 0, 0);
  618. laShowLabel(uil, crrr, "Description", 0, 0);
  619. laShowColumnAdjuster(uil, col);
  620. laShowItem(uil, col, Base, "properties");
  621. }
  622. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  623. laColumn *col, *cl, *cr, *cll, *clr;
  624. laUiItem *bracket;
  625. laUiList *tuil;
  626. cl = laFirstColumn(uil);
  627. laSplitColumn(uil, cl, 0.2);
  628. cll = laLeftColumn(cl, 1);
  629. clr = laRightColumn(cl, 0);
  630. laShowItem(uil, clr, Base, "title");
  631. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  632. laShowLabel(uil, clr, "Layouts", 0, 0);
  633. laShowItem(uil, clr, Base, "layouts");
  634. laShowLabel(uil, clr, "TopPanels", 0, 0);
  635. laShowItem(uil, clr, Base, "panels");
  636. }
  637. laEndCondition(uil, bracket);
  638. }
  639. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  640. laColumn *col, *cl, *cr, *cll, *clr;
  641. laUiItem *bracket;
  642. laUiList *tuil;
  643. cl = laFirstColumn(uil);
  644. laSplitColumn(uil, cl, 0.2);
  645. cll = laLeftColumn(cl, 1);
  646. clr = laRightColumn(cl, 0);
  647. laShowItem(uil, clr, Base, "title");
  648. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  649. laShowItem(uil, clr, Base, "panels");
  650. }
  651. laEndCondition(uil, bracket);
  652. }
  653. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  654. laColumn *col, *cl, *cr, *cll, *clr;
  655. laUiItem *bracket;
  656. laUiList *tuil;
  657. cl = laFirstColumn(uil);
  658. laSplitColumn(uil, cl, 0.2);
  659. cll = laLeftColumn(cl, 1);
  660. clr = laRightColumn(cl, 0);
  661. laShowItem(uil, clr, Base, "title");
  662. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  663. laShowItemFull(uil, clr, Base, "size", LA_WIDGET_INT,0, 0, 0);
  664. }
  665. laEndCondition(uil, bracket);
  666. }
  667. void laui_UiTemplateListItemLiveEdit(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  668. laColumn *col, *cl, *cr, *cll, *clr;
  669. laUiItem *bracket;
  670. laUiList *tuil;
  671. cl = laFirstColumn(uil);
  672. //bracket = laOnConditionThat(uil, cl, laNot(laPropExpression(Base, "for_panel"))); {
  673. bracket = laOnConditionThat(uil, cl, laAnd(laNot(laPropExpression(Base, "for_panel")), laOr(laNot(laPropExpression(Base, "target")), laEqual(laPropExpression(0, "live_editor.current_ui.prop_pack.last_ps.property.sub"), laPropExpression(Base, "target")))));{
  674. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  675. }
  676. laElse(uil, bracket);{
  677. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN, "disabled=true;",0, 0);
  678. }
  679. laEndCondition(uil, bracket);
  680. }
  681. void laui_UiTemplateListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  682. laColumn *col, *cl, *cr, *cll, *clr, *clll, *cllr, *clrl, *clrr, *clrrl, *clrrr;
  683. laUiItem *bracket, *b1;
  684. laUiList *tuil;
  685. cl = laFirstColumn(uil);
  686. laSplitColumn(uil, cl, 0.2);
  687. cll = laLeftColumn(cl, LA_2RH);
  688. clr = laRightColumn(cl, 0);
  689. laSplitColumn(uil, cll, 0.5);
  690. clll = laLeftColumn(cll, 0);
  691. cllr = laRightColumn(cll, 0);
  692. laSplitColumn(uil, clr, 0.5);
  693. clrl = laLeftColumn(clr, 0);
  694. clrr = laRightColumn(clr, 200);
  695. laSplitColumn(uil, clrr, 0.2);
  696. clrrl = laLeftColumn(clrr, 1);
  697. clrrr = laRightColumn(clrr, 0);
  698. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "define_func"));{
  699. laShowLabel(uil, clll, "f", 0, 0);
  700. }
  701. laEndCondition(uil, bracket);
  702. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "descriptor"));{
  703. laShowLabel(uil, cllr, "🠞", 0, 0);
  704. }
  705. laEndCondition(uil, bracket);
  706. laShowItemFull(uil, clrl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  707. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "target_id"));{
  708. laShowIcon(uil, clrrl, Base, "target.icon_id", 0);
  709. laShowItemFull(uil, clrrr, Base, "target_id", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  710. }
  711. laElse(uil, bracket);{
  712. b1 = laOnConditionThat(uil, cll, laPropExpression(Base, "for_panel"));{
  713. //laShowLabel(uil, clrrl, 0,, 0, 0);
  714. laShowLabel(uil, clrrr, "PANEL", 0, 0);
  715. }
  716. laElse(uil, b1);{
  717. laShowLabel(uil, clrrr, "-", 0, LA_WIDGET_STRING_PLAIN);
  718. }
  719. laEndCondition(uil, b1);
  720. }
  721. laEndCondition(uil, bracket);
  722. }
  723. void laui_PlainSceneListItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  724. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  725. laUiItem *ui;
  726. //if (Extra)c = Extra;
  727. c = laFirstColumn(uil);
  728. laShowItemFull(uil, c, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  729. }
  730. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  731. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  732. laUiList *u;
  733. laUiItem *b;
  734. laShowItemFull(uil, col, 0, "la", 0, 0, laui_SubPropSelection, 0);
  735. laShowItemFull(uil, col, 0, "tns", 0, 0, laui_SubPropSelection, 0);
  736. }
  737. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  738. laColumn *c = Extra, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  739. laUiItem *ui;
  740. laSplitColumn(0, c, 0.1);
  741. cll = laLeftColumn(c, 1);
  742. clr = laRightColumn(c, 0);
  743. laSplitColumn(0, clr, 0.7);
  744. clrl = laLeftColumn(clr, 0);
  745. clrr = laRightColumn(clr, 0);
  746. laSplitColumn(0, clrr, 0.5);
  747. clrrl = laLeftColumn(clrr, 0);
  748. clrrr = laRightColumn(clrr, 0);
  749. laShowItemFull(uil, cll, This, "type", LA_WIDGET_ENUM_ICON_PLAIN, 0, 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  750. //laShowItem(uil, cll, This, "is_folder");
  751. laShowItemFull(uil, clrl, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  752. ui = laOnConditionThat(uil, clrr, laNot(laPropExpression(This, "is_folder")));{
  753. laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  754. laShowItem(uil, clrrr, This, "size")->Flags|=LA_UI_FLAGS_NO_DECAL;
  755. }
  756. laEndCondition(uil, ui);
  757. //laShowSeparator(uil,cll)
  758. //laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0);
  759. //laShowItem(uil, clrrr, This, "size");
  760. }
  761. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  762. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr;
  763. laUiItem *ui;
  764. c = Extra;
  765. laSplitColumn(0, c, 0.2);
  766. cl = laLeftColumn(c, LA_2RH);
  767. cr = laRightColumn(c, 0);
  768. laSplitColumn(0, cr, 0.5);
  769. crl = laLeftColumn(cr, 0);
  770. crr = laRightColumn(cr, 0);
  771. //laShowColumnAdjuster(uil, c);
  772. laShowItemFull(uil, cl, This, "id", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  773. laShowItem(uil, crl, This, "total_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  774. laShowItem(uil, crr, This, "free_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  775. }
  776. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  777. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr, *ulc;
  778. laUiList *u; laUiItem *b; laUiList *ul;
  779. laSplitColumn(uil, col, 0.25);
  780. cl = laLeftColumn(col, 10);
  781. cr = laRightColumn(col, 0);
  782. laShowItemFull(uil, cl, Operator, "folder_up", LA_WIDGET_BUTTON_NO_CONFIRM, 0 ,0,0);
  783. laShowItem(uil, cr, Operator, "path")->Expand=1;
  784. laUiItem* r=laBeginRow(uil,cr,0,0);
  785. laShowItem(uil, cr, Operator, "file_name")->Expand=1;
  786. laShowItem(uil, cr, Operator, "confirm")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  787. laEndRow(uil,r);
  788. laShowSeparator(uil,col);
  789. laUiItem* left=laMakeEmptyGroup(uil, cl, "left", 0); ul=left->Page; left->Flags|=LA_UI_FLAGS_NO_DECAL; ul->HeightCoeff=-1;
  790. ulc=laFirstColumn(ul);
  791. b=laOnConditionThat(ul,ulc,laPropExpression(Operator,"use_type"));{
  792. u = laMakeGroup(ul, ulc, "Use Format", 0)->Page; c = laFirstColumn(u);
  793. laShowItemFull(u,c,Operator,"available_extensions",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  794. }laEndCondition(ul,b);
  795. u = laMakeFoldableGroup(ul, ulc, "Bookmarks", 0, 0, 0)->Page; c = laFirstColumn(u);
  796. laShowItemFull(u,c,Operator,"bookmarks",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  797. u = laMakeGroup(ul, ulc, "Logic Drives", 0)->Page;
  798. c = laFirstColumn(u); laSplitColumn(u, c, 0.2); cll = laLeftColumn(c, LA_2RH); clr = laRightColumn(c, 0);
  799. laSplitColumn(u, clr, 0.5); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  800. laShowColumnAdjuster(u, c);
  801. laShowItem(u, c, Operator, "disk_list");
  802. b = laMakeGroup(uil, cr, "File List", 0);b->State=LA_UI_ACTIVE; u=b->Page;
  803. u->HeightCoeff = -1;
  804. c = laFirstColumn(u); laSplitColumn(u, c, 0.1); cll = laLeftColumn(c, 1); clr = laRightColumn(c, 0);
  805. laSplitColumn(u, clr, 0.7); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  806. laSplitColumn(u, clrr, 0.5); clrrl = laLeftColumn(clrr, 0); clrrr = laRightColumn(clrr, 0);
  807. laShowColumnAdjuster(u, c);
  808. laShowLabel(u, clrl, "File Name", 0, 0);
  809. laShowLabel(u, clrrl, "Last Modified On", 0, 0);
  810. laShowLabel(u, clrrr, "File Size", 0, 0);
  811. laShowItem(u, c, Operator, "file_list")->Flags|=LA_UI_FLAGS_NO_DECAL;
  812. }
  813. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  814. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr, *gc;
  815. laUiList *gu;
  816. laUiItem *bracket, *b1, *b2;
  817. laPropContainer *pc;
  818. laProp *p;
  819. laPropPack *pp;
  820. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  821. c = laFirstColumn(uil);
  822. laSplitColumn(uil, c, 0.2);
  823. cl = laLeftColumn(c, 100);
  824. cr = laRightColumn(c, 0);
  825. laSplitColumn(uil, cr, 0.2);
  826. crl = laLeftColumn(cr, 1);
  827. crr = laRightColumn(cr, 0);
  828. gu = laMakeGroup(uil, c, " UDF File Content", 0)->Page;{
  829. gc = laFirstColumn(gu);
  830. laShowItem(gu, gc, OperatorInst, "root_nodes");
  831. }
  832. }
  833. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  834. laColumn *c=laFirstColumn(uil);
  835. laSplitColumn(uil,c,0.5);
  836. laColumn *cl=laLeftColumn(c, 1);
  837. laColumn *cr=laRightColumn(c,0);
  838. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(Base,"udf"));{
  839. laUiItem* r=laBeginRow(uil,c,0,0);
  840. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);strSafeSet(&b->ExtraInstructions,"text=🛈;");b->Flags|=LA_UI_FLAGS_PLAIN;{
  841. laShowItemFull(uil,c,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  842. }laElse(uil,b);{
  843. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  844. }laEndCondition(uil,b);
  845. laEndRow(uil, r);
  846. }laElse(uil,b2);{
  847. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  848. }laEndCondition(uil,b2);
  849. }
  850. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  851. laColumn *c=laFirstColumn(uil);
  852. laSplitColumn(uil,c,0.3);
  853. laColumn *cl=laLeftColumn(c, 1);
  854. laColumn *cr=laRightColumn(c,0);
  855. laUiItem* b1=laOnConditionThat(uil, cr, laPropExpression(Base, "udf"));{
  856. laShowItem(uil,cl,Base,"udf.modified");
  857. laUiItem* b=laBeginRow(uil,cr,0,0);
  858. laUiItem* b2=laOnConditionToggle(uil,cr,0,0,0,0,0);strSafeSet(&b2->ExtraInstructions,"text=🛈;");b2->Flags|=LA_UI_FLAGS_PLAIN;{
  859. laUiItem* ui=laShowItemFull(uil,cr,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);ui->Expand=1;strSafeSet(&ui->ExtraInstructions,"text=Change");
  860. laShowItem(uil,cr,&ui->PP,"get_file_path");
  861. }laElse(uil,b2);{
  862. laShowItemFull(uil,cr,Base,"basename", LA_WIDGET_STRING_PLAIN, 0 ,0,0)->Expand=1;
  863. }laEndCondition(uil,b2);
  864. laEndRow(uil, b);
  865. }laElse(uil,b1);{
  866. laShowItemFull(uil,cr,0,"LA_managed_save_new_file",0,"feedback=NONE;",0,0);
  867. }laEndCondition(uil,b1);
  868. }
  869. void laui_ManagedPropInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  870. if(!Base ||! Base->EndInstance ||Base->LastPs->p->PropertyType!=LA_PROP_SUB) return;
  871. laColumn *c=laFirstColumn(uil);
  872. laSplitColumn(uil,c,0.3); laColumn *cl=laLeftColumn(c, 1); laColumn *cr=laRightColumn(c,0);
  873. laSplitColumn(uil,cr,0.6); laColumn *crl=laLeftColumn(cr, 0); laColumn *crr=laRightColumn(cr,20);
  874. laPropContainer* pc=la_EnsureSubTarget(Base->LastPs->p, Base->EndInstance);
  875. if(pc->UDFPropagate){
  876. char buf[128]; sprintf(buf,"Assign all \"%s\" into:",pc->Name);
  877. laShowLabel(uil,crl,buf,0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED;
  878. laShowItem(uil,crr,Base,"__single_udf_propagate");
  879. laShowLabel(uil,cl," ",0,0);
  880. }
  881. if(pc->OtherAlloc || Base->LastPs->p->UDFIsSingle){
  882. //laShowLabel(uil,cr,"(Item not allocated by memAcquire)",0,0)->Expand=1;
  883. }else{
  884. if(pc->Hyper==2){
  885. laShowItem(uil,cl,Base,"__modified"); laSplitColumn(uil,crl,0.4); laColumn *crll=laLeftColumn(crl, 0); laColumn *crlr=laRightColumn(crl,20);
  886. laUiItem* idui=laShowItem(uil,crll,Base,"identifier");idui->Flags|=LA_UI_FLAGS_PLAIN;idui->Expand=1;
  887. laShowItem(uil,crlr,Base,"__uid")->Flags|=LA_UI_FLAGS_NO_DECAL;
  888. if(pc->UDFPropagate){
  889. laColumn *crrl,*crrr,*udfc,*optionc; laSplitColumn(uil,crr,0.7); crrl=laLeftColumn(crr,0); crrr=laRightColumn(crr,1);
  890. laSplitColumn(uil,crrl,0.3); udfc=laLeftColumn(crrl,0); optionc=laRightColumn(crrl,8);
  891. laUiItem* uc=laOnConditionToggle(uil,crrr,0,0,0,0,0);{ strSafeSet(&uc->ExtraInstructions,"text=⮯;");
  892. laShowItem(uil,udfc,Base,"__file");
  893. laUiItem* sr=laBeginRow(uil,optionc,1,0);
  894. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,"force=true;text=Force;",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  895. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,0,0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  896. laEndRow(uil,sr);
  897. }laElse(uil,uc);{
  898. laShowItem(uil,crrl,Base,"__file");
  899. }laEndCondition(uil,uc);
  900. }else{
  901. laShowItem(uil,crr,Base,"__file");
  902. }
  903. }else{
  904. //laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  905. }
  906. }
  907. for(laProp*p=pc->Props.pFirst;p;p=p->Item.pNext){
  908. if(p->PropertyType!=LA_PROP_SUB || p->UDFIsRefer) continue;
  909. la_EnsureSubTarget(p,0);
  910. if(p->SubProp &&p->SubProp->Hyper!=2 &&(!p->UDFIsSingle)) continue;
  911. if(p->UDFNoCreate || p->UDFHideInSave) continue;
  912. if(p==pc->SaverDummy){
  913. laShowItem(uil,cl,Base,"__single_saver_dummy.__modified");
  914. laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  915. laShowItem(uil,crr,Base,"__single_saver_dummy.__file");
  916. continue;
  917. }
  918. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);{ strSafePrint(&b->ExtraInstructions,"text=📦 %s;",p->Identifier);
  919. b->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_LEFT; b->State=LA_BT_ACTIVE;
  920. laShowItemFull(uil,cr,Base,p->Identifier,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  921. }laEndCondition(uil,b);
  922. }
  923. if(pc->UDFPropagate){
  924. laShowSeparator(uil,c);
  925. }
  926. }
  927. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  928. laColumn *c=laFirstColumn(uil),*cl,*cr,*cll,*clr;
  929. laPropPack PP={0}; if(!Base ||! Base->EndInstance) return;
  930. laManagedSaveProp* msp=Base->EndInstance;
  931. laSplitColumn(uil,c,0.6); cl=laLeftColumn(c,0); cr=laRightColumn(c,20);
  932. laSplitColumn(uil,cl,0.7); cll=laLeftColumn(cl,0); clr=laRightColumn(cl,0);
  933. laShowLabel(uil,cll,msp->Path->Ptr,0,0);
  934. laShowLabel(uil,clr,"UID",0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_ALIGN_CENTER;
  935. laShowLabel(uil,cr,"File",0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_ALIGN_CENTER;
  936. laShowItemFull(uil,c,0,msp->Path->Ptr,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  937. laShowSeparator(uil,c);
  938. }
  939. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *Operator, laColumn *ExtraColumns, int context){
  940. laManagedSaveExtra*mse=Operator->EndInstance;
  941. laColumn *c=laFirstColumn(uil);
  942. if(mse->OnExit){
  943. laShowLabel(uil,c,"You still have unsaved/unassigned datablocks:",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  944. laShowSeparator(uil,c);
  945. }
  946. laUiItem* r=laBeginRow(uil,c,0,0);
  947. laShowLabel(uil,c,"Viewing",0,0);
  948. laShowItem(uil,c,Operator,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  949. laEndRow(uil,r);
  950. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  951. laUiList* gu=g->Page; gu->HeightCoeff=mse->OnExit?-4:-3; laColumn* gc=laFirstColumn(gu);
  952. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Operator, "show_page"),laIntExpression(0)));{
  953. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  954. }laElse(gu,b);{
  955. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  956. }laEndCondition(gu,b);
  957. }
  958. if(mse->OnExit){
  959. laShowLabel(uil,c,"If you exit the program now, you will lose those changes.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  960. }
  961. r=laBeginRow(uil,c,0,0);
  962. if(mse->OnExit){
  963. laShowItemFull(uil,c,0,"LA_cancel",0,"text=Discard And Quit;feedback=DISCARD_AND_QUIT",0,0);
  964. }
  965. laShowSeparator(uil,c)->Expand=1;
  966. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified;feedback=SAVE_MODIFIED",0,0);
  967. laEndRow(uil,r);
  968. }
  969. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  970. laColumn *c;
  971. c = laFirstColumn(uil);
  972. laUiItem* b=laBeginRow(uil,c,0,0);
  973. laShowItem(uil, c, Base, "remove")->Flags|=LA_UI_FLAGS_ICON;
  974. laUiItem* ui=laShowItem(uil, c, Base, "path");
  975. ui->Expand=1;
  976. laShowItem(uil,c,&ui->PP,"get_folder_path")->Flags|=LA_UI_FLAGS_ICON;
  977. laEndRow(uil,b);
  978. }
  979. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  980. laShowItem(uil, ExtraColumns, Base, "content")->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_USE_NEWLINE|LA_TEXT_MONO|LA_UI_FLAGS_NO_TOOLTIP;
  981. }
  982. void laui_NodeRack(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  983. laNodeRack* r=This->EndInstance;
  984. laColumn* c=laFirstColumn(uil),*cl, *cr;
  985. laShowLabel(uil,c,"\n",0,0);
  986. laUiItem* b=laBeginRow(uil,c,0,0);
  987. laShowItemFull(uil,c,This,"move",0,"icon=🡰;direction=left;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  988. laUiItem* u=laShowItem(uil,c,This,"name"); u->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER; u->Expand=1;
  989. laShowItemFull(uil,c,This,"move",0,"icon=🡲;direction=right;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  990. laEndRow(uil,b);
  991. laShowLabel(uil,c,"\n",0,0);
  992. laShowItem(uil,c,This,"nodes")->Flags|=LA_UI_FLAGS_NO_DECAL;
  993. laShowLabel(uil,c,"\n",0,0);
  994. b=laBeginRow(uil,c,0,0);
  995. char args[64]=""; if(context) sprintf(args,"target=%d;",context);
  996. laShowItemFull(uil,c,This,"add_node",0,args,0,0)->Expand=1;
  997. laShowItem(uil,c,This,"delete")->Flags|=LA_UI_FLAGS_ICON;
  998. laShowItem(uil,c,This,"insert_rack");
  999. laEndRow(uil,b);
  1000. laShowLabel(uil,c,"\n\n\n",0,0);
  1001. }
  1002. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1003. laColumn* c=laFirstColumn(uil); laRackPage* r=This->EndInstance;
  1004. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(This,"has_rack"));{
  1005. laUiItem* g=laMakeGroup(uil,c,"Racks",0);{ g->Flags|=/*LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|*/LA_UI_FLAGS_NODE_CONTAINER;
  1006. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->AllowScale=1; gu->HeightCoeff=-1; g->State=LA_UI_ACTIVE;
  1007. laUiItem* hui=laShowItemFull(gu,gc,This,"racks",0,0,laui_NodeRack,r?r->RackType:0); hui->Expand=15; hui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1008. }
  1009. }laElse(uil,b);{
  1010. laShowItemFull(uil,c,This,"add_rack",0,0,0,0);
  1011. }laEndCondition(uil,b);
  1012. }
  1013. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1014. laColumn* c=laFirstColumn(uil); laNodeCategory* nc=This->EndInstance;
  1015. if(nc->Ui){ nc->Ui(uil,This,Extra,0,context); return; }
  1016. char buf[256];
  1017. for(laListItemPointer* lip=nc->NodeTypes.pFirst;lip;lip=lip->pNext){
  1018. laBaseNodeType* nt=lip->p; sprintf(buf,"feedback=%s;text=%s;icon=%lc;",nt->TypeName,nt->Name,nt->Icon?nt->Icon:' ');
  1019. laShowItemFull(uil,c,0,"LA_confirm",0,buf,0,0);
  1020. }
  1021. }
  1022. void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1023. laColumn* c = laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1024. laUiList *muil;
  1025. laColumn *mc, *mcl, *mcr, *mcll, *mclr;
  1026. laUiItem *b, *bracket;
  1027. //_LA_PANEL_USER_PREFERENCE = p;
  1028. //la_UDFAppendSharedTypePointer("_LA_PANEL_USER_PREFERENCE", _LA_PANEL_USER_PREFERENCE);
  1029. //p->Show = 0;
  1030. //p->FastUpdate = 1;
  1031. b=laBeginRow(uil,cl,0,0);
  1032. muil = laMakeMenuPage(uil, cr, "☰"); mc = laFirstColumn(muil);
  1033. laShowItem(muil, mc, 0, "LA_restore_factory");
  1034. laUiItem* ui=laShowLabel(uil,cl,"Save on exit:",0,0); ui->Expand=1; ui->Flags|=LA_TEXT_ALIGN_RIGHT;
  1035. laShowItemFull(uil,cl,0,"la.user_preferences.save_preferences_on_exit",LA_WIDGET_ENUM_HIGHLIGHT,"text=🞆",0,0);
  1036. laEndRow(uil,b);
  1037. laShowItem(uil, cr, 0, "LA_save_user_preferences")->Expand = 1;
  1038. bracket = laMakeTab(uil, c, 0);{
  1039. for(laExtraPreferencePage* epp=MAIN.ExtraPreferencePages.pFirst;epp;epp=epp->Item.pNext){
  1040. muil = laAddTabPage(bracket, epp->Name); epp->Func(muil,0,0,0,0);
  1041. }
  1042. muil = laAddTabPage(bracket, "Display");{
  1043. //muil->HeightCoeff = -1;
  1044. mc = laFirstColumn(muil);
  1045. laSplitColumn(muil, mc, 0.5);
  1046. mcl = laLeftColumn(mc, 0);
  1047. mcr = laRightColumn(mc, 0);
  1048. if(MAIN.PreferencePageDisplay){ MAIN.PreferencePageDisplay(muil,0,0,0,0); }
  1049. laShowLabel(muil, mc, "Interface:", 0, 0);
  1050. laShowLabel(muil, mcl, "Row Height:", 0, 0);
  1051. laShowItem(muil, mcr, 0, "la.user_preferences.interface_size");
  1052. laShowLabel(muil, mcl, "Font Size:", 0, 0);
  1053. laShowItem(muil, mcr, 0, "la.user_preferences.font_size");
  1054. laShowLabel(muil, mcl, "Margin Size:", 0, 0);
  1055. laShowItem(muil, mcr, 0, "la.user_preferences.margin_size");
  1056. laShowLabel(muil, mcl, "Panel Multisample:", 0, 0);
  1057. laShowItem(muil, mcr, 0, "la.user_preferences.panel_multisample")->Flags|=LA_UI_FLAGS_EXPAND;
  1058. laShowLabel(muil, mcl, "Top Framerate:", 0, 0);
  1059. laShowItem(muil, mc, 0, "la.user_preferences.top_framerate");
  1060. laShowSeparator(muil, mc);
  1061. laShowLabel(muil, mc, "Color:", 0, 0);
  1062. laShowItem(muil, mcl, 0, "la.user_preferences.color_picker_gamma");
  1063. laShowItem(muil, mcr, 0, "la.user_preferences.enable_color_management");
  1064. laShowLabel(muil, mc, "Viewport:", 0, 0);
  1065. laShowItem(muil, mcl, 0, "la.user_preferences.viewport_halftone_factor");
  1066. laShowItem(muil, mcr, 0, "la.user_preferences.viewport_halftone_size");
  1067. laShowSeparator(muil, mc);
  1068. laShowLabel(muil, mc, "Nodes:", 0, 0);
  1069. laShowItem(muil, mcr, 0, "la.user_preferences.wire_color_slices");
  1070. laShowItem(muil, mcr, 0, "la.user_preferences.wire_thickness");
  1071. laShowItem(muil, mcr, 0, "la.user_preferences.wire_saggyness");
  1072. laShowSeparator(muil, mc);
  1073. laShowLabel(muil, mc, "Floating Panel:", 0, 0);
  1074. laShowItem(muil, mcl, 0, "la.user_preferences.floating_alpha");
  1075. laShowItem(muil, mcr, 0, "la.user_preferences.solid_shadow_length");
  1076. laShowSeparator(muil, mc);
  1077. laShowLabel(muil, mc, "Translation:", 0, 0);
  1078. laShowLabel(muil, mcl, "Enable Translation:", 0, 0);
  1079. laShowItemFull(muil, mcr, 0, "la.user_preferences.enable_translation",LA_WIDGET_ENUM_CYCLE,0,0,0);
  1080. b = laOnConditionThat(muil, mcl, laPropExpression(0, "la.user_preferences.enable_translation"));{
  1081. laShowLabel(muil, mcl, "Language:", 0, 0);
  1082. laShowItemFull(muil, mcr, 0, "la.user_preferences.languages", LA_WIDGET_COLLECTION_SELECTOR, 0, 0, 0);
  1083. laShowItem(muil, mcl, 0, "LA_translation_dump");
  1084. }
  1085. laEndCondition(muil, b);
  1086. }
  1087. muil = laAddTabPage(bracket, "Input");{
  1088. //muil->HeightCoeff = -1;
  1089. mc = laFirstColumn(muil);
  1090. laSplitColumn(muil, mc, 0.5);
  1091. mcl = laLeftColumn(mc, 0);
  1092. mcr = laRightColumn(mc, 0);
  1093. if(MAIN.PreferencePageInput){ MAIN.PreferencePageInput(muil,0,0,0,0); }
  1094. laShowLabel(muil, mc, "User Interactions:", 0, 0);
  1095. laShowItem(muil, mc, 0, "la.user_preferences.scroll_speed");
  1096. laShowItem(muil, mcl, 0, "la.user_preferences.animation_speed");
  1097. laShowItem(muil, mcr, 0, "la.user_preferences.panel_animation_speed");
  1098. laShowItem(muil, mc, 0, "la.user_preferences.valuator_threshold");
  1099. laShowItem(muil, mc, 0, "la.user_preferences.zoom_speed_2d");
  1100. laShowItem(muil, mcl, 0, "la.user_preferences.tooltip_close_distance");
  1101. laShowItem(muil, mcr, 0, "la.user_preferences.idle_time");
  1102. laShowSeparator(muil,mc);
  1103. laShowLabel(muil, mc, "Input device handling:", 0, 0);
  1104. #ifdef _WIN32
  1105. laShowLabel(muil, mc, "Not yet implemened on Windows.", 0, 0);
  1106. #endif
  1107. laShowLabel(muil, mcl, "Input Mapping:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1108. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_input_mapper;text=Configure",0,0);
  1109. laShowLabel(muil, mcl, "Pads/Joysticks:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1110. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_controllers;text=Configure",0,0);
  1111. laShowSeparator(muil,mc);
  1112. laShowLabel(muil, mc, "Wacom Devices:", 0, 0);
  1113. #ifdef _WIN32
  1114. b=laBeginRow(muil,mcl,0,0); laShowSeparator(muil,mcl)->Expand=1;
  1115. laShowLabel(muil, mcl, "Driver:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1116. laShowItem(muil, mcl, 0, "LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1117. laEndRow(muil, b);
  1118. laShowItem(muil, mcr, 0, "la.user_preferences.wacom_driver");
  1119. #else
  1120. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_stylus");
  1121. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_eraser");
  1122. laShowItemFull(muil, mcr, 0, "LA_refresh_controllers",0,"text=Refresh",0,0);
  1123. #endif
  1124. }
  1125. if(MAIN.InitArgs.HasAudio){
  1126. muil = laAddTabPage(bracket, "Audio");{
  1127. mc = laFirstColumn(muil); laSplitColumn(muil, mc, 0.5);
  1128. mcl = laLeftColumn(mc, 0); mcr = laRightColumn(mc, 0);
  1129. laShowLabel(muil,mc,"Audio Device:",0,0);
  1130. laShowItemFull(muil,mcl,0,"la.audio.current_audio_device",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1131. laShowItem(muil,mcr,0,"LA_refresh_audio_devices");
  1132. }
  1133. }
  1134. muil = laAddTabPage(bracket, "Resource");{
  1135. //muil->HeightCoeff = -1;
  1136. mc = laFirstColumn(muil);
  1137. laSplitColumn(muil, mc, 0.5);
  1138. mcl = laLeftColumn(mc, 0);
  1139. mcr = laRightColumn(mc, 0);
  1140. if(MAIN.PreferencePageResource){ MAIN.PreferencePageResource(muil,0,0,0,0); }
  1141. laShowLabel(muil, mcl, "UDF Manager Default View:", 0, 0);
  1142. laShowItem(muil, mcr, 0, "la.user_preferences.manager_default_view")->Flags|=LA_UI_FLAGS_EXPAND;
  1143. laShowSeparator(muil,mc);
  1144. b=laBeginRow(muil,mc,0,0);
  1145. laShowLabel(muil, mc, "Resource Folders", 0, 0)->Expand=1;
  1146. laShowItem(muil, mc, 0, "LA_add_resource_folder");
  1147. laEndRow(muil,b);
  1148. laShowItem(muil, mc, 0, "la.user_preferences.resource_folders");
  1149. }
  1150. muil = laAddTabPage(bracket, "Theme");{
  1151. //muil->HeightCoeff = -1;
  1152. mc = laFirstColumn(muil); laSplitColumn(muil,mc,0.4);
  1153. mcl=laLeftColumn(mc,7);mcr=laRightColumn(mc,0);
  1154. if(MAIN.PreferencePageTheme){ MAIN.PreferencePageTheme(muil,0,0,0,0); }
  1155. laShowLabel(muil, mcl, "Active Theme", 0, 0);
  1156. laShowItemFull(muil, mcr, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
  1157. laShowSeparator(muil,mc);
  1158. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1159. }
  1160. muil = laAddTabPage(bracket, "System");{
  1161. mc = laFirstColumn(muil); laSplitColumn(muil, mc, 0.5);
  1162. mcl = laLeftColumn(mc, 0); mcr = laRightColumn(mc, 0);
  1163. laShowLabel(muil,mcl,"OpenGL Debugging:",0,0);
  1164. if(MAIN.InitArgs.GLDebug){
  1165. laShowLabel(muil,mc,"OpenGL debugging is force enabled with `--gl-debug`",0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  1166. }else{
  1167. laShowItem(muil,mcr,0,"la.user_preferences.enable_gl_debug");
  1168. laUiItem* b=laOnConditionThat(muil,mc,laPropExpression(0,"la.user_preferences.enable_gl_debug"));{
  1169. laShowItem(muil,mcl,0,"la.user_preferences.gl_debug_sync");
  1170. laShowItem(muil,mcr,0,"la.user_preferences.gl_debug_level")->Flags|=LA_UI_FLAGS_EXPAND;
  1171. }laEndCondition(muil,b);
  1172. }
  1173. laShowSeparator(muil,mc);
  1174. laShowLabel(muil,mcl,"Logs:",0,0);
  1175. laShowItem(muil,mcr,0,"la.user_preferences.enable_log_stdout");
  1176. }
  1177. }
  1178. }
  1179. void laui_About(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1180. laColumn *c, *cl, *cr, *tc, *gc, *gcl, *gcr, *tcl, *tcr;
  1181. laUiItem *bracket, *t, *g;
  1182. laPanel *p;
  1183. laUiList *u, *gu;
  1184. laPropContainer *pc;
  1185. int h;
  1186. laOperatorType *at;
  1187. laUiList *first;
  1188. char buf[2048]={0};
  1189. c = laFirstColumn(uil);
  1190. if(MAIN.AboutContent){
  1191. MAIN.AboutContent(uil,Base,OperatorInst,ExtraColumns,0);
  1192. }else{
  1193. laShowLabel(uil, c, "LaGUI", 0, 0);
  1194. laShowLabel(uil, c, "A graphical user interface application toolkit", 0, 0)->Flags|=LA_TEXT_LINE_WRAP;
  1195. laShowLabel(uil, c, "(C)Yiming Wu", 0, 0);
  1196. }
  1197. t = laMakeTab(uil, c, 0);{
  1198. first = u = laAddTabPage(t, "Version");
  1199. tc = laFirstColumn(u);
  1200. if(MAIN.AboutVersion){
  1201. MAIN.AboutVersion(u,Base,OperatorInst,ExtraColumns,0);
  1202. }
  1203. g = laMakeGroup(u, tc, "LaGUI information", 0);
  1204. gu = g->Page;{
  1205. gc = laFirstColumn(gu);
  1206. sprintf(buf, "LaGUI.%d.%d", LA_VERSION_MAIN, LA_VERSION_SUB);
  1207. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1208. laShowLabel(gu, gc, LAGUI_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
  1209. #ifdef LAGUI_GIT_HASH
  1210. laShowLabel(gu, gc, LAGUI_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
  1211. #endif
  1212. sprintf(buf, "Built on:[UTC+8] %s %s", __DATE__, __TIME__);
  1213. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1214. sprintf(buf, "UDF Identifier: %s",LA_UDF_IDENTIFIER);
  1215. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1216. laShowLabel(gu, gc, "UDF Extensions:", 0, 0)->Flags|=LA_TEXT_MONO;
  1217. laShowLabel(gu, gc, "🗸LA_UDF_BASICS", 0, 0)->Flags|=LA_TEXT_MONO;
  1218. for(int i=0;i<64;i++){
  1219. if(!LA_UDF_EXTENSION_STRINGS[i][0]) break; int gray=!((1<<i)&LA_UDF_EXTENSION_BITS);
  1220. sprintf(buf,"%s%s",gray?" ":"🗸",LA_UDF_EXTENSION_STRINGS[i]);
  1221. laUiItem* ext=laShowLabel(gu, gc, buf, 0, 0); ext->Flags|=LA_TEXT_MONO;
  1222. if(gray){ ext->Flags|=LA_UI_FLAGS_DISABLED; }
  1223. }
  1224. }
  1225. g = laMakeGroup(u, tc, "Device Graphics", 0);
  1226. gu = g->Page;{
  1227. gc = laFirstColumn(gu);
  1228. sprintf(buf, "OpenGL Version: %s", T->GLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1229. sprintf(buf, "OpenGL Vendor: %s", T->GLVendorStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1230. sprintf(buf, "OpenGL Renderer: %s", T->GLRendererStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1231. sprintf(buf, "GLSL Version: %s", T->GLSLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1232. }
  1233. u = laAddTabPage(t, "Authors");
  1234. tc= laFirstColumn(u);
  1235. if(MAIN.AboutAuthor){
  1236. MAIN.AboutAuthor(u,Base,OperatorInst,ExtraColumns,0);
  1237. }
  1238. g = laMakeGroup(u, tc, "LaGUI", 0);
  1239. gu = g->Page;{
  1240. gc = laFirstColumn(gu);
  1241. laShowLabel(gu,gc,"LaGUI application framework is made by Wu Yiming.",0,0)->Flags|=LA_TEXT_LINE_WRAP;
  1242. laUiItem* b=laBeginRow(gu,gc,0,0);
  1243. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com/lagui;text=Details", 0, 0);
  1244. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com;text=Yiming's Blog", 0, 0);
  1245. laEndRow(gu,b);
  1246. }
  1247. t->Page = first;
  1248. }
  1249. }
  1250. void laui_UndoHistories(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1251. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1252. laShowItem(uil,cl,0,"LA_undo"); laShowItem(uil,cr,0,"LA_redo")->Flags|=LA_TEXT_ALIGN_RIGHT;
  1253. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1254. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1255. laShowItem(gu,gc,0,"la.differences")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1256. }
  1257. }
  1258. void laui_Terminal(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1259. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.4); cl=laLeftColumn(c,2); cr=laRightColumn(c,0);
  1260. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1261. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-3;
  1262. laShowItem(gu,gc,0,"la.logs")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1263. }
  1264. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(0,"la.terminal_incomplete"));{
  1265. laShowLabel(uil,cl,"...",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1266. }laElse(uil,b);{
  1267. laShowLabel(uil,cl,">>>",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1268. }laEndCondition(uil,b);
  1269. laShowItem(uil,cr,0,"la.terminal_input")->Flags|=LA_UI_FLAGS_TERMINAL_INPUT|LA_TEXT_MONO;
  1270. }
  1271. void laui_IdleDataManager(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1272. laColumn *c=laFirstColumn(uil);
  1273. laUiItem* r=laBeginRow(uil,c,0,0);
  1274. laShowLabel(uil,c,"Viewing",0,0);
  1275. laShowItem(uil,c,Extra,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  1276. laEndRow(uil,r);
  1277. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  1278. laUiList* gu=g->Page; gu->HeightCoeff=-3; laColumn* gc=laFirstColumn(gu);
  1279. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Extra, "show_page"),laIntExpression(0)));{
  1280. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1281. }laElse(gu,b);{
  1282. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1283. }laEndCondition(gu,b);
  1284. }
  1285. r=laBeginRow(uil,c,0,0);
  1286. laShowSeparator(uil,c)->Expand=1;
  1287. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified",0,0);
  1288. laEndRow(uil,r);
  1289. }
  1290. void lauidetached_IdleDataManager(laPanel* p){
  1291. la_MakeDetachedProp(p, "la.user_preferences.manager_default_view", "show_page");
  1292. }
  1293. void laui_TextureInspector(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1294. laColumn *c=laFirstColumn(uil),*cl,*cr;
  1295. laSplitColumn(0, c, 0.5);
  1296. cl = laLeftColumn(c, 0);
  1297. cr = laRightColumn(c, 0);
  1298. laShowLabel(uil,cl,"Viewing Texture:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1299. laShowItemFull(uil,cr,Extra,"textures",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1300. laUiItem* u2=laShowCanvas(uil,c,Extra,"textures",0,-1);
  1301. laDefault2DViewOverlayRight(u2);
  1302. }
  1303. void lauidetached_TextureInspector(laPanel* p){
  1304. la_MakeDetachedProp(p, "tns.texture_list", "textures");
  1305. }
  1306. void laui_GameController(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1307. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1308. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1309. laUiItem* b=laBeginRow(uil,cl,0,0);
  1310. laUiItem* l=laShowLabel(uil,cl,"Controller:",0,0); l->Flags|=LA_TEXT_ALIGN_RIGHT; l->Expand=1;
  1311. laShowItem(uil,cl,0,"LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1312. laEndRow(uil,b);
  1313. laShowItemFull(uil,cr,Extra,"controllers",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1314. b=laOnConditionThat(uil,c,laPropExpression(Extra,"controllers"));{
  1315. laShowItemFull(uil,c,Extra,"controllers",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1316. }laElse(uil,b);{
  1317. laShowLabel(uil,c,"Please select a controller.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  1318. }
  1319. }
  1320. void lauidetached_GameController(laPanel* p){
  1321. la_MakeDetachedProp(p, "la.controllers", "controllers");
  1322. }
  1323. void laui_InputMapper(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1324. laColumn* c=laFirstColumn(uil);
  1325. laUiItem* b=laBeginRow(uil,c,0,0);
  1326. laShowItemFull(uil,c,0,"la.input_mapping.pages",LA_WIDGET_COLLECTION_SELECTOR,0,0,0)
  1327. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1328. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(0,"la.input_mapping.current_page"));{
  1329. laShowItem(uil,c,0,"la.input_mapping.current_page.name");
  1330. laShowItem(uil,c,0,"LA_add_input_mapping_page")->Flags|=LA_UI_FLAGS_ICON;
  1331. laShowItem(uil,c,Extra,"LA_input_mapping_rebuild")->Flags|=LA_UI_FLAGS_ICON;
  1332. laShowSeparator(uil,c);
  1333. laUiItem* cp=laShowInvisibleItem(uil,c,0,"la.input_mapping.current_page");
  1334. laShowItem(uil,c,&cp->PP,"remove_input_mapping_page")->Flags|=LA_UI_FLAGS_ICON;;
  1335. }laElse(uil,b3);{
  1336. laShowItem(uil,c,0,"LA_add_input_mapping_page");
  1337. }laEndCondition(uil,b3);
  1338. laEndRow(uil,b);
  1339. b3=laOnConditionThat(uil,c,laPropExpression(0,"la.input_mapping.current_page"));{
  1340. laShowItemFull(uil,c,0,"la.input_mapping.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1341. }laEndCondition(uil,b3);
  1342. }
  1343. void lauidetached_Drivers(laPanel* p){
  1344. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1345. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1346. }
  1347. void laui_DriverListItem(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1348. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1349. laUiItem* b=laBeginRow(uil,c,0,0);
  1350. laShowItem(uil,c,This,"use_script")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_CYCLE;
  1351. laShowItem(uil,c,This,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  1352. laShowItem(uil,c,This,"trigger")->Flags|=LA_UI_FLAGS_PLAIN;
  1353. laEndRow(uil,b);
  1354. }
  1355. void laui_Drivers(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1356. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1357. laSplitColumn(uil,c,0.35); cl=laLeftColumn(c,7); cr=laRightColumn(c,0);
  1358. laSplitColumn(uil,cl,0.4); cll=laLeftColumn(cl,1); clr=laRightColumn(cl,0);
  1359. laShowItemFull(uil,cll,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1360. #define ADD_PAGE \
  1361. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,""));{\
  1362. laUiItem* b=laBeginRow(uil,cr,0,0);\
  1363. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,"drivers.current_page"));{\
  1364. laUiItem* cp=laShowItemFull(uil,cr,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SELECTOR,0,laui_DriverListItem,0);\
  1365. cp->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;\
  1366. laShowItem(uil,cr,&cp->PP,"name");\
  1367. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;\
  1368. laShowItem(uil,cr,&cp->PP,"remove_driver_page")->Flags|=LA_UI_FLAGS_ICON;\
  1369. laShowSeparator(uil,cr);\
  1370. laShowItem(uil,cr,&cp->PP,"trigger");\
  1371. laShowItemFull(uil,cr,&cp->PP,"use_script",0,"icon=📃",0,0)\
  1372. ->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_ICON;\
  1373. }laElse(uil,b3);{\
  1374. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;\
  1375. }laEndCondition(uil,b3);\
  1376. laEndRow(uil,b);\
  1377. }laEndCondition(uil,b2);\
  1378. b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page"));{\
  1379. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page.use_script"));{\
  1380. laShowItemFull(uil,c,&rb->PP,"drivers.current_page.script",0,0,0,0)->Extra->HeightCoeff=-2;\
  1381. }laElse(uil,b3);{\
  1382. laShowItemFull(uil,c,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1383. }laEndCondition(uil,b3);\
  1384. }laElse(uil,b2);{\
  1385. laShowLabel(uil,c,"Select or add a logic page.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;\
  1386. }laEndCondition(uil,b2);
  1387. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1388. laUiItem* rb=laShowItemFull(uil,clr,Extra,"root_object",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1389. ADD_PAGE
  1390. }laElse(uil,b1);{
  1391. laUiItem* rb=laShowItemFull(uil,clr,0,"tns.world.active_root",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1392. ADD_PAGE
  1393. }laEndCondition(uil,b1);
  1394. #undef ADD_PAGE
  1395. }
  1396. void lauidetached_Materials(laPanel* p){
  1397. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1398. la_MakeDetachedProp(p, "tns.world.materials", "material");
  1399. }
  1400. void laui_Materials(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1401. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1402. laSplitColumn(uil,c,0.3); cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  1403. laShowItemFull(uil,cl,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1404. #define ADD_PAGE(SEL) \
  1405. laUiItem* b=laBeginRow(uil,cr,0,0);\
  1406. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(&rb->PP,""));{\
  1407. laUiItem* cp=laShowInvisibleItem(uil,cr,&rb->PP,"shader_page");\
  1408. if(SEL){\
  1409. laShowItemFull(uil,cr,&rb->PP,"",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0)\
  1410. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;\
  1411. }\
  1412. laShowItem(uil,cr,&rb->PP,"name");\
  1413. laShowItem(uil,cr,0,"M_new_material")->Flags|=LA_UI_FLAGS_ICON;\
  1414. laShowItem(uil,cr,&rb->PP,"remove")->Flags|=LA_UI_FLAGS_ICON;\
  1415. laShowSeparator(uil,cr)->Expand=1;\
  1416. laShowItemFull(uil,cr,&cp->PP,"use_script",0,"icon=📃;text=GLSL",0,0)\
  1417. ->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE;\
  1418. laShowItem(uil,cr,&rb->PP,"refresh");\
  1419. laShowSeparator(uil,cr);\
  1420. laShowItem(uil,cr,&rb->PP,"as_library")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE;\
  1421. }laElse(uil,b2);{\
  1422. if(SEL){\
  1423. laShowItemFull(uil,cr,&rb->PP,"",LA_WIDGET_COLLECTION_SELECTOR,"text=Select",laui_IdentifierOnly,0)\
  1424. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR|LA_UI_FLAGS_EXPAND;\
  1425. laShowItem(uil,cr,0,"M_new_material")->Flags|=LA_UI_FLAGS_ICON;\
  1426. }\
  1427. }laEndCondition(uil,b2);\
  1428. laEndRow(uil,b);\
  1429. b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"shader_page"));{\
  1430. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"shader_page.use_script"));{\
  1431. laShowItemFull(uil,c,&rb->PP,"shader_page.script",0,0,0,0)->Extra->HeightCoeff=-2;\
  1432. }laElse(uil,b3);{\
  1433. laShowItemFull(uil,c,&rb->PP,"shader_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1434. }laEndCondition(uil,b3);\
  1435. }laElse(uil,b2);{\
  1436. laShowLabel(uil,c,"Select or add a shader page.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;\
  1437. }laEndCondition(uil,b2);
  1438. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1439. laUiItem* rb=laShowInvisibleItem(uil,cr,Extra,"material");
  1440. ADD_PAGE(1)
  1441. }laElse(uil,b1);{
  1442. laShowInvisibleItem(uil,cr,0,"tns.world.active_root.active.as_mesh.materials"); // for switching updates.
  1443. laUiItem* rb=laShowInvisibleItem(uil,cr,0,"tns.world.active_root.active.as_mesh.current_material.material");
  1444. ADD_PAGE(0)
  1445. }laEndCondition(uil,b1);
  1446. #undef ADD_PAGE
  1447. }
  1448. void laui_AnimationActionSimple(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1449. laColumn* c=laFirstColumn(uil);
  1450. laUiItem* b=laBeginRow(uil,c,0,0);{
  1451. laUiItem* b2=laOnConditionThat(uil,c,laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action")));{
  1452. laShowLabel(uil,c,"🠶",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1453. }laElse(uil,b2);{
  1454. laShowLabel(uil,c," ",0,0)->Flags|=LA_TEXT_MONO;
  1455. }laEndCondition(uil,b2);
  1456. laUiItem* ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1457. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1458. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT;
  1459. laShowItemFull(uil,c,This,"solo",0,"icon=S;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1460. laShowItemFull(uil,c,This,"mute",0,"icon=M;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1461. }
  1462. laEndRow(uil,b);
  1463. }
  1464. void laui_AnimationActionHolder(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1465. laColumn* c=laFirstColumn(uil);
  1466. laShowItemFull(uil,c,This,"identifier",LA_WIDGET_STRING_PLAIN,0,0,0);
  1467. laShowItemFull(uil,c,This,"__actions__",0,0,laui_AnimationActionSimple,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1468. }
  1469. void laui_AnimationActionListItem(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1470. laColumn* c=laFirstColumn(uil); laUiItem* ui;
  1471. laUiItem* b=laBeginRow(uil,c,0,0);{
  1472. //laUiItem* b2=laOnConditionThat(uil,c,laNot(laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action"))));{
  1473. // ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1474. // ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1475. //}laEndCondition(uil,b2);
  1476. ui=laShowItem(uil,c,This,"name");
  1477. ui->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT; ui->Expand=1;
  1478. }
  1479. laEndRow(uil,b);
  1480. }
  1481. void laui_AnimationActions(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1482. laColumn* c=laFirstColumn(uil),*cl, *cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,5);
  1483. laUiItem* b,*ui;
  1484. ui=laShowItemFull(uil,cl,0,"la.animation.play_head",LA_WIDGET_INT_PLAIN,0,0,0);
  1485. ui->Flags|=LA_UI_FLAGS_NO_LABEL; ui->Expand=1;
  1486. laUiItem* row=laBeginRow(uil,cr,0,0);
  1487. laShowItemFull(uil,cr,0,"LA_animation_reset_time",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1488. b=laOnConditionThat(uil,cr,laPropExpression(0,"la.animation.play_status"));{
  1489. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1490. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1491. }laElse(uil,b);{
  1492. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1493. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1494. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1495. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1496. }laEndCondition(uil,b);
  1497. laEndRow(uil,row);
  1498. ui=laMakeEmptyGroup(uil,c,"Use Format",0); laUiList* gu=ui->Page; laColumn* gc=laFirstColumn(gu);
  1499. gu->HeightCoeff=-3; //ui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1500. for(laActionHolderPath* ahp=MAIN.Animation->ActionHolderPaths.pFirst;ahp;ahp=ahp->Item.pNext){
  1501. laShowLabel(gu,gc,ahp->PP.LastPs->p->Name,0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_MONO;
  1502. laShowItemFull(gu,gc,0,ahp->OriginalPath,LA_WIDGET_COLLECTION,"feedback=NONE",laui_AnimationActionHolder,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP;
  1503. }
  1504. row=laBeginRow(uil,cl,0,0);
  1505. laShowItemFull(uil,cl,0,"LA_animation_new_action",0,"text=New",0,0);//->Flags|=LA_UI_FLAGS_ICON;
  1506. laEndRow(uil,row);
  1507. }
  1508. void laui_AnimationActionChannels(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1509. laColumn* c=laFirstColumn(uil),*cl, *cr, *cll,*clr, *crl, *crr;
  1510. laSplitColumn(uil,c,0.3); cl=laLeftColumn(c,6); cr=laRightColumn(c,0);
  1511. laSplitColumn(uil,cl,0.75); cll=laLeftColumn(cl,0); clr=laRightColumn(cl,1);
  1512. laSplitColumn(uil,cr,0.75); crl=laLeftColumn(cr,0); crr=laRightColumn(cr,10);
  1513. laUiItem* b,*ui,*b2,*b3;
  1514. laUiItem* row=laBeginRow(uil,cll,0,0);
  1515. laShowItemFull(uil,cll,0,"LA_animation_reset_time",0,"current=true;text=1",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1516. b=laOnConditionThat(uil,cll,laPropExpression(0,"la.animation.play_status"));{
  1517. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1518. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1519. }laElse(uil,b);{
  1520. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1521. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1522. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1523. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1524. }laEndCondition(uil,b);
  1525. laEndRow(uil,row);
  1526. b2=laOnConditionThat(uil,c,laPropExpression(0,"la.animation.current_action"));{
  1527. row=laBeginRow(uil,crl,0,0);
  1528. ui=laShowItemFull(uil,crl,0,"la.animation.current_action.play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1529. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1530. laShowItem(uil,crl,0,"la.animation.current_action.current_frame")->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER;
  1531. laShowSeparator(uil,crl);
  1532. laShowItem(uil,crl,0,"la.animation.current_action.frame_count")->Flags|=LA_TEXT_ALIGN_CENTER;
  1533. laShowItem(uil,crl,0,"la.animation.current_action.length");
  1534. laEndRow(uil,row);
  1535. b3=laBeginRow(uil,crr,0,0);
  1536. laShowItem(uil,crr,0,"la.animation.current_action.name")->Expand=1;
  1537. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON;
  1538. laEndRow(uil,b3);
  1539. b=laOnConditionToggle(uil,clr,0,0,0,0,0);{
  1540. row=laBeginRow(uil,cr,0,0);
  1541. laShowItem(uil,cr,0,"la.animation.current_action.mix_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1542. laShowItem(uil,cr,0,"la.animation.current_action.play_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1543. laShowSeparator(uil,cr);
  1544. laShowItem(uil,cr,0,"la.animation.current_action.solo")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1545. laShowItem(uil,cr,0,"la.animation.current_action.mute")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1546. laEndRow(uil,row);
  1547. }laEndCondition(uil,b);
  1548. }laElse(uil,b2);{
  1549. laShowLabel(uil,crl,"Please select an action.",0,0);
  1550. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0);
  1551. }laEndCondition(uil,b2);
  1552. laShowCanvas(uil,c,0,"la.animation.current_action","la_AnimationActionDrawCanvas",-1);
  1553. }
  1554. void tnsui_CameraObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1555. laColumn* c=laFirstColumn(uil);
  1556. laShowLabel(uil,c,"Camera Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1557. }
  1558. void tnsui_LightObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1559. laColumn* c=laFirstColumn(uil);
  1560. laShowLabel(uil,c,"Light Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1561. }
  1562. void tnsui_Material(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1563. laColumn* c=laFirstColumn(uil),*cl,*cr; laUiItem* b,*b1,*b2;
  1564. laSplitColumn(uil,c,0.4); cl=laLeftColumn(c,8); cr=laRightColumn(c,0);
  1565. if(!context){
  1566. laShowLabel(uil,cl,"Name",0,0); laShowItem(uil,cr,This,"name");
  1567. }
  1568. b2=laOnConditionThat(uil,c,laPropExpression(This,"as_library"));{
  1569. laShowLabel(uil,c,"Material is common library.",0,0);
  1570. }laElse(uil,b2);{
  1571. b=laBeginRow(uil,cl,0,0);
  1572. laShowLabel(uil,cl,"Color",0,0)->Expand=1;
  1573. b1=laOnConditionThat(uil,cl,laOr(laPropExpression(This,"shader_page.racks"),
  1574. laPropExpression(This,"shader_page.use_script")));{
  1575. laShowLabel(uil,cl,"🎨",0,0);
  1576. }laEndCondition(uil,b1);
  1577. laEndRow(uil,b);
  1578. laShowItemFull(uil,cr,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_COLORFUL;
  1579. laShowItemFull(uil,cr,This,"colorful",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0);
  1580. }laEndCondition(uil,b2);
  1581. }
  1582. void tnsui_MaterialListItem(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1583. laColumn* c=laFirstColumn(uil); laUiItem* b,*b1;
  1584. b=laBeginRow(uil,c,0,0);
  1585. laShowItemFull(uil,c,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON;
  1586. laUiItem* ui=laShowItem(uil,c,This,"name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
  1587. b1=laOnConditionThat(uil,c,laOr(laPropExpression(This,"shader_page.racks"),
  1588. laPropExpression(This,"shader_page.use_script")));{
  1589. laShowLabel(uil,c,"🎨",0,0);
  1590. }laEndCondition(uil,b1);
  1591. laEndRow(uil,b);
  1592. }
  1593. void tnsui_MaterialSlot(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1594. laColumn* c=laFirstColumn(uil); laUiItem* b,*b1,*b2,*b3;
  1595. b1=laOnConditionThat(uil,c,laPropExpression(This,"material"));{
  1596. b=laBeginRow(uil,c,0,0);
  1597. b3=laOnConditionThat(uil,c,laPropExpression(This,"material.as_library"));{
  1598. laShowLabel(uil,c,"LIB ",0,0)->Flags|=LA_UI_DISABLED;
  1599. laShowItem(uil,c,This,"material.name")->Flags|=LA_UI_FLAGS_PLAIN|LA_UI_FLAGS_DISABLED;
  1600. }laElse(uil,b3);{
  1601. laShowItemFull(uil,c,This,"material.color",LA_WIDGET_FLOAT_COLOR,0,0,0)
  1602. ->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON|LA_UI_FLAGS_COLORFUL;
  1603. laUiItem* ui=laShowItem(uil,c,This,"material.name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
  1604. b2=laOnConditionThat(uil,c,laOr(laPropExpression(This,"material.shader_page.racks"),
  1605. laPropExpression(This,"material.shader_page.use_script")));{
  1606. laShowLabel(uil,c,"🎨",0,0);
  1607. }laEndCondition(uil,b2);
  1608. }laEndCondition(uil,b3);
  1609. laEndRow(uil,b);
  1610. }laElse(uil,b1);{
  1611. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_DISABLED;
  1612. }laEndCondition(uil,b1);
  1613. }
  1614. void tnsui_MeshObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1615. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1616. laShowLabel(uil,c,"Mesh Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1617. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.7);
  1618. gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,1);
  1619. tg=laMakeEmptyGroup(gu,gcl,"Slots",0); tu=tg->Page; tc=laFirstColumn(tu); tu->HeightCoeff=4;
  1620. laShowItemFull(tu,tc,This,"materials",0,0,tnsui_MaterialSlot,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1621. laShowItem(gu,gcr,This,"add_material_slot");
  1622. b2=laOnConditionThat(gu,gc,laPropExpression(This,"current_material"));{
  1623. laUiItem* mat=laShowInvisibleItem(gu,gc,This,"current_material");
  1624. laShowItem(gu,gcr,&mat->PP,"remove");
  1625. b3=laBeginRow(gu,gc,0,0); laUiItem* sel;
  1626. laShowItem(gu,gc,This,"add_material")->Flags|=LA_UI_FLAGS_ICON;
  1627. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1628. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1629. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1630. laShowItem(gu,gc,&mat->PP,"material.name")->Expand=1;
  1631. laShowItem(gu,gc,&sel->PP,"clear_selection")->Flags|=LA_UI_FLAGS_ICON;
  1632. }laElse(gu,b4);{
  1633. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1634. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; sel->Expand=1;
  1635. }laEndCondition(gu,b4);
  1636. laEndRow(gu,b3);
  1637. b4=laOnConditionThat(gu,gc,laEqual(laPropExpression(This,"mode"),laIntExpression(TNS_MESH_EDIT_MODE)));{
  1638. b5=laBeginRow(gu,gc,0,0);
  1639. laShowLabel(gu,gc,"Edit:",0,0);
  1640. laShowItemFull(gu,gc,This,"assign_material_slot",0,"text=Assign",0,0);
  1641. laEndRow(gu,b5);
  1642. }laEndCondition(gu,b4);
  1643. laShowSeparator(gu,gc);
  1644. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1645. laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SINGLE,0,tnsui_Material,1)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1646. }laEndCondition(gu,b4);
  1647. }laElse(gu,b2);{
  1648. laShowLabel(gu,gc,"No active material slot.",0,0);
  1649. }laEndCondition(gu,b2);
  1650. }
  1651. void tnsui_ShapeObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1652. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1653. laShowLabel(uil,c,"Shape Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1654. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.4);
  1655. gcl=laLeftColumn(gc,10); gcr=laRightColumn(gc,0);
  1656. laShowLabel(gu,gcl,"Backdrop",0,0);
  1657. laShowItemFull(gu,gcr,This,"backdrop",0,"text=Backdrop",0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1658. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.7);
  1659. gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,1);
  1660. tg=laMakeEmptyGroup(gu,gcl,"Slots",0); tu=tg->Page; tc=laFirstColumn(tu); tu->HeightCoeff=4;
  1661. laShowItemFull(tu,tc,This,"materials",0,0,tnsui_MaterialSlot,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1662. laShowItem(gu,gcr,This,"add_material_slot");
  1663. b2=laOnConditionThat(gu,gc,laPropExpression(This,"current_material"));{
  1664. laUiItem* mat=laShowInvisibleItem(gu,gc,This,"current_material");
  1665. laShowItem(gu,gcr,&mat->PP,"remove");
  1666. b3=laBeginRow(gu,gc,0,0); laUiItem* sel;
  1667. laShowItem(gu,gc,This,"add_material")->Flags|=LA_UI_FLAGS_ICON;
  1668. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1669. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1670. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1671. laShowItem(gu,gc,&mat->PP,"material.name")->Expand=1;
  1672. laShowItem(gu,gc,&sel->PP,"clear_selection")->Flags|=LA_UI_FLAGS_ICON;
  1673. }laElse(gu,b4);{
  1674. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1675. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; sel->Expand=1;
  1676. }laEndCondition(gu,b4);
  1677. laEndRow(gu,b3);
  1678. b4=laOnConditionThat(gu,gc,laEqual(laPropExpression(This,"mode"),laIntExpression(TNS_MESH_EDIT_MODE)));{
  1679. b5=laBeginRow(gu,gc,0,0);
  1680. laShowLabel(gu,gc,"Edit:",0,0);
  1681. laShowItemFull(gu,gc,This,"assign_material_slot",0,"text=Assign",0,0);
  1682. laEndRow(gu,b5);
  1683. }laEndCondition(gu,b4);
  1684. laShowSeparator(gu,gc);
  1685. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1686. laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SINGLE,0,tnsui_Material,1)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1687. }laEndCondition(gu,b4);
  1688. }laElse(gu,b2);{
  1689. laShowLabel(gu,gc,"No active material slot.",0,0);
  1690. }laEndCondition(gu,b2);
  1691. }
  1692. void tnsui_InstancerObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1693. laColumn* c=laFirstColumn(uil), *cl,*cr;
  1694. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,5); cr=laRightColumn(c,0);
  1695. laShowLabel(uil,cl,"Instance",0,0); laShowItemFull(uil,cr,This,"instance",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1696. }
  1697. void tnsui_RootObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1698. laColumn* c=laFirstColumn(uil), *cl,*cr;
  1699. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,5); cr=laRightColumn(c,0);
  1700. laShowLabel(uil,cl,"Mode",0,0); laShowItemFull(uil,cr,This,"is_2d",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND;
  1701. laShowLabel(uil,cl,"Active Camera",0,0); laShowItemFull(uil,cr,This,"active_camera",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1702. }
  1703. void tnsui_BaseObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1704. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1705. laShowLabel(uil,c,"Generic",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1706. g=laMakeGroup(uil,c,"Object",0); gu=g->Page; gc=laFirstColumn(gu);
  1707. b1=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b1->ExtraInstructions,"text=Transformations");
  1708. //b1->State=LA_UI_ACTIVE;
  1709. laSplitColumn(gu,gc,0.5); gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,0);
  1710. laShowLabel(gu,gcl,"Location",0,0); laShowItem(gu,gcl,This,"location")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1711. laShowLabel(gu,gcr,"Rotation",0,0); laShowItem(gu,gcr,This,"rotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1712. laShowLabel(gu,gcr,"Scale",0,0); laShowItem(gu,gcr,This,"scale")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1713. laUiItem* b=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b->ExtraInstructions,"text=Delta");
  1714. laShowLabel(gu,gcl,"Delta Loc",0,0); laShowItem(gu,gcl,This,"dlocation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1715. laShowLabel(gu,gcr,"Delta Rot",0,0); laShowItem(gu,gcr,This,"drotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1716. laShowLabel(gu,gcr,"Delta Scale",0,0);laShowItem(gu,gcr,This,"dscale")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1717. }laEndCondition(gu,b);
  1718. laShowSeparator(gu,gc);
  1719. }laEndCondition(gu,b1);
  1720. }
  1721. void tnsuidetached_ObjectProperties(laPanel* p){
  1722. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1723. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1724. la_MakeDetachedProp(p, "tns.world.property_page", "page");
  1725. }
  1726. void tnsui_ObjectProperties(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1727. laColumn* c=laFirstColumn(uil);
  1728. laUiItem* b=laBeginRow(uil,c,0,0);
  1729. laShowItemFull(uil,c,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1730. #define ADD_PAGE1(base,path) \
  1731. laUiItem* rb=laShowItemFull(uil,c,base,path,LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);\
  1732. rb->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;\
  1733. laUiItem* b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,""));{\
  1734. laShowItem(uil,c,&rb->PP,"name")->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1735. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"active"));{\
  1736. laShowLabel(uil,c,"⯈",0,0); laShowItem(uil,c,&rb->PP,"active.name")->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1737. }laEndCondition(uil,b3);\
  1738. }laEndCondition(uil,b2);\
  1739. laEndRow(uil,b);\
  1740. b=laBeginRow(uil,c,0,0);\
  1741. laShowItemFull(uil,c,Extra,"page",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND;\
  1742. laEndRow(uil,b);\
  1743. b=laOnConditionThat(uil,c,laNot(laPropExpression(Extra,"page")));{\
  1744. laShowItemFull(uil,c,base,path ".as_root_object",LA_WIDGET_COLLECTION_SINGLE,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1745. }laElse(uil,b);
  1746. #define ADD_PAGE2 \
  1747. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&actui->PP,""));{\
  1748. tnsui_BaseObjectProperties(uil,&actui->PP,0,0,0);\
  1749. }laElse(uil,b3);{\
  1750. laShowLabel(uil,c,"No active object.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;;\
  1751. }laEndCondition(uil,b3);\
  1752. laEndCondition(uil,b);
  1753. laUiItem* b0=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1754. ADD_PAGE1(Extra,"root_object")
  1755. laUiItem* actui=laShowItemFull(uil,c,&rb->PP,"active",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1756. actui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1757. ADD_PAGE2
  1758. }laElse(uil,b0);{
  1759. ADD_PAGE1(0,"tns.world.active_root")
  1760. laUiItem* actui=laShowItemFull(uil,c,0,"tns.world.active_root.active",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1761. actui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1762. ADD_PAGE2
  1763. }laEndCondition(uil,b0);
  1764. #undef ADD_PAGE1
  1765. #undef ADD_PAGE2
  1766. }
  1767. void tnsui_DetachedScenePanel(laPanel* p){
  1768. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1769. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1770. }
  1771. void tnsui_ScenePanel(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
  1772. laColumn* c=laFirstColumn(uil);
  1773. laShow3DCanvasCombo(uil,c,DetachedProps,"root_object",-1,DetachedProps);
  1774. }
  1775. void tnsui_ObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1776. void tnsui_ChildObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1777. laColumn* c=laFirstColumn(uil); laShowItemFull(uil,c,This,"object",0,0,tnsui_ObjectHierachy,1)
  1778. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP|LA_UI_COLLECTION_NO_HIGHLIGHT;
  1779. }
  1780. void tnsui_ObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1781. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  1782. laUiItem* r=laBeginRow(uil,cr,0,0);
  1783. laShowItemFull(uil,cr,This,"name",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1784. laEndRow(uil,r);
  1785. char* prop=context?"base.children":"children";
  1786. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(This,prop));{
  1787. laUiItem* b=laOnConditionToggle(uil,cl,0,0,0,0,0);{ b->Flags|=LA_UI_FLAGS_NO_DECAL;
  1788. b->State=LA_UI_ACTIVE;
  1789. laShowItemFull(uil,cr,This,prop,0,0,tnsui_ChildObjectHierachy,0)
  1790. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP|LA_UI_COLLECTION_NO_HIGHLIGHT;
  1791. }laEndCondition(uil,b);
  1792. }laEndCondition(uil,b2);
  1793. }
  1794. void tnsui_WorldHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1795. laColumn* c=laFirstColumn(uil),*gc; laUiList* gu;
  1796. laUiItem* r=laBeginRow(uil,c,0,0);
  1797. gu=laMakeMenuPage(uil,c,"Menu");{ gc=laFirstColumn(gu);
  1798. laShowItem(gu,gc,0,"M_new_root");
  1799. }
  1800. laEndRow(uil,r);
  1801. laUiItem* g=laMakeEmptyGroup(uil,c,"Hierachy",0);{ gu=g->Page; gc=laFirstColumn(gu);
  1802. gu->HeightCoeff=-1; //g->Flags|=LA_UI_FLAGS_NO_DECAL;
  1803. laShowItemFull(gu,gc,0,"tns.world.root_objects",0,0,tnsui_ObjectHierachy,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1804. }
  1805. }
  1806. void tnsui_DefaultObjectPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  1807. laColumn* c=laFirstColumn(uil);
  1808. char* prop=context?"base":"";
  1809. laUiItem* base=laShowInvisibleItem(uil,c,This,prop);
  1810. laShowItemFull(uil, c, &base->PP, "name",LA_WIDGET_STRING_PLAIN,0,0,0);
  1811. laShowItemFull(uil, c, &base->PP, "remove_root",0,0,0,0);
  1812. laShowItemFull(uil, c, 0, "M_new_root",0,0,0,0);
  1813. }
  1814. void la_RegisterBuiltinTemplates(){
  1815. int obj=MAIN.InitArgs.HasWorldObjects;
  1816. int tex=MAIN.InitArgs.HasTextureInspector;
  1817. int his=MAIN.InitArgs.HasHistories;
  1818. int ter=MAIN.InitArgs.HasTerminal;
  1819. int act=MAIN.InitArgs.HasAction&&obj;
  1820. laRegisterUiTemplate("LAUI_input_mapper","Input Mapper",laui_InputMapper,0,0,"Controlling",0,0,0);
  1821. laRegisterUiTemplate("LAUI_controllers", "Controllers", laui_GameController, lauidetached_GameController, 0,0,0,0,0);
  1822. if(obj) laRegisterUiTemplate("LAUI_scene", "Scene", tnsui_ScenePanel, tnsui_DetachedScenePanel, 0, 0, 0,25,25);
  1823. if(obj) laRegisterUiTemplate("LAUI_world_hierachy","World",tnsui_WorldHierachy,0,0,0,0,0,0);
  1824. if(obj) laRegisterUiTemplate("LAUI_object_properties", "Properties", tnsui_ObjectProperties, tnsuidetached_ObjectProperties, 0, 0, 0,15,25);
  1825. if(act) laRegisterUiTemplate("LAUI_animation_actions", "Actions", laui_AnimationActions, 0, 0, 0, 0,15,25);
  1826. if(act) laRegisterUiTemplate("LAUI_animation_action_channels", "Action Channels", laui_AnimationActionChannels, 0, 0, 0, 0,20,15);
  1827. if(obj) laRegisterUiTemplate("LAUI_drivers","Drivers",laui_Drivers,lauidetached_Drivers,0,0,0,0,0);
  1828. if(obj) laRegisterUiTemplate("LAUI_materials","Materials",laui_Materials,lauidetached_Materials,0,0,0,0,0);
  1829. laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,25,25);
  1830. if(tex) laRegisterUiTemplate("LAUI_texture_inspector", "Texture Inspector", laui_TextureInspector, lauidetached_TextureInspector, 0, 0, 0,0,0);
  1831. laRegisterUiTemplate("LAUI_data_manager", "Data Manager", laui_IdleDataManager, lauidetached_IdleDataManager, 0, 0, 0,25,25);
  1832. if(his) laRegisterUiTemplate("LAUI_histories", "Histories", laui_UndoHistories, 0, 0, 0, 0,10,25);
  1833. laRegisterUiTemplate("LAUI_about", "About", laui_About, 0, 0, 0, 0,15,25);
  1834. if(ter) laRegisterUiTemplate("LAUI_terminal", "Terminal", laui_Terminal, 0, 0, 0, 0,20,25);
  1835. }