Skip to content

Commit 6933f6c

Browse files
TheiLLeniumStudiosTheiLLeniumStudios
andauthored
feat(server/commands): Command support for opening job / gang outfit menus (#326)
* feat(server/commands): Command support for opening job / gang outfit menus * Remove unused args --------- Co-authored-by: TheiLLeniumStudios <theilleniumstudios@gmail.com>
1 parent 4563165 commit 6933f6c

File tree

17 files changed

+91
-8
lines changed

17 files changed

+91
-8
lines changed

client/common.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ function IsPlayerAllowedForOutfitRoom(outfitRoom)
1414
return isAllowed or not outfitRoom.citizenIDs or count == 0
1515
end
1616

17-
function GetPlayerJobOutfits(clothingRoom)
17+
function GetPlayerJobOutfits(job)
1818
local outfits = {}
1919
local gender = Framework.GetGender()
20-
local gradeLevel = clothingRoom.job and Framework.GetJobGrade() or Framework.GetGangGrade()
21-
local jobName = clothingRoom.job and client.job.name or client.gang.name
20+
local gradeLevel = job and Framework.GetJobGrade() or Framework.GetGangGrade()
21+
local jobName = job and client.job.name or client.gang.name
2222

2323
if Config.BossManagedOutfits then
24-
local mType = clothingRoom.job and "Job" or "Gang"
24+
local mType = job and "Job" or "Gang"
2525
local result = lib.callback.await("illenium-appearance:server:getManagementOutfits", false, mType, gender)
2626
for i = 1, #result, 1 do
2727
outfits[#outfits + 1] = {
@@ -33,7 +33,7 @@ function GetPlayerJobOutfits(clothingRoom)
3333
name = result[i].name
3434
}
3535
end
36-
else
36+
elseif Config.Outfits[jobName] and Config.Outfits[jobName][gender] then
3737
for i = 1, #Config.Outfits[jobName][gender], 1 do
3838
for _, v in pairs(Config.Outfits[jobName][gender][i].grades) do
3939
if v == gradeLevel then

client/outfits.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,8 @@ RegisterNetEvent("illenium-appearance:client:loadJobOutfit", LoadJobOutfit)
135135
RegisterNetEvent("illenium-appearance:client:openOutfitMenu", function()
136136
OpenMenu(nil, "outfit")
137137
end)
138+
139+
RegisterNetEvent("illenium-apearance:client:outfitsCommand", function(isJob)
140+
local outfits = GetPlayerJobOutfits(isJob)
141+
TriggerEvent("illenium-appearance:client:openJobOutfitsMenu", outfits)
142+
end)

client/target/target.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ local function SetupClothingRoomTargets()
118118
for k, v in pairs(Config.ClothingRooms) do
119119
local targetConfig = Config.TargetConfig["clothingroom"]
120120
local action = function()
121-
local outfits = GetPlayerJobOutfits(v)
121+
local outfits = GetPlayerJobOutfits(v.job)
122122
TriggerEvent("illenium-appearance:client:openJobOutfitsMenu", outfits)
123123
end
124124

client/zones.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ local function ZonesLoop()
151151
if IsControlJustReleased(0, 38) then
152152
if currentZone.name == "clothingRoom" then
153153
local clothingRoom = Config.ClothingRooms[currentZone.index]
154-
local outfits = GetPlayerJobOutfits(clothingRoom)
154+
local outfits = GetPlayerJobOutfits(clothingRoom.job)
155155
TriggerEvent("illenium-appearance:client:openJobOutfitsMenu", outfits)
156156
elseif currentZone.name == "playerOutfitRoom" then
157157
local outfitRoom = Config.PlayerOutfitRooms[currentZone.index]
@@ -187,7 +187,7 @@ end)
187187

188188
RegisterNetEvent("illenium-appearance:client:OpenClothingRoom", function()
189189
local clothingRoom = Config.ClothingRooms[currentZone.index]
190-
local outfits = GetPlayerJobOutfits(clothingRoom)
190+
local outfits = GetPlayerJobOutfits(clothingRoom.job)
191191
TriggerEvent("illenium-appearance:client:openJobOutfitsMenu", outfits)
192192
end)
193193

locales/ar.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["ar"] = {
308308
title = "خطأ",
309309
description = "لا يوجد اللاعب على الإنترنت"
310310
}
311+
},
312+
joboutfits = {
313+
title = "يفتح قائمة أزياء العمل"
314+
},
315+
gangoutfits = {
316+
title = "يفتح قائمة أزياء العصابات"
311317
}
312318
},
313319
textUI = {

locales/bg.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["bg"] = {
308308
title = "Грешка",
309309
description = "Играчът не е на линия"
310310
}
311+
},
312+
joboutfits = {
313+
title = "Отваря менюто за екипировка за работа"
314+
},
315+
gangoutfits = {
316+
title = "Отваря менюто Gang Outfits"
311317
}
312318
},
313319
textUI = {

locales/de.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["de"] = {
308308
title = "Fehler",
309309
description = "Spieler ist nicht online"
310310
}
311+
},
312+
joboutfits = {
313+
title = "Öffnet das Job-Outfits-Menü"
314+
},
315+
gangoutfits = {
316+
title = "Öffnet das Gang-Outfits-Menü"
311317
}
312318
},
313319
textUI = {

locales/en.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["en"] = {
308308
title = "Error",
309309
description = "Player not online"
310310
}
311+
},
312+
joboutfits = {
313+
title = "Opens Job Outfits Menu"
314+
},
315+
gangoutfits = {
316+
title = "Opens Gang Outfits Menu"
311317
}
312318
},
313319
textUI = {

locales/es-ES.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["es-ES"] = {
308308
title = "Error",
309309
description = "Jugador no en línea"
310310
}
311+
},
312+
joboutfits = {
313+
title = "Abre el menú de atuendos de trabajo"
314+
},
315+
gangoutfits = {
316+
title = "Abre el menú de atuendos de pandillas"
311317
}
312318
},
313319
textUI = {

locales/fr.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Locales["fr"] = {
308308
title = "Erreur",
309309
description = "Joueur non connecté"
310310
}
311+
},
312+
joboutfits = {
313+
title = "Ouvre le menu des tenues de travail"
314+
},
315+
gangoutfits = {
316+
title = "Ouvre le menu des tenues de gang"
311317
}
312318
},
313319
textUI = {

0 commit comments

Comments
 (0)