mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
122
gamemodes/darkrp/plugins/willardskills/cl_hooks.lua
Normal file
122
gamemodes/darkrp/plugins/willardskills/cl_hooks.lua
Normal file
@@ -0,0 +1,122 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
local smallerIconSize = SScaleMin(16 / 3)
|
||||
local function firstUpper(str)
|
||||
return str:gsub("^%l", string.utf8upper)
|
||||
end
|
||||
|
||||
function PLUGIN:PopulateHelpMenu(tabs)
|
||||
local permitsList = ix.permits.get()
|
||||
if (permitsList and !table.IsEmpty(permitsList)) then
|
||||
tabs["Permis"] = function(container)
|
||||
local permits = table.GetKeys(permitsList)
|
||||
table.sort(permits)
|
||||
|
||||
for _, v in pairs(permits) do
|
||||
local permitsButton = container:Add("DButton")
|
||||
permitsButton:Dock(TOP)
|
||||
permitsButton:SetText(Schema:FirstToUpper(v))
|
||||
permitsButton:SetFont("TitlesFontNoClamp")
|
||||
permitsButton:SizeToContents()
|
||||
permitsButton.Paint = nil
|
||||
permitsButton:SetContentAlignment(4)
|
||||
permitsButton.DoClick = function()
|
||||
LocalPlayer():NotifyLocalized("Permit ID '"..v.."' copied to clipboard")
|
||||
SetClipboardText( v )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CreateExtraCharacterTabInfo(character, informationSubframe, CreatePart)
|
||||
-- Permits
|
||||
local permitsPanel = informationSubframe:Add("Panel")
|
||||
local permitsData = LocalPlayer():GetCharacter():GetGenericdata().permits
|
||||
if !istable(permitsData) then
|
||||
CreatePart(permitsPanel, "Permis :", "Aucun permis", "licenses", true, false, true)
|
||||
return
|
||||
end
|
||||
|
||||
permitsData = table.GetKeys(LocalPlayer():GetCharacter():GetGenericdata().permits)
|
||||
|
||||
for k, v in pairs(permitsData) do
|
||||
permitsData[k] = firstUpper(v)
|
||||
end
|
||||
|
||||
if !table.IsEmpty(permitsData) then
|
||||
CreatePart(permitsPanel, "Permis :", table.concat(permitsData, ", "), "licenses", true, false, true)
|
||||
else
|
||||
CreatePart(permitsPanel, "Permis :", "Aucun permis", "licenses", true, false, true)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:AdjustInnerStatusPanel(innerStatus, CreateTitle, CreateSubBar)
|
||||
if (ix.special) then
|
||||
local attributesTitle = innerStatus:Add("DLabel")
|
||||
CreateTitle(attributesTitle, "ATTRIBUTS")
|
||||
|
||||
local character = LocalPlayer():GetCharacter()
|
||||
for _, v in pairs(ix.special.list) do
|
||||
local attribute = innerStatus:Add("Panel")
|
||||
local special = character:GetSpecial(tostring(v.uniqueID))
|
||||
|
||||
if v.name == "Force" then
|
||||
CreateSubBar(attribute, "willardnetworks/tabmenu/inventory/inv_strength.png", v.name, special .. "/10", smallerIconSize, smallerIconSize)
|
||||
end
|
||||
|
||||
if v.name == "Agilité" then
|
||||
CreateSubBar(attribute, "willardnetworks/tabmenu/inventory/inv_agility.png", v.name, special .. "/10", smallerIconSize, smallerIconSize)
|
||||
end
|
||||
|
||||
if v.name == "Intelligence" then
|
||||
CreateSubBar(attribute, "willardnetworks/tabmenu/inventory/inv_intelligence.png", v.name, special .. "/10", smallerIconSize, smallerIconSize)
|
||||
end
|
||||
|
||||
if v.name == "Perception" then
|
||||
CreateSubBar(attribute, "willardnetworks/tabmenu/inventory/inv_perception.png", v.name, special .. "/10", smallerIconSize, smallerIconSize)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (ix.skill) then
|
||||
local character = LocalPlayer():GetCharacter()
|
||||
|
||||
local skillsTitle = innerStatus:Add("DLabel")
|
||||
CreateTitle(skillsTitle, "COMPETENCES")
|
||||
|
||||
for skillID, skillInfo in pairs(ix.skill.list) do
|
||||
if (skillInfo.name == "Vortessence" and !LocalPlayer():IsVortigaunt()) or skillInfo.name == "Bartering" then
|
||||
continue
|
||||
end
|
||||
|
||||
local skillsPanel = innerStatus:Add("Panel")
|
||||
local level = character:GetSkillLevel(skillID)
|
||||
CreateSubBar(skillsPanel, "willardnetworks/tabmenu/inventory/inv_" .. skillID .. ".png", skillInfo.name, level .. "/50", smallerIconSize, smallerIconSize)
|
||||
end
|
||||
|
||||
local char = LocalPlayer().GetCharacter and LocalPlayer():GetCharacter()
|
||||
|
||||
-- Misc section
|
||||
local miscTitle = innerStatus:Add("DLabel")
|
||||
CreateTitle(miscTitle, "MISC")
|
||||
|
||||
if char then
|
||||
local money = char.GetMoney and char:GetMoney() or 0
|
||||
-- Display the amount of chips the player has
|
||||
local chipsPanel = innerStatus:Add("Panel")
|
||||
CreateSubBar(chipsPanel, "willardnetworks/tabmenu/charmenu/chips.png", "Chips", money, smallerIconSize, smallerIconSize)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user