split colors into multiple files
This commit is contained in:
parent
7e6a408e58
commit
b0e4841380
@ -61,7 +61,7 @@ type MapObjectConfig struct {
|
|||||||
Fancyvend bool `json:"fancyvend"`
|
Fancyvend bool `json:"fancyvend"`
|
||||||
ATM bool `json:"atm"`
|
ATM bool `json:"atm"`
|
||||||
Train bool `json:"train"`
|
Train bool `json:"train"`
|
||||||
TrainSignal bool `json:"trainsignal"`
|
TrainSignal bool `json:"trainsignal"`
|
||||||
Minecart bool `json:"minecart"`
|
Minecart bool `json:"minecart"`
|
||||||
Locator bool `json:"locator"`
|
Locator bool `json:"locator"`
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ func ParseConfig(filename string) (*Config, error) {
|
|||||||
Fancyvend: true,
|
Fancyvend: true,
|
||||||
ATM: true,
|
ATM: true,
|
||||||
Train: true,
|
Train: true,
|
||||||
TrainSignal: true,
|
TrainSignal: true,
|
||||||
Minecart: false,
|
Minecart: false,
|
||||||
Locator: false,
|
Locator: false,
|
||||||
}
|
}
|
||||||
|
19
app/setup.go
19
app/setup.go
@ -79,12 +79,19 @@ func Setup(p params.ParamsType, cfg *Config) *App {
|
|||||||
//color mapping
|
//color mapping
|
||||||
a.Colormapping = colormapping.NewColorMapping()
|
a.Colormapping = colormapping.NewColorMapping()
|
||||||
|
|
||||||
//load default colors
|
colorfiles := []string{
|
||||||
count, err := a.Colormapping.LoadVFSColors(false, "/colors.txt")
|
"/colors/default.txt",
|
||||||
if err != nil {
|
"/colors/advtrains.txt",
|
||||||
panic(err)
|
"/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
|
//load provided colors, if available
|
||||||
info, err := os.Stat("colors.txt")
|
info, err := os.Stat("colors.txt")
|
||||||
@ -96,7 +103,7 @@ func Setup(p params.ParamsType, cfg *Config) *App {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
count, err = a.Colormapping.LoadBytes(data)
|
count, err := a.Colormapping.LoadBytes(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ func (m *ColorMapping) LoadVFSColors(useLocal bool, filename string) (int, error
|
|||||||
|
|
||||||
log.WithFields(logrus.Fields{"size": len(buffer),
|
log.WithFields(logrus.Fields{"size": len(buffer),
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
"useLocal": useLocal}).Info("Loading default colors")
|
"useLocal": useLocal}).Info("Loading colors")
|
||||||
|
|
||||||
return m.LoadBytes(buffer)
|
return m.LoadBytes(buffer)
|
||||||
}
|
}
|
||||||
|
16
static/colors/advtrains.txt
Normal file
16
static/colors/advtrains.txt
Normal 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
1
static/colors/custom.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
planetoidgen:sun 255 100 0
|
@ -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
|
# other
|
||||||
building_blocks:slope_smoothglass_half_raised 160 160 160
|
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_middle 176 199 137
|
||||||
youngtrees:youngtree_top 190 211 156
|
youngtrees:youngtree_top 190 211 156
|
||||||
|
|
||||||
planetoidgen:sun 255 100 0
|
|
44
static/colors/scifi_nodes.txt
Normal file
44
static/colors/scifi_nodes.txt
Normal 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
|
Loading…
Reference in New Issue
Block a user