ImVec2
Definition
-- @/lua/common/extensions/ui/imgui_custom_luaintf.lua:16
--=== struct ImVec2 ===
function M.ImVec2(x, y)
return imgui.ImVec2(x, y)
end
Callers
@/lua/ge/extensions/editor/multiSpawnManager.lua
local comboWidth, inputWidth
local dummy = im.ImVec2(5, 5)
local colorWarning, colorError = im.ImVec4(1, 1, 0, 1), im.ImVec4(1, 0, 0, 1)
im.BeginChild1("groupType##editGroup", im.ImVec2(comboWidth, 32 * im.uiscale[0]), im.WindowFlags_None)
local val = currGroup.type == "custom" and im.IntPtr(1) or im.IntPtr(2)
im.BeginChild1("groupTags##editGroup", im.ImVec2(comboWidth, 64 * im.uiscale[0]), im.WindowFlags_None)
im.SameLine()
if editor.uiIconImageButton(editor.icons.close, im.ImVec2(16, 16)) then
table.remove(currGroup.tags, i)
end
im.Dummy(im.ImVec2(0, 0))
end
im.BeginChild1("Generated Group##editGroup", im.ImVec2(im.GetContentRegionAvailWidth(), 470 * im.uiscale[0]), im.WindowFlags_ChildWindow)
local width1 = 40 * im.uiscale[0]
end
if im.Button(i.."##vehicleSlot", im.ImVec2(24 * im.uiscale[0], 20 * im.uiscale[0])) then
selectVehIndex(i)
im.Dummy(dummy)
if im.Button("Done##customPaint", im.ImVec2(im.GetContentRegionAvailWidth(), 20)) then
editor.closeModalWindow(customPaintWindowName)
local function onEditorInitialized()
editor.registerWindow(toolModeName, im.ImVec2(500, 540))
editor.registerModalWindow(generatorWindowName, im.ImVec2(440, 500), nil, true)
editor.registerWindow(toolModeName, im.ImVec2(500, 540))
editor.registerModalWindow(generatorWindowName, im.ImVec2(440, 500), nil, true)
editor.registerModalWindow(customPaintWindowName, im.ImVec2(320, 120), nil, true)
editor.registerModalWindow(generatorWindowName, im.ImVec2(440, 500), nil, true)
editor.registerModalWindow(customPaintWindowName, im.ImVec2(320, 120), nil, true)
editor.registerModalWindow(overwriteGroupWindowName, im.ImVec2(240, 100), nil, true)
editor.registerModalWindow(customPaintWindowName, im.ImVec2(320, 120), nil, true)
editor.registerModalWindow(overwriteGroupWindowName, im.ImVec2(240, 100), nil, true)
editor.addWindowMenuItem(toolName, onWindowMenuItem, {groupMenuName = "Gameplay"})
@/lua/ge/extensions/editor/camPathEditor.lua
-- Speed normalization
-- if im.Button('Normalize Speed', im.ImVec2(buttonWidth, 0)) then
-- im.OpenPopup('Speed Settings')
-- Timing relaxation
if im.Button('Relax Timings', im.ImVec2(buttonWidth, 0)) then
relaxMarkerTimings(M.currentPath, 0.6)
-- Advanced relaxation
if im.Button('Smooth More', im.ImVec2(buttonWidth, 0)) then
relaxMarkerTimings(M.currentPath, 0.9)
im.Spacing()
if im.Button('Apply', im.ImVec2(80 * im.uiscale[0], 0)) then
if speed[0] > 0.1 then
im.SameLine()
if im.Button('Cancel', im.ImVec2(80 * im.uiscale[0], 0)) then
im.CloseCurrentPopup()
if tableIsEmpty(M.currentPath.markers) then
if im.Button('+ Add Marker', im.ImVec2(-1, 0)) then
addMarker()
-- Marker list with table
im.BeginChild1('markers', im.ImVec2(markerListWidth, listHeight), im.WindowFlags_ChildWindow)
-- Add button at top
-- Add button at top
if im.Button('+ Add Marker', im.ImVec2(-1, 0)) then
addMarker()
im.PushID4(index)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(20, 20)) then
deleteMarker(index)
im.SameLine()
im.BeginChild1('currentMarkerInner', im.ImVec2(detailsWidth, listHeight), im.WindowFlags_ChildWindow)
if im.Button('Preview', im.ImVec2(buttonWidth, 0)) then
local pos = marker.pos
if M.currentPath.replay and M.currentPath.replay ~= '' then
if im.Button('Preview + Sync', im.ImVec2(buttonWidth, 0)) then
local pos = marker.pos
if im.Button('Overwrite', im.ImVec2(buttonWidth, 0)) then
editor.history:commitAction(
end
if im.Button('Set for all##ttn', im.ImVec2(-1, 0)) then
setMarkersTTN(M.currentPath, imVal[0])
im.SameLine()
if im.Button('Set for all##fov', im.ImVec2(buttonWidth, 0)) then
changeAllMarkers(M.currentPath, 'fov', imVal[0])
im.SameLine()
if im.Button('Set for all##pos', im.ImVec2(buttonWidth, 0)) then
changeAllMarkers(M.currentPath, 'positionSmooth', imVal[0])
im.SameLine()
if im.Button('Set following', im.ImVec2(buttonWidth, 0)) then
local markerValues = {}
im.SameLine()
if im.Button('Set for all##trackPos', im.ImVec2(buttonWidth, 0)) then
changeAllMarkers(M.currentPath, 'trackPosition', trackPosition[0])
im.SameLine()
if im.Button('Set for all##startMove', im.ImVec2(buttonWidth, 0)) then
changeAllMarkers(M.currentPath, 'movingStart', movingStart[0])
im.SameLine()
if im.Button('Set for all##endMove', im.ImVec2(buttonWidth, 0)) then
changeAllMarkers(M.currentPath, 'movingEnd', movingEnd[0])
end
im.BeginChild1('replay', im.ImVec2(0, im.GetFontSize() * h * im.uiscale[0]), im.WindowFlags_ChildWindow)
linkReplay[0] = M.currentPath.replay == '' or M.currentPath.replay ~= nil and replayExists(M.currentPath.replay)
core_replay.isPaused() and editor.icons.play_arrow or editor.icons.pause,
im.ImVec2(buttonSize, buttonSize),
nil,
if im.Button('-10', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] - 10) / maxSecs)
im.SameLine()
if im.Button('-2', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] - 2) / maxSecs)
im.SameLine()
if im.Button('-1', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] - 1) / maxSecs)
im.SameLine()
if im.Button('+1', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] + 1) / maxSecs)
im.SameLine()
if im.Button('+2', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] + 2) / maxSecs)
im.SameLine()
if im.Button('+10', im.ImVec2(seekButtonWidth, 0)) then
core_replay.seek((relativePos[0] + 10) / maxSecs)
im.BeginChild1('M.currentPath', im.ImVec2(0, im.GetFontSize() * 6 * im.uiscale[0]), im.WindowFlags_ChildWindow)
im.Text('Current Path')
im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0, 0.8, 0, 0.7))
if im.Button('Play', im.ImVec2(playButtonWidth, 30 * im.uiscale[0])) then
playCurrentPath()
im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0, 0.6, 0, 0.7))
if im.Button('Play (Close Editor)', im.ImVec2(playButtonWidth, 30 * im.uiscale[0])) then
editor.skipCameraOnExit = true
im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.8, 0, 0, 0.7))
if im.Button('Stop', im.ImVec2(stopButtonWidth, 30 * im.uiscale[0])) then
core_paths.stopCurrentPath()
'Add new marker'
editor.registerWindow(toolWindowName, im.ImVec2(200, 400))
editor.registerWindow('cameraPathPreviewWindow', im.ImVec2(600, 400))
editor.registerWindow(toolWindowName, im.ImVec2(200, 400))
editor.registerWindow('cameraPathPreviewWindow', im.ImVec2(600, 400))
end
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
self.resetScrollY = true
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, true)
self.search = require('/lua/ge/extensions/editor/util/searchUtil')()
im.PushStyleColor2(im.Col_Button, im.ImVec4(0, 0, 0, 0))
if editor.uiIconImageButton(editor.icons.close, im.ImVec2(22, 22)) then
self:clear()
if tableIsEmpty(self.fgEditor.copyData) then
editor.uiIconImage(editor.icons.content_paste, im.ImVec2(22, 22), im.ImVec4(0.5, 0.5, 0.5, 1.0))
else
else
if editor.uiIconImageButton(editor.icons.content_paste, im.ImVec2(22, 22)) then
self.mgr:pasteNodes()
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
menuPos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
end
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
menuPos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
end
function C:highlightText(label, highlightText)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
local pos1 = 1
local iconSize = im.ImVec2(24, 24)
local iconColor = im.ImVec4(0.5,0.5,0.5,1)
if self.buttonListIndex == self.selectedButtonListIndex then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
if im.IsItemHovered() then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
local pos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
if menuPos then pos = menuPos end
if im.IsItemHovered() then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
menuPos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
end
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
menuPos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
end
if self.buttonListIndex == self.selectedButtonListIndex then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
-- display blue rectangle when node is hovered
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/perfProfiler.lua
chart.chartWindowName = chartWindowName
editor.registerWindow(chartWindowName, im.ImVec2(500, 500))
editor.showWindow(chartWindowName)
if im.BeginPopup("NewRecording") then
im.BeginChild1("rchild",im.ImVec2(500,500))
im.TextWrapped("Start a new Recording")
im.BulletText(string.format("There are %d vehicle spawned", #getAllVehicles()))
if im.Button("Delete All Vehicles", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
local vehs = deepcopy(getAllVehicles())
for _, result in ipairs(results) do
im.BeginChild1(result.id.."child", im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
if im.Checkbox("##cba" .. result.id, im.BoolPtr(columns[result.id].enabled or false)) then
for i, column in ipairs(columns) do
im.BeginChild1(i.."child", im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
if im.Checkbox("##cbaa" .. i, im.BoolPtr(column.enabled or false)) then
local function drawTableComparator()
editor.registerWindow(tableWindowName, im.ImVec2(500, 500))
editor.showWindow(tableWindowName)
else
im.Dummy(im.ImVec2(5,5))
end
local function drawMetadataWindow()
editor.registerWindow(metadataWindowName, im.ImVec2(500, 500))
editor.showWindow(metadataWindowName)
else
im.Dummy(im.ImVec2(5,5))
end
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500, 500), im.ImVec2(500, 500))
editor.addWindowMenuItem("Performance Recorder", function() show() end,{groupMenuName="Debug"})
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500, 500), im.ImVec2(500, 500))
editor.addWindowMenuItem("Performance Recorder", function() show() end,{groupMenuName="Debug"})
@/lua/ge/extensions/editor/driftDataEditor.lua
im.Text(lineName)
im.Dummy(im.ImVec2(1, 5))
im.Dummy(im.ImVec2(1, 10))
-- Add marker objects list
im.Dummy(im.ImVec2(1, 10))
im.Text("Marker Objects")
if lineName == "lineOne" then
im.Dummy(im.ImVec2(1, 10))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(1, 10))
end
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(1500,700))
editor.addWindowMenuItem("Drift Data Editor", function() show() end, {groupMenuName="Gameplay"})
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua
if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
im.SetClipboardText(fname)
if editor.uiIconImageButton(editor.icons.folder_open, im.ImVec2(20, 20), im.ImVec4(1, 1, 1, 1)) then
Engine.Platform.exploreFolder(path.dirname(fnames[1]))
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(20, 20), im.ImVec4(1, 1, 1, 1)) then
im.SetClipboardText(path.dirname(fnames[1]))
end
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(20, 20), regenClr) then
im.OpenPopup("Delete Audio Files")
im.Separator()
if im.Button("Ok", im.ImVec2(120,0)) then
pacenote:deleteAudioFiles()
im.SameLine()
if im.Button("Cancel", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
@/lua/ge/extensions/editor/windows.lua
if moveWindow then
im.SetWindowPos2("Windows", im.ImVec2(mainViewport.Pos.x + 40, mainViewport.Pos.y + 40))
end
if im.Button("Set position to 0,0##" .. name) then
im.SetWindowPos2(name, im.ImVec2(0, 0))
end
local function onEditorInitialized()
editor.registerWindow(windowName, im.ImVec2(800, 500))
editor.editModes.assetBrowserEditMode = {
@/lua/ge/extensions/editor/raceEditor/tools.lua
if FS:fileExists(f) then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
im.tooltip("Found file at "..f)
else
editor.uiIconImage(editor.icons.error_outline, im.ImVec2(24, 24))
im.tooltip("No file at "..f)
function C:drawGeneralInfo()
im.BeginChild1("Tools", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
im.Text("Side Decorators")
im.Dummy(im.ImVec2(0,10))
if lastGroup then
end
im.Dummy(im.ImVec2(0, 5))
if classification[field] then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
else
else
editor.uiIconImage(editor.icons.close, im.ImVec2(24, 24))
end
@/lua/ge/extensions/editor/undoHistory.lua
if imgui.Button("Undo Selected") then editor.undo(tableSize(editor.history.undoStack) - selectedIndex + 1) end
imgui.BeginChild1("undos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
for k = tableSize(editor.history.undoStack), 1, -1 do
if imgui.Button("Redo Selected") then editor.redo(tableSize(editor.history.redoStack) - selectedIndex2 + 1) end
imgui.BeginChild1("redos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
for k = tableSize(editor.history.redoStack), 1, -1 do
editor.addWindowMenuItem("Undo History", onWindowMenuItem)
editor.registerWindow(toolWindowName, imgui.ImVec2(300, 500))
end
@/lua/ge/extensions/editor/flowgraph/execution.lua
self.fgMgr = extensions['core_flowgraphManager']
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, true)
end
im.Separator()
editor.uiIconImage(mgr.runningState ~= "running" and editor.icons.pause_circle_outline or editor.icons.play_circle_filled, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip(mgr.runningState == "running" and "Project Running" or "Project Stopped")
if mgr.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("This project is invisible. You can see it because you have Dev Mode enabled.")
editor.uiIconImage(editor.icons.goat, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("This project is transient. It cannot be saved.")
editor.uiIconImage(editor.icons.assignment, im.ImVec2(20, 20), color)
-- ui_flowgraph_editor.tooltip(tooltipText)
if mgr.runningState == "running" then
if editor.uiIconImage(editor.icons.play_arrow, im.ImVec2(20, 20)) then
--mgr:setRunning(true)
im.SameLine()
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20)) then
mgr:setRunning(false)
else
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(20, 20)) then
-- Try to apply mission variables before starting
im.SameLine()
if editor.uiIconImage(editor.icons.stop, im.ImVec2(20, 20)) then
--mgr:setRunning(false)
--im.SameLine()
--if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(20, 20)) then
-- mgr:queueForRestart()
if self.alone then
if editor.uiIconImageButton(editor.icons.search, im.ImVec2(20, 20)) then
if self.alone then
im.SameLine()
if editor.uiIconImageButton(editor.icons.close, im.ImVec2(20, 20)) then
if self.alone or self.mgr ~= mgr then
im.NextColumn()
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(20, 20)) then
for _, m in ipairs(self.fgMgr.getAllManagers()) do
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20)) then
for _, m in ipairs(self.fgMgr.getAllManagers()) do
--if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(25, 25)) then
-- for _, m in ipairs(self.fgMgr.getAllManagers()) do
@/lua/common/extensions/ui/imgui_custom_luaintf.lua
function M.ImVec2(x, y)
return imgui.ImVec2(x, y)
end
function M.ImVec2Ptr(x, y)
return M.ImVec2(x, y)
end
if not buf_size then buf_size = 2^32 end
if not size then size = M.ImVec2(0,0) end
if not flags then flags = 0 end
function M.getCurrentMonitorSize()
local vec2 = M.ImVec2(0, 0)
imgui.getCurrentMonitorSize(vec2)
function M.HighlightText(label, highlightText)
M.PushStyleVar2(M.StyleVar_ItemSpacing, M.ImVec2(0, 0))
if highlightText == "" then
M.SameLine()
M.Dummy(M.ImVec2(width - M.GetCursorPosX(), 1))
M.EndGroup()
local itemSize = M.GetItemRectSize()
M.ImDrawList_AddRectFilled(M.GetWindowDrawList(), M.ImVec2(cursor.x + M.GetWindowPos().x - 2,
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
M.ImVec2(cursor.x + M.GetWindowPos().x + itemSize.x + (spacing.y/2),
cursor.y + M.GetWindowPos().y + itemSize.y + 2 - M.GetScrollY()),
local itemSize = M.GetItemRectSize()
M.ImDrawList_AddRectFilled(M.GetWindowDrawList(), M.ImVec2(cursor.x + M.GetWindowPos().x - 2,
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
cursor.y + M.GetWindowPos().y + (spacing.y/2) - 2 - M.GetScrollY()),
M.ImVec2(cursor.x + M.GetWindowPos().x + itemSize.x + (spacing.y/2),
cursor.y + M.GetWindowPos().y + itemSize.y + 2 - M.GetScrollY()),
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veView.lua
rot = data.rot or core_camera.getQuat(),
lastMouseDragPos = im.ImVec2(0,0),
attachToObject = im.BoolPtr(data.attachToObject or true),
editor.registerWindow(wndName, im.ImVec2(400,600))
editor.showWindow(wndName)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
if im.BeginPopup('viewcontrol' .. tostring(sceneViewName)) then
im.PushStyleVar1(im.StyleVar_WindowBorderSize, 0)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
if createNewViewNextFrame then
@/lua/ge/extensions/editor/crawlEditor.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(1800,900))
editor.addWindowMenuItem("Crawl Data Editor", function() show() end, {groupMenuName="Gameplay"})
im.Separator()
if im.BeginChild1("LeftPanel", im.ImVec2(im.GetWindowWidth() * 0.4, 0), true) then
if im.BeginChild1("RightPanel", im.ImVec2(0, 0), true) then
im.Text("Details")
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imButton.lua
local avail = im.GetContentRegionAvail()
im.Button(tostring(self.pinIn.text.value or "Button") ..'##'.. tostring(self.id), im.ImVec2(avail.x, 0))
@/lua/ge/extensions/gameplay/rally/loop/stagedCountdownUtils.lua
if state == STATE_COUNTDOWN_RUNNING then
im.ProgressBar((duration - timer) / duration, im.ImVec2(100,0))
im.Text("Running")
elseif state == STATE_FINISHED then
im.ProgressBar(1, im.ImVec2(100,0))
im.Text("Done")
else
im.ProgressBar(0, im.ImVec2(100,0))
im.Text("Waiting")
@/lua/ge/extensions/util/maptiles.lua
local draw3DDebug = im.BoolPtr(false)
local initialWindowSize = im.ImVec2(500, 500)
-- Draw the tile rectangle
im.ImDrawList_AddRectFilled(drawList, im.ImVec2(x, y), im.ImVec2(x + cellWidth - 1, y + cellHeight - 1), color)
-- Draw the tile rectangle
im.ImDrawList_AddRectFilled(drawList, im.ImVec2(x, y), im.ImVec2(x + cellWidth - 1, y + cellHeight - 1), color)
local mousePos = im.GetMousePos()
if im.IsMouseHoveringRect(im.ImVec2(x, y), im.ImVec2(x + cellWidth, y + cellHeight)) then
if im.IsMouseClicked(0) then
local mousePos = im.GetMousePos()
if im.IsMouseHoveringRect(im.ImVec2(x, y), im.ImVec2(x + cellWidth, y + cellHeight)) then
if im.IsMouseClicked(0) then
-- Draw grid border
im.ImDrawList_AddRect(drawList, cursorPos, im.ImVec2(cursorPos.x + gridWidth, cursorPos.y + gridHeight), im.GetColorU322(im.ImVec4(1, 1, 1, 1)))
-- Advance cursor so that the next UI elements don't overlap
im.Dummy(im.ImVec2(gridWidth, gridHeight))
local texObj = imUtils.texObj('#mapTilePreview')
im.Image(texObj.texId, im.ImVec2(300, 300))
im.TextWrapped(hoverTooltip)
@/lua/ge/extensions/editor/missionEditor/careerSetup.lua
local missionTypesDir = "/gameplay/missionTypes"
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
if (editor.uiIconImageButton(editor.icons.add, im.ImVec2(22, 22)) or att or editEnded[0]) then
local addKey = att or ffi.string(getBuffer("addReward--"..key, ""))
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(22, 22)) then
self.copiedRewards = deepcopy(rewards or {})
end
if editor.uiIconImageButton(editor.icons.content_paste, im.ImVec2(22, 22)) then
rewards = deepcopy(self.copiedRewards)
@/lua/ge/extensions/editor/sitesEditor.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(400, 400))
editor.editModes.sitesEditMode =
@/lua/ge/extensions/editor/missionPlaybook.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(1500,700))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName="Missions"})
@/lua/ge/extensions/editor/rallyEditor/notebookInfo.lua
local tabContentsHeight = 0
im.BeginChild1("codrivers", im.ImVec2(125 * im.uiscale[0], tabContentsHeight), im.WindowFlags_ChildWindow)
for _,codriver in ipairs(self.path.codrivers.sorted) do
im.SameLine()
im.BeginChild1("currentCodriver", im.ImVec2(0,tabContentsHeight), im.WindowFlags_ChildWindow)
im.SameLine()
if im.Button("Cancel", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
@/lua/ge/extensions/editor/shapeEditor.lua
local meshFile = nil
local initialWindowSize = im.ImVec2(800, 600)
local windowTitle = "Shape Editor"
end
return im.ImVec2(menuW, menuH)
end
im.BeginChild1("##child1", im.ImVec2(0, 0), false)
im.Columns(4)
-- im.BeginChild1("###shapeStats", im.ImVec2(400, 200), true)
-- im.Columns(2)
im.BeginChild1("##child2", im.ImVec2(0, 0), false)
im.Columns(5)
editor.icons.delete,
im.ImVec2(24, 24)
) then
@/lua/ge/extensions/editor/prefabInstanceEditor.lua
-- imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1,1,1,1))
if imgui.Button("Apply to parent", imgui.ImVec2(availWidth, 0)) then
end
@/lua/ge/extensions/editor/trafficManager.lua
name = realName,
size = im.ImVec2(360, 80)
},
icon = "car",
size = im.ImVec2(600, 560),
active = false
icon = "traffic",
size = im.ImVec2(500, 560),
active = false
icon = "directions",
size = im.ImVec2(500, 560),
active = false
icon = "settings",
size = im.ImVec2(240, 240),
popup = true,
local imSizes = {
dummy = im.ImVec2(5, 5),
small = im.ImVec2(20, 20),
dummy = im.ImVec2(5, 5),
small = im.ImVec2(20, 20),
medium = im.ImVec2(30, 30),
small = im.ImVec2(20, 20),
medium = im.ImVec2(30, 30),
large = im.ImVec2(40, 40)
medium = im.ImVec2(30, 30),
large = im.ImVec2(40, 40)
}
local vecY = vec3(0, 1, 0)
local imDefaultPos = im.ImVec2(60, 180) -- places new windows below the main window
local prevFilePath = "/"
im.PushStyleColor2(im.Col_ButtonHovered, imColors.accept)
if im.Button("Spawn Here##trafficManagerVehicles", im.ImVec2(140, im.GetFrameHeight())) then
spawnDelayFrames = 3
end
if im.Button("Spawn on Click##trafficManagerVehicles", im.ImVec2(140, im.GetFrameHeight())) then
if mouseMode ~= "spawn" then
local function tabVehicleManager()
im.BeginChild1("vehicleManagerList##trafficManager", im.ImVec2(240 * im.uiscale[0], 440 * im.uiscale[0]), im.WindowFlags_ChildWindow)
im.BeginChild1("vehicleManagerData##trafficManager", im.ImVec2(0, 440 * im.uiscale[0]), im.WindowFlags_None)
local sessionData = session.vehicles[currSelection.vehicle]
im.BeginChild1("trafficLightsList##trafficManager", im.ImVec2(160 * im.uiscale[0], 440 * im.uiscale[0]), im.WindowFlags_ChildWindow)
for _, id in ipairs(session.lightsSorted) do
im.BeginChild1("trafficLightsData##trafficManager", im.ImVec2(0, 440 * im.uiscale[0]), im.WindowFlags_None)
for _, id in ipairs(currInstance.tempSignalObjects) do
if im.Button(tostring(id).."##signalObject", im.ImVec2(columnWidth - im.GetStyle().ItemSpacing.x, 20 * im.uiscale[0])) then
editor.clearObjectSelection()
im.PushStyleColor2(im.Col_ButtonHovered, imColors.accept)
if im.Button("Spawn Here##trafficManagerSigns", im.ImVec2(140, im.GetFrameHeight())) then
spawnReady = true
end
if im.Button("Spawn on Click##trafficManagerSigns", im.ImVec2(140, im.GetFrameHeight())) then
if mouseMode ~= "spawn" then
im.PushItemWidth(300 * im.uiscale[0])
if editor.uiInputTextMultiline("Description##trafficManager", options.sessionDescription, 4096, im.ImVec2(0, 80 * im.uiscale[0])) then
session.description = ffi.string(options.sessionDescription)
if im.Button("YES", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
confirmData.yesFunc()
im.SameLine()
if im.Button("NO", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
confirmData.noFunc()
@/lua/ge/extensions/editor/flowgraph/legend.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
self.items = {
@/lua/ge/extensions/editor/toolUtilities/materialSelectionMgr.lua
local im = ui_imgui
local materialSelectWinName, materialSelectWinSize = 'materialSelect', im.ImVec2(300, 500) -- The material selection window.
local simSetNameFilter = im.ImGuiTextFilter()
local emptyStr = ""
local vec32 = im.ImVec2(32, 32)
-- Scrollable list area.
local listSize = im.ImVec2(0, im.GetContentRegionAvail().y)
im.BeginChild1("MaterialListScrollArea", listSize, false)
@/lua/ge/extensions/career/modules/partInventory.lua
local function debugMenu()
imgui.SetNextWindowSize(imgui.ImVec2(300, 300), imgui.Cond_FirstUseEver)
local partInventoryOpenPtr = imgui.BoolPtr(true)
end
imgui.BeginChild1("vehiclePartsOuter", imgui.ImVec2(220, 0), imgui.WindowFlags_ChildWindow)
imgui.Text("Parts in current vehicle")
imgui.Text("Parts in current vehicle")
imgui.BeginChild1("partsInVehicle", imgui.ImVec2(200, 0), imgui.WindowFlags_ChildWindow)
for partId, part in pairs(partInventory) do
imgui.SameLine()
imgui.BeginChild1("inventoryPartsOuter", imgui.ImVec2(0, 0), imgui.WindowFlags_ChildWindow)
imgui.Text("Parts in inventory")
@/lua/ge/extensions/editor/terrainEditor.lua
im.PopTextWrapPos()
im.Dummy(im.ImVec2(0, 10))
im.Text("Diffuse")
im.Image(selectedPaintMaterialProxy.diffuseMapObj.texId, im.ImVec2(size/2,size/2))
im.Text("Detail")
im.Text("Detail")
im.Image(selectedPaintMaterialProxy.detailMapObj.texId, im.ImVec2(size/2,size/2))
im.Text("Macro")
im.Image(selectedPaintMaterialProxy.macroMapObj.texId, im.ImVec2(size/2,size/2))
im.Text("Normal")
im.Text("Normal")
im.Image(selectedPaintMaterialProxy.normalMapObj.texId, im.ImVec2(size/2,size/2))
im.Columns(1)
local cursorPos = im.GetCursorPos()
local childSize = im.ImVec2(
0,
if texObj and texObj.tex then
im.Image(texObj.tex:getID(), im.ImVec2(previewPx, previewPx), nil, nil, nil, editor.color.white.Value)
drewPreview = true
if not drewPreview then
im.Dummy(im.ImVec2(previewPx, previewPx))
end
nil,
im.ImVec2(remainingW, previewPx)
)
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(btnHeight, btnHeight)) then
-- TODO: Add a `remove material`-modal
im.SameLine()
if im.Button("...##HeightMapImage", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
editor_fileDialog.openFile(function(data) terrainImpExp.heightMapTexture = im.ArrayChar(128, data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
im.SameLine()
if im.Button("...##HoleMapImage", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
editor_fileDialog.openFile(function(data) terrainImpExp.holeMapTexture = im.ArrayChar(128, data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
local btnWidth = im.GetContentRegionAvailWidth() - (var.channelComboWidth + var.materialComboWidth + 2*var.style.ItemSpacing.x)
if im.Button(map.path, im.ImVec2(btnWidth, var.inputWidgetHeight)) then
if im.GetIO().KeyCtrl == true then
im.Separator()
if im.Button("+##AddTextureMap", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
editor_fileDialog.openFile(function(data) addTextureMap(data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
im.SameLine()
if im.Button("-##RemoveTextureMap", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
removeTextureMap()
im.Separator()
if im.Button("Import##ImportTerrainAccept", im.ImVec2(0, var.inputWidgetHeight)) then
terrainImporter_Accept()
im.SameLine()
if im.Button("Cancel##ImportTerrainCancel", im.ImVec2(0, var.inputWidgetHeight)) then
terrainImporter_Cancel()
if im.Button("...##TerrainExportPath", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
editor_fileDialog.openFile(function(data) terrainImpExp.exportPath=im.ArrayChar(128, data.path) end, nil, true, var.lastPath)
if im.Button("Export##ExportTerrainAccept", im.ImVec2(0, var.inputWidgetHeight)) then
terrainExporter_Accept()
im.SameLine()
if editor.uiButtonRightAlign("Cancel", im.ImVec2(0, var.inputWidgetHeight), true, "ExportTerrainCancel") then
terrainExporter_Cancel()
var.sc_curveWidgetPosA = im.ImVec2(winPos.x + im.GetCursorPosX() + textWidthLeftBound, winPos.y + im.GetCursorPosY())
local posY = im.GetCursorPosY()
-- draw background
im.ImDrawList_AddRectFilled(drawList, var.sc_curveWidgetPosA, im.ImVec2(var.sc_curveWidgetPosA.x+var.sc_curveWidgetSize, var.sc_curveWidgetPosA.y+var.sc_curveWidgetSize), var.sc_backgroundCol)
-- draw background frame
-- draw background frame
im.ImDrawList_AddRect(drawList, var.sc_curveWidgetPosA, im.ImVec2(var.sc_curveWidgetPosA.x+var.sc_curveWidgetSize, var.sc_curveWidgetPosA.y+var.sc_curveWidgetSize), var.sc_frameCol, 0, 0,2)
-- draw the indentity line
-- draw the indentity line
im.ImDrawList_AddLine(drawList, var.sc_curveWidgetPosA, im.ImVec2(var.sc_curveWidgetPosA.x+var.sc_curveWidgetSize, var.sc_curveWidgetPosA.y+var.sc_curveWidgetSize), var.sc_identityLineCol, 1)
for i = 1, #var.softSelectFilter do
for i = 1, #var.softSelectFilter do
im.SetCursorPos(im.ImVec2(var.style.WindowPadding.x + textWidthLeftBound +
((i - 1) / (#var.softSelectFilter - 1) * (var.sc_curveWidgetSize -
"##softSelectButton" .. i,
im.ImVec2(
editor.getPreference("terrainEditor.general.brushSoftnessCurveKnotSize"),
drawList,
im.ImVec2(var.sc_curveWidgetPosA.x+((i-1)/(#var.softSelectFilter-1)*var.sc_curveWidgetSize), var.sc_curveWidgetPosA.y+((1-var.softSelectFilter[i])*var.sc_curveWidgetSize)),
im.ImVec2(var.sc_curveWidgetPosA.x+(i/(#var.softSelectFilter-1)*var.sc_curveWidgetSize), var.sc_curveWidgetPosA.y+((1-var.softSelectFilter[i+1])*var.sc_curveWidgetSize)),
im.ImVec2(var.sc_curveWidgetPosA.x+((i-1)/(#var.softSelectFilter-1)*var.sc_curveWidgetSize), var.sc_curveWidgetPosA.y+((1-var.softSelectFilter[i])*var.sc_curveWidgetSize)),
im.ImVec2(var.sc_curveWidgetPosA.x+(i/(#var.softSelectFilter-1)*var.sc_curveWidgetSize), var.sc_curveWidgetPosA.y+((1-var.softSelectFilter[i+1])*var.sc_curveWidgetSize)),
var.sc_curveColor,
im.SetCursorPos(im.ImVec2(textWidthLeftBound + var.style.WindowPadding.x, var.menuBarHeight + var.style.WindowPadding.y + var.sc_curveWidgetSize + 1*var.style.ItemSpacing.y + var.inputWidgetHeight))
im.TextUnformatted("Inside")
im.SetCursorPosY(im.GetCursorPosY() + 2*var.style.ItemSpacing.y)
if im.Button("Cancel##brushSoftnessCurve", im.ImVec2(0.5*((var.sc_curveWidgetSize + textWidthLeftBound)-var.style.ItemSpacing.x),var.inputWidgetHeight)) then
brushSoftnessCurve_Cancel()
end
if editor.uiButtonRightAlign("Ok", im.ImVec2(0.5*((var.sc_curveWidgetSize + textWidthLeftBound)-var.style.ItemSpacing.x),var.inputWidgetHeight), true, "brushSoftnessCurve", var.sc_curveWidgetSize - im.GetContentRegionAvailWidth() + textWidthLeftBound) then
brushSoftnessCurve_Accept()
local function onEditorInitialized()
editor.registerWindow(terrainPainterWindowName, im.ImVec2(240,550))
editor.registerWindow(terrainImportDialogName, im.ImVec2(350,480), nil, false)
editor.registerWindow(terrainPainterWindowName, im.ImVec2(240,550))
editor.registerWindow(terrainImportDialogName, im.ImVec2(350,480), nil, false)
editor.registerWindow(terrainExportDialogName, im.ImVec2(230,270), nil, false)
editor.registerWindow(terrainImportDialogName, im.ImVec2(350,480), nil, false)
editor.registerWindow(terrainExportDialogName, im.ImVec2(230,270), nil, false)
editor.registerWindow(terrainBrushSoftnessCurveDialogName, im.ImVec2(330,400), nil, false)
editor.registerWindow(terrainExportDialogName, im.ImVec2(230,270), nil, false)
editor.registerWindow(terrainBrushSoftnessCurveDialogName, im.ImVec2(330,400), nil, false)
editor.registerModalWindow("autoPaintModal", im.ImVec2(430, 320))
@/lua/ge/extensions/flowgraph/nodes/logic/frameDelay.lua
builder:Middle()
im.ProgressBar(self.pinIn.frames.value and (self.counter / self.pinIn.frames.value) or 0, im.ImVec2(50,0))
if im.SmallButton("Reset") then
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
for name, val in pairs(presets) do
if im.Button(string.format("%s##%s_%s", name:gsub("^%l", string.upper), "Generate Materials", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
setCamera(vec3(val[1], val[2], val[3]))
if im.Button(string.format("%s##%s", "Show Preferences", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.showPreferences("dynamicDecalsTool")
for name, val in pairs(presets) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##dynDecals_camera_presets_remove_%d", i)) then
presets[name] = nil
im.Separator()
if im.Button("Add Preset##dynDecals_camera_presets_add", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
local i = 0
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/textureFill.lua
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
editor.registerWindow(textureFillLayer_add_windowName, im.ImVec2(450, 310), nil, nil, nil, true)
end
@/lua/ge/extensions/editor/barriersEditor.lua
if not editor.editMode or editor.editMode.displayName ~= editModeName then
if im.Button("Enable Mouse Selection", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
editor.selectEditMode(editor.editModes[editModeName])
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(1500,700))
editor.addWindowMenuItem("Barriers Editor", function() show() end, {groupMenuName="Gameplay"})
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imSeparator.lua
if self.data.aboveSpacing > 0 then
im.Dummy(im.ImVec2(0,self.data.aboveSpacing))
end
if self.data.belowSpacing > 0 then
im.Dummy(im.ImVec2(0,self.data.belowSpacing))
end
@/lua/ge/extensions/editor/roadSpline.lua
local min, max = math.min, math.max
local toolWindowName, toolWindowSize = "roadSplineEditor", im.ImVec2(200, 400)
local sliderDefaults = layerMgr.getSliderDefaults()
local sliderDefaults = layerMgr.getSliderDefaults()
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local sliderDefaults = layerMgr.getSliderDefaults()
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('###1363', im.ImVec2(-1, 180)) then
im.Columns(3, "roadSplineListBoxColumns", true)
im.SetColumnWidth(1, 180)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 92333
-- Buttons underneath the road spline list box.
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.TextColored(cols.greenB, "Spline Properties:")
im.Dummy(im.ImVec2(0, 3))
im.tooltip('Toggle whether all layers in this spline should render over other objects.')
im.Dummy(im.ImVec2(0, 3))
end
-- Tab content.
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
if selectedTab == 0 then -- Layers tab.
im.TextColored(cols.greenB, "Auto-Generated Layers:")
im.Dummy(im.ImVec2(0, 3))
im.Columns(1)
-- Paint line controls.
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('###5363', im.ImVec2(-1, 150)) then
im.Columns(3, "layerListBoxColumns", true)
im.SetColumnWidth(1, 180)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 51322
-- Buttons underneath the layers list box.
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
im.TextColored(cols.greenB, "Layer Properties:")
im.Dummy(im.ImVec2(0, 3))
im.PushItemWidth(-1)
else
im.Dummy(im.ImVec2(iconsSmall.x + 4, iconsSmall.y))
end
else
im.Dummy(im.ImVec2(iconsSmall.x + 4, iconsSmall.y))
end
im.Columns(1)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
@/lua/ge/extensions/editor/masterSpline.lua
local min, max, sin = math.min, math.max, math.sin
local toolWindowName, toolWindowSize = "masterSpline", im.ImVec2(200, 400) -- The main tool window of the editor. The main UI entry point.
local sliderDefaults = layerMgr.getSliderDefaults()
local presetsMap = roadDesignStandards.getPresetsMap()
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local presetsMap = roadDesignStandards.getPresetsMap()
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.SetColumnWidth(4, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('###1363', im.ImVec2(-1, 180)) then
im.Columns(4, "splineListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 22322
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
-- Tab content.
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8)) -- Reduce horizontal padding
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8)) -- Reduce horizontal padding
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
if selectedTab == 0 and selSpline.isEnabled then -- Layers tab.
im.PushItemWidth(-1)
if im.BeginListBox('###5363', im.ImVec2(-1, 180)) then
im.Columns(4, "layerListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 51322
im.SetColumnWidth(4, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.TextColored(cols.greenB, "Layer Controls:")
im.Dummy(im.ImVec2(0, 2))
im.PushItemWidth(-1)
im.tooltip('Analyze width gradient violations for smooth lane transitions.')
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.SetColumnWidth(2, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
@/lua/common/extensions/ui/flowgraph/editor_api_luaintf.lua
M.Begin = function(id, size, readOnly)
if size == nil then size = im.ImVec2(0, 0) end
if readOnly == nil then readOnly = false end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local nodeInputTextInput = im.ArrayChar(16)
local nodeInputTextPopupPos = im.ImVec2(0,0)
local nodeInputTextPopupSize = im.ImVec2(0,0)
local nodeInputTextPopupPos = im.ImVec2(0,0)
local nodeInputTextPopupSize = im.ImVec2(0,0)
local nodeInputTextPopupOpen = false
local beamInputTextInput = im.ArrayChar(16)
local beamInputTextPopupPos = im.ImVec2(0,0)
local beamInputTextPopupSize = im.ImVec2(0,0)
local beamInputTextPopupPos = im.ImVec2(0,0)
local beamInputTextPopupSize = im.ImVec2(0,0)
local beamInputTextPopupOpen = false
if showGraphs[0] then
im.PlotLines1(units, v.plotData[nodeID], plotLen, plotOffset, name, FLT_MAX, FLT_MAX, im.ImVec2(300, 100))
end
if showGraphs[0] then
im.PlotLines1(units, v.plotData[beamID], plotLen, plotOffset, name, FLT_MAX, FLT_MAX, im.ImVec2(300, 100))
end
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
local maxMag = 20
local fillPercent = 0.33
im.BeginChild1(label.."Child", im.ImVec2(winWidth, scale*(24)+16), true, (not entry.expanded) and flags)
if icon and editor.icons[icon] then
editor.uiIconImage(editor.icons[icon], im.ImVec2(20,20), node.customIconColor or node.iconColor)
im.SameLine()
if e.meta.type == 'node' and e.meta.node then
if im.Button("View Node##".. e.meta.node.name.."/"..e.meta.node.id, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
self.mgr:selectGraph(e.meta.node.graph)
if e.meta.type == 'graph' and e.meta.graph then
if im.Button("View Graph##" ..e.meta.graph.name.."/"..e.meta.graph.id, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
self.mgr:unselectAll()
@/lua/ge/extensions/editor/dragRaceEditor.lua
log('D', 'drag_race_editor', 'Editor initialized, loading all data')
editor.registerWindow(constants.CONSTANTS.WINDOW_NAME, im.ImVec2(constants.CONSTANTS.WINDOW_SIZE.x, constants.CONSTANTS.WINDOW_SIZE.y))
editor.addWindowMenuItem("Drag Race Editor", function() M.show() end, {groupMenuName="Gameplay"})
-- Left column: All items (facilities, strips, settings)
im.BeginChild1("leftPanel", im.ImVec2(0, 0), true)
-- Right column: Details view
im.BeginChild1("rightPanel", im.ImVec2(0, 0), true)
@/lua/ge/extensions/flowgraph/nodes/macro/io.lua
local itemSize = {x = 100, y = 100}
--[[im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
if mgr and self.mission then
im.BeginChild1("mfgvarContainter", im.ImVec2(350*scale,350*scale))
im.Text("Project: " .. mgr.name)
end
if im.Button("Add all "..#self._sortedVars.missing.." missing Variables", im.ImVec2(-1,0)) then
for _, elem in ipairs(self._sortedVars.missing) do
end
if im.Button("Fix all "..#self._sortedVars.mismatch.." type-mismatched Variables", im.ImVec2(-1,0)) then
for _, elem in ipairs(self._sortedVars.mismatch) do
if self._editing then
im.InputTextMultiline("##facEditor", self._text[1], im.GetLengthArrayCharPtr(self._text[1]), im.ImVec2(-1,math.max(im.GetContentRegionAvail().y, 500)))
-- display char limit
@/lua/ge/extensions/editor/dragRaceEditor/dragSettings.lua
M.drawDragSettingsSection = function()
im.BeginChild1("dragSettings", im.ImVec2(0, 200), true)
im.Text("Drag Settings")
M.drawPrefabsSection = function()
im.BeginChild1("prefabs", im.ImVec2(0, 200), true)
im.Text("Prefabs")
M.drawPhasesSection = function()
im.BeginChild1("phases", im.ImVec2(0, 150), true)
im.Text("Race Phases")
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/vehicleStoppedNearPlane.lua
if self.pinIn.duration.value == nil then return end
im.ProgressBar(self.timer / math.max(1e-12, self.pinIn.duration.value), im.ImVec2(50,0))
end
@/lua/ge/extensions/render/viewDemo.lua
local imageRes = im.ImVec2(512, 256) -- resolution in pixels
@/lua/ge/extensions/gameplay/drift/drift.lua
im.Dummy(im.ImVec2(1, 10))
im.Dummy(im.ImVec2(1, 10))
plotHelperUtil = plotHelperUtil or require('/lua/ge/extensions/editor/util/plotHelperUtil')()
im.BeginChild1("Debug Graph", im.ImVec2(im.GetContentRegionAvailWidth(), 400), true)
for _, historyData in pairs(debugHistories) do
@/lua/ge/extensions/editor/rallyEditor/pacenotes/pacenoteForm.lua
if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
im.SetClipboardText(fname)
if im.Button("OK", im.ImVec2(120, 0)) then
pacenoteToolsWindow:deleteSelectedPacenote()
im.SameLine()
if im.Button("Cancel", im.ImVec2(120, 0)) then
im.CloseCurrentPopup()
@/lua/ge/extensions/editor/levelValidator.lua
im.BeginChild1("logsTable", im.ImVec2(0,0), false)
im.Columns(7, nil, false)
local textSize = im.CalcTextSize(logItem.message:sub(1, 1000) or "", nil, nil, im.GetColumnWidth(2) - im.GetStyle().ItemSpacing.x)
if im.Selectable1(" " .. (logItem.logLevel or "") .. "##" .. i, selected == i, im.SelectableFlags_SpanAllColumns, im.ImVec2(0, textSize.y + 5)) then
end
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(200, 400))
editor.addWindowMenuItem("Level Validator", onWindowMenuItem)
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
if self._editing then
im.InputTextMultiline("##facEditor", self._text[1], im.GetLengthArrayCharPtr(self._text[1]), im.ImVec2(-1,-1))
-- display char limit
@/lua/ge/extensions/editor/scriptAIManager.lua
local initialWindowSize = im.ImVec2(640, 200)
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(24,24), nil, nil, nil, 'stopall') then
for i = 0, objMax do
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(24,24), nil, nil, nil, 'playall') then
for i = 0, objMax do
im.NextColumn()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.Separator()
--im.ImGuiStyle_ItemSpacing(tmpVecPos)
local spacing = im.ImVec2(0, 0) --tmpVecPos[0].x, tmpVecPos[0].y)
local cPos = im.GetCursorScreenPos()
local graphPos = im.ImVec2(cPos.x, cPos.y)
local p1 = im.ImVec2(graphPos.x, graphPos.y)
local p2 = im.ImVec2(graphPos.x + cw - spacing.x * 2 - 12, graphPos.y + textLineHeight)
local p1 = im.ImVec2(graphPos.x, graphPos.y)
local p2 = im.ImVec2(graphPos.x + cw - spacing.x * 2 - 12, graphPos.y + textLineHeight)
local col = im.GetColorU322(im.ImVec4(0.3, 0.3, 0.3, 1))
local perc = vi.time / vi.endScriptTime
p1 = im.ImVec2(graphPos.x, graphPos.y)
p2 = im.ImVec2(graphPos.x + (perc * cwGraph), graphPos.y + barheight )
p1 = im.ImVec2(graphPos.x, graphPos.y)
p2 = im.ImVec2(graphPos.x + (perc * cwGraph), graphPos.y + barheight )
col = im.GetColorU322(im.ImVec4(0, 1, 0, 1))
perc = vi.scriptTime / vi.endScriptTime
p1 = im.ImVec2(graphPos.x, graphPos.y + barheight)
p2 = im.ImVec2(graphPos.x + (perc * cwGraph), graphPos.y + barheight * 2)
p1 = im.ImVec2(graphPos.x, graphPos.y + barheight)
p2 = im.ImVec2(graphPos.x + (perc * cwGraph), graphPos.y + barheight * 2)
col = im.GetColorU322(im.ImVec4(1, 1, 1, 1))
local ys = (y / 3) -- maxY
local p1 = im.ImVec2(graphPos.x + x, graphPos.y)
local p2 = im.ImVec2(graphPos.x + x, graphPos.y + textLineHeight)
local p1 = im.ImVec2(graphPos.x + x, graphPos.y)
local p2 = im.ImVec2(graphPos.x + x, graphPos.y + textLineHeight)
col = im.GetColorU322(im.ImVec4( 1, 0, 0, math.min(math.abs(ys), 1)))
if vehState[vehId] == 'idle' then
if editor.uiIconImageButton(editor.icons.fiber_manual_record, im.ImVec2(24,24), nil, nil, nil, 'record'..vehId) then
core_camera.setByName(0, "orbit", false)
im.SameLine()
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(24,24), nil, nil, nil, 'play'..vehId) then
playVehicle(bo)
elseif vehState[vehId] == 'recording' then
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(24,24), nil, nil, nil, 'stopRecord'..vehId) then
stopRecording(bo, vehId)
elseif vehState[vehId] == 'playing' then
if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(24,24), nil, nil, nil, 'play'..vehId) then
playVehicle(bo)
im.SameLine()
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(24,24), nil, nil, nil, 'stopPlay'..vehId) then
stopPlaying(bo, vehId)
im.SameLine()
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(24,24), nil, nil, nil, 'saverecord'..vehId) then
if not tmpSaveFilename then
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder_open, im.ImVec2(24,24), nil, nil, nil, 'loadrecord'..vehId) then
im.OpenPopup('Load Recording##'..vehId)
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.Text('Debug: ')
@/lua/ge/extensions/tech/cameraPreview.lua
end
return im.ImVec2(size.x * displayRatio, size.y * displayRatio)
end
local config = tech_sensors.getSensorConfiguration(tech_sensors.stype.tCamera, sensorId)
local size = im.ImVec2(config.size[1], config.size[2])
camData[sensorId] = {
visualize = im.BoolPtr(false),
size = im.ImVec2(size.x, size.y),
showColor = im.BoolPtr(true),
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
i = i + 1
if im.ColorButton(string.format("##pres_%s_%d", guiId, k), im.ImVec4(col[1],col[2],col[3],col[4]), nil, im.ImVec2(btnSize, btnSize)) then
value = shallowcopy(col)
if im.InputTextMultiline(widgetId, editor.getTempCharPtr(value), nil, im.ImVec2(im.GetContentRegionAvailWidth(), 120)) then
property.value = editor.getTempCharPtr()
im.GetWindowDrawList(),
im.ImVec2(im.GetCursorPosX() + windowPos.x - scrollX - 1, im.GetCursorPosY() + windowPos.y - scrollY - 1),
im.ImVec2(im.GetCursorPosX() + imgWidth + windowPos.x - scrollX + 3, im.GetCursorPosY() + imgHeight + windowPos.y - scrollY + 2),
im.ImVec2(im.GetCursorPosX() + windowPos.x - scrollX - 1, im.GetCursorPosY() + windowPos.y - scrollY - 1),
im.ImVec2(im.GetCursorPosX() + imgWidth + windowPos.x - scrollX + 3, im.GetCursorPosY() + imgHeight + windowPos.y - scrollY + 2),
im.GetColorU322(editor.color.grey.Value),
if im.ImageButton(string.format("%s_imageButton", widgetId), img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1)) then
local openPath = baseProp.defaultDir
if im.ImageButton(string.format("%s_imageButton", widgetId), img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1)) then
local openPath = baseProp.defaultDir
if im.ImageButton(string.format("%s_imageButton", widgetId), img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1)) then
local openPath = baseProp.defaultDir
local cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("%s_gradientColorBottomLeft", widgetId), editor.getTempFloatArray4_TableTable(gradientColorBottomLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
im.GetWindowDrawList(),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
gradientColorTopLeftU32,
-- adding an invisible button so the imgui cursor is at the right location
im.InvisibleButton("GradientButton", im.ImVec2(size, size))
im.SameLine()
cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("%s_gradientColorBottomRight", widgetId), editor.getTempFloatArray4_TableTable(gradientColorBottomRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
end
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size + im.GetStyle().ItemSpacing.y))
im.NewLine()
local style = im.GetStyle()
local p1 = im.ImVec2(wpos.x + startCursorPos.x - scrollX - style.ItemSpacing.x / 2, wpos.y + startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + endCursorPos.x - scrollX + im.GetContentRegionAvailWidth() + style.ItemSpacing.x / 2, wpos.y + endCursorPos.y - scrollY)
local p1 = im.ImVec2(wpos.x + startCursorPos.x - scrollX - style.ItemSpacing.x / 2, wpos.y + startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + endCursorPos.x - scrollX + im.GetContentRegionAvailWidth() + style.ItemSpacing.x / 2, wpos.y + endCursorPos.y - scrollY)
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 2)
@/lua/ge/extensions/editor/objectToSplineEditor.lua
if objId then
if editor.uiIconImageButton(editor.icons.check_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0])) then
editor.selectEditMode(editor.editModes.objectSelect)
if guideId then
if editor.uiIconImageButton(editor.icons.check_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0])) then
editor.selectEditMode(editor.editModes.objectSelect)
-- advanced parameters
im.Dummy(im.ImVec2(0, 5))
im.TextUnformatted("Advanced")
editor.addWindowMenuItem(toolName, onWindowMenuItem)
editor.registerWindow(toolWindowName, im.ImVec2(420, 500))
end
@/lua/ge/extensions/editor/dynamicDecals/colorPresets.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("remove##ColorPreset_%s_%d", guiId, k)) then
table.remove(data, k)
im.SameLine()
if editor.uiIconImageButton(editor.icons.border_color, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsDecalColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setDecalColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
im.SameLine()
if editor.uiIconImageButton(editor.icons.format_color_fill, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsFillColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setFillLayerColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
table.insert(data, {value = newPreset.value})
-- New color preset using a color picker widget
-- local spacing = im.ImVec2(0, im.GetStyle().ItemSpacing.y * 2)
-- im.Dummy(spacing)
-- if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
-- table.insert(data, {value = newPreset.value})
@/lua/ge/extensions/editor/rallyEditor.lua
im.Separator()
if im.Button("Ok", im.ImVec2(120,0)) then
currentPath:generateAllFreeform()
im.SameLine()
if im.Button("Cancel", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
if currentPath then
-- im.BeginChild1("##top-toolbar", im.ImVec2(0,topToolbarHeight), im.WindowFlags_ChildWindow)
im.PushStyleColor2(im.Col_Text, im.ImColorByRGB(0,0,0,255).Value)
if im.Button("Switch to Rally Editor Editmode", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
editor.selectEditMode(editor.editModes.notebookEditMode)
-- im.BeginChild1("##tabs-child", im.ImVec2(0,middleChildHeight), im.WindowFlags_ChildWindow and im.ImGuiWindowFlags_NoBorder )
im.BeginChild1("##tabs-child", nil, im.WindowFlags_ChildWindow and im.ImGuiWindowFlags_NoBorder )
-- local tabContentsHeight = middleChildHeight - tabsHeight
-- im.BeginChild1("##tab-contents-child-window", im.ImVec2(0,tabContentsHeight), im.WindowFlags_ChildWindow and im.ImGuiWindowFlags_NoBorder)
im.BeginChild1("##tab-contents-child-window", nil, im.WindowFlags_ChildWindow and im.ImGuiWindowFlags_NoBorder)
editor.editModes.notebookEditMode.auxShortcuts[editor.AuxControl_LMB] = "Select"
editor.registerWindow(toolWindowName, im.ImVec2(500, 500))
editor.addWindowMenuItem("Rally Editor", function() show() end,{groupMenuName="Gameplay"})
@/lua/ge/extensions/editor/resourceChecker.lua
local pos = im.ImVec2(0, 0)
local leftT = im.GetCursorScreenPos()
leftT = im.ImVec2(leftT.x - 2, leftT.y - 1)
if hover == 1 then
if hover == 1 then
leftT = im.ImVec2(leftT.x - 2, (leftT.y - 1)-textSize.y-1)
end
if smol == 1 then
rightB = im.ImVec2(leftT.x+textSize.x+3, leftT.y+textSize.y+4)
else
else
rightB = im.ImVec2(leftT.x + window, leftT.y + textSize.y+1)
end
img.tex:getID(),
im.ImVec2(sizex, sizey),
nil, nil, nil,
img.tex:getID(),
im.ImVec2(sizex, sizey),
nil, nil, nil,
im.Text("Manage duplicates of selected material")
im.BeginChild1("##duplicateChild", im.ImVec2(0, windowSize.y-60* im.uiscale[0], false, im.WindowFlags_ChildWindow))
local fontPushed = im.PushFont3("robotomono_regular")
im.Spacing()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-220* im.uiscale[0], 0))
im.SameLine()
im.SameLine()
if im.Button("Save changes and close window", im.ImVec2(220* im.uiscale[0],0)) then
for k,v in pairs(duplicateTable) do
im.SetNextWindowPos(pos, im.ImGuiCond_Always, im.ImVec2(0.5, 0))
if getProgress() then
im.ProgressBar(getProgress()/100, im.ImVec2(300* im.uiscale[0], 0))
im.SameLine()
im.SetNextWindowPos(pos, im.ImGuiCond_Always, im.ImVec2(0.5, 0))
im.Separator()
im.BeginChild1("##childResults", im.ImVec2(0, windowSize.y-textSize.y-(im.GetFontSize()*3.5)-30), false, im.WindowFlags_ChildWindow+im.WindowFlags_HorizontalScrollbar)
local fontPushed = im.PushFont3("robotomono_regular")
im.Spacing()
im.Dummy(im.ImVec2(5* im.uiscale[0], 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(50* im.uiscale[0], 0))
im.SameLine()
warning("Remove only selected files", level, cnt, unusType, isSelected)
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-buttonWidth*3-11* im.uiscale[0], 0))
else
else
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-buttonWidth-5* im.uiscale[0], 0))
end
if not tableIsEmpty(isSelected) then
if im.Button("Remove selected files ("..cnt..")", im.ImVec2(buttonWidth,0)) then
im.OpenPopup("Remove only selected files")
im.SameLine()
if im.Button("Invert selection" , im.ImVec2(buttonWidth,0)) then
local tempSel = isSelected
im.SameLine()
if im.Button("Remove all unused files", im.ImVec2(buttonWidth,0)) then
im.OpenPopup("Remove all unused files")
if filepath and testName then
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-200* im.uiscale[0], 0))
im.SameLine()
im.SameLine()
if im.Button("Save output to user folder", im.ImVec2(200* im.uiscale[0],0)) then
local path = filepath.."/resourceChecker_"..testName..".json"
local c = _colorFor(path, false)
im.ImDrawList_AddRectFilled(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(c))
im.ImDrawList_AddRect(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(im.ImVec4(0,0,0,0.35)))
local c = _colorFor(path, false)
im.ImDrawList_AddRectFilled(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(c))
im.ImDrawList_AddRect(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(im.ImVec4(0,0,0,0.35)))
im.ImDrawList_AddRectFilled(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(c))
im.ImDrawList_AddRect(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(im.ImVec4(0,0,0,0.35)))
im.ImDrawList_AddRectFilled(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(c))
im.ImDrawList_AddRect(dl, im.ImVec2(r.x, r.y), im.ImVec2(r.x+r.w, r.y+r.h), im.GetColorU322(im.ImVec4(0,0,0,0.35)))
if assetTreemapState.selectedPath == path then
im.ImDrawList_AddRect(dl, im.ImVec2(r.x+1, r.y+1), im.ImVec2(r.x+r.w-1, r.y+r.h-1), im.GetColorU322(im.ImVec4(1,1,1,0.9)), 0, 0, 2.0)
end
if assetTreemapState.selectedPath == path then
im.ImDrawList_AddRect(dl, im.ImVec2(r.x+1, r.y+1), im.ImVec2(r.x+r.w-1, r.y+r.h-1), im.GetColorU322(im.ImVec4(1,1,1,0.9)), 0, 0, 2.0)
end
if interacted < cap and r.w >= minPx and r.h >= minPx then
im.SetCursorScreenPos(im.ImVec2(r.x, r.y))
im.InvisibleButton("##tm_rect_flat_nomerge_"..i, im.ImVec2(r.w, r.h))
im.SetCursorScreenPos(im.ImVec2(r.x, r.y))
im.InvisibleButton("##tm_rect_flat_nomerge_"..i, im.ImVec2(r.w, r.h))
interacted = interacted + 1
if useVeh == true then btnText = "Check current level" else btnText = "Check current vehicle" end
if im.Button(btnText, im.ImVec2(220* im.uiscale[0],0)) then
if useVeh == false then useVeh = true else useVeh = false end
if im.Button("Scan Assets", im.ImVec2(140* im.uiscale[0],0)) then
im.OpenPopup("Progress")
if w > 0 then
local min = im.ImVec2(x, y)
local max = im.ImVec2(x + w, y + barH)
local min = im.ImVec2(x, y)
local max = im.ImVec2(x + w, y + barH)
im.ImDrawList_AddRectFilled(dl, min, max, im.GetColorU322(colors[k]))
im.SetCursorScreenPos(min)
im.InvisibleButton("##seg_" .. k .. "_" .. i, im.ImVec2(w, barH))
local hovered = im.IsItemHovered()
end
im.Dummy(im.ImVec2(barW, barH))
im.Text("Disk usage breakdown")
im.PushStyleColor2(im.Col_PlotHistogram, colors[key])
im.ProgressBar(b/total, im.ImVec2(w, 0))
im.PopStyleColor(1)
local w = im.GetContentRegionAvailWidth()
im.ProgressBar(usedT/usedTotal, im.ImVec2(w, 0), "Textures")
im.Spacing()
if im.BeginChild1("asset_tree", im.ImVec2(0, topH), true) then
_drawTreeList(root, (resExplorer[3] and resExplorer[3].diskBytes) or root.bytes or 1)
im.SetCursorScreenPos(spPos)
im.InvisibleButton("##asset_splitter", im.ImVec2(splitterWidth, splitterThickness))
local hovered = im.IsItemHovered()
local dl = im.GetWindowDrawList()
im.ImDrawList_AddRectFilled(dl, spPos, im.ImVec2(spPos.x + splitterWidth, spPos.y + splitterThickness), im.GetColorU322(im.ImVec4(0.3,0.3,0.3,1.0)))
if im.BeginChild1("treemap_canvas", im.ImVec2(0, bottomH), true) then
_drawTreemapGrid(root)
if useVeh == true then btnText = "Check current level" else btnText = "Check current vehicle" end
if im.Button(btnText, im.ImVec2(220* im.uiscale[0],0)) then
if useVeh == false then useVeh = true else useVeh = false end
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-180* im.uiscale[0], 0))
im.SameLine()
im.Text("Select one of these tools to generate information about materials loaded by this level.")
if im.Button("Check materials version", im.ImVec2(152* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Verify duplicates", im.ImVec2(120* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Remove pid", im.ImVec2(121* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Convert to PNG", im.ImVec2(121* im.uiscale[0],0)) then
editor_fileDialog.openFile(
end
if im.Button("Check texture map", im.ImVec2(131* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Check texture files", im.ImVec2(131* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Check missing mats", im.ImVec2(131* im.uiscale[0],0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Remove dummy mats", im.ImVec2(140* im.uiscale[0],0)) then
im.OpenPopup("Progress")
local buttonSize = 140* im.uiscale[0]
if im.Button("Loaded TSStatics", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Available ForestItems", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Loaded Terrains", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Used Materials", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
end
if im.Button("Unused Materials", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Unused Meshes", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Unused Textures", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
im.SameLine()
if im.Button("Collision Data", im.ImVec2(buttonSize,0)) then
im.OpenPopup("Progress")
editor.addWindowMenuItem("Resources Checker", onWindowMenuItem)
editor.registerWindow(toolWindowName, im.ImVec2(500, 300))
editor.registerWindow(imageWindowName, im.ImVec2(256, 256))
editor.registerWindow(toolWindowName, im.ImVec2(500, 300))
editor.registerWindow(imageWindowName, im.ImVec2(256, 256))
editor.registerWindow(duplicateResolverWindowName, im.ImVec2(500, 300))
editor.registerWindow(imageWindowName, im.ImVec2(256, 256))
editor.registerWindow(duplicateResolverWindowName, im.ImVec2(500, 300))
end
@/lua/ge/extensions/editor/dynamicDecals/docs.lua
im.GetWindowDrawList(),
im.ImVec2(wpos.x + cPos.x - itemInnerSpacing - itemSpacing.x, wpos.y + cPos.y - itemSpacing.y/2 - scrollY),
im.ImVec2(wpos.x + cPos.x - itemInnerSpacing, wpos.y + cPos.y + im.GetFontSize() + itemSpacing.y - scrollY),
im.ImVec2(wpos.x + cPos.x - itemInnerSpacing - itemSpacing.x, wpos.y + cPos.y - itemSpacing.y/2 - scrollY),
im.ImVec2(wpos.x + cPos.x - itemInnerSpacing, wpos.y + cPos.y + im.GetFontSize() + itemSpacing.y - scrollY),
im.GetColorU322(editor.color.beamng.Value)
img.tex:getID(),
im.ImVec2(sizeX, sizeY),
nil, nil, nil,
local function verticalSpacing()
im.Dummy(im.ImVec2(0, editor.getPreference("dynamicDecalsTool.docs.verticalSpacing")))
end
verticalSpacing()
if im.Button("Dynamic Decals Thread [Link]", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then openWebBrowser("https://www.beamng.com/threads/experimental-dynamic-decals.95559/") end
verticalSpacing()
local function controlsGui(docsSection)
-- local spacing = im.ImVec2(1, im.GetStyle().ItemSpacing.y * 2)
editor.registerWindow(windowName, im.ImVec2(640, 640))
@/lua/ge/extensions/editor/shortcutLegend.lua
-- Overwrite the last SameLine()
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 2))
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 2))
end
end
local topLeft = im.ImVec2(im.GetWindowPos().x + im.GetCursorPos().x - padding.x, im.GetWindowPos().y + im.GetCursorPos().y - im.GetScrollY())
local bottomRight = im.ImVec2(topLeft.x + im.CalcTextSize(controlName).x + 2 * padding.x, topLeft.y + im.CalcTextSize(controlName).y + padding.y)
local topLeft = im.ImVec2(im.GetWindowPos().x + im.GetCursorPos().x - padding.x, im.GetWindowPos().y + im.GetCursorPos().y - im.GetScrollY())
local bottomRight = im.ImVec2(topLeft.x + im.CalcTextSize(controlName).x + 2 * padding.x, topLeft.y + im.CalcTextSize(controlName).y + padding.y)
im.SameLine()
im.Dummy(im.ImVec2(20, 0))
im.SameLine()
@/lua/ge/extensions/editor/fileDialog.lua
local ratio = imgSize.x / imgSize.y
local tooltipThumbnailSize = im.ImVec2(maxImageSize, maxImageSize)
local maxTooltipThumbnailSize = 256
im.Image(getTempTextureObj().texId, im.ImVec2(sizex, sizex), nil, nil, nil, im.ImVec4(1,1,1,1))
end
if file.filetype == "dir" then
editor.uiIconImage(editor.icons.folder, im.ImVec2(im.GetFontSize(), im.GetFontSize()))
im.SameLine()
if fileTypeIcons[file.extension] then
editor.uiIconImage(fileTypeIcons[file.extension], im.ImVec2(im.GetFontSize(), im.GetFontSize()))
else
else
editor.uiIconImage(editor.icons.ab_asset_json, im.ImVec2(im.GetFontSize(), im.GetFontSize()))
end
im.PushStyleColor2(im.Col_Button, im.ImVec4(0,0,0,0))
if editor.uiIconImageButton(editor.icons.arrow_upward, im.ImVec2(25 * im.uiscale[0], 25 * im.uiscale[0])) then
local lastSep = currentPath:reverse():find("/", 2)
local pathPointer = im.ArrayChar(512, currentPath)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, im.GetStyle().ItemSpacing.y))
if im.InputText("##filepath", pathPointer, nil, im.InputTextFlags_EnterReturnsTrue) then
im.SameLine()
if editor.uiIconImageButton(editor.icons.arrow_downward, im.ImVec2(25 * im.uiscale[0], 25 * im.uiscale[0])) then
recentDirsWindowPos = im.ImVec2(im.GetWindowPos().x + xpos, im.GetWindowPos().y + im.GetCursorPosY() - im.GetStyle().ItemSpacing.y)
if editor.uiIconImageButton(editor.icons.arrow_downward, im.ImVec2(25 * im.uiscale[0], 25 * im.uiscale[0])) then
recentDirsWindowPos = im.ImVec2(im.GetWindowPos().x + xpos, im.GetWindowPos().y + im.GetCursorPosY() - im.GetStyle().ItemSpacing.y)
recentDirsWindowWidth = width
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (25 * im.uiscale[0]))
if editor.uiIconImageButton(editor.icons.create_new_folder, im.ImVec2(25 * im.uiscale[0], 25 * im.uiscale[0])) then
ffi.copy(textinputNewFolder, "")
local buttonSize = im.GetItemRectSize()
im.SetNextWindowPos(im.ImVec2(buttonPos.x, buttonPos.y + buttonSize.y), im.Cond_FirstUseEver)
if im.BeginPopupModal("Error##FileDialog_ErrorPopup", nil, im.WindowFlags_AlwaysAutoResize) then
im.BeginChild1("##GuiChild1", im.ImVec2(0, - im.GetTextLineHeightWithSpacing() - im.GetStyle().ItemSpacing.y), true)
if withPreview == true and selectedFile then
local width = im.CalcItemWidth()
smartSearchWindowPos = im.ImVec2(im.GetWindowPos().x + posX, im.GetWindowPos().y + im.GetCursorPosY() + 2)
smartSearchWindowSize = im.ImVec2(width, 100)
smartSearchWindowPos = im.ImVec2(im.GetWindowPos().x + posX, im.GetWindowPos().y + im.GetCursorPosY() + 2)
smartSearchWindowSize = im.ImVec2(width, 100)
if ffi.string(textinput) ~= "" then
end
im.SetNextWindowSize(im.ImVec2(recentDirsWindowWidth, 23 * im.uiscale[0] * tableSize(recentDirs) + 5))
--TODO: convert to modal popup
getTempTextureObj().texId,
im.ImVec2(sizex, sizey),
nil, nil, nil,
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(640, 480))
editor.registerWindow(recentDirsWindowName)
@/lua/ge/extensions/editor/gen/ui.lua
-- 't_shape',
-- s_block = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,.86)},
-- tetromino = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- 't_shape',
-- s_block = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,.86)},
-- tetromino = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- s_block = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,.86)},
-- tetromino = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- s_block = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,.86)},
-- tetromino = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
sh_square = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_hexa = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_square = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_hexa = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_diamond = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_hexa = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_diamond = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_u = {im.ImVec2(1.25,1.25), nil, 'p_shape'},
sh_diamond = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_u = {im.ImVec2(1.25,1.25), nil, 'p_shape'},
sh_t = {im.ImVec2(1.25,1.25), nil, 't_shape'},
sh_u = {im.ImVec2(1.25,1.25), nil, 'p_shape'},
sh_t = {im.ImVec2(1.25,1.25), nil, 't_shape'},
sh_cross = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
sh_t = {im.ImVec2(1.25,1.25), nil, 't_shape'},
sh_cross = {im.ImVec2(0.96,0.98), nil, 'b_shape'},
--[[
--[[
b_shape = {im.ImVec2(-0.2,0), im.ImVec2(1.2,0.9)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
--[[
b_shape = {im.ImVec2(-0.2,0), im.ImVec2(1.2,0.9)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
b_shape = {im.ImVec2(-0.2,0), im.ImVec2(1.2,0.9)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
b_shape = {im.ImVec2(-0.2,0), im.ImVec2(1.2,0.9)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
l_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
s_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
t_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
s_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
s_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
]]
p_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
s_shape = {im.ImVec2(0.3,0.3), im.ImVec2(0.7,0.7)},
]]
balcony = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
balcony = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
balcony = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
balcony = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
corner = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
pillar = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
opened_door = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
pilaster = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
stairs = {im.ImVec2(0,0), im.ImVec2(1,1)},
stringcourse = {im.ImVec2(0,0), im.ImVec2(1,1)},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
stairs = {im.ImVec2(0,0), im.ImVec2(1,1)},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
stairs = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- stairs = {im.ImVec2(0.8,0.8), nil},
storefront = {im.ImVec2(0,0), im.ImVec2(1,1)},
stairs = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- stairs = {im.ImVec2(0.8,0.8), nil},
stairs = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- stairs = {im.ImVec2(0.8,0.8), nil},
-- stairs = {im.ImVec2(-0.2,0.2), im.ImVec2(1.2,1.2)},
-- stairs = {im.ImVec2(0.8,0.8), nil},
-- stairs = {im.ImVec2(-0.2,0.2), im.ImVec2(1.2,1.2)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
-- stairs = {im.ImVec2(0.8,0.8), nil},
-- stairs = {im.ImVec2(-0.2,0.2), im.ImVec2(1.2,1.2)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
-- stairs = {im.ImVec2(-0.2,0.2), im.ImVec2(1.2,1.2)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
-- stairs = {im.ImVec2(-0.2,0.2), im.ImVec2(1.2,1.2)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
--[[
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
--[[
--[[
roof_flat = {im.ImVec2(1,1), nil, 'roof_flat'},
roof_pyramid = {im.ImVec2(1,1), nil},
roof_flat = {im.ImVec2(1,1), nil, 'roof_flat'},
roof_pyramid = {im.ImVec2(1,1), nil},
roof_shed = {im.ImVec2(1,1), nil},
roof_pyramid = {im.ImVec2(1,1), nil},
roof_shed = {im.ImVec2(1,1), nil},
roof_gable = {im.ImVec2(1,1), nil},
roof_shed = {im.ImVec2(1,1), nil},
roof_gable = {im.ImVec2(1,1), nil},
]]
roof_flat = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_flat = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_flat = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_flat = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_gable = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_pyramid = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_gable = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_gable = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_shed = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_gable = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_ridge = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_border = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_ridge = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_border = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_ridge = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_border = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_ridge = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_border = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_chimney = {im.ImVec2(0,0), im.ImVec2(1,1)},
roof_chimney = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- roof_gutter = {im.ImVec2(0,0), im.ImVec2(1,1)},
gutter2 = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- roof_gutter = {im.ImVec2(0,0), im.ImVec2(1,1)},
gutter2 = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- roof_gutter = {im.ImVec2(0,0), im.ImVec2(1,1)},
gutter2 = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- roof_gutter = {im.ImVec2(0,0), im.ImVec2(1,1)},
gutter2 = {im.ImVec2(0,0), im.ImVec2(1,1)},
width_fit = {im.ImVec2(0,0), im.ImVec2(1,1)},
width_fit = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- window = {im.ImVec2(-0.2,-0.2), im.ImVec2(1.2,1.2)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(-0.2,-0.2), im.ImVec2(1.2,1.2)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(-0.2,-0.2), im.ImVec2(1.2,1.2)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- window = {im.ImVec2(-0.2,-0.2), im.ImVec2(1.2,1.2)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- win2 = {im.ImVec2(0,0), im.ImVec2(1,1), suf = '.jpg'},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- t_shape = {im.ImVec2(0.2,0.2), im.ImVec2(0.8,0.8)},
-- window = {im.ImVec2(0,0), im.ImVec2(1,1)},
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- t_shape = {im.ImVec2(0.2,0.2), im.ImVec2(0.8,0.8)},
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- t_shape = {im.ImVec2(0.2,0.2), im.ImVec2(0.8,0.8)},
-- "/art/dynamicDecals/textures/00_color_palette_test.png",
-- t_shape = {im.ImVec2(0.12,0.12), im.ImVec2(0.86,0.86)},
-- t_shape = {im.ImVec2(0.2,0.2), im.ImVec2(0.8,0.8)},
-- "/art/dynamicDecals/textures/00_color_palette_test.png",
if not editor.isWindowRegistered('BAT') then
editor.registerWindow("BAT") --, im.ImVec2(200, 700))
end
if not editor.isWindowRegistered('LAT') then
editor.registerWindow("LAT") --, im.ImVec2(200, 700))
end
if not editor.isWindowRegistered('TEST') then
editor.registerWindow("TEST") --, im.ImVec2(200, 700))
end
if editor.uiIconImageButton(v.icon, --editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
topLeft.y = topLeft.y + cur.y
local bottomRight = im.ImVec2(topLeft.x + 100, topLeft.y + 20)
local color = im.GetColorU321(im.Col_WindowBg)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), topLeft, bottomRight, color)
im.Dummy(im.ImVec2(0,0))
end
-- lo('?? TL:'..topLeft.x..':'..topLeft.y)
-- topLeft = im.ImVec2(-461,277)
-- topLeft.x = topLeft.x - 50
-- topLeft.x = topLeft.x - 50
-- local bottomRight = im.ImVec2(topLeft.x + sz.x + 2*padding, topLeft.y + 20)
-- local color = im.GetColorU322(im.ImVec4(1.0, 0.0, 0.0, 1.0))
local ptr = im[tp..'Ptr'](env.ui[key] or 0)
im.Dummy(im.ImVec2(0, 0))
local ptr = im[tp..'Ptr'](env.ui[key] or 0)
im.Dummy(im.ImVec2(0, 0))
if editor.uiIconImageButton(editor.icons[icon], --editor.icons.forest_select,
im.ImVec2(30, 30), c,
nil, bgcolor, 'MultiSelectButton') then
cbg = cbg or im.ImVec4(0.7, 0.7, 0., 1)
dim = dim or im.ImVec2(62,22)
-- cbg = im.ImVec4(0.7, 0.7, 0., 1)
-- if im.ColorButton('ib'..i, im.ImVec4(0.6, 0.0, 0.0, 1)) then
if not dim then dim = im.ImVec2(37,37) end
-- if not cbg then cbg = im.ImVec4(0.2, 0.2, 0.2, 1) end
if not c then
im.Dummy(im.ImVec2(0, 0))
if im.Button(lbl) then
--[[
if im.InvisibleButton(lbl, im.ImVec2(30, 30)) then
env.onVal(key, lbl)
]]
-- dim = im.ImVec2(64,64)
im.SameLine()
dim,
-- im.ImVec2(0,0), im.ImVec2(0.5,0.5))
aicon[lbl][2] and aicon[lbl][1] or im.ImVec2(aicon[lbl][1].x-1,aicon[lbl][1].y-1),
dim,
-- im.ImVec2(0,0), im.ImVec2(0.5,0.5))
aicon[lbl][2] and aicon[lbl][1] or im.ImVec2(aicon[lbl][1].x-1,aicon[lbl][1].y-1),
-- im.ImVec2(0,0), im.ImVec2(0.5,0.5))
aicon[lbl][2] and aicon[lbl][1] or im.ImVec2(aicon[lbl][1].x-1,aicon[lbl][1].y-1),
aicon[lbl][2] and aicon[lbl][2] or im.ImVec2(2-aicon[lbl][1].x,2-aicon[lbl][1].y),
aicon[lbl][2] and aicon[lbl][1] or im.ImVec2(aicon[lbl][1].x-1,aicon[lbl][1].y-1),
aicon[lbl][2] and aicon[lbl][2] or im.ImVec2(2-aicon[lbl][1].x,2-aicon[lbl][1].y),
c,
-- im.Text(' ')
im.Dummy(im.ImVec2(0, 16))
buttonT('CLEAR', 'gen_clear', im.ImVec4(0.7, 0.1, 0.1, 1), im.ImVec4(0.77, 0.75, 0.65, 1), nil, true)
slider('Exit width', 'exit_w', {2, 10})
-- im.Dummy(im.ImVec2(0, 6))
check('Roundabout', 'junction_round')
W.ui.conf_all = W.out.D.out.inall or false
im.Dummy(im.ImVec2(0, 6))
check('For all', 'conf_all')
im.Dummy(im.ImVec2(0, 26))
im.TextColored(colorNav, 'Hint')
if editor.uiIconImageButton(editor.icons.terrain_tools,
im.ImVec2(30, 30), color,
nil, bgcolor, 'MultiSelectButton') then
-- if editor.beginWindow("PANE", "City Editor") then
im.Dummy(im.ImVec2(0, 0))
im.SameLine()
-- im.PushFont3("cairo_semibold_small")
-- im.Dummy(im.ImVec2(0, 2))
im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(0, 2))
im.Dummy(im.ImVec2(0, 0))
for k,s in pairs({'rectangle','hexagon','corner_cut','u_shape','t_shape','x_shape'}) do
im.SameLine()
local dim = im.ImVec2(37,37)
local key = ashape[k]
]]
-- im.Dummy(im.ImVec2(10, 0))
--[[
--!! im.Dummy(im.ImVec2(0, 4))
-- local opacity = (scope == 'building') and 1 or 0.4
-- local ctxt = (scope == 'building') and im.ImVec4(0.1, 0.1, 0.1, 1) or colorOff
-- buttonT('Clone', 'floor_clone', im.ImVec4(0.9, 0.9, 0.9, 1), im.ImVec4(0.47, 0.45, 0.45, 1), nil, true) --, nil, im.ImVec2(67,47))
]]
-- buttonT('Export', 'dae_export', ctxt, im.ImVec4(0.25, 0.25, 0.25, 1), im.ImVec2(50,20))
--[[
--[[
im.Dummy(im.ImVec2(0, 6))
combo('Style', 'building_style', {'','traditional/regional','modern', 'classic/monumental','functional','contemporary','decorative','historical'})
combo('Style', 'building_style', {'','traditional/regional','modern', 'classic/monumental','functional','contemporary','decorative','historical'})
im.Dummy(im.ImVec2(0, 41))
inputLeft('Seed', 'seed', true)
-- im.Columns(0)
-- im.Dummy(im.ImVec2(0, 12))
im.Columns(0)
im.Dummy(im.ImVec2(0, 12))
im.TreePop()
]]
im.Dummy(im.ImVec2(0, 8))
-- im.Separator()
-- im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
-- im.SameLine()
-- im.Dummy(im.ImVec2(8, 0))
im.Separator()
-- im.TextColored(colorNav, 'Scope:')
im.Dummy(im.ImVec2(8, 0))
im.Indent(8)
im.Indent(6)
im.Dummy(im.ImVec2(6, 0))
-- im.Indent(10)
-- im.Dummy(im.ImVec2(10, 0))
-- if im.ColorButton('ib'..i, im.ImVec4(0.6, 0.0, 0.0, 1)) then
if im.InvisibleButton('ib'..i, im.ImVec2(width + 5, 20)) then
-- lo('?? cclick'..i..':'..t)
-- im.SameLine()
-- im.Dummy(im.ImVec2(6, 0))
-- im.Indent(2)
-- im.SameLine()
-- im.Dummy(im.ImVec2(6, 0))
local ishidden = W.isHidden()
if editor.uiIconImageButton(ishidden and editor.icons.visibility_off or editor.icons.visibility,
im.ImVec2(24, 24), im.ImVec4(0.7, 0.7, 0.7, 0.8),
nil, nil, 'MultiSelectButton') then
im.SameLine()
im.Dummy(im.ImVec2(0, 0))
-- im.Indent(6)
if editor.uiIconImageButton(editor.icons.backspace,
im.ImVec2(24, 24), im.ImVec4(0.9, 0.3, 0.3, 0.8),
nil, nil, 'MultiSelectButton') then
if _dbgone then return end
im.Dummy(im.ImVec2(0, 10))
im.Dummy(im.ImVec2(2, 0))
im.Dummy(im.ImVec2(0, 10))
im.Dummy(im.ImVec2(2, 0))
if im.BeginListBox('', im.ImVec2(-1, 160)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(-1, 200)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
if im.BeginListBox('', im.ImVec2(-1, 160)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(-1, 200)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
if im.BeginListBox('', im.ImVec2(-1, 160)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(-1, 200)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
if im.BeginListBox('', im.ImVec2(-1, 160)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(-1, 200)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(-1, 200)) then --, im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- if im.BeginListBox('', im.ImVec2(333, 180), im.WindowFlags_ChildWindow) then
-- im.Columns(6, "jctListBoxColumns", true)
im.Dummy(im.ImVec2(0, 2))
im.Columns(3, 'UV', false)
slider(nil, 'uv_scale', {0.2,5})
-- im.Dummy(im.ImVec2(0, -10))
im.SameLine()
if editor.uiIconImageButton(editor.icons.refresh,
im.ImVec2(24, 24), im.ImVec4(0.5, 0.7, 0.5, 1),
nil, nil, 'MultiSelectButton') then
]]
im.Dummy(im.ImVec2(0, 2))
im.Separator()
-- im.Dummy(im.ImVec2(0, 4))
im.Dummy(im.ImVec2(0, 2))
-- im.Dummy(im.ImVec2(0, 4))
im.Dummy(im.ImVec2(0, 2))
-- im.Dummy(im.ImVec2(0, 0))
-- im.SameLine()
if editor.uiIconImageButton(editor.icons.check_box_outline_blank,
im.ImVec2(34, 34), colorOn,
nil, nil, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.data_usage,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
im.SameLine()
buttonC('roof_ridge', 'roof_ridge', color, im.ImVec2(30, 30))
im.tooltip('Ridge toggle')
-- color = scope == 'top' and W.ifRoof('flat') and colorOn or colorOff
buttonC('roof_border', 'roof_border', color, im.ImVec2(30, 30))
im.tooltip('Border toggle')
-- color = W.ifForest({'roofborder'}) and colorOn or colorOff
buttonC('gutter2', 'gutter', color, im.ImVec2(30, 30))
im.tooltip('Gutter toggle')
im.SameLine()
buttonC('roof_chimney', 'roof_chimney', colorOff, im.ImVec2(30, 30))
im.tooltip('Chimney toggle')
-- color = im.ImVec4(0.7, 0.7, 0.75, 1)
buttonCC('roof_'..s, 'roof_'..s, color, im.ImVec2(30, 30))
im.tooltip(s)
local dim = im.ImVec2(30, 30)
local cbg = nil
im.SameLine()
buttonC('roof_'..s, 'roof_'..s, color, im.ImVec2(30, 30))
im.tooltip(s)
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, nil, 'MultiSelectButton') then
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(0, 60))
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(0, 60))
-- im.SameLine()
-- im.Separator()
-- im.Dummy(im.ImVec2(-10, -10))
im.Indent(10)
im.Dummy(im.ImVec2(10, -10))
-- im.Columns(1, "eSelRow1", true)
im.Dummy(im.ImVec2(2, 0))
if true then
-------------------------
-- buttonC('window', 'win_toggle', colorOn, im.ImVec2(34, 34))
if editor.uiIconImageButton(editor.icons.web_asset, --icons.picture_in_picture, --.forest_select,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton') then
bgcolor = W.ifForest({'win'}) and bgActive or nil
buttonC('window3', 'win_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Window toggle')
bgcolor = W.ifForest({'door'}) and bgActive or nil
buttonC('opened_door', 'door_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Door toggle')
bgcolor = W.ifForest({'storefront'}) and bgActive or nil
buttonC('storefront', 'storefront_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Store front toggle')
bgcolor = W.ifForest({'balcony'}) and bgActive or nil
buttonC('balcony', 'balc_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Balcony toggle')
bgcolor = W.ifForest({'corner'}) and bgActive or nil
buttonC('corner', 'corner_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Corner toggle')
bgcolor = W.ifForest({'stringcourse'}) and bgActive or nil
buttonC('stringcourse', 'stringcourse_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('String course toggle')
bgcolor = W.ifForest({'plinth'}) and bgActive or nil
buttonC('roof_border', 'plinth_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Plinth toggle')
bgcolor = W.ifForest({'pillar'}) and bgActive or nil
buttonC('pillar', 'pillar_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Pillar togglee')
bgcolor = W.ifForest({'pilaster'}) and bgActive or nil
buttonC('pilaster', 'pilaster_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Pilaster toggle')
bgcolor = W.ifForest({'stairs'}) and bgActive or nil
buttonC('stairs', 'stairs_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Stair toggle')
bgcolor = W.ifForest({'firestairs'}) and bgActive or nil
buttonC('stairs', 'firestairs_toggle', color, im.ImVec2(30, 30), bgcolor)
im.tooltip('Fire-stairs toggle')
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton', nil, nil) then
if editor.uiIconImageButton(editor.icons.account_balance, --.forest_select,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton', nil, nil, function()
if editor.uiIconImageButton(editor.icons.account_balance,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton', nil, nil, function()
-- placeholder
im.InvisibleButton('ib_TYPES', im.ImVec2(34, 34))
end
-- im.SameLine()
-- im.Dummy(im.ImVec2(142, 0))
-- im.SameLine()
if editor.uiIconImageButton(editor.icons.roadRefPathDecal, --urbanRoad3To2Merge02, --.terrain_tools,
im.ImVec2(30, 30), color,
nil, bgcolor, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.domain,
im.ImVec2(30, 30), color,
nil, bgcolor, 'PopulateButton') then
if false and editor.uiIconImageButton(editor.icons.terrain_tools,
im.ImVec2(30, 30), color,
nil, bgcolor, 'MultiSelectButton') then
color = (W.ifForest({'win'}) and W.forSpline()) and colorOn or colorOff
buttonC('width_fit', 'win_spacefit', color, im.ImVec2(30, 30))
im.tooltip('Regular intervals')
-- im.NextColumn()
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(182, 0))
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(182, 0))
-- CONFORM
if editor.uiIconImageButton(editor.icons.terrain_tools,
im.ImVec2(30, 30), color,
nil, bgcolor, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.forest_select,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton') then
if editor.uiIconImageButton(editor.icons.account_balance,
im.ImVec2(34, 34), color,
nil, bgcolor, 'MultiSelectButton', nil, nil, function()
im.Columns(0)
im.Dummy(im.ImVec2(0, 10))
im.Indent(8)
-- 320
im.BeginChild1('CONTROLS', im.ImVec2(im.GetWindowWidth(), im.GetWindowHeight() - vspace), false)
-- im.Indent(8)
im.NextColumn()
im.Dummy(im.ImVec2(0, 6))
im.Dummy(im.ImVec2(2, 0))
im.Dummy(im.ImVec2(0, 6))
im.Dummy(im.ImVec2(2, 0))
im.SameLine()
-- road controls
im.Dummy(im.ImVec2(0, 10))
im.Dummy(im.ImVec2(2, 0))
im.Dummy(im.ImVec2(0, 10))
im.Dummy(im.ImVec2(2, 0))
im.SameLine()
im.Columns(1)
im.Dummy(im.ImVec2(0, 6))
im.TextColored(colorNav, 'Middle Line:')
im.SameLine()
im.Dummy(im.ImVec2(12, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(12, 0))
im.SameLine()
-- im.Separator()
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
-- im.Indent(-4)
end
buttonC('width_fit', 'hole_fitmesh', colorOn, im.ImVec2(30, 30))
im.tooltip('Match mesh size')
-- im.tooltip('Match mesh size')
-- buttonC('width_fit', 'hole_fitmesh', nil, im.ImVec2(30, 30))
elseif cforest then
-- im.Unindent(4)
-- im.Dummy(im.ImVec2(20, 0))
if false then
-- im.SetColumnWidth(1, width)
im.Dummy(im.ImVec2(0, 10))
im.Text('Balcony spacing')
im.Columns(1)
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0))
im.NextColumn()
buttonC('width_fit', 'win_fitx', nil, im.ImVec2(30, 30))
-- button('Match width', 'pillar_span', 'compare_arrows')
-- check('Fill width', 'pillar_span')
buttonCC('width_fit', 'pillar_span', nil, im.ImVec2(30, 30))
-- buttonC('Fill width', 'pillar_span', nil, im.ImVec2(30, 30))
buttonCC('width_fit', 'pillar_span', nil, im.ImVec2(30, 30))
-- buttonC('Fill width', 'pillar_span', nil, im.ImVec2(30, 30))
-- button('Match width', 'pillar_span', 'compare_arrows')
im.Columns(0)
im.Dummy(im.ImVec2(0, 12))
-- BASEMENT
-- im.Dummy(im.ImVec2(0, 6))
-- im.Separator()
-- im.Separator()
im.Dummy(im.ImVec2(0, 4))
end
im.Dummy(im.ImVec2(0, 4))
im.Indent(conf.inputMargin)
if cij[1] ~= 1 or (desc and not (desc.basement and desc.basement.yes)) then
buttonT('Clone', 'floor_clone', im.ImVec4(0.9, 0.9, 0.9, 1), im.ImVec4(0.47, 0.45, 0.45, 1), nil, true) --, nil, im.ImVec2(67,47))
end
im.Unindent(conf.inputMargin)
-- buttonC('Clone', 'floor_clone', nil, im.ImVec2(67,47))
-- if W.out.inaxis then
end
im.Dummy(im.ImVec2(0, 6))
if U._PRD == 0 then
W.ui.conf_all = W.out.D.out.inall or false
im.Dummy(im.ImVec2(0, 6))
check('For all', 'conf_all')
slider('Exit width', 'exit_w', {2, 10})
-- im.Dummy(im.ImVec2(0, 6))
check('Roundabout', 'junction_round')
-- im.Dummy(im.ImVec2(0, 26))
im.TextColored(colorNav, 'Hint') --..tableSize(HTree[3]))
-- im.SameLine()
-- im.Dummy(im.ImVec2(12, 10))
-- im.SameLine()
if i == 1 then
im.Dummy(im.ImVec2(0, 0))
else
else
im.Dummy(im.ImVec2(0, 24))
end
im.Separator()
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 30))
-- im.SameLine()
im.Text('')
im.Dummy(im.ImVec2(0, 0))
end
end
-- im.Dummy(im.ImVec2(0, 4))
-- im.SameLine()
-- lo('?? for_pos:'..topLeft.x..':'..topLeft.y)
-- topLeft = im.ImVec2(-461,377)
topLeft.x = topLeft.x + cur.x - padding
local color = im.GetColorU321(im.Col_FrameBg)
local bottomRight = im.ImVec2(topLeft.x + sz.x + 2*padding, topLeft.y + 20)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(topLeft.x, topLeft.y), bottomRight,
-- topLeft, bottomRight,
im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
end
-- im.Dummy(im.ImVec2(8, 0))
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
-- im.SameLine()
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
end
end
-- im.Dummy(im.ImVec2(0, 10))
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 2))
-- im.Separator()
-- im.Separator()
-- im.Dummy(im.ImVec2(0, 2))
im.Columns(1)
im.Dummy(im.ImVec2(0, 20))
-- im.Separator()
local colorHelp = im.ImVec4(0.7, 0.7, 0.1, 0.6)
im.Dummy(im.ImVec2(0, 6))
im.Dummy(im.ImVec2(2, 0))
im.Dummy(im.ImVec2(0, 6))
im.Dummy(im.ImVec2(2, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(3, 0))
im.SameLine()
im.TextColored(colorHelp, 'CLICK: split WHEEL: slope angle L/R: turn')
im.Dummy(im.ImVec2(3, 0))
im.SameLine()
-- local spacing = im.ImVec2(500, 20)
-- im.Dummy(spacing)
if i == 1 then
im.Dummy(im.ImVec2(0, 0))
else
else
im.Dummy(im.ImVec2(0, 24))
end
im.Separator()
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
im.Dummy(im.ImVec2(0, 0))
im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 30))
-- im.SameLine()
im.Text('')
im.Dummy(im.ImVec2(0, 0))
end
end
-- im.Dummy(im.ImVec2(0, 4))
-- im.SameLine()
-- lo('?? for_pos:'..topLeft.x..':'..topLeft.y)
-- topLeft = im.ImVec2(-461,377)
topLeft.x = topLeft.x + cur.x - padding
local color = im.GetColorU321(im.Col_FrameBg)
local bottomRight = im.ImVec2(topLeft.x + sz.x + 2*padding, topLeft.y + 20)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(topLeft.x, topLeft.y), bottomRight,
-- topLeft, bottomRight,
im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
end
-- im.Dummy(im.ImVec2(8, 0))
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
-- im.SameLine()
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
end
end
-- im.Dummy(im.ImVec2(0, 10))
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 2))
-- im.Separator()
-- im.Separator()
-- im.Dummy(im.ImVec2(0, 2))
if editor.beginWindow('Materials', 'Materials') then
im.BeginListBox('', im.ImVec2(233, 180), im.WindowFlags_ChildWindow)
im.EndListBox()
local width = im.CalcTextSize(t).x
if im.InvisibleButton('ib'..i, im.ImVec2(width + 5, 20)) then
scope = string.lower(t)
]]
-- local spacing = im.ImVec2(500, 20)
if editor.uiIconImageButton(editor.icons.ab_asset_jbeam,
im.ImVec2(10, 10), im.ImVec4(0.5, 0.7, 0.5, 1),
nil, nil, 'b_scope_'..i,
-- im.Space(20)
-- im.Dummy(im.ImVec2(10, 0))
-- im.SameLine()
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
im.BeginChild1(self.key, im.ImVec2(180 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
if editor.uiInputText('', self.search) then
im.SameLine()
im.BeginChild1("currentElement", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
if self.index then
local removeTag
im.BeginChild1("##child1", im.ImVec2(0, 22), false)
im.SetCursorPosY(im.GetCursorPosY() + 2)
im.EndChild()
im.BeginChild1(t, im.ImVec2(0, 22), false)
im.SetCursorPosY(im.GetCursorPosY() + 2)
@/lua/ge/extensions/editor/flowgraph/stateView.lua
self.filter = im.ImGuiTextFilterPtr()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
end
if running then
editor.uiIconImage(editor.icons.play_circle_filled, im.ImVec2(20, 20))
else
else
editor.uiIconImage(editor.icons.pause_circle_outline, im.ImVec2(20, 20))
end
@/lua/ge/extensions/editor/gen/lib/ui.lua
local aicon = {
car = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
local aicon = {
car = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
car = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
car = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
folder = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
link = {im.ImVec2(0.,0.2), im.ImVec2(1,0.8)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
mglass = {im.ImVec2(0.,0.), im.ImVec2(1,1)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
graph = {im.ImVec2(0.,0.), im.ImVec2(1.05,1.05)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
}
star = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},--, im.ImVec2(0.9,0.9)},
window3 = {im.ImVec2(0.1,0.1), im.ImVec2(0.9,0.9)},
}
topLeft.y = topLeft.y + cur.y
local bottomRight = im.ImVec2(topLeft.x + 100, topLeft.y + 20)
local color = im.GetColorU321(im.Col_WindowBg)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), topLeft, bottomRight, color)
im.Dummy(im.ImVec2(0,0))
end
if not dim then
dim = im.ImVec2(sz.x+16,sz.y + 2)
end
end
if not shift then shift = im.ImVec2(0,0) end
if cbg and type(cbg) == 'table' then
if not dim then
dim = im.ImVec2(37,37)
elseif not dim.x then
elseif not dim.x then
dim = im.ImVec2(dim[1],dim[2])
end
end
if not shift then shift = im.ImVec2(0,0) end
if not c then c = colorOn end
im.Image(dicon[src].tex:getID(),
im.ImVec2(dim.x*scale.x,dim.y*scale.y),
aicon[src][2] and aicon[src][1] or im.ImVec2(aicon[src][1].x-1,aicon[src][1].y-1),
im.ImVec2(dim.x*scale.x,dim.y*scale.y),
aicon[src][2] and aicon[src][1] or im.ImVec2(aicon[src][1].x-1,aicon[src][1].y-1),
aicon[src][2] and aicon[src][2] or im.ImVec2(2-aicon[src][1].x,2-aicon[src][1].y),
aicon[src][2] and aicon[src][1] or im.ImVec2(aicon[src][1].x-1,aicon[src][1].y-1),
aicon[src][2] and aicon[src][2] or im.ImVec2(2-aicon[src][1].x,2-aicon[src][1].y),
c,
local ptr = im[tp..'Ptr'](env.ui[key] or 0)
im.Dummy(im.ImVec2(0, 0))
if not nolabel then
local ptr = im[tp..'Ptr'](env.ui[key] or 0)
im.Dummy(im.ImVec2(0, 0))
if not nolabel then
-- im.TableNextColumn()
-- if im.BeginListBox(111, im.ImVec2(-1,-1)) then
-- im.EndListBox()
M.listBox = function(row, dim, lineH)
if im.BeginListBox('##123', im.ImVec2(-1, -1)) then
im.Columns(2, "folderList", true)
end
M.buttonImg('fav_up', 'star', im.ImVec2(lineH,lineH), colorOff, nil, vec3(0.5,0.5))
im.NextColumn()
im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
local cur = im.GetCursorPos()
cur = im.ImVec2(cur.x+topLeft.x, cur.y+topLeft.y)
local bottomRight = im.ImVec2(cur.x + sz.x + padding+1, cur.y + 25 + padding)
cur = im.ImVec2(cur.x+topLeft.x, cur.y+topLeft.y)
local bottomRight = im.ImVec2(cur.x + sz.x + padding+1, cur.y + 25 + padding)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(cur.x-padding-1, cur.y+padding+4), bottomRight,
cbg)--, 2, nil, 2)
im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
if i == 1 then
im.Dummy(im.ImVec2(0, 0))
else
else
im.Dummy(im.ImVec2(0, 24))
end
im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
-- im.Dummy(im.ImVec2(0, 0))
-- im.Dummy(im.ImVec2(0, 0)) -- add vertical space of 1pt
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 30))
-- im.SameLine()
im.Text('')
im.Dummy(im.ImVec2(0, 0))
end
end
-- im.Dummy(im.ImVec2(0, 4))
-- im.SameLine()
-- lo('?? for_pos:'..topLeft.x..':'..topLeft.y)
-- topLeft = im.ImVec2(-461,377)
topLeft.x = topLeft.x + cur.x - padding
local color = im.GetColorU321(im.Col_FrameBg)
local bottomRight = im.ImVec2(topLeft.x + sz.x + 2*padding, topLeft.y + 20)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(topLeft.x, topLeft.y), bottomRight,
-- topLeft, bottomRight,
im.SameLine()
im.Dummy(im.ImVec2(4, 0))
im.SameLine()
-- im.SameLine()
-- im.Dummy(im.ImVec2(0, 0))
end
@/lua/ge/extensions/editor/vizHelper.lua
local windowWasOpen = false
local initialWindowSize = im.ImVec2(300, 500)
@/lua/ge/extensions/editor/flowgraph/projectSettings.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
end
local editEnded = im.BoolPtr(false)
if editor.uiInputTextMultiline('##prDesc', textinput, 512,im.ImVec2(im.GetContentRegionAvailWidth(),100), nil, nil, nil, editEnded) then
self.mgr.description = ffi.string(textinput)
if self.mgr.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("This project is invisible. You can see it because you have Dev Mode enabled.")
if self.mgr.transient then
editor.uiIconImage(editor.icons.goat, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("This project is transient. It cannot be saved.")
@/lua/ge/extensions/editor/ffiptrleaktest.lua
im.TextUnformatted("ImVec2& vs ImVec2* test")
im.Image(image.tex:getID(), im.ImVec2(256,256), im.ImVec2(0,0), im.ImVec2(1,1));
end
im.TextUnformatted("ImVec2& vs ImVec2* test")
im.Image(image.tex:getID(), im.ImVec2(256,256), im.ImVec2(0,0), im.ImVec2(1,1));
end
im.TextUnformatted("ImVec2& vs ImVec2* test")
im.Image(image.tex:getID(), im.ImVec2(256,256), im.ImVec2(0,0), im.ImVec2(1,1));
end
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(800, 500))
editor.addWindowMenuItem("ffi ptr leak test", onWindowMenuItem, nil, true)
@/lua/ge/extensions/flowgraph/nodes/logic/flowSwitch.lua
local iconImage = self.on and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32))
if im.IsItemClicked() then
@/lua/ge/extensions/editor/headlessEditorTest.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(200, 200))
editor.registerWindow(toolbarWindowName, imgui.ImVec2(500, 200))
editor.registerWindow(toolWindowName, imgui.ImVec2(200, 200))
editor.registerWindow(toolbarWindowName, imgui.ImVec2(500, 200))
editor.addWindowMenuItem("Headless Editor Test", onWindowMenuItem, {groupMenuName="Debug"})
@/lua/ge/extensions/editor/assetDeduplicator.lua
end
im.Image(imgL.tex:getID(), im.ImVec2(sizex, sizey), nil, nil, nil, editor.color.white.Value)
else
end
im.Image(imgR.tex:getID(), im.ImVec2(sizex, sizey), nil, nil, nil, editor.color.white.Value)
else
local outerSize = im.ImVec2(im.GetWindowSize().x-(10*im.uiscale[0]), im.GetWindowSize().y-(160*im.uiscale[0]))
if im.BeginTable("matchesTable", 3, tableFlags, outerSize) then
local icon = isSelected and iconCheck or iconClose
if editor.uiIconImageButton(icon, im.ImVec2(24, 24), nil, nil, nil, "sel_" .. tostring(i) .. "_" .. tostring(name)) then
toggled = true
editor.addWindowMenuItem("Asset Deduplicator", onWindowMenuItem, {groupMenuName = 'Assets'})
editor.registerWindow(toolWindowName, im.ImVec2(500, 300))
end
@/lua/ge/extensions/editor/terrainAndRoadImporter.lua
local toolWinName, toolWinSize = 'terrainAndRoadImporter', im.ImVec2(200, 200) -- The main tool window of the feature.
local isToolActive = false
-- 'Conform To Peaks' button.
if editor.uiIconImageButton(editor.icons.lineToTerrain, im.ImVec2(34, 34), nil, nil, nil, 'conformToPeaksBtn') then
extensions.editor_fileDialog.openFile(
-- 'Import Terrain' button.
if editor.uiIconImageButton(editor.icons.simobject_terrainblock, im.ImVec2(34, 34), nil, nil, nil, 'importTerrainBtn') then
extensions.editor_fileDialog.openFile(
-- 'Import Roads' button.
if editor.uiIconImageButton(editor.icons.autobahn, im.ImVec2(34, 34), nil, nil, nil, 'importRoadsBtn') then
extensions.editor_fileDialog.openFile(
-- 'Reset' button.
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(34, 34), nil, nil, nil, 'resetBtn') then
reset()
@/lua/ge/extensions/editor/assemblySpline.lua
local min, max = math.min, math.max
local toolWinName, toolWinSize = 'assemblySpline', im.ImVec2(300, 700)
local defaultParams = splineMgr.getDefaultSliderParams()
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 180)) then
im.Columns(4, "splineListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 41225
im.SetColumnWidth(7, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.SetColumnWidth(2, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
-- Tab content.
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
if selectedTab == 0 then
im.NextColumn()
im.Dummy(im.ImVec2(0, 3))
if molecule.rigids and #molecule.rigids > 0 then
im.Dummy(im.ImVec2(0, 5))
im.TextColored(cols.greenB, "Molecule Components:")
im.Columns(1)
im.Dummy(im.ImVec2(0, 5))
im.TextColored(cols.greenB, "Bridge Components:")
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
--im.SetNextWindowDockID(self.fgEditor.dockspaces["NE_Main_Dockspace"])
im.SetNextWindowSize(im.ImVec2(view.size.x, view.size.y), im.Cond_Appearing)
im.PushID1(windowId)
im.PushID1(windowId)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
local windowOpen = im.Begin('Vehicle Detail View - ' .. view.name .. ' - ' .. loadedLayoutBaseFilename, view.windowOpen)
local texObj = imUtils.texObj('#' .. view.name)
im.Image(texObj.texId, im.ImVec2(view.size.x, view.size.y))
handleImageInput(view) -- must come directly after the image
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/vehicleStoppedNearPos.lua
if self.pinIn.duration.value == nil then return end
im.ProgressBar(self.timer / math.max(1e-12, self.pinIn.duration.value), im.ImVec2(50,0))
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua
if tWidth.x < avail.x then
im.Dummy(im.ImVec2((avail.x-tWidth.x)/2 -10,0))
im.SameLine()
if tWidth.x < avail.x then
im.Dummy(im.ImVec2((avail.x-tWidth.x)/2 -10,0))
im.SameLine()
local progress = math.max(0, math.min(1, waitedTime / totalWaitTime))
im.ProgressBar(progress, im.ImVec2(100,0))
else
else
im.ProgressBar(0, im.ImVec2(100,0))
end
elseif self.running then
im.ProgressBar((self.duration - self.timer) / self.duration, im.ImVec2(100,0))
im.Text("Running")
else
im.ProgressBar((self.duration - self.timer) / self.duration, im.ImVec2(100,0))
if self.done then
@/lua/ge/extensions/editor/missionEditor/conditions.lua
end
im.Dummy(im.ImVec2(depth * padPerDepth, 1)) im.SameLine()
if im.Button("Add##"..index) then
index = index + 1
im.Dummy(im.ImVec2(1,1))
end
im.Dummy(im.ImVec2(depth * padPerDepth, 1)) im.SameLine()
if condition.transient then
if condition.transient then
editor.uiIconImageButton(editor.icons.visibility_off, im.ImVec2(24, 24), nil, nil, nil,'##rem'..condition.type..index.."-"..depth)
im.tooltip("This Condition is transient (generated at runtime) and can't be edited.")
else
if editor.uiIconImageButton(editor.icons.delete_forever, im.ImVec2(24, 24), nil, nil, nil,'##rem'..condition.type..index.."-"..depth) then
rem = true
@/lua/ge/extensions/editor/decalEditor.lua
image.texId,
im.ImVec2(200, image.size.y / (image.size.x / 200)),
im.ImVec2Zero,
if editor.uiIconImageButton(editor.icons.add_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
editor.history:commitAction("CreateDecalTemplate", {}, createTemplateActionUndo, createTemplateActionRedo)
if not selectedTemplate then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
local instancesData = {}
if not selectedTemplate or not editor.isDecalDirty(selectedTemplate) then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.material_save_current, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
editor.saveDecal(selectedTemplate)
if editor.uiIconImageButton(editor.icons.material_save_all, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
editor.saveDecals()
if tableIsEmpty(selectedInstances) then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
onDeleteSelection()
im.BeginChild1("Instances", im.ImVec2(0,300), true)
for _, templateName in ipairs(templateNamesSorted) do
end
im.BeginChild1("Instance Properties", im.ImVec2(0,0), true)
im.Text("Instance Properties")
editor.editModes.decalEditMode.auxShortcuts["Shift + Drag Gizmo"] = "Duplicate decals"
editor.registerWindow(toolWindowName, im.ImVec2(400,600))
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua
im.Separator()
if im.Button("Ok", im.ImVec2(120,0)) then
self:deleteAllPacenotes()
im.SameLine()
if im.Button("Cancel", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
-- im.HeaderText("Selected Pacenote")
-- im.BeginChild1("pacenotes", im.ImVec2(270*im.uiscale[0], 0), im.WindowFlags_ChildWindow)
im.BeginChild1("pacenotes", nil, im.WindowFlags_ChildWindow)
@/lua/ge/extensions/editor/sensorDebugger.lua
editor.registerWindow(toolWindowName, im.ImVec2(600, 600))
editor.addWindowMenuItem('Camera Sensor Debug', onWindowMenuItem, {groupMenuName = 'Tech'})
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veTCSDebug.lua
local didInit = false
local defaultWindowSize = im.ImVec2(600, 400)
im.PlotMultiLines("", #graph1Tables, graph1Names, graphColors1, graph1Tables, dataPointCount, "", -0.25, 1, im.ImVec2(width, height))
im.PlotMultiLines("", #graph2Tables, graph2Names, graphColors2, graph2Tables, dataPointCount, "", 0, 0.5, im.ImVec2(width, height))
im.PlotMultiLines("", #graph3Tables, graph3Names, graphColors3, graph3Tables, dataPointCount, "", 0, 1, im.ImVec2(width, height))
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/canEnterFromWalking.lua
if gameplay_walk then
editor.uiIconImage(editor.icons.simobject_bng_vehicle, im.ImVec2(40, 40), (gameplay_walk.isWalking() and gameplay_walk.getVehicleInFront() and gameplay_walk.isAtParkingSpeed()) and im.ImVec4(0.3,1,0.3,1) or im.ImVec4(1,1,1,0.3))
end
@/lua/ge/extensions/core/ropeVisualTest.lua
im.SetNextWindowSize(im.ImVec2(400, 600), im.Cond_FirstUseEver)
if im.Begin("Rope Visual Sandbox", nil, im.WindowFlags_MenuBar) then
@/lua/ge/extensions/editor/flowgraph/nodePreview.lua
self.previewEctx = nil
self.previewSize = im.ImVec2(200, 200)
end
im.BeginChild1("##nodepreview", self.previewSize, false)
ui_flowgraph_editor.Begin('preview', im.ImVec2(0, 0), true)
@/lua/ge/extensions/editor/missionEditor/additionalAttributes.lua
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
@/lua/ge/extensions/editor/aiTests.lua
change = change or marker:update()
im.Dummy(im.ImVec2(0, 5))
end
im.Dummy(im.ImVec2(0, 5))
end
im.BeginChild1("AI Test Vehicles", im.ImVec2(150 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
im.BeginChild1("AI Test Parameters", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
im.Dummy(im.ImVec2(0, 5))
im.Separator()
im.Dummy(im.ImVec2(0, 5))
im.Separator()
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(520, 420))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName = 'Debug'})
@/lua/ge/extensions/editor/dynamicDecals/news.lua
im.Dummy(spacing)
if im.Button("Vehicle Livery Creator Thread [Link]", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then openWebBrowser("https://www.beamng.com/threads/experimental-dynamic-decals.95559/") end
im.Dummy(spacing)
-- im.SetWindowFontScale(1.1)
spacing = im.ImVec2(1, im.GetStyle().ItemSpacing.y * 2)
im.PushFont3("cairo_regular_medium")
local style = im.GetStyle()
if im.BeginChild1("DynamicDecals_NewsWindow_Child", im.ImVec2(availableSpace.x, availableSpace.y - (math.ceil(im.GetFontSize()) + 3 * style.ItemSpacing.y)), true) then
im.Dummy(spacing)
editor.registerWindow(windowName, im.ImVec2(640, 640))
@/lua/ge/extensions/editor/flowgraph/main.lua
local initialWindowSize = im.ImVec2(400, 400)
editor.registerWindow(self.windowName, im.ImVec2(600,600), nil, false)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(8, 8))
self:drawMenu()
if not self.fgEditor.dockspaces["NE_Main_Dockspace"] then self.fgEditor.dockspaces["NE_Main_Dockspace"] = im.GetID1("NE_Main_Dockspace") end
im.DockSpace(self.fgEditor.dockspaces["NE_Main_Dockspace"], im.ImVec2(0, 0), im.DockNodeFlags_None)
im.EndChild()
end
--im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
im.SetNextWindowDockID(self.fgEditor.dockspaces["NE_Main_Dockspace"])
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
if gridColor then
im.Columns(3)
editor.uiIconImage(self.mgr.runningState ~= "running" and editor.icons.pause_circle_outline or editor.icons.play_circle_filled, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip(self.mgr.runningState == "running" and "Project Running" or "Project Stopped")
im.SameLine()
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
local _, lNames, lIds = gr:getLocation()
local itemSize = im.GetItemRectSize()
editor.uiIconImage(editor.icons.navigate_next, im.ImVec2(20,20))
if im.IsItemClicked() then
-- display blue rectangle when node is hovered
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
im.SameLine()
if editor.uiIconImageButton(editor.icons.gesture, im.ImVec2(20,20)) then
self.mgr:updateNodePositions()
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(20, 20)) then
-- Try to apply mission variables before starting
im.SameLine()
if editor.uiIconImageButton(editor.icons.skip_next, im.ImVec2(20, 20)) then
-- Try to apply mission variables before starting
editor.uiIconImage(editor.icons.play_arrow, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("Project running")
im.SameLine()
if editor.uiIconImageButton(editor.icons.pause, im.ImVec2(20, 20)) then
self.mgr:setPaused(true)
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(20, 20)) then
self.mgr:setPaused(false)
im.SameLine()
if editor.uiIconImageButton(editor.icons.skip_next, im.ImVec2(20, 20)) then
self.mgr:setPaused(false)
if self.mgr.runningState ~= "stopped" then
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20)) then
self.mgr:setRunning(false)
else
editor.uiIconImage(editor.icons.stop, im.ImVec2(20, 20))
ui_flowgraph_editor.tooltip("Project stopped")
im.SameLine()
im.Dummy(im.ImVec2(20,5))
im.SameLine()
if editor.getPreference("flowgraph.debug.editorDebug") then
if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(20, 20)) then
local serialized = self.mgr:_onSerialize()
im.SameLine()
if editor.uiIconImageButton(editor.icons.fullscreen_exit, im.ImVec2(20, 20)) then
self.fgEditor.switchToSmallWindow = true
ui_flowgraph_editor.Begin(self.editorid, im.ImVec2(0, -5), graphReadOnly)
if im.IsWindowFocused() then
im.SetCursorPos(im.ImVec2(50/vz[0]-im.GetWindowPos().x+vp.x / vz[0], 5/vz[0]-im.GetWindowPos().y+vp.y / vz[0]))
--editor.uiIconImage(editor.icons.goat, im.ImVec2(300/vz[0],300/vz[0]), im.ImVec4(math.sin(os.clock()*3)*0.25+0.75,0.25,0.25,1))
im.SetCursorPos(im.ImVec2(50/vz[0]-im.GetWindowPos().x+vp.x / vz[0], 5/vz[0]-im.GetWindowPos().y+vp.y / vz[0]))
--editor.uiIconImage(editor.icons.goat, im.ImVec2(300/vz[0],300/vz[0]), im.ImVec4(math.sin(os.clock()*3)*0.25+0.75,0.25,0.25,1))
--im.SetCursorPos(oldCp)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
self:doContextMenus()
if pin.quickAccess then
if im.Button("Remove Quick Access",im.ImVec2(200*editor.getPreference("ui.general.scale"),0)) then
pin.quickAccess = nil
im.SameLine()
if editor.uiIconImageButton(editor.icons.check, im.ImVec2(20,20)) or entered then
local nameTaken = false
im.PopItemWidth()
im.Dummy(im.ImVec2(1,4))
im.Separator()
end
editor.uiIconImage(icon, im.ImVec2(22, 22), whiteStrong)
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-5,1))
im.EndGroup()
local clr = im.IsItemHovered() and orangeColor or whiteColor
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
im.PushStyleColor2(im.Col_Border, im.ImVec4(1.0, 1.0, 1.0, 0.25))
im.BeginChild1("##createnodespopup", im.ImVec2(300 * editor.getPreference("ui.general.scale"), 300 * editor.getPreference("ui.general.scale")), false)
if self.mgr.allowEditing then
im.PushStyleColor2(im.Col_Border, im.ImVec4(1.0, 1.0, 1.0, 0.25))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(9, 9))
if im.BeginPopup("BackgroundContextMenu") then
@/lua/ge/extensions/flowgraph/nodes/macro/integrated.lua
--im.Text(self.targetGraph.name)
editor.uiIconImage(editor.icons.search, im.ImVec2(20, 20))
if im.IsItemHovered() then
@/lua/ge/extensions/flowgraph/nodes/debug/displayFlow.lua
local iconImage = activeBool and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32), activeColor)
@/lua/ge/extensions/gameplay/drift/quickMessages.lua
im.Text("Available quick messages : ")
if im.BeginChild1("Available quick messages", im.ImVec2(im.GetContentRegionAvailWidth(), 130), true) then
for messageId, data in pairs(quickMessages) do
im.Dummy(im.ImVec2(1, 10))
im.Text("Quick message history : ")
@/lua/ge/extensions/editor/missionEditor/previewChecker.lua
end
local imVec24x24 = im.ImVec2(24,24)
local imVec4Red = im.ImVec4(1,0,0,1)
im.BeginTooltip()
im.Image(self.previewImage.texId, self.previewImage.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
im.BeginTooltip()
im.Image(self.previewImage.texId, self.previewImage.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
im.BeginTooltip()
im.Image(self.thumbImage.texId, self.thumbImage.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
im.BeginTooltip()
im.Image(self.thumbImage.texId, self.thumbImage.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
end
im.Image(self.previewImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
size = vec3(self.thumbImage.size.x, self.thumbImage.size.y, 0)
end
im.Image(self.previewImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
size = vec3(self.thumbImage.size.x, self.thumbImage.size.y, 0)
end
im.Image(self.previewImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
size = vec3(self.thumbImage.size.x, self.thumbImage.size.y, 0)
end
im.Image(self.thumbImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
end
end
im.Image(self.thumbImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
end
end
im.Image(self.thumbImage.texId, im.ImVec2(size.x, size.y), im.ImVec2(0, 0), im.ImVec2(1, 1))
end
@/lua/ge/extensions/flowgraph/builder.lua
}
res.top_left = function() return im.ImVec2(res.x, res.y) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.top_left = function() return im.ImVec2(res.x, res.y) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.bottom_right = function() return im.ImVec2(res.x + res.w, res.y + res.h) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.bottom_right = function() return im.ImVec2(res.x + res.w, res.y + res.h) end
res.is_empty = function() return w == 0 and h == 0 end
if self.HeaderRect and not self.HeaderRect.is_empty() and self.headerTexture.texId then
local uv = im.ImVec2(self.HeaderRect.w / (4 * im.uiscale[0] * self.headerTexture.size.x), self.HeaderRect.h / (4 * im.uiscale[0] * self.headerTexture.size.y))
im.ImDrawList_AddImageRounded(im.GetWindowDrawList(), self.headerTexture.texId, a, b, im.ImVec2(0, 0), uv, im.GetColorU322(self.HeaderColor), ui_flowgraph_editor.GetStyle().NodeRounding, 3)
if self.leftPinSize then
-- im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1, 1, 1, 0.2)))
end
if self.leftPinSize then
-- im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.leftPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1, 1, 1, 0.2)))
end
if self.rightPinSize then
-- im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1,1,1, 0.2)))
end
if self.rightPinSize then
-- im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y), im.ImVec2(self.ContentRect.x + self.ContentRect.w - self.rightPinSize, self.ContentRect.y + self.ContentRect.h), im.GetColorU322(im.ImVec4(1,1,1, 0.2)))
end
elseif stage == 'input' then
--im.BeginVertical1('inputs', im.ImVec2(0, 0), 0)
im.PushID1("inputs")
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotAlignment, im.ImVec2(0, 0.5))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize, im.ImVec2(0, 0))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotAlignment, im.ImVec2(0, 0.5))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize, im.ImVec2(0, 0))
elseif stage == 'middle' then
--im.Dummy(im.ImVec2(4,0))
--im.SameLine()
--im.BeginVertical1('middle', im.ImVec2(0, 0), 1)
im.PushID1("middle")
--end
--im.Dummy(im.ImVec2(4,0))
--im.SameLine()
--im.SameLine()
im.Dummy(im.ImVec2(paddingRequired,2))
im.SameLine()
--im.BeginVertical1('outputs', im.ImVec2(0, 0), 1)
im.PushID1("outputs")
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotAlignment, im.ImVec2(1, 0.5))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize, im.ImVec2(0, 0))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotAlignment, im.ImVec2(1, 0.5))
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize, im.ImVec2(0, 0))
--end
--ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize,im.ImVec2(1,1))
--ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotScale,im.ImVec2(50,50))
--ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotSize,im.ImVec2(1,1))
--ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotScale,im.ImVec2(50,50))
im.SetCursorPosY(im.GetCursorPosY() + 12 )
im.Dummy(im.ImVec2(00,12))
--ui_flowgraph_editor.EndPin()
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
local C = {}
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
end
im.BeginChild1("LB",im.ImVec2(im.GetContentRegionAvailWidth()*0.66, 62), true)
im.Columns(3)
local function decoHeaderDraw(e, mtd) im.PushFont3("cairo_regular_medium") im.TextColored(e.color, e.text) im.PopFont() end
local function decoTextDraw(e, mtd) im.Columns(2) im.SetColumnWidth(0,columnWidth) im.Dummy(im.ImVec2(1,1)) im.NextColumn() im.TextWrapped(e.text) if e.tooltip then im.tooltip(e.tooltip) end im.Columns(1) end
local separatorColor = im.GetColorU322(im.ImVec4(1,1,1,0.5))
local separatorColor = im.GetColorU322(im.ImVec4(1,1,1,0.5))
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, mtd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, mtd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, mtd) im.Dummy(im.ImVec2(0,e.height)) end
local function decoSeparatorDraw(e, mtd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, mtd) im.Dummy(im.ImVec2(0,e.height)) end
local drawFunctions = {
@/lua/ge/extensions/flowgraph/nodes/states/transition.lua
im.Text(self.transitionName or "No Transition!")
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
end
@/lua/ge/extensions/editor/objectTool.lua
imgui.Separator()
imgui.BeginChild1("icon object classes", imgui.ImVec2(0, 200))
for k = 1, tableSize(classes) do
@/lua/ge/extensions/editor/raceEditor/pathnodes.lua
local avail = im.GetContentRegionAvail()
im.BeginChild1("keynodes", im.ImVec2(125 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for i, node in ipairs(self.path.pathnodes.sorted) do
im.SameLine()
im.BeginChild1("currentPathnode", im.ImVec2(0, 0 ), im.WindowFlags_ChildWindow)
if self.index then
im.BeginChild1("self.indexInner", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local editEnded = im.BoolPtr(false)
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
local materialEditorWindowSize = nil
local materialEditorMapThumbnailSize = im.ImVec2(48,48)
local terrainMtlProxy
editor.icons.material_texturemap_remove,
im.ImVec2(inputWidgetHeight, inputWidgetHeight)
) then
editor.icons.folder,
im.ImVec2(inputWidgetHeight, inputWidgetHeight)
) then
local texture = editor.getTempTextureObj(val)
local size = im.ImVec2(128, 128)
im.SetCursorPosX(removeMapButtonCursorX)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(fontSize, fontSize)) then
editor_terrainEditor.removeMap(terrainMtlCopyProxy, "diffuse")
im.SetCursorPosX(removeMapButtonCursorX)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(fontSize, fontSize)) then
editor_terrainEditor.removeMap(terrainMtlCopyProxy, "macro")
im.SetCursorPosX(removeMapButtonCursorX)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(fontSize, fontSize)) then
editor_terrainEditor.removeMap(terrainMtlCopyProxy, "detail")
im.SetCursorPosX(removeMapButtonCursorX)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(fontSize, fontSize)) then
editor_terrainEditor.removeMap(terrainMtlCopyProxy, "normal")
im.TextUnformatted("Found the following textures:")
im.Dummy(im.ImVec2(0, 10))
im.Columns(1)
im.Dummy(im.ImVec2(0, 10))
im.TextUnformatted("Would you like to bulk change them?")
im.TextUnformatted("The following Terrain Materials will be moved to a new file using the the most recent file format.")
im.Dummy(im.ImVec2(0, 10))
im.TextUnformatted("Old file path: " .. upgradeFileFormatMaterials.oldFile)
im.Dummy(im.ImVec2(0, 10))
if im.BeginTable('##terrainMaterialsTable', 2) then
im.Dummy(im.ImVec2(0, 10))
end
]])
im.Dummy(im.ImVec2(0,10))
im.TextColored(editor.color.warning.Value, "Once the terrain materials are upgraded you won't be able to fallback to the former system within this editor.")
im.TextUnformatted("Do not forget to save the level in order to apply the changes that have been made to the TerrainBlock object.")
im.Dummy(im.ImVec2(0,20))
if not editor_terrainEditor.getTerrainBlock() then
-- Add new material
if editor.uiIconImageButton(editor.icons.add, im.ImVec2(fontSize, fontSize)) then
editMaterial()
-- Delete selected material
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(fontSize, fontSize)) and terrainMtlProxy and terrainMtlProxy.material then
--TODO: undo
if im.Selectable1(mtl.internalName .. "##Terrain Materials" .. id, name == mtl.internalName, nil,
im.ImVec2(im.GetContentRegionAvailWidth() - (editor_terrainEditor.getVars().style.ItemSpacing.x + btnHeight), 0))
then
if editor_terrainEditor.getTerrainBlock():getField('materialTextureSet', 0) == "" then
im.Dummy(im.ImVec2(0,10))
if im.Button("Upgrade Terrain Materials", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
im.Dummy(im.ImVec2(0,10))
if im.Button("Upgrade Terrain Materials", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.openModalWindow("upgradeTerrainMaterialsModal")
if editor_terrainEditor.getErrors()['deprecated_material_file'] == true then
im.Dummy(im.ImVec2(0,20))
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextColored(editor.color.warning.Value, "The Terrain Materials reside in a file with a deprecated format.")
if im.Button("Upgrade Terrain Material file format", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
upgradeTerrainMaterialFileFormat()
-- MATERIAL PROPERTIES COLUMN
-- local size = im.ImVec2(0, materialEditorWindowSize.y - (fontSize + 2 * editor_terrainEditor.getVars().style.FramePadding.y + editor_terrainEditor.getVars().style.WindowPadding.y) - (fontSize + editor_terrainEditor.getVars().style.WindowPadding.y + editor_terrainEditor.getVars().style.ItemSpacing.y) - (fontSize + editor_terrainEditor.getVars().style.ItemSpacing.y))
local size = im.ImVec2(0, im.GetContentRegionAvail().y - (im.GetFontSize() + 2 * im.GetStyle().FramePadding.y + im.GetStyle().ItemSpacing.y))
-- local size = im.ImVec2(0, materialEditorWindowSize.y - (fontSize + 2 * editor_terrainEditor.getVars().style.FramePadding.y + editor_terrainEditor.getVars().style.WindowPadding.y) - (fontSize + editor_terrainEditor.getVars().style.WindowPadding.y + editor_terrainEditor.getVars().style.ItemSpacing.y) - (fontSize + editor_terrainEditor.getVars().style.ItemSpacing.y))
local size = im.ImVec2(0, im.GetContentRegionAvail().y - (im.GetFontSize() + 2 * im.GetStyle().FramePadding.y + im.GetStyle().ItemSpacing.y))
if im.BeginChild1("Material Properties##Child", size, true) then
im.SameLine()
im.ColorButton("Annotation color", bgColor, 0, im.ImVec2(25, 19))
im.SameLine()
end
im.ColorButton("annotationColorButton", bgColor, 0, im.ImVec2(25, 19))
im.SameLine()
local function onEditorInitialized()
editor.registerWindow(terrainMaterialEditorWindowName, im.ImVec2(710,530))
editor.showTerrainMaterialsEditor = showTerrainMaterialsEditor
editor.registerModalWindow("bulkChangeTexturesModal", im.ImVec2(200, 300))
editor.registerModalWindow("upgradeTerrainMaterialsModal", im.ImVec2(600, 300))
editor.registerModalWindow("bulkChangeTexturesModal", im.ImVec2(200, 300))
editor.registerModalWindow("upgradeTerrainMaterialsModal", im.ImVec2(600, 300))
editor.registerModalWindow("upgradeTerrainMaterialsFileFormatModal", im.ImVec2(700, 340))
editor.registerModalWindow("upgradeTerrainMaterialsModal", im.ImVec2(600, 300))
editor.registerModalWindow("upgradeTerrainMaterialsFileFormatModal", im.ImVec2(700, 340))
end
@/lua/ge/extensions/editor/util/plotHelperUtil.lua
self.size = im.ImVec2(width, height)
self.innerSize = im.ImVec2(width-2*borderSize, height-2*borderSize)
self.size = im.ImVec2(width, height)
self.innerSize = im.ImVec2(width-2*borderSize, height-2*borderSize)
im.BeginChild1('curve_'..self.id, self.size)
local min, max = self:normToImSS(0,0), self:normToImSS(1,1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(min.x,self.mousePos.y), im.ImVec2(max.x,self.mousePos.y), crossHairColor, 1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(self.mousePos.x,min.y), im.ImVec2(self.mousePos.x,max.y), crossHairColor, 1)
local min, max = self:normToImSS(0,0), self:normToImSS(1,1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(min.x,self.mousePos.y), im.ImVec2(max.x,self.mousePos.y), crossHairColor, 1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(self.mousePos.x,min.y), im.ImVec2(self.mousePos.x,max.y), crossHairColor, 1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(min.x,self.mousePos.y), im.ImVec2(max.x,self.mousePos.y), crossHairColor, 1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(self.mousePos.x,min.y), im.ImVec2(self.mousePos.x,max.y), crossHairColor, 1)
end
im.ImDrawList_AddLine(self.dl, im.ImVec2(min.x,self.mousePos.y), im.ImVec2(max.x,self.mousePos.y), crossHairColor, 1)
im.ImDrawList_AddLine(self.dl, im.ImVec2(self.mousePos.x,min.y), im.ImVec2(self.mousePos.x,max.y), crossHairColor, 1)
end
if xPos then
im.SetCursorPos(im.ImVec2(xPos.x, botPos.y - im.GetTextLineHeightWithSpacing()))
im.Text(" "..label)
local xSs = self:graphPtToImSS(x,self.scale.yMin + (self.scale.yMax - self.scale.yMin)/2)
im.ImDrawList_AddLine(self.dl, im.ImVec2(xSs.x,min.y), im.ImVec2(xSs.x,max.y), annotationColor, 1)
end
local xSs = self:graphPtToImSS(x,self.scale.yMin + (self.scale.yMax - self.scale.yMin)/2)
im.ImDrawList_AddLine(self.dl, im.ImVec2(xSs.x,min.y), im.ImVec2(xSs.x,max.y), annotationColor, 1)
end
for i, line in ipairs(lines) do
im.SetCursorPos(im.ImVec2(pos.x + borderSize/3, pos.y +borderSize - im.GetTextLineHeight()/4 + im.GetTextLineHeight()*i ))
im.Text(line)
local btnWidth = 10
local btnSize = im.ImVec2(btnWidth,btnWidth)
function C:normToImSS(x,y)
return im.ImVec2(borderSize + self.screenPos.x + x * self.innerSize.x, borderSize + self.screenPos.y + (1-y) * self.innerSize.y)
end
function C:normToImWS(x,y)
return im.ImVec2(borderSize + x * self.innerSize.x, borderSize + (1-y) * self.innerSize.y)
end
@/lua/ge/extensions/editor/inspector.lua
local groundCoverUVDragPos = nil
local groundCoverUVDragStartLocalDelta = imgui.ImVec2(0, 0)
local groundCoverUVHandlesOnDragStart = nil
local groundCoverUVHandles = {
[groundCoverUVHandle_enum.topLeft] = {imgui.ImVec2(0, 0), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
local groundCoverUVHandles = {
[groundCoverUVHandle_enum.topLeft] = {imgui.ImVec2(0, 0), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topLeft] = {imgui.ImVec2(0, 0), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topRight] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topLeft] = {imgui.ImVec2(0, 0), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topRight] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topRight] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topCenter] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.topRight] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleLeft] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleLeft] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleLeft] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleRight] = {imgui.ImVec2(1, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleLeft] = {imgui.ImVec2(0, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleRight] = {imgui.ImVec2(1, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleRight] = {imgui.ImVec2(1, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleCenter] = {imgui.ImVec2(0.5, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.middleRight] = {imgui.ImVec2(1, 0.5), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomLeft] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomLeft] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomLeft] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomRight] = {imgui.ImVec2(1, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomLeft] = {imgui.ImVec2(0, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomRight] = {imgui.ImVec2(1, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomRight] = {imgui.ImVec2(1, 1), imgui.ImVec2(0, 0)},
}
[groundCoverUVHandle_enum.bottomCenter] = {imgui.ImVec2(0.5, 1), imgui.ImVec2(0, 0)},
[groundCoverUVHandle_enum.bottomRight] = {imgui.ImVec2(1, 1), imgui.ImVec2(0, 0)},
}
local wndName = inspectorWindowNamePrefix .. tostring(idx)
editor.registerWindow(wndName, imgui.ImVec2(300, 500))
editor.showWindow(wndName)
end
headerMenu.pos = imgui.ImVec2(imgui.GetMousePos().x - 150 * editor.getPreference("ui.general.scale"), imgui.GetMousePos().y + 10)
end
local p_Min = imgui.ImVec2(imgui.GetWindowPos().x + imageStartCursorPos.x + u_pixel + imgui.GetStyle().ChildBorderSize, imgui.GetWindowPos().y + imageStartCursorPos.y + v_pixel + imgui.GetStyle().ChildBorderSize)
local p_Max = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel)
local p_Min = imgui.ImVec2(imgui.GetWindowPos().x + imageStartCursorPos.x + u_pixel + imgui.GetStyle().ChildBorderSize, imgui.GetWindowPos().y + imageStartCursorPos.y + v_pixel + imgui.GetStyle().ChildBorderSize)
local p_Max = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel)
local p1_HandleSqTopLeft = imgui.ImVec2(p_Min.x, p_Min.y)
local p2_HandleSqTopLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + handleSquareSize)
local p1_HandleSqTopLeft = imgui.ImVec2(p_Min.x, p_Min.y)
local p2_HandleSqTopLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + handleSquareSize)
groundCoverUVHandles[groundCoverUVHandle_enum.topLeft] = {p1_HandleSqTopLeft, p2_HandleSqTopLeft}
local p1_HandleSqTopMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y)
local p2_HandleSqTopMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + handleSquareSize)
local p1_HandleSqTopMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y)
local p2_HandleSqTopMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + handleSquareSize)
groundCoverUVHandles[groundCoverUVHandle_enum.topCenter] = {p1_HandleSqTopMiddle, p2_HandleSqTopMiddle}
local p1_HandleSqTopRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y)
local p2_HandleSqTopRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + handleSquareSize)
local p1_HandleSqTopRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y)
local p2_HandleSqTopRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + handleSquareSize)
groundCoverUVHandles[groundCoverUVHandle_enum.topRight] = {p1_HandleSqTopRight, p2_HandleSqTopRight}
local p1_HandleSqMiddleLeft = imgui.ImVec2(p_Min.x, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqMiddleLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + height_pixel/2 + handleSquareSize/2)
local p1_HandleSqMiddleLeft = imgui.ImVec2(p_Min.x, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqMiddleLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + height_pixel/2 + handleSquareSize/2)
groundCoverUVHandles[groundCoverUVHandle_enum.middleLeft] = {p1_HandleSqMiddleLeft, p2_HandleSqMiddleLeft}
local p1_HandleSqCenter = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqCenter = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + height_pixel/2 + handleSquareSize/2)
local p1_HandleSqCenter = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqCenter = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + height_pixel/2 + handleSquareSize/2)
groundCoverUVHandles[groundCoverUVHandle_enum.middleCenter] = {p1_HandleSqCenter, p2_HandleSqCenter}
local p1_HandleSqMiddleRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqMiddleRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel/2 + handleSquareSize/2)
local p1_HandleSqMiddleRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y + height_pixel/2 - handleSquareSize/2)
local p2_HandleSqMiddleRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel/2 + handleSquareSize/2)
groundCoverUVHandles[groundCoverUVHandle_enum.middleRight] = {p1_HandleSqMiddleRight, p2_HandleSqMiddleRight}
local p1_HandleSqBottomLeft = imgui.ImVec2(p_Min.x, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleRectBottomLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + height_pixel)
local p1_HandleSqBottomLeft = imgui.ImVec2(p_Min.x, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleRectBottomLeft = imgui.ImVec2(p_Min.x + handleSquareSize, p_Min.y + height_pixel)
groundCoverUVHandles[groundCoverUVHandle_enum.bottomLeft] = {p1_HandleSqBottomLeft, p2_HandleRectBottomLeft}
local p1_HandleSqBottomMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleSqBottomMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + height_pixel)
local p1_HandleSqBottomMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 - handleSquareSize/2, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleSqBottomMiddle = imgui.ImVec2(p_Min.x + width_pixel/2 + handleSquareSize/2, p_Min.y + height_pixel)
groundCoverUVHandles[groundCoverUVHandle_enum.bottomCenter] = {p1_HandleSqBottomMiddle, p2_HandleSqBottomMiddle}
local p1_HandleSqBottomRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleSqBottomRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel)
local p1_HandleSqBottomRight = imgui.ImVec2(p_Min.x + width_pixel - handleSquareSize, p_Min.y + height_pixel - handleSquareSize)
local p2_HandleSqBottomRight = imgui.ImVec2(p_Min.x + width_pixel, p_Min.y + height_pixel)
groundCoverUVHandles[groundCoverUVHandle_enum.bottomRight] = {p1_HandleSqBottomRight, p2_HandleSqBottomRight}
groundCoverUVHandles[draggingGCUVHandleSq][1] = sqNewPos
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
groundCoverUVal[0] = (relNewPos.x)/imageSize.x
groundCoverUVHandles[draggingGCUVHandleSq][1] = sqNewPos
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
groundCoverVVal[0] = relNewPos.y/imageSize.y
groundCoverUVHandles[draggingGCUVHandleSq][1] = sqNewPos
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
groundCoverVVal[0] = relNewPos.y/imageSize.y
groundCoverUVHandles[draggingGCUVHandleSq][1] = sqNewPos
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
groundCoverUVal[0] = relNewPos.x/imageSize.x
groundCoverUVHandles[draggingGCUVHandleSq][1].y = (sqNewPos.y == math.huge and groundCoverUVHandles[draggingGCUVHandleSq][1].y or sqNewPos.y)
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
if sqNewPos.x ~= math.huge then
groundCoverUVHandles[draggingGCUVHandleSq][1] = sqNewPos
local relNewPos = imgui.ImVec2(sqNewPos.x - imageStartAbsCursorPos.x, sqNewPos.y - imageStartAbsCursorPos.y)
groundCoverUVal[0] = relNewPos.x/imageSize.x
local groundCoverUVDragStartLocalDeltaY = groundCoverUVDragPos.y - groundCoverUVHandlesOnDragStart[draggingGCUVHandleSq][1].y
groundCoverUVDragStartLocalDelta = imgui.ImVec2(groundCoverUVDragStartLocalDeltaX, groundCoverUVDragStartLocalDeltaY)
end
if imgui.BeginChild1("ColorMapColumn", imgui.ImVec2(0, uvMainPanelHeight), true, imgui.WindowFlags_NoScrollWithMouse) then
imgui.Columns(2, "MainColumn")
local textStartCursorPos = imgui.GetCursorPos()
imgui.SetCursorPos(imgui.ImVec2(fontSize*2, fontSize*2))
local imageSize = math.min(availableImageSize.x, availableImageSize.y) - 6*imgui.GetStyle().ChildBorderSize
local size = imgui.ImVec2(imageSize, imageSize)
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y)
local p2_BG = imgui.ImVec2(coloredBG_StartPos_X + size.x, coloredBG_StartPos_Y + size.y)
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y)
local p2_BG = imgui.ImVec2(coloredBG_StartPos_X + size.x, coloredBG_StartPos_Y + size.y)
imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(groundCoverUVBgColors[groundCoverUVBgColorIndex].color))
drawUVHandle(imageStartCursorPos, imageStartAbsCursorPos, size)
imgui.SetCursorPos(imgui.ImVec2(textStartCursorPos.x + fontSize/2, fontSize))
imgui.TextUnformatted("0.0")
imgui.SetCursorPos(imgui.ImVec2(textStartCursorPos.x + fontSize, fontSize*2 + size.y / 2))
imgui.TextUnformatted("V")
imgui.SetCursorPos(imgui.ImVec2(textStartCursorPos.x + fontSize/2, size.y + fontSize))
imgui.TextUnformatted("1.0")
local p1_HandleColorLabel = imgui.ImVec2(windowPos.x + cursorPos.x, windowPos.y + cursorPos.y + imgui.GetStyle().FramePadding.y)
local p2_HandleColorLabel = imgui.ImVec2(p1_HandleColorLabel.x + fontSize, p1_HandleColorLabel.y + fontSize)
local p1_HandleColorLabel = imgui.ImVec2(windowPos.x + cursorPos.x, windowPos.y + cursorPos.y + imgui.GetStyle().FramePadding.y)
local p2_HandleColorLabel = imgui.ImVec2(p1_HandleColorLabel.x + fontSize, p1_HandleColorLabel.y + fontSize)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_HandleColorLabel, p2_HandleColorLabel, imgui.GetColorU322(groundCoverUVHandleColors[groundCoverUVHandleColorIndex].color))
imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_HandleColorLabel.x - 1, p1_HandleColorLabel.y - 1), imgui.ImVec2(p2_HandleColorLabel.x + 1, p2_HandleColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_HandleColorLabel, p2_HandleColorLabel, imgui.GetColorU322(groundCoverUVHandleColors[groundCoverUVHandleColorIndex].color))
imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_HandleColorLabel.x - 1, p1_HandleColorLabel.y - 1), imgui.ImVec2(p2_HandleColorLabel.x + 1, p2_HandleColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
for index, val in ipairs(groundCoverUVHandleColors) do
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y + 4*imgui.GetStyle().ChildBorderSize)
local p2_BG = imgui.ImVec2(coloredBG_EndPos_X, coloredBG_StartPos_Y + fontSize - imgui.GetStyle().ChildBorderSize)
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y + 4*imgui.GetStyle().ChildBorderSize)
local p2_BG = imgui.ImVec2(coloredBG_EndPos_X, coloredBG_StartPos_Y + fontSize - imgui.GetStyle().ChildBorderSize)
imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
local cursorPosBg = imgui.GetCursorPos()
local p1_bgColorLabel = imgui.ImVec2(windowPos.x + cursorPosBg.x, windowPos.y + cursorPosBg.y + imgui.GetStyle().FramePadding.y)
local p2_bgColorLabel = imgui.ImVec2(p1_bgColorLabel.x + fontSize, p1_bgColorLabel.y + fontSize)
local p1_bgColorLabel = imgui.ImVec2(windowPos.x + cursorPosBg.x, windowPos.y + cursorPosBg.y + imgui.GetStyle().FramePadding.y)
local p2_bgColorLabel = imgui.ImVec2(p1_bgColorLabel.x + fontSize, p1_bgColorLabel.y + fontSize)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_bgColorLabel, p2_bgColorLabel, imgui.GetColorU322(groundCoverUVBgColors[groundCoverUVBgColorIndex].color))
imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_bgColorLabel.x - 1, p1_bgColorLabel.y - 1), imgui.ImVec2(p2_bgColorLabel.x + 1, p2_bgColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1_bgColorLabel, p2_bgColorLabel, imgui.GetColorU322(groundCoverUVBgColors[groundCoverUVBgColorIndex].color))
imgui.ImDrawList_AddRect(imgui.GetWindowDrawList(), imgui.ImVec2(p1_bgColorLabel.x - 1, p1_bgColorLabel.y - 1), imgui.ImVec2(p2_bgColorLabel.x + 1, p2_bgColorLabel.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
for index, val in ipairs(groundCoverUVBgColors) do
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y + 4*imgui.GetStyle().ChildBorderSize)
local p2_BG = imgui.ImVec2(coloredBG_EndPos_X, coloredBG_StartPos_Y + fontSize - imgui.GetStyle().ChildBorderSize)
local p1_BG = imgui.ImVec2(coloredBG_StartPos_X, coloredBG_StartPos_Y + 4*imgui.GetStyle().ChildBorderSize)
local p2_BG = imgui.ImVec2(coloredBG_EndPos_X, coloredBG_StartPos_Y + fontSize - imgui.GetStyle().ChildBorderSize)
imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
imgui.ImDrawList_AddRectFilled(drawlist, p1_BG, p2_BG, imgui.GetColorU322(val.color))
imgui.ImDrawList_AddRect(drawlist, imgui.ImVec2(p1_BG.x - 1, p1_BG.y - 1), imgui.ImVec2(p2_BG.x + 1, p2_BG.y + 1), imgui.GetColorU322(imgui.ImVec4(0, 0, 0, 1)), nil, nil, 1)
if inspectorInfo.selection then
if editor.uiIconImageButton(editor.icons.lock, imgui.ImVec2(24, 24)) then
inspectorInfo.selection = nil
if imgui.IsItemHovered() then imgui.SetTooltip("Unlock Inspector Window") end
elseif editor.uiIconImageButton(editor.icons.lock_open, imgui.ImVec2(24, 24)) and (not tableIsEmpty(editor.selection)) then
inspectorInfo.selection = deepcopy(editor.selection)
local numKeys = 0
if editor.uiIconImageButton(editor.icons.fiber_new, imgui.ImVec2(24, 24)) then
editor.addInspectorInstance()
for key, val in pairs(guiInstancer.instances) do
editor.registerWindow(inspectorWindowNamePrefix .. tostring(key), imgui.ImVec2(300, 500))
val.fieldNameFilter = imgui.ImGuiTextFilter()
local p1_U_BG = imgui.ImVec2(coloredBG_U_StartPos_X, coloredBG_StartPos_Y)
local p2_U_BG = imgui.ImVec2(coloredBG_U_EndPos_X, coloredBG_EndPos_Y)
local p1_U_BG = imgui.ImVec2(coloredBG_U_StartPos_X, coloredBG_StartPos_Y)
local p2_U_BG = imgui.ImVec2(coloredBG_U_EndPos_X, coloredBG_EndPos_Y)
local p1_U_Text = imgui.ImVec2(coloredBG_U_StartPos_X + textPadding/4 - 2, textPadding_Y)
local p2_U_BG = imgui.ImVec2(coloredBG_U_EndPos_X, coloredBG_EndPos_Y)
local p1_U_Text = imgui.ImVec2(coloredBG_U_StartPos_X + textPadding/4 - 2, textPadding_Y)
local p1_V_BG = imgui.ImVec2(coloredBG_V_StartPos_X, coloredBG_StartPos_Y)
local p2_V_BG = imgui.ImVec2(coloredBG_V_EndPos_X, coloredBG_EndPos_Y)
local p1_V_BG = imgui.ImVec2(coloredBG_V_StartPos_X, coloredBG_StartPos_Y)
local p2_V_BG = imgui.ImVec2(coloredBG_V_EndPos_X, coloredBG_EndPos_Y)
local p1_V_Text = imgui.ImVec2(coloredBG_V_StartPos_X + textPadding/4, textPadding_Y)
local p2_V_BG = imgui.ImVec2(coloredBG_V_EndPos_X, coloredBG_EndPos_Y)
local p1_V_Text = imgui.ImVec2(coloredBG_V_StartPos_X + textPadding/4, textPadding_Y)
local p1_W_BG = imgui.ImVec2(coloredBG_W_StartPos_X, coloredBG_StartPos_Y)
local p2_W_BG = imgui.ImVec2(coloredBG_W_EndPos_X, coloredBG_EndPos_Y)
local p1_W_BG = imgui.ImVec2(coloredBG_W_StartPos_X, coloredBG_StartPos_Y)
local p2_W_BG = imgui.ImVec2(coloredBG_W_EndPos_X, coloredBG_EndPos_Y)
local p1_W_Text = imgui.ImVec2(coloredBG_W_StartPos_X + textPadding/4, textPadding_Y)
local p2_W_BG = imgui.ImVec2(coloredBG_W_EndPos_X, coloredBG_EndPos_Y)
local p1_W_Text = imgui.ImVec2(coloredBG_W_StartPos_X + textPadding/4, textPadding_Y)
local p1_H_BG = imgui.ImVec2(coloredBG_H_StartPos_X, coloredBG_StartPos_Y)
local p2_H_BG = imgui.ImVec2(coloredBG_H_EndPos_X, coloredBG_EndPos_Y)
local p1_H_BG = imgui.ImVec2(coloredBG_H_StartPos_X, coloredBG_StartPos_Y)
local p2_H_BG = imgui.ImVec2(coloredBG_H_EndPos_X, coloredBG_EndPos_Y)
local p1_H_Text = imgui.ImVec2(coloredBG_H_StartPos_X + textPadding/4, textPadding_Y)
local p2_H_BG = imgui.ImVec2(coloredBG_H_EndPos_X, coloredBG_EndPos_Y)
local p1_H_Text = imgui.ImVec2(coloredBG_H_StartPos_X + textPadding/4, textPadding_Y)
imgui.PushStyleVar2(imgui.StyleVar_FramePadding, imgui.ImVec2(imgui.GetFontSize(), 0))
imgui.PushItemWidth(uvValueWidgetWidth)
imgui.SameLine()
local prevCursorPos = imgui.ImVec2(imgui.GetCursorPos().x - imgui.GetStyle().FramePadding.x / 2, imgui.GetCursorPos().y)
imgui.InvisibleButton("openUVEditorButton", imgui.ImVec2(buttonSize * imgui.uiscale[0], buttonSize * imgui.uiscale[0]))
local uvButtonBGColor = imgui.GetStyleColorVec4(imgui.Col_Button)
groundCoverHVal[0] = tonumber(vec[4])
imgui.SetWindowSize2(groundCoverUVWindowName, imgui.ImVec2(800, 600))
imgui.OpenPopup(groundCoverUVWindowName)
imgui.SetCursorPos(prevCursorPos)
editor.uiIconImageButton(editor.icons.crop_free, imgui.ImVec2(buttonSize, buttonSize), nil, nil, uvButtonBGColor)
@/lua/ge/extensions/gameplay/util/crashDetection.lua
im.Dummy(im.ImVec2(1, 10))
-- Graph enable checkboxes
im.Dummy(im.ImVec2(1, 5))
im.Text("Graph Visibility:")
im.Checkbox("Graph 4: Events", crashData.debug.graphEnabled[4])
im.Dummy(im.ImVec2(1, 5))
if graphGroups[graphNum] and crashData.debug.graphEnabled[graphNum][0] then
im.BeginChild1("Graph " .. graphNum .. "##" .. selectedVehId, im.ImVec2(im.GetContentRegionAvailWidth(), 300), true)
im.Dummy(im.ImVec2(1, 10))
im.Text("Is crashing: " .. tostring(trackedVehIds[selectedVehId].isCrashing))
@/lua/ge/extensions/editor/util/zoneSelectorUtil.lua
local initialZonesHeight = math.max(150, math.min(availHeight * 0.5, #e.initialZones * 25 + 30))
im.BeginChild1("InitialZonesList"..e._id, im.ImVec2(0, initialZonesHeight), true)
for i, zoneName in ipairs(e.initialZones) do
local destinationZonesHeight = math.max(150, math.min(availHeight * 0.5, #e.destinationZones * 25 + 30))
im.BeginChild1("DestinationZonesList"..e._id, im.ImVec2(0, destinationZonesHeight), true)
for i, zoneName in ipairs(e.destinationZones) do
@/lua/ge/extensions/editor/renderTest.lua
im.PushStyleVar1(im.StyleVar_WindowBorderSize, 0)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
if editor.beginWindow(toolWindowName, toolWindowName) then
local delta = im.ImVec2(0, 0)
if im.IsMouseDragging(0) then
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(400,600))
editor.addWindowMenuItem('Render Test', onWindowMenuItem, {groupMenuName = 'Debug'})
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
local childSize = im.ImVec2(0,0)
local border = 0
local frameCount = 0
local imVec01 = im.ImVec2(0,1)
local lookWithoutZ = vec3()
-- imgui window setup
local lastSize = im.ImVec2(0,0)
local lastTexSize = im.ImVec2(0,0)
local lastSize = im.ImVec2(0,0)
local lastTexSize = im.ImVec2(0,0)
local drawTransform = {0,0,0,0}
local transparent = im.GetColorU322(im.ImVec4(0,0,0,0.0))
local padding = im.ImVec2(5,5)
local imPadding = 0
local windowPos, windowSize = im.ImVec2(0,0), im.ImVec2(0,0)
local function draw(dtReal, dtSim)
local windowPos, windowSize = im.ImVec2(0,0), im.ImVec2(0,0)
local function draw(dtReal, dtSim)
@/lua/ge/extensions/editor/engineAudioDebug.lua
local exportData = im.Button("Copy to Clipboard", im.ImVec2(150, 25))
im.SameLine()
local reset = im.Button("Reset All to 0", im.ImVec2(150, 25))
if reset then
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,200))
editor.addWindowMenuItem(wndName, open, {groupMenuName = 'Audio'})
@/lua/ge/extensions/gameplay/statistic.lua
local windowOpen = im.BoolPtr(false)
local initialWindowSize = im.ImVec2(300, 100)
local max = math.max
@/lua/ge/extensions/flowgraph/pin.lua
else
editor.uiIconImage(editor.icons.lock_outline, im.ImVec2(24 * scale, 24 * scale), ui_flowgraph_editor.getTypeColor(self.type))
end
im.SameLine()
im.Dummy(im.ImVec2((xStart + outWidth - (im.GetCursorPosX() + 4)), 1))
end
-- Push style changes
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(5, 5))
im.PushStyleColor2(im.Col_Separator, im.ImVec4(1.0, 1.0, 1.0, 0.175))
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_removedataPointsEntry", k)) then
table.remove(layer.dataPoints, k)
if k == count then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_insertdataPointsEntry", k)) then
local nextPoint = layer.dataPoints[k + 1]
if editor.uiIconImageButton(editor.icons.move, im.ImVec2(tool.getIconSize(), tool.getIconSize()), (gizmo.data.uid == layer.uid and gizmo.data.dataPointIndex == k) and editor.color.beamng.Value or nil, nil, nil, string.format("MoveBrushStrokePoint_%s_%d", layer.uid, k)) then
local layerData = deepcopy(layer)
@/lua/ge/extensions/ui/console.lua
local logsTail = 1
local initialWindowSize = im.ImVec2(800, 600)
local filterOld = ""
fullscreen = false
im.SetWindowPos1(im.ImVec2(winstate[1] or 0,winstate[2] or 0), im.ImGuiCond_Always)
im.SetWindowSize1(im.ImVec2(winstate[3] or 800,winstate[4] or 600), im.ImGuiCond_Always)
im.SetWindowPos1(im.ImVec2(winstate[1] or 0,winstate[2] or 0), im.ImGuiCond_Always)
im.SetWindowSize1(im.ImVec2(winstate[3] or 800,winstate[4] or 600), im.ImGuiCond_Always)
else
local numColm = 4
im.PushStyleVar2(im.StyleVar_FramePadding,im.ImVec2(0,0))
im.PushStyleColor2(im.Col_ChildBg, im.ImColorByRGB(0,0,0,0).Value)
im.PushStyleColor2(im.Col_ChildBg, im.ImColorByRGB(0,0,0,0).Value)
if im.BeginTable("LogsChild", numColm, im.TableFlags_Resizable+im.TableFlags_ContextMenuInBody+im.TableFlags_ScrollY+im.TableFlags_NoPadInnerX+im.TableFlags_BordersOuter+(tableBgLines[0] and im.TableFlags_RowBg or 0 )+im.TableFlags_Hideable, im.ImVec2(0, -30 * uiScale)) and numColm>0 then
im.SetWindowFontScale(fontConsoleFact[0])
-- local numColm = 3
-- im.PushStyleVar2(im.StyleVar_FramePadding,im.ImVec2(0,0))
-- if im.BeginTable("testtable", numColm, im.TableFlags_Resizable+im.TableFlags_ContextMenuInBody+im.TableFlags_ScrollY+im.TableFlags_NoPadInnerX+im.TableFlags_BordersOuter+im.TableFlags_RowBg, im.ImVec2(0, 0)) and numColm>0 then
-- im.PushStyleVar2(im.StyleVar_FramePadding,im.ImVec2(0,0))
-- if im.BeginTable("testtable", numColm, im.TableFlags_Resizable+im.TableFlags_ContextMenuInBody+im.TableFlags_ScrollY+im.TableFlags_NoPadInnerX+im.TableFlags_BordersOuter+im.TableFlags_RowBg, im.ImVec2(0, 0)) and numColm>0 then
-- im.SetWindowFontScale(fontConsoleFact[0])
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
local imDummy = im.ImVec2(0, 5)
local defaultVehicle = {model = "etk800"}
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
local configListHeight = math.max(200, math.min(availHeight * 0.6, #finalConfigs * 25 + 30))
im.BeginChild1("VehicleFilterConfigs"..e._id, im.ImVec2(0, configListHeight), true)
@/lua/ge/extensions/editor/bulkRename.lua
imgui.BeginChild1("TableChild", imgui.ImVec2(0, 0), 0)
if imgui.BeginTable("RenamePreviewTable", 4, bit.bor(imgui.TableFlags_Borders, imgui.TableFlags_RowBg, imgui.TableFlags_ScrollY)) then
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(600, 600))
editor.addWindowMenuItem("Bulk Rename", onWindowMenuItem)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imVehicleSelect.lua
function C:displayWindow()
im.SetNextWindowSize(im.ImVec2(480, 300))
im.Begin("Vehicle Select##"..self.id, im.BoolPtr(true))
@/lua/ge/extensions/editor/missionEditor/layers.lua
local C = {}
local imVec24x24 = im.ImVec2(24,24)
local imVec20x20 = im.ImVec2(20,20)
local imVec24x24 = im.ImVec2(24,24)
local imVec20x20 = im.ImVec2(20,20)
local infoColor = im.ImVec4(1,1,1,0.33)
local editEnded = im.BoolPtr(false)
--im.BeginChild1("box", im.ImVec2(width, 50), true, bit.bor(im.WindowFlags_NoScrollWithMouse, im.WindowFlags_NoScrollbar))
if i == 1 then im.BeginDisabled() end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePowerTrain.lua
local windowOpen = im.BoolPtr(false)
local initialWindowSize = im.ImVec2(800, 800)
local deviceString
@/lua/ge/extensions/editor/dynamicDecals/export.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize())) then
editor_fileDialog.openFile(
@/lua/ge/extensions/editor/rayCastTest.lua
editor.editModes.checkTerrainCastRay.auxShortcuts["esc"] = "Exit check"
editor.registerWindow(toolWindowName, imgui.ImVec2(200,100))
editor.addWindowMenuItem("Raycast Test", onWindowMenuItem, {groupMenuName = 'Debug'})
@/lua/ge/extensions/editor/flowgraphEditor.lua
local autoSaveTimer = 120
local lastMousePos = im.ImVec2(0,0)
local lastMouseTimer = 0
local function drawContextMenus()
im.SetNextWindowSize(im.ImVec2(0,350 * im.uiscale[0]), im.Cond_Always)
if im.BeginPopup("CreateNodeContentMenu") then
local function drawExecution()
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(8, 8))
executionView:drawAlone()
--dump(mgr.name)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(8, 8))
ui_flowgraph_editor.SetCurrentEditor(M.ectx)
mgr:draw(dtReal,dtSim,dtRaw)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(2, 2))
if not M.showSmallFgWindow[0] then return end
im.SetNextWindowPos(im.ImVec2(100,100))
im.Begin("FG Monitor")
im.Begin("FG Monitor")
if editor.uiIconImageButton(editor.icons.fullscreen, im.ImVec2(20, 20)) then
editor.setEditorActive(true)
if mgr and mgr.runningState ~= 'stopped' then
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20)) then
mgr:setRunning(false)
else
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(20, 20)) then
-- Try to apply mission variables before starting
local function resetFrecencyDataUi()
if im.Button("Reset Node Library Usage Data", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.setPreference("flowgraph.general.nodeFrecency", {})
for _, name in ipairs(sortedNames) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(20, 20)) then
del = name
@/lua/ge/extensions/editor/raceEditor/trackLayout.lua
function C:drawGeneralInfo()
im.BeginChild1("Layout", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
if classification[field] then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
else
else
editor.uiIconImage(editor.icons.close, im.ImVec2(24, 24))
end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
im.SameLine()
im.Dummy(im.ImVec2(8, 1))
im.SameLine()
im.TableSetColumnIndex(2)
if editor.uiIconImageButton(node.__hidden and editor.icons.visibility_off or editor.icons.visibility, im.ImVec2(16,16)) then
if not node.__hidden then
im.SameLine()
im.Dummy(im.ImVec2(3, 1))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(vEditor.propertyTableEditTarget == node and editor.icons.send or editor.icons.mode_edit, im.ImVec2(16,16)) then
editor.showWindow('Part Properties')
im.SameLine()
im.Dummy(im.ImVec2(3, 1))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(node.__selected and editor.icons.filter_none or editor.icons.select_all, im.ImVec2(16,16)) then
-- highlight this node and all its children
if ast then
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 2))
im.PushFont2(1) -- 1= monospace? PushFont3("cairo_semibold_large")
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,400))
end
@/lua/ge/extensions/editor/roadEditor.lua
local lastMousePos = im.ImVec2(0,0)
local roadMaterialTagString = "RoadAndPath"
im.PushID1(string.format('template_%d', i))
if im.ImageButton(editor_roadUtils.getMaterials()[i].texId, im.ImVec2(128, 128), im.ImVec2Zero, im.ImVec2One, 1, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then
templateDialogOpen[0] = false
if matIndex then
if im.ImageButton(editor_roadUtils.getMaterials()[matIndex].texId, im.ImVec2(128, 128), im.ImVec2Zero, im.ImVec2One, 1, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then
templateDialogOpen[0] = true
if (isAnyNodeSelected()) then
im.BeginChild1("node", im.ImVec2(0, 130), true)
im.Text("Node Properties")
local buttonTextSuffix = tableIsEmpty(roadAndNodeIDsTbl) and "" or "s"
if im.Button("Split Road"..buttonTextSuffix, im.ImVec2(0,0)) then
splitRoads(roadAndNodeIDsTbl)
if not tableIsEmpty(selectedRoadsIds) then
im.BeginChild1("RoadOps", im.ImVec2(0, 130), true)
im.Text("Road Operations")
im.Text("Road Operations")
if im.Button("Flip Direction", im.ImVec2(0,0)) then
flipSelectedRoadsDirection()
if shouldShowFuseOption then
if im.Button("Fuse Roads", im.ImVec2(0,0)) then
fuseRoads()
editor.registerCustomFieldInspectorFilter("DecalRoad", "Material", customDecalRoadMaterialsFilter)
editor.registerModalWindow(roadNotSelectableErrorWindowName, im.ImVec2(600, 400))
@/lua/ge/extensions/editor/flowgraph/references.lua
local filterModes = { { mode = 'All', tooltip = 'Filters through all nodes.' }, { mode = 'Current', tooltip = 'Filters through the nodes of the current project.' }, { mode = 'unused', tooltip = 'Filters through all unused nodes.' } }
local buttonSize = im.ImVec2(32, 32)
local pinPreviewSize = 24
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150, 300), nil, false)
self.searchResult = {}
end
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
local pos1 = 1
if not self.nodeTable or self.nodeTable == {} then
if im.Button("Load Data", im.ImVec2(-1, 0)) then
self:createNodeTable()
im.SameLine()
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(6, 6.5 * editor.getPreference("ui.general.scale")))
im.PushItemWidth(im.GetContentRegionAvailWidth() * 0.55)
for _, n in pairs(self.filteredNodes) do
if editor.uiIconImageButton(editor.icons.subdirectory_arrow_right, im.ImVec2(24, 24)) then
self.inspectedNode = n.nodeName
im.TableSetBgColor(im.TableBgTarget_CellBg, im.GetColorU322(columnBackground), 2)
im.Dummy(im.ImVec2(0, 3))
im.TableNextColumn()
im.TableNextColumn()
im.Dummy(im.ImVec2(0, 3))
im.TableNextColumn()
im.TableNextColumn()
im.Dummy(im.ImVec2(0, 3))
im.TableNextColumn()
if editor.uiIconImageButton(editor.icons.folder_open, im.ImVec2(24, 24)) then
editor_flowgraphEditor.openFile({ filepath = p.projectFile }, true)
@/lua/ge/extensions/gameplay/rally/tools/devTools.lua
im.Separator()
if im.Button("Ok", im.ImVec2(120,0)) then
local currentPath = editor_rallyEditor.getCurrentPath()
im.SameLine()
if im.Button("Cancel", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
@/lua/ge/extensions/flowgraph/nodes/states/stateNode.lua
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
if self.targetGraph and self.targetGraph.state and self.targetGraph.state.active then
@/lua/ge/extensions/editor/dynamicDecals/inspector/utils.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "button")) then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "removeButton")) then
layer[property] = removeTextureOverridePath or "/"
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
local cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomLeft"), editor.getTempFloatArray4_TableTable(gradientColorBottomLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
im.GetWindowDrawList(),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
gradientColorTopLeftU32,
-- adding an invisible button so the imgui cursor is at the right location
im.InvisibleButton("GradientButton", im.ImVec2(size, size))
im.SameLine()
cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomRight"), editor.getTempFloatArray4_TableTable(gradientColorBottomRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
end
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size + im.GetStyle().ItemSpacing.y))
im.NewLine()
@/lua/ge/extensions/editor/assetBrowser.lua
var.minThumbnailSize = math.ceil(im.GetFontSize())
var.tooltipThumbnailSize = im.ImVec2(64,64)
var.maxTooltipThumbnailSize = 256
var.iconSize = im.ImVec2(var.minThumbnailSize, var.minThumbnailSize)
var.assetViewMainPanelHeight = nil
var.assetViewMainPanelSize = im.ImVec2(0,0)
if var.imageInspectorImage.ratio < 1 then
var.imageInspectorWindowSize = im.ImVec2(var.imageInspectorWindowMaxSize, var.imageInspectorWindowMaxSize * var.imageInspectorImage.ratio)
else
else
var.imageInspectorWindowSize = im.ImVec2(var.imageInspectorWindowMaxSize / var.imageInspectorImage.ratio, var.imageInspectorWindowMaxSize)
end
if var.imageInspectorImage.ratio < 1 then
var.imageInspectorWindowSize = im.ImVec2(var.imageInspectorWindowMinWidthSize, var.imageInspectorWindowMinWidthSize * var.imageInspectorImage.ratio)
else
else
var.imageInspectorWindowSize = im.ImVec2(var.imageInspectorWindowMinWidthSize, var.imageInspectorWindowMinWidthSize / var.imageInspectorImage.ratio)
end
else
var.imageInspectorWindowSize = im.ImVec2(var.imageInspectorImage.size.x, var.imageInspectorImage.size.y)
end
editor.assetDragDrop.dragImage.tex:getID(),
im.ImVec2(sizex, sizey),
nil, nil, nil,
-- Either draw a custom popup or make it selectable and show its properties in the inspector.
-- im.SetNextWindowSize(im.ImVec2(0, im.GetContentRegionAvail().y))
im.tooltip(tooltip)
)
editor.uiIconImage(editor.icons.folder, im.ImVec2(thumbSize, thumbSize))
local dirName = (parentDir == true) and "[...]" or dir.name
img.tex:getID(),
im.ImVec2(sizex, sizey),
nil, nil, nil,
local uiScaling = editor.getPreference("ui.general.scale") or defaultUiScale;
local imgSize = im.ImVec2(var.options.thumbnailSize * uiScaling - 5, var.options.thumbnailSize * uiScaling - 5)
if set.d then
else
editor.uiIconImage(editor.icons.photo_library, im.ImVec2(var.options.thumbnailSize, var.options.thumbnailSize))
end
im.SetCursorPos(cursorPos)
icon(set, im.ImVec2(var.options.thumbnailSize/4, var.options.thumbnailSize/4), im.GetStyleColorVec4(im.Col_Text))
-- if file.selected then im.TextColored(im.GetStyleColorVec4(im.Col_ButtonActive), file.fullFileName) else im.TextUnformatted(file.fullFileName) end
if im.BeginChild1("AssetViewChild_" .. material.name .. "_" .. material.id, childSize, true, im.flags(im.WindowFlags_NoScrollWithMouse, im.WindowFlags_NoScrollbar)) then
icon(material, im.ImVec2(var.options.thumbnailSize, var.options.thumbnailSize), nil)
end
or editor.icons.keyboard_arrow_right,
im.ImVec2(var.minThumbnailSize, var.minThumbnailSize), nil, nil, nil, "##" .. file.id
) then
end
im.SetCursorPos(im.ImVec2(startCursorPos.x + var.minThumbnailSize, startCursorPos.y))
local buttonWidth = im.CalcTextSize(file.fullFileName).x + 2 * var.style.FramePadding.x
local buttonWidth = im.CalcTextSize(file.fullFileName).x + 2 * var.style.FramePadding.x
if im.Button("##" .. tostring(file.id), im.ImVec2(buttonWidth,var.fontSize)) then
selectAsset(file)
im.PopStyleColor()
im.SetCursorPos(im.ImVec2(startCursorPos.x + var.minThumbnailSize + var.style.FramePadding.x, startCursorPos.y))
if file.selectedInABView == true then im.PushStyleColor2(im.Col_Text, im.GetStyleColorVec4(im.Col_ButtonActive)) end
editor.getTempTextureObj(path).tex:getID(),
im.ImVec2(sizex, sizey),
nil, nil, nil,
editor.getTempTextureObj(file.path or "").tex:getID(),
im.ImVec2(var.options.thumbnailSize * uiScaling - 5, var.options.thumbnailSize * uiScaling - 5),
nil, nil, nil,
im.SetCursorPos(topLeft)
icon(file, im.ImVec2(var.options.thumbnailSize/4, var.options.thumbnailSize/4))
im.SetCursorPos(botRight)
editor.getTempTextureObj(file.inspectorData.cachePath).tex:getID(),
im.ImVec2(var.options.thumbnailSize * uiScaling - 5, var.options.thumbnailSize * uiScaling - 5),
nil, nil, nil,
im.SetCursorPos(topLeft)
icon(file, im.ImVec2(var.options.thumbnailSize/4, var.options.thumbnailSize/4))
im.SetCursorPos(botRight)
elseif file.type == "materials" then
icon(file, im.ImVec2(var.options.thumbnailSize, var.options.thumbnailSize), (file.selectedInABView == true and im.GetStyleColorVec4(im.Col_ButtonActive) or im.GetStyleColorVec4(im.Col_Text)))
local oldPos = im.GetCursorPos()
local cpos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cpos.x-var.style.WindowPadding.x-var.minThumbnailSize, cpos.y))
im.PushStyleColor2(im.Col_Button, im.ImVec4(0,0,0,0.1))
and editor.icons.keyboard_arrow_left
or editor.icons.keyboard_arrow_right, im.ImVec2(var.minThumbnailSize, var.minThumbnailSize), nil, nil, nil, "##" .. file.id) then
file.open = not file.open
else
icon(file, im.ImVec2(var.options.thumbnailSize, var.options.thumbnailSize), (file.selectedInABView == true and im.GetStyleColorVec4(im.Col_ButtonActive) or im.GetStyleColorVec4(im.Col_Text)))
end
local actualThumbnailSize = var.options.thumbnailSize * (editor.getPreference("ui.general.scale") or defaultUiScale)
local colorCodePosA = im.ImVec2(winPos.x + colorCodePos.x, winPos.y + colorCodePos.y + actualThumbnailSize - var.assetColorCodeHeight)
-- => -2 = minus border
-- => -2 = minus border
local colorCodePosB = im.ImVec2(winPos.x + colorCodePos.x + actualThumbnailSize - 3, winPos.y + colorCodePos.y + actualThumbnailSize - var.assetColorCodeHeight)
local cPosStart = im.GetCursorPos()
if im.Button("##" .. group.identifier .. "_CollapsingHeader", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
group.open = not group.open
im.SetCursorPos(im.ImVec2(cPosStart.x + var.style.FramePadding.x, cPosStart.y + var.style.FramePadding.y))
-- Draw arrow indicating whether the collapsing header is open or not and the group identifier within the button.
-- Draw arrow indicating whether the collapsing header is open or not and the group identifier within the button.
editor.uiIconImage(group.open == true and editor.icons.keyboard_arrow_down or editor.icons.keyboard_arrow_right, im.ImVec2(var.fontSize, var.fontSize))
im.SetCursorPos(im.ImVec2(cPosStart.x + var.fontSize + 3 * var.style.FramePadding.x, cPosStart.y + var.style.FramePadding.y))
editor.uiIconImage(group.open == true and editor.icons.keyboard_arrow_down or editor.icons.keyboard_arrow_right, im.ImVec2(var.fontSize, var.fontSize))
im.SetCursorPos(im.ImVec2(cPosStart.x + var.fontSize + 3 * var.style.FramePadding.x, cPosStart.y + var.style.FramePadding.y))
im.TextUnformatted(group.identifier .. " (" .. tostring(#var.filteredAssetGroups[group.identifier]) .. ")")
var.assetViewMainPanelHeight = var.windowSize.y - (2*var.menuBarHeight - 6 + 3*var.style.WindowPadding.y + 1*var.style.FramePadding.y +2*var.style.ChildBorderSize + var.inputFieldSize)
if im.BeginChild1("Assets##AssetMainPanel", im.ImVec2(0, var.assetViewMainPanelHeight), true, im.WindowFlags_NoScrollWithMouse) then
var.assetViewScrollMax = im.GetScrollMaxY()
-- is set to the minimal asset size possible, we're going to render a list view.
local childSize = (var.options.thumbnailSize <= var.minThumbnailSize) and -1 or im.ImVec2(var.options.thumbnailSize + var.style.WindowPadding.x * 2, var.options.thumbnailSize + 2 * var.style.WindowPadding.y + var.style.ItemSpacing.x + var.fontSize - 5)
-- [Debug]
local sizeY = dirsCount * var.fontSize + (dirsCount - 1) * var.style.ItemSpacing.y
im.SetNextWindowPos(im.ImVec2(pos.x, pos.y - sizeY))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(2,2))
im.SetNextWindowPos(im.ImVec2(pos.x, pos.y - sizeY))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(2,2))
if im.BeginPopup("childrenDirectoryPopup_" .. dir.path) then
for _, dir in ipairs(dir.dirs) do
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4,0))
if im.Button(dir.name, im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4,0))
if im.Button(dir.name, im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
selectDirectory(dir, nil, nil, true)
editor.icons.keyboard_arrow_right,
im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling),
nil, nil, nil, ">##" .. dir.path
local cursorPos = im.GetCursorPos()
chilrenDirectoryPopupButton(dir, im.ImVec2(var.windowPos.x + cursorPos.x, var.windowPos.y + cursorPos.y))
im.SameLine()
if editor.selection["asset"] ~= nil and editor.selection["asset"].type ~= "textureSet" and editor.selection["asset"].dir == var.selectedDirectory then
chilrenDirectoryPopupButton(var.selectedDirectory, im.ImVec2(var.windowPos.x + cursorPos.x, var.windowPos.y + cursorPos.y))
im.SameLine()
elseif var.selectedDirectory.dirCount > 0 then
chilrenDirectoryPopupButton(var.selectedDirectory, im.ImVec2(var.windowPos.x + cursorPos.x, var.windowPos.y + cursorPos.y))
end
if drawWithIcons == true then
editor.uiIconImage(editor.icons.ab_thumbnails_small, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling))
im.SameLine()
im.SameLine()
editor.uiIconImage(editor.icons.ab_thumbnails_big, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling))
end
im.BeginDisabled(var.historyIndex == 1 and true or false)
if editor.uiIconImageButton(editor.icons.arrow_back, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling), nil, nil, nil, "historyBack") then
if var.historyIndex > 1 then
im.BeginDisabled(var.historyIndex >= #var.history and true or false)
if editor.uiIconImageButton(editor.icons.arrow_forward, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling), nil, nil, nil, "historyForward") then
if #var.history > var.historyIndex then
im.PushStyleColor2(im.Col_Button, im.ImVec4(0,0,0,0))
local open_popup = editor.uiIconImageButton(editor.icons.star, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling), editor.color.gold.Value, nil, nil, "SaveFilterDropdownButton")
im.PopStyleColor()
local popupPos = im.ImVec2(0,0)
im.SetNextWindowPos(popupPos)
im.SetNextWindowSize(im.ImVec2(0, 0), im.Cond_Always)
if im.BeginPopup("SaveFilterDropdown") then
im.PopItemWidth()
if im.Button("Save", im.ImVec2(var.saveFilterNameInputWidth, var.inputFieldSize)) then
if #ffi.string(var.saveFilterNameInput) > 0 then
im.PushStyleColor2(im.Col_Button, im.ImVec4(0,0,0,0))
local open_popup = editor.uiIconImageButton(editor.icons.ab_filter_by_type, im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling), nil, nil, nil, "FilterDropdownButton")
im.PopStyleColor()
local popupPos = im.ImVec2(
cursorX + var.windowPos.x + var.inputFieldSize - (var.fontSize + var.style.ItemSpacing.x + 2 * var.style.ItemSpacing.x + 2 * var.style.WindowPadding.x + im.CalcTextSize("prefab").x),
)
local popupPosRmb = im.ImVec2(
cursorX + var.windowPos.x + var.inputFieldSize - (im.CalcTextSize("Disable all").x + 2 * var.style.WindowPadding.x) ,
im.SetNextWindowPos(popupPos)
im.SetNextWindowSize(im.ImVec2(100, im.GetContentRegionAvail().y - var.menuBarHeight - var.style.WindowPadding.y - var.inputFieldSize))
if im.BeginPopup("FilterByTypeDropdown") then
if type.active[0] == true then
editor.uiIconImage(editor.icons.done, im.ImVec2(var.fontSize / uiScaling,var.fontSize / uiScaling))
im.SameLine()
im.SetNextWindowPos(popupPosRmb)
im.SetNextWindowSize(im.ImVec2(0, 0), im.Cond_Always)
if im.BeginPopup("FilterByTypeDropdown_rmb") then
local uiScaling = editor.getPreference("ui.general.scale") or defaultUiScale;
local iconSize = im.ImVec2(var.inputFieldSize / uiScaling, var.inputFieldSize / uiScaling)
)
if im.Button(dirText, im.ImVec2(0, var.inputFieldSize)) then
var.options.filter_displayDirs = not var.options.filter_displayDirs
)
if im.Button(assetText, im.ImVec2(0 ,var.inputFieldSize)) then
var.options.filter_displayAssets = not var.options.filter_displayAssets
)
if im.Button(setText, im.ImVec2(0 ,var.inputFieldSize)) then
var.options.filter_displayTextureSets = not var.options.filter_displayTextureSets
if editor.isWindowVisible(assetBrowserImageInspectorWindowName) and var.imageInspectorWindowSize then
im.SetNextWindowSize(im.ImVec2(
var.imageInspectorWindowSize.x + 2 * var.style.WindowPadding.x + 2 * var.style.WindowBorderSize,
if var.imageInspectorImageSize.x ~= var.imageInspectorImageSize.y / var.imageInspectorImage.ratio then
im.SetNextWindowSize(im.ImVec2(
var.imageInspectorImageSize.x + 2 * var.style.WindowPadding.x + 2 * var.style.WindowBorderSize,
else
var.imageInspectorImageSize = im.ImVec2(windowSize.x - 2 * var.style.WindowPadding.x - 2 * var.style.WindowBorderSize, windowSize.y - 2 * var.style.WindowPadding.y - var.menuBarHeight - 2 * var.style.WindowBorderSize - var.minThumbnailSize)
end
or editor.icons.grid_on,
im.ImVec2(var.minThumbnailSize, var.minThumbnailSize), nil, nil, nil, "Checkerboard"
) then
or editor.icons.lens,
im.ImVec2(var.minThumbnailSize, var.minThumbnailSize), nil, nil, nil, "White Background"
) then
local cursorPos = initialCursorPos
local uv1 = im.ImVec2(1, 1)
local offsetInRow = var.imageInspectorImageSize.x % texToDraw.size.x
uv1.y = isLastTileInCol and (lastTileHeightInCol/texToDraw.size.y) or 1
local texSize = im.ImVec2(texToDraw.size.x * uv1.x, texToDraw.size.y * uv1.y)
im.Image(texToDraw.tex:getID(), texSize, nil, uv1, nil, nil)
im.Image(texToDraw.tex:getID(), texSize, nil, uv1, nil, nil)
im.SetCursorPos(im.ImVec2(cursorPos.x + texSize.x, cursorPos.y))
end
end
im.SetCursorPos(im.ImVec2(initialCursorPos.x, initialCursorPos.y + rowIndex * texToDraw.size.y))
end
end
im.Dummy(im.ImVec2(0, 3*var.style.ItemSpacing.y))
if im.TreeNode1('rawdata##' .. asset.path) then
img.tex:getID(),
im.ImVec2(width, height),
im.ImVec2Zero,
var.meshPreview:renderWorld(var.meshPreviewDimRdr)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1("MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1("MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
var.meshPreview:ImGui_Image(var.meshPreviewRenderSize[1],var.meshPreviewRenderSize[2])
editor.registerInspectorTypeHandler("asset", assetInspectorGui)
editor.registerWindow(assetBrowserWindowName, im.ImVec2(800, 500))
editor.registerWindow(assetBrowserImageInspectorWindowName)
im.BeginChild1("abPrefs_directoriesToLoadChild", im.ImVec2(0, 250))
table.sort(sortedTbl)
im.BeginChild1("abTypeColorsTblChild", im.ImVec2(0, 300))
im.Columns(2)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/fill.lua
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
editor.registerWindow(fillLayer_add_windowName, im.ImVec2(360, 140), nil, nil, nil, true)
end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua
-- local btnSize = im.GetFontSize() + 2 * im.GetStyle().FramePadding.y
-- if editor.uiIconImageButton(editor.icons.add, im.ImVec2(btnSize, btnSize), nil, nil, nil, string.format("PropertiesAddButton_%s_%s", guiId, layer.uid)) then
-- im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
if im.Button(string.format("Add##LinkedSet_%s_%s", guiId, layer.uid), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
im.Separator()
if im.Button(string.format("Apply##%s_%s_LinkedSetProperties", layer.uid, guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
setPropertiesInChildrenRec(layer, layer.properties)
if layer.propertiesDirty then
im.Dummy(im.ImVec2(0, im.GetStyle().ItemSpacing.y * 2))
if im.BeginChild1("PropertiesDirtyInfoChild", nil, true) then
@/lua/ge/extensions/editor/toolUtilities/meshAuditionMgr.lua
local im = ui_imgui
local meshSelectWinName, meshSelectWinSize = 'meshSelect', im.ImVec2(300, 300)
local sin, cos = math.sin, math.cos
im.TableSetColumnIndex(2)
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(24, 24), nil, nil, nil, 'folderSelectBtn') then
extensions.editor_fileDialog.openFile(
im.TableSetColumnIndex(3)
if editor.uiIconImageButton(editor.icons.ab_asset_jbeam, im.ImVec2(24, 24), nil, nil, nil, 'defaultFoldersBtn') then
staticMeshPaths = deepcopy(defaultStaticMeshPaths)
im.Separator()
im.BeginChild1("meshListScrollArea", im.ImVec2(-1, -1))
if im.BeginListBox('##meshListBox', im.ImVec2(-1, -1)) then
im.BeginChild1("meshListScrollArea", im.ImVec2(-1, -1))
if im.BeginListBox('##meshListBox', im.ImVec2(-1, -1)) then
im.Columns(1, "meshSelectListboxColumns")
@/lua/ge/extensions/editor/newsMessage.lua
imgui.Spacing()
if imgui.Button("Close##newsCloseBtn", imgui.ImVec2(120, 0)) then editor.closeModalWindow(newsDlgName) end
end
@/lua/ge/extensions/flowgraph/baseStateNode.lua
--make each pin individually.
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
ufe.BeginPin(self.transitionPins._in.N.id, ufe.PinKind_Input)
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y+nodeRect.h*2/3))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y+nodeRect.h*2/3))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
ufe.BeginPin(self.transitionPins._in.W.id, ufe.PinKind_Input)
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w*2/3, nodeRect.y+nodeRect.h))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w*2/3, nodeRect.y+nodeRect.h))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
ufe.BeginPin(self.transitionPins._in.S.id, ufe.PinKind_Input)
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
ufe.BeginPin(self.transitionPins._in.E.id, ufe.PinKind_Input)
-- out pins have no arrows and are cw side
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w*2/3, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w*2/3, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
ufe.BeginPin(self.transitionPins._out.N.id, ufe.PinKind_Output)
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
ufe.BeginPin(self.transitionPins._out.W.id, ufe.PinKind_Output)
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y+nodeRect.h))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
im.SetCursorPos(im.ImVec2(nodeRect.x, nodeRect.y+nodeRect.h))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(nodeRect.w/3,pivotSize))
ufe.BeginPin(self.transitionPins._out.S.id, ufe.PinKind_Output)
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w, nodeRect.y+nodeRect.h*2/3))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
im.SetCursorPos(im.ImVec2(nodeRect.x+nodeRect.w, nodeRect.y+nodeRect.h*2/3))
ufe.PushStyleVar2(ufe.StyleVar_PivotSize,im.ImVec2(pivotSize,nodeRect.h/3))
ufe.BeginPin(self.transitionPins._out.E.id, ufe.PinKind_Output)
@/lua/ge/extensions/editor/flowgraph/events.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
end
im.Columns(1)
im.BeginChild1("eventLogChild", im.ImVec2(avail.x-1, avail.y -24))
@/lua/ge/extensions/editor/raceEditor/timeTrials.lua
function C:drawGeneralInfo()
im.BeginChild1("General", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
editEnded = im.BoolPtr(false)
if editor.uiInputTextMultiline("Description", descText, 2048, im.ImVec2(0,60), nil, nil, nil, editEnded) then
end im.tooltip("The description of the track.")
if previewTex then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
if im.IsItemHovered() then
else
editor.uiIconImage(editor.icons.error_outline, im.ImVec2(24, 24))
im.tooltip("None found at " .. self.previewPath.."\nClick to refresh.")
im.Separator()
local size = im.ImVec2(previewTex.size.x, previewTex.size.y)
local avail = im.GetContentRegionAvail()
if classification[field] then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
else
else
editor.uiIconImage(editor.icons.close, im.ImVec2(24, 24))
end
if at then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
im.tooltip("Found file at " .. at)
else
editor.uiIconImage(editor.icons.error_outline, im.ImVec2(24, 24))
local str = "No file at:"
for i, prefab in ipairs(list) do
if editor.uiIconImageButton(editor.icons.delete_forever, im.ImVec2(24, 24), nil, nil, nil,'##rem'..prefab..i) then
rem = i
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/path.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s", layer.uid, guiId, "pathLayerFontPath_fileDialog")) then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s", layer.uid, guiId, "pathLayerFontPath_removeButton")) then
layer.fontPath = editor.getTempCharPtr()
im.SameLine()
if editor.uiIconImageButton(editor.icons.replay, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "textCharacterPositions_resetValue", k)) then
local val = (1.0 / (#layer.text - 1) * (k-1))
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_removeDataPointsEntry", k)) then
table.remove(layer.dataPoints, k)
if k == count then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_insertDataPointsEntry", k)) then
local nextPoint = layer.dataPoints[k + 1]
if editor.uiIconImageButton(editor.icons.move, im.ImVec2(tool.getIconSize(), tool.getIconSize()), (gizmo.data.uid == layer.uid and gizmo.data.dataPointIndex == k) and editor.color.beamng.Value or nil, nil, nil, string.format("MovePathPoint_%s_%d", layer.uid, k)) then
local layerData = deepcopy(layer)
local vertSeparatorHeight = im.GetContentRegionAvail().y
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
end
@/lua/ge/extensions/editor/missionEditor/dev.lua
editor.uiInputTextMultiline("##Description", self.devText, 2048, im.ImVec2(0,40), nil, nil, nil, editEnded)
if editEnded[0] then
@/lua/ge/extensions/career/modules/linearTutorial.lua
im.Dummy(im.ImVec2(1,3))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(1,3))
for _, file in ipairs(introPopupFiles) do
if not next(file) then
im.Dummy(im.ImVec2(1,3))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(1,3))
else
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
function M.BeginChild1(string_str_id, ImVec2_size, bool_border, ImGuiWindowFlags_flags)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if bool_border == nil then bool_border = false end
function M.BeginChild2(ImGuiID_id, ImVec2_size, bool_border, ImGuiWindowFlags_flags)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if bool_border == nil then bool_border = false end
if ImGuiCond_cond == nil then ImGuiCond_cond = 0 end
if ImVec2_pivot == nil then ImVec2_pivot = M.ImVec2(0,0) end
imgui.SetNextWindowPos(ImVec2_pos, ImGuiCond_cond, ImVec2_pivot)
function M.Button(string_label, ImVec2_size)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if string_label == nil then log("E", "", "Parameter 'string_label' of function 'Button' cannot be nil, as the c type is 'const char *'") ; return end
function M.ProgressBar(float_fraction, ImVec2_size_arg, string_overlay)
if ImVec2_size_arg == nil then ImVec2_size_arg = M.ImVec2(-FLT_MIN,0) end
-- string_overlay is optional and can be nil
function M.Image(ImTextureID_user_texture_id, ImVec2_size, ImVec2_uv0, ImVec2_uv1, ImVec4_tint_col, ImVec4_border_col)
if ImVec2_uv0 == nil then ImVec2_uv0 = M.ImVec2(0,0) end
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(1,1) end
if ImVec2_uv0 == nil then ImVec2_uv0 = M.ImVec2(0,0) end
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(1,1) end
if ImVec4_tint_col == nil then ImVec4_tint_col = M.ImVec4(1,1,1,1) end
function M.ImageButton(string_str_id, ImTextureID_user_texture_id, ImVec2_size, ImVec2_uv0, ImVec2_uv1, ImVec4_bg_col, ImVec4_tint_col)
if ImVec2_uv0 == nil then ImVec2_uv0 = M.ImVec2(0,0) end
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(1,1) end
if ImVec2_uv0 == nil then ImVec2_uv0 = M.ImVec2(0,0) end
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(1,1) end
if ImVec4_bg_col == nil then ImVec4_bg_col = M.ImVec4(0,0,0,0) end
function M.InputTextMultiline(string_label, string_buf, size_t_buf_size, ImVec2_size, ImGuiInputTextFlags_flags, ImGuiInputTextCallback_callback, void_user_data)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if ImGuiInputTextFlags_flags == nil then ImGuiInputTextFlags_flags = 0 end
if ImGuiColorEditFlags_flags == nil then ImGuiColorEditFlags_flags = 0 end
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if string_desc_id == nil then log("E", "", "Parameter 'string_desc_id' of function 'ColorButton' cannot be nil, as the c type is 'const char *'") ; return end
if ImGuiSelectableFlags_flags == nil then ImGuiSelectableFlags_flags = 0 end
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if string_label == nil then log("E", "", "Parameter 'string_label' of function 'Selectable1' cannot be nil, as the c type is 'const char *'") ; return end
if ImGuiSelectableFlags_flags == nil then ImGuiSelectableFlags_flags = 0 end
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if string_label == nil then log("E", "", "Parameter 'string_label' of function 'Selectable2' cannot be nil, as the c type is 'const char *'") ; return end
function M.BeginListBox(string_label, ImVec2_size)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if string_label == nil then log("E", "", "Parameter 'string_label' of function 'BeginListBox' cannot be nil, as the c type is 'const char *'") ; return end
if float_scale_max == nil then float_scale_max = FLT_MAX end
if ImVec2_graph_size == nil then ImVec2_graph_size = ImVec2(0,0) end
if int_stride == nil then int_stride = ffi.sizeof('float') end
if float_scale_max == nil then float_scale_max = FLT_MAX end
if ImVec2_graph_size == nil then ImVec2_graph_size = ImVec2(0,0) end
if int_stride == nil then int_stride = ffi.sizeof('float') end
if ImGuiTableFlags_flags == nil then ImGuiTableFlags_flags = 0 end
if ImVec2_outer_size == nil then ImVec2_outer_size = M.ImVec2(0.0,0.0) end
if float_inner_width == nil then float_inner_width = 0 end
function M.DockSpace(ImGuiID_id, ImVec2_size, ImGuiDockNodeFlags_flags, ImGuiWindowClass_window_class)
if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
if ImGuiDockNodeFlags_flags == nil then ImGuiDockNodeFlags_flags = 0 end
function M.ImDrawList_AddImage(ImDrawList_ctx, ImTextureID_user_texture_id, ImVec2_p_min, ImVec2_p_max, ImVec2_uv_min, ImVec2_uv_max, ImU32_col)
if ImVec2_uv_min == nil then ImVec2_uv_min = M.ImVec2(0,0) end
if ImVec2_uv_max == nil then ImVec2_uv_max = M.ImVec2(1,1) end
if ImVec2_uv_min == nil then ImVec2_uv_min = M.ImVec2(0,0) end
if ImVec2_uv_max == nil then ImVec2_uv_max = M.ImVec2(1,1) end
if ImU32_col == nil then ImU32_col = IM_COL32_WHITE end
function M.ImDrawList_AddImageQuad(ImDrawList_ctx, ImTextureID_user_texture_id, ImVec2_p1, ImVec2_p2, ImVec2_p3, ImVec2_p4, ImVec2_uv1, ImVec2_uv2, ImVec2_uv3, ImVec2_uv4, ImU32_col)
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(0,0) end
if ImVec2_uv2 == nil then ImVec2_uv2 = M.ImVec2(1,0) end
if ImVec2_uv1 == nil then ImVec2_uv1 = M.ImVec2(0,0) end
if ImVec2_uv2 == nil then ImVec2_uv2 = M.ImVec2(1,0) end
if ImVec2_uv3 == nil then ImVec2_uv3 = M.ImVec2(1,1) end
if ImVec2_uv2 == nil then ImVec2_uv2 = M.ImVec2(1,0) end
if ImVec2_uv3 == nil then ImVec2_uv3 = M.ImVec2(1,1) end
if ImVec2_uv4 == nil then ImVec2_uv4 = M.ImVec2(0,1) end
if ImVec2_uv3 == nil then ImVec2_uv3 = M.ImVec2(1,1) end
if ImVec2_uv4 == nil then ImVec2_uv4 = M.ImVec2(0,1) end
if ImU32_col == nil then ImU32_col = IM_COL32_WHITE end
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
im.PushStyleColor2(im.Col_MenuBarBg, editor.color.transparent.Value)
if im.BeginChild1("vehicleEditorSpecificEditorToolbar", im.ImVec2(width, im.GetFrameHeight()), true, innerToolbarFlags) then
if im.BeginMenuBar() then
im.PushStyleColor2(im.Col_MenuBarBg, editor.color.transparent.Value)
if im.BeginChild1("vehicleEditorSpecificEditorToolbar", im.ImVec2(width - camTodSize, im.GetFrameHeight()), true, innerToolbarFlags) then
if im.BeginMenuBar() then
@/lua/ge/extensions/editor/roadArchitect.lua
local win = {
toolWinName = 'roadArchitect', toolWinSize = im.ImVec2(300, 300), -- The main tool window of the editor. The main UI entry point.
materialSelectWinName = 'materialSelect', materialSelectWinSize = im.ImVec2(300, 300), -- The material selection window.
toolWinName = 'roadArchitect', toolWinSize = im.ImVec2(300, 300), -- The main tool window of the editor. The main UI entry point.
materialSelectWinName = 'materialSelect', materialSelectWinSize = im.ImVec2(300, 300), -- The material selection window.
meshSelectWinName = 'meshSelect', meshSelectWinSize = im.ImVec2(300, 300), -- The static mesh selection window.
materialSelectWinName = 'materialSelect', materialSelectWinSize = im.ImVec2(300, 300), -- The material selection window.
meshSelectWinName = 'meshSelect', meshSelectWinSize = im.ImVec2(300, 300), -- The static mesh selection window.
nodeEditWinName = 'NodeEditWindow', nodeEditWinSize = im.ImVec2(712, 310), -- The individual road node editor window (secondary window).
meshSelectWinName = 'meshSelect', meshSelectWinSize = im.ImVec2(300, 300), -- The static mesh selection window.
nodeEditWinName = 'NodeEditWindow', nodeEditWinSize = im.ImVec2(712, 310), -- The individual road node editor window (secondary window).
profilesListWinName = 'ProfilesListWindow', profilesListWinSize = im.ImVec2(350, 370), -- The lateral road profiles list window (primary window).
nodeEditWinName = 'NodeEditWindow', nodeEditWinSize = im.ImVec2(712, 310), -- The individual road node editor window (secondary window).
profilesListWinName = 'ProfilesListWindow', profilesListWinSize = im.ImVec2(350, 370), -- The lateral road profiles list window (primary window).
profileEditWinName = 'ProfileEditWindow', profileEditWinSize = im.ImVec2(845, 490), -- The lateral road profile editor window (secondary window).
profilesListWinName = 'ProfilesListWindow', profilesListWinSize = im.ImVec2(350, 370), -- The lateral road profiles list window (primary window).
profileEditWinName = 'ProfileEditWindow', profileEditWinSize = im.ImVec2(845, 490), -- The lateral road profile editor window (secondary window).
groupsListWinName = 'GroupsListWindow', groupsListWinSize = im.ImVec2(410, 400), -- The groups list window (secondary window).
profileEditWinName = 'ProfileEditWindow', profileEditWinSize = im.ImVec2(845, 490), -- The lateral road profile editor window (secondary window).
groupsListWinName = 'GroupsListWindow', groupsListWinSize = im.ImVec2(410, 400), -- The groups list window (secondary window).
importWinName = 'ImportOptionsWindow', importWinSize = im.ImVec2(230, 200) } -- The import options window (secondary window).
groupsListWinName = 'GroupsListWindow', groupsListWinSize = im.ImVec2(410, 400), -- The groups list window (secondary window).
importWinName = 'ImportOptionsWindow', importWinSize = im.ImVec2(230, 200) } -- The import options window (secondary window).
local vec24, vec28 = im.ImVec2(24, 24), im.ImVec2(28, 28) -- Some commonly-used Imgui vectors.
local vec36, vec40 = im.ImVec2(36, 36), im.ImVec2(40, 40)
local vec24, vec28 = im.ImVec2(24, 24), im.ImVec2(28, 28) -- Some commonly-used Imgui vectors.
local vec36, vec40 = im.ImVec2(36, 36), im.ImVec2(40, 40)
local vec24, vec28 = im.ImVec2(24, 24), im.ImVec2(28, 28) -- Some commonly-used Imgui vectors.
local vec36, vec40 = im.ImVec2(36, 36), im.ImVec2(40, 40)
local vec24, vec28 = im.ImVec2(24, 24), im.ImVec2(28, 28) -- Some commonly-used Imgui vectors.
local vec36, vec40 = im.ImVec2(36, 36), im.ImVec2(40, 40)
im.BeginChild1("topBtnRow1", im.ImVec2(-1, 60), im.WindowFlags_ChildWindow)
im.SetCursorPosY(im.GetCursorPosY() + 5)
im.BeginChild1("ScrollingRegion1", im.ImVec2(-1, 800), im.WindowFlags_ChildWindow)
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 200)) then
im.PushItemWidth(-1)
if im.BeginListBox('###103', im.ImVec2(-1, 200)) then
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 200)) then
if im.BeginListBox('###7777', im.ImVec2(-1, 300)) then
texture.texId,
im.ImVec2(32, 32),
im.ImVec2Zero,
im.PushItemWidth(-1)
if im.BeginListBox('##123', im.ImVec2(300, 500)) then
im.Columns(1, "meshSelectListboxColumns")
im.PushItemWidth(-1)
if im.BeginListBox('##123', im.ImVec2(-1, 300)) then
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
if hasRecording then
if im.Button("Load from Recording", im.ImVec2(-1, 30)) then
self:loadFromRecording()
im.BeginDisabled()
im.Button("Load from Recording (Not Found)", im.ImVec2(-1, 30))
im.EndDisabled()
local buttonLabel = hasFinal and "Existing Final Driveline" or "Create New Driveline"
if im.Button(buttonLabel, im.ImVec2(-1, 30)) then
self:loadFromFinal()
-- Create from Race button
if im.Button("Create from Race", im.ImVec2(-1, 30)) then
self:loadFromRace()
if not self.bufferEnabled then
if im.Button("Generate Buffer (30m)", im.ImVec2(-1, 30)) then
self:generateBuffer()
@/lua/ge/extensions/editor/dragRaceEditor/lanes.lua
M.drawLanesSection = function()
im.BeginChild1("lanes", im.ImVec2(0, 150), true)
im.Text("Lanes")
im.BeginChild1("laneDetails", im.ImVec2(0, 0), true)
im.Text("Lane Details")
@/lua/ge/extensions/flowgraph/nodes/gameplay/isWalking.lua
if gameplay_walk then
editor.uiIconImage(editor.icons.directions_walk, im.ImVec2(40, 40), gameplay_walk.isWalking() and im.ImVec4(0.3,1,0.3,1) or im.ImVec4(1,1,1,0.3))
end
@/lua/ge/extensions/editor/vehicleBridgeTest.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(400,600))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName = 'Vehicles'})
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
local flexbodyInputTextInput = im.ArrayChar(128)
local flexbodyInputTextPopupPos = im.ImVec2(0,0)
local flexbodyInputTextPopupSize = im.ImVec2(0,0)
local flexbodyInputTextPopupPos = im.ImVec2(0,0)
local flexbodyInputTextPopupSize = im.ImVec2(0,0)
local flexbodyInputTextPopupOpen = false
local nodeInputTextInput = im.ArrayChar(16)
local nodeInputTextPopupPos = im.ImVec2(0,0)
local nodeInputTextPopupSize = im.ImVec2(0,0)
local nodeInputTextPopupPos = im.ImVec2(0,0)
local nodeInputTextPopupSize = im.ImVec2(0,0)
local nodeInputTextPopupOpen = false
local vertexInputTextInput = im.ArrayChar(16)
local vertexInputTextPopupPos = im.ImVec2(0,0)
local vertexInputTextPopupSize = im.ImVec2(0,0)
local vertexInputTextPopupPos = im.ImVec2(0,0)
local vertexInputTextPopupSize = im.ImVec2(0,0)
local vertexInputTextPopupOpen = false
@/lua/ge/extensions/editor/gen/exp_frame.lua
if not editor.isWindowRegistered(wnm) then
editor.registerWindow(wnm) --, im.ImVec2(200, 700))
end
@/lua/ge/extensions/editor/crawlEditor/presets.lua
if self:getShowPresetManager() then
if im.Begin("Component Manager", self:getShowPresetManagerPtr(), nil, im.ImVec2(600, 400)) then
im.Text("Trail Components")
@/lua/ge/extensions/editor/dataBlockEditor.lua
editor.addWindowMenuItem("DataBlock Editor", onWindowMenuItem)
editor.registerWindow(dataBlockEditorWindowName, im.ImVec2(200, 400))
editor.registerWindow(createDataBlockWindowName, im.ImVec2(300, 200))
editor.registerWindow(dataBlockEditorWindowName, im.ImVec2(200, 400))
editor.registerWindow(createDataBlockWindowName, im.ImVec2(300, 200))
dataBlockClasses = getAllDataBlockClasses()
if im.BeginTabItem("Existing") then
im.BeginChild1("Existing_Child", im.ImVec2(0, 0), false)
inExistingTab = true
if im.BeginTabItem("New") then
im.BeginChild1("New_Child", im.ImVec2(0, 0), false)
for className, _ in pairs(dataBlockClasses) do
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth() - 60 * im.uiscale[0], 1))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
if editor.selection.object and editor.selection.object[1] then
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
if editor.selection.object and editor.selection.object[1] then
if confirmationWindowOpen then
im.SetNextWindowPos(im.ImVec2(windowPos.x + 50, windowPos.y + 50), im.Cond_Appearing)
if im.Begin("DataBlock Deleted", nil , 0) then
@/lua/ge/extensions/editor/missionEditor/general.lua
local C = {}
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputTextMultiline("##Description", self.descText, 2048, im.ImVec2(0,100), nil, nil, nil, editEnded)
im.PopItemWidth()
@/lua/ge/extensions/editor/slotTrafficEditor.lua
-- Begin the table
if im.BeginTable("##RoadsTable", 5, tableFlags, im.ImVec2(0, 300)) then
-- Setup columns
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(600, 200))
editor.editModes[editModeName] =
@/lua/ge/extensions/flowgraph/nodes/util/timedSequence.lua
end
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
end
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
local names, groups = dat.names, dat.groups -- The common string values used with cosimulation coupling.
local toolWinName, toolWinSize = 'cosimulationSignalEditor', im.ImVec2(580, 225) -- The main tool window of the editor. The main UI entry point.
local signalsWinName, signalsWinSize = 'SignalsWindow', im.ImVec2(750, 600) -- The vehicle signals window.
local toolWinName, toolWinSize = 'cosimulationSignalEditor', im.ImVec2(580, 225) -- The main tool window of the editor. The main UI entry point.
local signalsWinName, signalsWinSize = 'SignalsWindow', im.ImVec2(750, 600) -- The vehicle signals window.
local isSignalsWinOpen = false -- A flag which indicates if the vehicle signals window is open or closed.
local listHeight = toolWinSize.y - 30
if im.BeginListBox("", im.ImVec2(listWidth, listHeight), im.WindowFlags_ChildWindow) then
local numVehicles = #vehicles
local text = 'Remove this vehicle from scene.'
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), redB, nil, nil, 'removeVehicleButton') then
if not isExecuting then
-- 'Go To Vehicle' button.
if editor.uiIconImageButton(editor.icons.cameraFocusOnVehicle2, im.ImVec2(21, 21), greenB, nil, nil, 'goToVehicleButton') then
core_camera.setByName(0, "orbit", false)
if isSignalsWinOpen and i == selectedVehicleIdx then btnCol = blueD end
if editor.uiIconImageButton(editor.icons.code, im.ImVec2(19, 19), btnCol, nil, nil, 'openSignalsWinButton') then
if i == selectedVehicleIdx or not isSignalsWinOpen then
end
if editor.uiIconImageButton(btnIcon, im.ImVec2(19, 19), btnCol, nil, nil, 'executeToggleButton') then
if not isExecuting then
if selectedVehicleIdx == i then
if editor.uiIconImageButton(editor.icons.floppyDisk, im.ImVec2(19, 19), nil, nil, nil, 'saveSignalsConfig') then
saveConfiguration(vehicles[i])
if selectedVehicleIdx == i then
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(19, 19), dullWhite, nil, nil, 'loadSignalsConfig') then
loadConfiguration(vehicles[i])
-- Top row of checkboxes for each available signals group.
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
-- Signals listbox.
if im.BeginListBox("", im.ImVec2(665, 370), im.WindowFlags_ChildWindow) then
local numSignals = #signals
if signals[i].isIncluded then
if editor.uiIconImageButton(editor.icons.check_box, im.ImVec2(20, 20), redB, nil, nil, 'includeSignalButton') then
signals[i].isIncluded = false
else
if editor.uiIconImageButton(editor.icons.check_box_outline_blank, im.ImVec2(20, 20), redD, nil, nil, 'discludeSignalButton') then
signals[i].isIncluded = true
if signal.readOnly then
if editor.uiIconImageButton(editor.icons.fast_forward, im.ImVec2(20, 20), greenD, nil, nil, 'signalReadOnlyButton') then
end
if signal.isFrom then
if editor.uiIconImageButton(editor.icons.fast_rewind, im.ImVec2(20, 20), greenB, nil, nil, 'signalFromButton') then
signal.isFrom = false
else
if editor.uiIconImageButton(editor.icons.fast_forward, im.ImVec2(20, 20), greenB, nil, nil, 'signalToButton') then
signal.isFrom = true
-- 'Reload Signals' button.
if editor.uiIconImageButton(editor.icons.autorenew, im.ImVec2(28, 28), nil, nil, nil, 'reloadSignals') then
isRequestSent, isVluaDataReturned = false, false
-- 'Unlink All Signals' button.
if editor.uiIconImageButton(editor.icons.unlink, im.ImVec2(28, 28), nil, nil, nil, 'unlinkAllSignals') then
unlinkAllSignals()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
-- Display the proposed message sizes.
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
im.Dummy(im.ImVec2(15, 0))
im.SameLine()
@/lua/ge/extensions/flowgraph/nodes/debug/multiFlow.lua
local iconImage = activeBool and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32), activeColor)
iconImage = activeBool and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32), activeColor)
iconImage = activeBool and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32), activeColor)
iconImage = activeBool and editor.icons.check_box or editor.icons.check_box_outline_blank
editor.uiIconImage(iconImage, im.ImVec2(32, 32), activeColor)
@/lua/ge/extensions/editor/mainToolbar.lua
if editor.getPreference("snapping.terrain.enabled") then bgColor = im.GetStyleColorVec4(im.Col_ButtonActive) else bgColor = nil end
local windowPos = im.ImVec2(im.GetWindowPos().x + im.GetCursorPosX(), im.GetWindowPos().y + im.GetCursorPosY() + 30)
if editor.uiIconImageButton(editor.icons.terrain_snap, nil, nil, nil, bgColor) then
-- Time of Day
if editor.uiIconImageButton(editor.icons.simobject_timeofday, im.ImVec2(iconButtonWidth, iconButtonWidth), nil, nil, nil, nil) then
im.OpenPopup("TODCamSlidersPopup")
-- Editor icons and camera settings
if editor.uiIconImageButton(editor.icons.photo_camera, im.ImVec2(iconButtonWidth, iconButtonWidth), nil, nil, nil, nil) then
im.OpenPopup("EditorIconsAndCameraPopup")
im.SameLine() im.Spacing()
editor.uiVertSeparator(32, im.ImVec2(0,0))
im.Spacing() im.SameLine()
im.SameLine() im.Spacing()
editor.uiVertSeparator(32, im.ImVec2(0,0))
im.Spacing()
local icon = popupOpen and editor.icons.keyboard_arrow_down or editor.icons.menu
if editor.uiIconImageButton(icon, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y), nil, nil, nil) then
im.OpenPopup("EditModeSetsPopup")
-- Edit Mode Sets popup
im.SetNextWindowSizeConstraints(im.ImVec2(200, 300), im.ImVec2(400, 600))
im.SetNextWindowSize(im.ImVec2(0, 0), im.Cond_Always)
-- Edit Mode Sets popup
im.SetNextWindowSizeConstraints(im.ImVec2(200, 300), im.ImVec2(400, 600))
im.SetNextWindowSize(im.ImVec2(0, 0), im.Cond_Always)
im.SetNextWindowSizeConstraints(im.ImVec2(200, 300), im.ImVec2(400, 600))
im.SetNextWindowSize(im.ImVec2(0, 0), im.Cond_Always)
if im.BeginPopup("EditModeSetsPopup", im.WindowFlags_NoCollapse) then
im.SetNextWindowSize(im.ImVec2(900, 500), im.Cond_FirstUseEver)
if im.BeginPopup("CustomizeToolbarLayout", 0) then
im.BeginChild1("EditModeSets", im.ImVec2(200, 400), true)
for i, set in ipairs(editModeSets) do
end
im.BeginChild1("AvailableModes", im.ImVec2(250, 320), true)
if not anyModeSelected then im.BeginDisabled() end
if im.Button("Deselect All##Available", im.ImVec2(120, 25)) then
deselectAllAvailableModes()
im.BeginGroup()
im.Dummy(im.ImVec2(0, 80)) -- Spacing to center buttons vertically
-- Move all to right
if editor.uiIconImageButton(editor.icons.fast_forward, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
-- Move all items to selected list
if not anyModeSelected then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.arrow_forward, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
-- Add selected modes
if not hasSelectedSelected then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.arrow_back, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
-- First find indices to remove
-- Move all to left
if editor.uiIconImageButton(editor.icons.fast_rewind, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
-- Move all items to available list
end
im.BeginChild1("SelectedModes", im.ImVec2(250, 320), true)
-- Don't show available modes for Default Set
if not canMoveUpEnabled then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.arrow_upward, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
moveSelectedModesUp()
if not canMoveDownEnabled then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.arrow_downward, im.ImVec2(editor.getDefaultIconButtonSize().x, editor.getDefaultIconButtonSize().y)) then
moveSelectedModesDown()
if not hasSelectedSelected then im.BeginDisabled() end
if im.Button("Deselect All##Selected", im.ImVec2(120, 25)) then
deselectAllSelectedModes()
im.Spacing()
if im.Button("Close", im.ImVec2(120, 0)) then
modesManagerOpen[0] = false
local pos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(pos.x + 6, pos.y))
local pushedModeBtn = editor.uiIconImageButton(val.icon, nil, nil, nil, bgColor,nil, nil, nil, true)
if maxNumEditModesToShow < numEditModes then
if editor.uiIconImageButton(editor.icons.fast_forward, im.ImVec2(editor.getDefaultIconButtonSize().x/2.0, editor.getDefaultIconButtonSize().y), nil, nil, nil, nil) then
im.OpenPopup("EditModePopup")
im.SetCursorPosY(im.GetCursorPosY() + 5)
editor.uiIconImage(skippedEditMode.icon, im.ImVec2(iconButtonWidth*0.9, iconButtonWidth*0.9), bgColor)
im.SameLine()
if im.Button(skippedEditMode.iconTooltip, im.ImVec2(120, iconButtonWidth)) and skippedEditMode ~= editor.editMode then
editor.selectEditMode(skippedEditMode)
im.SetCursorPosY(im.GetCursorPosY() + 3)
editor.uiIconImage(val.icon, im.ImVec2(buttonWidth*uiScaling*0.9, buttonWidth*uiScaling*0.9), bgColor)
im.SameLine()
im.SetCursorPosY(im.GetCursorPosY() + 3)
if im.Selectable1(val.iconTooltip, false, nil, im.ImVec2(buttonWidthMax, buttonWidth*uiScaling)) and val ~= editor.editMode then
editor.selectEditMode(val)
im.SameLine() im.Spacing()
editor.uiVertSeparator(32, im.ImVec2(0,0))
editor.uiVertSeparator(editor.getPreference("ui.general.iconButtonSize"), im.ImVec2(0,0))
drawAlwaysVisibleToolbars()
@/lua/ge/extensions/editor/flowgraph/welcome.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, true)
self.headerImage = imguiUtils.texObj('/lua/ge/extensions/editor/flowgraph/welcomeHeader.png')
self.headerImageSize = im.ImVec2(1200, 200)
self.sideImage = imguiUtils.texObj('/lua/ge/extensions/editor/flowgraph/welcomeSide.png')
self.sideImageSize = im.ImVec2(200, 800)
self.focus = true
im.SetWindowFontScale(1)
im.Dummy(im.ImVec2(0, 10))
end
im.BeginGroup()
im.Dummy(im.ImVec2(leftpadding, 0))
im.SameLine()
im.SameLine()
editor.uiIconImage(ico, im.ImVec2(32, 32), col, im.ImVec4(0,0,0,0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(leftpadding, 0))
im.SameLine()
im.BeginGroup()
--im.BeginChild1("##" .. txt, im.ImVec2(im.GetContentRegionAvailWidth(), lowerTxt and 80 or 30), nil, im.WindowFlags_NoScrollWithMouse)
im.TextColored(col, txt)
function C:drawLeftColumn()
im.BeginChild1("##leftColumn", im.ImVec2(450, 820), nil, im.WindowFlags_NoScrollWithMouse)
im.Dummy(im.ImVec2(0, 10))
im.BeginChild1("##leftColumn", im.ImVec2(450, 820), nil, im.WindowFlags_NoScrollWithMouse)
im.Dummy(im.ImVec2(0, 10))
headerText('Projects')
function C:drawRightColumn()
--im.BeginChild1("##welcomeContentColumn2", im.ImVec2(0, 0), nil, im.WindowFlags_NoScrollWithMouse)
im.BeginGroup()
im.Dummy(im.ImVec2(0, 20))
im.PushTextWrapPos(im.GetCursorPosX() + math.max(minWrap,math.min(im.GetContentRegionAvailWidth(), maxWrap)))
im.TextWrapped("Welcome to the Flowgraph Editor! You can use it to create gameplay, experiments, and other interactive content for BeamNG. If you're new, there are examples you can check out below.")
im.Dummy(im.ImVec2(0,1))
im.TextWrapped("Please keep in mind, while the Flowgraph Editor is in a good shape and can already be used to create new content, it is still WIP. That means projects that work now may not work after another update in the future.")
im.TextWrapped("Please keep in mind, while the Flowgraph Editor is in a good shape and can already be used to create new content, it is still WIP. That means projects that work now may not work after another update in the future.")
im.Dummy(im.ImVec2(0,5))
im.TextWrapped("These are some simple examples you can check out to learn about Flowgraph. They showcase basic concepts of the Editor, such as creating and editing nodes, or working with the state system.")
im.Dummy(im.ImVec2(0,1))
im.TextWrapped("You can find more examples in the Examples Window when you have a project opened.")
im.TextWrapped("You can find more examples in the Examples Window when you have a project opened.")
im.Dummy(im.ImVec2(0,5))
im.Dummy(im.ImVec2(0,5))
headerText('Advanced Examples')
im.TextWrapped("These are some more complex examples, containing many states and nodes. Take a look and discover the full potential of the Flowgraph Editor.")
im.Dummy(im.ImVec2(0,5))
--]]
--im.Dummy(im.ImVec2(self.headerImageSize.x,1))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
--im.Dummy(im.ImVec2(self.headerImageSize.x,1))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
im.Image(self.headerImage.texId, self.headerImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
im.Image(self.headerImage.texId, self.headerImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
--im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(1, 0, 0, 1)))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
im.Image(self.headerImage.texId, self.headerImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
--im.ImDrawList_AddRect(im.GetWindowDrawList(), im.GetItemRectMin(), im.GetItemRectMax(), im.GetColorU322(im.ImVec4(1, 0, 0, 1)))
if im.GetContentRegionAvailWidth() > 500 then
im.Image(self.sideImage.texId, self.sideImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
im.SameLine()
if im.GetContentRegionAvailWidth() > 500 then
im.Image(self.sideImage.texId, self.sideImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
im.SameLine()
im.PopStyleVar()
im.PushStyleVar2(im.StyleVar_ItemSpacing,im.ImVec2(3, 3))
im.Dummy(im.ImVec2(40, 0))
im.PushStyleVar2(im.StyleVar_ItemSpacing,im.ImVec2(3, 3))
im.Dummy(im.ImVec2(40, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(40, 0))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(40, 0))
im.PopStyleVar()
@/lua/ge/extensions/editor/forestEditor.lua
local noValueString = ""
local clearButtonSize = im.ImVec2(24, 24)
local filteredFieldPopupSize = im.ImVec2(500, 500)
local clearButtonSize = im.ImVec2(24, 24)
local filteredFieldPopupSize = im.ImVec2(500, 500)
local dataBlocksTbl = {}
local enableSnapSinkOption = false
local selectionStylePopupPos = im.ImVec2(0, 0)
local snapOptionPopupPos = im.ImVec2(0, 0)
local selectionStylePopupPos = im.ImVec2(0, 0)
local snapOptionPopupPos = im.ImVec2(0, 0)
local u_32_max_int = 4294967295
im.Columns(1, "assetInspectorGuiForestItem_columns")
if im.Button("Open TextureSet editor##ForestItemInspector", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.showWindow(parallaxMappingTextureSetEditor_WindowId)
var.meshPreview:renderWorld(var.meshPreviewDimRdr)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1("MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1("MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
var.meshPreview:ImGui_Image(var.meshPreviewRenderSize[1],var.meshPreviewRenderSize[2])
if im.Button("Select ForestItemData", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
for _, forestItemData in ipairs(var.forestItemData) do
transformToolSettingsOpen = not transformToolSettingsOpen
selectionStylePopupPos = im.ImVec2(im.GetWindowPos().x + im.GetCursorPosX(), im.GetWindowPos().y + im.GetCursorPosY() + 30)
elseif tool.mode == var.enum_brushMode.snap and im.IsItemHovered() and im.IsMouseClicked(1) then
snapOptionsOpen = not snapOptionsOpen
snapOptionPopupPos = im.ImVec2(im.GetWindowPos().x + im.GetCursorPosX(), im.GetWindowPos().y + im.GetCursorPosY() + 30)
end
if var.fontSize then
im.SetCursorPos(im.ImVec2(im.GetCursorPosX() + var.style.ItemSpacing.x, im.GetCursorPosY() + (32/2 - var.fontSize/2)))
end
if var.editingObject == item then
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(var.style.FramePadding.x, 0))
im.PushItemWidth(im.GetContentRegionAvailWidth())
local id = item.type == var.enum_forestObjType.forestBrush and ("##" .. item.internalName .. "_button_FB_" .. tostring(item.id)) or ("##" .. item.internalName .. "_button_FBE_" .. tostring(item.id))
if im.Button(id, im.ImVec2(im.GetContentRegionAvailWidth(), var.fontSize)) then
-- add to selection if ctrl is held
im.PopStyleColor()
im.SetCursorPos(im.ImVec2(cPos.x + var.style.FramePadding.x, cPos.y))
im.TextUnformatted(item.internalName)
if forestBrush.type == var.enum_forestObjType.forestBrush then
if editor.uiIconImageButton((forestBrush.open == true) and editor.icons.keyboard_arrow_down or editor.icons.keyboard_arrow_right, im.ImVec2(var.fontSize, var.fontSize), nil, nil, var.buttonColor_inactive) then
toggleForestBrushTreeNode(forestBrush)
im.SameLine()
editor.uiIconImage(editor.icons.forest_brushgroup, im.ImVec2(var.fontSize, var.fontSize))
im.SameLine()
im.SetCursorPosX(cursorPos.x + var.style.FramePadding.x - var.fontSize)
editor.uiIconImage(editor.icons.forest_brushelement, im.ImVec2(var.fontSize, var.fontSize))
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + var.fontSize + var.style.ItemSpacing.x)
editor.uiIconImage(editor.icons.forest_brushelement, im.ImVec2(var.fontSize, var.fontSize))
im.SameLine()
editor.uiIconImage(editor.icons.forest_brushelement, im.ImVec2(var.fontSize, var.fontSize))
im.SameLine()
--TODO: make sure to make a better nil check for internalName
if im.Button("##" .. (obj.internalName or "unnamed") .. "_button_FID_" .. tostring(item.id), im.ImVec2(im.GetContentRegionAvailWidth(), var.fontSize)) then
-- add to selection if ctrl is held
im.PopStyleColor()
im.SetCursorPos(im.ImVec2(cPos.x + var.style.FramePadding.x, cPos.y))
im.TextUnformatted(obj.name)
local img = editor.getTempTextureObj(imgPath)
if im.ImageButton(string.format("TextureSetImageButton_%d", id), img.texId, im.ImVec2(imgSize, imgSize)) then
editor_fileDialog.openFile(
im.GetWindowDrawList(),
im.ImVec2(windowPos.x + cPos.x - style.ItemSpacing.x/2, windowPos.y + cPos.y - math.floor(style.ItemSpacing.y/2) - scrollY),
im.ImVec2(
im.ImVec2(windowPos.x + cPos.x - style.ItemSpacing.x/2, windowPos.y + cPos.y - math.floor(style.ItemSpacing.y/2) - scrollY),
im.ImVec2(
windowPos.x + cPos.x - style.ItemSpacing.x/2 + (style.ScrollbarSize - style.ItemSpacing.x/2),
im.BeginChild1("parallaxMappingTextureSetEditor_textureSet_TexturePreview_Child", im.ImVec2(0, im.GetContentRegionAvail().y - (math.ceil(im.GetFontSize() + im.GetStyle().ItemSpacing.y * 2))), true)
if var.forestEditorWindowSize.x < var.forestEditorWindowMinWidth then
im.SetNextWindowSize(im.ImVec2(var.forestEditorWindowMinWidth, 0))
end
local tabIconWidth = var.fontSize + 2 * var.style.FramePadding.y - 3
local tabIconSize = im.ImVec2(tabIconWidth, tabIconWidth)
end
im.SetCursorPos(im.ImVec2(
cursorPos.x + im.CalcTextSize("BrushesMeshes").x + 4 * var.style.FramePadding.x + var.style.ItemInnerSpacing.x + 2*var.style.ItemSpacing.x,
))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4,4))
var.meshPreview:renderWorld(var.meshPreviewDimRdr)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1(fieldName .. "MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1(fieldName .. "MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
var.meshPreview:ImGui_Image(var.meshPreviewRenderSize[1],var.meshPreviewRenderSize[2])
var.meshPreview:renderWorld(var.meshPreviewDimRdr)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1(fieldName .. "MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0,0))
if im.BeginChild1(fieldName .. "MeshPreviewChild", im.ImVec2(size,size), true, im.WindowFlags_NoScrollWithMouse) then
var.meshPreview:ImGui_Image(var.meshPreviewRenderSize[1],var.meshPreviewRenderSize[2])
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(220,320), nil, true)
editor.registerWindow(parallaxMappingTextureSetEditor_WindowId, im.ImVec2(600,480), nil, true)
editor.registerWindow(toolWindowName, im.ImVec2(220,320), nil, true)
editor.registerWindow(parallaxMappingTextureSetEditor_WindowId, im.ImVec2(600,480), nil, true)
editor.registerModalWindow("noForestMsgDlg")
@/lua/ge/extensions/editor/gen/exp_solidflex.lua
if not editor.isWindowRegistered(wnm) then
editor.registerWindow(wnm) --, im.ImVec2(200, 700))
end
im.PushStyleColor2(im.Col_FrameBg, im.ImVec4(0.2, 0.2, 0.2, 0.4))
if im.BeginListBox(id, im.ImVec2(-1,im.GetWindowHeight() - 118)) then
im.Indent(8)
--[[
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
im.Dummy(im.ImVec2(0,0))
]]
end
UI.buttonTxt('crumple', 'CRUMPLE', im.ImVec2(72, 21), color, cbg, im.ImVec2(4,6))
end
UI.buttonTxt('crumple', 'CRUMPLE', im.ImVec2(72, 21), color, cbg, im.ImVec2(4,6))
-- im.SetCursorPosY(im.GetCursorPosY() + 16)
UI.buttonImg('reset', 'refresh', im.ImVec2(30, 30), im.ImVec4(0.5, 0.7, 0.5, 1), nil, nil, im.ImVec2(0, -6))
--[[
-- im.SetCursorPosY(im.GetCursorPosY() + 16)
UI.buttonImg('reset', 'refresh', im.ImVec2(30, 30), im.ImVec4(0.5, 0.7, 0.5, 1), nil, nil, im.ImVec2(0, -6))
--[[
if editor.uiIconImageButton(editor.icons.refresh,
im.ImVec2(24, 24), im.ImVec4(0.5, 0.7, 0.5, 1),
nil, nil, 'MultiSelectButton') then
im.Dummy(im.ImVec2(0,0))
im.Unindent(14)
im.Dummy(im.ImVec2(0,0))
-- im.Indent(10)
@/lua/ge/extensions/editor/missionPlaybook/unlockedMissionsViewer.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500,500))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName="Missions"})
@/lua/ge/extensions/gameplay/drift/general.lua
im.Dummy(im.ImVec2(1, 7))
im.Dummy(im.ImVec2(1, 10))
end
im.Dummy(im.ImVec2(1, 10))
end
@/lua/ge/extensions/editor/missionEditor/prefabs.lua
local originalPrefabName = self.mission.prefabs[i]
if editor.uiIconImageButton(editor.icons.delete_forever, im.ImVec2(24, 24), nil, nil, nil,'##rem'..originalPrefabName..i) then
rem = i
if foundFile then
editor.uiIconImage(editor.icons.check, im.ImVec2(24, 24))
im.tooltip("Found file at " .. file)
else
editor.uiIconImage(editor.icons.error_outline, im.ImVec2(24, 24))
im.tooltip("No file at " .. file)
@/lua/ge/extensions/editor/sidewalkSpline.lua
local min, max = math.min, math.max
local toolWinName, toolWinSize = 'sidewalkSpline', im.ImVec2(300, 700)
local defaultParams = splineMgr.getDefaultSliderParams()
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
im.SetColumnWidth(6, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 180)) then
im.Columns(4, "splineListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 88428
im.SetColumnWidth(5, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
-- Tab content.
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
if selectedTab == 0 then -- Sidewalk Kit tab.
im.NextColumn()
im.Dummy(im.ImVec2(0, 3))
im.SetColumnWidth(1, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
@/lua/ge/extensions/flowgraph/nodes/types/string.lua
builder:Middle()
--im.BeginChild1("str"..self.id, im.ImVec2(160,100),1)
if self.string then
@/lua/ge/extensions/editor/main.lua
loadAndInitializeExtensions()
editor.registerModalWindow("saveDirtyTools", imgui.ImVec2(600, 300), nil, true)
editor.loadWindowsState()
imguiUtils.changeUIScale(1)
local pos = imgui.ImVec2(imgui.GetMainViewport().Pos.x + imgui.GetMainViewport().Size.x / 2, imgui.GetMainViewport().Pos.y + imgui.GetMainViewport().Size.y / 2)
if not splashImage then splashImage = imguiUtils.texObj("/core/art/gui/images/editorSplash.png") end
imgui.SetNextWindowPos(pos, imgui.Cond_Appearing, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(imgui.uiscale[0] * (imageSize.x + 50), imgui.uiscale[0] * (imageSize.y + 30)), imgui.Cond_Always)
imgui.SetNextWindowPos(pos, imgui.Cond_Appearing, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(imgui.uiscale[0] * (imageSize.x + 50), imgui.uiscale[0] * (imageSize.y + 30)), imgui.Cond_Always)
imgui.Begin("loadingEditorWnd", nil, imgui.WindowFlags_NoScrollbar + imgui.WindowFlags_NoTitleBar + imgui.WindowFlags_NoResize + imgui.WindowFlags_NoMove)
imgui.Image(splashImage.texId, imgui.ImVec2(imgui.uiscale[0] * imageSize.x, imgui.uiscale[0] * imageSize.y))
imgui.End()
@/lua/ge/extensions/util/vehicleRopeDebug.lua
-- *** CHANGED: Increased default window size for new layout ***
im.SetNextWindowSize(im.ImVec2(800, 750), im.Cond_FirstUseEver)
if im.Begin("Rope Visual Sandbox", windowOpen) then
if selectedRope.anchorAFixed then
im.ColorButton("##FixedAHeader", im.ImVec4(0.2, 0.4, 0.8, 1.0), im.ColorEditFlags_NoTooltip, im.ImVec2(20, 20))
if im.IsItemHovered() then im.SetTooltip("Fixed Anchor A - Blue spheres") end
else
im.ColorButton("##FreeAHeader", im.ImVec4(0.2, 0.8, 0.8, 1.0), im.ColorEditFlags_NoTooltip, im.ImVec2(20, 20))
if im.IsItemHovered() then im.SetTooltip("Free Anchor A - Cyan spheres") end
if selectedRope.anchorBFixed then
im.ColorButton("##FixedBHeader", im.ImVec4(0.8, 0.2, 0.2, 1.0), im.ColorEditFlags_NoTooltip, im.ImVec2(20, 20))
if im.IsItemHovered() then im.SetTooltip("Fixed Anchor B - Red spheres") end
else
im.ColorButton("##FreeBHeader", im.ImVec4(0.2, 0.8, 0.2, 1.0), im.ColorEditFlags_NoTooltip, im.ImVec2(20, 20))
if im.IsItemHovered() then im.SetTooltip("Free Anchor B - Green spheres") end
@/lua/ge/extensions/flowgraph/nodes/scene/storeStatics.lua
if tableContains(sortedObjectIds, e.currentId) then
editor.uiIconImage(editor.icons.check_box,im.ImVec2(20, 20))
else
else
editor.uiIconImage(editor.icons.delete_forever,im.ImVec2(20, 20),im.ImVec4(1,0.25,0.25,1))
end
if obj then
editor.uiIconImage(editor.icons.check,im.ImVec2(20, 20))
if im.IsItemHovered() and editor_flowgraphEditor.allowTooltip then
im.SameLine()
if editor.uiIconImageButton(editor.icons.search,im.ImVec2(20, 20)) then
editor.selectObjects({e.currentId})
else
editor.uiIconImage(editor.icons.check_box_outline_blank,im.ImVec2(20, 20))
end
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete_forever,im.ImVec2(20, 20)) then
remove = i
@/lua/common/extensions/ui/imguiUtils.lua
posY = posY or (imgui.GetWindowPos().y + imgui.GetCursorPosY())
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX - 4, posY), imgui.ImVec2(posX + 4, posY) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX, posY - 4), imgui.ImVec2(posX, posY + 4) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
posY = posY or (imgui.GetWindowPos().y + imgui.GetCursorPosY())
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX - 4, posY), imgui.ImVec2(posX + 4, posY) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX, posY - 4), imgui.ImVec2(posX, posY + 4) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX - 4, posY), imgui.ImVec2(posX + 4, posY) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX, posY - 4), imgui.ImVec2(posX, posY + 4) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
end
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX - 4, posY), imgui.ImVec2(posX + 4, posY) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
imgui.ImDrawList_AddLine(imgui.GetWindowDrawList(), imgui.ImVec2(posX, posY - 4), imgui.ImVec2(posX, posY + 4) , imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 0.75)))
end
local windowPos = imgui.GetWindowPos()
local popupPos = imgui.ImVec2(0,0)
if not size then size = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else size = imgui.ImVec2(size.x * imgui.uiscale[0], size.y * imgui.uiscale[0]) end
if not size then size = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else size = imgui.ImVec2(size.x * imgui.uiscale[0], size.y * imgui.uiscale[0]) end
imgui.SetNextWindowPos(popupPos)
imgui.SetNextWindowSize(imgui.ImVec2(0, 0), imgui.Cond_Always)
if imgui.BeginPopup(label) then
else
if editor.uiIconImageButton(item.icon, imgui.ImVec2(size.x, size.y), nil, nil, nil, lbl) then
if item.func then item.func() end
local open_popup_rmb
if not iconSize then iconSize = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else iconSize = imgui.ImVec2(iconSize.x * imgui.uiscale[0], iconSize.y * imgui.uiscale[0]) end
local open_popup_rmb
if not iconSize then iconSize = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else iconSize = imgui.ImVec2(iconSize.x * imgui.uiscale[0], iconSize.y * imgui.uiscale[0]) end
local popupPos = imgui.ImVec2(0,0)
imgui.SetNextWindowPos(popupPos)
imgui.SetNextWindowSize(imgui.ImVec2(0, 0), imgui.Cond_Always)
if imgui.BeginPopup(label) then
if item.active[0] == true then
editor.uiIconImage(editor.icons.done, imgui.ImVec2(14,14))
imgui.SameLine()
imgui.SetNextWindowPos(popupPos)
imgui.SetNextWindowSize(imgui.ImVec2(0, 0), imgui.Cond_Always)
if imgui.BeginPopup(label.."rmb") then
local windowPos = imgui.GetWindowPos()
local popupPos = imgui.ImVec2(0,0)
if not size then size = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else size = imgui.ImVec2(size.x * imgui.uiscale[0], size.y * imgui.uiscale[0]) end
if not size then size = imgui.ImVec2(32 * imgui.uiscale[0], 32 * imgui.uiscale[0]) else size = imgui.ImVec2(size.x * imgui.uiscale[0], size.y * imgui.uiscale[0]) end
imgui.SetNextWindowPos(popupPos)
imgui.SetNextWindowSize(imgui.ImVec2(0, 0), imgui.Cond_Always)
if imgui.BeginPopup(label) then
else
if editor.uiIconImageButton(item.icon, imgui.ImVec2(size.x, size.y), nil, nil, nil, lbl) then
selectedItem[0] = k
else
if editor.uiIconImageButton(item.icon, imgui.ImVec2(size.x, size.y), nil, nil, nil, lbl) then
selectedItem[0] = k
--[[if flag then
if imgui.BeginChild1("plot", imgui.ImVec2(0,130), true) then
imgui.PlotLines1("",dataPlot, dataPlotLen, offset, "", FLT_MAX, FLT_MAX, imgui.ImVec2(300, 100))
if imgui.BeginChild1("plot", imgui.ImVec2(0,130), true) then
imgui.PlotLines1("",dataPlot, dataPlotLen, offset, "", FLT_MAX, FLT_MAX, imgui.ImVec2(300, 100))
imgui.EndChild()
@/lua/ge/extensions/editor/meshEditor.lua
-- Params for setting width of node by dragging the mouse after creating it
local cursorOldPosition2D = im.ImVec2(0,0)
if selectedMesh and (not tableIsEmpty(selectedNodes)) and selectedMesh:getNodeCount() > 0 then
im.BeginChild1("node", im.ImVec2(0, 150), true)
im.Text("Node Properties")
if selectedNode then
if im.Button("Split " .. M.niceName, im.ImVec2(0,0)) then
splitMesh(selectedMesh, selectedNode)
mouseButtonHeldOnNode = false
cursorOldPosition2D = im.ImVec2(0,0)
if editor.keyModifiers.alt then
@/lua/ge/extensions/editor/flowgraph/search.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
self.searchResultsByMgr = {}
im.SameLine()
editor.uiIconImage(editor.icons.help, im.ImVec2(20,20))
ui_flowgraph_editor.tooltip("Type any string to search for nodes, graphs and pins.\nBegin with 'node:', 'graph:' or 'pin:' to only search for those elements.")
function C:highlightText(label, highlightText)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
local pos1 = 1
local iconSize = im.ImVec2(20,20)
function C:displayResults()
if self.buttonListIndex == self.selectedButtonListIndex then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
-- display blue rectangle when node is hovered
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/roadTemplateEditor.lua
im.PushID1(string.format('template_%d', i))
if im.ImageButton("##selectionDialogButton", editor_roadUtils.getMaterials()[i].texId, im.ImVec2(128, 128), im.ImVec2Zero, im.ImVec2One,
im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then
if editor.beginWindow(toolWindowName, "Road Templates") then
im.BeginChild1("templates", im.ImVec2(0, im.GetFontSize() * 7.2), true)
im.Text("Road Templates")
im.BeginChild1("decalroads", im.ImVec2(0, im.GetFontSize() * 10), true)
im.Text("Template Decal Roads")
im.BeginChild1("decorations", im.ImVec2(0, im.GetFontSize() * 10), true)
im.Text("Template Decorations")
im.BeginChild1("decals", im.ImVec2(0, im.GetFontSize() * 10), true)
im.Text("Template Random Decals")
editor.addWindowMenuItem("Road Template Editor", onWindowMenuItem, {groupMenuName = 'Roads'})
editor.registerWindow(toolWindowName, im.ImVec2(200, 400))
end
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
local ctrlDefinitionTypeName = im.ArrayChar(256, "")
local dummyVec = im.ImVec2(0, 5)
local iconVec = im.ImVec2(24, 24)
local dummyVec = im.ImVec2(0, 5)
local iconVec = im.ImVec2(24, 24)
local buttonVec = im.ImVec2(32, 32)
local iconVec = im.ImVec2(24, 24)
local buttonVec = im.ImVec2(32, 32)
local function windowSignalCtrlDefinitions()
im.SetNextWindowSize(im.ImVec2(500, 600), im.Cond_FirstUseEver)
if im.Begin("Controller Definitions##ctrlDefinitions", windowFlags.instanceGroups) then
local function tabInstances()
im.BeginChild1("instances", im.ImVec2(150 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
im.BeginChild1("instanceData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
else
im.BeginChild1("signalObjects", im.ImVec2(im.GetContentRegionAvailWidth(), 110 * im.uiscale[0]), im.WindowFlags_ChildWindow)
for _, oid in ipairs(currInstance.tempSignalObjects) do
im.BeginChild1("controllers", im.ImVec2(150 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
im.BeginChild1("controllerData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
im.BeginChild1("sequences", im.ImVec2(150 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
im.BeginChild1("sequenceData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
-- display a table representing the phase components and durations
im.PushStyleVar2(im.StyleVar_CellPadding, im.ImVec2(0, 0))
im.BeginTable("sequencePhaseDurations##sequence", columns, bit.bor(im.TableFlags_RowBg, im.TableFlags_Borders))
im.ProgressBar(currTime / maxTime, im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.TableNextColumn()
if im.Button("YES", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
resetSignals()
im.SameLine()
if im.Button("NO", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
im.CloseCurrentPopup()
local function onEditorInitialized()
editor.registerWindow(editModeName, im.ImVec2(540, 600))
editor.editModes[editModeName] = {
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
im.BeginChild1("BrowserFontsChild", im.ImVec2(0, im.GetContentRegionAvail().y - math.ceil(im.GetFontSize()) - im.GetStyle().ItemSpacing.y), true)
fontAtlasTexObj.texId,
im.ImVec2(previewSize, previewSize),
im.ImVec2(glyph.monospaced_x / header.atlas_monospaced_width, glyph.monospaced_y / header.atlas_monospaced_height),
im.ImVec2(previewSize, previewSize),
im.ImVec2(glyph.monospaced_x / header.atlas_monospaced_width, glyph.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((glyph.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (glyph.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height)
im.ImVec2(glyph.monospaced_x / header.atlas_monospaced_width, glyph.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((glyph.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (glyph.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height)
)
textureObject.texId,
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
0,
textureObject.texId,
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
0,
editor.getTempTextureObj(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png")).texId,
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
im.ImVec2(char.monospaced_x / header.atlas_monospaced_width, char.monospaced_y / header.atlas_monospaced_height),
im.ImVec2((char.monospaced_x + header.glyph_pixel_height) / header.atlas_monospaced_width, (char.monospaced_y + header.glyph_pixel_height) / header.atlas_monospaced_height),
nil,
if afterTextPos.y > im.GetCursorPos().y then
im.SetCursorPos(im.ImVec2(im.GetCursorPos().x, afterTextPos.y))
end
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, "fontPath_FileDialogButton") then
editor_fileDialog.openFile(
editor.registerWindow(fontPreviewWindowName, im.ImVec2(550, 550))
tool.registerEditorOnUpdateFn("fonts", editModeUpdate)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartPropertyView.lua
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,400))
@/lua/ge/extensions/editor/raceEditor/pacenotes.lua
local avail = im.GetContentRegionAvail()
im.BeginChild1("keynotes", im.ImVec2(125 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for i, note in ipairs(self.path.pacenotes.sorted) do
im.SameLine()
im.BeginChild1("currentPacenote", im.ImVec2(0, 0 ), im.WindowFlags_ChildWindow)
if self.index then
im.BeginChild1("self.indexInner", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local editEnded = im.BoolPtr(false)
@/lua/ge/suspensionFrequencyTester.lua
local function drawWindow()
imgui.SetNextWindowSize(imgui.ImVec2(500, 600), imgui.Cond_FirstUseEver)
if imgui.Begin("Suspension Frequency Tester", windowOpen) then
imgui.PushStyleColor2(imgui.Col_PlotLines, imgui.ImVec4(1, 1, 1, 1))
imgui.PlotLines1("##"..node.name, ampArray, numPixels, 0, nil, 0, maxAmpl, imgui.ImVec2(contentWidth, 60))
imgui.PopStyleColor()
local xPos = startCursorPosX + (i * contentWidth / (numLabels - 1)) - 10
imgui.SetCursorPos(imgui.ImVec2(xPos, startCursorPosY))
local color = (i % 2 == 0) and imgui.ImVec4(1, 1, 1, 1) or imgui.ImVec4(0.6, 0.6, 0.6, 1)
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
local cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
im.GetWindowDrawList(),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x - scrollPosX, windowPos.y + cursorPos.y - scrollPosY),
im.ImVec2(windowPos.x + cursorPos.x + size - scrollPosX, windowPos.y + cursorPos.y + size - scrollPosY),
gradientColorTopLeftU32,
-- adding an invisible button so the imgui cursor is at the right location
im.InvisibleButton("GradientButton", im.ImVec2(size, size))
im.SameLine()
cursorPos = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
im.ColorButton("##colorBR", editor.getTempImVec4_TableImVec4(gradientColorBottomRight), im.ColorEditFlags_AlphaPreview)
im.ColorButton("##colorTR", editor.getTempImVec4_TableImVec4(gradientColorTopRight), im.ColorEditFlags_AlphaPreview)
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size + im.GetStyle().ItemSpacing.y))
im.NewLine()
im.TextUnformatted(brush.decalColorTexturePath)
im.Image(editor.getTempTextureObj(brush.decalColorTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted("Decal Color")
im.TextUnformatted(brush.decalColorTexturePath)
im.Image(editor.getTempTextureObj(brush.decalColorTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted("Decal Color")
im.TextUnformatted(brush.decalColorTexturePath)
im.Image(editor.getTempTextureObj(brush.decalColorTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted("Decal Color")
im.TextUnformatted(brush.decalNormalTexturePath)
im.Image(editor.getTempTextureObj(brush.decalNormalTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalNormalTexturePath)
im.Image(editor.getTempTextureObj(brush.decalNormalTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalNormalTexturePath)
im.Image(editor.getTempTextureObj(brush.decalNormalTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalMetallicTexturePath)
im.Image(editor.getTempTextureObj(brush.decalMetallicTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalMetallicTexturePath)
im.Image(editor.getTempTextureObj(brush.decalMetallicTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalMetallicTexturePath)
im.Image(editor.getTempTextureObj(brush.decalMetallicTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalRoughnessTexturePath)
im.Image(editor.getTempTextureObj(brush.decalRoughnessTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalRoughnessTexturePath)
im.Image(editor.getTempTextureObj(brush.decalRoughnessTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalRoughnessTexturePath)
im.Image(editor.getTempTextureObj(brush.decalRoughnessTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalAlphaTexturePath)
im.Image(editor.getTempTextureObj(brush.decalAlphaTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalAlphaTexturePath)
im.Image(editor.getTempTextureObj(brush.decalAlphaTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.TextUnformatted(brush.decalAlphaTexturePath)
im.Image(editor.getTempTextureObj(brush.decalAlphaTexturePath).texId, im.ImVec2(imageWidth, imageWidth), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TreePop()
im.BeginChild1("BrowserBrushesChild", im.ImVec2(spaceAvailable.x, spaceAvailable.y - (im.GetStyle().ItemSpacing.y + 1 * math.ceil(im.GetFontSize()) + 3)), true)
local thumbnailSize = editor.getPreference("dynamicDecalsTool.textureBrowser.texturePreviewSize")
im.PushID1("Brush_" .. tostring(k))
if im.ImageButton("##TabGuiButton", editor.getTempTextureObj(brush.decalColorTexturePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, nil, (editor.selection["dynamicDecalBrush"] and editor.selection["dynamicDecalBrush"].id == k) and editor.color.beamng.Value or nil) then
selectBrush(k, brush)
im.TextUnformatted("LMB: Select brush; Double-click: Load brush; RMB: Open brush context menu")
im.SetCursorPos(im.ImVec2(cPos.x + textSpace, cPos.y))
editor.uiInputSearchTextFilter("Brush Filter", brushTextFilter, textFilterWidth)
@/lua/ge/extensions/editor/dynamicDecals/meshes.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize())) then
editor_fileDialog.openFile(
@/lua/ge/extensions/editor/flowgraph/history.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
end
local avail = im.GetContentRegionAvail()
im.BeginChild1("historyChild", im.ImVec2(avail.x-1, avail.y - 5))
im.Columns(2)
@/lua/ge/extensions/flowgraph/nodes/vehicle/replay.lua
im.Text(tostring(self.stopReplay))
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
end
@/lua/ge/extensions/editor/missionEditor.lua
if shownMission._dirty then
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(40, 40), unsavedColor) then
gameplay_missions_missions.saveMission(shownMission,shownMission.missionFolder)
else
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(40, 40)) then end
ui_flowgraph_editor.tooltip("No unsaved changes for this mission")
if not canTeleport then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.flag, im.ImVec2(40, 40)) then
-- check if map loaded and player has vehicle
im.SameLine()
if editor.uiIconImageButton(instance.unlocks.startable and editor.icons.assignment_turned_in or editor.icons.assignment_late, im.ImVec2(40, 40), instance.unlocks.startable and colorLightGreen or colorLightRed) then
instance.unlocks.startable = not instance.unlocks.startable
im.SameLine()
if editor.uiIconImageButton(instance.unlocks.visible and editor.icons.visibility or editor.icons.visibility_off, im.ImVec2(40, 40), instance.unlocks.visible and colorLightGreen or colorLightRed) then
instance.unlocks.visible = not instance.unlocks.visible
-- Add button to edit start position
if editor.uiIconImageButton(editor.icons.edit_location, im.ImVec2(40, 40)) then
missionStartPositionEditor.setSelectedMission(shownMission)
if shownMission.missionType == 'rallyStage' or shownMission.missionType == 'rallyRoadSection' then
if editor.uiIconImageButton(editor.icons.simobject_bng_waypoint, im.ImVec2(40, 40)) then
openRaceEditor(shownMission)
if editor.uiIconImageButton(editor.icons.import_contacts, im.ImVec2(40, 40)) then
openRallyEditor(shownMission)
end
local infoSize = im.ImVec2(18, 18)
local infoColors = {
local scale = editor.getPreference("ui.general.scale")
im.BeginChild1("createNewMissionPopupChild", im.ImVec2(350*scale,180*scale), 0)
im.HeaderText("Create New Mission")
im.HeaderText("Create New Mission")
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(0,0))
im.Columns(2)
if not taken then
editor.uiIconImage(editor.icons.check, im.ImVec2(24,24), im.ImVec4(0,1,0,1))
im.tooltip("This ID is available.")
else
editor.uiIconImage(editor.icons.error_outline, im.ImVec2(24,24), im.ImVec4(1,0,0,1))
im.tooltip("This ID is already taken!")
end
if im.Button("Create Mission", im.ImVec2(-1, -1)) then
-- create mission and add into mission list
end
if im.Button("Change Auto Key",im.ImVec2(-1,0)) then
local level = clickedMission.startTrigger and clickedMission.startTrigger.level or "noLevel"
im.InputText("Key:##translationKey", translationData.translationKeyPtr, translationData.translationKeyLength)
if im.Button("Make Translation",im.ImVec2(-1,0)) then
makeTranslation()
end
im.InputTextMultiline("##translationCopyPasta", translationData.copyPastaPtr, translationData.copyPastaLength, im.ImVec2(500,500))
if im.Button("Replace Mission Data with Keys",im.ImVec2(-1,0)) then
im.InputTextMultiline("##translationCopyPasta", translationData.copyPastaPtr, translationData.copyPastaLength, im.ImVec2(500,500))
if im.Button("Replace Mission Data with Keys",im.ImVec2(-1,0)) then
applyTranslation()
local areaWidth = missionListWidth
im.BeginChild1("Search",im.ImVec2(areaWidth, filterHeight+2), false)
if editor.uiIconImageButton(editor.icons.ab_filter_default, im.ImVec2(21,21), next(groupFilterText) and im.ImVec4(0,1,0,1)) then
im.OpenPopup("MissionEditorGroupFilter")
if im.BeginPopup("MissionEditorGroupFilter") then
im.BeginChild1("MissionEditorGroupFilterChild", im.ImVec2(300,200))
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.EndChild()
im.BeginChild1("missionList", im.ImVec2(areaWidth, -1), true)
-- header
local areaWidth = im.GetWindowContentRegionWidth() - im.GetCursorPos().x + 15
im.BeginChild1("missionDetails", im.ImVec2(areaWidth, winHeight-45), false, 0)
local areaWidth = im.GetWindowContentRegionWidth() - im.GetCursorPos().x + 15
im.BeginChild1("missionDetails", im.ImVec2(areaWidth, winHeight-45), false, 0)
if shownMission then
local areaWidth = im.GetWindowContentRegionWidth() - im.GetCursorPos().x + 15
im.BeginChild1("missionDetails", im.ImVec2(areaWidth, winHeight-45), false, 0)
if shownMission then
local areaWidth = im.GetWindowContentRegionWidth() - im.GetCursorPos().x
im.BeginChild1(tab.tabName.."windowhild", im.ImVec2(areaWidth, winHeight-45), false, 0)
if shownMission then
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(1500,700))
editor.registerWindow("mission_issues", im.ImVec2(700,700))
editor.registerWindow(toolWindowName, im.ImVec2(1500,700))
editor.registerWindow("mission_issues", im.ImVec2(700,700))
editor.addWindowMenuItem("Mission Editor", onWindowMenuItem, {groupMenuName="Missions"})
@/lua/ge/extensions/editor/forestView.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(220,320), nil, true)
end
local style = imgui.GetStyle()
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(fontSize, fontSize))
imgui.SameLine()
--TODO: make sure to make a better nil check for internalName
if imgui.Button("##_button_FID_" .. tostring(item.name), imgui.ImVec2(imgui.GetContentRegionAvailWidth(), fontSize)) then
-- add to selection if ctrl is held
imgui.PopStyleColor()
imgui.SetCursorPos(imgui.ImVec2(cPos.x + style.FramePadding.x, cPos.y))
imgui.TextUnformatted(obj.name)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
local btnWidth = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
if im.Button(string.format("Horizontally##%s_flipHorizontally", widgetId), im.ImVec2(btnWidth, 0)) then
layer.decalUv.x = layer.decalUv.x * -1
im.PushStyleColor2(im.Col_Button, layer.decalUv.y == -1 and editor.color.beamng.Value or btnCol)
if im.Button(string.format("Vertically##%s_flipVertically", widgetId), im.ImVec2(btnWidth, 0)) then
layer.decalUv.y = layer.decalUv.y * -1
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
if im.TreeNode1(string.format("Meshes##%s", widgetId)) then
if im.BeginChild1(string.format("MeshesChild_%s", widgetId), im.ImVec2(0, 240), true) then
local i = 1
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, name .. "_Button") then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, name .. "_RemoveButton") then
api.setDecalTexturePath(type, removeTextureOverridePath or "/")
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
if im.BeginDragDropTarget() then
if im.TreeNodeEx1(string.format("SDF Properties##DecalColor_%s", guiId), im.TreeNodeFlags_DefaultOpen) then
if im.Button("What is SDF?", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
M.showSdfIntroWindow()
im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
if im.Button(string.format("Horizontally##%s_flipHorizontally", guiId), im.ImVec2(btnWidth, 0)) then
uvValue.x = uvValue.x * -1
im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
if im.Button(string.format("Vertically##%s_flipVertically", guiId), im.ImVec2(btnWidth, 0)) then
uvValue.y = uvValue.y * -1
im.SameLine()
im.Dummy(im.ImVec2(im.GetStyle().ItemSpacing.x, 0))
im.SameLine()
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
local scrollY = im.GetScrollY()
local p1 = im.ImVec2(wpos.x + highlightSdfProperties.startCursorPos.x - scrollX, wpos.y + highlightSdfProperties.startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + highlightSdfProperties.endCursorPos.x - scrollX + im.GetContentRegionAvailWidth(), wpos.y + highlightSdfProperties.endCursorPos.y - scrollY)
local p1 = im.ImVec2(wpos.x + highlightSdfProperties.startCursorPos.x - scrollX, wpos.y + highlightSdfProperties.startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + highlightSdfProperties.endCursorPos.x - scrollX + im.GetContentRegionAvailWidth(), wpos.y + highlightSdfProperties.endCursorPos.y - scrollY)
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 3)
editor.registerWindow(sdfIntroWindowName, im.ImVec2(400, 400))
editor.registerWindow(fontCharacterSelectionWindowName, im.ImVec2(550, 550))
editor.registerWindow(sdfIntroWindowName, im.ImVec2(400, 400))
editor.registerWindow(fontCharacterSelectionWindowName, im.ImVec2(550, 550))
tool.registerSection("Decal Properties", sectionGui, 60, false, {size = im.ImVec2(320, 640)}, {
{icon = editor.icons.help_outline, tooltip = "Docs", fn = function() docs.selectSection({"Layer Types", "Decal Layers", "Properties"}) end},
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
if vEditor.ast and vEditor.ast.transient.linesIndexes then
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 2))
im.PushFont2(1) -- 1= monospace? PushFont3("cairo_semibold_large")
--im.SetNextWindowContentSize(im.ImVec2(maxLineLength, 0))
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,400))
editor.registerModalWindow("editASTNode")
@/lua/ge/extensions/util/groundModelDebug.lua
im.SameLine()
im.Dummy(im.ImVec2(30,0)) im.SameLine()
if im.Checkbox("Mouse Focus", mouseFocus) then serializeSettings() end
im.Dummy(im.ImVec2(0,10))
im.Separator()
local p1 = im.GetCursorScreenPos() --return struct116 /shrug
p1 = im.ImVec2(p1.x,p1.y)
local p2 = im.ImVec2(p1.x + 20, p1.y + textLineHeight)
p1 = im.ImVec2(p1.x,p1.y)
local p2 = im.ImVec2(p1.x + 20, p1.y + textLineHeight)
local cf = groundModels[k].color
-- local p1 = im.GetCursorScreenPos()
-- local p2 = im.ImVec2(p1.x + weight, p1.y + textLineHeight)
-- local col = im.GetColorU322( im.ImVec4(0.65, 0.2, 0.2, 1))
@/lua/ge/extensions/editor/missionPlaybook/attributeViewer.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500,500))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName="Missions"})
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
if im.BeginChild1("##sectionButtons", im.ImVec2(0, textHeight * 2), false, im.WindowFlags_HorizontalScrollbar) then
local sectionNamesLen = #sectionNamesSorted
local cellSize = im.ImVec2(im.GetContentRegionAvail().x + im.GetStyle().CellPadding.x * 2, textHeight)
local cursorPos = im.GetCursorScreenPos()
local startPos = im.ImVec2(cursorPos.x - im.GetStyle().CellPadding.x, cursorPos.y - cellSize.y)
startPos,
im.ImVec2(startPos.x + cellSize.x, startPos.y + cellSize.y),
imCol,
@/lua/ge/extensions/flowgraph/nodes/debug/comment.lua
function C:init()
self.commentSize = im.ImVec2(200, 200)
self.storedCommentSize = im.ImVec2(200,200)
self.commentSize = im.ImVec2(200, 200)
self.storedCommentSize = im.ImVec2(200,200)
self.commentTitle = 'Comment'
if im.InputTextMultiline("##" .. self.id, descText, 2048,im.ImVec2(im.GetContentRegionAvailWidth(),300), im.InputTextFlags_Multiline) then
self.commentText = ffi.string(descText)
function C:_onDeserialized(nodeData)
self.commentSize = im.ImVec2(nodeData.commentSize[1], nodeData.commentSize[2])
if nodeData.backgroundColor then
and self.nodePosition[1] < 2e8 and self.nodePosition[2] < 2e8 then
ui_flowgraph_editor.SetNodePosition(self.id, im.ImVec2(self.nodePosition[1], self.nodePosition[2]))
end
local rMin = im.ImVec2(min.x - 4, min.y - 1)
local rMax = im.ImVec2(min.x + itemSize.x + 4, min.y + itemSize.y + 1)
local rMin = im.ImVec2(min.x - 4, min.y - 1)
local rMax = im.ImVec2(min.x + itemSize.x + 4, min.y + itemSize.y + 1)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), rMin, rMax, col1, 4)
@/lua/ge/extensions/editor/missionPlaybook/missionTreeViewer.lua
}
res.top_left = function() return im.ImVec2(res.x, res.y) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.top_left = function() return im.ImVec2(res.x, res.y) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.top_right = function() return im.ImVec2(res.x + res.w , res.y) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.bottom_right = function() return im.ImVec2(res.x + res.w, res.y + res.h) end
res.bottom_left = function() return im.ImVec2(res.x, res.y + res.h) end
res.bottom_right = function() return im.ImVec2(res.x + res.w, res.y + res.h) end
res.is_empty = function() return w == 0 and h == 0 end
local nodeSize = im.ImVec2(200,40)
M.nodes = {
}
ui_flowgraph_editor.SetNodePosition(node.id, im.ImVec2(node.pos.x, node.pos.y))
table.insert(nodes, node)
ui_flowgraph_editor.PushStyleVar2(ui_flowgraph_editor.StyleVar_PivotAlignment, im.ImVec2(0.5, 0.5))
ui_flowgraph_editor.BeginPin(pinIn,ui_flowgraph_editor.PinKind_Input)
--im.SetCursorPosX(cp.x)
im.Dummy(im.ImVec2(10,nodeSize.y))
ui_flowgraph_editor.EndPin()
end
editor.uiIconImage(icon,im.ImVec2(20,20), mission.careerSetup._activeStarCache.defaultStarKeysByKey[key] and defaultStarColor or bonusStarColor)
end
im.Dummy(im.ImVec2(10,nodeSize.y))
ui_flowgraph_editor.EndPin()
txtSize.y = txtSize.y + 6
local center = im.ImVec2(cp.x - txtSize.x, (cp.y + ep.y)/2)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.GetColorU322(im.ImVec4(0.3, 0.3, 0.3, 1)), 3
im.ImDrawList_AddRect(im.GetWindowDrawList(),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.GetColorU322(im.ImVec4(clr.x*str, clr.y*str, clr.z*str, 0.6)), 3, nil , 2
)
im.SetCursorPos(im.ImVec2(center.x - txtSize.x/2+3, center.y - txtSize.y/2+3))
im.Text(text)
end
ui_flowgraph_editor.Begin('asdfsdd', im.ImVec2(0, 0), false)
--ui_flowgraph_editor.NavigateToContent(0.01)
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500,500))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName="Missions"})
@/lua/ge/extensions/editor/audioEventsList.lua
editor.uiIconImage(editor.icons.music_note, im.ImVec2(24,24), im.ImVec4(1,1,1,1))
im.SameLine()
-- Go back to "root" folder
editor.uiIconImage(editor.icons.folder, im.ImVec2(24,24), im.ImVec4(1,1,1,1))
im.SameLine()
im.BeginChild1("##ScrollableGUI", im.ImVec2(0, im.GetContentRegionAvail().y - stopButtonHeight))
-- Render folders and eventsTree
if v.dataType == "dir" then
editor.uiIconImage(editor.icons.folder, im.ImVec2(24,24), im.ImVec4(1,1,1,1))
im.SameLine()
local function renderSearchResultsGui(stopButtonHeight)
im.BeginChild1("##ScrollableGUI", im.ImVec2(0, im.GetContentRegionAvail().y - stopButtonHeight))
if searchResults then
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(500, 500))
editor.addWindowMenuItem(toolWindowTitle, M.onWindowMenuItem, {groupMenuName = 'Audio'})
@/lua/ge/extensions/flowgraph/nodes/debug/testDynamic.lua
builder:Middle()
im.ProgressBar(self.timer / 5, im.ImVec2(50, 0))
end
@/lua/ge/extensions/editor/missionEditor/progressSetup.lua
if self._editing then
im.InputTextMultiline("##facEditor", self._text[1], im.GetLengthArrayCharPtr(self._text[1]), im.ImVec2(-1,-1))
-- display char limit
@/lua/ge/extensions/editor/dynamicDecals/colorHistory.lua
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("remove##ColorHistory_%s_%d", guiId, k)) then
table.remove(data, k)
@/lua/ge/extensions/editor/rendererComponents.lua
editor.icons.folder,
im.ImVec2(24, 24)
) then
local function renderBloomTab()
im.Dummy(im.ImVec2(0, 5))
if im.Checkbox('Debug##Lighting' .. tostring(newPath), tempBoolPtr) then
end
im.Dummy(im.ImVec2(0, 5))
im.Separator()
im.TextUnformatted("Brightness")
im.Dummy(im.ImVec2(0, 5))
local rangeMin = 0
end
im.Dummy(im.ImVec2(0, 5))
im.Separator()
im.TextUnformatted("Bloom")
im.Dummy(im.ImVec2(0, 5))
if im.Checkbox('Enable Bloom##Bloom', tempBoolPtr) then
end
im.Dummy(im.ImVec2(0, 5))
im.Separator()
im.TextUnformatted("Effects")
im.Dummy(im.ImVec2(0, 5))
if im.Checkbox('Enable Color Shift##Effects', tempBoolPtr) then
im.Dummy(im.ImVec2(0, 5))
tempBoolPtr[0] = DOFSettings['enable'].value
end
im.Dummy(im.ImVec2(0, 5))
im.Separator()
im.TextUnformatted("Focus Settings")
im.Dummy(im.ImVec2(0, 5))
im.TextUnformatted("Focus Blur (Near)")
end
im.Dummy(im.ImVec2(0, 15))
im.Separator()
im.TextUnformatted("Debug Stats")
im.Dummy(im.ImVec2(0, 5))
-- Estimate in-focus width (approximate, for user feedback)
local function renderLightRaysTab()
im.Dummy(im.ImVec2(0, 5))
tempBoolPtr[0] = lightraysSettings['enable'].value
im.Dummy(im.ImVec2(0, 5))
local rangeMin = lightraysSettings['brightness'].range[1]
end
im.Dummy(im.ImVec2(0, 15))
if im.Button("Reset to defaults") then
im.Columns(4)
local buttonSize = im.ImVec2(im.GetContentRegionAvailWidth(), 42)
if im.Button("Load Preset...", buttonSize) then
end
im.Dummy(im.ImVec2(0, 10))
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(300, 500))
editor.addWindowMenuItem("Renderer Components", onWindowMenuItem)
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
local defaultPaint = {1, 1, 1, 1}
local imDummy = im.ImVec2(0, 5)
local defaultColumnWidth = 80
im.BeginChild1("##vehicleSelector"..dumps(self.id), im.ImVec2(im.GetContentRegionAvailWidth(), elemCount * elemHeight + elemPadding))
@/lua/ge/extensions/flowgraph/nodes/scene/raceLineParking.lua
local centerOffset = vec3(140,20)
local tlCenter = im.ImVec2(0,0)
local dl, wp
local cYellow = im.GetColorU322(im.ImVec4(1, 1, 0.5, 0.5))
local aL, bL = im.ImVec2(0,0), im.ImVec2(0,0)
function C:drawLine(line, color, thickness)
local cYellow = im.GetColorU322(im.ImVec4(1, 1, 0.5, 0.5))
local aL, bL = im.ImVec2(0,0), im.ImVec2(0,0)
function C:drawLine(line, color, thickness)
function C:drawImgui()
local childSize = im.ImVec2(280,300)
tlCenter = im.GetCursorScreenPos()
@/lua/ge/extensions/editor/dynamicDecals/history.lua
im.BeginChild1(string.format("DynamicDecalsHistoryChild%s", guiId), im.ImVec2(0, childHeight), true)
if im.Button("Delete All History##DynamicDecalsTool") then history:clear() end
if im.Button("Undo Selected##DynamicDecalsTool") then history:undo(tableSize(history.undoStack) - undoStackSelectedIndex + 1) end
im.BeginChild1("undos", im.ImVec2(0, im.GetContentRegionAvail().y))
for k = tableSize(history.undoStack), 1, -1 do
if im.Button("Redo Selected##DynamicDecalsTool") then history:redo(tableSize(history.redoStack) - redoStackSelectedIndex + 1) end
im.BeginChild1("redos", im.ImVec2(0, im.GetContentRegionAvail().y))
for k = tableSize(history.redoStack), 1, -1 do
@/lua/ge/extensions/util/screenshotCreator.lua
local tableFlags = bit.bor(im.TableFlags_NoBordersInBody)
local imVec24x24 = im.ImVec2(24,24)
local imVec32x32 = im.ImVec2(32, 32)
local imVec24x24 = im.ImVec2(24,24)
local imVec32x32 = im.ImVec2(32, 32)
local imVec4Grey = im.ImVec4(0.65,0.65,0.65,1)
local windowOpen = im.BoolPtr(false)
local initialWindowSize = im.ImVec2(300, 500)
local runDone = false
im.Dummy(im.ImVec2(1, 5))
end
im.Dummy(im.ImVec2(1, 20))
else
im.Dummy(im.ImVec2(1, 20))
end
im.Dummy(im.ImVec2(1, 20))
local halfWidth = im.GetContentRegionAvailWidth() / 2
if im.BeginChild1("unselectedSection", im.ImVec2(halfWidth, 0), true) then
im.Text("Unselected Models")
im.Text("Unselected Models")
if im.BeginChild1("unselectedVehs", im.ImVec2(0,0), true) then
if vehList then
im.SameLine()
if im.BeginChild1("selected", im.ImVec2(halfWidth, 0), true) then
im.Text("Selected Models")
im.Text("Selected Models")
if im.BeginChild1("selectedVehs", im.ImVec2(0,0), true) then
if vehList then
im.Dummy(im.ImVec2(1, 10))
im.TextWrapped(" will be used for the spawned config.")
im.Dummy(im.ImVec2(1, 10))
end
im.Dummy(im.ImVec2(1, 10))
local imguiHeight = 230
if im.BeginChild1("Parent parent", im.ImVec2(0, imguiHeight), true) then
if im.BeginChild1("Config list", im.ImVec2(im.GetContentRegionAvailWidth() / 2, 0), nil) then
if im.BeginChild1("Parent parent", im.ImVec2(0, imguiHeight), true) then
if im.BeginChild1("Config list", im.ImVec2(im.GetContentRegionAvailWidth() / 2, 0), nil) then
if im.BeginTable('Model configs', 4, nil) then
local cameraConfigs = getCameraConfig(currModelName, currConfigName)
if im.BeginChild1("Config custom camera", im.ImVec2(im.GetContentRegionAvailWidth() / 2, 0), true) then
if cameraConfigs.vehCamConfig and cameraConfigs.vehCamConfig.cameraConfig then
local halfWidth = im.GetContentRegionAvailWidth() / 2
if im.BeginChild1("Vehicle list info", im.ImVec2(halfWidth, 0), true) then
im.Text("Thumbnail status list : ")
im.Text("Thumbnail status list : ")
im.Dummy(im.ImVec2(1, 10))
im.BeginTooltip()
im.Image(thumb.texId, thumb.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
im.BeginTooltip()
im.Image(thumb.texId, thumb.size, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.EndTooltip()
if im.BeginChild1("Run info", im.ImVec2(halfWidth, 0), true) then
im.Text("General info : ")
im.Dummy(im.ImVec2(1, 10))
im.Text("Generate missing thumbnails only : " .. (reviewData.onlyMissingThumbnails and "Yes" or "No"))
@/lua/ge/extensions/editor/autoSave.lua
imgui.Separator()
imgui.BeginChild1("autosaves", imgui.ImVec2(0, 200))
for k = tableSize(autosaves), 1, -1 do
@/lua/ge/extensions/editor/flowgraph/variables.lua
local highlightColor = im.ImVec4(1,0.5,0,1)
local imVec24x24 = im.ImVec2(24,24)
local imVec4Red = im.ImVec4(1,0.3,0.3,0.7)
self.newVariableNameField = im.ArrayChar(64,"")
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
self.dragPayload = nil
if not self.mgr.allowEditing then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.add, im.ImVec2(35,35)) then
im.OpenPopup("addVariablePopup")
if not self.mgr.allowEditing then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.add, im.ImVec2(35,35)) then
im.OpenPopup("addVariablePopup")
im.SameLine()
if im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), -1)) then
acceptCreate = true
local flags = (not variable.expanded) and bit.bor(im.WindowFlags_NoScrollbar, im.WindowFlags_NoScrollWithMouse) or nil
im.BeginChild1(target.id..varName..dumps(global), im.ImVec2(im.GetContentRegionAvailWidth(), scale*(variable.expanded and 68 or 24)+16), true, flags)
im.SetCursorPosX(width - 75*scale - 5)
editor.uiIconImageButton(editor.icons.cloud_download, im.ImVec2(24,24))
if im.IsItemHovered() and im.IsMouseReleased(0) and not self.dragPayload then
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
local pos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
local node = self.mgr.graph:createNode("types/getVariable")
im.SameLine()
editor.uiIconImageButton(editor.icons.cloud_upload, im.ImVec2(24,24))
if im.IsItemHovered() and im.IsMouseReleased(0) and not self.dragPayload then
local bounds = ui_flowgraph_editor.GetVisibleCanvasBounds()
local pos = im.ImVec2((bounds.x + bounds.z) / 2, (bounds.y + bounds.w) / 2)
local node = self.mgr.graph:createNode("types/setVariable")
im.SetCursorPosX(width - 22*scale)
editor.uiIconImageButton(editor.icons.reorder, im.ImVec2(24,24), self.dragPayload and self.dragPayload.name == varName and self.dragPayload.target.id == target.id and highlightColor or nil)
if im.IsItemHovered() and im.IsItemClicked() then
if not self.dragPayload then
im.SetCursorPos(im.ImVec2(prePos.x - 5, prePos.y -5))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(0, 0))
im.SetCursorPos(im.ImVec2(prePos.x - 5, prePos.y -5))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(0, 0))
im.BeginChild1(target.id..varName..dumps(global).."clicker", im.ImVec2(im.GetContentRegionAvailWidth()-90*scale, endPos.y-prePos.y+3))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(0, 0))
im.BeginChild1(target.id..varName..dumps(global).."clicker", im.ImVec2(im.GetContentRegionAvailWidth()-90*scale, endPos.y-prePos.y+3))
im.EndChild()
im.Separator()
im.Dummy(im.ImVec2(1,1))
ui_flowgraph_editor.variableEditor(target, varName, {global = global, showNodes = true, allowDelete = true})
if math.abs(mousePos.y - y) < dragReleaseVerticalDistance and mousePos.x > mouseXMin and mousePos.x < mouseXMax then
im.ImDrawList_AddLine(im.GetWindowDrawList(), im.ImVec2(im.GetCursorScreenPos().x+10, y-1), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth()-20, y-1), lineColor, 3)
if im.IsMouseReleased(0) then
if math.abs(mousePos.y - y) < dragReleaseVerticalDistance and mousePos.x > mouseXMin and mousePos.x < mouseXMax then
im.ImDrawList_AddLine(im.GetWindowDrawList(), im.ImVec2(im.GetCursorScreenPos().x+10, y-1), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth()-20, y-1), lineColor, 3)
if im.IsMouseReleased(0) then
@/lua/ge/extensions/editor/suspensionAudioDebug.lua
local impulseArr = im.TableToArrayFloat(beamSounds[bi].impulseTbl)--not actually stress, things are named poorly in sounds.lua
im.PlotLines1("", impulseArr, im.GetLengthArrayFloat(impulseArr), counter, "maxStress: " ..tostring(val.maxStress), 0, val.maxStress, im.ImVec2(400, 80))
im.Text("Pitch")
local pitchArr = im.TableToArrayFloat(beamSounds[bi].pitchTbl)
im.PlotLines1("", pitchArr, im.GetLengthArrayFloat(pitchArr), counter, "pitchFactor: " ..tostring(val.pitchFactor), 0, val.pitchFactor, im.ImVec2(400, 80))
im.Text("Volume")
local volumeArr = im.TableToArrayFloat(beamSounds[bi].volumeTbl)
im.PlotLines1("", volumeArr, im.GetLengthArrayFloat(volumeArr), counter, "volumeFactor: " ..tostring(val.volumeFactor), 0, 1, im.ImVec2(400, 80))
end
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,200))
editor.addWindowMenuItem(wndName, open, {groupMenuName = 'Audio'})
@/lua/ge/extensions/editor/dragRaceEditor/waypoints.lua
M.drawWaypointsSection = function()
im.BeginChild1("waypoints", im.ImVec2(0, 150), true)
im.Text("Waypoints")
im.BeginChild1("waypointDetails", im.ImVec2(0, 0), true)
im.Text("Waypoint Details")
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua
im.Text(" no data")
im.ProgressBar(0, im.ImVec2(200, 0), "")
else
local progress = (proximityData.timer or 0) / math.max(1e-12, proximityData.duration or 1)
im.ProgressBar(progress, im.ImVec2(200, 0), string.format("%.1f/%.1fs", proximityData.timer or 0, proximityData.duration or 0))
end
@/lua/ge/extensions/editor/particleEditor.lua
im.SameLine()
if editor.uiIconImageButton(editor.icons.add_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
newEmitter()
im.SameLine()
if editor.uiIconImageButton(editor.icons.material_save_current, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
saveEmitter(currentEmitter)
im.SameLine()
if editor.uiIconImageButton(editor.icons.material_save_all, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
saveEmitterToLevel(currentEmitter)
end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
deleteEmitter(currentEmitter)
if particleCount >= 4 then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.add_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
newParticle()
if not currentParticle then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.material_save_current, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
editor.saveDataBlockToFile(currentParticle)
if not currentParticle or particleCount <= 1 then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
deleteParticle(currentParticle)
if confirmationWindowOpen then
im.SetNextWindowPos(im.ImVec2(windowPos.x+50, windowPos.y+50), im.Cond_Appearing)
--TODO: convert to modal popup
if requestedEmitter then
im.SetNextWindowPos(im.ImVec2(windowPos.x+50, windowPos.y+50), im.Cond_Appearing)
--TODO: convert to modal popup
if requestedParticle then
im.SetNextWindowPos(im.ImVec2(windowPos.x+50, windowPos.y+50), im.Cond_Appearing)
--TODO: convert to modal popup
im.SameLine()
if editor.uiIconImageButton(editor.icons.add_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
local newParticleName = Sim.getUniqueName("newParticle")
im.SameLine()
if editor.uiIconImageButton(editor.icons.remove_circle, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
table.remove(particleNames, i)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua
imgScale = 0.5,
imgPos = im.ImVec2(200, 100),
},
imgScale = 0.5,
imgPos = im.ImVec2(200, 450),
}
local wndPos = im.GetWindowPos()
return im.ImVec2(wndPos.x + x, wndPos.y + y)
end
if x and y then
im.SetCursorPos(im.ImVec2(x, y))
end
im.SetCursorPos(leftView.imgPos)
im.Image(leftView.img.texId, leftView.imgSize, im.ImVec2(0, 0), im.ImVec2(1, 1))
--im.ImDrawList_AddCircle(im.GetWindowDrawList(), localToGlobalPos(imgPos.x, imgPos.y), 2, whiteColor, 8, 2)
im.SetCursorPos(leftView.imgPos)
im.Image(leftView.img.texId, leftView.imgSize, im.ImVec2(0, 0), im.ImVec2(1, 1))
--im.ImDrawList_AddCircle(im.GetWindowDrawList(), localToGlobalPos(imgPos.x, imgPos.y), 2, whiteColor, 8, 2)
im.SetCursorPos(bottomView.imgPos)
im.Image(bottomView.img.texId, bottomView.imgSize, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.SetCursorPos(bottomView.imgPos)
im.Image(bottomView.img.texId, bottomView.imgSize, im.ImVec2(0, 0), im.ImVec2(1, 1))
im.SetCursorPos(im.ImVec2(cursorPosX, 800))
addVarFloatSlider(nil, nil, '$weightscale')
local wndPos = im.GetWindowPos()
im.SetCursorPos(im.ImVec2(5, 50))
im.Text(string.format("Mouse Pos: %0.2f, %0.2f", im.GetMousePos().x - wndPos.x, im.GetMousePos().y - wndPos.y))
view.img = imguiUtils.texObj(view.imgPath)
view.imgSize = im.ImVec2(view.img.size.x * view.imgScale, view.img.size.y * view.imgScale)
end
end
editor.registerWindow(wndName, im.ImVec2(700,400))
end
@/lua/ge/extensions/editor/raceEditor/segments.lua
local avail = im.GetContentRegionAvail()
im.BeginChild1("segments", im.ImVec2(125 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
for i, segment in ipairs(self.path.segments.sorted) do
im.SameLine()
im.BeginChild1("currentSegment", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
if self.index then
end
im.BeginChild1("currentSegmentInner", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local editEnded = im.BoolPtr(false)
if segment.mode == 'capsules' then
im.BeginChild1("capsules", im.ImVec2(125 * im.uiscale[0], 0), im.WindowFlags_ChildWindow)
for i, cap in ipairs(segment.capsulePoints) do
im.SameLine()
im.BeginChild1("currentCapsule", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local cap = segment.capsulePoints[self.capsuleIndex]
@/lua/ge/extensions/editor/api/valueInspector.lua
local undefinedInteger = 2147483647
local filteredFieldPopupSize = imgui.ImVec2(500, 500)
local tooltipLongTextLength = 70
local integerFormat = "%0.0f"
local clearButtonSize = imgui.ImVec2(24, 24)
local simSetNameFilter = imgui.ImGuiTextFilter()
end
imgui.SetNextWindowPos(imgui.ImVec2(mousePos.x, mousePos.y))
imgui.SetNextWindowSize(imgui.ImVec2(windowSize.x, windowSize.y))
imgui.SetNextWindowPos(imgui.ImVec2(mousePos.x, mousePos.y))
imgui.SetNextWindowSize(imgui.ImVec2(windowSize.x, windowSize.y))
popupWasPositioned = true
texture.texId,
imgui.ImVec2(32, 32),
imgui.ImVec2Zero,
local p1_X_BG = imgui.ImVec2(coloredBG_X_StartPos_X, coloredBG_StartPos_Y)
local p2_X_BG = imgui.ImVec2(coloredBG_X_EndPos_X, coloredBG_EndPos_Y)
local p1_X_BG = imgui.ImVec2(coloredBG_X_StartPos_X, coloredBG_StartPos_Y)
local p2_X_BG = imgui.ImVec2(coloredBG_X_EndPos_X, coloredBG_EndPos_Y)
local color_X_BG = imgui.GetColorU322(imgui.ImVec4(0.7, 0.0, 0.0, 1.0))
local color_X_BG = imgui.GetColorU322(imgui.ImVec4(0.7, 0.0, 0.0, 1.0))
local p1_X_Text = imgui.ImVec2(coloredBG_X_StartPos_X + coloredBGWidth / 2 - textWidth / 2, textPadding_Y)
local p1_Y_BG = imgui.ImVec2(coloredBG_Y_StartPos_X, coloredBG_StartPos_Y)
local p2_Y_BG = imgui.ImVec2(coloredBG_Y_EndPos_X, coloredBG_EndPos_Y)
local p1_Y_BG = imgui.ImVec2(coloredBG_Y_StartPos_X, coloredBG_StartPos_Y)
local p2_Y_BG = imgui.ImVec2(coloredBG_Y_EndPos_X, coloredBG_EndPos_Y)
local color_Y_BG = imgui.GetColorU322(imgui.ImVec4(0.0, 0.7, 0.0, 1.0))
local color_Y_BG = imgui.GetColorU322(imgui.ImVec4(0.0, 0.7, 0.0, 1.0))
local p1_Y_Text = imgui.ImVec2(coloredBG_Y_StartPos_X + coloredBGWidth / 2 - textWidth / 2, textPadding_Y)
local p1_Z_BG = imgui.ImVec2(coloredBG_Z_StartPos_X, coloredBG_StartPos_Y)
local p2_Z_BG = imgui.ImVec2(coloredBG_Z_EndPos_X, coloredBG_EndPos_Y)
local p1_Z_BG = imgui.ImVec2(coloredBG_Z_StartPos_X, coloredBG_StartPos_Y)
local p2_Z_BG = imgui.ImVec2(coloredBG_Z_EndPos_X, coloredBG_EndPos_Y)
local color_Z_BG = imgui.GetColorU322(imgui.ImVec4(0.0, 0.0, 1.0, 1.0))
local color_Z_BG = imgui.GetColorU322(imgui.ImVec4(0.0, 0.0, 1.0, 1.0))
local p1_Z_Text = imgui.ImVec2(coloredBG_Z_StartPos_X + coloredBGWidth / 2 - textWidth / 2, textPadding_Y)
if customData and customData.coloredLabelIndicator then drawColoredLabelIndicator = true end
if drawColoredLabelIndicator then imgui.PushStyleVar2(imgui.StyleVar_FramePadding, imgui.ImVec2(imgui.GetFontSize(), 0)) end
if customData and customData.coloredLabelIndicator then drawColoredLabelIndicator = true end
if drawColoredLabelIndicator then imgui.PushStyleVar2(imgui.StyleVar_FramePadding, imgui.ImVec2(imgui.GetFontSize(), 0)) end
end
imgui.ColorButton("Annotation color", bgColor, 0, imgui.ImVec2(25, 19))
imgui.SameLine()
end
imgui.ColorButton(fieldNameId, bgColor, 0, imgui.ImVec2(25, 19))
imgui.SameLine()
@/lua/ge/extensions/gameplay/drift/scoring.lua
if debugToggleSmothnessGraph[0] then
im.BeginChild1("Data", im.ImVec2(im.GetContentRegionAvailWidth() / 100 * 65, 300), true)
-- debug graph
im.SameLine()
im.BeginChild1("Legend", im.ImVec2(im.GetContentRegionAvailWidth(), 300), true)
im.PushStyleColor2(im.Col_Text, im.ImVec4(1, 1, 0.1, 1))
if scoreExperiment[0] then
im.BeginChild1("change", im.ImVec2(0, 140), true)
im.Text("Experiment (CTRL + L to reset):")
@/lua/ge/extensions/editor/rallyEditor/static.lua
if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
if FS:fileExists(variant.audioFname) then
-- im.SameLine()
-- if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
-- if file_exists then
-- im.SameLine()
-- if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
-- if file_exists then
@/lua/ge/extensions/core/vehicle/manager.lua
im = ui_imgui
editor.registerWindow(toolWindowName, im.ImVec2(420, 500))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName = 'Vehicles'})
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua
if im.Button("Set Wheels", im.ImVec2(150, 25)) then
setWheels()
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
if not editor.isWindowRegistered(wnm) then
editor.registerWindow(wnm) --, im.ImVec2(200, 700))
end
if not editor.isWindowRegistered(wnm) then
editor.registerWindow(wnm) --, im.ImVec2(200, 700))
end
local wndPos = im.GetWindowPos()
return im.ImVec2(wndPos.x + x, wndPos.y + y)
end
id = id + 1
im.BeginChild1('DAE', im.ImVec2(0, cdaeHeight), true)
im.Columns(2, "geoPanel", true)
--------------------------
im.BeginListBox(id, im.ImVec2(-1,tablineHeight*(#daedata.alod+1)))
UI.table('tLOD152',daedata.alod,function(k,v)
end
im.Dummy(im.ImVec2(0,0))
--------------------------
inghover = false
im.BeginChild1('PARTS', im.ImVec2(0, avail.y/(env.ui['model_on'] and 1 or 2)), false)
-- im.Text(''..avail.x..':'..avail.y)
id = id + 1
if im.BeginListBox(id, im.ImVec2(-1,lineH*#geonode.astep)) then
-- im.Text('GEO_PATH')
local w = im.GetColumnWidth()
im.Dummy(im.ImVec2(w-40,0))
im.SameLine()
local w = im.GetColumnWidth()
im.Dummy(im.ImVec2(w-40,0))
im.SameLine()
id = id + 1
if im.BeginListBox(id, im.ImVec2(-1,avail.y-30*4-6)) then
UI.table('tGRP_17',beamdata.agroup,function(k,v)
id = id + 1
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
-- im.Text('TODO: inputs')
local grp = beamdata.agpick[1]
im.Dummy(im.ImVec2(0,8))
im.Columns(2)
UI.buttonImg('group_edit', 'floppyDisk', {34,34}, UI.colorOn,
nil,nil,im.ImVec2(0,-14)
)
--[[
UI.buttonTxt('gorup_edit','OK',im.ImVec2(28,20),
-- im.ImVec4(0.1,0.6,0,1),
nil,
im.ImVec4(1,0.9,0.9,0.2),im.ImVec2(2,2)
)
editor.icons.keyboard_arrow_right,
im.ImVec2(20,20), im.ImVec4(1.0, 1.0, 1.0, 0.8), nil, nil, nil,
im.ImVec4(1.0, 1.0, 0.0, 1))
-------------------------
im.BeginListBox(id, im.ImVec2(-1,-1))
if env.ui['geo_up'] and daedata.dgeo[env.ui['geo_up']] then
-- local cur = im.GetCursorPos()
-- im.SetCursorPos(im.ImVec2(cur.x,cur.y-16))
elseif false then
id = id + 1
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
for j,af in pairs(list) do
-- UI.columnRight(60)
-- im.Dummy(im.ImVec2(0, 2))
---------------------------------
-- im.SameLine()
-- im.Dummy(im.ImVec2(0,0))
-- im.Dummy(im.ImVec2(0,0))
-- im.Dummy(im.ImVec2(0,0))
-- im.Dummy(im.ImVec2(0,0))
im.Indent(12)
UI.buttonTxt('view_flip', inmesh and 'J <- M' or 'J -> M',
im.ImVec2(54,30), nil,
im.ImVec4(0.0, 0.3, 0.5, 0.5),
-- im.ImVec4(0.0, 0.4, 0.3, 0.5),
im.ImVec2(2, 2))
im.PopFont()
if not env.ui['model_on'] or inmesh then
im.Dummy(im.ImVec2(0, 1))
UI.combo('Material', 'mat_on', amat, cmat-1)
-- im.BeginChild1('FILES', im.ImVec2(0, -1), true)
-- im.Text('Shape type_POST2')
if not indae then
-- if im.BeginChild1('DAE', im.ImVec2(-1, 100), true) then
-- im.EndChild()
-- im.Text('Shape type')
if im.BeginListBox(id, im.ImVec2(-1,avail.y-40)) then
if not env.ui['model_on'] then
im.Image(dimg[v].tex:getID(),
im.ImVec2(30, 30),
im.ImVec2(0.,0.), im.ImVec2(1,1),
im.ImVec2(30, 30),
im.ImVec2(0.,0.), im.ImVec2(1,1),
nil,
im.ImVec2(30, 30),
im.ImVec2(0.,0.), im.ImVec2(1,1),
nil,
end
-- if im.BeginListBox(id, im.ImVec2(-1,#fsnode.afile*(lineH-3))) then
-- im.Text('Shape type_PRE:'..#fsnode.afile)
id = id + 1
if im.BeginListBox(id, im.ImVec2(-1,#fsnode.astep*(lineH+0))) then
im.Columns(3, "folderPath", false)
color = infilter and UI.cbutOn or UI.cbutOff
UI.buttonImg('fav_filter_on', 'star', im.ImVec2(iconsz,iconsz), color, nil, vec3(0.6,0.6))
im.Unindent(-4)
-- im.Indent(-40)
UI.buttonImg('fav_to', 'star', im.ImVec2(iconsz,iconsz), UI.colorOn, nil, vec3(0.6,0.6))
-- im.Unindent(-40)
im.Image(dimg[md].tex:getID(),
im.ImVec2(w, w),
im.ImVec2(0.,0.), im.ImVec2(1,1),
im.ImVec2(w, w),
im.ImVec2(0.,0.), im.ImVec2(1,1),
nil,
im.ImVec2(w, w),
im.ImVec2(0.,0.), im.ImVec2(1,1),
nil,
-- im.Dummy(im.ImVec2(40, 40))
-- im.BeginGroup()
avail = im.GetContentRegionAvail()
if im.BeginListBox(id, im.ImVec2(-1,avail.y-40)) then
-- if im.BeginListBox(id, im.ImVec2(-1,avail.y-38)) then
if im.BeginListBox(id, im.ImVec2(-1,avail.y-40)) then
-- if im.BeginListBox(id, im.ImVec2(-1,avail.y-38)) then
im.Columns(2, "folderList", true)
color = fsnode.adir[i].fav==1 and im.ImVec4(0.7, 0.7, 0.0, 0.7) or UI.cbutOff
UI.buttonImg({'fav_up',i}, 'star', im.ImVec2(iconsz,iconsz), color, nil, vec3(0.6,0.6))
im.Unindent(-4)
-- im.Dummy(im.ImVec2(0,0))
-- UI.combo('Models','model_up',amodel,env.ui['model_up'])
end
im.Dummy(im.ImVec2(0,0))
im.PushFont3("cairo_regular_medium")
color = env.ui['bmodel_over'] and im.ImVec4(1, 1, 1, 0.4) or UI.cbutOn
UI.buttonImg('model_on', env.ui['model_on'] and 'folder' or 'car', im.ImVec2(36,36),
color, nil, vec3(0.8,0.8))
-- im.BeginChild1('DAE', im.ImVec2(0, cdaeHeight-0), true)
--[[
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
for j,af in pairs(list) do
--[[
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
inhover = false
@/lua/ge/extensions/editor/flowgraph/properties.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, true)
self.previousNode = nil
im.SameLine()
if editor.uiIconImageButton(editor.icons.format_line_spacing, im.ImVec2(22,22)) then
self._editMultilineText = {saveCallback = saveCallback, buf = im.ArrayChar(8192, v), pos = im.GetCursorScreenPos()}
elseif type == 'table' then
-- im.BeginChild1('##innertable' .. path, im.ImVec2(0, 0))
-- self:_drawDataTable(path, cdata, v, savePath, saveCallback, true)
a.y = a.y - yy
b = im.ImVec2(a.x + b.x + xx * 2, a.y + im.GetFontSize() + 16)
local uv = im.ImVec2(0.5, 0.1)
b = im.ImVec2(a.x + b.x + xx * 2, a.y + im.GetFontSize() + 16)
local uv = im.ImVec2(0.5, 0.1)
im.ImDrawList_AddImageRounded(im.GetWindowDrawList(), self.headerTexture.texId, a, b, im.ImVec2(0, 0), uv, im.GetColorU322(item.color), 0, 0)
local uv = im.ImVec2(0.5, 0.1)
im.ImDrawList_AddImageRounded(im.GetWindowDrawList(), self.headerTexture.texId, a, b, im.ImVec2(0, 0), uv, im.GetColorU322(item.color), 0, 0)
im.PushItemWidth(100)
im.Dummy(im.ImVec2(0,24))
im.SameLine()
if not self._editCustomProperties then
if editor.uiIconImageButton(editor.icons.mode_edit, im.ImVec2(22, 22)) then
self:initCustomProperties(item)
if im.BeginPopup("FGIconSelector") then
im.BeginChild1("fgSelIcon", im.ImVec2(250*im.uiscale[0],400*im.uiscale[0]))
editor_iconOverview.drawContent(function(v)
if item.customIconColor then
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(22,22)) then
item.customIconColor = nil
if editor.uiIconImageButton(editor.icons[item.customIcon or item.icon or "add"], im.ImVec2(22, 22)) then
im.OpenPopup("FGIconSelector")
im.SameLine()
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(22,22)) then
item.customIcon = nil
im.SameLine()
im.Dummy(im.ImVec2(20,1))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(22,22)) then
item.customColor = nil
im.SameLine()
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(22,22)) then
item.customName = nil
im.SameLine()
if editor.uiIconImageButton(editor.icons.check or editor.icons.add, im.ImVec2(22, 22)) then
-- save name again in case enter has not been pressed
if icon and editor.icons[icon] then
editor.uiIconImage(editor.icons[icon], im.ImVec2(22, 22), item.customIconColor or item.iconColor)
im.SameLine()
im.SameLine(im.GetWindowWidth() - 110)
if im.Button("Set Once", im.ImVec2(90, 22)) then
item:setDynamicMode('once')
im.SameLine(im.GetWindowWidth() - 110)
if im.Button("Set Repeat", im.ImVec2(90, 22)) then
item:setDynamicMode('repeat')
if pin.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(24, 24), im.ImVec4(0.3, 0.3, 0.3, 1))
if im.IsItemClicked() and self.mgr.allowEditing then
else
editor.uiIconImage(editor.icons.visibility, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing and not firstLink then
if pin.pinMode == 'hardcoded' then
editor.uiIconImage(editor.icons.lock_outline, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing then
if pin.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(24, 24), im.ImVec4(0.3, 0.3, 0.3, 1))
if im.IsItemClicked() and self.mgr.allowEditing then
else
editor.uiIconImage(editor.icons.visibility, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing and not firstLink then
if pin.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(24, 24), im.ImVec4(0.3, 0.3, 0.3, 1))
if im.IsItemClicked() and self.mgr.allowEditing then
else
editor.uiIconImage(editor.icons.visibility, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing and not firstLink then
if pin.pinMode == 'hardcoded' then
editor.uiIconImage(editor.icons.lock_outline, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing then
if pin.hidden then
editor.uiIconImage(editor.icons.visibility_off, im.ImVec2(24, 24), im.ImVec4(0.3, 0.3, 0.3, 1))
if im.IsItemClicked() and self.mgr.allowEditing then
else
editor.uiIconImage(editor.icons.visibility, im.ImVec2(24, 24), ui_flowgraph_editor.getTypeColor(pin.type))
if im.IsItemClicked() and self.mgr.allowEditing and not firstLink then
else
editor.uiInputTextMultiline("##ml",self._editMultilineText.buf,8192, im.ImVec2(250*im.uiscale[0],400*im.uiscale[0]))
end
local editEnded = im.BoolPtr(false)
if editor.uiInputTextMultiline('##Description', textinput, 512,im.ImVec2(im.GetContentRegionAvailWidth(),150), nil, nil, nil, editEnded) then
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/careerActive.lua
editor.uiIconImage(editor.icons[(career_career and career_career.isActive()) and 'check' or 'close'], im.ImVec2(40, 40), (career_career and career_career.isActive()) and im.ImVec4(0.3,1,0.3,1) or im.ImVec4(1,1,1,0.3))
@/lua/ge/extensions/editor/raceEditor.lua
if not editor.editMode or editor.editMode.displayName ~= editModeName then
if im.Button("Switch to Race Editor Editmode", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
editor.selectEditMode(editor.editModes.raceEditMode)
editor.editModes.raceEditMode.auxShortcuts[editor.AuxControl_LMB] = "Select"
editor.registerWindow(toolWindowName, im.ImVec2(500, 500))
editor.addWindowMenuItem("Race/Path Editor", function() show() end,{groupMenuName="Gameplay"})
@/lua/common/extensions/ui/flowgraph/editor.lua
local clr = im.ImVec4(value[1], value[2], value[3], value[4])
editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20), clr, nil, clr)
im.SameLine()
local clr = im.ImVec4(value[1], value[2], value[3], value[4])
editor.uiIconImageButton(editor.icons.stop, im.ImVec2(20, 20), clr, nil, clr)
im.SameLine()
im.SetCursorPosX(totalWidth - 22 * im.uiscale[0])
if editor.uiIconImageButton(editor.icons.settings, im.ImVec2(22, 22)) then
im.OpenPopup(source.id .. "-" .. name)
im.BeginChild1(self._imguiId, im.ImVec2(-1, height), false, im.WindowFlags_NoScrollWithMouse)
if self.models == nil or next(self.models) == nil then
im.SameLine()
if editor.uiIconImageButton(editor.icons.search, im.ImVec2(22, 22)) then
self.openPopup = true
if im.BeginPopup("vehicleSearchUtil"..self._imguiId) then
im.BeginChild1("vehicleSearchUtilChild"..self._imguiId, im.ImVec2(350,250))
local searchChanged = false
for _, result in ipairs(vehSearchResults) do
im.BeginChild1(result.id, im.ImVec2(im.GetContentRegionAvailWidth(), 20 * editor.getPreference("ui.general.scale")))
local cPos = im.GetCursorScreenPos()
if im.IsItemHovered() then
im.ImDrawList_AddRect(im.GetWindowDrawList(), cPos, im.ImVec2(cPos.x + size.x, cPos.y + size.y), im.GetColorU322(im.ImVec4(1,0.6,0,0.5)), nil, nil, 1)
end
@/lua/ge/extensions/editor/flowgraph/overview.lua
self.contextMenuElement = nil
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
end
@/lua/ge/extensions/editor/techServerManager.lua
editor.registerWindow(toolWindowName, im.ImVec2(500, 155))
editor.addWindowMenuItem('BeamNGpy Server', onWindowMenuItem, {groupMenuName = 'Tech'})
@/lua/ge/extensions/flowgraph/link.lua
-- Push style changes
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(5, 5))
im.PushStyleColor2(im.Col_Separator, im.ImVec4(1.0, 1.0, 1.0, 0.175))
txtSize.y = txtSize.y + 6
local center = im.ImVec2((sPin.imPos.x + tPin.imPos.x)/2+8,(sPin.imPos.y + tPin.imPos.y)/2+8)
local off = im.GetWindowPos()
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.GetColorU322(im.ImVec4(0.3, 0.3, 0.3, 1)), 3
im.ImDrawList_AddRect(im.GetWindowDrawList(),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.ImVec2(center.x - txtSize.x/2 + off.x, center.y - txtSize.y/2 + off.y),
im.ImVec2(center.x + txtSize.x/2 + off.x, center.y + txtSize.y/2 + off.y),
im.GetColorU322(im.ImVec4(self.color.x, self.color.y, self.color.z, 0.6)), 3, nil , 2
)
im.SetCursorPos(im.ImVec2(center.x - txtSize.x/2+3, center.y - txtSize.y/2+3))
im.Text(self.label)
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
-- Module constants (UI).
local toolWinName, toolWinSize = 'SensorConfigurationEditor', im.ImVec2(300, 230) -- The main tool window of the editor. The main UI entry point.
local attachedSensorsWinName, attachedSensorsWinSize = 'AttachedSensorsWindow', im.ImVec2(230, 290) -- The per-vehicle 'attached sensors' window.
local toolWinName, toolWinSize = 'SensorConfigurationEditor', im.ImVec2(300, 230) -- The main tool window of the editor. The main UI entry point.
local attachedSensorsWinName, attachedSensorsWinSize = 'AttachedSensorsWindow', im.ImVec2(230, 290) -- The per-vehicle 'attached sensors' window.
local sensorPropWinName, sensorPropWinSize = 'SensorPropertiesWindow', im.ImVec2(290, 880) -- The per-sensor 'sensor properties' window.
local attachedSensorsWinName, attachedSensorsWinSize = 'AttachedSensorsWindow', im.ImVec2(230, 290) -- The per-vehicle 'attached sensors' window.
local sensorPropWinName, sensorPropWinSize = 'SensorPropertiesWindow', im.ImVec2(290, 880) -- The per-sensor 'sensor properties' window.
local isAttachedSensorsWinOpen = false
winBaseName = 'CameraPreviewWindow',
winSize = im.ImVec2(290, 600),
render = nil,
winBaseName = 'IMUPreviewWindow',
winSize = im.ImVec2(290, 600),
render = nil,
winBaseName = 'UltrasonicPreviewWindow',
winSize = im.ImVec2(400, 200),
render = nil,
local gray = im.ImVec4(0.5, 0.5, 0.5, 1)
local sensorIcon = im.ImVec2(32, 32) -- Some commonly-used Imgui icon size vectors.
local beginDragRotation = vec3(0, 0)
local plotOffset = 0
local plotSize = im.ImVec2(500, 70)
local imuPlotData = {}
im.Separator()
if im.BeginListBox("", im.ImVec2(287, 180), im.WindowFlags_ChildWindow) then
local numVehicles = #vehicles
if #vehicles > 1 then
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), redB, nil, nil, 'removeVehicleButton' .. i) then
vehicles[i].veh:delete()
-- 'Go To Vehicle' button.
if editor.uiIconImageButton(editor.icons.cameraFocusOnVehicle2, im.ImVec2(21, 21), greenB, nil, nil, 'goToVehicleButton' .. i) then
core_camera.setByName(0, "orbit", false)
if isAttachedSensorsWinOpen and i == selectedVehicleIdx then btnCol = blueD end
if editor.uiIconImageButton(editor.icons.wifi, im.ImVec2(19, 19), btnCol, nil, nil, 'openAttachedSensorsWinButton' .. i) then
if i == selectedVehicleIdx or not isAttachedSensorsWinOpen then
local numSensors = #sensors
if im.BeginListBox("", im.ImVec2(222, 180), im.WindowFlags_ChildWindow) then
for i = 1, numSensors do
-- 'Remove Sensor' button.
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), redB, nil, nil, 'removeSensorButton' .. i) then
selectedSensorIdx = min(numSensors, selectedSensorIdx)
if isSensorPropWinOpen and i == selectedSensorIdx then btnCol = greenD end
if editor.uiIconImageButton(editor.icons.build, im.ImVec2(21, 21), btnCol, nil, nil, 'editSensorButton' .. i) then
if i == selectedSensorIdx or not isSensorPropWinOpen then
if preview then btnCol = greenD end
if editor.uiIconImageButton(config.icon, im.ImVec2(21, 21), btnCol, nil, nil, config.buttonId .. i) then
if preview then
if sensor.isLive then btnCol, btnIcon = blueD, editor.icons.wifi_lock end
if editor.uiIconImageButton(btnIcon, im.ImVec2(19, 19), btnCol, nil, nil, 'toggleLiveSensorButton' .. i) then
sensor.isLive = not sensor.isLive
im.Text("You can use this code to recreate the configuration in BeamNGpy:")
im.InputTextMultiline("##pythonCode", pythonCodePtr, pythonCodeLen, im.ImVec2(1200, 400))
im.Separator()
local cursorPos = im.GetCursorScreenPos()
local sliderStart = im.ImVec2(cursorPos.x + padding, cursorPos.y)
local sliderEnd = im.ImVec2(cursorPos.x + padding + sliderWidth, cursorPos.y + sliderHeight)
local sliderStart = im.ImVec2(cursorPos.x + padding, cursorPos.y)
local sliderEnd = im.ImVec2(cursorPos.x + padding + sliderWidth, cursorPos.y + sliderHeight)
im.ImDrawList_AddLine(drawList, im.ImVec2(markerX, sliderStart.y), im.ImVec2(markerX, sliderEnd.y), markerColor, 4)
im.ImDrawList_AddCircleFilled(drawList, im.ImVec2(markerX, sliderStart.y + sliderHeight * 0.5), 8, markerColor)
im.ImDrawList_AddLine(drawList, im.ImVec2(markerX, sliderStart.y), im.ImVec2(markerX, sliderEnd.y), markerColor, 4)
im.ImDrawList_AddCircleFilled(drawList, im.ImVec2(markerX, sliderStart.y + sliderHeight * 0.5), 8, markerColor)
im.ImDrawList_AddLine(drawList, im.ImVec2(markerX, sliderStart.y), im.ImVec2(markerX, sliderEnd.y), markerColor, 4)
im.ImDrawList_AddCircleFilled(drawList, im.ImVec2(markerX, sliderStart.y + sliderHeight * 0.5), 8, markerColor)
im.Dummy(im.ImVec2(sliderWidth + padding * 2, sliderHeight + 10))
else
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Text("vehicle position, velocity and acceleration.")
im.Dummy(im.ImVec2(5, 0))
im.TextColored(redB, "This sensor does not require attachment/placing.")
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Text("local road heading and curvature, spline data.")
im.Dummy(im.ImVec2(5, 0))
im.TextColored(redB, "This sensor does not require attachment/placing.")
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Text("torque values, electric devices, etc.")
im.Dummy(im.ImVec2(5, 0))
im.TextColored(redB, "This sensor does not require attachment/placing.")
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Text("The mesh geometry is also available.")
im.Dummy(im.ImVec2(5, 0))
im.TextColored(redB, "This sensor does not require attachment/placing.")
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
@/lua/ge/extensions/editor/sceneView.lua
rot = data.rot or core_camera.getQuat(),
lastMouseDragPos = im.ImVec2(0,0),
attachToObject = im.BoolPtr(data.attachToObject or true),
}
editor.registerWindow(newName, im.ImVec2(400,600))
editor.showWindow(newName)
im.PushStyleVar1(im.StyleVar_WindowBorderSize, 0)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
if createNewViewNextFrame then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
if im.BeginPopup('viewcontrol' .. tostring(sceneViewName)) then
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua
local buttonWidth = (maxWidth - style.ItemSpacing.x) / 2
if im.Button(string.format("%s##%s", "set true##api.setProjectDynamicDecalsState(true)", guiId), im.ImVec2(buttonWidth, 0)) then
api.setProjectDynamicDecalsState(true)
im.SameLine()
if im.Button(string.format("%s##%s", "set false##api.setProjectDynamicDecalsState(false)", guiId), im.ImVec2(buttonWidth, 0)) then
api.setProjectDynamicDecalsState(false)
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
if im.TreeNode2(field..'tree',name..' ('..#self.sortedKeys[field]..' Items)') then
if im.Button("Sort", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
self:sortKeys()
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete_forever,im.ImVec2(20, 20)) then
rem = i
im.SameLine()
if editor.uiIconImageButton(editor.icons.add,im.ImVec2(20, 20)) then
self.partConfig[field][ffi.string(self._keyText)] = ffi.string(self._valText)
im.SameLine()
if editor.uiIconImageButton(editor.icons.add,im.ImVec2(20, 20)) then
self.partConfig[field][ffi.string(self._keyText)] = self._valNum[0]
@/lua/ge/extensions/editor/iconOverview.lua
local icons
local size = imgui.ImVec2(32,32)
local style
style = imgui.GetStyle()
editor.registerWindow(toolWindowName, imgui.ImVec2(600, 600))
editor.addWindowMenuItem("Available Icons", onWindowMenuItem, {groupMenuName = 'Debug'})
@/lua/ge/extensions/flowgraph/nodes/util/perlinNoise.lua
if #self.graphData > 0 then
im.PlotMultiLines("", 1, {"val"}, {im.ImColorByRGB(255,255,255,255)}, {self.graphData}, self.data.graphDataCount-1, "", self.scaleMin, self.scaleMax, im.ImVec2(200,60))
end
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
if (cPos.x + scrollY - thumbnailSize) > imagePosY or imagePosY > (cPos.x + scrollY + spaceAvailable.y) then
im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
else
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
else
im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
end
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
else
im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
end
im.TextUnformatted(filePath)
im.Image(editor.getTempTextureObj(filePath).texId, im.ImVec2(64, 64), im.ImVec2Zero, im.ImVec2One)
im.EndDragDropSource()
local cp = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cPos.x, cp.y + thumbnailSize))
end
local spaceAvailable = im.GetContentRegionAvail()
im.BeginChild1("DecalTexturesBrowserChild", im.ImVec2(spaceAvailable.x, spaceAvailable.y - (2 * im.GetStyle().ItemSpacing.y + 1 * math.ceil(im.GetFontSize()))), true)
drawTextureTiles(textures.getTextureFiles(), decalTextureTextFilter)
im.TextUnformatted("Hover over a texture and hit the right mouse button in order to open a context menu.")
im.SetCursorPos(im.ImVec2(cPos.x + textSpace, cPos.y))
editor.uiInputSearchTextFilter("Texture Filter", decalTextureTextFilter, textFilterWidth)
local ratio = img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(maxWidth, maxWidth * ratio), im.ImVec2Zero, im.ImVec2One, nil, editor.color.beamng.Value)
im.SetCursorPos(cpos)
@/lua/ge/extensions/editor/textEditor.lua
if instance.registerNameAsync then
editor.registerWindow(instance.registerNameAsync, imgui.ImVec2(300, 500))
editor.showWindow(instance.registerNameAsync)
if editor.beginWindow(wndName, "Text Editor " .. idsToString(instance.objIds) .. " " .. instance.fieldName .. "##" .. index) then
if editor.uiInputTextMultiline('##text' .. index, instance.textInput, textInputSize, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), imgui.GetWindowSize().y - imgui.CalcTextSize('Cancel Ok').y * 4), imgui.InputTextFlags_AllowTabInput, nil, nil, nil) then
end
@/lua/ge/extensions/editor/mapSensorEditor.lua
-- Module constants (UI).
local toolWinName, toolWinSize = 'MapSensorEditor', im.ImVec2(230, 240) -- The main tool window of the editor. The main UI entry point.
local sensorPropWinName, sensorPropWinSize = 'MapSensorPropertiesWindow', im.ImVec2(290, 880) -- The per-sensor 'sensor properties' window..
local toolWinName, toolWinSize = 'MapSensorEditor', im.ImVec2(230, 240) -- The main tool window of the editor. The main UI entry point.
local sensorPropWinName, sensorPropWinSize = 'MapSensorPropertiesWindow', im.ImVec2(290, 880) -- The per-sensor 'sensor properties' window..
local cameraPreviewWinName, cameraPreviewWinSize = 'MapCameraPreviewWindow', im.ImVec2(290, 600) -- The per-camera 'camera preview' window.
local sensorPropWinName, sensorPropWinSize = 'MapSensorPropertiesWindow', im.ImVec2(290, 880) -- The per-sensor 'sensor properties' window..
local cameraPreviewWinName, cameraPreviewWinSize = 'MapCameraPreviewWindow', im.ImVec2(290, 600) -- The per-camera 'camera preview' window.
local isSensorPropWinOpen = false -- A flag which indicates if the sensor properties window is open or closed.
local gray = im.ImVec4(0.5, 0.5, 0.5, 1)
local sensorIcon = im.ImVec2(32, 32) -- Some commonly-used Imgui icon size vectors.
local beginDragRotation = vec3(0, 0)
local numSensors = #sensors
if im.BeginListBox("", im.ImVec2(222, 180), im.WindowFlags_ChildWindow) then
for i = 1, numSensors do
-- 'Remove Sensor' button.
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), redB, nil, nil, 'removeSensorButton') then
selectedSensorIdx = min(numSensors, selectedSensorIdx)
if isSensorPropWinOpen and i == selectedSensorIdx then btnCol = greenD end
if editor.uiIconImageButton(editor.icons.build, im.ImVec2(21, 21), btnCol, nil, nil, 'editSensorButton') then
if i == selectedSensorIdx or not isSensorPropWinOpen then
if isCameraPreviewWinOpen and i == selectedSensorIdx then btnCol = greenD end
if editor.uiIconImageButton(editor.icons.photo_camera, im.ImVec2(21, 21), btnCol, nil, nil, 'previewSensorButton') then
if i == selectedSensorIdx or not isCameraPreviewWinOpen then
if sensor.isLive then btnCol, btnIcon = blueD, editor.icons.wifi_lock end
if editor.uiIconImageButton(btnIcon, im.ImVec2(19, 19), btnCol, nil, nil, 'toggleLiveSensorButton') then
sensor.isLive = not sensor.isLive
im.Text("You can use this code to recreate the configuration in BeamNGpy:")
im.InputTextMultiline("##pythonCode", pythonCodePtr, pythonCodeLen, im.ImVec2(1200, 400))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(5, 0))
im.Dummy(im.ImVec2(5, 0))
im.Separator()
@/lua/ge/extensions/editor/rallyEditor/pacenotes/customForm.lua
if editor.uiIconImageButton(editor.icons.play_circle_filled, im.ImVec2(20, 20), voicePlayClr) then
im.SetClipboardText(fname)
if editor.uiIconImageButton(editor.icons.folder_open, im.ImVec2(20, 20), im.ImVec4(1, 1, 1, 1)) then
-- local dir = path.dirname(fname)
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(20, 20), im.ImVec4(1, 1, 1, 1)) then
im.SetClipboardText(path.dirname(fnames[1]))
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MaterialsChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
local i = 0
im.Dummy(im.ImVec2(0,4))
im.TextUnformatted("x")
@/lua/ge/extensions/gameplay/race/race.lua
if editor and editor.icons then
editor.uiIconImage(editor.icons.search, im.ImVec2(20, 20))
else
@/lua/ge/extensions/flowgraph/nodes/logic/wait.lua
im.ProgressBar(self.timer / math.max(1e-12, self.pinIn.duration.value), im.ImVec2(50,0))
if im.SmallButton("Reset") then
@/lua/ge/extensions/flowgraph/nodes/debug/miniGraph.lua
local graphSize = im.ImVec2(200, 60)
@/lua/ge/extensions/gameplay/drift/sounds.lua
im.PopStyleColor()
im.Dummy(im.ImVec2(1, 10))
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
im.BeginChild1("measurements", im.ImVec2(0, 200), im.WindowFlags_ChildWindow)
im.BeginChild1("points", im.ImVec2(0, 150), im.WindowFlags_ChildWindow)
@/lua/ge/extensions/editor/audioRibbonEditor.lua
local min, max = math.min, math.max
local toolWinName, toolWinSize = 'audioRibbonEditor', im.ImVec2(500, 500) -- The main tool window of the editor. The main UI entry point.
local globalDown = vec3(0, 0, -1)
local cols = style.getImguiCols('crystal')
local iconsBig, iconsSmall = im.ImVec2(36, 36), im.ImVec2(24, 24)
local cols = style.getImguiCols('crystal')
local iconsBig, iconsSmall = im.ImVec2(36, 36), im.ImVec2(24, 24)
-- Ribbons List Box.
if im.BeginListBox('', im.ImVec2(-1, 180)) then
im.Columns(4, "ribbonListBoxColumns", false)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
for i = 1, #ribbons do
@/lua/ge/extensions/editor/flowgraph/examples.lua
function C:init()
editor.registerWindow(self.windowName, im.ImVec2(150,300), nil, false)
self.searchResultsByMgr = {}
im.SameLine()
editor.uiIconImage(editor.icons.help, im.ImVec2(20,20))
ui_flowgraph_editor.tooltip("Type any string to search for nodes, graphs and pins.\nBegin with 'node:', 'graph:' or 'pin:' to only search for those elements.")
function C:highlightText(label, highlightText)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
if highlightText == "" then
local iconSize = im.ImVec2(20,20)
function C:displayResults()
if self.buttonListIndex == self.selectedButtonListIndex then
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
-- display blue rectangle when node is hovered
im.ImDrawList_AddRect(im.GetWindowDrawList(), im.ImVec2(cursor.x + im.GetWindowPos().x - 2,
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
cursor.y + im.GetWindowPos().y + (im.GetStyle().ItemSpacing.y/2) - 2 - im.GetScrollY()),
im.ImVec2(cursor.x + im.GetWindowPos().x + itemSize.x + (im.GetStyle().ItemSpacing.y/2),
cursor.y + im.GetWindowPos().y + itemSize.y + 2 - im.GetScrollY()),
@/lua/ge/extensions/editor/dynamicDecals/browser.lua
editor.registerWindow(toolDecalTexturesBrowserWindowName, im.ImVec2(800, 400))
tool.registerOnEditorGuiFn("browser", onGui)
@/lua/ge/extensions/editor/roadNetworkExporter.lua
if not enabled then return end
editor.registerWindow(toolWindowName, im.ImVec2(600,600))
editor.addWindowMenuItem('Road Network Exporter', onWindowMenuItem, {groupMenuName = 'Tech'})
@/lua/ge/extensions/career/modules/fuel.lua
if showUI and not shipping_build then
imgui.SetNextWindowSize(imgui.ImVec2(200, 200), imgui.Cond_FirstUseEver)
imgui.Begin("Fueling")
for index, tankData in ipairs(fuelData) do
if imgui.BeginChild1("Tank " .. index, imgui.ImVec2(0, 150), true) then
imgui.Text("Tank " .. index)
@/lua/ge/extensions/editor/visualization.lua
local function drawResetButton(itemPath)
im.Spacing(im.ImVec2(0, 0))
local prefWindowCurrWidth = im.GetContentRegionAvailWidth();
im.Separator()
if im.Button("Yes", im.ImVec2(120,0)) then
im.CloseCurrentPopup()
im.SameLine()
if im.Button("No", im.ImVec2(120,0)) then im.CloseCurrentPopup() end
im.EndPopup()
editor.updateVisSettings = updateVisSettings
editor.registerWindow(toolWindowName, im.ImVec2(500,600))
editor.clearVisualizationTypes()
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/imRaceTimes.lua
local avail = im.GetContentRegionAvail()
--im.BeginChild1("Times", im.ImVec2(avail.x, avail.y/2-5), 0, im.WindowFlags_AlwaysVerticalScrollbar)
if self.race:inDrawTimes(self.pinIn.vehId.value, im, self.data.detailed) then
@/lua/ge/extensions/gameplay/drift/stuntZones.lua
if im.BeginChild1("Stunt zones", im.ImVec2(im.GetWindowContentRegionWidth(), 150)) then
for _, stuntZone in ipairs(stuntZones) do
@/lua/ge/extensions/editor/sitesEditor/tags.lua
function C:drawGeneralInfo()
im.BeginChild1("Tags", im.ImVec2(125 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for i, tag in ipairs(self.sortedTags) do
im.SameLine()
im.BeginChild1("currentElement", im.ImVec2(0, 0 ), im.WindowFlags_ChildWindow)
@/lua/ge/extensions/editor/meshSpline.lua
local abs, min, max = math.abs, math.min, math.max
local toolWinName, toolWinSize = 'meshSpline', im.ImVec2(300, 700)
local defaultParams = splineMgr.getDefaultSliderParams()
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 180)) then
im.Columns(4, "splineListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 41225
im.SetColumnWidth(7, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.SetColumnWidth(6, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
-- Tab content.
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
if im.BeginChild1("TabContentChild", im.ImVec2(0, 0), true) then
if selectedTab == 0 then -- Components tab.
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
@/lua/ge/extensions/editor/scriptAIEditor.lua
name = "scriptAIEditor",
winSize = im.ImVec2(561, 65),
t = im.FloatPtr(0.0),
isExecuting = false,
windowPos = im.ImVec2(1000, 10),
isLooping = im.BoolPtr(false),
name = "scriptAIEditor_VehWin",
winSize = im.ImVec2(482, 250),
isRecording = {},
name = "scriptAIEditor_TrajListWin",
winSize = im.ImVec2(182, 288),
selectedTraj = nil
idx3 = nil,
winSize = im.ImVec2(342, 500)
}
name = "scriptAIEditor_CamWin",
winSize = im.ImVec2(833, 182),
nodes = {},
name = "scriptAIEditor_DrawWin",
winSize = im.ImVec2(226, 365),
drawNodes = {},
if twd.tStart < 0.0 then
if editor.uiIconImageButton(editor.icons.watch_later, im.ImVec2(28, 28), nil, nil, nil, 'normalizeTrajectory') then
for k, tr in pairs(trajectories) do
if twd.isExecuting == false then
if editor.uiIconImageButton(editor.icons.movieCamera, im.ImVec2(30, 30), nil, nil, nil, 'execute') then
twd.t = im.FloatPtr(twd.tStart)
else
if editor.uiIconImageButton(editor.icons.videocam_off, im.ImVec2(30, 30), nil, nil, nil, 'stopExecutution') then
stopExecute()
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
if im.BeginListBox("", im.ImVec2(103, 31), im.WindowFlags_ChildWindow) then
if twd.isExecuting == false then
if twd.isPlaying == false then
if editor.uiIconImageButton(editor.icons.play_arrow, im.ImVec2(28, 28), colors.black, nil, nil, 'play') then
if abs(twd.t[0] - twd.tEnd) < 1e-3 then twd.t = im.FloatPtr(twd.tStart) end
else
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(28, 28), colors.black, nil, nil, 'stop') then
twd.isPlaying = false
im.PushButtonRepeat(true)
im.PushStyleVar2(im.StyleVar_CellPadding, im.ImVec2(0,-10))
if editor.uiIconImageButton(editor.icons.fast_rewind, im.ImVec2(28, 28), colors.black, nil, nil, 'rewind') then
im.PushStyleVar2(im.StyleVar_CellPadding, im.ImVec2(0,-10))
if editor.uiIconImageButton(editor.icons.fast_rewind, im.ImVec2(28, 28), colors.black, nil, nil, 'rewind') then
twd.t = im.FloatPtr(twd.t[0] - twd.rewJump)
im.PushButtonRepeat(true)
if editor.uiIconImageButton(editor.icons.fast_forward, im.ImVec2(28, 28), colors.black, nil, nil, 'fastForward') then
twd.t = im.FloatPtr(twd.t[0] + twd.ffwdJump)
im.SameLine()
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
if editor.uiIconImageButton(editor.icons.car, im.ImVec2(29, 29), im.ImVec4(1, 1, 1, winStates.vehWin.buttonAlpha), nil, nil, 'openVehiclesWindow') then
if editor.isWindowVisible(vehWinData.name) then
im.SameLine()
if editor.uiIconImageButton(editor.icons.cameraFocusTopDown, im.ImVec2(27, 27), im.ImVec4(1, 1, 1, winStates.trajWin.buttonAlpha), nil, nil, 'openTrajectoriesWindow') then
if editor.isWindowVisible(trajWinData.name) then
im.SameLine()
if editor.uiIconImageButton(editor.icons.switch_video, im.ImVec2(29, 29), im.ImVec4(1, 1, 1, winStates.camWin.buttonAlpha), nil, nil, 'openCameraWindow') then
if editor.isWindowVisible(camWinData.name) then
im.SameLine()
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(26, 26), nil, nil, nil, 'loadSession') then
load()
im.SameLine()
if editor.uiIconImageButton(editor.icons.floppyDisk, im.ImVec2(24, 24), nil, nil, nil, 'saveSession') then
save()
im.Separator()
if im.BeginListBox("", im.ImVec2(480, 180), im.WindowFlags_ChildWindow) then
local ctr = 1
im.NextColumn()
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), nil, nil, nil, 'removeVehicle') then
local selectedVehicle = sceneVehicles[i]
im.NextColumn()
if editor.uiIconImageButton(editor.icons.car, im.ImVec2(21, 21), nil, nil, nil, 'goToSelectedVehicle') then
core_camera.setByName(0, "orbit", false)
local btnCol = getTrajButtonCol(idx)
if editor.uiIconImageButton(editor.icons.cameraFocusTopDown, im.ImVec2(19, 19), btnCol, nil, nil, 'editTrajectoryVehicleWindow') then
if idx ~= nil then
if vwd.isRecording[i] == false then
if editor.uiIconImageButton(editor.icons.fiber_manual_record, im.ImVec2(21, 21), colors.rec, nil, nil, 'startRecordingScript') then
core_camera.setByName(0, "orbit", false)
im.SameLine()
im.Dummy(im.ImVec2(5, 0))
im.SameLine()
else
if editor.uiIconImageButton(editor.icons.stop, im.ImVec2(21, 21), nil, nil, nil, 'stopRecordingScript') then
scenetree.findObject(veh.vid):queueLuaCommand('obj:queueGameEngineLua("extensions.hook(\\"onVehicleSubmitRecording\\","..tostring(objectId)..","..serialize(ai.stopRecording())..")")')
im.Separator()
if im.BeginListBox("", im.ImVec2(170, 180), im.WindowFlags_ChildWindow) then
for k, tr in pairs(trajectories) do
im.NextColumn()
if editor.uiIconImageButton(editor.icons.trashBin2, im.ImVec2(22, 22), nil, nil, nil, 'removeTrajectory') then
local oldTrajData = serializeTrajData()
local btnCol = getTrajButtonCol(k)
if editor.uiIconImageButton(editor.icons.cameraFocusTopDown, im.ImVec2(19, 19), btnCol, nil, nil, 'editTrajectoryTrajectoryWindow') then
assignTrajWin(k)
im.Separator()
if editor.uiIconImageButton(editor.icons.mode_edit, im.ImVec2(23, 23), nil, nil, nil, 'drawInTrajectoryManually') then
editor.showWindow(drawWinData.name)
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(23, 23), nil, nil, nil, 'importTrajectory') then
import()
-- The nodes list.
if im.BeginListBox("", im.ImVec2(330, 200), im.WindowFlags_ChildWindow) then
im.Columns(6, "indTrajListCols", false)
if n.isLocked then
if editor.uiIconImageButton(editor.icons.lock, im.ImVec2(17, 17), colors.lock, nil, nil, 'unlockNode') then
if tr.isTimeBased == true then
-- The row of buttons below the nodes list.
im.Dummy(im.ImVec2(gapA, 0))
im.SameLine()
im.PushButtonRepeat(true)
if editor.uiIconImageButton(editor.icons.arrow_upward, im.ImVec2(27, 27), nil, nil, nil, 'increaseVel') then
polyLine[tr.selectedNode].v = im.FloatPtr(min(consts.maxMPS, polyLine[tr.selectedNode].v[0] + consts.incMPS))
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
im.PushButtonRepeat(true)
if editor.uiIconImageButton(editor.icons.arrow_downward, im.ImVec2(27, 27), nil, nil, nil, 'decreaseVel') then
polyLine[tr.selectedNode].v = im.FloatPtr(max(consts.minMPS, polyLine[tr.selectedNode].v[0] - consts.incMPS))
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
end
if editor.uiIconImageButton(editor.icons.nodeLast01, im.ImVec2(27, 27), nil, nil, nil, 'addNode') then
if tr.isTimeBased == true then
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.control_point_duplicate, im.ImVec2(27, 27), nil, nil, nil, 'doubleNodeResolution') then
if tr.isTimeBased == true then
end
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.nodeRemove, im.ImVec2(27, 27), nil, nil, nil, 'deleteNode') then
if tr.isTimeBased == true then
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
if polyLine[pos].isLocked == false then
if editor.uiIconImageButton(editor.icons.lock, im.ImVec2(27, 27), colors.lock, nil, nil, 'lockNode') then
if tr.isTimeBased == true then
else
if editor.uiIconImageButton(editor.icons.lock_open, im.ImVec2(27, 27), colors.lock, nil, nil, 'unlockNode') then
if tr.isTimeBased == true then
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.cameraFocusTopDown, im.ImVec2(24, 24), nil, nil, nil, 'revealTrajectory') then
moveCam2Traj(tr.polyLine)
im.SameLine()
im.Dummy(im.ImVec2(gapB, 0))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.floppyDisk, im.ImVec2(23, 23), nil, nil, nil, 'exportTrajectory') then
export(polyLine, tr)
im.SameLine()
if editor.uiIconImageButton(editor.icons.jointUnlocked, im.ImVec2(26, 26), nil, nil, nil, 'attachTrajectoryToVehicle') then
local oldTraj = ptr2ValTraj(tr)
im.SameLine()
if editor.uiIconImageButton(editor.icons.jointLocked, im.ImVec2(22, 22), nil, nil, nil, 'detachTrajectoryFromVehicle') then
local oldTraj = ptr2ValTraj(tr)
im.SameLine()
if editor.uiIconImageButton(editor.icons.car, im.ImVec2(24, 24), nil, nil, nil, 'goToLinkedVehicle') then
core_camera.setByName(0, "orbit", false)
-- The row for manual trajectory velocity setting dialog.
if editor.uiIconImageButton(editor.icons.network_check, im.ImVec2(26, 26), nil, nil, nil, 'setTrajectoryVelocity') then
local oldTraj = ptr2ValTraj(tr)
else
im.Dummy(im.ImVec2(25, 25))
im.NextColumn()
im.NextColumn()
im.Dummy(im.ImVec2(25, 25))
im.NextColumn()
im.Separator()
if im.BeginListBox("", im.ImVec2(820, 110), im.WindowFlags_ChildWindow) then
im.Columns(6, "camWinColumns", false)
if n.isLocked then
if editor.uiIconImageButton(editor.icons.lock, im.ImVec2(17, 17), colors.lock, nil, nil, 'unlockNode') then
n.isLocked = false
if isDisabled then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.nodeAddFirst01, im.ImVec2(26, 26), nil, nil, nil, 'addCamNode') then
local oldData = serializeCamData()
if isDisabled then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.nodeRemove, im.ImVec2(26, 26), nil, nil, nil, 'removeCamNode') then
local oldData = serializeCamData()
if isDisabled then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.touch_app, im.ImVec2(25, 25), nil, nil, nil, 'camAutoGenerate') then
local tr = trajectories[trajWinData.selectedTraj]
im.NextColumn()
if editor.uiIconImageButton(editor.icons.cameraFocusTopDown, im.ImVec2(24, 24), nil, nil, nil, 'camTrajReveal') then
moveCam2Traj(cwd.nodes)
if nSel.isLocked == false then
if editor.uiIconImageButton(editor.icons.lock, im.ImVec2(27, 27), colors.lock, nil, nil, 'lockNode') then
nSel.isLocked = true
else
if editor.uiIconImageButton(editor.icons.lock_open, im.ImVec2(27, 27), colors.lock, nil, nil, 'unlockNode') then
nSel.isLocked = false
im.Separator()
if im.BeginListBox("", im.ImVec2(215, 250), im.WindowFlags_ChildWindow) then
local numdrawNodes = #dwd.drawNodes
if #dwd.drawNodes > 1 then
if editor.uiIconImageButton(editor.icons.check, im.ImVec2(26, 26), nil, nil, nil, 'finishDrawInTrajectory') then
local tIdx = "drawn_" .. tostring(getNextUniqueId())
@/lua/ge/extensions/flowgraph/basenode.lua
local vec20x20 = im.ImVec2(22,22)
function C:drawHeader(builder, style)
builder:Header(headerColor)
im.Dummy(im.ImVec2(1, 1))
im.SameLine()
im.SameLine()
im.Dummy(im.ImVec2(0, 28))
-- modify style before opening
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(5, 5))
im.PushStyleColor2(im.Col_Separator, im.ImVec4(1.0, 1.0, 1.0, 0.175))
if icon then
editor.uiIconImage(editor.icons[icon], im.ImVec2(22, 22))
im.SameLine()
if self.behaviour[b] then
editor.uiIconImage(editor.icons[ui_flowgraph_editor.getBehaviourIcon(b)], im.ImVec2(22, 22))
im.SameLine()
local pos = self.overDrawSize.top_left()
local size = im.ImVec2(self.overDrawSize.w, self.overDrawSize.h)
local pad = im.ImVec2(size.x/2, size.y/2)
local size = im.ImVec2(self.overDrawSize.w, self.overDrawSize.h)
local pad = im.ImVec2(size.x/2, size.y/2)
if size.x > size.y then size.x = size.y end
size.y = size.y * 0.75
pad = im.ImVec2(pad.x - size.x/2, pad.y - size.y/2)
im.SetCursorPos(im.ImVec2(-off.x + pos.x + pad.x, -off.y + pos.y + pad.y))
local fgClr = self.customIconColor or self.iconColor
local fgClr = self.customIconColor or self.iconColor
im.Dummy(im.ImVec2(math.max(1,builder.expectedHeaderWidth/2-64),0))
im.SameLine()
im.SameLine()
editor.uiIconImage(editor.icons[icon], im.ImVec2(64,64), fgClr)
elseif drawType == 'debug' then
builder:makeAlignmentPin(self.alignmentPin)
--im.Dummy(im.ImVec2(5,5))
end
local xOff = outPinWidth - im.CalcTextSize(txt).x - 3
im.Dummy(im.ImVec2(xOff, 1)) im.SameLine()
im.Text(txt)
builder:SetStage('output')
im.Dummy(im.ImVec2(5,0))
end
if self.behaviour[b] then
im.SetCursorPos(im.ImVec2(-off.x + builder.NodeRect.x + builder.NodeRect.w - 24 * iconCount - 24, -off.y + builder.NodeRect.y))
editor.uiIconImage(editor.icons[ui_flowgraph_editor.getBehaviourIcon(b)], im.ImVec2(22, 22), im.ImVec4(1, 1, 1, 0.25))
im.SetCursorPos(im.ImVec2(-off.x + builder.NodeRect.x + builder.NodeRect.w - 24 * iconCount - 24, -off.y + builder.NodeRect.y))
editor.uiIconImage(editor.icons[ui_flowgraph_editor.getBehaviourIcon(b)], im.ImVec2(22, 22), im.ImVec4(1, 1, 1, 0.25))
iconCount = iconCount + 1
im.SetWindowFontScale(editor.getPreference("ui.general.scale"))
-- im.BeginChild1("ncm##"..self.id, im.ImVec2(150*editor.getPreference("ui.general.scale"), entries * im.GetTextLineHeightWithSpacing() * editor.getPreference("ui.general.scale")))
accept = im.InputText('',self.graphName,128, im.InputTextFlags_EnterReturnsTrue)
if accept or im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
accept = im.InputText('',self._commentInput,128, im.InputTextFlags_EnterReturnsTrue)
accept = accept or im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0,0))
accept = accept or im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0,0))
local clr = nil
im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(c[1],c[2],c[3],0.8))
if im.Button("##"..i.."clr", im.ImVec2(15*editor.getPreference("ui.general.scale"), 15* editor.getPreference("ui.general.scale"))) then
accept = true
if comment.commentTitle == "" then comment.commentTitle = "Comment" end
comment.commentSize = im.ImVec2(rect[3]-rect[1]+1.6*pad, rect[4]-rect[2]+1.5*pad)
if clr then
and self.nodePosition[1] < 2e8 and self.nodePosition[2] < 2e8 then
ui_flowgraph_editor.SetNodePosition(self.id, im.ImVec2(self.nodePosition[1], self.nodePosition[2]))
end
self:updateEditorPosition()
--ui_flowgraph_editor.SetNodePosition(self.id, im.ImVec2(self.nodePosition[1], self.nodePosition[2]))
end
@/lua/ge/extensions/flowgraph/nodes/debug/drawGraph.lua
local graphSize = im.ImVec2(400, 300)
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
local style = im.GetStyle()
im.BeginChild1("DynamicDecals_Notification_NotificationsChild", im.ImVec2(0, im.GetContentRegionAvail().y - (math.ceil(im.GetFontSize()) + 2*style.ItemSpacing.y)), true)
for sectionName, sectionData in pairs(notifications) do
for k, notification in ipairs(sectionData) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d", sectionName, k)) then
table.remove(notifications[sectionName], k)
editor.registerWindow(dynamicDecal_notification_windowName, im.ImVec2(450, 650), nil, nil, nil, true)
end
@/lua/ge/extensions/editor/extensionsEditor.lua
local toolWindowTitle = "Extensions Editor"
local iconSize = imgui.ImVec2(20, 20)
local iconColor = imgui.ImVec4(1,1,1,1)
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(915, 600))
editor.addWindowMenuItem(toolWindowTitle, onToolMenuItem)
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
local cpos = im.GetCursorPos()
local p1 = im.ImVec2(wpos.x + cpos.x, wpos.y + cpos.y - tool.getMainScrollY())
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth(), wpos.y + cpos.y + layerDropHeight - tool.getMainScrollY())
local p1 = im.ImVec2(wpos.x + cpos.x, wpos.y + cpos.y - tool.getMainScrollY())
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth(), wpos.y + cpos.y + layerDropHeight - tool.getMainScrollY())
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.getTempImVec4_TableTable(colorTbl or {1,1,1,1})))
end
im.BeginChild1(string.format("%s_%s_%s_%d", name, layer.uid, guiId, id), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
local function layerElement(k, layer, guiId, parentUid, parentStack, layerLevel)
editor.uiIconImageButton(editor.icons.menu, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s_%s", "layerdrag##", guiId, layer.uid))
im.tooltip("LMB + drag to move layer")
layer.type == api.layerTypes.linkedSet and editor.icons.link or editor.icons.symbol_exclamation,
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
layer.type == api.layerTypes.decal and editor.getTempImVec4_TableTable(layerIconColorData.decal) or
im.SetCursorPosX(im.GetCursorPosX() + (im.GetContentRegionAvailWidth() - (tool.getIconSize() * im.uiscale[0])))
if editor.uiIconImageButton(layer.enabled and editor.icons.visibility or editor.icons.visibility_off, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##enabled_%s_%s", guiId, layer.uid)) then
layer.enabled = not layer.enabled
if selectionData and selectionData[layer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)) and layer.uid or nil)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(layer.uid, im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)))
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("remove##%s_%s", guiId, layer.uid)) then
removeLayer(k, layer.uid, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicate##%s_%s", guiId, layer.uid)) then
api.duplicateLayer(k, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicateAndMirror##%s_%s", guiId, layer.uid)) then
api.duplicateAndMirrorLayer(k, parentUid, true) -- args: id, parentUid, mirrorChildren
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("disable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(nil)
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("enable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(layer.uid)
isHighlighted and editor.icons.simobject_pointlight or editor.icons.lightbulb_outline,
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerButton##%s_%s", guiId, layer.uid)
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingTextureFiles", guiId, layer.uid))
im.tooltip("Missing texture files: " .. dumps(layer.status.missingTextureFiles))
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingFontFile", guiId, layer.uid))
im.tooltip("Missing font file: " .. layer.status.missingFontFile.path)
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s", layer.uid, "removeLayerMask")) then
local layerCopy = deepcopy(layer)
if selectionData and selectionData[maskLayer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(maskLayer.uid)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(maskLayer.uid)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d_%s", layer.uid, k, "removeLayerMaskLayer")) then
local layerCopy = deepcopy(layer)
isHighlighted and editor.icons.simobject_pointlight or editor.icons.lightbulb_outline,
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerMaskButton##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerHighlightButton", k)) then
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, layer.uid, "before"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, "XXXX-XXXX", "after_last"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
-- tool.registerSection("Decal Stack / Layers", sectionGui, 140, true, {size = im.ImVec2(320, 640)}, {
-- {icon = editor.icons.help_outline, tooltip = "Docs", fn = function() docs.selectSection("Layer Stack") end},
@/lua/ge/extensions/editor/dynamicDecals/helper.lua
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
end
editor.uiIconImage(editor.icons.info_outline, im.ImVec2(tool.getIconSize(), tool.getIconSize()))
im.tooltip(msg)
@/lua/ge/extensions/flowgraph/nodes/logic/timedTrigger.lua
builder:Middle()
im.ProgressBar(self.timer / self.data.duration, im.ImVec2(50,0))
im.SameLine()
im.Text("%0.1f", self.data.duration-self.timer)
im.ProgressBar(self.reset / self.data.resetTimer, im.ImVec2(50,0))
im.SameLine()
@/lua/ge/extensions/editor/util/editorElementHelper.lua
local C = {}
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
end
im.BeginChild1("LB",im.ImVec2(im.GetContentRegionAvailWidth()*0.66, 62), true)
im.Columns(3)
local function decoHeaderDraw(e, ctd) im.PushFont3("cairo_regular_medium") im.TextColored(e.color, e.text) im.PopFont() end
local function decoTextDraw(e, ctd) im.Columns(2) im.SetColumnWidth(0,columnWidth) im.Dummy(im.ImVec2(1,1)) im.NextColumn() im.TextWrapped(e.text) if e.tooltip then im.tooltip(e.tooltip) end im.Columns(1) end
local separatorColor = im.GetColorU322(im.ImVec4(1,1,1,0.5))
local separatorColor = im.GetColorU322(im.ImVec4(1,1,1,0.5))
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, ctd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, ctd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, ctd) im.Dummy(im.ImVec2(0,e.height)) end
local function decoSeparatorDraw(e, ctd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, ctd) im.Dummy(im.ImVec2(0,e.height)) end
@/lua/ge/extensions/core/vehicleTriggers.lua
im.SetNextWindowSize(im.ImVec2(500, 500), im.Cond_FirstUseEver)
if im.Begin(toolWindowName, openPtr) then
@/lua/ge/extensions/editor/sceneTree.lua
local inputTextValue = imgui.ArrayChar(500)
local smallIconSize = imgui.ImVec2(20, 20)
local nodeIconColor = imgui.ImColorByRGB(255,255,0,255)
if mousePosY < middlePoint + entrySize/5 and mousePosY > middlePoint - entrySize/5 and imgui.IsWindowHovered(imgui.HoveredFlags_RootAndChildWindows) then
local p1 = imgui.ImVec2(imgui.GetWindowPos().x, itemRect.min.y - imgui.GetStyle().FramePadding.y/2)
local winSize = imgui.GetWindowSize()
local winSize = imgui.GetWindowSize()
local p2 = imgui.ImVec2(imgui.GetWindowPos().x + winSize.x*2, p1.y)
local dl = imgui.GetWindowDrawList()
recacheAllNodes()
editor.registerWindow(wndName, imgui.ImVec2(300, 500))
editor.showWindow(wndName)
if editor.uiIconImageButton(editor.icons.create_new_folder, imgui.ImVec2(24, 24)) then
addNewGroupToSceneTree(instance)
if searchRange > 0 then bgColor = imgui.GetStyleColorVec4(imgui.Col_ButtonActive) end
if editor.uiIconImageButton(editor.icons.wifi_tethering, imgui.ImVec2(searchRangeIconWidth, searchRangeIconWidth), nil, nil, bgColor) then
if searchRange > 0 then
imgui.BeginChild1("Scene Tree Child", imgui.ImVec2(0, searchResultsMode and maxTreeHeight or 0), false)
if searchResultsMode then
local localMouseDragStartPos = imgui.ImVec2(instance.mouseDragStartPos.x, instance.mouseDragStartPos.y - scrollYDiff)
local winPos = imgui.GetWindowPos()
imgui.SameLine()
--imgui.Dummy(imgui.ImVec2(5, imgui.GetStyle().ItemSpacing.y))
local label = tostring(#searchResults) .. ' matches'
instance.windowName = sceneTreeWindowNamePrefix .. key
editor.registerWindow(instance.windowName, imgui.ImVec2(300, 500))
end
@/lua/ge/extensions/editor/api/core.lua
imgui.Text("Tool windows with unsaved data:")
imgui.BeginChild1("Windows", imgui.ImVec2(-1, imgui.GetContentRegionAvail().y - 30), imgui.WindowFlags_ChildWindow)
for name, _ in pairs(editor.dirtyTools) do
@/lua/ge/extensions/flowgraph/nodes/util/customLua.lua
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(20, 20), customNodes[self.name] and im.ImVec4(1,0.6,0.6,1)) then
local data = self:__onSerialize()
if self.status[code] then
editor.uiIconImage(editor.icons.error, im.ImVec2(20, 20), im.ImVec4(1,0,0,1))
ui_flowgraph_editor.tooltip(self.status[code])
else
editor.uiIconImage(editor.icons.check, im.ImVec2(20, 20), im.ImVec4(0,1,0,1))
ui_flowgraph_editor.tooltip("All good!")
local buff = im.ArrayChar(bufLen, self.code[code] or "")
if editor.uiInputTextMultiline("##"..code..self.id.."/"..self.mgr.id, buff, bufLen, im.ImVec2(im.GetContentRegionAvailWidth(),150), im.InputTextFlags_Multiline, nil, nil, editEnded) then
self.code[code] = ffi.string(buff)
@/lua/ge/extensions/editor/raceEditor/startPositions.lua
--dumpz(self.path,2)
im.BeginChild1("sp", im.ImVec2(220 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for i, sp in ipairs(self.path.startPositions.sorted) do
im.SameLine()
im.BeginChild1("currentSP", im.ImVec2(0, 0 ), im.WindowFlags_ChildWindow)
if self.index then
im.BeginChild1("self.indexInner", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local editEnded = im.BoolPtr(false)
@/lua/ge/extensions/flowgraph/manager.lua
local uiscale = im.uiscale[0]
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
im.BeginGroup()--"",im.ImVec2(24* uiscale,24))
im.SetCursorPosY(im.GetCursorPosY() + 3 * uiscale)
im.SetCursorPosX(im.GetCursorPosX() + 3 * uiscale)
editor.uiIconImage(editor.icons[iconType .. "_" .. (connected and 1 or 2)], im.ImVec2(typeIconSize * uiscale, typeIconSize * uiscale), color)
im.SetCursorPosY(im.GetCursorPosY() + 3 * uiscale)
im.PopStyleVar(2)
--ui_flowgraph_editor.Icon(ui_imgui.ctx, im.ImVec2(typeIconSize * uiscale, typeIconSize * uiscale), iconType, connected, color, innercolor)
end
local mousePos = ui_flowgraph_editor.ScreenToCanvas(im.GetMousePos())
local center = im.ImVec2(0, 0)
for _, nodeData in pairs(self.copyData.nodes) do
ids[id] = node
ui_flowgraph_editor.SetNodePosition(node.id, im.ImVec2(mousePos.x + (nodeData.pos[1] - center.x), mousePos.y + (nodeData.pos[2] - center.y)))
node:alignToGrid(mousePos.x + (nodeData.pos[1] - center.x), mousePos.y + (nodeData.pos[2] - center.y))
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
function C:highlightText(label, highlightText)
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0, 0))
local pos1 = 1
self:drawSearchInput()
im.BeginChild1("all", im.ImVec2(im.GetContentRegionAvailWidth(), 400 * editor.getPreference("ui.general.scale")))
if self.search.matchString ~= "" then
for _, result in ipairs(self.results) do
im.BeginChild1(result.id, im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
im.Checkbox("##cba" .. result.id, im.BoolPtr(listKeys[result.id] or false))
for i, name in ipairs(allCategories[cat]) do
im.BeginChild1(name, im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
local clk = im.Checkbox("##cba" .. name .. "-" .. cat .. "-" .. self.id, im.BoolPtr(listKeys[name] or false))
@/lua/ge/extensions/editor/trafficDebug.lua
end
if im.Button(str, im.ImVec2(100, im.GetFrameHeight())) then
if trafficAmountChange[0] > 0 then
end
if im.Button(str, im.ImVec2(100, im.GetFrameHeight())) then
if parkingAmountChange[0] > 0 then
im.Dummy(im.ImVec2(0, 5))
im.TextUnformatted("Traffic Variables")
im.Dummy(im.ImVec2(0, 5))
im.TextUnformatted("Parking Variables")
local function drawVehiclesTab()
im.BeginChild1("Vehicles##trafficDebug", im.ImVec2(180 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for id, veh in pairs(traffic) do
im.BeginChild1("Current Vehicle##trafficDebug", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
local currVeh = traffic[currId]
im.BulletText("System: "..system)
im.Dummy(im.ImVec2(0, 5))
im.BulletText("Action: "..currVeh.role.actionName)
im.Dummy(im.ImVec2(0, 5))
im.BeginChild1("Action Logs##trafficDebug", im.ImVec2(im.GetWindowContentRegionWidth(), 200), true, im.WindowFlags_None)
if logs[currVeh.id] then
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(400, 600))
editor.addWindowMenuItem(toolWindowName, onWindowMenuItem, {groupMenuName = "Debug"})
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdown.lua
if tWidth.x < avail.x then
im.Dummy(im.ImVec2((avail.x-tWidth.x)/2 -10,0))
im.SameLine()
builder:Middle()
im.ProgressBar((self.duration - self.timer) / self.duration, im.ImVec2(100,0))
if not self.running then
@/lua/ge/extensions/flowgraph/nodes/ui/contextTranslation.lua
if self.variablesState == 1 then
editor.uiIconImage(editor.icons.translate, im.ImVec2(24, 24), im.ImVec4(1, 0, 0, 1))
im.tooltip("No context found for this translationString!")
elseif self.variablesState == 2 then
editor.uiIconImage(editor.icons.translate, im.ImVec2(24, 24), im.ImVec4(0, 1, 0, 1))
im.tooltip("Variables loaded successfully")
else
editor.uiIconImage(editor.icons.translate, im.ImVec2(24, 24), im.ImVec4(1, 1, 1, 1))
im.tooltip("Put in translationString to load variables")
im.SameLine()
if im.Button("Load Variables", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
@/lua/ge/extensions/career/career.lua
local debugSettings = settings.getValue('careerDebugSettings')
imgui.SetNextWindowSize(imgui.ImVec2(300, 300), imgui.Cond_FirstUseEver)
imgui.Begin("Career Debug (Save File: " .. career_saveSystem.getCurrentSaveSlot() .. ")###Career Debug", nil, imgui.WindowFlags_MenuBar)
@/lua/ge/extensions/flowgraph/nodes/logic/rateLimit.lua
if self.pinIn.input.value then
im.ProgressBar((self.pinIn.input.value - self.time) / self.pinIn.input.value, im.ImVec2(50, 0))
end
@/lua/ge/extensions/editor/navMeshEditor.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(400, 400))
editor.editModes.navMeshEditMode =
@/lua/ge/extensions/editor/decalSpline.lua
local min, max = math.min, math.max
local toolWinName, toolWinSize = 'decalSpline', im.ImVec2(300, 700)
local defaultParams = splineMgr.getDefaultSliderParams()
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('', im.ImVec2(-1, 180)) then
im.Columns(4, "splineListBoxColumns", true)
im.SetColumnWidth(3, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 41225
im.SetColumnWidth(5, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
local childName = "ComponentChild"..tostring(compIdx)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
im.BeginChild1(childName, im.ImVec2(0, 350), true)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(4, 8))
im.BeginChild1(childName, im.ImVec2(0, 350), true)
if compIdx == 1 then
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Dummy(im.ImVec2(0, 3))
im.Separator()
end
im.Dummy(im.ImVec2(0, 3))
im.Separator()
@/lua/ge/extensions/editor/cameraTransform.lua
editor.addWindowMenuItem("Camera Transform", onWindowMenuItem)
editor.registerWindow(toolWindowName, im.ImVec2(600, 200))
end
@/lua/ge/extensions/editor/api/gui.lua
local modalWindowVisibleStack = {} -- used for beginModalWindow/endModalWindow
local defaultIconButtonSize = imgui.ImVec2(32, 32)
local WindowsStateFileFormatVersion = 1
local function setDefaultIconButtonSize(size)
defaultIconButtonSize = imgui.ImVec2(size, size)
end
local tempVec2A, tempVec2B, tempVec2C = imgui.ImVec2(0,0), imgui.ImVec2(0,0), imgui.ImVec2(0,0)
local tempVec2A, tempVec2B, tempVec2C = imgui.ImVec2(0,0), imgui.ImVec2(0,0), imgui.ImVec2(0,0)
local tempVec2A, tempVec2B, tempVec2C = imgui.ImVec2(0,0), imgui.ImVec2(0,0), imgui.ImVec2(0,0)
imgui.BeginGroup()
imgui.PushStyleVar2(imgui.StyleVar_ItemSpacing, imgui.ImVec2(0, 0))
local pos1 = 1
local topLeft = imgui.GetCursorScreenPos()
local bottomRight = imgui.ImVec2(topLeft.x + textSize.x, topLeft.y + textSize.y)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), topLeft, bottomRight, textBG, 0, nil)
else
size = imgui.ImVec2(size.x * imgui.uiscale[0], size.y * imgui.uiscale[0])
if id then imgui.PushID1(id) end
if not backgroundCol then backgroundCol = imgui.GetStyleColorVec4(imgui.Col_Button) end
imgui.ImageButton("##ImageButton", iconsTex.texId, size, imgui.ImVec2(ux, uy), imgui.ImVec2(vx, vy), backgroundCol, col)
imgui.PopStyleColor()
if not backgroundCol then backgroundCol = imgui.GetStyleColorVec4(imgui.Col_Button) end
imgui.ImageButton("##ImageButton", iconsTex.texId, size, imgui.ImVec2(ux, uy), imgui.ImVec2(vx, vy), backgroundCol, col)
imgui.PopStyleColor()
imgui.GetWindowDrawList(),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y)),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()) + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()))),
imgui.GetWindowDrawList(),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y)),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()) + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()))),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y)),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()) + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()))),
imgui.GetColorU321(imgui.Col_Separator),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y)),
(vec2_offset and imgui.ImVec2(winPos.x + cursor.x + vec2_offset.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()) + vec2_offset.y) or imgui.ImVec2(winPos.x + cursor.x, winPos.y + cursor.y + imgui.uiscale[0] * (float_height or imgui.GetFontSize()))),
imgui.GetColorU321(imgui.Col_Separator),
imgui.PushStyleVar1(imgui.StyleVar_WindowBorderSize, 0)
imgui.PushStyleVar2(imgui.StyleVar_WindowPadding, imgui.ImVec2(0, 0))
local window_flags = bit.bor(imgui.WindowFlags_MenuBar, imgui.WindowFlags_NoDocking, imgui.WindowFlags_NoTitleBar, imgui.WindowFlags_NoCollapse, imgui.WindowFlags_NoResize, imgui.WindowFlags_NoMove, imgui.WindowFlags_NoBringToFrontOnFocus, imgui.WindowFlags_NoNavFocus, imgui.WindowFlags_NoBackground, imgui.WindowFlags_NoFocusOnAppearing)
-- init the dockspace
imgui.DockSpace(imgui.GetID1("MainDockspace1"), imgui.ImVec2(0, 0), imgui.DockNodeFlags_PassthruCentralNode)
imgui.End()
local imgsize = (imgui.CalcTextSize("yes").y + style.FramePadding.y * 2)
imgui.BeginChild1("##InputSearch", imgui.ImVec2(width, imgsize + 2), false)
local frame = imgui.GetStyleColorVec4(imgui.Col_FrameBg)
imgui.PushStyleColor2(imgui.Col_Button, bgcol)
imgui.PushStyleVar2(imgui.StyleVar_ItemSpacing,imgui.ImVec2(0, 0))
local res = editor.uiIconImageButton(editor.icons.search, {x=imgsize/ uiScale, y=imgsize/ uiScale})
if auto_resize then
ImVec2_graph_size = imgui.ImVec2(imgui.GetWindowSize().x - 2*imgui.GetStyle().WindowPadding.x - imgui.CalcTextSize(string_label).x, imgui.GetWindowSize().y - 5*imgui.GetStyle().WindowPadding.y)
else
else
ImVec2_graph_size = imgui.ImVec2(0,0)
end
if wnd.centered then
local pos = imgui.ImVec2(imgui.GetMainViewport().Pos.x + imgui.GetMainViewport().Size.x / 2, imgui.GetMainViewport().Pos.y + imgui.GetMainViewport().Size.y / 2)
imgui.SetNextWindowPos(pos, imgui.Cond_Appearing, imgui.ImVec2(0.5, 0.5))
local pos = imgui.ImVec2(imgui.GetMainViewport().Pos.x + imgui.GetMainViewport().Size.x / 2, imgui.GetMainViewport().Pos.y + imgui.GetMainViewport().Size.y / 2)
imgui.SetNextWindowPos(pos, imgui.Cond_Appearing, imgui.ImVec2(0.5, 0.5))
else
if val.defaultWindowSize and val.defaultWindowSize.x and val.defaultWindowSize.y then
val.defaultSize = imgui.ImVec2(val.defaultWindowSize.x, val.defaultWindowSize.y)
end
if val.defaultWindowPos and val.defaultWindowPos.x and val.defaultWindowPos.y then
val.defaultPos = imgui.ImVec2(val.defaultWindowPos.x, val.defaultWindowPos.y)
end
local stepButtonSizeHeight = fontSize + style.FramePadding.y * 2
local stepButtonSize = imgui.ImVec2(stepButtonSizeHeight, stepButtonSizeHeight)
local winPos = imgui.GetWindowPos()
local clipRectMin = imgui.ImVec2(winPos.x, winPos.y)
local clipRectMax = imgui.ImVec2(winPos.x + imgui.GetWindowWidth(), winPos.y + imgui.GetWindowHeight())
local clipRectMin = imgui.ImVec2(winPos.x, winPos.y)
local clipRectMax = imgui.ImVec2(winPos.x + imgui.GetWindowWidth(), winPos.y + imgui.GetWindowHeight())
if imgui.GetScrollMaxY() > 0 then -- Doesn't highlight the area under the scrollbar
local mColor = imgui.ColorConvertFloat4ToU32(not isOdd and mEvenColor or mOddColor)
imgui.ImDrawList_AddRectFilled(mDrawList, imgui.ImVec2(xMin, y - mStyle.ItemSpacing.y), imgui.ImVec2(xMax, y + mHeight), mColor)
local mColor = imgui.ColorConvertFloat4ToU32(not isOdd and mEvenColor or mOddColor)
imgui.ImDrawList_AddRectFilled(mDrawList, imgui.ImVec2(xMin, y - mStyle.ItemSpacing.y), imgui.ImVec2(xMax, y + mHeight), mColor)
editor.miniIconButtonSize = imgui.ImVec2(24, 24)
@/lua/ge/extensions/editor/cameraBookmarks.lua
imgui.BeginChild1("cameraBookmarksChild", imgui.ImVec2(0, 0), true)
local bookmarks = editor.getCameraBookmarks()
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(500,500))
editor.addWindowMenuItem("Camera Bookmarks", onWindowMenuItem)
@/lua/ge/extensions/render/openxr.lua
local debugWindowOpen = im.BoolPtr(false)
local debugWindowSize = im.ImVec2(0, 0)
@/lua/ge/extensions/core/vehicle/mirror.lua
local windowOpen = im.BoolPtr(false)
local initialWindowSize = im.ImVec2(300, 100)
local imguiSliderData = {}
@/lua/ge/extensions/editor/raceEditor/testing.lua
local avail = im.GetContentRegionAvail()
im.BeginChild1("Times", im.ImVec2(avail.x, avail.y/2-5), 0, im.WindowFlags_AlwaysVerticalScrollbar)
local avail = im.GetContentRegionAvail()
im.BeginChild1("EventLog", im.ImVec2(avail.x, avail.y-5), 0, im.WindowFlags_AlwaysVerticalScrollbar)
self.race:inDrawEventlog(self.race.vehIds[1], im)
@/lua/ge/extensions/editor/missionEditor/objectives.lua
local missionTypesDir = "/gameplay/missionTypes"
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec24x24 = im.ImVec2(24,24)
local imVec16x16 = im.ImVec2(16,16)
local imVec4Red = im.ImVec4(1,0,0,1)
if (editor.uiIconImageButton(editor.icons.add, im.ImVec2(22, 22)) or att or editEnded[0]) then
local addKey = att or ffi.string(getBuffer("addReward--"..key, ""))
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(22, 22)) then
self.copiedRewards = deepcopy(rewards or {})
end
if editor.uiIconImageButton(editor.icons.content_paste, im.ImVec2(22, 22)) then
rewards = deepcopy(self.copiedRewards)
if not hasDefault then
editor.uiIconImage(editor.icons.font_download, im.ImVec2(22, 22), grayColor)
im.tooltip("No Default Text found.")
else
editor.uiIconImage(editor.icons.font_download, im.ImVec2(22, 22), usingDefault and greenColor or yellowColor)
if usingDefault then
end
im.Dummy(im.ImVec2(2,2))
im.NextColumn()
end
im.Dummy(im.ImVec2(2,2))
im.NextColumn()
end
im.Dummy(im.ImVec2(2,2))
im.NextColumn()
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(22, 22)) then
self.copiedStars[self.mission.missionType] = deepcopy(self.mission.careerSetup or {})
end
if editor.uiIconImageButton(editor.icons.content_paste, im.ImVec2(22, 22)) then
self.mission.careerSetup = deepcopy(self.copiedStars[self.mission.missionType])
if self._editing then
im.InputTextMultiline("##facEditor", self._text[1], im.GetLengthArrayCharPtr(self._text[1]), im.ImVec2(-1,-1))
-- display char limit
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua
if im.BeginChild1("##partList", im.ImVec2(0, maxTreeHeight), false) then
im.GetContentRegionAvail()
local function onEditorInitialized()
editor.registerWindow(wndName, im.ImVec2(500,400))
end
@/lua/ge/extensions/editor/util/transformUtil.lua
if not self:correctEditMode() then
if editor.uiIconImageButton(editor.icons.mode_edit, im.ImVec2(height, height)) then
self:enableEditing()
if editor.uiIconImageButton(editor.icons.check, im.ImVec2(height, height), activeColor) then
editor.selectEditMode(nil)
im.SetCursorPosY(math.ceil(prePos.y + buttonHeight * row * scale + spacing * row * scale))
if editor.uiIconImageButton(editor.icons[btn.icon] or editor.icons.settings, im.ImVec2(buttonHeight, buttonHeight), smallButtonColor) then
self[btn.fun](self)
if self.allowTranslate then
im.SetCursorPos(im.ImVec2(prePos.x, math.ceil(prePos.y + elemHeight * row + spacing * row)))
row = row + 1
if self.allowRotate then
im.SetCursorPos(im.ImVec2(prePos.x, math.ceil(prePos.y + elemHeight * row + spacing * row)))
row = row + 1
if self.allowScale then
im.SetCursorPos(im.ImVec2(prePos.x, math.ceil(prePos.y + elemHeight * row + spacing * row)))
row = row + 1
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
local iconSize = 20
local iconSizeVec2 = im.ImVec2(0, 0)
local mainScrollY = 0
local headerWidth = im.GetContentRegionAvailWidth() - (section.buttons and #section.buttons or 0) * (buttonHeight + imguiStyle.ItemSpacing.x)
if im.Button(string.format("##%s", colHeaderTitle), im.ImVec2(headerWidth, buttonHeight)) then
section.open = not section.open
for k, button in ipairs(section.buttons) do
im.SetCursorPos(im.ImVec2(beforeCPos.x + headerWidth + k * (imguiStyle.ItemSpacing.x) + (k - 1) * buttonHeight, beforeCPos.y))
if editor.uiIconImageButton(button.icon, im.ImVec2(buttonHeight, buttonHeight), nil, nil, nodeColor or im.ImVec4(1,102/255, 0, 0.2), string.format("SectionButton_%s_%d", section.name, k)) then
im.SetCursorPos(im.ImVec2(beforeCPos.x + headerWidth + k * (imguiStyle.ItemSpacing.x) + (k - 1) * buttonHeight, beforeCPos.y))
if editor.uiIconImageButton(button.icon, im.ImVec2(buttonHeight, buttonHeight), nil, nil, nodeColor or im.ImVec4(1,102/255, 0, 0.2), string.format("SectionButton_%s_%d", section.name, k)) then
button.fn()
im.SetCursorPos(im.ImVec2(beforeCPos.x + imguiStyle.FramePadding.x, beforeCPos.y + imguiStyle.FramePadding.y))
-- button icon
local iconSize = math.ceil(im.GetFontSize())
editor.uiIconImage(section.open and editor.icons.keyboard_arrow_down or editor.icons.keyboard_arrow_right, im.ImVec2(iconSize, iconSize), im.GetStyleColorVec4(im.Col_Text))
-- button text
-- button text
im.SetCursorPos(im.ImVec2(beforeCPos.x + 2 * imguiStyle.FramePadding.x + iconSize, beforeCPos.y + imguiStyle.FramePadding.y))
im.TextUnformatted(colHeaderTitle)
local style = im.GetStyle()
if im.Button("Cancel", im.ImVec2((space - style.ItemSpacing.x) / 2, 0)) then
editor.hideWindow(openToolWindowPopupName)
im.SameLine()
if im.Button("Ok", im.ImVec2((space - style.ItemSpacing.x) / 2, 0)) then
editor.hideWindow(openToolWindowPopupName)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
if selectionData then
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
editor.uiVertSeparator(vertSeparatorHeight, im.ImVec2(0,0), 2)
im.SameLine()
im.Dummy(im.ImVec2(im.GetStyle().ItemSpacing.x, 0))
for _, child in ipairs(docsSection.children) do
if im.Button(child.name, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
deps.docs.selectSection(child.name)
editor.addWindowMenuItem("Vehicle Livery Creator", onWindowMenuItem, {groupMenuName = "Vehicles"})
editor.registerWindow(toolWindowName, im.ImVec2(400, 400))
-- registerWindow(windowName, defaultSize, defaultPos, defaultVisibleBoolean, modal, centered
-- registerWindow(windowName, defaultSize, defaultPos, defaultVisibleBoolean, modal, centered
editor.registerWindow(openToolWindowPopupName, im.ImVec2(240, 120), nil, nil, false, true)
section.windowName = string.format("%s##window", section.name)
local windowSize = im.ImVec2(400, 400)
if section.window and section.window.size then
advancedSection.windowName = string.format("%s##window", advancedSection.name)
local windowSize = im.ImVec2(400, 400)
if advancedSection.window and advancedSection.window.size then
@/lua/ge/extensions/ui/messagesDebugger.lua
im.SetNextWindowSize(im.ImVec2(520, 320), im.Cond_FirstUseEver)
if im.Begin("Messages Debugger", windowOpen) then
im.TextUnformatted("Message Text")
im.InputTextMultiline("##msg", txtMsg, im.ArraySize(txtMsg), im.ImVec2(-1, 100))
@/lua/ge/extensions/editor/assetManagementTool.lua
if editor.uiIconImageButton(editor.icons.close, imgui.ImVec2(24, 24)) then
delAssetHash = hash
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(1200, 900))
editor.registerModalWindow(removeSelectedDlg, imgui.ImVec2(400, 100))
editor.registerWindow(toolWindowName, imgui.ImVec2(1200, 900))
editor.registerModalWindow(removeSelectedDlg, imgui.ImVec2(400, 100))
editor.registerModalWindow(migrationDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(removeSelectedDlg, imgui.ImVec2(400, 100))
editor.registerModalWindow(migrationDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(migrationDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchAllDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchAllDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(savedListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(searchAllDuplicatesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(savedListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(savedListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidFilenamesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidFilenamesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(deleteInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(checkForInvalidFilenamesDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(deleteInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(tryFixingInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(deleteInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(tryFixingInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(clearDuplicateListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(tryFixingInvalidLinksDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(clearDuplicateListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(delinkerDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(clearDuplicateListDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(delinkerDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(relinkerDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(delinkerDlg, imgui.ImVec2(600, 200))
editor.registerModalWindow(relinkerDlg, imgui.ImVec2(600, 200))
editor.addWindowMenuItem("Asset Management Tool", onWindowMenuItem, {groupMenuName = 'Assets'})
@/lua/ge/extensions/editor/materialEditor.lua
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth() - (num*iconW * im.uiscale[0] + num*spacing + 10),1))
im.SameLine()
local clicked = editor.uiIconImageButton(icon, im.ImVec2(iconW, iconW), tint)
if clicked then
local y2 = y1 + ts.y + ((smol == 1) and 4 or 1)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), im.ImVec2(x1, y1), im.ImVec2(x2, y2), im.GetColorU322(color), 0, nil)
end
local y2 = y1 + ts.y + ((smol == 1) and 4 or 1)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), im.ImVec2(x1, y1), im.ImVec2(x2, y2), im.GetColorU322(color), 0, nil)
end
local avail = im.GetContentRegionAvail()
im.BeginChild1("##mu_child", im.ImVec2(avail.x, avail.y - 4*im.GetFontSize()), false, im.WindowFlags_ChildWindow + im.WindowFlags_HorizontalScrollbar)
im.Dummy(im.ImVec2(0, im.GetStyle().ItemSpacing.y))
im.Separator()
im.Separator()
im.Dummy(im.ImVec2(0, im.GetStyle().ItemSpacing.y))
editor.icons.material_texturemap_remove,
im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)
) then
editor.icons.folder,
im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)
) then
editor.icons.open_in_new,
im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)
) then
local texture = editor.getTempTextureObj(absPath)
local size = im.ImVec2(options.thumbnailSize, options.thumbnailSize)
if texture and texture.size.x ~= 0 and texture.size.y ~= 0 then
editor.icons.folder,
im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)
) then
editor.getTempTextureObj(selectedCubemapObj:getField("cubeFace", index)).texId,
im.ImVec2(cubemapFaceThumbnailSize, cubemapFaceThumbnailSize),
im.ImVec2Zero,
-- local childSize = im.ImVec2(0, )
cubemapFaceThumbnailSize = (im.GetContentRegionAvailWidth() - (3 * v.style.ItemSpacing.x) - 8) / 4 -- -8 = remove 4 times the ImageButton border size (2px)
editor.icons.material_pick_mapto,
im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight),
pickMaterialFromObject and editor.color.white.Value or editor.color.grey.Value
im.NextColumn()
im.ColorButton("Annotation color", bgColor, 0, im.ImVec2(25, 19))
im.SameLine()
end
im.ColorButton("annotationColorButton", bgColor, 0, im.ImVec2(25, 19))
im.SameLine()
local cPosB = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cPosA.x + im.GetStyle().ItemSpacing.y, cPosA.y + im.GetStyle().ItemSpacing.y))
if editor.uiColorEdit3(
local cPosB = im.GetCursorPos()
im.SetCursorPos(im.ImVec2(cPosA.x + im.GetStyle().ItemSpacing.y, cPosA.y + im.GetStyle().ItemSpacing.y))
if editor.uiColorEdit3(
im.Dummy(im.ImVec2(0,4))
materialInfo()
materialInfo()
im.Dummy(im.ImVec2(0,4))
end
im.Dummy(im.ImVec2(0, v.style.FramePadding.y))
im.EndPopup()
local cpos = im.GetCursorPos()
local p1 = im.ImVec2(wpos.x + cpos.x - v.style.WindowPadding.x, wpos.y + cpos.y - v.style.WindowPadding.y)
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth() + 2 * v.style.WindowPadding.x, wpos.y + cpos.y + v.inputWidgetHeight * 1.5)
local p1 = im.ImVec2(wpos.x + cpos.x - v.style.WindowPadding.x, wpos.y + cpos.y - v.style.WindowPadding.y)
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth() + 2 * v.style.WindowPadding.x, wpos.y + cpos.y + v.inputWidgetHeight * 1.5)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p1, p2, im.GetColorU321(im.Col_MenuBarBg))
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p1, p2, im.GetColorU321(im.Col_MenuBarBg))
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 2))
im.PushStyleColor2(im.Col_Button, im.ImVec4(1,0.5647,0,1))
im.PushStyleColor2(im.Col_Button, im.ImVec4(1,0.5647,0,1))
if editor.uiIconImageButton(editor.icons.material_new, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5)) then
ffi.copy(newMatPath, lastCreateMaterialPath .. "main.materials.json")
im.SameLine(nil, v.style.ItemSpacing.x)
if editor.uiIconImageButton(editor.icons.material_tag, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5)) then
editor.showWindow(materialsByTagsWindowName)
im.SameLine(nil, v.style.ItemSpacing.x)
if editor.uiIconImageButton(editor.icons.refresh, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5)) then
if currentMaterial then
if not residesInJson then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5)) then
im.OpenPopup("DeleteCurrentMaterial")
im.Spacing()
editor.uiVertSeparator(32, im.ImVec2(0,0))
im.Spacing()
end
if editor.uiIconImageButton(editor.icons.material_pick_mapto, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5), nil, nil, bgColor) then
pickingFromObjectMode = pickingFromObjectMode_enum.from_object_selection
if editor.uiIconImageButton(editor.icons.public, im.ImVec2(v.inputWidgetHeight * 1.5, v.inputWidgetHeight * 1.5)) then
editor.clearObjectSelection()
im.Dummy(im.ImVec2(0, v.style.ItemSpacing.y))
end
end
if pickMapToFromObjectPopupHeight then im.SetNextWindowSize(im.ImVec2(0, pickMapToFromObjectPopupHeight)) end
if im.BeginPopup("PickMapToFromObjectPopup") then
im.SameLine()
local size = im.ImVec2(v.inputWidgetHeight, 2* v.inputWidgetHeight + v.style.ItemSpacing.y)
local pos = im.GetCursorPos()
end
im.SetCursorPos(im.ImVec2(pos.x,pos.y + size.y/4))
editor.uiIconImage((newMatMapToLocked == true and editor.icons.lock_outline or editor.icons.lock_open), im.ImVec2(size.x, size.x))
im.SetCursorPos(im.ImVec2(pos.x,pos.y + size.y/4))
editor.uiIconImage((newMatMapToLocked == true and editor.icons.lock_outline or editor.icons.lock_open), im.ImVec2(size.x, size.x))
-- icon, size, col, borderCol, label
if createMaterialMessage and createMaterialMessage ~= "" and createMaterialError then
im.SetCursorPos(im.ImVec2(im.GetCursorPosX(), im.GetContentRegionAvail().y + im.GetCursorPosY() - im.GetTextLineHeight()))
im.TextColored(im.ImVec4(1, 1, 0, 1), createMaterialMessage)
im.SameLine()
if editor.uiIconImageButton(editor.icons.refresh, im.ImVec2(24, 24)) then
getPreviewMeshes()
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight), editor.color.warning.Value)
im.tooltip("The selected object either has no materials assigned to it or all the materials were auto-generated and can't be changed using the material editor.")
im.SameLine()
if editor.uiIconImageButton(editor.icons.material_save_current, im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)) then
saveCurrentMaterial()
im.SameLine()
if editor.uiIconImageButton(editor.icons.material_save_all, im.ImVec2(v.inputWidgetHeight, v.inputWidgetHeight)) then
saveAllDirtyMaterials()
editor.addWindowMenuItem("Material Editor", onWindowMenuItem, nil, true)
editor.registerWindow(toolWindowName, im.ImVec2(310, 580))
editor.registerWindow(createCubemapWindowName, im.ImVec2(750, 380))
editor.registerWindow(toolWindowName, im.ImVec2(310, 580))
editor.registerWindow(createCubemapWindowName, im.ImVec2(750, 380))
editor.registerWindow(createMaterialWindowName, im.ImVec2(450, 150))
editor.registerWindow(createCubemapWindowName, im.ImVec2(750, 380))
editor.registerWindow(createMaterialWindowName, im.ImVec2(450, 150))
editor.registerWindow(materialPreviewWindowName, im.ImVec2(300, 300))
editor.registerWindow(createMaterialWindowName, im.ImVec2(450, 150))
editor.registerWindow(materialPreviewWindowName, im.ImVec2(300, 300))
editor.registerWindow(materialsByTagsWindowName, im.ImVec2(260, 320))
editor.registerWindow(materialPreviewWindowName, im.ImVec2(300, 300))
editor.registerWindow(materialsByTagsWindowName, im.ImVec2(260, 320))
editor.registerWindow(materialUsageWindowName, im.ImVec2(420, 340))
editor.registerWindow(materialsByTagsWindowName, im.ImVec2(260, 320))
editor.registerWindow(materialUsageWindowName, im.ImVec2(420, 340))
editor.hideWindow(materialUsageWindowName)
@/lua/ge/extensions/flowgraph/groupHelper.lua
if inputNode then
ui_flowgraph_editor.SetNodePosition(inputNode.id, im.ImVec2(graphRect[1] - 250, centerPosY - #inputLinks*15 -15))
inputNode:alignToGrid()
if outputNode then
ui_flowgraph_editor.SetNodePosition(outputNode.id, im.ImVec2(graphRect[3] + 150, centerPosY - #outputLinks*15 -15))
outputNode:alignToGrid()
ui_flowgraph_editor.SetNodePosition(integratedNode.id, im.ImVec2(centerPosX - 100, centerPosY - math.max(#outputLinks+1,#inputLinks+1)*15))
integratedNode:alignToGrid()
@/lua/ge/extensions/editor/mainMenu.lua
--TODO: cannot properly position status bar window, needs precise values. It will break on UI scale other than 1
imgui.SetNextWindowPos(imgui.ImVec2(winbounds.Pos.x + 15, winbounds.Pos.y + winbounds.Size.y - imgui.GetTextLineHeight()*3), imgui.Cond_Always)
imgui.Begin("StatusBar", opened,
if imgui.Button("OK", imgui.ImVec2(120, 0)) then editor.closeModalWindow(safeModeDlgName) end
end
end
if imgui.Button("OK", imgui.ImVec2(120, 0)) then editor.closeModalWindow(aboutDlgName) end
end
local function onEditorInitialized()
editor.registerWindow(saveLayoutWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(deleteLayoutWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(saveLayoutWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(deleteLayoutWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(resetLayoutsWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(deleteLayoutWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(resetLayoutsWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(revertLevelToOriginalWindowName, imgui.ImVec2(300, 100))
editor.registerWindow(resetLayoutsWindowName, imgui.ImVec2(200, 100))
editor.registerWindow(revertLevelToOriginalWindowName, imgui.ImVec2(300, 100))
editor.registerModalWindow(aboutDlgName, nil, nil, true)
@/lua/ge/extensions/flowgraph/nodes/states/stateExit.lua
im.Text(self.transitionName or "No Transition!")
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
end
@/lua/ge/extensions/core/metrics.lua
local im = ui_imgui
local pos = im.ImVec2(0, 0)
local padding = im.ImVec2(10, 0)
local pos = im.ImVec2(0, 0)
local padding = im.ImVec2(10, 0)
local sizeMin = im.ImVec2(0, 0)
local padding = im.ImVec2(10, 0)
local sizeMin = im.ImVec2(0, 0)
local sizeMax = im.ImVec2(-1, -1)
local sizeMin = im.ImVec2(0, 0)
local sizeMax = im.ImVec2(-1, -1)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imBegin.lua
anchor = anchor or 100
im.SetNextWindowSize(im.ImVec2(w,h))
if anchor == "TL" or anchor == "TR" or anchor == "BL" or anchor == "BR" then
if windowPos then
im.SetNextWindowPos(im.ImVec2(windowPos.x, windowPos.y))
end
@/lua/ge/extensions/editor/preferences.lua
imgui.GetWindowDrawList(),
imgui.ImVec2(windowPos.x + cPos.x - style.ItemSpacing.x/2, windowPos.y + cPos.y - math.floor(style.ItemSpacing.y/2) - scrollY),
imgui.ImVec2(
imgui.ImVec2(windowPos.x + cPos.x - style.ItemSpacing.x/2, windowPos.y + cPos.y - math.floor(style.ItemSpacing.y/2) - scrollY),
imgui.ImVec2(
windowPos.x + cPos.x - style.ItemSpacing.x/2 + 5,
imgui.Separator()
if imgui.Button("Yes", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() editor.preferencesRegistry:resetToDefaults(catName) end
imgui.SameLine()
imgui.SameLine()
if imgui.Button("No", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() end
imgui.EndPopup()
-- the left side list of pref pages
imgui.BeginChild1("Preferences Pages", imgui.ImVec2(imgui.uiscale[0] * 160, -bottom_margin), true)
pageListGui(preferencesPages)
imgui.BeginChild1("Preferences Page", imgui.ImVec2(0, -bottom_margin), true)
if editor.uiInputSearchTextFilter("##prefItemNameSearchFilter", prefItemNameFilter, 200, nil, editEnded) then
-- Right alignment
imgui.Spacing(imgui.ImVec2(0, 0))
local prefWindowCurrWidth = imgui.GetContentRegionAvailWidth();
imgui.Separator()
if imgui.Button("Yes", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() editor.preferencesRegistry:resetToDefaults() end
imgui.SameLine()
imgui.SameLine()
if imgui.Button("No", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() end
imgui.EndPopup()
local function onEditorInitialized()
editor.registerWindow(toolWindowName, imgui.ImVec2(800, 600))
valueInspector.inspectorName = "preferencesInspector"
@/lua/ge/extensions/editor/createObjectTool.lua
local simObjectSearch = require('/lua/ge/extensions/editor/util/searchUtil')()
local filteredFieldPopupSize = imgui.ImVec2(300, 500)
local tooltipLongTextLength = 70
local tooltipLongTextLength = 70
local clearButtonSize = imgui.ImVec2(24, 24)
local simObjectClassNames = {}
imgui.SameLine()
if editor.uiIconImageButton(editor.icons.close, imgui.ImVec2(22, 22)) then
ffi.copy(simObjectClassNameFilter, "")
if not editor.getPreference("createObjectTool.general.verticalToolbar") then
editor.uiVertSeparator(editor.getPreference("ui.general.iconButtonSize"), imgui.ImVec2(0, 0))
imgui.SameLine()
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
selectedPieceColor = im.ImVec4(0.5, 0.75, 1, 1.0),
initialWindowSize = im.ImVec2(400, 300),
nextWindowPos = im.ImVec2(600, 200),
initialWindowSize = im.ImVec2(400, 300),
nextWindowPos = im.ImVec2(600, 200),
buttonSize = im.ImVec2(44,44),
nextWindowPos = im.ImVec2(600, 200),
buttonSize = im.ImVec2(44,44),
thinButtonSize = im.ImVec2(44,22),
buttonSize = im.ImVec2(44,44),
thinButtonSize = im.ImVec2(44,22),
slimButtonSize = im.ImVec2(22,44)
thinButtonSize = im.ImVec2(44,22),
slimButtonSize = im.ImVec2(22,44)
}
im.SetCursorPosX(piecePositions[3] + 10)
if editor.uiIconImageButton(editor.icons.videocam, im.ImVec2(22,22), style.buttonColorBase) then
tb.focusCameraOn(currentIndex,nil, true)
--if im.SmallButton("m##"..name) then
if editor.uiIconImageButton(editor.icons.adjust, size or im.ImVec2(20,20), style.colorYellow) then
tbFunctions.modifierChange(name)
--if im.SmallButton("x##"..name) then
if editor.uiIconImageButton(editor.icons.delete, size or im.ImVec2(20,20), style.colorRed) then
tbFunctions.modifierRemove(name)
--if im.SmallButton("r##"..name) then
if editor.uiIconImageButton(editor.icons.undo, size or im.ImVec2(20,20), style.colorGreen) then
modifierValues[name].value[0] = resetValue
im.SetDragDropPayload("TrackBuilderMaterialPayload", materialSettings.dragDropData, im.ArraySize(materialSettings.dragDropData), im.Cond_Once );
im.Image(materialSettings.dragDropImage.texId, im.ImVec2(50, 50), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(255,255,255,255).Value, im.ImColorByRGB(255,255,255,255).Value)
im.EndDragDropSource()
im.SetDragDropPayload("TrackBuilderTextureSetPayload", materialSettings.dragDropData, im.ArraySize(materialSettings.dragDropData), im.Cond_Once );
im.Image(materialSettings.dragDropImage.texId, im.ImVec2(50, 50), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(255,255,255,255).Value, im.ImColorByRGB(255,255,255,255).Value)
im.EndDragDropSource()
im.SetDragDropPayload("TrackBuilderGlowMapPayload", materialSettings.dragDropData, im.ArraySize(materialSettings.dragDropData), im.Cond_Once );
im.Image(materialSettings.dragDropImage.texId, im.ImVec2(50, 50), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(255,255,255,255).Value, im.ImColorByRGB(255,255,255,255).Value)
im.EndDragDropSource()
im.SameLine()
if editor.uiIconImageButton(editor.icons.save, im.ImVec2(16,16), style.buttonColorBase, nil, nil, "saveButton") then saveMaterial() end
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(16,16), style.buttonColorBase, nil, nil, "resetMaterialButton") then
local materialLetter = string.sub(materials.matNames[materialSettings.selectedMaterial[0]+1],14,14)
im.TextColored(style.textColor,translateLanguage("ui.trackBuilder.matEditor.base", 'Base'))
if im.ImageButton("##imageButton1", materialSettings.base.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,0).Value, im.ImColorByRGB(255,255,255,255).Value) then end
dragDropTarget('base')
im.TextColored(style.textColor,translateLanguage("ui.trackBuilder.matEditor.center", "Center"))
if im.ImageButton("##imageButton2", materialSettings.center.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(255,0,0,0).Value, im.ImColorByRGB(255,255,255,255).Value) then end
dragDropTarget('center')
im.TextColored(style.textColor,translateLanguage("ui.trackBuilder.matEditor.border", "Border"))
if im.ImageButton("##imageButton3", materialSettings.border.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,0).Value, im.ImColorByRGB(255,255,255,255).Value) then end
dragDropTarget('border')
if im.TreeNode1(translateLanguage("ui.trackBuilder.matEditor.baseTextures", "Base Textures")) then
im.BeginChild1("baseTextureChild", im.ImVec2(-1,160))
local i = 1
for name, set in pairs(materialSettings.textureSets) do
if im.ImageButton("##imageButton4", set.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
dragDropSourceTextureSet(name, set)
if im.TreeNode1(translateLanguage("ui.trackBuilder.matEditor.decalTextures", "Decal Textures")) then
im.BeginChild1("decalTextureChild",im.ImVec2(-1,160))
local i = 1
for name, glowMap in pairs(materialSettings.glowMaps) do
if im.ImageButton("##imageButton5", glowMap.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
dragDropSourceGlowMap(name, glowMap)
smallSetButtons("bank",{-75,-45,-15,15,45,75},im.ImVec2(40,0))
im.NewLine()
im.NewLine()
smallSetButtons("bank2",{-90,-60,-30,30,60,90},im.ImVec2(40,0))
im.NewLine()
smallSetButtons("height",{-25,-10,-5,5,10,25},im.ImVec2(35,0), true, {'-25','-10','-5','+5','+10','+25'})
im.NewLine()
im.TextColored(style.textColor,translateLanguage("ui.trackBuilder.base.width", "Width") .. ": " .. modifierValues.width.value[0]..'m')
smallSetButtons("width",{0,1,2,5,10,15,20},im.ImVec2(30,0))
im.NewLine()
if editor.uiIconImageButton(editor.icons.wb_sunny, im.ImVec2(30,30),style.buttonColorBase) then
saveSettings.timeOfDay[0]= 0.2
im.SameLine()
if editor.uiIconImageButton(editor.icons.access_time or editor.icons.stop,im.ImVec2(30,30),style.buttonColorBase) then
saveSettings.timeOfDay[0] = 0.1
im.SameLine()
if editor.uiIconImageButton(editor.icons.brightness_3,im.ImVec2(30,30),style.buttonColorBase) then
saveSettings.timeOfDay[0]= 0.5
im.Separator()
local size = im.ImVec2(im.GetWindowWidth()-2,24)
if im.Button(translateLanguage("ui.trackBuilder.trackSettings.alignTrackToCam", "Align Track to Camera"),size) then
-- actual save button
if im.Button(text, im.ImVec2(128,20)) then
local exp, filename = tb.save(
im.SameLine()
if im.Button(previewText, im.ImVec2(128,20)) then
hiddenForScreenshotTimer = 1
if allowPacking then
if im.Button(translateLanguage("ui.trackBuilder.saveLoad.packToMod", "Pack to Mod"), im.ImVec2(264,20)) then
local modName = "mods/TrackBuilder_" .. ffi.string(saveSettings.saveStr)..".zip"
im.TextColored(style.textColor, translateLanguage("ui.trackBuilder.saveLoad.description", "Description"))
im.InputTextMultiline("##description", saveSettings.description, im.GetLengthArrayCharPtr(saveSettings.description), im.ImVec2(-1.0, im.GetTextLineHeight() * 3))
im.Combo1(translateLanguage("ui.trackBuilder.saveLoad.difficulty", 'Difficulty'), saveSettings.difficulty, difficulty)
activeCount = activeCount +1
im.BeginChild1("ObstacleChild", im.ImVec2(0,430), true)
if im.TreeNodeEx1('Obstacle '..activeCount,im.TreeNodeFlags_DefaultOpen) then
-- if im.SmallButton("r##op"..i) then
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(20,20), style.colorGreen) then
o.position[0] = 0
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(20,20), style.colorGreen) then
o.scale[0] = obstacleInfo[name].scale[1] or 1
-- if im.SmallButton("r##or"..i) then
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(20,20), style.colorGreen) then
o.rotation[0] = 0
tbFunctions.refreshPieceInfo()
elseif editor.uiIconImageButton(editor.icons.add_box or editor.icons.stop, im.ImVec2(35,35), style.buttonColorBase) then
modifierValues.obstacles.list[activeCount+1].active = true
im.SetCursorPosX(im.GetWindowWidth()-25)
if editor.uiIconImageButton(editor.icons.undo, size or im.ImVec2(20,20), style.colorGreen) then
local currentPiece = tb.getSelectedTrackInfo()
im.SetCursorPosX(im.GetWindowWidth()-25)
if editor.uiIconImageButton(editor.icons.undo, size or im.ImVec2(20,20), style.colorGreen) then
modifierValues.checkpoint.position[0] = 0
local function stopDrivingWindow()
--im.SetNextWindowPos(im.ImVec2(style.displaySize.x/2-108, 0))
im.SetNextWindowSize(im.ImVec2(216, 76))
--im.SetNextWindowPos(im.ImVec2(style.displaySize.x/2-108, 0))
im.SetNextWindowSize(im.ImVec2(216, 76))
im.Begin("StopDrivingWindow", stopDrivingWindowOpen, im.flags(im.WindowFlags_NoResize, im.WindowFlags_NoScrollbar))
im.Begin("StopDrivingWindow", stopDrivingWindowOpen, im.flags(im.WindowFlags_NoResize, im.WindowFlags_NoScrollbar))
if im.Button("Stop Driving", im.ImVec2(200,60)) then
driving = false
local function toolbar()
im.SetNextWindowSize(im.ImVec2(style.toolbarWidth, 72))
-- im.SetNextWindowPos(im.ImVec2(style.displaySize.x/2 - style.fullToolbarsWidth/2,0))
im.SetNextWindowSize(im.ImVec2(style.toolbarWidth, 72))
-- im.SetNextWindowPos(im.ImVec2(style.displaySize.x/2 - style.fullToolbarsWidth/2,0))
im.Begin( translateLanguage("ui.trackBuilder.toolbar.title", "Toolbar"), nil, im.flags(im.WindowFlags_NoScrollbar, im.WindowFlags_NoResize, im.WindowFlags_NoCollapse, im.WindowFlags_NoDocking))
--im.SetCursorPosX(style.toolbarWidth/2 - 100)
if im.Button("Stop Driving", im.ImVec2(-1,-1)) then
driving = false
local pos = im.GetWindowPos()
local p = im.ImVec2(pos.x + im.GetCursorPosX() - 4 ,pos.y + im.GetCursorPosY()-4)
local col = im.GetColorU322(im.ImVec4(0.5,0.5,0.5,1))
local col = im.GetColorU322(im.ImVec4(0.5,0.5,0.5,1))
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p, im.ImVec2(p.x+1,p.y+40), col)
im.SetCursorPosX(im.GetCursorPosX() + 1)
pos = im.GetWindowPos()
p = im.ImVec2(pos.x + im.GetCursorPosX() - 4 ,pos.y + im.GetCursorPosY()-4)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p, im.ImVec2(p.x+1,p.y+40), col)
p = im.ImVec2(pos.x + im.GetCursorPosX() - 4 ,pos.y + im.GetCursorPosY()-4)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p, im.ImVec2(p.x+1,p.y+40), col)
im.SetCursorPosX(im.GetCursorPosX() + 1)
im.SetCursorPosY(im.GetCursorPosY() + 8)
modifierButtons(name,0, false,im.ImVec2(29,29))
im.SetCursorPosX(im.GetWindowWidth()/2 - 100)
if im.Button(translateLanguage("ui.trackbuilder.menus.openAdvancedPieces","Open Advanced Pieces"),im.ImVec2(200,50)) then
menuItems.advancedPieces.isOpen[0] = true
im.SetCursorPosX(selectorPositions[1])
if im.Button(translateLanguage("ui.trackBuilder.base.drive","Drive"),im.ImVec2(100,24)) then
tbFunctions.drive()
im.SetCursorPosX(selectorPositions[2])
if im.Button(translateLanguage("ui.trackBuilder.base.test","Test"),im.ImVec2(100,24)) then
tbFunctions.drive(currentIndex-1)
local function drawTrackBuilderUI()
im.SetNextWindowSize(im.ImVec2(280,0))
local flags = trackSpawned and im.flags(im.WindowFlags_MenuBar, im.WindowFlags_NoResize) or im.flags(im.WindowFlags_NoResize)
if not trackSpawned then
if im.Button(translateLanguage("ui.trackbuilder.menus.startTrackBuilder", "Start Track Builder Here"), im.ImVec2(-1,0)) then
trackSpawned = true
end
if im.Button(translateLanguage("ui.trackbuilder.menus.startTrackBuilderOnGlowCity", "Switch to Glow City"), im.ImVec2(-1,0)) then
freeroam_freeroam.startTrackBuilder('glow_city',true)
name = translateLanguage("ui.trackBuilder.menus.advancedModifiers", "Advanced Modifiers"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.adjust
},
name = translateLanguage("ui.trackBuilder.menus.advancedPieces", "Advanced Pieces"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons['tb_loop'] or editor.icons.stop
},
name = translateLanguage("ui.trackBuilder.menus.trackShape", "Track Shape"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons['tb_shapes'] or editor.icons.stop,
onOpenFunction = onBordersAndCentersOpened, onCloseFunction = onBordersAndCentersClosed
name =translateLanguage("ui.trackBuilder.menus.wallsCeiling", "Walls and Ceiling"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons['tb_tunnel'] or editor.icons.stop
},
name = translateLanguage("ui.trackBuilder.menus.obstacles", "Obstacles"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,504), icon = editor.icons.remove_circle_outline
},
name = translateLanguage("ui.trackBuilder.menus.materialEditor", "Material Editor"),
isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.brush,
onOpenFunction = onMaterialEditorOpened, onCloseFunction = onMaterialEditorClosed
name = 'SubTrack',
isOpen = im.BoolPtr(true), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.extension,
onCloseFunction = onSubTracksClosed
additionalMenuItems = {
checkpoints = {name = translateLanguage("ui.trackBuilder.menus.checkpoints", "CheckPoints"), isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.flag},
postionrotation = {name = translateLanguage("ui.trackBuilder.menus.trackSettings", "Track Settings"), isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.settings},
checkpoints = {name = translateLanguage("ui.trackBuilder.menus.checkpoints", "CheckPoints"), isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.flag},
postionrotation = {name = translateLanguage("ui.trackBuilder.menus.trackSettings", "Track Settings"), isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.settings},
saveload = {name= translateLanguage("ui.trackBuilder.menus.saveLoad", "Save and Load"),isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,420), icon = editor.icons.save},
postionrotation = {name = translateLanguage("ui.trackBuilder.menus.trackSettings", "Track Settings"), isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,0), icon = editor.icons.settings},
saveload = {name= translateLanguage("ui.trackBuilder.menus.saveLoad", "Save and Load"),isOpen = im.BoolPtr(false), wasOpen = false, size = im.ImVec2(280,420), icon = editor.icons.save},
--debug = {name = 'debug', value = im.BoolPtr(false), icon = editor.icons.bug_report}
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veStaticRenderView.lua
ortho = im.BoolPtr(mainRVData.ortho or false),
imagePos = im.ImVec2(0,0),
imageSize = im.ImVec2(0,0),
imagePos = im.ImVec2(0,0),
imageSize = im.ImVec2(0,0),
},
textureName = '#' .. wndName .. 'axisGizmo',
imagePos = im.ImVec2(0,0),
imageSize = im.ImVec2(0,0),
imagePos = im.ImVec2(0,0),
imageSize = im.ImVec2(0,0),
}
if not editor.isWindowRegistered(wndName) then
editor.registerWindow(wndName, im.ImVec2(400,600))
end
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(6, 6))
if im.BeginPopup('viewcontrol' .. tostring(wndData.wndName)) then
local axisGizmoRVPadding = 15
local axisGizmoRVSize = im.ImVec2(100,100)
local axisGizmoRVPos = im.ImVec2(mainRVPos.x + mainRVSize.x - axisGizmoRVSize.x - axisGizmoRVPadding, mainRVPos.y + axisGizmoRVPadding)
local axisGizmoRVSize = im.ImVec2(100,100)
local axisGizmoRVPos = im.ImVec2(mainRVPos.x + mainRVSize.x - axisGizmoRVSize.x - axisGizmoRVPadding, mainRVPos.y + axisGizmoRVPadding)
local btnWidth = im.CalcTextSize(">>>").x
im.SetCursorPos(im.ImVec2(mainRVSize.x - btnWidth - 30, 200))
if editor.uiIconImageButton(editor.icons.switch_camera, nil, im.ImColorByRGB(255,255,255,255).Value, nil, nil) then
im.PushStyleVar1(im.StyleVar_WindowBorderSize, 0)
im.PushStyleVar2(im.StyleVar_WindowPadding, im.ImVec2(0, 0))
@/lua/ge/extensions/flowgraph/nodes/gameplay/countdown.lua
if tWidth.x < avail.x then
im.Dummy(im.ImVec2((avail.x-tWidth.x)/2 -10,0))
im.SameLine()
builder:Middle()
im.ProgressBar((self.duration - self.timer) / self.duration, im.ImVec2(100,0))
if not self.running then
@/lua/ge/extensions/editor/util/searchUtil.lua
im.BeginChild1("##"..string_label.."childCombo", im.ImVec2(im.GetContentRegionAvailWidth(), 140 * (editor and editor.getPreference and editor.getPreference("ui.general.scale") or 1)) )
for _, result in ipairs(self.filtered) do
@/lua/ge/extensions/editor/biomeTool.lua
local layer = getLayerWithType(layerType, layerID)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainPanel#"..layer.layerType..layer.layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(imgui.GetStyle().FramePadding.y)), true)
imgui.BeginChild1("LayerActionsPanel"..layer.layerType..layer.layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, 40 * imgui.uiscale[0]), nil)
imgui.BeginChild1("MainPanel#"..layer.layerType..layer.layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(imgui.GetStyle().FramePadding.y)), true)
imgui.BeginChild1("LayerActionsPanel"..layer.layerType..layer.layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, 40 * imgui.uiscale[0]), nil)
imgui.SameLine()
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("No Forest Item Selected") then
local panelWidth = imgui.GetContentRegionAvail().x
imgui.BeginChild1("LayerMainPanel##"..tostring(layer.layerType)..tostring(layer.layerID), imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y), nil)
--imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowViewport().Size.x * 0.5, imgui.GetWindowViewport().Size.y * 0.5))
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5 - 150, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
--imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowViewport().Size.x * 0.5, imgui.GetWindowViewport().Size.y * 0.5))
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5 - 150, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
local framePadding = imgui.ImVec2(3, 3) --imgui.GetStyle().FramePadding
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5 - 150, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
local framePadding = imgui.ImVec2(3, 3) --imgui.GetStyle().FramePadding
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
local framePadding = imgui.ImVec2(3, 3) --imgui.GetStyle().FramePadding
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Biome Work Progress") then
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5 - 150, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
local framePadding = imgui.ImVec2(3, 3)
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5 - 150, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
local framePadding = imgui.ImVec2(3, 3)
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
local framePadding = imgui.ImVec2(3, 3)
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Biome Edge Placement Progress") then
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
if imgui.BeginPopupModal("No Brush Selected!") then
end
imgui.SetNextWindowPos(imgui.ImVec2(imgui.GetWindowPos().x + imgui.GetWindowSize().x * 0.5, imgui.GetWindowPos().y + imgui.GetWindowSize().y * 0.5))
if imgui.BeginPopupModal("No Lasso Areas!") then
end
if imgui.Button("Generate Layer", imgui.ImVec2(150, 30)) then
local isAddBlending = (getBlendingMethod(layerType, layerID) == blending_enum.add)
imgui.Dummy(imgui.ImVec2(5,10))
imgui.Text("Layer Mask:")
editor.icons.folder,
imgui.ImVec2(22, 22)
) then
imgui.SameLine()
if imgui.Button("Clear", imgui.ImVec2(40, 30)) then
setTerrLayerMask(layerID, "")
local texture = editor.getTempTextureObj(getTerrLayerMask(layerID))
imgui.Image(texture.tex:getID(), imgui.ImVec2(200, 200), nil, nil, nil, editor.color.white.Value)
if getTerrLayerMask(layerID) == "" then
local posY = 100 - textSize.y/2
imgui.SetCursorPos(imgui.ImVec2(imgPosStart.x + posX, imgPosStart.y + posY))
imgui.Text("No Mask Selected!")
end
imgui.SetCursorPos(imgui.ImVec2(0, imgPosStart.y + 205))
end
imgui.SetCursorPosX(firstWidgetPos)
imgui.BeginChild1("CentralBrushesSelected"..layerType..layerID, imgui.ImVec2(180, 100), imgui.WindowFlags_ChildWindow)
local noBrushTextSize = imgui.CalcTextSize("No Brush Selected!")
imgui.SetCursorPos(imgui.ImVec2(90 - noBrushTextSize.x/2, 50 - noBrushTextSize.y/2))
imgui.Text("No Brush Selected!")
--imgui.PushStyleColor2(imgui.Col_Button, (isForestBrushTempSelected(layerType, layerID, item.internalName, enum_forestBrushItemZone.central)) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##CentralBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.central)
imgui.SameLine()
if imgui.Button("Select Brush##Central", imgui.ImVec2(100, 30)) then
imgui.OpenPopup("Select Forest Brush (Central)")
imgui.SetCursorPosX(firstWidgetPos)
imgui.BeginChild1("FalloffBrushesSelected"..layerType..layerID, imgui.ImVec2(180, 100), imgui.WindowFlags_ChildWindow)
local noBrushTextSize = imgui.CalcTextSize("No Brush Selected!")
imgui.SetCursorPos(imgui.ImVec2(90 - noBrushTextSize.x/2, 50 - noBrushTextSize.y/2))
imgui.Text("No Brush Selected!")
if not isForestBrushSelected(layerType, layerID, item.internalName, enum_forestBrushItemZone.falloff) then goto continue end
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##FalloffBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.falloff)
imgui.SameLine()
if imgui.Button("Select Brush##Falloff", imgui.ImVec2(100, 30)) then
imgui.OpenPopup("Select Forest Brush (Falloff)")
local forestBrPopupPos = imgui.ImVec2(var.layers.PopupOpenMousePos.x + 20, var.layers.PopupOpenMousePos.y - 250)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowSize(imgui.ImVec2(300, 500), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Select Forest Brush (Central)") then
if imgui.BeginPopupModal("Select Forest Brush (Central)") then
imgui.BeginChild1("CentralBrushesCentralPopup"..layerType..layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y - 50), imgui.WindowFlags_ChildWindow)
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1))
imgui.PushStyleColor2(imgui.Col_Button, (isNoneBrushSelected) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##NoneCentral", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
clearForestBrushTempSelection()
imgui.PushStyleColor2(imgui.Col_Button, (isBrushSelected) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##Falloff"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
if isBrushSelected then
local forestBrPopupPos = imgui.ImVec2(var.layers.PopupOpenMousePos.x + 20, var.layers.PopupOpenMousePos.y - 250)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowSize(imgui.ImVec2(300, 500), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Select Forest Brush (Falloff)") then
if imgui.BeginPopupModal("Select Forest Brush (Falloff)") then
imgui.BeginChild1("FalloffBrushesCentralPopup"..layerType..layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y - 50), imgui.WindowFlags_ChildWindow)
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1))
imgui.PushStyleColor2(imgui.Col_Button, (isForestBrushTempSelected(layerType, layerID, noneBrushItemName, enum_forestBrushItemZone.falloff)) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##NoneFalloff", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
clearForestBrushTempSelection()
imgui.PushStyleColor2(imgui.Col_Button, isBrushSelected and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##Falloff"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
if isBrushSelected then
end
imgui.SetCursorPos(imgui.ImVec2(panelWidth - 180, cursorPosY))
if imgui.Button("Create Edges", imgui.ImVec2(150, 30)) then
imgui.SetCursorPos(imgui.ImVec2(panelWidth - 180, cursorPosY))
if imgui.Button("Create Edges", imgui.ImVec2(150, 30)) then
local edgeElements = getForestBrushElementsFromSelection(layerType, layerID, enum_forestBrushItemZone.edge)
imgui.SetCursorPosX(firstWidgetPos)
imgui.BeginChild1("EdgeBrushesSelected"..layerType..layerID, imgui.ImVec2(180, 100), imgui.WindowFlags_ChildWindow)
local noBrushTextSize = imgui.CalcTextSize("No Brush Selected!")
imgui.SetCursorPos(imgui.ImVec2(90 - noBrushTextSize.x/2, 50 - noBrushTextSize.y/2))
imgui.Text("No Brush Selected!")
if not isForestBrushSelected(layerType, layerID, item.internalName, enum_forestBrushItemZone.edge) then goto continue end
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##EdgeBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.edge)
local forestBrPopupPos = imgui.ImVec2(var.layers.PopupOpenMousePos.x + 20, var.layers.PopupOpenMousePos.y - 250)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowPos(forestBrPopupPos)
imgui.SetNextWindowSize(imgui.ImVec2(300, 500), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Select Forest Brush (Edge)") then
if imgui.BeginPopupModal("Select Forest Brush (Edge)") then
imgui.BeginChild1("EdgeBrushesPopup"..layerType..layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y - 50), imgui.WindowFlags_ChildWindow)
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1))
imgui.PushStyleColor2(imgui.Col_Button, (isNoneBrushSelected) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##NoneEdge", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
clearForestBrushTempSelection()
imgui.PushStyleColor2(imgui.Col_Button, (isBrushSelected) and var.buttonColor_active or var.buttonColor_inactive)
editor.uiIconImage(editor.icons.forest_brushelement, imgui.ImVec2(math.ceil(imgui.GetFontSize()), math.ceil(imgui.GetFontSize())))
imgui.SameLine()
local textPos = imgui.GetCursorPos()
if imgui.Button("##Edge"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
if isBrushSelected then
imgui.SameLine()
if imgui.Button("Select Brush##Edge", imgui.ImVec2(100, 30)) then
imgui.OpenPopup("Select Forest Brush (Edge)")
local panelHeight = math.max(imgui.GetContentRegionAvail().y, 200)
imgui.BeginChild1("AreasList##"..layer.layerType..layer.layerID, imgui.ImVec2(imgui.GetContentRegionAvail().x, panelHeight - 60), imgui.WindowFlags_ChildWindow)
local lassoAreas = getAllLassoAreas(layer.layerID)
local noAreaText = "N O L A S S O A R E A A V A I L A B L E !"
imgui.SetCursorPos(imgui.ImVec2(imgui.GetContentRegionAvail().x/2 - imgui.CalcTextSize(noAreaText).x/2, imgui.GetContentRegionAvail().y/2))
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1));
local arealistHeight = math.max(imgui.GetContentRegionAvail().y, 200)
imgui.BeginChild1("AreasListContainer##"..layer.layerType..layer.layerID, imgui.ImVec2(300, arealistHeight - 10), imgui.WindowFlags_ChildWindow)
imgui.Text("Lasso Areas")
imgui.Text("Lasso Areas")
local buttonSize = imgui.ImVec2(180, 30)
local framePadding = imgui.ImVec2(3, 3)
local buttonSize = imgui.ImVec2(180, 30)
local framePadding = imgui.ImVec2(3, 3)
area = lassoAreas[index]
local p1 = imgui.ImVec2(imgui.GetCursorPos().x - 32, imgui.GetCursorPos().y - 32)
local p2 = imgui.ImVec2(imgui.GetCursorPos().x + 150 + 32, imgui.GetCursorPos().y + 30 + 32)
local p1 = imgui.ImVec2(imgui.GetCursorPos().x - 32, imgui.GetCursorPos().y - 32)
local p2 = imgui.ImVec2(imgui.GetCursorPos().x + 150 + 32, imgui.GetCursorPos().y + 30 + 32)
imgui.ImDrawList_AddRectFilled(imgui.GetWindowDrawList(), p1, p2, imgui.GetColorU322(imgui.ImVec4(1, 0, 0, 1)))
imgui.SameLine()
imgui.Dummy(imgui.ImVec2(5,1))
imgui.SameLine()
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Delete Lasso Area##"..area.lassoAreaID) then
if imgui.Button("Delete##Area"..layer.layerID..area.lassoAreaID, imgui.ImVec2(50, 30)) then
if area.zoneType == var.enum_lassoDrawType.inclusionZone then
local buttonSize = imgui.ImVec2(150, 30)
imgui.SetCursorPosX(imgui.GetContentRegionAvail().x/2 - buttonSize.x - 20)
imgui.SameLine()
imgui.Dummy(imgui.ImVec2(20,1))
imgui.SameLine()
local layers = getLayersWithType(layerType)
imgui.BeginChild1("LayersList", imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y - 4), imgui.WindowFlags_ChildWindow)
for _, layer in ipairs(layers) do
local buttonSize = imgui.ImVec2(150, 30)
local cursorPosX = imgui.GetCursorPosX()
imgui.SetNextWindowSize(imgui.ImVec2(200, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Delete Layer") then
local brushName = tableIsEmpty(brush) and "None" or brush[1]
imgui.Dummy(imgui.ImVec2(10,1))
imgui.SameLine()
imgui.SameLine()
imgui.Dummy(imgui.ImVec2(10,1))
imgui.SameLine()
local function drawLevelBiomeToolbar()
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), levelBiomeToolbarHeight), true)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), levelBiomeToolbarHeight), true)
if imgui.Button("(Re)generate all layers", buttonSize) then
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonLBToolbar", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
local function drawLevelBiomeLayersList()
imgui.BeginChild1("LevelBiomeLayers", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), levelBiomeLevelsListHeight), true)
imgui.Text("Terrain Layers:")
imgui.Text("Terrain Layers:")
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainPanelLevelBiome", imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(buttonSize.y+imgui.GetStyle().FramePadding.y*6)), true)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainPanelLevelBiome", imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(buttonSize.y+imgui.GetStyle().FramePadding.y*6)), true)
local layers = getLayersWithType(layerType_enum.terrain)
local noAreaText = "N O T E R R A I N L A Y E R A V A I L A B L E !"
imgui.SetCursorPos(imgui.ImVec2(imgui.GetContentRegionAvail().x/2 - imgui.CalcTextSize(noAreaText).x/2, imgui.GetContentRegionAvail().y/2))
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1));
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonLBLevels", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
local function drawLevelBiomeLayerProperties()
imgui.BeginChild1("LevelBiomeLayerProps", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), levelBiomeLevelPropsHeight), true)
local selectedLayer = getSelectedLayer(layerType_enum.terrain)
local noAreaText = "N O L A Y E R S E L E C T E D !"
imgui.SetCursorPos(imgui.ImVec2(imgui.GetContentRegionAvail().x/2 - imgui.CalcTextSize(noAreaText).x/2, imgui.GetContentRegionAvail().y/2))
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1));
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonLBLevelsProps", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
local function drawBiomeAreasToolbar()
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), biomeAreasToolbarHeight), true)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), biomeAreasToolbarHeight), true)
if imgui.Button("(Re)generate all layers", buttonSize) then
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonLBToolbar", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
local function drawBiomeAreasLayersList()
imgui.BeginChild1("AreaLayers", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), biomeAreasLevelsListHeight), true)
imgui.Text("Area Layers:")
imgui.Text("Area Layers:")
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainPanelAL", imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(buttonSize.y+imgui.GetStyle().FramePadding.y*6)), true)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainPanelAL", imgui.ImVec2(imgui.GetContentRegionAvail().x, imgui.GetContentRegionAvail().y-(buttonSize.y+imgui.GetStyle().FramePadding.y*6)), true)
local noAreaText = "N O A R E A L A Y E R A V A I L A B L E !"
imgui.SetCursorPos(imgui.ImVec2(imgui.GetContentRegionAvail().x/2 - imgui.CalcTextSize(noAreaText).x/2, imgui.GetContentRegionAvail().y/2))
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1));
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonALLevels", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
imgui.BeginChild1("BiomeAreaLayerProps", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), biomeAreasLevelPropsHeight), true)
local selectedLayer = getSelectedLayer(layerType_enum.area)
local noAreaText = "N O L A Y E R S E L E C T E D !"
imgui.SetCursorPos(imgui.ImVec2(imgui.GetContentRegionAvail().x/2 - imgui.CalcTextSize(noAreaText).x/2, imgui.GetContentRegionAvail().y/2))
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1, 0, 0, 1));
local separatorPos = imgui.GetCursorPos()
imgui.InvisibleButton("SeparatorButtonALLevelsProps", imgui.ImVec2(imgui.GetContentRegionAvail().x, seperatorHeight))
if imgui.IsItemActive() then
local function drawMainToolbar()
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 6), 50), true)
local buttonSize = imgui.ImVec2(150, 30)
imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 6), 50), true)
if imgui.Button("Open Project", buttonSize) then
local tabIconWidth = imgui.GetFontSize() + 6
local tabIconSize = imgui.ImVec2(tabIconWidth, tabIconWidth)
local framePadding = imgui.ImVec2(6, 6) --imgui.GetStyle().FramePadding
imgui.PushStyleVar2(imgui.StyleVar_FramePadding, framePadding)--imgui.ImVec2(imgui.GetFontSize(), imgui.GetFontSize()))
local framePadding = imgui.ImVec2(6, 6) --imgui.GetStyle().FramePadding
imgui.PushStyleVar2(imgui.StyleVar_FramePadding, framePadding)--imgui.ImVec2(imgui.GetFontSize(), imgui.GetFontSize()))
if imgui.BeginTabBar("BiomeToolTabBar") then
var.selectedTab = enum_tabType.LevelBiome
if imgui.BeginChild1("LevelBiomeChild", imgui.ImVec2((imgui.GetContentRegionAvail().x - 6), (imgui.GetContentRegionAvail().y - 6)), true) then
drawLevelBiomeLayersList()
var.selectedTab = enum_tabType.BiomeAreas
if imgui.BeginChild1("BiomeAreasChild", imgui.ImVec2((imgui.GetContentRegionAvail().x - 6), (imgui.GetContentRegionAvail().y - 6)), true) then
drawBiomeAreasLayersList()
local errCode = var.forestBrushTool:getBiomeError()
imgui.SetNextWindowSize(imgui.ImVec2(300, 100), imgui.Cond_FirstUseEver)
if imgui.BeginPopupModal("Biome Lasso Work Progress") then
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
editor.registerCustomFieldInspectorEditor("BiomeTool", "RA_Map", biomeToolCustomFieldEditor)
editor.registerWindow(toolWindowName, imgui.ImVec2(400, 400))
editor.registerModalWindow("NoForestObjDialog")
@/lua/ge/extensions/editor/drivePathEditor.lua
local min, max = math.min, math.max
local toolWinName, toolWinSize = 'drivePathEditor', im.ImVec2(300, 700)
local toolPrefixStr = splineMgr.getToolPrefixStr()
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
local cols = style.getImguiCols('crystal')
local iconsSmall, iconsBig = im.ImVec2(24, 24), im.ImVec2(36, 36)
im.SetColumnWidth(6, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('drivePathSplineListBox', im.ImVec2(-1, 180)) then
im.Columns(5, "drivePathSplineListBoxColumns", true)
im.SetColumnWidth(4, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 41225
im.SetColumnWidth(3, 40)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushItemWidth(-1)
if im.BeginListBox('vehicleListBox', im.ImVec2(-1, 180)) then
im.Columns(5, "vehicleListBoxColumns", true)
im.SetColumnWidth(4, 35)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
local wCtr = 823671
im.SetColumnWidth(3, 39)
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(2, 2))
im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(4, 2))
end
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
im.Separator()
-- Properties checkboxes and sliders.
im.Dummy(im.ImVec2(0, 3))
im.Separator()
im.Columns(1)
im.Dummy(im.ImVec2(0, 3))
im.Separator()
@/lua/ge/extensions/editor/physicsReloader.lua
local function onEditorInitialized()
editor.registerWindow(toolWindowName, im.ImVec2(300, 500))
editor.addWindowMenuItem("Physics Reloader", onWindowMenuItem)
@/lua/ge/extensions/flowgraph/nodes/util/template.lua
im.SameLine()
im.Dummy(im.ImVec2(self.sliderWidth[0],0))
im.SameLine()
im.Text("]")
--im.BeginChild1("child",im.ImVec2(self.sliderWidth[0],50), true)
end