Skip to content

Commit

Permalink
ui: allow disabling of sfx and imf buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Jensen committed Sep 2, 2023
1 parent 9f60dce commit 22f132b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cdcSound/sfxmarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace cdc {

bool neverInsideSfxPerimeter = false;

void SFXMARKER_ProcessAllMarkers() { // line 100
for (uint32_t i=0; i<sizeof(StreamTracker)/sizeof(StreamUnit); i++) {
StreamUnit& streamUnit = StreamTracker[i];
Expand Down Expand Up @@ -75,6 +77,8 @@ bool CheckPerimeter(dtp::sfxmarker::Perimeter *perimeter, dtp::sfxmarker *marker
auto distanceSq = Dot3(distanceVec, distanceVec);
auto distance = sqrtf(distanceSq);
bool inside = perimeter->radius >= distance;
if (neverInsideSfxPerimeter)
inside = false; // override
bool changed = perimeter->bBreached != inside;
perimeter->bBreached = inside;
perimeter->lastDistance = distance;
Expand Down
2 changes: 2 additions & 0 deletions cdcSound/sfxmarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace cdc {

extern bool neverInsideSfxPerimeter;

void SFXMARKER_ProcessAllMarkers(); // line 100

void TriggerAction(dtp::sfxmarker *marker, dtp::sfxmarker::Trigger *trigger); // line 131
Expand Down
5 changes: 4 additions & 1 deletion spinnycube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ int spinnyCube(HWND window,
bool showStringsWindow = false;
bool showScaleformStringsWindow = false;
bool showIntroButtons = true;
bool showIntroButtonsIMF = true;
bool editorMode = false;
std::vector<std::pair<void*, cdc::CommonScene*>> captures { { nullptr, nullptr } };
uint32_t selectedCapture = 0;
Expand Down Expand Up @@ -1019,7 +1020,7 @@ int spinnyCube(HWND window,
cdc::FileRequest::NORMAL);
cdc::archiveFileSystem_default->processAll();
}
if (ref.m_imfDRMName && strrchr(ref.m_imfDRMName, '\\'))
if (showIntroButtonsIMF && ref.m_imfDRMName && strrchr(ref.m_imfDRMName, '\\'))
fbs.push_back(FloatingButton{
{ref.m_transform.m[3][0],
ref.m_transform.m[3][1],
Expand Down Expand Up @@ -1200,6 +1201,8 @@ int spinnyCube(HWND window,
// editorMode on: hide cdc::Scene, render cdc::Intros directly
if (ImGui::MenuItem("Editor mode", nullptr, editorMode)) { editorMode = !editorMode; }
if (ImGui::MenuItem("Intro Buttons", nullptr, showIntroButtons)) { showIntroButtons = !showIntroButtons; }
if (ImGui::MenuItem("Intro Buttons IMF", nullptr, showIntroButtonsIMF)) { showIntroButtonsIMF = !showIntroButtonsIMF; }
if (ImGui::MenuItem("Disable SFX", nullptr, cdc::neverInsideSfxPerimeter)) { cdc::neverInsideSfxPerimeter = !cdc::neverInsideSfxPerimeter; }
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Language")) {
Expand Down

0 comments on commit 22f132b

Please sign in to comment.