1. This forum is for bug reporting of current Player Test Environment (QA Server) issues ONLY.
    Be sure to follow the format below, it will help us out greatly in responding. If you do not, your report may not be entered into the system.

    Read BEFORE submitting your first bug: Reporting Bugsā€¦ QA 101 Document
    • Search for your bug in all likely categories before posting in order to avoid duplicate reports.
    • Be sure to provide details of what the issue is and how to re-produce it, but keep your bug report factual.
    • Only report oneissue per thread, additional issues may be ignored.
    • Do not add, include or modify the thread moderator tags in the title of the thread. (indicators in the [])
    • Reply to an existing thread if you have additional information for the reported bug.
      Do not use this forum for commentary, your post will be deleted and you may be moderated, suspended or banned if the activity continues.
    • There is no need to submit crash logs. Crash data we require is automatically logged.
    NOTE: Important information including your location and system specs are automatically put into your clipboard when using /devbug in the game (DO NOT add additional system specs unless requested). When starting your post, just use <CTRL>-V to insert the data and fill in the entries with no data.

    Please include Screenshots if possible. Images can be saved on our SotA Discord Server here

    If the clipboard does not work, use and fill in this Bug Report Template:
    1. Title:
    2. Reproducible?
    3. Blocker?
    4. Details:
    5. Steps to Reproduce:
    6. User Specs: (RAM, CPU, GPU and Operating System only)

Button Click zindex issue

Discussion in 'Lua API' started by Tirrag, Oct 9, 2021.

Thread Status:
Not open for further replies.
  1. Tirrag

    Tirrag Avatar

    Messages:
    854
    Likes Received:
    1,824
    Trophy Points:
    93
    Location:
    Iowa, USA
    10/09/2021 08:57
    Title: button click zindex issue
    Reproduction Rate: 100%
    Blocker? No
    Details: I am working on a windowing system in lua and found that when two buttons are on top of each other, the button on the bottom of the draw order gets the click instead of the button on top. If one of the buttons is clicked in an area that does not overlap, the clicks work as desired. This issue happens for both the click and repeat.
    Steps to Reproduce: create two buttons that overlap and have them show different text when clicked. If the user clicks where two buttons overlap, the button that is drawn first (and further away from the user) will receive the click instead of the button that is on top and closer to the user. The button that is closer to the user should receive the click when clicking an area where two buttons overlap.
    User Specs:
    OS: Windows 10 (10.0.0) 64bit
    CPU: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz (4) System RAM: 16295
    GPU: NVIDIA GeForce GTX 1050 GPU RAM: 1977
    SotA.QA.Win.64.1264.Date.10.06.21
    Area: POT_forest_metropolis_02_template/Maiden's Blush
    Area Display Name: Maiden's Blush
    Loc: (-247.2, 44.0, -197.3)
    Debug: UE9UX2ZvcmVzdF9tZXRyb3BvbGlzXzAyX3RlbXBsYXRlfE1haWRlbidzIEJsdXNofCgtMjQ3LjIwNiwgNDQuMDAxLCAtMTk3LjMyNCl8KDAsIC0wLjc2MywgMCwgLTAuNjQ3KXw5OS40MDYyfDEwfDQuNjc2NTA4

    Code:
    local tex = nil
    local client_width = 0
    local client_height = 0
    function ShroudOnStart()
        tex = ShroudLoadTexture("tiny.png", true)
        client_width = ShroudGetScreenX()
        client_height = ShroudGetScreenY()
    end
    function ShroudOnConsoleInput(type, src, msg) end
    function ShroudOnGUI()
        if ShroudButton(client_width/2 - 50 , client_height/2 - 100, 200, 200, tex, "Click me 1!", "Test 1") == true then
            ConsoleLog("Button 1 clicked!")
        end
        if ShroudButton(client_width/2 - 100 , client_height/2 - 100, 200, 200, tex, "Click me 2!", "Test 2") == true then
            ConsoleLog("Button 2 clicked!")
        end
    end
    function ShroudOnUpdate() end
    
     
    Last edited: Oct 9, 2021
  2. Tirrag

    Tirrag Avatar

    Messages:
    854
    Likes Received:
    1,824
    Trophy Points:
    93
    Location:
    Iowa, USA
    just a little extra comment. it would be nice for it to work exactly as expected but if that is too difficult then having both clicks fire in the situation where they are overlapping would work as well. in that situation leave it to the Lua programmer to determine which click should be actually recognized. i already have this built-in to what i am working on and is how i discovered this issue.
     
Thread Status:
Not open for further replies.