Ticket #1187: Ticket#1187_V6.patch
File Ticket#1187_V6.patch, 3.8 KB (added by , 12 years ago) |
---|
-
binaries/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 -
binaries/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 error("Remove: " + entsOnScreen); 776 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":false }); 777 Engine.GuiInterfaceCall("SetStatusBars", { "entities":Engine.PickEntitiesAtPoint(mouseX, mouseY), "enabled":true }); 778 } 779 763 780 // State-machine processing: 764 781 765 782 switch (inputState) … … 1412 1429 { 1413 1430 Engine.PostNetworkCommand({"type": "unload-all", "garrisonHolder": garrisonHolder}); 1414 1431 } 1432 1433 1434 // Set all inactive status bars on screen to active, removes those off screen 1435 function allStatusBars(ents) 1436 { 1437 var temp = entsOnScreen; 1438 entsOnScreen = ents; 1439 for (var ent in entsOnScreen) 1440 { 1441 if (temp.indexOf(entsOnScreen[ent]) >=0) 1442 { 1443 if(temp.length == 1 && temp[0] == entsOnScreen[ent]) 1444 temp = []; 1445 temp.splice(temp.indexOf(entsOnScreen[ent]), 1); 1446 } 1447 } 1448 error("Selection: " + g_Selection.toList()); 1449 for (var ent in g_Selection.toList()) 1450 { 1451 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1452 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1453 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1454 { 1455 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1456 temp = {}; 1457 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1458 } 1459 } 1460 for (var ent in g_Selection.toList()) 1461 { 1462 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1463 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1464 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1465 { 1466 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1467 temp = {}; 1468 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1469 } 1470 } 1471 error("ents: " + entsOnScreen); 1472 error("temp: " + temp); 1473 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":true }); 1474 Engine.GuiInterfaceCall("SetStatusBars", { "entities":temp, "enabled":false }); 1475 } 1476 No newline at end of file