Page 2 of 2

Re: [ZScript] ZForms 1.0

Posted: Fri Feb 03, 2023 6:22 am
by krokots
Is there some easy way to make the menu not pausing the game?

Ha, never mind, I found this great tip from Nash

Code: Select all

    override void Ticker(void)
    {
        menuactive = Menu.OnNoPause;
    }

Re: [ZScript] ZForms 1.0

Posted: Fri Feb 03, 2023 11:23 am
by Xeotroid
You can also put that in the Init() virtual method with the rest of the menu set-up.

Re: [ZScript] ZForms 1.0

Posted: Wed May 31, 2023 4:05 pm
by julmust
*Edit* Fixed it. If you are using the latest gzdoom there is a small bug in ZForms in "Frame.zsc" line 4 and 5. Change uint to int and you will be able to run the script. Thank you for an awesome framework.

I am trying to get ZForms to work.

I've gotten SimpleMenu.ZS to work, without the buttonClickCommand. When I run the project with buttonClickCommand, it throws this error:

C:/projects/doom/project/game/:zscript/simplemenu.zs, line 17: Attempt to override non-existent virtual function buttonClickCommand

I have copied the Samples project to a T, just generating a new Prefix from the main repo.

Any ideas?

Re: [ZScript] ZForms 1.0

Posted: Tue Jul 11, 2023 2:55 pm
by Gutawer
After helping someone with a ZForms issue on Discord I realized that I never actually linked the new documentation for the git version, even though it's been up for ages...
https://gutawer.gitlab.io/gzdoom-zforms ... index.html
This entirely replaces the old miraheze wiki, and is specifically for the current git version (which, I feel like pointing out at this point, is a much better version of ZForms than the one this thread advertises. I am working on bringing it to a releasable state again after being quite swamped by university work!).

Re: [ZScript] ZForms 1.0

Posted: Tue Jul 11, 2023 3:59 pm
by Major Cooke
Epic! I was just about to get started, and admittedly I was confused when I had first began. Hopefully this makes it much easier to delve into.

Does this include the 'animation' branch or just 'master'?

Re: [ZScript] ZForms 1.0

Posted: Tue Jul 11, 2023 4:20 pm
by Gutawer
This is for the main branch. The animation branch does have a bunch of cool work but it's (varying levels of) experimental and I'm currently in the progress of overhauling some things to introduce a layout system. I wouldn't advise using it unless you're willing to ask me a lot of questions about migrating stuff whenever I decide to work on it lol

Re: [ZScript] ZForms 1.0

Posted: Wed Jul 12, 2023 3:33 pm
by Major Cooke
Heh fair enough. Yeah I'll wait. Though I am curious what is planned for it?

Re: [ZScript] ZForms 1.0

Posted: Thu Jul 13, 2023 3:57 pm
by Gutawer
Lots of stuff, a fair amount of which is done.
  • Removing the separation of tickers/drawers, the library in general has been refactored to run at any frame rate, making it much smoother than it used to be.
  • Affine transformations on elements, allowing any element to be rotated, offset, sheared, scaled, etc.
  • An API for defining custom "stylers" for visually complicated elements like buttons. For example, you can use this to add hover animations to a button without messily putting this functionality into something like a hover handler.
  • A fully-fledged animation system heavily inspired by (and in some respects matching in power) the CSS animation system. This allows you to automatically run animations without writing the logic yourself, including a standard library of easing functions from https://easings.net, with the capability to define easing functions yourself. It can animate any double-type property in the entire library, and has functionality for changing the speed of and pausing animations, and calling a function when an animation ends.
  • The most drastic thing, which unfortunately is a non-trivial API break (hence me doing all this work on a branch until I'm confident of it!) is a fully-fledged layout system for defining menus without manually specifying coordinates for things. This is what is currently WIP, though progress is coming along quickly. I did do something like this before, but it was based on a very different principle and didn't hold up in runtime performance. The new system is inspired by UI systems like SwiftUI by Apple. Luckily, nothing particularly changes besides API surface - manual coordinates are still totally supported because a lot of game menus work best specified like that at least to some degree.
I think that's all but this is a lot of work in total.

A note on the layout system in particular - back when I started ZForms, it wasn't something I wanted to do because my main layout experience was with the CSS layout system, which is, to be honest, pretty terrible. It's more like 4+ layout systems that interact in weird ways, with the "old one" having different rules to flexbox which has different rules to grid. This made me think that a layout system wouldn't be worthwhile for game menus, which are often more freeform than websites. I have since looked at many more systems here and found ones that do allow for a better mixture of free-form and layouted parts, with every part following the same rules.

Once all of this is finalized it'll be documented and then I'd like to produce some tutorials, because some bits can be initially confusing.

Here's an example of the layout system running:

Re: [ZScript] ZForms 1.0

Posted: Sun Jul 16, 2023 6:41 pm
by Major Cooke
That's amazing, and going to revolutionize menus further. I'll be eager to try it when its done. But if you need any kind of testing, feel free to send me some stuff to try for it.

Re: [ZScript] ZForms 1.0

Posted: Sat Sep 16, 2023 7:40 pm
by Deon
This looks amazing. I will be happily waiting for the release, to rework my inventory system in never-to-be-released mod :). Thank you for everything.

Re: [ZScript] ZForms 1.0

Posted: Mon Oct 23, 2023 9:43 pm
by Major Cooke
Will this also feature the ability to make ghost preview when dragging with a mouse? I.e. clicking and holding on something selectable and moving it around, akin to Diablo-style inventory when selecting an item.

Asking because I'm intending to make a Keyconf Destroyer mod that will allow reassigning all weapons to different slots and orders. Got to thinking about mouse support and, while it's still quite early for me to even think about attempting yet, figured I'd ask if it's doable now or if it'll be in 2.0 only. Primary method right now will be simply pressing enter on a weapon entry in the list and moving it with the arrow keys, but this does scream for mouse drag support. I know for a fact people will crave for it immediately out the gate.