1
0
forked from MTSR/mapserver

split colors into multiple files

This commit is contained in:
NatureFreshMilk 2019-07-30 13:44:12 +02:00
parent 7e6a408e58
commit b0e4841380
7 changed files with 78 additions and 69 deletions

View File

@ -61,7 +61,7 @@ type MapObjectConfig struct {
Fancyvend bool `json:"fancyvend"`
ATM bool `json:"atm"`
Train bool `json:"train"`
TrainSignal bool `json:"trainsignal"`
TrainSignal bool `json:"trainsignal"`
Minecart bool `json:"minecart"`
Locator bool `json:"locator"`
}
@ -150,7 +150,7 @@ func ParseConfig(filename string) (*Config, error) {
Fancyvend: true,
ATM: true,
Train: true,
TrainSignal: true,
TrainSignal: true,
Minecart: false,
Locator: false,
}

View File

@ -79,12 +79,19 @@ func Setup(p params.ParamsType, cfg *Config) *App {
//color mapping
a.Colormapping = colormapping.NewColorMapping()
//load default colors
count, err := a.Colormapping.LoadVFSColors(false, "/colors.txt")
if err != nil {
panic(err)
colorfiles := []string{
"/colors/default.txt",
"/colors/advtrains.txt",
"/colors/scifi_nodes.txt",
"/colors/custom.txt",
}
for _, colorfile := range colorfiles {
_, err := a.Colormapping.LoadVFSColors(false, colorfile)
if err != nil {
panic(err)
}
}
logrus.WithFields(logrus.Fields{"count": count}).Info("Loaded default colors")
//load provided colors, if available
info, err := os.Stat("colors.txt")
@ -96,7 +103,7 @@ func Setup(p params.ParamsType, cfg *Config) *App {
panic(err)
}
count, err = a.Colormapping.LoadBytes(data)
count, err := a.Colormapping.LoadBytes(data)
if err != nil {
panic(err)
}

View File

@ -97,7 +97,7 @@ func (m *ColorMapping) LoadVFSColors(useLocal bool, filename string) (int, error
log.WithFields(logrus.Fields{"size": len(buffer),
"filename": filename,
"useLocal": useLocal}).Info("Loading default colors")
"useLocal": useLocal}).Info("Loading colors")
return m.LoadBytes(buffer)
}

View File

@ -0,0 +1,16 @@
# advtrains
advtrains:dtrack_cr 147 94 25
advtrains:dtrack_st_60 147 94 25
advtrains:dtrack_cr_45 147 94 25
advtrains:dtrack_cr_60 147 94 25
advtrains:dtrack_st_30 147 94 25
advtrains:dtrack_cr_30 147 94 25
advtrains:dtrack_st_45 147 94 25
advtrains:dtrack_st 147 94 25
advtrains:dtrack_vst1 147 94 25
advtrains:dtrack_vst2 147 94 25
advtrains:dtrack_bumper_st 147 94 25
advtrains:dtrack_atc_st 147 94 25
advtrains:platform_low_stonebrick 187 120 25
advtrains:platform_high_stonebrick 187 120 25

1
static/colors/custom.txt Normal file
View File

@ -0,0 +1 @@
planetoidgen:sun 255 100 0

View File

