Shops (now with source)
Re: Shops (please test)
Would you be able to gives us the WIP source?
Re: Shops (please test)
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.
Could you make some .dungeon_editor files with life examples? Please.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
MultiAlcoveManager, Toolbox, Graphic text,
Re: Shops (please test)
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!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.
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)
nice introduction and examples of GUI dialogues, ggod work !
how are you progressing with shop ?
how are you progressing with shop ?
Re: Shops (please test)
Slowly, but steadilyDrakkan wrote:nice introduction and examples of GUI dialogues, ggod work !
how are you progressing with shop ?
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)
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
alois
Re: Shops (now with source)
Added the source in the first message (with instructions, too!).
alois
alois
Re: Shops (now with source)
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
- 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)
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!
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)
Please, feel free to use it, and, should you need help, feel free to contact me!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!
alois