Development > Newbie Coding

UI Adjustments.

<< < (7/17) > >>

bayo:
I fix that in the master and i move all samples to unittest/ufos/uisample.
Then, now, everything is checked, and we should have less regressions

H-Hour:
I'm trying to change the cvar's for a bar node in a confunc that get's called when the player clicks an image. I'm getting the following error:


--- Code: ---Com_EParseValue: Illegal float statement '*cvar:mn_tu0' (file: 'C:\Program Files (x86)\UFOAI\ufoai\src\client\ui\ui_parse.c', line: 272)
--- End code ---

The code for the bar, image and confunc is:


--- Code: --- bar team_sld0_status
{
pos "65 10"
size "4 46"
color ".2187 .73 .23 1"
current *cvar:mn_hp0
max *cvar:mn_hpmax0
disabled true
direction "uc"
excluderect { pos "0 0" size "4 46" }
}

...

// Select tu button
image showtu_btn {
align LAYOUTALIGN_MIDDLE
src "hhud/tm_sldbg_sel"
pos "27 10"
size "64 64"
onClick { cmd "showtu;" }
}
confunc showtu {
*node:root.team.team_sld0_status@color = ".65 .23 .23 1"
*node:root.team.team_sld0_status@current = *cvar:mn_tu0
*node:root.team.team_sld0_status@max = *cvar:mn_tumax0
}
--- End code ---

Am I doing something wrong or is it not possible to reassign the @current and @max values for a node this way?

mor2:
@H-Hour, i understand you want to force an update but i dont think its how it works, the way i understand it 'current' is of type "V_CVAR_OR_FLOAT"
which i assume is ufoai for pointer to/or float, so you already linked the cvar to current and any change will be reflected when the bar gets an update event, which i assume the mouse movement trigger(among other things) the question if it tigers an update or if its call for specific nodes update (like the TU).


~unrelated questions:
1. if the above is correct what is the syntax difference between getting V_CVAR and its value?
2. how 'excluderect' work, if i place buttons on panel without a a background and exclude all of it, the buttons will keep receive mouse event, right?  (e.g. use ghost?)
also excluding a node, means that the node under it will receive the mouse event in order of creation with zone render being the last?
3. how does the nodes capture zone is defined? a square by the pos/size or by the image (if present) because i seen few none square buttons?

H-Hour:

--- Quote from: mor2 on October 30, 2010, 12:12:58 pm ---@H-Hour, i understand you want to force an update but i dont think its how it works, the way i understand it...

--- End quote ---

I'm sorry but I don't understand your explanation. I'm not really a programmer. If this won't work I can do it by creating multiple nodes and swapping them out with invis, but it would be better if I could update swap the data used for a single node.

mor2:
neither do i, i wanted to explain this by providing an example of actor_select but it looks like i was wrong. i think that 'updateactorvalues' from the parent ahud class is what you are looking for (its in the_hud file) do the same for onclick event. also maybe try "*cvar:mn_tu0"


if not you'll have to do as i do wait for someone who actually knows this stuff  ;)  (if someone like that comes, then some help with the question in my previous post will be greatly appreciated)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version