1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Request] Shortcut keys for Unit Upgrade and Escort

Discussion in 'Civ6 - Creation & Customization' started by lifemare, Nov 30, 2016.

  1. lifemare

    lifemare Chieftain

    Joined:
    Dec 14, 2011
    Messages:
    21
    Can anyone help me with the code for DefaultKeyUpHandler? I know i can use the UI.GetHeadSelectedUnit operation (thanks to @chaorace and his awesome CQUI) but i have no idea how to find the IDs for Unit Upgrade and Escort.
     
  2. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    If you look at the functions ShowPromotionsList and OnPromoteUnit in unitpanel.lua should give you an idea.
    Also look at function OnUnitActionClicked_EnterFormation or search flle for formation.

    If this doesn't help enough let me know, I'll have more time later to be more specific(got to take kids to school now)
     
  3. lifemare

    lifemare Chieftain

    Joined:
    Dec 14, 2011
    Messages:
    21
    Thank you gyogen! That was very helpful.

    I managed to get the Promotion shortcut working by using the simple LuaEvents.UnitPanel_PromoteUnit(); :D

    I'm having a hard time however using the Formation code in a meaningful way. I'm guessing the correct function for this is:
    Code:
    UnitManager.RequestCommand( pSelectedUnit, UnitCommandTypes.ENTER_FORMATION, tParameters ); 
    But i have no idea how to make this work.

    Also, i forgot to mention in my OP, but i would also like to get a shortcut to Wake up fortified units. But the only code i found in UnitPanel is for refreshing icons:
    Code:
    SetUnitEntryStatusIcon(unitEntry, "ICON_DEFENSE");
    Excuse this noob for stealing your attention from your own modding. Give me a chance to repay you if you ever find yourself needing a hand in the art department (my background is in Design).
    :beer:
     
  4. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    I already have a mod that assigns an action and wakes a unit - Fortified Alert (though now I call it alert guard) You can look at it to see how I did it. ( though I added a new operation so had to do it a round about way.
     
  5. gyogen2

    gyogen2 Chieftain

    Joined:
    May 8, 2014
    Messages:
    1,201
    Just realized I totally misread, you can still look at the mod for idea, but you would just need to add a short cut key, then have get the selected unit and issue command to wake
     

Share This Page