Support ATMs and WTT from Unified Money (#372)

* Support ATMs and WTT from Unified Money

* Return L.icon(...)
This commit is contained in:
1F616EMO~nya 2024-06-07 01:21:00 +08:00 committed by GitHub
parent e667ca580a
commit fcd321448f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 13 deletions

View File

@ -14,18 +14,15 @@ func (this *ATM) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, block *ma
o := mapobjectdb.NewMapObject(mbpos, x, y, z, "atm")
if nodename == "atm:wtt" {
o.Attributes["type"] = "wiretransfer"
} else if nodename == "atm:atm2" {
o.Attributes["type"] = "atm2"
} else if nodename == "atm:atm3" {
o.Attributes["type"] = "atm3"
} else {
o.Attributes["type"] = "atm"
switch nodename {
case "atm:wtt", "um_wtt:wtt":
o.Attributes["type"] = "wiretransfer"
case "atm:atm2", "um_atm:atm_2":
o.Attributes["type"] = "atm2"
case "atm:atm3", "um_atm:atm_3":
o.Attributes["type"] = "atm3"
default:
o.Attributes["type"] = "atm"
}
return o

View File

@ -164,10 +164,18 @@ func Setup(ctx *app.App) {
if ctx.Config.MapObjects.ATM {
atm := &ATM{}
// ATMs and WTT of gpcf's mod
l.AddMapObject("atm:atm", atm)
l.AddMapObject("atm:atm2", atm)
l.AddMapObject("atm:atm3", atm)
l.AddMapObject("atm:wtt", atm)
// ATMs and WTT of Unified Money
l.AddMapObject("um_atm:atm_1", atm)
l.AddMapObject("um_atm:atm_2", atm)
l.AddMapObject("um_atm:atm_3", atm)
l.AddMapObject("um_wtt:wtt", atm)
}
//locator

View File

@ -19,7 +19,7 @@ export default AbstractIconOverlay.extend({
else if (obj.attributes.type == "atm3")
img = "pics/atm3_front.png";
L.icon({
return L.icon({
iconUrl: img,
iconSize: [16, 16],
iconAnchor: [8, 8],