GIGA REFACTOR
This commit is contained in:
@@ -9,7 +9,7 @@ SummonMenu::SummonMenu(client::Client* client) : GuiWidget(client), m_MenuOpened
|
||||
m_Values.fill(0);
|
||||
}
|
||||
|
||||
void SummonMenu::render() {
|
||||
void SummonMenu::Render() {
|
||||
if (m_MenuOpened) {
|
||||
ImGui::Begin("Summon", &m_MenuOpened);
|
||||
ImTextureID my_tex_id = ImGui::GetIO().Fonts->TexID;
|
||||
@@ -25,7 +25,7 @@ void SummonMenu::render() {
|
||||
ImGui::SameLine();
|
||||
ImGui::PushID(i);
|
||||
if (ImGui::InputInt("", m_Values.data() + i, 1, 10)) {
|
||||
setSummonMax(i);
|
||||
SetSummonMax(i);
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -43,7 +43,7 @@ void SummonMenu::render() {
|
||||
ImGui::SameLine();
|
||||
ImGui::PushID(i);
|
||||
if (ImGui::InputInt("", m_Values.data() + i, 1, m_MobTypeCount)) {
|
||||
setSummonMax(i);
|
||||
SetSummonMax(i);
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
@@ -59,14 +59,14 @@ void SummonMenu::render() {
|
||||
mobSent.push_back(mobSend);
|
||||
}
|
||||
}
|
||||
m_Client->sendMobs(mobSent);
|
||||
m_Client->SendMobs(mobSent);
|
||||
m_Values.fill(0);
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
void SummonMenu::setSummonMax(int valueIndex) {
|
||||
void SummonMenu::SetSummonMax(int valueIndex) {
|
||||
int& value = m_Values[valueIndex];
|
||||
value = std::max(0, value);
|
||||
value = std::min(12, value);
|
||||
|
||||
Reference in New Issue
Block a user