иконки

SNAPE

Участник
Автор темы
80
3
Версия MoonLoader
.026-beta
тот же код, в других скриптах работает, а на моем - нет

Lua:
local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
        
local window = imgui.ImBool(false)
        
local fa = require 'fAwesome5'

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig()
        font_config.MergeMode = true
        
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
    end
end

function main()
    while not isSampAvailable() do wait(200) end
    imgui.Process = false
    window.v = true  --show window on start
    while true do
        wait(0)
        imgui.Process = window.v
    end
end
        
function imgui.OnDrawFrame()
    if window.v then
        local resX, resY = getScreenResolution()
        local sizeX, sizeY = 300, 300 -- WINDOW SIZE
        imgui.SetNextWindowPos(imgui.ImVec2(resX / 2 - sizeX / 2, resY / 2 - sizeY / 2), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
        imgui.Begin('Window Title', window)
            imgui.Text(fa.ICON_FA_TOOLS)
        imgui.End()
    end
end






все либы есть


nY4yU1TN6WA.jpg
 

SNAPE

Участник
Автор темы
80
3
Lua:
local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
        
local window = imgui.ImBool(false)
        
local fa = require 'fAwesome5'

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig()
        font_config.MergeMode = true
        
    getGameDirectory() .. "\\moonloader\\resource\\fonts\\fa-solid-900.ttf"    end
end

function main()
    while not isSampAvailable() do wait(200) end
    imgui.Process = false
    window.v = true  --show window on start
    while true do
        wait(0)
        imgui.Process = window.v
    end
end
        
function imgui.OnDrawFrame()
    if window.v then
        local resX, resY = getScreenResolution()
        local sizeX, sizeY = 300, 300 -- WINDOW SIZE
        imgui.SetNextWindowPos(imgui.ImVec2(resX / 2 - sizeX / 2, resY / 2 - sizeY / 2), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
        imgui.Begin('Window Title', window)
            imgui.Text(fa.ICON_FA_TOOLS)
        imgui.End()
    end
end

так?
 

chapo

tg/inst: @moujeek
Всефорумный модератор
9,099
12,131
moonloader/resource/fonts/fa-solid-900.ttf мейби с путём хуйня (17 строка)
попробуй так
Lua:
getGameDirectory() .. "\\moonloader\\resource\\fonts\\fa-solid-900.ttf"
скорее всего проблема не в этом, так как если бы имгуи не нашел файл то игра бы просто крашнулась с ошибкой Microsoft Visual C++ Runtime Libruary