DICE PACKS BUNDLE
Page 1 of 2 12 Last

Thread: Ruleset stuff

  1. #1

    Ruleset stuff

    So I'm trying to modify CoreRPG. I can't even put a string on the charsheet. In campaign/record_char_main.xml I have:

    <windowclass name="charsheet_main">
    <margins control="0,0,0,2" />
    <sheetdata>
    <frame_char name="attributesframe">
    <bounds>15,0,-29,-5</bounds>
    </frame_char>
    <label_frametop name="attributesframetop">
    <anchored to="attributesframe" />
    <static textres="char_label_abilities" />
    </label_frametop>
    <label_fieldtop>
    <anchored to="attributesframe" position="lefthigh" offset="15,5" />
    <static textres="ABC" />
    </label_fieldtop>
    </sheetdata>
    </windowclass>

    strings.xml contains the string ABC and defines it as abc. Nothing show up. Just attributes text that comes with CoreRPG. What is wrong with label_fieldtop? I tried it with label too. Nothing. I've been programming for 30 years and I can't get a text field to show up.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    are you working in an unpacked copy of corerpg?
    is fg loading your unpacked copy?

    Ok label field top should be anchored to something like a numberfield not a frame...
    and static textres is looking for a text resource called ABC - eg have a look in one of the strings files and you will see a bunch of text resources - so you would need to create one called ABC which contains the text you want displayed...

  3. #3
    [QUOTE=damned;426517]are you working in an unpacked copy of corerpg?[quote]
    Yes

    is fg loading your unpacked copy?
    Yes

    Ok label field top should be anchored to something like a numberfield not a frame...
    Is this documented anywhere? There are a lot of "helper" tags not part of the documented API in the rulesets. What "label" should I be using? I've only gotten anything to appear by using explicit <bound> tags.

    and static textres is looking for a text resource called ABC - eg have a look in one of the strings files and you will see a bunch of text resources - so you would need to create one called ABC which contains the text you want displayed...
    My OP says I added ABC string to the strings.xml.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by jmucchiello View Post
    I've only gotten anything to appear by using explicit <bound> tags.
    Your code in post #1 is using an anchor position of “lefthigh” - which is outside of the frame you’re anchoring to and is also inheriting dimensions from that frame, so the control probably isn’t anywhere visible - hence why static bounds is working (I assume you’ve specified bounds within the visible areas of the window), but anchoring isn’t.

    See info on anchoring here: https://www.fantasygrounds.com/wiki/...face#Anchoring
    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!

  5. #5
    Quote Originally Posted by Trenloe View Post
    Your code in post #1 is using an anchor position of “lefthigh” - which is outside of the frame you’re anchoring to and is also inheriting dimensions from that frame, so the control probably isn’t anywhere visible - hence why static bounds is working (I assume you’ve specified bounds within the visible areas of the window), but anchoring isn’t.

    See info on anchoring here: https://www.fantasygrounds.com/wiki/...face#Anchoring
    The anchoring section you reference (that I've read six times) doesn't explain how to combine left and top. I saw lefthigh in another file and used it. Again, is that documented anywhere?

    I repeat. I've been a programmer for 30 years. I understand how this should work. The documentation is very spotty.

  6. #6
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    The documentation is certainly not all encompassing.
    The approach I use is to look for an example of what I want to do in an existing ruleset and mimic that code.

    I keep unpacked copies of CoreRPG and 5E (I unpack to CoreRPG337 and 5E337 so that I am not preventing updates from working) plus I have over time collected many other extensions and community rulesets that have different UI features.

    I do find anchoring to be plenty confusing still...

  7. #7

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Yep me too but it is an incredibly powerful system. The relative anchoring can make a lot of Windows very easy to do. And the merge system is not even short of amazing.

  8. #8
    If you want something in the upper left interior of another object (such as a frame), use the "insidetopleft" position as the starting point. Or set the individual left and top anchors to parent from the target object.

    Check out the Interface section in the Developer Guide wiki:
    https://www.fantasygrounds.com/wiki/...face#Anchoring
    Specifically, take a look at the graphic that's included to help you understand which anchors are set by each "position" option.

    Regards,
    JPG

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by jmucchiello View Post
    The anchoring section you reference (that I've read six times) doesn't explain how to combine left and top. I saw lefthigh in another file and used it. Again, is that documented anywhere?
    As mentioned by Moon Wizard - check the graphic in the anchoring section we both linked.
    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!

  10. #10

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
  •  
STAR TREK 2d20

Log in

Log in