From e8439ad503f530724f1eae2de1a8ac2c19df52c0 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 22 Jan 2016 19:55:23 -0500 Subject: More debugging around file.Find not finding games folder --- gamemode/hud/draw_spell.lua | 9 ++++++--- gamemode/hud/games/base.lua | 2 ++ gamemode/hud/games/connectthedots.lua | 7 +++++++ gamemode/hud/games/rubickscircle.lua | 1 + gamemode/hud/spellminigames/base.lua | 18 ++++++++++++++++++ gamemode/hud/spellminigames/connectthedots.lua | 7 ------- 6 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 gamemode/hud/games/base.lua create mode 100644 gamemode/hud/games/connectthedots.lua create mode 100644 gamemode/hud/games/rubickscircle.lua create mode 100644 gamemode/hud/spellminigames/base.lua delete mode 100644 gamemode/hud/spellminigames/connectthedots.lua (limited to 'gamemode/hud') diff --git a/gamemode/hud/draw_spell.lua b/gamemode/hud/draw_spell.lua index c1879ef..032c25f 100644 --- a/gamemode/hud/draw_spell.lua +++ b/gamemode/hud/draw_spell.lua @@ -2,6 +2,8 @@ CASTING_SPELL = nil --AddLUACSFolder("spellminigames") +local Folder = GM.Folder:gsub("gamemodes/","").."/gamemode/hud/" + --A table of spells to functions? Spells = {} --[[ @@ -14,13 +16,14 @@ Spells = {} function loadgames() GAMEMODE.minigames = {} - local Folder = GAMEMODE.Folder:gsub("gamemodes/","").."/gamemode/hud/" print("WS2A:Looking for minigames in:" .. Folder) - local games = file.Find(Folder.."*","LUA") + AddCSLuaFile(Folder .. "/games/base.lua") + include(Folder .. "/games/base.lua") + local games, fold = file.Find(Folder.."*","LUA") local game = {} print("WS2A:Loading " .. #(games) .. " minigames") + print("WS2A:Found " .. #(fold) .. " folders") for k,v in pairs(games) do - print(k) print(v) --[[ if (v != "base.lua") then diff --git a/gamemode/hud/games/base.lua b/gamemode/hud/games/base.lua new file mode 100644 index 0000000..a6c68c1 --- /dev/null +++ b/gamemode/hud/games/base.lua @@ -0,0 +1,2 @@ +--A file to show what functions are used for minigames +print("Base included!") diff --git a/gamemode/hud/games/connectthedots.lua b/gamemode/hud/games/connectthedots.lua new file mode 100644 index 0000000..c24ff14 --- /dev/null +++ b/gamemode/hud/games/connectthedots.lua @@ -0,0 +1,7 @@ +--The connet the dots spell game +print("Hi from connectthedots.lua") + +function connectthedots() + print("Blah!") + return 100 +end diff --git a/gamemode/hud/games/rubickscircle.lua b/gamemode/hud/games/rubickscircle.lua new file mode 100644 index 0000000..528f62b --- /dev/null +++ b/gamemode/hud/games/rubickscircle.lua @@ -0,0 +1 @@ +print(" second file to see if something's wrong with file function") diff --git a/gamemode/hud/spellminigames/base.lua b/gamemode/hud/spellminigames/base.lua new file mode 100644 index 0000000..65127e7 --- /dev/null +++ b/gamemode/hud/spellminigames/base.lua @@ -0,0 +1,18 @@ +--A file to show what functions are used for minigames + +Game.Name="Base" +Game.Tip="Why did I even write this? No one will look at it anyway!" + +--Set this to non-nil to end the game, and give the player a score. +Game.Score=nil + +--[[ +Game.OnStartCasting = function(ply,spell) + +Game.Minigame = function() +end + +Game.Interupt = function() +end + +--]] diff --git a/gamemode/hud/spellminigames/connectthedots.lua b/gamemode/hud/spellminigames/connectthedots.lua deleted file mode 100644 index c24ff14..0000000 --- a/gamemode/hud/spellminigames/connectthedots.lua +++ /dev/null @@ -1,7 +0,0 @@ ---The connet the dots spell game -print("Hi from connectthedots.lua") - -function connectthedots() - print("Blah!") - return 100 -end -- cgit v1.2.3-70-g09d2