diff --git a/analyze/overwrites.json b/analyze/overwrites.json
index 7278bc1..e83ea45 100644
--- a/analyze/overwrites.json
+++ b/analyze/overwrites.json
@@ -87,6 +87,10 @@
}
],
"Entity": [
+ {
+ "Name": "Parent",
+ "Type": "int"
+ },
{
"Name": "Necromancer",
"Type": "bool"
diff --git a/backend/model/context.go b/backend/model/context.go
index d1071cc..594ca0b 100644
--- a/backend/model/context.go
+++ b/backend/model/context.go
@@ -94,10 +94,13 @@ func hfIcon(x *HistoricalFigure) string {
case x.Necromancer:
return ` `
case x.Werebeast:
- return ` `
+ return ` `
case x.Vampire:
return ` `
}
+ if len(x.SiteLink) > 0 && x.SiteLink[0].LinkType == SiteLinkLinkType_Lair {
+ return ` `
+ }
return ""
}
@@ -138,7 +141,23 @@ func (c *Context) artifact(id int) string {
func (c *Context) entity(id int) string {
if x, ok := c.World.Entities[id]; ok {
- return fmt.Sprintf(` %s `, x.Id(), x.Icon(), util.Title(x.Name()))
+ c := ""
+ switch x.Race {
+ case "dwarf":
+ c = ` style="color:#FFCC33"`
+ case "elf":
+ c = ` style="color:#99FF00"`
+ case "human":
+ c = ` style="color:#0000CC"`
+ case "kobold":
+ c = ` style="color:#333"`
+ case "goblin":
+ c = ` style="color:#CC0000"`
+ }
+ if x.Necromancer {
+ c = ` style="color:#A0A"`
+ }
+ return fmt.Sprintf(` %s `, x.Id(), x.Icon(), c, util.Title(x.Name()))
}
return "UNKNOWN ENTITY"
}
diff --git a/backend/model/model.go b/backend/model/model.go
index 04ec7c3..7e8402d 100644
--- a/backend/model/model.go
+++ b/backend/model/model.go
@@ -1992,13 +1992,15 @@ type Entity struct {
WorshipId []int `json:"worshipId" legend:"plus" related:""` // worship_id
Leaders []*EntityLeader `json:"leaders" legend:"add" related:""` // Leaders
Necromancer bool `json:"necromancer" legend:"add" related:""` // Necromancer
+ Parent int `json:"parent" legend:"add" related:""` // Parent
Sites []int `json:"sites" legend:"add" related:""` // Sites
Wars []*HistoricalEventCollection `json:"wars" legend:"add" related:""` // Wars
}
func NewEntity() *Entity {
return &Entity{
- Id_: -1,
+ Id_: -1,
+ Parent: -1,
}
}
func (x *Entity) Id() int { return x.Id_ }
@@ -2033,6 +2035,9 @@ func (x *Entity) MarshalJSON() ([]byte, error) {
d["worshipId"] = x.WorshipId
d["leaders"] = x.Leaders
d["necromancer"] = x.Necromancer
+ if x.Parent != -1 {
+ d["parent"] = x.Parent
+ }
d["sites"] = x.Sites
d["wars"] = x.Wars
return json.Marshal(d)
diff --git a/backend/model/process.go b/backend/model/process.go
index 17e5403..43b40fc 100644
--- a/backend/model/process.go
+++ b/backend/model/process.go
@@ -32,6 +32,12 @@ func (w *DfWorld) process() {
}
}
+ for _, l := range e.EntityLink {
+ if l.Type_ == EntityEntityLinkType_PARENT {
+ e.Parent = l.Target
+ }
+ }
+
idx := slices.Index(e.Child, e.Id_)
if idx != -1 {
e.Child = append(e.Child[:idx], e.Child[idx+1:]...)
diff --git a/backend/static/css/legends.css b/backend/static/css/legends.css
index 6868ec7..47068c8 100644
--- a/backend/static/css/legends.css
+++ b/backend/static/css/legends.css
@@ -86,6 +86,11 @@ td.object {
@media (prefers-color-scheme: dark) {
+ .bg-light {
+ --bs-bg-opacity: 1;
+ background-color: rgba(var(--bs-dark-rgb), var(--bs-bg-opacity)) !important;
+ }
+
a {
color: #337ab7;
}
diff --git a/backend/templates/artforms.html b/backend/templates/artforms.html
index 002087f..cfd601d 100644
--- a/backend/templates/artforms.html
+++ b/backend/templates/artforms.html
@@ -7,24 +7,25 @@
+ {{ $active := " active"}}
{{- range $t, $v := .DanceForms }}
- {{$t}} ({{
- len $v
- }})
- {{- end}}
+ {{$t}} ({{
+ len $v }})
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .MusicalForms }}
- {{$t}} ({{ len $v
- }})
- {{- end}}
+ {{$t}} ({{ len
+ $v }})
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .PoeticForms }}
- {{$t}} ({{ len $v
- }})
- {{- end}}
+ {{$t}} ({{ len
+ $v }})
+ {{ $active = ""}}{{- end}}
+ {{ $active := " active"}}
{{- range $t, $v := .DanceForms }}
-
+
Name
@@ -38,9 +39,9 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .MusicalForms }}
-
+
Name
@@ -54,9 +55,9 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .PoeticForms }}
-
+
Name
@@ -70,7 +71,7 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- end }}
\ No newline at end of file
diff --git a/backend/templates/entity.html b/backend/templates/entity.html
index 91c1f6d..1662822 100644
--- a/backend/templates/entity.html
+++ b/backend/templates/entity.html
@@ -9,6 +9,9 @@
{{- if .Profession }}
of {{ .Profession }}s
{{- end }}
+ {{- if ne .Parent -1 }}
+ of {{ entity .Parent }}
+ {{- end }}
{{- if and (eq .Type "religion") (gt (len .WorshipId) 0) }}
centered around the worship of {{ hfList .WorshipId }}
{{- end }}
@@ -24,26 +27,28 @@
+ {{ $active := " active"}}
{{- if gt (len .Leaders) 0 }}
- Sites
- {{- end}}
+ Leaders
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Sites) 0 }}
- Sites
- {{- end}}
+ Sites
+ {{ $active = ""}}{{- end}}
{{- if gt (len .HistfigId) 0 }}
- Members
- {{- end}}
+ Members
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Child) 0 }}
- Groups
- {{- end}}
+ Groups
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Wars) 0 }}
- Wars
- {{- end}}
+ Wars
+ {{ $active = ""}}{{- end}}
+ {{ $active := " active"}}
{{- if gt (len .Leaders) 0 }}
-
+
Date
@@ -64,9 +69,9 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Sites) 0 }}
-
+
Name
@@ -80,9 +85,9 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- if gt (len .HistfigId) 0 }}
-
+
Type
@@ -94,9 +99,9 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Child) 0 }}
-
+
Type
@@ -108,9 +113,9 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- if gt (len .Wars) 0 }}
-
+
Year
@@ -140,7 +145,7 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
Events
diff --git a/backend/templates/geography.html b/backend/templates/geography.html
index 1608f95..16f5b6d 100644
--- a/backend/templates/geography.html
+++ b/backend/templates/geography.html
@@ -7,28 +7,29 @@
+ {{ $active := " active"}}
{{- range $t, $v := .Regions }}
- {{$t}} ({{
- len $v
- }})
- {{- end}}
+ {{$t}} ({{
+ len $v }})
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .Landmasses }}
- {{$t}} ({{ len $v
- }})
- {{- end}}
+ {{$t}} ({{ len
+ $v }})
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .MountainPeaks }}
- {{$t}} ({{ len $v
- }})
- {{- end}}
+ {{$t}} ({{ len
+ $v }})
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .Rivers }}
- {{$t}} ({{ len $v
- }})
- {{- end}}
+ {{$t}} ({{ len
+ $v }})
+ {{ $active = ""}}{{- end}}
+ {{ $active := " active"}}
{{- range $t, $v := .Regions }}
-
+
Name
@@ -42,9 +43,9 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .Landmasses }}
-
+
Name
@@ -58,9 +59,9 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .MountainPeaks }}
-
+
Name
@@ -74,9 +75,9 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- range $t, $v := .Rivers }}
-
+
Name
@@ -90,7 +91,7 @@
{{- end}}{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- end }}
\ No newline at end of file
diff --git a/backend/templates/popoverEntity.html b/backend/templates/popoverEntity.html
index b12d6cf..9a4e04a 100644
--- a/backend/templates/popoverEntity.html
+++ b/backend/templates/popoverEntity.html
@@ -1,7 +1,10 @@
-{{ .Race }} {{ .Type }}
+{{ .Race }}{{ if .Necromancer}} necromancer{{end}} {{ .Type }}
{{- if .Profession }}
of {{ .Profession }}s
{{- end }}
+{{- if ne .Parent -1 }}
+of {{ entity .Parent }}
+{{- end }}
{{- if and (eq .Type "religion") (gt (len .WorshipId) 0) }}
centered around the worship of {{ hfList .WorshipId }}
{{- end }}
diff --git a/backend/templates/site.html b/backend/templates/site.html
index 98b138b..70f99be 100644
--- a/backend/templates/site.html
+++ b/backend/templates/site.html
@@ -8,17 +8,21 @@
+ {{ $active := " active"}}
{{- if gt (len .Structures) 0 }}
- Structures
- {{- end}}
+ Structures
+ {{ $active = ""}}{{- end}}
{{- if gt (len .SiteProperties) 0 }}
- Properties
- {{- end}}
+ Properties
+ {{ $active = ""}}{{- end}}
+ {{ $active := " active"}}
{{- if gt (len .Structures) 0 }}
-
+
Name
@@ -32,9 +36,9 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
{{- if gt (len .SiteProperties) 0 }}
-
+
Type
@@ -49,7 +53,7 @@
{{- end}}
- {{- end}}
+ {{ $active = ""}}{{- end}}
Events