Skip to content

Commit

Permalink
run clang format (#448)
Browse files Browse the repository at this point in the history
* add linux clang format script

* first shot at powershell

* whoops

* webrequest is slow, try webclient

* just get the one file

* simplify and maybe make it work?

* whoops again

* try a different suggestion

* why is it always windows

* again

* try again

* bit of path stuff

* chmod +x

* add action to check

* fix workflow name

* run clang format
  • Loading branch information
briaguya-ai authored and garrettjoecox committed May 22, 2024
1 parent 0a2d899 commit 6da0031
Show file tree
Hide file tree
Showing 300 changed files with 4,560 additions and 4,380 deletions.
126 changes: 63 additions & 63 deletions mm/2s2h/BenGui/BenGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,87 +23,87 @@
bool ShouldClearTextureCacheAtEndOfFrame = false;

namespace BenGui {
// MARK: - Delegates
// MARK: - Delegates

std::shared_ptr<BenMenuBar> mBenMenuBar;
std::shared_ptr<BenMenuBar> mBenMenuBar;

std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
std::shared_ptr<Ship::GuiWindow> mStatsWindow;
std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow;
std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
std::shared_ptr<Ship::GuiWindow> mStatsWindow;
std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow;

std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
std::shared_ptr<HudEditorWindow> mHudEditorWindow;
std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
std::shared_ptr<CollisionViewerWindow> mCollisionViewerWindow;
std::shared_ptr<EventLogWindow> mEventLogWindow;
std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
std::shared_ptr<HudEditorWindow> mHudEditorWindow;
std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
std::shared_ptr<CollisionViewerWindow> mCollisionViewerWindow;
std::shared_ptr<EventLogWindow> mEventLogWindow;

void SetupGuiElements() {
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
void SetupGuiElements() {
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();

auto& style = ImGui::GetStyle();
style.FramePadding = ImVec2(4.0f, 6.0f);
style.ItemSpacing = ImVec2(8.0f, 6.0f);
style.Colors[ImGuiCol_MenuBarBg] = UIWidgets::Colors::DarkGray;
auto& style = ImGui::GetStyle();
style.FramePadding = ImVec2(4.0f, 6.0f);
style.ItemSpacing = ImVec2(8.0f, 6.0f);
style.Colors[ImGuiCol_MenuBarBg] = UIWidgets::Colors::DarkGray;

mBenMenuBar = std::make_shared<BenMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar));
mBenMenuBar = std::make_shared<BenMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar));

if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) {
if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) {
#if defined(__SWITCH__) || defined(__WIIU__)
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
#else
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu");
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu");
#endif
}
}

mStatsWindow = gui->GetGuiWindow("Stats");
if (mStatsWindow == nullptr) {
SPDLOG_ERROR("Could not find stats window");
}
mStatsWindow = gui->GetGuiWindow("Stats");
if (mStatsWindow == nullptr) {
SPDLOG_ERROR("Could not find stats window");
}

mConsoleWindow = gui->GetGuiWindow("Console");
if (mConsoleWindow == nullptr) {
SPDLOG_ERROR("Could not find console window");
}
mConsoleWindow = gui->GetGuiWindow("Console");
if (mConsoleWindow == nullptr) {
SPDLOG_ERROR("Could not find console window");
}

mInputEditorWindow = gui->GetGuiWindow("Input Editor");
if (mInputEditorWindow == nullptr) {
SPDLOG_ERROR("Could not find input editor window");
}
mInputEditorWindow = gui->GetGuiWindow("Input Editor");
if (mInputEditorWindow == nullptr) {
SPDLOG_ERROR("Could not find input editor window");
}

mGfxDebuggerWindow = gui->GetGuiWindow("GfxDebuggerWindow");
if (mGfxDebuggerWindow == nullptr) {
SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
}
mGfxDebuggerWindow = gui->GetGuiWindow("GfxDebuggerWindow");
if (mGfxDebuggerWindow == nullptr) {
SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
}

mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor");
gui->AddGuiWindow(mSaveEditorWindow);
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor");
gui->AddGuiWindow(mSaveEditorWindow);

mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "Hud Editor");
gui->AddGuiWindow(mHudEditorWindow);
mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "Hud Editor");
gui->AddGuiWindow(mHudEditorWindow);

mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer");
gui->AddGuiWindow(mActorViewerWindow);
mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer");
gui->AddGuiWindow(mActorViewerWindow);

mCollisionViewerWindow = std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer");
gui->AddGuiWindow(mCollisionViewerWindow);
mCollisionViewerWindow = std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer");
gui->AddGuiWindow(mCollisionViewerWindow);

mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log");
gui->AddGuiWindow(mEventLogWindow);
}
mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log");
gui->AddGuiWindow(mEventLogWindow);
}

void Destroy() {
mBenMenuBar = nullptr;
mStatsWindow = nullptr;
mConsoleWindow = nullptr;
mInputEditorWindow = nullptr;
mGfxDebuggerWindow = nullptr;
mCollisionViewerWindow = nullptr;
mEventLogWindow = nullptr;

mSaveEditorWindow = nullptr;
mHudEditorWindow = nullptr;
mActorViewerWindow = nullptr;
}
void Destroy() {
mBenMenuBar = nullptr;
mStatsWindow = nullptr;
mConsoleWindow = nullptr;
mInputEditorWindow = nullptr;
mGfxDebuggerWindow = nullptr;
mCollisionViewerWindow = nullptr;
mEventLogWindow = nullptr;

mSaveEditorWindow = nullptr;
mHudEditorWindow = nullptr;
mActorViewerWindow = nullptr;
}
} // namespace BenGui
Loading

0 comments on commit 6da0031

Please sign in to comment.