Author Topic: [REQ] / [QUESTION] - quick move to allianceinventory [postponed]  (Read 267 times)

Bailung

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    2
    • View Profile
Hello there Avorians,

I started reading into mods only recently and I didnt found anything about this nor a mod supporting this allready so I guess I will just ask.


Given:
You can move turrets into the researchstation by right clicking them, as far as I understood the code (I know batch / bash / Python and a little pearl but no LUA - )= ) There is a function called onInventoryClicked? 

code:
Spoiler: show

from: ...\Steam\steamapps\common\Avorion\data\scripts\entity\merchants\researchstation.lua

Code: [Select]

inventory.onClickedFunction = "onInventoryClicked"
~~~
function onInventoryClicked(selectionIndex, kx, ky, item, button)

    if button == 2 or button == 3 then
        -- fill required first, then, once it's full, fill optional
        local items = required:getItems()
        if tablelength(items) < 3 then
            moveItem(item, inventory, required, ivec2(kx, ky), nil)

            refreshButton()
            results:clear()
            results:addEmpty()
            return
        end

        local items = optional:getItems()
        if tablelength(items) < 2 then
            moveItem(item, inventory, optional, ivec2(kx, ky), nil)

            refreshButton()
            results:clear()
            results:addEmpty()
            return
        end
    end
end


So the first problem is, I cant find the player inventory as lua file, neither could I find the alliance one.

We would need to move them via shift-leftctrl since ctrl-leftclick and rightclick are taken
Is someone able to get this done?

extra:
Maybe even add a button "move all" to the UI? (I've marked good positions for such buttons)
PS: I had to scale down the quality just a bit in order to get it smaller than 128kb


PS: While writing this I found (https://www.avorion.net/forum/index.php/topic,4495.msg24339.html#msg24339)
But the question never got answerd nor is it fleshed out that much.


Thanks for your time
« Last Edit: December 30, 2018, 04:05:59 PM by Bailung »



Amriel

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
on: December 29, 2018, 01:02:50 AM
Best I can tell, the basic UI resources (i.e. not station or ship related) are baked into the .exe file. Until/unless the devs want to break those out into external scripts, our best bet for doing this is probably rebuilding the whole alliance transfer window from scratch in a separate mod, using inventory add/remove functions like are found in researchstation.lua.

In this case, it's probably better to petition the devs to add the functionality (or, ideally, inventory multi-selection), as it's probably a lot fewer lines of code for them to do it.




Bailung

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    2
    • View Profile
on: December 30, 2018, 04:05:22 PM
Thanks for the answer, this explains why I coudnt find it and why nobody has done anything against it.
Can we mark this as "postponed/ as of now not possible"?