project-navigation
Personal tools

Author Topic: UI Adjustments.  (Read 34876 times)

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: UI Adjustments.
« Reply #15 on: October 22, 2010, 07:41:08 pm »
*path??:hudinv@visiblewhen, here u must use @invis (which it visibility status), not @visiblewhen (which is something like a function)

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #16 on: October 22, 2010, 07:58:29 pm »
yep, i didnt looked at the data type before, its not even boolean  :-[
so its should be something like this:
Code: [Select]
    onClick {
if (*node:hudinv@invis) { call *node:root.showinventory }
else { call *node:hudinv.hideinventory }
}

the only problem is how do you check if *node:hudinv exist at all?  ==null?  
and is there a specific reason why hudinv is done as another window?(resources? readability?) because i would prefer if it was as another panel.
« Last Edit: October 22, 2010, 08:06:32 pm by mor2 »

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: UI Adjustments.
« Reply #17 on: October 22, 2010, 10:25:22 pm »
*:node:something.another.anotherthing
mean "something" is a window.

A path must start with a window name, or must be relative and start with "this", "parent", or "root"

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #18 on: October 22, 2010, 11:28:57 pm »
so  *hudinv@invis (a window extends abstruct node so why not) or do i have to type *hudinv:root@invis ?
and how do i check if it exist?   *hudinv != null  ?  otherwise i assume that *node:inventory@invis will return a nasty runtime error...

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: UI Adjustments.
« Reply #19 on: October 23, 2010, 03:14:27 am »
All nodes already exists. To know if a window is pushed or not, i dont think u can use invis. And i dont think there is a way to know it ATM. You must remember this status with a cvar.

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #20 on: October 25, 2010, 03:22:46 am »
ok, how about placement, is there any suggestion how to do it or is it just notepad move 2px right start the game and back for more?
also is there a way to check if ctrl/shit is pressed when i click the mouse? and where are those functions located anyway?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: UI Adjustments.
« Reply #21 on: October 25, 2010, 08:12:45 am »
open the game console (shift+esc) and type ui_push editor
« Last Edit: October 25, 2010, 08:24:00 pm by bayo »

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #22 on: October 25, 2010, 10:11:17 pm »
where do i need to put that?
in the main menu and geoscape it returns 'unknown command - wasnt sent to server'
in the battlescape it recognizes it as text and pops it on screen me:ui_push editor
in either case nothing happens beyond that.

EDIT:
found it its "mn_push editor" not ui...
« Last Edit: October 25, 2010, 10:25:25 pm by mor2 »

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: UI Adjustments.
« Reply #23 on: October 25, 2010, 10:28:13 pm »
open the game console (shift+esc) and type ui_push editor

Ooh, that's a neat trick!

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #24 on: October 25, 2010, 10:50:22 pm »
the question is where does the changes being saved?

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: UI Adjustments.
« Reply #25 on: October 25, 2010, 11:29:26 pm »
Quote
the question is where does the changes being saved?
On your home.

mn_push is for 2.3, ui_push is for 2.4 cause i rename everything, cause i dont like "menu" token.

Offline mor2

  • Squad Leader
  • ****
  • Posts: 145
    • View Profile
Re: UI Adjustments.
« Reply #26 on: October 26, 2010, 04:56:19 pm »
its possible i have encountered a bug, replacing graphics works, for example:
original X.png from UFOAI-2.3\0base.pk3
replaced by placing it in  UFOAI-2.3\base\pics\hud\X.png

but replacing scripts, has a glitch and the game doesnt past the init stage.
i extracted althud.ufo from UFOAI-2.3\0ufos.pk3
to UFOAI-2.3\base\ufos\ui\althud.ufo
stuck.


as for the home dir, this didnt help, i have no such thing in my %appdata%\UFOAI\2.3\base\ufoconsole.log
For dir, run the game and check the logs below "---- filesystem initialization -----".

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: UI Adjustments.
« Reply #27 on: October 29, 2010, 05:23:07 am »
but replacing scripts, has a glitch and the game doesnt past the init stage.
i extracted althud.ufo from UFOAI-2.3\0ufos.pk3
to UFOAI-2.3\base\ufos\ui\althud.ufo
stuck.

Assuming you didn't have a typo, yes there are some bug with parsing, for example last time I tried to make a bar with a non-default direction (vertical) game crashed at startup -- size mismatch -- seems that the orientation of the bar is declared as a byte while the game is trying to parse an integer, so it crashes, maybe there's a similar bug somewhere else?


Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: UI Adjustments.
« Reply #28 on: October 29, 2010, 10:29:00 am »
It dont crash, it exit with an error message.

If it crash, please provide a backtrace,
And if it dont crash and the message dont help you, please more explicite.

Bar direction only work for 2.4. Here you have examples http://ufoai.git.sourceforge.net/git/gitweb.cgi?p=ufoai/ufoai;a=blob;f=contrib/scripts/ui/examples/unittest_bar.ufo

Anyway, i dont check it for a will.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: UI Adjustments.
« Reply #29 on: October 29, 2010, 08:01:26 pm »
TBH I hadn't checked it recently either -- when I said "the last time I tried, I didn't imply it was recently, the error message was helpful at that time (I just went for a standard bar)

I only meant to note that the game not going past startup could be due to an script typo or there could actually be parsing bugs.

Anyways a quick test (with althud.ufo) shows it still doesn't work:

Code: [Select]
----------- parse scripts ----------
52 script files
48 ui script files
UI_ParseNodeProperties: unknown property "orientation", node ignored (node althud.floor.health0)
UI_ParseNodeBody: node with bad body ignored (node "althud.floor.health0")
UI_ParseWindow: window "althud" has a bad body

FS_RemoveFile: remove /home/eliab/.ufoai/2.4-dev/base/keys.cfg
There are still 1 opened files
]./ufo[0x8189b80]
./ufo[0x818915d]
./ufo[0x8129fab]
./ufo[0x80f65c7]
./ufo[0x805dd44]
./ufo[0x8140743]
./ufo[0x812b4e7]
./ufo[0x8188397]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x670bd6]
./ufo[0x804e191]
Error: Shutdown
(that last part does *look* like a backtrace btw)

