XRWS           À   ~  Bext_01.cat ext_01.dat md/fixyourface.xml 4447 1686461726 b12c74756ef2e1870d06d66e7687c850
md/md.xsd 227 1684625449 65903521e4b710fa13ef8318218cbc30
<?xml version="1.0" encoding="utf-8"?>
<mdscript name="GoFixYourFace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
    <cues>
		<cue name="GFYFInit">
			<conditions>
				<check_any>
					<event_universe_generated/>
					<event_cue_signalled cue="md.Setup.Start"/>
				</check_any>
			</conditions>
			<actions>
                <set_value name="$GFYFDebug" exact="0" />
				<debug_text text="'GFYFDebug: ' + $GFYFDebug" />
			</actions>
		    <cues>
				<cue name="InteractMenu_GFYFRepair" instantiate="true">
					<conditions>
						<event_cue_signalled cue="md.Interact_Menu_API.Get_Actions" />
					</conditions>
					<actions>
						<set_value name="$ship" exact="@event.param.$selectedplayerships.{1}" />
						<set_value name="$clickobject" exact="@event.param.$object" />
						<debug_text text="'GFYF Initial Menu: $ship: %s $clickobject: %s shipname: %s clickobject name: %s'.[@$ship,@$clickobject,@$ship.knownname,@$clickobject.knownname]" chance="$GFYFDebug" />
						<do_if value="($ship and $ship.owner == faction.player) or ($clickobject and $clickobject.owner == faction.player)">
                            <!-- right-clicking ship -->
							<set_value name="$section" exact="'main_orders'" />
							<set_value name="$text" exact="'Closest Repair/Resupply'" />
							<signal_cue_instantly cue="md.Interact_Menu_API.Add_Action" param = "table[
								$id = 'gofixyourface1',
								$section = 'main_orders',
								$text = $text,
								$icon = 'order_repair',
                                $mouseover = 'Send ship to repair/resupply at nearest option',
								$callback = InteractMenu_GFYFOrder
							]" />
							<!-- right-clicking map with ship selected -->
							<set_value name="$section" exact="'selected_orders'" />
							<signal_cue_instantly cue="md.Interact_Menu_API.Add_Action" param = "table[
								$id = 'gofixyourface2',
								$section = 'selected_orders',
								$text = $text,
								$icon = 'order_repair',
                                $mouseover = 'Send ship to repair/resupply at nearest option',
								$callback = InteractMenu_GFYFOrder
							]" />
						</do_if>
						<cancel_cue cue="this" />
					</actions>
				</cue>
				
				<cue name="InteractMenu_GFYFOrder">
					<conditions>
						<event_cue_signalled />
					</conditions>
					<actions>
						<set_value name="$clickobject" exact="event.param.$object" />
						<set_value name="$selectedships" exact="@event.param.$selectedplayerships" />
						<debug_text text="'GFYF Order Given: $ship: %s $clickobject: %s shipname: %s clickobject: %s'.[@$ship,@$clickobject,@$ship.knownname,@$clickobject.knownname]" chance="$GFYFDebug" />
						<do_for_each name="$ship" in="@$selectedships">						
						    <debug_text text="'GFYF Giving Orders: $ship: %s $clickobject: %s shipname: %s clickobject: %s'.[@$ship,@$clickobject,@$ship.knownname,@$clickobject.knownname]" chance="$GFYFDebug" />
							<do_if value="$ship">
								<create_order object="$ship" id="'Resupply'" immediate="true" >
                                    <param name="hullpercent" value="100" />
                                    <param name="urgent" value="false" />
                                    <param name="onlyuseresupplierships" value="false" />
                                    <param name="resupply_units" value="false" />
                                    <param name="debugchance" value="0" />
                                </create_order>
							</do_if>
						</do_for_each>
                        <do_if value="$selectedships.count == 0 and $clickobject and $clickobject.isclass.ship and $clickobject.owner == faction.player">
                            <create_order object="$clickobject" id="'Resupply'" immediate="true" >
                                <param name="hullpercent" value="100" />
                                <param name="urgent" value="false" />
                                <param name="onlyuseresupplierships" value="false" />
                                <param name="resupply_units" value="false" />
                                <param name="debugchance" value="0" />
                            </create_order>
                        </do_if>
						<reset_cue cue="this" />
					</actions>
				</cue>
            </cues>						
		</cue>
    </cues>
</mdscript><?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:include schemaLocation="D:\X4 Modding\Core X4 Files\libraries\md.xsd" />

</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<content id="" name="" description="" author="Chillmatica" version="100" date="2023-06-11" save="0" lastupdate="">
  <dependency id="ws_2042901274" optional="false" name="SirNukes Mod Support APIs"/>
</content>
