Jump to content

Search the Community

Showing results for tags 'context menu'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • News
  • Project Zomboid
    • PZ Updates
    • General Discussions
    • Bug Reports
    • PZ Support
    • PZ Multiplayer
    • PZ Community & Creativity
    • PZ Suggestions
  • PZ Modding
    • Tutorials & Resources
    • Mods
    • Items
    • Mapping
    • Mod Ideas and Requests
  • General Games Development
    • Indie Scene
  • Other Discussions
    • General Discussion
    • Forum Games & Activities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Twitter


Interests

Found 6 results

  1. If you are not an admin/moderator, the safehouse owner or on the safehouse perm list, the right-click context menu is non-functional in that particular safehouse. • 41.73 • Multiplayer. • Dedicated Server. • No Mods. • Still occurs on new save • Reproduction steps: 1. Claim a safehouse as a player with no admin perms. 2. Bring another player over to right-click anywhere in the area the safehouse occupies. 3. None of the right-click context menu options appear. It doesn't matter what safehouse options are enabled/disabled in the server settings. I could be mistaken, but it doesn't seem like there is a check for this taking place place in the Java or LUA code base. I assume it would take place in ISWorldObjectContextMenu.lua, but seems I'm wrong. The check seems to consider admin powers, safehouse perms and where you are clicking. If this is for some reason intended, could someone guide me to the source of this check so I can make a quick mod to bypass it? Preventing the context menu from appearing does not impact whether players can enter a safehouse, loot safehouse containers, or demolish within a safehouse. I need to check dismanstle, but other than that blanketly preventing the context menu from appearing for players without safehouse perms seems unnecessarily limiting.
  2. tommysticks

    Context Menu

    Howdy. Im looking for an example of code that makes a context menu pop up when you right click a zed corpse while it's on the ground, not in the inventory.
  3. Hello. I'm a little surprised this isn't floating around on here somewhere.... I've seen bits about adding context menus, but not something for weapon renaming specifically. I figured, since we can rename bags and evolved recipe dishes, it's pretty much already in there and just needs a bit adding for weapons. And here it is This will enable renaming weapons in inventory context menu, just like bags. Go forth and give that hammer you've been swinging around in the Exclusion Zone for 2 months a special name I expect renamed items should continue to work fine for recipes, as the display name is what's being changed, not the underlying ID. Bit of a disclaimer: - I've not personally tested in multiplayer, either hosted or joined, but it's been commented that it works, however. - I've not personally tested with renaming weapons from mods, but that's also been commented to work. I expected it would, it operates against hand weapon items after all. Credit / References: - Indie Stone, of course. Basically, I've adapted relevant bits of the base ISInventoryPaneContextMenu.lua. - I referred a bit to RoboMat's Creating Inventory Context Menus tutorial and MisterInSayne's Giving custom options to items when you right click them thread. Download the mod file .7z archive from here; or Copy paste the below, or attachment, into a mod media/lua/client folder; or It's on Steam Workshop as well. ---------------------------------------------------------------------------------------------------------- ISInventoryRenameWeapon = {}; require "ISInventoryPaneContextMenu" ISInventoryRenameWeapon.createMenu = function(player, context, items) local canBeRenamedWeapon = nil; for i, v in ipairs(items) do local item = v; if not instanceof(v, "InventoryItem") then item = v.items[1]; end if instanceof(item, "HandWeapon") then isHandWeapon = item; canBeRenamedWeapon = item; end end if canBeRenamedWeapon then context:addOption(getText("Rename weapon"), canBeRenamedWeapon, ISInventoryRenameWeapon.onRenameWeapon, player); end end ISInventoryRenameWeapon.onRenameWeapon = function(weapon, player) local modal = ISTextBox:new(0, 0, 280, 180, getText("Change item name"), weapon:getName(), nil, ISInventoryRenameWeapon.onRenameWeaponClick, player, getSpecificPlayer(player), weapon); modal:initialise(); modal:addToUIManager(); end function ISInventoryRenameWeapon:onRenameWeaponClick(button, player, item) if button.internal == "OK" then if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then item:setName(button.parent.entry:getText()); local pdata = getPlayerData(player:getPlayerNum()); pdata.playerInventory:refreshBackpacks(); pdata.lootInventory:refreshBackpacks(); end end end Events.OnPreFillInventoryObjectContextMenu.Add(ISInventoryRenameWeapon.createMenu); ISInventoryRenameWeapon.lua
  4. Hi everyone. Please, can you help me with the context menu for my custom pills? I cant understad how work a "Take Pill" action for vanilla Painkillers... This is code of my item item AspirinBottle { Weight = 0.1, Type = Drainable, UseDelta = 0.02, DisplayName = Bottle of aspirin pills, Icon = OZMoreMeds_Aspirin500mg, Tooltip = Tooltip_Painkillers, UseWhileEquipped = FALSE, } I tried to make a custom context menu but my lua script still not working...
  5. hi everyone, i have recently been trying to get to grips with the world context menu. i can add an option if conditions are met, player clicks on ground outside and is grass/soil. the menu option displays, however the function i have linked to the menu option (a timed action) is always executed. i'm probably missing something very very simple however i keep looking at my code and it looks fine (well it looks terrible... but...) TL:DR context menu shows my option but always calls the function i have linked to it. function contextMenu(_player, _context, _worldObjects) if test then return ISWorldObjectContextMenu.setTest() end testVar = false; local player = getSpecificPlayer(_player); local square = nil; for i,v in ipairs(_worldObjects) do square = v:getSquare(); for t = 0, square:getObjects():size() - 1 do local item = square:getObjects():get(t); if item:getTextureName() and (luautils.stringStarts(item:getTextureName(), "floors_exterior_natural") or luautils.stringStarts(item:getTextureName(), "blends_natural")) then testVar = true; end end end if testVar then if test then return ISWorldObjectContextMenu.setTest() end _context:addOption("My Menu", _worldObjects, testfunc(player,"woop woop"), testVar, _player); end endfunction testfunc(player, msg) print(msg); ISTimedActionQueue.add(ISslowPoke:new(player, msg, 50));endEvents.OnFillWorldObjectContextMenu.Add(contextMenu)
×
×
  • Create New...