R3voA3 / 3den-Enhanced

Official 3den Enhanced repository
https://steamcommunity.com/sharedfiles/filedetails/?id=623475643
Other
49 stars 30 forks source link

Feature: Virtual Arsenal Manager #262

Closed linkion closed 1 year ago

linkion commented 1 year ago

260 #258 #261

for real this time

linkion commented 1 year ago

Sorry for the closing and reopening of the same pull request, it's my first time using git.

Please do give me suggestions on what to do in the future.

R3voA3 commented 1 year ago

Sorry for the closing and reopening of the same pull request, it's my first time using git.

Please do give me suggestions on what to do in the future.

Don't worry, all good!

If you want to still work on this you can conver it to a draft image

R3voA3 commented 1 year ago

I added your branch to VS Code to keep working on it. Feel free to contribute to it as well. We can merge it when we are happy =)

linkion commented 1 year ago

How do you get hashmaps to work? I've defined _selectHashMap in the beginning, and I'm trying to set [_itemClass, [data]] from within ENH_fnc_virtualArsenalManager_switchNodeState

But getting _selectHashMap from within ENH_fnc_virtualArsenalManager_switchNodeState is returning any and not the hashmap.

I'm hoping to use _selectHashMap to save the selection to the profile and other stuff.

linkion commented 1 year ago

nvm, I just realized I have to set _selectHashMap to be a variable in uiNamespace.

R3voA3 commented 1 year ago

Probably because it's a private variable. uiNamespace should be fine.

linkion commented 1 year ago

Note: use this function to init ace Arsenal.

ace_arsenal_fnc_attributeInit

R3voA3 commented 1 year ago

Current state

image

linkion commented 1 year ago

I'm having an issue with testing, the GUI is half gone and this error keeps popping up. 20230407153233_1

linkion commented 1 year ago

Is there a cache for arma 3 mods? since I'm also having an issue where the mod isn't updating anymore when I build it.

R3voA3 commented 1 year ago

Did you sync your local repository? Otherwise I will check tomorrow morning

linkion commented 1 year ago

yeah, I also unpacked the PBO that's built and it is updated

linkion commented 1 year ago

It has to be an older version in my screenshot since when I click on a folder all the debug 3DEN notifications started popping up, even though I deleted those ages ago.

linkion commented 1 year ago

Just checked the function viewer ingame and none of the functions are being updated, even though the unpacked pbo shows that they should be.

Arma has to have some kind kind of cache or something, the mod loaded doesn't match the mod in the mods folder

linkion commented 1 year ago

fixed it, cfgFunctions wasn't updated to the new folder path.

linkion commented 1 year ago

so I've fixed what I thought would have worked with ace by instead editing the 3den attribute "ace_arsenal_attribute"

And I added a TODO, to add a second checkbox for whether to use BI virt arsenal since most groups who run with ace don't include BI arsenals.

So it would be nice if the GUI would detect if isClass(configFile >> "CfgPatches" >> "ace_arsenal") is true and then show the ace and BI arsenal checkboxes, else default to BI arsenal

linkion commented 1 year ago

Also, can we extend the window width-wise and have the right half to show the select item descriptions and stats for weapons and ammo, like what we see in the ace arsenal?

20230407184121_1 20230407184139_1 And to have the bottom half of that panel be another table view for compatible attachments like scopes, pointers, and magazines. 20230407184030_1

bask in the glory of my terrible ms paint skills

linkion commented 1 year ago

*for compatible items, they'll be separated by attachment type, not mod (scopes, pointers, bipods, magazines, etc.)

R3voA3 commented 1 year ago

So it would be nice if the GUI would detect if isClass(configFile >> "CfgPatches" >> "ace_arsenal") is true and then show the ace and BI arsenal checkboxes, else default to BI arsenal

Good idea.

Also, can we extend the window width-wise and have the right half to show the select item descriptions and stats for weapons and ammo, like what we see in the ace arsenal?

Stats are planned.

linkion commented 1 year ago

I almost finished up tvItemInit.

Need to set up selection/deselection and figure out a way to update the main table view to reflect what is currently selected.

Updating based on VAM_selectHashMap is the route I will go; this will also open up shortly to load the selection hashmap from the profile.

Currently, the accessories table view is just floating since I don't need to learn to work with GUIs.

R3voA3 commented 1 year ago

image

Not the prettiest thing in the world, but at least it symmetric and got space for your tree view at the bottom. Total height still exceeds screen which I'll fix next.

linkion commented 1 year ago

Currently exam season for me, and was pretty stretched thin

I've done some work in the attachments tree, now I'm gonna try to make it to be a full list when no weapon is selected, then split when there is one selected.

linkion commented 1 year ago

