Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package/SKSE/Plugins/CommunityShaders/Translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@
"feature.cs_editor.thunder_freq_info_7": "Range: 0-255 (unsigned 8-bit integer)",
"feature.cs_editor.thunder_freq_info_8": "Note: Creation Kit interprets this value non-linearly",
"feature.cs_editor.thunder_frequency": "Thunder Frequency: %u",
"feature.cs_editor.time_controls": "Time Controls",
"feature.cs_editor.toggle_with": "Toggle with ",
"feature.cs_editor.tooltip_editor_id": "Editor ID: %s",
"feature.cs_editor.tooltip_editor_id_2": "Editor ID: %s",
Expand All @@ -534,10 +533,9 @@
"feature.cs_editor.using_default_settings": "Using Default Settings",
"feature.cs_editor.weather": "Weather",
"feature.cs_editor.weather_controls": "Weather Controls",
"feature.cs_editor.weather_details": "Weather Details",
"feature.cs_editor.weather_information": "Weather Information",
"feature.cs_editor.weather_percentage": "Weather Percentage: %.1f%%",
"feature.cs_editor.weather_status": "Weather Status",
"feature.cs_editor.weather_picker": "Weather Picker",
"feature.cs_editor.weather_wind_speed": "Weather Wind Speed: %.2f (raw %d)",
"feature.cs_editor.wind_direction": "Wind Direction: %.1f° (raw %d)",
"feature.cs_editor.wind_direction_range": "Wind Direction Range: %.1f° (raw %d)",
Expand Down Expand Up @@ -1491,6 +1489,7 @@
"feature.wetness_effects.climate_preset_nordic_desc": "Balanced Nordic climate (moderate rain)",
"feature.wetness_effects.climate_preset_unknown": "Unknown",
"feature.wetness_effects.climate_presets": "Climate Presets",
"feature.wetness_effects.current_climate_preset": "Current Climate Preset",
"feature.wetness_effects.custom_preset_tooltip_0": "Custom settings - you have modified the preset values.",
"feature.wetness_effects.custom_preset_tooltip_1": "Select a preset above to apply predefined climate settings.",
"feature.wetness_effects.debug": "Debug",
Expand Down Expand Up @@ -1529,8 +1528,8 @@
"feature.wetness_effects.min_rain_wetness": "Min Rain Wetness",
"feature.wetness_effects.min_rain_wetness_tooltip": "The minimum amount an object gets wet from rain.",
"feature.wetness_effects.name": "Wetness Effects",
"feature.wetness_effects.open_feature": "Open {}",
"feature.wetness_effects.open_installed_feature_tooltip": "Open the installed %s feature",
"feature.wetness_effects.open_weather_picker": "Open Weather Picker",
"feature.wetness_effects.open_weather_picker_tooltip": "Open the Weather Picker in CS Utility",
"feature.wetness_effects.portion_of_grid_size": "As portion of grid size.",
"feature.wetness_effects.puddle_max_angle": "Puddle Max Angle",
"feature.wetness_effects.puddle_max_angle_tooltip": "How flat a surface needs to be for puddles to form on it.",
Expand All @@ -1542,6 +1541,7 @@
"feature.wetness_effects.puddle_wetness_in_exterior": "Puddle Wetness In/Exterior",
"feature.wetness_effects.radius": "Radius",
"feature.wetness_effects.rain_in_exterior": "Rain In/Exterior",
"feature.wetness_effects.rain_system_state": "Rain System State",
"feature.wetness_effects.rain_wetness": "Rain Wetness",
"feature.wetness_effects.raindrop_effects": "Raindrop Effects",
"feature.wetness_effects.raindrops": "Raindrops",
Expand Down
10 changes: 5 additions & 5 deletions package/SKSE/Plugins/CommunityShaders/Translations/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@
"feature.wetness_effects.climate_preset_nordic": "北欧(默认)",
"feature.wetness_effects.climate_preset_nordic_desc": "平衡的北欧气候(中雨)",
"feature.wetness_effects.climate_preset_unknown": "未知",
"feature.wetness_effects.current_climate_preset": "当前气候预设",
"feature.wetness_effects.climate_presets": "气候预设",
"feature.wetness_effects.custom_preset_tooltip_0": "自定义设置 - 您已修改预设值。",
"feature.wetness_effects.custom_preset_tooltip_1": "在上方选择一个预设以应用预定义的气候设置。",
Expand Down Expand Up @@ -945,8 +946,8 @@
"feature.wetness_effects.min_rain_wetness": "最小降雨湿润度",
"feature.wetness_effects.min_rain_wetness_tooltip": "物体因雨水变湿的最小程度。",
"feature.wetness_effects.name": "湿润效果",
"feature.wetness_effects.open_feature": "打开 {}",
"feature.wetness_effects.open_installed_feature_tooltip": "打开已安装的 %s 功能",
"feature.wetness_effects.open_weather_picker": "打开天气选择器",
"feature.wetness_effects.open_weather_picker_tooltip": "在 CS 实用工具中打开天气选择器",
"feature.wetness_effects.portion_of_grid_size": "作为网格尺寸的比例。",
"feature.wetness_effects.puddle_max_angle": "积水最大角度",
"feature.wetness_effects.puddle_max_angle_tooltip": "表面需要多平才能形成积水。",
Expand All @@ -962,6 +963,7 @@
"feature.wetness_effects.raindrop_effects": "雨滴效果",
"feature.wetness_effects.raindrops": "雨滴",
"feature.wetness_effects.raindrops_help": "在每个间隔内,每个网格单元中放置一个雨滴。\n只有设定比例的雨滴会实际触发飞溅和涟漪。\n",
"feature.wetness_effects.rain_system_state": "雨水系统状态",
"feature.wetness_effects.ripples": "涟漪",
"feature.wetness_effects.shore_range": "岸边范围",
"feature.wetness_effects.shore_range_tooltip": "岸边湿润效果影响水体的最大距离",
Expand Down Expand Up @@ -2056,7 +2058,6 @@
"feature.cs_editor.thunder_freq_info_7": "范围:0-255(无符号8位整数)",
"feature.cs_editor.thunder_freq_info_8": "注意:Creation Kit以非线性方式解释此值",
"feature.cs_editor.thunder_frequency": "雷声频率:%u",
"feature.cs_editor.time_controls": "时间控制",
"feature.cs_editor.toggle_with": "切换键:",
"feature.cs_editor.tooltip_editor_id": "编辑器ID:%s",
"feature.cs_editor.tooltip_editor_id_2": "编辑器ID:%s",
Expand All @@ -2073,10 +2074,9 @@
"feature.cs_editor.using_default_settings": "使用默认设置",
"feature.cs_editor.weather": "天气",
"feature.cs_editor.weather_controls": "天气控制",
"feature.cs_editor.weather_details": "天气详情",
"feature.cs_editor.weather_information": "天气信息",
"feature.cs_editor.weather_percentage": "天气百分比:%.1f%%",
"feature.cs_editor.weather_status": "天气状态",
"feature.cs_editor.weather_picker": "天气选择器",
"feature.cs_editor.weather_wind_speed": "天气风速:%.2f(原始%d)",
"feature.cs_editor.wind_direction": "风向:%.1f°(原始%d)",
"feature.cs_editor.wind_direction_range": "风向范围:%.1f°(原始%d)",
Expand Down
91 changes: 50 additions & 41 deletions src/Features/CSEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ void CSEditor::DrawSettings()
OpenEditorWindow();
ImGui::EndDisabled();

