Results 1 to 7 of 7

Thread: WIP: Promotion Tree

  1. #1
    Join Date
    Apr 2011
    Location
    Near Portsmouth, UK
    Posts
    1,104

    Cool WIP: Promotion Tree

    I don't normally post work-in-progress screen grabs, but the layout for this one has been driving me up-the-wall (or more accurately round-the-(pipe)-bend) and I've finally cracked it! (Layout is fully derived from the Promotions table - which was fun!)


    That's a drop-down for the 11 combat classes (melee, siege, naval, bomber, etc) on the left

    (Boy I miss a good IDE for Lua and a Dialog Editor)


    Given a unit, it will display earnt/available/unavailable promotions
    Last edited by whoward69; 03-21-2012 at 02:32 PM.

  2. #2
    Join Date
    Apr 2011
    Location
    The Republic of New Zealand
    Posts
    1,112
    Awesome! Is it possible to select a promotion from the table when available?

  3. #3
    Join Date
    Sep 2010
    Posts
    878
    I agree, this is pretty awesome.

  4. #4
    Join Date
    Apr 2011
    Location
    Near Portsmouth, UK
    Posts
    1,104
    Quote Originally Posted by Pouakai View Post
    Awesome! Is it possible to select a promotion from the table when available?
    That's the intention. So (somehow) when selecting a promotion, rather than having just the buttons to pick an available promotion you can open the tree and select a promotion (a bit like the tech tree being available from the tech list). In the second screen shot all the green boxes are buttons, they just don't do anything yet.

    The drop-down list of combat classes was written as a debugging/testing aid, but it's so useful I'm going to try and embed it into the help system somewhere (probably on the Additional Information drop-down in "Diplo Corner")

    Next task is to work out how to add a new PopupButtonTypes and/or PopupPriority entry - as both seem to be hard-coded.

  5. #5
    Join Date
    Apr 2011
    Location
    Near Portsmouth, UK
    Posts
    1,104
    I've uploaded version 1 (as a beta) to the ModHub as "UI - Promotion Tree" under "UI -> Widgets"

    It uses Modularized DiploCorner to hook into the Additional Information list in the Diplo Corner; UnitPanel integration is still to be done.

    PLMKWYT

    W

  6. #6
    Join Date
    Apr 2011
    Location
    Near Portsmouth, UK
    Posts
    1,104
    Version 2 is uploaded - includes support for displaying the tree for a specific unit with "active" promotion buttons

    I'm still undecided as to how best to hook this into the UnitPanel, so for the time being, here's how to do it

    Code:
    --
    -- To display the Promotion Tree call either
    --   LuaEvents.PromotionTreeDisplay(iUnit)
    -- to display the tree for a specific unit, or
    --   LuaEvents.PromotionTreeDisplay()
    -- to display the tree with the Combat Class drop-down menu
    --
    -- For example, for a button on the UnitPanel screen
    --   function OnPromotionTreeButton(iUnit)
    --     LuaEvents.PromotionTreeDisplay(iUnit)
    --   end
    --   Controls.PromotionTreeButton:SetVoid1(UI.GetHeadSelectedUnit():GetID())
    --   Controls.PromotionTreeButton:RegisterCallback(Mouse.eLClick, OnPromotionTreeButton)
    --

  7. #7
    Join Date
    Apr 2011
    Location
    Near Portsmouth, UK
    Posts
    1,104
    Version 3 uploaded as a fully working mod - see http://forums.2kgames.com/showthread...Promotion-Tree

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •