5E Character Create Playlist
Page 1 of 3 123 Last
  1. #1

    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","")
    Last edited by joshuha; August 10th, 2011 at 15:27.

  2. #2
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    This is Cool. Two questions:

    1) Am I right in understanding that you remove the underlying chat panel and simply call for the chatwindow to render as a standard window?
    a) if so do dice rolls still fire OK when the chatwindow is sized larger than the original default?
    2) do you not also need to add the <dynamic /> tag to the chat windowclass to allow for dynamic resizing of the chatwindow?
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  3. #3
    Quote Originally Posted by DrZeuss
    This is Cool. Two questions:

    1) Am I right in understanding that you remove the underlying chat panel and simply call for the chatwindow to render as a standard window?
    a) if so do dice rolls still fire OK when the chatwindow is sized larger than the original default?
    2) do you not also need to add the <dynamic /> tag to the chat windowclass to allow for dynamic resizing of the chatwindow?
    1) Yes
    a) Yes they come across fine, I tested with several players. Whats neat is if the players window is bigger then your it seems to overlap the vector of where it fires but still lands in your smaller window and the results are still the same.

    2) Yes but its already like that in the base 4E ruleset in 2.8 even though its tied to a panel and therefor not really dynamic. Will add a note though.
    Last edited by joshuha; August 3rd, 2011 at 23:14.

  4. #4
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    It works beautifully. Just added this to the ArsMagica ruleset.

    - Obe
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  5. #5
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    Ouch. Noticed the first bug with this aproach... in it's current form the window can be accidentially closed by the clients.

    - Obe
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  6. #6
    Updated post so user's cannot close chat down. GM could still though and can get window back by pressing ALT. Might be a more elegant way to prevent GM from doing it or auto-reopen but can't think of it right this second.
    Last edited by joshuha; August 4th, 2011 at 02:50.

  7. #7
    Nice mod joshuha!

    I've just added it to my ruleset and noticed a minor issue. When you move the chat window the subjacent area that receives the thrown dice is not updated to the new position until the chat window is resized.

  8. #8
    Hmm didn't notice that but will test it and see if I can figure out why its doing that.

  9. #9
    Great job joshuha!

    I was able to add it to a ruleset also. I did add the <placement> tag so I could set a default position and size which replicated the original placement before I made changes.

    I am able to replicate psicodelix's issue. I did notice that it will still register the roll if you drop it in the old location before you moved it.

  10. #10
    a work around to the issue isto force a resize every time you move the window.

    add an on move event handler to the chat window onInit and then set the onMove function to resize to the current window size and it should work

    Code:
    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(source)
    	source.setSize(source.getSize())
    	end

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in