S-C-A-N / SCANsat

Real Scanning, Real Science, at Warp Speed!
217 stars 97 forks source link

Unable to open any SCANsat windows #308

Closed nevercast closed 6 years ago

nevercast commented 6 years ago

I'm using SCANsat, and a bunch of other mods.

KSP: 1.3.1 (Win64) - Unity: 5.4.0p4 - OS: Windows 10  (10.0.0) 64bit
000_AT_Utils - 1.5
Toolbar - 1.7.16.5
UI Core - 1.0.0.1
USI Tools - 0.10.1
Astronomer's Visual Pack - 3.6.3
Community Category Kit - 2.0.2
Community Resource Pack - 0.8
CommunityTechTree - 3.2.1
Contract Configurator - 1.23.3
AGExt - 2.3.1
CapCom Mission Control On The Go - 1.0.2.7
Contract Parser - 1.0.7
Contracts Window Plus - 1.0.8.1
Progress Parser - 1.0.8
Easy Vessel Switch - 1.5.6471.31118
EditorExtensionsRedux - 3.3.16
Ferram Aerospace Research - 0.15.8.1
Firespitter - 7.6
GroundConstruction - 1.2.1
HeatControl - 0.4.4
HideEmptyTechTreeNodes - 1.0.1
Interstellar Fuel Switch - 2.10.3
JanitorsCloset - 0.3.3
RasterPropMonitor - 0.29.3
Kerbal Attachment System - 0.6.3
Kerbal Engineer Redux - 1.1.3
Kerbal Inventory System - 1.9.6571.274
<b><color=#CA7B3C>Kopernicus</color></b> - 1.3.1.3
KramaxAutoPilotContinued - 0.3.4
kRPC - 0.4.3
KSP-AVC Plugin - 1.1.6.2
LoadingScreenManager - 1.2.2
Maeneuver Node Evolved - 1.0.3.3
ModularFlightIntegrator - 1.2.4
S.A.V.E - 1.4.7.2860
Overdrive - 1.1
PatchManager - 0.0.13
ReentryParticleEffect - 1.2.0.1
SafeChute - 2.1.9
SCANsat - 1.1.8.2
Stock Visual Terrain - 2.0.9
TextureReplacerReplaced - 0.5.4
Kerbal Alarm Clock - 3.8.5
TrimIndicator - 1.3.1
TweakScale - 2.3.7
USI Core - 0.5
Konstruction - 0.3
MKS - 0.53
KSP Interstellar Extended - 1.16.6
[x] Science! - 5.11

When I try to open a ScanSAT Window, it does not open. The Debug console gives me the following error.

[ERR 21:17:00.586] [Toolbar] [ERROR] error while handling click event: SCANsat.KSCMap

[EXC 21:17:00.587] ArgumentException: The Object you want to instantiate is null.
    UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message)
    UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original)
    SCANsat.SCAN_Unity.SCAN_UI_BigMap.Open ()
    SCANsat.SCAN_Toolbar.SCANtoolbar+<>c.<.ctor>b__6_5 (SCANsat.SCAN_Toolbar.ClickEvent e)
    SCANsat.SCAN_Toolbar.Button.clicked (System.Object realEvent)
    Toolbar.Command.click ()
    UnityEngine.Debug:LogException(Exception)
    Toolbar.Log:log(LogLevel, Exception, String, Object[])
    Toolbar.Log:error(Exception, String, Object[])
    Toolbar.Command:click()
    Toolbar.Button:click()
    Toolbar.Button:drawInToolbar(Rect, Boolean)
    Toolbar.Toolbar:drawButtons()
    Toolbar.Toolbar:draw()
    Toolbar.ToolbarManager:OnGUI()

Here are my logs

KSP Log Output Log - Part 1 Output Log - Part 2

Sorry about the two parts, my modem is broken at the moment and can't upload anything larger

Contract Configurator - 1.23.3
Module Manager - 3.0.1
SCANsat - 1.1.8.2
Toolbar - 1.7.16.5

Anything I can do to help find the cause of this issue? I could do a bisection of my mods in a manual binary search, but it would take hours probably.

NC

DMagic1 commented 6 years ago

SCANsat is incompatible with OverDrive. Remove that if you want to continue using SCANsat.

HebaruSan commented 6 years ago

This is being tracked on the Overdrive side at Real-Gecko/KSP-Overdrive#2. (Though the mod itself is now abandoned and adopted by @linuxgurugamer.)

I took a look at the code to see if it was something simple, and nothing jumped out at me. The toggle object should be getting replaced with a valid object, which has the various onNormal.background properties set to valid image objects. However, some of this work is done through the UICore dependency, which I haven't checked yet.

HebaruSan commented 6 years ago

Hey @DMagic1, is it possible that these width - 32, height - 32 expressions are passing negative dimensions if the underlying image is less than 32x32? Most C# code that I've seen throws exceptions if that happens:

new Rect(16, 16, skin.toggle.normal.background.width - 32, skin.toggle.normal.background.height - 32)

Overdrive's icons seem to be 16x22, which would result in new Rect(16, 16, -16, -10) under the above theory:

unchecked

https://github.com/Real-Gecko/KSP-Overdrive/blob/master/GameData/Overdrive/Skins/Overdrive/Textures/unchecked.png

nevercast commented 6 years ago

Cheers thanks for that! Can I attach a debugger (Visual Studio) to KSP to assist in debugging this issue further (Comparing with and without overdrive)?

Edit: This seems sufficient

For the moment, I'll just undo the UI mod.

DMagic1 commented 6 years ago

Fixed in 18.3.

nevercast commented 6 years ago

Wonderful, thanks!