Page 8 of 15
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 9:26 pm
by JohnWordsworth
JKos. If I recall correctly, your GUI framework for LOG1 had an "autoexec" mechanism for calling a function from each script entity. Do you have this in the new framework? If so, I can add an autoexec to install the GrimTK methods automatically when using the framework

.
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 9:51 pm
by Slade
Hello, why that sample map keep crashing when i step at the first pressurre plate? And same thing when i tried to GTKGui.Basic.showInfoMessage("blaa"); to my own map.. what im doing wrong? Installed it like readme said. Im a complete noob at lua and everyting but trying hard...so srry

Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 9:55 pm
by JohnWordsworth
Hi Slade. Are you running the latest beta version of Grimrock 2? The latest version of the toolkit only works with 2.2.4 - which is only available through Steam at the moment. If you are not running the Beta, and do not have the Steam version - you can download Alpha 005 for now and then upgrade when the Beta is made public!
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 10:04 pm
by Slade
Oh, my version is 2.1.18 apparently, so where i can download that on steam?(why i cant find it) Thanks for the answer btw

Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 10:12 pm
by Zo Kath Ra
Slade wrote:Oh, my version is 2.1.18 apparently, so where i can download that on steam?(why i cant find it) Thanks for the answer

viewtopic.php?f=18&t=8168&p=82749#p82749
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 10:19 pm
by JKos
@AdrTru:
Oh, right, now I understand what the problem is, the onDrawGui-connector of the grimtk doesn't get called if the party.onDrawGui-hook isn't defined.
This can be fixed by defining a dummy onDrawGui-hook like this in your party-object definition:
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
fw_addHooks{
class = "Party",
onDrawGui = function(party,g)
--Dummy hook for enabling onDrawGui-connectors
end
}
}
}
Defining onDrawGui with hook-framework doesn't really differ from native in any way (other than that the Party-component definition is inside of a fw_addHooks-function call).
onDrawXXX-hooks aren't passed to hook-framework for performance reasons, and it's not even needed with LoG2 since we can use native connectors if we need add/remove onDraw-hooks at runtime.
@JohnW
autoexec is not a part of the hook-framework, I wanted to keep it as simple as possible. However I made a separate script which implements autoexec
viewtopic.php?f=22&t=8132
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 10:22 pm
by JohnWordsworth
@Slade...
1. Steam -> Library
2. Right Click "Legend of Grimrock 2" and click "Properties".
3. Go to "Betas" tab.
4. Select "beta - " from the dropdown.
You may need to restart Steam afterwards.
@JKos: Strangely, if there is no onDrawXXX method in the party definition - then you cannot hook into it using party.party:addConnector("onDrawGui", ...). So, I had to define a completely empty onDrawGui hook in the party definition so that I could add a connector for it later.
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 10:53 pm
by Drakkan
JKos wrote:@AdrTru:
Oh, right, now I understand what the problem is, the onDrawGui-connector of the grimtk doesn't get called if the party.onDrawGui-hook isn't defined.
This can be fixed by defining a dummy onDrawGui-hook like this in your party-object definition:
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
fw_addHooks{
class = "Party",
onDrawGui = function(party,g)
--Dummy hook for enabling onDrawGui-connectors
end
}
}
}
Defining onDrawGui with hook-framework doesn't really differ from native in any way (other than that the Party-component definition is inside of a fw_addHooks-function call).
onDrawXXX-hooks aren't passed to hook-framework for performance reasons, and it's not even needed with LoG2 since we can use native connectors if we need add/remove onDraw-hooks at runtime.
@JohnW
autoexec is not a part of the hook-framework, I wanted to keep it as simple as possible. However I made a separate script which implements autoexec
viewtopic.php?f=22&t=8132
JKos could be there some collide problem between John GUI and your party hiring GUI ? Just asking, cause I still have John GUI dialogues screwed sometimes :/
Re: [WIP] GrimTK GUI Framework
Posted: Tue Mar 03, 2015 11:15 pm
by JKos
I don't think that it's possible, they don't share same variables or anything, so I can not see how they could interfere with each others.
Re: [WIP] GrimTK GUI Framework
Posted: Wed Mar 04, 2015 12:02 am
by Slade
Cool, thanks dudes! Now it works..learned something new about steam too

This is everything that i could ask for a mod! I appreciate your work very much John! And one more question.. : Can you activate that dialog with mouse click?(edit i guess with that npc mod.. need to try out)