<LittleRedSonja>

	<conditional>
    <if cond="mod_loaded('TFP_Harmony') == false">

		<setattribute xpath="//window[@name='mainMenu']//mainmenubutton[not(contains(@name, 'btnQuit'))]" name="visible">false</setattribute>
		<set xpath="//window[@name='mainMenuNews']/rect/@visible">false</set>

		<append xpath="//window[@name='menuBackground']">
			<texture depth="180" color="[white]" texture="@modfolder:Textures/TheHorror_Background.jpg" name="failure" anchor_left="#cam,0,-5" anchor_bottom="#cam,0,-5" anchor_right="#cam,1,5" anchor_top="#cam,1,5"/>
		</append>
		
    </if>
	</conditional>

    <insertAfter xpath="/windows/window[@name='optionsPaging']//table[@name='tabButtons']/pagingheader_button[@name='optionsVideoSimplified']">
        <pagingheader_button name="optionsLoadingScreens" text_key="LOADING SCREENS" />
    </insertAfter>

    <append xpath="/windows">

        <window name="optionsLoadingScreens" anchor="Top" pos="0,-88" width="1800" height="820" controller="SonjaLoadingScreens.XUiC_OptionsLoadingScreens, SonjaLoadingScreens" cursor_area="true" depth="10">
            
            <rect name="content" pos="-900,-70" height="661" width="1800"> 
                        
                <rect name="scrollarea" pos="0,0" width="1200" height="661">
                    <grid pos="8,-20" cols="1" cell_width="1180" cell_height="45" repeat_content="false" arrangement="vertical" >
                        <options_combo_custom name="LoadingSet" prefname="" type="ComboBoxList`1[System.String]" value_wrap="true" apply_defaults="false" />
						<options_combo_custom name="Randomize" prefname="" type="ComboBoxList`1[System.String]" value_wrap="true" apply_defaults="false" />
						<options_combo_custom name="CycleTimer" prefname="" type="ComboBoxList`1[System.String]" value_wrap="true" apply_defaults="false" />
                        <options_combo_custom name="Fullscreen" prefname="" type="ComboBoxBool" value_wrap="true" apply_defaults="false" />
                        <options_combo_custom name="ShowTips" prefname="" type="ComboBoxBool" value_wrap="true" apply_defaults="false" />
						<options_combo_custom name="Watermark" prefname="" type="ComboBoxBool" value_wrap="true" apply_defaults="false" />
                    </grid>
                </rect>

                <rect name="tooltipPanel" pos="8,-330" width="1180" height="200">
                    <label name="lblTooltipTitle" pos="0,0" height="30" font_size="28" color="228, 18, 21, 255" text="{hovered_tooltip_title}" />
                    <label name="lblTooltipText" pos="0,-35" height="150" font_size="24" color="[white]" text="{hovered_tooltip_text}" />
                </rect>
				
                <rect name="statisticsPanel" pos="8,-595" width="1180" height="70">                    
                    <sprite name="statBorder" pos="-15, 10" width="550" height="80" depth="0" sprite="menu_empty2px" type="sliced" fillcenter="false" color="64,64,64,255" />                    
                    <label name="lblStatTitle" pos="0,0" height="28" font_size="32" color="[white]" text="MOD STATISTICS" />                  
                    <label name="lblStats" pos="0,-35" height="26" font_size="24" color="[white]" text="Native Sets: [96FF96]{stat_native_sets}[-]   |   External Mods: [96FF96]{stat_external_sets}[-]   |   Total Images: [96FF96]{stat_total_images}[-]" />
                </rect>

                <sprite name="separator" pos="1225,0" width="2" height="661" depth="0" sprite="menu_empty" type="sliced" color="[darkGrey]" fillcenter="false" />
                
                <rect name="previewArea" pos="1235,0" width="560" height="661">
                    <label name="lblTitle" pos="0,-20" height="40" font_size="30" pivot="left" text="{set_title}" color="228, 18, 21, 255" />
                    <label name="lblAuthor" pos="0,-60" height="30" font_size="24" text="{set_author}" color="[lightGrey]" />
					<label name="lblImageCount" pos="0,-90" height="24" font_size="22" text="{set_image_count}" color="150, 255, 150, 255" />
                    <label name="lblDescription" pos="0,-120" height="180" font_size="26" text="{set_description}" />
					<label name="lblWebsite" pos="0,-305" height="24" font_size="22" text="{set_website}" color="255,204,0,255" /> 
                    <label name="lblDiscord" pos="0,-330" height="24" font_size="22" text="{set_discord}" color="114,137,218,255" />
                    
                    <rect name="previewRect" pos="0,-360" height="350">
                        <sprite name="border" pos="280,0" depth="0" pivot="top" sprite="menu_empty2px" type="sliced" fillcenter="false" color="64,64,64,255" />
                        <texture name="previewTex" pos="280,0" depth="1" pivot="top" texture="{preview_image}" keepsourceaspectratio="true" sourceaspectratiorespectpivot="true" />
                    </rect>
                </rect>
            </rect>

            <options_buttons />
        </window>
		
    </append>


	<!-- ======================= -->
    <!-- LOADING SCREEN OVERRIDE -->
    <!-- ======================= -->
    
    <remove xpath="/windows/window[@name='loadingScreen']" />

    <append xpath="/windows">
        <window name="loadingScreen" depth="200" pos="0,0" width="1185" height="780" anchor="CenterCenter" controller="LoadingScreen" browse_sound="Sounds/Crafting/craft_click_recipe">
            
            <panel name="pnlBlack" depth="1" pos="-3000,3000" width="10000" height="10000" createuipanel="true" on_press="true" disableautobackground="true" gamepad_selectable="false" />

            <rect controller="SonjaLoadingScreens.XUiC_LoadingScreenOverlay, SonjaLoadingScreens">
			
                <sprite name="squashed_black_backdrop" visible="{is_not_fullscreen}" depth="2" type="sliced" sprite="menu_empty" color="0,0,0,255" anchor_left="#cam,0,-5" anchor_bottom="#cam,0,-5" anchor_right="#cam,1,5" anchor_top="#cam,1,5" />
                
                <texture name="Sonja_loading_image_fullscreen" visible="{user_fullscreen}" depth="3" texture="{background_texture}" color="[white]" anchor_left="#cam,0,-5" anchor_bottom="#cam,0,-5" anchor_right="#cam,1,5" anchor_top="#cam,1,5" original_aspect_ratio="true" keep_aspect_ratio="BasedOnWidth" />
                
                <texture name="Sonja_loading_image_squashed" visible="{is_not_fullscreen}" depth="3" texture="{background_texture}" color="[white]" anchor_left="#cam,0,-5" anchor_bottom="#cam,0,250" anchor_right="#cam,1,5" anchor_top="#cam,1,5" original_aspect_ratio="true" keep_aspect_ratio="BasedOnWidth" />
                
                <sprite name="mum_panel_background" visible="{show_watermark}" depth="4" pos="0,0" pivot="center" type="sliced" sprite="menu_empty" color="7,7,7,225" anchor_left="#cam,0,-5" anchor_bottom="#cam,0,-5" anchor_right="#cam,1,5" anchor_top="#cam,1,-775" />
                
            </rect>

            <rect name="tips_enabled" visible="{show_tips}">
                <label name="lblTitle" depth="6" anchor_left="#cam,0,20" anchor_right="#cam,1,-280" anchor_bottom="#cam,0,180" anchor_top="#cam,0,240" font_size="50" color="230,26,22" justify="left" parse_actions="true" text="{title}" upper_case="true" />
                <label name="lblLeft" depth="6" anchor_left="#cam,1,-200" anchor_right="#cam,1,-150" anchor_bottom="#cam,0,180" anchor_top="#cam,0,240" font_size="30" color="[white]" pivot="center" justify="right" parse_actions="true" max_line_count="1" text=" [action:local:Secondary]" />
                <label name="lblIndex" depth="6" anchor_left="#cam,1,-150" anchor_right="#cam,1,-70" anchor_bottom="#cam,0,180" anchor_top="#cam,0,240" font_size="30" color="[white]" pivot="center" justify="center" parse_actions="true" max_line_count="1" text="{index}/{count}" />
                <label name="lblRight" depth="6" anchor_left="#cam,1,-70" anchor_right="#cam,1,-20" anchor_bottom="#cam,0,180" anchor_top="#cam,0,240" font_size="30" color="[white]" pivot="center" justify="left" parse_actions="true" max_line_count="1" text="[action:local:Primary] " />
                <label name="lblText" depth="6" anchor_left="#cam,0,20" anchor_right="#cam,1,-20" anchor_bottom="#cam,0,20" anchor_top="#cam,0,170" font_size="32" justify="left" parse_actions="true" actions_default_format="( [e61a16]###[-] )" spacing_y="5" text="{text}" />
            </rect>
            
        </window>
    </append>
	
</LittleRedSonja>