Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Sync #17

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading