sbox-issues
sbox-issues copied to clipboard
Cloud.Asset() doesn't work in the editor
Describe the bug
I want to load https://sbox.game/sbux/icon from sbox.game for my editor UI. It is able to get the image fine in the game project, but fails in the editor project.
To Reproduce
To reproduce this you need to try and load an asset (i.e facepunch.soda_can) with Cloud.Asset() in the editor project.
Here is an empty project with the reproduction. bug_tests.zip
Expected behavior
Cloud.Asset() should find the package and return PrimaryAsset.
Media/Files
CloudAsset: Unknown package (facepunch.soda_can)
at Sandbox.Cloud.Asset(String ident) in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\Assets\Cloud\Cloud.cs:line 41
at Sandbox.CloudAssetTest.Frame() in C:\Users\yourbadandimbest\Documents\S&box Projects\bug_tests\Editor\CloudAssetTest.cs:line 10
at InvokeStub_CloudAssetTest.Frame(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Sandbox.Internal.EventSystem.<>c__DisplayClass11_0.<BuildDelegate>b__0(Object o, Object[] p) in C:\build\_work\sbox\sbox\engine\Sandbox.Event\EventSystem.cs:line 167
at Sandbox.Internal.EventSystem.Run(String v) in C:\build\_work\sbox\sbox\engine\Sandbox.Event\EventSystem.cs:line 285
at Editor.EditorEvent.Run(String name) in C:\build\_work\sbox\sbox\engine\Sandbox.Tools\Events\EditorEvent.cs:line 56
at Editor.ManagedTools.RunFrame() in C:\build\_work\sbox\sbox\engine\Sandbox.Tools\ManagedTools.cs:line 113
at Managed.SourceTools.Exports.Editor_ManagedTools_RunFrame() in C:\build\_work\sbox\sbox\engine\Sandbox.Tools\Interop.Tools.cs:line 20154
at Sandbox.EngineLoop.RunFrame(CMaterialSystem2AppSystemDict appDict, Boolean& wantsQuit) in C:\build\_work\sbox\sbox\engine\Sandbox.Engine\EngineLoop.cs:line 46
at Sandbox.AppSystem.RunFrame() in C:\build\_work\sbox\sbox\engine\Sandbox.AppSystem\AppSystem.cs:line 86
at Sandbox.AppSystem.Run() in C:\build\_work\sbox\sbox\engine\Sandbox.AppSystem\AppSystem.cs:line 65
at Sandbox.Launcher.Main() in C:\build\_work\sbox\sbox\engine\Launcher\SboxDev\Launcher.cs:line 24
at Sandbox.Program.Launch() in C:\build\_work\sbox\sbox\engine\Launcher\Shared\Startup.cs:line 21
at Sandbox.Program.Main() in C:\build\_work\sbox\sbox\engine\Launcher\Shared\Startup.cs:line 16
Additional context
I can't just download the png and use that. I already tried that. I'm making a library which means content doesn't mount correctly.