Revert gl.Text - Page 2

Revert gl.Text

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

lurker wrote:Caydr, zwzsg's function as is has an extremely high chance of conflict if you put it in a standalone widget, and doesn't belong in any of them.
I agree.

So:
FLOZi wrote:It needs to be reverted [...] quick. Otehrwise [..] it will [..] mess everything up [..].
Quoted For Truth!
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Revert gl.Text

Post by lurker »

Well you could do it the boring way, an extra var

Code: Select all

-- Compensate for gl.Text y positioning change between 0.80.0 and 0.80.1
if Game.version == "0.80.2" and not gl.TextAdjusted then
   local glText = gl.Text
   gl.Text = function(text,x,y,size,options)
      if size then
         glText(text,x,y+size/4,size,options)
      else
         glText(text,x,y,size,options)
      end
   end
   gl.TextAdjusted = true
end
Or the fun way, that also is compatible with existing implementations loading first.

Code: Select all

-- Compensate for gl.Text y positioning change between 0.80.0 and 0.80.1
if Game.version == "0.80.2" and debug.getinfo(gl.Text, "S").what == "C" then
   local glText = gl.Text
   gl.Text = function(text,x,y,size,options)
      if size then
         glText(text,x,y+size/4,size,options)
      else
         glText(text,x,y,size,options)
      end
   end
end
I'm just partial to doing this hack in the most horrible of ways, though.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

Well, that doesn't solve the problem of knowing which widget needs which version of gl.Text, or fixing mods and widgets that are not updated anymore.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Revert gl.Text

Post by Caydr »

zwzsg wrote:Well, that doesn't solve the problem of knowing which widget needs which version of gl.Text, or fixing mods and widgets that are not updated anymore.
That's an easy one: ALL of them require the old one, and all of them will continue to need the old one, because this change is retarded.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

Yep, but we're mod maker, not engine devs. Now go convince jK!
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Revert gl.Text

Post by REVENGE »

This sort of shit needs to be discussed with mod-makers ahead of release time.

Stupid.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Revert gl.Text

Post by lurker »

REVENGE wrote:This sort of shit needs to be discussed with mod-makers ahead of release time.

Stupid.
jK wrote:Accidental
I don't know if people in this thread have trouble comprehending the implications of this word or what. Are you calling jK a liar? That would be a valid argument, but say so.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

We just didn't focus on the same words of the same jK post.
jK wrote:Somehow I prefer it this way, so I am hold off to revert it.
Forgive me, English is not my native language, so in my attempt to guess the meaning of "To Hold Of something", I infered from the start of the sentence that it would mean he didn't want to revert.


Also:
#sy wrote:<Auswaschbar> jk: gl.Text was broken before and is now fixed, right?
[..]
<Auswaschbar> gl.Text used a wrong placement method before
<Auswaschbar> jk fixed that
Are you calling Auswaschbar a liar, Lurker?
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Revert gl.Text

Post by Licho »

You are unlikely to get new spring release anytime soon.. unless more serious problems appear..

So why not just fixing widgets for it?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

FLOZi exposed why not.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Revert gl.Text

Post by Auswaschbar »

zwzsg wrote:Also:
#sy wrote:<Auswaschbar> jk: gl.Text was broken before and is now fixed, right?
[..]
<Auswaschbar> gl.Text used a wrong placement method before
<Auswaschbar> jk fixed that
Are you calling Auswaschbar a liar, Lurker?
I you read closely you will notice a question mark. That is there because I was not sure, and only interpreted what he wrote in the commit message.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Revert gl.Text

Post by MelTraX »

By the way: This doesn't only affect LuaUI. With Lua completely disabled you now get resource bars with text overlapping the window border and all the buttons in the share/quit/gameend dialogs are misaligned.

If the tooltip has 5 lines it even touches the bottom of the screen (at least for me).

So this does need a non-Lua fix and since it was an accident I would also favor a revert of the default setting.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Revert gl.Text

Post by Regret »

Licho wrote:You are unlikely to get new spring release anytime soon.. unless more serious problems appear..

So why not just fixing widgets for it?
Something that requires the update of everything is kinda a serious issue ;/
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Revert gl.Text

Post by jK »