ImGui::Spacing();
ImGui::SeparatorText(T(TKEY("weather_picker"), "Weather Picker"));

// Time controls
DrawTimeControls();

Expand All @@ -175,6 +178,27 @@ void CSEditor::DrawSettings()

// Integrated Weather Picker UI
DrawWeatherPickerSection();

ImGui::Spacing();
DrawShowInOverlayToggle();
}

void CSEditor::DrawShowInOverlayToggle()
{
const auto& themeSettings = Menu::GetSingleton()->GetTheme();
const auto& menuSettings = Menu::GetSingleton()->GetSettings();

bool showInOverlay = WeatherDetailsWindow.ShowInOverlay;
if (ImGui::Checkbox(T(TKEY("show_in_overlay"), "Show in Overlay"), &showInOverlay)) {
WeatherDetailsWindow.ShowInOverlay = showInOverlay;
}
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("%s", T(TKEY("show_in_overlay_tooltip"),
"Opens weather details in a separate window that stays open\neven when the main menu is closed. "));
ImGui::Text(T(TKEY("toggle_with"), "Toggle with "));
ImGui::SameLine();
ImGui::TextColored(themeSettings.StatusPalette.CurrentHotkey, "%s", Util::Input::KeyIdToString(menuSettings.OverlayToggleKey).c_str());
}
}

