Custom window (Slash Command): Difference between revisions

From Homecoming Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
/custom_window "Title" can be used to create macro-holding windows. Once created, the custom window will appear on every character, new or old.
{{TOCright}}
== SlashCommand ==
{{SlashCommandArticle|command=Custom_Window|options=name|note=This command creates a persistent, macro-holding window.}}
 
The /custom_window command, if not setup first, will initially create a temporary, custom window that will disappear when the game is restarted. However, the real value of a custom window is that it can be made persistent. Meaning, it can automatically appear for every account on every character, new or old.  
 
== Creating the Custom Window ==


Before using the command, create a text file named custom.window  
Before using the command, create a text file named custom.window using all lower case letters.


=== Syntax ===
Inside the text file type:
Inside the text file type:
Window "MyCustomWindowName" 0 0 200 100
Button "ButtonName" "<commands>"
Open 1
End


* '''<tt>Window</tt>''' tells the game this is a new window.
** '''''<tt>"MyCustomWindowName"</tt>''''' is a user variable that defines the name of the custom window.
** The first 2 digits define the location of the custom window on the screen, expressed as decimals. These coordinates are dynamically updated as you click and drag the window across the screen, so you really don't have to mess with these.
** The last 2 numbers define the size of the custom window. The size is dynamically updated as you resize the window with the mouse within game, so you really don't have to mess with these.
* '''''<tt>Button</tt>''''' tells the game to create a button.
** '''''<tt>"ButtonName"</tt>''''' defines the name of the button.
** '''''<tt>"<commands>"</tt>''''' are the slash commands to be executed when the button is clicked.
* '''''<tt>Open 1</tt>''''' creates a blank button that allows you to create a new button while in game.
* '''''<tt>End</tt>''''' tells the game this is the end of the custom window script.


Window MyWindow 0 0 200 100
Note: Before the Button and Open 1 commands is a tab character (unicode: U+0009) that is required for the custom window script to function properly.


Open 1


End
Save the text file in the following folder (in all lowercase letters):
''<COH_INSTALL_DIRECTORY>''\data\customwindows\


If the directories/folders do not exist, then create them. If you don't know the location of the COH Install Directory on your hard drive, go in game and type:
/bindloadfile /


Save the text file in the following folder in all lowercase letters:
This will give you the location of the game's default home folder in the Global chat window, but it also points you to the general location of your COH Install Directory.


COH folder/data/customwindows/


Create the folders if they don't exist.
Now go into the game, and in the chat box type  
 
/custom_window "MyCustomWindowName"
Now go into the game, and in the chat box type /custom_window MyWindow


A small box will appear in the upper left corner of the screen. Click on it and the custom window will open.  
A small box will appear in the upper left corner of the screen. Click on it and the custom window will open.  


Drag and drop any macro from your power trays into the custom window and a button will be created with the macro's commands.
Drag and drop any macro from your power trays into the custom window and a button will automatically be created with the macro's commands.


Drag the custom window to any location on your screen. Grab the edges of the custom window to resize it.
Drag the custom window to any location on your screen. Grab the edges of the custom window to resize it.


Note: You can change "MyWindow" into any name you want. If the name includes blank spaces, enclose the name in quotes. For example:
Window "My Custom Window" 0 0 200 100


Additional custom windows can be created using the custom_window slash command. Simply use a different name for the new custom window.


TIP: The custom.window text file requires some very specific formatting to work. It's best to use the custom_window command in game before you attempt to edit the file manually, which in turn will reset the text file you created into the correct format. Then you can use a text editor and just copy/paste the formatting within the corrected file if you want to edit the file manually. Be aware that if the text file is incorrectly formatted, that the custom_window command will completely overwrite it, re-set it, and delete any data already inside the file.
=== Notes ===
* Additional custom windows can be created using the custom_window slash command. Simply use a different name for the new custom window while in game.
* There's no command to destroy one of these yet, so you still need to text-edit the file to get rid of it.
* TIP: The custom.window text file requires some very specific formatting to work. It's best to use the custom_window command in game before you attempt to edit the file manually, which in turn will reset the text file you created into the correct format. Then you can use a text editor and just copy/paste the formatting within the corrected file if you want to edit the file manually. Be aware that if the text file is incorrectly formatted, that the custom_window command will completely overwrite it, re-set it, and delete any data already inside the file.


Note: There's no command to destroy one of these yet, so you still need to text-edit the file to get rid of it, for now.


==See Also==
*{{slashcommand|custom_window_toggle}}


==External Links==
This process was first detailed by @Leandro here https://www.cohtitan.com/forum/index.php?topic=11080.msg186612#msg186612
This process was first detailed by @Leandro here https://www.cohtitan.com/forum/index.php?topic=11080.msg186612#msg186612

Revision as of 19:16, 4 June 2022

SlashCommand

/Custom_Window name

This command creates a persistent, macro-holding window.

The /custom_window command, if not setup first, will initially create a temporary, custom window that will disappear when the game is restarted. However, the real value of a custom window is that it can be made persistent. Meaning, it can automatically appear for every account on every character, new or old.

Creating the Custom Window

Before using the command, create a text file named custom.window using all lower case letters.

Syntax

Inside the text file type:

Window "MyCustomWindowName" 0 0 200 100
	Button "ButtonName" "<commands>"
	Open 1
End
  • Window tells the game this is a new window.
    • "MyCustomWindowName" is a user variable that defines the name of the custom window.
    • The first 2 digits define the location of the custom window on the screen, expressed as decimals. These coordinates are dynamically updated as you click and drag the window across the screen, so you really don't have to mess with these.
    • The last 2 numbers define the size of the custom window. The size is dynamically updated as you resize the window with the mouse within game, so you really don't have to mess with these.
  • Button tells the game to create a button.
    • "ButtonName" defines the name of the button.
    • "<commands>" are the slash commands to be executed when the button is clicked.
  • Open 1 creates a blank button that allows you to create a new button while in game.
  • End tells the game this is the end of the custom window script.

Note: Before the Button and Open 1 commands is a tab character (unicode: U+0009) that is required for the custom window script to function properly.


Save the text file in the following folder (in all lowercase letters):

<COH_INSTALL_DIRECTORY>\data\customwindows\

If the directories/folders do not exist, then create them. If you don't know the location of the COH Install Directory on your hard drive, go in game and type:

/bindloadfile /

This will give you the location of the game's default home folder in the Global chat window, but it also points you to the general location of your COH Install Directory.


Now go into the game, and in the chat box type

/custom_window "MyCustomWindowName"

A small box will appear in the upper left corner of the screen. Click on it and the custom window will open.

Drag and drop any macro from your power trays into the custom window and a button will automatically be created with the macro's commands.

Drag the custom window to any location on your screen. Grab the edges of the custom window to resize it.


Notes

  • Additional custom windows can be created using the custom_window slash command. Simply use a different name for the new custom window while in game.
  • There's no command to destroy one of these yet, so you still need to text-edit the file to get rid of it.
  • TIP: The custom.window text file requires some very specific formatting to work. It's best to use the custom_window command in game before you attempt to edit the file manually, which in turn will reset the text file you created into the correct format. Then you can use a text editor and just copy/paste the formatting within the corrected file if you want to edit the file manually. Be aware that if the text file is incorrectly formatted, that the custom_window command will completely overwrite it, re-set it, and delete any data already inside the file.


See Also

External Links

This process was first detailed by @Leandro here https://www.cohtitan.com/forum/index.php?topic=11080.msg186612#msg186612