New GUI scripting concepts and foundation
Re: New GUI scripting concepts and foundation
Ok, I included the framework and made gw_loadModule function which can be used to load gw script entities. I moved gw and gw_events to lua files: mod_assets/grimwidgets/gw.lua and mod_assets/grimwidgets/gw_events.lua.
We can always rollback to previous version if this is not what we want.
We can always rollback to previous version if this is not what we want.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
I just wanted to let you know that real life (aka project deadline) will make me likely to disappear till end of January. I may look at grimrock forum briefly, but I won't be able to contribute anything. That doesn't mean that I lost interest or anything, just being busy writing tons of a different kind of code.
Re: New GUI scripting concepts and foundation
Real life or real wife?
Yeah, I know what you mean, I have slowed down my modding pace a lot too. I just can't figure out how to extend the real life timer.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
Real life or real wife?
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
Re: New GUI scripting concepts and foundation
I did some code refactoring:
added gw_utils module and moved some methods to it and prefixed private methods with _ on gw script entity.
Should we make another script entity for all those draw-methods? eg. gw_draw?
added gw_utils module and moved some methods to it and prefixed private methods with _ on gw script entity.
Should we make another script entity for all those draw-methods? eg. gw_draw?
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
I didn't work on it these days, sorry.Should we make another script entity for all those draw-methods? eg. gw_draw?
Maybe it makes more sense to divide them by control type (like gw_buttons ?) and have the draw methods as private in those entities ? Or you mean just the "helper" draw methods like drawBevel and similar ?
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
Re: New GUI scripting concepts and foundation
Maybe, we should think about the structure a bit more. Anyway I added freeze world functionality to encounters, it's still buggy because only way to unfreeze world is to click leave button, so if you heal the dwarf the game is frozen forever, but the idea should be clear so thomson or anyone can continue from there.
Edit: shit, I accidentally committed on eob-waterdeep instead of grimwidgets, sorry I'm gonna fix it.
Edit: shit, I accidentally committed on eob-waterdeep instead of grimwidgets, sorry I'm gonna fix it.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
Ok, now it's pushed to grimwidgets repo and I updated it to eob-waterdeep repo too.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
Added gwElement:setRelativePosition(positions)
Implementation is at gw_util.setRelativePosition
.. etc..
possible values: top,middle,bottom,left,center,right
TODO:
- possibility to pass relative position as an argument to addChild method
- support for {'after','element_id'} and {'below','element_id'}
- And I think we need a margin (top and left at least) property too
Implementation is at gw_util.setRelativePosition
Code: Select all
button1:setRelativePosition{'center'} -- sets element position to the center of the parent element
button1:setRelativePosition{'left','bottom'} -- sets element position to the bottom left of the parent element
possible values: top,middle,bottom,left,center,right
TODO:
- possibility to pass relative position as an argument to addChild method
- support for {'after','element_id'} and {'below','element_id'}
- And I think we need a margin (top and left at least) property too
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: New GUI scripting concepts and foundation
FYI: I'm making a major code structure overhaul, so I hope that you guys don't have any uncommitted features in progress.
I'm changing the api to something like this:
So every widget has a own script entity (like Xanathar suggested ). IMO It's much clearer and flexible that way.
Edit: Pushed my changes to github.
- I also added a text wrapping functionality and added text support for rectangles too. (see examples from dungeon)
- gw script has now general element factory method: gw.create(elementType,id,arg1,arg2,arg3,arg4,arg5,arg6)
which can be used like this:
gw.create('button3D','my_3D_button', 20, 20, "Click me", 150, 20, {200,200,200})
Which is exactly the same as calling:
gw_button3D.create('my_3D_button', 20, 20, "Click me", 150, 20, {200,200,200})
I'm changing the api to something like this:
Code: Select all
rect1 = gw_rectangle.create('rect_id',10,10,100,100)
button = gw_button.create('button_1',10,10,'button text')
rect1:addChild(button)
Edit: Pushed my changes to github.
- I also added a text wrapping functionality and added text support for rectangles too. (see examples from dungeon)
- gw script has now general element factory method: gw.create(elementType,id,arg1,arg2,arg3,arg4,arg5,arg6)
which can be used like this:
gw.create('button3D','my_3D_button', 20, 20, "Click me", 150, 20, {200,200,200})
Which is exactly the same as calling:
gw_button3D.create('my_3D_button', 20, 20, "Click me", 150, 20, {200,200,200})
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450