-
Notifications
You must be signed in to change notification settings - Fork 68
Feature/outfit editor #140
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
base: enhanced
Are you sure you want to change the base?
Conversation
for cmake to find the lib* you just have to hit control s on the file |
this should be a great feature if its implented correctly! |
This comment was marked as spam.
This comment was marked as spam.
CMakeLists.txt
Outdated
@@ -14,7 +14,11 @@ include(cmake/minhook.cmake) | |||
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src") | |||
file(GLOB_RECURSE SRC_FILES | |||
"${SRC_DIR}/**.hpp" | |||
"${SRC_DIR}/**.cpp" | |||
"${SRC_DIR}/game/backend/OutfitManager.hpp" |
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.
Please revert this
src/game/backend/OutfitManager.cpp
Outdated
|
||
#include "game/gta/Natives.hpp" | ||
|
||
namespace YimMenu |
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.
You don't need an outfit manager, just put all the necessary logic under OutfitEditor and delete this file
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.
Or maybe add them to the Ped
class
src/game/frontend/GUI.cpp
Outdated
@@ -96,4 +97,77 @@ namespace YimMenu | |||
ScriptMgr::Yield(); | |||
} | |||
} | |||
|
|||
void GUI::ShowOutfitAndPropEditor() |
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.
You shouldn't add UI stuff to GUI.cpp
. That's what the submenu files are for
src/game/frontend/GUI.cpp
Outdated
|
||
void GUI::ShowOutfitAndPropEditor() | ||
{ | ||
auto ped = PLAYER::PLAYER_PED_ID(); |
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.
Use Self::GetPed
instead
src/game/frontend/GUI.cpp
Outdated
auto ped = PLAYER::PLAYER_PED_ID(); | ||
if (!ENTITY::DOES_ENTITY_EXIST(ped)) | ||
{ | ||
Notifications::Show("Error", "Player not found", NotificationType::Error); |
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.
Use ImGui::TextDisabled
to tell the user this
src/game/frontend/GUI.cpp
Outdated
return; | ||
} | ||
|
||
ImGui::Begin("Outfit and Prop Editor"); |
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.
You don't need a separate window
OutfitEditor::OutfitEditor() : | ||
Submenu::Submenu("Outfit Editor") | ||
{ | ||
// Create a shared_ptr for the category |
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.
Make sure all UI stuff goes here and not in a separate window. The seemingly AI-generated comment above this line isn't very helpful
namespace YimMenu::Submenus | ||
{ | ||
OutfitEditor::OutfitEditor() : | ||
Submenu::Submenu("Outfit Editor") |
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.
Actually, on second thought, this shouldn't be a submenu at all. Add this as a new category under self (but still create a separate file)
src/game/frontend/GUI.cpp
Outdated
const int maxDrawable = OutfitManager::GetMaxDrawable(i); | ||
int maxTexture = OutfitManager::GetMaxTexture(i, drawable); | ||
|
||
const char* slotName = (i < 12) ? outfitSlotNames[i] : "Unknown"; |
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.
Unnecessary check since i
can never exceed 11
src/game/frontend/GUI.cpp
Outdated
const char* propName = propNames[i]; | ||
|
||
// Precompute labels | ||
std::string drawableLabel = std::string(propName) + " Drawable##" + std::to_string(i); |
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.
Slightly nitpicky but you can replace all your string concatenations with std::format
and also get rid of the "cache" and "precompute" stuff because it still gets calculated every tick
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.
last one didn't have the cache and it wasn't snappy , it had a delay without caching but alright I'll try to implement these changes .
Reorganized into a dedicated category under the Self menu (not a separate submenu). Some Error handling and more fixes .
b66c55c
to
d9fefd3
Compare
is there a way to implement a tattoo editor ?. i looked into but nothing seems to work,. also they dont overlap |
I was wondering that myself, have 2 check |
This is a great feature IF it is properly implemented. What I mean by this is, YimMenu V1 had an outfit editor, it was a bit buggy and not labeled correctly, also, it was stuck in one position on the screen (So you could not see your character with the menu opened) resulting in having to show/hide the menu for each outfit item you changed. I changed this in YimMenu V1 (Chronix) so the outfit editor is movable/resizable and fixed all the mismatched labeling as well as added tabs (Clothing/Accessories) for a better user experience. As far as the labeling went, the original outfit editor was, to my own guess, built in story mode, which made the clothing item labels "correct" in the menu, but for MP, they were wrong. https://github.com/Deadlineem/Chronix/blob/main/src/views/self/view_outfit_editor.cpp |
Before moving it under self this had separate window and it was editable but now it's under self and follows top UI properties which is fine , also the labels can be edited but for me they are fine rn , I didn't want to force outfits so if game doesn't like ur selection ( invis body ) it will automatically fix it after couple of seconds , I added Outfit Preset Saving in my local branch plus tattoo editing but tattoo isn't working rn , does not draw . about the preset saving , since it wasn't persistent when I reloaded the game I didn't push it . |
To make it persist you need to save the outfit files in .json like yimv1 does (saved_outfits folder) and then the persist outfit would apply on a loop from that ,json outfit. I personally did not like having the editor in the main UI on YimV1 bc it was so bulky, but i think it'd be ok with this UI as it doesn't overlay over your character. |
I mean invisible clothing isn't a big deal and I doubt anyone actually likes how it looks, I personally think the loop should be left out of it. No need to please the public lobby rats. The game also already has a saved outfits option, the source is already out there so I doubt it would be difficult to pull from that instead of JSON. |
yeah exactly what I was going for , since game already has outfit saving system it's not actually needed and about the invis parts or exclusive mask hat combo or long sleeves , I don't want to force a loop of applying outfit . |
This comment was marked as off-topic.
This comment was marked as off-topic.
Fixed Ui And Added Randomize Outfit Button
maybe this pr will be enough ? BegaMetaZone#1 |
feat(OutfitEditor): Update
public: | ||
static std::shared_ptr<YimMenu::Category> CreateCategory(); | ||
|
||
static void SetOutfitSlot(int slot, int drawable, int texture); |
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.
These don't need to be in the header file
class OutfitEditor | ||
{ | ||
public: | ||
static std::shared_ptr<YimMenu::Category> CreateCategory(); |
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.
Should be CreateOutfitsMenu
instead, and get rid of the OutfitEditor namespace
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.
Sure I'm working on it
Done ✅ BegaMetaZone#2 |
added outfit slot editing feature with the help of CoPilot , excuse my rusted skills I learned coding with pascal , UI integration might not be the best , again sry . I couldn't figure out why cmakelist didn't found the libs so I had to ..