Skip to content

Commit

Permalink
feat: exporting ship info for bases
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Mar 28, 2024
1 parent e17a984 commit 8d39f74
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
13 changes: 9 additions & 4 deletions darkstat/linker/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func (l *Linker) Link() *builder.Builder {
),
)

var infocard_per_good_nickname map[string]configs_export.Infocard = make(map[string]configs_export.Infocard)

for _, base := range data.Bases {
// fmt.Println("market_goods, len=", len(base.MarketGoods), " nickname=", base.Nickname, base.Name)
build.RegComps(
Expand All @@ -105,14 +107,17 @@ func (l *Linker) Link() *builder.Builder {
front.BaseMarketGoods(base.MarketGoods),
),
)

for _, good := range base.MarketGoods {
infocard_per_good_nickname[good.Nickname] = good.Infocard
}
}

goods := l.configs.GoodsSelEquip
for _, good := range goods {
for good_nickname, infocard := range infocard_per_good_nickname {
build.RegComps(
builder.NewComponent(
utils_types.FilePath(front.MarketGoodInfocardUrl(good.Nickname)),
front.Infocard(good.Infocard),
utils_types.FilePath(front.MarketGoodInfocardUrl(good_nickname)),
front.Infocard(infocard),
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.1

require (
github.com/a-h/templ v0.2.543
github.com/darklab8/fl-configs v0.15.0
github.com/darklab8/fl-configs v0.16.0
github.com/darklab8/go-typelog v0.6.0
github.com/darklab8/go-utils v0.12.0
github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
github.com/a-h/templ v0.2.543 h1:8YyLvyUtf0/IE2nIwZ62Z/m2o2NqwhnMynzOL78Lzbk=
github.com/a-h/templ v0.2.543/go.mod h1:jP908DQCwI08IrnTalhzSEH9WJqG/Q94+EODQcJGFUA=
github.com/darklab8/fl-configs v0.13.1 h1:C/8JD9eVGkxW5PGKwf5Sp7IvopJpbF+5L2v6yNJTHn0=
github.com/darklab8/fl-configs v0.13.1/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.13.2 h1:HIWrZI4z5PdEba3qkugzz1Ysl7UTJNmvsGTezjivXZw=
github.com/darklab8/fl-configs v0.13.2/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.14.0 h1:YtK83tiltJpbYd6X8QiLxSIjhFxgBjmXI+IrDSYph60=
github.com/darklab8/fl-configs v0.14.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.15.0 h1:l+G2vlcJG7nhlBx8cuZdQLuDydu4yT0pkUSsTbynPxA=
github.com/darklab8/fl-configs v0.15.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.16.0 h1:eFv++nj/xZt8oc4foRshkVbtR64Bk0XDKSVXH1AqHRg=
github.com/darklab8/fl-configs v0.16.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/go-typelog v0.6.0 h1:Ci8imc7ScXiy5e1qMgf46NyJjrqNLPoIE1gbVe7bxl4=
github.com/darklab8/go-typelog v0.6.0/go.mod h1:AwwOf3dkp/tpevHFNbkB+PbwlDrUUgO1CVFkEnj+q5w=
github.com/darklab8/go-utils v0.12.0 h1:LxsG3yVNf9W4xyV+tHPOaZB2ewItgM/1BzOXyKFvofs=
Expand Down

0 comments on commit 8d39f74

Please sign in to comment.