NicooPasPris / nicoo_charcreator

Fivem Character Creator
47 stars 24 forks source link

Multiple issue point by point for character creator. #18

Open IronGiu opened 4 years ago

IronGiu commented 4 years ago

Hello, i explain multiple problem that i found in this script:

its all for the moment.

With a bit of reverse engineering I will try to solve the problems, if someone succeeds first let me know, thanks, if I succeed first I will put the fix here and make a pull request

IronGiu commented 4 years ago

Already tried to add -1 to the start of the items array, that do not work, about other issue i not seen a fix in other opend issues here on github, not for default opacity and color problem nor for the skin component to -1

IronGiu commented 4 years ago

i almost fixed all the problems, but did too much modification in order to adapt the script to my needs (included full clothes customization) to do a pull request, i try to post here all modification in order to make it work great:

Different colors in color palette, some colors in PanelColour.lua are wrong, i post here the right colors:

RageUI.PanelColour = {
    HairCut = {
        { 22, 19, 19 }, -- 0
        { 30, 28, 25 }, -- 1
        { 76, 56, 45 }, -- 2
        { 69, 34, 24 }, -- 3
        { 123, 59, 31 }, -- 4
        { 149, 68, 35 }, -- 5
        { 165, 87, 50 }, -- 6
        { 175, 111, 72 }, -- 7
        { 159, 105, 68 }, -- 8
        { 198, 152, 108 }, -- 9
        { 213, 170, 115 }, -- 10
        { 223, 187, 132 }, -- 11
        { 202, 164, 110 }, -- 12
        { 238, 204, 130 }, -- 13
        { 229, 190, 126 }, -- 14
        { 250, 225, 167 }, -- 15
        { 187, 140, 96 }, -- 16
        { 163, 92, 60 }, -- 17
        { 144, 52, 37 }, -- 18
        { 134, 21, 17 }, -- 19
        { 164, 24, 18 }, -- 20
        { 195, 33, 24 }, -- 21
        { 221, 69, 34 }, -- 22
        { 229, 71, 30 }, -- 23
        { 208, 97, 56 }, -- 24
        --{ 113, 79, 38 }, -- 25 not in right position this put all color after this 1 color behind to the real color
        { 132, 107, 95 }, -- 26
        { 185, 164, 150 }, -- 27
        { 218, 196, 180 }, -- 28
        { 247, 230, 217 }, -- 29
        { 102, 72, 93 }, -- 30
        { 162, 105, 138 }, -- 31
    { 118, 64, 87 }, -- 32
        { 239, 61, 200 }, -- 33
        { 255, 69, 152 }, -- 34
        { 255, 178, 191 }, -- 35
        { 12, 168, 146 }, -- 36
        { 8, 146, 165 }, -- 37
        { 11, 82, 134 }, -- 38
        { 118, 190, 117 }, -- 39
        { 52, 156, 104 }, -- 40
        { 22, 86, 85 }, -- 41
        { 152, 177, 40 }, -- 42
        { 127, 162, 23 }, -- 43
    { 72, 119, 44 }, -- 44
        { 238, 178, 16 }, -- 45
    { 241, 200, 98 }, -- 46
        { 247, 157, 15 }, -- 47
        { 243, 143, 16 }, -- 48
        { 231, 70, 15 }, -- 49
        { 255, 101, 21 }, -- 50
        { 254, 91, 34 }, -- 51
        { 252, 67, 21 }, -- 52
        { 196, 12, 15 }, -- 53
        { 143, 10, 14 }, -- 54
        { 44, 27, 22 }, -- 55
        { 80, 51, 37 }, -- 56
        { 98, 54, 37 }, -- 57
        { 60, 31, 24 }, -- 58
        { 69, 43, 32 }, -- 59
        { 8, 10, 14 }, -- 60
    { 0, 0, 0 }, -- 61 
        { 212, 185, 158 }, -- 62
        { 213, 170, 115 }, -- 63
    },
}

To set component to -1, modifications are various, i hope to post all here and do not forgot anything:

in UIList.lua under the function RageUI.List

change this: ListText = (type(Items[Index]) == "table") and string.format("← %s →", Items[Index].Name) or string.format("← %s →", Items[Index]) or "NIL"

with this:

local ListText = ""
                if Items[Index] == nil then
                    ListText = (type(Items[Index]) == "table") and string.format("← %s →", Items[Index].Name) or string.format("← %s →", "NO") or "NO"
                else
                    ListText = (type(Items[Index]) == "table") and string.format("← %s →", Items[Index].Name) or string.format("← %s →", Items[Index]) or "NO"
                end

In the same function, change this:

Index = Index - 1
                    if Index < 1 then
                        Index = #Items
                    end

with this:

Index = Index - 1
                    if Index < 0 then
                        Index = #Items
                    end

little bit below change this:

Index = Index + 1
                    if Index > #Items then
                        Index = 1
                    end

with this:

Index = Index + 1
                    if Index > #Items then
                        Index = 0
                    end

Then set all the default index that you want that start from "NO" in client.lua under Apperance to 0 (almost all except for eye_color and hair_color (if you applied Twiitchter color patch))

Then set index to 1 if 0 in menu.lua for elements that not have a 0 value, for example:

in manu.lua under Citizen.CreateThread(function()

change this: -- Sexe

                RageUI.List(Locales[Config.Locale]['gender_item'], {Locales[Config.Locale]['gender_male'], Locales[Config.Locale]['gender_female']}, actionIndex, Locales[Config.Locale]['gender_item_desc'], {}, true, function(Hovered, Active, Selected, Index)
                end, function(Index, Item)
                    actionIndex = Index
                    updateSex(Index-1)
                end)

With this:

-- Sexe
                RageUI.List(Locales[Config.Locale]['gender_item'], {Locales[Config.Locale]['gender_male'], Locales[Config.Locale]['gender_female']}, actionIndex, Locales[Config.Locale]['gender_item_desc'], {}, true, function(Hovered, Active, Selected, Index)
                end, function(Index, Item)
                    if Index == nil or Index == 0 then
                        Index = 1
                    end
                    actionIndex = Index
                    updateSex(Index-1)
                end)

To fix another, not listed issue that i found (parents start from name but there are another photo) make parent too start from "no" this is esay, in menu.lua, at very beginning (first line)

change this: actionIndex, motherAct, fatherAct, clotheAct = 1, 1, 1, 1

with this: actionIndex, motherAct, fatherAct, clotheAct = 1, 0, 0, 1

Thats all for now, must to fix some other problems, like wrong actions in face when you modify "nose" text say "up, down, large, tight" but its wrong because that action make it "up, down, broken left, broken right"

Must to fix default opecity to 100%

Must to fix controls disabled during character creation

I alreadt fixed most of that, but i have to check how to give you that modification based on this resource, i maded too musch modifications, if i find a way to put that modification here, i update this post

cjeje84 commented 4 years ago

Bonjour auriez vous svp les fichier modifier je vous remercie de tous ce que vous faites bonne journée a vous.