STAR TREK 2d20
Page 1 of 2 12 Last
  1. #1
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1

    Feature Request: Resizable Character Sheet With Contents Expanding To Fit Width

    I was able to create an extension that allows me to resize my character sheets for CoreRPG, but when I expand the width of the character sheet, the fields do not expand to fit the width of the sheet. I know that modifying the anchors will fix that, but I have not been able to identify which anchors to change.

    CoreRPG has made some very nice improvements with the last few updates. I would love to see the character sheets become resizable in a future update, with fields that expand to fit the sheet width. In the meantime, if anyone knows which anchors I need to modify to make this happen, I can include that in my extension. Otherwise, just consider it a feature request!

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,638
    Blog Entries
    1
    if your frame goes to teh right edge you can set the anchor to be something like -29 and that sets it to 29 pixels from the right edge.
    You can do the same thing for the bottom edge.
    For frames that do not end on the right and/or the bottom it is not very practical to resize the frame.

    Does that help?
    Ive got some stuff Im working on for DCC but as you say its getting close to FGCon... I also need to do my game prep so if you are ok with the current DCC changes for now...?

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Quote Originally Posted by leozelig View Post
    ...but when I expand the width of the character sheet, the fields do not expand to fit the width of the sheet.

    In the meantime, if anyone knows which anchors I need to modify to make this happen, I can include that in my extension.
    As damned says, the right most window frames and controls are usually bound to the right hand edge so resizing width does result in these right hand frame/control resizing. These anchors are already there in standard CoreRPG - which specific fields are you referring to?

    Quote Originally Posted by leozelig View Post
    Otherwise, just consider it a feature request!
    Add it to the feature request list: https://fg2app.idea.informer.com/
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Quote Originally Posted by damned View Post
    Ive got some stuff Im working on for DCC but as you say its getting close to FGCon... I also need to do my game prep so if you are ok with the current DCC changes for now...?
    Yes, definitely good for FG Con, thank you!

  5. #5
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Here is an example of my character sheet, minimum width and maximum width, but fields are fixed size.

    I understand how anchoring works, but identifying which anchors to modify is like cracking a secret code!

    Attachment 9440 Attachment 9441

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Ah, OK - so you're referring to the column width for the attribute list. By default these lists are set with a specific column width (222 pixels in this case), if the windowlist control (https://www.fantasygrounds.com/refdoc/windowlist.xcp) is resized so that it's width allows for another column to be added, it will add another column with the same fixed width:



    If you want to dynamically change the width of the columns then you'll need to decide on a fixed number of columns - let's go with 2 in this case. Then, code needs to be written that detects when the window gets resized and changes the width of the columns using the setColumnWidth method based off the new width of the windowlist control: https://www.fantasygrounds.com/refdo...setColumnWidth



    The disadvantage if this is that if you have a lot of entries then resizing the width doesn't give you more columns, just two wider columns, and you'll have to resize the length (height) of the window or use the scrollbar. So, it's basically a design decision: dynamic width with a fixed number of columns, or dynamic number of columns with a fixed width.

    To do the dynamic 2 column width resizing shown in the second screenshot above you'll need to modify the <template name="list_charmaincategory"> in campaign\template_char.xml as follows (code in red):

    Code:
    	<template name="list_charmaincategory">
    		<windowlist>
    			<class>char_main_category</class>
    			<datasource>.maincategorylist</datasource> 
    			<columns width="222" filldown="true" />
    			<allowcreate />
    			<allowdelete />
    			<sortby><field>label</field></sortby>
    			<script>
    				function onInit()
    					window.onSizeChanged = resizeColumns;
    				end
    			
    				function resizeColumns()
    						local w, h = window.getSize();
    						setColumnWidth(math.floor(w/2)-40);
    				end		
    				
    				function onListChanged()
    					update();
    				end
    
    				function update()
    					local sEdit = getName() .. "_iedit";
    					if window[sEdit] then
    						local bEdit = (window[sEdit].getValue() == 1);
    						for _,wCategory in ipairs(getWindows()) do
    							wCategory.idelete.setVisibility(bEdit);
    							wCategory.attributes_iadd.setVisible(bEdit);
    							wCategory.attributes.update(bEdit);
    						end
    					end
    				end
    				
    				function addEntry(bFocus)
    					local w = createWindow();
    					if bFocus then
    						w.header.subwindow.label.setFocus();
    					end
    					return w;
    				end
    			</script>
    		</windowlist>
    	</template>
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,638
    Blog Entries
    1
    Nice - the three columns would be useful at times for sure!

  8. #8
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Thank you (again), Trenloe! I actually like the three columns, but I am going to experiment with a few things and see what I like.

  9. #9
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Ok, as I was playing around with the min/max sheet sizes, I noticed that if you minimize below a certain level, the columns drop from two to one, and the fields expand to fill the window. With a max of 750-800, it goes to three columns (but the field sizes don't change once it expands to two columns, interestingly). I really like the 3-column look actually. I did notice that the sheet will not split a section in two, so my thief character sheet has ~15 skills listed in the "Thief Skills" section and will not split into three columns. I'm going to make another section with the same name and divide up the list manually, which will fix that.

    So, I changed the field size to 240 (from 222), because it was cutting off the last character of a few fields, and changed the min height/width to 500 and the max to 800. I liked the ability for the player to resize it to a format that they like (1-3 columns). That works fine for me - pretty darn close to having an actual ruleset really!

    Once again, thank you for pointing me to the template_char file, Trenloe... Somehow I did not think to look there.

  10. #10
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,638
    Blog Entries
    1
    Quote Originally Posted by leozelig View Post
    So, I changed the field size to 240 (from 222)...
    .... That works fine for me - pretty darn close to having an actual ruleset really!
    You could also look at using a differnt font - 1px smaller to fit more characters in.
    CoreRPG is far more flexible than most of have worked out



    FG Con 6 – April 17-19th 2015 - register at www.fg-con.com for all the latest info.

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
  •  
DICE PACKS BUNDLE

Log in

Log in