[WIP] GrimTK GUI Framework

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [WIP] GrimTK GUI Framework

Post by Drakkan »

looking fantastic! In case not prepared, please could you include some examples:

- how to display some picture inside Simple Message Box and change its position
- have you somehow worked on custom size of the message inbox ? If it is somehow easy customizable, because I am planning lots of text and the window is quite small
- I do not have noticed if you have somehow solved the "freeze" world option when message box is displayed (curently I can move freely and disable that way the message box)

- is the text box windowreacting somehow on what is written in ? Perhaps some example could be fine

btw these advanced scripts are really impressive !
looking forward to dialogue system !
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] GrimTK GUI Framework

Post by JohnWordsworth »

Thanks Drakkan! I intend to have a bunch of "built-in" one-liners that you can use to fire off a few different UIs. I will make one with bigger texts in mind soon with a lot more space on the screen.

At the moment, the world freezes when you use the edit boxes (so you don't move around when typing), but I will make it so that you can just attach a flag to an active window (freezeParty), and if that is set on any active window, it will freeze the party until the window has gone away.

Good idea for an example of how to get text from a window. I'll keep building up the examples in the same dungeon so that they will all be there whenever I add new features. :)
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: [WIP] GrimTK GUI Framework

Post by Eleven Warrior »

Truly awesome John, cant wait to see it :)
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: [WIP] GrimTK GUI Framework

Post by cameronC »

I haven't done anything with the gui framework yet - I spent a nice while going through the code, though, and it's pretty beautiful stuff. The demo dungeon does a nice job of showing off some of the capabilities and possibilities.

A potential "one-liner" I know I'd be interested in: A box with a list of choices, and an area below that changes based on what is selected. My particular use case would be, for example, an item that onUse would display a small selection of traits and highlighting each would allow that traits description to be displayed below. The selected trait when an accept button is pressed is then added to the champion that used the item. Obviously this has a lot of potential uses, probably chiefly as a shop interface, but I don't know if this qualifies as "one-liner", though it certainly looks like it would be possible at least.
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] GrimTK GUI Framework

Post by JohnWordsworth »

Just a quick preview of what I hope to release tomorrow...

Dialogue System Screenshot

As usual, it will be very easy to use...

Code: Select all

local options = {
	speakerName = "Forest Ogre",
	message = "Hello puny adventurer. I am a nice ogre and I am going to give you one chance to save your skin before I destroy you...",
	responses = {
		{ text = "Hahahah. You do not scare me!" },
		{ text = "Oh. Erm. Okay. Whatever you say." },
		{ text = "Noooo. Please don't hurt me Mr Ogre Sir!" }
	}
}
GTKGui.Dialogue.showDialoguePage(options);
I intend to make it possible to chain together the pages with a single call too, but I've not quite finished designing that. I also hope to add lots of options too (and optional portrait for the speaker, an optional "top image" that sits in the top half of the screen if you want that).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: [WIP] GrimTK GUI Framework

Post by Drakkan »

JohnWordsworth wrote:Just a quick preview of what I hope to release tomorrow...

Dialogue System Screenshot

As usual, it will be very easy to use...

Code: Select all

local options = {
	speakerName = "Forest Ogre",
	message = "Hello puny adventurer. I am a nice ogre and I am going to give you one chance to save your skin before I destroy you...",
	responses = {
		{ text = "Hahahah. You do not scare me!" },
		{ text = "Oh. Erm. Okay. Whatever you say." },
		{ text = "Noooo. Please don't hurt me Mr Ogre Sir!" }
	}
}
GTKGui.Dialogue.showDialoguePage(options);
I intend to make it possible to chain together the pages with a single call too, but I've not quite finished designing that. I also hope to add lots of options too (and optional portrait for the speaker, an optional "top image" that sits in the top half of the screen if you want that).
cool .I wonder how you define for each answer to which "page" of dialogue go to (or what to do ?)

example:
{ text = "Hahahah. You do not scare me!" },
{ text = "Oh. Erm. Okay. Whatever you say." },
{ text = "Noooo. Please don't hurt me Mr Ogre Sir!" }

if I click text row 1, I want open dialogue where ogre is saying: "I kill you" and when press Ok, dialogue is closed and fight begin
if I click row 2 another dialogue window is opened with another different answers
if I click row 3 answer I want some fucntion to be enabled and some door to be opened... etc.

I think it will be much more cleaner when you release it. cannot wait ! :)
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] GrimTK GUI Framework

Post by JohnWordsworth »

So the "single page" option will allow you to provide a callback function, but the full system will allow you to provide multiple "pages" and then simply define which page to go to if they select something. Probably something like this (still WIP).

Code: Select all

pages = {
  { 
    id = "first", speakerName = "John", message = "some text", responses = {
      { text = "Option A", nextPage = "second" },
      { text = "Option B", callback = someFunction }
    },
    id = "second", speakerName = "Drakkan", message = "some other text", responses = {
      { text = "Please repeat that!", nextPage = "first" },
      { text = "Quit", closeDialogue = true }
    }
  }
}
Something like that anyway :)
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [WIP] GrimTK GUI Framework

Post by JohnWordsworth »

Going to try to upload a (half-finished) preview version tomorrow, but I didn't get all of the features in today that I'd hoped I'm afraid.

Here's a preview of the latest changes though (might take a while for the high-res one to be available).

http://youtu.be/ZbX5_-dFyhY
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Skuggasveinn
Posts: 561
Joined: Wed Sep 26, 2012 5:28 pm

Re: [WIP] GrimTK GUI Framework

Post by Skuggasveinn »

This is looking seriously cool :shock:
Fantastic works (as always).

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [WIP] GrimTK GUI Framework

Post by Grimfan »

you are the MAN John!!!!! :shock:

Seriously, this is brilliant stuff. The possibilities this will open up to modders are too many to count.

AH should take note. Grimrock 3 should incorporate these features in some capacity.

Also, take as much time as you need. ;)
Post Reply