Skip to content

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

Open
wants to merge 4 commits into
base: enhanced
Choose a base branch
from

Conversation

BegaMetaZone
Copy link

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 ..

@Psifter
Copy link
Contributor

Psifter commented Apr 10, 2025

for cmake to find the lib* you just have to hit control s on the file

@yigitboi07
Copy link

this should be a great feature if its implented correctly!

@CSY0N

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this


#include "game/gta/Natives.hpp"

namespace YimMenu
Copy link
Collaborator

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

Copy link
Collaborator

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

@@ -96,4 +97,77 @@ namespace YimMenu
ScriptMgr::Yield();
}
}

void GUI::ShowOutfitAndPropEditor()
Copy link
Collaborator

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


void GUI::ShowOutfitAndPropEditor()
{
auto ped = PLAYER::PLAYER_PED_ID();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Self::GetPed instead

auto ped = PLAYER::PLAYER_PED_ID();
if (!ENTITY::DOES_ENTITY_EXIST(ped))
{
Notifications::Show("Error", "Player not found", NotificationType::Error);
Copy link
Collaborator

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

return;
}

ImGui::Begin("Outfit and Prop Editor");
Copy link
Collaborator

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
Copy link
Collaborator

@maybegreat48 maybegreat48 Apr 10, 2025

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")
Copy link
Collaborator

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)

const int maxDrawable = OutfitManager::GetMaxDrawable(i);
int maxTexture = OutfitManager::GetMaxTexture(i, drawable);

const char* slotName = (i < 12) ? outfitSlotNames[i] : "Unknown";
Copy link
Collaborator

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

const char* propName = propNames[i];

// Precompute labels
std::string drawableLabel = std::string(propName) + " Drawable##" + std::to_string(i);
Copy link
Collaborator

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

Copy link
Author

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 .

BegaMetaZone and others added 2 commits April 12, 2025 00:36
Reorganized into a dedicated category under the Self menu (not a separate submenu).
Some Error handling and more fixes .
@BegaMetaZone BegaMetaZone force-pushed the feature/Outfit-Editor branch from b66c55c to d9fefd3 Compare April 11, 2025 22:16
@xAzurrr
Copy link

xAzurrr commented Apr 12, 2025

is there a way to implement a tattoo editor ?. i looked into but nothing seems to work,. also they dont overlap

@BegaMetaZone
Copy link
Author

I was wondering that myself, have 2 check

@Deadlineem
Copy link

Deadlineem commented Apr 13, 2025

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

@BegaMetaZone
Copy link
Author

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 .

@Deadlineem
Copy link

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.

@qwertyuiop11243
Copy link

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.

@BegaMetaZone
Copy link
Author

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 .

@CSY0N

This comment was marked as off-topic.

Fixed Ui And Added Randomize Outfit Button
@L7NEG
Copy link

L7NEG commented Apr 14, 2025

maybe this pr will be enough ? BegaMetaZone#1

public:
static std::shared_ptr<YimMenu::Category> CreateCategory();

static void SetOutfitSlot(int slot, int drawable, int texture);
Copy link
Collaborator

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();
Copy link
Collaborator

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

Copy link

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

@L7NEG
Copy link

L7NEG commented Apr 16, 2025

Done ✅ BegaMetaZone#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants