ProjectGamePanel.cs 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. function ProjectGamePanel::onAdd(%this)
  2. {
  3. %this.init("Project");
  4. }
  5. function ProjectGamePanel::onOpen(%this, %allModules)
  6. {
  7. %appCore = ModuleDatabase.findModule("AppCore", 1);
  8. if(isObject(%appCore))
  9. {
  10. %this.setTitle(%appCore.project);
  11. }
  12. %loadedModules = ModuleDatabase.findModules(true);
  13. %this.clearModules();
  14. for(%i = 0; %i < getWordCount(%allModules); %i++)
  15. {
  16. %mod = getWord(%allModules, %i);
  17. %this.addModule(%mod, %loadedModules);
  18. }
  19. %this.list.sortByText();
  20. }
  21. function ProjectGamePanel::addModule(%this, %module, %loadedModules)
  22. {
  23. %color = %this.gray;
  24. if(%module.Deprecated)
  25. {
  26. %color = %this.darkRed;
  27. }
  28. for(%i = 0; %i < getWordCount(%loadedModules); %i++)
  29. {
  30. %loadedModule = getWord(%loadedModules, %i);
  31. if(%loadedModule == %module)
  32. {
  33. %color = %this.yellow;
  34. if(%module.Deprecated)
  35. {
  36. %color = %this.darkRed;
  37. }
  38. }
  39. }
  40. %this.list.addItemWithID(%this.getModuleName(%module), %module);
  41. %index = %this.list.findItemID(%module);
  42. %this.list.setItemColor(%index, %color);
  43. }