Skip to content

Commit

Permalink
Merge pull request #17 from Byte-Labs-Studio/main
Browse files Browse the repository at this point in the history
Update Sync
  • Loading branch information
SOH69 authored Aug 13, 2024
2 parents 9eb890d + b3285bf commit 5f79c24
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 35 deletions.
67 changes: 36 additions & 31 deletions data/zones.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,48 +134,54 @@ local currentZone = nil
local sprites = {}

local function setupZones()
if not textUi and GetResourceState('bl_sprites') == 'missing' then
return
end

for _, v in pairs(stores) do

if textUi then
local point = lib.points.new({
coords = v.coords,
distance = 3.0,
})
local point = lib.points.new({
coords = v.coords,
distance = 3.0,
})

function point:onEnter()
currentZone = v
function point:onEnter()
currentZone = v
if textUi then
local prefix = "[" .. control .. "] - "
local displayText = ""
if currentZone.type == 'barber' then
textui.showTextUI(prefix .. "Barber Shop", 'left')
displayText = "Barber Shop"
elseif currentZone.type == 'tattoos' then
textui.showTextUI(prefix .. "Tattoo Parlor", 'left')
displayText = "Tattoo Parlor"
elseif currentZone.type == 'clothing' then
textui.showTextUI(prefix .. "Clothing Store", 'left')
displayText = "Clothing Store"
elseif currentZone.type == 'surgeon' then
textui.showTextUI(prefix .. "Surgeon", 'left')
displayText = "Surgeon"
end
textui.showTextUI(prefix .. displayText, 'left')
end
end

function point:onExit()
currentZone = nil
function point:onExit()
currentZone = nil
if textUi then
textui.hideTextUI()
end
else
if GetResourceState('bl_sprites') == 'missing' then return end
for _, v in pairs(stores) do
sprites[#sprites+1] = exports.bl_sprites:sprite({
coords = v.coords,
shape = 'hex',
key = key,
distance = 3.0,
onEnter = function()
currentZone = v
end,
onExit = function()
currentZone = nil
end
})
end
end

if not textUi then
sprites[#sprites+1] = exports.bl_sprites:sprite({
coords = v.coords,
shape = 'hex',
key = key,
distance = 3.0,
onEnter = function()
currentZone = v
end,
onExit = function()
currentZone = nil
end
})
end
end
end
Expand Down Expand Up @@ -232,7 +238,6 @@ AddEventHandler('onResourceStop', function(resource)
end
end
end)


RegisterCommand('+openAppearance', function()
if not currentZone then return end
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ game "gta5"
lua54 'yes'

author "Byte Labs"
version '1.1.1'
version '1.1.2'
description 'Customize your virtual persona with precision using the Byte Labs Appearance Menu'
repository 'https://github.com/Byte-Labs-Studio/bl_appearance'

Expand Down
21 changes: 18 additions & 3 deletions web/src/components/micro/NumberStepper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@
dispatch('change', value);
}
function handleInput(event) {
const inputValue = Number(event.target.value);
if (isNaN(inputValue)) return;
if (inputValue < 0) {
value = none ? -1 : 0;
} else if (inputValue > total) {
value = total;
} else {
value = inputValue;
}
checkBlacklist();
dispatch('change', value);
}
$: {
if (blacklist) {
checkBlacklist();
Expand All @@ -73,9 +90,7 @@
type="number"
class="w-full relative h-full"
bind:value
on:input={()=>{
dispatch('change', value);
}}
on:input={handleInput}
/>

{#if isBlacklisted}
Expand Down

0 comments on commit 5f79c24

Please sign in to comment.