sif: Make some user/ui preferences configurable

people wants to change them

Signed-off-by: Yuan Si <do4suki@gmail.com>
This commit is contained in:
2024-01-27 05:12:35 +08:00
parent a6fe2e7740
commit 09f0237560
3 changed files with 53 additions and 16 deletions
+26 -2
View File
@@ -9,8 +9,9 @@ import (
)
type AppConfigs struct {
AppName string `json:"app_name"`
Settings Settings `json:"settings"`
AppName string `json:"app_name"`
Settings Settings `json:"settings"`
UserPrefs UserPrefs `json:"user_prefs"`
}
type Settings struct {
@@ -18,6 +19,18 @@ type Settings struct {
AsCdnServer string `json:"as_cdn_server"`
}
type UserPrefs struct {
Name string `json:"name"` // 用户名
Level int `json:"level"` // 用户等级
ExpNumerator int `json:"exp_numerator"` // Exp 分子
ExpDenominator int `json:"exp_denominator"` // Exp 分母
GameCoin int `json:"game_coin"` // 游戏金币
SnsCoin int `json:"sns_coin"` // 游戏爱心
EnergyMax int `json:"energy_max"` // 体力上限
OverMaxEnergy int `json:"over_max_energy"` // 实际体力,为 0 时与 EnergyMax 一致
InviteCode string `json:"invite_code"` // 用户 ID
}
func DefaultConfigs() *AppConfigs {
return &AppConfigs{
AppName: "honoka-chan",
@@ -25,6 +38,17 @@ func DefaultConfigs() *AppConfigs {
SifCdnServer: "http://192.168.1.123/static",
AsCdnServer: "http://192.168.1.123/static",
},
UserPrefs: UserPrefs{
Name: "梦路 @bilibili",
Level: 1028,
ExpNumerator: 1089696,
ExpDenominator: 1207185,
GameCoin: 112124104,
SnsCoin: 0,
EnergyMax: 417,
OverMaxEnergy: 0,
InviteCode: "377385143",
},
}
}