string
Definition
-- @/=[C]:-1
function string(...)
Callers
@/lua/ge/extensions/editor/flowgraph/examples.lua
table.clear(self.results)
self.matchString = string.lower(ffi.string(self.searchText))
self.search:setFrecencyData(self.mgr.frecency or {})
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
if nodeType == 'string' or nodeType == 'string_single' then
node[2] = ffi.string(nodeEditTextInput)
elseif nodeType == 'number' then
@/lua/ge/extensions/editor/raceEditor/pacenotes.lua
editor.history:commitAction("Change Name of Note",
{index = self.index, self = self, old = note.name, new = ffi.string(nameText), field = 'name'},
setFieldUndo, setFieldRedo)
setFieldUndo, setFieldRedo)
--note.name = ffi.string(nameText)
end
editor.history:commitAction("Change Note of Pacenote",
{index = self.index, self = self, old = note.note, new = ffi.string(noteText), field = 'note'},
setFieldUndo, setFieldRedo)
setFieldUndo, setFieldRedo)
--note.name = ffi.string(nameText)
end
@/lua/ge/extensions/editor/biomeTool.lua
maskFilePath = imgui.ArrayChar(256, data.filepath)
setTerrLayerMask(layerID, ffi.string(maskFilePath))
end,
isRenamingLayer = false
setLayerName(layer.layerType, layer.layerID, ffi.string(inputTextValue))
end
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
im.Separator()
local filter = string.lower(ffi.string(self.search))
if filter == '' then
if editEnded[0] then
self:setField('name', ffi.string(self.nameText))
end
for _, id in ipairs(self.selections) do
self.objects[id].customFields.values[name] = ffi.string(self.fields[name])
end
for _, id in ipairs(self.selections) do
self.objects[id].customFields:add(ffi.string(self.addFieldText), 'string', "value")
end
for _, id in ipairs(self.selections) do
self.objects[id].customFields:add(ffi.string(self.addFieldText), 'number', 0)
end
function C:addTag()
local tag = ffi.string(self.addTagText)
if tag == '' then
@/lua/ge/extensions/editor/api/valueInspector.lua
if changed then
fieldValueCached = ffi.string(self.inputTextValue)
if fieldName == "name" then
if self.editEnded[0] then
fieldValue = ffi.string(self.inputTextValue)
local val = fieldValueCached or fieldValue
if isDifferent then
fieldValue = ffi.string(self.inputTextValue)
else
if isDifferent then
fieldValue = ffi.string(self.inputTextValue)
self.differentValuesFieldFlags[fieldName] = nil
if isDifferent then
fieldValue = ffi.string(self.inputTextValue)
else
if isDifferent then
fieldValue = ffi.string(self.inputTextValue)
self.differentValuesFieldFlags[fieldName] = nil
if editor.uiInputText(fieldNameId, self.inputTextValue, imgui.ArraySize(self.inputTextValue), nil, nil, nil, self.editEnded) and self.editEnded[0] then
fieldValue = ffi.string(self.inputTextValue)
self.setValueCallback(fieldName, fieldValue, arrayIndex, customData, self.editEnded[0])
if changed then
fieldValueCached = ffi.string(self.inputTextValue)
end
if self.editEnded[0] then
fieldValue = ffi.string(self.inputTextValue)
local val = fieldValueCached or fieldValue
@/lua/ge/extensions/editor/decalSpline.lua
local preState = splineMgr.deepCopyDecalSpline(spline)
spline.name = ffi.string(splineNamePtr)
local postState = splineMgr.deepCopyDecalSpline(spline)
@/lua/ge/extensions/editor/flowgraphEditor.lua
else
local tag = ffi.string(properties.macroTagField)
if tag~='' then
@/lua/ge/extensions/flowgraph/nodes/debug/comment.lua
if im.InputText("##title" .. self.id, imText, nil, im.InputTextFlags_EnterReturnsTrue) then
self.commentTitle = ffi.string(imText)
reason = "Changed title to self.commentTitle"
if im.InputTextMultiline("##" .. self.id, descText, 2048,im.ImVec2(im.GetContentRegionAvailWidth(),300), im.InputTextFlags_Multiline) then
self.commentText = ffi.string(descText)
end
--editor.uiIconImage("lock")
im.TextColored(self.textColorVec4,ffi.string(self.commentTitle))
im.EndGroup()
@/lua/ge/extensions/editor/gen/terrain.lua
1, 50
,ffi.string('/levels/gridmap_v2/art/terrains/t_macro_holes_r.png')
-- ,ffi.string('/lua/ge/extensions/editor/gen/assets/tflat.png')
,ffi.string('/levels/gridmap_v2/art/terrains/t_macro_holes_r.png')
-- ,ffi.string('/lua/ge/extensions/editor/gen/assets/tflat.png')
-- ,ffi.string(im.ArrayChar(128))
-- ,ffi.string('/lua/ge/extensions/editor/gen/assets/tflat.png')
-- ,ffi.string(im.ArrayChar(128))
-- ffi.string(terrainImpExp.holeMapTexture),
-- ,ffi.string(im.ArrayChar(128))
-- ffi.string(terrainImpExp.holeMapTexture),
,materials
@/lua/ge/extensions/editor/mainToolbar.lua
if editingSetIndex > 0 and editingSetIndex <= #editModeSets then
local newName = ffi.string(editingSetName)
if newName ~= "" then
@/lua/ge/extensions/editor/raceEditor/segments.lua
local old = segment:onSerialize()
segment.name = ffi.string(nameText)
self:addHistory("Changed Name of Segment", old)
@/lua/ge/extensions/editor/raceEditor/startPositions.lua
local old = sp:onSerialize()
sp.name = ffi.string(nameText)
self:addHistory("Renamed Start Position", old)
@/lua/ge/extensions/editor/flowgraph/variables.lua
im.SameLine()
local name = ffi.string(self.addVariableSettings.name)
local nameAvailable = name ~= "" and not self.targets[self.addVariableSettings.target].target:variableExists(name)
end
local typeText = self.addVariableSettings.type=="auto" and ("Automatic Type: ("..self:getAutoTypeFromName(ffi.string(self.addVariableSettings.name))..")") or "self.addVariableSettings.type"
if im.BeginCombo("##typeSelectorNewVariable", typeText, im.ComboFlags_HeightLarge) then
if acceptCreate then
local name = ffi.string(self.addVariableSettings.name)
if name ~= "" then
@/lua/ge/extensions/editor/rallyEditor/pacenotes/pacenoteForm.lua
-- pacenote:clearTodo()
-- local newVal = ffi.string(freeformBefore)
-- pacenote:setNoteFieldBefore(newVal)
pacenote:clearTodo()
local newVal = ffi.string(freeformNote)
pacenote:setNoteFieldFreeform(newVal)
-- if editEnded[0] then
-- pacenote.playback_rules = ffi.string(playbackRulesText)
-- end
@/lua/ge/extensions/editor/preferences.lua
filterValueChanged = true
if ffi.string(imgui.TextFilter_GetInputBuf(prefItemNameFilter)) == "" then
imgui.ImGuiTextFilter_Clear(prefItemNameFilter)
@/lua/common/libs/luaqrcode/qrencode.lua
--- that varies between 8 and 16, depending on the version and the mode (see method `get_length()`). The
--- remaining capacity is multiplied by the amount of data per bit string (numeric: 3, alphanumeric: 2, other: 1)
--- and divided by the length of the bit string (numeric: 10, alphanumeric: 11, binary: 8, kanji: 13).
--- remaining capacity is multiplied by the amount of data per bit string (numeric: 3, alphanumeric: 2, other: 1)
--- and divided by the length of the bit string (numeric: 10, alphanumeric: 11, binary: 8, kanji: 13).
--- Then the floor function is applied to the result:
-- Add the data string (0's and 1's) to the matrix for the given mask.
local function add_data_to_matrix(matrix,data,mask)
@/lua/ge/extensions/editor/driftDataEditor.lua
if im.Button("Create new drift spot") then
if #ffi.string(newDriftSpotId) > 0 then
createNewDriftSpot(ffi.string(newDriftSpotId))
if #ffi.string(newDriftSpotId) > 0 then
createNewDriftSpot(ffi.string(newDriftSpotId))
newDriftSpotId = im.ArrayChar(128, "")
if im.InputText("##marker"..i..lineName, imVal) then
lineData.markerObjects[i] = ffi.string(imVal)
driftSpotsUnsavedChanges = true
if im.InputText("##name", namePtr) then
info.name = ffi.string(namePtr)
driftSpotsUnsavedChanges = true
@/lua/ge/extensions/core/settings/settings.lua
for index=0, ui_imgui.IoFontsGetCount() - 1 do
if ffi.string(ui_imgui.IoFontsGetName(index)) == fontToApply then
log("D", "", "set font: " .. ffi.string(ui_imgui.IoFontsGetName(index)))
if ffi.string(ui_imgui.IoFontsGetName(index)) == fontToApply then
log("D", "", "set font: " .. ffi.string(ui_imgui.IoFontsGetName(index)))
ui_imgui.SetDefaultFont(index)
@/lua/common/libs/luasocket/ltn12.lua
-- creates string source
function source.string(s)
if s then
@/lua/ge/extensions/editor/cameraBookmarks.lua
if addMark then
local val = ffi.string(newBookmarkName)
ffi.copy(newBookmarkName, "")
@/lua/ge/extensions/editor/tech/roadArchitect/render.lua
end
dbgDraw.drawTextAdvanced(p2, 'Join: [' .. ffi.string(r1.displayName) .. ' <-> ' .. ffi.string(r2.displayName) .. ']', textA, true, false, textB)
dbgDraw.drawTextAdvanced(p2, selectedLink.class, textA, true, false, textB)
end
dbgDraw.drawTextAdvanced(p2, 'Join: [' .. ffi.string(r1.displayName) .. ' <-> ' .. ffi.string(r2.displayName) .. ']', textA, true, false, textB)
dbgDraw.drawTextAdvanced(p2, selectedLink.class, textA, true, false, textB)
local pos = p + (jRoad.nodes[jNodeIdx].p - p) * 0.5
dbgDraw.drawTextAdvanced(pos, 'Join: [' .. ffi.string(r.displayName) .. ' <-> ' .. ffi.string(jRoad.displayName) .. ']', textA, true, false, textB)
dbgDraw.drawTextAdvanced(pos, selectedJct.class, textA, true, false, textB)
local pos = p + (jRoad.nodes[jNodeIdx].p - p) * 0.5
dbgDraw.drawTextAdvanced(pos, 'Join: [' .. ffi.string(r.displayName) .. ' <-> ' .. ffi.string(jRoad.displayName) .. ']', textA, true, false, textB)
dbgDraw.drawTextAdvanced(pos, selectedJct.class, textA, true, false, textB)
@/lua/vehicle/powertrain/electricMotor.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/vehicle/powertrain/viscousClutch.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/util/vehicleRopeDebug.lua
if im.InputText("Material Name", materialNamePtr) then
selectedRope.materialName = ffi.string(materialNamePtr)
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/parkingspot.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/textEditor.lua
if imgui.Button("Ok") then
objectHistoryActions.changeObjectFieldWithUndo(instance.objIds, instance.fieldName, ffi.string(instance.textInput), 0)
editor.hideWindow(wndName)
@/lua/vehicle/protocols.lua
protocol.dtSim = 0
local data = ffi.string(protocol.packet, protocol.packetSize)
protocol.udpSocket:sendto(data, protocol.ip, protocol.port)
@/lua/ge/extensions/editor/flowgraph/projectSettings.lua
local oldName = self.mgr.name
self.mgr.name = ffi.string(self.mgrNameField)
self.fgEditor.addHistory("Changed project name from " .. oldName .. " to " ..self.mgr.name, false)
if editor.uiInputTextMultiline('##prDesc', textinput, 512,im.ImVec2(im.GetContentRegionAvailWidth(),100), nil, nil, nil, editEnded) then
self.mgr.description = ffi.string(textinput)
end
local oldName = self.mgr.authors
self.mgr.authors = ffi.string(self.mgrAuthorField)
self.fgEditor.addHistory("Changed project Author from " .. oldName .. " to " ..self.mgr.authors, false)
@/lua/ge/extensions/editor/crawlEditor/waypoints.lua
editor.history:commitAction("Change Name of Pathnode",
{index = index, old = pathnode.name, new = ffi.string(pathnodeNameText), field = 'name', self = self},
setFieldUndo, setFieldRedo)
if editEnded[0] then
fields.values[name] = ffi.string(self.fields[name])
end
if im.Button("New String") then
fields:add(ffi.string(self.addFieldText),'string',"value")
self.addFieldText = im.ArrayChar(256,"")
if im.Button("New Number") then
fields:add(ffi.string(self.addFieldText),'number',0)
self.addFieldText = im.ArrayChar(256,"")
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
if editor.uiInputText("Name##ctrlDefinitionTypes", ctrlDefinitionTypeName, nil, im.InputTextFlags_EnterReturnsTrue) then
local name = ffi.string(ctrlDefinitionTypeName)
signalCtrlDefinitions.types[name] = signalCtrlDefinitions.types[currName]
if editor.uiInputText("Name##ctrlDefinitionState", ctrlDefinitionStateName, nil, im.InputTextFlags_EnterReturnsTrue) then
local name = ffi.string(ctrlDefinitionStateName)
signalCtrlDefinitions.states[name] = signalCtrlDefinitions.states[currName]
if ctrlDefinitionStateName then
selected.ctrlDefState = arrayFindValueIndex(signalCtrlDefinitions.statesSorted, ffi.string(ctrlDefinitionStateName)) or 1
else
if ctrlDefinitionTypeName then
selected.ctrlDefType = arrayFindValueIndex(signalCtrlDefinitions.typesSorted, ffi.string(ctrlDefinitionTypeName)) or 1
else
if editor.uiInputText("Name##instance", signalName, nil, im.InputTextFlags_EnterReturnsTrue) then
renameSignal(currInstance, ffi.string(signalName))
end
if editor.uiInputText("Name##controller", ctrlName, nil, im.InputTextFlags_EnterReturnsTrue) then
currController.name = ffi.string(ctrlName)
end
if editor.uiInputText("Name##sequence", sequenceName, nil, im.InputTextFlags_EnterReturnsTrue) then
currSequence.name = ffi.string(sequenceName)
end
@/lua/ge/extensions/gameplay/rally/client.lua
url = uri,
source = ltn12.source.string(reqbody),
headers = {
@/lua/ge/extensions/editor/tech/roadArchitect/roads.lua
rCopy.name = r.name
rCopy.displayName = im.ArrayChar(32, ffi.string(r.displayName))
rCopy.profile = profileMgr.copyProfile(r.profile)
local roadA = createRoadFromProfile(profile)
roadA.displayName = im.ArrayChar(32, ffi.string(r.displayName) .. ' [A]')
roadA.nodes = copiedNodesA
local roadB = createRoadFromProfile(profileMgr.copyProfile(profile))
roadB.displayName = im.ArrayChar(32, ffi.string(r.displayName) .. ' [B]')
roadB.nodes = copiedNodesB
return {
displayName = ffi.string(r.displayName),
isVis = r.isVis[0],
@/lua/ge/extensions/editor/createObjectTool.lua
drawTextFilter()
if ffi.string(simObjectClassNameFilter) == '' then
searchResults = allClassesSearchResults
if searchChanged then
simObjectSearch:startSearch(ffi.string(simObjectClassNameFilter))
for i, clsName in ipairs(simObjectClassNames) do
@/ui/ui-vue/src/utils/colorUtils.js
* @param {string} hex - Hex color code (e.g. "#ff0000")
* @returns {string} RGB values as comma-separated string (e.g. "255, 0, 0")
*/
@/lua/ge/extensions/editor/cameraTransform.lua
if im.Button("GoTo") then
commands.setFreeCameraTransformJson(ffi.string(camTransfrom))
end
if im.Button("Copy") then
im.SetClipboardText(ffi.string(camTransfrom))
end
@/lua/ge/extensions/editor/dataBlockEditor.lua
editor.history:commitAction("CreateDataBlock",
{name = ffi.string(newDataBlockName), className = newDataBlockClass, copyID = dataBlockToCopyID}, createDataBlockActionUndo, createDataBlockActionRedo)
dataBlockToCopyID = nil
@/lua/ge/extensions/editor/audioRibbonEditor.lua
audioRibbon.clearAllSFXEmitters()
ribbon.emitters[1].eventNameStr = ffi.string(ambientEventBinding)
ribbon.emitters[2].eventNameStr = ffi.string(frontEventBinding)
ribbon.emitters[1].eventNameStr = ffi.string(ambientEventBinding)
ribbon.emitters[2].eventNameStr = ffi.string(frontEventBinding)
ribbon.emitters[3].eventNameStr = ffi.string(rearEventBinding)
ribbon.emitters[2].eventNameStr = ffi.string(frontEventBinding)
ribbon.emitters[3].eventNameStr = ffi.string(rearEventBinding)
ribbon.emitters[4].eventNameStr = ffi.string(rightEventBinding)
ribbon.emitters[3].eventNameStr = ffi.string(rearEventBinding)
ribbon.emitters[4].eventNameStr = ffi.string(rightEventBinding)
ribbon.emitters[5].eventNameStr = ffi.string(leftEventBinding)
ribbon.emitters[4].eventNameStr = ffi.string(rightEventBinding)
ribbon.emitters[5].eventNameStr = ffi.string(leftEventBinding)
end
im.InputText("###100" .. tostring(i), nameBinding, 128)
ribbon.name = ffi.string(nameBinding)
im.tooltip('Edit the name of this ribbon.')
@/lua/ge/extensions/flowgraph/nodes/util/customLua.lua
if editEnded[0] then
self.name = ffi.string(name)
change = "Changed name for custom lua node to " ..self.name
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)
self.status[code] = nil
if editEnded[0] then
self.code[code] = ffi.string(buff)
self.status[code] = nil
@/lua/ge/extensions/editor/crawlEditor/paths.lua
if editEnded[0] then
path.name = ffi.string(self.name)
markPathAsDirty(path)
if im.Button("Rename") then
local newFileName = ffi.string(self.fileName)
if newFileName ~= path._fileName and newFileName ~= "" then
if editEnded[0] then
path.description = ffi.string(self.description)
markPathAsDirty(path)
if nameEditEnded[0] then
self.currentPathnode.name = ffi.string(pathnodeName)
markPathAsDirty(path)
return (json and json.decode and json.decode(s)) or {}
end, ffi.string(flagsBuf))
if ok and type(decoded) == 'table' then
@/lua/ge/extensions/editor/audioEventsList.lua
local function updateSearchResults()
search:startSearch(ffi.string(eventSearchInput))
-- otherwise render search results
if #ffi.string(eventSearchInput) == 0 then
-- Get current directory
@/lua/ge/extensions/flowgraph/nodes/ui/missionEndScreen.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/resourceChecker.lua
if editor.uiInputSearch(nil, searchTxt, 400* im.uiscale[0]) then
if ffi.string(searchTxt) ~= nil then
searchFilter = true
if (foundi == false or foundd == false or foundao == false) and searchFilter == true then
if not string.match(string.lower(k), string.lower(ffi.string(searchTxt))) then
goto skipk
if (foundd == false or foundao == false) and searchFilter == true then
if not string.match(string.lower(i), string.lower(ffi.string(searchTxt))) then
foundi = true
if foundao == false and searchFilter == true then
if not string.match(string.lower(d), string.lower(ffi.string(searchTxt))) then
foundd = true
if searchFilter == true then
if not string.match(string.lower(o), string.lower(ffi.string(searchTxt))) then
foundao = true
for k,v in pairs(data) do
if searchFilter == true and not string.match(string.lower(v), string.lower(ffi.string(searchTxt))) then
skipK[k] = true
@/lua/vehicle/extensions/api.lua
url = uri,
source = ltn12.source.string(reqbody),
headers = {
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
@/lua/ge/extensions/flowgraph/nodes/ui/selectButtons.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/crawlEditor/startingPositions.lua
editor.history:commitAction("Change Starting Position Name",
{startingPosition = startingPosition, old = startingPosition.name, new = ffi.string(self.name), field = 'name'},
setFieldUndo, setFieldRedo)
if im.Button("Rename") then
local newFileName = ffi.string(self.fileName)
if newFileName ~= startingPosition._fileName and newFileName ~= "" then
editor.history:commitAction("Change Starting Position Description",
{startingPosition = startingPosition, old = startingPosition.description, new = ffi.string(self.description), field = 'description'},
setFieldUndo, setFieldRedo)
@/lua/ge/extensions/editor/bulkRename.lua
local matchInternalName = fieldToSearchPtr[0] == 1
local filterStr = ffi.string(imgui.TextFilter_GetInputBuf(filter))
if whatSetPtr[0] == 1 and filterStr ~= "" then
objectIds = Sim.findObjectsByNameMask(ffi.string(imgui.TextFilter_GetInputBuf(filter)), matchInternalName, useGeneratedNamePtr[0])
elseif whatSetPtr[0] == 0 then
local oldName = obj:getGeneratedDisplayName(matchInternalName)
name = generateNewName(oldName, ffi.string(renamePatternInput), counter)
previewNames[id] = {old = oldName, new = name}
updatePreview()
if ffi.string(imgui.TextFilter_GetInputBuf(filter)) == "" then
imgui.ImGuiTextFilter_Clear(filter)
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua
-- if editEnded[0] then
-- self.pacenoteToolsState.search = ffi.string(pacenotesSearchText)
-- local lang_data = newVal[language] or {}
-- local val = rallyUtil.trimString(ffi.string(buf))
@/lua/ge/extensions/core/ropeVisualTest.lua
windDrag = uiPtrs.windDrag[0],
materialName = materialNamePtr[0] ~= "" and ffi.string(materialNamePtr) or "",
windDrag = uiPtrs.windDrag[0],
materialName = materialNamePtr[0] ~= "" and ffi.string(materialNamePtr) or "",
rope.windDrag = uiPtrs.windDrag[0]
rope.materialName = materialNamePtr[0] ~= "" and ffi.string(materialNamePtr) or ""
rope.anchorAFixed = uiPtrs.anchorAFixed[0]
if im.Button("Save") then
local filePath = ffi.string(saveFilePathPtr)
if filePath ~= "" then
if im.Button("Load") then
local filePath = ffi.string(loadFilePathPtr)
if filePath ~= "" then
if im.InputText("Material Name", materialNamePtr) then
selectedRope.materialName = ffi.string(materialNamePtr)
end
@/lua/ge/extensions/editor/missionEditor/prefabs.lua
if editEnded[0] then
self.mission.prefabs[i] = ffi.string(prefab)
self.mission._dirty = true
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
if im.Button("Finish Editing") then
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
local oldVal = self.partConfig[field][old]
self.sortedKeys[field][i] = ffi.string(keyText)
self.partConfig[field][old] = nil
self.partConfig[field][old] = nil
self.partConfig[field][ffi.string(keyText)] = oldVal
end
if im.InputText("##inputValPart" .. i ..field, valText, nil, im.InputTextFlags_EnterReturnsTrue) then
self.partConfig[field][ffi.string(keyText)] = ffi.string(valText)
end
if im.InputText("##inputValPart" .. i ..field, valText, nil, im.InputTextFlags_EnterReturnsTrue) then
self.partConfig[field][ffi.string(keyText)] = ffi.string(valText)
end
if im.InputFloat("##inputValPart" .. i ..field, valNum, nil,nil,nil, im.InputTextFlags_EnterReturnsTrue) then
self.partConfig[field][ffi.string(keyText)] = valNum[0]
end
if editor.uiIconImageButton(editor.icons.add,im.ImVec2(20, 20)) then
self.partConfig[field][ffi.string(self._keyText)] = ffi.string(self._valText)
table.insert(self.sortedKeys[field], ffi.string(self._keyText))
if editor.uiIconImageButton(editor.icons.add,im.ImVec2(20, 20)) then
self.partConfig[field][ffi.string(self._keyText)] = ffi.string(self._valText)
table.insert(self.sortedKeys[field], ffi.string(self._keyText))
self.partConfig[field][ffi.string(self._keyText)] = ffi.string(self._valText)
table.insert(self.sortedKeys[field], ffi.string(self._keyText))
self._keyText = nil
if editor.uiIconImageButton(editor.icons.add,im.ImVec2(20, 20)) then
self.partConfig[field][ffi.string(self._keyText)] = self._valNum[0]
table.insert(self.sortedKeys[field], ffi.string(self._keyText))
self.partConfig[field][ffi.string(self._keyText)] = self._valNum[0]
table.insert(self.sortedKeys[field], ffi.string(self._keyText))
self._keyText = nil
@/lua/ge/extensions/editor/dynamicDecals/inspector/utils.lua
assert(payload.DataSize == 256)
local path = ffi.string(payload.Data)
layer[property] = path
@/lua/ge/extensions/editor/vehicleBridgeTest.lua
if im.InputText("Key", keyInput) then
key = ffi.string(keyInput)
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
local input = ffi.string(flexbodyInputTextInput)
local input = ffi.string(nodeInputTextInput)
local input = ffi.string(vertexInputTextInput)
@/lua/vehicle/powertrain/compressor.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/vehicle/powertrain/genericTorqueProvider.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/assetManagementTool.lua
if imgui.InputText("##selectionTartgetPath", inputTextNew, 2048) then
selectionTargetPath = ffi.string(inputTextNew)
end
if imgui.InputText("##newTxt" .. row, inputTextNew, 2048) then
record.targetPath = ffi.string(inputTextNew)
end
if imgui.InputText("##searchForDupesPath", inputTextNew, pathSize) then
searchForDuplicatesPath = ffi.string(inputTextNew)
end
if imgui.InputText("##searchNamingPath", inputTextNew, pathSize) then
searchNamingPath = ffi.string(inputTextNew)
end
if imgui.InputText("##delinkPath", inputTextNew, pathSize) then
delinkPath = ffi.string(inputTextNew)
end
if imgui.InputText("##relinkPath", inputTextNew, pathSize) then
relinkPath = ffi.string(inputTextNew)
end
@/lua/common/lpack.lua
local tsize = #tbl + 1 - (tbl[0] == nil and 1 or 0)
return ffi.string(ffi.new(daType, tsize, tbl), 8 * tsize)
end
@/lua/ge/extensions/editor/mapSensorEditor.lua
if im.Button("Copy to clipboard") then
setClipboard(ffi.string(pythonCodePtr))
end
@/lua/vehicle/powertrain/automaticGearbox.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/common/libs/copas/copas/ftp.lua
if body then
t.source = ltn12.source.string(body)
else
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local input = ffi.string(nodeInputTextInput)
local input = ffi.string(beamInputTextInput)
@/lua/ge/extensions/editor/barriersEditor.lua
if im.MenuItem1("Find for level " .. level) then
loadPrefabs(level, ffi.string(searchText))
end
@/lua/ge/extensions/flowgraph/nodes/types/string.lua
if im.InputTextMultiline("##mf" .. self.id, self.imText) then
self.string = ffi.string(self.imText)
reason = "Changed Text"
if im.InputText("##mf" .. self.id, self.imText, nil, im.InputTextFlags_EnterReturnsTrue) then
self.string = ffi.string(self.imText)
reason = "Changed Text"
@/lua/common/libs/luasocket/socket/http.lua
if b then
reqt.source = ltn12.source.string(b)
reqt.headers = {
@/lua/ge/extensions/gameplay/rally/loop/rallyLoopManager.lua
function C:formatTimeFromSecondsString(timeSecs, includeSeconds, includeTenths)
-- Helper to get formatted time as a display string (for debug drawing, etc.)
local timeTable = self:formatTimeFromSeconds(timeSecs, includeSeconds, includeTenths)
@/lua/ge/extensions/editor/dragRaceEditor/facilities.lua
if im.InputText("##facilityId", id, 256) then
facility.id = ffi.string(id)
utils.markUnsavedChanges()
if im.InputText("##facilityName", name, 256) then
facility.name = ffi.string(name)
utils.markUnsavedChanges()
if im.InputText("##facilityDescription", description, 512) then
facility.description = ffi.string(description)
utils.markUnsavedChanges()
@/lua/ge/extensions/editor/missionEditor/careerSetup.lua
self.mission._dirty = true
re.attributeKey = att or ffi.string(getBuffer(idx.."--"..key, re.attributeKey))
inputBuffers[idx.."--"..key] = nil
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, ""))
if addKey ~= "" then
@/lua/ge/extensions/editor/crawlEditor/presets.lua
if im.Button("Save") then
local name = ffi.string(self:getBoundaryPresetName())
if name and name ~= "" then
if im.Button("Save") then
local name = ffi.string(self:getPathnodePresetName())
if name and name ~= "" then
if im.Button("Save") then
local name = ffi.string(self:getTrailPresetName())
if name and name ~= "" then
@/lua/ge/extensions/ui/messagesDebugger.lua
if im.Button("Send Message") then
local msg = ffi.string(txtMsg)
local cat = ffi.string(txtCategory)
local msg = ffi.string(txtMsg)
local cat = ffi.string(txtCategory)
local icn = ffi.string(txtIcon)
local cat = ffi.string(txtCategory)
local icn = ffi.string(txtIcon)
_sendMessage(msg, ttlSeconds[0], cat, icn)
if im.Button("Send Binding Example") then
local cat = ffi.string(txtCategory)
local ex = "Press [action=switch_next_vehicle] to switch"
if im.Button("Clear Category") then
_clearCategory(ffi.string(txtCategory), useRegexClear[0])
end
if im.Button("Test 3 Messages") then
local cat = ffi.string(txtCategory)
_sendMessage("First test line", 3.0, cat .. ".1", "")
@/ui/lib/ext/angular-translate/angular-translate.js
* @param {string|object} value - value to be sanitized (either a string or an interpolated value map)
* @param {string} mode - either 'text' for a string (translation) or 'params' for the interpolated params
* @return {string|object}
@/lua/ge/extensions/editor/roadTemplateEditor.lua
if im.Button("Save") then
local name = ffi.string(saveName)
saveTemplate(name)
@/lua/ge/extensions/editor/api/assets.lua
assert(payload.DataSize == 2048)
local str = ffi.string(payload.Data)
if dragDropAsset.callback then dragDropAsset.callback(str) end
@/lua/ge/extensions/editor/slotTrafficEditor.lua
if roadFilterChanged then
roadFilterText = string.lower(ffi.string(im.ArrayChar(128, roadFilterText)))
end
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
--self.search:setFrecencyData({})
self.search:startSearch(ffi.string(self.searchText))
-- self.search:setSameScoreResolvingFunction(sortFun)
@/lua/ge/extensions/editor/tech/roadArchitect/profiles.lua
{
name = im.ArrayChar(32, ffi.string(layer.name)),
isHidden = layer.isHidden,
{
name = im.ArrayChar(32, ffi.string(layer.name)),
isHidden = layer.isHidden,
local pSer = {
name = ffi.string(p.name),
isDeletable = p.isDeletable,
{
name = ffi.string(lay.name),
isHidden = lay.isHidden,
for i = #profiles, 1, -1 do
if ffi.string(profiles[i].name) == 'Current Profile' then
table.remove (profiles, i)
local p = deserialiseProfile(serProfile)
p.name = im.ArrayChar(32, util.removeExtension(ffi.string(p.name)))
return p
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceEndScreen.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/masterSpline.lua
local preState = splineMgr.deepCopyMasterSpline(spline)
spline.name = ffi.string(splineNamePtr)
local statePost = splineMgr.deepCopyMasterSpline(spline)
else
im.TextColored(cols.dullWhite, ffi.string(splineNamePtr))
im.tooltip('This Master Spline is disabled.')
local preState = splineMgr.deepCopyMasterSpline(selSpline)
layer.name = ffi.string(layerNamePtr)
layer.isDirty = true
@/ui/lib/ext/angular-translate/angular-translate-beamng.js
* @param {string|object} value - value to be sanitized (either a string or an interpolated value map)
* @param {string} mode - either 'text' for a string (translation) or 'params' for the interpolated params
* @return {string|object}
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua
end
partsSearchTextCache = ffi.string(partsSearchText)
partsViewCount = 0
@/lua/ge/extensions/editor/dragRaceEditor/lanes.lua
if im.InputText("##laneId", id, 256) then
lane.id = ffi.string(id)
utils.markUnsavedChanges()
if im.InputText("##laneName", name, 256) then
lane.name = ffi.string(name)
utils.markUnsavedChanges()
if im.InputText("##laneShortName", shortName, 256) then
lane.shortName = ffi.string(shortName)
utils.markUnsavedChanges()
if im.InputText("##laneLongName", longName, 256) then
lane.longName = ffi.string(longName)
utils.markUnsavedChanges()
if im.InputText("##laneBoundaryId", boundaryId, 256) then
lane.boundaryId = ffi.string(boundaryId)
utils.markUnsavedChanges()
@/lua/ge/extensions/editor/flowgraph/search.lua
function C:getFilterType()
local match = string.lower(ffi.string(self.searchText))
for _, t in ipairs(tableKeys(typeOrder)) do
@/lua/ge/extensions/editor/toolUtilities/util.lua
local f3 = ffi.new("float[3]", {x, y, z})
table.insert(bin, ffi.string(f3, 12))
return byteLen + 12
local u16 = ffi.new("uint16_t[1]", i)
table.insert(bin, ffi.string(u16, 2))
return byteLen + 2
@/lua/ge/extensions/editor/missionEditor/general.lua
if editEnded[0] then
self.mission.name = ffi.string(self.nameText)
self._titleTranslated = nil
if editEnded[0] then
self.mission.description = ffi.string(self.descText)
self._descTranslated = nil
@/lua/common/tcpServer.lua
1. 4-byte Identifier:
- A fixed 4-character string ('BN01') used to identify and validate
the message format.
-- Send the header
connection:send(ffi.string(self.headerBuffer, headerSize))
@/lua/ge/extensions/editor/api/genericInspector.lua
if editor.uiInputSearchTextFilter("", self.fieldNameFilter, 200, nil, self.editEnded) then
if ffi.string(imgui.TextFilter_GetInputBuf(self.fieldNameFilter)) == "" then
imgui.ImGuiTextFilter_Clear(self.fieldNameFilter)
@/lua/vehicle/powertrain/electricServo.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/flowgraph/manager.lua
assert(payload.DataSize == 64)
local path = ffi.string(payload.Data)
end
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
local forbiddenName = false
local newName = ffi.string(terrainMtlCopyProxy.nameInput)
-- we have a new name
local oldMaterialName = terrainMtlCopyProxy.internalName
local materialName = ffi.string(terrainMtlCopyProxy.nameInput)
if im.InputText("##MaterialNameInput", terrainMtlCopyProxy.nameInput, nil, im.flags(im.InputTextFlags_CharsNoBlank)) then
local firstChar = tonumber(string.sub(ffi.string(terrainMtlCopyProxy.nameInput), 1, 1))
if firstChar and type(firstChar) == "number" then
@/lua/ge/extensions/editor/flowgraph/properties.lua
if editEnded[0] then
saveCallback(savePath, ffi.string(cdata[path]))
end
if item.onCustomNameChanged then
reason = item:onCustomNameChanged(ffi.string(self._editCustomProperties.name))
else
else
item.customName = ffi.string(self._editCustomProperties.name)
reason = "Changed custom name for " .. item.name
-- save name again in case enter has not been pressed
if item.customName ~= ffi.string(self._editCustomProperties.name) and item.name ~= ffi.string(self._editCustomProperties.name) then
if item.onCustomNameChanged then
-- save name again in case enter has not been pressed
if item.customName ~= ffi.string(self._editCustomProperties.name) and item.name ~= ffi.string(self._editCustomProperties.name) then
if item.onCustomNameChanged then
if item.onCustomNameChanged then
reason = item:onCustomNameChanged(ffi.string(self._editCustomProperties.name))
else
else
item.customName = ffi.string(self._editCustomProperties.name)
reason = "Changed custom name for " .. item.name
local oldName = pin.name
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
local oldName = pin.name
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
item.pinInLocal[oldName] = nil
local oldName = pin.name
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
local oldName = pin.name
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
if ffi.string(textinput) ~= '' and ffi.string(textinput):gsub("[%s]",""):len()~=0 then
pin.name = ffi.string(textinput)
item.pinOut[oldName] = nil
if im.Button("Save") then
self._editMultilineText.saveCallback(self._editMultilineText.savePath, ffi.string(self._editMultilineText.buf))
im.CloseCurrentPopup()
local oldName = k
self.mgr.macroTags[i] = ffi.string(textinput)
self.fgEditor.addHistory("Changed macro tag from " .. oldName .. " to " .. ffi.string(textinput))
self.mgr.macroTags[i] = ffi.string(textinput)
self.fgEditor.addHistory("Changed macro tag from " .. oldName .. " to " .. ffi.string(textinput))
end
local oldName = graph.name
graph.name = ffi.string(textinput)
local integratedNode = self.mgr:findIntegratedNode(graph)
if integratedNode then
integratedNode.name = ffi.string(textinput)
end
if editEnded[0] then
graph.description = ffi.string(textinput)
self.fgEditor.addHistory("Changed graph description ")
if im.Button("Add Tag Field") then
if ffi.string(self.macroTagField) ~= '' and ffi.string(self.macroTagField):gsub("[%s]",""):len()~=0 then
table.insert(self.mgr.macroTags,tag)
if im.Button("Add Tag Field") then
if ffi.string(self.macroTagField) ~= '' and ffi.string(self.macroTagField):gsub("[%s]",""):len()~=0 then
table.insert(self.mgr.macroTags,tag)
self.macroTagField = im.ArrayChar(128)
self.fgEditor.addHistory("Added tag " .. ffi.string(self.macroTagField) .. " to macro")
end
@/lua/ge/extensions/editor/assetBrowser.lua
var.newFolderParentDir = var.newFolderParentDir or var.selectedDirectory
local name = ffi.string(var.newFolderName)
local path = var.newFolderParentDir.path .. name
if im.Button("Save", im.ImVec2(var.saveFilterNameInputWidth, var.inputFieldSize)) then
if #ffi.string(var.saveFilterNameInput) > 0 then
local filterInput = ffi.string(im.TextFilter_GetInputBuf(var.assetViewFilter))
if #ffi.string(var.saveFilterNameInput) > 0 then
local filterInput = ffi.string(im.TextFilter_GetInputBuf(var.assetViewFilter))
local close = saveSearchFilter(ffi.string(var.saveFilterNameInput), filterInput)
local filterInput = ffi.string(im.TextFilter_GetInputBuf(var.assetViewFilter))
local close = saveSearchFilter(ffi.string(var.saveFilterNameInput), filterInput)
if close == true then im.CloseCurrentPopup() end
@/lua/ge/extensions/editor/crawlEditor/trails.lua
editor.history:commitAction("Change Trail Name",
{trail = trail, old = trail.name, new = ffi.string(self.name), field = 'name'},
setFieldUndo, setFieldRedo)
if im.Button("Rename") then
local newFileName = ffi.string(self.fileName)
if newFileName ~= trail._fileName and newFileName ~= "" then
editor.history:commitAction("Change Trail Description",
{trail = trail, old = trail.description, new = ffi.string(self.description), field = 'description'},
setFieldUndo, setFieldRedo)
editor.history:commitAction("Change Trail Thumbnail",
{trail = trail, old = trail.thumbnail, new = ffi.string(self.thumbnail), field = 'thumbnail'},
setFieldUndo, setFieldRedo)
editor.history:commitAction("Change Trail Preview",
{trail = trail, old = trail.preview, new = ffi.string(self.preview), field = 'preview'},
setFieldUndo, setFieldRedo)
if editEnded[0] then
trail.rules.description = ffi.string(self.rules)
markTrailAsDirty(trail)
@/lua/ge/extensions/editor/perfProfiler.lua
--self.search:setFrecencyData({})
search:startSearch(ffi.string(searchText))
-- self.search:setSameScoreResolvingFunction(sortFun)
if im.InputText("Name", metaEdit.name, 1024) then
metadataFile.meta.name = ffi.string(metaEdit.name)
end
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
editor.hideWindow(saveLayoutWindowName)
editor_layoutManager.saveWindowLayout(ffi.string(layoutName), vEditor.getEditorName())
end
editor.hideWindow(saveLayoutWindowName)
editor_layoutManager.saveWindowLayout(ffi.string(layoutName), vEditor.getEditorName())
end
@/lua/ge/extensions/editor/util/searchUtil.lua
--self.search:setFrecencyData({})
self:startSearch(ffi.string(self.searchText))
-- self.search:setSameScoreResolvingFunction(sortFun)
@/lua/ge/extensions/editor/missionEditor/startTrigger.lua
if editEnded[0] then
self.mission.startTrigger.level = ffi.string(self.fields.levelName)
self.mission._dirty = true
if editEnded[0] then
self.mission.startTrigger.level = ffi.string(self.fields.levelName)
self.mission._dirty = true
if editEnded[0] then
self.mission.startTrigger.level = ffi.string(self.fields.levelName)
self.mission._dirty = true
@/lua/ge/extensions/editor/camPathEditor.lua
'ChangePathField',
{ path = M.currentPath, field = 'name', oldValue = M.currentPath.name, newValue = ffi.string(pathNameField) },
changePathFieldActionUndo,
@/lua/ge/extensions/editor/techServerManager.lua
else
ip = ffi.string(openServerGuiData.ip)
end
@/lua/vehicle/powertrain/shaft.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/rendererComponents.lua
else
return ffi.string(tempCharPtr)
end
@/lua/ge/extensions/editor/raceEditor/tools.lua
editor.uiInputText("##lopath", shapeInputLeft, 1024, nil, nil, nil, editEnded)
if editEnded[0] then shapeNameLeft = ffi.string(shapeInputLeft) end
im.SameLine()
editor.uiInputText("##roPath", shapeInputRight, 1024, nil, nil, nil, editEnded)
if editEnded[0] then shapeNameRight = ffi.string(shapeInputRight) end
im.SameLine()
@/lua/ge/extensions/editor/missionEditor/dev.lua
if editEnded[0] then
self.mission.devNotes.text = ffi.string(self.devText)
self.mission._dirty = true
@/ui/lib/ext/angular-material/angular-material.js
// Take resolve values and invoke them.
// Resolves can either be a string (value: 'MyRegisteredAngularConst'),
// or an invokable 'factory' of sorts: (value: function ValueGetter($dependency) {})
/**
* Replace `{{` and `}}` in a string (usually a template) with the actual start-/endSymbols used
* for interpolation. This allows pre-defined templates (for components such as dialog, toast etc)
@/inspector/Views/TextEditor.js
get string()
{
set string(newString)
{
@/lua/ge/extensions/editor/missionEditor/layers.lua
if editEnded[0] then
layer.dir = ffi.string(self.inputs[i].text)
self.mission._dirty = true
@/lua/vehicle/powertrain/dctGearbox.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/missionEditor/additionalAttributes.lua
if editEnded[0] then
self.mission.author = ffi.string(self.authorInput)
self.mission._dirty = true
if editEnded[0] then
self.mission.grouping.id = ffi.string(self.groupIdInput)
self.mission._dirty = true
if editEnded[0] then
self.mission.grouping.label = ffi.string(self.groupLabelInput)
self._groupLabelTranslated = nil
@/lua/vehicle/powertrain/linearActuator.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
if im.Button("Finish Editing") then
local progressString = ffi.string(self._text[1])
local state, newProgress = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
@/lua/vehicle/powertrain/manualGearbox.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
if e.displayOptions.optional then return end
local file = ffi.string(e.ac)
local foundFile = file ~= "" and (FS:fileExists(file) or FS:fileExists(m.missionFolder..'/'..file))
if not e._translated then
e._translated = translateLanguage(ffi.string(e.ac), noTranslation)
end
im.Columns(1)
if editEnded[0] then e._translated = nil mtd[e.fieldName] = ffi.string(e.ac) return true end
return false
if editEnded[0] then
mtd[e.fieldName] = ffi.string(e.ac)
e.foundFile = nil
end im.SameLine()
local file = ffi.string(e.ac)
if e.foundFile == nil then
editor_raceEditor.show()
editor_raceEditor.loadRace(ffi.string(e.ac))
end
editor_raceEditor.show()
editor_raceEditor.saveRace(nil, ffi.string(e.ac))
e.foundFile = nil
end
im.tooltip("Saves to " .. ffi.string(e.ac))
end
editor_sitesEditor.show()
editor_sitesEditor.loadSites(ffi.string(e.ac))
end
editor_sitesEditor.show()
editor_sitesEditor.saveSites(nil, ffi.string(e.ac))
e.foundFile = nil
end
im.tooltip("Saves to " .. ffi.string(e.ac))
end
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
lo('?? aaa:'..tostring(vertices[2]))
-- local s = ffi.string(vertices)
]]
-- binstr = ffi.string(vertices) --dataString:get())
-- print('?? CHAR:'..string.byte(binstr, 3)) -- string.len(binstr)))
-- mime.decode(res, "base64")
-- local s = ffi.string(dataString:get()) --res)
-- lo('?? ss:'..string.sub(res, 1, 100))
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenWhole.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/forestEditor.lua
if im.InputText("##" .. item.internalName .. "_inputText_FB_" .. tostring(item.id), var.editingNameCharPtr, nil, im.InputTextFlags_EnterReturnsTrue) then
local internalName = ffi.string(var.editingNameCharPtr)
if internalName ~= item.internalName then
assert(payload.DataSize == 2048)
local data = ffi.string(payload.Data)
local path, filepath, extension = path.split(data)
if im.InputText("##shapeFile", shapeFileInputTextValue, nil, im.InputTextFlags_EnterReturnsTrue) then
return {fieldValue = ffi.string(shapeFileInputTextValue), editEnded = true}
end
@/lua/ge/extensions/editor/sidewalkSpline.lua
if im.InputText("###" .. tostring(wCtr), splineNamePtr, 32) then
spline.name = ffi.string(splineNamePtr)
if spline.sceneTreeFolderId then
@/lua/common/utils/httpJsonServer.lua
end
local srcSink = ltn12.source.string(jsonEncode(reply))
local sink = socket.sink('close-when-done', c)
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
if editor.uiInputFile("Vehicle Group##traffic", self.trafficCustomGroupInput, nil, nil, {{"Vehicle group files", ".vehGroup.json"}}, im.InputTextFlags_EnterReturnsTrue) then
setupModule.customGroupFile = ffi.string(self.trafficCustomGroupInput)
self.mission._dirty = true
@/ui/lib/ext/angular/angular.js
* * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year
* * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')
* * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')
* * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')
* * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')
*
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a
* valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
* (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5
* @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be
* a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
* (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5
*
* When used with standard inputs, the view value will always be a string (which is in some cases
* parsed into another type, such as a `Date` object for `input[date]`.)
@/lua/ge/extensions/editor/flowgraph/references.lua
for k, v in pairs(self.nodeTable) do
if string.find(k, ffi.string(self.searchText)) then
table.insert(res, { nodeName = k, nodeData = v })
if v.displayName == node.name then
if string.find(k, ffi.string(self.searchText)) then
table.insert(res, { nodeName = k, nodeData = v })
if v.amount == 0 then
if string.find(k, ffi.string(self.searchText)) then
table.insert(res, { nodeName = k, nodeData = v })
if im.InputText("##findReferenceByName", self.searchText, nil) then
im.TextUnformatted('Looking for ' .. ffi.string(self.searchText) .. ' ....')
im.SameLine()
self:highlightText(tostring(n.nodeName), string.lower(ffi.string(self.searchText)))
im.TableNextColumn()
@/lua/ge/extensions/editor/drivePathEditor.lua
if im.InputText("###" .. tostring(wCtr), splineNamePtr, 32) then
spline.name = ffi.string(splineNamePtr)
end
@/lua/ge/extensions/editor/inspector.lua
if editor.uiInputSearchTextFilter("##fieldNameSearchFilter", inspectorInfo.fieldNameFilter, 200, nil, ctx.editEnded) then
if ffi.string(imgui.TextFilter_GetInputBuf(inspectorInfo.fieldNameFilter)) == "" then
imgui.ImGuiTextFilter_Clear(inspectorInfo.fieldNameFilter)
-- if dynamic field value is changed and the value it's not empty string then update it
if editor.uiInputText(fieldNameId, ctx.inputTextValue, imgui.ArraySize(ctx.inputTextValue), nil, nil, nil, ctx.editEnded) and ctx.editEnded[0] and ffi.string(ctx.inputTextValue) ~= "" then
fieldValue = ffi.string(ctx.inputTextValue)
if editor.uiInputText(fieldNameId, ctx.inputTextValue, imgui.ArraySize(ctx.inputTextValue), nil, nil, nil, ctx.editEnded) and ctx.editEnded[0] and ffi.string(ctx.inputTextValue) ~= "" then
fieldValue = ffi.string(ctx.inputTextValue)
setMultiSelectionDynamicFieldValue(valueInspector.selectedIds, dynFields[i], fieldValue, arrayIndex)
if wantsToAddField then
local fieldValue = ffi.string(ctx.newFieldName)
setMultiSelectionDynamicFieldValue(valueInspector.selectedIds, fieldValue, "0", arrayIndex)
@/lua/ge/extensions/editor/gen/world.lua
local terrBlockName = ffi.string(terrainImpExp.terrainName)
for tbName, tbData in pairs(terrainBlockProxies) do
terrainImpExp.heightScale[0],
ffi.string(terrainImpExp.holeMapTexture),
materials, terrainImpExp.textureMaps,
@/lua/ge/extensions/editor/roadArchitect.lua
util.drawSphereHighlightRed(p1)
util.drawAutoJctMarkup(p1, ffi.string(r.displayName), 'start')
end
util.drawSphereHighlightRed(p2)
util.drawAutoJctMarkup(p2, ffi.string(r.displayName), 'end')
end
serPlacedGroups[i] = {
name = ffi.string(placedGroups[i].name),
list = {} }
local pCopy = profileMgr.copyProfile(profileMgr.profiles[i])
pCopy.name = im.ArrayChar(32, ffi.string(pCopy.name) .. ' [copy]')
profileMgr.profiles[#profileMgr.profiles + 1] = pCopy
local numLanes = numLeft + numRight
if editor.beginWindow(win.profileEditWinName, "Template Editor - [" .. tostring(ffi.string(profile.name)) .. "]###1113", im.WindowFlags_NoCollapse) then
local wCtr = 1
serPlacedGroups[i] = {
name = ffi.string(placedGroups[i].name),
list = {} }
@/lua/ge/extensions/editor/raceEditor/timeTrials.lua
if editEnded[0] then
self:changeField("name",ffi.string(nameText))
end
if editEnded[0] then
self:changeField("description",ffi.string(descText))
end
if editEnded[0] then
self:changeField("authors",ffi.string(authorsText))
end
local newPrefabs = deepcopy(self.path[fieldName])
newPrefabs[i] = ffi.string(filenameList[i])
self:changeField(fieldName, newPrefabs,"changed entry")
@/lua/vehicle/powertrain/torqueConverter.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/multiSpawnManager.lua
if edited[0] then
currGroup.name = ffi.string(imValues.groupName)
commonGroups[options.groupListIdx].name = currGroup.name
if im.Button("Add Tag##editGroup") then
local tagName = ffi.string(imValues.tagName)
if tagName ~= "" and not arrayFindValueIndex(currGroup.tags, tagName) then
@/lua/ge/extensions/util/export.lua
end
-- writeFile("test.b64", ffi.string(res))
buffer.uri = base64Prefix .. res
-- ffi buffer
f:write(ffi.string(v.data, v.len))
elseif type(v.data) == 'string' then
@/lua/ge/extensions/editor/sceneTree.lua
cameraPositionCache = core_camera.getPosition()
nameFilterText = ffi.string(imgui.TextFilter_GetInputBuf(instance.nameFilter))
applyFilterRecursive(instance, node)
if editingNodeName then
local newName = ffi.string(inputTextValue)
local object = scenetree.findObjectById(editingNodeName.id)
if editEnded[0] or (not imgui.IsItemActive() and not node.setFocus) then
local newName = ffi.string(inputTextValue)
local object = scenetree.findObjectById(node.id)
if editor.uiInputSearchTextFilter("##nodeNameSearchFilter", instance.nameFilter, searchFilterWidth, nil, nil, editEnded) then
if ffi.string(imgui.TextFilter_GetInputBuf(instance.nameFilter)) == "" then
imgui.ImGuiTextFilter_Clear(instance.nameFilter)
@/lua/common/libs/luasocket/socket/ftp.lua
local putt = parse(u)
putt.source = ltn12.source.string(body)
return tput(putt)
@/lua/ge/extensions/editor/iconOverview.lua
if editor.uiInputSearchTextFilter("##iconFilter", filter, imgui.GetContentRegionAvailWidth(), nil, editEnded) then
if ffi.string(imgui.TextFilter_GetInputBuf(filter)) == "" then
imgui.ImGuiTextFilter_Clear(filter)
@/lua/ge/extensions/editor/trafficManager.lua
if editor.uiInputFile("Vehicle Group##trafficManager", options.vehicleGroupFile, nil, nil, {{"Vehicle group files", ".vehGroup.json"}}, im.InputTextFlags_EnterReturnsTrue) then
local tempVehGroup = jsonReadFile(ffi.string(options.vehicleGroupFile))
if tempVehGroup and tempVehGroup.data then
local vehGroup
local vehGroupFile = ffi.string(options.vehicleGroupFile)
if vehGroupFile:len() > 0 then
if editor.uiInputText("Name##trafficManagerVehicle", options.vehicleName, nil, im.InputTextFlags_EnterReturnsTrue) then
local tempName = ffi.string(options.vehicleName)
if not scenetree.findObject(tempName) then -- transfer vehicle data to new table
if editor.uiInputText("Class##trafficManagerVehicle", options.vehicleClass, nil, im.InputTextFlags_EnterReturnsTrue) then
sessionData.class = ffi.string(options.vehicleClass)
end
if editor.uiInputFile("ScriptAi File##trafficManagerAi", options.aiData.scriptFile, nil, nil, {{"ScriptAI Recordings", {".track.json", ".json"}}}, im.InputTextFlags_EnterReturnsTrue) then
sessionData.aiData.scriptFile = ffi.string(options.aiData.scriptFile)
edited = true
if editor.uiInputFile("Flowgraph File##trafficManagerAi", options.aiData.flowgraphFile, nil, nil, {{"Flowgraphs", {".flow.json"}}}, im.InputTextFlags_EnterReturnsTrue) then
sessionData.aiData.flowgraphFile = ffi.string(options.aiData.flowgraphFile)
sessionData._tempData.varCurrentId = nil
if editor.uiInputText("Session Name##trafficManager", options.sessionName, nil, im.InputTextFlags_EnterReturnsTrue) then
session.name = ffi.string(options.sessionName)
end
if editor.uiInputText("Author##trafficManager", options.sessionAuthor, nil, im.InputTextFlags_EnterReturnsTrue) then
session.author = ffi.string(options.sessionAuthor)
end
if editor.uiInputTextMultiline("Description##trafficManager", options.sessionDescription, 4096, im.ImVec2(0, 80 * im.uiscale[0])) then
session.description = ffi.string(options.sessionDescription)
end
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
if editor.uiInputText("Population Attribute##"..e._id.."popAttr", popAttrPtr, 64) then
e.popAttribute = ffi.string(popAttrPtr)
-- Filter config saved to additionalAttributes, not ctd
@/lua/ge/extensions/editor/rallyEditor/pacenotes/customForm.lua
if editEnded[0] then
pacenote:setCustomAudioFile(ffi.string(audioFileText))
end
if editEnded[0] then
pacenote:setCustomDescription(ffi.string(descriptionText))
end
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
function C:getFilterType()
local match = string.lower(ffi.string(self.searchText))
for _, t in ipairs(tableKeys(typeOrder)) do
im.PushStyleColor2(im.Col_ScrollbarGrabActive, im.GetStyleColorVec4(im.Col_SliderGrabActive))
if ffi.string(self.searchText) == '' then
self:drawContentAsTreeNodes(menuPos)
@/lua/common/libs/luasec/https.lua
if body then
url.source = ltn12.source.string(body)
url.headers = {
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imDialogue.lua
if im.InputText("##btn" .. i .. '_' .. self.id, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/missionEditor.lua
if missionSearchDisplayResult then
im.HighlightSelectable(name, ffi.string(missionSearchTxt), clickedMission == missionData)
else
local function applySearch()
local s = ffi.string(missionSearchTxt)
missionSearchDisplayResult = s:len() > 0
local id = ffi.string(newMissionData.id)
-- check if the id is already taken
if newMissionData.recalcId then
local name = ffi.string(newMissionData.name)
name = name:match("(.-) ") or name
local data = {
name = ffi.string(newMissionData.name),
id = ffi.string(newMissionData.id),
name = ffi.string(newMissionData.name),
id = ffi.string(newMissionData.id),
missionType = newMissionData.type,
local translation = {}
local prefix = ffi.string(translationData.translationKeyPtr)
local instance = gameplay_missions_missions.getMissionById(clickedMission.id)
if elem.type == 'string' then
table.insert(translation,{key = prefix.."."..elem.fieldName, value = ffi.string(elem.ac), source = elem})
end
if elem.type == 'string' then
table.insert(translation,ffi.string(elem.ac))
end
@/lua/ge/extensions/editor/terrainEditor.lua
assert(payload.DataSize == 2048)
local path = ffi.string(payload.Data)
updateMap(mtlProxy, map, path)
local createNewTerrainBlock = true
local terrBlockName = ffi.string(terrainImpExp.terrainName)
local heightMapTexturePath = ffi.string(terrainImpExp.heightMapTexture)
local terrBlockName = ffi.string(terrainImpExp.terrainName)
local heightMapTexturePath = ffi.string(terrainImpExp.heightMapTexture)
success = terrBlock:importMaps(heightMapTexturePath, terrainImpExp.metersPerPixel[0], terrainImpExp.heightScale[0], ffi.string(terrainImpExp.holeMapTexture), materials, terrainImpExp.textureMaps, terrainImpExp.flipYAxis[0])
local function terrainExporter_Accept()
local dir = ffi.string(terrainImpExp.exportPath)
if #dir == 0 then
data.name = ffi.string(terrainImpExp.terrainName)
data.type = "TerrainData"
data.pos = {x = terrainImpExp.transformPos.x[0], y = terrainImpExp.transformPos.y[0], z = terrainImpExp.transformPos.z[0]}
data.heightMapPath = ffi.string(terrainImpExp.heightMapTexture)
data.holeMapPath = ffi.string(terrainImpExp.holeMapTexture)
data.heightMapPath = ffi.string(terrainImpExp.heightMapTexture)
data.holeMapPath = ffi.string(terrainImpExp.holeMapTexture)
data.opacityMaps = {}
@/lua/ge/extensions/editor/toolUtilities/meshAuditionMgr.lua
im.Columns(1, "meshSelectListboxColumns")
local filterStr = ffi.string(meshFilterBuf):lower()
local wCtr = 6345
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua
local directoryToBeautify = ffi.string(directoryToBeautifyPtr)
local beautiftyEnabled = directoryToBeautify ~= ''
@/lua/ge/extensions/editor/raceEditor/pathnodes.lua
editor.history:commitAction("Change Name of Node",
{index = self.index, self = self, old = node.name, new = ffi.string(nameText), field = 'name'},
setFieldUndo, setFieldRedo)
setFieldUndo, setFieldRedo)
--node.name = ffi.string(nameText)
end
if editEnded[0] then
fields.values[name] = ffi.string(self.fields[name])
end
if im.Button("New String") then
fields:add(ffi.string(self.addFieldText),'string',"value")
self.addFieldText = im.ArrayChar(256,"")
if im.Button("New Number") then
fields:add(ffi.string(self.addFieldText),'number',0)
self.addFieldText = im.ArrayChar(256,"")
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/missionEditor/progressSetup.lua
if im.Button("Finish Editing") then
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
@/lua/common/utils/simpleHttpServer.lua
local response = handle(request)
local srcSink = ltn12.source.string(response)
local sink = socket.sink('close-when-done', c)
@/lua/vehicle/powertrain/cvtGearbox.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
local size = tex:getSize()
local format = ffi.string(tex:getFormat())
if not powerOfTwo(size.x) or not powerOfTwo(size.y) then
@/lua/ge/extensions/core/audioRibbon.lua
emitter:setTransform(MatrixF(true))
emitter:setField("track", 0, ffi.string(eventName))
emitter.canSave = false
@/lua/ge/extensions/editor/dragRaceEditor/strips.lua
if im.InputText("##stripId", id, 256) then
strip.id = ffi.string(id)
utils.markUnsavedChanges()
if im.InputText("##stripName", name, 256) then
strip.name = ffi.string(name)
utils.markUnsavedChanges()
if im.InputText("##stripDescription", description, 512) then
strip.description = ffi.string(description)
utils.markUnsavedChanges()
if im.InputText("##laneId", id, 256) then
lane.id = ffi.string(id)
utils.markUnsavedChanges()
if im.InputText("##laneName", name, 256) then
lane.name = ffi.string(name)
utils.markUnsavedChanges()
if im.InputText("##laneShortName", shortName, 256) then
lane.shortName = ffi.string(shortName)
utils.markUnsavedChanges()
if im.InputText("##laneLongName", longName, 256) then
lane.longName = ffi.string(longName)
utils.markUnsavedChanges()
if im.InputText("##boundaryId", boundaryId, 256) then
lane.boundary.id = ffi.string(boundaryId)
utils.markUnsavedChanges()
if im.InputText("##boundaryName", boundaryName, 256) then
lane.boundary.name = ffi.string(boundaryName)
utils.markUnsavedChanges()
if im.InputText("##boundaryDescription", boundaryDescription, 512) then
lane.boundary.description = ffi.string(boundaryDescription)
utils.markUnsavedChanges()
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
assert(payload.DataSize == 256)
local path = ffi.string(payload.Data)
api.setDecalTexturePath(type, path)
@/lua/ge/extensions/flowgraph/nodes/ui/endScreen.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/roadSpline.lua
if im.InputText("###" .. tostring(wCtr), splineNamePtr, 32) then
group.name = ffi.string(splineNamePtr)
if group.sceneTreeFolderId then
local preState = groupMgr.deepCopyGroup(selGroup)
layer.name = ffi.string(layerNamePtr)
layerMgr.removeDecalRoadInLayer(layer)
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
if im.SmallButton('save##saveLayouy') then
local baseFilename = ffi.string(saveFilenameFFI)
local layoutFilename = saveFolder .. baseFilename .. '.vehicleDetailSetting.json'
@/lua/ge/extensions/editor/dragRaceEditor/dragSettings.lua
if im.InputText("##context", context, 256) then
dragSettings.context = ffi.string(context)
utils.markUnsavedChanges()
if im.InputText("##stripId", stripId, 256) then
dragSettings.stripId = ffi.string(stripId)
utils.markUnsavedChanges()
if im.InputText("##facilityId", facilityId, 256) then
dragSettings.facilityId = ffi.string(facilityId)
utils.markUnsavedChanges()
if im.InputText("##phaseName", phaseName, 256) then
phase.name = ffi.string(phaseName)
utils.markUnsavedChanges()
if im.InputText("##christmasTreePath", christmasTreePath, 512) then
dragSettings.prefabs.christmasTree.prefabPath = ffi.string(christmasTreePath)
utils.markUnsavedChanges()
if im.InputText("##displaySignPath", displaySignPath, 512) then
dragSettings.prefabs.displaySign.prefabPath = ffi.string(displaySignPath)
utils.markUnsavedChanges()
if im.InputText("##pathsPath", pathsPath, 512) then
dragSettings.prefabs.paths.prefabPath = ffi.string(pathsPath)
utils.markUnsavedChanges()
if im.InputText("##decorationsPath", decorationsPath, 512) then
dragSettings.prefabs.decorations.prefabPath = ffi.string(decorationsPath)
utils.markUnsavedChanges()
if im.InputText("##context", context, 256) then
dragSettings.context = ffi.string(context)
utils.markUnsavedChanges()
if im.InputText("##facilityId", facilityId, 256) then
dragSettings.facilityId = ffi.string(facilityId)
utils.markUnsavedChanges()
if im.InputText("##stripId", stripId, 256) then
dragSettings.stripId = ffi.string(stripId)
utils.markUnsavedChanges()
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
csv:add('connection', nil, 'Ping Time', tostring(pingTime[0]), 'number', nil, nil, nil)
csv:add('connection', 'otherUDP', 'IP', ffi.string(sIP), 'string', nil, nil, nil)
csv:add('connection', 'otherUDP', 'port', tostring(sPort[0]), 'number', nil, nil, nil)
csv:add('connection', 'otherUDP', 'port', tostring(sPort[0]), 'number', nil, nil, nil)
csv:add('connection', 'beamngUDP', 'IP', ffi.string(rIP), 'string', nil, nil, nil)
csv:add('connection', 'beamngUDP', 'port', tostring(rPort[0]), 'number', nil, nil, nil)
if d[2] == 'otherUDP' then
if d[3] == 'IP' then udpSendIP = ffi.string(im.ArrayChar(128, d[4])) or '127.0.0.1' end
if d[3] == 'port' then udpSendPort = tonumber(d[4]) end
if d[2] == 'beamngUDP' then
if d[3] == 'IP' then udpReceiveIP = ffi.string(im.ArrayChar(128, d[4])) or '127.0.0.1' end
if d[3] == 'port' then udpReceivePort = tonumber(d[4]) end
@/lua/ge/extensions/editor/flowgraph/main.lua
local dec
local status, err, res = xpcall(function() dec = lpack.decode(ffi.string(im.GetClipboardText())) end, debug.traceback)
if dec then
local nameTaken = false
local ffiName = ffi.string(self.quickAccessTextfield)
for _, node in pairs(self.mgr.graph.nodes) do
pin.quickAccess = true
pin.accessName = ffi.string(self.quickAccessTextfield)
im.CloseCurrentPopup()
@/lua/vehicle/powertrain/splitShaft.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/location.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/ui/console.lua
local function runFilter(newEntry)
invalidOriginFilter = not checkPattern(ffi.string(originFilterImC):lower())
if invalidOriginFilter then return end
if invalidOriginFilter then return end
local origFilter = ffi.string(originFilterImC):lower()
local r
-- invalidOriginFilter = checkPattern(ffi.string(originFilterImC))
-- im.PushItemWidth(260)
filterCur = dumps(levelFilter) .. ffi.string(originFilterImC)
if filterCur ~= filterOld then
previouslyShown = nil
local cmd = ffi.string(consoleInputField)
if string.len(cmd) > 0 then
d.windowOpen = windowOpen[0]
d.originFilter = ffi.string(originFilterImC)
local tmp = ffi.string(consoleInputField)
d.originFilter = ffi.string(originFilterImC)
local tmp = ffi.string(consoleInputField)
if tmp and string.len(tmp) >0 then
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
if im.Button("Copy to clipboard") then
setClipboard(ffi.string(pythonCodePtr))
end
@/lua/ge/extensions/editor/api/gui.lua
res.size = res.tex:getSize()
res.format = ffi.string(res.tex:getFormat())
return res
local style = imgui.GetStyle()
local dispErase = ffi.string(text):len() > 0
local uiScale = ui_imgui.GetIO().FontGlobalScale --editor.getPreference("ui.general.scale")
local function uiInputSearchTextFilter(label, txtfilter, width, extra_flags, editEnded)
local text = imgui.ArrayChar(256, ffi.string(imgui.TextFilter_GetInputBuf(txtfilter)))
local res = uiInputSearch(label, text, width, extra_flags, editEnded)
if res then
imgui.TextFilter_SetInputBuf(txtfilter, ffi.string(text))
imgui.ImGuiTextFilter_Build(txtfilter)
if not dir then
dir = path.split(ffi.string(buf)) or "/"
end
{
name = ffi.string(imgui.IoFontsGetName(i))
})
else
return ffi.string(tempCharPtr)
end
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenBegin.lua
if im.InputText("##btn" .. i, txt, nil, im.InputTextFlags_EnterReturnsTrue) then
if ffi.string(txt) == '' then
remove = i
else
self.options[i] = ffi.string(txt)
reason = "renamed button to" .. self.options[i]
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
assert(payload.DataSize == 256)
local path = ffi.string(payload.Data)
property.value = path
@/lua/ge/extensions/flowgraph/basenode.lua
--self.graph.subGraphName = ffi.string(self.graphName)
self.mgr:createSubgraphFromSelection(false)
self.mgr:createSubgraphFromSelection(false)
editor_flowgraphEditor.addHistory("Created subgraph " .. ffi.string(self.graphName))
im.CloseCurrentPopup()
comment:updateEditorPosition()
comment.commentTitle = ffi.string(self._commentInput)
if comment.commentTitle == "" then comment.commentTitle = "Comment" end
@/lua/ge/extensions/editor/fileDialog.lua
if im.InputText("##filepath", pathPointer, nil, im.InputTextFlags_EnterReturnsTrue) then
local newPath = ffi.string(pathPointer)
if FS:directoryExists(newPath) then
if createNewDir then
local dirName = ffi.string(textinputNewFolder)
if #dirName <= 0 then
if im.Button("Create") or createNow then
local crtPath = ffi.string(pathPointer)
local newPath = crtPath .. ffi.string(textinputNewFolder)
local crtPath = ffi.string(pathPointer)
local newPath = crtPath .. ffi.string(textinputNewFolder)
if string.match(ffi.string(textinputNewFolder), "^%s*$") then
local newPath = crtPath .. ffi.string(textinputNewFolder)
if string.match(ffi.string(textinputNewFolder), "^%s*$") then
im.OpenPopup("Error##FileDialog_ErrorPopup")
end
if ffi.string(textinputNewFolder) == "" then
editor.logWarn("Input a valid name for the new folder in the File Dialog")
fNameInput = ffi.string(textinput)
fNameInputLength = #fNameInput
smartSearchWindowSize = im.ImVec2(width, 100)
if ffi.string(textinput) ~= "" then
filenameTextInputFocused = true
if im.Button(action) or pressedEnter then
local fname = ffi.string(textinput)
if options.select_folder and currentPath ~= "/" then
-- check if file actually exists before calling cb func
local fName = ffi.string(textinput)
local found = false
@/lua/ge/extensions/editor/rallyEditor/notebookInfo.lua
editor.history:commitAction("Change Name of Notebook",
{self = self, old = self.path.name, new = ffi.string(notebookNameText), field = 'name'},
setNotebookFieldUndo, setNotebookFieldRedo)
editor.history:commitAction("Change Authors of Notebook",
{self = self, old = self.path.authors, new = ffi.string(notebookAuthorsText), field = 'authors'},
setNotebookFieldUndo, setNotebookFieldRedo)
editor.history:commitAction("Change Description of Notebook",
{self = self, old = self.path.description, new = ffi.string(notebookDescText), field = 'description'},
setNotebookFieldUndo, setNotebookFieldRedo)
local oldVal = codriver.name
local newVal = ffi.string(codriverNameText)
self.path.codrivers.objects[self.codriverId].name = newVal
editor.history:commitAction("Change Language of Codriver",
{self = self, index = self.codriverId, old = codriver.language, new = ffi.string(codriverLanguageText), field = 'language'},
setCodriverFieldUndo, setCodriverFieldRedo)
local oldVal = codriver.voice
local newVal = ffi.string(codriverVoiceIdText)
self.path.codrivers.objects[self.codriverId].voice = newVal
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
assert(payload.DataSize == 64)
local texture = ffi.string(payload.Data)
setTexture(map, texture)
assert(payload.DataSize == 64)
local textureSet = ffi.string(payload.Data)
applyTextureSet(materialSettings.textureSets[textureSet])
assert(payload.DataSize == 64)
local glowMap = ffi.string(payload.Data)
setTexture(map, materialSettings.glowMaps[glowMap].file)
local previewText = translateLanguage("ui.trackBuilder.saveLoad.createPreview", "Create Preview")
local name = ffi.string(saveSettings.saveStr)
local allowScreenshot = false
local exp, filename = tb.save(
ffi.string(saveSettings.saveStr),
{
saveEnvironment = saveSettings.saveEnvironment[0],
description = string.gsub(ffi.string(saveSettings.description),"\n", "\\n"),
difficulty = 12 + 25*saveSettings.difficulty[0]
saveSettings.previewNames = tb.getPreviewNames()
saveSettings.infoText = translateLanguage("ui.trackBuilder.saveLoad.trackWrittenTo", "Successfully saved track to ") .."'/trackEditor/"..ffi.string(saveSettings.saveStr)..".json'!"
end
screenshotTaken = false
saveSettings.infoText = translateLanguage("ui.trackBuilder.saveLoad.previewCreated", "Successfully created preview ") .."'/trackEditor/".. ffi.string(saveSettings.saveStr)..".jpg'!"
end
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"
local zip = ZipArchive()
-- addFile( path [, pathInZIP, overrideFile] )
zip:addFile( 'trackEditor/'..ffi.string(saveSettings.saveStr)..'.json' )
zip:addFile( 'trackEditor/'..ffi.string(saveSettings.saveStr)..'.jpg' )
zip:addFile( 'trackEditor/'..ffi.string(saveSettings.saveStr)..'.json' )
zip:addFile( 'trackEditor/'..ffi.string(saveSettings.saveStr)..'.jpg' )
zip:close()
ffi.copy(saveSettings.saveStr, file)
saveSettings.infoText = translateLanguage("ui.trackBuilder.saveLoad.trackLoaded", "Loaded track ") .."'"..ffi.string(saveSettings.saveStr).."'!"
end
if not screenshotTaken and hiddenForScreenshotTimer < 0.5 then
createScreenshot("trackEditor/"..ffi.string(saveSettings.saveStr))
screenshotTaken = true
@/lua/ge/extensions/editor/util/editorElementHelper.lua
if e.displayOptions.optional then return end
local file = ffi.string(e.ac)
local foundFile = false
im.PushItemWidth(im.GetContentRegionAvailWidth())
-- Handle displayOptions as either a table or a string (tooltip)
local displayOpts = type(e.displayOptions) == 'table' and e.displayOptions or {}
if not e._translated then
e._translated = translateLanguage(ffi.string(e.ac), noTranslation)
end
im.Columns(1)
if editEnded[0] then e._translated = nil ctd[e.fieldName] = ffi.string(e.ac) return true end
return false
if editEnded[0] then
ctd[e.fieldName] = ffi.string(e.ac)
e.foundFile = nil
end im.SameLine()
local file = ffi.string(e.ac)
if e.foundFile == nil then
editor_raceEditor.show()
editor_raceEditor.loadRace(ffi.string(e.ac))
end
editor_raceEditor.show()
editor_raceEditor.saveRace(nil, ffi.string(e.ac))
e.foundFile = nil
end
im.tooltip("Saves to " .. ffi.string(e.ac))
end
editor_sitesEditor.show()
editor_sitesEditor.loadSites(ffi.string(e.ac))
end
editor_sitesEditor.show()
editor_sitesEditor.saveSites(nil, ffi.string(e.ac))
e.foundFile = nil
end
im.tooltip("Saves to " .. ffi.string(e.ac))
end
@/lua/ge/extensions/editor/meshSpline.lua
if im.InputText("###" .. tostring(wCtr), splineNamePtr, 32) then
spline.name = ffi.string(splineNamePtr)
if spline.sceneTreeFolderId then
@/lua/ge/extensions/flowgraph/nodes/util/template.lua
if im.InputText("##mf" .. self.id, imText, nil, im.InputTextFlags_EnterReturnsTrue) then
self.myField = ffi.string(imText)
reason = "Changed Text"
@/lua/ge/extensions/editor/assemblySpline.lua
if im.InputText("###" .. tostring(wCtr), splineNamePtr, 32) then
spline.name = ffi.string(splineNamePtr)
if spline.sceneTreeFolderId then
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
if editor.uiInputFile("##vehicleSelectorCustom"..dumps(self.id), self.customConfigPtr, nil, nil, {{"Part config files", ".pc"}}, im.InputTextFlags_EnterReturnsTrue) then
local customConfigPath = ffi.string(self.customConfigPtr)
@/lua/ge/extensions/editor/missionEditor/conditions.lua
self.mission._dirty = true
condition.progressKey = ffi.string(self.fields[val])
end
self.mission._dirty = true
condition.leagueId = ffi.string(self.fields[val])
end
if editEnded[0] then
condition.valueName = ffi.string(self.fields[name])
self.mission._dirty = true
if editEnded[0] then
condition.value = ffi.string(self.fields[name])
self.mission._dirty = true
@/lua/ge/extensions/editor/mainMenu.lua
if editor.uiInputSearch(nil, windowSearchTxt, 240 * editor.getPreference("ui.general.scale")) then
local s = ffi.string(windowSearchTxt)
windowSearchDisplayResult = s:len() > 0
editor.hideWindow(saveLayoutWindowName)
editor_layoutManager.saveWindowLayout(ffi.string(layoutName))
end
editor.hideWindow(saveLayoutWindowName)
editor_layoutManager.saveWindowLayout(ffi.string(layoutName))
end
@/lua/common/extensions/ui/flowgraph/editor.lua
if displayOptions.allowEditing then
source:changeBase(name, ffi.string(imVal))
source.mgr.fgEditor.addHistory("Changed Variable " .. name)
else
source:changeInstant(name, ffi.string(imVal))
end
if im.InputText("##RenameVariable", newNameArray, nil, im.flags(im.InputTextFlags_EnterReturnsTrue)) then
local newName = ffi.string(newNameArray)
if string.len(newName) > 0 then
if searchChanged then
vehSearch:startSearch(ffi.string(vehSearchTxt))
for mIdx, m in ipairs(self.models) do
else
if ffi.string(vehSearchTxt) == "" then
im.Text("Type vehicle model or config here to get results.")
@/lua/ge/extensions/editor/particleEditor.lua
if im.InputText("##particleTexture", imText, nil, im.InputTextFlags_EnterReturnsTrue) then
return {fieldValue = ffi.string(imText), editEnded = true}
end
@/lua/common/libs/copas/copas/http.lua
if b then
reqt.source = ltn12.source.string(b)
reqt.headers = {
@/lua/ge/extensions/editor/scriptAIManager.lua
if im.Button('OK') then
local filename = ffi.string(tmpSaveFilename)
saveRecording(bo, vehId, filename)
@/gameplay/missionTypes/cannon/editor.lua
enemyType.valueChangedCallback = function(value)
hideStartAndFinish(ffi.string(value.ac) == "Static")
end
winType.valueChangedCallback = function(value)
hideMedals(ffi.string(value.ac) == "Waypoint")
end
@/lua/ge/extensions/editor/tech/roadArchitect/groups.lua
return {
name = ffi.string(pg.name),
list = deepcopy(pg.list) }
@/lua/ge/extensions/editor/missionEditor/objectives.lua
self.mission._dirty = true
re.attributeKey = att or ffi.string(getBuffer(idx.."--"..key, re.attributeKey))
inputBuffers[idx.."--"..key] = nil
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, ""))
if addKey ~= "" then
self.mission._dirty = true
self.mission.careerSetup.starOutroTexts[key] = ffi.string(buf)
self._translatedTexts[key] = nil
if im.Button("Finish Editing") then
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
@/lua/vehicle/powertrain/sequentialGearbox.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/materialEditor.lua
local textFilterString = string.lower(ffi.string(im.TextFilter_GetInputBuf(matFilter)))
assert(payload.DataSize == 2048)
local data = ffi.string(payload.Data)
-- editor.logInfo(logTag .. "Setting property '" .. property .. "' on layer '" .. tostring(layer or o.layer[0]) .. "' to .. '" .. data .. "'")
assert(payload.DataSize == 2048)
local data = ffi.string(payload.Data)
local oldValue = selectedCubemapObj:getField("cubeFace", index)
local function saveCubemap()
selectedCubemapObj:setName(ffi.string(cubemapNamePtr))
scenetree.matLuaEd_PersistMan:setDirty(selectedCubemapObj, "")
newMatMapToLocked = not newMatMapToLocked
if newMatMapToLocked == true and #ffi.string(newMatName) == 0 and #ffi.string(newMatMapTo) > 0 then
ffi.copy(newMatName, ffi.string(newMatMapTo))
newMatMapToLocked = not newMatMapToLocked
if newMatMapToLocked == true and #ffi.string(newMatName) == 0 and #ffi.string(newMatMapTo) > 0 then
ffi.copy(newMatName, ffi.string(newMatMapTo))
if newMatMapToLocked == true and #ffi.string(newMatName) == 0 and #ffi.string(newMatMapTo) > 0 then
ffi.copy(newMatName, ffi.string(newMatMapTo))
end
if createMaterialName ~= ffi.string(newMatName) then
createMaterialName = ffi.string(newMatName)
if createMaterialName ~= ffi.string(newMatName) then
createMaterialName = ffi.string(newMatName)
local mat = scenetree.findObject(createMaterialName)
if im.Button("Create") then
if editor.createMaterial(ffi.string(newMatName), ffi.string(newMatPath), (newMatMapToLocked == true and ffi.string(newMatName) or ffi.string(newMatMapTo))) then
editor.hideWindow(createMaterialWindowName)
if im.Button("Create") then
if editor.createMaterial(ffi.string(newMatName), ffi.string(newMatPath), (newMatMapToLocked == true and ffi.string(newMatName) or ffi.string(newMatMapTo))) then
editor.hideWindow(createMaterialWindowName)
if im.Button("Create") then
if editor.createMaterial(ffi.string(newMatName), ffi.string(newMatPath), (newMatMapToLocked == true and ffi.string(newMatName) or ffi.string(newMatMapTo))) then
editor.hideWindow(createMaterialWindowName)
if im.Button("Create") then
if editor.createMaterial(ffi.string(newMatName), ffi.string(newMatPath), (newMatMapToLocked == true and ffi.string(newMatName) or ffi.string(newMatMapTo))) then
editor.hideWindow(createMaterialWindowName)
getMaterials()
selectMaterialByName(ffi.string(newMatName))
ffi.copy(newMatName, "")
@/lua/vehicle/powertrain/combustionEngine.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/gen/ui.lua
for i = 1,im.IoFontsGetCount() do
-- lo('?? for_font:'..ffi.string(im.IoFontsGetName(i)))
end
@/lua/vehicle/powertrain/hydraulicPump.lua
if device.breakTriggerBeam and device.breakTriggerBeam == "" then
--get rid of the break beam if it's just an empty string (cancellation)
device.breakTriggerBeam = nil
@/lua/ge/extensions/editor/visualization.lua
if editor.uiInputSearchTextFilter("##vizSearchFilter", vizFilter, im.GetContentRegionAvailWidth(), nil) then
if ffi.string(im.TextFilter_GetInputBuf(vizFilter)) == "" then
im.ImGuiTextFilter_Clear(vizFilter)
-- Filter validator
local filterQuery = string.gsub(ffi.string(im.TextFilter_GetInputBuf(vizFilter)), "[^%w_]+", " ") -- sanitize
filterQuery = string.gsub(filterQuery, "^%s*(.-)%s*$", "%1") -- trim edges
@/lua/ge/extensions/editor/tech/roadArchitect/junctions.lua
if jct then
local jctName = ffi.string(jct.name)
local jRoads = jct.roads
return {
name = im.ArrayChar(32, ffi.string(jct.name)),
type = jct.type,
return {
name = ffi.string(jct.name),
type = jct.type,
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
if editEnded[0] then
boundary.name = ffi.string(self.name)
markBoundaryAsDirty(boundary)
if im.Button("Rename") then
local newFileName = ffi.string(self.fileName)
if newFileName ~= boundary._fileName and newFileName ~= "" then
if editEnded[0] then
fields.values[name] = ffi.string(self.fields[name])
if im.Button("New String") then
fields:add(ffi.string(self.addFieldText),'string',"value")
self.addFieldText = im.ArrayChar(256,"")
if im.Button("New Number") then
fields:add(ffi.string(self.addFieldText),'number',0)
self.addFieldText = im.ArrayChar(256,"")