Page 2 of 2

Posted: 30 Nov 2007, 22:42
by Forboding Angel
Quantums is way the heck over the top. THis widget is simple and much mroe along the lines of what I wanted.

Posted: 01 Dec 2007, 08:26
by BigHead
I don't think it's caused by svn version. I checked my code and if you don't call Script.LuaUI.setPageOptions(newOptions), no options are set and voila there's your error. It's a bug in the widget becouse default option should be used if nothing is set. Anyway, easiest way to fix it is calling Script.LuaUI.setPageOptions(nil).
Let me know if it helped.

Posted: 01 Dec 2007, 09:29
by Forboding Angel
I have no idea what that means nor how to fix it :/

Posted: 01 Dec 2007, 22:40
by Noruas
Could someone please fix it?

Where do i find it?

Posted: 01 Dec 2007, 22:56
by smoth
BigHead wrote: I don't think it's caused by svn version. I checked my code and if you don't call Script.LuaUI.setPageOptions(newOptions), no options are set and voila there's your error. It's a bug in the widget becouse default option should be used if nothing is set. Anyway, easiest way to fix it is calling Script.LuaUI.setPageOptions(nil).*edits* instead of Script.LuaUI.setPageOptions(newOptions)
Let me know if it helped.
he is saying try this.

Either comment out the line:
Script.LuaUI.setPageOptions(newOptions)

or try:
calling Script.LuaUI.setPageOptions(nil). instead of Script.LuaUI.setPageOptions(newOptions)

if that doesn't fix it let him know.

Posted: 01 Dec 2007, 23:15
by BigHead
8)

My English is worse than I've thought.
You need to call
Script.LuaUI.setPageOptions(newOptions or nil)
before
Script.LuaUI.displayPage(page)

setPageOptions can be used to modify widget size, colors, font and many other things.
There are some default options and newOptions override them. If newOptions is nil, nothing is overrided and defaultOptions are used (options = defaultOptions).
However if you don't call setPageOptions method no options are initialized (options = nil) and you get the error.

Posted: 01 Dec 2007, 23:17
by smoth
I can promise you I cannot speak your language at all. So you are doing better then me bighead!

Posted: 02 Dec 2007, 01:13
by Forboding Angel
and what file is that line in?

I have looked to no avail

Posted: 02 Dec 2007, 01:55
by smoth
what a smart assed thing to do. You know, it isn't like I refuse to help you all the time. Cute that you posted a whole code block.

I can do that to.

Gui_Example_help.lua

Code: Select all

  Script.LuaUI.setPageOptions(options)
  Script.LuaUI.displayPage("unit-guide/some-unit")
OH LAWD

Posted: 02 Dec 2007, 02:36
by AF
Pastebins people!!!

Posted: 02 Dec 2007, 08:27
by BigHead
Btw this is code for another widget I wrote:

Code: Select all

BFBOC (Big Fucking Block of Code)
Ok, so let's all just edit our posts and make them way shorter 8)

Posted: 02 Dec 2007, 09:06
by smoth
LULZ bighead, I just wanna say you are a cool dude.

Posted: 02 Dec 2007, 11:43
by Forboding Angel
smoth wrote:LULZ bighead, I just wanna say you are a cool dude.
That wasn't from the same file smoth. I posted the code block so that you might be arsed to look at it. I didn't know if you have the widget downloaded or not. Also, If I pastebinned it, would you be arsed to click the link?

Or omg, the widget could be updated on UF so that it works with the current spring version *gasped*!

The lua shit is spring is becoming more and more like the spring code every week. NEEDS MORE DOCUMENTATION!

Posted: 02 Dec 2007, 13:00
by BigHead
Uhm ... could anyone please reupload this widget to UF 8)
Edit: Never mind, it's still there ...

Forboding Angel: Were you able to fix your problem? I think you don't understand how this widget works. It's not a standalone help anymore. It only provides you with API (=functions that you can call) that displays your page. In order to use those functions you must create your own widget. See gui_example_help.lua for that. It's disabled by default so you need to enable it to see it.
The easiest way to display your page is calling:

Code: Select all

Script.LuaUI.setPageOptions(nil)
Script.LuaUI.displayPage(path-to-your-page)
I hope it helps ...

Posted: 02 Dec 2007, 22:12
by Wasp
Forboding, you may want to check this out, the list isn't entirely complete but it has enough to get you going.

C:\Program Files\Spring\LuaUI\API.txt

Posted: 03 Dec 2007, 00:32
by Forboding Angel
Bighead, thanks for that clarification.

I was under the impression that it was still a stand alone thing, which is why I couldn't find that line. I was looking in the wrong place.

Yes I have fixed the issue, thanks for the help!

@wasp thanks dude. I Have gone over the wiki, but the wiki isn't a guide so much as it is a list, which to someone who doesn't know lua might as well be written in latin.

@smoth I asked a simple question and didn't understand the answer, so I responded with information about what I was looking at. THere is no point to deride me like that. I had no idea what was going on because it hadn't been explained in a manner that I could understand. Not everyone here knows 50 different languages like you (and that prolly isn't much of an exaggeration), so be a little more patient please.

Posted: 03 Dec 2007, 01:06
by smoth
mods are sleeping. I will do my part.

Posted: 03 Dec 2007, 07:48
by BigHead
not fill bigheads thread with drama