using direction instead of orientation:
Code: [Select]
----------- parse scripts ----------
52 script files
48 ui script files
UI_ParseProperty: "cl" is not a well formed node name (it must be quoted, uppercase const, a number, or prefixed with '*')
UI_ParseNodeProperties: Problem with parsing of node property 'althud.floor.health0@direction'. See upper
UI_ParseNodeBody: node with bad body ignored (node "althud.floor.health0")
UI_ParseWindow: window "althud" has a bad body

FS_RemoveFile: remove /home/eliab/.ufoai/2.4-dev/base/keys.cfg
There are still 1 opened files
]./ufo[0x8189b80]
./ufo[0x818915d]
./ufo[0x8129fab]
./ufo[0x80f65c7]
./ufo[0x805dd44]
./ufo[0x8140743]
./ufo[0x812b4e7]
./ufo[0x8188397]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x2f3bd6]
./ufo[0x804e191]
Error: Shutdown

and using direction ALING_CL:
Code: [Select]
----------- parse scripts ----------
52 script files
48 ui script files
UI_ParseProperty: Invalid value for property 'direction': Size mismatch: given size: 1, should be: 4. (type: 3)
UI_ParseNodeProperties: Problem with parsing of node property 'althud.floor.health0@direction'. See upper
UI_ParseNodeBody: node with bad body ignored (node "althud.floor.health0")
UI_ParseWindow: window "althud" has a bad body

FS_RemoveFile: remove /home/eliab/.ufoai/2.4-dev/base/keys.cfg
There are still 1 opened files
]./ufo[0x8189b80]
./ufo[0x818915d]
./ufo[0x8129fab]
./ufo[0x80f65c7]
./ufo[0x805dd44]
./ufo[0x8140743]
./ufo[0x812b4e7]
./ufo[0x8188397]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x2f7bd6]
./ufo[0x804e191]
Error: Shutdown

which was the error I got at that time

anyway got to go