void CSEditor::Prepass()
Expand All @@ -200,27 +224,9 @@ void CSEditor::Prepass()
void CSEditor::DrawWeatherPickerSection()
{
ImGui::Spacing();
Util::DrawSectionHeader(T(TKEY("weather_details"), "Weather Details"));

const auto& themeSettings = Menu::GetSingleton()->GetTheme();
const auto& menuSettings = Menu::GetSingleton()->GetSettings();

// Show as Overlay checkbox
bool showInOverlay = WeatherDetailsWindow.ShowInOverlay;
if (ImGui::Checkbox(T(TKEY("show_in_overlay"), "Show in Overlay"), &showInOverlay)) {
WeatherDetailsWindow.ShowInOverlay = showInOverlay;
}
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("%s", T(TKEY("show_in_overlay_tooltip"),
"Opens weather details in a separate window that stays open\neven when the main menu is closed. "));
ImGui::Text(T(TKEY("toggle_with"), "Toggle with "));
ImGui::SameLine();
ImGui::TextColored(themeSettings.StatusPalette.CurrentHotkey, "%s", Util::Input::KeyIdToString(menuSettings.OverlayToggleKey).c_str());
}
ImGui::Spacing();

// Render core weather details
RenderCoreWeatherDetails(true); // true = show interactive elements in main settings panel
RenderCoreWeatherDetails(true, false); // true = show interactive elements in main settings panel

