- Timestamp:
- 09/02/11 02:33:19 (13 years ago)
- Location:
- ps/trunk/binaries/data/mods/public/gui/pregame
- Files:
-
- 2 edited
-
mainmenu.js (modified) (6 diffs)
-
mainmenu.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js
r10155 r10165 1 1 var userReportEnabledText; // contains the original version with "$status" placeholder 2 var currentSubmenu ; // contains placeholder submenu3 const MARGIN = 4; 2 var currentSubmenuType; // contains submenu type 3 const MARGIN = 4; // menu border size 4 4 5 5 function init() … … 10 10 11 11 userReportEnabledText = getGUIObjectByName("userReportEnabledText").caption; 12 currentSubmenu = "submenuSinglePlayer"; 12 13 // initialize currentSubmenuType with placeholder to avoid null 14 currentSubmenuType = "submenuSinglePlayer"; 13 15 } 14 16 … … 33 35 var left = screen.right - w * (1 + Math.ceil(screen.right / w)); 34 36 layer1.size = new GUISize(left + off1, screen.top, screen.right + off1, screen.bottom); 35 36 layer2.size = new GUISize(screen.right - h + off2, screen.top, screen.right + off2, screen.bottom); 37 layer2.size = new GUISize(screen.right/2 - h + off2, screen.top, screen.right/2 + h + off2, screen.bottom); 37 38 layer3.size = new GUISize(screen.right - h + off3, screen.top, screen.right + off3, screen.bottom); 38 39 } … … 144 145 145 146 // switch to new submenu type 146 currentSubmenu = newSubmenu;147 getGUIObjectByName(currentSubmenu ).hidden = false;147 currentSubmenuType = newSubmenu; 148 getGUIObjectByName(currentSubmenuType).hidden = false; 148 149 149 150 // set position of new submenu … … 156 157 blendSubmenuIntoMain(top, bottom); 157 158 158 // prepare to hide the submenu when the mouse moves off of thesubmenu159 // Reveal submenu 159 160 getGUIObjectByName("submenu").hidden = false; 161 162 // prepare to hide the submenu when the user clicks on the background 163 getGUIObjectByName("submenuScreen").hidden = false; 160 164 } 161 165 … … 164 168 { 165 169 // remove old submenu type 166 getGUIObjectByName(currentSubmenu).hidden = true; 167 168 // hide submenu 169 getGUIObjectByName("submenu").hidden = true; 170 171 // reset submenu position 172 getGUIObjectByName("submenu").size = getGUIObjectByName("mainMenu").size; 170 getGUIObjectByName(currentSubmenuType).hidden = true; 171 172 // hide submenu and reset position 173 var submenu = getGUIObjectByName("submenu"); 174 submenu.hidden = true; 175 submenu.size = getGUIObjectByName("mainMenu").size; 173 176 174 177 // reset main menu panel right border 175 178 getGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%"; 179 180 // hide submenu screen 181 getGUIObjectByName("submenuScreen").hidden = false; 182 console.write(getGUIObjectByName("submenuScreen").hidden); 176 183 } 177 184 -
ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml
r10158 r10165 147 147 </object> 148 148 149 149 150 <!-- 150 151 ========================================== … … 152 153 ========================================== 153 154 --> 155 156 <!-- submenu screen (hides submenu when clicked --> 157 <object name="submenuScreen" 158 type="button" 159 size="0 0 100% 100%" 160 hidden="true" 161 > 162 <action on="Press"> 163 closeMenu(); 164 </action> 165 </object> 154 166 155 167 <!-- submenu -->
Note:
See TracChangeset
for help on using the changeset viewer.
