From 3ee0264c228471c862a5fb1f2c9690f6dd4f407c Mon Sep 17 00:00:00 2001 From: Robert Janetzko Date: Sat, 7 May 2022 18:46:37 +0000 Subject: [PATCH] world map tooltips --- backend/model/functions.go | 21 ++++----------------- backend/static/js/map.js | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/backend/model/functions.go b/backend/model/functions.go index 200608d..441191e 100644 --- a/backend/model/functions.go +++ b/backend/model/functions.go @@ -40,22 +40,14 @@ var AddMapLandmass = func(w *DfWorld, id int) template.HTML { c2 := strings.Split(x.Coord2, ",") x2, _ := strconv.Atoi(c2[0]) y2, _ := strconv.Atoi(c2[1]) - return template.HTML(fmt.Sprintf(``, x.Name_, x1, y1, x2, y2)) + return template.HTML(fmt.Sprintf(``, x.Id_, x1, y1, x2, y2)) } return "" } var AddMapRegion = func(w *DfWorld, id int) template.HTML { if x, ok := w.Regions[id]; ok { - r := "" - return template.HTML(r) + return template.HTML(fmt.Sprintf(``, x.Id_, coords, fillColor)) } return "" } @@ -110,7 +97,7 @@ var AddMapWorldConstruction = func(w *DfWorld, id int) template.HTML { color := util.If(x.Type_ == WorldConstructionType_Tunnel, "#000", "#fff") line := x.Line() if len(line) == 1 { - return template.HTML(fmt.Sprintf(``, x.Name_, line[0].X, line[0].Y, color)) + return template.HTML(fmt.Sprintf(``, x.Id_, line[0].X, line[0].Y, color)) } else { r := "