akherber Posted April 25, 2014 Share Posted April 25, 2014 (edited) blizzy.de correct? And is there an alternate mirror? Because your page won't hit here. The interwebs are being odd. Edited April 25, 2014 by akherber Link to comment Share on other sites More sharing options...
philotical Posted May 2, 2014 Share Posted May 2, 2014 Hi Blizzy78I'm working on two different plugins - both are near release without toolbar.Now I tried to add toolbar but no matter what I do, I get this error..CA0058 [B]Error Running Code Analysis[/B]CA0058 : The referenced assembly 'aaa_Toolbar, Version=1.0.0.0, Culture=neutral' could not be found. This assembly is required for analysis and was referenced by: C:\Users\[...]Reloaded.dll.[B][Errors and Warnings][/B] - (Global)To clarify: It happens in all cases as soon as IButton is used. It happens in both projects independentlyI tried using-dependency, only referencing and toolbarWrapper..With depency and/or reference I get the above on the failed build - with the wrapper it builds, but the above is printed in the KSP.logI've tried to reference different versions of the toolbar DLL - no change..Also Google showed me clearly - I'm the only one with this problem! lolSo as a C# noob with limited debug abilities, I am at a loss..Would you consider pointing me in a direction that helps? If you have one..Edit: Additional info..I am using your example codes from github..default button.. (including the onDestroy stuff)However - I've tried to copy/paste implementations from other plugins with the same result..So I doubt it's a code problem on my end.. - but who knows.. Link to comment Share on other sites More sharing options...
blizzy78 Posted May 2, 2014 Author Share Posted May 2, 2014 I'm using Visual Studio Express here, and I just add the necessary DLLs as references to the project. This usually works fine without having to do anything else. Link to comment Share on other sites More sharing options...
philotical Posted May 2, 2014 Share Posted May 2, 2014 yup - that's what I figured..However - here it does not..What could cause this problem? Link to comment Share on other sites More sharing options...
blizzy78 Posted May 2, 2014 Author Share Posted May 2, 2014 Perhaps it's the "code analysis" you're running? I *think* I have never used that, I just compile stuff. Link to comment Share on other sites More sharing options...
philotical Posted May 2, 2014 Share Posted May 2, 2014 will try right away..LOL it worked..Man that took me the whole day.. :-)One never stops learning.. - I've started with c# yesterday.. - so.. as noobs can be..Thank's - I owe you one.. Link to comment Share on other sites More sharing options...
MarkZero Posted May 7, 2014 Share Posted May 7, 2014 Hello,I am trying to add support for the toolbar to my plugin as instructed under "Use the Toolbar Plugin wrapper to provide optional Toolbar Plugin support".However if I have the ToolbarWrapper.cs in my project (don't even need to try to use the toolbar), my plugin won't load and I get this error in KSP.log:[ERR 14:26:15.363] AssemblyLoader: Exception loading 'MyPlugin': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at AssemblyLoader.LoadAssemblies () [0x00000] in <filename unknown>:0 Additional information about this exception: System.TypeLoadException: Could not load type 'MyPlugin.ToolbarTypes' from assembly 'MyPlugin, Version=1.0.5240.24185, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass3' from assembly 'MyPlugin, Version=1.0.5240.24185, Culture=neutral, PublicKeyToken=null'.Any idea what could cause this? Link to comment Share on other sites More sharing options...
blizzy78 Posted May 7, 2014 Author Share Posted May 7, 2014 .NET target version must be set to 3.5. Link to comment Share on other sites More sharing options...
MarkZero Posted May 8, 2014 Share Posted May 8, 2014 Thank you, works now. Link to comment Share on other sites More sharing options...
SirAtomBrysicle Posted May 11, 2014 Share Posted May 11, 2014 Hey I really love your toolbar but after I got the 23.5 ARM update it won't work alongside MechJeb. MJ is updated to the most recent 23.5 path (2.2.1) I can place the part but the MJ UI will not show up. I removed all mods and tried each one after the other with MJ and this was the only one that caused the issue. I'm not all that great at math so the MJ is almost essential for me to get past the learning curve, but it has become a big deal to me that I can't use the toolbar as well. I must sort this out! I will post there as well, I'm just reaching out seeing if someone more familiar with modding has dealt with this? Link to comment Share on other sites More sharing options...
blizzy78 Posted May 11, 2014 Author Share Posted May 11, 2014 I can place the part but the MJ UI will not show up.I think you need to enable MJ's Toolbar support in MJ's settings. Link to comment Share on other sites More sharing options...
blizzy78 Posted June 22, 2014 Author Share Posted June 22, 2014 Toolbar Plugin 1.7.2 is now available for download. Link to comment Share on other sites More sharing options...
xEvilReeperx Posted June 26, 2014 Share Posted June 26, 2014 There seem to be some issues related to IDrawable and the latest update. I have users reporting incorrect toolbar positions and in some cases the GUI becomes nearly non-interactive if the toolbar is positioned such that the auto positioning code fails (typically when at the top of the screen, positioned between the altimeter and sides of the screen).Here is an example:The exact position will alternate on every right-click-open and in both cases something strange is going on because clicking buttons does nothing or (if the positioning is as the second picture) the drawable will suddenly snap to the wrong place. I want to say that the actual location checked for mouse input is lagging behind the displayed position, since you can sometimes manage to click buttons if you twitch your mouse fast enough to the right spot.1.7.1 works fine though Link to comment Share on other sites More sharing options...
blizzy78 Posted June 26, 2014 Author Share Posted June 26, 2014 I'll look into it. Link to comment Share on other sites More sharing options...
blizzy78 Posted June 26, 2014 Author Share Posted June 26, 2014 Toolbar Plugin 1.7.3 is now available for download. Link to comment Share on other sites More sharing options...
xEvilReeperx Posted June 26, 2014 Share Posted June 26, 2014 That was fast, thanks! Link to comment Share on other sites More sharing options...
blizzy78 Posted June 26, 2014 Author Share Posted June 26, 2014 It could have been sooner, weren't it for my daytime work. Link to comment Share on other sites More sharing options...
diomedea Posted June 27, 2014 Share Posted June 27, 2014 Just a very minor thing, but believe you may find useful: with the 1.7.3 version, Toolbar.dll still shows version 1.7.2.0 from the file properties. Link to comment Share on other sites More sharing options...
blizzy78 Posted June 27, 2014 Author Share Posted June 27, 2014 Just a very minor thing, but believe you may find useful: with the 1.7.3 version, Toolbar.dll still shows version 1.7.2.0 from the file properties.Ah great. Thanks for letting me know! Link to comment Share on other sites More sharing options...
Felger Posted July 6, 2014 Share Posted July 6, 2014 Hopefully this is the right place to post this, but I'm running into odd behaviour trying to implement the ToolbarWrapper into my plugin.I'm building my plugin to interface with Infernal Robotics (which also uses the Toolbar Wrapper). Mirroring the implementation in the TestButtons.cs into my code (without the direct dependency on Toolbar, instead using the wrapper and testing for the existence of the toolbar in much the same way sirkut does here)I instantiated the IButton for my plugin, and added the appropriate code to my Awake() function to tie my plugin into the toolbar. All seemed to go well, until I compiled and launched the game.Once in-game, the plugin no longer loaded, claiming an object wasn't being assigned. (Or being assigned to a null reference). Removing all references to the toolbar from my code resolved the problem.For context, here's the relevant lines of code in the plugin: IButton AutoGimbalButton; void Awake() { Debug.Log("[AutoGimbalManager] awake"); guiEnabled = false; var scene = HighLogic.LoadedScene; if (scene == GameScenes.FLIGHT) {//Need to check at some point if we need to reload groups from vessel } if (ToolbarManager.ToolbarAvailable) { AutoGimbalButton = ToolbarManager.Instance.add("Felger", "AutoGimbalButton"); AutoGimbalButton.TexturePath = "AutoGimbal/Textures/icon_button"; AutoGimbalButton.ToolTip = "AutoGimbal Manager"; AutoGimbalButton.Visibility = new GameScenesVisibility(GameScenes.EDITOR, GameScenes.SPH, GameScenes.FLIGHT); AutoGimbalButton.OnClick += (e) => guiEnabled = !guiEnabled; AutoGimbalButton.Visible = true; } else { guiEnabled = true; } } void OnGUI() { //Define the default window position, if no changes have been made: if(windowPosn.x == 0 && windowPosn.y == 0) { windowPosn = new Rect(Screen.width - 300, 50, 10, 10); } var scene = HighLogic.LoadedScene; if (scene == GameScenes.FLIGHT) { //Creates a new box, specifying the position to follow the defined position above. if (guiEnabled) { windowPosn = GUILayout.Window(0, windowPosn, WindowMaker, "AutoGimbal"); } } } void OnDestroy() { if (ToolbarManager.ToolbarAvailable) { AutoGimbalButton.Destroy(); } }As far as I can tell from following your and sirkut's code through, I shouldn't expect a problem, using the wrapper. However, in-game Infernal Robotics shows up on the toolbar, and my plugin crashes when it attempts to load.Removing the toolbar from my plugin, it loads just fine. Link to comment Share on other sites More sharing options...
blizzy78 Posted July 6, 2014 Author Share Posted July 6, 2014 If you're getting an exception, there should be a stack trace in your output_log.txt. Link to comment Share on other sites More sharing options...
Felger Posted July 6, 2014 Share Posted July 6, 2014 The actual log message, going back and looking for it is:[EXC 13:25:57.696] NullReferenceException: Object reference not set to an instance of an objectIn the output_log.txt:AssemblyLoader: Exception loading 'AutoGimbal': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at AssemblyLoader.LoadAssemblies () [0x00000] in <filename unknown>:0 Additional information about this exception: System.TypeLoadException: Could not load type 'AutoGimbal.ToolbarTypes' from assembly 'AutoGimbal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. System.TypeLoadException: Could not load type '<>c__DisplayClass3' from assembly 'AutoGimbal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)I'm pretty inexperienced with object-oriented programming, so I'm not really sure what to make of all this. Link to comment Share on other sites More sharing options...
blizzy78 Posted July 6, 2014 Author Share Posted July 6, 2014 I think you need to set your .NET target version to 3.5. Link to comment Share on other sites More sharing options...
Felger Posted July 6, 2014 Share Posted July 6, 2014 And of course I completely missed step 3 in the setup, thanks for setting me straight Blizzy! Link to comment Share on other sites More sharing options...
Diazo Posted July 13, 2014 Share Posted July 13, 2014 (edited) edit: Nevermind, PEBKAC error.I had the state of my window state boolean backwards so when I was trying to open the window, I was closing it.Off to actually make some progress now.D. Edited July 14, 2014 by Diazo Link to comment Share on other sites More sharing options...
Recommended Posts