mirror of https://github.com/AxioDL/metaforce.git
MP1: Migrate from std::bind to lambdas
Provides a more straightforward means of supplying custom behavior in place. Lambdas also typically optimize better compared to std::bind objects.
This commit is contained in:
parent
cf294db9eb
commit
8b7945e76f
|
@ -97,19 +97,15 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading() {
|
||||||
worker->SetIsSelectable(false);
|
worker->SetIsSelectable(false);
|
||||||
worker->SetVisibility(false, ETraversalMode::Children);
|
worker->SetVisibility(false, ETraversalMode::Children);
|
||||||
|
|
||||||
x20_tablegroup_fileselect->SetMenuAdvanceCallback(
|
x20_tablegroup_fileselect->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoFileMenuAdvance(caller); });
|
||||||
std::bind(&SNewFileSelectFrame::DoFileMenuAdvance, this, std::placeholders::_1));
|
|
||||||
x20_tablegroup_fileselect->SetMenuSelectionChangeCallback(
|
x20_tablegroup_fileselect->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
x20_tablegroup_fileselect->SetMenuCancelCallback(
|
x20_tablegroup_fileselect->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoFileMenuCancel(caller); });
|
||||||
std::bind(&SNewFileSelectFrame::DoFileMenuCancel, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
x40_tablegroup_popup->SetMenuAdvanceCallback(
|
x40_tablegroup_popup->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoPopupAdvance(caller); });
|
||||||
std::bind(&SNewFileSelectFrame::DoPopupAdvance, this, std::placeholders::_1));
|
|
||||||
x40_tablegroup_popup->SetMenuSelectionChangeCallback(
|
x40_tablegroup_popup->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
x40_tablegroup_popup->SetMenuCancelCallback(
|
x40_tablegroup_popup->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoPopupCancel(caller); });
|
||||||
std::bind(&SNewFileSelectFrame::DoPopupCancel, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 3; ++i)
|
||||||
x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i);
|
x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i);
|
||||||
|
@ -868,12 +864,12 @@ void CFrontEndUI::SFusionBonusFrame::FinishedLoading() {
|
||||||
SetTableColors(x28_tablegroup_options);
|
SetTableColors(x28_tablegroup_options);
|
||||||
SetTableColors(x2c_tablegroup_fusionsuit);
|
SetTableColors(x2c_tablegroup_fusionsuit);
|
||||||
|
|
||||||
x28_tablegroup_options->SetMenuAdvanceCallback(std::bind(&SFusionBonusFrame::DoAdvance, this, std::placeholders::_1));
|
x28_tablegroup_options->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
|
||||||
x28_tablegroup_options->SetMenuSelectionChangeCallback(
|
x28_tablegroup_options->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SFusionBonusFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
x28_tablegroup_options->SetMenuCancelCallback(std::bind(&SFusionBonusFrame::DoCancel, this, std::placeholders::_1));
|
x28_tablegroup_options->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoCancel(caller); });
|
||||||
x2c_tablegroup_fusionsuit->SetMenuSelectionChangeCallback(
|
x2c_tablegroup_fusionsuit->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SFusionBonusFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFrontEndUI::SFusionBonusFrame::PumpLoad() {
|
bool CFrontEndUI::SFusionBonusFrame::PumpLoad() {
|
||||||
|
@ -1112,10 +1108,10 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading() {
|
||||||
if (proceed)
|
if (proceed)
|
||||||
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
|
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
|
||||||
|
|
||||||
x18_tablegroup_mainmenu->SetMenuAdvanceCallback(std::bind(&SFrontEndFrame::DoAdvance, this, std::placeholders::_1));
|
x18_tablegroup_mainmenu->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
|
||||||
x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback(
|
x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SFrontEndFrame::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
x18_tablegroup_mainmenu->SetMenuCancelCallback(std::bind(&SFrontEndFrame::DoCancel, this, std::placeholders::_1));
|
x18_tablegroup_mainmenu->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoCancel(caller); });
|
||||||
|
|
||||||
HandleActiveChange(x18_tablegroup_mainmenu);
|
HandleActiveChange(x18_tablegroup_mainmenu);
|
||||||
}
|
}
|
||||||
|
@ -1531,31 +1527,27 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading() {
|
||||||
x30_tablegroup_triple = static_cast<CGuiTableGroup*>(x1c_loadedFrame->FindWidget("tablegroup_triple"));
|
x30_tablegroup_triple = static_cast<CGuiTableGroup*>(x1c_loadedFrame->FindWidget("tablegroup_triple"));
|
||||||
x34_slidergroup_slider = static_cast<CGuiSliderGroup*>(x1c_loadedFrame->FindWidget("slidergroup_slider"));
|
x34_slidergroup_slider = static_cast<CGuiSliderGroup*>(x1c_loadedFrame->FindWidget("slidergroup_slider"));
|
||||||
|
|
||||||
x24_tablegroup_leftmenu->SetMenuAdvanceCallback(
|
x24_tablegroup_leftmenu->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoLeftMenuAdvance(caller); });
|
||||||
std::bind(&SOptionsFrontEndFrame::DoLeftMenuAdvance, this, std::placeholders::_1));
|
|
||||||
x24_tablegroup_leftmenu->SetMenuSelectionChangeCallback(
|
x24_tablegroup_leftmenu->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
|
||||||
|
|
||||||
x38_rowPitch = x24_tablegroup_leftmenu->GetWorkerWidget(1)->GetIdlePosition().z() -
|
x38_rowPitch = x24_tablegroup_leftmenu->GetWorkerWidget(1)->GetIdlePosition().z() -
|
||||||
x24_tablegroup_leftmenu->GetWorkerWidget(0)->GetIdlePosition().z();
|
x24_tablegroup_leftmenu->GetWorkerWidget(0)->GetIdlePosition().z();
|
||||||
|
|
||||||
x28_tablegroup_rightmenu->SetMenuSelectionChangeCallback(
|
x28_tablegroup_rightmenu->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
|
||||||
x28_tablegroup_rightmenu->SetMenuCancelCallback(
|
x28_tablegroup_rightmenu->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
x2c_tablegroup_double->SetMenuSelectionChangeCallback(
|
x2c_tablegroup_double->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
|
||||||
x2c_tablegroup_double->SetMenuCancelCallback(
|
x2c_tablegroup_double->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
x30_tablegroup_triple->SetMenuSelectionChangeCallback(
|
x30_tablegroup_triple->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoMenuSelectionChange(caller, oldSel); });
|
||||||
x30_tablegroup_triple->SetMenuCancelCallback(
|
x30_tablegroup_triple->SetMenuCancelCallback([this](CGuiTableGroup* caller) { DoMenuCancel(caller); });
|
||||||
std::bind(&SOptionsFrontEndFrame::DoMenuCancel, this, std::placeholders::_1));
|
|
||||||
|
|
||||||
x34_slidergroup_slider->SetSelectionChangedCallback(
|
x34_slidergroup_slider->SetSelectionChangedCallback(
|
||||||
std::bind(&SOptionsFrontEndFrame::DoSliderChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiSliderGroup* caller, float value) { DoSliderChange(caller, value); });
|
||||||
|
|
||||||
FindTextPanePair(x1c_loadedFrame, "textpane_double0").SetPairText(x20_loadedPauseStrg->GetString(95)); // Off
|
FindTextPanePair(x1c_loadedFrame, "textpane_double0").SetPairText(x20_loadedPauseStrg->GetString(95)); // Off
|
||||||
FindTextPanePair(x1c_loadedFrame, "textpane_double1").SetPairText(x20_loadedPauseStrg->GetString(94)); // On
|
FindTextPanePair(x1c_loadedFrame, "textpane_double1").SetPairText(x20_loadedPauseStrg->GetString(94)); // On
|
||||||
|
|
|
@ -141,10 +141,10 @@ void CGBASupport::Update(float dt) {
|
||||||
|
|
||||||
case EPhase::StartJoyBusBoot:
|
case EPhase::StartJoyBusBoot:
|
||||||
x34_phase = EPhase::PollJoyBusBoot;
|
x34_phase = EPhase::PollJoyBusBoot;
|
||||||
if (!g_JbusEndpoint || g_JbusEndpoint->GBAJoyBootAsync(
|
if (!g_JbusEndpoint || g_JbusEndpoint->GBAJoyBootAsync(x40_siChan * 2, 2, x2c_buffer.get(), x28_fileSize,
|
||||||
x40_siChan * 2, 2, x2c_buffer.get(), x28_fileSize, &x3c_status,
|
&x3c_status, JoyBootDone) != jbus::GBA_READY) {
|
||||||
std::bind(JoyBootDone, std::placeholders::_1, std::placeholders::_2)) != jbus::GBA_READY)
|
|
||||||
x34_phase = EPhase::Failed;
|
x34_phase = EPhase::Failed;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EPhase::PollJoyBusBoot:
|
case EPhase::PollJoyBusBoot:
|
||||||
|
|
|
@ -207,11 +207,11 @@ void COptionsScreen::VActivate() {
|
||||||
.SetText(xc_pauseStrg.GetString(98));
|
.SetText(xc_pauseStrg.GetString(98));
|
||||||
|
|
||||||
x18c_slidergroup_slider->SetSelectionChangedCallback(
|
x18c_slidergroup_slider->SetSelectionChangedCallback(
|
||||||
std::bind(&COptionsScreen::OnSliderChanged, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiSliderGroup* caller, float value) { OnSliderChanged(caller, value); });
|
||||||
x190_tablegroup_double->SetMenuSelectionChangeCallback(
|
x190_tablegroup_double->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&COptionsScreen::OnEnumChanged, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { OnEnumChanged(caller, oldSel); });
|
||||||
x194_tablegroup_triple->SetMenuSelectionChangeCallback(
|
x194_tablegroup_triple->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&COptionsScreen::OnEnumChanged, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { OnEnumChanged(caller, oldSel); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void COptionsScreen::RightTableSelectionChanged(int oldSel, int newSel) { UpdateOptionView(); }
|
void COptionsScreen::RightTableSelectionChanged(int oldSel, int newSel) { UpdateOptionView(); }
|
||||||
|
|
|
@ -79,10 +79,10 @@ void CPauseScreen::InitializeFrameGlue() {
|
||||||
deco->SetColor(color);
|
deco->SetColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
x34_loadedPauseScreenInstructions->SetMouseDownCallback(std::bind(&CPauseScreen::OnWidgetMouseDown, this,
|
x34_loadedPauseScreenInstructions->SetMouseDownCallback(
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiWidget* caller, bool resume) { OnWidgetMouseDown(caller, resume); });
|
||||||
x34_loadedPauseScreenInstructions->SetMouseUpCallback(std::bind(&CPauseScreen::OnWidgetMouseUp, this,
|
x34_loadedPauseScreenInstructions->SetMouseUpCallback(
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiWidget* caller, bool cancel) { OnWidgetMouseUp(caller, cancel); });
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPauseScreen::CheckLoadComplete(const CStateManager& mgr) {
|
bool CPauseScreen::CheckLoadComplete(const CStateManager& mgr) {
|
||||||
|
|
|
@ -151,25 +151,21 @@ void CPauseScreenBase::InitializeFrameGlue() {
|
||||||
x190_tablegroup_double->SetWorkersMouseActive(false);
|
x190_tablegroup_double->SetWorkersMouseActive(false);
|
||||||
x194_tablegroup_triple->SetWorkersMouseActive(false);
|
x194_tablegroup_triple->SetWorkersMouseActive(false);
|
||||||
|
|
||||||
x70_tablegroup_leftlog->SetMenuAdvanceCallback(
|
x70_tablegroup_leftlog->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { OnLeftTableAdvance(caller); });
|
||||||
std::bind(&CPauseScreenBase::OnLeftTableAdvance, this, std::placeholders::_1));
|
|
||||||
x70_tablegroup_leftlog->SetMenuSelectionChangeCallback(
|
x70_tablegroup_leftlog->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&CPauseScreenBase::OnTableSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { OnTableSelectionChange(caller, oldSel); });
|
||||||
x84_tablegroup_rightlog->SetMenuAdvanceCallback(
|
x84_tablegroup_rightlog->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { OnRightTableAdvance(caller); });
|
||||||
std::bind(&CPauseScreenBase::OnRightTableAdvance, this, std::placeholders::_1));
|
|
||||||
x84_tablegroup_rightlog->SetMenuSelectionChangeCallback(
|
x84_tablegroup_rightlog->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&CPauseScreenBase::OnTableSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { OnTableSelectionChange(caller, oldSel); });
|
||||||
x84_tablegroup_rightlog->SetMenuCancelCallback(
|
x84_tablegroup_rightlog->SetMenuCancelCallback([this](CGuiTableGroup* caller) { OnRightTableCancel(caller); });
|
||||||
std::bind(&CPauseScreenBase::OnRightTableCancel, this, std::placeholders::_1));
|
|
||||||
x18c_slidergroup_slider->SetSelectionChangedCallback({});
|
x18c_slidergroup_slider->SetSelectionChangedCallback({});
|
||||||
x190_tablegroup_double->SetMenuSelectionChangeCallback({});
|
x190_tablegroup_double->SetMenuSelectionChangeCallback({});
|
||||||
x194_tablegroup_triple->SetMenuSelectionChangeCallback({});
|
x194_tablegroup_triple->SetMenuSelectionChangeCallback({});
|
||||||
|
|
||||||
x8_frame.SetMouseUpCallback(std::bind(&CPauseScreenBase::OnWidgetMouseUp, this,
|
x8_frame.SetMouseUpCallback([this](CGuiWidget* widget, bool cancel) { OnWidgetMouseUp(widget, cancel); });
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
x8_frame.SetMouseScrollCallback([this](CGuiWidget* widget, const boo::SScrollDelta& delta, int accumX, int accumY) {
|
||||||
x8_frame.SetMouseScrollCallback(std::bind(&CPauseScreenBase::OnWidgetScroll, this,
|
OnWidgetScroll(widget, delta, accumX, accumY);
|
||||||
std::placeholders::_1, std::placeholders::_2,
|
});
|
||||||
std::placeholders::_3, std::placeholders::_4));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPauseScreenBase::IsReady() {
|
bool CPauseScreenBase::IsReady() {
|
||||||
|
|
|
@ -29,9 +29,9 @@ void CQuitGameScreen::FinishedLoading() {
|
||||||
|
|
||||||
x14_tablegroup_quitgame = static_cast<CGuiTableGroup*>(x10_loadedFrame->FindWidget("tablegroup_quitgame"));
|
x14_tablegroup_quitgame = static_cast<CGuiTableGroup*>(x10_loadedFrame->FindWidget("tablegroup_quitgame"));
|
||||||
x14_tablegroup_quitgame->SetVertical(false);
|
x14_tablegroup_quitgame->SetVertical(false);
|
||||||
x14_tablegroup_quitgame->SetMenuAdvanceCallback(std::bind(&CQuitGameScreen::DoAdvance, this, std::placeholders::_1));
|
x14_tablegroup_quitgame->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
|
||||||
x14_tablegroup_quitgame->SetMenuSelectionChangeCallback(
|
x14_tablegroup_quitgame->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&CQuitGameScreen::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
|
|
||||||
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_title"))
|
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_title"))
|
||||||
->TextSupport()
|
->TextSupport()
|
||||||
|
@ -46,8 +46,7 @@ void CQuitGameScreen::FinishedLoading() {
|
||||||
|
|
||||||
x14_tablegroup_quitgame->SetUserSelection(DefaultSelections[int(x0_type)]);
|
x14_tablegroup_quitgame->SetUserSelection(DefaultSelections[int(x0_type)]);
|
||||||
x14_tablegroup_quitgame->SetWorkersMouseActive(true);
|
x14_tablegroup_quitgame->SetWorkersMouseActive(true);
|
||||||
x10_loadedFrame->SetMouseUpCallback(std::bind(&CQuitGameScreen::OnWidgetMouseUp, this,
|
x10_loadedFrame->SetMouseUpCallback([this](CGuiWidget* widget, bool cancel) { OnWidgetMouseUp(widget, cancel); });
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
|
||||||
SetColors();
|
SetColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,9 @@ bool CSaveGameScreen::PumpLoad() {
|
||||||
x64_textpane_choice2 = static_cast<CGuiTextPane*>(x50_loadedFrame->FindWidget("textpane_choice2"));
|
x64_textpane_choice2 = static_cast<CGuiTextPane*>(x50_loadedFrame->FindWidget("textpane_choice2"));
|
||||||
x68_textpane_choice3 = static_cast<CGuiTextPane*>(x50_loadedFrame->FindWidget("textpane_choice3"));
|
x68_textpane_choice3 = static_cast<CGuiTextPane*>(x50_loadedFrame->FindWidget("textpane_choice3"));
|
||||||
|
|
||||||
x58_tablegroup_choices->SetMenuAdvanceCallback(std::bind(&CSaveGameScreen::DoAdvance, this, std::placeholders::_1));
|
x58_tablegroup_choices->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); });
|
||||||
x58_tablegroup_choices->SetMenuSelectionChangeCallback(
|
x58_tablegroup_choices->SetMenuSelectionChangeCallback(
|
||||||
std::bind(&CSaveGameScreen::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
|
[this](CGuiTableGroup* caller, int oldSel) { DoSelectionChange(caller, oldSel); });
|
||||||
|
|
||||||
if (x0_saveCtx == ESaveContext::InGame)
|
if (x0_saveCtx == ESaveContext::InGame)
|
||||||
x6c_cardDriver->StartCardProbe();
|
x6c_cardDriver->StartCardProbe();
|
||||||
|
|
|
@ -648,27 +648,33 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana
|
||||||
m_cvarMgr = cvarMgr;
|
m_cvarMgr = cvarMgr;
|
||||||
m_console = std::make_unique<hecl::Console>(m_cvarMgr);
|
m_console = std::make_unique<hecl::Console>(m_cvarMgr);
|
||||||
m_console->init(window);
|
m_console->init(window);
|
||||||
m_console->registerCommand("Quit"sv, "Quits the game immediately"sv, ""sv,
|
m_console->registerCommand(
|
||||||
std::bind(&CMain::quit, this, std::placeholders::_1, std::placeholders::_2));
|
"Quit"sv, "Quits the game immediately"sv, ""sv,
|
||||||
m_console->registerCommand("Give"sv, "Gives the player the specified item, maxing it out"sv, ""sv,
|
[this](hecl::Console* console, const std::vector<std::string>& args) { quit(console, args); });
|
||||||
std::bind(&CMain::Give, this, std::placeholders::_1, std::placeholders::_2),
|
m_console->registerCommand(
|
||||||
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
"Give"sv, "Gives the player the specified item, maxing it out"sv, ""sv,
|
||||||
m_console->registerCommand("Remove"sv, "Removes the specified item from the player"sv, ""sv,
|
[this](hecl::Console* console, const std::vector<std::string>& args) { Give(console, args); },
|
||||||
std::bind(&CMain::Remove, this, std::placeholders::_1, std::placeholders::_2),
|
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
||||||
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
m_console->registerCommand(
|
||||||
|
"Remove"sv, "Removes the specified item from the player"sv, ""sv,
|
||||||
|
[this](hecl::Console* console, const std::vector<std::string>& args) { Remove(console, args); },
|
||||||
|
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
||||||
m_console->registerCommand(
|
m_console->registerCommand(
|
||||||
"Teleport"sv, "Teleports the player to the specified coordinates in worldspace"sv, "x y z [dX dY dZ]"sv,
|
"Teleport"sv, "Teleports the player to the specified coordinates in worldspace"sv, "x y z [dX dY dZ]"sv,
|
||||||
std::bind(&CMain::Teleport, this, std::placeholders::_1, std::placeholders::_2),
|
[this](hecl::Console* console, const std::vector<std::string>& args) { Teleport(console, args); },
|
||||||
(hecl::SConsoleCommand::ECommandFlags::Cheat | hecl::SConsoleCommand::ECommandFlags::Developer));
|
(hecl::SConsoleCommand::ECommandFlags::Cheat | hecl::SConsoleCommand::ECommandFlags::Developer));
|
||||||
m_console->registerCommand("God"sv, "Disables damage given by enemies and objects"sv, ""sv,
|
m_console->registerCommand(
|
||||||
std::bind(&CMain::God, this, std::placeholders::_1, std::placeholders::_2),
|
"God"sv, "Disables damage given by enemies and objects"sv, ""sv,
|
||||||
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
[this](hecl::Console* console, const std::vector<std::string>& args) { God(console, args); },
|
||||||
m_console->registerCommand("ListWorlds"sv, "Lists loaded worlds"sv, ""sv,
|
hecl::SConsoleCommand::ECommandFlags::Cheat);
|
||||||
std::bind(&CMain::ListWorlds, this, std::placeholders::_1, std::placeholders::_2),
|
m_console->registerCommand(
|
||||||
hecl::SConsoleCommand::ECommandFlags::Normal);
|
"ListWorlds"sv, "Lists loaded worlds"sv, ""sv,
|
||||||
m_console->registerCommand("Warp"sv, "Warps to a given area and world"sv, "[worldname] areaId"sv,
|
[this](hecl::Console* console, const std::vector<std::string>& args) { ListWorlds(console, args); },
|
||||||
std::bind(&CMain::Warp, this, std::placeholders::_1, std::placeholders::_2),
|
hecl::SConsoleCommand::ECommandFlags::Normal);
|
||||||
hecl::SConsoleCommand::ECommandFlags::Normal);
|
m_console->registerCommand(
|
||||||
|
"Warp"sv, "Warps to a given area and world"sv, "[worldname] areaId"sv,
|
||||||
|
[this](hecl::Console* console, const std::vector<std::string>& args) { Warp(console, args); },
|
||||||
|
hecl::SConsoleCommand::ECommandFlags::Normal);
|
||||||
|
|
||||||
InitializeSubsystems();
|
InitializeSubsystems();
|
||||||
x128_globalObjects.PostInitialize();
|
x128_globalObjects.PostInitialize();
|
||||||
|
|
Loading…
Reference in New Issue