1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-400 Move name and configKey values from widget to settings

This commit is contained in:
Chris Cummer
2019-04-17 17:16:26 -07:00
parent d174bd1497
commit b50c762dab
93 changed files with 351 additions and 237 deletions

View File

@@ -5,6 +5,8 @@ import (
"github.com/wtfutil/wtf/cfg"
)
const configKey = "toplist"
type colors struct {
from struct {
name string
@@ -34,14 +36,14 @@ type Settings struct {
top map[string]interface{}
}
func NewSettingsFromYAML(ymlConfig *config.Config) *Settings {
localConfig, _ := ymlConfig.Get("wtf.mods.cryptolive")
func NewSettingsFromYAML(name string, ymlConfig *config.Config) *Settings {
localConfig, _ := ymlConfig.Get("wtf.mods." + configKey)
currencies, _ := localConfig.Map("currencies")
top, _ := localConfig.Map("top")
settings := Settings{
common: cfg.NewCommonSettingsFromYAML(ymlConfig),
common: cfg.NewCommonSettingsFromYAML(name, configKey, ymlConfig),
currencies: currencies,
top: top,
}