*/}}
1
0

la_templates.c 103 KB

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