Misc Region.cpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. /******************************************************************************/
  2. #include "stdafx.h"
  3. /******************************************************************************/
  4. MiscRegion Misc;
  5. /******************************************************************************/
  6. /******************************************************************************/
  7. void MiscRegion::Play(MiscRegion &mr) {CodeEdit.play ();}
  8. void MiscRegion::Debug(MiscRegion &mr) {CodeEdit.debug ();}
  9. void MiscRegion::RunToCursor(MiscRegion &mr) {CodeEdit.runToCursor();}
  10. void MiscRegion::Build(MiscRegion &mr) {CodeEdit.build ();}
  11. void MiscRegion::Rebuild(MiscRegion &mr) {CodeEdit.rebuild ();}
  12. void MiscRegion::Clean(MiscRegion &mr) {CodeEdit.clean ();}
  13. void MiscRegion::CleanAll(MiscRegion &mr) {CodeEdit.cleanAll ();}
  14. void MiscRegion::Stop(MiscRegion &mr) {CodeEdit.stop ();}
  15. void MiscRegion::OpenIDE(MiscRegion &mr) {CodeEdit.openIDE ();}
  16. void MiscRegion::ExportTXT(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_TXT );}
  17. void MiscRegion::ExportCPP(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_CPP );}
  18. void MiscRegion::ExportVS2015(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_VS2015 );}
  19. void MiscRegion::ExportVS2017(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_VS2017 );}
  20. void MiscRegion::ExportAndroid(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_ANDROID);}
  21. void MiscRegion::ExportAndroidData(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_ANDROID, true);}
  22. void MiscRegion::ExportXcode(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_XCODE );}
  23. void MiscRegion::ExportXcodeDataiOS(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_XCODE , true);}
  24. void MiscRegion::ExportLinuxMake(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_LINUX_MAKE );}
  25. void MiscRegion::ExportLinuxNetBeans(MiscRegion &mr) {CodeEdit.Export(Edit::EXPORT_LINUX_NETBEANS);}
  26. void MiscRegion::ExportData(MiscRegion &mr) {::Publish.exportData();}
  27. void MiscRegion::ExportDataAndroid(MiscRegion &mr) {::Publish.exportData(Edit::EXE_APK);}
  28. void MiscRegion::ExportDataiOS(MiscRegion &mr) {::Publish.exportData(Edit::EXE_IOS);}
  29. void MiscRegion::CodeExplore(MiscRegion &mr) {Proj.codeExplore();}
  30. void MiscRegion::CodeImport(MiscRegion &mr) {Proj.codeImport (true);}
  31. void MiscRegion::CodeExport(MiscRegion &mr) {Proj.codeExport (true);}
  32. void MiscRegion::ConfigDebug(MiscRegion &mr) {CodeEdit.configDebug(true );}
  33. void MiscRegion::ConfigRelease(MiscRegion &mr) {CodeEdit.configDebug(false);}
  34. void MiscRegion::Config32(MiscRegion &mr) {CodeEdit.config32Bit(true );}
  35. void MiscRegion::Config64(MiscRegion &mr) {CodeEdit.config32Bit(false);}
  36. void MiscRegion::ConfigDX9(MiscRegion &mr) {CodeEdit.configDX9 (true );}
  37. void MiscRegion::ConfigDX11(MiscRegion &mr) {CodeEdit.configDX9 (false);}
  38. void MiscRegion::ConfigEXE(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_EXE );}
  39. void MiscRegion::ConfigDLL(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_DLL );}
  40. void MiscRegion::ConfigLIB(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_LIB );}
  41. void MiscRegion::ConfigNEW(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_NEW );}
  42. void MiscRegion::ConfigAPK(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_APK );}
  43. void MiscRegion::ConfigMAC(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_MAC );}
  44. void MiscRegion::ConfigIOS(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_IOS );}
  45. void MiscRegion::ConfigLinux(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_LINUX);}
  46. void MiscRegion::ConfigWeb(MiscRegion &mr) {CodeEdit.configEXE (Edit::EXE_WEB );}
  47. void MiscRegion::ProjList(bool all_saved, ptr) {if(all_saved)StateProjectList.set(StateFadeTime);}
  48. void MiscRegion::ProjList(MiscRegion &mr) {SaveChanges(ProjList);}
  49. void MiscRegion::HideProj(MiscRegion &mr) {Proj.visible(!mr.hide_proj());}
  50. void MiscRegion::ToggleProj(MiscRegion &mr) {mr.hide_proj.push();}
  51. void MiscRegion::ToggleTheater(MiscRegion &mr) {Proj.theater.push();}
  52. void MiscRegion::ToggleRemoved(MiscRegion &mr) {Proj.show_removed.push();}
  53. void MiscRegion::FindProj(MiscRegion &mr) {if(mr.hide_proj())mr.hide_proj.push(); Proj.filter.selectAll().activate();}
  54. void MiscRegion::ModeClose(MiscRegion &mr) {Mode.closeActive(false);}
  55. void MiscRegion::Mode0(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(0))tab->push();}
  56. void MiscRegion::Mode1(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(1))tab->push();}
  57. void MiscRegion::Mode2(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(2))tab->push();}
  58. void MiscRegion::Mode3(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(3))tab->push();}
  59. void MiscRegion::Mode4(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(4))tab->push();}
  60. void MiscRegion::Mode5(MiscRegion &mr) {if(Tab *tab=Mode.visibleTab(5))tab->push();}
  61. void MiscRegion::VidOpt(MiscRegion &mr) {::VidOpt.visibleToggleActivate();}
  62. void MiscRegion::BuyLicense(ptr ) {Explore("http://www.esenthel.com/?id=store&cat=0");}
  63. void MiscRegion::Help(MiscRegion &mr) {Explore("http://www.esenthel.com/forum/");}
  64. void MiscRegion::Fullscreen(MiscRegion &mr) {D.toggle();}
  65. void MiscRegion::Screenshot(MiscRegion &mr) {mr.screenshot=5;}
  66. void MiscRegion::CalcShow(MiscRegion &mr) {Calculator.visibleToggleActivate();}
  67. void MiscRegion::VerifyElms(MiscRegion &mr) {}
  68. void MiscRegion::ProjSettings(MiscRegion &mr) {::ProjSettings.display();}
  69. void MiscRegion::Publish(MiscRegion &mr) {PublishDo();}
  70. void MiscRegion::PublishEsProj(MiscRegion &mr) {if(!PublishEsProjIO.is())PublishEsProjIO.create(EsenthelProjectExt, S, SystemPath(SP_DESKTOP), null, ::PublishEsProjAs); PublishEsProjIO.save().name(CleanFileName(Proj.name));}
  71. void MiscRegion::AppStore(MiscRegion &mr) {::AppStore.activate();}
  72. void MiscRegion::EraseRemoved(MiscRegion &mr) {::EraseRemoved.activate();}
  73. void MiscRegion::MergeSimMtrl(MiscRegion &mr) {MSM .activate();}
  74. void MiscRegion::DetectSimTex(MiscRegion &mr) {DST .activate();}
  75. void MiscRegion::CreateMtrls(MiscRegion &mr) {::CreateMtrls.activate();}
  76. void MiscRegion::DataSizeStats(MiscRegion &mr) {SizeStats .display(S);}
  77. void MiscRegion::UnusedMaterials(MiscRegion &mr) {SizeStats .displayUnusedMaterials();}
  78. void MiscRegion::ShowTexDownsize(MiscRegion &mr) {TexDownsize .toggle();}
  79. void MiscRegion::SyncCodes(MiscRegion &mr) {Proj.syncCodes();}
  80. void MiscRegion::EditorOptions(MiscRegion &mr) {CodeEdit.visibleOptions (!CodeEdit.visibleOptions ());}
  81. void MiscRegion::CodeOutput(MiscRegion &mr) {CodeEdit.visibleOutput (!CodeEdit.visibleOutput ());}
  82. void MiscRegion::CodeDevLog(MiscRegion &mr) {CodeEdit.visibleAndroidDevLog(!CodeEdit.visibleAndroidDevLog());}
  83. void MiscRegion::Quit(MiscRegion &mr) {App.close();}
  84. void MiscRegion::About(MiscRegion &mr)
  85. {
  86. Str about=S+AppName+(STEAM ? " Steam Edition" : "")+"\nEngine Build: "+ENGINE_BUILD+", Editor Build: "+EE_APP_BUILD+", Network Protocol: "+ClientServerVersion;
  87. about+='\n'; about+=D.apiName();
  88. if(D.shaderModel()!=SM_GL)about+=S+" Shader Model "+D.shaderModelName();
  89. about+=(X64 ? ", 64-bit" : ", 32-bit");
  90. switch(Physics.engine())
  91. {
  92. case PHYS_ENGINE_PHYSX : about+=", PhysX" ; break;
  93. case PHYS_ENGINE_BULLET: about+=", Bullet"; break;
  94. }
  95. about+="\n\n";
  96. Str s=Cpu.name(); if(s.is())s+=", "; s+=S+Cpu.threads()+" HW Threads"; if(s.is())about.line()+=S+"CPU: "+s;
  97. s=D.deviceName(); if(s.is()){if(D.deviceMemory()>0)s+=S+", "+FileSize(D.deviceMemory(), '.')+" RAM"; about.line()+=S+"GPU: "+s;}
  98. MemStats m; m.get(); if(m.total_phys>0)about.line()+=S+"RAM: "+FileSize(m.total_phys, '.');
  99. s=OSName(); if(s.is())about.line()+=S+"Operating System: "+s;
  100. s=OSUserName(); if(s.is())about.line()+=S+"System User Name: "+s;
  101. #if DESKTOP
  102. s=S+App.desktopW()+'x'+App.desktopH(); if(s.is())about.line()+=S+"Desktop Resolution: "+s;
  103. #endif
  104. s=S+D.resW()+'x'+D.resH(); if(s.is())about.line()+=S+"Application Resolution: "+s;
  105. Dialog &dialog=Gui.getMsgBox("about");
  106. Gui+=dialog.create("System Information", about, ConstCast(Str("OK")));
  107. dialog.buttons[0].func(Hide, SCAST(GuiObj, dialog));
  108. dialog.activate();
  109. }
  110. void MiscRegion::Move(MiscRegion &mr) {mr.setPos(VecI2(Ms.pos().x>0, Ms.pos().y>0));}
  111. void MiscRegion::setPos(C VecI2 &pos)
  112. {
  113. if(T.pos!=pos)
  114. {
  115. T.pos=pos;
  116. ScreenChanged();
  117. }
  118. }
  119. void MiscRegion::create()
  120. {
  121. Node<MenuElm> menu_menu;
  122. {
  123. menu_menu.New().create("Help" , Help , T).display(MLTC(null, PL, u"Pomoc" , DE, u"Hilfe" , RU, u"Помощь" , PO, u"Ajuda" )); //.desc(MLT("Show Esenthel Engine help documentation", PL,"Wyświetl pomoc Esenthel Engine", DE,"Zeige Esenthel Engine Hilfe Dokumentation", RU,"Показать документацию Esenthel Engine", PO,"Mostrar a documentaçăo de ajuda do Esenthel Engine"));
  124. menu_menu.New().create("About" , About , T);
  125. menu_menu.New().create("Video Options" , VidOpt , T).kbsc(KbSc(KB_F12 )).display(MLTC(null, PL, u"Opcje Grafiki", DE, u"Grafik Optionen", RU, u"Настройки видео", PO, u"Opçőes de Video" )).desc(MLT("Change video options", PL,u"Zmień opcje grafiki", DE,u"Ändert die Grafik Optionen", RU,u"Изменить видео настройки", PO,u"Mudar as opçőes de video")).flag(MENU_HIDDEN);
  126. menu_menu.New().create("Fullscreen" , Fullscreen, T).kbsc(KbSc(KB_F11 )).display(MLTC(null, PL, u"Pełny Ekran" , DE, u"Vollbild" , RU, u"Полноэкранный" , PO, u"Ecră inteiro" )).desc(MLT("Toggle fullscreen mode", PL,u"Zmień pełny ekran", DE, "Wechseln zu Fullscreen Modus", RU,u"Переключить полноэкранный режим", PO,u"Accionar modo de ecră inteiro"));
  127. menu_menu.New().create("Screenshot" , Screenshot, T).kbsc(KbSc(KB_PRINT)).display(MLTC(null, RU, u"Скриншот")).desc("Take a screenshot and save it on the Desktop"/*MLTC(u"Take a screenshot and save it to \"ScreenShot\" folder inside the Editor", PL, u"Pobierz ekran oraz zapisz go do katalogu \"ScreenShot\"", DE, u"Macht einen Screenshot und speichert ihn in \"ScreenShot\"", RU, u"Сделать скриншот и сохранить в \"ScreenShot\"", PO, u"Captar um screenshot e guardar em \"ScreenShot\"")*/);
  128. menu_menu.New().create("Calculator" , CalcShow , T).kbsc(KbSc(KB_EQUAL, KBSC_CTRL_CMD));
  129. //menu_menu.New().create("Verify Elements", VerifyElms, T).desc("Verify if project elemets are accessing elements that haven't been removed.");
  130. //menu_menu.New().create(STEAM ? "License Key / Steam Subscription" : "License Key", SetLicense, T).desc("Set Your License Key");
  131. #if !STEAM // Valve doesn't allow this
  132. menu_menu.New().create("Esenthel Store" , AppStore , T).desc("Open Esenthel Store where you can buy and sell items");
  133. #endif
  134. //menu_menu.New().create("Opened Files" , ViewOpened, T).kbsc(KbSc(KB_3, KBSC_ALT)).flag(MENU_TOGGLABLE);
  135. menu_menu++;
  136. menu_menu.New().create("Editor Options" , EditorOptions , T).kbsc(KbSc(KB_F9));
  137. menu_menu.New().create("Project Settings" , ProjSettings , T);
  138. menu_menu.New().create("Erase Removed Elements" , EraseRemoved , T);
  139. menu_menu.New().create("Merge Similar Materials" , MergeSimMtrl , T);
  140. menu_menu.New().create("Create Materials from Images", CreateMtrls , T).desc("This option allows for automated creating Material Elements out of Image Elements and Image Files");
  141. menu_menu.New().create("Data Size Statistics" , DataSizeStats , T);
  142. menu_menu.New().create("Show Unused Materials" , UnusedMaterials, T);
  143. menu_menu.New().create("Detect Similar Textures" , DetectSimTex , T);
  144. menu_menu.New().create("Material Texture Downsize" , ShowTexDownsize, T).kbsc(KbSc(KB_D, KBSC_CTRL_CMD|KBSC_ALT));
  145. menu_menu++;
  146. menu_menu.New().create("Synchronize Codes (Experimental)", SyncCodes, T).desc("This will initiate synchronizing codes between client and server.\nFirst all codes will be received from server.\nThen any changes in codes will be merged on the client side.\nUpon completion of merging code changes all of them will be sent to the server.");
  147. menu_menu++;
  148. menu_menu.New().create("Project List" , ProjList , T).kbsc(KbSc(KB_ESC, KBSC_SHIFT )).desc("Go back to the project list");
  149. menu_menu.New().create("Exit" , Quit , T).kbsc(KbSc(KB_F4 , KBSC_ALT )).display(MLTC(null, PL, u"Wyjdź", DE, u"Beenden", RU, u"Выход", PO, u"Sair")).desc(MLT("Exit application", PL,u"Wyjdź z programu", DE,"Beendet die Anwendung", RU,u"Выйти и закрыть программу", PO,u"Sair da aplicaçăo"));
  150. menu_menu.New().create("Toggle Project" , ToggleProj , T).kbsc(KbSc(KB_1 , KBSC_ALT )).flag(MENU_HIDDEN);
  151. menu_menu.New().create("Toggle Theater" , ToggleTheater, T).kbsc(KbSc(KB_4 , KBSC_ALT )).flag(MENU_HIDDEN);
  152. menu_menu.New().create("Toggle Removed" , ToggleRemoved, T).kbsc(KbSc(KB_R , KBSC_ALT )).flag(MENU_HIDDEN);
  153. menu_menu.New().create("Find in Project", FindProj , T).kbsc(KbSc(KB_F , KBSC_CTRL_CMD|KBSC_SHIFT)).flag(MENU_HIDDEN);
  154. menu_menu.New().create("Mode Close", ModeClose, T).kbsc(KbSc(KB_F3 , KBSC_ALT|KBSC_REPEAT)).flag(MENU_HIDDEN);
  155. menu_menu.New().create("Mode 0" , Mode0 , T).kbsc(KbSc(KB_F1 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  156. menu_menu.New().create("Mode 1" , Mode1 , T).kbsc(KbSc(KB_F2 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  157. menu_menu.New().create("Mode 2" , Mode2 , T).kbsc(KbSc(KB_F3 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  158. menu_menu.New().create("Mode 3" , Mode3 , T).kbsc(KbSc(KB_F4 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  159. menu_menu.New().create("Mode 4" , Mode4 , T).kbsc(KbSc(KB_F5 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  160. menu_menu.New().create("Mode 5" , Mode5 , T).kbsc(KbSc(KB_F6 , KBSC_CTRL_CMD)).flag(MENU_HIDDEN);
  161. }
  162. Node<MenuElm> build_menu;
  163. {
  164. build_menu.New().create("Play" , Play , T).kbsc(KbSc(KB_F5)).flag(MENU_HIDDEN);
  165. #if WINDOWS
  166. build_menu.New().create("Debug" , Debug, T).kbsc(KbSc(KB_F5 , KBSC_CTRL_CMD)).desc("Play active application from within Visual Studio allowing to debug when needed");
  167. #elif MAC
  168. //build_menu.New().create("Debug" , Debug, T).kbsc(KbSc(KB_F5 , KBSC_CTRL_CMD)).desc("Play active application from within Xcode allowing to debug when needed");
  169. #elif LINUX
  170. //build_menu.New().create("Debug" , Debug, T).kbsc(KbSc(KB_F5 , KBSC_CTRL_CMD)).desc("Play active application from within NetBeans allowing to debug when needed");
  171. #endif
  172. // TODO:
  173. //build_menu.New().create("Run To Cursor", RunToCursor, T).kbsc(KbSc(KB_F10, KBSC_CTRL_CMD));
  174. build_menu.New().create("Build" , Build , T).kbsc(KbSc(KB_F7)).desc("Build application but don't start it");
  175. build_menu.New().create("Rebuild" , Rebuild , T).kbsc(KbSc(KB_F7, KBSC_CTRL_CMD)).desc("Delete all temporary files that were created during building process and build again");
  176. build_menu.New().create("Clean" , Clean , T).kbsc(KbSc(KB_F7, KBSC_CTRL_CMD|KBSC_ALT)).desc("Delete all temporary files that were created during building process of this project");
  177. build_menu.New().create("Clean All" , CleanAll, T).desc("Delete all temporary files that were created during building process of all projects");
  178. build_menu.New().create("Stop" , Stop , T).kbsc(KbSc(KB_PAUSE)).desc("Stop any build in progress");
  179. #if WINDOWS
  180. build_menu.New().create("Open in Visual Studio", OpenIDE, T).kbsc(KbSc(KB_F8)).desc("Export the project to C++ files, and open them in Visual Studio");
  181. #elif MAC
  182. build_menu.New().create("Open in Xcode" , OpenIDE, T).kbsc(KbSc(KB_F8)).desc("Export the project to C++ files, and open them in Xcode");
  183. #elif LINUX
  184. build_menu.New().create("Open in NetBeans" , OpenIDE, T).kbsc(KbSc(KB_F8)).desc("Export the project to C++ files, and open them in NetBeans");
  185. #endif
  186. build_menu.New().create( "Publish" , Publish , T).kbsc(KbSc(KB_F8, KBSC_CTRL_CMD )).desc("Use this option when you want to publish your application publicly.\nThis will create your application packaged with all needed data.\nApplication will always be compiled in release mode, even if debug is currently selected.");
  187. build_menu.New().create(S+"Save as *."+EsenthelProjectExt, PublishEsProj, T).kbsc(KbSc(KB_F8, KBSC_CTRL_CMD|KBSC_SHIFT)).desc(S+"Export your project into a single *."+EsenthelProjectExt+" file which can be easily imported by other users.");
  188. {
  189. Node<MenuElm> &Export=(build_menu+="Export");
  190. Export.New().create("Text" , ExportTXT , T);
  191. Export.New().create("C++" , ExportCPP , T);
  192. /*Export.New().create("C++ with Visual Studio 2008 project" , ExportVS2008 , T);
  193. Export.New().create("C++ with Visual Studio 2010 project" , ExportVS2010 , T);
  194. Export.New().create("C++ with Visual Studio 2012 project" , ExportVS2012 , T);
  195. Export.New().create("C++ with Visual Studio 2013 project" , ExportVS2013 , T);*/
  196. Export.New().create("C++ with Visual Studio 2015 project" , ExportVS2015 , T);
  197. Export.New().create("C++ with Visual Studio 2017 project" , ExportVS2017 , T);
  198. Export.New().create("C++ with Android project" , ExportAndroid , T);
  199. Export.New().create("C++ with Android project and Project data" , ExportAndroidData , T);
  200. Export.New().create("C++ with Xcode project" , ExportXcode , T);
  201. Export.New().create("C++ with Xcode project and Project data for iOS" , ExportXcodeDataiOS , T);
  202. Export.New().create("C++ with Linux Make project" , ExportLinuxMake , T);
  203. Export.New().create("C++ with Linux NetBeans project" , ExportLinuxNetBeans, T);
  204. Export.New().create("Project data" , ExportData , T);
  205. Export.New().create("Project data optimized for Android" , ExportDataAndroid , T);
  206. Export.New().create("Project data optimized for iOS" , ExportDataiOS , T);
  207. {
  208. Node<MenuElm> &code=(Export+="Code Synchronization"); code.desc("Import/Export Project Source Code which can be synchronized using 3rd party tools.");
  209. code.New().create("Explore", CodeExplore, T).desc("Open Project Source Code Synchronization folder.");
  210. code.New().create("Import" , CodeImport , T).desc("Import Project Source Code from Code Synchronization folder to Esenthel Project.\n\nYou can use this option to import source code from folder that was synchronized using 3rd party tools.");
  211. code.New().create("Export" , CodeExport , T).desc("Export Project Source Code from Esenthel Project to Code Synchronization Folder.\n\nYou can use this option to export source code and then synchronize it using 3rd party tools.");
  212. }
  213. }
  214. build_menu++;
  215. build_menu.New().create("View Output" , CodeOutput, T).kbsc(KbSc(KB_2, KBSC_ALT)).flag(MENU_TOGGLABLE);
  216. build_menu.New().create("View Android Device Log", CodeDevLog, T).kbsc(KbSc(KB_3, KBSC_ALT)).flag(MENU_TOGGLABLE);
  217. build_menu++;
  218. build_menu.New().create("Debug" , ConfigDebug , T).flag(MENU_TOGGLABLE);
  219. build_menu.New().create("Release", ConfigRelease, T).flag(MENU_TOGGLABLE);
  220. build_menu++;
  221. #if WINDOWS
  222. build_menu.New().create("64-bit", Config64, T).flag(MENU_TOGGLABLE);
  223. build_menu.New().create("32-bit", Config32, T).flag(MENU_TOGGLABLE);
  224. build_menu++;
  225. build_menu.New().create("DirectX 11", ConfigDX11, T).flag(MENU_TOGGLABLE);
  226. build_menu.New().create("DirectX 9" , ConfigDX9 , T).flag(MENU_TOGGLABLE);
  227. build_menu++;
  228. #endif
  229. build_menu.New().create("Windows EXE" , ConfigEXE , T).flag(MENU_TOGGLABLE);
  230. build_menu.New().create("Windows DLL" , ConfigDLL , T).flag(MENU_TOGGLABLE);
  231. //build_menu.New().create("Windows LIB" , ConfigLIB , T).flag(MENU_TOGGLABLE);
  232. build_menu.New().create("Windows Universal", ConfigNEW , T).flag(MENU_TOGGLABLE);
  233. build_menu.New().create("Android APK" , ConfigAPK , T).flag(MENU_TOGGLABLE);
  234. #if WINDOWS
  235. build_menu.New().create("Web" , ConfigWeb , T).flag(MENU_TOGGLABLE);
  236. #elif MAC
  237. build_menu.New().create("Mac APP" , ConfigMAC , T).flag(MENU_TOGGLABLE);
  238. build_menu.New().create("iOS APP" , ConfigIOS , T).flag(MENU_TOGGLABLE);
  239. #elif LINUX
  240. build_menu.New().create("Linux" , ConfigLinux, T).flag(MENU_TOGGLABLE);
  241. #endif
  242. /*if(ScriptsSupported())
  243. {
  244. build_menu++;
  245. build_menu.New().create("Play using Esenthel Compiler", PlayEsenthelCompiler).kbsc(KbSc(KB_P, KBSC_CTRL_CMD));
  246. }
  247. #if DEBUG
  248. build_menu++;
  249. build_menu.New().create("CreateFuncList", CreateFuncList);
  250. #endif*/
  251. }
  252. online_ts.reset().size=0.036f;
  253. flt w=0.55f, h=0.06f;
  254. Gui+=::EE::Region::create(Rect_LU(0, 0, w, h)).skin(&DarkSkin, false).hide().disabled(true); kb_lit=false;
  255. T +=hide_proj.create(Rect_LU(0, 0, 0.090f, 0.06f), "<<").func(HideProj, T).focusable(false).desc("Hide Project\nKeyboard Shortcut: Alt+1"); hide_proj.mode=BUTTON_TOGGLE;
  256. T +=menu .create(Rect_LU(hide_proj.rect().ru(), 0.060f, 0.06f), menu_menu).skin(&NoComboBoxImage).focusable(false).desc("Menu"); menu.text="M"; menu.text_align=0; menu.flag|=COMBOBOX_CONST_TEXT;
  257. T +=vid_opt .create(Rect_LU(menu .rect().ru(), 0.060f, 0.06f)).func(VidOpt, T).focusable(false).desc(S+MLTC(u"Video Options", PL, u"Opcje Grafiki", DE, u"Grafik Optionen", RU, u"Настройки видео", PO, u"Opçőes de Video")+"\nKeyboard Shortcut: F12"); vid_opt.image="Gui/Misc/display.img"; vid_opt.mode=BUTTON_TOGGLE;
  258. T +=online .create(Rect_LU(vid_opt .rect().ru(), 0.155f, 0.06f), "Offline", &online_ts);
  259. T +=play .create(Rect_LU(online .rect().ru(), 0.060f, 0.06f)).func(Play, T).focusable(false).desc("Play active application\nKeyboard Shortcut: F5"); play.image="Gui/arrow_right_big.img";
  260. T +=build .create(Rect_LU(play .rect().ru(), 0.125f, 0.06f)).setData(build_menu).focusable(false); build.text="Build"; build.text_size*=0.64f; FlagDisable(build.flag, COMBOBOX_MOUSE_WHEEL); build.flag|=COMBOBOX_CONST_TEXT;
  261. Gui+=move_misc.create(Rect_LU(0, 0, h, h)).func(Move, T).hide().focusable(false).desc("Move bar around the screen"); move_misc.image="Gui/Misc/move.img"; move_misc.mode=BUTTON_CONTINUOUS;
  262. CodeEdit.configChangedDebug();
  263. CodeEdit.configChanged32Bit();
  264. CodeEdit.configChangedDX9 ();
  265. CodeEdit.configChangedEXE ();
  266. CodeEdit.visibleChangedOptions ();
  267. CodeEdit.visibleChangedOpenedFiles ();
  268. CodeEdit.visibleChangedOutput ();
  269. CodeEdit.visibleChangedAndroidDevLog();
  270. }
  271. void MiscRegion::resize()
  272. {
  273. Rect screen(-D.w(), -D.h(), D.w(), D.h());
  274. Vec2 cur=rect().lerp(pos.x, pos.y),
  275. target(screen.lerp(pos.x, pos.y));
  276. move(target-cur);
  277. cur=move_misc.rect().lerp( pos.x, 0);
  278. target= rect().lerp(1-pos.x, 0);
  279. move_misc.move(target-cur);
  280. }
  281. void MiscRegion::updateMove()
  282. {
  283. if(Mode()!=MODE_GUI)setPos(VecI2(0, MiscOnTop));
  284. move_misc.visible(visible() && Mode()==MODE_GUI);
  285. }
  286. void MiscRegion::update(C GuiPC &gpc)
  287. {
  288. ::EE::Region::update(gpc);
  289. if(screenshot && !--screenshot)Renderer.screenShots(SystemPath(SP_DESKTOP).tailSlash(true)+"Esenthel Editor ScreenShots/", "bmp");
  290. }
  291. void MiscRegion::draw(C GuiPC &gpc)
  292. {
  293. if(visible() && gpc.visible)
  294. {
  295. if(Proj.visible() && Proj.rect().max.x>rect().max.x+EPS)
  296. if(Mode()==MODE_OBJ || Mode()==MODE_ANIM || Mode()==MODE_WORLD || Mode()==MODE_TEX_DOWN)
  297. {
  298. D.clip(gpc.clip);
  299. Rect r=rect(); r.setX(r.max.x, Proj.rect().max.x);
  300. Color col=BackgroundColor(); //if(GuiSkin *skin=getSkin()){col=skin.region.normal_color; col.a=255;}
  301. r.draw(col);
  302. }
  303. ::EE::Region::draw(gpc);
  304. }
  305. }
  306. MiscRegion& MiscRegion::show(){::EE::GuiObj::show(); updateMove(); return T;}
  307. MiscRegion& MiscRegion::hide(){::EE::GuiObj::hide(); updateMove(); return T;}
  308. MiscRegion::MiscRegion() : screenshot(0), pos(0, MiscOnTop) {}
  309. /******************************************************************************/