Skip to content

Commit

Permalink
feat: applying useful filters
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Apr 7, 2024
1 parent e87a501 commit 45a844b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 11 additions & 9 deletions darkstat/linker/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ func (l *Linker) Link() *builder.Builder {
build := builder.NewBuilder()

useful_factions := configs_export.FilterToUsefulFactions(data.Factions)
useful_ships := configs_export.FilterToUsefulShips(data.Ships)
useful_guns := configs_export.FilterToUsefulGun(data.Guns)

build.RegComps(
builder.NewComponent(
Expand Down Expand Up @@ -233,71 +235,71 @@ func (l *Linker) Link() *builder.Builder {
),
builder.NewComponent(
urls.Commodities,
front.CommoditiesT(data.Commodities, front.ShowEmpty(false)),
front.CommoditiesT(configs_export.FilterToUsefulCommodities(data.Commodities), front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Commodities),
front.CommoditiesT(data.Commodities, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Guns,
front.GunsT(data.Guns, front.GunsShowBases, front.ShowEmpty(false)),
front.GunsT(useful_guns, front.GunsShowBases, front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Guns),
front.GunsT(data.Guns, front.GunsShowBases, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.GunModifiers,
front.GunsT(data.Guns, front.GunsShowDamageBonuses, front.ShowEmpty(false)),
front.GunsT(useful_guns, front.GunsShowDamageBonuses, front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.GunModifiers),
front.GunsT(data.Guns, front.GunsShowDamageBonuses, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Missiles,
front.GunsT(data.Missiles, front.GunsMissiles, front.ShowEmpty(false)),
front.GunsT(configs_export.FilterToUsefulGun(data.Missiles), front.GunsMissiles, front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Missiles),
front.GunsT(data.Missiles, front.GunsMissiles, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Mines,
front.MinesT(data.Mines, front.ShowEmpty(false)),
front.MinesT(configs_export.FilterToUsefulMines(data.Mines), front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Mines),
front.MinesT(data.Mines, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Shields,
front.ShieldT(data.Shields, front.ShowEmpty(false)),
front.ShieldT(configs_export.FilterToUsefulShields(data.Shields), front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Shields),
front.ShieldT(data.Shields, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Thrusters,
front.ThrusterT(data.Thrusters, front.ShowEmpty(false)),
front.ThrusterT(configs_export.FilterToUsefulThrusters(data.Thrusters), front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Thrusters),
front.ThrusterT(data.Thrusters, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.Ships,
front.ShipsT(data.Ships, front.ShipShowBases, front.ShowEmpty(false)),
front.ShipsT(useful_ships, front.ShipShowBases, front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.Ships),
front.ShipsT(data.Ships, front.ShipShowBases, front.ShowEmpty(true)),
),
builder.NewComponent(
urls.ShipDetails,
front.ShipsT(data.Ships, front.ShipShowDetails, front.ShowEmpty(false)),
front.ShipsT(useful_ships, front.ShipShowDetails, front.ShowEmpty(false)),
),
builder.NewComponent(
front.AllItemsUrl(urls.ShipDetails),
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.33.0
github.com/darklab8/fl-configs v0.34.0
github.com/darklab8/go-typelog v0.6.0
github.com/darklab8/go-utils v0.13.0
github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ github.com/darklab8/fl-configs v0.32.0 h1:HsmWxf+CQvmOVmesPXqIMze/UXmh01jXZwcxXm
github.com/darklab8/fl-configs v0.32.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.33.0 h1:gcxBl11SbtUsuLLeuyno9DyRJavXT5XPBQLcloykCsM=
github.com/darklab8/fl-configs v0.33.0/go.mod h1:8zaCaFL21TvawP65KB9NOJ+nEpaMDQYsnoOi77RiSVY=
github.com/darklab8/fl-configs v0.34.0 h1:O5Q6kUlSBaRxBkQdnyBvb5UZF6jI7ToZkY8PmTUDdv4=
github.com/darklab8/fl-configs v0.34.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 45a844b

Please sign in to comment.