@ -1,63 +1,4 @@
# advtrains
advtrains:dtrack_cr 147 94 25
advtrains:dtrack_st_60 147 94 25
advtrains:dtrack_cr_45 147 94 25
advtrains:dtrack_cr_60 147 94 25
advtrains:dtrack_st_30 147 94 25
advtrains:dtrack_cr_30 147 94 25
advtrains:dtrack_st_45 147 94 25
advtrains:dtrack_st 147 94 25
advtrains:dtrack_vst1 147 94 25
advtrains:dtrack_vst2 147 94 25
advtrains:dtrack_bumper_st 147 94 25
advtrains:dtrack_atc_st 147 94 25
advtrains:platform_low_stonebrick 187 120 25
advtrains:platform_high_stonebrick 187 120 25
# scifi nodes
scifi_nodes:slope_white 240 240 240
scifi_nodes:slope_vent 120 120 120
scifi_nodes:white2 240 240 240
scifi_nodes:white 240 240 240
scifi_nodes:slope_glight 30 250 30
scifi_nodes:black_mesh 20 20 20
scifi_nodes:blacktile 20 20 20
scifi_nodes:blink 200 30 30
scifi_nodes:ladder 40 40 40
scifi_nodes:black 20 20 20
scifi_nodes:slope_rlight 200 30 30
scifi_nodes:glass 30 30 30
scifi_nodes:blacktile2 20 20 20
scifi_nodes:light 200 200 200
scifi_nodes:green_light 30 200 30
scifi_nodes:slope_stripes 30 30 30
scifi_nodes:doomwall3 50 50 50
scifi_nodes:slope_blight 30 30 200
scifi_nodes:whitetile 210 210 210
scifi_nodes:windowstraight2 30 30 30
scifi_nodes:lighttop 210 210 210
scifi_nodes:windowstraight2 40 40 40
#scifi_nodes:mesh2
scifi_nodes:blue 30 30 200
scifi_nodes:greenmetal 30 180 30
scifi_nodes:greenlights2 30 200 30
scifi_nodes:white_base 200 200 200
scifi_nodes:dent 20 20 20
scifi_nodes:blackvent 20 20 20
scifi_nodes:black_screen 20 20 20
scifi_nodes:slope_black 20 20 20
scifi_nodes:greenbar 30 200 30
scifi_nodes:black_lights 20 20 20
scifi_nodes:slope_white2 200 200 200
scifi_nodes:octbl 30 30 200
scifi_nodes:lightbar 200 200 200
scifi_nodes:green 20 210 20
scifi_nodes:whiteoct 210 210 210
scifi_nodes:tile 20 20 20
scifi_nodes:lightbars 210 210 210
scifi_nodes:octgrn 30 210 30
# other
building_blocks:slope_smoothglass_half_raised 160 160 160
@ -16165,4 +16106,4 @@ youngtrees:youngtree_bottom 51 38 33
youngtrees:youngtree_middle 176 199 137
youngtrees:youngtree_top 190 211 156
planetoidgen:sun 255 100 0

View File

@ -0,0 +1,44 @@
# scifi nodes
scifi_nodes:slope_white 240 240 240
scifi_nodes:slope_vent 120 120 120
scifi_nodes:white2 240 240 240
scifi_nodes:white 240 240 240
scifi_nodes:slope_glight 30 250 30
scifi_nodes:black_mesh 20 20 20
scifi_nodes:blacktile 20 20 20
scifi_nodes:blink 200 30 30
scifi_nodes:ladder 40 40 40
scifi_nodes:black 20 20 20
scifi_nodes:slope_rlight 200 30 30
scifi_nodes:glass 30 30 30
scifi_nodes:blacktile2 20 20 20
scifi_nodes:light 200 200 200
scifi_nodes:green_light 30 200 30
scifi_nodes:slope_stripes 30 30 30
scifi_nodes:doomwall3 50 50 50
scifi_nodes:slope_blight 30 30 200
scifi_nodes:whitetile 210 210 210
scifi_nodes:windowstraight2 30 30 30
scifi_nodes:lighttop 210 210 210
scifi_nodes:windowstraight2 40 40 40
#scifi_nodes:mesh2
scifi_nodes:blue 30 30 200
scifi_nodes:greenmetal 30 180 30
scifi_nodes:greenlights2 30 200 30
scifi_nodes:white_base 200 200 200
scifi_nodes:dent 20 20 20
scifi_nodes:blackvent 20 20 20
scifi_nodes:black_screen 20 20 20
scifi_nodes:slope_black 20 20 20
scifi_nodes:greenbar 30 200 30
scifi_nodes:black_lights 20 20 20
scifi_nodes:slope_white2 200 200 200
scifi_nodes:octbl 30 30 200
scifi_nodes:lightbar 200 200 200
scifi_nodes:green 20 210 20
scifi_nodes:whiteoct 210 210 210
scifi_nodes:tile 20 20 20
scifi_nodes:lightbars 210 210 210
scifi_nodes:octgrn 30 210 30