-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Line ending changes (?????) exposed hook loaders
- Loading branch information
Showing
10 changed files
with
1,788 additions
and
1,788 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
local ConsoleCommand = Api.class("ConsoleCommand") | ||
|
||
--[[ --------------------------------------------------------------------------------------- | ||
Name: initialize | ||
Desc: Constructs new unregistered console command. | ||
Args: | ||
(string trigger) - the string that triggers the command. | ||
(string description) - a short description of what the command does. | ||
(ModHandle modHandle) - a reference to the mod, which owns this command. | ||
(function callback) - the function, which will be called when this command | ||
is executed. | ||
Signature: (string trigger) - same as trigger | ||
(string input) - everything, in the input | ||
string, past the trigger | ||
--]] --------------------------------------------------------------------------------------- | ||
function ConsoleCommand:initialize(trigger, description, modHandle, callback) | ||
assert_e(Api.IsString(trigger)) | ||
assert_e(Api.IsString(description)) | ||
assert_e(Api.IsTable(modHandle)) | ||
assert_e(Api.IsFunction(callback)) | ||
|
||
self._trigger = trigger | ||
self._description = description | ||
self._modHandle = modHandle | ||
self._callback = callback | ||
|
||
getmetatable(self).__tojson = function(s, state) | ||
return "{" .. "\"trigger\": \"" .. tostring(s:GetTrigger()) .. "\"," .. | ||
"\"description\": \"" .. tostring(s:GetDescription()) .. "\"," .. | ||
"\"modHandle\": \"" .. tostring(s:GetModHandle()) .. "\"," .. | ||
"\"callback\": \"" .. tostring(s:GetCallback()) .. "\"}" | ||
end | ||
end | ||
|
||
function ConsoleCommand:GetTrigger() return self._trigger end | ||
|
||
function ConsoleCommand:GetDescription() return self._description end | ||
|
||
function ConsoleCommand:GetModHandle() return self._modHandle end | ||
|
||
function ConsoleCommand:GetCallback() return self._callback end | ||
|
||
local ConsoleCommand = Api.class("ConsoleCommand") | ||
|
||
--[[ --------------------------------------------------------------------------------------- | ||
Name: initialize | ||
Desc: Constructs new unregistered console command. | ||
Args: | ||
(string trigger) - the string that triggers the command. | ||
(string description) - a short description of what the command does. | ||
(ModHandle modHandle) - a reference to the mod, which owns this command. | ||
(function callback) - the function, which will be called when this command | ||
is executed. | ||
Signature: (string trigger) - same as trigger | ||
(string input) - everything, in the input | ||
string, past the trigger | ||
--]] --------------------------------------------------------------------------------------- | ||
function ConsoleCommand:initialize(trigger, description, modHandle, callback) | ||
assert_e(Api.IsString(trigger)) | ||
assert_e(Api.IsString(description)) | ||
assert_e(Api.IsTable(modHandle)) | ||
assert_e(Api.IsFunction(callback)) | ||
|
||
self._trigger = trigger | ||
self._description = description | ||
self._modHandle = modHandle | ||
self._callback = callback | ||
|
||
getmetatable(self).__tojson = function(s, state) | ||
return "{" .. "\"trigger\": \"" .. tostring(s:GetTrigger()) .. "\"," .. | ||
"\"description\": \"" .. tostring(s:GetDescription()) .. "\"," .. | ||
"\"modHandle\": \"" .. tostring(s:GetModHandle()) .. "\"," .. | ||
"\"callback\": \"" .. tostring(s:GetCallback()) .. "\"}" | ||
end | ||
end | ||
|
||
function ConsoleCommand:GetTrigger() return self._trigger end | ||
|
||
function ConsoleCommand:GetDescription() return self._description end | ||
|
||
function ConsoleCommand:GetModHandle() return self._modHandle end | ||
|
||
function ConsoleCommand:GetCallback() return self._callback end | ||
|
||
return ConsoleCommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
Log.Debug("Called PostPlay.lua") | ||
|
||
-- notify player of any failed mod loads | ||
|
||
local configError = Api.ModManager:GetLoadConfigError() | ||
local modLoadErrors = Api.ModManager:GetLoadModsError() | ||
|
||
local function writeChat(message) | ||
Api.ChatConsole.SendLocalChat(message, true, false, "VermHook: ") | ||
end | ||
|
||
if configError then | ||
writeChat("Error loading config: " .. tostring(configError)) | ||
end | ||
|
||
if modLoadErrors then | ||
writeChat("Errors loading mods:") | ||
|
||
for k,v in pairs(modLoadErrors) do | ||
writeChat(tostring(k) .. ": " .. tostring(v)) | ||
end | ||
Log.Debug("Called PostPlay.lua") | ||
|
||
-- notify player of any failed mod loads | ||
|
||
local configError = Api.ModManager:GetLoadConfigError() | ||
local modLoadErrors = Api.ModManager:GetLoadModsError() | ||
|
||
local function writeChat(message) | ||
Api.ChatConsole.SendLocalChat(message, true, false, "VermHook: ") | ||
end | ||
|
||
if configError then | ||
writeChat("Error loading config: " .. tostring(configError)) | ||
end | ||
|
||
if modLoadErrors then | ||
writeChat("Errors loading mods:") | ||
|
||
for k,v in pairs(modLoadErrors) do | ||
writeChat(tostring(k) .. ": " .. tostring(v)) | ||
end | ||
end |
Oops, something went wrong.