11using DiskCardGame ;
22using HarmonyLib ;
3- using System ;
43using UnityEngine ;
5- using System . Linq ;
6- using APIPlugin ;
7- using System . Collections . Generic ;
84using GBC ;
95
106namespace InscryptionAPI . AscensionScreens
@@ -56,20 +52,20 @@ public virtual void InitializeScreen(GameObject partialScreen)
5652 public static AscensionRunSetupScreenBase BuildScreen ( Type screenType , AscensionMenuScreens . Screen previousScreen , AscensionMenuScreens . Screen nextScreen )
5753 {
5854 // Create the new screen
59- Plugin . Log . LogInfo ( $ "Creating screen for { screenType . Name } ") ;
55+ InscryptionAPIPlugin . Log . LogInfo ( $ "Creating screen for { screenType . Name } ") ;
6056
6157 GameObject pseudoPrefab = AscensionMenuScreens . Instance . cardUnlockSummaryScreen ;
6258 GameObject screenObject = GameObject . Instantiate ( pseudoPrefab , pseudoPrefab . transform . parent ) ;
6359 screenObject . name = screenType . Name ;
6460
65- Plugin . Log . LogInfo ( $ "Getting old logic") ;
61+ InscryptionAPIPlugin . Log . LogInfo ( $ "Getting old logic") ;
6662 AscensionCardsSummaryScreen oldController = screenObject . GetComponent < AscensionCardsSummaryScreen > ( ) ;
6763
68- Plugin . Log . LogInfo ( $ "Adding new logic") ;
64+ InscryptionAPIPlugin . Log . LogInfo ( $ "Adding new logic") ;
6965 AscensionRunSetupScreenBase controller = screenObject . AddComponent ( screenType ) as AscensionRunSetupScreenBase ;
7066
7167 // Update the title of the screen
72- Plugin . Log . LogInfo ( $ "Updating screen title") ;
68+ InscryptionAPIPlugin . Log . LogInfo ( $ "Updating screen title") ;
7369 GameObject textHeader = screenObject . transform . Find ( "Header/Mid" ) . gameObject ;
7470 textHeader . transform . localPosition = new Vector3 ( 0f , - 0.575f , 0f ) ;
7571 controller . screenTitle = textHeader . GetComponent < PixelText > ( ) ;
@@ -83,7 +79,7 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
8379 GameObject footerLowline = screenObject . transform . Find ( "Footer/PixelTextLine_DIV" ) . gameObject ;
8480 if ( controller . showCardDisplayer )
8581 {
86- Plugin . Log . LogInfo ( $ "Resetting card information displayer") ;
82+ InscryptionAPIPlugin . Log . LogInfo ( $ "Resetting card information displayer") ;
8783
8884 // Move the stuff
8985 cardTextDisplayer . transform . localPosition = new Vector3 ( 2.38f , 0.27f , 0f ) ;
@@ -101,12 +97,12 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
10197 }
10298 else
10399 {
104- Plugin . Log . LogInfo ( $ "Destroying unwanted card information displayer") ;
100+ InscryptionAPIPlugin . Log . LogInfo ( $ "Destroying unwanted card information displayer") ;
105101 // Destroy the card text displayer and footer low line
106102 GameObject . Destroy ( cardTextDisplayer ) ;
107103 GameObject . Destroy ( footerLowline ) ;
108104
109- Plugin . Log . LogInfo ( $ "Creating new information displayer") ;
105+ InscryptionAPIPlugin . Log . LogInfo ( $ "Creating new information displayer") ;
110106 GameObject newInfoDisplayer = GameObject . Instantiate ( textHeader ) ;
111107 controller . secondaryInfoDisplayer = newInfoDisplayer . GetComponent < PixelText > ( ) ;
112108 controller . secondaryInfoDisplayer . SetColor ( GameColors . Instance . nearWhite ) ;
@@ -115,24 +111,24 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
115111
116112 if ( controller . showCardPanel )
117113 {
118- Plugin . Log . LogInfo ( $ "Transferring ownership of cards") ;
114+ InscryptionAPIPlugin . Log . LogInfo ( $ "Transferring ownership of cards") ;
119115 controller . cards = oldController . cards ;
120116 }
121117
122118 // Destroy the old game logic
123- Plugin . Log . LogInfo ( $ "Destroying old game logic") ;
119+ InscryptionAPIPlugin . Log . LogInfo ( $ "Destroying old game logic") ;
124120 Component . Destroy ( oldController ) ;
125121
126122 // Sort out the unlocks block
127- Plugin . Log . LogInfo ( $ "Handling card panel") ;
123+ InscryptionAPIPlugin . Log . LogInfo ( $ "Handling card panel") ;
128124 controller . cardPanel = screenObject . transform . Find ( "Unlocks" ) . gameObject ;
129125 if ( controller . showCardDisplayer )
130126 controller . cardPanel . transform . localPosition = new Vector3 ( 0f , 0.2f , 0f ) ;
131127 else
132128 GameObject . Destroy ( controller . cardPanel ) ;
133129
134130 // Clone the challenge information from a challenge screen
135- Plugin . Log . LogInfo ( $ "Creating challenge text header") ;
131+ InscryptionAPIPlugin . Log . LogInfo ( $ "Creating challenge text header") ;
136132 GameObject header = screenObject . transform . Find ( "Header" ) . gameObject ;
137133 SequentialPixelTextLines headerLines = header . AddComponent < SequentialPixelTextLines > ( ) ;
138134
@@ -145,19 +141,19 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
145141
146142 // Set the old header lines to the lines of the sequential pixel text lines
147143 // Fundamentally, the old header now controls these new challenge level lines
148- Plugin . Log . LogInfo ( $ "Assigning new lines of text to header") ;
144+ InscryptionAPIPlugin . Log . LogInfo ( $ "Assigning new lines of text to header") ;
149145 headerLines . lines = new List < PixelText > ( ) {
150146 challengeLevel . GetComponent < PixelText > ( ) ,
151147 challengePoints . GetComponent < PixelText > ( )
152148 } ;
153149
154150 // And add those lines to the new challenge level controller
155- Plugin . Log . LogInfo ( $ "Giving controller access to header") ;
151+ InscryptionAPIPlugin . Log . LogInfo ( $ "Giving controller access to header") ;
156152 ChallengeLevelText challengeLevelController = screenObject . AddComponent < ChallengeLevelText > ( ) ;
157153 challengeLevelController . headerPointsLines = headerLines ;
158154 controller . challengeHeaderDisplay = challengeLevelController ;
159155
160- Plugin . Log . LogInfo ( $ "Creating challenge footer text") ;
156+ InscryptionAPIPlugin . Log . LogInfo ( $ "Creating challenge footer text") ;
161157
162158 List < Transform > footerLinePseudos = new List < Transform > ( ) ;
163159 GameObject challengeFooter = challengeScreen . transform . Find ( "Footer" ) . gameObject ;
@@ -166,7 +162,7 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
166162 footerLinePseudos . Add ( child ) ;
167163 footerLinePseudos . Sort ( ( a , b ) => a . localPosition . y < b . localPosition . y ? - 1 : 1 ) ;
168164
169- Plugin . Log . LogInfo ( $ "Building footer text controller") ;
165+ InscryptionAPIPlugin . Log . LogInfo ( $ "Building footer text controller") ;
170166 List < GameObject > newFooterLines = footerLinePseudos . Select ( t => GameObject . Instantiate ( t . gameObject , footer . transform ) ) . ToList ( ) ;
171167 SequentialPixelTextLines footerLines = footer . AddComponent < SequentialPixelTextLines > ( ) ;
172168 footerLines . lines = newFooterLines . Select ( o => o . GetComponent < PixelText > ( ) ) . ToList ( ) ;
@@ -178,14 +174,14 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
178174 controller . rightButton = screenObject . transform . Find ( "Unlocks/ScreenAnchor/PageRightButton" ) . gameObject . GetComponent < MainInputInteractable > ( ) ;
179175 if ( controller . showCardPanel )
180176 {
181- Plugin . Log . LogInfo ( $ "Reassigning left/right scroll buttons") ;
177+ InscryptionAPIPlugin . Log . LogInfo ( $ "Reassigning left/right scroll buttons") ;
182178 controller . leftButton . CursorSelectStarted = controller . LeftButtonClicked ;
183179 controller . rightButton . CursorSelectStarted = controller . RightButtonClicked ;
184180 controller . leftButton . gameObject . transform . localPosition = controller . leftButton . gameObject . transform . localPosition - ( Vector3 ) BETWEEN_CARD_OFFSET * 1.5f ;
185181 controller . rightButton . gameObject . transform . localPosition = controller . rightButton . gameObject . transform . localPosition + ( Vector3 ) BETWEEN_CARD_OFFSET * 1.5f ;
186182
187183 // Let's add three more cards to the panel
188- Plugin . Log . LogInfo ( $ "Expanding card panel") ;
184+ InscryptionAPIPlugin . Log . LogInfo ( $ "Expanding card panel") ;
189185 GameObject cardPrefab = Resources . Load < GameObject > ( "prefabs/gbccardbattle/pixelselectablecard" ) ;
190186 Transform cardsParent = screenObject . transform . Find ( "Unlocks/ScreenAnchor/Cards" ) ;
191187 for ( int i = 0 ; i < 3 ; i ++ )
@@ -200,7 +196,7 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
200196 Traverse . Create ( newPixelComponent ) . Field ( "pixelBorder" ) . SetValue ( pixelBorder ) ;
201197 }
202198
203- Plugin . Log . LogInfo ( $ "Assigning click action to cards in card panel") ;
199+ InscryptionAPIPlugin . Log . LogInfo ( $ "Assigning click action to cards in card panel") ;
204200 foreach ( PixelSelectableCard card in controller . cards )
205201 {
206202 card . CursorSelectStarted = ( Action < MainInputInteractable > ) Delegate . Combine ( card . CursorSelectStarted , new Action < MainInputInteractable > ( delegate ( MainInputInteractable i )
@@ -219,7 +215,7 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
219215 }
220216 else
221217 {
222- Plugin . Log . LogInfo ( $ "Destroying scroll buttons") ;
218+ InscryptionAPIPlugin . Log . LogInfo ( $ "Destroying scroll buttons") ;
223219 GameObject . Destroy ( controller . leftButton . gameObject ) ;
224220 GameObject . Destroy ( controller . rightButton . gameObject ) ;
225221
@@ -229,13 +225,13 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
229225
230226
231227 // Reroute the back button
232- Plugin . Log . LogInfo ( $ "Rerouting back button") ;
228+ InscryptionAPIPlugin . Log . LogInfo ( $ "Rerouting back button") ;
233229 GameObject backButton = screenObject . transform . Find ( "BackButton" ) . gameObject ;
234230 controller . backButton = backButton . GetComponent < AscensionMenuBackButton > ( ) ;
235231 controller . backButton . screenToReturnTo = previousScreen ;
236232
237233 // Add a continue button
238- Plugin . Log . LogInfo ( $ "Adding continue button") ;
234+ InscryptionAPIPlugin . Log . LogInfo ( $ "Adding continue button") ;
239235 GameObject continuePrefab = Resources . Load < GameObject > ( "prefabs/ui/ascension/ascensionmenucontinuebutton" ) ;
240236 GameObject continueButton = GameObject . Instantiate ( continuePrefab , screenObject . transform ) ;
241237 continueButton . transform . localPosition = new Vector3 ( 2.08f , 1.15f , 0f ) ;
@@ -252,24 +248,24 @@ public static AscensionRunSetupScreenBase BuildScreen(Type screenType, Ascension
252248 controller . continueButton . CursorSelectStarted = ( Action < MainInputInteractable > ) Delegate . Combine ( controller . continueButton . CursorSelectStarted , clickAction ) ;
253249
254250 // Let the base class do its magic
255- Plugin . Log . LogInfo ( $ "Calling screen implementation to finish creating screen UI elements") ;
251+ InscryptionAPIPlugin . Log . LogInfo ( $ "Calling screen implementation to finish creating screen UI elements") ;
256252 controller . InitializeScreen ( screenObject ) ;
257253
258254 // And we're done
259- Plugin . Log . LogInfo ( $ "Done building screen") ;
255+ InscryptionAPIPlugin . Log . LogInfo ( $ "Done building screen") ;
260256 return controller ;
261257 }
262258
263259 private static void TransitionToGame ( )
264260 {
265261 if ( ! AscensionSaveData . Data . ChallengeLevelIsMet ( ) && AscensionSaveData . Data . challengeLevel <= 12 )
266262 {
267- Plugin . Log . LogInfo ( "Sending the player to the confirmation screen" ) ;
263+ InscryptionAPIPlugin . Log . LogInfo ( "Sending the player to the confirmation screen" ) ;
268264 AscensionMenuScreens . Instance . SwitchToScreen ( AscensionMenuScreens . Screen . SelectChallengesConfirm ) ;
269265 }
270266 else
271267 {
272- Plugin . Log . LogInfo ( "Starting a new run" ) ;
268+ InscryptionAPIPlugin . Log . LogInfo ( "Starting a new run" ) ;
273269 AscensionMenuScreens . Instance . TransitionToGame ( true ) ;
274270 }
275271 }
0 commit comments