Skip to content

Commit

Permalink
Initial implementation of PresetsManager (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjoecox authored Feb 14, 2025
1 parent eec2be4 commit 3d46f8d
Show file tree
Hide file tree
Showing 4 changed files with 535 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mm/2s2h/BenGui/BenMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "DeveloperTools/CollisionViewer.h"
#include "DeveloperTools/EventLog.h"
#include "2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.h"
#include "2s2h/PresetManager/PresetManager.h"
#include "HudEditor.h"
#include "Notification.h"
#include <variant>
Expand Down Expand Up @@ -382,6 +383,10 @@ void BenMenu::AddSettings() {
});
})
.Options(ButtonOptions().Tooltip("Displays a test notification."));

path.sidebarName = "Presets";
AddSidebarEntry("Settings", "Presets", 1);
AddWidget(path, "Presets", WIDGET_CUSTOM).CustomFunction([](WidgetInfo& info) { PresetManager_Draw(); });
}
int32_t motionBlurStrength;

Expand Down
7 changes: 4 additions & 3 deletions mm/2s2h/BenPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ CrowdControl* CrowdControl::Instance;
#include "2s2h/BenGui/Notification.h"
#include "2s2h/ShipUtils.h"
#include "2s2h/ShipInit.hpp"
#include "2s2h/PresetManager/PresetManager.h"

// Resource Types/Factories
#include "resource/type/Blob.h"
Expand Down Expand Up @@ -451,9 +452,9 @@ void Ben_ProcessDroppedFiles(std::string filePath) {
// handled = Randomizer_HandleFileDropped(filePath);
// }

// if (!handled) {
// handled = Presets_HandleFileDropped(filePath);
// }
if (!handled) {
handled = PresetManager_HandleFileDropped(filePath);
}

if (!handled) {
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
Expand Down
Loading

0 comments on commit 3d46f8d

Please sign in to comment.