Jump to content

[WIP] [1.12.x] HUDReplacer - (v1.2.11-beta)


UltraJohn

Recommended Posts

3 hours ago, zapsnh said:

There should be a toolbar (or any other) button that toggles HUDReplacer's keybinds. I either sometimes find some textures that need texturing during normal sessions (and forget about them) or just forget that I had the dev version installed and either have to suffer with no roll controls or suffer with the atrocious loading times again (mods + HDD).

Right, so at this point I should probably just merge both versions into one dll for ease of use. This will be in the next release.

 

3 hours ago, Nazalassa said:

I have a small idea of thing to add to HUDReplacer: when pressing a key (like 'a' or something) HUDReplacer goes through all loaded textures and dumps them to  GameData/HUDReplacer/PluginData/  or something. Or pressing that key pops out a dialog box where we can enter a texture's name, which HUDReplacer saves to  GameData/HUDReplacer/PluginData/ . Just an idea, but it may help quite a lot.

So as an example, let's say you wanna replace the stock vertical speed gauge at the top. Would you press D to get the current textures names on the mouse, then press A, type in the name of the gauge, then it saves that texture to a folder with the correct name already set? e.g. "GaugeVerticalSpeed#138x138"?

Link to comment
Share on other sites

28 minutes ago, UltraJohn said:

So as an example, let's say you wanna replace the stock vertical speed gauge at the top. Would you press D to get the current textures names on the mouse, then press A, type in the name of the gauge, then it saves that texture to a folder with the correct name already set? e.g. "GaugeVerticalSpeed#138x138"?

Exactly! Also this way we can have access to these ominous "font" textures :)

Link to comment
Share on other sites

Welp, bad news. Looks like it's not possible to read textures from the game data..

Quote

"Texture is not readable. The texture memory cannot be accessed from scripts."

The solution would be to find the import formatter and change the IsReadable flag, but this value is not accessible outside of the unity editor from what I can tell. That means I can't do much about it as it stands right now.

Link to comment
Share on other sites

1.1.0-beta is released.

https://github.com/UltraJohn/HUDReplacer/releases/tag/1.1.0-beta

What's Changed

  • Debug and release versions of the mod have been merged into one dll, for ease of use.
  • Added a toolbar button ingame to enable or disable the developer features.
  • Added a settings manager which is used to enable or disable the toolbar button. Remember to change the setting in HUDReplacer/Settings.cfg showDebugToolbar from false to true to enable the button.
Edited by UltraJohn
Link to comment
Share on other sites

26 minutes ago, Nazalassa said:

They don't change colors - they're always black. Well, I guess I'll have to make my altimeter lighter then... :(

 

Probably colored in code then. I'll see if I can figure something out for that.

Link to comment
Share on other sites

8 hours ago, UltraJohn said:

Aha, I may have found the solution to coloring the numbers...

4GWhp1p.png

 

Edit:

Oh look!

YuG1LRV.png

 

Are there other elements that need recoloring support?

So, how did you do? Is it code?

Anyways, here are my new digits, tell me what you think of them.

7iSXVdD.png

Link to comment
Share on other sites

4 hours ago, Nazalassa said:

So, how did you do? Is it code?

 

Yes it's colored by a material, and it's easy to overwrite with your own:

var tumbler = FindObjectOfType<KSP.UI.Screens.Tumbler>();
if(tumbler != null)
{
  tumbler.SetColor(new Color(r,g,b,a));
}

The downside is that I have to add each type of UI element individually if you want it to support recoloring. Though so far it would only be the Tumbler numerals and letters. If there's more let me know so I can add it.

 

Now to think of how the configs should be structured for this... Perhaps a cfg with something like this?

HUDReplacerRecolor:NEEDS[HUDReplacer]
{
	TumblerNumerals = 1,1,1,1
}

The values given are RGBA with the range going from 0 to 1.

 

4 hours ago, Nazalassa said:

Anyways, here are my new digits, tell me what you think of them.

 

Looks great!

 

1 hour ago, zapsnh said:

I can't theme the Mission Builder since there's no toolbar button for it and I can't use Q, E, or D.

 

Is this the same issue @Nazalassamentioned a few pages back? I don't have the dlc for this, so I can't really test it myself.

I've looked at the options given for KSPAddon.Startup and I don't see an option for this scene specifically. Someone will have to help me with this one.

Link to comment
Share on other sites

43 minutes ago, UltraJohn said:

I've looked at the options given for KSPAddon.Startup and I don't see an option for this scene specifically. Someone will have to help me with this one.

