lua controller and digiterms overlay
This commit is contained in:
parent
631cdc0b10
commit
e8c35a4089
@ -30,3 +30,7 @@
|
||||
* jeija_luacontroller_top.png
|
||||
** CC-BY-SA-3.0
|
||||
** Source [mesecons](https://github.com/minetest-mods/mesecons)
|
||||
|
||||
* digiterms_beige_front.png
|
||||
** License: CC BY-SA 3.0
|
||||
** Source [digiterms](https://github.com/Pyrollo/digiterms)
|
||||
|
18
server/mapobject/digiterms.go
Normal file
18
server/mapobject/digiterms.go
Normal file
@ -0,0 +1,18 @@
|
||||
package mapobject
|
||||
|
||||
import (
|
||||
"mapserver/mapblockparser"
|
||||
"mapserver/mapobjectdb"
|
||||
)
|
||||
|
||||
type DigitermsBlock struct{}
|
||||
|
||||
func (this *DigitermsBlock) onMapObject(x, y, z int, block *mapblockparser.MapBlock) *mapobjectdb.MapObject {
|
||||
md := block.Metadata.GetMetadata(x, y, z)
|
||||
|
||||
o := mapobjectdb.NewMapObject(block.Pos, x, y, z, "digiterm")
|
||||
o.Attributes["display_text"] = md["display_text"]
|
||||
o.Attributes["channel"] = md["channel"]
|
||||
|
||||
return o
|
||||
}
|
@ -122,6 +122,17 @@ func Setup(ctx *app.App) {
|
||||
l.AddMapObject("mesecons_luacontroller:luacontroller0011", luac)
|
||||
l.AddMapObject("mesecons_luacontroller:luacontroller_burnt", luac)
|
||||
|
||||
//digiterms
|
||||
digiterms := &DigitermsBlock{}
|
||||
l.AddMapObject("'digiterms:lcd_monitor", digiterms)
|
||||
l.AddMapObject("'digiterms:cathodic_beige_monitor", digiterms)
|
||||
l.AddMapObject("'digiterms:cathodic_white_monitor", digiterms)
|
||||
l.AddMapObject("'digiterms:cathodic_black_monitor", digiterms)
|
||||
l.AddMapObject("'digiterms:scifi_glassscreen", digiterms)
|
||||
l.AddMapObject("'digiterms:scifi_widescreen", digiterms)
|
||||
l.AddMapObject("'digiterms:scifi_tallscreen", digiterms)
|
||||
l.AddMapObject("'digiterms:scifi_keysmonitor", digiterms)
|
||||
|
||||
//missions
|
||||
l.AddMapObject("missions:mission", &MissionBlock{})
|
||||
|
||||
|
@ -38,6 +38,8 @@
|
||||
<script src="js/overlays/ProtectorOverlay.js"></script>
|
||||
<script src="js/overlays/BonesOverlay.js"></script>
|
||||
<script src="js/overlays/LcdOverlay.js"></script>
|
||||
<script src="js/overlays/DigitermOverlay.js"></script>
|
||||
<script src="js/overlays/LuacontrollerOverlay.js"></script>
|
||||
|
||||
<!-- bootstrap -->
|
||||
<script src="js/main.js"></script>
|
||||
|
@ -34,6 +34,8 @@ api.getConfig().then(function(cfg){
|
||||
overlays["Travelnet"] = new TravelnetOverlay(wsChannel, layerMgr);
|
||||
overlays["Bones"] = new BonesOverlay(wsChannel, layerMgr);
|
||||
overlays["Digilines LCD"] = new LcdOverlay(wsChannel, layerMgr);
|
||||
overlays["Digiterms"] = new DigitermOverlay(wsChannel, layerMgr);
|
||||
overlays["Lua Controller"] = new LuacontrollerOverlay(wsChannel, layerMgr);
|
||||
//overlays["Protector"] = new ProtectorOverlay(wsChannel, layerMgr);
|
||||
|
||||
//Default enabled overlays
|
||||
|
19
server/static/js/overlays/DigitermOverlay.js
Normal file
19
server/static/js/overlays/DigitermOverlay.js
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var DigitermIcon = L.icon({
|
||||
iconUrl: 'pics/digiterms_beige_front.png',
|
||||
|
||||
iconSize: [16, 16],
|
||||
iconAnchor: [8, 8],
|
||||
popupAnchor: [0, -16]
|
||||
});
|
||||
|
||||
var DigitermOverlay = AbstractIconOverlay.extend({
|
||||
initialize: function(wsChannel, layerMgr) {
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "digiterm", DigitermIcon);
|
||||
},
|
||||
|
||||
createPopup: function(lcd){
|
||||
return "<pre>" + lcd.attributes.display_text + "</pre>";
|
||||
}
|
||||
});
|
@ -13,7 +13,7 @@ var LcdOverlay = AbstractIconOverlay.extend({
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "digilinelcd", LcdIcon);
|
||||
},
|
||||
|
||||
createPopup: function(bones){
|
||||
return "<pre>" + bones.attributes.text + "</pre>";
|
||||
createPopup: function(lcd){
|
||||
return "<pre>" + lcd.attributes.text + "</pre>";
|
||||
}
|
||||
});
|
||||
|
19
server/static/js/overlays/LuacontrollerOverlay.js
Normal file
19
server/static/js/overlays/LuacontrollerOverlay.js
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var LuacontrollerIcon = L.icon({
|
||||
iconUrl: 'pics/jeija_luacontroller_top.png',
|
||||
|
||||
iconSize: [16, 16], //TODO: 512px :O ...
|
||||
iconAnchor: [8, 8],
|
||||
popupAnchor: [0, -16]
|
||||
});
|
||||
|
||||
var LuacontrollerOverlay = AbstractIconOverlay.extend({
|
||||
initialize: function(wsChannel, layerMgr) {
|
||||
AbstractIconOverlay.prototype.initialize.call(this, wsChannel, layerMgr, "luacontroller", LuacontrollerIcon);
|
||||
},
|
||||
|
||||
createPopup: function(lcd){
|
||||
return "<pre>" + lcd.attributes.code + "</pre>";
|
||||
}
|
||||
});
|
BIN
server/static/pics/digiterms_beige_front.png
Normal file
BIN
server/static/pics/digiterms_beige_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 571 B |
Loading…
Reference in New Issue
Block a user