45 lines
1.2 KiB
Plaintext
Executable File
45 lines
1.2 KiB
Plaintext
Executable File
--
|
|
-- File:: userprops.ms
|
|
-- Description:: User property utility functions.
|
|
--
|
|
-- Author:: David Muir <david.muir@rockstarnorth.com>
|
|
-- Date:: 23 April 2009
|
|
--
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Uses
|
|
-----------------------------------------------------------------------------
|
|
-- None
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Functions
|
|
-----------------------------------------------------------------------------
|
|
|
|
--
|
|
-- name: RsUserProp_Clear
|
|
-- desc: Clear an object user property.
|
|
--
|
|
fn RsUserProp_Clear obj property = (
|
|
|
|
local propBuffer = ( getUserPropBuffer obj )
|
|
local newPropBuffer = ""
|
|
local propBufferComponents = ( filterString propBuffer "\r\n" )
|
|
for propComponent in propBufferComponents do
|
|
(
|
|
local propParts = ( filterString propComponent " = " )
|
|
|
|
-- If our buffer name does not equal our property to remove then
|
|
-- we re-add it into our newPropBuffer.
|
|
if ( property != propParts[1] ) then
|
|
(
|
|
newPropBuffer = newPropBuffer + ( propComponent + "\r\n" )
|
|
)
|
|
)
|
|
|
|
-- Update the user property buffer.
|
|
setUserPropBuffer obj newPropBuffer
|
|
true
|
|
)
|
|
|
|
-- userprops.ms
|