Page 10 of 15

Re: [WIP] GrimTK GUI Framework

Posted: Fri Jul 03, 2015 12:16 am
by Duncan1246
JohnWordsworth wrote:GrimTK GUI Alpha 007 Released.

Release Notes
Hi John,
After my first juicy experience in GrimTK in ORR3, I decided to use it in my mod. I have already fw, so I read carefully the readme of GrimTK07 and I add this in my init.lua:
SpoilerShow

Code: Select all

import "mod_assets/grimtk/init.lua"
defineObject{
   name = "party",
   baseObject = "party",
   components = {
        fw_addHooks{
            class = "Party",
		onDrawGui = function(party, g)
				
			end,
		onRest = function(party)
			if ( findEntity("GTK") ) then
				if ( GTK.Core.GUI:isPartyLocked() ) then
					return false;
				end
			end			
		end,
		onWakeUp = function(party)
			if ( findEntity("GTK") ) then
				if ( GTK.Core.GUI:isPartyLocked() ) then
					return false;
				end
			end
		end
        },
   },
}
Hi John,
I have installed now GrimTK 8, and I have the same problem: any call to GTK.GUI falls, particularly "GTKGui.Dialogue.startDialogue".
I don't understand where is the problem, even in comparing my mod with ORR3 where the gui works well.
Can you help me?
Duncan

Re: [WIP] GrimTK GUI Framework

Posted: Fri Jul 03, 2015 6:41 am
by cromcrom
John,

just to let you know I am using this feature in my mod now, and thanking you a lot for creating and sharing. :)

Re: [WIP] GrimTK GUI Framework

Posted: Sun Jul 05, 2015 7:48 pm
by cromcrom
hmmmm, there seems to be a debug window somewhere, but I can't make it appear i, the editor. Any tip please ?

Re: [WIP] GrimTK GUI Framework

Posted: Sun Jul 12, 2015 9:28 pm
by JohnWordsworth
Hey CromCrom, great to hear you're using the GTK. Let me know how you get on :).

In other news - I have added a few updates and released GTK Alpha 008.
  • Can now call GTKGui.Dialogue.showDialoguePage(<page_name>) to jump to a page in the current dialogue.
  • Dialogue response onSelect callbacks can also return a page_name to jump straight to that page.
  • Added a basic shopkeeper example where you can buy items using a dialogue.

Re: [WIP] GrimTK GUI Framework

Posted: Mon Jul 20, 2015 12:28 am
by cromcrom
Thank you, I am doing the finishing touches for my revamped crafting system, using GrimTK. I will be done soon, and will post pictures, and maybe a short tut video. However, I am stuck trying to "dynamically" change the text inside labels, for the "GPushButton" widget.
I could probably create two buttons on the same place, and make one appear and the other disappear, but well...
Any help please ?

Re: [WIP] GrimTK GUI Framework

Posted: Mon Jul 20, 2015 7:54 am
by Drakkan
intro / ending cinematics update pleeeease ? :)

Re: [WIP] GrimTK GUI Framework

Posted: Mon Jul 20, 2015 9:08 am
by THOM
...and the writable notebook!


(poor John - he has not enough to do with Grimrock-things these days... :mrgreen: )

Re: [WIP] GrimTK GUI Framework

Posted: Mon Jul 20, 2015 2:37 pm
by cromcrom
Here John, thank you again, and again, and again, and.... ^^

viewtopic.php?f=23&t=8469&start=20#p97442

Re: [WIP] GrimTK GUI Framework

Posted: Tue Aug 18, 2015 1:05 pm
by cromcrom
Help please,
is there a way to dynamically change text inside labels ?
My button definition is that:

Code: Select all

			{
				type = "GPushButton",
				position = {200, 450},
				size = {400, 20},
				name = "launchCrafting",
				label = {
					padding = {1, 1, 1, 1},
					text = "LAUNCH CRAFTING (or not)",
					font = GTK.Constants.Fonts.Large,
					textAlign = GTK.Constants.TextAlign.Center,				
				},
				onPressed = self.go.id .. ".script.craftItem"
			},
but this:

Code: Select all

	if launchCraftBool then 
		launchCrafting.data.textColor = {51,204,0,255}
		launchCrafting.data.text = "Launch crafting"
	else
		launchCrafting.data.textColor = {204,0,51,255}
		launchCrafting.data.text = "CAN'T CRAFT"	
	end
has no effect on the button text.

Re: [WIP] GrimTK GUI Framework

Posted: Tue Aug 18, 2015 6:19 pm
by JohnWordsworth
In order to change the text on a label you first have to get the label's data structure from the window. When you create the window, you can either keep a reference to that window around but assuming you have no information at all, you can do the following...

Code: Select all

local window = GTK.Core.GUI:getWindow("window_name");

if window then
	local label = window:findChild("launchCrafting")

 	if label then 
		label.data.text = "NEW TEXT"
	end
end