How to create a resizable chatwindow
I worked at creating this as an extension but due to the way the default chat is a panel and this is a pure windowclass it isn't working. Video will take a second to load.
You will be needing to modify 2 XML files and 1 LUA file.
File 1: desktop_panels.xml
Step 1: Comment out the current chat panel so that it looks like this:
Code:
<!--<panel name="chat" modes="host,client">
<class>chat</class>
<bounds>15,90,390,-118</bounds>
</panel>-->
Step 2: Change the anchors on the identity list not to use the chat panel. Note that you may need to play around with the coordinates here to place the identity list (the NPCs the GM speaks as) somewhere else you like it.
Comment out the parent node for the top anchor and left anchor and add a left offset to the identitylist control like so:
Code:
<top>
<!--<parent>chat</parent>-->
<anchor>bottom</anchor>
<offset>-50</offset>
</top>
<left>
<!--<parent>chat</parent>-->
<anchor>left</anchor>
<offset>100</offset>
</left>
File 2: desktop_classes.xml
Step 1: Add a width to the sizelimits maximum node of the chat windowclass. This will allow maximum stretchability.
Code:
<maximum>
<height>10000</height>
<width>10000</width>
</maximum>
Step 2: Modify the left anchor to use the right side of the chat panel in the "mode" genericcontrol under the "chat" windowclass..
Code:
<left>
<anchor>right</anchor>
<offset>-55</offset>
</left>
Step 3: Add functions to autoshare the window with client. If GM accidentally closed it pressing ALT will bring it back with no loss of info. Put these in the "chat" windowclass. I put mine right below the <placement> node.
Code:
<softclose />
<sharable />
<script>
function onInit()
User.onLogin = reshare
Input.onAlt = reopen
self.onMove = onMove
end
function reshare()
share()
end
function reopen()
Interface.openWindow("chat","")
share()
end
function onMove()
self.setSize(self.getSize())
end
</script>
Note if you want the default chat not to open in the middle you can add a set of position tags to the chat windowclass. This is optional though.
Also, if your ruleset does not have the current chat windowclass as dynamic you should add the following under the sizelimits node:
Code:
<dynamic>
<resize>both</resize>
</dynamic>
File 3: Scripts\desktop.lua
Step 1: Basically here we are adding in a call to the desktop initialization to open our modified chat windowclass for the GM. Modify the onInit function and add an Interface.openWindow right under the first if User.isHost() statement.
Code:
function onInit()
if not User.isLocal() then
if User.isHost() then
Interface.openWindow("chat","")