pxlNav.gui/GUI.js

  1. ./ GUI Draws
  2. ./ document.body element & css management
  3. ./ Written by Kevin Edzenga; 2020, 2024
  4. ./ -- -- -- -- -- --
  5. import { GUIManager } from '..GUIBase.js';
  6. import { ShaderEditor } from '..ShaderEditor.js';
  7. .*import { HelpGui } from './pxlGui/HelpGui.js';
  8. import { InfoGui } from '..pxlGui/InfoGui.js';
  9. import { SettingsGui } from '..pxlGui/SettingsGui.js';*/
  10. .**
  11. * @namespace pxlGuiDraws
  12. * @description GUI drawing and management
  13. *.
  14. export class GUI extends GUIManager{
  15. constructor(verbose, projectTitle="Metal-Asylum", assetRoot="images.assets/", guiRoot="images/GUI/" ){
  16. super(verbose, projectTitle, assetRoot, guiRoot );
  17. this.verbose = verbose;
  18. ./ Dynamic Styles
  19. this.lableBoxSize = 40; ./ Device Label Box Size
  20. this.optionWidthRound = 10;
  21. this.optionWidthAdd = 25;
  22. this.deviceOptionHeight = [0, 300]; ./ Device Option List Max-Height's
  23. this.ShaderEditor = null;
  24. ./ TODO : This is the loadable stage count
  25. ./ Load js, load room, run room boot, await room environment load/setup, and run post-boot code.
  26. ./ This should be a registration system, not hard coded
  27. ./ As it would be better for loading status for multi-room systems
  28. ./ Loader stages added to a promise/stage list during pre-boot, update max stage count here
  29. this.pxlLoaderTotal = 5;
  30. this.hudVisibility=true;
  31. this.camChoicesActive=false;
  32. ./this.camChoicePrevObj=null;
  33. this.micChoicesActive=false;
  34. ./this.micChoicePrevObj=null;
  35. ./ TODO : Move to function to prep dictionary for div lookup
  36. this.textDescriptions={
  37. chatIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">C<.span> )</span><br>chat', 'pos':[1,-1.5]},
  38. multiverseIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">U<.span> )</span><br>multiverse<br>selection', 'pos':[0,-1.3]},
  39. djPlayerVolumeParent:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">B<.span> )</span><br>music volume', 'pos':[0,-1.5]},
  40. speakerIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">N<.span> )</span><br>mute people<br>pick audio output', 'pos':[0,-1.5]},
  41. micIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">M<.span> )</span><br>mute/pick<br>mic input', 'pos':[0,-1.5]},
  42. camIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">V<.span> )</span><br>enable/pick<br>video input', 'pos':[0,-1.5]},
  43. helpIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">?<.span> )</span><br>help &<br>instructions', 'pos':[0,-1.5]},
  44. infoIconParent:{'text':'Info <span class="helpHotKeyParent">( <span class="helpHotKey">I<.span> )</span>', 'pos':[-1,0], 'offset':[-10,0]},
  45. settingsIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">G<.span> )</span><br>graphics &<br>navigation', 'pos':[0,-1.5]},
  46. muteAllIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">N<.span> )</span><br>mute all users', 'pos':[1,0]},
  47. fullScreenIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">F<.span> )</span><br>toggle full screen', 'pos':[-1,0]},
  48. videoQualityIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">H<.span> )</span><br>video quality settings', 'pos':[-1,0]},
  49. ./%=
  50. statsIcon:{'text':'jitsi connection status; toggle connection ', 'pos':[1,0]},
  51. ./%
  52. ./&=
  53. usersIcon:{'text':'<span class="helpHotKeyParent">( <span class="helpHotKey">T<.span> )</span> user moderator tools', 'pos':[1,0]},
  54. ./&
  55. ft2Button:{'text':'Environment', 'pos':[-1,0], 'offset':[-10,0]},
  56. ft3Button:{'text':'Invite Friends', 'pos':[-1,0], 'offset':[-10,0]},
  57. hud_userCount:{'text':'# of People', 'pos':[-1,0], 'offset':[-10,0]},
  58. };
  59. this.activeItem=null;
  60. this.actionPopUp=null;
  61. this.init();
  62. }
  63. setDependencies( pxlNav ){
  64. super.setDependencies( pxlNav );
  65. this.ShaderEditor = new ShaderEditor( pxlNav, this );
  66. }
  67. ./ Runs
  68. init(){
  69. super.init();
  70. }
  71. ./ Runs post pxlNav load & boot
  72. ./ All files have been requested & document elements prepped
  73. booted(){
  74. super.booted();
  75. }
  76. step(){
  77. super.step();
  78. }
  79. toggleShaderEditor(){
  80. this.ShaderEditor.toggleShaderEditor();
  81. }
  82. resize( e ){
  83. super.resize();
  84. if( this.ShaderEditor ){
  85. this.ShaderEditor.resize( e );
  86. }
  87. }
  88. .////////////////////////////////////////////
  89. ./ -- -- -- -- -- -- -- -- -- -- -- -- -- //
  90. .//////////////////////////////////////////
  91. }