// Render weather analysis from features with collapsible headers
RenderFeatureWeatherAnalysis();
Expand Down Expand Up @@ -301,8 +307,6 @@ void CSEditor::LerpWeather(RE::TESWeather* oldWeather, RE::TESWeather* newWeathe

void CSEditor::DrawTimeControls()
{
ImGui::Spacing();
Util::DrawSectionHeader(T(TKEY("time_controls"), "Time Controls"));
ImGui::Spacing();
EditorWindow::GetSingleton()->DrawTimeControls();
ImGui::Spacing();
Expand All @@ -311,8 +315,6 @@ void CSEditor::DrawTimeControls()
void CSEditor::DrawWeatherStatusPanel()
{
ImGui::Spacing();
Util::DrawSectionHeader(T(TKEY("weather_status"), "Weather Status"));
ImGui::Spacing();

auto weatherManager = WeatherManager::GetSingleton();
auto currentWeathers = weatherManager->GetCurrentWeathers();
Expand Down Expand Up @@ -371,7 +373,7 @@ void CSEditor::DrawWeatherStatusPanel()
// Weather Picker functionality (integrated from WeatherPicker feature)
// ================================================================================

void CSEditor::RenderWeatherDetailsWindow(bool* open)
void CSEditor::RenderWeatherDetailsWindow(bool* open, bool showSectionHeaders)
{
if (!open || !*open)
return;
Expand Down Expand Up @@ -405,7 +407,7 @@ void CSEditor::RenderWeatherDetailsWindow(bool* open)
(globals::game::ui && globals::game::ui->IsMenuOpen(RE::CursorMenu::MENU_NAME)));
};

RenderCoreWeatherDetails(shouldEnableInteractiveElements());
RenderCoreWeatherDetails(shouldEnableInteractiveElements(), showSectionHeaders);

// Render weather analysis from features with collapsible headers
RenderFeatureWeatherAnalysis();
Expand Down Expand Up @@ -635,14 +637,16 @@ void CSEditor::DisplayWeatherInfo(RE::TESWeather* weather, float weatherPct, boo
CSEditor::DisplayWindInfo(weather);
}

void CSEditor::RenderWeatherControls(RE::Sky* sky)
void CSEditor::RenderWeatherControls(RE::Sky* sky, bool showSectionHeader)
{
// Weather Selection Section (only show interactive elements in inline mode)
static bool weatherControlsExpanded = true;
Util::DrawSectionHeader(T(TKEY("weather_controls"), "Weather Controls"), false, true, &weatherControlsExpanded);
if (showSectionHeader) {
Util::DrawSectionHeader(T(TKEY("weather_controls"), "Weather Controls"), false, true, &weatherControlsExpanded);

if (!weatherControlsExpanded)
return;
if (!weatherControlsExpanded)
return;
}

ImGui::Text("%s", T(TKEY("filter_by_weather_type"), "Filter by Weather Type:"));
if (ImGui::Button(T(TKEY("select_all"), "Select All"))) {
Expand Down Expand Up @@ -820,12 +824,14 @@ void CSEditor::RenderWeatherControls(RE::Sky* sky)
}
}

void CSEditor::RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiveElements)
void CSEditor::RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiveElements, bool showSectionHeader)
{
ImGui::Spacing();
ImGui::Spacing();
ImGui::Spacing();
Util::DrawSectionHeader(T(TKEY("weather_information"), "Weather Information"), false, true);
if (showSectionHeader) {
Util::DrawSectionHeader(T(TKEY("weather_information"), "Weather Information"), false, true);
}

// Update cache: store current lastWeather if it exists, otherwise keep the cached one
if (sky->lastWeather) {
Expand All @@ -836,7 +842,7 @@ void CSEditor::RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiv
RE::TESWeather* displayLastWeather = sky->lastWeather ? sky->lastWeather : s_cachedLastWeather;

// Create resizable 2-column table for current and last weather
if (ImGui::BeginTable("WeatherComparison", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersV)) {
if (ImGui::BeginTable("WeatherComparison", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_Borders)) {
// Set up columns
ImGui::TableSetupColumn(T(TKEY("current_weather_column"), "Current Weather"), ImGuiTableColumnFlags_WidthStretch, 0.5f);
ImGui::TableSetupColumn(T(TKEY("last_weather_column"), "Last Weather"), ImGuiTableColumnFlags_WidthStretch, 0.5f);
Expand All @@ -856,7 +862,7 @@ void CSEditor::RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiv
}
}

void CSEditor::RenderCoreWeatherDetails(bool showInteractiveElements)
void CSEditor::RenderCoreWeatherDetails(bool showInteractiveElements, bool showSectionHeaders)
{
const auto showError = [](const char* msg) {
auto menu = Menu::GetSingleton();
Expand All @@ -867,9 +873,9 @@ void CSEditor::RenderCoreWeatherDetails(bool showInteractiveElements)
if (auto sky = globals::game::sky) {
if (sky->mode.get() == RE::Sky::Mode::kFull) {
if (showInteractiveElements) {
RenderWeatherControls(sky);
RenderWeatherControls(sky, showSectionHeaders);
}
RenderWeatherInformationDisplay(sky, showInteractiveElements);
RenderWeatherInformationDisplay(sky, showInteractiveElements, showSectionHeaders);
ImGui::Spacing();
} else {
showError(T(TKEY("sky_not_full"), "Sky not in full mode"));
Expand Down Expand Up @@ -973,8 +979,8 @@ void CSEditor::RenderFeatureWeatherAnalysis()
auto featureName = feature->GetShortName();
ImGui::PushID(featureName.c_str());

// Create collapsible header for feature weather analysis
bool isExpanded = ImGui::CollapsingHeader(weatherConfig.sectionName.c_str(), ImGuiTreeNodeFlags_DefaultOpen);
const ImGuiTreeNodeFlags treeFlags = ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_SpanAvailWidth;
bool isExpanded = ImGui::TreeNodeEx(weatherConfig.sectionName.c_str(), treeFlags);
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("%s", T(TKEY("feature_weather_analysis_tooltip_0"), "Weather analysis provided by: "));
ImGui::Text("%s", feature->GetDisplayName().c_str());
Expand All @@ -984,9 +990,12 @@ void CSEditor::RenderFeatureWeatherAnalysis()
isExpanded ? T(TKEY("collapse"), "collapse") : T(TKEY("expand"), "expand"));
}

if (isExpanded && weatherConfig.drawFunction) {
// Call the feature's weather analysis draw function
weatherConfig.drawFunction();
if (isExpanded) {
if (weatherConfig.drawFunction) {
// Call the feature's weather analysis draw function
weatherConfig.drawFunction();
}
ImGui::TreePop();
}

ImGui::PopID();
Expand Down Expand Up @@ -1188,7 +1197,7 @@ void CSEditor::DrawOverlay()
WeatherDetailsWindow.Enabled = true;
}
bool* p_open = &WeatherDetailsWindow.Enabled;
RenderWeatherDetailsWindow(p_open);
RenderWeatherDetailsWindow(p_open, false);
}
s_prevOverlayVisible = overlayVisible;
}
Expand Down
9 changes: 5 additions & 4 deletions src/Features/CSEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct CSEditor : OverlayFeature
* Renders the standalone weather details window.
* @param open Pointer to the open/close state owned by the caller.
*/
void RenderWeatherDetailsWindow(bool* open);
void RenderWeatherDetailsWindow(bool* open, bool showSectionHeaders = true);

// Core weather display functions that other features can use
/**
Expand All @@ -64,7 +64,7 @@ struct CSEditor : OverlayFeature
* Renders the core weather details UI section.
* @param showInteractiveElements Enables interactive controls when true.
*/
static void RenderCoreWeatherDetails(bool showInteractiveElements = true);
static void RenderCoreWeatherDetails(bool showInteractiveElements = true, bool showSectionHeaders = true);
/**
* Renders weather analysis sections contributed by other features.
*/
Expand All @@ -75,13 +75,13 @@ struct CSEditor : OverlayFeature
* Renders the weather controls section.
* @param sky Active sky instance.
*/
static void RenderWeatherControls(RE::Sky* sky);
static void RenderWeatherControls(RE::Sky* sky, bool showSectionHeader = true);
/**
* Renders the weather information display section.
* @param sky Active sky instance.
* @param showInteractiveElements Enables interactive controls when true.
*/
static void RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiveElements = true);
static void RenderWeatherInformationDisplay(RE::Sky* sky, bool showInteractiveElements = true, bool showSectionHeader = true);

struct WeatherDetailsWindowSettings
{
Expand Down Expand Up @@ -122,6 +122,7 @@ struct CSEditor : OverlayFeature
static ImVec4 GetWeatherFlagColorByName(const std::string& flagName);

private:
void DrawShowInOverlayToggle();
void DrawTimeControls();
void DrawWeatherStatusPanel();
void DrawWeatherPickerSection();
Expand Down
Loading
Loading