Page 1 of 1

BA-Layout

Posted: 19 Sep 2008, 19:31
by NOiZE
Hi Guys,

The BA-Layout widget in BA is broken in 0.77

This widget was made by lurker, he said he would fix it like 1,5 months ago, however it appears he ran out of time, or has set different priority's. So any volunteers who can/want to fix this widget for BA? or write a new one which does the same? (determine the layout of the buildmenu)

Any help is appreciated!

Re: BA-Layout

Posted: 19 Sep 2008, 20:56
by Forboding Angel
I'm pretty sure it's the same widget that he originally wrote for me. And yes I asked about the same length of time ago, yes I'm screwed if it (and other thigns that he wrote) aren't fixed fairly soon.

Re: BA-Layout

Posted: 19 Sep 2008, 21:08
by Andrej
if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub

Re: BA-Layout

Posted: 20 Sep 2008, 02:30
by REVENGE
Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub
So math.mod was changed to math.fmod? Why is this even necessary?

Re: BA-Layout

Posted: 20 Sep 2008, 16:21
by NOiZE
Thanks =)

Re: BA-Layout

Posted: 21 Sep 2008, 08:48
by dizekat
REVENGE wrote:
Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub
So math.mod was changed to math.fmod? Why is this even necessary?
just a guess, maybe math.mod is not doing modulus at all, but doing "floating point modulus" aka a-floor(a/b)*b
edit: correction:
math.mod is indeed doing proper remainder of division, with floats. i.e. math.fmod(-1,0.7) = -0.3

For most practical uses however, thats really not what you need. You need to use operator "%" instead.
-1%0.7 = 0.4 , which is the value you usually want to get when you do modulus on negative number. In my whole career I think I seen no code that would want to get 0 .. 0.7 from modulus when input is positive and -0.7 .. 0 when input is negative.

Re: BA-Layout

Posted: 21 Sep 2008, 12:34
by lurker
No Electricities!

And until 1 day before power loss I was busy at my summer job.

Re: BA-Layout

Posted: 21 Sep 2008, 12:41
by Hoi
Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
"borrowed" from BA

Fixed.

Re: BA-Layout

Posted: 22 Sep 2008, 08:30
by Forboding Angel
Actually they all borrowed from evo if you wanna get picky. :_)

Unless the one lurker made for me the night we stayed up till god knows when is a different one...