Coder Social home page Coder Social logo

core.lua issues about wolfhud HOT 4 CLOSED

Hulkfog avatar Hulkfog commented on July 20, 2024
core.lua issues

from wolfhud.

Comments (4)

Kamikaze94 avatar Kamikaze94 commented on July 20, 2024

Hmm, that stuff down there is quite experimental, tried to add levels in kick menu and joining dialog, as well as removing level in players 'over-head' labels....
Only the kick levels seem to work, the rest is kinda broken and needs some more work.... :/

Added a check for HUDManager for now, so that error goes away.
Not quite sure, which of the other two Hooks isn't possible to hook into, will try that out later...

from wolfhud.

Hulkfog avatar Hulkfog commented on July 20, 2024

I thought kick levels were in the base game?
https://bitbucket.org/YaPh1l/payday-2-lua/src/17e0723084141b791a4ce490a022ba5c43f58bd1/lib/managers/menumanager.lua?at=master&fileviewer=file-view-default

KickPlayer = KickPlayer or class()
function KickPlayer:modify_node(node, up)
    node:clean_items()
    if managers.network:session() then
        for _, peer in pairs(managers.network:session():peers()) do
            local params = {
                name = peer:name(),
                text_id = peer:name() .. " (" .. (peer:rank() > 0 and managers.experience:rank_string(peer:rank()) .. "-" or "") .. (peer:level() or "") .. ")",
                callback = "kick_player",
                to_upper = false,
                rpc = peer:rpc(),
                peer = peer,
                help_id = peer:is_host() and managers.localization:text("menu_vote_kick_is_host") or managers.vote:option_vote_kick() and managers.vote:help_text() or "",
                localize = false,
                localize_help = false
            }
            local new_item = node:create_item(nil, params)
            if peer:is_host() or managers.vote:option_vote_kick() and not managers.vote:available() then
                new_item:set_enabled(false)
            end
            node:add_item(new_item)
        end
    end
    managers.menu:add_back_button(node)
    return node
end

Try BaseNetworkSession for the joining dialog and menumanagerdialog

from wolfhud.

Kamikaze94 avatar Kamikaze94 commented on July 20, 2024

Uhm, how could I overlook that.... removed it now.
Now I feel stupid, xD

The other errors resulted out of the 'MenuNodeMainGui' not beeing present, when Core.lua got called.
Added a check for that now.

Also moved the other stuff out of core, into more appropriate places.
Yeah, for the joining, I'm already in menumanagerdialog, but I'm not quite sure, if my code isn't working, or the level just syncing too late. Only tested it with 2 or 3 players, and for those it didn't show up...

Thanks for the help, might take a look into BaseNetworkSession....

from wolfhud.

Hulkfog avatar Hulkfog commented on July 20, 2024

Managed to get the player rank to show

function MenuManager:show_person_joining(id, nick)
        local dialog_data = {}
        local peer = managers.network:session():peer(id)
        local name = nick
        name = name .. " (" .. (peer:rank() > 0 and managers.experience:rank_string(peer:rank()) .. "-" or "") .. peer:level() .. ")"
        dialog_data.title = managers.localization:text("dialog_dropin_title", {
            USER = string.upper(name)
        })
        dialog_data.text = managers.localization:text("dialog_wait") .. " 0%"
        dialog_data.id = "user_dropin" .. id
        dialog_data.no_buttons = true
        managers.system_menu:show(dialog_data)
    end

from wolfhud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.