r19
| 1 | {{{#!syntax csharp |
|---|
r18
| 2 | public static void UIOriginCardSlot_SetData(UIOriginCardSlot __instance, DiceCardItemModel cardmodel, Image[] ___img_Frames, Image ___img_Artwork, ref Color ___colorFrame, ref Color ___colorLineardodge) |
|---|
| 3 | { |
|---|
| 4 | bool flag = cardmodel != null; |
|---|
| 5 | if (flag) |
|---|
| 6 | { |
|---|
| 7 | bool flag2 = cardmodel.GetID().packageId == YisangInitializer.pid; |
|---|
| 8 | if (flag2) |
|---|
| 9 | { |
|---|
| 10 | ___colorFrame = new Color(1f, 1f, 1f, 1f); |
|---|
| 11 | ___colorLineardodge = new Color(1f, 1f, 1f, 0f); |
|---|
| 12 | bool flag3 = YisangInitializer.uiinit2; |
|---|
| 13 | if (flag3) |
|---|
| 14 | { |
|---|
| 15 | YisangInitializer.uiinit2 = false; |
|---|
| 16 | YisangInitializer.sprites2.Add(___img_Frames[0].sprite); |
|---|
| 17 | } |
|---|
| 18 | bool flag4 = YisangInitializer.sprites2.Count == 1; |
|---|
| 19 | if (flag4) |
|---|
| 20 | { |
|---|
| 21 | bool flag5 = __instance is UIDetailCardSlot; |
|---|
| 22 | if (flag5) |
|---|
| 23 | { |
|---|
| 24 | Image component = __instance.transform.GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent<Image>(); |
|---|
| 25 | YisangInitializer.sprites2.Add(component.sprite); |
|---|
| 26 | } |
|---|
| 27 | } |
|---|
| 28 | ___img_Frames[0].sprite = YisangInitializer.ArtWorks["LeftPage_Base"]; |
|---|
| 29 | ImgTranslator imgTranslator = ___img_Frames[0].gameObject.GetComponent<ImgTranslator>(); |
|---|
| 30 | bool flag6 = imgTranslator == null; |
|---|
| 31 | if (flag6) |
|---|
| 32 | { |
|---|
| 33 | imgTranslator = ___img_Frames[0].gameObject.AddComponent<ImgTranslator>(); |
|---|
| 34 | } |
|---|
| 35 | imgTranslator.image = ___img_Frames[0]; |
|---|
| 36 | imgTranslator.active = true; |
|---|
| 37 | imgTranslator.SpineUpdate("Spine2", "Front", 1f, 0.2f); |
|---|
| 38 | bool flag7 = __instance is UIDetailCardSlot; |
|---|
| 39 | if (flag7) |
|---|
| 40 | { |
|---|
| 41 | Image component2 = __instance.transform.GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent<Image>(); |
|---|
| 42 | component2.sprite = YisangInitializer.ArtWorks["RightPage_Base"]; |
|---|
| 43 | ImgTranslator imgTranslator2 = component2.gameObject.GetComponent<ImgTranslator>(); |
|---|
| 44 | bool flag8 = imgTranslator2 == null; |
|---|
| 45 | if (flag8) |
|---|
| 46 | { |
|---|
| 47 | imgTranslator2 = component2.gameObject.AddComponent<ImgTranslator>(); |
|---|
| 48 | } |
|---|
| 49 | imgTranslator2.image = component2; |
|---|
| 50 | imgTranslator2.active = true; |
|---|
| 51 | imgTranslator2.SpineUpdate("Spine", new List<string> |
|---|
| 52 | { |
|---|
| 53 | "Back_Aquila", |
|---|
| 54 | "Back_Gemini", |
|---|
| 55 | "Back_the Plough" |
|---|
| 56 | }, 1f, 0.2f); |
|---|
| 57 | } |
|---|
| 58 | __instance.GetType().GetMethod("SetFrameColor", AccessTools.all).Invoke(__instance, new object[] |
|---|
| 59 | { |
|---|
| 60 | ___colorFrame |
|---|
| 61 | }); |
|---|
| 62 | __instance.GetType().GetMethod("SetLinearDodgeColor", AccessTools.all, null, new Type[] |
|---|
| 63 | { |
|---|
| 64 | typeof(Color) |
|---|
| 65 | }, null).Invoke(__instance, new object[] |
|---|
| 66 | { |
|---|
| 67 | ___colorLineardodge |
|---|
| 68 | }); |
|---|
| 69 | } |
|---|
| 70 | else |
|---|
| 71 | { |
|---|
| 72 | bool flag9 = !YisangInitializer.uiinit2; |
|---|
| 73 | if (flag9) |
|---|
| 74 | { |
|---|
| 75 | ___img_Frames[0].sprite = YisangInitializer.sprites2[0]; |
|---|
| 76 | ImgTranslator component3 = ___img_Frames[0].gameObject.GetComponent<ImgTranslator>(); |
|---|
| 77 | bool flag10 = component3 != null; |
|---|
| 78 | if (flag10) |
|---|
| 79 | { |
|---|
| 80 | component3.active = false; |
|---|
| 81 | } |
|---|
| 82 | bool flag11 = __instance is UIDetailCardSlot && YisangInitializer.sprites2.Count > 1; |
|---|
| 83 | if (flag11) |
|---|
| 84 | { |
|---|
| 85 | Image component4 = __instance.transform.GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent<Image>(); |
|---|
| 86 | component4.sprite = YisangInitializer.sprites2[1]; |
|---|
| 87 | ImgTranslator component5 = component4.gameObject.GetComponent<ImgTranslator>(); |
|---|
| 88 | bool flag12 = component5 != null; |
|---|
| 89 | if (flag12) |
|---|
| 90 | { |
|---|
| 91 | component5.active = false; |
|---|
| 92 | } |
|---|
| 93 | } |
|---|
| 94 | } |
|---|
| 95 | } |
|---|
| 96 | } |
|---|
| 97 | } |
|---|
r19
| 98 | }}} |
|---|
| 99 | {{{#!syntax csharp |
|---|
r16
| 100 | public class CardFrameInit : ModInitializer |
|---|
| 101 | { |
|---|
| 102 | public override void OnInitializeMod() |
|---|
| 103 | { |
|---|
| 104 | Harmony harmony = new Harmony("LOR.CardFrameChangeMOD"); |
|---|
| 105 | MethodInfo method = typeof(CardFrameInit).GetMethod("SetCard"); |
|---|
| 106 | harmony.Patch(typeof(BattleDiceCardUI).GetMethod("SetCard", AccessTools.all), null, new HarmonyMethod(method),null); |
|---|
| 107 | } |
|---|
| 108 | public static void SetCard(BattleDiceCardModel cardModel, BattleDiceCardUI __instance, ref Color ___colorFrame, ref Color ___colorLineardodge, params BattleDiceCardUI.Option[] options) |
|---|
| 109 | { |
|---|
| 110 | ___colorFrame = Color.black; |
|---|
| 111 | ___colorLineardodge = Color.black; |
|---|
| 112 | __instance.GetType().GetMethod("SetFrameColor", AccessTools.all).Invoke(__instance, new System.Object[] {___colorFrame}); |
|---|
| 113 | __instance.GetType().GetMethod("SetLinearDodgeColor", AccessTools.all).Invoke(__instance, new System.Object[] { ___colorLineardodge }); |
|---|
| 114 | } |
|---|
r19
| 115 | } |
|---|
| 116 | }}} |
|---|