Ticket #1028: #1028.patch
File #1028.patch, 4.5 KB (added by , 12 years ago) |
---|
-
binaries/data/mods/public/gui/session/input.js
1147 1147 } 1148 1148 1149 1149 // Called by unit selection buttons 1150 function changePrimarySelectionGroup(templateName )1150 function changePrimarySelectionGroup(templateName, rightPressed) 1151 1151 { 1152 if (Engine.HotkeyIsPressed("session.deselectgroup")) 1152 1153 if (Engine.HotkeyIsPressed("session.deselectgroup") || rightPressed) 1153 1154 g_Selection.makePrimarySelection(templateName, true); 1154 1155 else 1155 1156 g_Selection.makePrimarySelection(templateName, false); -
binaries/data/mods/public/gui/session/unit_commands.js
295 295 button.tooltip = tooltip; 296 296 297 297 // Button Function (need nested functions to get the closure right) 298 button.onpress = (function(e){ return function() { callback(e) } })(item); 298 if(guiName == "Selection") 299 button.onpressright = (function(e){return function() {callback(e, true) } })(item); 300 button.onpress = (function(e){ return function() {callback(e, false) } })(item); 299 301 300 302 // Get icon image 301 303 if (guiName == "Formation") … … 473 475 474 476 if (selection.length > 1) 475 477 setupUnitPanel("Selection", usedPanels, entState, g_Selection.groups.getTemplateNames(), 476 function (entType ) { changePrimarySelectionGroup(entType); } );478 function (entType, rightPressed) { changePrimarySelectionGroup(entType, rightPressed); } ); 477 479 478 480 var commands = getEntityCommandsList(entState); 479 481 if (commands.length) -
source/gui/IGUIButtonBehavior.cpp
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
39 39 // TODO Gee: easier access functions 40 40 switch (Message.type) 41 41 { 42 case GUIM_MOUSE_PRESS_RIGHT: 43 { 44 bool enabled; 45 GUI<bool>::GetSetting(this, "enabled", enabled); 46 47 if (!enabled) 48 break; 49 50 m_PressedRight = true; 51 } break; 42 52 case GUIM_MOUSE_PRESS_LEFT: 43 53 { 44 54 bool enabled; … … 49 59 50 60 m_Pressed = true; 51 61 } break; 62 case GUIM_MOUSE_DBLCLICK_RIGHT: 63 case GUIM_MOUSE_RELEASE_RIGHT: 64 { 65 bool enabled; 66 GUI<bool>::GetSetting(this, "enabled", enabled); 67 68 if (!enabled) 69 break; 52 70 71 if (m_PressedRight) 72 { 73 m_PressedRight = false; 74 if (Message.type == GUIM_MOUSE_RELEASE_RIGHT) 75 { 76 // Button was right-clicked 77 SendEvent(GUIM_PRESSED, "pressright"); 78 } 79 else 80 { 81 // Button was clicked a second time. We can't tell if the button 82 // expects to receive doublepress events or just a second press 83 // event, so send both of them (and assume the extra unwanted press 84 // is harmless on buttons that expect doublepress) 85 SendEvent(GUIM_PRESSED, "pressright"); 86 SendEvent(GUIM_DOUBLE_PRESSED, "doublepressright"); 87 } 88 } 89 } break; 53 90 case GUIM_MOUSE_DBLCLICK_LEFT: 54 91 case GUIM_MOUSE_RELEASE_LEFT: 55 92 { -
source/gui/IGUIButtonBehavior.h
114 114 { 115 115 m_MouseHovering = false; 116 116 m_Pressed = false; 117 m_PressedRight = false; 117 118 } 118 119 119 120 /** … … 121 122 * you have to first press the button, and then release it... 122 123 * in between those two steps you can actually leave the button 123 124 * area, as long as you release it within the button area... Anyway 124 * this lets us know we are done with step one (clicking). 125 * this lets us know we are done with step one (clicking). Or right clicking 125 126 */ 126 127 bool m_Pressed; 128 bool m_PressedRight; 127 129 }; 128 130 129 131 #endif