Jump to content

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


UltraJohn

Recommended Posts

Spoiler

Am stupid, accidentally copied the files (including the old config file) to GameData and didn't notice.
When I moved the folders to `PluginData`, HUDReplacer can't load the files. The config file is correct (i think) but when I view the console it looks like it's trying to load the older directory locations.
zip file with the folders in plugindata
ksp.log

I also tried reinstalling HUDReplacer but it still persists.

--
Also,

Requesting recoloring support for the PAW blue buttons.

Edited by zapsnh
Link to comment
Share on other sites

btw, did some research:

  • GameObject  things have little, if not no, documentation
  • [WRN 16:21:50.556] Texture load error in '/home/ivyroot/Utility/KSP/GameData/Naztheme/KALeditor/keyframe_step_forward#64x64.png': HTTP/1.1 404 Not Found

 

Spoiler
[LOG 17:16:49.871] altUI: Awaking on scene change  [ -> FLIGHT ] ...
[LOG 17:16:49.871] altUI: Looking for UI elements...
[LOG 17:16:49.872] altUI: hello: 'IVACollapseGroup (UnityEngine.GameObject)'
[LOG 17:16:49.872] altUI: Destroying hello (aka IVACollapseGroup) ...
[LOG 17:16:49.872] altUI: Hello (aka IVACollapseGroup) destroyed.
[LOG 17:16:49.872] altUI: Awake finished on scene change  [ -> FLIGHT ] ...

3qVtyaX.png

Destroyed altimeter!!

btw, the arrow is the map-view-filters-toggling one. Apparently they didn't bother hiding it when out of map view.

Link to comment
Share on other sites

39 minutes ago, Nazalassa said:
Spoiler

Destroyed altimeter!!

Definetely don't destroy the gameobject, that's gonna cause issues.

A few options you could try instead:

  • gameObject.GetComponent<Renderer>().enabled = false;

    or

  • gameObject.transform.localScale = new Vector3(0, 0, 0);

 

 

43 minutes ago, Nazalassa said:
  • [WRN 16:21:50.556] Texture load error in '/home/ivyroot/Utility/KSP/GameData/Naztheme/KALeditor/keyframe_step_forward#64x64.png': HTTP/1.1 404 Not Found

Try changing your texture directory to GameData/Naztheme/PluginData/KALeditor/ and see what happens.

 

44 minutes ago, Nazalassa said:

btw, the arrow is the map-view-filters-toggling one. Apparently they didn't bother hiding it when out of map view.

The one hidden behind where the altimeter was? Yeah lol

Link to comment
Share on other sites

21 minutes ago, UltraJohn said:

Definetely don't destroy the gameobject, that's gonna cause issues.

Yeah, I got error spam lol, programming is fun!

 

28 minutes ago, UltraJohn said:

Try changing your texture directory to GameData/Naztheme/PluginData/KALeditor/ and see what happens.

It's gone, indeed.

OK, I'm looking at the Unity documentation, since it appears GameObject is from Unity and not KSP itself.

30 minutes ago, UltraJohn said:

A few options you could try instead:

  • gameObject.GetComponent<Renderer>().enabled = false;

    or

  • gameObject.transform.localScale = new Vector3(0, 0, 0);

Looks like it's getting some issues.