I've got Making History and I also don't see any options for it.
(just to make sure I'm not a dumb goof, are the options in public enum Startup?)

Edited by zapsnh
Link to comment
Share on other sites

54 minutes ago, zapsnh said:

(just to make sure I'm not a dumb goof, are the options in public enum Startup?)

Yeah, that's it. Although with the poor documentation of KSP in general, it's impossible to know if any of them include the mission builder and without access to that menu, I can't test them.

 

Edit:

@zapsnh

Ok so in your screenshot I noticed it's actually loading some of your textures already. That would indicate it might be using the same scene as the main menu.

Since there's no toolbar button on the main menu, what you can try is loading into KSC to spawn the button, then enable debug, back out to the main menu and then try the debug hotkeys. Let me know how that goes.

Edited by UltraJohn
Link to comment
Share on other sites

2 hours ago, UltraJohn said:

I've looked at the options given for KSPAddon.Startup and I don't see an option for this scene specifically. Someone will have to help me with this one.

Maybe try  KSPAddon.Startup.EveryScene  (or so it's named)?
Also I have found this in KSP.log:  kspMissionEditor.unity  (may be useful).

 

2 hours ago, UltraJohn said:

Now to think of how the configs should be structured for this... Perhaps a cfg with something like this?

HUDReplacerRecolor:NEEDS[HUDReplacer]
{
	TumblerNumerals = 1,1,1,1
}

The values given are RGBA with the range going from 0 to 1.

Excellent! Also maybe add a way to specify pointer textures, instead of checking for every image? Like:

HUDReplacer:NEEDS[HUDReplacer]
{
	cursorDir = GameData/<modDirectory>/Cursors
}

(to specify a directory in which the cursors are)

or

HUDReplacer:NEEDS[HUDReplacer]
{
	cursorNormal = GameData/<modDirectory>/Cursors/normal.png
    cursorLeftClick = GameData/<modDirectory>/Cursors/left.png
    cursorRightClick = GameData/<modDirectory>/Cursors/right.png
}

(to specify files individually)

(whatever is better)

Link to comment
Share on other sites

14 minutes ago, Nazalassa said:

Maybe try  KSPAddon.Startup.EveryScene  (or so it's named)?

Well as I mentioned in the edit above, I don't think there's a specific scene used for mission builder, but either way I can't test it myself. Try the "fix" i mentioned and let me know if that works. If not I'll try your idea just to make absolutely sure I didn't miss anything.

 

14 minutes ago, Nazalassa said:

Excellent! Also maybe add a way to specify pointer textures, instead of checking for every image? Like:

 

Not sure what you mean here? The pointer textures already work in the latest version?

 

3 minutes ago, Nazalassa said:

Also, maybe add the orange "window bar" to the list of colorable elements if possible :)

Which one is that?

Edited by UltraJohn
Link to comment
Share on other sites

1 minute ago, UltraJohn said:

Not sure what you mean here? The pointer textures already work in the latest version?

So that we can give meaningful names to pointer textures, and also with this change you can remove all the 'if's from the function that refreshes images, and HR would probably run a little faster. (just a guess)

btw, have you seen @Space Scumbag (aka swdennis)'s video about HR?

6 minutes ago, UltraJohn said:

Which one is that?

The bar at the top of PAWs

Link to comment
Share on other sites

1 hour ago, Nazalassa said:

So that we can give meaningful names to pointer textures, and also with this change you can remove all the 'if's from the function that refreshes images, and HR would probably run a little faster. (just a guess)

 

I can kinda see what you mean, being able to rename the files to something other than basicNeutral? But then you could say the same for every other texture? I'd like to keep it simple to make the configs, and try to allow as much as possible to be automated without requiring writing configs for each individual part. However, in the case of the cursor I might make an exception for that, since it already requires some extra code to work.

 

I will clean up the 'if' code in a future update. In terms of performance, there won't be any noticeable difference between your suggestion, as the current method of loading the cursor textures is done in the same pass as everything else.

 

1 hour ago, Nazalassa said:

btw, have you seen @Space Scumbag (aka swdennis)'s video about HR?

No, I have not. Gonna have to check that out! :D 

 

1 hour ago, Nazalassa said:

The bar at the top of PAWs

Gotcha, I'll look at that next!

 

Edit: PAW yeah!

HKPAhIR.png

Edited by UltraJohn
Link to comment
Share on other sites

I'm seeing some missing buttons in the RP-1 tech tree, can this be the culprit (I'm using ZTheme)?

0kRZAh1.png

EDIT - Not the culprit. It was actually "Hide empty tech tree nodes" which was causing the issue.

Edited by mateusviccari
Found the solution
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...