General > User modifications

Lazy battlescape HUD

<< < (4/7) > >>

MCR:

--- Quote from: bayo on December 26, 2011, 05:49:53 pm ---Are you sure? or somebody implement it? i know it is a feature request only.

--- End quote ---

http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=commit;h=decae72387c22c1fd4b5c3c86f3fdde5ff475d0a

Here in use:

http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=blobdiff;f=base/ufos/ui/hud_mini.ufo;h=84337a4741f011517b384952bb097205449d94de;hp=6d54d0160ad20ee928965d424b8a46d8ace358d7;hb=f87abc419d8dbec26b21915f781e5476cc42321f;hpb=b063f7cb28a16c61c397d4fe3faea98b79aadce5

MCR:
Take a look @ hud_phone.ufo

There you can find something like this


--- Code: --- panel actionselection_controls {
{
pos "0 0"
size "622 768"
ghost true
}

panel buttons {
{
pos "0 0"
size "122 768"
ghost true
layout LAYOUT_TOP_DOWN_FLOW
}
custombutton up {
size "122 148"
background "hudphone/sprites/button"
icon "hudphone/sprites/arrowup"
onClick {
*node:parent.parent.elements@viewpos = ( *node:parent.parent.elements@viewpos - 150 )
}
}
custombutton down {
size "122 148"
background "hudphone/sprites/button"
icon "hudphone/sprites/arrowdown"
onClick {
*node:parent.parent.elements@viewpos = ( *node:parent.parent.elements@viewpos + 150 )
}
}
custombutton cancel {
size "122 148"
background "hudphone/sprites/button"
icon "hudphone/sprites/cancel"
onClick {
*cvar:mn_controlaction_mode = ""
*cvar:mn_control_mode = ""
call *node:root.update_control_mode
// cancel the firemode aiming
cmd "hud_movemode"
}
}
}

panel elements {
{
pos "122 0"
size "500 768"
ghost true
layout LAYOUT_TOP_DOWN_FLOW
}

confunc hud_phone_actionlistener {
if (<1> eq "begin") {
call *node:parent@removeAllChild
// call *node:parent@createChild("cancel", "hud_phone_firemodeentry")
// call *node:parent.cancel.init_cancel
} elif (<1> eq "firemode") {
call *node:parent@createChild("<2>", "hud_phone_firemodeentry")
call *node:parent.<2>.init(<2>, <3>, <4>, <5>, <6>, <7>, <8>, <9>, <10>)
} elif (<1> eq "reaction") {
call *node:parent.<2>.init_reaction(<3>)
} elif (<1> eq "reload") {
call *node:parent@createChild("<2>", "hud_phone_firemodeentry")
call *node:parent.<2>.init_reload(<2>, <3>, <4>, <5>, <6>)
} elif (<1> eq "end") {
} else {
cmd "echo firemode_listener: unknown \"<1>\" command"
}
}

}
}

--- End code ---

It does more or less what you need to get done (& several other things ;)) - the position of the panel elements is moved up/downwards by 150 point by clicking on the up/down buttons.

Another tip: Open the console and type "debug_ui 1" without quotes to enable the UI Debug mode. Could be very helpful :)

homunculus:
:) relocating things works now.

hopefully assigning child node properties will also work in components.
then it should be just a bit of typing, as far as i can see.
unless... well, whatever.

geever:

--- Quote from: bayo on December 26, 2011, 05:49:53 pm ---Are you sure? or somebody implement it? i know it is a feature request only.

--- End quote ---

CVAR listener was available in C code before and mattn did the UI binding a few days ago.

-geever

geever:

--- Quote from: homunculus on December 26, 2011, 06:09:28 pm ---0. Thanks, that makes me feel better (it does feel bit strange doing things not according to spec otherwise).

--- End quote ---

My fault, I badly needed align functionality for images (in building preview window for 1x1 and 2x1 building images) so I've reused the textalign stuff and renamed to show it's not for text only anymore, but I missed the wiki documentation.... because... not even know where should I doc it, I don't get the system behind it and don't know if the auto-generated behaviour pages are really auto-generated, or generated by scripts a year ago or before...

-geever

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version