_HouseSwitches V1.0


NOTICE: THIS MOD IS NOT ONE THAT WORKS RIGHT OUT OF THE BOX. IT PROVIDES TOOLS TO BE USED WITH YOUR OWN HOUSE ITEMS.
Using the house mannequin and clicking the button to open the switch panel is the easiest way to use the addon.

Installation:
Install like any other addon. If this is your first addon, please follow these instructions: https://www.eq2interface.com/forums/faq.php?faq=howto_install#faq_new_faq_item

Copy all the contents in the _HouseSwitches folder to your addon UI folder and add the EQ2UI_custom.xml include line to your EQ2UI_custom.xml in your addon UI folder.



Description:
The addon loads house layouts when interacting with specific items you setup in the addon. The works by loading layouts for different items placemnet to "interactively" move items. This only works in your house but may be able to work for guild halls but I have yet to try it.
You can use this to make moving bookcases to create secret doors, or make opening fridges or boxes, or other ideas.



Usage for v1.x:
This addon requires saving house layouts for each state of any "activated items". EQ2 Layout editor is fantastic for this.

Make sure there are no spaces in the house layout name. The house name should be CharacterName's_HouseName like: Anadre's_Manor.

The addon requires house layouts to be saved as the housename_whateveryoumakeit. Example Anadre's_Manor_CloseFridge.
The command in the code for loading the layout is "load_layout Parent.Parent.CurrentZone.Text ## _OpenFridge"


_HouseSwitchPanel.xml Purpose:
This contains the window that popups up with the various activation buttons. You have to change them to load you house layouts.


_HouseSwitchTriggers.xml Purpose:
There is a panel of al the switches that pop up when you click the button on the house mannequin, any items you set in the mod. The following is useage for using book as triggers (the other triggers use the same format):
T3 book in my usage in my house automatically louad the layout to open/close my fridge as shown in my pictures.

NOTICE: Pay attention to &apos; replacing apostrophe and &amp; to replace & in item names
Look for the following line and change the book names to books you want (T#="book name"). You can add more if you add more arguments. 
	<Page Name="BookTrigger" T1="The Precious Fairy Book" T2="A Frostfell Carol" T3="The Siren&apos;s Song" Visible="false" OnShow="
		BOOL1=(Parent.Parent.Book_Simple.WindowFrame.LeftGrouper.Title.Text '==' T1)
		BOOL2=(Parent.Parent.Book_Simple.WindowFrame.LeftGrouper.Title.Text '==' T2)
		BOOL3=(Parent.Parent.Book_Simple.WindowFrame.LeftGrouper.Title.Text '==' T3)
		Parent.UseFridge.Visible=BOOL3 ? BOOL3 : ''
		DOTHIS=(BOOL1 '||' BOOL2 '||' BOOL3)
		Parent.ActivateBookTrigger.Visible=DOTHIS ? DOTHIS : ''" OnHide="Parent.UseFridge.Visible=BOOL3 ? false : ''">
	</Page>
	<Page Name="ActivateBookTrigger" Visible="false" OnShow="
		show_window Custom.HouseSwitchPanel
		Visible=false" OnHide="hide_window Custom.HouseSwitchTriggers">
	</Page>



SPECIAL NOTE FOR CONTAINERS:
Containers and possibly other items have a random numbers in there label that you cannot see. Example the T1 in the following:

	<Page Name="ContainerTrigger" Visible="false" T1=":c033c273aa87bed3:Personal Food &amp; Drink Depot" OnShow="
		BOOL1=(Parent.Parent.Container.Label.Text '==' T1)
		Parent.UseFridge.Visible=BOOL1 ? BOOL1 : ''
		BOOL2=(Parent.Parent.Container.Label.Text '==' T2)
		Parent.ActivateContainerTrigger.Visible=BOOL2 ? BOOL2 : ''" OnHide="Parent.UseFridge.Visible=BOOL1 ? false : ''">
	</Page>
	<Page Name="ActivateContainerTrigger" Visible="false" OnShow="
		show_window Custom.HouseSwitchPanel
		Visible=false" OnHide="hide_window Custom.HouseSwitchTriggers">
	</Page>


How to find that number: add say Parent.Parent.Container.Label.Text (or Parent.DesignerTarget.Text for items used by the decorator mode button selection, etc.).
It will show the number in chat you can copy and save, or you can find it in the logs if you turned on logging.

See the second line in the following:
	<Page Name="ContainerTrigger" Visible="false" T1=":c033c273aa87bed3:Personal Food &amp; Drink Depot" OnShow="
		say Parent.Parent.Container.Label.Text
		BOOL1=(Parent.Parent.Container.Label.Text '==' T1)
		Parent.UseFridge.Visible=BOOL1 ? BOOL1 : ''
		BOOL2=(Parent.Parent.Container.Label.Text '==' T2)
		Parent.ActivateContainerTrigger.Visible=BOOL2 ? BOOL2 : ''" OnHide="Parent.UseFridge.Visible=BOOL1 ? false : ''">
	</Page>
	<Page Name="ActivateContainerTrigger" Visible="false" OnShow="
		show_window Custom.HouseSwitchPanel
		Visible=false" OnHide="hide_window Custom.HouseSwitchTriggers">
	</Page>
