Ticket #1187: Ticket#1187_V6.2.patch
File Ticket#1187_V6.2.patch, 3.7 KB (added by , 12 years ago) |
---|
-
data/config/default.cfg
190 190 hotkey.timewarp.fastforward = Space ; If timewarp mode enabled, speed up the game 191 191 hotkey.timewarp.rewind = Backspace ; If timewarp mode enabled, go back to earlier point in the game 192 192 193 193 194 ; > OVERLAY KEYS 194 195 hotkey.fps.toggle = "Alt+F" ; Toggle frame counter 195 196 hotkey.session.devcommands.toggle = "Alt+D" ; Toggle developer commands panel 196 197 hotkey.session.gui.toggle = "Alt+G" ; Toggle visibility of session GUI 197 198 hotkey.menu.toggle = "F10" ; Toggle in-game menu 198 199 hotkey.timeelapsedcounter.toggle = "F12" ; Toggle time elapsed counter 200 hotkey.healthbars.toggle = Tab ; Toggle display of health bars 199 201 202 200 203 ; > HOTKEYS ONLY 201 204 hotkey.chat = Return ; Toggle chat window 202 205 -
data/mods/public/gui/session/input.js
52 52 var doublePressTimer = 0; 53 53 var prevHotkey = 0; 54 54 55 // Some variables for status bar hotkey 56 var entsOnScreen = {}; 57 var showStatusBars = false; 58 55 59 function updateCursorAndTooltip() 56 60 { 57 61 var cursorSet = false; … … 83 87 Engine.SetCursor("arrow-default"); 84 88 if (!tooltipSet) 85 89 informationTooltip.hidden = true; 90 if(showStatusBars) 91 allStatusBars(Engine.PickFriendlyEntitiesOnScreen(Engine.GetPlayerID())); 86 92 } 87 93 88 94 function updateBuildingPlacementPreview() … … 760 766 Engine.RewindTimeWarp(); 761 767 } 762 768 769 770 if (ev.type == "hotkeydown" && ev.hotkey == "healthbars.toggle") 771 showStatusBars = true; 772 if (ev.type == "hotkeyup" && ev.hotkey == "healthbars.toggle") 773 { 774 showStatusBars = false; 775 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":false }); 776 Engine.GuiInterfaceCall("SetStatusBars", { "entities":Engine.PickEntitiesAtPoint(mouseX, mouseY), "enabled":true }); 777 } 778 763 779 // State-machine processing: 764 780 765 781 switch (inputState) … … 1412 1428 { 1413 1429 Engine.PostNetworkCommand({"type": "unload-all", "garrisonHolder": garrisonHolder}); 1414 1430 } 1431 1432 1433 // Set all inactive status bars on screen to active, removes those off screen 1434 function allStatusBars(ents) 1435 { 1436 temp = entsOnScreen; 1437 entsOnScreen = ents; 1438 if(temp.length > 0) 1439 { 1440 for (var ent in entsOnScreen) 1441 { 1442 if (temp.indexOf(entsOnScreen[ent]) >=0) 1443 { 1444 if(temp.length == 1 && temp[0] == entsOnScreen[ent]) 1445 temp = []; 1446 temp.splice(temp.indexOf(entsOnScreen[ent]), 1); 1447 } 1448 } 1449 } 1450 for (var ent in g_Selection.toList()) 1451 { 1452 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1453 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1454 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1455 { 1456 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1457 temp = {}; 1458 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1459 } 1460 } 1461 for (var ent in g_Selection.toList()) 1462 { 1463 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1464 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1465 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1466 { 1467 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1468 temp = {}; 1469 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1470 } 1471 } 1472 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":true }); 1473 Engine.GuiInterfaceCall("SetStatusBars", { "entities":temp, "enabled":false }); 1474 } 1475 No newline at end of file