Getting a weird error with my new function Error GIAR pre stack size violation

I added functionality to load a _selectHashMap from an 3den object and I added it to arsenalPrototype to run when the window opens.

loadObject uses _display since it has a dialog popup for when ace mod is loaded to choose between using the ace arsenal attribute or BI arsenal attribute

R3voA3 commented 1 year ago

Getting a weird error with my new function Error GIAR pre stack size violation

I added functionality to load a _selectHashMap from an 3den object and I added it to arsenalPrototype to run when the window opens.

loadObject uses _display since it has a dialog popup for when ace mod is loaded to choose between using the ace arsenal attribute or BI arsenal attribute

So far I know this error is caused by a large array that has a wrong syntax. For example a missing bracket.

linkion commented 1 year ago

I'm having some issues with handleItemStats

It's not working... 🙃

The bars aren't changing positions, even with the random test

linkion commented 1 year ago

nvm, it's because the ctrl isn't being inputted as a parameter

linkion commented 1 year ago

I'm getting some weird stuff

In the function I'm getting the correct display but the _ctrlProgress_1 is incorrect and unrecognizable

Initial creation 107410_20230521193115_1 In handleItemStats 107410_20230521193118_1

linkion commented 1 year ago

figured it out, it's because the IDCPROGRESS* were not defined in the function

works now

linkion commented 1 year ago

Now all that's left is:

linkion commented 1 year ago

working on loading from selected object and ran into that arma 3 stores BI ammoBox in the weirdest way

107410_20230521214359_1

it's a string with which the array is within and calling toArray just spews out random numbers

linkion commented 1 year ago

fixed it by using [_object] call BIS_fnc_getVirtualWeaponCargo

working on loading from selected object and ran into that arma 3 stores BI ammoBox in the weirdest way

107410_20230521214359_1

it's a string with which the array is within and calling toArray just spews out random numbers

linkion commented 1 year ago

I think the UI is finally ready to get its config setup

Though I'd like to add frames around each table view

We'll work on loading from the profile later

linkion commented 1 year ago

idk why but _ctrlProgress_1 just doesn't want to listen to the commands

R3voA3 commented 1 year ago

Looking good. Unfortunately I dont have much time atm to work on this.

linkion commented 1 year ago

made ctrlAddEventHandler fire once on creation for AccTV since some weird glitch where clicking the same item in the main TV twice would break the AccTV

linkion commented 1 year ago

facepalm-really I just realized why my AccTV and ProgressBar1 don't listen to me.

they're both idc = 40... 😭

linkion commented 1 year ago

Also debating whether or not to remove stats since I don't think it's needed and just clutters the UI while being hard to implement

R3voA3 commented 1 year ago

Also debating whether or not to remove stats since I don't think it's needed and just clutters the UI while being hard to implement

We could create a sub-ui showing the stats if needed.

linkion commented 1 year ago

Huh, also, I ran a profiler, and with large modsets, the initialization takes likes 2 seconds.

Most egregious, the accessory TV init is taking 300 ms, which causes a lag between selecting weapons.

At least the switchNodeState is really fast.

linkion commented 1 year ago

Can the accTV asynchronously load somehow?

Everything about loading the accessories is slow, the retrieval of mags, the filling of the TV. While it isn't really needed immediately.

All except for retrieving the other compatible items using ENH_fnc_compatibleItems.

R3voA3 commented 1 year ago

Can the accTV asynchronously load somehow?

Everything about loading the accessories is slow, the retrieval of mags, the filling of the TV. While it isn't really needed immediately.

All except for retrieving the other compatible items using ENH_fnc_compatibleItems.

Which function handles that?

linkion commented 1 year ago

Can the accTV asynchronously load somehow? Everything about loading the accessories is slow, the retrieval of mags, the filling of the TV. While it isn't really needed immediately. All except for retrieving the other compatible items using ENH_fnc_compatibleItems.

Which function handles that?

fn_VAM_tvItemInit

linkion commented 1 year ago

I'm gonna try to call the individual add TVitems using spawn, but I'm having some issues with actually killing them when _displayName or _class is nil

linkion commented 1 year ago

There's also quite the bug where with large modsets, the mainTV just freezes and is un-interactable, which is frustrating

And many things could be causing it, like the large amount of items, the pictures, maybe the eventHandler, or it could be something else loading and taking up the scheduler

though all the other controls, like close, work

linkion commented 1 year ago

removed checking for ace being loaded to show checkboxes since it's not really required to apply the attribute

kept for loading objects though

linkion commented 1 year ago

The applyAttribute function is having some issues with the BI apply, ace works flawlessly

but BI only works if you were to apply and then open the attributes of the object.

I've tried setting the 3DENAttribute manually, but then I couldn't addAction for arsenal