File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -129,13 +129,13 @@ private bool Initialize()
129129
130130 protected string GetModFolderPath ( string subpath )
131131 {
132- return $ "@modfolder( { this . Info . Name } ): { subpath } ";
132+ return $ "{ this . Info . Path } / { subpath } ";
133133 }
134134
135135 protected bool TryGetModFolderPath ( string subpath , out string path )
136136 {
137137 path = GetModFolderPath ( subpath ) ;
138- return File . Exists ( ModManager . PatchModPathString ( path ) ) ;
138+ return File . Exists ( path ) ;
139139 }
140140
141141 public virtual bool TryGetIconImage ( out IXUiTexture texture )
Original file line number Diff line number Diff line change @@ -47,21 +47,29 @@ public interface IXUiTexture
4747
4848 public sealed class XUiTexturePath : IXUiTexture
4949 {
50- private readonly string modFolderRelativePath ;
50+ private readonly string modFolderPath ;
5151
52- public XUiTexturePath ( string modFolderRelativePath )
52+ public XUiTexturePath ( string modFolderPath )
5353 {
54- this . modFolderRelativePath = modFolderRelativePath ;
54+ this . modFolderPath = modFolderPath ;
55+ Debug . Log ( this . modFolderPath ) ;
5556 }
5657
5758 public void Load ( XUiV_Texture texture )
5859 {
59- texture . ParseAttribute ( "texture" , this . modFolderRelativePath , null ) ;
60+ byte [ ] data = File . ReadAllBytes ( this . modFolderPath ) ;
61+
62+ Texture2D texture2d = new Texture2D ( 0 , 0 ) ;
63+ texture2d . LoadImage ( data ) ;
64+
65+ texture . Texture = texture2d ;
66+ wwwAssignedField . SetValue ( texture , true ) ;
6067 }
6168
6269 public void Unload ( XUiV_Texture texture )
6370 {
64- texture . UnloadTexture ( ) ;
71+ texture . Texture = null ;
72+ texture . UITexture . mainTexture = null ;
6573 }
6674 }
6775
You can’t perform that action at this time.
0 commit comments