Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nil error in key check #6510

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

Uveso
Copy link
Contributor

@Uveso Uveso commented Nov 5, 2024

Resolved nil error in key check; added missing comparison for action.

example table:

ret["select_inview_idle_mex"] = {
    action = "UI_SelectByCategory +inview +idle MASSEXTRACTION",
    category = "user",
    order = 30
}

@Garanas
Copy link
Member

Garanas commented Nov 10, 2024

Can you share your preference file that triggers this logic? And shouldn't it also be applied to the next block:

  • fa/lua/keymap/keymapper.lua

    Lines 217 to 223 in d1d28f7

    for k,v in debugKeyActions do
    if ret[k] and ret[k] != v.action then
    WARN(string.format("Overwriting user key action: %s -> %s", k, ret[k].action))
    end
    ret[k] = v
    end

Resolved nil error in key check; added missing comparison for action.
@Uveso
Copy link
Contributor Author

Uveso commented Nov 11, 2024

yes you are right, the second block also need a fix.

btw these are the warnings:

WARNING: Overwriting user key action: select_all_idle_eng_onscreen -> UI_SelectByCategory +inview +idle ENGINEER
WARNING: Overwriting user key action: select_inview_idle_mex -> UI_SelectByCategory +inview +idle MASSEXTRACTION
WARNING: Overwriting user key action: select_all_mex -> UI_SelectByCategory MASSEXTRACTION
WARNING: Overwriting user key action: toggle_tab_display -> UI_Lua import("/lua/ui/game/tabs.lua").ToggleTabDisplay()
WARNING: Overwriting user key action: show_enemy_life -> UI_ForceLifbarsOnEnemy
WARNING: Overwriting user key action: teleport -> StartCommandMode order RULEUCC_Teleport
WARNING: Overwriting user key action: toggle_mdf_panel -> UI_Lua import("/lua/ui/game/multifunction.lua").ToggleMFDPanel()

and these are the keys:

UserKeyActions = {
    select_all_idle_eng_onscreen = {
        order = 18,
        action = 'UI_SelectByCategory +inview +idle ENGINEER',
        category = 'user'
    },
    select_inview_idle_mex = {
        order = 30,
        action = 'UI_SelectByCategory +inview +idle MASSEXTRACTION',
        category = 'user'
    },
    select_all_mex = {
        order = 31,
        action = 'UI_SelectByCategory MASSEXTRACTION',
        category = 'user'
    },
    toggle_tab_display = {
        order = 28,
        action = 'UI_Lua import("/lua/ui/game/tabs.lua").ToggleTabDisplay()',
        category = 'user'
    },
    show_enemy_life = {
        order = 2,
        action = 'UI_ForceLifbarsOnEnemy',
        category = 'user'
    },
    teleport = {
        order = 5,
        action = 'StartCommandMode order RULEUCC_Teleport',
        category = 'user'
    },
    toggle_mdf_panel = {
        order = 27,
        action = 'UI_Lua import("/lua/ui/game/multifunction.lua").ToggleMFDPanel()',
        category = 'user'
    },
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants