Registers the door properties that come with the Doors plugin ('name', 'title_type', 'skin', 'bodygroups', 'locked', 'ownable' and 'price') and the 'center' title type.

Summary

Functions

Creates the text row for the name of the door in the door menu.
Creates the combo box row with all registered title types in the door menu.
Creates the checkbox row for the lock state of the door in the door menu.
Creates the checkbox row that makes the door ownable in the door menu.
Creates the text row for the price of the door in the door menu.
Draws the name of the door on a background box with white bars above and below it, a quarter of the door's height away from the center of the door, and the status of the door (see Doors:get_status_text) in a smaller font below it.
Returns the name of the door.
Returns the id of the title type of the door.
Returns the skin of the door.
Returns the bodygroups of the door.
Returns whether the door is locked.
Returns whether the door can be owned.
Returns the price that staff have set for the door.
Sets the networked name of the door.
Sets the networked title type of the door.
Sets the skin of the door.
Sets the bodygroups of the door with Entity:SetBodygroup.
Locks or unlocks the door and networks its new state.
Makes the door, and the doors linked with it, ownable or not.
Sets the price of the door and of the doors linked with it.

Functions

create_panel(_entity, panel)

shared plugins/doors/plugin/lib/sh_properties.lua:25

Creates the text row for the name of the door in the door menu.

Parameters

  • _entity Entity the door
  • panel Panel the fl_door_menu panel

Returns

  • Panel the created property row

create_panel(_entity, panel)

shared plugins/doors/plugin/lib/sh_properties.lua:50

Creates the combo box row with all registered title types in the door menu.

Parameters

  • _entity Entity the door
  • panel Panel the fl_door_menu panel

Returns

  • Panel the created property row

create_panel(_entity, panel)

shared plugins/doors/plugin/lib/sh_properties.lua:134

Creates the checkbox row for the lock state of the door in the door menu.

Parameters

  • _entity Entity the door
  • panel Panel the fl_door_menu panel

Returns

  • Panel the created property row

create_panel(_entity, panel)

shared plugins/doors/plugin/lib/sh_properties.lua:161

Creates the checkbox row that makes the door ownable in the door menu.

Parameters

  • _entity Entity the door
  • panel Panel the fl_door_menu panel

Returns

  • Panel the created property row

create_panel(_entity, panel)

shared plugins/doors/plugin/lib/sh_properties.lua:192

Creates the text row for the price of the door in the door menu.

Parameters

  • _entity Entity the door
  • panel Panel the fl_door_menu panel

Returns

  • Panel the created property row

draw(entity, _w, h, alpha)

shared plugins/doors/plugin/lib/sh_properties.lua:210

Draws the name of the door on a background box with white bars above and below it, a quarter of the door's height away from the center of the door, and the status of the door (see Doors:get_status_text) in a smaller font below it. A door without a name only gets its status drawn, and nothing is drawn if it has no status either.

Parameters

  • entity Entity the door
  • _w Number width of the door face in drawing units
  • h Number height of the door face in drawing units
  • alpha Number opacity that fades with distance, up to 255

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:12

Returns the name of the door.

Parameters

  • entity Entity the door

Returns

  • String the name, or an empty string if the door has no name

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:37

Returns the id of the title type of the door.

Parameters

  • entity Entity the door

Returns

  • String the title type id, or nil if it has never been set

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:68

Returns the skin of the door.

Parameters

  • entity Entity the door

Returns

  • Number the skin index

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:84

Returns the bodygroups of the door.

Parameters

  • entity Entity the door

Returns

  • List the value of every bodygroup of the door, the first entry being that of bodygroup 0

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:113

Returns whether the door is locked. Reads the networked value on the client and the internal state of the door on the server.

Parameters

  • entity Entity the door

Returns

  • Boolean

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:146

Returns whether the door can be owned.

Parameters

  • entity Entity the door

Returns

  • Boolean

get_save_data(entity)

shared plugins/doors/plugin/lib/sh_properties.lua:174

Returns the price that staff have set for the door.

Parameters

  • entity Entity the door

Returns

  • Number the price; if the door has none, an empty string on the client and nil on the server

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:18

Sets the networked name of the door.

Parameters

  • entity Entity the door
  • data String the name

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:43

Sets the networked title type of the door.

Parameters

  • entity Entity the door
  • data String title type id, an empty string to disable the title

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:74

Sets the skin of the door.

Parameters

  • entity Entity the door
  • data Number the skin index

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:97

Sets the bodygroups of the door with Entity:SetBodygroup.

Parameters

  • entity Entity the door
  • data List the bodygroups that were saved by get_save_data; entries that are not numbers are skipped

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:123

Locks or unlocks the door and networks its new state. Serverside only.

Parameters

  • entity Entity the door
  • data Boolean true to lock the door; other values are converted with tobool

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:154

Makes the door, and the doors linked with it, ownable or not. The owner of a door that stops being ownable loses it. Serverside only.

Parameters

  • entity Entity the door
  • data Boolean true to let characters own the door; other values are converted with tobool

on_load(entity, data)

shared plugins/doors/plugin/lib/sh_properties.lua:185

Sets the price of the door and of the doors linked with it. Serverside only.

Parameters

  • entity Entity the door
  • data Number/String the price; anything that is not a number makes the door cost what the door_price config says

Defined in