Skip to content

Commit 1455a5a

Browse files
committed
Merge branch 'mc/1.13'
2 parents d34628d + 275076b commit 1455a5a

File tree

4 files changed

+90
-2
lines changed

4 files changed

+90
-2
lines changed

BlueMapCore/src/main/webroot/js/libs/modules/HudInfo.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import $ from 'jquery';
22
import {
33
Raycaster,
4-
Vector2
4+
Vector2,
5+
BoxBufferGeometry,
6+
Mesh,
7+
MeshBasicMaterial
58
} from 'three';
69
import {pathFromCoords} from "../utils";
710

@@ -11,6 +14,16 @@ export default class HudInfo {
1114
this.blueMap = blueMap;
1215
this.container = container;
1316

17+
let blockMarkerGeo = new BoxBufferGeometry( 1, 1, 1 );
18+
blockMarkerGeo.translate(0.5, 0.5, 0.5);
19+
this.blockMarker = new Mesh(blockMarkerGeo, new MeshBasicMaterial( {
20+
color: 0xffffff,
21+
opacity: 0.3,
22+
depthWrite: false,
23+
depthTest: false,
24+
transparent: true
25+
} ));
26+
1427
this.rayPosition = new Vector2();
1528
this.raycaster = new Raycaster();
1629

@@ -125,13 +138,21 @@ export default class HudInfo {
125138
this.element.removeClass("below");
126139
}
127140
this.element.fadeIn(200);
141+
142+
if (hiresData){
143+
this.blockMarker.position.set(block.x, block.y, block.z);
144+
this.blueMap.hiresScene.add(this.blockMarker);
145+
this.blueMap.updateFrame = true;
146+
}
128147
}
129148

130149
};
131150

132151
onHideInfo = event => {
133152
if (!this.element.is(':animated')) {
134153
this.element.fadeOut(200);
154+
this.blueMap.hiresScene.remove(this.blockMarker);
155+
this.blueMap.updateFrame = true;
135156
}
136157
};
137158

BlueMapCore/src/main/webroot/js/libs/ui/Menu.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import $ from 'jquery';
2626

2727
import Element from './Element.js';
28+
import Separator from "./Separator";
2829

2930
export default class Menu {
3031

@@ -47,6 +48,23 @@ export default class Menu {
4748
this.children.forEach(child => {
4849
this.content.append(child.createElement());
4950
});
51+
52+
$(`<div class="footer-separator"></div>`).appendTo(this.content);
53+
54+
$(`
55+
<div class="ui-element footer">
56+
<h1>BlueMap</h1>
57+
<p>
58+
Visit BlueMap on <a href="https://github.com/BlueMap-Minecraft">GitHub</a> and <a href="https://discord.gg/zmkyJa3">Discord</a>!
59+
</p>
60+
<h2>Controls</h2>
61+
<p>
62+
<kbd>leftclick and drag</kbd> or <kbd>arrow-keys</kbd> to navigate<br>
63+
<kbd>rightclick and drag</kbd> to rotate your view<br>
64+
<kbd>scroll</kbd> to zoom in and out
65+
</p>
66+
</div>
67+
`).appendTo(this.content);
5068
}
5169

5270
isOpen = () => {

BlueMapCore/src/main/webroot/js/libs/ui/UI.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class UI {
6969
let posZ = new Position(this.blueMap, 'z');
7070
let compass = new Compass(this.blueMap);
7171

72-
let mobSpawnOverlay = new ToggleButton("mob-spawnable overlay", blueMap.mobSpawnOverlay.value, button => {
72+
let mobSpawnOverlay = new ToggleButton("mob-spawn (experimental)", blueMap.mobSpawnOverlay.value, button => {
7373
this.blueMap.mobSpawnOverlay.value = button.isSelected();
7474
this.blueMap.updateFrame = true;
7575
});
@@ -119,6 +119,7 @@ export default class UI {
119119
this.menu.addElement(new Separator());
120120
this.menu.addElement(debugInfo);
121121
this.menu.update();
122+
122123
}
123124

124125
}

BlueMapCore/src/main/webroot/style/ui/menu.scss

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ $menu-width: 375px;
6969
right: 0;
7070
top: 3rem;
7171

72+
display: flex;
73+
flex-direction: column;
74+
7275
width: calc(375px - 1rem);
7376
height: calc(100% - 4rem);
7477

@@ -80,6 +83,11 @@ $menu-width: 375px;
8083
width: calc(100% - 1rem);
8184
}
8285

86+
> * {
87+
flex-grow: 0;
88+
flex-shrink: 0;
89+
}
90+
8391
> .separator {
8492
position: relative;
8593
left: -0.5rem;
@@ -88,6 +96,11 @@ $menu-width: 375px;
8896

8997
border-top: solid 1px $line_color;
9098
margin: 0.5rem 0;
99+
100+
&.greedy {
101+
flex-grow: 1;
102+
border-bottom: solid 1px $line_color;
103+
}
91104
}
92105

93106
> .label {
@@ -127,5 +140,40 @@ $menu-width: 375px;
127140
color: $hover_fg;
128141
}
129142
}
143+
144+
> .footer-separator{
145+
flex-grow: 1;
146+
}
147+
148+
> .footer {
149+
margin: 0.5rem -0.5rem -0.5rem -0.5rem;
150+
padding: 0 0.5rem 0.5rem 0.5rem;
151+
152+
border-top: solid 1px $line_color;
153+
154+
line-height: 1rem;
155+
font-size: 0.8rem;
156+
157+
white-space: normal;
158+
159+
h1 {
160+
margin: 1rem 0 0.5rem 0;
161+
font-size: 1rem;
162+
text-align: center;
163+
}
164+
165+
h2 {
166+
margin: 1rem 0 0 0;
167+
font-size: inherit;
168+
}
169+
170+
p {
171+
margin: 0 0 0.5rem 0;
172+
173+
&:last-child {
174+
margin-bottom: 0;
175+
}
176+
}
177+
}
130178
}
131179
}

0 commit comments

Comments
 (0)