Auswaschbar wrote:
zwzsg wrote:Also:
#sy wrote:<Auswaschbar> jk: gl.Text was broken before and is now fixed, right?
[..]
<Auswaschbar> gl.Text used a wrong placement method before
<Auswaschbar> jk fixed that
Are you calling Auswaschbar a liar, Lurker?
I you read closely you will notice a question mark. That is there because I was not sure, and only interpreted what he wrote in the commit message.
Nah, the commit messages means something different (I fixed multilined text in GetTextHeight), the vertical alignment change was an accident and so it wasn't mentioned in it.

@crying crowd
A part of the fact that ppl aren't using the new correct opcodes to vertical align their text to a control (that's what 99% of the ppl seem to want here), also nobody except smoth and lurker even are willing to see why I am reserved to revert it (nor do most here even know what got changed...).
So here is a visualization of the different single-line vertical alignments:
Image
Last edited by jK on 23 Aug 2009, 12:25, edited 1 time in total.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Revert gl.Text

Post by Regret »

jK wrote:A part of the fact that ppl aren't using the new correct opcodes to vertical align their text to a control (that's what 99% of the ppl seem to want here), also nobody except smoth and lurker even are willing to see why I am reserved to revert it (nor do most here even know what got changed...).
So here is a visualization of the different single lined vertical alignments:
Image
I for one want my gl.Text to behave like a rectangle with relative width and height being exactly fontsize. I don't care about 'real textsize'.

If you want a new way to use then include a flag for that way, not change the default.
User avatar
Wisse
Posts: 263
Joined: 10 Jul 2006, 17:50

Re: Revert gl.Text

Post by Wisse »

MelTraX wrote:By the way: This doesn't only affect LuaUI. With Lua completely disabled you now get resource bars with text overlapping the window border and all the buttons in the share/quit/gameend dialogs are misaligned.

If the tooltip has 5 lines it even touches the bottom of the screen (at least for me).

So this does need a non-Lua fix and since it was an accident I would also favor a revert of the default setting.
This.
It's not just lua.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Revert gl.Text

Post by Caydr »

REVENGE wrote:This sort of shit needs to be discussed with mod-makers ahead of release time.

Stupid.
Or tested. Testing could work. I've seen it work with other projects.

Look, I don't want to be a PITA. As long as you can promise with a certainty that the "current" way of doing things isn't going to be arbitrarily, unilaterally changed again because someone thinks "it looks better," it's just a matter of updating widgets once. Which is an asston of unnecessary work at a time when I'm up to my neck in it, but progress is rarely easy, and besides, people are updating widgets all the time anyway.

Just make up your mind on whether it'll be reverted or not and say one way or the other so everyone can get back to business as usual.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Revert gl.Text

Post by zwzsg »

Caydr wrote:it's just a matter of updating widgets once.
You hugely under estimate what that represents. There isn't a single authority maintaining all widgets. You returned only recently, so haven't realised how much Lua has now pervaded Spring. There are hundreds of widgets, hundreds of widget makers, and since widget is kinda easy and fast, they're no as commited, as, let's say, C++ coder. So half of widget makers left Sprng, lost interest in coding, or have other things to do that go back to make new release of all their work of the past three years. For instance, do you honestly think I'm gonna bump or edit all the posts to which I attached a widget? And if I did, would all the people that ever downloaded one widget once upon a time notice my bump or edit? And even if they saw, which is totally unlikely, there's still no guarantee they'll accept to update. And then, there'd be people who got second hand or third hand widgets which I'd have no way to contact because I wouldn't even know what website/downloader/mod they got their widget from, and even if I found out, I'd still have no way to make an update to that place.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Revert gl.Text

Post by AF »

Unmaintained widgets DIE

Its as simple as that, doesnt matter wether it's a change to text/font rendering or another API change, widgets die.

If a widget is worth saving someone will fix it, we have plenty of widgets already that barely work, duplicate other widgets, or are broken already, and most are poorly written anyway.

If it can be guaranteed that this API change will not be messed around with in subsequent releases then I think it should be kept as reverting it would appear to 'remove' features whish is never a good thing.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Revert gl.Text

Post by AF »

I'd also like to raise the point that the time invested in arguing the point in this thread is greater than the time needed to fix the majority of widgets. Stop being so stupid and stubborn and fix it already instead of wasting your time arguing in a thread over an API change that won't be reverted.
Post Reply

Return to “Engine”