Page 1 of 1

Disabling UI

Posted: 19 Aug 2009, 17:40
by Regret
Why does disabling UI using F5 disable LuaUI drawscreen?

Re: Disabling UI

Posted: 19 Aug 2009, 17:45
by imbaczek
do i infer correctly this breaks Lua effects?

Re: Disabling UI

Posted: 19 Aug 2009, 17:46
by Regret
yes (actually not sure if all)

Re: Disabling UI

Posted: 19 Aug 2009, 17:57
by Auswaschbar
Which ones?
Commander nametags -> work
Display DPS -> works
LUPS -> works

Re: Disabling UI

Posted: 19 Aug 2009, 17:59
by Regret
Auswaschbar wrote:Which ones?
Commander nametags -> work
Display DPS -> works
LUPS -> works
Regret wrote:drawscreen
All those use drawworld etc afaik.

Re: Disabling UI

Posted: 19 Aug 2009, 18:00
by imbaczek
isn't drawworld the place you should be drawing effects, anyway?

edit: i've got a feeling that you actually want a different callin with a working name of DrawScreenUIHidden.

Re: Disabling UI

Posted: 19 Aug 2009, 18:03
by Regret
imbaczek wrote:isn't drawworld the place you should be drawing effects, anyway?

edit: i've got a feeling that you actually want a different callin with a working name of DrawScreenUIHidden.
No, there already is a check to see whether UI is disabled, I don't see the point to force drawscreen disabled.

Spring.IsGUIHidden

Re: Disabling UI

Posted: 19 Aug 2009, 18:04
by Auswaschbar
Regret wrote:
imbaczek wrote:isn't drawworld the place you should be drawing effects, anyway?

edit: i've got a feeling that you actually want a different callin with a working name of DrawScreenUIHidden.
No, there already is a check to see whether UI is disabled, I don't see the point to force drawscreen disabled.
WHy would someone call DrawScreen if screen drawing is disabled anyway?

Btw, you also fail to give any example widget...

Re: Disabling UI

Posted: 19 Aug 2009, 18:05
by Regret
Auswaschbar wrote:WHy would someone call DrawScreen if screen drawing is disabled anyway?

Btw, you also fail to give any example widget...
To change cursor size.

http://springrts.com/phpbb/viewtopic.php?f=23&t=19934

Re: Disabling UI

Posted: 19 Aug 2009, 18:10
by imbaczek
Regret wrote:No, there already is a check to see whether UI is disabled, I don't see the point to force drawscreen disabled.
1) clean separation of responsibility
2) backwards compatibility

Re: Disabling UI

Posted: 19 Aug 2009, 18:12
by Regret
imbaczek wrote:1) clean separation of responsibility
2) backwards compatibility
Drawscreen was always enabled. The disabling when UI is hidden was introduced only in recent spring versions. So what backwards compatibility are you talking about?

Also widget makers are responsible for checking whether UI is hidden with Spring.IsGUIHidden().

Re: Disabling UI

Posted: 19 Aug 2009, 18:16
by imbaczek
no idea, i didn't design the api nor do i follow changes in it; it's how i'd do it. if it was working differently than it is now, there should be a rationale somewhere.

Re: Disabling UI

Posted: 19 Aug 2009, 18:18
by Regret
imbaczek wrote:no idea, i didn't design the api nor do i follow changes in it; it's how i'd do it. if it was working differently than it is now, there should be a rationale somewhere.
What on earth is the Spring.IsGUIHidden for then? It was always used in drawscreen. There is no rational explanation for forcing drawscreen to be disabled other than catering to lazy widget makers that do not make the said check.

Re: Disabling UI

Posted: 19 Aug 2009, 19:16
by Auswaschbar
Spring.SetMouseCursor should be called from widget:Update anyway (see trepans SmoothScroll-widget).

Re: Disabling UI

Posted: 19 Aug 2009, 19:52
by Regret
Auswaschbar wrote:Spring.SetMouseCursor should be called from widget:Update anyway (see trepans SmoothScroll-widget).
It does not work in Update.

EDIT: seems there is widget:DrawScreenEffects() which makes this topic nil.