mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Allow hovering pinned shapes to enlarge them
This commit is contained in:
parent
576bd3166f
commit
02fb6d53b5
BIN
res/ui/icons/blueprint_marker.png
Normal file
BIN
res/ui/icons/blueprint_marker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
@ -31,6 +31,14 @@
|
|||||||
@include S(height, 25px);
|
@include S(height, 25px);
|
||||||
grid-column: 1 / 2;
|
grid-column: 1 / 2;
|
||||||
grid-row: 1 / 3;
|
grid-row: 1 / 3;
|
||||||
|
pointer-events: all;
|
||||||
|
transition: transform 0.1s ease-in-out;
|
||||||
|
position: relative;
|
||||||
|
z-index: 20;
|
||||||
|
&:hover {
|
||||||
|
transform: scale(2) translateX(#{D(5px)});
|
||||||
|
z-index: 21;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .amountLabel,
|
> .amountLabel,
|
||||||
@ -64,19 +72,27 @@
|
|||||||
grid-row: 1 / 2;
|
grid-row: 1 / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.marked .amountLabel {
|
&.goal,
|
||||||
&::after {
|
&.blueprint {
|
||||||
content: " ";
|
.amountLabel {
|
||||||
position: absolute;
|
&::after {
|
||||||
display: inline-block;
|
content: " ";
|
||||||
@include S(width, 9px);
|
position: absolute;
|
||||||
@include S(height, 9px);
|
display: inline-block;
|
||||||
opacity: 0.8;
|
@include S(width, 8px);
|
||||||
@include S(top, -4px);
|
@include S(height, 8px);
|
||||||
@include S(left, -4px);
|
opacity: 0.8;
|
||||||
background: uiResource("icons/current_goal_marker.png") center center / contain no-repeat;
|
@include S(top, 4px);
|
||||||
|
@include S(left, -7px);
|
||||||
|
background: uiResource("icons/current_goal_marker.png") center center / contain no-repeat;
|
||||||
|
|
||||||
@include DarkThemeInvert;
|
@include DarkThemeInvert;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.blueprint .amountLabel::after {
|
||||||
|
background-image: uiResource("icons/blueprint_marker.png");
|
||||||
|
background-size: 90%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ export const CHANGELOG = [
|
|||||||
version: "1.1.2",
|
version: "1.1.2",
|
||||||
date: "unreleased",
|
date: "unreleased",
|
||||||
entries: [
|
entries: [
|
||||||
|
"Allow hovering pinned shapes to enlarge them",
|
||||||
"Move default key for deleting from 'X' to 'DEL'",
|
"Move default key for deleting from 'X' to 'DEL'",
|
||||||
"Show confirmation when deleting > 100 buildings",
|
"Show confirmation when deleting > 100 buildings",
|
||||||
"Reintroduce 'SPACE' keybinding to center on map",
|
"Reintroduce 'SPACE' keybinding to center on map",
|
||||||
|
@ -83,7 +83,7 @@ export const globalConfig = {
|
|||||||
|
|
||||||
debug: {
|
debug: {
|
||||||
/* dev:start */
|
/* dev:start */
|
||||||
// fastGameEnter: true,
|
fastGameEnter: true,
|
||||||
// noArtificialDelays: true,
|
// noArtificialDelays: true,
|
||||||
// disableSavegameWrite: true,
|
// disableSavegameWrite: true,
|
||||||
// showEntityBounds: true,
|
// showEntityBounds: true,
|
||||||
|
@ -74,10 +74,10 @@ export class HUDPinnedShapes extends BaseHUDPart {
|
|||||||
}
|
}
|
||||||
this.handles = [];
|
this.handles = [];
|
||||||
|
|
||||||
this.internalPinShape(currentKey, currentGoal.required, false);
|
this.internalPinShape(currentKey, currentGoal.required, false, "goal");
|
||||||
|
|
||||||
if (this.root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_blueprints)) {
|
if (this.root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_blueprints)) {
|
||||||
this.internalPinShape(blueprintShape, null, false);
|
this.internalPinShape(blueprintShape, null, false, "blueprint");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < this.pinnedShapes.length; ++i) {
|
for (let i = 0; i < this.pinnedShapes.length; ++i) {
|
||||||
@ -93,14 +93,19 @@ export class HUDPinnedShapes extends BaseHUDPart {
|
|||||||
* @param {string} key
|
* @param {string} key
|
||||||
* @param {number} goal
|
* @param {number} goal
|
||||||
* @param {boolean} canUnpin
|
* @param {boolean} canUnpin
|
||||||
|
* @param {string=} className
|
||||||
*/
|
*/
|
||||||
internalPinShape(key, goal, canUnpin = true) {
|
internalPinShape(key, goal, canUnpin = true, className = null) {
|
||||||
const definition = this.root.shapeDefinitionMgr.getShapeFromShortKey(key);
|
const definition = this.root.shapeDefinitionMgr.getShapeFromShortKey(key);
|
||||||
|
|
||||||
const element = makeDiv(this.element, null, ["shape"]);
|
const element = makeDiv(this.element, null, ["shape"]);
|
||||||
const canvas = definition.generateAsCanvas(120);
|
const canvas = definition.generateAsCanvas(120);
|
||||||
element.appendChild(canvas);
|
element.appendChild(canvas);
|
||||||
|
|
||||||
|
if (className) {
|
||||||
|
element.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
let detector = null;
|
let detector = null;
|
||||||
if (canUnpin) {
|
if (canUnpin) {
|
||||||
element.classList.add("unpinable");
|
element.classList.add("unpinable");
|
||||||
|
Loading…
Reference in New Issue
Block a user