All garrisoned units should go hidden when garrisoned, and you should add two functions setVisible and setHidden. To use these functions in the gui, we will have to add new buttons but we can already start implementing them with hotkeys for test purposes. For example, when we Crtl-click on a icon template in the garrison panel, one of these units (the one with the greatest health ratio) would become visible if a spot is available for it, and when we Crtl-click on the ungarrison button (in the command panel) of a visible garrisoned unit, it becomes hidden. We could also add another function which would fill all the empty visible spots (although it will require an additional button in the gui).
All garrisoned units should go hidden when garrisoned, and you should add two functions setVisible and setHidden. To use these functions in the gui, we will have to add new buttons but we can already start implementing them with hotkeys for test purposes. For example, when we Crtl-click on a icon template in the garrison panel, one of these units (the one with the greatest health ratio) would become visible if a spot is available for it, and when we Crtl-click on the ungarrison button (in the command panel) of a visible garrisoned unit, it becomes hidden. We could also add another function which would fill all the empty visible spots (although it will require an additional button in the gui).