STAR TREK 2d20
Page 37 of 68 First ... 27353637383947 ... Last
  1. #361
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    524
    This is a version of 4.8 with some debug. This shouldn't be used by anybody unless they're having issues - the version on the forge is what should be used otherwise.
    Attached Files Attached Files

  2. #362
    Small problem: Clicking on options always need one extra click to cycle back to the first option.

    Big problem: Using the scroll-wheel without key-modifier does not zoom in/out of the map when the mouse-pointer hovers over a token.

  3. #363
    Quote Originally Posted by Weissrolf View Post
    Big problem: Using the scroll-wheel without key-modifier does not zoom in/out of the map when the mouse-pointer hovers over a token.
    GKEnialb, I may be able to help you with that issue since I already solved that in my extension; actually Moon Wizard solved this issue

    (though I am guessing now, I did not yet test your extensions)

    Change your onWheel function to the following:

    Code:
    function onWheel(tokenCT, notches)
        if Input.isAltPressed() then  
            TokenHeight.updateHeight(tokenCT, notches, true);
            return true;
        end
    end
    You see, way more concise than your function You currently overwrite everything and your return true is at the very end; however, seemingly the onWheel function gets merged with the original one, it won't overwrite it as it usually happens with scripts. It rather runs simultaneously with the original one (though I am not sure whether this is how one should describe it, just my naive observation after Moon Wizard's help and suggestions). If the return true gets executed, then anything in lower layers like the original onWheel function won't be activated and searched for. (so, it basically stops the onWheel activation/procedure) That means, that you can control with the position of the return true, when you actually want the original code to be executed or overwritten. By having the return true in the Alt-if-clause, which is the only real new information you add via the height extension to onWheel, you assure that your code only applies when pressing alt. While for other shortcuts like ctrl and shift it will still use the original code.

    This method improves compatibility with the actual code and also won't overwrite the onWheel code when just the mouse wheel is used while hovering over a token. Then Weissrolf's issue should be solved since the original code actually already adds zooming while hovering over a token and using the mouse wheel

    Your method executes always return true, leading to that the code for a pure mouse wheel without using shortcuts while hovering over a token is overwritten. With Moon Wizard's method you then do not need to figure out adding the zooming while hovering over a token (and neither do you need to maintain the code for the other shortcuts which can be a mess; your shift-if-clause may for example not work completely on hex grids or other type of grids in general since adjacent fields are not always 8. So, this issue may be then solved, too )
    Last edited by Kelrugem; August 9th, 2021 at 14:06.

  4. #364
    This seems to have done the trick. Thanks Kelrugem!

  5. #365
    Quote Originally Posted by Weissrolf View Post
    Small problem: Clicking on options always need one extra click to cycle back to the first option.
    Solution:
    Code:
    function registerOptions()
    	OptionsManager.registerOption2 (
            "THIALLOWUSERADJUST",
            false,
            "option_header_height_indicator",
            "option_label_allow_player_mod",
            "option_entry_cycler",
            {
                labels = "option_val_no",
                values = "no",
                baselabel = "option_val_yes",
                baseval = "yes",
                default = "yes"
            }
        ) 
    	OptionsManager.registerOption2 (
            "THIPOSITION",
            false,
            "option_header_height_indicator",
            "option_label_height_position",
            "option_entry_cycler",
            {
                labels = "option_val_bottom_left|option_val_left|option_val_top_left|option_val_top|option_val_top_right|option_val_right|option_val_bottom_right",
                values = "bottom left|left|top left|top|top right|right|bottom right",
                baselabel = "option_val_bottom",
                baseval = "bottom",
                default = "bottom"
            }
        ) 
    	OptionsManager.registerOption2 (
            "THIFONT",
            false,
            "option_header_height_indicator",
            "option_label_font",
            "option_entry_cycler",
            {
                labels = "option_val_large",
                values = "large",
                baselabel = "option_val_medium",
                baseval = "medium",
                default = "medium"
            }
        ) 
    	OptionsManager.registerOption2 (
            "THIFONTCOLOR",
            false,
            "option_header_height_indicator",
            "option_label_font_color",
            "option_entry_cycler",
            {
                labels = "option_val_medium|option_val_light",
                values = "medium|light",
                baselabel = "option_val_dark",
                baseval = "dark",
                default = "dark"
            }
        ) 
    	OptionsManager.registerOption2 (
            "THIDIAGONALS",
            false,
            "option_header_height_indicator",
            "option_label_variant_diagonals",
            "option_entry_cycler",
            {
                labels = "option_val_long",
                values = "long",
                baselabel = "option_val_short",
                baseval = "short",
                default = "short"
            }
        ) 
    	
    	OptionsManager.registerCallback("THIALLOWUSERADJUST", setPlayerControl)
    	OptionsManager.registerCallback("THIPOSITION", changeOptions)
    	OptionsManager.registerCallback("THIFONT", changeOptions)
    	OptionsManager.registerCallback("THIFONTCOLOR", changeOptions)
    	setFont()
    end
    Basically baselabel and baseval create the label and value so you shouldn't include them in labels and values.

  6. #366
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    524
    Thanks, Kelrugem and bmos! Uploaded v4.9 to the first page and the Forge (still processing in the Forge as I write this) with both of those fixes. Wish I had known about the onWheel thing at the beginning - could never quite figure out that behavior. And also didn't know about not duplicated the baselabel/baseval. Great to learn new things.

  7. #367
    Was this updated in the forge or only in this thread?

  8. #368
    GKEnialb's Avatar
    Join Date
    Jul 2017
    Location
    Castle Rock, CO
    Posts
    524
    It is live on the forge as of now. It took long enough to process last night that I got distracted by a shiny object and didn't check later, so thanks for the reminder.

  9. #369
    I recently updated to 1.2 of Kent Height and 4.9 of Token Height and when i put a token 20' in the air and next to another token it is rolling with disadvantage with a ranged attack. It was working previously.

  10. #370
    I can confirm this is no longer working and was fine before.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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