Jump to content

[1.12.x] Toolbar Continued - Common API for draggable/resizable buttons toolbar


Recommended Posts

20 hours ago, linuxgurugamer said:

Sorry about the long time

No need to apologize, it is us players who have to say thank you for your time and efforts :) 

 

20 hours ago, linuxgurugamer said:

this was a very hard one to find, even though it was a single line to change.

 I'm curious, what was it then? 

 

Link to comment
Share on other sites

6 minutes ago, VoidSquid said:

No need to apologize, it is us players who have to say thank you for your time and efforts :) 

 

 I'm curious, what was it then? 

 

This requires a bit of an explanation:

When KSP loads images during the initial starting of the game, it does some sort of compression on the texture in order to save space.  When loading icons which weren't made with the correct dimensions, the end result is a blurring of the icon.  There is some disagreement as to what is exactly going on, but the end result is a blurring of  the icon.

In order to avoid the blurring of icons (which the unBlur was supposed to take care of), I have code which reads the image directly from the file if it exists.  My code avoids the issue with KSP loading by doing it myself.

Ok.  The bug in this case had to do with these specific mods, which do NOT have the icons on disk, rather, they are compiled into the code as a resource.  These were the only mods that I know of which do this.  I'm not going to get into a discussion about which is better.

The problem was that the function which checked for the existence of the file was returning True even if the file wasn't there.  So when the toolbar tries to load the missing file, it obviously gets nothing.  Once I fixed it, when the file isn't there, it loads from the KSP game database

Link to comment
Share on other sites

That's quite interesting, the quirks and quarks of writing code which depends on what other folks thought is the way to go. Sounds familiar, though I'm just doing some minor scripting at work.

30 minutes ago, linuxgurugamer said:

they are compiled into the code as a resource

That sounds odd, why would one do that (pretty sure there are reasons, lol)? Not easy to deal with this, I'd say, and hard to get around this, I think.

30 minutes ago, linuxgurugamer said:

returning True even if the file wasn't there.  So when the toolbar tries to load the missing file, it obviously gets nothing.  Once I fixed it, when the file isn't there, it loads from the KSP game database

Glad you found it, definitely a tricky one, yes. I do remember having spent hours finding out about odd ways stuff has been made, and that's only talking stupid Powershell/Exchange/AD scripting stuff (back tick, anyone?) :D 

Thanks a lot for the explanation and the fix! :) 

Edited by VoidSquid
Link to comment
Share on other sites

9 minutes ago, VoidSquid said:

Uh oh... hate to say it, but now, TAC Fuel Balancer is purple again :( 

Reverting to 1.7.20 with Unblur then. 

It would be just a little helpful if you said which toolbar it was purple in, and if you did anything to get it that way.  Otherwise i have to guess and take more time to figure it out

Link to comment
Share on other sites

7 minutes ago, linuxgurugamer said:

It would be just a little helpful if you said which toolbar it was purple

Blizzy's, stock toolbar unaffected.

 

7 minutes ago, linuxgurugamer said:

and if you did anything to get it that way

Updated Toolbar from 1.7.20 to 1.7.22.2, removed Unblur 0.5.0 

All via CKAN 1.26.4

Edited by VoidSquid
Link to comment
Share on other sites

14 minutes ago, linuxgurugamer said:

That's actually a bug in TacFuelBalancer.  The mod had the suffix appended to the file name, while the Toolbar wasn't expecting that.

Then: how did Unblur manage this? Or to be more precise: why did it work with 1.7.20 plus Unblur?

APIs...

Edited by VoidSquid
Link to comment
Share on other sites

2 minutes ago, VoidSquid said:

Then: how did Unblur manage this? Or to be more precise: why did it work with 1.7.20 plus Unblur?

APIs...

One bug covered another bug.  When i did the TAC conversion to the toolbarcontrol, it was tested with the broken version

2 minutes ago, VoidSquid said:

I'm sorry... :(

Let me know if there's anything I can do for you, ok?

Reporting the problems is good. Just be a little more specific.  One reason it took me so long to find the main bug was that I couldn't replicate it in the stock toolbar.  I didn't realize that it was only in the Blizzy toolbar

Link to comment
Share on other sites

Oh, I see... I thought it was obvious that Blizzy's was meant (the mod is about that toolbar), not stock. Does this mod also affect stock the toolbar then?

Anyway, that was easy to clarify, you asked 

49 minutes ago, linuxgurugamer said:

which toolbar it was

and could answer this :) 

More often than not, when my customers do complain, the main job is to get useful information from them to understand the core of the issue, I can very much follow you here :) 

Need to catch some sleep, work awaits only too soon. Talk to you soon, and have a good night as well. :) 

Edited by VoidSquid
Link to comment
Share on other sites

11 minutes ago, VoidSquid said:

Oh, I see... I thought it was obvious that Blizzy's was meant (the mod is about that toolbar), not stock. Does this mod also affect stock the toolbar then?

Anyway, that was easy to clarify, you asked 

and could answer this :) 

More often than not, when my customers do complain, the main job is to get useful information from them to understand the core of the issue, I can very much follow you here :) 

Need to catch some sleep, work awaits only too soon. Talk to you soon, and have a good night as well. :) 

The Toolbar Controller works with both the stock and the Blizzy toolbar.  All my mods, and many others, use it

Link to comment
Share on other sites

On 8/25/2019 at 7:41 AM, linuxgurugamer said:

For those who are having the "purple icon" issue, can you respond and say which toolbar it's happening in?  The Blizzy or the stock toolbar (or both)?

@VoidSquid @Phil deCube

 @CoriW @AG5BPilot 

In Blizzy only. An update the other day seems to have fixed it. All Blizzy icons are good now.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
18 hours ago, linuxgurugamer said:

Yes, although for various reasons I won't be able to start my updates until next week.

Coolio,

I thought at first the little black square was something I was doing, like video drivers or something. Then it dawned on me the little checkerboard was missing.

Homer

Edited by Homer_S
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...