I would like to work on a ui mod, a group manager. I'm not too crazy, so i planned to start whith something basic. This group manager should display in the UI : the groups which have been created their composition (which unit, and how many) I would like also to have a basic interaction with the UI: single click on a group => select the group double click on the group => select the group and center the camera above it the problem is that i don't find the object to handle the groups, the units and the camera... Do someone know what object return the current created group ? and if this object exist what are the methods to return the units ? How can we apply a selection ? and finally how to move the camera ?
I think a good start would be to read the whole live_game.js just to get an idea of how the whole ingame ui works. It definitely contains handling of some camera interaction and handling of selection events. I think it should be possible to capture what groups are created in those event handlers. Also you might be able to select the groups again if you can figure out what happens when the hotkeys for "select group" are pressed. Basically you'd need to simulate that when the button is clicked. However I am not sure if this is all possible with an ui mod right now.
HTML: <div class="div_unit_selection_cont" data-bind="visible: showSelectionBar"> <div> <div class="div_current_selection_cont"> <!-- ko foreach: selectionList --> <div class="div_unit_selection" data-bind="click: function (data, event) { $parent.onSelectionDisplayClick($index(), event) }"> <a href="#"> <img class="img_selected_unit" src="" data-bind="attr: { src: $data.icon }" style="-webkit-transform: scaleX(-1);"/> </a> <span class="span_selection_count" data-bind="text: $data.count"></span> </div> <!-- /ko --> </div> </div> </div> I found the HTML part who describe the selection bar (the icons at the botom left which show the content of your selection). Unfortunately the following data bind still very mysterious for me. HTML: data-bind="click: function (data, event) { $parent.onSelectionDisplayClick($index(), event) }"
And concerning the groups... nothing This feature should not be available into the ui. They are still handle by the engine ?
alpha/shared/js/api/select.js api.select.captureGroup(#) is directly bound to a key. It doesn't contain any unit information, though you can probably guess by looking at what units are currently selected, in the selectionViewModel in live_game.js. However, I don't think there's a UI event when a unit dies, so I don't know how you would clean those lists of the units that have died since the group was created.
I am not an expert on knockout, but I think that basically says: when the element is clicked call onSelectionDisplayClick and pass it the index of the clicked item. So search for onSelectionDisplayClick in the live_game.js?
I clearly don't have the skills for this job. The UI stuff were ok, i achieved to figured out what i was doing, but here i have to admit everything looks like chinese for me Maybe i'll try back later but i don't have enough time now.