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
2 changes: 1 addition & 1 deletion docs/development/vscode-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Automatically deploy shaders when you save `.hlsl` or `.hlsli` files.

**Interaction with built-in filewatcher:**

Community Shaders has a built-in filewatcher (**Settings → Advanced → Shader Compilation → Enable File Watcher**) that hot-reloads shaders when files change in the game's `Data/Shaders/` directory. The workflow is:
Community Shaders has a built-in filewatcher (**Settings → Advanced → Shaders → Cache & File Watcher → Enable File Watcher**) that hot-reloads shaders when files change in the game's `Data/Shaders/` directory. The workflow is:

1. Edit shader in VSCode
2. Save → RunOnSave deploys to `Data/Shaders/`
Expand Down
120 changes: 58 additions & 62 deletions src/FeatureIssues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,74 +1462,70 @@ namespace FeatureIssues
auto* menu = Menu::GetSingleton();
const auto& themeSettings = menu->GetTheme();

if (ImGui::CollapsingHeader("Testing", ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick)) {
{
auto sectionWrapper = Util::SectionWrapper("Feature Issue Testing",
"These tools create test INI files to trigger all known feature issue types for testing purposes.",
themeSettings.Palette.Text);

if (sectionWrapper) {
const bool hasActiveTests = HasActiveTestInis();
if (hasActiveTests) { // Warning section using theme colors
ImGui::PushStyleColor(ImGuiCol_Text, themeSettings.StatusPalette.RestartNeeded);
ImGui::TextWrapped("Test INI files are currently active. Restart CS to see feature issues.");
ImGui::PopStyleColor(); // Show detailed test state information
ImGui::Spacing();
ImGui::PushStyleColor(ImGuiCol_Text, themeSettings.StatusPalette.RestartNeeded);
ImGui::TextWrapped(GetTestStateDescription().c_str());
ImGui::PopStyleColor();
ImGui::Spacing();
}

// Create Test INIs button
{
auto disableGuard = Util::DisableGuard(hasActiveTests);
auto buttonStyle = Util::StyledButtonWrapper(
themeSettings.Palette.FrameBorder,
themeSettings.StatusPalette.RestartNeeded,
themeSettings.StatusPalette.CurrentHotkey);

if (ImGui::Button("Create Test Inis", { -1, 0 })) {
auto testInis = CreateTestInis();
logger::info("Created {} test INI files for feature issue testing", testInis.size());
}
}
auto sectionWrapper = Util::SectionWrapper("Feature Issue Testing",
"These tools create test INI files to trigger all known feature issue types for testing purposes.",
themeSettings.Palette.Text);

if (sectionWrapper) {
const bool hasActiveTests = HasActiveTestInis();
if (hasActiveTests) { // Warning section using theme colors
ImGui::PushStyleColor(ImGuiCol_Text, themeSettings.StatusPalette.RestartNeeded);
ImGui::TextWrapped("Test INI files are currently active. Restart CS to see feature issues.");
ImGui::PopStyleColor(); // Show detailed test state information
ImGui::Spacing();
ImGui::PushStyleColor(ImGuiCol_Text, themeSettings.StatusPalette.RestartNeeded);
ImGui::TextWrapped(GetTestStateDescription().c_str());
ImGui::PopStyleColor();
ImGui::Spacing();
}

if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text(
"Creates test INI files that trigger all known feature issue cases:\n"
"- Obsolete features (ComplexParallaxMaterials, TerrainBlending, etc.)\n"
"- Unknown features (fake non-existent features)\n"
"- Version mismatch (modifies existing feature version)\n"
"Restart CS after creating to see the issues in action.");
}
// Create Test INIs button
{
auto disableGuard = Util::DisableGuard(hasActiveTests);
auto buttonStyle = Util::StyledButtonWrapper(
themeSettings.Palette.FrameBorder,
themeSettings.StatusPalette.RestartNeeded,
themeSettings.StatusPalette.CurrentHotkey);

if (ImGui::Button("Create Test INIs", { -1, 0 })) {
auto testInis = CreateTestInis();
logger::info("Created {} test INI files for feature issue testing", testInis.size());
}
}

// Restore button
{
auto disableGuard = Util::DisableGuard(!hasActiveTests);
auto buttonStyle = Util::StyledButtonWrapper(
themeSettings.Palette.FrameBorder,
themeSettings.StatusPalette.Error,
themeSettings.StatusPalette.CurrentHotkey);

if (ImGui::Button("Restore", { -1, 0 })) {
auto& testInis = GetCurrentTestInis();
if (RestoreOriginalState(testInis)) {
logger::info("Successfully restored original state");
} else {
logger::warn("Some restoration operations failed");
}
}
}
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text(
"Creates test INI files that trigger all known feature issue cases:\n"
"- Obsolete features (ComplexParallaxMaterials, TerrainBlending, etc.)\n"
"- Unknown features (fake non-existent features)\n"
"- Version mismatch (modifies existing feature version)\n"
"Restart CS after creating to see the issues in action.");
}

if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text(
"Removes all test INI files and restores any modified INI files to their original state.\n"
"This undoes all changes made by 'Create Test Inis'.\n"
"Restart CS after restoring to see normal operation.");
// Restore button
{
auto disableGuard = Util::DisableGuard(!hasActiveTests);
auto buttonStyle = Util::StyledButtonWrapper(
themeSettings.Palette.FrameBorder,
themeSettings.StatusPalette.Error,
themeSettings.StatusPalette.CurrentHotkey);

if (ImGui::Button("Restore", { -1, 0 })) {
auto& testInis = GetCurrentTestInis();
if (RestoreOriginalState(testInis)) {
logger::info("Successfully restored original state");
} else {
logger::warn("Some restoration operations failed");
}
}
}

if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text(
"Removes all test INI files and restores any modified INI files to their original state.\n"
"This undoes all changes made by 'Create Test INIs'.\n"
"Restart CS after restoring to see normal operation.");
}
}
}
bool RefreshTestState()
Expand Down
Loading
Loading