mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:20:54 +01:00
42 lines
711 B
C++
42 lines
711 B
C++
|
|
#include "Admin.h"
|
||
|
|
#include <imgui.h>
|
||
|
|
#include <AdminApp.h>
|
||
|
|
|
||
|
|
Admin::Admin()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Admin::OnEnable()
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Admin::OnDisable()
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Admin::Update(AdminApp& aApp)
|
||
|
|
{
|
||
|
|
if (ImGui::Button("Shutdown Server"))
|
||
|
|
ImGui::OpenPopup("Shutdown Server Dialog");
|
||
|
|
|
||
|
|
if (ImGui::BeginPopupModal("Shutdown Server Dialog"))
|
||
|
|
{
|
||
|
|
ImGui::Text("Are you sure you want to shutdown the server?");
|
||
|
|
|
||
|
|
if (ImGui::Button("Yes"))
|
||
|
|
{
|
||
|
|
aApp.SendShutdownRequest();
|
||
|
|
ImGui::CloseCurrentPopup();
|
||
|
|
}
|
||
|
|
|
||
|
|
ImGui::SameLine();
|
||
|
|
|
||
|
|
if (ImGui::Button("No"))
|
||
|
|
ImGui::CloseCurrentPopup();
|
||
|
|
|
||
|
|
ImGui::EndPopup();
|
||
|
|
}
|
||
|
|
}
|