Resources : icon not found

Started by Monsieur OUXX, Mon 20/09/2021 20:15:36

Previous topic - Next topic

Monsieur OUXX

I want to add a new sort of "Component" in the AGS project tree.

- I duplicated "ScriptsComponent" and named it "FooComponent".
- I replaced the word Script/script/Scripts everywhere relevant.
- I did "AddComponent" in ApplicationController.cs
- Finally, I duplicated "scripts.ico" and "script.ico" in the Resources folder and named the new files "foos.ico" and "foo.ico".
- I added those files to the Resources folder in the project ("Add existing item").

Everything compiles, but when the Editor starts, ResourceManager.GetIcon crashes. It says that "System.ArgumentException: 'Resource 'foo.ico' cannot be found in class 'AGS.Editor.Resources.ResourceManager'.'
.


Again, I did everything like ScriptsComponent does it, except with "Foo" in place of "Script".

So, my question : Do new resources (icons) need to be added explicitly to some sort of Resources manifest file or some list that I failed to locate?
Why are the new icons not found? Not found in what? (in the file system? In some list?)

 

Monsieur OUXX

I see that there seems to be some Resources somehow connected to AGS.Editor.Resources.ResourceManager but I fail to see how to view/edit them? When I open the "Resources" tab of the AGSEditor project's properties (or simply when I open Resources.resx) I don't see any of the icons.
 

Crimson Wizard

The editor icons are located in the AGSEditor/Resources folder. They are marked as "Build Action = Embedded Resources" in their properties in solution.

Monsieur OUXX

#3
Quote from: Crimson Wizard on Mon 20/09/2021 21:44:26
They are marked as "Build Action = Embedded Resources"
That's the thing I forgot existed.


I'm not allowed to change the value?
I can see the Properties of each and every icon, but it appears in dark gray : I cannot modify the value...
I'm using Visual Studio Professional 2019.
 

SMF spam blocked by CleanTalk