[LOG 18:35:47.023] altUI: Awaking on scene change  [ -> FLIGHT ] ...
[LOG 18:35:47.023] altUI: Looking for UI elements...
[LOG 18:35:47.024] altUI: hello: 'IVACollapseGroup (UnityEngine.GameObject)'
[LOG 18:35:47.024] altUI: Hiding hello (aka IVACollapseGroup) ...
[EXC 18:35:47.044] NullReferenceException: Object reference not set to an instance of an object
	altUI.altUI.Awake () (at <510c2692861a4ec799ec1d735288c4be>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.GameObject:AddComponent(Type)
	AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
	AddonLoader:StartAddons(Startup)
	AddonLoader:OnLevelLoaded(GameScenes)
	AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
	UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

 

Link to comment
Share on other sites

4 hours ago, zapsnh said:

Requesting recoloring support for the PAW blue buttons.

Gotta love how there's 6 different textures for just the blue button.

Also classic KSP having the texture colored blue, but actually overwriting that in code instead.. I was just about to reply and tell you to just recolor the texture, but I see you already tried that :D

Anyway, are there any other buttons that need recolor support? For example the flow priority - + 0 and the left/right variant icons? Might as well try to grab as many in one batch as possible.

0KNkyp5.png

Link to comment
Share on other sites

11 minutes ago, Nazalassa said:

I'll try that instead:

hello.SetActive(false);

OK so that spams the log with these instead.

Coroutine couldn't be started because the the game object 'TrackingFilters' is inactive!

SetActive(false) is the sort of equivalent to destroying the object - it can no longer run functions, which is not what you want.

Link to comment
Share on other sites

I found the following components:

[LOG 18:57:34.214] altUI: Awaking on scene change  [ -> FLIGHT ] ...
[LOG 18:57:34.214] altUI: Looking for UI elements...
[LOG 18:57:34.215] altUI: hello: 'IVACollapseGroup (UnityEngine.GameObject)'
[LOG 18:57:34.215] altUI: Component found for hello (aka IVACollapseGroup): 'IVACollapseGroup (UnityEngine.RectTransform)'
[LOG 18:57:34.215] altUI: Component found for hello (aka IVACollapseGroup): 'IVACollapseGroup (KSP.UI.UIPanelTransition)'
[LOG 18:57:34.215] altUI: Hiding hello (aka IVACollapseGroup) ...
[LOG 18:57:34.215] altUI: Hello (aka IVACollapseGroup) hidden.
[LOG 18:57:34.216] altUI: hello: 'TrackingFilters (UnityEngine.GameObject)'
[LOG 18:57:34.216] altUI: Component found for hello (aka TrackingFilters): 'TrackingFilters (UnityEngine.RectTransform)'
[LOG 18:57:34.216] altUI: Component found for hello (aka TrackingFilters): 'TrackingFilters (MapViewFiltering)'
[LOG 18:57:34.216] altUI: Component found for hello (aka TrackingFilters): 'TrackingFilters (KSP.UI.UIPanelTransitionToggle)'
[LOG 18:57:34.216] altUI: Hiding hello (aka TrackingFilters) ...
[LOG 18:57:34.216] altUI: Hello (aka TrackingFilters) hidden.
[LOG 18:57:34.216] altUI: Awake finished on scene change  [ -> FLIGHT ] ...

There's no "render" component which explains why disabling it didn't work, but what can I do with the "RectTransform"?

Link to comment
Share on other sites

Doesn't the altimeter disappear when your vessel is destroyed? That would mean there should already be a method call somewhere you can use to simulate the same behavior. It might be more optimal to use this.

You might be able to find something referring to Vessel.altimeterDisplayState for that to toggle it on/off.

41 minutes ago, Nazalassa said:

There's no "render" component which explains why disabling it didn't work, but what can I do with the "RectTransform"?

It was just a shot in the dark to see if it would work. Might need to be altered a bit. Also I pulled it from a Google result, so I can't really tell you :D 

https://discussions.unity.com/t/how-can-i-hide-a-gameobject-without-active-false/64919

 

Link to comment
Share on other sites

9 hours ago, UltraJohn said:

Anyway, are there any other buttons that need recolor support? For example the flow priority - + 0 and the left/right variant icons? Might as well try to grab as many in one batch as possible.

- The flow priority and the < > change variant icons.
- The maneuver mode text
- Fuel indicators (I want to recolor the label and the gauge separately like this)
- OrbitIcons.png (I have |no idea| what is going on with these, so good luck? screenshot with a 16x16 checkerboard pattern (#FF006E and #000))
- Maybe the orbital lines?

--
I've also noticed some weird artifacts with some textures, probably a byproduct of image resampling:

Spoiler

Screenshot%202023-07-11%20102044.png Top-left: There are some green pixels that don't exist in the original SAS texture.
Screenshot%202023-07-11%20102622.png Right: Ignore the white pixels on the top. The funds border should look seamless with the background, however, there's some darker pixels which ruins the seamlessness.

Edited by zapsnh
Link to comment
Share on other sites

5 hours ago, zapsnh said:

I've also noticed some weird artifacts with some textures, probably a byproduct of image resampling:

Hmm very strange. I don't recall noticing those green pixels ingame when I tried the latest version of Ztheme? And those darker pixels look very odd indeed.

 

5 hours ago, zapsnh said:

- Fuel indicators (I want to recolor the label and the gauge separately like this)

Is that the green bars? If you can screenshot and circle out each thing on the list you want done, it would be easier to remember what is what :D

But anyway I'll see what I can do. I've already got the blue buttons finished! :)

Link to comment
Share on other sites

8 hours ago, zapsnh said:

The funds border should look seamless with the background, however, there's some darker pixels which ruins the seamlessness.

Add a border around the funds UI element, which is the exact same color as the funds background, but with an opacity as low as you can (like 1/100). It will still blend, but it will be almost seamless since the blending apparently also includes alpha, so it'll be nearly invisible.

oh, btw, I have some good news for my ui-deleting mod: (/!\ spoiler contains "computer science vocabulary")

Spoiler

I finally managed to mount its folder on the computer which has the C# compiler on (not the one with KSP) over ssh (with sshfs and an ethernet cable), so I no longer need to transfer the sources and binaries back and forth.
Yes, the compiler is on a separate computer. For reasons.

Edited by Nazalassa
ALL HAIL SSHFS!!
Link to comment
Share on other sites

2 hours ago, UltraJohn said:

Is that the green bars? If you can screenshot and circle out each thing on the list you want done, it would be easier to remember what is what :D

Yes
I think the dV indicator background also is hard colored so maybe you could look into that.
Screenshot-6227.png
The coloring of OrbitalIcons.png seems to be a mess. Here's the screenshot again and here's the checkerboard texture. The texture is a magenta/pink and black but in the screenshot some are red-black and blue-black.

Link to comment
Share on other sites

10 minutes ago, zapsnh said:

The coloring of OrbitalIcons.png seems to be a mess. Here's the screenshot again and here's the checkerboard texture. The texture is a magenta/pink and black but in the screenshot some are red-black and blue-black.

Could you check whether TUFX is shading it?

 

11 minutes ago, zapsnh said:

I think the dV indicator background also is hard colored so maybe you could look into that.

(the blue background yes?) Is it not one of these:

    stageTotalDeltaVColor = 1,1,1,0.957
    stageGroupDeltaVTextColor = 0.816,0.816,0.835,1
    stageGroupDeltaVNumberColor = 1,1,1,0.957

I need a better method of remembering what setting is for what... lol

Link to comment
Share on other sites

58 minutes ago, UltraJohn said:

Could you check whether TUFX is shading it?

I doubt TUFX is shading it. I'll uninstall TUFX just in case though.
Nope. It is not TUFX.

58 minutes ago, UltraJohn said:

(the blue background yes?) Is it not one of these:

    stageTotalDeltaVColor = 1,1,1,0.957
    stageGroupDeltaVTextColor = 0.816,0.816,0.835,1
    stageGroupDeltaVNumberColor = 1,1,1,0.957

It's none of those, they're all text colors (that are colored slightly differently for some reason).

Edited by zapsnh
Link to comment
Share on other sites

42 minutes ago, zapsnh said:

The coloring of OrbitalIcons.png seems to be a mess. Here's the screenshot again and here's the checkerboard texture. The texture is a magenta/pink and black but in the screenshot some are red-black and blue-black.

I think it's the same thing as the needles for pitch/yaw/roll/etc: depending on the color it wants them to be (orbit line color) the game will "recolor" them.

Also, I think we'll need to do some work with OrbitalIcons.png, to determine what is what.

(compilation successful)

Link to comment
Share on other sites

On 7/11/2023 at 7:47 PM, Nazalassa said:

Also, I think we'll need to do some work with OrbitalIcons.png, to determine what is what.

I've found out that the texture is a 5*5 grid of icons (~102px*~102px (icons are different from this size)). Here's a texture with number labels (left to right) and a list of what some numbers mean:

[1] and [2] Ap and Pe Icons
[3] Ascending Node
[4] Descending Node
[5] Airplane icon
[6] Ship Capsule (the one that looks like the Mk1 Command Pod)
[7] Debris
[8] Planet body
[9] Unknown object
[10] Relay
[11] Entering SOI icon
[12] Escaping SOI icon
[13] Kerbal icon
[14] Planet location icon [?] (the icon you get when you hover over the escape SOI icon or when planning a maneuver) It's also the icon that shows up when you hover over the orbit line
[15] ?
[16] Closest approach icon
[17] Target position at closest approach
[18] Maneuver icon
[19] Space station
[20] Asteroid
[21] Rover
[22] Probe
[23] Base
[24] Lander
[25] Flag

Edited by zapsnh
Link to comment
Share on other sites

I think I'll stop the C# for today, and work on HUDReplacer stuff for the rest of the day.

I managed to do this: https://github.com/Nazalassa/Misc/raw/Misc-files-to-host/wheeeUI.tar.gz (source code included), you should give it a try

P.S if you do, it's even funnier if you add this to conf.cfg:

WHEEEUI
{
	name = NavBall
	amount = 5
}
Link to comment
Share on other sites

So interestingly while I was finding the correct places to hook into these colors, I found that there's four different method calls for setting the color.

ProtoStageIconInfo.SetMsgTextColor() = Text color (red)
ProtoStageIconInfo.SetProgressBarColor() = Fill color (purple)
ProtoStageIconInfo.SetProgressBarBgColor() = Fill background color (blue)
ProtoStageIconInfo.SetMsgBgColor() = ???? (yellow)

KNr7gHS.png

I can't really tell if the yellow one is supposed to be the background color (shadow) of the text. Still gotta find out where the hook for the green title background color is as well. I thought it was gonna be the yellow one, but oh well.

Edit: nevermind, that IS the correct one! I guess I got my RGB's wrong :D 

Now what would this fuel slider menu thing even be called? Is that what a 'Proto Stage' is? lol. What do you guys suggest I name it for the config?

Edited by UltraJohn
Link to comment
Share on other sites

1.2.7-beta is released.

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

 

What's Changed

  • Recolor support for: PAW Blue button (PAWBlueButton), Blue toggle button (PAWBlueButtonToggle)
  • Recolor support for: Variant selector Previous/Next buttons (PAWVariantSelectorNext, PAWVariantSelectorPrevious)
  • Recolor support for: PAW Fuel priority buttons (PAWResourcePriorityIncrease, PAWResourcePriorityDecrease, PAWResourcePriorityReset)
  • Recolor support for: PAW Fuel slider text color and fill color (PAWFuelSliderTextColor, PAWFuelSliderColor)
  • Recolor support for: Stage group DeltaV background color (stageGroupDeltaVBackgroundColor)
  • Recolor support for: Maneuver node editor text color (maneuverNodeEditorTextColor)
  • Recolor support for: Stage engine fuel gauge (stageEngineFuelGaugeTextColor, stageEngineFuelGaugeBackgroundColor, stageEngineFuelGaugeFillColor, stageEngineFuelGaugeFillBackgroundColor)
  • Recolor support for Stage engine heat gauge (stageEngineHeatGaugeTextColor, stageEngineHeatGaugeBackgroundColor, stageEngineHeatGaugeFillColor, stageEngineHeatGaugeFillBackgroundColor)

Full list of available recolor options can be found in the README.

Link to comment
Share on other sites

10 hours ago, UltraJohn said:

1.2.7-beta is released.

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

  • Recolor support for: Maneuver node editor text color (maneuverNodeEditorTextColor)

This doesn't seem to recolor the text in advanced orbital info and the approach info tabs, only the orbital info one (2nd and 3rd tabs).

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...