Skip to content

Commit

Permalink
ver 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Creepler13 committed Aug 7, 2022
1 parent 5e256ca commit 21c809f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
25 changes: 1 addition & 24 deletions ImageRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public void load()
Bitmap bm = new Bitmap(Imagepath);
Texture2D text = new Texture2D(bm.Width, bm.Height, TextureFormat.ARGB32, false);




for (int x = 0; x < bm.Width; x++)
{
for (int y = 0; y < bm.Height; y++)
Expand All @@ -41,8 +38,6 @@ public void load()
}
}



text.Apply();
TextureData textDat = new TextureData();
textDat.rawData = text.GetRawTextureData();
Expand All @@ -52,10 +47,9 @@ public void load()
textures.Add(text);
Sprite s = Sprite.Create(text, new Rect(0, 0, text.width, text.height), new Vector2(0.5f, 0.5f));


images.Add(s);

MelonLoader.MelonLogger.Msg("Loaded img " + Imagepath);
//MelonLoader.MelonLogger.Msg("Loaded img " + Imagepath);
}
}

Expand All @@ -70,24 +64,7 @@ public Sprite getRandomSprite()
public Texture2D getRandomTexture()
{
return textures[rand.Next(textures.Count)];
/* string path = "CustomLoadingScreens";
string[] images = Directory.GetFiles(path);
Bitmap bm = new Bitmap(images[rand.Next(images.Length)]);
Texture2D text = new Texture2D(bm.Width, bm.Height, TextureFormat.ARGB32, false);
for (int x = 0; x < bm.Width; x++)
{
for (int y = 0; y < bm.Height; y++)
{
System.Drawing.Color c = bm.GetPixel(x, bm.Height - 1 - y);
text.SetPixel(x, y, new UnityEngine.Color32(c.R, c.G, c.B, c.A));
}
}
text.Apply();

return text;
*/
}

}
Expand Down
18 changes: 3 additions & 15 deletions LoadingImg_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ internal static class LoadingImg_Patch

public static void Postfix(ref LoadingImg __instance)
{


MelonLoader.MelonLogger.Msg(Settings.onlyCustomImages);
if (!Settings.onlyCustomImages)
if (rand.NextDouble() > Settings.customImageProbability) return;

Expand Down Expand Up @@ -59,25 +56,14 @@ public static void Postfix(ref LoadingImg __instance)
components = __instance.simpleIllus.GetComponents<Image>();
}





foreach (Image c in components)
{

c.sprite = temp;
}



}






public static bool is43(int x, int y)
{
return ((double)(x % y) / y) <= 1.7;
Expand All @@ -92,7 +78,9 @@ internal class LoadingTxt_Patch

public static void Postfix(ref LoadingTxt __instance)
{
MelonLoader.MelonLogger.Msg(Settings.customText.Length);
return;
MelonLoader.MelonLogger.Msg("Start");
if (__instance.m_Txt == null) return;
MelonLoader.MelonLogger.Msg(__instance.m_Txt.text);
if (Settings.customText.Length == 0) return;
__instance.m_Txt.text = Settings.customText[rand.Next(Settings.customText.Length)];
Expand Down

0 comments on commit 21c809f

Please sign in to comment.