mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Minor improvements
This commit is contained in:
parent
ffd011ac45
commit
576bd3166f
@ -1,4 +1,15 @@
|
||||
export const CHANGELOG = [
|
||||
{
|
||||
version: "1.1.2",
|
||||
date: "unreleased",
|
||||
entries: [
|
||||
"Move default key for deleting from 'X' to 'DEL'",
|
||||
"Show confirmation when deleting > 100 buildings",
|
||||
"Reintroduce 'SPACE' keybinding to center on map",
|
||||
"Improved keybinding hints",
|
||||
"Fixed some keybindings showing as 'undefined'",
|
||||
],
|
||||
},
|
||||
{
|
||||
version: "1.1.1",
|
||||
date: "28.05.2020",
|
||||
|
@ -345,15 +345,19 @@ export class Camera extends BasicSerializableObject {
|
||||
*/
|
||||
bindKeys() {
|
||||
const mapper = this.root.keyMapper;
|
||||
mapper
|
||||
.getBinding(KEYMAPPINGS.ingame.mapMoveUp)
|
||||
.add(() => console.log("move up") || (this.keyboardForce.y = -1));
|
||||
mapper.getBinding(KEYMAPPINGS.ingame.mapMoveDown).add(() => (this.keyboardForce.y = 1));
|
||||
mapper.getBinding(KEYMAPPINGS.ingame.mapMoveRight).add(() => (this.keyboardForce.x = 1));
|
||||
mapper.getBinding(KEYMAPPINGS.ingame.mapMoveLeft).add(() => (this.keyboardForce.x = -1));
|
||||
mapper.getBinding(KEYMAPPINGS.navigation.mapMoveUp).add(() => (this.keyboardForce.y = -1));
|
||||
mapper.getBinding(KEYMAPPINGS.navigation.mapMoveDown).add(() => (this.keyboardForce.y = 1));
|
||||
mapper.getBinding(KEYMAPPINGS.navigation.mapMoveRight).add(() => (this.keyboardForce.x = 1));
|
||||
mapper.getBinding(KEYMAPPINGS.navigation.mapMoveLeft).add(() => (this.keyboardForce.x = -1));
|
||||
|
||||
mapper.getBinding(KEYMAPPINGS.ingame.mapZoomIn).add(() => (this.desiredZoom = this.zoomLevel * 1.2));
|
||||
mapper.getBinding(KEYMAPPINGS.ingame.mapZoomOut).add(() => (this.desiredZoom = this.zoomLevel * 0.8));
|
||||
mapper
|
||||
.getBinding(KEYMAPPINGS.navigation.mapZoomIn)
|
||||
.add(() => (this.desiredZoom = this.zoomLevel * 1.2));
|
||||
mapper
|
||||
.getBinding(KEYMAPPINGS.navigation.mapZoomOut)
|
||||
.add(() => (this.desiredZoom = this.zoomLevel * 0.8));
|
||||
|
||||
mapper.getBinding(KEYMAPPINGS.navigation.centerMap).add(() => this.centerOnMap());
|
||||
}
|
||||
|
||||
centerOnMap() {
|
||||
@ -881,19 +885,19 @@ export class Camera extends BasicSerializableObject {
|
||||
let forceY = 0;
|
||||
|
||||
const actionMapper = this.root.keyMapper;
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.ingame.mapMoveUp).isCurrentlyPressed()) {
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveUp).isCurrentlyPressed()) {
|
||||
forceY -= 1;
|
||||
}
|
||||
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.ingame.mapMoveDown).isCurrentlyPressed()) {
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveDown).isCurrentlyPressed()) {
|
||||
forceY += 1;
|
||||
}
|
||||
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.ingame.mapMoveLeft).isCurrentlyPressed()) {
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveLeft).isCurrentlyPressed()) {
|
||||
forceX -= 1;
|
||||
}
|
||||
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.ingame.mapMoveRight).isCurrentlyPressed()) {
|
||||
if (actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveRight).isCurrentlyPressed()) {
|
||||
forceX += 1;
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,9 @@ export class GameHUD {
|
||||
}
|
||||
|
||||
/* dev:start */
|
||||
this.trailerMaker.update();
|
||||
if (this.trailerMaker) {
|
||||
this.trailerMaker.update();
|
||||
}
|
||||
/* dev:end*/
|
||||
}
|
||||
|
||||
|
@ -24,24 +24,25 @@ export class HUDKeybindingOverlay extends BaseHUDPart {
|
||||
[],
|
||||
`
|
||||
<div class="binding">
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.ingame.createMarker)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.navigation.createMarker)}</code>
|
||||
<label>${T.ingame.keybindingsOverlay.createMarker}</label>
|
||||
</div>
|
||||
|
||||
<div class="binding">
|
||||
<code class="keybinding leftMouse noPlacementOnly"></code><i class="noPlacementOnly"></i>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.ingame.mapMoveUp)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.ingame.mapMoveLeft)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.ingame.mapMoveDown)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.ingame.mapMoveRight)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.navigation.mapMoveUp)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.navigation.mapMoveLeft)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.navigation.mapMoveDown)}</code>
|
||||
<code class="keybinding">${getKeycode(KEYMAPPINGS.navigation.mapMoveRight)}</code>
|
||||
<label>${T.ingame.keybindingsOverlay.moveMap}</label>
|
||||
</div>
|
||||
|
||||
<div class="binding noPlacementOnly">
|
||||
<code class="keybinding rightMouse"></code><i></i>
|
||||
<code class="keybinding builtinKey">${T.global.keys.control}</code>+
|
||||
<code class="keybinding builtinKey">${getKeycode(
|
||||
KEYMAPPINGS.massSelect.massSelectStart
|
||||
)}</code>+
|
||||
<code class="keybinding leftMouse"></code>
|
||||
<label>${T.ingame.keybindingsOverlay.removeBuildings}</label>
|
||||
<label>${T.ingame.keybindingsOverlay.selectBuildings}</label>
|
||||
</div>
|
||||
|
||||
|
||||
@ -62,7 +63,7 @@ export class HUDKeybindingOverlay extends BaseHUDPart {
|
||||
</div>
|
||||
|
||||
<div class="binding placementOnly">
|
||||
<code class="keybinding builtinKey shift">⇧ ${getKeycode(
|
||||
<code class="keybinding builtinKey shift">${getKeycode(
|
||||
KEYMAPPINGS.placementModifiers.placeMultiple
|
||||
)}</code>
|
||||
<label>${T.ingame.keybindingsOverlay.placeMultiple}</label>
|
||||
|
@ -79,7 +79,7 @@ export class HUDMassSelector extends BaseHUDPart {
|
||||
}
|
||||
|
||||
confirmDelete() {
|
||||
if (this.selectedUids.size > 500) {
|
||||
if (this.selectedUids.size > 100) {
|
||||
const { ok } = this.root.hud.parts.dialogs.showWarning(
|
||||
T.dialogs.massDeleteConfirm.title,
|
||||
T.dialogs.massDeleteConfirm.desc.replace(
|
||||
|
@ -35,7 +35,7 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
<span class='desc'>${T.ingame.waypoints.description.replace(
|
||||
"<keybinding>",
|
||||
`<code class='keybinding'>${this.root.keyMapper
|
||||
.getBinding(KEYMAPPINGS.ingame.createMarker)
|
||||
.getBinding(KEYMAPPINGS.navigation.createMarker)
|
||||
.getKeyCodeString()}</code>`
|
||||
)}</span>
|
||||
`
|
||||
@ -121,7 +121,9 @@ export class HUDWaypoints extends BaseHUDPart {
|
||||
this.domAttach = new DynamicDomAttach(this.root, this.hintElement);
|
||||
}
|
||||
|
||||
this.root.keyMapper.getBinding(KEYMAPPINGS.ingame.createMarker).add(this.requestCreateMarker, this);
|
||||
this.root.keyMapper
|
||||
.getBinding(KEYMAPPINGS.navigation.createMarker)
|
||||
.add(this.requestCreateMarker, this);
|
||||
|
||||
this.currentMarkerOpacity = 1;
|
||||
this.rerenderWaypointList();
|
||||
|
@ -20,17 +20,20 @@ export const KEYMAPPINGS = {
|
||||
},
|
||||
|
||||
ingame: {
|
||||
mapMoveUp: { keyCode: key("W") },
|
||||
mapMoveRight: { keyCode: key("D") },
|
||||
mapMoveDown: { keyCode: key("S") },
|
||||
mapMoveLeft: { keyCode: key("A") },
|
||||
|
||||
menuOpenShop: { keyCode: key("F") },
|
||||
menuOpenStats: { keyCode: key("G") },
|
||||
|
||||
toggleHud: { keyCode: 113 }, // F2
|
||||
toggleFPSInfo: { keyCode: 115 }, // F1
|
||||
},
|
||||
|
||||
navigation: {
|
||||
mapMoveUp: { keyCode: key("W") },
|
||||
mapMoveRight: { keyCode: key("D") },
|
||||
mapMoveDown: { keyCode: key("S") },
|
||||
mapMoveLeft: { keyCode: key("A") },
|
||||
|
||||
centerMap: { keyCode: 32 }, // SPACE
|
||||
mapZoomIn: { keyCode: 187, repeated: true }, // "+"
|
||||
mapZoomOut: { keyCode: 189, repeated: true }, // "-"
|
||||
|
||||
@ -62,7 +65,7 @@ export const KEYMAPPINGS = {
|
||||
massSelectStart: { keyCode: 17 }, // CTRL
|
||||
massSelectSelectMultiple: { keyCode: 16 }, // SHIFT
|
||||
massSelectCopy: { keyCode: key("C") },
|
||||
confirmMassDelete: { keyCode: key("X") },
|
||||
confirmMassDelete: { keyCode: 46 }, // DEL
|
||||
},
|
||||
|
||||
placementModifiers: {
|
||||
|
@ -204,7 +204,7 @@ ingame:
|
||||
# every situation
|
||||
keybindingsOverlay:
|
||||
moveMap: Move
|
||||
removeBuildings: Delete
|
||||
selectBuildings: Select area
|
||||
stopPlacement: Stop placement
|
||||
rotateBuilding: Rotate building
|
||||
placeMultiple: Place multiple
|
||||
@ -557,6 +557,7 @@ keybindings:
|
||||
categoryLabels:
|
||||
general: Application
|
||||
ingame: Game
|
||||
navigation: Navigating
|
||||
placement: Placement
|
||||
massSelect: Mass Select
|
||||
buildings: Building Shortcuts
|
||||
@ -569,6 +570,7 @@ keybindings:
|
||||
mapMoveRight: Move Right
|
||||
mapMoveDown: Move Down
|
||||
mapMoveLeft: Move Left
|
||||
centerMap: Center Map
|
||||
|
||||
mapZoomIn: Zoom in
|
||||
mapZoomOut: Zoom out
|
||||
|
Loading…
Reference in New Issue
Block a user