diff --git a/app/config.go b/app/config.go index 72aa274..0e6da94 100644 --- a/app/config.go +++ b/app/config.go @@ -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, } diff --git a/app/setup.go b/app/setup.go index edf8e9f..376adf4 100644 --- a/app/setup.go +++ b/app/setup.go @@ -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) } diff --git a/colormapping/colormapping.go b/colormapping/colormapping.go index b31158c..ce52ebe 100644 --- a/colormapping/colormapping.go +++ b/colormapping/colormapping.go @@ -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) } diff --git a/static/colors/advtrains.txt b/static/colors/advtrains.txt new file mode 100644 index 0000000..6a3c573 --- /dev/null +++ b/static/colors/advtrains.txt @@ -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 \ No newline at end of file diff --git a/static/colors/custom.txt b/static/colors/custom.txt new file mode 100644 index 0000000..faa4c22 --- /dev/null +++ b/static/colors/custom.txt @@ -0,0 +1 @@ +planetoidgen:sun 255 100 0 \ No newline at end of file diff --git a/static/colors.txt b/static/colors/default.txt similarity index 99% rename from static/colors.txt rename to static/colors/default.txt index 4e277c3..afe3921 100644 --- a/static/colors.txt +++ b/static/colors/default.txt @@ -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 + diff --git a/static/colors/scifi_nodes.txt b/static/colors/scifi_nodes.txt new file mode 100644 index 0000000..032bd15 --- /dev/null +++ b/static/colors/scifi_nodes.txt @@ -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