Skip to content

Commit

Permalink
Fix duplicate (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEcza authored Jun 1, 2024
1 parent 871af6f commit 6af51c0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 94 deletions.
66 changes: 59 additions & 7 deletions src/game/frontend/submenus/World.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#include "World.hpp"

#include "world.hpp"
#include "game/backend/FiberPool.hpp"
#include "core/commands/Commands.hpp"
#include "core/commands/HotkeySystem.hpp"
#include "core/commands/LoopedCommand.hpp"
#include "World/weather.hpp"
#include "game/frontend/items/Items.hpp"
#include "util/Ped.hpp"
#include "game/backend/ScriptMgr.hpp"
#include <game/rdr/Natives.hpp>
#include "util/libraries/PedModels.hpp"

#include "util/Ped.hpp"

namespace YimMenu::Submenus
{
Expand Down Expand Up @@ -91,6 +95,52 @@ namespace YimMenu::Submenus
World::World() :
Submenu::Submenu("World")
{
auto main = std::make_shared<Category>("Main");
auto weather = std::make_shared<Category>("Weather");


main->AddItem(std::make_shared<ImGuiItem>([] {
static std::string hour, minute, second;
InputTextWithHint("Hour", "Enter Hour", &hour).Draw();
InputTextWithHint("Minute", "Enter Minute", &minute).Draw();
InputTextWithHint("Second", "Enter Second", &second).Draw();
if (ImGui::Button("Change Time"))
{
int h = std::stoi(hour);
int m = std::stoi(minute);
int s = std::stoi(second);
FiberPool::Push([=] {
ChangeTime(h, m, s);
});
}
}));



weather->AddItem(std::make_shared<ImGuiItem>([] {
static const char* current_weather = WeatherTypes[0]; // Default weather
if (ImGui::BeginCombo("Weather Types", current_weather))
{
for (auto& weather_type : WeatherTypes)
{
bool is_selected = (current_weather == weather_type);
if (ImGui::Selectable(weather_type, is_selected))
{
current_weather = weather_type;
FiberPool::Push([=] {

ChangeWeather(weather_type);
});
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
}));



auto spawners = std::make_shared<Category>("Spawners");
auto pedSpawnerGroup = std::make_shared<Group>("Ped Spawner", GetListBoxDimensions());

Expand All @@ -99,7 +149,9 @@ namespace YimMenu::Submenus
}));

spawners->AddItem(pedSpawnerGroup);

AddCategory(std::move(spawners));
main->AddItem(std::make_shared<CommandItem>("forcelighting"_J));
AddCategory(std::move(main));
AddCategory(std::move(weather));
}
}

}
2 changes: 1 addition & 1 deletion src/game/frontend/submenus/World.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ namespace YimMenu::Submenus
public:
World();
};
}
}
75 changes: 0 additions & 75 deletions src/game/frontend/submenus/world.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions src/game/frontend/submenus/world.hpp

This file was deleted.

0 comments on commit 6af51c0

Please sign in to comment.