SWADE Playlist
Page 11 of 12 First ... 9101112 Last
  1. #101
    Quote Originally Posted by MeAndUnique View Post
    That's a reasonable interpretation; I would happily make a merge request if there were a mechanism to do so. Roughly 2 hours of work between last night and this morning to accomplish a reasonable first pass.



    The 5E ruleset is my primary interest, though I'm sure the concept would translate to others. I'm less interested in explicit integration points, though having one at the end would be useful, and more interested in more fine-grained definition of the functionality. There's a rather tight relationship between the Single Responsibility Principle and the Open and Closed Principle. In other words, if the code is broken down so that each function is responsible for doing one thing well, being able to extend any one thing becomes a very straight-forward process.

    See here.
    Ugh - applyDamage? I already had to copy that stupid thing in an extension simply because it was missing one line for exceeded damage message for instant death buried in the dead center of the code that I intercept for polymorph transitions where damage is carried over. Extensions (sigh). Never ending keeping your eye out for surprise changes in the core code

  2. #102
    Quote Originally Posted by SilentRuin View Post
    Ugh - applyDamage? I already had to copy that stupid thing in an extension simply because it was missing one line for exceeded damage message for instant death buried in the dead center of the code that I intercept for polymorph transitions where damage is carried over. Extensions (sigh). Never ending keeping your eye out for surprise changes in the core code
    The changes in the link would make that no longer necessary; you could extend handleRemainderDamage() in the "safe" way.
    My creations: https://github.com/MeAndUnique/FantasyGrounds
    Discord: MeAndUnique#6805

  3. #103
    Quote Originally Posted by MeAndUnique View Post
    The changes in the link would make that no longer necessary; you could extend handleRemainderDamage() in the "safe" way.
    Exactly how would that replace every applyDamage logic for everything in the game again? Are you saying I'd only have to replace "less" things as opposed to the whole thing?
    Last edited by SilentRuin; February 9th, 2021 at 19:01.

  4. #104
    Quote Originally Posted by SilentRuin View Post
    Exactly how would that replace every applyDamage logic for everything in the game again? Are you saying I'd only have to replace "less" things as opposed to the whole thing?
    Assuming that the linked changes were the way the ruleset handles it. For your case you could use the "safe" approach of doing something like this in your extension:
    Code:
    local originalHandleRemainderDamage;
    onInit()
        originalHandleRemainderDamage = ActionDamage.handleRemainderDamage;
        ActionDamage.handleRemainderDamage = handleRemainderDamage;
    end
    function handleRemainderDamage(rTarget, nRemainder, nPrevWounds, rDamageValues, aNotifications, rDamageOutput)
        -- Your logic here
        return originalHandleRemainderDamage(rTarget, nRemainder, nPrevWounds, rDamageValues, aNotifications, rDamageOutput);
    end
    My creations: https://github.com/MeAndUnique/FantasyGrounds
    Discord: MeAndUnique#6805

  5. #105
    Quote Originally Posted by MeAndUnique View Post
    Assuming that the linked changes were the way the ruleset handles it. For your case you could use the "safe" approach of doing something like this in your extension:
    Code:
    local originalHandleRemainderDamage;
    onInit()
        originalHandleRemainderDamage = ActionDamage.handleRemainderDamage;
        ActionDamage.handleRemainderDamage = handleRemainderDamage;
    end
    function handleRemainderDamage(rTarget, nRemainder, nPrevWounds, rDamageValues, aNotifications, rDamageOutput)
        -- Your logic here
        return originalHandleRemainderDamage(rTarget, nRemainder, nPrevWounds, rDamageValues, aNotifications, rDamageOutput);
    end
    How I would normally do it then when something is not buried in a template .lua or in the middle of some block of code. Your just breaking up the code into handlers then. Wanted to make sure it was not like some handlers where your extension is doing its own thing in a list of handlers. For global operations I'd want to make sure any handler was global - not stacked in a list being executed. So assuming that - it would be fine.

  6. #106
    Quote Originally Posted by Moon Wizard View Post
    Yes, when weighing the pros and cons, the removal of the iconography of the sidebar was a big negative for me. However, the sheer weight of the maintenance and ability to make new rulesets/themes was severely hampered by the requirement. You'll notice that several of the changes over the last year were to reduce the overhead of setting up new rulesets/themes.

    Regards,
    JPG
    I'm not a DEV guy but I like the ability to customize the user interface. Having text vs icons makes things easy but also 'boring' and remove some of the immersive experience. FGU is not a word processor. Why not offer both and default to text when no iconography is present but have an option to skin the UI for those who want to?

  7. #107
    Getting all sidebar buttons to be shown is a lot of steps after this recent update.
    Any chance of simplifying this to show all?
    bmos' extensions
    he/him | Discord Tag: wil.thieme#3396

  8. #108
    Quote Originally Posted by MeAndUnique View Post
    That's a reasonable interpretation; I would happily make a merge request if there were a mechanism to do so. Roughly 2 hours of work between last night and this morning to accomplish a reasonable first pass.



    The 5E ruleset is my primary interest, though I'm sure the concept would translate to others. I'm less interested in explicit integration points, though having one at the end would be useful, and more interested in more fine-grained definition of the functionality. There's a rather tight relationship between the Single Responsibility Principle and the Open and Closed Principle. In other words, if the code is broken down so that each function is responsible for doing one thing well, being able to extend any one thing becomes a very straight-forward process.

    See here.
    I love your code, all neatly commented as well in case someone else is reading it (or in case you forget, I know I always did), good practice. Reminds me of when I used to do it, in 68000 Assembly.

  9. #109
    Kelrugem's Avatar
    Join Date
    Sep 2018
    Location
    Geneva, Switzerland, and Lyon, France
    Posts
    3,077
    Quote Originally Posted by bmos View Post
    Getting all sidebar buttons to be shown is a lot of steps after this recent update.
    Any chance of simplifying this to show all?
    What do you mean?

    The visibility is controlled as usual, but now in the settings and not in the library There is a show "All" button, the other buttons, too So, very similar as before, just different place

  10. #110
    Quote Originally Posted by Jiminimonka View Post
    I love your code, all neatly commented as well in case someone else is reading it (or in case you forget, I know I always did), good practice. Reminds me of when I used to do it, in 68000 Assembly.
    Thanks! Who knows, if this one goes anywhere, maybe I'll take a stab at some others.
    My creations: https://github.com/MeAndUnique/FantasyGrounds
    Discord: MeAndUnique#6805

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in