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