aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_internal.h
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2016-12-03 21:43:25 -0800
committerparamat <mat.gregory@virginmedia.com>2016-12-07 04:07:54 +0000
commit075833e39368e63e06889f21140f816420e83541 (patch)
treec40d5390e23bbe87a8672f44e8c51649d3331091 /src/script/cpp_api/s_internal.h
parent9714cdcf4ba51b44cca72e133ec5ef2a3c9f50f6 (diff)
Fog: Make fraction of visible distance at which fog starts configurable
Optimise the fetching of global settings 'camera_smoothing', 'cinematic' and 'cinematic_camera_smoothing'. Cache 'cam_smoothing'.
Diffstat (limited to 'src/script/cpp_api/s_internal.h')
0 files changed, 0 insertions, 0 deletions
opt">.yard_active = function(set) --if set == true then yard = active local yard_indicator = POS(-4025,14,-2659) if set ~= nil then setstate(yard_indicator,(set and "on") or "off") end return (getstate(yard_indicator) == "on") or false end F.dir = function(set) -- if set == true then dir = pointing north local dir_indicator = POS(-4025,13,-2665) if set ~= nil then setstate(dir_indicator,(set and "on") or "off") end return (getstate(dir_indicator) == "on") or false end F.get_rc_safe = function() return get_rc() or "" end F.has_rc = function(query,rc_list) -- query eg: "rc1" if rc_list == "" or query == nil or query=="" then return false end if not rc_list then rc_list = F.get_rc_safe() end for word in rc_list:gmatch("[^%s]+") do if word == query then return true end end print(F.get_rc_safe()) return false end F.remove_rc = function(rc_list,arrow_mode) -- rc_list eg: {"rc1","rc2"} -- rc_list MUST be a table of rc codes to remove -- eg: {"rc1","rc2"} -- Arrow Modes: -- true: with arrow direction -- false: against arrow direction -- nil: ignores arrow direction if not atc_id then return false end if (arrow_mode == nil) or (atc_arrow == arrow_mode) then local rc = F.get_rc_safe() rc_list = rc_list or {} local rc_remove = {} for _,v in pairs(rc_list) do rc_remove[v] = true end -- remove codes from train's rc local reinsert = {} for token in rc:gmatch("[^%s]+") do if not rc_remove[token] then table.insert(reinsert,token) end end -- insert new string to train's rc set_rc(table.concat(reinsert," ")) end print(F.get_rc_safe()) return reinsert end F.remove_rc_match = function(rc_list) -- rc_list eg: "rc_%d+" local rm = {} for v in F.get_rc_safe():gmatch("("..rc_list..")") do table.insert(rm,v) end