mapserver/mapobject/um_area_forsale.go
Buckaroo Banzai dc5a401d8b
Fork 20240605 um area forsale (#379)
* Add For Sale Sings for Unified Money

* Change popup and icon size

* Revert icon size

* Add For Sale Sign into searches

* Fix syntax

* Minor display change

* Skip unconfigured for sale signs

---------

Co-authored-by: 1F616EMO <root@1f616emo.xyz>
2024-06-06 19:40:36 +02:00

27 lines
635 B
Go

package mapobject
import (
"mapserver/mapobjectdb"
"mapserver/types"
"github.com/minetest-go/mapparser"
)
type UnifiefMoneyAreaForSale struct{}
func (this *UnifiefMoneyAreaForSale) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, block *mapparser.MapBlock) *mapobjectdb.MapObject {
md := block.Metadata.GetMetadata(x, y, z)
if _, ok := md["id"]; !ok {
return nil
}
o := mapobjectdb.NewMapObject(mbpos, x, y, z, "um_area_forsale")
o.Attributes["owner"] = md["owner"]
o.Attributes["id"] = md["id"] // ", " seperated
o.Attributes["price"] = md["price"]
o.Attributes["description"] = md["description"]
return o
}