编辑雨量计皮肤的 lua 文件“你需要夹克吗”在此代码的标题中出现错误
--[[ Given the current temperature, return the appropriate
string for the main string meter ]]
local function getMainString( temp )
local negation = (temp > Settings.Ss_Limit) and " don't" or ""
local summerwear = (temp < Settings.Ss_Limit) and (temp > Settings.Vest_Limit) and "shirt and shorts"
local innerwear = (temp < Settings.Vest_Limit) and (temp > Settings.Jacket_Limit) and "vest"
local southerwear = (temp < Settings.Jacket_Limit) and (temp > Settings.Coat_Limit) and "jacket"
local outerwear = (temp < Settings.Coat_Limit) and "coat"
return string.format("You%s need a %s", negation, (summerwear or innerwear or southerwear or outerwear))
end
它应该根据温度给出正确的衣服。我尝试了不同位置的温度变化,唯一一次我得到错误是当温度超过 Ss_limit 时。我没有太多的编码经验,所以提前谢谢你