Page 2 of 4
Re: Shops (please test)
Posted: Fri Apr 26, 2013 1:44 am
by Krazzikk
Would you be able to gives us the WIP source?
Re: Shops (please test)
Posted: Sat Apr 27, 2013 1:26 pm
by AdrTru
Your system looks very useful, but I dont know how it worked exactly

( when I tested it, i have many errors )
Could you make some .dungeon_editor files with life examples? Please.
Re: Shops (please test)
Posted: Sun Apr 28, 2013 11:23 am
by alois
AdrTru wrote:Your system looks very useful, but I dont know how it worked exactly

( when I tested it, i have many errors )
Could you make some .dungeon_editor files with life examples? Please.
I realized I uploaded the gui.lua file but not the assets to make buttons/windows background... I'll add them to the original post!
As for a demo:
.dat file and
source.
There will be three buttons: the northern one shows a very simple dialog with two buttons; the western one shows a dialog with buttons, and the user is asked to answer a simple mathematical questions (nothing fancy

): the number of correct/wrong answers is saved, and shown using hudPrint; the eastern button, instead, is a sort of utility: say you want to create a 600x600 window, and you want to make the 'standard' background using only one image (instead of several tiles as it is now in gui.lua); you can use the third button to 'build' a window/button background of the dimensions you want, take a photo of the screen, and edit it (in your favorite image retouching programâ„¢) to create a .tga (.dds) file to import inside LoG.
The code is commented; whatever you may need, feel free to ask!
alois

Re: Shops (please test)
Posted: Sun Apr 28, 2013 10:22 pm
by Drakkan
nice introduction and examples of GUI dialogues, ggod work !
how are you progressing with shop ?
Re: Shops (please test)
Posted: Mon Apr 29, 2013 7:42 pm
by alois
Drakkan wrote:nice introduction and examples of GUI dialogues, ggod work !
how are you progressing with shop ?
Slowly, but steadily
I needed to add some 'tools': for example, a pop-up window which gets the focus of the mouse (you can only click on one of its buttons to dismiss it). To do that, I had to deal with the order in which gui elements are displayed and looked for clicks. Basically, as soon as you create an element, it is put in a list; then, the list is read from the first element to the last, and - in this order - every object in the list is drawn, together with its children. Thus, the first elements to be created are the first to be drawn (which is nice, because children often are 'superimposed' to parents). However, the same table dictates the order in which object is checked for mouse clicks, and the good order to do that is the opposite: first check the topmost objects (and stop if you find a click), then those which are below. Therefore, trouble: the pop-up window has to be on top of the others (i.e., it has to be created last), but in this way it is looked for clicks as the last one (and so - maybe - a click below is followed, which you do not want). My solution: create a 'huge' transparent layer ("screen") as the first thing, and 'activate' it every time there is a pop-up window. Since it is drawn (and there is nothing to draw!) first, it also intercepts clicks for first, stopping every other click.
I hop to be able to post something rather complete in a couple of days
alois

Re: Shops (please test)
Posted: Tue Apr 30, 2013 5:51 pm
by alois
Added a new 'Shoptest'.dat in the first post; as I say there, now it should be almost complete ('almost' being the keyword here).
alois

Re: Shops (now with source)
Posted: Thu May 02, 2013 9:45 am
by alois
Added the source in the first message (with instructions, too!).
alois

Re: Shops (now with source)
Posted: Fri May 03, 2013 10:05 am
by alois
Made small changes:
- items sold are added to the shop data and will be present (with higher prices...) the next time the shop is entered [adding them directly to the shop will be done in a second moment...];
- changed the folders for assets and 'rationalized' them;
- added a button to turn tooltips on and off.
See the first message of this thread for downloads.
alois

Re: Shops (now with source)
Posted: Mon May 06, 2013 6:35 am
by Ulfsark
Thank you so much for making/posting this.
I have been planning on making a mod that relies heavily on shops and this would be perfect for it.
Do you mind if I use your shop in my mod? I will give you credit of course.
Thanks!
Re: Shops (now with source)
Posted: Mon May 06, 2013 7:41 am
by alois
Ulfsark wrote:Thank you so much for making/posting this.
I have been planning on making a mod that relies heavily on shops and this would be perfect for it.
Do you mind if I use your shop in my mod? I will give you credit of course.
Thanks!
Please, feel free to use it, and, should you need help, feel free to contact me!
alois
