-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KSP 1.8.1 - FAR 0.15.11.3 Mach - no button texture shown #85
Comments
Sorry, I don't know why it's happening. FAR uses textures from the GameDatabase so the issue might be with KSP, and of course it's not reproducible on my machine. Can you try FAR from https://github.com/dkavolis/Ferram-Aerospace-Research/tree/logs and overwriting the icon path with
and see if a different icon works? Default FARConfig If you use DLL from |
I don't need the @ because the FARConfig.cfg already got the correct paths. I will test the build from the "logs" repo next session - as is. |
Hmm. Now I loaded the game and as I went to the R&D the UI became unresponsive, I cannot leave R&D and this is spammed to the log:
Do I really HAVE to replace the binaries from those of the bin/debug folder? Or is it something else? |
Well, this time I used the debug binaries and the log spamming already started as KSP reached the main menu... After loading the save there is no FAR button at all. |
Ok, the latest commit should solve the issue. Some mod was modifying |
Button is there again, no log spamming - but still no icon on the button. ;) |
Can you check if the button texture works on a clean KSP install only with FAR and dependencies? Might be a mod interaction |
With just
and starting a new career test save - no icon on the button: Log: |
Ok, I think I know what's happening, try now |
With all my mods - no icon: With the minimum install environment and a new career - no icon as well (see pic above). |
Still no button. |
Well, the texture is loaded and exists in the |
Can you check if the icon shows up once in main menu with DLL from https://drive.google.com/file/d/1bBlSc4IeXqYr4VgYcpS7tLH-kB01se7d/view?usp=sharing? The only difference is I added this segment of code immediately after call to var go = new GameObject("Image");
go.AddComponent<CanvasRenderer>();
var rectTransform = go.AddComponent<RectTransform>();
var image = go.AddComponent<Image>();
rectTransform.SetParent(MainCanvasUtil.MainCanvas.transform);
rectTransform.position = Vector3.zero;
image.sprite = Sprite.Create(icon, new Rect(0, 0, icon.width, icon.height), new Vector2(0.5f, 0.5f), 500f); If there's still no icon, I'll look into loading the image myself. |
I would say this is a "nope". Log: btw this .dll did not create an additional CustomFARConfig.cfg directly in GameData |
This time I'm loading the texture myself but you don't have to wait till main menu using System.Collections;
using FerramAerospaceResearch.FARUtils;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
namespace FerramAerospaceResearch
{
[KSPAddon(KSPAddon.Startup.Instantly, true)]
public class ImageLoader : MonoBehaviour
{
private void Awake()
{
StartCoroutine(Test());
}
private IEnumerator Test()
{
using UnityWebRequest request =
UnityWebRequestTexture
.GetTexture($@"file:///{FARConfig.CombineGameData("FerramAerospaceResearch/Textures/icon_button_stock.png")}");
yield return request.SendWebRequest();
Texture2D tex = DownloadHandlerTexture.GetContent(request);
FARLogger.Info($"Testing image loading from {request.url}");
var go = new GameObject("Image");
go.AddComponent<CanvasRenderer>();
var rectTransform = go.AddComponent<RectTransform>();
var image = go.AddComponent<Image>();
rectTransform.SetParent(MainCanvasUtil.MainCanvas.transform);
rectTransform.position = Vector3.zero;
image.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f), 500f);
}
}
} |
Try dev branch and FARConfig.cfg for options, works with MM. Add the Note that there's an additional DLL now for adding and testing new features directly in Unity editor. |
See
![Screen-2019-11-05_17-12-36](https://user-images.githubusercontent.com/29145213/68224786-94c95580-ffef-11e9-8153-a0c3169346ec.jpg)
![Screen-2019-11-05_17-13-02](https://user-images.githubusercontent.com/29145213/68224803-9abf3680-ffef-11e9-8814-137e4cc19f8d.jpg)
and
Log:
https://www.dropbox.com/s/w8z9jco9xlljjv6/player.log%20and%20stuff%202019-11-05-02.zip?dl=1
The text was updated successfully, but these errors were encountered: