using javascript for menus?
using javascript for menus?
is it possible to start using javascript to make new menus and other elements on the display?
we can't figure out how to make this happen for a custom map-mod to use a new menu screen
we can't figure out how to make this happen for a custom map-mod to use a new menu screen
Re: using javascript for menus?
also we want to change the title music in our map-mod depending on what menu option these select, is that possible?
Re: using javascript for menus?
We would really want a new javascript-based GUI. However, this is a lot of work.
Re: using javascript for menus?
What if initially a JS env is created for menus and some basic functions are exposed to it - then modders could start hacking away at it? I imagine it would quickly turn in to a larger project with dozens of new functions/globals being asked for, most if not all of which would be very specific to menus. Maybe a 3.2+ project?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: using javascript for menus?
You do not understand. The current GUI code does not operate like a retained "scene graph", like most modern GUI toolkits. Everything in the GUI is composed anew every graphical frame. Exposing this broken architecture to javascript would do nobody any good.
Re: using javascript for menus?
OMG, no wonder the GUI doesn't get updated much! I took a look at some of the GUI code and realised it was somewhat evil, but I had no idea it was redrawing everything every frame. That explains my laptop temperature increase even while looking at the menus...
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: using javascript for menus?
You can add browoser inside and make html widgets.Per wrote:We would really want a new javascript-based GUI. However, this is a lot of work.
Code: Select all
var widget = getWidget(path_to_template, position, [size])
template:
<div width='2%' height='3%'>
<input type='button' style='wz_buttons' value='Write to console', onclick='console('hello')'>
<div>
widget.show()
http://addons.wz2100.net/ developer
Re: using javascript for menus?
@Duha is that using QT? If so, which version?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
- Regular
- Posts: 678
- Joined: 29 Jul 2009, 18:01
Re: using javascript for menus?
This sounds like the EVE or WoW gui systems only using JS rather than Python or LUA.
Rebuilding the GUI even in a more modern game is a difficult challenge at best. By the sound of it for WZ it would be a nightmare at best and impossible at worst. May end up having to build a new GUI from scratch.
Rebuilding the GUI even in a more modern game is a difficult challenge at best. By the sound of it for WZ it would be a nightmare at best and impossible at worst. May end up having to build a new GUI from scratch.
Re: using javascript for menus?
where do you add this code?Duha wrote:You can add browoser inside and make html widgets.Per wrote:We would really want a new javascript-based GUI. However, this is a lot of work.Code: Select all
var widget = getWidget(path_to_template, position, [size]) template: <div width='2%' height='3%'> <input type='button' style='wz_buttons' value='Write to console', onclick='console('hello')'> <div> widget.show()
Re: using javascript for menus?
The problem with WZ's GUI code is not that it is drawn on every frame, that is fine & normal.
The issue is, everything is hardcoded at compile time.
It doesn't (yet) have the ability to handle external events, so all the glue code hasn't even been written.
This could all be under script control at some point in the future, but, as with everything else, we just need someone to write it first.
The issue is, everything is hardcoded at compile time.
It doesn't (yet) have the ability to handle external events, so all the glue code hasn't even been written.
This could all be under script control at some point in the future, but, as with everything else, we just need someone to write it first.
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: using javascript for menus?
Is it possible add new graphic layer above standart GUI?vexed wrote:The problem with WZ's GUI code is not that it is drawn on every frame, that is fine & normal.
The issue is, everything is hardcoded at compile time.
It doesn't (yet) have the ability to handle external events, so all the glue code hasn't even been written.
This could all be under script control at some point in the future, but, as with everything else, we just need someone to write it first.
js function that calls browser frame that can have access to game js enviroment
http://addons.wz2100.net/ developer
Re: using javascript for menus?
Adding a new GUI as an additional graphics layer, which replaces the old GUI piece by piece, is probably the only sane way to do it.
Re: using javascript for menus?
I've been through the front-end UI to try and work out what JS API features would be needed (in addition to some sort of browser environment within WZ) to replace current menus & game set-up with HTML/CSS/JS...
https://warzone.atlassian.net/wiki/disp ... R/Menus+UI
Things get particularly complex around map previews and mp game host/join. But a lot of the rest of the stuff looks relatively straightforward from a JS perspective.
https://warzone.atlassian.net/wiki/disp ... R/Menus+UI
Things get particularly complex around map previews and mp game host/join. But a lot of the rest of the stuff looks relatively straightforward from a JS perspective.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO