Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameclient): one 6x3 command grid, one key per place

Olcay Seygan3fa56a7f8165
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a53f33fd9..933fa0c7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -168,13 +168,13 @@ found and fixed — EA's own, not port damage.**
- A reservation lapses within half a second if the shot never arrives.
- Ctrl+Q now takes infantry only, not every armed thing you own.
- A box drawn with Ctrl held takes those units back out of your selection instead of replacing it, so a group is trimmed by dragging over the corner of it rather than picked again from scratch. Held with Alt the box keeps only what can shoot: drag across your base and you get the tanks, not the dozers and supply trucks standing among them. Both are drag-only, and a single click still means exactly what it always did.
-- A box dragged over your army and your economy together takes the army. The dozers, workers, supply trucks and hackers standing among the tanks stay where they are, and ambulances and troop carriers go with the soldiers they look after. A box with nobody military in it takes the workers the way it always did. Legacy keeps the old box.
+- A box dragged over your army and your economy together takes the army. The dozers, workers, supply trucks and hackers standing among the tanks stay where they are, and ambulances and troop carriers go with the soldiers they look after. A box with nobody military in it takes the workers the way it always did.
- The three buttons each do one thing now. Left selects, and only selects. Right gives orders, and nothing it does moves the camera. The camera is on the middle button, and it scrolls the way the right button used to: the spot you pressed on stays put, and the further you pull away from it the faster the map runs. Hold Ctrl and the same drag turns the view instead. The wheel zooms toward whatever the cursor is over and the screen edges still scroll. The classic scheme, where left both selected and commanded and right scrolled and deselected, is gone rather than switched off, and the two checkboxes that used to choose between them are out of the options screen.
- An isometric camera, on Options > Controls. It looks at the battlefield from far off through a narrow lens, so a tank at the top of the screen is drawn the same size as one at the bottom and a base reads like a city-builder's plan instead of shrinking into the distance. It buys no extra sight. The normal camera's corners, edges and centre are laid over the isometric screen as closely as a flat picture allows, hills and ultrawide screens included: the normal camera still sees a little more at the far corners and the isometric one the same amount more at the near corners, because a perspective view is wider at the back than at the front and an isometric one is not. Pan across a ridge and the picture holds its size and its angle; it does not rise and dip with the ground under it. You still turn and zoom it the way you always did, and the box takes effect the moment you tick it, mid-match included.
- Drag the right button and you draw a line: the selection spreads itself evenly along it, in the order the units already stand, so a column arrives as a firing line instead of a queue. It is the line you actually drew, curves and all, however far you keep drawing it: a long sweep used to give up partway through and finish as one straight run to the cursor, and now it holds its shape to the end. Letting go over the sidebar finishes the order rather than leaving the line stuck to the cursor. Draw the line with the left button while attack move is armed and the whole line is an attack move: artillery spread across a front, each gun firing on what walks into it, instead of one clump on one spot. The left button, because that is what attack move is aimed with; with F armed a right drag draws nothing. Armed with attack instead, every unit fires on its own station along the line, which is a barrage laid across a ridge in one drag. This is what the right button freed up. `FormationDrag = no` in Options.ini turns it off if you would rather a slipped click did nothing.
- Selected units draw a thread to wherever they are going, with the pointer, tinted, sitting on the spot. Every order draws one: move, attack move, attack, force fire, ground fire, enter, dock, repair, heal, capture, hack, guard, a waypoint path. Green for a move, pink for an attack-move, red for anything that shoots, so a group told three different things reads as three different colours. Units standing together and headed the same way share one thread, from the middle of the knot to the middle of where they are going, so twenty tanks sent across the map draw one line instead of twenty laid on top of each other; a selection spread over the map draws one per knot, and a flank sent on its own still shows. An angry mob draws one thread for the whole mob, not one per rioter. An attack move and a shot at the ground both point at the spot you clicked: the attack move's thread used to wander off to whichever free ground each unit was steering for, and ground fire pointed at the middle of the nearest map cell. An attack move stays pink from start to finish, too. A unit that stopped to fight used to swing its thread onto the enemy it was fighting, and only swung it back to your destination once the enemy was dead. A dot and a ring stood in for the pointer for a while, and players asked for the pointer back. It is not a flash at the moment of the order: the line is asked of the unit every frame, so it lasts until the unit gets there, changes its mind or leaves your selection, and it shows on the formation line while you are still drawing it. A unit that has walked off the edge of the screen still draws its line, which is how you see where the half of your army you cannot see is headed. The animated ring the ground used to sprout wherever you clicked is gone: it flashed for a second and told you nothing the marker sitting on the destination does not, and that marker stays for as long as the order does. A marker that has just appeared slides the last few pixels up out of the bottom right and fades in as it lands, over about an eighth of a second, so a fresh order catches your eye without anything flashing. Aircraft draw their thread from the click, not from the moment they leave the runway. A plane parked on its airfield answers an order by starting its takeoff and puts the order itself aside until the wheels are up, so the taxi and the climb, which is exactly the stretch where you are wondering whether the strike went out at all, used to show nothing.
- A unit standing guard draws its marker on the ground it is guarding. A guard order clears the unit's goal on the way in, so every guard marker used to sit in the bottom left corner of the map with a thread running the whole way across it, whatever the unit was actually watching.
-- A is attack and F is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved.
+- A is attack and D is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved.
- G is guard, armed the same way and aimed with the same left button. A left click posts the selection on that spot: they hold it, shoot what walks into range and do not chase it off the post you put them on. The cursor turns into the targeting cross while G is armed, so you can see the key is down before you click, and a right click puts it down again. Drag the left button with G armed (the right one draws nothing while G is down) and they post along the line you draw, one unit per station, which is how a hill or a bridge approach gets covered in one gesture instead of a click per tank. Guard has its own colour, blue, on the line while you draw it and on the thread and marker afterwards, so a group told to hold ground reads apart from one told to walk there. Hold position, which posts every unit on the spot it is already standing on, has moved to H.
- With A armed, hold the left button and drag a circle instead: everything hostile you can see inside it becomes a target list, nearest first, and the selection works down that list on its own. When the current target dies the next order goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold shift while you draw the circle and its targets go on the end of what the group is already working through; draw it without shift and the circle replaces the lot. The ground inside the circle is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. A target with enough of your fire already in the air to kill it counts as done, so the rest of the group takes the next thing on the list rather than emptying itself into something that is dead and has not fallen over yet. Aircraft are what this is for: a flight fires from range and the missiles are seconds behind, and four planes used to spend all four loads on the first tank in the circle. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A line drawn with A works the same way now: every enemy the line is drawn across goes on the list, in the order the line crosses them, so the way you draw it is the way the group fights along it. It used to pour fire into the ground under the line and hit whatever happened to be standing there. A line that crosses nobody still fires on the ground along it.
- Shift queues a guard as well, and it is where the line of orders stops. Hold shift with G armed and click, and the group takes up its post once it has finished everything queued in front of it: clear that ridge, then sit on it, in one set of clicks instead of standing over the fight waiting to give the last order. Nothing goes behind a guard, because a posted unit has no next place to be. The thread to the post is drawn in the guard colour like any other guard.
@@ -614,7 +614,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
- The strips close up again: across a row the trays slide an eighth of a tray under each other, so a row reads as one run of metal. The cameos never overlap each other, because every tray goes down before any picture does.
- Watching, the top left corner is clear. The promotions and superweapon shelves that stood there are gone: every general's promotions and superweapons are on the Tab scoreboard.
- Watching, an observer's board sits on the right of the screen, built from the command bar's own steel, and the steel is the watched side's: grey for America, red for China, sand for GLA, changing when you select a unit of another side: every player's general, his name in his colour, the number in gold, and under it a bar in the same colour as his name. In a two-sided match the bars used to go green for one side and red for the other, so a blue name could stand over a red bar. It opens on net worth, the cash in hand plus what everything the player has standing would cost to build again, counted twice a second, richest first. Its drop-downs close when you click anywhere else, on the battlefield, the radar or another drop-down, instead of staying open until you picked something in them.
-- The number the board ranks by is yours to pick from the drop-down at its top: net worth, cash, income per minute, army value, kills and losses, the general's rank and power. The list re-sorts the moment you choose. The command bar's top row of keys picks them too while you watch, Q W E R T Y U, or Q E R T Y U I with the WASD camera, and the drop-down writes each stat's key beside it.
+- The number the board ranks by is yours to pick from the drop-down at its top: net worth, cash, income per minute, army value, kills and losses, the general's rank and power. The list re-sorts the moment you choose. The command bar's keys pick them too while you watch, Q W E R T Y and A, and the drop-down writes each stat's key beside it.
- A button under the list opens the armies: every player's six most expensive kinds of unit in cameo trays, with how many of each he has on the field. The generals' emblems on the board stand bare, with no tray round them.
- The drop-downs on the right open over the board instead of pushing it down the screen.
- The superweapon countdowns and the promotions each general has bought moved into a panel on the left, one row per player with his general at the head of it, where they used to be two strips down the right-hand edge.
@@ -624,9 +624,9 @@ A third pass went through the generals' powers, promotions and unit abilities.
- Both are an ordinary web page with a stylesheet, in the game's Window folder. Change the colours, the sizes or the order there and the next match you watch draws it that way, and the page opens in a browser too.
- A minimised command bar stays minimised. Changing seats, or clicking another player's unit while watching, put the whole bar back up over the battlefield you had just cleared. A new match still opens with the bar up.
- The command bar's frame is drawn new, in the same steel as the boards. Each panel holds one thing and is exactly its size, the radar, the command grid, the portrait with the experience bar, and wears a steel border outside it. Grey for America, red for China, sand for GLA. It slides and minimises with the bar, and like the boards it is a page in the Window folder; take the page away and the old painted bar comes back.
-- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 220 pixels tall where the old bar took 312, and nearly half the screen's bottom edge right of it is battlefield but for the general's powers in the corner. The radar sits in the corner with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it the command panel keeps every order in the same place whatever you select: the unit's own abilities and upgrades along the top, then attack, stop and attack move, then eject, guard and hold position. Only the orders your selection can give are drawn, each in its place, and the rest of the panel is bare steel. Attack and hold position are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one. Over the panel runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and every kind of unit in it follows, each with how many you have. A dozer's or a worker's buildings get two bars of their own beside the panel, the first eight on the Q bar and the rest on the W bar, each in the place its two-key shortcut names, and the power bar stands up at the W bar's right end. Your money has moved to the middle of the screen's top edge.
-- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge. The power bar stands in a steel groove of its own at the right end of the worker bars, twenty cells that light up from the bottom with your production and fill the groove when full, the consumption marked by a white needle across it. The money hangs from the top edge of the screen in a steel plate of its own, the figure in a dark well. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.
-- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel tab over your rank's stars, where it no longer hides the end of the power bar. Each of the fourteen build places is its own dark cell with steel running between them, so an empty place reads as a slot waiting for a button, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel plate as the build grid, standing at its right end, and is as tall as the grid on every side, where it used to change length from one faction to the next. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. A watcher has nothing to promote and no longer gets the tab, which used to hang half into the screen's corner. Its button goes with it: a watcher who clicked a unit used to find an empty patch of screen there that still showed the promotions tooltip and opened the promotion screen. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. It comes up the way the Esc menu does, the battlefield behind it dimmed to 65% black and the screen fading in over an eighth of a second; the side's old painted screen no longer fades in over it for the first nine frames. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.
+- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 248 pixels tall where the old bar took 312, and it ends a third of the way across, so the rest of the screen's bottom edge is battlefield but for the general's powers in the corner. The radar sits in the corner with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it is one grid of eighteen buttons, six across and three down, and every button is its own key: Q W E R T Y over A S D F G H over Z X C V B N. No more two-key building shortcuts and no second bars: a dozer's buildings, a factory's units, a unit's abilities and upgrades and its orders all share the grid, each a single press. The orders stay put whatever you select. For a unit, A attacks, S stops, D attack-moves, Z ejects the passengers, X guards and C holds position; for a building, N sells it, B sets its rally point and Z empties its garrison. Everything else fills the free places from Q along the rows, what a building makes first and its upgrades after. Only the buttons your selection has are drawn, and the rest of the grid is bare steel. Its buttons are a fifth bigger than the rest of the bar's, so what you build stands out. Attack and hold position are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one. Over the grid runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and every kind of unit in it follows, each with how many you have. The power bar stands up at the grid's right end. Your money has moved to the middle of the screen's top edge. The Legacy mouse and keyboard and the W A S D camera are gone from the Options screen: there is one way to play, and an Options.ini that still names them loads as it always did.
+- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge. The power bar stands in a steel groove of its own at the right end of the command grid, twenty cells that light up from the bottom with your production and fill the groove when full, the consumption marked by a white needle across it. The money hangs from the top edge of the screen in a steel plate of its own, the figure in a dark well. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.
+- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel tab over your rank's stars, where it no longer hides the end of the power bar. Each button stands in its own dark cell with steel running between them, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel plate as the build grid, standing at its right end, and is as tall as the grid on every side, where it used to change length from one faction to the next. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. A watcher has nothing to promote and no longer gets the tab, which used to hang half into the screen's corner. Its button goes with it: a watcher who clicked a unit used to find an empty patch of screen there that still showed the promotions tooltip and opened the promotion screen. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. It comes up the way the Esc menu does, the battlefield behind it dimmed to 65% black and the screen fading in over an eighth of a second; the side's old painted screen no longer fades in over it for the first nine frames. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.
- The general's powers you have bought and can fire, the column that climbed the right edge of the screen, stand in the bottom right corner now in a tray of the bar's own steel. The first sits in the corner against the right edge of the screen, and each one you gain takes the place to the left of the last, three to a row before a new row starts above, so the tray is only ever as big as what you hold and an empty one takes no room at all. Each power sits on a dark cell three quarters the size of a build button, where the side's old tray art used to frame it. It is always out; there is no button to fold it away.
- Three buttons sit side by side in a step of the radar's own steel, on its top edge: the smoke signals Alt+Z, X and C send. Press one and the pointer turns to a cross; your next click puts the signal there, on the ground or on the radar, and a right click or Escape takes it back; until now a button dropped its smoke in the middle of your view. Every signal now leaves a mark on the ground in your colour for ten seconds, and the radar ping lasts as long: crossed swords to attack, a shield to defend, an eye to look, each in a ring a few tanks across, fading out over its last two seconds. Each is a key sunk into the steel with a sharp white picture on it instead of a word: a crosshair to attack, a shield to defend, an eye to look. Point at one and it comes up out of its well as lit steel with a gold rim, and it sinks in darker while you hold the button down. They rise into place one after another from the bottom of the screen when the match starts. A game with nobody on your side to see the smoke, a skirmish against the computer or a replay, has no signal buttons at all.
- Tooltips wear the bar's steel. Point at a build button and a card opens right above it rather than in a fixed box at the side: the name on a steel header in your side's colour with the price in gold at its end, every "Power Supplied: 5" or "Strong: infantry" line of the description laid out as a label and a bold figure, then the unit's health, damage, attacks a second, damage a second, range and build time in gold, counted with the upgrades you own. Under them every upgrade that touches the unit and what it does to it: a Gattling Tank's card says Chain Guns takes its damage from 15 to 18 and its damage a second from 37 to 46, a Humvee's that TOW adds a 50 damage missile with a range of 317, and an upgrade you already bought turns gold. Point at the upgrade itself and the card lists the units it changes, Composite Armor putting a Crusader from 480 health to 680. At the bottom, "not enough money" or what you still need in a sunk red note at the bottom. Point at something on the battlefield and a small dark box beside the pointer names it, its owner's colour in a stripe down the left edge.
@@ -655,11 +655,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
- Two buildings can no longer be put down on the same spot online. A build order travels to the other players before anything appears on the ground, and every click made while it was in flight was answered by a map that still showed the square as empty - so a shift-held row on a bad connection came out as buildings standing inside each other. The ghost now knows about the orders you have already spent, and turns red over them or slides to the square beside; and the order itself is checked again where it lands, on every machine, after the first building is standing. A second one aimed at the same ground is refused there and costs you nothing. What the ghost remembered of each order was the square around the building rather than the building, and a building standing at an angle, which is how most of them come out, fills barely half its square: a shift-clicked row of them found its neighbour in the way, slid off, and left a gap. It remembers the building's own outline now, and five Power Plants clicked side by side stand wall to wall.
- A building you put down next to another snaps against it. Click a little short of the neighbour, or a little into it, and the ghost slides along the way you stepped until the two touch, lined up with it. Clicking out a row by eye used to leave a strip of dirt at every other joint, or zigzag when the buildings stood at an angle to the row: the grid only has room for a building every 10, a diagonal building touches its neighbour somewhere in between, and a ghost pushed back out of a neighbour was thrown a whole square too far. Leave more than a square and a half between them and the gap stays where you put it.
- The right button drops the building on your cursor whether the click travelled or not. Sending a dozer off somewhere in the middle of a shift-held row moved it and left the ghost riding the cursor, because the cancel only counted a press that had not moved a pixel and a hand on the way to a destination always moves a few.
-- A click clears a half-typed building shortcut.
-- The two-key building shortcut survives the command bar's redraw now.
-- Every structure is those two keys and nothing else. The letter written on a cell is the second half of its pair, and pressed on its own it used to build whatever sat in the slot that letter names - so the same barracks went up either by the shortcut painted on it or by one bare key nobody had written anywhere, and a key pressed after a shortcut you had thought better of put a building on your cursor. And the pairs are read off the key bindings now instead of a list written out beside them: the second letters had been left behind when the bottom row of the command bar moved to Z X C V B N M, so half the cells answered a letter that was not on them.
- The command bar is driven by its own grid of keys - the buttons in the shape they are in, under your left hand - and there is no longer a switch for it. It shipped off by default, which meant nobody ever saw it.
-- W A S D can move the camera. It is a box on the Controls page, off until you tick it, and it only takes with the Modern input scheme: pick Legacy and the box goes grey. On top of the arrow keys and everything the mouse already does, and it moves the keys a fight is fought with one row down to meet the hand: F attacks, G stops, H attack-moves, J guards, K holds position. The grid's top row steps over W and reads Q E R T Y U I, which pushes the idle-worker key from I to O, and every letter painted on the command bar follows the moment you press Accept. Let go of a camera key with Ctrl held for a control group and the camera still stops. The pointer stays the pointer while the keys scroll, instead of turning into the scroll arrows the mouse uses.
- Escape cancels what you were doing before it opens the menu.
## Where the money is, and where it is coming from
@@ -931,7 +927,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
The whole HUD is on the hardware. Four colours carry it, and they mean the same thing everywhere: green is something you have, red is something wrong, white is something ready to fire, and your own player colour is everything else. How bright a key is says how much.
- Select anything and the board goes black except for the keys you can press and the gauges. A keyboard glowing all over is the worst background there is for reading a command bar off, so the colour is there while you have nothing selected and gets out of the way the moment you do.
-- The command bar is on the keys that actually press it, whichever input scheme you play on and however you have rebound it. Under Modern that is the grid, Q Z W X and on; under Legacy it is the letter written in each button's name. A key lights while its button can be pressed and goes dark the moment it cannot, and a button with a queue dims in step with the clock drawn on it, so the key tells you how far along the tank is. A builder's two key chord is followed: press Q and the lights move onto the structures Q opened, the same moment the labels on screen do.
+- The command bar is on the keys that actually press it, however you have rebound them: the grid, Q W E R T Y over A S D F G H over Z X C V B N. A key lights while its button can be pressed and goes dark the moment it cannot, and a button with a queue dims in step with the clock drawn on it, so the key tells you how far along the tank is.
- The number row is your power. Green keys while there is headroom, fewer as the base fills up, yellow for the last of it, and the whole row blinking red once consumption passes production. That is the brownout that stops your radar and your defences, and you see it before you have gone looking for the meter. A faction with no power plant leaves the row dark rather than pretending to be full.
- The function row is your generals powers, the way the keys really reach them: the first press names a row of the strip and the second a power in it. So with nothing pressed, the key of every row holding a power you can use blinks white. Press it and the blinking moves onto the keys of the usable powers in that row. A power still charging shows how far it has got, and a key that reaches nothing stays quiet.
- The numpad fills from the bottom as your nearest superweapon charges, then the whole block blinks. The particle cannon arrives on your hand, not in a corner of the screen.
@@ -1006,12 +1002,11 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- The promotion screen closes when you press its key again, however fast you press it. The screen fades in, and the fade drives the window itself for several frames either way - so a second press during the fade read the screen as still shut and opened it again, and a press just after it was closed was undone by the fade's next frame.
- The command bar stops changing under you while you are using it. With nothing selected the bar shows one of your builders so you can place a structure without picking a dozer first, and it showed whichever one happened to be idle - so a dozer finishing a building on the far side of the base took the bar over, dropping a half-typed build hotkey and taking the structure off your cursor. The builder you are working with keeps the bar.
- The command bar's artwork moves with the command bar. Minimising it slid the buttons off the bottom of the screen and left the metal they sit on painted over the battlefield; the same painting stood still through the slide the bar makes when a match opens. It travels with the bar and goes with it.
-- Play it the way it shipped. Options > Controls has a Mouse and Keyboard box with two answers. Modern is this game as it is now. Legacy is the 2003 game: left click selects and orders, right click deselects, a right drag scrolls the map, a middle drag turns the camera, and the command bar answers the game's own letter for each button, painted in the button's corner the way the grid keys are. Holding Ctrl makes a click force fire, at the ground or at your own units. Those letters are the English game's even when the words are Turkish: the translation marks every label's first letter, which would have put K on three GLA structures and S on five. The promotion screen's number keys and the general's power keys are this game's additions, so under Legacy their labels are gone and the number keys pick your groups again. Every key comes from the game's own key map, so the grid keys, the two-key structures, Alt+Z signals, Ctrl+Z barracks, Tab, box select filters, formation lines, zoom to cursor and clickable health bars all stand down. It changes the moment you press Accept, even in the middle of a match, and it only changes your own screen.
- The lines from your selection to where it is headed can be switched off. Options > Gameplay has an Order Lines box, on by default. Off, a selected unit shows no line to its goal and none through its queue, but the marker on every point it is headed for stays, so an attack move or a string of waypoints is still there to see. The line you draw while dragging a formation still shows, because that one is the order being given. It changes the moment you press Accept.
- Zoom to cursor is a box on Options > Controls again, on by default, for anyone who would rather the wheel zoomed on the middle of the screen. It also stopped fighting you. The camera corrected itself a frame after each step of the zoom, so the ground slid off the cursor and was pulled back the whole way in, and the last pull landed after the zoom had finished, as a small jump towards the cursor. And a wheel spun over a spot with no ground under it, out past the edge of the map, threw the camera to the corner of the map. The ground under the cursor stays under it on every frame now, and a spot with no ground zooms on the middle of the screen.
- Orders land where you clicked when the camera is right down on the ground. Zoomed all the way in, a right click sent the units to the corner of the map instead of to the spot under the pointer, and the marker and the line went there with them. The game works out what you clicked on by firing a line from the camera at the ground, and that line was thrown away whenever the camera itself had dropped below the height of the tallest hill on the map - so it went wrong on hilly maps first and stayed fine on flat ones, which is why it looked random.
- Click through the command bar wherever its metal is not. The bar is three shaped plates with sloped tops and cut corners, but it caught clicks over the whole rectangle each plate sits in, so a unit standing in the sky above the radar's slope, or in the notch beside the command grid, could not be clicked or ordered to. Between 3 and 22 percent of each plate's rectangle is empty, depending on the side and the panel. Those parts belong to the battlefield now, and the buttons and metal still take every click they did.
-- Drag the camera across the radar. Press on the radar and keep the button down, and the camera follows the cursor over the map until you let go; before, it jumped once per click, so crossing the map meant clicking your way over it. The button that moves the camera with a click is the one that drags it, left under Modern and right under Legacy, and with nothing selected either one does. Run the left button off the side of the radar and the camera waits at the edge of the map. It keeps following while the arrow keys are scrolling too, which used to leave the drag dead until the key came up. A selection box dragged onto the radar from the battlefield leaves the camera where it is.
+- Drag the camera across the radar. Press on the radar and keep the button down, and the camera follows the cursor over the map until you let go; before, it jumped once per click, so crossing the map meant clicking your way over it. The left button that moves the camera with a click is the one that drags it, and with nothing selected the right one does too. Run the left button off the side of the radar and the camera waits at the edge of the map. It keeps following while the arrow keys are scrolling too, which used to leave the drag dead until the key came up. A selection box dragged onto the radar from the battlefield leaves the camera where it is.
- Widescreen resolutions are back in the options menu, and the list works during a match. It was greyed out the moment a game started, because changing it rebuilt the menus and then pushed the main menu over whatever you were playing. It rebuilds the menus for later and leaves you on the battlefield with the command bar back up.
- Changing the resolution during a match no longer takes the game down. Two things were behind it. The old command bar's windows were handed back while the menu system still had them on its list, so the next thing that painted a button read whatever had since been written over it. And the bar itself was thrown away and built from scratch, which handed out fresh copies of every build button while your factories, your repair crews and the promotion screen went on pointing at the old ones. The bar's windows are rebuilt now and the bar keeps everything that is not a window.
- One command bar, not three. Changing the resolution during a match rebuilt the bar and left the old one behind, still drawn and still taking clicks at the size of the screen it was built for - and the confirmation box you answer afterwards rebuilds it a second time, so two mode changes in a row put three command bars on top of each other across the bottom of the battlefield. The code that was meant to throw the old one away asked the window system for a window called "ControlBar.wnd", and the bar's window is called "ControlBar.wnd:ControlBarParent", so it never found anything to throw away and never had.
diff --git a/GeneralsMD/Code/CMakeLists.txt b/GeneralsMD/Code/CMakeLists.txt
index f4c8ee0d4..0d9928b98 100644
--- a/GeneralsMD/Code/CMakeLists.txt
+++ b/GeneralsMD/Code/CMakeLists.txt
@@ -785,12 +785,14 @@ set_target_properties(test_gameengine PROPERTIES CXX_STANDARD 17)
# fxlist_reforged_ini_parses_and_keeps_its_light runs the fork's own FXList file through the real
# INI parser, so it needs the tracked master rather than whatever sits in Run/.
# the_options_menu_buttons_all_wear_one_font reads the tracked layout master, not Run/'s copy.
-# the_spectator_page_names_only_on_off_options reads the tracked page master the same way.
+# the_spectator_page_names_only_on_off_options reads the tracked page master the same way, and
+# the_command_grid_keys_are_the_places_and_n_sells_and_b_rallies the tracked command map.
target_compile_definitions(test_gameengine PRIVATE
GAMEENGINE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/GameEngine"
FXLIST_REFORGED_INI="${CMAKE_CURRENT_SOURCE_DIR}/Data/INI/FXListReforged.ini"
OPTIONS_MENU_WND="${CMAKE_CURRENT_SOURCE_DIR}/Data/Window/Menus/OptionsMenu.wnd"
SPECTATOR_HTML="${CMAKE_CURRENT_SOURCE_DIR}/Data/Window/Html/Spectator.html"
+ COMMAND_MAP_REFORGED_INI="${CMAKE_CURRENT_SOURCE_DIR}/Data/INI/CommandMapReforged.ini"
PLATE_TEXTURE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/Data/Art/Textures")
# The three hand-written self-checks predate the harness; run them from ctest
diff --git a/GeneralsMD/Code/Data/INI/CommandMapReforged.ini b/GeneralsMD/Code/Data/INI/CommandMapReforged.ini
index 0557c9193..2b9c7bc6c 100644
--- a/GeneralsMD/Code/Data/INI/CommandMapReforged.ini
+++ b/GeneralsMD/Code/Data/INI/CommandMapReforged.ini
@@ -14,21 +14,22 @@
;
; Loose overlay, loaded after Data\<Language>\CommandMap.ini, so a block here
; overrides that file entry-for-entry and new commands can be added. Every
-; binding this fork adds or moves lives here; KEYMAP.md is the readable
-; version of the same table.
+; binding this fork adds or moves lives here.
;
; Grid command bar, which is how the bar is driven - there is no other scheme and
-; no switch: the command bar is 7 columns x 2 rows and the keys sit under the
-; left hand in the same shape.
+; no switch: the command grid is 6 columns x 3 rows and the keys sit under the
+; left hand in the same shape, one key per place.
;
-; slot 01 03 05 07 09 11 13 (top row) Q W E R T Y U
-; slot 02 04 06 08 10 12 14 (bottom row) Z X C V B N M
+; slot 01 02 03 04 05 06 (top row) Q W E R T Y
+; slot 07 08 09 10 11 12 (middle row) A S D F G H
+; slot 13 14 15 16 17 18 (bottom row) Z X C V B N
;
-; The bottom row is Z X C V B N M so that A (attack), S (stop) and F (attack
-; move) stay free for the units. The previous owners of the grid letters moved
-; onto a modifier - see "displaced" below.
+; The owner's fixed places: a unit's A attack, S stop, D attack move, Z eject,
+; X guard, C hold position; a building's N sell, B rally point, Z evacuate. The
+; rest of a command set fills the free places in reading order, what it builds
+; first and its abilities and upgrades after (ControlBar_commandPlaces). A key
+; whose place holds its own order, or nothing, still does that order.
-; column 1, top row
CommandMap COMMAND_SLOT01
Key = KEY_Q
Transition = DOWN
@@ -39,9 +40,8 @@ CommandMap COMMAND_SLOT01
DisplayName = GUI:CommandSlot01
End
-; column 1, bottom row
CommandMap COMMAND_SLOT02
- Key = KEY_Z
+ Key = KEY_W
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -50,9 +50,8 @@ CommandMap COMMAND_SLOT02
DisplayName = GUI:CommandSlot02
End
-; column 2, top row
CommandMap COMMAND_SLOT03
- Key = KEY_W
+ Key = KEY_E
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -61,9 +60,8 @@ CommandMap COMMAND_SLOT03
DisplayName = GUI:CommandSlot03
End
-; column 2, bottom row
CommandMap COMMAND_SLOT04
- Key = KEY_X
+ Key = KEY_R
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -72,9 +70,8 @@ CommandMap COMMAND_SLOT04
DisplayName = GUI:CommandSlot04
End
-; column 3, top row
CommandMap COMMAND_SLOT05
- Key = KEY_E
+ Key = KEY_T
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -83,9 +80,8 @@ CommandMap COMMAND_SLOT05
DisplayName = GUI:CommandSlot05
End
-; column 3, bottom row
CommandMap COMMAND_SLOT06
- Key = KEY_C
+ Key = KEY_Y
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -94,9 +90,8 @@ CommandMap COMMAND_SLOT06
DisplayName = GUI:CommandSlot06
End
-; column 4, top row
CommandMap COMMAND_SLOT07
- Key = KEY_R
+ Key = KEY_A
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -105,9 +100,8 @@ CommandMap COMMAND_SLOT07
DisplayName = GUI:CommandSlot07
End
-; column 4, bottom row
CommandMap COMMAND_SLOT08
- Key = KEY_V
+ Key = KEY_S
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -116,9 +110,8 @@ CommandMap COMMAND_SLOT08
DisplayName = GUI:CommandSlot08
End
-; column 5, top row
CommandMap COMMAND_SLOT09
- Key = KEY_T
+ Key = KEY_D
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -127,9 +120,8 @@ CommandMap COMMAND_SLOT09
DisplayName = GUI:CommandSlot09
End
-; column 5, bottom row
CommandMap COMMAND_SLOT10
- Key = KEY_B
+ Key = KEY_F
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -138,9 +130,8 @@ CommandMap COMMAND_SLOT10
DisplayName = GUI:CommandSlot10
End
-; column 6, top row
CommandMap COMMAND_SLOT11
- Key = KEY_Y
+ Key = KEY_G
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -149,9 +140,8 @@ CommandMap COMMAND_SLOT11
DisplayName = GUI:CommandSlot11
End
-; column 6, bottom row
CommandMap COMMAND_SLOT12
- Key = KEY_N
+ Key = KEY_H
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -160,9 +150,8 @@ CommandMap COMMAND_SLOT12
DisplayName = GUI:CommandSlot12
End
-; column 7, top row
CommandMap COMMAND_SLOT13
- Key = KEY_U
+ Key = KEY_Z
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -171,9 +160,8 @@ CommandMap COMMAND_SLOT13
DisplayName = GUI:CommandSlot13
End
-; column 7, bottom row
CommandMap COMMAND_SLOT14
- Key = KEY_M
+ Key = KEY_X
Transition = DOWN
Modifiers = NONE
UseableIn = GAME
@@ -182,6 +170,46 @@ CommandMap COMMAND_SLOT14
DisplayName = GUI:CommandSlot14
End
+CommandMap COMMAND_SLOT15
+ Key = KEY_C
+ Transition = DOWN
+ Modifiers = NONE
+ UseableIn = GAME
+ Category = CONTROL
+ Description = GUI:CommandSlot15Description
+ DisplayName = GUI:CommandSlot15
+End
+
+CommandMap COMMAND_SLOT16
+ Key = KEY_V
+ Transition = DOWN
+ Modifiers = NONE
+ UseableIn = GAME
+ Category = CONTROL
+ Description = GUI:CommandSlot16Description
+ DisplayName = GUI:CommandSlot16
+End
+
+CommandMap COMMAND_SLOT17
+ Key = KEY_B
+ Transition = DOWN
+ Modifiers = NONE
+ UseableIn = GAME
+ Category = CONTROL
+ Description = GUI:CommandSlot17Description
+ DisplayName = GUI:CommandSlot17
+End
+
+CommandMap COMMAND_SLOT18
+ Key = KEY_N
+ Transition = DOWN
+ Modifiers = NONE
+ UseableIn = GAME
+ Category = CONTROL
+ Description = GUI:CommandSlot18Description
+ DisplayName = GUI:CommandSlot18
+End
+
;------------------------------------------------------------------------------
; Category selection. CTRL + a grid letter picks a whole class of thing: the
; row under the left hand reads Q W E / Z X C = units, and the second press of
@@ -311,32 +339,11 @@ CommandMap SELECT_NEXT_IDLE_WORKER
DisplayName = GUI:SelectNextIdleWorker
End
-; attack move. 'F' arms the mode, the next left click issues it (CommandXlat
-; clears the mode again right after, so it is single shot) and a right click
-; puts it down. It sits next to the attack key below, and the two turn each
-; other off.
-CommandMap TOGGLE_ATTACKMOVE
- Key = KEY_F
- Transition = DOWN
- Modifiers = NONE
- UseableIn = GAME
- Category = CONTROL
- Description = GUI:ToggleAttackMoveDescription
- DisplayName = GUI:ToggleAttackMove
-End
-
-; attack. 'A' arms force fire the same way, so a left click on the ground, on
-; rubble or on your own tank is an attack. It is the only way to force fire:
-; holding ctrl no longer does it.
-CommandMap TOGGLE_FORCEATTACK
- Key = KEY_A
- Transition = DOWN
- Modifiers = NONE
- UseableIn = GAME
- Category = CONTROL
- Description = GUI:ToggleForceAttackDescription
- DisplayName = GUI:ToggleForceAttack
-End
+; Attack (A), stop (S), attack move (D), guard (X) and hold position (C) have no
+; record of their own any more: they are the grid's places on those keys, and
+; the grid posts the same message a record here used to (orderAtPlace in
+; ControlBar.cpp). A record of their own on the same letter would come before
+; the grid's in the list and steal the key from a structure standing there.
; the order queue. Retail put it on ALT; here it is SHIFT, the key every other RTS
; queues with, and the same key that adds to the selection - the two records both
@@ -370,44 +377,6 @@ CommandMap TOGGLE_PURCHASE_SCIENCE
DisplayName = GUI:TogglePurchaseScience
End
-; stop what you are doing. This file replaces the shipped command map rather than
-; merging with it, so a retail key that is not written out here is simply not bound -
-; which is what had happened to stop: the grid gives the command bar's stop button a
-; cell letter, but the key every RTS player reaches for was dead.
-CommandMap STOP
- Key = KEY_S
- Transition = DOWN
- Modifiers = NONE
- UseableIn = GAME
- Category = CONTROL
- Description = GUI:StopDescription
- DisplayName = GUI:Stop
-End
-
-; guard. 'G' arms the mode the same way, and the next order click posts the
-; selection where it is pointed; drag the right button with it armed and they
-; post along the line instead of piling onto one spot.
-CommandMap TOGGLE_GUARD
- Key = KEY_G
- Transition = DOWN
- Modifiers = NONE
- UseableIn = GAME
- Category = CONTROL
- Description = GUI:ToggleGuardDescription
- DisplayName = GUI:ToggleGuard
-End
-
-; guard the spot you are standing on, without chasing anything
-CommandMap HOLD_POSITION
- Key = KEY_H
- Transition = DOWN
- Modifiers = NONE
- UseableIn = GAME
- Category = CONTROL
- Description = GUI:HoldPositionDescription
- DisplayName = GUI:HoldPosition
-End
-
; smoke signals for your allies, where the cursor is or on the radar spot under it,
; gone after three seconds. The grid's bottom row again, on the one modifier the
; grid leaves alone: Z attack here, X defend here, C look here. Network games only.
diff --git a/GeneralsMD/Code/Data/INI/CommandMapWASD.ini b/GeneralsMD/Code/Data/INI/CommandMapWASD.ini
deleted file mode 100644
index e4eac7bf5..000000000
--- a/GeneralsMD/Code/Data/INI/CommandMapWASD.ini
+++ /dev/null
@@ -1,103 +0,0 @@
-;//////////////////////////////////////////////////////////////////////////////
-;FILE: CommandMapWASD.ini (SYSTEM) ////////////////////////////////////////////
-;//////////////////////////////////////////////////////////////////////////////
-;
-; MASTER COPY - the build copies it to Run/Data/INI/ with CommandMap.ini.
-;
-; The keys that move when the W A S D camera box is ticked on the Controls page.
-; MetaMap::loadWasdBindings copies the finished Modern map - the language's own
-; CommandMap.ini with this fork's CommandMap.ini over it - into a list of its
-; own and lays this file over that copy, so a block here only has to name what
-; changes: every field it leaves out keeps the Modern value. Legacy input never
-; reads this file and the box is grey while Legacy is picked.
-;
-; The camera keys themselves are not in here. Scrolling is read as a raw key
-; in LookAtXlat.cpp, beside the arrow keys: the meta map holds one key per
-; command, so binding W A S D would take the arrows away, and a meta record
-; fires its UP only while the modifiers match the ones the key went down with,
-; so letting go of W with ctrl held for a control group would leave the camera
-; running.
-;
-; The grid's top row steps over W:
-;
-; slot 01 03 05 07 09 11 13 (top row) Q E R T Y U I
-; slot 02 04 06 08 10 12 14 (bottom row) Z X C V B N M
-;
-; and the orders the camera hand took off A and S move one row down, reading
-; left to right along it with no modifier on any of them:
-;
-; F attack G stop H attack move J guard K hold position
-;
-; Idle workers go from I, which slot 13 now wants, to O.
-
-CommandMap COMMAND_SLOT03
- Key = KEY_E
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap COMMAND_SLOT05
- Key = KEY_R
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap COMMAND_SLOT07
- Key = KEY_T
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap COMMAND_SLOT09
- Key = KEY_Y
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap COMMAND_SLOT11
- Key = KEY_U
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap COMMAND_SLOT13
- Key = KEY_I
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap SELECT_NEXT_IDLE_WORKER
- Key = KEY_O
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap TOGGLE_FORCEATTACK
- Key = KEY_F
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap STOP
- Key = KEY_G
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap TOGGLE_ATTACKMOVE
- Key = KEY_H
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap HOLD_POSITION
- Key = KEY_K
- Transition = DOWN
- Modifiers = NONE
-End
-
-CommandMap TOGGLE_GUARD
- Key = KEY_J
- Transition = DOWN
- Modifiers = NONE
-End
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index 349f49c0d..f57dcdef2 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -38,7 +38,7 @@ GUI:CommandSlot02
END
GUI:CommandSlot02Description
-"Presses command bar slot 02 (column 1, bottom row, 'Z' in the default grid layout)."
+"Presses command bar slot 02 (column 2, top row, 'W' in the default grid layout)."
END
GUI:CommandSlot03
@@ -46,7 +46,7 @@ GUI:CommandSlot03
END
GUI:CommandSlot03Description
-"Presses command bar slot 03 (column 2, top row, 'W' in the default grid layout)."
+"Presses command bar slot 03 (column 3, top row, 'E' in the default grid layout)."
END
GUI:CommandSlot04
@@ -54,7 +54,7 @@ GUI:CommandSlot04
END
GUI:CommandSlot04Description
-"Presses command bar slot 04 (column 2, bottom row, 'X' in the default grid layout)."
+"Presses command bar slot 04 (column 4, top row, 'R' in the default grid layout)."
END
GUI:CommandSlot05
@@ -62,7 +62,7 @@ GUI:CommandSlot05
END
GUI:CommandSlot05Description
-"Presses command bar slot 05 (column 3, top row, 'E' in the default grid layout)."
+"Presses command bar slot 05 (column 5, top row, 'T' in the default grid layout)."
END
GUI:CommandSlot06
@@ -70,7 +70,7 @@ GUI:CommandSlot06
END
GUI:CommandSlot06Description
-"Presses command bar slot 06 (column 3, bottom row, 'C' in the default grid layout)."
+"Presses command bar slot 06 (column 6, top row, 'Y' in the default grid layout)."
END
GUI:CommandSlot07
@@ -78,7 +78,7 @@ GUI:CommandSlot07
END
GUI:CommandSlot07Description
-"Presses command bar slot 07 (column 4, top row, 'R' in the default grid layout)."
+"Presses command bar slot 07 (column 1, middle row, 'A' in the default grid layout), where a unit's Attack sits."
END
GUI:CommandSlot08
@@ -86,7 +86,7 @@ GUI:CommandSlot08
END
GUI:CommandSlot08Description
-"Presses command bar slot 08 (column 4, bottom row, 'V' in the default grid layout)."
+"Presses command bar slot 08 (column 2, middle row, 'S' in the default grid layout), where a unit's Stop sits."
END
GUI:CommandSlot09
@@ -94,7 +94,7 @@ GUI:CommandSlot09
END
GUI:CommandSlot09Description
-"Presses command bar slot 09 (column 5, top row, 'T' in the default grid layout)."
+"Presses command bar slot 09 (column 3, middle row, 'D' in the default grid layout), where Attack Move sits."
END
GUI:CommandSlot10
@@ -102,7 +102,7 @@ GUI:CommandSlot10
END
GUI:CommandSlot10Description
-"Presses command bar slot 10 (column 5, bottom row, 'B' in the default grid layout)."
+"Presses command bar slot 10 (column 4, middle row, 'F' in the default grid layout)."
END
GUI:CommandSlot11
@@ -110,7 +110,7 @@ GUI:CommandSlot11
END
GUI:CommandSlot11Description
-"Presses command bar slot 11 (column 6, top row, 'Y' in the default grid layout)."
+"Presses command bar slot 11 (column 5, middle row, 'G' in the default grid layout)."
END
GUI:CommandSlot12
@@ -118,7 +118,7 @@ GUI:CommandSlot12
END
GUI:CommandSlot12Description
-"Presses command bar slot 12 (column 6, bottom row, 'N' in the default grid layout)."
+"Presses command bar slot 12 (column 6, middle row, 'H' in the default grid layout)."
END
GUI:CommandSlot13
@@ -126,7 +126,7 @@ GUI:CommandSlot13
END
GUI:CommandSlot13Description
-"Presses command bar slot 13 (column 7, top row, 'U' in the default grid layout)."
+"Presses command bar slot 13 (column 1, bottom row, 'Z' in the default grid layout), where Eject sits, for a unit's passengers or a building's garrison."
END
GUI:CommandSlot14
@@ -134,55 +134,55 @@ GUI:CommandSlot14
END
GUI:CommandSlot14Description
-"Presses command bar slot 14 (column 7, bottom row, 'M' in the default grid layout)."
+"Presses command bar slot 14 (column 2, bottom row, 'X' in the default grid layout), where Guard sits."
END
-GUI:TogglePurchaseScience
-"Generals Promotions"
+GUI:CommandSlot15
+"Command Bar Slot 15"
END
-GUI:TogglePurchaseScienceDescription
-"Opens and closes the general's promotion screen."
+GUI:CommandSlot15Description
+"Presses command bar slot 15 (column 3, bottom row, 'C' in the default grid layout), where Hold Position sits."
END
-GUI:Stop
-"Stop"
+GUI:CommandSlot16
+"Command Bar Slot 16"
END
-GUI:StopDescription
-"Stops what the selected units are doing."
+GUI:CommandSlot16Description
+"Presses command bar slot 16 (column 4, bottom row, 'V' in the default grid layout)."
END
-GUI:ToggleAttackMove
-"Attack Move"
+GUI:CommandSlot17
+"Command Bar Slot 17"
END
-GUI:ToggleAttackMoveDescription
-"Arms attack move: left click where the selected units should go, fighting anything they meet on the way, or drag the left button to spread them along a line. Right click puts it down."
+GUI:CommandSlot17Description
+"Presses command bar slot 17 (column 5, bottom row, 'B' in the default grid layout), where a building's rally point sits."
END
-GUI:ToggleForceAttack
-"Attack"
+GUI:CommandSlot18
+"Command Bar Slot 18"
END
-GUI:ToggleForceAttackDescription
-"Arms force fire: the next left click is an attack on whatever is under it, your own units and bare ground included. Right click puts it down."
+GUI:CommandSlot18Description
+"Presses command bar slot 18 (column 6, bottom row, 'N' in the default grid layout), where Sell sits."
END
-GUI:ToggleGuard
-"Guard"
+GUI:TogglePurchaseScience
+"Generals Promotions"
END
-GUI:ToggleGuardDescription
-"Arms guard: left click posts the selected units on that spot, and a left drag posts them along the line you draw. Right click puts it down."
+GUI:TogglePurchaseScienceDescription
+"Opens and closes the general's promotion screen."
END
-GUI:HoldPosition
-"Hold Position"
+GUI:Stop
+"Stop"
END
-GUI:HoldPositionDescription
-"Every selected unit guards the spot it is standing on: it shoots what comes into range and never chases it."
+GUI:StopDescription
+"Stops what the selected units are doing."
END
// Smoke signals. The three ...Placed lines are what an ally reads; %s is the sender's name. The
@@ -818,30 +818,6 @@ GUI:OptionsGroupInput
"Input"
END
-GUI:InputScheme
-"Mouse and Keyboard"
-END
-
-GUI:InputScheme0
-"Modern"
-END
-
-GUI:InputScheme1
-"Legacy"
-END
-
-TOOLTIP:InputScheme
-"Modern: left selects, right orders, the middle button moves the camera and the grid keys run the command bar. Legacy: the mouse and keys the game shipped with, without any of the additions."
-END
-
-GUI:WasdCamera
-"W A S D Camera"
-END
-
-TOOLTIP:WasdCamera
-"W A S D move the camera. F attacks, G stops, H attack-moves, J guards and K holds position, and the command bar's top row reads Q E R T Y U I. Modern input only."
-END
-
GUI:ChromaLighting
"Razer Chroma Lighting"
END
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index f4ab0ec04..3664a928d 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -14634,7 +14634,7 @@ GUI:CommandSlot01
END
GUI:CommandSlot01Description
-"Komut çubuğu yuvası 01'e basar (sütun 1, üst sıra, varsayılan ızgara düzeninde 'Q')."
+"Komut çubuğunun 1. yuvasına basar (1. sütun, üst sıra; varsayılan ızgara düzeninde 'Q')."
END
GUI:CommandSlot02
@@ -14642,7 +14642,7 @@ GUI:CommandSlot02
END
GUI:CommandSlot02Description
-"Komut çubuğu yuvası 02'ye basar (sütun 1, alt sıra, varsayılan ızgara düzeninde 'Z')."
+"Komut çubuğunun 2. yuvasına basar (2. sütun, üst sıra; varsayılan ızgara düzeninde 'W')."
END
GUI:CommandSlot03
@@ -14650,7 +14650,7 @@ GUI:CommandSlot03
END
GUI:CommandSlot03Description
-"Komut çubuğu yuvası 03'e basar (sütun 2, üst sıra, varsayılan ızgara düzeninde 'W')."
+"Komut çubuğunun 3. yuvasına basar (3. sütun, üst sıra; varsayılan ızgara düzeninde 'E')."
END
GUI:CommandSlot04
@@ -14658,7 +14658,7 @@ GUI:CommandSlot04
END
GUI:CommandSlot04Description
-"Komut çubuğu yuvası 04'e basar (sütun 2, alt sıra, varsayılan ızgara düzeninde 'X')."
+"Komut çubuğunun 4. yuvasına basar (4. sütun, üst sıra; varsayılan ızgara düzeninde 'R')."
END
GUI:CommandSlot05
@@ -14666,7 +14666,7 @@ GUI:CommandSlot05
END
GUI:CommandSlot05Description
-"Komut çubuğu yuvası 05'e basar (sütun 3, üst sıra, varsayılan ızgara düzeninde 'E')."
+"Komut çubuğunun 5. yuvasına basar (5. sütun, üst sıra; varsayılan ızgara düzeninde 'T')."
END
GUI:CommandSlot06
@@ -14674,7 +14674,7 @@ GUI:CommandSlot06
END
GUI:CommandSlot06Description
-"Komut çubuğu yuvası 06'ya basar (sütun 3, alt sıra, varsayılan ızgara düzeninde 'C')."
+"Komut çubuğunun 6. yuvasına basar (6. sütun, üst sıra; varsayılan ızgara düzeninde 'Y')."
END
GUI:CommandSlot07
@@ -14682,7 +14682,7 @@ GUI:CommandSlot07
END
GUI:CommandSlot07Description
-"Komut çubuğu yuvası 07'ye basar (sütun 4, üst sıra, varsayılan ızgara düzeninde 'R')."
+"Komut çubuğunun 7. yuvasına basar (1. sütun, orta sıra; varsayılan ızgara düzeninde 'A'). Birliğin Saldır düğmesi buradadır."
END
GUI:CommandSlot08
@@ -14690,7 +14690,7 @@ GUI:CommandSlot08
END
GUI:CommandSlot08Description
-"Komut çubuğu yuvası 08'e basar (sütun 4, alt sıra, varsayılan ızgara düzeninde 'V')."
+"Komut çubuğunun 8. yuvasına basar (2. sütun, orta sıra; varsayılan ızgara düzeninde 'S'). Birliğin Dur düğmesi buradadır."
END
GUI:CommandSlot09
@@ -14698,7 +14698,7 @@ GUI:CommandSlot09
END
GUI:CommandSlot09Description
-"Komut çubuğu yuvası 09'a basar (sütun 5, üst sıra, varsayılan ızgara düzeninde 'T')."
+"Komut çubuğunun 9. yuvasına basar (3. sütun, orta sıra; varsayılan ızgara düzeninde 'D'). Saldırarak İlerle düğmesi buradadır."
END
GUI:CommandSlot10
@@ -14706,7 +14706,7 @@ GUI:CommandSlot10
END
GUI:CommandSlot10Description
-"Komut çubuğunun 10. yuvasına basar (5. sütun, alt sıra; varsayılan ızgara düzeninde 'B')."
+"Komut çubuğunun 10. yuvasına basar (4. sütun, orta sıra; varsayılan ızgara düzeninde 'F')."
END
GUI:CommandSlot11
@@ -14714,7 +14714,7 @@ GUI:CommandSlot11
END
GUI:CommandSlot11Description
-"Komut çubuğunun 11. yuvasına basar (6. sütun, üst sıra; varsayılan ızgara düzeninde 'Y')."
+"Komut çubuğunun 11. yuvasına basar (5. sütun, orta sıra; varsayılan ızgara düzeninde 'G')."
END
GUI:CommandSlot12
@@ -14722,7 +14722,7 @@ GUI:CommandSlot12
END
GUI:CommandSlot12Description
-"Komut çubuğunun 12. yuvasına basar (6. sütun, alt sıra; varsayılan ızgara düzeninde 'N')."
+"Komut çubuğunun 12. yuvasına basar (6. sütun, orta sıra; varsayılan ızgara düzeninde 'H')."
END
GUI:CommandSlot13
@@ -14730,7 +14730,7 @@ GUI:CommandSlot13
END
GUI:CommandSlot13Description
-"Komut çubuğunun 13. yuvasına basar (7. sütun, üst sıra; varsayılan ızgara düzeninde 'U')."
+"Komut çubuğunun 13. yuvasına basar (1. sütun, alt sıra; varsayılan ızgara düzeninde 'Z'). Tahliye düğmesi buradadır: birliğin yolcularını ya da binadaki garnizonu indirir."
END
GUI:CommandSlot14
@@ -14738,51 +14738,51 @@ GUI:CommandSlot14
END
GUI:CommandSlot14Description
-"Komut çubuğunun 14. yuvasına basar (7. sütun, alt sıra; varsayılan ızgara düzeninde 'M')."
+"Komut çubuğunun 14. yuvasına basar (2. sütun, alt sıra; varsayılan ızgara düzeninde 'X'). Koru düğmesi buradadır."
END
-GUI:TogglePurchaseScience
-"General Terfileri"
+GUI:CommandSlot15
+"Komut Çubuğu Yuvası 15"
END
-GUI:TogglePurchaseScienceDescription
-"General terfi ekranını açar ve kapatır."
+GUI:CommandSlot15Description
+"Komut çubuğunun 15. yuvasına basar (3. sütun, alt sıra; varsayılan ızgara düzeninde 'C'). Mevzini Koru düğmesi buradadır."
END
-GUI:StopDescription
-"Seçili birliklerin yaptığı işi durdurur."
+GUI:CommandSlot16
+"Komut Çubuğu Yuvası 16"
END
-GUI:ToggleAttackMove
-"Saldırarak İlerle"
+GUI:CommandSlot16Description
+"Komut çubuğunun 16. yuvasına basar (4. sütun, alt sıra; varsayılan ızgara düzeninde 'V')."
END
-GUI:ToggleAttackMoveDescription
-"Saldırarak ilerleme modunu açar: seçili birliklerin gideceği yere sol tıklayın, yolda karşılaştıkları her şeyle çarpışsınlar. Onları bir hat boyunca yaymak için sol tuşu sürükleyin. Sağ tıklama modu kapatır."
+GUI:CommandSlot17
+"Komut Çubuğu Yuvası 17"
END
-GUI:ToggleForceAttack
-"Saldır"
+GUI:CommandSlot17Description
+"Komut çubuğunun 17. yuvasına basar (5. sütun, alt sıra; varsayılan ızgara düzeninde 'B'). Binanın toplanma noktası düğmesi buradadır."
END
-GUI:ToggleForceAttackDescription
-"Zorla saldırı modunu açar: sonraki sol tıklama, altındaki her şeye saldırı emridir; kendi birlikleriniz ve boş zemin de dahil. Sağ tıklama modu kapatır."
+GUI:CommandSlot18
+"Komut Çubuğu Yuvası 18"
END
-GUI:ToggleGuard
-"Koru"
+GUI:CommandSlot18Description
+"Komut çubuğunun 18. yuvasına basar (6. sütun, alt sıra; varsayılan ızgara düzeninde 'N'). Sat düğmesi buradadır."
END
-GUI:ToggleGuardDescription
-"Koruma modunu açar: sol tıklama seçili birlikleri o noktaya yerleştirir, sol tuşla sürüklemek onları çizdiğiniz hat boyunca dizer. Sağ tıklama modu kapatır."
+GUI:TogglePurchaseScience
+"General Terfileri"
END
-GUI:HoldPosition
-"Mevzini Koru"
+GUI:TogglePurchaseScienceDescription
+"General terfi ekranını açar ve kapatır."
END
-GUI:HoldPositionDescription
-"Seçili her birlik durduğu noktayı korur: menzile gireni vurur ama asla peşine düşmez."
+GUI:StopDescription
+"Seçili birliklerin yaptığı işi durdurur."
END
GUI:SignalAttack
@@ -15377,30 +15377,6 @@ GUI:OptionsGroupInput
"Kontrol Düzeni"
END
-GUI:InputScheme
-"Fare ve Klavye"
-END
-
-GUI:InputScheme0
-"Modern"
-END
-
-GUI:InputScheme1
-"Legacy"
-END
-
-TOOLTIP:InputScheme
-"Modern: sol tık seçer, sağ tık emir verir, orta tuş kamerayı gezdirir, komut çubuğu ızgara tuşlarıyla kullanılır. Legacy: oyunun çıktığı hâldeki fare ve tuşlar, sonradan eklenenlerin hiçbiri olmadan."
-END
-
-GUI:WasdCamera
-"W A S D Kamera"
-END
-
-TOOLTIP:WasdCamera
-"W A S D kamerayı gezdirir. F saldırır, G durdurur, H saldırarak ilerler, J gözcü koyar, K konumu korur; komut çubuğunun üst sırası Q E R T Y U I olur. Yalnızca Modern girişte."
-END
-
GUI:ChromaLighting
"Razer Chroma Işıkları"
END
diff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
index 51f9c89d3..4f806cfba 100644
--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html
+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html
@@ -2,8 +2,8 @@
<!--
The command bar's frame, drawn where its three plates used to be, and the bar's own buttons, laid
out the way the owner drew them on 2026-09-28 (docs/plans/HUD-REDESIGN.md): the radar in the
- bottom left corner with the experience bar beside it, the command panel with the portrait bar on
- it, the Q and W worker bars with the power bar standing up after them; over the radar the idle
+ bottom left corner with the experience bar beside it, the command grid with the portrait bar on
+ it and the power bar standing up after it; over the radar the idle
worker's key on the skills key on the under-attack light, and the smoke signals; the money at the
screen's top. Laid out at ControlBarHudScale(), 70 percent of the uniform scale the tooltips and
the boards use. The command buttons, the radar, the money and the
@@ -41,13 +41,13 @@
its black line
data-each="rankstars" a star for every rank there is, {{lit}} "lit" up to the one reached, at
{{x}} inside the 58 wide key so the row is centred on it
- data-each="commandcells" each {{cell.x}} .y .w .h: the command panel's places that hold a command
- (five abilities and upgrades; attack, stop, attack move; eject, seek
- shelter, guard, hold position), an empty one left as steel, and every
- place of the worker bars, eight each
+ data-each="commandcells" each {{cell.x}} .y .w .h: the command grid's places that hold a command,
+ six by three, each its key (Q W E R T Y, A S D F G H, Z X C V B N), an
+ empty one left as steel; its cells are a fifth bigger than the others
{{attackkey.x}} ... the attack and hold position places, where the page's own keys stand,
{{holdkey.x}} ... data-click="order:attack" and "order:hold", for a selection that attack
- moves; no command set has a button for either
+ moves; no command set has a button for either. .key is the key bound
+ to that place, "A" and "H" as shipped
data-each="portraitcells" the portrait bar's cells, the portrait's first and then only what it
holds, each {{cell.x}} .y .w .h
{{skilltray.x}} ... the general's powers' tray, a panel as {{centre.x}} is, only as big as the
@@ -69,14 +69,14 @@
{{panelN.shown}} is "hidden" when a minimised bar has stood it down
{{left.x}} .y .w .h the panels, each a container and a border outside it: .x and .y the
{{centre.x}} ... border's outer corner, .w and .h the container, exactly what it holds (the
- {{portrait.x}} ... radar and the experience bar; the command panel's places; the portrait
- {{qbar.x}} ... bar's; each worker bar's), and .bt .br .bb .bl the border's four widths,
- {{wbar.x}} ... out to the screen's edge on the sides against it
+ {{portrait.x}} ... radar and the experience bar; the command grid and the power groove; the
+ portrait bar's), and .bt .br .bb .bl the border's four widths, out to the
+ screen's edge on the sides against it
{{alerttab.x}} ... the under-attack light, a tab on the radar panel's top edge at its left
{{skillstab.x}} ... hand end, and on it the skills key: the rank's stars, pressed through
data-click="press:ButtonGeneral" for the promotion screen
{{idletab.x}} ... the idle worker's key in a tab on the skills key
- {{powerframe.x}} ... the power bar's groove inside the W bar's frame, after its grid;
+ {{powerframe.x}} ... the power bar's groove inside the command grid's frame, after the grid;
{{powerframe.inner}} the width inside the frame and its lip
{{moneyplate.x}} ... the money's plate hanging from the screen's top edge in its middle, and
{{moneyblock.x}} ... the dark well in it the money's window is moved into
@@ -271,6 +271,9 @@
.order .glow { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-size: 100% 100%; background-repeat: no-repeat; }
.order:hover .glow { background-image: url(Cameo_hilited); }
.held .order:hover .glow { background-image: url(Cameo_push); }
+ /* the key in the top left corner, the way the command buttons wear theirs */
+ .order .keyname { position: absolute; left: 0; top: 0; padding: 0 1px; line-height: 7px; font-size: 7px;
+ background-color: rgba(0, 0, 0, 0.6); color: #ffffff; }
/* the under-attack light: a red lamp in a tab on the radar's bezel, dark until the bar blinks it.
The tab is 66 by 14 and the lamp a bar 54 by 10 with its rim */
@@ -359,20 +362,8 @@
<div class="shade" style="right: -{{centre.br}}px; top: -{{centre.bt}}px; bottom: -{{centre.bb}}px"></div>
<div class="sunk grid" style="width: {{centre.w}}px; height: {{centre.h}}px"></div>
</div>
- <div class="piece frame bezel solid {{qbar.shown}}" style="left: {{qbar.x}}px; top: {{qbar.y}}px; width: {{qbar.w}}px; height: {{qbar.h}}px; border-width: {{qbar.bt}}px {{qbar.br}}px {{qbar.bb}}px {{qbar.bl}}px">
- <div class="steel" style="left: -{{qbar.bl}}px; right: -{{qbar.br}}px; top: -{{qbar.bt}}px; bottom: -{{qbar.bb}}px"></div>
- <div class="lit" style="left: -{{qbar.bl}}px; top: -{{qbar.bt}}px; bottom: -{{qbar.bb}}px"></div>
- <div class="shade" style="right: -{{qbar.br}}px; top: -{{qbar.bt}}px; bottom: -{{qbar.bb}}px"></div>
- <div class="sunk grid" style="width: {{qbar.w}}px; height: {{qbar.h}}px"></div>
- </div>
- <div class="piece frame bezel solid {{wbar.shown}}" style="left: {{wbar.x}}px; top: {{wbar.y}}px; width: {{wbar.w}}px; height: {{wbar.h}}px; border-width: {{wbar.bt}}px {{wbar.br}}px {{wbar.bb}}px {{wbar.bl}}px">
- <div class="steel" style="left: -{{wbar.bl}}px; right: -{{wbar.br}}px; top: -{{wbar.bt}}px; bottom: -{{wbar.bb}}px"></div>
- <div class="lit" style="left: -{{wbar.bl}}px; top: -{{wbar.bt}}px; bottom: -{{wbar.bb}}px"></div>
- <div class="shade" style="right: -{{wbar.br}}px; top: -{{wbar.bt}}px; bottom: -{{wbar.bb}}px"></div>
- <div class="sunk grid" style="width: {{wbar.w}}px; height: {{wbar.h}}px"></div>
- </div>
- <!-- the power bar standing up in its groove at the W bar's right, the way the experience bar
- stands beside the radar -->
+ <!-- the power bar standing up in its groove at the command grid's right, the way the experience
+ bar stands beside the radar -->
<div class="piece groove solid stack {{powerframe.shown}}" style="left: {{powerframe.x}}px; top: {{powerframe.y}}px; width: {{powerframe.w}}px; height: {{powerframe.h}}px">
<div class="cells {{power.state}}" style="width: {{powerframe.inner}}px"><div class="cell {{lit}}" data-each="powercells" style="top: {{y}}px; height: {{h}}px; width: {{powerframe.inner}}px"><div class="seg" style="width: {{powerframe.inner}}px; height: {{segh}}px"></div></div></div>
<div class="lip"></div>
@@ -398,8 +389,8 @@
</div>
<div class="piece commandcell" data-each="commandcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
<div class="piece commandcell" data-each="portraitcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>
- <div class="piece order attack {{attackkey.shown}}" data-click="order:attack" style="left: {{attackkey.x}}px; top: {{attackkey.y}}px; width: {{attackkey.w}}px; height: {{attackkey.h}}px"><div class="glow"></div></div>
- <div class="piece order hold {{holdkey.shown}}" data-click="order:hold" style="left: {{holdkey.x}}px; top: {{holdkey.y}}px; width: {{holdkey.w}}px; height: {{holdkey.h}}px"><div class="glow"></div></div>
+ <div class="piece order attack {{attackkey.shown}}" data-click="order:attack" style="left: {{attackkey.x}}px; top: {{attackkey.y}}px; width: {{attackkey.w}}px; height: {{attackkey.h}}px"><div class="glow"></div><div class="keyname">{{attackkey.key}}</div></div>
+ <div class="piece order hold {{holdkey.shown}}" data-click="order:hold" style="left: {{holdkey.x}}px; top: {{holdkey.y}}px; width: {{holdkey.w}}px; height: {{holdkey.h}}px"><div class="glow"></div><div class="keyname">{{holdkey.key}}</div></div>
<div class="piece frame bezel solid {{skilltray.shown}}" style="left: {{skilltray.x}}px; top: {{skilltray.y}}px; width: {{skilltray.w}}px; height: {{skilltray.h}}px; border-width: {{skilltray.bt}}px {{skilltray.br}}px {{skilltray.bb}}px {{skilltray.bl}}px">
<div class="steel" style="left: -{{skilltray.bl}}px; right: -{{skilltray.br}}px; top: -{{skilltray.bt}}px; bottom: -{{skilltray.bb}}px"></div>
diff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
index 07d296095..824b45efb 100644
--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
@@ -7233,344 +7233,9 @@ WINDOW
STATICTEXTDATA = CENTERED: 0;
END
CHILD
- WINDOW
- WINDOWTYPE = STATICTEXT;
- SCREENRECT = UPPERLEFT: 530 182, BOTTOMRIGHT: 754 206, CREATIONRESOLUTION: 800 600;
- NAME = "OptionsMenu.wnd:LabelInputScheme";
- TOOLTIPTEXT = "TOOLTIP:InputScheme";
- STATUS = ENABLED;
- STYLE = STATICTEXT+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 14, BOLD: 0;
- HEADERTEMPLATE = "MinorTitle";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:InputScheme";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
- STATICTEXTDATA = CENTERED: 0;
- END
- CHILD
- WINDOW
- WINDOWTYPE = COMBOBOX;
- SCREENRECT = UPPERLEFT: 536 206, BOTTOMRIGHT: 760 230, CREATIONRESOLUTION: 800 600;
- NAME = "OptionsMenu.wnd:ComboBoxInputScheme";
- TOOLTIPTEXT = "TOOLTIP:InputScheme";
- STATUS = ENABLED+IMAGE;
- STYLE = MOUSETRACK+COMBOBOX;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
- HEADERTEMPLATE = "ComboBoxEntry";
- TOOLTIPDELAY = -1;
- TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXDATA = ISEDITABLE: 0,
- MAXCHARS: 16,
- MAXDISPLAY: 5,
- ASCIIONLY: 0,
- LETTERSANDNUMBERS: 0;
- COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: TextEntryEnabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,
- IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: TextEntryDisabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: TextEntryHiliteSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,
- IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- END
- CHILD
- WINDOW
- WINDOWTYPE = CHECKBOX;
- SCREENRECT = UPPERLEFT: 536 238, BOTTOMRIGHT: 760 262, CREATIONRESOLUTION: 800 600;
- NAME = "OptionsMenu.wnd:CheckWasdCamera";
- STATUS = ENABLED+IMAGE+BORDER;
- STYLE = CHECKBOX+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 14, BOLD: 0;
- HEADERTEMPLATE = "MinorTitle";
- TOOLTIPTEXT = "TOOLTIP:WasdCamera";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:WasdCamera";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 186 255 12 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: Active-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,
- IMAGE: Active-Checked, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 255 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
- IMAGE: Disabled-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 192 192 192 255,
- IMAGE: Disabled-Checked, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,
- IMAGE: Active-HiLighted, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,
- IMAGE: Active-Checked, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- END
- CHILD
WINDOW
WINDOWTYPE = CHECKBOX;
- SCREENRECT = UPPERLEFT: 536 266, BOTTOMRIGHT: 760 290, CREATIONRESOLUTION: 800 600;
+ SCREENRECT = UPPERLEFT: 536 182, BOTTOMRIGHT: 760 206, CREATIONRESOLUTION: 800 600;
NAME = "OptionsMenu.wnd:CheckChromaLighting";
STATUS = ENABLED+IMAGE+BORDER;
STYLE = CHECKBOX+MOUSETRACK;
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
index c698a0652..0e5bea2c3 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
@@ -72,17 +72,6 @@ enum HealthBarModeType
HEALTH_BAR_MODE_COUNT = 4,
};
-/** How the mouse and the keyboard give orders. Modern is this fork's: left selects, right orders, the
- * middle button drives the camera and the grid keys run the command bar. Legacy is the game as it
- * shipped, keys and all, with none of what this fork added to either. */
-enum InputSchemeType
-{
- INPUT_SCHEME_MODERN = 0,
- INPUT_SCHEME_LEGACY = 1,
-
- INPUT_SCHEME_COUNT = 2,
-};
-
/** The language the game's words are shown in. English is the string table EA shipped; every other
* entry names a translation GameText lays over it. Speech and video stay what the install has. */
enum TextLanguageType
@@ -318,10 +307,6 @@ public:
Int m_healthBarMode; ///< HealthBarModeType: which units wear a bar at all
Int m_playerColorScheme; ///< PlayerColorSchemeType: whose colour the client draws (client only)
Int m_textLanguage; ///< TextLanguageType: the translation GameText lays over the CSF, read once at startup (client only)
- Int m_inputScheme; ///< InputSchemeType: which mouse and keyboard the client answers to, read on every click and key (client only)
- Bool isLegacyInput( void ) const { return m_inputScheme == INPUT_SCHEME_LEGACY; }
- Bool m_wasdCamera; ///< W A S D scroll the camera and the unit keys move to F G H J K; Modern input only (client only)
- Bool isWasdCamera( void ) const { return m_wasdCamera && !isLegacyInput(); }
Bool m_showOrderLines; ///< draw a line from each selected unit to where it is going, and its queue (client only)
Bool m_scriptDebug; ///< Should we attempt to load the script debugger window (.DLL)
Bool m_particleEdit; ///< Should we attempt to load the particle editor (.DLL)
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
index 27b16a124..978085716 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
@@ -225,8 +225,8 @@ public:
MSG_META_SELECT_PREV_WORKER, ///< select 'prev' worker
MSG_META_SELECT_NEXT_IDLE_WORKER, ///< select 'next' idle worker
- // command-bar grid hot keys: one per visible command button, laid out 7 columns x 2 rows
- // (slot 01/02 = column 1 top/bottom, 03/04 = column 2, ... 13/14 = column 7)
+ // command-bar grid hot keys: one per place of the 6 x 3 command grid, read along the rows
+ // (01-06 the top row, 07-12 the middle one, 13-18 the bottom); see CommandPlace
MSG_META_COMMAND_SLOT01, ///< press command bar slot 01
MSG_META_COMMAND_SLOT02, ///< press command bar slot 02
MSG_META_COMMAND_SLOT03, ///< press command bar slot 03
@@ -241,6 +241,10 @@ public:
MSG_META_COMMAND_SLOT12, ///< press command bar slot 12
MSG_META_COMMAND_SLOT13, ///< press command bar slot 13
MSG_META_COMMAND_SLOT14, ///< press command bar slot 14
+ MSG_META_COMMAND_SLOT15, ///< press command bar slot 15
+ MSG_META_COMMAND_SLOT16, ///< press command bar slot 16
+ MSG_META_COMMAND_SLOT17, ///< press command bar slot 17
+ MSG_META_COMMAND_SLOT18, ///< press command bar slot 18
MSG_META_SHORTCUT_SLOT01, ///< press general's power shortcut bar slot 01 (F1)
MSG_META_SHORTCUT_SLOT02, ///< press general's power shortcut bar slot 02
MSG_META_SHORTCUT_SLOT03, ///< press general's power shortcut bar slot 03
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index bd621a1ac..9c6cadb52 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -421,31 +421,51 @@ Int getBuildBatchCount( void );
enum { MAX_COMMANDS_PER_SET = 18 }; // user interface max is 14 (but internally it's 18 for script only buttons!)
-/** The places the bar's page lays a command set out in: the command panel's three rows and the two
- * worker bars. See ControlBar_commandPlaces. */
+/** The command grid, six places across and three down, read along the rows. A place is its key:
+ * COMMAND_SLOTnn is bound to place nn - 1, Q W E R T Y over A S D F G H over Z X C V B N as shipped.
+ * See ControlBar_commandPlaces. */
enum CommandPlace
{
- COMMAND_PLACE_SKILL = 0, ///< the command panel's top row, the unit's own abilities and upgrades
- COMMAND_PLACE_SKILLS = 5,
- COMMAND_PLACE_ATTACK = 5, ///< its second row: attack, stop, attack move
- COMMAND_PLACE_STOP,
- COMMAND_PLACE_ATTACK_MOVE,
- COMMAND_PLACE_EJECT, ///< its third row: eject, seek shelter, guard, hold position
- COMMAND_PLACE_SHELTER,
- COMMAND_PLACE_GUARD,
- COMMAND_PLACE_HOLD,
- COMMAND_PLACE_Q, ///< the Q worker bar, one place for each slot of the Q structure chord
- COMMAND_PLACE_W = COMMAND_PLACE_Q + 8, ///< the W worker bar, the W chord's
- COMMAND_PLACE_COUNT = COMMAND_PLACE_W + 8
+ COMMAND_PLACE_Q = 0,
+ COMMAND_PLACE_W,
+ COMMAND_PLACE_E,
+ COMMAND_PLACE_R,
+ COMMAND_PLACE_T,
+ COMMAND_PLACE_Y,
+ COMMAND_PLACE_A,
+ COMMAND_PLACE_S,
+ COMMAND_PLACE_D,
+ COMMAND_PLACE_F,
+ COMMAND_PLACE_G,
+ COMMAND_PLACE_H,
+ COMMAND_PLACE_Z,
+ COMMAND_PLACE_X,
+ COMMAND_PLACE_C,
+ COMMAND_PLACE_V,
+ COMMAND_PLACE_B,
+ COMMAND_PLACE_N,
+ COMMAND_PLACE_COUNT,
+ COMMAND_PLACE_COLUMNS = 6,
+
+ // the owner's fixed places, 2026-09-28: a unit's orders under the left hand, a building's on the right
+ COMMAND_PLACE_ATTACK = COMMAND_PLACE_A,
+ COMMAND_PLACE_STOP = COMMAND_PLACE_S,
+ COMMAND_PLACE_ATTACK_MOVE = COMMAND_PLACE_D,
+ COMMAND_PLACE_EJECT = COMMAND_PLACE_Z, ///< a transport's passengers out, or a building's garrison
+ COMMAND_PLACE_GUARD = COMMAND_PLACE_X,
+ COMMAND_PLACE_HOLD = COMMAND_PLACE_C,
+ COMMAND_PLACE_RALLY = COMMAND_PLACE_B,
+ COMMAND_PLACE_SELL = COMMAND_PLACE_N
};
/** Where each of `count` command slots stands: `types` is what each slot holds, GUI_COMMAND_NONE for
- * an empty one, and `places` gets a CommandPlace for each or -1. A stop, an attack move, a guard
- * and an evacuate go to their own places; a structure, a unit to build and a passenger's exit go to
- * the worker bars by slot, the first eight to Q and the rest to W, where the structure chord's keys
- * find them; everything else runs along the top row in slot order and spills into the worker bars'
- * free places. */
-void ControlBar_commandPlaces( const Int *types, Int count, Int *places );
+ * an empty one, and `places` gets a CommandPlace for each or -1. Stop, attack move, guard, evacuate,
+ * rally point and sell go to their own places. A set with an attack move has attack and hold
+ * position too, keys no command set has a button for, so their two places are kept for them; the
+ * return is TRUE then. Everything else fills the free places in reading order, Q W E R T Y first:
+ * what the set builds (structures, units) in slot order, then the rest - abilities, upgrades,
+ * passengers - in slot order, so a building's upgrades come after its production. */
+Bool ControlBar_commandPlaces( const Int *types, Int count, Int *places );
enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 5};
enum { MAX_MULTI_SELECT_GROUPS = 36 }; ///< unit types a multi-selection tells apart (6x6 grid, Tab focus)
enum {
@@ -786,9 +806,18 @@ public:
GadgetGameMessage gadgetMessage );
- /** press a command bar button by its slot index (0..MAX_COMMANDS_PER_SET-1), exactly as
- a mouse click would. This is what the COMMAND_SLOTnn grid keys are wired to. */
- void pressCommandButton( Int index );
+ /** press the command at grid place `place` (a CommandPlace), exactly as a mouse click would.
+ This is what the COMMAND_SLOTnn grid keys are wired to. Where the place holds one of the
+ orders every unit shares, or nothing, the key sends that order's own message, the one its
+ key sent before the grid took it: A force fire, S stop, D attack move, X guard, C hold. */
+ void pressCommandButton( Int place );
+
+ /** The place each command window stands at right now, -1 for a hidden one, and whether the
+ attack and hold places hold the page's two orders. `places` has MAX_COMMANDS_PER_SET. */
+ Bool getCommandPlaces( Int *places ) const;
+
+ /** paint each command window's key, its place's, in its top left corner; `places` as above */
+ void labelCommandPlaces( const Int *places );
/** The general's powers are laid out SPECIAL_POWER_SHORTCUT_COLS to a row, so one key press
cannot reach eleven of them. The first press picks a row (F1 is the row in the corner,
@@ -803,26 +832,24 @@ public:
/** What a press would do this instant, for whoever shows the bar somewhere other than the
screen - the hardware lighting is the one that does. These run the same resolution the two
- press calls above run, chords and all, and stop short of pressing: a second copy of that
- logic kept elsewhere is a copy that goes stale, and this file has been bitten by one already.
- button comes back as the window the press would reach. For a press that only arms a chord
- it is the first window in the armed group that would take the second key, or NULL when the
- group holds nothing to press, so a caller can tell a chord worth starting from an empty one. */
+ press calls above run and stop short of pressing: a second copy of that logic kept elsewhere
+ is a copy that goes stale, and this file has been bitten by one already. button comes back
+ as the window the press would reach. For a tray key that only picks a row it is the first
+ window in that row, or NULL when the row holds nothing to press. */
enum PressOutcome
{
PRESS_DOES_NOTHING, ///< no button behind this key right now
- PRESS_ARMS_CHORD, ///< first half of a two key chord
+ PRESS_ARMS_CHORD, ///< first half of the powers tray's two key press
PRESS_IS_REFUSED, ///< a button is there and it is disabled
PRESS_FIRES ///< the button would take it
};
PressOutcome peekCommandButtonPress( Int index, GameWindow **button );
PressOutcome peekSpecialPowerShortcutPress( Int index, GameWindow **button );
- /** Where a press lands: a slot index, or one of these two. The two functions below are the
- whole decision and touch no window, so the tests can hold every row of it; the press calls
- and the peek calls gather what is on the bar and ask them. */
+ /** Where a tray key lands: a slot index, or one of these two. resolveTrayPress is the whole
+ decision and touches no window, so the tests can hold every row of it; the press and the peek
+ calls gather what is on the tray and ask it. */
enum { SLOT_NOTHING = -1, SLOT_ARMS_CHORD = -2 };
- static Int resolveGridPress( Int index, Int chordGroup, Bool hasStructures, Bool indexIsStructure );
static Int resolveTrayPress( Int index, Int armedRow, Int visibleSlots );
/** The promotion screen answers the group keys while it is open: 1 to 5 name its five columns.
@@ -847,22 +874,8 @@ public:
Shift-Tab (-1) walk the focus between them */
void cycleMultiSelectFocus( Int direction );
- /** a builder's structures are reached by a two-key chord: the Q cell (slot 0) arms the
- structures in columns 1-4 (slots 0..7), the W cell (slot 2) the ones in columns 5-7
- (slots 8..), then the next grid key picks the cell within the group by its own position */
- enum { CHORD_SLOT_Q = 0, CHORD_SLOT_W = 2, CHORD_GROUP_SIZE = 8 };
-
- /** a raw key while a chord is armed: the key of one of the group's own cells (the grid's
- slots 0..7 - Q Z W X E C R V as shipped) resolves the chord and returns TRUE (the key is
- eaten), anything else drops it */
- Bool handleChordKey( Int mappableKey );
- Bool isChordArmed( void ) const { return m_chordGroup >= 0; }
-
- /** forget a half-typed chord. An armed chord swallows the next grid key and turns it into
- a structure to place, so anything that says the player has moved on
- (a click, a new selection, a key that is not part of the chord, or simply time passing)
- must drop it. */
- void dropChord( void );
+ /** how long a half-finished two key press waits for its second key, the powers tray's row and
+ the promotion screen's marked column */
enum { CHORD_TIMEOUT_MS = 4000 }; ///< real time, not frames: the client frame rate is uncapped
/// is the drawable the currently selected drawable for the context sensitive UI?
@@ -1207,9 +1220,10 @@ protected:
void arrangeSpecialPowerShortcutGrid( void ); ///< re-lay the layout's single column as rows of SPECIAL_POWER_SHORTCUT_COLS
Int countVisibleSpecialPowerShortcuts( void ); ///< how many slots carry a power right now, which is not the command set's size
- /** Where a press lands with the chords as they stand. The press calls and the peek calls both
- go through these, which is the point of them. */
- Int resolveCommandSlot( Int index, Bool *hasStructures ) const;
+ /** Where a key lands: the command slot at grid place `place`, or SLOT_NOTHING; and the tray slot
+ a shortcut key reaches with its row as it stands. The press calls and the peek calls both go
+ through these, which is the point of them. */
+ Int resolveCommandSlot( Int place ) const;
Int resolveSpecialPowerShortcutSlot( Int index );
static const Image* calculateVeterancyOverlayForThing( const ThingTemplate *thingTemplate );
@@ -1327,9 +1341,6 @@ protected:
CommandButton *m_buildPageBackButton; ///< takes a page back to the menu buttons
Int m_buildPage; ///< BUILD_PAGE_ROOT, or the page being shown
ObjectID m_buildPageObjectID; ///< builder the page belongs to; a new one starts at the menu
- Int m_chordGroup; ///< -1, or the structure group (0 = Q, 1 = W) armed by the first chord key
- UnsignedInt m_chordStartMs; ///< millisecond the chord was armed on, for CHORD_TIMEOUT_MS
- DrawableID m_chordDrawableID; ///< builder the armed chord addresses; the chord dies if the bar moves to another one
/** A player upgrade is researched once, so it goes to exactly one of the selected buildings -
* and the bar cannot see the queue an earlier click in this same frame just filled, because
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
index c5b09903e..48197b53b 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
@@ -79,11 +79,6 @@ class GameTextInterface : public SubsystemInterface
virtual UnicodeString fetch( const Char *label, Bool *exists = NULL ) = 0; ///< Returns the associated labeled unicode text
virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ) = 0; ///< Returns the associated labeled unicode text
- /** The text a label had before the player's translation was laid over it: the CSF, or this
- * fork's own English in Patch.str. Legacy input reads its '&' hot keys from here, because a
- * translation marks letters of its own and those are not the keys the game shipped with. */
- virtual UnicodeString fetchUntranslated( const Char *label ) = 0;
-
// This function is not performance tuned.. Its really only for Worldbuilder. jkmcd
virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label) = 0;
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index 89eb3be4c..1b27bb3e4 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -1113,7 +1113,7 @@ public: // ********************************************************************
void toggleForceAttackArmed( void ) { m_forceAttackArmed = !m_forceAttackArmed; m_attackMoveToMode = FALSE; m_guardArmed = FALSE; }
Bool isForceAttackArmed( void ) const { return m_forceAttackArmed; }
Bool isOrderKeyArmed( void ) const { return m_forceAttackArmed || m_attackMoveToMode || m_guardArmed; } ///< the next left click is an attack, an attack move or a guard
- Bool isForceFireOn( void ) const; ///< the next order click force fires: the attack key armed it, or Legacy's ctrl is held
+ Bool isForceFireOn( void ) const; ///< the next order click force fires: the attack key armed it
// and the guard key arms guard the same way: the next order click posts the selection on that
// spot, or on that object, and a drag posts them along the line instead of stacking them all
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
index a982c8d2d..2d5a8b58f 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
@@ -53,15 +53,13 @@ private:
{
MAX_VIEW_LOCS = 8
};
- // Modern drags the camera with the middle button and gives orders with the right one; Legacy
- // drags it with the right button, the way the game shipped.
+ // the middle button drags the camera; the right one gives orders
enum
{
SCROLL_NONE = 0,
SCROLL_KEY,
SCROLL_SCREENEDGE,
- SCROLL_MMB, // middle-button drag pan, Modern
- SCROLL_RMB // right-button drag pan, Legacy
+ SCROLL_MMB // middle-button drag pan
};
ICoord2D m_anchor;
ICoord2D m_originalAnchor;
@@ -75,7 +73,6 @@ private:
DrawableID m_lastPlaneID;
ViewLocation m_viewLocation[ MAX_VIEW_LOCS ];
Int m_scrollType;
- Bool m_scrollMovesCursor; // the scroll in progress swapped the cursor for the scroll arrows and puts it back when it stops
void setScrolling( Int );
void stopScrolling( void );
Bool networkCameraDue( const ViewLocation &view );
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
index 9f2b83b97..64971cea9 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
@@ -30,7 +30,6 @@
#ifndef _H_MetaEvent
#define _H_MetaEvent
-#include "Common/GlobalData.h"
#include "Common/SubsystemInterface.h"
#include "GameClient/InGameUI.h"
#include "GameClient/KeyDownInfo.h"
@@ -366,11 +365,7 @@ class MetaMap : public SubsystemInterface
friend class MetaEventTranslator;
private:
- /// one list of bindings per InputSchemeType, and a third for Modern with W A S D on the camera
- enum { BINDINGS_WASD = INPUT_SCHEME_COUNT, BINDING_LIST_COUNT };
-
- MetaMapRec *m_metaMaps[ BINDING_LIST_COUNT ];
- Int m_parseScheme; ///< the list parseMetaMap is filling
+ MetaMapRec *m_metaMaps;
protected:
GameMessage::Type findGameMessageMetaType(const char* name);
@@ -387,18 +382,7 @@ public:
static void parseMetaMap(INI* ini);
- /** Fill the Legacy list from the language's CommandMap.ini alone, which is the game's own map out
- * of its own archives. Everything this fork binds is in Data\INI\CommandMapReforged.ini, and only the
- * Modern list reads that. */
- void loadLegacyBindings( const AsciiString& languageMapFile );
-
- /** Fill the W A S D list: a copy of the finished Modern list, in the same order, with overlayFile
- * laid over it. Runs after everything else that binds into Modern, so the copy has it all. */
- void loadWasdBindings( const AsciiString& overlayFile );
-
- /// the bindings the player's InputScheme, and the W A S D box under Modern, answer to
- const MetaMapRec *getFirstMetaMapRec() const;
- const MetaMapRec *getFirstMetaMapRec( Int scheme ) const { return m_metaMaps[ scheme ]; }
+ const MetaMapRec *getFirstMetaMapRec() const { return m_metaMaps; }
};
extern MetaMap *TheMetaMap;
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
index 000d6ee83..4cb9b5b38 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
@@ -54,12 +54,6 @@ private:
ICoord2D m_selectFeedbackAnchor; // Note: Used for drawing feedback only.
Bool m_displayedMaxWarning; // did we already display a warning about selecting too many units?
- // where and when the right button went down, and where the camera was, so a Legacy release can
- // tell a click, which deselects, from the drag that scrolled the camera
- ICoord2D m_rightDownPixel;
- UnsignedInt m_rightDownTime;
- Coord3D m_rightDownCamera;
-
SelectCountMap m_selectCountMap;
// A team key's new members reach the logic a run-ahead after the press in a network game. A
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
index 01e1825e3..3f5d95427 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
@@ -1145,8 +1145,6 @@ void GameEngine::init( int argc, char *argv[] )
AsciiString fname;
fname.format("Data\\%s\\CommandMap.ini", GetRegistryLanguage().str());
initSubsystem(TheMetaMap,"TheMetaMap", MSGNEW("GameEngineSubsystem") MetaMap(), NULL, fname.str(), "Data\\INI\\CommandMapReforged.ini");
- // Legacy mouse and keyboard answers to the game's own map and to nothing this fork binds
- TheMetaMap->loadLegacyBindings(fname);
#if defined(_DEBUG) || defined(_INTERNAL)
ini.load("Data\\INI\\CommandMapDebug.ini", INI_LOAD_MULTIFILE, NULL);
@@ -1156,10 +1154,6 @@ void GameEngine::init( int argc, char *argv[] )
ini.load("Data\\INI\\CommandMapDemo.ini", INI_LOAD_MULTIFILE, NULL);
#endif
- // Modern with W A S D on the camera: everything Modern binds above, and the keys that moves
- TheMetaMap->loadWasdBindings("Data\\INI\\CommandMapWASD.ini");
-
-
initSubsystem(TheActionManager,"TheActionManager", MSGNEW("GameEngineSubsystem") ActionManager(), NULL);
//initSubsystem((CComObject<WebBrowser> *)TheWebBrowser,"(CComObject<WebBrowser> *)TheWebBrowser", (CComObject<WebBrowser> *)createWebBrowser(), NULL);
initSubsystem(TheGameStateMap,"TheGameStateMap", MSGNEW("GameEngineSubsystem") GameStateMap, NULL, NULL, NULL );
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
index 845557c61..c3e160b66 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
@@ -941,10 +941,6 @@ GlobalData::GlobalData()
m_playerColorScheme = PLAYER_COLORS_ORIGINAL;
// the words the game shipped with until somebody picks a translation
m_textLanguage = TEXT_LANGUAGE_ENGLISH;
- // the mouse and keys this fork plays with until somebody asks for the ones the game shipped with
- m_inputScheme = INPUT_SCHEME_MODERN;
- // W A S D stay on the grid and the unit keys until somebody asks for them on the camera
- m_wasdCamera = FALSE;
// the lines have been on since they were added, so nobody loses them until they say so
m_showOrderLines = TRUE;
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
index 73bc97f1f..fbabf1c92 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
@@ -319,6 +319,10 @@ AsciiString GameMessage::getCommandTypeAsAsciiString(GameMessage::Type t)
CHECK_IF(MSG_META_COMMAND_SLOT12)
CHECK_IF(MSG_META_COMMAND_SLOT13)
CHECK_IF(MSG_META_COMMAND_SLOT14)
+ CHECK_IF(MSG_META_COMMAND_SLOT15)
+ CHECK_IF(MSG_META_COMMAND_SLOT16)
+ CHECK_IF(MSG_META_COMMAND_SLOT17)
+ CHECK_IF(MSG_META_COMMAND_SLOT18)
CHECK_IF(MSG_META_SHORTCUT_SLOT01)
CHECK_IF(MSG_META_SHORTCUT_SLOT02)
CHECK_IF(MSG_META_SHORTCUT_SLOT03)
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
index 56ab5757a..c577b47a3 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
@@ -73,8 +73,6 @@ OPTION_BOOL_ACCESSORS( m_classicGraphics )
OPTION_INT_ACCESSORS( m_healthBarMode )
OPTION_INT_ACCESSORS( m_playerColorScheme )
OPTION_INT_ACCESSORS( m_textLanguage )
-OPTION_INT_ACCESSORS( m_inputScheme )
-OPTION_BOOL_ACCESSORS( m_wasdCamera )
OPTION_BOOL_ACCESSORS( m_showOrderLines )
OPTION_BOOL_ACCESSORS( m_useShadowVolumesForSkins )
OPTION_BOOL_ACCESSORS( m_shadowsForProjectiles )
@@ -223,8 +221,7 @@ const OptionDef TheOptionCatalog[] =
// MiddleMousePans used to sit here. The middle button is the only camera drag there is now, so
// there is nothing left to choose: it pans, and Ctrl turns the same drag into a rotate.
- // Back on Options > Controls: players split on whether the wheel should chase the cursor, and
- // Legacy zooms on the middle of the screen whatever this says.
+ // Back on Options > Controls: players split on whether the wheel should chase the cursor.
{ "ZoomToCursor", OPT_WND( "CheckZoomToCursor" ), "GUI:ZoomToCursor",
OPTION_BOOL, APPLY_LIVE, 0, 1,
get_m_zoomToCursor, set_m_zoomToCursor },
@@ -342,9 +339,6 @@ const OptionDef TheOptionCatalog[] =
OPTION_ENUM, APPLY_LIVE, 0, PLAYER_COLOR_SCHEME_COUNT - 1,
get_m_playerColorScheme, set_m_playerColorScheme },
- // Modern or Legacy. Legacy is the mouse and the keys the game shipped with and switches off what
- // this fork added to both. Every click and key asks, so it changes the moment Accept is pressed,
- // and it is local: two players in one match can give orders two different ways.
// The line from each selected unit to where it is going, with every point of a shift queue after
// it. The list is rebuilt from the units every frame, so turning it off takes the lines away at
// once and turning it back on shows the orders already given.
@@ -352,17 +346,6 @@ const OptionDef TheOptionCatalog[] =
OPTION_BOOL, APPLY_LIVE, 0, 1,
get_m_showOrderLines, set_m_showOrderLines },
- { "InputScheme", OPT_WND( "ComboBoxInputScheme" ), "GUI:InputScheme",
- OPTION_ENUM, APPLY_LIVE, 0, INPUT_SCHEME_COUNT - 1,
- get_m_inputScheme, set_m_inputScheme },
-
- // W A S D on the camera, and the keys they held moved to F G H J K. Modern only: the box greys
- // while Legacy is picked, and a tick saved under Modern is kept but ignored until Modern is back.
- // Every key asks, and Accept rebuilds the command bar's letters, so it changes at once.
- { "WasdCamera", OPT_WND( "CheckWasdCamera" ), "GUI:WasdCamera",
- OPTION_BOOL, APPLY_LIVE, 0, 1,
- get_m_wasdCamera, set_m_wasdCamera },
-
// Which language the words are in. English is the string table the game shipped with, and every
// other entry is a translation laid over it, so a line the translation lacks stays English. The
// table is built once while the game starts: a new language is on screen from the next launch.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp
index 64a569cde..f22baa17d 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/ChromaKeyboard.cpp
@@ -132,7 +132,6 @@ static const char *CHROMA_KEY_ROWS[] = { "1234567890", "qwertyuiop", "asdfghjkl"
static const Int CHROMA_KEY_ROW_COUNT = 4;
static const Int CHROMA_KEY_FIRST_COLUMNS[ CHROMA_KEY_ROW_COUNT ] = { 2, 2, 2, 3 };
static const Int CHROMA_POWER_ROW = 0;
-static const Int CHROMA_FIRST_HOTKEY_ROW = 1;
static const Int CHROMA_KEY_FIRST_ROW = 1;
static const Int MATCH_STATE_ROW = 0;
@@ -1405,17 +1404,14 @@ Int chromaCellForMappableKey( Int key )
//-----------------------------------------------------------------------------
// Which lamp each command bar slot and each tray slot answers to under the
// bindings in force, looked up twice a second rather than per lamp per frame.
-// The player can rebind a slot in Options and change scheme mid-match, so it
-// cannot be looked up once. Under Legacy nothing is bound to either and every
-// entry is -1, which is right: there the letters in the labels do the work.
+// The player can rebind a slot in Options mid-match, so it cannot be looked up
+// once.
//-----------------------------------------------------------------------------
/// How many slots of each bar a key can actually reach, counted off the messages
-/// themselves rather than off the arrays behind the bars. The two do not agree:
-/// the command bar holds eighteen slots and only fourteen of them have a key,
-/// the rest being for buttons a map script puts up. Reading the slot out of a
-/// message and bounding it by eighteen therefore ran four slots past the end of
-/// the command messages and into the shortcut ones, and filed the first four
-/// function keys as command bar slots.
+/// themselves rather than off the arrays behind the bars. Bounding a slot read
+/// out of a message by the bar's array once ran past the end of the command
+/// messages and into the shortcut ones, and filed function keys as command bar
+/// slots.
static const Int COMMAND_SLOTS_WITH_KEYS =
(Int)GameMessage::MSG_META_SHORTCUT_SLOT01 - (Int)GameMessage::MSG_META_COMMAND_SLOT01;
static const Int SHORTCUT_SLOTS_WITH_KEYS =
@@ -1490,37 +1486,8 @@ static void chromaRefreshBoundCells( UnsignedInt frame )
}
//-----------------------------------------------------------------------------
-/** The command bar under Legacy input: the letter marked in each button's label,
- * which is what HotKeyManager presses it with.
- *
- * Only under Legacy. The manager is not the command bar's alone - every screen
- * that has ever put a labelled button up has registered its letters there and
- * they stay registered - so under Modern, where the bar binds none of them,
- * this used to light whatever a menu had left behind. */
-static void chromaFillLabelHotKeys( Int *cells, Int pressable, Int unavailable )
-{
- for( Int row = CHROMA_FIRST_HOTKEY_ROW; row < CHROMA_KEY_ROW_COUNT; ++row )
- {
- const char *keys = CHROMA_KEY_ROWS[ row ];
- for( Int column = 0; keys[ column ] != 0; ++column )
- {
- Bool isPressable = FALSE;
- const char keyText[ 2 ] = { keys[ column ], 0 };
- GameWindow *win = TheHotKeyManager->findHotKey( AsciiString( keyText ), &isPressable );
- if( win == NULL )
- continue;
-
- cells[ chromaCellForKey( keys[ column ] ) ] =
- isPressable ? chromaPressableWithClock( pressable, win ) : unavailable;
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-/** The command bar under Modern input: the grid keys, with the builder's two key
- * chord followed. What a key would do comes from the control bar's own
- * resolution of the press, so when Q has armed a group the lamps move onto that
- * group's cells the moment the labels on screen do. */
+/** The command bar: the grid keys. What a key would do comes from the control
+ * bar's own resolution of the press, so the lamps follow the labels on screen. */
static void chromaFillCommandGrid( Int *cells, Int pressable, Int unavailable )
{
for( Int slot = 0; slot < COMMAND_SLOTS_WITH_KEYS; ++slot )
@@ -1847,14 +1814,7 @@ static void chromaFillCells( Int *cells, Bool inMatch )
const Int pressable = factionColor;
const Int unavailable = COLOR_OFF;
- // Two input schemes reach the same buttons by different keys, and exactly one
- // of them is live: Legacy presses the letters in the labels, Modern presses
- // the grid. Whichever is not the player's lights nothing.
- if( TheGlobalData != NULL && TheGlobalData->isLegacyInput() )
- {
- chromaFillLabelHotKeys( cells, pressable, unavailable );
- }
- else if( TheControlBar != NULL )
+ if( TheControlBar != NULL )
{
chromaFillCommandGrid( cells, pressable, unavailable );
chromaFillPowerTray( cells, bed, factionColor, frame );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index fce62b958..cd6a9d920 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -147,162 +147,156 @@ static void commandButtonTooltip(GameWindow *window,
}
//-------------------------------------------------------------------------------------------------
-/** The key command bar slot 'slot' answers to right now, MK_NONE when none does. Read live out of
- the meta map, which is where CommandMap.ini puts the grid: a second copy of those letters here
- is a copy that goes stale, and one did - the chord's second keys stayed Q A W S E D R F long
- after the bottom row of the grid had moved to Z X C V B N M, so half the cells answered to a
- letter that was not written on them and the letter that was fell straight through to the button
- underneath. Rebinding a slot in Options > Keyboard now moves its chord with it. */
+/** The place a command of `type` always stands at, or -1 for one that takes the next free place. */
//-------------------------------------------------------------------------------------------------
-static MappableKeyType getGridHotKey( Int slot )
+static Int fixedCommandPlace( Int type )
{
- if( TheMetaMap == NULL || slot < 0 || slot >= MAX_COMMANDS_PER_SET )
- return MK_NONE;
-
- const GameMessage::Type wanted =
- (GameMessage::Type)( GameMessage::MSG_META_COMMAND_SLOT01 + slot );
-
- for( const MetaMapRec *rec = TheMetaMap->getFirstMetaMapRec(); rec; rec = rec->m_next )
- if( rec->m_meta == wanted && rec->m_modState == 0 )
- return rec->m_key;
-
- return MK_NONE;
-
-} // end getGridHotKey
+ switch( type )
+ {
+ case GUI_COMMAND_STOP: return COMMAND_PLACE_STOP;
+ case GUI_COMMAND_ATTACK_MOVE: return COMMAND_PLACE_ATTACK_MOVE;
+ case GUI_COMMAND_GUARD:
+ case GUI_COMMAND_GUARD_WITHOUT_PURSUIT:
+ case GUI_COMMAND_GUARD_FLYING_UNITS_ONLY: return COMMAND_PLACE_GUARD;
+ case GUI_COMMAND_EVACUATE: return COMMAND_PLACE_EJECT;
+ case GUI_COMMAND_SET_RALLY_POINT: return COMMAND_PLACE_RALLY;
+ case GUI_COMMAND_SELL: return COMMAND_PLACE_SELL;
+ }
+ return -1;
+}
//-------------------------------------------------------------------------------------------------
-/** Which slot a press on the grid key for 'index' lands on with the structure chord as it
- stands, or SLOT_ARMS_CHORD for a press that would only start one, or SLOT_NOTHING. Changes
- nothing: pressCommandButton acts on the answer and peekCommandButtonPress reports it. */
+/** What the key of `place` did before the grid took it, MSG_INVALID for a key that pressed a cell
+ already. The grid keeps it for the place's own order and for a place with nothing in it, so S
+ still stops a selection whose bar has no stop button, and still calls off a building going up. */
//-------------------------------------------------------------------------------------------------
-Int ControlBar::resolveGridPress( Int index, Int chordGroup, Bool hasStructures, Bool indexIsStructure )
+static GameMessage::Type orderAtPlace( Int place )
{
- if( index < 0 || index >= MAX_COMMANDS_PER_SET )
- return SLOT_NOTHING;
+ switch( place )
+ {
+ case COMMAND_PLACE_ATTACK: return GameMessage::MSG_META_TOGGLE_FORCEATTACK;
+ case COMMAND_PLACE_STOP: return GameMessage::MSG_META_STOP;
+ case COMMAND_PLACE_ATTACK_MOVE: return GameMessage::MSG_META_TOGGLE_ATTACKMOVE;
+ case COMMAND_PLACE_GUARD: return GameMessage::MSG_META_TOGGLE_GUARD;
+ case COMMAND_PLACE_HOLD: return GameMessage::MSG_META_HOLD_POSITION;
+ }
+ return GameMessage::MSG_INVALID;
+}
- //
- // a builder's structures are reached by a two-key chord so the whole set can stay on
- // screen: Q arms the structures in columns 1-4 (slots 0-7), W the ones in columns 5-7
- // (slots 8-13), and the next grid key picks the cell inside that group by its own
- // position - Q-Q, Q-Z, ... W-Q (= T's cell), W-Z (= B's cell) ... A structure has no other
- // way in: its own letter on its own is the second half of a chord nobody started. Q and W
- // are whatever the grid binds to slots 0 and 2, so with W A S D on the camera they are Q and E.
- //
- if( !hasStructures )
- return index;
+//-------------------------------------------------------------------------------------------------
+/** What a set builds, which takes the free places before the rest of the set. */
+static Bool isProduction( Int type )
+{
+ return type == GUI_COMMAND_UNIT_BUILD || type == GUI_COMMAND_DOZER_CONSTRUCT;
+}
- if( chordGroup < 0 )
+//-------------------------------------------------------------------------------------------------
+Bool ControlBar_commandPlaces( const Int *types, Int count, Int *places )
+{
+ Bool taken[ COMMAND_PLACE_COUNT ] = { FALSE };
+ Bool fights = FALSE;
+ for( Int slot = 0; slot < count; slot++ )
{
- if( index == CHORD_SLOT_Q || index == CHORD_SLOT_W )
- return SLOT_ARMS_CHORD;
-
- //
- // Every structure is two keys, and only two. The key painted on a cell is the *second*
- // of its pair, so on its own it used to fall through to whatever sits in the slot that
- // key names - which for a builder is another structure. So the same building could be
- // put up either by the chord written on it or by one bare letter nobody wrote anywhere,
- // and a key pressed after a Q that had already been dropped built something.
- //
- return indexIsStructure ? SLOT_NOTHING : index;
+ places[ slot ] = -1;
+ fights = fights || types[ slot ] == GUI_COMMAND_ATTACK_MOVE;
}
+ taken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = fights;
- if( index >= CHORD_GROUP_SIZE )
- return SLOT_NOTHING; // the second key must be one of the first group's cells (Q W E R A S D F)
- index += chordGroup * CHORD_GROUP_SIZE;
- return index < MAX_COMMANDS_PER_SET ? index : SLOT_NOTHING;
+ for( Int slot = 0; slot < count; slot++ )
+ {
+ const Int place = fixedCommandPlace( types[ slot ] );
+ if( place >= 0 && !taken[ place ] )
+ {
+ places[ slot ] = place;
+ taken[ place ] = TRUE;
+ }
+ }
-} // end resolveGridPress
+ // production first, then the rest, each into the first free place in reading order
+ for( Int pass = 0; pass < 2; pass++ )
+ {
+ const Bool wantProduction = ( pass == 0 );
+ for( Int slot = 0; slot < count; slot++ )
+ {
+ if( places[ slot ] >= 0 || types[ slot ] == GUI_COMMAND_NONE || isProduction( types[ slot ] ) != wantProduction )
+ continue;
+ for( Int place = 0; place < COMMAND_PLACE_COUNT; place++ )
+ {
+ if( !taken[ place ] )
+ {
+ places[ slot ] = place;
+ taken[ place ] = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ return fights;
+}
//-------------------------------------------------------------------------------------------------
-Int ControlBar::resolveCommandSlot( Int index, Bool *hasStructures ) const
+Bool ControlBar::getCommandPlaces( Int *places ) const
{
- *hasStructures = FALSE;
- Bool indexIsStructure = FALSE;
- for( Int i = 0; i < MAX_COMMANDS_PER_SET; i++ )
+ Int types[ MAX_COMMANDS_PER_SET ];
+ for( Int slot = 0; slot < MAX_COMMANDS_PER_SET; slot++ )
{
- GameWindow *w = m_commandWindows[ i ];
- if( w == NULL || BitTest( w->winGetStatus(), WIN_STATUS_HIDDEN ) )
- continue;
- const CommandButton *c = (const CommandButton *)GadgetButtonGetData( w );
- if( c == NULL || c->getCommandType() != GUI_COMMAND_DOZER_CONSTRUCT )
- continue;
- *hasStructures = TRUE;
- if( i == index )
- indexIsStructure = TRUE;
+ GameWindow *window = m_commandWindows[ slot ];
+ const CommandButton *command = ( window && !BitTest( window->winGetStatus(), WIN_STATUS_HIDDEN ) )
+ ? (const CommandButton *)GadgetButtonGetData( window ) : NULL;
+ types[ slot ] = command ? command->getCommandType() : GUI_COMMAND_NONE;
}
- return resolveGridPress( index, m_chordGroup, *hasStructures, indexIsStructure );
+ return ControlBar_commandPlaces( types, MAX_COMMANDS_PER_SET, places );
+}
+
+//-------------------------------------------------------------------------------------------------
+Int ControlBar::resolveCommandSlot( Int place ) const
+{
+ Int places[ MAX_COMMANDS_PER_SET ];
+ getCommandPlaces( places );
+ for( Int slot = 0; slot < MAX_COMMANDS_PER_SET; slot++ )
+ if( places[ slot ] == place )
+ return slot;
+ return SLOT_NOTHING;
} // end resolveCommandSlot
//-------------------------------------------------------------------------------------------------
-ControlBar::PressOutcome ControlBar::peekCommandButtonPress( Int index, GameWindow **button )
+ControlBar::PressOutcome ControlBar::peekCommandButtonPress( Int place, GameWindow **button )
{
*button = NULL;
- Bool hasStructures = FALSE;
- const Int slot = resolveCommandSlot( index, &hasStructures );
+ const Int slot = resolveCommandSlot( place );
if( slot == SLOT_NOTHING )
return PRESS_DOES_NOTHING;
- if( slot == SLOT_ARMS_CHORD )
- {
- // the first cell of the group this key would arm that the second key could press
- const Int first = ( index == CHORD_SLOT_Q ? 0 : 1 ) * CHORD_GROUP_SIZE;
- for( Int i = first; i < first + CHORD_GROUP_SIZE && i < MAX_COMMANDS_PER_SET; i++ )
- {
- GameWindow *w = m_commandWindows[ i ];
- if( w && !BitTest( w->winGetStatus(), WIN_STATUS_HIDDEN )
- && BitTest( w->winGetStatus(), WIN_STATUS_ENABLED ) )
- {
- *button = w;
- break;
- }
- }
- return PRESS_ARMS_CHORD;
- }
-
GameWindow *win = m_commandWindows[ slot ];
- if( win == NULL || BitTest( win->winGetStatus(), WIN_STATUS_HIDDEN ) )
- return PRESS_DOES_NOTHING;
-
*button = win;
return BitTest( win->winGetStatus(), WIN_STATUS_ENABLED ) ? PRESS_FIRES : PRESS_IS_REFUSED;
} // end peekCommandButtonPress
//-------------------------------------------------------------------------------------------------
-/** Press a command bar button by slot index. Mirrors HotKeyManager::executeHotKey: a hidden
- slot does nothing at all, an enabled one gets the same GBM_SELECTED the mouse would send,
- and a disabled one just makes the rejection noise. */
+/** Press the command at a grid place. Mirrors HotKeyManager::executeHotKey: an empty place does
+ nothing at all, an enabled button gets the same GBM_SELECTED the mouse would send, and a
+ disabled one just makes the rejection noise. The places of the shared orders go through the
+ orders' own messages instead, see orderAtPlace. */
//-------------------------------------------------------------------------------------------------
-void ControlBar::pressCommandButton( Int index )
+void ControlBar::pressCommandButton( Int place )
{
- // a press that names no slot at all leaves an armed chord alone
- if( index < 0 || index >= MAX_COMMANDS_PER_SET )
+ if( place < 0 || place >= COMMAND_PLACE_COUNT )
return;
- Bool hasStructures = FALSE;
- const Int slot = resolveCommandSlot( index, &hasStructures );
-
- if( slot == SLOT_ARMS_CHORD )
+ const Int slot = resolveCommandSlot( place );
+ GameWindow *win = ( slot == SLOT_NOTHING ) ? NULL : m_commandWindows[ slot ];
+ const CommandButton *command = win ? (const CommandButton *)GadgetButtonGetData( win ) : NULL;
+ const GameMessage::Type order = orderAtPlace( place );
+ if( order != GameMessage::MSG_INVALID && ( command == NULL || fixedCommandPlace( command->getCommandType() ) == place ) )
{
- m_chordGroup = ( index == CHORD_SLOT_Q ) ? 0 : 1;
- m_chordStartMs = timeGetTime();
- m_chordDrawableID = m_currentSelectedDrawable ? m_currentSelectedDrawable->getID()
- : INVALID_DRAWABLE_ID;
- markUIDirty(); // the group that is armed greys the other one out
+ TheMessageStream->appendMessage( order );
return;
}
- // an armed chord is spent by its second key whether or not that key found a cell
- if( hasStructures && m_chordGroup >= 0 )
- dropChord();
-
- if( slot == SLOT_NOTHING )
- return;
-
- GameWindow *win = m_commandWindows[ slot ];
- if( win == NULL || BitTest( win->winGetStatus(), WIN_STATUS_HIDDEN ) )
+ if( win == NULL )
return;
if( BitTest( win->winGetStatus(), WIN_STATUS_ENABLED ) )
@@ -323,53 +317,6 @@ void ControlBar::pressCommandButton( Int index )
} // end pressCommandButton
-//-------------------------------------------------------------------------------------------------
-/** The second key of a structure chord is the cell's own position inside the group, so it is
- whatever the grid has bound to slots 0..7 - Q Z W X E C R V on the shipped map, which is what is
- painted on the cells. MetaEventTranslator hands the raw key here while a chord is armed. */
-//-------------------------------------------------------------------------------------------------
-Bool ControlBar::handleChordKey( Int mappableKey )
-{
- if( m_chordGroup < 0 )
- return FALSE;
-
- for( Int i = 0; i < CHORD_GROUP_SIZE; i++ )
- {
- const MappableKeyType key = getGridHotKey( i );
-
- if( key != MK_NONE && (Int)key == mappableKey )
- {
- pressCommandButton( i ); // resolves the chord: i + group * CHORD_GROUP_SIZE
- return TRUE;
- }
- }
-
- //
- // Any other key means the player is done with the chord, so drop it and let the key through.
- // It used to be left armed: nothing in the game cleared it except another grid key or a
- // context change, so a Q pressed and thought better of stayed armed for the rest of the
- // game and the next A or S - attack move, stop - silently became "place this structure",
- // which took the selection away and looked like the click had been eaten.
- //
- dropChord();
- return FALSE;
-
-} // end handleChordKey
-
-//-------------------------------------------------------------------------------------------------
-/** Forget a half-typed structure chord. */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::dropChord( void )
-{
- if( m_chordGroup < 0 )
- return;
-
- m_chordGroup = -1;
- m_chordDrawableID = INVALID_DRAWABLE_ID;
- markUIDirty(); // the greyed-out half of the structures comes back
-
-} // end dropChord
-
//-------------------------------------------------------------------------------------------------
/** Build the menu and back buttons a paged builder shows. They carry no thing template and no
text label of their own - the page they open is told by the cameo of its first structure, and
@@ -1349,9 +1296,6 @@ ControlBar::ControlBar( void )
for( i = 0; i < BUILD_PAGE_COUNT; i++ )
m_buildPageButton[ i ] = NULL;
m_buildPageBackButton = NULL;
- m_chordGroup = -1;
- m_chordStartMs = 0;
- m_chordDrawableID = INVALID_DRAWABLE_ID;
m_upgradeSpreadFrame = 0;
m_upgradeSpreadEntries = 0;
for( i = 0; i < UPGRADE_SPREAD_MAX; i++ )
@@ -2208,64 +2152,6 @@ void ControlBar::placeWindowAt( GameWindow *window, const IRegion2D &rect )
place.placedH = height;
}
-//-------------------------------------------------------------------------------------------------
-void ControlBar_commandPlaces( const Int *types, Int count, Int *places )
-{
- enum { CHORD_GROUP = 8 };
- Bool taken[ COMMAND_PLACE_COUNT ] = { FALSE };
- for( Int slot = 0; slot < count; slot++ )
- places[ slot ] = -1;
-
- // the orders every unit shares, each at its own place
- for( Int slot = 0; slot < count; slot++ )
- {
- Int place = -1;
- switch( types[ slot ] )
- {
- case GUI_COMMAND_STOP: place = COMMAND_PLACE_STOP; break;
- case GUI_COMMAND_ATTACK_MOVE: place = COMMAND_PLACE_ATTACK_MOVE; break;
- case GUI_COMMAND_GUARD:
- case GUI_COMMAND_GUARD_WITHOUT_PURSUIT:
- case GUI_COMMAND_GUARD_FLYING_UNITS_ONLY: place = COMMAND_PLACE_GUARD; break;
- case GUI_COMMAND_EVACUATE: place = COMMAND_PLACE_EJECT; break;
- }
- if( place >= 0 && !taken[ place ] )
- {
- places[ slot ] = place;
- taken[ place ] = TRUE;
- }
- }
-
- // what a builder, a factory or a transport lists, in the worker bars at its slot's place in its
- // chord group: the structure chord's second key is that place
- for( Int slot = 0; slot < count && slot < 2 * CHORD_GROUP; slot++ )
- {
- const Int type = types[ slot ];
- if( places[ slot ] >= 0 ||
- ( type != GUI_COMMAND_DOZER_CONSTRUCT && type != GUI_COMMAND_UNIT_BUILD && type != GUI_COMMAND_EXIT_CONTAINER ) )
- continue;
- places[ slot ] = ( slot < CHORD_GROUP ? COMMAND_PLACE_Q : COMMAND_PLACE_W ) + slot % CHORD_GROUP;
- taken[ places[ slot ] ] = TRUE;
- }
-
- // the rest along the top row, then wherever the worker bars have room
- for( Int slot = 0; slot < count; slot++ )
- {
- if( places[ slot ] >= 0 || types[ slot ] == GUI_COMMAND_NONE )
- continue;
- for( Int place = COMMAND_PLACE_SKILL; place < COMMAND_PLACE_COUNT; place++ )
- {
- const Bool spare = place < COMMAND_PLACE_SKILLS || place >= COMMAND_PLACE_Q;
- if( spare && !taken[ place ] )
- {
- places[ slot ] = place;
- taken[ place ] = TRUE;
- break;
- }
- }
- }
-}
-
//-------------------------------------------------------------------------------------------------
/** Put every window where its panel's slide says it should be.
*
@@ -3181,28 +3067,8 @@ void ControlBar::update( void )
}
//
- // a chord the player armed and then walked away from expires on its own, so it cannot be
- // waiting to eat a keystroke a minute later
- //
- if( m_chordGroup >= 0 && timeGetTime() - m_chordStartMs > CHORD_TIMEOUT_MS )
- {
- dropChord();
- }
-
- //
- // ... and neither does a chord whose builder is gone: the command bar is now showing
- // something else, so the cell the second key would pick is not the one that was armed
- //
- if( m_chordGroup >= 0 )
- {
- const DrawableID nowShowing = m_currentSelectedDrawable ? m_currentSelectedDrawable->getID()
- : INVALID_DRAWABLE_ID;
- if( nowShowing != m_chordDrawableID )
- dropChord();
- }
-
- //
- // a general's power row goes the same way: it expires on its own, and it drops the moment the
+ // a general's power row expires on its own, so it cannot be waiting to eat a keystroke a minute
+ // later, and it drops the moment the
// bar it was picked against is off screen - hidden with the command bar, animated out, or
// repopulated with fewer powers than the row names. Otherwise a key pressed in a hurry and
// then thought better of sits armed, and the next one fires a power instead of picking a row
@@ -4573,15 +4439,6 @@ void ControlBar::switchToContext( ControlBarContext context, Drawable *draw )
// save a pointer for the currently selected drawable
m_currentSelectedDrawable = draw;
- //
- // a half-typed structure chord used to be dropped here. It cannot be: evaluateContextUI
- // erases the bar by switching to CB_CONTEXT_NONE before it rebuilds it, and arming the
- // chord calls markUIDirty() itself to grey the other group out - so the chord killed
- // itself on the very next frame and the second key never had a chord to resolve.
- // ControlBar::update drops it instead, when the drawable driving the bar is no longer the
- // one the chord was armed on.
- //
-
if (IsInGameChatActive() == FALSE && TheGameLogic && !TheGameLogic->isInShellGame()) {
TheWindowManager->winSetFocus( NULL );
}
@@ -4894,28 +4751,9 @@ static UnicodeString getMetaKeyLabel( GameMessage::Type wanted )
} // end getMetaKeyLabel
-static UnicodeString getGridHotKeyLabel( Int slot )
-{
- return getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_COMMAND_SLOT01 + slot) );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** The letter a button's label marks with '&', in capitals: the key HotKeyManager presses that
- * button with under Legacy input. Read from the untranslated label, because a translation marks
- * letters of its own - the Turkish one marks every label's first letter, which put K on three
- * GLA structures and S on five. */
-//-------------------------------------------------------------------------------------------------
-static UnicodeString getLabelHotKeyLabel( const AsciiString& textLabel )
+static UnicodeString getGridHotKeyLabel( Int place )
{
- UnicodeString label;
- const UnicodeString text = TheGameText->fetchUntranslated( textLabel.str() );
- const WideChar *marker = wcschr( text.str(), L'&' );
- if( marker && marker[ 1 ] )
- {
- const WideChar letter[ 2 ] = { (WideChar)towupper( marker[ 1 ] ), 0 };
- label.set( letter );
- }
- return label;
+ return getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_COMMAND_SLOT01 + place) );
}
//-------------------------------------------------------------------------------------------------
@@ -5002,72 +4840,34 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com
setCommandBarBorder(button, commandButton->getCommandButtonMappedBorderType());
- //
- // The '&' letter buried in each localized button label and the grid keys are two rival input
- // schemes for the same buttons: the letter fires on KEY_UP out of HotKeyTranslator, the grid
- // keys on KEY_DOWN out of MetaEventTranslator, so leaving both live makes one keystroke do two
- // things. Modern is the grid and registers no letters. Legacy is the letters, which is what the
- // game shipped with, and each button wears its own letter the way a Modern one wears its grid key.
- //
- const Bool legacyInput = TheGlobalData->isLegacyInput();
- if( legacyInput && TheHotKeyManager )
- {
- AsciiString hotKey = TheHotKeyManager->searchHotKey(
- TheGameText->fetchUntranslated( commandButton->getTextLabel().str() ) );
- if( hotKey.isNotEmpty() )
- TheHotKeyManager->addHotKey( button, hotKey );
- }
+ // the key in the button's top left corner is its place's, and a place is only known once the
+ // whole set is on the bar: labelCommandPlaces paints it
+
+ GadgetButtonSetAltSound(button, "GUICommandBarClick");
+
+} // end setControlCommand
- // paint the key in the button's top left corner. Only the real command bar slots get one -
- // the communicator, options and science buttons are not on the grid.
+//-------------------------------------------------------------------------------------------------
+void ControlBar::labelCommandPlaces( const Int *places )
+{
for( Int slot = 0; slot < MAX_COMMANDS_PER_SET; slot++ )
{
- if( m_commandWindows[ slot ] != button )
+ GameWindow *button = m_commandWindows[ slot ];
+ if( button == NULL )
continue;
- UnicodeString label = legacyInput ? getLabelHotKeyLabel( commandButton->getTextLabel() )
- : getGridHotKeyLabel( slot );
-
- // structures are reached by a chord: Q or W picks the group (columns 1-4 or 5-7), then
- // the key of the cell's own position inside that group - paint both, "QQ", "QZ", "WQ" ...
- // Legacy has no chords, and a structure is its one letter.
- if( commandButton->getCommandType() == GUI_COMMAND_DOZER_CONSTRUCT && !label.isEmpty() && !legacyInput )
- {
- Int base = ( slot < CHORD_GROUP_SIZE ) ? 0 : CHORD_GROUP_SIZE;
- UnicodeString chord = getGridHotKeyLabel( base == 0 ? CHORD_SLOT_Q : CHORD_SLOT_W );
- chord.concat( getGridHotKeyLabel( slot - base ) );
- label = chord;
- }
-
+ const UnicodeString label = places[ slot ] >= 0 ? getGridHotKeyLabel( places[ slot ] ) : UnicodeString();
if( label.isEmpty() )
button->winClearStatus( WIN_STATUS_SHORTCUT_BUTTON );
else
button->winSetStatus( WIN_STATUS_SHORTCUT_BUTTON );
- GadgetButtonSetText( button, label );
- break;
- }
- //
- // the stop button does not live on the grid: MSG_META_STOP presses it whether or not grid hot
- // keys are switched on, and on a building of yours that is still going up it is the cancel key,
- // so the button wears that letter in both modes.
- //
- if( commandButton->getCommandType() == GUI_COMMAND_STOP )
- {
- UnicodeString stopKey = legacyInput ? getLabelHotKeyLabel( commandButton->getTextLabel() )
- : getMetaKeyLabel( GameMessage::MSG_META_STOP );
-
- if( stopKey.isEmpty() )
- button->winClearStatus( WIN_STATUS_SHORTCUT_BUTTON );
- else
- button->winSetStatus( WIN_STATUS_SHORTCUT_BUTTON );
-
- GadgetButtonSetText( button, stopKey );
+ // every frame, so only a changed key goes to the button
+ if( button->winGetText().compare( label ) != 0 )
+ GadgetButtonSetText( button, label );
}
- GadgetButtonSetAltSound(button, "GUICommandBarClick");
-
-} // end setControlCommand
+} // end labelCommandPlaces
//-------------------------------------------------------------------------------------------------
void CommandButton::cacheButtonImage()
@@ -5697,7 +5497,7 @@ void ControlBar::updatePurchaseScienceHotKeys( void )
return;
}
- // a column marked and then thought better of expires on its own, like an armed builder chord
+ // a column marked and then thought better of expires on its own, like a powers tray row
if( m_purchaseScienceColumn >= 0
&& timeGetTime() - m_purchaseScienceColumnMs > CHORD_TIMEOUT_MS )
clearPurchaseScienceColumn();
@@ -5709,10 +5509,8 @@ void ControlBar::updatePurchaseScienceHotKeys( void )
{
GameWindow *candidate = purchaseScienceCandidate( column );
- // Legacy's number keys pick groups, as they did in the game as shipped, so its columns wear no key
UnicodeString label;
- if( !TheGlobalData->isLegacyInput() &&
- ( m_purchaseScienceColumn < 0 || m_purchaseScienceColumn == column ) )
+ if( m_purchaseScienceColumn < 0 || m_purchaseScienceColumn == column )
label = getMetaKeyLabel( (GameMessage::Type)( GameMessage::MSG_META_SELECT_TEAM1 + column ) );
for( Int depth = 0; depth < PURCHASE_SCIENCE_COLUMN_DEPTH; depth++ )
@@ -6764,8 +6562,7 @@ void ControlBar::drawSpecialPowerShortcutMultiplierText()
else if( i / SPECIAL_POWER_SHORTCUT_COLS == m_specialPowerShortcutRow )
keySlot = i % SPECIAL_POWER_SHORTCUT_COLS;
- // the power keys are this fork's; Legacy's powers are clicked, and wear only their ready count
- if( keySlot >= 0 && keySlot < MAX_SPECIAL_POWER_SHORTCUTS && !TheGlobalData->isLegacyInput() )
+ if( keySlot >= 0 && keySlot < MAX_SPECIAL_POWER_SHORTCUTS )
text = getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_SHORTCUT_SLOT01 + keySlot) );
const SpecialPowerTemplate *spTemplate = command->getSpecialPowerTemplate();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
index 27ab698f3..df73c1281 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
@@ -890,16 +890,6 @@ void ControlBar::updateContextCommand( void )
}
}
- // a structure outside the armed chord group greys out until the chord resolves
- if( m_chordGroup >= 0 && command->getCommandType() == GUI_COMMAND_DOZER_CONSTRUCT &&
- ( i < CHORD_GROUP_SIZE ) != ( m_chordGroup == 0 ) )
- {
- setCommandBarBorder( win, command->getCommandButtonMappedBorderType() );
- win->winEnable( FALSE );
- continue;
- }
-
-
// LORENZEN COMMENTED THIS OUT 8/11
// Reason: ExitCameos can be greyed out when the container object gets subdued
@@ -953,16 +943,6 @@ void ControlBar::updateContextCommand( void )
win->winSetStatus( WIN_STATUS_ALWAYS_COLOR );
}
- // while a chord is armed, the structures of its group that can be built right now wear
- // a green border - those are what the next key picks; otherwise the command's own border
- if( command->getCommandType() == GUI_COMMAND_DOZER_CONSTRUCT )
- {
- if( m_chordGroup >= 0 && BitTest( win->winGetStatus(), WIN_STATUS_ENABLED ) )
- GadgetButtonSetBorder( win, GameMakeColor( 60, 255, 60, 255 ), TRUE );
- else
- setCommandBarBorder( win, command->getCommandButtonMappedBorderType() );
- }
-
//Determine by the production type of this button, whether or not the created object
//will have a veterancy rank
if( command->getCommandType() != GUI_COMMAND_EXIT_CONTAINER )
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
index c13be4dfa..0aa8c8534 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
@@ -323,10 +323,8 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,
const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables(); // locally-owned only
// see if the user wants to move the tactical view
- // Left on the radar looks and right orders, the same division the world has. Legacy
- // divides the world the other way round, and so did the radar in the game as shipped.
- const UnsignedInt lookButton = TheGlobalData->isLegacyInput() ? GWM_RIGHT_DOWN : GWM_LEFT_DOWN;
- if( drawableList->empty() || msg == lookButton )
+ // Left on the radar looks and right orders, the same division the world has.
+ if( drawableList->empty() || msg == GWM_LEFT_DOWN )
{
TheTacticalView->lookAt( &world );
s_radarLookDrag = (msg == GWM_LEFT_DOWN) ? GWM_LEFT_DRAG : GWM_RIGHT_DRAG;
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
index 189bf883f..7dd2afb24 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
@@ -1194,23 +1194,6 @@ static void updateResolutionEnabled( void )
comboBoxResolution->winEnable( value != WINDOW_MODE_BORDERLESS );
}
-//-------------------------------------------------------------------------------------------------
-/** The W A S D camera box only means something under Modern input, so it goes grey while Legacy is
- * picked. The tick stays as it was: going back to Modern brings back what the player chose. Read
- * off the input scheme combo box, like the resolution list above, so it follows the dropdown. */
-//-------------------------------------------------------------------------------------------------
-static void updateWasdCameraEnabled( void )
-{
- GameWindow *check = findOptionWidget( *findOptionDef( "WasdCamera" ) );
- GameWindow *schemeWidget = findOptionWidget( *findOptionDef( "InputScheme" ) );
-
- Int selected = -1;
- GadgetComboBoxGetSelectedPos( schemeWidget, &selected );
-
- const Int scheme = ( selected >= 0 ) ? selected : TheGlobalData->m_inputScheme;
- check->winEnable( scheme != INPUT_SCHEME_LEGACY );
-}
-
static void saveOptions( void )
{
Int index;
@@ -2612,7 +2595,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
// borderless owns the resolution; the list is grey while it is picked
updateResolutionEnabled();
- updateWasdCameraEnabled();
TheWindowManager->winSetModal(parent);
ignoreSelected = FALSE;
@@ -2781,8 +2763,6 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
// picking borderless greys the resolution list out, the other two hand it back
updateResolutionEnabled();
- // picking Legacy greys the W A S D box out, Modern hands it back
- updateWasdCameraEnabled();
break;
}
@@ -2839,8 +2819,7 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
{
saveOptions();
- // the command bar's hot keys belong to the input scheme, so it rebuilds them on its next
- // update: grid letters for Modern, the labels' own letters for Legacy
+ // the command bar rebuilds its grid letters on its next update
if( TheControlBar )
TheControlBar->markUIDirty();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
index de5aa27ae..d65089268 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
@@ -151,7 +151,6 @@ class GameTextManager : public GameTextInterface
virtual UnicodeString fetch( const Char *label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text
virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text
- virtual UnicodeString fetchUntranslated( const Char *label );
virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label);
virtual void initMapStringFile( const AsciiString& filename );
@@ -159,7 +158,6 @@ class GameTextManager : public GameTextInterface
protected:
Int m_textCount;
- Int m_untranslatedCount; ///< entries at the front of m_stringInfo that came before the language overlay
Int m_maxLabelLen;
Char m_buffer[MAX_UITEXT_LENGTH];
Char m_buffer2[MAX_UITEXT_LENGTH];
@@ -253,7 +251,6 @@ GameTextInterface* CreateGameTextInterface( void )
GameTextManager::GameTextManager()
: m_textCount(0),
- m_untranslatedCount(0),
m_maxLabelLen(0),
m_stringInfo(NULL),
m_stringLUT(NULL),
@@ -396,7 +393,6 @@ void GameTextManager::init( void )
// the tail in turn and restore afterwards.
StringInfo *wholeTable = m_stringInfo;
Int filled = mainCount;
- m_untranslatedCount = mainCount;
for ( Int overlay = 0; overlay < OVERLAY_COUNT; ++overlay )
{
if ( overlayCounts[ overlay ] == 0 )
@@ -407,11 +403,6 @@ void GameTextManager::init( void )
if ( parseStringFile( overlays[ overlay ] ) )
{
filled += overlayCounts[ overlay ];
- // Patch.str is English; everything from the next overlay on is the translation
- if ( overlay == 0 )
- {
- m_untranslatedCount = filled;
- }
}
}
m_stringInfo = wholeTable;
@@ -1419,26 +1410,6 @@ UnicodeString GameTextManager::fetch( AsciiString label, Bool *exists )
return fetch(label.str(), exists);
}
-//============================================================================
-// *GameTextManager::fetchUntranslated
-//============================================================================
-
-UnicodeString GameTextManager::fetchUntranslated( const Char *label )
-{
- // The lookup table keeps only the winning copy of a label, but the table under it keeps every
- // file's copy in load order, so the last one ahead of the language overlay is the English.
- // ponytail: a linear scan, fine for the command bar's handful of labels a selection; build a
- // second lookup table if anything ever asks this every frame.
- for ( Int i = ( m_stringInfo != NULL ) ? m_untranslatedCount - 1 : -1; i >= 0; --i )
- {
- if ( m_stringInfo[i].label.compareNoCase( label ) == 0 )
- {
- return m_stringInfo[i].text;
- }
- }
- return fetch( label );
-}
-
//============================================================================
// GameTextManager::getStringsWithLabelPrefix
//============================================================================
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 421ca4285..14e69f8a9 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -1849,7 +1849,6 @@ enum
FEED_LINE_FRAMES = LOGICFRAMES_PER_SECOND * 10, ///< how long a line of the event feed stays up
FEED_LINES_KEPT = 6, ///< the most of those on screen at once; the oldest goes first
FEED_HISTORY_KEPT = 12, ///< the lines held for the open chat to show, however old
- COMMAND_SLOTS_PER_COLUMN = 2, ///< the command bar numbers its slots down each column, top then bottom
PERCENT = 100
};
@@ -2430,7 +2429,7 @@ static void updateReplaySeek( void )
//-------------------------------------------------------------------------------------------------
/** The key a command bar slot is bound to right now, "Q" for KEY_Q, so the page names the key the
- * player really has: the WASD camera moves the whole top row along by one. Empty when unbound. */
+ * player really has after a rebinding in Options > Keyboard. Empty when unbound. */
//-------------------------------------------------------------------------------------------------
static std::string commandSlotKey( Int commandSlot )
{
@@ -2448,15 +2447,14 @@ static std::string commandSlotKey( Int commandSlot )
}
//-------------------------------------------------------------------------------------------------
-/** The command bar's top row while the spectator page is up: slots 1, 3, 5... - Q, W, E, R, T, Y,
- * U by default, Q, E, R, T, Y, U, I with the WASD camera - pick the stats in the order the
- * drop-down lists them, and {{statkey:stat}} names each one's key. The bottom row and anything
- * past the last stat are left to the command bar. */
+/** The command grid's keys in reading order while the spectator page is up - Q, W, E, R, T, Y, A as
+ * shipped - pick the stats in the order the drop-down lists them, and {{statkey:stat}} names each
+ * one's key. Anything past the last stat is left to the command bar. */
//-------------------------------------------------------------------------------------------------
Bool InGameUI::pickSpectatorStat( Int commandSlot )
{
- const Int stat = commandSlot / COMMAND_SLOTS_PER_COLUMN;
- if( !m_spectatorPageShown || commandSlot % COMMAND_SLOTS_PER_COLUMN != 0 || stat >= (Int)ARRAY_SIZE( SPECTATOR_STATS ) )
+ const Int stat = commandSlot;
+ if( !m_spectatorPageShown || stat >= (Int)ARRAY_SIZE( SPECTATOR_STATS ) )
return FALSE;
m_spectatorPicked[ STAT_GROUP ] = SPECTATOR_STATS[ stat ].key;
@@ -2507,7 +2505,7 @@ void InGameUI::drawSpectatorPage( void )
m_spectatorTotals[ PICK_ACTION + STAT_GROUP + ":" + stat.key ] = "on";
m_spectatorTotals[ "side" ] = spectatorSide();
for( Int each = 0; each < (Int)ARRAY_SIZE( SPECTATOR_STATS ); each++ )
- m_spectatorTotals[ std::string( "statkey:" ) + SPECTATOR_STATS[ each ].key ] = commandSlotKey( each * COMMAND_SLOTS_PER_COLUMN );
+ m_spectatorTotals[ std::string( "statkey:" ) + SPECTATOR_STATS[ each ].key ] = commandSlotKey( each );
m_spectatorListsFrame = frame;
m_spectatorListsWatched = watched;
}
@@ -6424,17 +6422,11 @@ void InGameUI::createCommandHint( const GameMessage *msg )
}
//-------------------------------------------------------------------------------------------------
-/** Ctrl held is how the game as shipped force fired, and Legacy is that game. Modern keeps ctrl for
- * the shared pace on a move and force fires on the attack key alone. */
+/** Force fire is the attack key alone; ctrl held is the shared pace on a move. */
//-------------------------------------------------------------------------------------------------
-Bool InGameUI_isForceFireOn( Bool forceAttackArmed, Bool ctrlHeld, Bool legacyInput )
-{
- return forceAttackArmed || ( legacyInput && ctrlHeld );
-}
-
Bool InGameUI::isForceFireOn( void ) const
{
- return InGameUI_isForceFireOn( m_forceAttackArmed, m_forceAttackMode, TheGlobalData->isLegacyInput() );
+ return m_forceAttackArmed;
}
//-------------------------------------------------------------------------------------------------
@@ -10891,7 +10883,7 @@ static void putPowerBar( HtmlValues &values, std::vector< HtmlValues > &cells )
{
ONE_UNIT_NEEDLE_TENTHS = 15, ///< a consumption of 1 is drawn as 1.5: log(1) is 0, and 1 is not nothing
POWER_CELLS = 20 ///< the bar is drawn as this many cells, lit up to the production; forty
- ///< stood across the old bar, and up the worker bar's height a cell was two pixels
+ ///< stood across the old bar, and up a groove this short a cell was two pixels
};
Player *player = TheControlBar->isObserverControlBarOn() ? TheControlBar->getObserverLookAtPlayer()
@@ -11060,22 +11052,22 @@ static const Int COMMAND_BUTTONS = 14; ///< ButtonCommand01 to 14, the command s
static const Int UPGRADE_CAMEOS = 5; ///< UnitUpgrade1 to 5, a single unit's upgrades in the portrait bar
/** The bar as the owner drew it on 2026-09-28, 800x600 pixels at ControlBarHudScale(): from the left,
- * the radar with the experience bar beside it, the command panel with the portrait bar on it, and
- * the Q and W worker bars a row lower, the power bar standing up at the W bar's right. Over the
- * radar the idle worker's key stands on the skills key, the skills key on the under-attack light at
- * its left hand end, and the smoke signals at its right. The money hangs from the screen's top. */
+ * the radar with the experience bar beside it, then the command grid, six by three, with the portrait
+ * bar on it and the power bar standing up at its right. Over the radar the idle worker's key stands
+ * on the skills key, the skills key on the under-attack light at its left hand end, and the smoke
+ * signals at its right. The money hangs from the screen's top. */
enum
{
COMMAND_BUTTON_WIDTH = 50, ///< a command button as ControlBar.wnd authors it, the promotion screen's cell
COMMAND_BUTTON_HEIGHT = 44,
- CELL_WIDTH = 38, ///< every grid's cell, three quarters of a command button: the whole size
- CELL_HEIGHT = 33, ///< made the owner's drawing a third again as wide
- CELL_GAP = 4, ///< between two cells of the command panel, the worker bars and the portrait bar,
- ///< a ring of half of it round each picture
- COMMAND_COLUMNS = 5,
- COMMAND_ROWS = 3,
- WORKER_COLUMNS = 4, ///< a worker bar is its chord's keys: Q W E R over Z X C V
- WORKER_ROWS = 2,
+ CELL_WIDTH = 38, ///< the portrait bar's and the trays' cell, three quarters of a command button:
+ CELL_HEIGHT = 33, ///< the whole size made the owner's drawing a third again as wide
+ COMMAND_CELL_WIDTH = 46, ///< the command grid's, a fifth bigger again: the owner asked for the production
+ COMMAND_CELL_HEIGHT = 40, ///< area to stand out from the rest of the bar
+ CELL_GAP = 4, ///< between two cells of the command grid and the portrait bar, a ring of half of
+ ///< it round each picture
+ COMMAND_COLUMNS = COMMAND_PLACE_COLUMNS,
+ COMMAND_ROWS = COMMAND_PLACE_COUNT / COMMAND_PLACE_COLUMNS,
PORTRAIT_WIDTH = 44, ///< the portrait's cell, a cell's height at the portrait's own shape
PORTRAIT_PLACES = 7, ///< the most cells the portrait bar holds in one row after the portrait; it is
///< only as long as what it holds
@@ -11092,7 +11084,7 @@ enum
SIGNAL_STEP_HEIGHT = 24, ///< three keys side by side
IDLE_TAB_WIDTH = 38, ///< the idle worker's key in a tab on the skills key's, with its rim
IDLE_TAB_HEIGHT = 22,
- POWER_WIDTH = 12, ///< the power bar's groove up the W worker bar's right, frame and lip
+ POWER_WIDTH = 12, ///< the power bar's groove up the command grid's right, frame and lip
MONEY_WIDTH = 104, ///< the money's well in its plate at the screen's top
MONEY_HEIGHT = 18,
MONEY_PLATE_BORDER = 5, ///< the plate's steel round the well
@@ -11289,29 +11281,30 @@ static void putCell( HtmlValues &entry, const IRegion2D &picture, Int ring, Real
entry[ "ring" ] = std::to_string( ring );
}
-/** A grid of `columns` by `rows` cells and the ring round them, standing on `bottom` with its left
- * edge on `left`, screen pixels. */
-static IRegion2D gridBox( Int left, Int bottom, Int columns, Int rows )
+/** A grid of `columns` by `rows` cells of `width` by `height` and the ring round them, standing on
+ * `bottom` with its left edge on `left`, screen pixels. */
+static IRegion2D gridBox( Int left, Int bottom, Int columns, Int rows, Int width, Int height )
{
const Real scale = ControlBarHudScale();
IRegion2D box;
box.lo.x = left;
- box.hi.x = left + REAL_TO_INT( columns * ( CELL_WIDTH + CELL_GAP ) * scale );
+ box.hi.x = left + REAL_TO_INT( columns * ( width + CELL_GAP ) * scale );
box.hi.y = bottom;
- box.lo.y = bottom - REAL_TO_INT( rows * ( CELL_HEIGHT + CELL_GAP ) * scale );
+ box.lo.y = bottom - REAL_TO_INT( rows * ( height + CELL_GAP ) * scale );
return box;
}
-/** Cell `column`, `row` of the grid `box` holds, scaled by `share`: a grid of smaller cells in the
- * same room, the portrait bar's when a selection has more types than it has places. */
-static IRegion2D gridCell( const IRegion2D &box, Int column, Int row, Real share = 1.0f )
+/** Cell `column`, `row` of the grid of `width` by `height` cells `box` holds, scaled by `share`: a
+ * grid of smaller cells in the same room, the portrait bar's when a selection has more types than it
+ * has places. */
+static IRegion2D gridCell( const IRegion2D &box, Int column, Int row, Int width, Int height, Real share = 1.0f )
{
const Real scale = ControlBarHudScale() * share;
IRegion2D cell;
- cell.lo.x = box.lo.x + REAL_TO_INT( ( CELL_GAP / 2 + column * ( CELL_WIDTH + CELL_GAP ) ) * scale );
- cell.lo.y = box.lo.y + REAL_TO_INT( ( CELL_GAP / 2 + row * ( CELL_HEIGHT + CELL_GAP ) ) * scale );
- cell.hi.x = cell.lo.x + REAL_TO_INT( CELL_WIDTH * scale );
- cell.hi.y = cell.lo.y + REAL_TO_INT( CELL_HEIGHT * scale );
+ cell.lo.x = box.lo.x + REAL_TO_INT( ( CELL_GAP / 2 + column * ( width + CELL_GAP ) ) * scale );
+ cell.lo.y = box.lo.y + REAL_TO_INT( ( CELL_GAP / 2 + row * ( height + CELL_GAP ) ) * scale );
+ cell.hi.x = cell.lo.x + REAL_TO_INT( width * scale );
+ cell.hi.y = cell.lo.y + REAL_TO_INT( height * scale );
return cell;
}
@@ -11504,8 +11497,8 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// the sides facing the battlefield, out to the screen's edge on the sides against it. Everything
// else - the tabs, the keys, the signals - stands outside the border. The layout is the owner's
// drawing of 2026-09-28 at ControlBarHudScale(), which is what the page is laid out at too: from
- // the left the radar with the experience bar beside it, the command panel with the portrait bar on
- // it, and the Q and W worker bars a row lower with the power bar standing up after them
+ // the left the radar with the experience bar beside it, then the command grid with the portrait bar
+ // on it and the power bar standing up after it
const Real scale = ControlBarHudScale();
m_controlBarOverlay->setHud( TRUE );
for( Int panel = 0; panel < panelCount; panel++ )
@@ -11567,74 +11560,48 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
m_signalsWereShown = signalsShown;
putSignalRise( values, nowMs - m_signalsRiseStartMs );
- // the command panel against the radar's: five places across the top for the unit's own abilities
- // and upgrades, then attack, stop and attack move, then eject, seek shelter, guard and hold
- // position. The worker bars stand beside it a row lower, Q then W, and the power bar stands up in
- // its groove inside the W bar's frame, after its grid, the way the experience bar stands in the
- // radar's. The money hangs from the screen's top
- const IRegion2D commandBox = gridBox( leftBox.hi.x + border, foot, COMMAND_COLUMNS, COMMAND_ROWS );
- const IRegion2D centreBox = framed( commandBox, border, FALSE, FALSE );
- putFrame( values, "centre", commandBox, centreBox, centreShown );
- const IRegion2D qBox = gridBox( centreBox.hi.x + border, foot, WORKER_COLUMNS, WORKER_ROWS );
- const IRegion2D qFrame = framed( qBox, border, FALSE, FALSE );
- putFrame( values, "qbar", qBox, qFrame, centreShown );
- const IRegion2D wBox = gridBox( qFrame.hi.x + border, foot, WORKER_COLUMNS, WORKER_ROWS );
- IRegion2D power = wBox;
- power.lo.x = wBox.hi.x + REAL_TO_INT( EXPERIENCE_GAP * scale );
+ // the command grid against the radar's panel, six by three, every place its key: the orders in the
+ // owner's places (ControlBar_commandPlaces) and everything else from Q on in reading order, what a
+ // set builds before its abilities and upgrades. The power bar stands up in its
+ // groove inside the grid's frame, after it, the way the experience bar stands in the radar's. The
+ // money hangs from the screen's top
+ const IRegion2D commandBox = gridBox( leftBox.hi.x + border, foot, COMMAND_COLUMNS, COMMAND_ROWS,
+ COMMAND_CELL_WIDTH, COMMAND_CELL_HEIGHT );
+ IRegion2D power = commandBox;
+ power.lo.x = commandBox.hi.x + REAL_TO_INT( EXPERIENCE_GAP * scale );
power.hi.x = power.lo.x + REAL_TO_INT( POWER_WIDTH * scale );
- IRegion2D wContent = wBox;
- wContent.hi.x = power.hi.x;
- const IRegion2D wFrame = framed( wContent, border, FALSE, FALSE );
- putFrame( values, "wbar", wContent, wFrame, centreShown );
+ IRegion2D centreContent = commandBox;
+ centreContent.hi.x = power.hi.x;
+ const IRegion2D centreBox = framed( centreContent, border, FALSE, FALSE );
+ putFrame( values, "centre", centreContent, centreBox, centreShown );
putPowerGroove( values, power, centreShown );
putPowerBar( values, lists[ "powercells" ] ); // after the groove, which it divides into cells
putMoney( values, centreShown && !controlBarWindow( "MoneyDisplay" )->winIsHidden() );
- // each command button to the place its command goes to. A click only reaches a window inside
- // every one of its parents, so the buttons' two cover the whole frame; the page's solids still
- // decide what is battlefield
+ // each command button to its place. A click only reaches a window inside every one of its parents,
+ // so the buttons' two cover the whole frame; the page's solids still decide what is battlefield
const IRegion2D frameRect = windowScreenRect( TheControlBar->getMasterParent() );
TheControlBar->placeWindowAt( controlBarWindow( "CenterBackground" ), frameRect );
TheControlBar->placeWindowAt( controlBarWindow( "CommandWindow" ), frameRect );
- Int types[ COMMAND_BUTTONS ];
- Int where[ COMMAND_BUTTONS ];
- Bool fights = FALSE;
- for( Int button = 0; button < COMMAND_BUTTONS; button++ )
- {
- GameWindow *window = numberedWindow( "ButtonCommand", button + 1 );
- const CommandButton *command = window->winIsHidden() ? NULL : (const CommandButton *)GadgetButtonGetData( window );
- types[ button ] = command ? command->getCommandType() : GUI_COMMAND_NONE;
- fights = fights || types[ button ] == GUI_COMMAND_ATTACK_MOVE;
- }
- ControlBar_commandPlaces( types, COMMAND_BUTTONS, where );
+ Int where[ MAX_COMMANDS_PER_SET ];
+ const Bool fights = TheControlBar->getCommandPlaces( where );
+ TheControlBar->labelCommandPlaces( where );
Bool taken[ COMMAND_PLACE_COUNT ] = { FALSE };
for( Int button = 0; button < COMMAND_BUTTONS; button++ )
if( where[ button ] >= 0 )
taken[ where[ button ] ] = TRUE;
// attack and hold position have no button in any command set: the page's keys do what A and H do,
- // for anything that attack moves. Seek shelter has nothing behind it and stays steel
+ // for anything that attack moves
taken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = fights;
- // a cell for every place a command stands in, and on the worker bars for every place, so a builder's
- // two bars read as its chord's keys. A worker bar's place is its chord key's: the second key runs
- // down the columns, Q Z W X E C R V as shipped. An empty place on the command panel is its steel
+ // a cell only for a place a command stands in; an empty one is the panel's steel
IRegion2D place[ COMMAND_PLACE_COUNT ];
- for( Int each = 0; each < COMMAND_PLACE_COUNT; each++ )
- {
- const Int inBar = ( each - COMMAND_PLACE_Q ) % ( WORKER_COLUMNS * WORKER_ROWS );
- if( each < COMMAND_PLACE_SKILLS )
- place[ each ] = gridCell( commandBox, each, 0 );
- else if( each < COMMAND_PLACE_EJECT )
- place[ each ] = gridCell( commandBox, each - COMMAND_PLACE_ATTACK, 1 );
- else if( each < COMMAND_PLACE_Q )
- place[ each ] = gridCell( commandBox, each - COMMAND_PLACE_EJECT, 2 );
- else
- place[ each ] = gridCell( each < COMMAND_PLACE_W ? qBox : wBox, inBar / WORKER_ROWS, inBar % WORKER_ROWS );
- }
std::vector< HtmlValues > &commandCells = lists[ "commandcells" ];
- for( Int each = 0; each < COMMAND_PLACE_COUNT && centreShown; each++ )
+ for( Int each = 0; each < COMMAND_PLACE_COUNT; each++ )
{
- if( each < COMMAND_PLACE_Q && !taken[ each ] )
+ place[ each ] = gridCell( commandBox, each % COMMAND_COLUMNS, each / COMMAND_COLUMNS,
+ COMMAND_CELL_WIDTH, COMMAND_CELL_HEIGHT );
+ if( !centreShown || !taken[ each ] )
continue;
HtmlValues entry;
putCell( entry, place[ each ], ring, scale );
@@ -11645,6 +11612,8 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
TheControlBar->placeWindowAt( numberedWindow( "ButtonCommand", button + 1 ), place[ where[ button ] ] );
putPageRect( values, "attackkey", place[ COMMAND_PLACE_ATTACK ], centreShown && fights, scale );
putPageRect( values, "holdkey", place[ COMMAND_PLACE_HOLD ], centreShown && fights, scale );
+ values[ "attackkey.key" ] = commandSlotKey( COMMAND_PLACE_ATTACK );
+ values[ "holdkey.key" ] = commandSlotKey( COMMAND_PLACE_HOLD );
// the portrait bar on the command panel, flush with its left edge: the portrait, then a single
// unit's upgrades or a multi-selection's types, the owner's rule, and only as long as what it
@@ -11682,7 +11651,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
putFrame( values, "portrait", portraitBox, portraitFrame, portraitShown );
TheControlBar->placeWindowAt( controlBarWindow( "RightHUD" ), portraitBox );
TheControlBar->placeWindowAt( controlBarWindow( "WinUnitSelected" ), portraitBox );
- IRegion2D portraitCell = gridCell( portraitBox, 0, 0 );
+ IRegion2D portraitCell = gridCell( portraitBox, 0, 0, CELL_WIDTH, CELL_HEIGHT );
portraitCell.hi.x = portraitCell.lo.x + REAL_TO_INT( PORTRAIT_WIDTH * scale );
TheControlBar->placeWindowAt( portraitWindow, portraitCell );
IRegion2D placesBox = portraitBox;
@@ -11697,7 +11666,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
}
for( size_t upgrade = 0; upgrade < upgrades.size(); upgrade++ )
{
- const IRegion2D cell = gridCell( placesBox, (Int)upgrade, 0 );
+ const IRegion2D cell = gridCell( placesBox, (Int)upgrade, 0, CELL_WIDTH, CELL_HEIGHT );
TheControlBar->placeWindowAt( upgrades[ upgrade ], cell );
HtmlValues entry;
putCell( entry, cell, ring, scale );
@@ -11706,7 +11675,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
}
for( size_t tile = 0; tile < tiles.size(); tile++ )
{
- const IRegion2D cell = gridCell( placesBox, (Int)tile / rows, (Int)tile % rows, 1.0f / rows );
+ const IRegion2D cell = gridCell( placesBox, (Int)tile / rows, (Int)tile % rows, CELL_WIDTH, CELL_HEIGHT, 1.0f / rows );
TheControlBar->placeWindowAt( tiles[ tile ], cell );
HtmlValues entry;
putCell( entry, cell, rows > 1 ? 1 : ring, scale );
@@ -11717,14 +11686,14 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I
// the general's powers ready to fire, the first in the corner against the screen's right edge, the
// row growing left as they come and wrapping upward past three, each a cell's size. They sit in a
// tray of the panels' steel only as big as they are, standing on the screen's bottom edge right of
- // the worker bars where three fit there, and over the W bar's end where they do not
+ // the command grid where three fit there, and over the grid's end where they do not
const Int trayBorder = REAL_TO_INT( SKILL_TRAY_BORDER * scale );
const ICoord2D cell = cellSize();
const Int cellGap = REAL_TO_INT( SKILL_CELL_GAP * scale );
const Int trayWidth = SPECIAL_POWER_SHORTCUT_COLS * ( cell.x + cellGap ) + 2 * trayBorder;
ICoord2D corner;
corner.x = TheDisplay->getWidth() - trayBorder;
- corner.y = ( (Int)TheDisplay->getWidth() - wFrame.hi.x >= trayWidth ? barBottom() : wFrame.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale ) )
+ corner.y = ( (Int)TheDisplay->getWidth() - centreBox.hi.x >= trayWidth ? barBottom() : centreBox.lo.y - REAL_TO_INT( SKILL_GRID_GAP * scale ) )
- trayBorder;
const Int powersShown = TheControlBar->placeSpecialPowerShortcutGrid( centreShown ? &corner : NULL, cell, cellGap );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
index 4c2bb43c0..2be3f2a96 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
@@ -105,8 +105,7 @@
/**
* Is the next order click a force fire?
* Under Modern only the attack key arms it: ctrl is the "one shared pace" modifier on a move (see
- * issueMoveToLocationCommand), so a ctrl click could not ask for both. Legacy's ctrl is still the
- * game's own force fire (InGameUI::isForceFireOn).
+ * issueMoveToLocationCommand), so a ctrl click could not ask for both.
*/
Bool CommandXlat_isForceAttackTargeting( Bool forceAttackArmed, Bool attackMoveArmed )
{
@@ -173,10 +172,6 @@ SignalKind Command_signalKindForMeta( GameMessage::Type meta )
static Bool isFormationDragArmed( void )
{
- // a Legacy right drag is the camera scroll it always was
- if( TheGlobalData->isLegacyInput() )
- return FALSE;
-
return Command_formationDragArmed( TheGlobalData->m_formationDrag,
TheInGameUI->getSelectCount() > 0
&& TheInGameUI->areSelectedObjectsControllable(),
@@ -2857,6 +2852,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
case GameMessage::MSG_META_COMMAND_SLOT12:
case GameMessage::MSG_META_COMMAND_SLOT13:
case GameMessage::MSG_META_COMMAND_SLOT14:
+ case GameMessage::MSG_META_COMMAND_SLOT15:
+ case GameMessage::MSG_META_COMMAND_SLOT16:
+ case GameMessage::MSG_META_COMMAND_SLOT17:
+ case GameMessage::MSG_META_COMMAND_SLOT18:
{
// a watcher has no commands to press, and the top row picks the spectator's stat instead,
// the keys Dota's spectator uses for the same list
@@ -3405,9 +3404,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//
// Escape is "take that back" before it is "open the menu": a structure waiting to be
- // placed, a targeting command armed off the command bar, or a half-typed builder chord
- // are all dropped first, and the pause menu only comes up on a press with nothing
- // pending.
+ // placed or a targeting command armed off the command bar is dropped first, and the pause
+ // menu only comes up on a press with nothing pending.
//
Bool cancelledSomething = FALSE;
@@ -3418,12 +3416,6 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
cancelledSomething = TRUE;
}
- if( TheControlBar && TheControlBar->isChordArmed() )
- {
- TheControlBar->dropChord();
- cancelledSomething = TRUE;
- }
-
// a general's power row picked but not yet spent goes the same way
if( TheControlBar && TheControlBar->clearSpecialPowerShortcutRow() )
cancelledSomething = TRUE;
@@ -4116,7 +4108,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//-----------------------------------------------------------------------------
case GameMessage::MSG_MOUSE_RIGHT_DOUBLE_CLICK:
{
- if( TheGlobalData->m_doubleClickAttackMove && !TheGlobalData->isLegacyInput() )
+ if( TheGlobalData->m_doubleClickAttackMove )
{
// create the message and append arguments for a guard location
GameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );
@@ -4141,12 +4133,6 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//
// The one exception is the attack, attack move or guard key. Those orders are aimed with the
// left button, so a right click while one is armed puts the key down and gives no order.
- //
- // A Legacy right button never orders at all: it scrolls and deselects, which LookAtXlat and
- // SelectionXlat do.
- if( TheGlobalData->isLegacyInput() )
- break;
-
if( TheInGameUI->isOrderKeyArmed() )
{
TheInGameUI->clearAttackMoveToMode();
@@ -4197,26 +4183,6 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//-----------------------------------------------------------------------------
case GameMessage::MSG_MOUSE_LEFT_DOUBLE_CLICK:
- {
- // Legacy's orders are on the left button, so its double-click guard is here. Modern's is on
- // the right button, and this case does nothing of its own.
- if( TheGlobalData->isLegacyInput() && TheGlobalData->m_doubleClickAttackMove )
- {
- // create the message and append arguments for a guard location
- GameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );
- Coord3D pos;
- TheTacticalView->screenToTerrain( &msg->getArgument( 0 )->pixel, &pos );
- newMsg->appendLocationArgument(pos);
- newMsg->appendIntegerArgument(GUARDMODE_NORMAL);
-
- ThePlayerList->getLocalPlayer()->getAcademyStats()->recordDoubleClickAttackMoveOrderGiven();
-
- TheInGameUI->triggerDoubleClickAttackMoveGuardHint();
-
- break;
- }
- //intentional fall through
- }
case GameMessage::MSG_MOUSE_LEFT_CLICK:
{
Bool isPoint = (msg->getArgument(0)->pixelRegion.height() == 0 && msg->getArgument(0)->pixelRegion.width() == 0);
@@ -4244,10 +4210,9 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
// The left button selects and nothing else. The exceptions are a GUI command that is
// already armed and waiting for a target, and the attack, attack move and guard keys: all of
- // them are aimed with the left button, because the right one cancels them. In Legacy the left
- // button is the order button as well, as it was in the game as shipped.
+ // them are aimed with the left button, because the right one cancels them.
const Bool isOrderKey = TheInGameUI->isOrderKeyArmed();
- if( !isFiringGUICommand && !isOrderKey && !TheGlobalData->isLegacyInput() )
+ if( !isFiringGUICommand && !isOrderKey )
break;
Bool controllable = TheInGameUI->areSelectedObjectsControllable()
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
index f067ad274..b502b266b 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
@@ -66,20 +66,6 @@ static enum
static Bool scrollDir[4] = { false, false, false, false };
-// The directions a W A S D key is holding. A release only ends a scroll its own press started: with
-// the box off W is a grid key, and letting go of it must not stop the up arrow; with the box
-// unticked while W is held, letting go must still stop the camera.
-static Bool letterScrollDir[4] = { false, false, false, false };
-
-static void scrollByLetter( Int dir, Bool isPressed, Bool pressScrolls )
-{
- if( isPressed ? !pressScrolls : !letterScrollDir[ dir ] )
- return;
-
- letterScrollDir[ dir ] = isPressed;
- scrollDir[ dir ] = isPressed;
-}
-
Int SCROLL_AMT = 100;
static const Int edgeScrollSize = 3;
@@ -92,14 +78,9 @@ void LookAtTranslator::setScrolling(Int x)
if (!TheInGameUI->getInputEnabled())
return;
- // With the W A S D box ticked a keyboard scroll leaves the cursor alone - arrow keys too, it is the
- // same scroll - because the mouse is not the thing moving the camera. A mouse scroll, and every
- // keyboard scroll with the box off, still turns the cursor into the scroll arrows.
- m_scrollMovesCursor = !( x == SCROLL_KEY && TheGlobalData->isWasdCamera() );
- if( m_scrollMovesCursor )
- prevCursor = TheMouse->getMouseCursor();
+ prevCursor = TheMouse->getMouseCursor();
m_isScrolling = true;
- TheInGameUI->setScrolling( TRUE, m_scrollMovesCursor );
+ TheInGameUI->setScrolling( TRUE );
TheTacticalView->setMouseLock( TRUE );
m_scrollType = x;
// A manual pan restores map constraints widened by scripted camera paths.
@@ -113,10 +94,9 @@ void LookAtTranslator::setScrolling(Int x)
void LookAtTranslator::stopScrolling( void )
{
m_isScrolling = false;
- TheInGameUI->setScrolling( FALSE, m_scrollMovesCursor );
+ TheInGameUI->setScrolling( FALSE );
TheTacticalView->setMouseLock( FALSE );
- if( m_scrollMovesCursor )
- TheMouse->setCursor(prevCursor);
+ TheMouse->setCursor(prevCursor);
m_scrollType = SCROLL_NONE;
// if we have a stats collectore increment the stats
@@ -136,8 +116,7 @@ LookAtTranslator::LookAtTranslator() :
m_lastPlaneID(INVALID_DRAWABLE_ID),
m_lastMouseMoveFrame(0),
m_cameraSentFrame(0),
- m_scrollType(SCROLL_NONE),
- m_scrollMovesCursor(true)
+ m_scrollType(SCROLL_NONE)
{
//Added By Sadullah Nader
//Initializations misssing and needed
@@ -159,7 +138,7 @@ LookAtTranslator::~LookAtTranslator()
const ICoord2D* LookAtTranslator::getScrollAnchor(void)
{
- if (m_isScrolling && (m_scrollType == SCROLL_MMB || m_scrollType == SCROLL_RMB))
+ if (m_isScrolling && m_scrollType == SCROLL_MMB)
{
return &m_anchor;
}
@@ -231,19 +210,6 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
if (TheShell && TheShell->isShellActive())
break;
- //
- // With the W A S D box ticked those four scroll alongside the arrow keys, and
- // CommandMapWASD.ini moves what they were bound to. They are read here as raw keys
- // instead of being bound there for two reasons: the meta map holds one key per command, so
- // binding them would have taken the arrows away, and a meta record fires its UP only while
- // the modifier state still matches the one the key went down with - letting go of W with
- // ctrl held for a control group would have left the camera scrolling with nothing to stop
- // it. A press with ctrl or alt down belongs to whatever that combination is bound to.
- //
- const Bool letterPressScrolls = TheGlobalData->isWasdCamera() &&
- !BitTest( state, KEY_STATE_CONTROL ) &&
- !BitTest( state, KEY_STATE_ALT );
-
switch (key)
{
case KEY_UP:
@@ -258,18 +224,6 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
case KEY_RIGHT:
scrollDir[DIR_RIGHT] = isPressed;
break;
- case KEY_W:
- scrollByLetter( DIR_UP, isPressed, letterPressScrolls );
- break;
- case KEY_S:
- scrollByLetter( DIR_DOWN, isPressed, letterPressScrolls );
- break;
- case KEY_A:
- scrollByLetter( DIR_LEFT, isPressed, letterPressScrolls );
- break;
- case KEY_D:
- scrollByLetter( DIR_RIGHT, isPressed, letterPressScrolls );
- break;
}
if (TheInGameUI->isSelecting() || (m_isScrolling && m_scrollType != SCROLL_KEY))
@@ -295,32 +249,13 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
}
//-----------------------------------------------------------------------------
- // Modern's right button belongs to the order layer - a click commands, a drag draws a
- // formation line - so here it only keeps the idle timer honest: a player who is
- // right-clicking is not away from the keyboard. Legacy's right drag scrolls the camera, as
- // the game shipped.
+ // The right button belongs to the order layer - a click commands, a drag draws a formation
+ // line - so here it only keeps the idle timer honest: a player who is right-clicking is not
+ // away from the keyboard.
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
- {
- m_lastMouseMoveFrame = TheGameLogic->getFrame();
-
- if (TheGlobalData->isLegacyInput())
- {
- m_anchor = msg->getArgument( 0 )->pixel;
- m_currentPos = msg->getArgument( 0 )->pixel;
-
- if (!TheInGameUI->isSelecting() && !m_isScrolling)
- setScrolling(SCROLL_RMB);
- }
- break;
- }
-
- //-----------------------------------------------------------------------------
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:
{
m_lastMouseMoveFrame = TheGameLogic->getFrame();
-
- if (m_scrollType == SCROLL_RMB)
- stopScrolling();
break;
}
@@ -338,9 +273,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// the drag turns the camera instead. It used to be the other way round, with a
// MiddleMousePans switch in Options.ini deciding; there is no switch now because the
// right button no longer scrolls anything and the pan has to live somewhere. The
- // click-to-reset below works either way. Legacy's middle drag only ever turns the camera,
- // because its right button is the one that scrolls.
- if( !TheKeyboard->isCtrl() && !TheGlobalData->isLegacyInput() )
+ // click-to-reset below works either way.
+ if( !TheKeyboard->isCtrl() )
{
m_isRotating = false;
if (!TheInGameUI->isSelecting() && !m_isScrolling)
@@ -435,7 +369,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
Real angle = FACTOR * (m_currentPos.x - m_anchor.x);
- if (TheGlobalData->m_snapCameraRotateTo45 && !TheGlobalData->isLegacyInput())
+ if (TheGlobalData->m_snapCameraRotateTo45)
{
// discrete heading: the drag turns an angle we keep to ourselves and the camera
// jumps to the eighth it is nearest, as the mouse crosses each halfway point.
@@ -491,14 +425,14 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
//
// Whole notches only: half a touchpad swipe is not a 45 degree turn.
const Int rotateSteps = (Int)spin;
- if (!TheGlobalData->isLegacyInput() && TheKeyboard->isCtrl() && rotateSteps != 0 &&
+ if (TheKeyboard->isCtrl() && rotateSteps != 0 &&
TheInGameUI->rotatePendingPlacement( rotateSteps ))
return DESTROY_MESSAGE;
// ZoomToCursor: the view holds the ground under the cursor while the zoom eases in. It does
// it inside its own update, between the zoom moving and the frame being drawn; held from
// here, the correction always landed a frame late.
- if (TheGlobalData->m_zoomToCursor && !TheGlobalData->isLegacyInput() && TheInGameUI->getInputEnabled())
+ if (TheGlobalData->m_zoomToCursor && TheInGameUI->getInputEnabled())
TheTacticalView->anchorZoomAt( &msg->getArgument( 0 )->pixel );
if (spin > 0.0f)
@@ -539,7 +473,6 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
switch (m_scrollType)
{
- case SCROLL_RMB:
case SCROLL_MMB:
{
// The anchor stays where the button went down and the camera runs away from it,
@@ -844,10 +777,7 @@ void LookAtTranslator::resetModes()
// the flags that say a scroll is in progress.
//
for( Int i = 0; i < 4; ++i )
- {
scrollDir[i] = false;
- letterScrollDir[i] = false;
- }
if( m_isScrolling && TheInGameUI && TheTacticalView && TheMouse )
stopScrolling();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
index b3a130861..b557ad060 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
@@ -154,6 +154,10 @@ static const LookupListRec GameMessageMetaTypeNames[] =
{ "COMMAND_SLOT12", GameMessage::MSG_META_COMMAND_SLOT12 },
{ "COMMAND_SLOT13", GameMessage::MSG_META_COMMAND_SLOT13 },
{ "COMMAND_SLOT14", GameMessage::MSG_META_COMMAND_SLOT14 },
+ { "COMMAND_SLOT15", GameMessage::MSG_META_COMMAND_SLOT15 },
+ { "COMMAND_SLOT16", GameMessage::MSG_META_COMMAND_SLOT16 },
+ { "COMMAND_SLOT17", GameMessage::MSG_META_COMMAND_SLOT17 },
+ { "COMMAND_SLOT18", GameMessage::MSG_META_COMMAND_SLOT18 },
{ "SHORTCUT_SLOT01", GameMessage::MSG_META_SHORTCUT_SLOT01 },
{ "SHORTCUT_SLOT02", GameMessage::MSG_META_SHORTCUT_SLOT02 },
{ "SHORTCUT_SLOT03", GameMessage::MSG_META_SHORTCUT_SLOT03 },
@@ -448,9 +452,8 @@ static const char * findGameMessageNameByType(GameMessage::Type type)
//-------------------------------------------------------------------------------------------------
static Bool metaIgnoresShift(const MetaMapRec *map)
{
- return !TheGlobalData->isLegacyInput() &&
- map->m_meta >= GameMessage::MSG_META_COMMAND_SLOT01 &&
- map->m_meta <= GameMessage::MSG_META_COMMAND_SLOT14 &&
+ return map->m_meta >= GameMessage::MSG_META_COMMAND_SLOT01 &&
+ map->m_meta <= GameMessage::MSG_META_COMMAND_SLOT18 &&
(map->m_modState & SHIFT) == 0;
}
@@ -460,17 +463,6 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
GameMessageDisposition disp = KEEP_MESSAGE;
GameMessage::Type t = msg->getType();
- //
- // a click is the player saying what they want with the mouse, so whatever half-typed
- // structure chord is still armed from the keyboard is stale - drop it before it can eat
- // the next A or S and turn it into a building to place
- //
- if( ( t == GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_DOWN ||
- t == GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN ) && TheControlBar )
- {
- TheControlBar->dropChord();
- }
-
if (t == GameMessage::MSG_RAW_KEY_DOWN || t == GameMessage::MSG_RAW_KEY_UP)
{
MappableKeyType key = (MappableKeyType)msg->getArgument(0)->integer;
@@ -495,31 +487,12 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
newModState |= ALT;
}
- //
- // a half-typed structure chord (Q or W pressed on a builder) takes the next plain key:
- // the group's own eight cell keys pick a cell, anything else drops the chord and goes
- // on as usual. Legacy has no chords: its structures are the letters on their labels.
- //
- if( !TheGlobalData->isLegacyInput() &&
- t == GameMessage::MSG_RAW_KEY_DOWN && ( newModState & ( CTRL | ALT ) ) == 0 &&
- !( keyState & KEY_STATE_AUTOREPEAT ) &&
- TheControlBar && TheControlBar->isChordArmed() &&
- !( TheShell && TheShell->isShellActive() ) )
- {
- if( TheControlBar->handleChordKey( key ) )
- {
- m_lastModState = newModState;
- return DESTROY_MESSAGE;
- }
- }
-
//
// Tab / Shift-Tab walks the focus through a multi-selection's units on the control bar.
// Handled here rather than through the MetaMap because CommandMap.ini lives in the
// shipped game data and has no slot for it. The game as it shipped did nothing with Tab.
//
- if( !TheGlobalData->isLegacyInput() &&
- t == GameMessage::MSG_RAW_KEY_DOWN && key == MK_TAB &&
+ if( t == GameMessage::MSG_RAW_KEY_DOWN && key == MK_TAB &&
( newModState & ( CTRL | ALT ) ) == 0 &&
!( keyState & KEY_STATE_AUTOREPEAT ) &&
TheGameClient->getFrame() >= 1 &&
@@ -537,14 +510,13 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
// the key came up while the modifier was still held. Letting go of Ctrl first meant the
// key's own release carried no Ctrl, the record no longer matched, and whatever the DOWN
// had switched on stayed on. Every key remembers the combinations it was pressed with, so
- // a modifier release can finish them off in whatever order the player let go. Legacy keeps
- // the game's own rule, where the order of letting go mattered.
+ // a modifier release can finish them off in whatever order the player let go.
//
const Bool isModifierKey = ( key == KEY_LCTRL || key == KEY_RCTRL ||
key == KEY_LSHIFT || key == KEY_RSHIFT ||
key == KEY_LALT || key == KEY_RALT );
- if( isModifierKey && ( keyState & KEY_STATE_UP ) && !TheGlobalData->isLegacyInput() )
+ if( isModifierKey && ( keyState & KEY_STATE_UP ) )
{
for( Int keyIndex = 0; keyIndex < NUM_MAPPABLE_KEYS; ++keyIndex )
{
@@ -621,10 +593,7 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
disp = DESTROY_MESSAGE;
// every record on this modifier fires, not the first one found: shift is both "add to
// the selection" on the left button and "queue the order" on the right, and the two
- // are separate records that have to come on and go off together. Legacy stops at the
- // first, as the game did.
- if( TheGlobalData->isLegacyInput() )
- break;
+ // are separate records that have to come on and go off together.
continue;
}
@@ -815,75 +784,21 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
//-------------------------------------------------------------------------------------------------
MetaMap::MetaMap() :
- m_parseScheme(INPUT_SCHEME_MODERN)
+ m_metaMaps(NULL)
{
- for (Int scheme = 0; scheme < BINDING_LIST_COUNT; ++scheme)
- m_metaMaps[scheme] = NULL;
}
//-------------------------------------------------------------------------------------------------
MetaMap::~MetaMap()
{
- for (Int scheme = 0; scheme < BINDING_LIST_COUNT; ++scheme)
+ while (m_metaMaps)
{
- while (m_metaMaps[scheme])
- {
- MetaMapRec *next = m_metaMaps[scheme]->m_next;
- m_metaMaps[scheme]->deleteInstance();
- m_metaMaps[scheme] = next;
- }
+ MetaMapRec *next = m_metaMaps->m_next;
+ m_metaMaps->deleteInstance();
+ m_metaMaps = next;
}
}
-//-------------------------------------------------------------------------------------------------
-const MetaMapRec *MetaMap::getFirstMetaMapRec() const
-{
- if( TheGlobalData->isLegacyInput() )
- return m_metaMaps[ INPUT_SCHEME_LEGACY ];
-
- return m_metaMaps[ TheGlobalData->isWasdCamera() ? BINDINGS_WASD : INPUT_SCHEME_MODERN ];
-}
-
-//-------------------------------------------------------------------------------------------------
-void MetaMap::loadLegacyBindings( const AsciiString& languageMapFile )
-{
- m_parseScheme = INPUT_SCHEME_LEGACY;
- INI ini;
- ini.load( languageMapFile, INI_LOAD_OVERWRITE, NULL );
- m_parseScheme = INPUT_SCHEME_MODERN;
-}
-
-//-------------------------------------------------------------------------------------------------
-void MetaMap::loadWasdBindings( const AsciiString& overlayFile )
-{
- //
- // Appended at the tail, not through getMetaMapRec, which puts a new record at the head: the
- // translator stops at the first record that matches a key, so the copy keeps Modern's order and
- // answers a key the way Modern does wherever the overlay does not reach.
- //
- MetaMapRec **tail = &m_metaMaps[ BINDINGS_WASD ];
- for( const MetaMapRec *modern = m_metaMaps[ INPUT_SCHEME_MODERN ]; modern; modern = modern->m_next )
- {
- MetaMapRec *copy = newInstance( MetaMapRec );
- copy->m_next = NULL;
- copy->m_meta = modern->m_meta;
- copy->m_key = modern->m_key;
- copy->m_transition = modern->m_transition;
- copy->m_modState = modern->m_modState;
- copy->m_usableIn = modern->m_usableIn;
- copy->m_category = modern->m_category;
- copy->m_description = modern->m_description;
- copy->m_displayName = modern->m_displayName;
- *tail = copy;
- tail = &copy->m_next;
- }
-
- m_parseScheme = BINDINGS_WASD;
- INI ini;
- ini.load( overlayFile, INI_LOAD_OVERWRITE, NULL );
- m_parseScheme = INPUT_SCHEME_MODERN;
-}
-
//-------------------------------------------------------------------------------------------------
GameMessage::Type MetaMap::findGameMessageMetaType(const char* name)
{
@@ -898,7 +813,7 @@ GameMessage::Type MetaMap::findGameMessageMetaType(const char* name)
//-------------------------------------------------------------------------------------------------
MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
{
- for (MetaMapRec *map = m_metaMaps[m_parseScheme]; map; map = map->m_next)
+ for (MetaMapRec *map = m_metaMaps; map; map = map->m_next)
{
if (map->m_meta == t)
return map;
@@ -914,8 +829,8 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
m->m_category = CATEGORY_MISC;
m->m_description.clear();
m->m_displayName.clear();
- m->m_next = m_metaMaps[m_parseScheme];
- m_metaMaps[m_parseScheme] = m;
+ m->m_next = m_metaMaps;
+ m_metaMaps = m;
return m;
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
index fecdb8089..d633cee05 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
@@ -285,10 +285,6 @@ SelectionTranslator::SelectionTranslator()
m_selectFeedbackAnchor.x = 0;
m_selectFeedbackAnchor.y = 0;
m_displayedMaxWarning = FALSE;
- m_rightDownPixel.x = 0;
- m_rightDownPixel.y = 0;
- m_rightDownTime = 0;
- m_rightDownCamera.zero();
m_selectCountMap.clear();
forgetPendingSquads();
@@ -479,7 +475,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// click - the same fallback, in the same order, as the point pick in
// W3DView::iterateDrawablesInRegion
//
- if( underCursor == NULL && !TheGlobalData->isLegacyInput() )
+ if( underCursor == NULL )
underCursor = TheGameClient->pickDrawableByHealthBar( &pixel );
Object *objUnderCursor = underCursor ? underCursor->getObject() : NULL;
@@ -517,7 +513,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
break;
}
- // an armed order key, or Legacy's ctrl, makes this click an order, which CommandXlat gives
+ // an armed order key makes this click an order, which CommandXlat gives
if (TheInGameUI->isOrderKeyArmed() || TheInGameUI->isForceFireOn())
break;
@@ -712,8 +708,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
was a way to take things back out and a way to leave the base staff behind: Alt keeps
only what can shoot, Ctrl removes the box from the selection instead of replacing it.
Both are drag-only. A point click has to stay exactly what it was - a filter that eats
- single clicks reads as a broken mouse. Legacy has neither: its Ctrl is force fire. */
- if (!isPoint && !TheGlobalData->isLegacyInput())
+ single clicks reads as a broken mouse. */
+ if (!isPoint)
{
if (TheKeyboard->isAlt())
{
@@ -772,9 +768,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
}
// A box with an army in it takes the army and leaves the dozers and trucks standing among
- // it; a box of workers alone still takes the workers. Drag-only, like the filters above,
- // and not under Legacy, which is the 2003 box.
- if (!isPoint && !TheGlobalData->isLegacyInput())
+ // it; a box of workers alone still takes the workers. Drag-only, like the filters above.
+ if (!isPoint)
prioritizeMilitaryBoxSelection(drawablesThatWillSelect, isSelectableMilitaryInBox);
SelectionInfo si;
@@ -1143,9 +1138,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
if( !TheInGameUI->getGUICommand() && !TheInGameUI->isOrderKeyArmed()
&& !TheKeyboard->isShift() && !TheKeyboard->isCtrl() && !TheKeyboard->isAlt() )
{
- //No GUI command mode, so a click on empty ground deselects everyone. Not in Legacy,
- //where that click is a move order and the right button is what deselects.
- if( TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID && !TheGlobalData->isLegacyInput() )
+ //No GUI command mode, so a click on empty ground deselects everyone.
+ if( TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID )
{
if( !TheInGameUI->getPreventLeftClickDeselectionInAlternateMouseModeForOneClick() )
{
@@ -1164,16 +1158,6 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
break;
}
- //-----------------------------------------------------------------------------
- case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
- case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:
- {
- m_rightDownPixel = msg->getArgument( 0 )->pixel;
- m_rightDownTime = (UnsignedInt)msg->getArgument( 2 )->integer;
- TheTacticalView->getPosition( &m_rightDownCamera );
- break;
- }
-
//-----------------------------------------------------------------------------
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:
{
@@ -1184,26 +1168,6 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
break;
}
- //
- // Legacy is the game as shipped: a right drag scrolled the camera and did nothing else, and
- // a right click cancelled whatever was armed or, with nothing armed, deselected everyone.
- //
- if( TheGlobalData->isLegacyInput() )
- {
- const ICoord2D lift = msg->getArgument( 0 )->pixel;
- Coord3D cameraNow;
- TheTacticalView->getPosition( &cameraNow );
- if( !TheMouse->isClick( &m_rightDownPixel, &lift, &m_rightDownCamera, &cameraNow,
- m_rightDownTime, (UnsignedInt)msg->getArgument( 2 )->integer ) )
- break;
-
- if( TheInGameUI->getGUICommand() == NULL && TheInGameUI->getPendingPlaceType() == NULL )
- {
- deselectAll();
- break;
- }
- }
-
//
// The right button drops whatever is armed, and it does so on a drag as well as on a
// click. A dozer placing a row of structures with shift held is the case that made this
@@ -1292,7 +1256,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// A screen that fills the middle of the display and answers nothing on the keyboard is
// the thing being fixed, so group selection gives way for as long as it is up.
//
- if( TheControlBar && TheControlBar->isPurchaseScienceVisible() && !TheGlobalData->isLegacyInput()
+ if( TheControlBar && TheControlBar->isPurchaseScienceVisible()
&& group >= 1 && group <= PURCHASE_SCIENCE_COLUMNS )
{
TheControlBar->pressPurchaseScienceColumn( group - 1 );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
index e5c516cb2..31abe2c80 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
@@ -137,11 +137,6 @@ extern Bool contextCommandForNewSelection(const DrawableList *currentlySelectedD
}
}
- Drawable *newMine = NULL;
- Drawable *newFriendly = NULL;
- Drawable *newEnemy = NULL;
- Drawable *newCivilian = NULL;
-
for (it = newlySelectedDrawables->begin(); it != newlySelectedDrawables->end(); ++it) {
if (!(*it)) {
continue;
@@ -160,21 +155,17 @@ extern Bool contextCommandForNewSelection(const DrawableList *currentlySelectedD
}
if (obj->isLocallyControlled()) {
- ++outSelectionInfo->newCountMine;
- newMine = *it;
+ ++outSelectionInfo->newCountMine;
if (obj->isKindOf(KINDOF_STRUCTURE)) {
++outSelectionInfo->newCountMineBuildings;
}
} else {
Relationship rel = localPlayer->getRelationship(obj->getTeam());
if (rel == ALLIES) {
- newFriendly = *it;
++outSelectionInfo->newCountFriends;
} else if (rel == ENEMIES) {
- newEnemy = *it;
++outSelectionInfo->newCountEnemies;
} else if (rel == NEUTRAL) {
- newCivilian = *it;
++outSelectionInfo->newCountCivilians;
}
}
@@ -184,73 +175,10 @@ extern Bool contextCommandForNewSelection(const DrawableList *currentlySelectedD
DEBUG_ASSERTCRASH(outSelectionInfo->currentCountFriends <= 1, ("Selection bug. jkmcd"));
DEBUG_ASSERTCRASH(outSelectionInfo->currentCountCivilians <= 1, ("Selection bug. jkmcd"));
- if (outSelectionInfo->currentCountEnemies > 0) {
- // If we have an enemy selected, there are no context sensitive commands
- return FALSE;
- }
-
- if (outSelectionInfo->currentCountFriends > 0) {
- return FALSE;
- }
-
- if (outSelectionInfo->currentCountCivilians > 0) {
- return FALSE;
- }
-
- // In Modern the left button selects and the right button orders, so a left click never commands.
- // The counting above is still wanted - the caller reads the counts for the cursor and the
- // selection filters.
- if (!TheGlobalData->isLegacyInput()) {
- return FALSE;
- }
-
- // In Legacy the left button is both, and this is the game's own rule for which one a click on an
- // enemy, an ally, a garrisonable building or a crate is.
- if (outSelectionInfo->currentCountMine > 0) {
- if (outSelectionInfo->newCountEnemies > 0) {
- if (outSelectionInfo->newCountEnemies == 1 && selectionIsPoint) {
- return TheGameClient->evaluateContextCommand(newEnemy, newEnemy->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
- }
-
- return selectionIsPoint;
- }
-
- if (outSelectionInfo->newCountMine > 0) {
- if (outSelectionInfo->newCountMine == 1 && selectionIsPoint && !TheInGameUI->isInPreferSelectionMode()) {
- return TheGameClient->evaluateContextCommand(newMine, newMine->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
- }
-
- return FALSE;
- }
-
- if (outSelectionInfo->newCountFriends > 0) {
- if (outSelectionInfo->newCountFriends == 1 && selectionIsPoint) {
- return TheGameClient->evaluateContextCommand(newFriendly, newFriendly->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
- }
- return FALSE;
- }
-
- if (outSelectionInfo->currentCountMineInfantry > 0 && outSelectionInfo->newCountGarrisonableBuildings == 1) {
- return TRUE;
- }
-
- if (outSelectionInfo->newCountCivilians > 0) {
- if (outSelectionInfo->newCountCivilians == 1 && selectionIsPoint) {
- return TheGameClient->evaluateContextCommand(newCivilian, newCivilian->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
- }
- return FALSE;
- }
-
- if (outSelectionInfo->newCountCrates > 0) {
- return (outSelectionInfo->newCountCrates == 1 && selectionIsPoint);
- }
- }
-
- if (outSelectionInfo->currentCountMine == 0) {
- return FALSE;
- }
-
- return selectionIsPoint;
+ // The left button selects and the right button orders, so a left click never commands. The
+ // counting above is still wanted - the caller reads the counts for the cursor and the selection
+ // filters.
+ return FALSE;
}
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
index c5a020a19..78b7e0457 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
@@ -2693,10 +2693,9 @@ Int W3DView::iterateDrawablesInRegion( IRegion2D *screenRegion,
// hidden behind a building or lost in a crowd - and infantry at full zoom out is a handful of
// pixels of model under a bar that is easier to hit than the man. Fallback order matters: a
// bar hangs in the air above its own unit and so overlaps whatever stands behind it, so it may
- // only answer a click that would otherwise have missed everything. Legacy input is the game
- // as shipped, where a bar was only ever a picture.
+ // only answer a click that would otherwise have missed everything.
//
- if (onlyDrawableToTest == NULL && !TheGlobalData->isLegacyInput())
+ if (onlyDrawableToTest == NULL)
onlyDrawableToTest = TheGameClient->pickDrawableByHealthBar(&screenRegion->lo);
if (onlyDrawableToTest == NULL) {
diff --git a/GeneralsMD/Code/Tests/test_camera_behavior.inc b/GeneralsMD/Code/Tests/test_camera_behavior.inc
index 100308ed5..0339abe85 100644
--- a/GeneralsMD/Code/Tests/test_camera_behavior.inc
+++ b/GeneralsMD/Code/Tests/test_camera_behavior.inc
@@ -188,7 +188,7 @@ TEST(camera_margin_preferences_load_and_rebuild_constraints)
CHECK_EQ(f.view.constraintRecalcs, 1);
}
-TEST(camera_wheel_anchors_zoom_to_cursor_only_under_modern_with_the_box_ticked)
+TEST(camera_wheel_anchors_zoom_to_cursor_only_with_the_box_ticked)
{
// Pull request 5 asked for zoom to cursor to go; it stayed as a menu box instead.
const OptionDef *def = findOptionDef("ZoomToCursor");
@@ -220,14 +220,9 @@ TEST(camera_wheel_anchors_zoom_to_cursor_only_under_modern_with_the_box_ticked)
f.global->m_zoomToCursor = FALSE;
spinWheel();
CHECK_EQ(f.view.zoomAnchors, 1);
-
- f.global->m_zoomToCursor = TRUE;
- f.global->m_inputScheme = INPUT_SCHEME_LEGACY;
- spinWheel();
- CHECK_EQ(f.view.zoomAnchors, 1);
}
-TEST(wasd_camera_scrolls_without_touching_the_cursor_and_only_with_the_box_ticked)
+TEST(arrow_keys_scroll_the_camera_and_w_a_s_d_stay_grid_keys)
{
CHECK(bootOnce());
CameraInputFixture f;
@@ -240,8 +235,7 @@ TEST(wasd_camera_scrolls_without_touching_the_cursor_and_only_with_the_box_ticke
message->deleteInstance();
};
- // Box off: D is a unit key and scrolls nothing; the arrow keys scroll behind the scroll arrows.
- CHECK(!f.global->isWasdCamera());
+ // D is a command bar key and scrolls nothing; the arrow keys scroll behind the scroll arrows.
press(KEY_D, TRUE);
CHECK(!f.ui->scrolling);
press(KEY_D, FALSE);
@@ -253,19 +247,4 @@ TEST(wasd_camera_scrolls_without_touching_the_cursor_and_only_with_the_box_ticke
CHECK(f.ui->scrolling);
press(KEY_RIGHT, FALSE);
CHECK(!f.ui->scrolling);
-
- // Box on: D scrolls, and the cursor is not touched on the way in or out.
- f.global->m_wasdCamera = TRUE;
- const Int cursorChanges = f.mouse.cursorChanges;
- press(KEY_D, TRUE);
- CHECK(f.ui->scrolling);
- press(KEY_D, FALSE);
- CHECK(!f.ui->scrolling);
- CHECK_EQ(f.mouse.cursorChanges, cursorChanges);
-
- // Legacy keeps the game's own keys: the box is ignored.
- f.global->m_inputScheme = INPUT_SCHEME_LEGACY;
- press(KEY_D, TRUE);
- CHECK(!f.ui->scrolling);
- press(KEY_D, FALSE);
}
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index fcd6e2972..31f853a37 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -1057,22 +1057,6 @@ TEST(force_fire_is_the_attack_key_and_nothing_else)
CHECK( !CommandXlat_isForceAttackTargeting( false, true ) );
}
-/* InGameUI.cpp: Legacy is the game as shipped, where holding ctrl is force fire. Modern keeps ctrl for
- the shared pace and force fires on the attack key alone. */
-extern Bool InGameUI_isForceFireOn( Bool forceAttackArmed, Bool ctrlHeld, Bool legacyInput );
-
-TEST(legacy_ctrl_force_fires_and_modern_ctrl_does_not)
-{
- CHECK( InGameUI_isForceFireOn( false, true, true ) );
- CHECK( !InGameUI_isForceFireOn( false, true, false ) );
-
- /* the attack key arms it under either scheme */
- CHECK( InGameUI_isForceFireOn( true, false, false ) );
- CHECK( InGameUI_isForceFireOn( true, false, true ) );
-
- CHECK( !InGameUI_isForceFireOn( false, false, true ) );
-}
-
/* Player.cpp: the lobby's unit limit is 840 units shared out by the players who are not watching. */
TEST(unit_limit_shares_840_between_the_players)
{
@@ -3096,60 +3080,183 @@ TEST(controlbar_command_places_follow_the_owners_drawing)
Int places[ SLOTS ];
const Int N = GUI_COMMAND_NONE;
- /* AmericaDozerCommandSet: structures in slots 1 to 9, 11 and 13, disarm mines in 14. The first
- eight go to the Q bar at their slot, the rest to the W bar at their slot less eight, which is
- the place the structure chord's second key names; the disarm is an ability on the top row */
+ /* AmericaDozerCommandSet: structures in slots 1 to 9, 11 and 13, disarm mines in 14. Nothing
+ has a place of its own, so the structures fill the places in reading order and the disarm, an
+ ability, comes after them */
const Int dozer[ SLOTS ] = { GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT,
GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT,
GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_DOZER_CONSTRUCT, N, GUI_COMMAND_DOZER_CONSTRUCT, N,
GUI_COMMAND_DOZER_CONSTRUCT, GUI_COMMAND_FIRE_WEAPON };
- ControlBar_commandPlaces( dozer, SLOTS, places );
+ CHECK( !ControlBar_commandPlaces( dozer, SLOTS, places ) );
CHECK_EQ( places[ 0 ], (Int)COMMAND_PLACE_Q );
- CHECK_EQ( places[ 7 ], COMMAND_PLACE_Q + 7 );
- CHECK_EQ( places[ 8 ], (Int)COMMAND_PLACE_W );
- CHECK_EQ( places[ 10 ], COMMAND_PLACE_W + 2 );
- CHECK_EQ( places[ 12 ], COMMAND_PLACE_W + 4 );
+ CHECK_EQ( places[ 5 ], (Int)COMMAND_PLACE_Y );
+ CHECK_EQ( places[ 6 ], (Int)COMMAND_PLACE_A );
+ CHECK_EQ( places[ 8 ], (Int)COMMAND_PLACE_D );
CHECK_EQ( places[ 9 ], -1 );
- CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_SKILL );
+ CHECK_EQ( places[ 10 ], (Int)COMMAND_PLACE_F );
+ CHECK_EQ( places[ 12 ], (Int)COMMAND_PLACE_G );
+ CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_H );
/* AmericaVehicleHumveeCommandSet: three drones, five passengers, evacuate, attack move, guard,
- stop. The orders take their own places whatever slot they were in; the passengers go to the Q
- bar by slot and the drones along the top */
+ stop. The orders take the owner's places whatever slot they were in - stop S, attack move D,
+ eject Z, guard X - and A and C are kept for attack and hold position; the drones fill the top
+ row and the passengers run on into F G */
const Int humvee[ SLOTS ] = { GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_OBJECT_UPGRADE,
GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER,
GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EVACUATE, N, GUI_COMMAND_ATTACK_MOVE, N, GUI_COMMAND_GUARD, GUI_COMMAND_STOP };
- ControlBar_commandPlaces( humvee, SLOTS, places );
- CHECK_EQ( places[ 0 ], COMMAND_PLACE_SKILL + 0 );
- CHECK_EQ( places[ 2 ], COMMAND_PLACE_SKILL + 2 );
- CHECK_EQ( places[ 3 ], COMMAND_PLACE_Q + 3 );
- CHECK_EQ( places[ 8 ], (Int)COMMAND_PLACE_EJECT );
- CHECK_EQ( places[ 10 ], (Int)COMMAND_PLACE_ATTACK_MOVE );
- CHECK_EQ( places[ 12 ], (Int)COMMAND_PLACE_GUARD );
- CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_STOP );
-
- /* ChinaCommandCenterCommandSet: a dozer to build, seven powers, two upgrades, rally, sell. Past
- the top row's five the rest spill into the worker bars' free places, and nothing lands on the
- places kept for orders */
+ CHECK( ControlBar_commandPlaces( humvee, SLOTS, places ) );
+ CHECK_EQ( places[ 0 ], (Int)COMMAND_PLACE_Q );
+ CHECK_EQ( places[ 5 ], (Int)COMMAND_PLACE_Y );
+ CHECK_EQ( places[ 6 ], (Int)COMMAND_PLACE_F );
+ CHECK_EQ( places[ 7 ], (Int)COMMAND_PLACE_G );
+ CHECK_EQ( places[ 8 ], (Int)COMMAND_PLACE_Z );
+ CHECK_EQ( places[ 10 ], (Int)COMMAND_PLACE_D );
+ CHECK_EQ( places[ 12 ], (Int)COMMAND_PLACE_X );
+ CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_S );
+
+ /* ChinaCommandCenterCommandSet: a dozer to build, seven powers, two upgrades, rally, sell. Rally
+ stands on B and sell on N whatever slot they were in; the dozer first, then the rest in order */
const Int centre[ SLOTS ] = { GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_SPECIAL_POWER,
GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_SPECIAL_POWER,
GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_OBJECT_UPGRADE, N, N,
GUI_COMMAND_SET_RALLY_POINT, GUI_COMMAND_SELL };
- ControlBar_commandPlaces( centre, SLOTS, places );
+ CHECK( !ControlBar_commandPlaces( centre, SLOTS, places ) );
CHECK_EQ( places[ 0 ], (Int)COMMAND_PLACE_Q );
- CHECK_EQ( places[ 5 ], COMMAND_PLACE_SKILL + 4 );
- CHECK_EQ( places[ 6 ], COMMAND_PLACE_Q + 1 );
- CHECK_EQ( places[ 13 ], COMMAND_PLACE_Q + 6 );
+ CHECK_EQ( places[ 1 ], (Int)COMMAND_PLACE_W );
+ CHECK_EQ( places[ 6 ], (Int)COMMAND_PLACE_A );
+ CHECK_EQ( places[ 9 ], (Int)COMMAND_PLACE_F );
+ CHECK_EQ( places[ 12 ], (Int)COMMAND_PLACE_B );
+ CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_N );
+
+ /* a factory whose set opens on an upgrade, nine units after it, a garrison, rally and sell: the
+ units take Q W E R T Y and A S D, the upgrade comes after them on F, the garrison's evacuate is
+ Z like a transport's */
+ const Int factory[ SLOTS ] = { GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD,
+ GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD,
+ GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_EVACUATE, N,
+ GUI_COMMAND_SET_RALLY_POINT, GUI_COMMAND_SELL };
+ CHECK( !ControlBar_commandPlaces( factory, SLOTS, places ) );
+ CHECK_EQ( places[ 1 ], (Int)COMMAND_PLACE_Q );
+ CHECK_EQ( places[ 6 ], (Int)COMMAND_PLACE_Y );
+ CHECK_EQ( places[ 7 ], (Int)COMMAND_PLACE_A );
+ CHECK_EQ( places[ 9 ], (Int)COMMAND_PLACE_D );
+ CHECK_EQ( places[ 0 ], (Int)COMMAND_PLACE_F );
+ CHECK_EQ( places[ 10 ], (Int)COMMAND_PLACE_Z );
+ CHECK_EQ( places[ 12 ], (Int)COMMAND_PLACE_B );
+ CHECK_EQ( places[ 13 ], (Int)COMMAND_PLACE_N );
+
+ /* the biggest set there is, the Boss general's dozer, fourteen structures: every one gets a place
+ and no two share one */
+ Int boss[ SLOTS ];
+ for( Int slot = 0; slot < SLOTS; slot++ )
+ boss[ slot ] = GUI_COMMAND_DOZER_CONSTRUCT;
+ ControlBar_commandPlaces( boss, SLOTS, places );
Bool taken[ COMMAND_PLACE_COUNT ] = { FALSE };
for( Int slot = 0; slot < SLOTS; slot++ )
{
- if( places[ slot ] < 0 )
+ CHECK( places[ slot ] >= 0 && places[ slot ] < COMMAND_PLACE_COUNT );
+ if( places[ slot ] < 0 || places[ slot ] >= COMMAND_PLACE_COUNT )
continue;
CHECK( !taken[ places[ slot ] ] );
- CHECK( places[ slot ] < COMMAND_PLACE_SKILLS || places[ slot ] >= COMMAND_PLACE_Q );
taken[ places[ slot ] ] = TRUE;
}
}
+/* CommandMapReforged.ini binds COMMAND_SLOTnn to the key of place nn - 1: the grid reads Q W E R T Y,
+ A S D F G H, Z X C V B N, so a place's key is where the owner put it on 2026-09-28 - a unit's attack
+ on A, stop on S, attack move on D, eject on Z, guard on X, hold on C; a building's sell on N, rally
+ point on B and evacuate on Z. No other record may hold one of those letters bare, or it comes
+ first in the list and steals the key. */
+TEST(the_command_grid_keys_are_the_places_and_n_sells_and_b_rallies)
+{
+ FILE *fp = fopen( COMMAND_MAP_REFORGED_INI, "rb" );
+ CHECK( fp != NULL );
+ if( fp == NULL )
+ return;
+ std::string text;
+ char chunk[ 1024 ];
+ size_t got = 0;
+ while( ( got = fread( chunk, 1, sizeof( chunk ), fp ) ) > 0 )
+ text.append( chunk, got );
+ fclose( fp );
+
+ static const char GRID_KEYS[] = "QWERTYASDFGHZXCVBN";
+ CHECK_EQ( (Int)strlen( GRID_KEYS ), (Int)COMMAND_PLACE_COUNT );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_ATTACK ], 'A' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_STOP ], 'S' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_ATTACK_MOVE ], 'D' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_EJECT ], 'Z' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_GUARD ], 'X' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_HOLD ], 'C' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_RALLY ], 'B' );
+ CHECK_EQ( GRID_KEYS[ COMMAND_PLACE_SELL ], 'N' );
+
+ // and the command types that land there, whatever slot of their set they sit in
+ enum { SLOTS = 8 };
+ const Int unit[ SLOTS ] = { GUI_COMMAND_STOP, GUI_COMMAND_GUARD, GUI_COMMAND_EVACUATE, GUI_COMMAND_ATTACK_MOVE,
+ GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_NONE, GUI_COMMAND_NONE, GUI_COMMAND_NONE };
+ Int places[ SLOTS ];
+ CHECK( ControlBar_commandPlaces( unit, SLOTS, places ) );
+ CHECK_EQ( GRID_KEYS[ places[ 0 ] ], 'S' );
+ CHECK_EQ( GRID_KEYS[ places[ 1 ] ], 'X' );
+ CHECK_EQ( GRID_KEYS[ places[ 2 ] ], 'Z' );
+ CHECK_EQ( GRID_KEYS[ places[ 3 ] ], 'D' );
+ CHECK_EQ( GRID_KEYS[ places[ 4 ] ], 'Q' );
+ const Int building[ SLOTS ] = { GUI_COMMAND_SELL, GUI_COMMAND_SET_RALLY_POINT, GUI_COMMAND_EVACUATE,
+ GUI_COMMAND_UNIT_BUILD, GUI_COMMAND_NONE, GUI_COMMAND_NONE, GUI_COMMAND_NONE, GUI_COMMAND_NONE };
+ CHECK( !ControlBar_commandPlaces( building, SLOTS, places ) );
+ CHECK_EQ( GRID_KEYS[ places[ 0 ] ], 'N' );
+ CHECK_EQ( GRID_KEYS[ places[ 1 ] ], 'B' );
+ CHECK_EQ( GRID_KEYS[ places[ 2 ] ], 'Z' );
+ CHECK_EQ( GRID_KEYS[ places[ 3 ] ], 'Q' );
+
+ // every block as name, key and modifiers
+ Int slotsBound = 0;
+ std::string name, key, modifiers;
+ size_t at = 0;
+ while( at < text.size() )
+ {
+ size_t end = text.find( '\n', at );
+ if( end == std::string::npos )
+ end = text.size();
+ std::string line = text.substr( at, end - at );
+ at = end + 1;
+ const size_t comment = line.find( ';' );
+ if( comment != std::string::npos )
+ line.erase( comment );
+ char word[ 64 ] = { 0 };
+ char value[ 64 ] = { 0 };
+ if( sscanf( line.c_str(), " CommandMap %63s", word ) == 1 )
+ {
+ name = word;
+ key.clear();
+ modifiers = "NONE";
+ }
+ else if( sscanf( line.c_str(), " Key = %63s", value ) == 1 )
+ key = value;
+ else if( sscanf( line.c_str(), " Modifiers = %63s", value ) == 1 )
+ modifiers = value;
+ else if( sscanf( line.c_str(), " %63s", word ) == 1 && strcmp( word, "End" ) == 0 && !name.empty() )
+ {
+ Int slot = 0;
+ if( sscanf( name.c_str(), "COMMAND_SLOT%d", &slot ) == 1 )
+ {
+ CHECK( slot >= 1 && slot <= COMMAND_PLACE_COUNT );
+ if( slot >= 1 && slot <= COMMAND_PLACE_COUNT )
+ {
+ CHECK_STR( key.c_str(), ( std::string( "KEY_" ) + GRID_KEYS[ slot - 1 ] ).c_str() );
+ CHECK_STR( modifiers.c_str(), "NONE" );
+ slotsBound++;
+ }
+ }
+ else if( modifiers == "NONE" && key.size() == 5 && key.compare( 0, 4, "KEY_" ) == 0 )
+ CHECK( strchr( GRID_KEYS, key[ 4 ] ) == NULL );
+ name.clear();
+ }
+ }
+ CHECK_EQ( slotsBound, (Int)COMMAND_PLACE_COUNT );
+}
+
TEST(controlbar_seconds_round_up_and_never_reach_zero_early)
{
/* nothing left is the only thing that reads as no number at all */
@@ -11478,61 +11585,38 @@ TEST(gameplay_conveniences_are_forced_on_and_left_the_catalog)
delete scratch;
}
-TEST(the_input_scheme_is_a_live_menu_choice_that_starts_modern)
+TEST(an_options_ini_naming_the_removed_input_scheme_and_wasd_keys_still_loads)
{
- /* Legacy is read on every click and key, so the row has to say APPLY_LIVE - a restart note on a
- setting that already took would send the player looking for a change that is not coming. A
- player who never opens the menu keeps the game they already had. */
- const OptionDef *def = findOptionDef( "InputScheme" );
- CHECK( def != NULL );
- if( def == NULL )
- return;
- CHECK_EQ( def->kind, OPTION_ENUM );
- CHECK_EQ( def->apply, APPLY_LIVE );
- CHECK_EQ( def->lo, 0 );
- CHECK_EQ( def->hi, (Int)INPUT_SCHEME_COUNT - 1 );
- CHECK( def->widgetName != NULL && def->widgetName[ 0 ] != '\0' );
+ /* InputScheme and WasdCamera were catalog rows until the Legacy mouse and the W A S D camera came
+ out. Every Options.ini saved while they existed still carries both, and UserPreferences::load
+ puts every key it reads into the map. The catalog only looks up its own keys, so the two are
+ left lying there, and the rows around them still load. */
+ CHECK( findOptionDef( "InputScheme" ) == NULL );
+ CHECK( findOptionDef( "WasdCamera" ) == NULL );
GlobalData *saved = TheWritableGlobalData;
GlobalData *scratch = NEW GlobalData;
TheWritableGlobalData = scratch;
- CHECK_EQ( scratch->m_inputScheme, (Int)INPUT_SCHEME_MODERN );
- CHECK( !scratch->isLegacyInput() );
- def->set( INPUT_SCHEME_LEGACY );
- CHECK( scratch->isLegacyInput() );
- CHECK_EQ( def->get(), (Int)INPUT_SCHEME_LEGACY );
-
- TheWritableGlobalData = saved;
- delete scratch;
-}
+ const OptionDef *orderLines = findOptionDef( "OrderLines" );
+ const OptionDef *zoom = findOptionDef( "ZoomToCursor" );
+ CHECK( orderLines != NULL && zoom != NULL );
+ orderLines->set( 1 );
+ zoom->set( 1 );
-TEST(wasd_camera_is_a_live_check_box_that_starts_off_and_needs_modern_input)
-{
- /* The box moves eleven keys a player already has in their hands, so nobody gets it without asking.
- A tick saved under Modern is kept through a switch to Legacy, which plays the game's own map,
- and comes back with Modern. */
- const OptionDef *def = findOptionDef( "WasdCamera" );
- CHECK( def != NULL );
- if( def == NULL )
- return;
- CHECK_EQ( def->kind, OPTION_BOOL );
- CHECK_EQ( def->apply, APPLY_LIVE );
- CHECK( def->widgetName != NULL && def->widgetName[ 0 ] != '\0' );
+ UserPreferences pref;
+ pref[ AsciiString( "InputScheme" ) ] = AsciiString( "1" );
+ pref[ AsciiString( "WasdCamera" ) ] = AsciiString( "yes" );
+ pref[ AsciiString( "OrderLines" ) ] = AsciiString( "no" );
+ pref[ AsciiString( "ZoomToCursor" ) ] = AsciiString( "no" );
+ loadOptionsFromPreferences( pref );
- GlobalData *saved = TheWritableGlobalData;
- GlobalData *scratch = NEW GlobalData;
- TheWritableGlobalData = scratch;
+ CHECK_EQ( orderLines->get(), 0 );
+ CHECK_EQ( zoom->get(), 0 );
- CHECK( !scratch->m_wasdCamera );
- CHECK( !scratch->isWasdCamera() );
- def->set( 1 );
- CHECK( scratch->isWasdCamera() );
- scratch->m_inputScheme = INPUT_SCHEME_LEGACY;
- CHECK( !scratch->isWasdCamera() );
- CHECK_EQ( def->get(), 1 );
- scratch->m_inputScheme = INPUT_SCHEME_MODERN;
- CHECK( scratch->isWasdCamera() );
+ // and saving over such a file leaves the old keys alone instead of tripping on them
+ saveOptionsToPreferences( pref );
+ CHECK_STR( pref[ AsciiString( "OrderLines" ) ].str(), "no" );
TheWritableGlobalData = saved;
delete scratch;
@@ -13971,44 +14055,6 @@ TEST(chroma_key_maps_agree_on_every_letter_and_digit)
}
}
-// Where a grid key lands. This is the decision pressCommandButton used to make inline, pulled
-// out so the keyboard lighting could ask the same question without pressing anything; every
-// row below is what the inline version did, read off it before it was moved.
-TEST(grid_press_follows_the_builders_two_key_chord)
-{
- const Int NOTHING = ControlBar::SLOT_NOTHING;
- const Int ARMS = ControlBar::SLOT_ARMS_CHORD;
- const Int Q = ControlBar::CHORD_SLOT_Q;
- const Int W = ControlBar::CHORD_SLOT_W;
- const Int GROUP = ControlBar::CHORD_GROUP_SIZE;
-
- // no structures on the bar: a slot is a slot, chord or no chord
- CHECK_EQ(ControlBar::resolveGridPress(0, -1, FALSE, FALSE), 0);
- CHECK_EQ(ControlBar::resolveGridPress(5, -1, FALSE, FALSE), 5);
- CHECK_EQ(ControlBar::resolveGridPress(5, 0, FALSE, FALSE), 5);
-
- // out of range names nothing
- CHECK_EQ(ControlBar::resolveGridPress(-1, -1, FALSE, FALSE), NOTHING);
- CHECK_EQ(ControlBar::resolveGridPress(MAX_COMMANDS_PER_SET, -1, TRUE, FALSE), NOTHING);
-
- // a builder, nothing armed: Q and W arm, a structure's own key does nothing on its own,
- // and a cell that is not a structure is still one press
- CHECK_EQ(ControlBar::resolveGridPress(Q, -1, TRUE, TRUE), ARMS);
- CHECK_EQ(ControlBar::resolveGridPress(W, -1, TRUE, FALSE), ARMS);
- CHECK_EQ(ControlBar::resolveGridPress(4, -1, TRUE, TRUE), NOTHING);
- CHECK_EQ(ControlBar::resolveGridPress(4, -1, TRUE, FALSE), 4);
-
- // armed: the second key is a cell of the first group, shifted into the armed one
- CHECK_EQ(ControlBar::resolveGridPress(0, 0, TRUE, TRUE), 0);
- CHECK_EQ(ControlBar::resolveGridPress(3, 0, TRUE, FALSE), 3);
- CHECK_EQ(ControlBar::resolveGridPress(0, 1, TRUE, TRUE), GROUP);
- CHECK_EQ(ControlBar::resolveGridPress(3, 1, TRUE, FALSE), GROUP + 3);
- CHECK_EQ(ControlBar::resolveGridPress(GROUP - 1, 1, TRUE, FALSE), GROUP + GROUP - 1);
- // a second key from outside the first group's cells is not a cell of any group
- CHECK_EQ(ControlBar::resolveGridPress(GROUP, 0, TRUE, FALSE), NOTHING);
- CHECK_EQ(ControlBar::resolveGridPress(GROUP + 2, 1, TRUE, FALSE), NOTHING);
-}
-
// The generals powers tray: the first key names a row, the second a power in it, and what the
// keys can reach is what is showing rather than the size of the general's command set.
TEST(tray_press_names_a_row_and_then_a_power_in_it)
diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.py
index 4e32187f7..3f40f5861 100644
--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py
+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py
@@ -119,8 +119,7 @@ NAME_THE_UNNAMED = [
]
# Controls that are in the shipped file and are not wanted at all. CheckAlternateMouse chose
-# between the classic mouse and the alternate one; ComboBoxInputScheme is that choice now, and it
-# takes the keyboard along with the mouse.
+# between the classic mouse and the alternate one; there is one mouse now.
DELETE = ["CheckAlternateMouse"]
# The templates new controls are cloned from, and whose lettering the moved ones take.
@@ -162,9 +161,6 @@ NEW_CONTROLS = [
(LABEL, "LabelSmoke", "GUI:Smoke"),
(COMBO, "ComboBoxSmoke", None),
(CHECK, "CheckParticleBounce", "GUI:ParticleBounce"),
- (LABEL, "LabelInputScheme", "GUI:InputScheme"),
- (COMBO, "ComboBoxInputScheme", None),
- (CHECK, "CheckWasdCamera", "GUI:WasdCamera"),
(CHECK, "CheckChromaLighting", "GUI:ChromaLighting"),
]
@@ -268,8 +264,6 @@ GROUP_LAYOUT = [
("check", "Retaliation"),
("check", "CheckDoubleClickAttackMove")]),
("PageControls", 2, "GUI:OptionsGroupInput", [
- setting("LabelInputScheme", "ComboBoxInputScheme"),
- ("check", "CheckWasdCamera"),
("check", "CheckChromaLighting")]),
("PageGameplay", 0, "GUI:OptionsGroupBattlefield", [