Ticket #3211: t3211_cancel_production_queue_with_shift_click_v3.1.patch

File t3211_cancel_production_queue_with_shift_click_v3.1.patch, 2.6 KB (added by elexis, 9 years ago)

The "iconButton" style wasn't shown because of the size of the sprite. Although its 100% everywhere else in the code, it has to to be a little smaller here. Also a bit cleaner code. Close as won't fix if it isn't a desired feature.

  • binaries/data/mods/public/gui/session/selection_panels_right/queue_panel.xml

     
    22<object name="unitQueuePanel"
    33    size="4 -56 100% 0"
    44    type="image"
    55    sprite="queuePanelShader"
    66>
    7     <object size="-4 -2 52 54" type="image" sprite="stretched:session/icons/production.png" tooltip_style="sessionToolTipBottom">
     7    <object size="-4 -2 46 48" type="image" sprite="stretched:session/icons/production.png" tooltip_style="sessionToolTipBottom">
    88        <translatableAttribute id="tooltip">Production queue</translatableAttribute>
    99        <object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
    1010    </object>
    1111
    12     <object size="48 6 100% 100%">
     12    <object size="40 6 100% 100%">
    1313    <repeat count="16">
    1414        <object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
    1515        <object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
    1616        <object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="3 3 37 37" z="20"/>
    1717        <object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
    1818        </object>
    1919    </repeat>
    2020    </object>
     21   
     22    <object size="100%-30 12 100%-6 40" name="cancelQueue" type="button" style="iconButton" tooltip_style="sessionToolTipBottom" >
     23        <object type="image" size="5 5 100%-5 100%-5" sprite="stretched:session/icons/cancel.png" ghost="true" />
     24        <translatableAttribute id="tooltip">Cancel the whole production queue</translatableAttribute>
     25        <action on="Press">clearProductionQueue(g_Selection.toList());</action>
     26    </object>
     27   
    2128</object>
  • binaries/data/mods/public/gui/session/session.js

     
    273273    };
    274274
    275275    Engine.SubmitUserReport("profile", 3, JSON.stringify(data));
    276276}
    277277
     278
     279function clearProductionQueue(producingEntities) {
     280    for(var producingEnt of producingEntities)
     281        for(var ent of getTrainingQueueItems([producingEnt]))
     282            removeFromProductionQueue(producingEnt, ent.id);
     283}
     284
    278285/**
    279286 * Resign a player.
    280287 * @param leaveGameAfterResign If player is quitting after resignation.
    281288 */
    282289function resignGame(leaveGameAfterResign)