-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated add weather changer and time changer and force lighting flash #79
Changes from 14 commits
4b5c9a2
2246b3c
6409ba3
b45dc7f
84c3f23
72fb7a7
cacc63e
dfb03a9
eca9f61
3b441eb
b93af8f
caa3cc9
1a36a76
785d1f4
dbaa767
ff64158
9de57be
006e926
fe706ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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[]{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe turn this into an unordered_map and i don't believe the inlining is required I could be wrong though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I will remeber the inlining. I am curious, why would an array be better here? I guess an array and unordered_map are pretty close to the same thing. |
||
|
||
"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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. turn into a command There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well not everything needs to be a command for example where you play the animations you could say to make the a command so yeah i think that is fine i put every thing else as a command because i thought it was right but i don't think that the time changer has to be a command or change weather has to it can be one but at the end it doesn't have too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do agree here, because there are not methods to pass arguments to commands(minutes, hours, etc) so that makes sense. |
||
{ | ||
NETWORK::_NETWORK_CLOCK_TIME_OVERRIDE(H, M, S, transition, freeze); | ||
} | ||
|
||
namespace yimmenu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. YimMenu |
||
{ | ||
namespace Features | ||
{ | ||
class forcelighting: public Command | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ForceLightning <- correct case and correct spelling |
||
{ | ||
public: | ||
using Command::Command; | ||
|
||
virtual void OnCall() override | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i dont known how this native works, but if it only works once, you could turn this into a looped command to make it happen more than just once per button press. just an idea tho |
||
{ | ||
MISC::FORCE_LIGHTNING_FLASH(); | ||
} | ||
|
||
}; | ||
|
||
|
||
static forcelighting _forcelighting{"forcelighting", "force lighting", "spawn lighting "}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ForceLightning |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include "world.hpp" | ||
#include "game/backend/FiberPool.hpp" | ||
#include "core/commands/Commands.hpp" | ||
#include "core/commands/HotkeySystem.hpp" | ||
#include "core/commands/LoopedCommand.hpp" | ||
#include "game/features/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>([] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be a good idea to mention that this is purely local |
||
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)); | ||
|
||
|
||
|
||
|
||
} | ||
|
||
} |
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(); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a
#pragma once
here