SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   Mods Workshop for Cold Waters (https://www.subsim.com/radioroom/forumdisplay.php?f=285)
-   -   [TEC] Circle Range Marks Alignment in DotMod (https://www.subsim.com/radioroom/showthread.php?t=256466)

Laines 01-09-24 04:35 PM

Circle Range Marks Alignment in DotMod + Help with HUD needed
 
If someone (like me) is being constantly irritated and confused with misaligned range marks in DotMod, then I hope they will find this post helpful.

Marks are drawn in gui code and therefore one has to edit assembly to change their relative positions. For this you will need the latest version of dnSpy and some basic coding knowledge. I myself am not a proficient coder, so unfortunately I can't create a simple patch of sorts.

Method that redraws (best guess at what it does) the marks is located at:
Assembly-CSharp.dll/GUI_Additions/RecalculateCircleZoomReadouts()

There you can find lots of branches that choose offsets based on resolution index. The one I found that works for my resolution (2560x1440) is right after switch-case. The first argument of Vector3 is what you want to change to align marks to your liking. Positive values move mark to the right and negative to the left.

Here's a snippet of what my values look like
Code:

...
        if (num != 6)
        {
                switch(num)
                ...
                GUI_Additions.circlesZoomRight1_Object.transform.localPosition = new Vector3(130f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomRight2_Object.transform.localPosition = new Vector3(285f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomRight3_Object.transform.localPosition = new Vector3(440f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomRight4_Object.transform.localPosition = new Vector3(595f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomLeft1_Object.transform.localPosition = new Vector3(-175f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomLeft2_Object.transform.localPosition = new Vector3(-330f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomLeft3_Object.transform.localPosition = new Vector3(-485f / hudsize, -30f, 0f);
                GUI_Additions.circlesZoomLeft4_Object.transform.localPosition = new Vector3(-640f / hudsize, -30f, 0f);
        }
        return;
...

And how it looks in the game
https://photos.app.goo.gl/8ZTUNWmg7db4Fhpg8

I am also trying to change the order of WPN DATA values and will greatly appreciate info on where to find a method that draws them. Currently I found a way to reorder titles in LanguageManager.BuildCombatHUD(), but that's about it.

Aktungbby 01-10-24 03:44 PM

Welcome aboard!
 
Laines!:Kaleun_Salute:...nice "snippets of yer values"!:up:


All times are GMT -5. The time now is 03:33 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.