Uniform painter

  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Uniform painter

« posted: Jul 15, 2015, 08:56 PM »
So i'm working on my uniform painter for it to show the texture list from storeConfig.sqf.
I got it to work, but now i'm having trouble on the selection. I cannot figure out how to get the selection into the next script. As soon as I know how to get the selection array or part over to the next script I will be able to script the rest. Any help? :)

When the select button is pressed this part of the script is run:
https://github.com/LouDnl/ArmA3_Wasteland.Altis/blob/NL-United/addons/Painter/dialog/UniformPainter_mainMenu.hpp#L71-L80

This is what it looks like now. It shows the textures with preview picture.
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.0
// @file Name: UniformPainter_ownerMenu.sqf
// @file Author: LouD / Cael817 for original script
// @file Description: Paint script

#define Paint_Menu_option 17001
disableSerialization;

private ["_start","_panelOptions","_Paint_select","_displayPaint"];
_uid = getPlayerUID player;
if (!isNil "_uid") then
{
_start = createDialog "Paint_Menu";

_displayPaint = uiNamespace getVariable "Paint_Menu";
_colorlist = _displayPaint displayCtrl Paint_Menu_option;
lbClear _colorlist;
_colorlist lbSetCurSel -1;

_colorsArray  = [];
_cfgColors = call colorsArray;
reverse _cfgColors;

{

_class = _x select 0;
_texs = _x select 1;

if (_class == "All") then
{
{
_color = _x select 0;
_tex = _x select 1;
_added = false;

if (typeName _tex == "ARRAY") then
{
_existingTex = [_colorsArray, _color, ""] call fn_getFromPairs;

if (typeName _existingTex == "ARRAY") then
{
{
[_existingTex, _x select 0, _x select 1] call fn_setToPairs;
} forEach _tex;
};
};

if (!_added) then
{
[_colorsArray, _color, _tex] call fn_setToPairs;
};
} forEach _texs;
};
} forEach _cfgColors;

{
_tex = _x select 1;
_colorlistIndex = _colorlist lbAdd (_x select 0);
_colorlist lbSetPicture [_colorlistIndex, if (typeName _tex == "ARRAY") then { _tex select 0 select 1 } else { _tex }];
_colorlist lbSetData [_colorlistIndex, str _tex];
} forEach _colorsArray;

};

This is how it was:
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.0
// @file Name: UniformPainter_ownerMenu.sqf
// @file Author: LouD / Cael817 for original script
// @file Description: Paint script

#define Paint_Menu_option 17001
disableSerialization;

private ["_start","_panelOptions","_Paint_select","_displayPaint"];
_uid = getPlayerUID player;
if (!isNil "_uid") then {
_start = createDialog "Paint_Menu";

_displayPaint = uiNamespace getVariable "Paint_Menu";
_Paint_select = _displayPaint displayCtrl Paint_Menu_option;

_panelOptions =
[
"Bloodshot ($ 500)",
"Orange Camo ($ 500)",
"Pink Camo ($ 500)",
"Red Camo ($ 500)",
"Digital ($ 500)",
"Digital Black ($ 500)",
"Digital Desert ($ 500)",
"Digital Wood ($ 500)",
"Drylands ($ 500)",
"Hex ($ 500)",
"Sand ($ 500)",
"Swamp ($ 500)",
"Urban ($ 500)",
"Woodland ($ 500)",
"Woodland Dark ($ 500)",
"Woodland Tiger ($ 500)",
"Hello Kitty ($ 500)"
];

{
_Paint_select lbAdd _x;
} forEach _panelOptions;
};

Re: Uniform painter

« Reply #1 posted: Jan 24, 2016, 03:07 PM »
Ive been trying to incorporate the Uniform Painter into my mission based upon your github but I get the following error:

Resource Paint_menu not found

Any ideas?

Re: Uniform painter

« Reply #2 posted: Apr 14, 2016, 09:00 AM »
I have players on my server reporting a bug regarding persistent uniform/backpack textures.

If players disconnect the server with custom uniform/backpack textures and then rejoin, they will become invisible, as shown in the attachment.

I know LouD has been inactive for some time. But can someone else have a look at this? This feature is quite popular among players.

The mission files my server uses: https://github.com/Jermin/ArmA3_Wasteland.Altis/tree/dev

Re: Uniform painter

« Reply #3 posted: Apr 14, 2016, 10:04 AM »
More screenshots are attached.

The transparent parts are the parts where custom textures are applied, mostly uniforms and backpacks.

Re: Uniform painter

« Reply #4 posted: Apr 14, 2016, 04:03 PM »
I'm wonder whether it might be caused by this commit.

Update: I reverted this commit but the issue still remains.  :(

Re: Uniform painter

« Reply #5 posted: Apr 15, 2016, 12:24 PM »
Had a look into the database. It seems the back slashes in the texture path are somehow stripped when players are saved.

Code: [Select]
select Name as PlayerSave_Name, UniformTexture as PlayerInfo_UniformTexture, BackpackTexture as PlayerInfo_BackpackTexture, LastModified as PlayerSave_LastModified from PlayerSave ps inner join PlayerInfo pi on ps.PlayerUID=pi.UID where pi.Name='Jermin';
+-----------------+-------------------------------------------+-------------------------------------------+-------------------------+
| PlayerSave_Name | PlayerInfo_UniformTexture                 | PlayerInfo_BackpackTexture                | PlayerSave_LastModified |
+-----------------+-------------------------------------------+-------------------------------------------+-------------------------+
| Jermin          | "clientimagesvehicleTextureswooddark.paa" | "clientimagesvehicleTextureswooddark.paa" | 2016-04-15 17:54:35     |
| Jermin          | ""                                        | ""                                        | 2015-06-08 20:47:34     |
+-----------------+-------------------------------------------+-------------------------------------------+-------------------------+
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2288

Re: Uniform painter

« Reply #6 posted: Apr 16, 2016, 08:58 PM »
Gotta remove the backslash ( \ ) from "Strip Custom Chars" under [insertOrUpdatePlayerSave] in a3wasteland.ini:

https://github.com/A3Wasteland/Release_Files/blob/f6d6ac653f24f86e5a9d6739371535bcf4d879b2/extDB/sql_custom_v2/a3wasteland.ini#L111

Re: Uniform painter

« Reply #7 posted: Apr 16, 2016, 09:49 PM »
Gotta remove the backslash ( \ ) from "Strip Custom Chars" under [insertOrUpdatePlayerSave] in a3wasteland.ini:

https://github.com/A3Wasteland/Release_Files/blob/f6d6ac653f24f86e5a9d6739371535bcf4d879b2/extDB/sql_custom_v2/a3wasteland.ini#L111
Thanks a lot! Will test and report back.

Sent from my L50t using Tapatalk

Re: Uniform painter

« Reply #8 posted: Apr 17, 2016, 08:36 AM »
Works like a charm!  :)

Re: Uniform painter

« Reply #9 posted: May 10, 2017, 11:52 PM »
Hi
Got a problem with saving to database, i purchase uniform painting and on restarts they are gone. Does anybody have any idea ? running extdb3.