From fcd321448fd23e9dc0f42eadfeddb7d2d1c8c331 Mon Sep 17 00:00:00 2001 From: 1F616EMO~nya Date: Fri, 7 Jun 2024 01:21:00 +0800 Subject: [PATCH] Support ATMs and WTT from Unified Money (#372) * Support ATMs and WTT from Unified Money * Return L.icon(...) --- mapobject/atm.go | 21 +++++++++------------ mapobject/setup.go | 8 ++++++++ public/js/map/overlays/ATMOverlay.js | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/mapobject/atm.go b/mapobject/atm.go index bf0af10..9f5e7ae 100644 --- a/mapobject/atm.go +++ b/mapobject/atm.go @@ -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 diff --git a/mapobject/setup.go b/mapobject/setup.go index 525328d..d502659 100644 --- a/mapobject/setup.go +++ b/mapobject/setup.go @@ -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 diff --git a/public/js/map/overlays/ATMOverlay.js b/public/js/map/overlays/ATMOverlay.js index 8c63c73..b7f3fa7 100644 --- a/public/js/map/overlays/ATMOverlay.js +++ b/public/js/map/overlays/ATMOverlay.js @@ -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],