From 7aedabfdb21a0967fba49048ee505b367724417d Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 1 Jun 2016 22:45:04 -0400 Subject: [PATCH 1/2] Implement external config function call After loading all the defaults, call a config function if it exists. --- GCICAP.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GCICAP.lua b/GCICAP.lua index ea1578b..40772f3 100644 --- a/GCICAP.lua +++ b/GCICAP.lua @@ -335,6 +335,13 @@ gcicap.tasks = { "cap", "gci" } gcicap.log = mist.Logger:new("GCICAP", gcicap.log_level) +-- if you create the function gcicap_do_config in a DO SCRIPT block +-- before loading the GCICAP.lua file, then we will call it here +-- This lets you override configuration without modifying the base script +-- and making it easier to include in multiple missions without having multiple +-- verisons of the file. +if gcicap_do_config ~= nil then gcicap_do_config() end + do --- Flight class. -- @type gcicap.Flight From cc603481faa47dd1b610247ac9500ce274bfabd9 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 2 Jun 2016 07:32:20 -0400 Subject: [PATCH 2/2] Improve comment --- GCICAP.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/GCICAP.lua b/GCICAP.lua index 40772f3..ccb7cd0 100644 --- a/GCICAP.lua +++ b/GCICAP.lua @@ -335,11 +335,18 @@ gcicap.tasks = { "cap", "gci" } gcicap.log = mist.Logger:new("GCICAP", gcicap.log_level) --- if you create the function gcicap_do_config in a DO SCRIPT block --- before loading the GCICAP.lua file, then we will call it here --- This lets you override configuration without modifying the base script --- and making it easier to include in multiple missions without having multiple --- verisons of the file. +--[[ + If you create the function gcicap_do_config in a DO SCRIPT block + _before_ loading the GCICAP.lua file, then we will call it here + This lets you override configuration without modifying the base script + and making it easier to include in multiple missions without having multiple + verisons of the file. Example: + + function gcicap_do_config() + gcicap.blue.borders_enabled = true + end +--]] + if gcicap_do_config ~= nil then gcicap_do_config() end do