Problem statement
The time.* and weather.* command families both report engine state to the console, but only
time.status exists. There is no weather.status to print the current weather state and intensity in
isolation. Users who want to query weather without also dumping the full time/clock state have to
issue time.status (which works, but reads as if weather state lives under time.*) or guess. The
full status of weather is already in scope of time.status (ConsoleCommands.cpp:1583), but a
dedicated weather.status would mirror the existing time.status pattern and round out the weather.*
family.
Suggested implementation
Two changes:
- Add
Cmd_WeatherStatus near the other Cmd_Weather* implementations (around
ConsoleCommands.cpp:1325-1390).
- Register
weather.status next to the other weather.* registrations at
ConsoleCommands.cpp:3585-3607.
bool Cmd_WeatherStatus(std::span<const std::string_view> args, CommandContext& ctx)
{
if (ctx.time == nullptr)
{
ctx.out.PrintError("weather.status: time manager unavailable");
return false;
}
if (!args.empty())
{
ctx.out.PrintError("weather.status: usage 'weather.status'");
return false;
}
char line[128];
std::snprintf(line,
sizeof(line),
"weather.status: %s intensity=%.2f",
std::string(EnumTraits<WeatherState>::Name(ctx.time->GetWeather())).c_str(),
static_cast<double>(ctx.time->GetWeatherIntensity()));
ctx.out.Print(line);
return true;
}
Register near the existing weather.* block:
m_Registry.Register("weather.status",
"print current weather state and intensity",
[makeContext](auto args, Console&)
{
CommandContext ctx = makeContext();
(void)Cmd_WeatherStatus(args, ctx);
});
Proposed solution
Add a weather.status console command that prints one line of the form:
weather.status: <StateName> intensity=<0.00-1.00>
Implementation mirrors Cmd_TimeStatus/time.status but reads only ctx.time->GetWeather() and
ctx.time->GetWeatherIntensity(). Register it next to the other weather.* commands at
ConsoleCommands.cpp:3585-3607.
Alternatives considered
Not applicable - this approach is simple
Scope
Not applicable - the scope is clear
Pre-submission checklist
Problem statement
The
time.*andweather.*command families both report engine state to the console, but onlytime.statusexists. There is noweather.statusto print the current weather state and intensity inisolation. Users who want to query weather without also dumping the full time/clock state have to
issue
time.status(which works, but reads as if weather state lives undertime.*) or guess. Thefull status of weather is already in scope of
time.status(ConsoleCommands.cpp:1583), but adedicated
weather.statuswould mirror the existingtime.statuspattern and round out theweather.*family.
Suggested implementation
Two changes:
Cmd_WeatherStatusnear the otherCmd_Weather*implementations (aroundConsoleCommands.cpp:1325-1390).weather.statusnext to the otherweather.*registrations atConsoleCommands.cpp:3585-3607.Register near the existing
weather.*block:Proposed solution
Add a
weather.statusconsole command that prints one line of the form:weather.status: <StateName> intensity=<0.00-1.00>Implementation mirrors
Cmd_TimeStatus/time.statusbut reads onlyctx.time->GetWeather()andctx.time->GetWeatherIntensity(). Register it next to the otherweather.*commands atConsoleCommands.cpp:3585-3607.Alternatives considered
Not applicable - this approach is simple
Scope
Not applicable - the scope is clear
Pre-submission checklist