Skip to content

Commit

Permalink
updated add weather changer and time changer and force lighting flash (
Browse files Browse the repository at this point in the history
…#79)

* Update Menu.cpp

* Add files via upload

* Update world.cpp

* Create weather.hpp

* Update weather.hpp

* Update world.cpp

* Update world.hpp

* Update world.cpp

* Update world.cpp

* Update weather.hpp

* Update world.cpp

* Update weather.hpp

added the force light that i thought i added

* Update world.cpp

* Update weather.hpp

* Update weather.hpp

* Update weather.hpp

* Update weather.hpp

* Update world.cpp

* Update world.hpp
  • Loading branch information
theofficialhackclean authored May 28, 2024
1 parent 8ed259c commit f0c61ae
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/frontend/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ namespace YimMenu
Menu::Font::g_ChildTitleFont = IO.Fonts->AddFontFromMemoryTTF(const_cast<std::uint8_t*>(Fonts::MainFont), sizeof(Fonts::MainFont), Menu::Font::g_ChildTitleFontSize, &FontCfg);
UIManager::SetOptionsFont(Menu::Font::g_OptionsFont);
}
}
}
60 changes: 60 additions & 0 deletions src/game/frontend/submenus/World/weather.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

#include "core/commands/LoopedCommand.hpp"
#include "game/features/Features.hpp"
#include "game/rdr/Enums.hpp"
#include "game/rdr/Natives.hpp"

inline const char* WeatherTypes[]{

"BLIZZARD",
"CLOUDS",
"DRIZZLE",
"FOG",
"GROUNDBLIZZARD",
"HAIL",
"HIGHPRESSURE",
"HURRICANE",
"MISTY",
"OVERCAST",
"OVERCASTDARK",
"RAIN",
"SANDSTORM",
"SHOWER",
"SLEET",
"SNOW",
"SNOWLIGHT",
"SUNNY",
"THUNDER",
"THUNDERSTORM",
"WHITEOUT",
};

void ChangeWeather(const char* weather)
{
MISC::_SET_OVERRIDE_WEATHER(MISC::GET_HASH_KEY(weather));
}
void ChangeTime(int H = 12, int M = 0, int S = 0, int transition = 0, bool freeze = false)
{
NETWORK::_NETWORK_CLOCK_TIME_OVERRIDE(H, M, S, transition, freeze);
}

namespace YimMenu
{
namespace Features
{
class ForceLightning: public Command
{
public:
using Command::Command;

virtual void OnCall() override
{
MISC::FORCE_LIGHTNING_FLASH();
}

};


static ForceLightning _forcelighting{"forcelighting", "force lighting", "spawn's lighting "};
}
}
75 changes: 75 additions & 0 deletions src/game/frontend/submenus/world.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#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 "game/backend/ScriptMgr.hpp"
#include <game/rdr/Natives.hpp>
#include <imgui.h> // Include for ImGui
#include <memory> // Include for std::make_shared
#include "features.hpp"

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();
}
}));


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




}

}
11 changes: 11 additions & 0 deletions src/game/frontend/submenus/world.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "core/frontend/manager/UIManager.hpp"

namespace YimMenu::Submenus
{
class World : public Submenu
{
public:
World();
};
}

0 comments on commit f0c61ae

Please sign in to comment.