Modding Help Is it possible to "lock" the container?

Discussion in 'Starbound Modding' started by Amegatron, Feb 16, 2019.

  1. Amegatron

    Amegatron Scruffy Nerf-Herder

    Hello everyone!

    TLDR
    : The question is in subject. By locking I mean that the contents of a container (itemGrid) should become "read-only" at some moment (items can not be taken back, no more items can be put inside) for the player (all futher interactions with this contents should become possible only by code). It is OK to have this lock on per "open session" basis, I mean if a player closes the container, it resets to initial state (and items are returned back to the player).

    Sorry, could not find any suitable example here :/ Also "disabled" property of itemGrid does not work. Making itemGrid invisible still allows putting more items inside by shift-clicking in the inventory. Even if I knew how to override the "callback" at run-time it would not solve the problem, cause even when it is null, items still can be put inside by shift-clicking.

    I don't want to spoil much on the mod I wanna make, sorry, but in short it is a special station: a player first puts some items inside, after that he proceeds to the next stage of interaction by clicking a button and the contents must be locked in order to proceed, but preferably still visible to the user.

    I see some possible workarounds, including emulation of a container with separate itemSlots, as far as I understand, but using an itemGrid would be more preferable, since amount of slots should be high ideally and also for further calling container-related API functions. Nevertheless, any woking solutions/workarounds are welcome!

    Thanks!
     
    Last edited: Feb 16, 2019

Share This Page