General > User modifications

Lazy battlescape HUD

<< < (3/7) > >>

homunculus:
1) I guess I'll need to store the weapon in some variable, and when the user clicks then check if the weapon in the 'container right' is the same as the stored weapon. Edit: Actually I was more worried about not knowing a better shortcut.

2) No, I wouldn't loose the drag functionality : )
I would exclude a 25x25 rectangle in the lower right corner of the firemode string on top of the weapon container (and put a ghost 'hand' icon at that spot; or maybe change cursor, but I havn't tried changing cursors yet).

3) Maybe it is bit more clear this way.
I want to put two bars on top of each other (the lower one in the script would appear on top).

--- Code: ---|----bar-1-(dark)---->|-----bar-1-background-(light)--------|
|----bar-2-background-(transparent)----|<---bar-2-(dark)----|

--- End code ---
This way the light colored area (background of the first bar) would indicate the position in the list like a scrollbar (but without the icons at both ends).

I don't know if that now clarified it or not, but for the last 5 hours or so (lol!), I have been trying to figure out how to create such reusable component, but without success.
The thing I can't figure out how to do is child node variables based on parent node variables (tried several variations).
--- Code: ---component bar forwardBar
{
    {
        size     <some default values here>
        max      <some default value here>
        current  <some default value here>
    }
    bar oppositeBar
    {
        <i would like size to be the same as the parent size>
        <i would like max to be the same as the max in the parent>
        <i would like to calculate current based on current in the parent>
    }
}

--- End code ---
Tried things like:
<calculate current based on current in the parent!>
<i would like current calculated based on current in parent>
<i would like current calculated based on current in parent, please>
but nothing seemed to help.
(well, maybe not exactly like that, but the end result was the same)

MCR:
1) The weapons are already stored: see mn_lweapon_item and mn_rweapon_item

2) This would be a possibility

3) I would not try to code that with bars as you do not need any of the bar functionality here...
To achieve that simply take a backgound image and a foreground image and change the x size and x position of the foreground image dynamically, no ?

geever:
0. textalign was renamed to contentalign
1.a. onselect event of a container is called on selecting an element of the container AFAIK.
1.b. if you have weapon name in a cvar (like normal hud does), you can set up a cvar-listener to it

-geever

bayo:

--- Quote from: geever on December 26, 2011, 05:23:12 pm ---1.b. if you have weapon name in a cvar (like normal hud does), you can set up a cvar-listener to it

--- End quote ---
Are you sure? or somebody implement it? i know it is a feature request only.

homunculus:
1.b. I think I saw a cvarlistener in some .ufo file yesterday.

1.a. onSelect for shooting looks unusable because each time the user drags the item, onSelect is called.
The node (with a hole) over the weapon container is better.

0. Thanks, that makes me feel better (it does feel bit strange doing things not according to spec otherwise).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version