project-navigation
Personal tools

Author Topic: Adding a node on top of the dragButton area in UI window  (Read 3487 times)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Adding a node on top of the dragButton area in UI window
« on: December 24, 2011, 03:56:03 pm »
A window node has the ability to set closebutton and dragbutton, which automatically places nodes for closing and dragging the window.

I would like to keep the dragbutton option but use my own custom node for closebutton. However, because the dragbutton is added after the UI script is read, it "covers up" my closebutton, so I can't place my own clickable node over the drag area.

Is there any way to add a node on top of another node that is added automatically? Or, alternatively, is there a way I can create a a custom node that will have the drag functionality?

The attached image shows the default closebutton. If I remove the closebutton from the window and then add a node in roughly the same place with the same functionality, it doesn't work because the dragbutton area covers it up.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #1 on: December 24, 2011, 04:21:37 pm »

Use this before you place your close button on top of it.

Code: [Select]
controls drag {
               tooltip   "_LMB:Drag/RMB:Close"
               pos        "x y"
               size       "x y"
               OnRClick { cmd "ui_pop;" }
       }


Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #3 on: December 24, 2011, 04:34:49 pm »
As MCR found out, you can't change the layout but you can use a custom drag node (controls).

-geever

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #4 on: December 24, 2011, 04:37:08 pm »
thanks guys, will try it

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #5 on: December 24, 2011, 09:00:57 pm »

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #6 on: December 24, 2011, 09:33:10 pm »
Actually the window node creates a controls subnode dynamically, so it won't disappear without notice.

-geever

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: Adding a node on top of the dragButton area in UI window
« Reply #7 on: December 25, 2011, 09:50:13 pm »
The problem is it can became a mess to recode everytime you need a movable window with this layout. I think there is some easy way to code "window" node customization with scripts. But the full system still need fixe (padding-top with influencies into child node, which IMO will broke everything) to be better.