content stringlengths 5 1.05M |
|---|
local Players = game:GetService("Players")
local CoreGuiService = game:GetService("CoreGui")
local RobloxReplicatedStorage = game:GetService("RobloxReplicatedStorage")
local RobloxGui = CoreGuiService:FindFirstChild("RobloxGui")
local CoreGuiModules = RobloxGui:FindFirstChild("Modules")
local CommonModules = CoreGuiModules:FindFirstChild("Common")
local Rigging = require(CommonModules:FindFirstChild("RagdollRigging"))
local HumanoidReadyUtil = require(CommonModules:FindFirstChild("HumanoidReadyUtil"))
local deathType = game:DefineFastString("DeathTypeValue", "Classic")
-- Replicate this to clients so all clients make the same choice
local DeathTypeValue = Instance.new("StringValue")
DeathTypeValue.Name = "DeathType"
DeathTypeValue.Value = deathType
DeathTypeValue.Parent = RobloxReplicatedStorage
-- Everything below is in support of ragdoll death
if deathType ~= "Ragdoll" then
return
end
-- { [player: Player] = humanoid: Humanoid, ... }
local riggedPlayerHumanoids = {}
-- Create remote event for the client to notify the server that it went ragdoll. The server
-- never disables joints authoritatively until the client acknowledges that it has already
-- broken it's own joints non-authoritatively, started simulating the ragdoll locally, and
-- should already be sending physics data.
local remote = Instance.new("RemoteEvent")
remote.Name = "OnRagdoll"
remote.OnServerEvent:Connect(function(remotePlayer, humanoid)
if humanoid and riggedPlayerHumanoids[remotePlayer] == humanoid then
local character = humanoid and humanoid.Parent
if character and character:IsA("Model") then
Rigging.disableMotors(character, humanoid.RigType)
end
-- One time, one way.
riggedPlayerHumanoids[remotePlayer] = nil
end
end)
remote.Parent = RobloxReplicatedStorage
HumanoidReadyUtil.registerHumanoidReady(function(player, character, humanoid)
local ancestryChangedConn
local function disconnect()
ancestryChangedConn:Disconnect()
if riggedPlayerHumanoids[player] == humanoid then
riggedPlayerHumanoids[player] = nil
end
end
-- Handle connection cleanup on remove
ancestryChangedConn = humanoid.AncestryChanged:Connect(function(_child, parent)
if not game:IsAncestorOf(parent) then
disconnect()
end
end)
-- We will only disable specific joints
humanoid.BreakJointsOnDeath = false
-- Server creates ragdoll joints on spawn to allow for seamless transition even if death is
-- initiated on the client. The Motor6Ds keep them inactive until they are disabled.
Rigging.createRagdollJoints(character, humanoid.RigType)
riggedPlayerHumanoids[player] = humanoid
end) |
b = "hello world"
function test()
local a = b
return a
end
jit("compile", test)
local res = test()
assert(res == b)
--[[
function <../tests/6_OP_GETTABUP.lua:2,5> (3 instructions at 0x1bc9610)
0 params, 2 slots, 1 upvalue, 1 local, 1 constant, 0 functions
1 [3] GETTABUP 0 0 -1 ; _ENV "b"
2 [4] RETURN 0 2
3 [5] RETURN 0 1
constants (1) for 0x1bc9610:
1 "b"
locals (1) for 0x1bc9610:
0 a 2 4
upvalues (1) for 0x1bc9610:
0 _ENV 0 0
]]
--[[
ra = R(0);
rc = K(0);
ci->u.l.savedpc = &cl->p->code[1];
Y_luaV_gettable(L, cl->upvals[0]->v, rc, ra);
base = ci->u.l.base;
]] |
require('mono.metadata.object-forward')
require('mono.metadata.object')
require('mono.metadata.image')
ffi.cdef [[
MonoException *
mono_exception_from_name (MonoImage *image,
const char* name_space,
const char *name);
MonoException *
mono_exception_from_token (MonoImage *image, uint32_t token);
MonoException *
mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
const char *name, MonoString *a1, MonoString *a2);
MonoException *
mono_exception_from_name_msg (MonoImage *image, const char *name_space,
const char *name, const char *msg);
MonoException *
mono_exception_from_token_two_strings (MonoImage *image, uint32_t token,
MonoString *a1, MonoString *a2);
MonoException *
mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
const char* name_space,
const char *name);
MonoException *
mono_get_exception_divide_by_zero (void);
MonoException *
mono_get_exception_security (void);
MonoException *
mono_get_exception_arithmetic (void);
MonoException *
mono_get_exception_overflow (void);
MonoException *
mono_get_exception_null_reference (void);
MonoException *
mono_get_exception_execution_engine (const char *msg);
MonoException *
mono_get_exception_thread_abort (void);
MonoException *
mono_get_exception_thread_state (const char *msg);
MonoException *
mono_get_exception_thread_interrupted (void);
MonoException *
mono_get_exception_serialization (const char *msg);
MonoException *
mono_get_exception_invalid_cast (void);
MonoException *
mono_get_exception_invalid_operation (const char *msg);
MonoException *
mono_get_exception_index_out_of_range (void);
MonoException *
mono_get_exception_array_type_mismatch (void);
MonoException *
mono_get_exception_type_load (MonoString *class_name, char *assembly_name);
MonoException *
mono_get_exception_missing_method (const char *class_name, const char *member_name);
MonoException *
mono_get_exception_missing_field (const char *class_name, const char *member_name);
MonoException *
mono_get_exception_not_implemented (const char *msg);
MonoException *
mono_get_exception_not_supported (const char *msg);
MonoException*
mono_get_exception_argument_null (const char *arg);
MonoException *
mono_get_exception_argument (const char *arg, const char *msg);
MonoException *
mono_get_exception_argument_out_of_range (const char *arg);
MonoException *
mono_get_exception_io (const char *msg);
MonoException *
mono_get_exception_file_not_found (MonoString *fname);
MonoException *
mono_get_exception_file_not_found2 (const char *msg, MonoString *fname);
MonoException *
mono_get_exception_type_initialization (const char *type_name, MonoException *inner);
MonoException *
mono_get_exception_synchronization_lock (const char *msg);
MonoException *
mono_get_exception_cannot_unload_appdomain (const char *msg);
MonoException *
mono_get_exception_appdomain_unloaded (void);
MonoException *
mono_get_exception_bad_image_format (const char *msg);
MonoException *
mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname);
MonoException *
mono_get_exception_stack_overflow (void);
MonoException *
mono_get_exception_out_of_memory (void);
MonoException *
mono_get_exception_field_access (void);
MonoException *
mono_get_exception_method_access (void);
MonoException *
mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
MonoException *
mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception);
/* Installs a function which is called when the runtime encounters an unhandled exception.
* This hook isn't expected to return.
* If no hook has been installed, the runtime will print a message before aborting.
*/
typedef void (*MonoUnhandledExceptionFunc) (MonoObject *exc, void *user_data);
void mono_install_unhandled_exception_hook (MonoUnhandledExceptionFunc func, void *user_data);
void mono_invoke_unhandled_exception_hook (MonoObject *exc);
]] |
modifier_item_diffusal_custom= class({})
function modifier_item_diffusal_custom:OnCreated()
self.mana_per_tick = self:GetAbility():GetSpecialValueFor("mana_per_tick")
EmitSoundOn("DOTA_Item.DiffusalBlade.Target", self:GetCaster())
end
function modifier_item_diffusal_custom:OnDestroy()
StopSoundOn("DOTA_Item.DiffusalBlade.Target", self:GetCaster())
end
function modifier_item_diffusal_custom:DeclareFunctions()
return {
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE,
MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE,
}
end
function modifier_item_diffusal_custom:GetModifierIncomingDamage_Percentage(params)
if IsServer() then
self:GetParent():ReduceMana(self.mana_per_tick)
self:PlayEffectsOnImpact(self:GetParent())
return 0
end
end
function modifier_item_diffusal_custom:GetModifierMoveSpeedBonus_Percentage()
return -self:GetAbility():GetSpecialValueFor("ms_pct")
end
function modifier_item_diffusal_custom:CheckState()
return {
[MODIFIER_STATE_NO_UNIT_COLLISION] = true,
}
end
function modifier_item_diffusal_custom:PlayEffectsOnImpact(hTarget)
EmitSoundOn("DOTA_Item.DiffusalBlade.Target", hTarget)
local particle_cast = "particles/generic_gameplay/generic_manaburn.vpcf"
local effect_cast = ParticleManager:CreateParticle(particle_cast, PATTACH_ABSORIGIN_FOLLOW, hTarget)
ParticleManager:ReleaseParticleIndex(effect_cast)
end
function modifier_item_diffusal_custom:GetEffectName()
return "particles/items_fx/diffusal_slow.vpcf"
end
function modifier_item_diffusal_custom:GetEffectAttachType()
return PATTACH_ABSORIGIN_FOLLOW
end
function modifier_item_diffusal_custom:GetStatusLabel() return "Inhibit" end
function modifier_item_diffusal_custom:GetStatusPriority() return 4 end
function modifier_item_diffusal_custom:GetStatusStyle() return "Inhibit" end
if IsClient() then require("wrappers/modifiers") end
Modifiers.Status(modifier_item_diffusal_custom) |
--[[
#part of the 3DreamEngine by Luke100000
shader.lua - loads the shaders
--]]
local lib = _3DreamEngine
local testForOpenES = true
--enables auto shader validator
if _DEBUGMODE then
love.graphics.newShader_old = love.graphics.newShader
function love.graphics.newShader(pixel, vertex, name)
local status, err = love.graphics.validateShader(testForOpenES, pixel, vertex)
if not status then
print()
print("-----------------")
print("SHADER ERROR " .. tostring(name))
if not vertex and #pixel < 1024 and not pixel:find("\n") then
print(pixel)
end
print(err)
print(debug.traceback())
print("-----------------")
--dump shader in case of error
love.filesystem.write("shader_errored.glsl", pixel)
error("shader compile failed")
end
local sh = love.graphics.newShader_old(pixel, vertex)
local warnings = sh:getWarnings()
if #warnings ~= 29 then
if not vertex and #pixel < 1024 and not pixel:find("\n") then
print(pixel)
end
print(warnings)
print()
end
return sh
end
end
--shader library
lib.shaderLibrary = {
base = { },
light = { },
module = { },
}
--shader register
function lib:registerShader(path)
local name = (path:match("^.+/(.+)$") or path):sub(1, -5)
local sh = require(path:sub(1, -5))
self.shaderLibrary[sh.type][name] = sh
end
--register inbuild shaders
for i,v in ipairs({"base", "light", "modules"}) do
for d,s in ipairs(love.filesystem.getDirectoryItems(lib.root .. "/shaders/" .. v)) do
if s:sub(-4) == ".lua" then
lib:registerShader(lib.root .. "/shaders/" .. v .. "/" .. s)
end
end
end
--load code snippsets
local codes = { }
for d,s in ipairs(love.filesystem.getDirectoryItems(lib.root .. "/shaders/functions")) do
codes[s:sub(1, #s-5)] = love.filesystem.read(lib.root .. "/shaders/functions/" .. s)
end
--return and load shader if nececary
lib.shaders = { }
function lib:getShader(s)
if not lib.shaders[s] then
local r = love.filesystem.read
local shader = r(lib.root .. "/shaders/" .. s .. ".glsl") or r(lib.root .. "/shaders/sky/" .. s .. ".glsl") or r(lib.root .. "/shaders/debug/" .. s .. ".glsl")
assert(shader, "shader " .. tostring(s) .. " does not exist")
lib.shaders[s] = love.graphics.newShader(shader, nil, s)
end
return lib.shaders[s]
end
local function earlyExposure(canvases)
return canvases.mode ~= "normal" or canvases.format == "rgba8"
end
--load all setting depending shaders
function lib.loadShader(self)
self.shaders.final = { }
self.mainShaders = { }
self.particlesShader = { }
self.mainShaderCount = 0
--the ambient occlusion shader
if self.AO_enabled then
local code = (
"#define SAMPLE_COUNT " .. self.AO_quality .. "\n" ..
love.filesystem.read(self.root .. "/shaders/SSAO.glsl")
):gsub(" ", "")
self.shaders.SSAO = love.graphics.newShader(code)
--pass samples to the shader
local f = { }
local range = 64.0
for i = 1, self.AO_quality do
local r = i / self.AO_quality * math.pi * 2
local d = (0.5 + i % 4) / 4
f[#f+1] = {math.cos(r)*d*range / love.graphics.getWidth(), math.sin(r)*d*range / love.graphics.getHeight(), (1-d)^2 / self.AO_quality}
end
self.shaders.SSAO:send("samples", unpack(f))
end
end
--the final canvas combines all resources into one result
local sh_final = love.filesystem.read(lib.root .. "/shaders/final.glsl")
function lib.getFinalShader(self, canvases)
local parts = { }
parts[#parts+1] = canvases.postEffects and "#define POSTEFFECTS_ENABLED" or nil
parts[#parts+1] = canvases.postEffects and self.autoExposure_enabled and "#define AUTOEXPOSURE_ENABLED" or nil
parts[#parts+1] = canvases.postEffects and earlyExposure(canvases) and self.exposure and "#define EXPOSURE_ENABLED" or nil
parts[#parts+1] = canvases.postEffects and earlyExposure(canvases) and self.gamma and "#define GAMMA_ENABLED" or nil
parts[#parts+1] = canvases.postEffects and self.bloom_enabled and "#define BLOOM_ENABLED" or nil
parts[#parts+1] = self.fog_enabled and "#define FOG_ENABLED" or nil
parts[#parts+1] = self.AO_enabled and "#define AO_ENABLED" or nil
parts[#parts+1] = (canvases.refractions or canvases.averageAlpha) and "#define ALPHAPASS_ENABLED" or nil
parts[#parts+1] = canvases.averageAlpha and "#define AVERAGE_ALPHA" or nil
parts[#parts+1] = (canvases.fxaa and canvases.msaa == 0) and "#define FXAA_ENABLED" or nil
if self.fog_enabled then
parts[#parts+1] = codes.fog
end
local ID = table.concat(parts, "\n")
if not self.shaders.final[ID] then
self.shaders.final[ID] = love.graphics.newShader("#pragma language glsl3\n" .. ID .. "\n" .. sh_final)
end
return self.shaders.final[ID]
end
--returns and initializes if not already done
do
local lastID = 0
function lib:getShaderModule(name)
local sh = self.shaderLibrary.module[name]
--give unique bit ID
if not sh.ID then
sh.ID = 2 ^ lastID
lastID = lastID + 1
end
--initilized module
self.allActiveShaderModules[name] = sh
if not sh.initilized then
sh.initilized = true
if sh.init then
sh:init(self)
end
end
return sh
end
end
--get a unique ID for this specific light setup
do
local lastID = 0
local IDs = { }
function lib:getLightSetupID(lights, types)
local ID = {0, 0, 0, 0, 0, 0, 0, 0}
if lights then
for d,s in pairs(types) do
if not IDs[d] then
lastID = lastID + 1
IDs[d] = lastID
end
ID[IDs[d]] = lib.shaderLibrary.light[d].batchable and 1 or s
end
end
return string.char(unpack(ID))
end
end
--construct a shader
local baseShader = love.filesystem.read(lib.root .. "/shaders/base.glsl")
local baseShadowShader = love.filesystem.read(lib.root .. "/shaders/shadow.glsl")
function lib:getRenderShader(o, pass, canvases, light, shadows)
local mat = o.material
local shaderType = o.shaderType
local reflection = o.reflection or o.obj and o.obj.reflection or self.sky_reflection
local refractions = mat.ior ~= 1.0
local modules = o.modules or o.obj and o.obj.modules or mat.modules
--check if required shader exists
assert(self.shaderLibrary.base[shaderType], "Shader '" .. shaderType .. "' does not exist!")
--get unique IDs for the components
local ID_base = self.shaderLibrary.base[shaderType]:getTypeID(self, mat)
local ID_light = shadows and 0 or light.ID
local ID_settings = 0
local ID_modules = 0
--global modules
local m = { }
for d,s in pairs(self.activeShaderModules) do
local sm = self:getShaderModule(d)
if not shadows or sm.shadow then
m[d] = sm
ID_modules = ID_modules + sm.ID
end
end
--local modules
if modules then
for d,s in pairs(modules) do
if not self.activeShaderModules[d] then
local sm = self:getShaderModule(d)
if not shadows or sm.shadow then
m[d] = sm
ID_modules = ID_modules + sm.ID
end
end
end
end
--settings
local globalDefines
if not shadows then
globalDefines = { }
if reflection then
ID_settings = ID_settings + 2 ^ 0
end
if canvases.refractions and refractions and pass == 2 then
ID_settings = ID_settings + 2 ^ 1
table.insert(globalDefines, "#define REFRACTIONS_ENABLED")
end
if canvases.averageAlpha and pass == 2 then
ID_settings = ID_settings + 2 ^ 2
table.insert(globalDefines, "#define AVERAGE_ENABLED")
end
if canvases.postEffects and self.exposure and earlyExposure(canvases) then
ID_settings = ID_settings + 2 ^ 3
table.insert(globalDefines, "#define EXPOSURE_ENABLED")
end
if canvases.postEffects and self.gamma and earlyExposure(canvases) then
ID_settings = ID_settings + 2 ^ 4
table.insert(globalDefines, "#define GAMMA_ENABLED")
end
if self.fog_enabled and canvases.mode ~= "normal" then
ID_settings = ID_settings + 2 ^ 5
table.insert(globalDefines, "#define FOG_ENABLED")
end
if pass == 2 then
ID_settings = ID_settings + 2 ^ 6
table.insert(globalDefines, "#define ALPHA_PASS")
end
if pass == 1 and (mat.discard or mat.alpha or mat.dither or self.dither) then
ID_settings = ID_settings + 2 ^ 7
table.insert(globalDefines, "#define DISCARD_ENABLED")
end
if mat.translucent > 0 then
ID_settings = ID_settings + 2 ^ 8
table.insert(globalDefines, "#define TRANSLUCENT_ENABLED")
end
end
--construct full ID (8 bytes light, 1 byte base, 4 bytes modules and 1 byte settings
local ID = ID_light .. string.char(ID_base, (ID_modules / 256^3) % 256, (ID_modules / 256^2) % 256, (ID_modules / 256^1) % 256, (ID_modules / 256^0) % 256, math.floor(ID_settings / 256), ID_settings % 256)
if not self.mainShaders[ID] then
--construct shader
local code = shadows and baseShadowShader or baseShader
--additional data
self.mainShaders[ID] = {
shaderType = shaderType,
modules = m,
reflection = not shadows and reflection,
shadows = shadows,
}
local info = self.mainShaders[ID]
if not shadows then
--setting specific defines
code = code:gsub("#import globalDefines", table.concat(globalDefines, "\n"))
--the shader might need additional code
code = code:gsub("#import mainDefines", self.shaderLibrary.base[shaderType]:constructDefines(self, mat) or "")
code = code:gsub("#import mainPixelPre", self.shaderLibrary.base[shaderType]:constructPixelPre(self, mat) or "")
code = code:gsub("#import mainPixelPost", self.shaderLibrary.base[shaderType]:constructPixelPost(self, mat) or "")
code = code:gsub("#import mainPixel", self.shaderLibrary.base[shaderType]:constructPixel(self, mat) or "")
code = code:gsub("#import mainVertex", self.shaderLibrary.base[shaderType]:constructVertex(self, mat) or "")
--import reflection function
code = code:gsub("#import reflections", info.reflection and codes.reflections or codes.ambientOnly)
end
--import additional modules
local define = { }
local vertex = { }
local pixel = { }
local pixelPost = { }
for d,s in pairs(m) do
assert(s, "Shader module '" .. d .. "' does not exist!")
table.insert(define, s.constructDefines and s:constructDefines(self, info) or "")
table.insert(vertex, s.constructVertex and s:constructVertex(self, info) or "")
table.insert(pixel, s.constructPixel and s:constructPixel(self, info) or "")
table.insert(pixelPost, s.constructPixelPost and s:constructPixelPost(self, info) or "")
end
code = code:gsub("#import modulesDefines", table.concat(define, "\n"))
code = code:gsub("#import modulesVertex", table.concat(vertex, "\n"))
code = code:gsub("#import modulesPixelPost", table.concat(pixelPost, "\n"))
code = code:gsub("#import modulesPixel", table.concat(pixel, "\n"))
if not shadows then
--fog engine
if self.fog_enabled and canvases.mode ~= "normal" then
code = code:gsub("#import fog", codes.fog)
end
--construct forward lighting system
if #light.lights > 0 then
local lcInit, lc = self:getLightComponents(light)
code = code:gsub("#import lightingSystemInit", table.concat(lcInit, "\n"))
code = code:gsub("#import lightingSystem", table.concat(lc, "\n"))
code = code:gsub("#import lightFunction", self.shaderLibrary.base[shaderType]:constructLightFunction(self, info))
end
end
--remove unused imports and remove tabs
code = code:gsub("#import", "//#import")
code = code:gsub(" ", "")
--compile
info.shader = love.graphics.newShader(code)
--count
self.mainShaderCount = self.mainShaderCount + 1
end
return self.mainShaders[ID]
end
local baseParticlesShader = love.filesystem.read(lib.root .. "/shaders/particles.glsl")
local baseParticleShader = love.filesystem.read(lib.root .. "/shaders/particle.glsl")
function lib:getParticlesShader(canvases, light, emissive, single)
--additional settings
local globalDefines = { }
local ID_settings = 0
if emissive then
ID_settings = ID_settings + 2^0
table.insert(globalDefines, "#define TEX_EMISSION")
end
if canvases.postEffects and self.exposure and earlyExposure(canvases) then
ID_settings = ID_settings + 2^1
table.insert(globalDefines, "#define EXPOSURE_ENABLED")
end
if canvases.postEffects and self.gamma and earlyExposure(canvases) then
ID_settings = ID_settings + 2^2
table.insert(globalDefines, "#define GAMMA_ENABLED")
end
if self.fog_enabled and canvases.mode ~= "normal" then
ID_settings = ID_settings + 2^4
table.insert(globalDefines, "#define FOG_ENABLED")
end
if single then
ID_settings = ID_settings + 2^5
end
local ID = light.ID .. string.char(ID_settings)
if not self.particlesShader[ID] then
local info = { }
--construct shader
local code = single and baseParticleShader or baseParticlesShader
--setting specific defines
code = code:gsub("#import globalDefines", table.concat(globalDefines, "\n"))
--fog engine
if self.fog_enabled and canvases.mode ~= "normal" then
code = code:gsub("#import fog", codes.fog)
end
--construct forward lighting system
if light.lights and #light.lights > 0 then
local lcInit, lc = self:getLightComponents(light, true)
code = code:gsub("#import lightingSystemInit", table.concat(lcInit, "\n"))
code = code:gsub("#import lightingSystem", table.concat(lc, "\n"))
end
--remove unused imports and remove tabs
code = code:gsub("#import", "//#import")
code = code:gsub(" ", "")
--compile
info.shader = love.graphics.newShader(code)
self.particlesShader[ID] = info
end
return self.particlesShader[ID]
end
function lib:getLightComponents(light, basic)
local lcInit = { }
local lc = { }
--global defines and code
for d,s in pairs(light.types) do
assert(self.shaderLibrary.light[d], "Light of type '" .. d .. "' does not exist!")
lcInit[#lcInit+1] = self.shaderLibrary.light[d]:constructDefinesGlobal(self)
if basic then
lc[#lc+1] = self.shaderLibrary.light[d]:constructPixelBasicGlobal(self)
else
lc[#lc+1] = self.shaderLibrary.light[d]:constructPixelGlobal(self)
end
end
--defines and code
local IDs = { }
for d,s in ipairs(light.lights) do
IDs[s.light_typ] = (IDs[s.light_typ] or -1) + 1
lcInit[#lcInit+1] = self.shaderLibrary.light[s.light_typ]:constructDefines(self, IDs[s.light_typ])
local px
if basic then
px = self.shaderLibrary.light[s.light_typ]:constructPixelBasic(self, IDs[s.light_typ])
else
px = self.shaderLibrary.light[s.light_typ]:constructPixel(self, IDs[s.light_typ])
end
if px then
lc[#lc+1] = "{\n" .. px .. "\n}"
end
end
return lcInit, lc
end |
local ffi = require("cffi")
-- strings are convertible to char pointers
local foo = "hello world"
local foop = ffi.cast("const char *", foo)
assert(ffi.string(foop) == "hello world")
-- pointer<->number conversions
local up = ffi.cast("uintptr_t", foop)
local op = ffi.cast("const char *", up)
assert(ffi.string(op) == "hello world")
assert(op == foop)
|
local date = require('os').date
local success, parent = pcall(require, '../package')
local serverName = success and (parent.name .. " v" .. parent.version)
return function(req, res, go)
local isHead = false
if req.method == "HEAD" then
req.method = "GET"
isHead = true
end
local requested = req.headers["if-none-match"]
go()
-- We could use the fancy metatable, but this is much faster
local lowerHeaders = {}
local headers = res.headers
for i = 1, #headers do
local key, value = unpack(headers[i])
lowerHeaders[key:lower()] = value
end
if not lowerHeaders.server then
headers[#headers + 1] = {"Server", serverName}
end
if not lowerHeaders.date then
headers[#headers + 1] = {"Date", date("!%a, %d %b %Y %H:%M:%S GMT")}
end
if not lowerHeaders.connection then
if req.keepAlive then
lowerHeaders.connection = "Keep-Alive"
headers[#headers + 1] = {"Connection", "Keep-Alive"}
else
headers[#headers + 1] = {"Connection", "Close"}
end
end
res.keepAlive =
lowerHeaders.connection and lowerHeaders.connection:lower() ==
"keep-alive"
local body = res.body
if body then
local needLength = not lowerHeaders["content-length"] and
not lowerHeaders["transfer-encoding"]
if type(body) == "string" then
if needLength then
headers[#headers + 1] = {"Content-Length", #body}
end
else
if needLength then
headers[#headers + 1] = {"Transfer-Encoding", "chunked"}
end
end
if not lowerHeaders["content-type"] then
headers[#headers + 1] = {"Content-Type", "text/plain"}
end
end
local etag = lowerHeaders.etag
if requested and res.code >= 200 and res.code < 300 and requested == etag then
res.code = 304
body = nil
end
if isHead then body = nil end
res.body = body
end
|
local ssl = require "ngx.ssl"
local pl_file = require "pl.file"
local helpers = require "spec.helpers"
local utils = require "kong.tools.utils"
local constants = require "kong.constants"
local KONG_VERSION = require "kong.meta"._VERSION
local CLUSTERING_SYNC_STATUS = constants.CLUSTERING_SYNC_STATUS
local VNEG_ENDPOINT = "/version-handshake"
local SERVER_NAME = "kong_clustering"
local CERT_FNAME = "spec/fixtures/kong_clustering.crt"
local CERT_KEY_FNAME = "spec/fixtures/kong_clustering.key"
local CLIENT_CERT = assert(ssl.parse_pem_cert(assert(pl_file.read(CERT_FNAME))))
local CLIENT_PRIV_KEY = assert(ssl.parse_pem_priv_key(assert(pl_file.read(CERT_KEY_FNAME))))
for _, strategy in helpers.each_strategy() do
describe("[ #" .. strategy .. " backend]", function()
describe("connect to endpoint", function()
local bp, db
local client_setup = {
host = "127.0.0.1",
port = 9005,
scheme = "https",
ssl_verify = false,
ssl_client_cert = CLIENT_CERT,
ssl_client_priv_key = CLIENT_PRIV_KEY,
ssl_server_name = SERVER_NAME,
}
lazy_setup(function()
bp, db = helpers.get_db_utils(strategy, {
"routes",
"services",
"plugins",
"upstreams",
"targets",
"certificates",
"clustering_data_planes",
}) -- runs migrations
bp.plugins:insert {
name = "key-auth",
}
assert(helpers.start_kong({
role = "control_plane",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
database = strategy,
db_update_frequency = 3,
cluster_listen = "127.0.0.1:9005",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_version_check = "major_minor",
}))
end)
before_each(function()
db:truncate("clustering_data_planes")
end)
lazy_teardown(function()
helpers.stop_kong()
end)
it("rejects plaintext request", function()
local client = helpers.http_client{
host = "127.0.0.1",
port = 9005,
scheme = "http",
}
local res = assert(client:post(VNEG_ENDPOINT))
assert.res_status(400, res)
end)
for _, req_method in ipairs{"GET", "HEAD", "PUT", "DELETE", "PATCH"} do
it(string.format("rejects HTTPS method %q", req_method), function()
local client = helpers.http_client(client_setup)
local res = assert(client:send({ method = req_method, path = VNEG_ENDPOINT }))
assert.res_status(400, res)
end)
end
it("rejects text body", function()
local client = helpers.http_client(client_setup)
local res = assert(client:post(VNEG_ENDPOINT, {
headers = { ["Content-Type"] = "text/html; charset=UTF-8"},
body = "stuff",
}))
assert.res_status(400, res)
end)
it("accepts HTTPS method \"POST\"", function()
local client = helpers.http_client(client_setup)
local res = assert(client:post(VNEG_ENDPOINT, {
headers = { ["Content-Type"] = "application/json"},
body = {
node = {
id = utils.uuid(),
type = "KONG",
version = KONG_VERSION,
hostname = "localhost",
},
services_requested = {},
},
}))
assert.res_status(200, res)
assert.response(res).jsonbody()
end)
it("rejects if there's something weird in the services_requested array", function()
local client = helpers.http_client(client_setup)
local res = assert(client:post(VNEG_ENDPOINT, {
headers = { ["Content-Type"] = "application/json"},
body = {
node = {
id = utils.uuid(),
type = "KONG",
version = KONG_VERSION,
hostname = "localhost",
},
services_requested = { "hi" },
},
}))
assert.res_status(400, res)
end)
it("rejects if missing fields", function()
local client = helpers.http_client(client_setup)
local res = assert(client:post(VNEG_ENDPOINT, {
headers = { ["Content-Type"] = "application/json"},
body = {
node = {
id = utils.uuid(),
version = KONG_VERSION,
hostname = "localhost",
},
services_requested = {},
},
}))
assert.res_status(400, res)
local body = assert.response(res).jsonbody()
assert.is_string(body.message)
end)
it("API shows DP status", function()
local client = helpers.http_client(client_setup)
do
local node_id = utils.uuid()
local res = assert(client:post(VNEG_ENDPOINT, {
headers = { ["Content-Type"] = "application/json"},
body = {
node = {
id = node_id,
type = "KONG",
version = KONG_VERSION,
hostname = "localhost",
},
services_requested = {
{
name = "Config",
versions = { "v0" },
},
{
name = "infundibulum",
versions = { "chronoscolastic", "kitchen" }
}
},
},
}))
assert.res_status(200, res)
local body = assert.response(res).jsonbody()
assert.is_string(body.node.id)
assert.same({
{
name = "config",
version = "v0",
message = "JSON over WebSocket",
},
}, body.services_accepted)
assert.same({
{ name = "infundibulum", message = "unknown service." },
}, body.services_rejected)
end
helpers.wait_until(function()
local admin_client = helpers.admin_client()
finally(function()
admin_client:close()
end)
local res = assert(admin_client:get("/clustering/data-planes"))
assert.res_status(200, res)
local body = assert.response(res).jsonbody()
for _, v in pairs(body.data) do
if v.ip == "127.0.0.1" then
assert.near(14 * 86400, v.ttl, 3)
assert.matches("^(%d+%.%d+)%.%d+", v.version)
assert.equal(CLUSTERING_SYNC_STATUS.NORMAL, v.sync_status)
return true
end
end
end, 10)
end)
it("negotiation client", function()
-- (re)load client with special set of requested services
package.loaded["kong.clustering.version_negotiation.services_requested"] = {
{
name = "Config",
versions = { "v0", "v1" },
},
{
name = "infundibulum",
versions = { "chrono-synclastic", "kitchen" }
},
}
package.loaded["kong.clustering.version_negotiation"] = nil
local version_negotiation = require "kong.clustering.version_negotiation"
local conf = {
cluster_control_plane = "127.0.0.1:9005",
cluster_mtls = "shared",
}
local data = assert(version_negotiation.request_version_handshake(conf, CLIENT_CERT, CLIENT_PRIV_KEY))
-- returns data in standard form
assert.same({
{ name = "config", version = "v1", message = "wRPC" },
}, data.services_accepted)
assert.same({
{ name = "infundibulum", message = "unknown service." },
}, data.services_rejected)
-- stored node-wise as Lua-style values
-- accepted
assert.same({ "v1", "wRPC" }, { version_negotiation.get_negotiated_service("Config") })
-- rejected
assert.same({ nil, "unknown service." }, { version_negotiation.get_negotiated_service("infundibulum") })
-- not even requested
assert.same({}, { version_negotiation.get_negotiated_service("thingamajig") })
end)
end)
end)
end
|
--[[
Name: "sv_hooks.lua".
Product: "nexus".
--]]
local MOUNT = MOUNT;
-- Called when nexus has loaded all of the entities.
function MOUNT:NexusInitPostEntity() self:LoadAreaDisplays(); end;
-- Called when a player's data stream info should be sent.
function MOUNT:PlayerSendDataStreamInfo(player)
NEXUS:StartDataStream(player, "AreaDisplays", self.areaDisplays);
end; |
objs = {}
function objs.update(dt)
for i,o in ipairs(objs) do
o:update(dt, i)
objs.globalUpdate(o, i)
end
end
function objs.draw()
for i,o in ipairs(objs) do
o:draw()
end
end
function objs.remove(i)
local o = objs[i]
table.remove(objs, i)
if o.physics ~= nil then
o.physics.body:destroy()
o.physics.body:release()
o.physics = nil
end
end
--for specific updates we want to apply globally to the objects
function objs.globalUpdate(o, i)
--destroy objects that go out of the bottom of the screen
local oy = nil
if o.name == "egg" then
local x, y = GetPolygonCenter(o)
oy = o.y or y
elseif o.name ~= "Bjornio" then
oy = o.physics.body:getY()
end
if oy ~= nil and (oy - 80) > (-Camera.y + WINDOW_HEIGHT) then
objs.remove(i);
end
end |
Locales['es'] = {
['GPS_info'] = 'La central indicaba un bote de basura en su ~ y ~ GPS',
['cancel_mission'] = 'Has cancelado la misión.',
['pickup'] = '~INPUT_CONTEXT~ Para recoger la basura',
['end_service'] = 'Servicio final',
['take_service'] = 'Toma su servicio',
['end_service_notif'] = 'Fin de ~r~Service',
['take_service_notif'] = 'Tomando ~ g ~ Servicio',
['start_job'] = 'Use la tecla ~ b ~ BORRAR ~ w ~ para comenzar su turno ~ b ~',
['Vehicle_Menu_Title'] = 'Vehículo de servicio',
['in_vehicle'] = '~ r ~ ¡Sal de tu vehículo!',
['vehicle_broken'] = '~ r ~ ¡Ve a reparar el vehículo antes!',
['bad_vehicle'] = 'Solo puede almacenar ~ b ~ vehículos de servicio',
['not_good_veh'] = '~ r ~ Debe estar en su vehículo de servicio',
['stop_npc'] = 'Acción ~ r ~ imposible ~ s ~: Reunión en el centro de Prosegur',
} |
ngx.say("hello suggestion")
|
local Model = require("lib.model")
local config = require("config.app")
local Tag = Model:new('post_tags')
return Tag |
data.raw['roboport-equipment']['personal-roboport-equipment'].charging_energy = "100MW"
data.raw['roboport-equipment']['personal-roboport-mk2-equipment'].charging_energy = "100MW"
|
local GlobalBaseStats = require(script:GetCustomProperty("GlobalBaseStats"))
function Activate()
GlobalBaseStats.currentStats.recoveryMul = GlobalBaseStats.currentStats.recoveryMul + 4
end
local Effect = {}
Effect.Activate = Activate
return Effect |
Locales['fr'] = {
['robbery_cancelled'] = 'Le braquage a été annulé, vous ne gagnerez rien!',
['robbery_successful'] = 'Braquage réussi, vous avez obtenu des! ~g~$',
['bank_robbery'] = 'Braquage de banque',
['press_to_rob'] = 'Appuyez sur ~INPUT_CONTEXT~ pour braquer ~b~',
['press_to_cancel'] = 'Appuyez sur ~INPUT_CONTEXT~ pour annuler le braquage ~b~',
['press_to_hack'] = 'Appuyez sur ~INPUT_CONTEXT~ pour lancer le hack ~b~',
['press_to_bomb'] = 'Appuyez sur ~INPUT_CONTEXT~ pour placer la bombe ~b~',
['robbery_of'] = 'Braquage de banque: ~r~',
['bomb_of'] = 'Bombe plantée: ~r~',
['hack_of'] = 'Hacking de la banque: ~r~',
['seconds_remaining'] = '~w~ secondes restantes',
['robbery_cancelled_at'] = '~r~ a été annulé à: ~b~',
['robbery_has_cancelled'] = '~r~ Le braquage a été annulé: ~b~',
['already_robbed'] = 'Cette banque a déjà été braquée. Revenez dans: ',
['seconds'] = 'secondes.',
['rob_in_prog'] = '~r~ Braquage en cours à: ~b~',
['started_to_rob'] = 'Vous avez débuter un braquage ',
['started_to_hack'] = 'Vous avez commencé à hack ',
['started_to_plantbomb'] = 'Vous avez commencé à planter la bombe ',
['do_not_move'] = ', Ne bougez pas!',
['alarm_triggered'] = 'Les alarmes ont été déclanchées',
['hack_failed'] = 'Votre tentative de hacking de la porte a échouée!',
['hold_pos'] = 'Tenez la banque pendant 5 minutes et l\'argent est à vous!',
['hold_pos_hack'] = 'Tenez la banque pendant que vous piratez la porte blindée et vous accéderez à l\'intérieur!',
['hold_pos_plantbomb'] = 'Tenez la banque pendant que vous plantez la bombe, vous êtes presque!',
['leave'] = 'Appuyez sur ~INPUT_CONTEXT~ pour quitter ',
['robbery_complete'] = '~r~ Braquage réussi.~s~ ~h~ Courrez! ',
['hack_complete'] = '~r~ Piratage réussi. Au boulot, courrez! ',
['robbery_complete_at'] = '~r~ Braquage terminée à: ~b~',
['min_two_police'] = 'Nombre d\'officiers de policer nécéssaire: ',
['robbery_already'] = '~r~ There is already a robbery in progress.',
['bombplanted_run'] = 'Vous avez planter la bombe, courrez et planquez vous! Elle explosera dans 20 secondes',
['bombplanted_at'] = 'Une bombe a été plantée à: ~b~ !',
['raspberry_needed'] = 'Vous avez besoin d\'un rasperry pour pirater!',
['c4_needed'] = 'Vous avez besoin de pains de C4 pour exploser la porte!',
['blowtorch_needed'] = 'Vous avez besoin d\'un chalumeau pour ouvrir les casiers!',
}
|
-------------------------------------------------------------------------------
-- SF Editor
-- Originally created by Jazzelhawk
--
-- To do:
-- Find new icons
-------------------------------------------------------------------------------
SF.Editor = {}
local addon_path = nil
do
local tbl = debug.getinfo( 1 )
local file = tbl.short_src
addon_path = string.TrimRight( string.match( file, ".-/.-/" ), "/" )
end
if CLIENT then
include( "sfderma.lua" )
-- Colors
SF.Editor.colors = {}
SF.Editor.colors.dark = Color( 36, 41, 53 )
SF.Editor.colors.meddark = Color( 48, 57, 92 )
SF.Editor.colors.med = Color( 78, 122, 199 )
SF.Editor.colors.medlight = Color( 127, 178, 240 )
SF.Editor.colors.light = Color( 173, 213, 247 )
-- Icons
SF.Editor.icons = {}
SF.Editor.icons.arrowr = Material( "radon/arrow_right.png", "noclamp smooth" )
SF.Editor.icons.arrowl = Material( "radon/arrow_left.png", "noclamp smooth" )
local defaultCode = [[--@name
--@author
--[[
Starfall Scripting Environment
More info: http://inpstarfall.github.io/Starfall
Github: http://github.com/INPStarfall/Starfall
Reference Page: http://sf.inp.io
Development Thread: http://www.wiremod.com/forum/developers-showcase/22739-starfall-processor.html
Default Keyboard shortcuts: https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts
]].."]]"
local invalid_filename_chars = {
["*"] = "",
["?"] = "",
[">"] = "",
["<"] = "",
["|"] = "",
["\\"] = "",
['"'] = "",
}
CreateClientConVar( "sf_editor_width", 1100, true, false )
CreateClientConVar( "sf_editor_height", 760, true, false )
CreateClientConVar( "sf_editor_posx", ScrW()/2-1100/2, true, false )
CreateClientConVar( "sf_editor_posy", ScrH()/2-760/2, true, false )
CreateClientConVar( "sf_fileviewer_width", 263, true, false )
CreateClientConVar( "sf_fileviewer_height", 760, true, false )
CreateClientConVar( "sf_fileviewer_posx", ScrW()/2-1100/2-263, true, false )
CreateClientConVar( "sf_fileviewer_posy", ScrH()/2-760/2, true, false )
CreateClientConVar( "sf_fileviewer_locked", 1, true, false )
CreateClientConVar( "sf_editor_widgets", 1, true, false )
CreateClientConVar( "sf_editor_linenumbers", 1, true, false )
CreateClientConVar( "sf_editor_gutter", 1, true, false )
CreateClientConVar( "sf_editor_invisiblecharacters", 0, true, false )
CreateClientConVar( "sf_editor_indentguides", 1, true, false )
CreateClientConVar( "sf_editor_activeline", 1, true, false )
CreateClientConVar( "sf_editor_autocompletion", 1, true, false )
CreateClientConVar( "sf_editor_fixkeys", system.IsLinux() and 1 or 0, true, false ) --maybe osx too? need someone to check
CreateClientConVar( "sf_editor_fixconsolebug", 0, true, false )
CreateClientConVar( "sf_editor_disablequitkeybind", 0, true, false )
local aceFiles = {}
local htmlEditorCode = nil
function SF.Editor.init ()
if not SF.Editor.safeToInit then
SF.AddNotify( LocalPlayer(), "Starfall is downloading editor files, please wait.", NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
return false
end
if SF.Editor.initialized or #aceFiles == 0 or htmlEditorCode == nil then
SF.AddNotify( LocalPlayer(), "Failed to initialize Starfall editor.", NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
return false
end
if not file.Exists( "starfall", "DATA" ) then
file.CreateDir( "starfall" )
end
SF.Editor.editor = SF.Editor.createEditor()
SF.Editor.fileViewer = SF.Editor.createFileViewer()
SF.Editor.fileViewer:close()
SF.Editor.settingsWindow = SF.Editor.createSettingsWindow()
SF.Editor.settingsWindow:close()
SF.Editor.runJS = function ( ... )
SF.Editor.editor.components.htmlPanel:QueueJavascript( ... )
end
SF.Editor.updateSettings()
local tabs = util.JSONToTable( file.Read( "sf_tabs.txt" ) or "" )
if tabs ~= nil and #tabs ~= 0 then
for k, v in pairs( tabs ) do
if type( v ) ~= "number" then
SF.Editor.addTab( v.filename, v.code )
end
end
SF.Editor.selectTab( tabs.selectedTab or 1 )
else
SF.Editor.addTab()
end
SF.Editor.editor:close()
SF.Editor.initialized = true
return true
end
function SF.Editor.open ()
if not SF.Editor.initialized then
if not SF.Editor.init() then return end
end
SF.Editor.editor:open()
if CanRunConsoleCommand() then
RunConsoleCommand( "starfall_event", "editor_open" )
end
end
function SF.Editor.close ()
SF.Editor.editor:close()
if CanRunConsoleCommand() then
RunConsoleCommand( "starfall_event", "editor_close" )
end
end
function SF.Editor.updateCode () -- Incase anyone needs to force update the code
SF.Editor.runJS( "console.log(\"RUNLUA:SF.Editor.getActiveTab().code = \\\"\" + addslashes(editor.getValue()) + \"\\\"\")" )
end
function SF.Editor.getCode ()
return SF.Editor.getActiveTab().code
end
function SF.Editor.getOpenFile ()
return SF.Editor.getActiveTab().filename
end
function SF.Editor.getTabHolder ()
return SF.Editor.editor.components[ "tabHolder" ]
end
function SF.Editor.getActiveTab ()
return SF.Editor.getTabHolder():getActiveTab()
end
function SF.Editor.selectTab ( tab )
local tabHolder = SF.Editor.getTabHolder()
if type( tab ) == "number" then
tab = math.min( tab, #tabHolder.tabs )
tab = tabHolder.tabs[ tab ]
end
if tab == nil then
SF.Editor.selectTab( 1 )
return
end
tabHolder:selectTab( tab )
SF.Editor.runJS( "selectEditSession("..tabHolder:getTabIndex( tab )..")" )
end
function SF.Editor.addTab ( filename, code )
local name = filename or "generic"
if code then
local ppdata = {}
SF.Preprocessor.ParseDirectives( "file", code, {}, ppdata )
if ppdata.scriptnames and ppdata.scriptnames.file ~= "" then
name = ppdata.scriptnames.file
end
end
code = code or defaultCode
SF.Editor.runJS( "newEditSession(\""..string.JavascriptSafe( code or defaultCode ).."\")" )
local tab = SF.Editor.getTabHolder():addTab( name )
tab.code = code
tab.name = name
tab.filename = filename
function tab:DoClick ()
SF.Editor.selectTab( self )
end
SF.Editor.selectTab( tab )
end
function SF.Editor.removeTab ( tab )
local tabHolder = SF.Editor.getTabHolder()
if type( tab ) == "number" then
tab = tabHolder.tabs[ tab ]
end
if tab == nil then return end
tabHolder:removeTab( tab )
end
function SF.Editor.saveTab ( tab )
if not tab.filename then SF.Editor.saveTabAs( tab ) return end
local saveFile = "starfall/" .. tab.filename
file.Write( saveFile, tab.code )
SF.Editor.updateTabName( tab )
SF.AddNotify( LocalPlayer(), "Starfall code saved as " .. saveFile .. ".", NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
end
function SF.Editor.saveTabAs ( tab )
SF.Editor.updateTabName( tab )
local saveName = ""
if tab.filename then
saveName = string.StripExtension( tab.filename )
else
saveName = tab.name or "generic"
end
Derma_StringRequestNoBlur(
"Save File",
"",
saveName,
function ( text )
if text == "" then return end
text = string.gsub( text, ".", invalid_filename_chars )
local saveFile = "starfall/" .. text .. ".txt"
file.Write( saveFile, tab.code )
SF.AddNotify( LocalPlayer(), "Starfall code saved as " .. saveFile .. ".", NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
SF.Editor.fileViewer.components[ "browser" ].tree:reloadTree()
tab.filename = text .. ".txt"
SF.Editor.updateTabName( tab )
end
)
end
function SF.Editor.doValidation ( forceShow )
local function valid ()
local code = SF.Editor.getActiveTab().code
local err = CompileString( code, "Validation", false )
if type( err ) ~= "string" then
if forceShow then SF.AddNotify( LocalPlayer(), "Validation successful", NOTIFY_GENERIC, 3, NOTIFYSOUND_DRIP3 ) end
SF.Editor.runJS( "editor.session.clearAnnotations(); clearErrorLines()" )
return
end
local row = tonumber( err:match( "%d+" ) ) - 1
local message = err:match( ": .+$" ):sub( 3 )
SF.Editor.runJS( string.format( "editor.session.setAnnotations([{row: %d, text: \"%s\", type: \"error\"}])", row, message:JavascriptSafe() ) )
SF.Editor.runJS( [[
clearErrorLines();
var Range = ace.require("ace/range").Range;
var range = new Range(]] .. row .. [[, 1, ]] .. row .. [[, Infinity);
editor.session.addMarker(range, "ace_error", "screenLine");
]] )
if not forceShow then return end
SF.Editor.runJS( "editor.session.unfold({row: " .. row .. ", column: 0})" )
SF.Editor.runJS( "editor.scrollToLine( " .. row .. ", true )" )
end
if forceShow then valid() return end
if not timer.Exists( "validationTimer" ) or ( timer.Exists( "validationTimer") and not timer.Adjust( "validationTimer", 0.5, 1, valid ) ) then
timer.Remove( "validationTimer" )
timer.Create( "validationTimer", 0.5, 1, valid )
end
end
local function createLibraryMap ()
local map = {}
for lib, tbl in pairs( SF.Types ) do
if ( lib == "Environment" or lib:find( "Library: " ) ) and type( tbl.__index ) == "table" then
lib = lib:Replace( "Library: ", "" )
map[ lib ] = {}
for name, val in pairs( tbl.__index ) do
table.insert( map[ lib ], name )
end
end
end
map.Angle = {}
for name, val in pairs( SF.Angles.Methods ) do
table.insert( map.Angle, name )
end
map.Color = {}
for name, val in pairs( SF.Color.Methods ) do
table.insert( map.Color, name )
end
map.Entity = {}
for name, val in pairs( SF.Entities.Methods ) do
table.insert( map.Entity, name )
end
map.Player = {}
for name, val in pairs( SF.Players.Methods ) do
table.insert( map.Player, name )
end
map.Sound = {}
for name, val in pairs( SF.Sounds.Methods ) do
table.insert( map.Sound, name )
end
map.VMatrix = {}
for name, val in pairs( SF.VMatrix.Methods ) do
table.insert( map.VMatrix, name )
end
map.Vector = {}
for name, val in pairs( SF.Vectors.Methods ) do
table.insert( map.Vector, name )
end
return map
end
function SF.Editor.refreshTab ( tab )
local tabHolder = SF.Editor.getTabHolder()
if type( tab ) == "number" then
tab = tabHolder.tabs[ tab ]
end
if tab == nil then return end
SF.Editor.updateTabName( tab )
local fileName = tab.filename
local tabIndex = tabHolder:getTabIndex( tab )
if not fileName or not file.Exists( "starfall/" .. fileName, "DATA" ) then
SF.AddNotify( LocalPlayer(), "Unable to refresh tab as file doesn't exist", NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
return
end
local fileData = file.Read( "starfall/" .. fileName, "DATA" )
SF.Editor.runJS( "editSessions[ " .. tabIndex .. " - 1 ].setValue( \"" .. fileData:JavascriptSafe() .. "\" )" )
SF.Editor.updateTabName( tab )
SF.AddNotify( LocalPlayer(), "Refreshed tab: " .. fileName, NOTIFY_GENERIC, 5, NOTIFYSOUND_DRIP3 )
end
function SF.Editor.updateTabName ( tab )
local ppdata = {}
SF.Preprocessor.ParseDirectives( "tab", tab.code, {}, ppdata )
if ppdata.scriptnames and ppdata.scriptnames.tab ~= "" then
tab.name = ppdata.scriptnames.tab
else
tab.name = tab.filename or "generic"
end
tab:SetText( tab.name )
end
function SF.Editor.createEditor ()
local editor = vgui.Create( "StarfallFrame" )
editor:SetSize( 800, 600 )
editor:SetTitle( "Starfall Code Editor" )
editor:Center()
function editor:OnKeyCodePressed ( keyCode )
if keyCode == KEY_S and ( input.IsKeyDown( KEY_LCONTROL ) or input.IsKeyDown( KEY_RCONTROL ) ) then
SF.Editor.saveTab( SF.Editor.getActiveTab() )
elseif keyCode == KEY_Q and ( input.IsKeyDown( KEY_LCONTROL ) or input.IsKeyDown( KEY_RCONTROL ) )
and GetConVarNumber( "sf_editor_disablequitkeybind" ) == 0 then
SF.Editor.close()
end
end
local buttonHolder = editor.components[ "buttonHolder" ]
buttonHolder:getButton( "Close" ).DoClick = function ( self )
SF.Editor.close()
end
buttonHolder:removeButton( "Lock" )
local buttonSaveExit = vgui.Create( "StarfallButton", buttonHolder )
buttonSaveExit:SetText( "Save and Exit" )
function buttonSaveExit:DoClick ()
SF.Editor.saveTab( SF.Editor.getActiveTab() )
SF.Editor.close()
end
buttonHolder:addButton( "SaveExit", buttonSaveExit )
local buttonSettings = vgui.Create( "StarfallButton", buttonHolder )
buttonSettings:SetText( "Settings" )
function buttonSettings:DoClick ()
if SF.Editor.settingsWindow:IsVisible() then
SF.Editor.settingsWindow:close()
else
SF.Editor.settingsWindow:open()
end
end
buttonHolder:addButton( "Settings", buttonSettings )
local buttonHelper = vgui.Create( "StarfallButton", buttonHolder )
buttonHelper:SetText( "SF Helper" )
function buttonHelper:DoClick ()
if SF.Helper.Frame and SF.Helper.Frame:IsVisible() then
SF.Helper.Frame:close()
else
SF.Helper.show()
end
end
buttonHolder:addButton( "Helper", buttonHelper )
local buttonFiles = vgui.Create( "StarfallButton", buttonHolder )
buttonFiles:SetText( "Files" )
function buttonFiles:DoClick ()
if SF.Editor.fileViewer:IsVisible() then
SF.Editor.fileViewer:close()
else
SF.Editor.fileViewer:open()
end
end
buttonHolder:addButton( "Files", buttonFiles )
local buttonSaveAs = vgui.Create( "StarfallButton", buttonHolder )
buttonSaveAs:SetText( "Save As" )
function buttonSaveAs:DoClick ()
SF.Editor.saveTabAs( SF.Editor.getActiveTab() )
end
buttonHolder:addButton( "SaveAs", buttonSaveAs )
local buttonSave = vgui.Create( "StarfallButton", buttonHolder )
buttonSave:SetText( "Save" )
function buttonSave:DoClick ()
SF.Editor.saveTab( SF.Editor.getActiveTab() )
end
buttonHolder:addButton( "Save", buttonSave )
local buttonNewFile = vgui.Create( "StarfallButton", buttonHolder )
buttonNewFile:SetText( "New tab" )
function buttonNewFile:DoClick ()
SF.Editor.addTab()
end
buttonHolder:addButton( "NewFile", buttonNewFile )
local buttonCloseTab = vgui.Create( "StarfallButton", buttonHolder )
buttonCloseTab:SetText( "Close tab" )
function buttonCloseTab:DoClick ()
SF.Editor.removeTab( SF.Editor.getActiveTab() )
end
buttonHolder:addButton( "CloseTab", buttonCloseTab )
local html = vgui.Create( "DHTML", editor )
html:SetPos( 5, 54 )
htmlEditorCode = htmlEditorCode:Replace( "<script>//replace//</script>", table.concat( aceFiles ) )
html:SetHTML( htmlEditorCode )
html:SetAllowLua( true )
local map = createLibraryMap()
html:QueueJavascript( "libraryMap = JSON.parse(\"" .. util.TableToJSON( map ):JavascriptSafe() .. "\")" )
local libs = {}
local functions = {}
table.ForEach( map, function ( lib, vals )
if lib == "Environment" or lib:GetChar( 1 ):upper() ~= lib:GetChar( 1 ) then
table.insert( libs, lib )
end
table.ForEach( vals, function ( key, val )
table.insert( functions, val )
end )
end )
html:QueueJavascript( "createStarfallMode(\"" .. table.concat( libs, "|" ) .. "\", \"" .. table.concat( table.Add( table.Copy( functions ), libs ), "|" ) .. "\")" )
function html:PerformLayout ( ... )
self:SetSize( editor:GetWide() - 10, editor:GetTall() - 59 )
end
function html:OnKeyCodePressed ( key, notfirst )
local function repeatKey ()
timer.Create( "repeatKey"..key, not notfirst and 0.5 or 0.02, 1, function () self:OnKeyCodePressed( key, true ) end )
end
if GetConVarNumber( "sf_editor_fixkeys" ) == 0 then return end
if ( input.IsKeyDown( KEY_LSHIFT ) or input.IsKeyDown( KEY_RSHIFT ) ) and
( input.IsKeyDown( KEY_LCONTROL ) or input.IsKeyDown( KEY_RCONTROL ) ) then
if key == KEY_UP and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.modifyNumber(1)" )
repeatKey()
elseif key == KEY_DOWN and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.modifyNumber(-1)" )
repeatKey()
elseif key == KEY_LEFT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectWordLeft()" )
repeatKey()
elseif key == KEY_RIGHT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectWordRight()" )
repeatKey()
end
elseif input.IsKeyDown( KEY_LSHIFT ) or input.IsKeyDown( KEY_RSHIFT ) then
if key == KEY_LEFT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectLeft()" )
repeatKey()
elseif key == KEY_RIGHT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectRight()" )
repeatKey()
elseif key == KEY_UP and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectUp()" )
repeatKey()
elseif key == KEY_DOWN and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectDown()" )
repeatKey()
elseif key == KEY_HOME and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectLineStart()" )
repeatKey()
elseif key == KEY_END and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.selection.selectLineEnd()" )
repeatKey()
end
elseif input.IsKeyDown( KEY_LCONTROL ) or input.IsKeyDown( KEY_RCONTROL ) then
if key == KEY_LEFT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateWordLeft()" )
repeatKey()
elseif key == KEY_RIGHT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateWordRight()" )
repeatKey()
elseif key == KEY_BACKSPACE and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.removeWordLeft()" )
repeatKey()
elseif key == KEY_DELETE and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.removeWordRight()" )
repeatKey()
elseif key == KEY_SPACE and input.IsKeyDown( key ) then
SF.Editor.doValidation( true )
elseif key == KEY_C and input.IsKeyDown( key ) then
self:QueueJavascript( "console.log(\"RUNLUA:SetClipboardText(\\\"\"+ addslashes(editor.getSelectedText()) +\"\\\")\")" )
end
elseif input.IsKeyDown( KEY_LALT ) or input.IsKeyDown( KEY_RALT ) then
if key == KEY_UP and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.moveLinesUp()" )
repeatKey()
elseif key == KEY_DOWN and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.moveLinesDown()" )
repeatKey()
end
else
if key == KEY_LEFT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateLeft(1)" )
repeatKey()
elseif key == KEY_RIGHT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateRight(1)" )
repeatKey()
elseif key == KEY_UP and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateUp(1)" )
repeatKey()
elseif key == KEY_DOWN and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateDown(1)" )
repeatKey()
elseif key == KEY_HOME and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateLineStart()" )
repeatKey()
elseif key == KEY_END and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateLineEnd()" )
repeatKey()
elseif key == KEY_PAGEUP and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateFileStart()" )
repeatKey()
elseif key == KEY_PAGEDOWN and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.navigateFileEnd()" )
repeatKey()
elseif key == KEY_BACKSPACE and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.remove('left')" )
repeatKey()
elseif key == KEY_DELETE and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.remove('right')" )
repeatKey()
elseif key == KEY_ENTER and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.splitLine(); editor.navigateDown(1); editor.navigateLineStart()" )
repeatKey()
elseif key == KEY_INSERT and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.toggleOverwrite()" )
repeatKey()
elseif key == KEY_TAB and input.IsKeyDown( key ) then
self:QueueJavascript( "editor.indent()" )
repeatKey()
end
end
end
editor:AddComponent( "htmlPanel", html )
function editor:OnOpen ()
html:Call( "editor.focus()" )
html:RequestFocus()
end
local tabHolder = vgui.Create( "StarfallTabHolder", editor )
tabHolder:SetPos( 5, 30 )
tabHolder.menuoptions[ #tabHolder.menuoptions + 1 ] = { "", "SPACER" }
tabHolder.menuoptions[ #tabHolder.menuoptions + 1 ] = { "Save", function ()
if not tabHolder.targetTab then return end
SF.Editor.saveTab( tabHolder.targetTab )
tabHolder.targetTab = nil
end }
tabHolder.menuoptions[ #tabHolder.menuoptions + 1 ] = { "Save As", function ()
if not tabHolder.targetTab then return end
SF.Editor.saveTabAs( tabHolder.targetTab )
tabHolder.targetTab = nil
end }
tabHolder.menuoptions[ #tabHolder.menuoptions + 1 ] = { "", "SPACER" }
tabHolder.menuoptions[ #tabHolder.menuoptions + 1 ] = { "Refresh", function ()
if not tabHolder.targetTab then return end
SF.Editor.refreshTab( tabHolder.targetTab )
tabHolder.targetTab = nil
end }
function tabHolder:OnRemoveTab ( tabIndex )
SF.Editor.runJS( "removeEditSession("..tabIndex..")" )
if #self.tabs == 0 then
SF.Editor.addTab()
end
SF.Editor.selectTab( tabIndex )
end
editor:AddComponent( "tabHolder", tabHolder )
function editor:OnClose ()
local tabs = {}
for k, v in pairs( tabHolder.tabs ) do
tabs[ k ] = {}
tabs[ k ].filename = v.filename
tabs[ k ].code = v.code
end
tabs.selectedTab = SF.Editor.getTabHolder():getTabIndex( SF.Editor.getActiveTab() )
file.Write( "sf_tabs.txt", util.TableToJSON( tabs ) )
local activeWep = LocalPlayer():GetActiveWeapon()
if IsValid( activeWep ) and activeWep:GetClass() == "gmod_tool" and activeWep.Mode == "starfall_processor" then
local model = nil
local ppdata = {}
SF.Preprocessor.ParseDirectives( "file", SF.Editor.getCode(), {}, ppdata )
if ppdata.models and ppdata.models.file ~= "" then
model = ppdata.models.file
end
local tool = activeWep:GetToolObject( "starfall_processor" )
tool.ClientConVar[ "HologramModel" ] = model
end
end
function editor:OnThink ()
if self.Dragged or self.Resized then
SF.Editor.saveSettings()
end
end
return editor
end
function SF.Editor.createFileViewer ()
local fileViewer = vgui.Create( "StarfallFrame" )
fileViewer:SetSize( 200, 600 )
fileViewer:SetTitle( "Starfall File Viewer" )
fileViewer:Center()
local browser = vgui.Create( "StarfallFileBrowser", fileViewer )
local searchBox, tree = browser:getComponents()
tree:setup( "starfall" )
function tree:OnNodeSelected ( node )
if not node:GetFileName() or string.GetExtensionFromFilename( node:GetFileName() ) ~= "txt" then return end
local fileName = string.gsub( node:GetFileName(), "starfall/", "", 1 )
local code = file.Read( node:GetFileName(), "DATA" )
for k, v in pairs( SF.Editor.getTabHolder().tabs ) do
if v.filename == fileName and v.code == code then
SF.Editor.selectTab( v )
return
end
end
SF.Editor.addTab( fileName, code )
end
fileViewer:AddComponent( "browser", browser )
local buttonHolder = fileViewer.components[ "buttonHolder" ]
local buttonLock = buttonHolder:getButton( "Lock" )
buttonLock._DoClick = buttonLock.DoClick
buttonLock.DoClick = function ( self )
self:_DoClick()
SF.Editor.saveSettings()
end
local buttonRefresh = vgui.Create( "StarfallButton", buttonHolder )
buttonRefresh:SetText( "Refresh" )
buttonRefresh:SetHoverColor( Color( 7, 70, 0 ) )
buttonRefresh:SetColor( Color( 26, 104, 17 ) )
buttonRefresh:SetLabelColor( Color( 103, 155, 153 ) )
function buttonRefresh:DoClick ()
tree:reloadTree()
searchBox:SetValue( "Search..." )
end
buttonHolder:addButton( "Refresh", buttonRefresh )
function fileViewer:OnThink ()
if self.Dragged or self.Resized then
SF.Editor.saveSettings()
end
end
function fileViewer:OnOpen ()
SF.Editor.editor.components[ "buttonHolder" ]:getButton( "Files" ).active = true
end
function fileViewer:OnClose ()
SF.Editor.editor.components[ "buttonHolder" ]:getButton( "Files" ).active = false
end
return fileViewer
end
function SF.Editor.createSettingsWindow ()
local frame = vgui.Create( "StarfallFrame" )
frame:SetSize( 200, 400 )
frame:SetTitle( "Starfall Settings" )
frame:Center()
frame:SetVisible( true )
frame:MakePopup( true )
local panel = vgui.Create( "StarfallPanel", frame )
panel:SetPos( 5, 40 )
function panel:PerformLayout ()
self:SetSize( frame:GetWide() - 10, frame:GetTall() - 45 )
end
frame:AddComponent( "panel", panel )
local function setDoClick ( panel )
function panel:OnChange ()
SF.Editor.updateSettings()
end
return panel
end
local form = vgui.Create( "DForm", panel )
form:Dock( FILL )
form.Header:SetVisible( false )
form.Paint = function () end
setDoClick( form:CheckBox( "Show fold widgets", "sf_editor_widgets" ) )
setDoClick( form:CheckBox( "Show line numbers", "sf_editor_linenumbers" ) )
setDoClick( form:CheckBox( "Show gutter", "sf_editor_gutter" ) )
setDoClick( form:CheckBox( "Show invisible characters", "sf_editor_invisiblecharacters" ) )
setDoClick( form:CheckBox( "Show indenting guides", "sf_editor_indentguides" ) )
setDoClick( form:CheckBox( "Highlight active line", "sf_editor_activeline" ) )
setDoClick( form:CheckBox( "Auto completion", "sf_editor_autocompletion" ) )
setDoClick( form:CheckBox( "Fix keys not working on Linux", "sf_editor_fixkeys" ) ):SetTooltip( "Some keys don't work with the editor on Linux\nEg. Enter, Tab, Backspace, Arrow keys etc..." )
setDoClick( form:CheckBox( "Fix console bug", "sf_editor_fixconsolebug" ) ):SetTooltip( "Fix console opening when pressing ' or @ (UK Keyboad layout)" )
setDoClick( form:CheckBox( "Disable quit keybind", "sf_editor_disablequitkeybind" ) ):SetTooltip( "Ctrl-Q" )
function frame:OnOpen ()
SF.Editor.editor.components[ "buttonHolder" ]:getButton( "Settings" ).active = true
end
function frame:OnClose ()
SF.Editor.editor.components[ "buttonHolder" ]:getButton( "Settings" ).active = false
end
return frame
end
function SF.Editor.saveSettings ()
local frame = SF.Editor.editor
RunConsoleCommand( "sf_editor_width", frame:GetWide() )
RunConsoleCommand( "sf_editor_height", frame:GetTall() )
local x, y = frame:GetPos()
RunConsoleCommand( "sf_editor_posx", x )
RunConsoleCommand( "sf_editor_posy", y )
local frame = SF.Editor.fileViewer
RunConsoleCommand( "sf_fileviewer_width", frame:GetWide() )
RunConsoleCommand( "sf_fileviewer_height", frame:GetTall() )
local x, y = frame:GetPos()
RunConsoleCommand( "sf_fileviewer_posx", x )
RunConsoleCommand( "sf_fileviewer_posy", y )
RunConsoleCommand( "sf_fileviewer_locked", frame.locked and 1 or 0 )
end
function SF.Editor.updateSettings ()
local frame = SF.Editor.editor
frame:SetWide( GetConVarNumber( "sf_editor_width" ) )
frame:SetTall( GetConVarNumber( "sf_editor_height" ) )
frame:SetPos( GetConVarNumber( "sf_editor_posx" ), GetConVarNumber( "sf_editor_posy" ) )
local frame = SF.Editor.fileViewer
frame:SetWide( GetConVarNumber( "sf_fileviewer_width" ) )
frame:SetTall( GetConVarNumber( "sf_fileviewer_height" ) )
frame:SetPos( GetConVarNumber( "sf_fileviewer_posx" ), GetConVarNumber( "sf_fileviewer_posy" ) )
frame:lock( SF.Editor.editor )
frame.locked = tobool(GetConVarNumber( "sf_fileviewer_locked" ))
local buttonLock = frame.components[ "buttonHolder" ]:getButton( "Lock" )
buttonLock.active = frame.locked
buttonLock:SetText( frame.locked and "Locked" or "Unlocked" )
local js = SF.Editor.runJS
js( "editor.setOption(\"showFoldWidgets\", " .. GetConVarNumber( "sf_editor_widgets" ) .. ")" )
js( "editor.setOption(\"showLineNumbers\", " .. GetConVarNumber( "sf_editor_linenumbers" ) .. ")" )
js( "editor.setOption(\"showGutter\", " .. GetConVarNumber( "sf_editor_gutter" ) .. ")" )
js( "editor.setOption(\"showInvisibles\", " .. GetConVarNumber( "sf_editor_invisiblecharacters" ) .. ")" )
js( "editor.setOption(\"displayIndentGuides\", " .. GetConVarNumber( "sf_editor_indentguides" ) .. ")" )
js( "editor.setOption(\"highlightActiveLine\", " .. GetConVarNumber( "sf_editor_activeline" ) .. ")" )
js( "editor.setOption(\"highlightGutterLine\", " .. GetConVarNumber( "sf_editor_activeline" ) .. ")" )
js( "editor.setOption(\"enableLiveAutocompletion\", " .. GetConVarNumber( "sf_editor_autocompletion" ) .. ")" )
end
--- (Client) Builds a table for the compiler to use
-- @param maincode The source code for the main chunk
-- @param codename The name of the main chunk
-- @return True if ok, false if a file was missing
-- @return A table with mainfile = codename and files = a table of filenames and their contents, or the missing file path.
function SF.Editor.BuildIncludesTable ( maincode, codename )
if not SF.Editor.initialized then
if not SF.Editor.init() then return end
end
local tbl = {}
maincode = maincode or SF.Editor.getCode()
codename = codename or SF.Editor.getOpenFile() or "main"
tbl.mainfile = codename
tbl.files = {}
tbl.filecount = 0
tbl.includes = {}
local loaded = {}
local ppdata = {}
local function recursiveLoad ( path )
if loaded[ path ] then return end
loaded[ path ] = true
local code
if path == codename and maincode then
code = maincode
else
code = file.Read( "starfall/"..path, "DATA" ) or error( "Bad include: " .. path, 0 )
end
tbl.files[ path ] = code
SF.Preprocessor.ParseDirectives( path, code, {}, ppdata )
if ppdata.includes and ppdata.includes[ path ] then
local inc = ppdata.includes[ path ]
if not tbl.includes[ path ] then
tbl.includes[ path ] = inc
tbl.filecount = tbl.filecount + 1
else
assert( tbl.includes[ path ] == inc )
end
for i = 1, #inc do
recursiveLoad( inc[i] )
end
end
end
local ok, msg = pcall( recursiveLoad, codename )
local function findCycle ( file, visited, recStack )
if not visited[ file ] then
--Mark the current file as visited and part of recursion stack
visited[ file ] = true
recStack[ file ] = true
--Recurse for all the files included in this file
for k, v in pairs( ppdata.includes[ file ] or {} ) do
if recStack[ v ] then
return true, file
elseif not visited[ v ] then
local cyclic, cyclicFile = findCycle( v, visited, recStack )
if cyclic then return true, cyclicFile end
end
end
end
--Remove this file from the recursion stack
recStack[ file ] = false
return false, nil
end
local isCyclic = false
local cyclicFile = nil
for k, v in pairs( ppdata.includes or {} ) do
local cyclic, file = findCycle( k, {}, {} )
if cyclic then
isCyclic = true
cyclicFile = file
break
end
end
if isCyclic then
return false, "Loop in includes from: " .. cyclicFile
end
if ok then
return true, tbl
elseif msg:sub( 1, 13 ) == "Bad include: " then
return false, msg
else
error( msg, 0 )
end
end
net.Receive( "starfall_editor_getacefiles", function ( len )
local index = net.ReadInt( 8 )
aceFiles[ index ] = net.ReadString()
if not tobool( net.ReadBit() ) then
net.Start( "starfall_editor_getacefiles" )
net.SendToServer()
else
SF.Editor.safeToInit = true
SF.Editor.init()
end
end )
net.Receive( "starfall_editor_geteditorcode", function ( len )
htmlEditorCode = net.ReadString()
end )
-- CLIENT ANIMATION
local busy_players = { }
hook.Add( "EntityRemoved", "starfall_busy_animation", function ( ply )
busy_players[ ply ] = nil
end )
local emitter = ParticleEmitter( vector_origin )
net.Receive( "starfall_editor_status", function ( len )
local ply = net.ReadEntity()
local status = net.ReadBit() ~= 0 -- net.ReadBit returns 0 or 1, despite net.WriteBit taking a boolean
if not ply:IsValid() or ply == LocalPlayer() then return end
busy_players[ ply ] = status or nil
end )
local rolldelta = math.rad( 80 )
timer.Create( "starfall_editor_status", 1 / 3, 0, function ()
rolldelta = -rolldelta
for ply, _ in pairs( busy_players ) do
local BoneIndx = ply:LookupBone( "ValveBiped.Bip01_Head1" ) or ply:LookupBone( "ValveBiped.HC_Head_Bone" ) or 0
local BonePos, BoneAng = ply:GetBonePosition( BoneIndx )
local particle = emitter:Add( "radon/starfall2", BonePos + Vector( math.random( -10, 10 ), math.random( -10, 10 ), 60 + math.random( 0, 10 ) ) )
if particle then
particle:SetColor( math.random( 30, 50 ), math.random( 40, 150 ), math.random( 180, 220 ) )
particle:SetVelocity( Vector( 0, 0, -40 ) )
particle:SetDieTime( 1.5 )
particle:SetLifeTime( 0 )
particle:SetStartSize( 10 )
particle:SetEndSize( 5 )
particle:SetStartAlpha( 255 )
particle:SetEndAlpha( 0 )
particle:SetRollDelta( rolldelta )
end
end
end )
elseif SERVER then
util.AddNetworkString( "starfall_editor_status" )
util.AddNetworkString( "starfall_editor_getacefiles" )
util.AddNetworkString( "starfall_editor_geteditorcode" )
local function getFiles ( dir, dir2 )
local files = {}
local dir2 = dir2 or ""
local f, directories = file.Find( dir .. "/" .. dir2 .. "/*", "GAME" )
for k, v in pairs( f ) do
files[ #files + 1 ] = dir2 .. "/" .. v
end
for k, v in pairs( directories ) do
table.Add( files, getFiles( dir, dir2 .. "/" .. v ) )
end
return files
end
local acefiles = {}
do
local netSize = 64000
local files = file.Find( addon_path .. "/html/starfall/ace/*", "GAME" )
local out = ""
for k, v in pairs( files ) do
out = out .. "<script>\n" .. file.Read( addon_path .. "/html/starfall/ace/" .. v, "GAME" ) .. "</script>\n"
end
for i = 1, math.ceil( out:len() / netSize ) do
acefiles[i] = out:sub( (i - 1)*netSize + 1, i*netSize )
end
end
local plyIndex = {}
local function sendAceFile ( len, ply )
local index = plyIndex[ ply ]
net.Start( "starfall_editor_getacefiles" )
net.WriteInt( index, 8 )
net.WriteString( acefiles[ index ] )
net.WriteBit( index == #acefiles )
net.Send( ply )
plyIndex[ ply ] = index + 1
end
hook.Add( "PlayerInitialSpawn", "starfall_file_init", function ( ply )
net.Start( "starfall_editor_geteditorcode" )
net.WriteString( file.Read( addon_path .. "/html/starfall/editor.html", "GAME" ) )
net.Send( ply )
plyIndex[ ply ] = 1
sendAceFile( nil, ply )
end )
net.Receive( "starfall_editor_getacefiles", sendAceFile )
for k, v in pairs( getFiles( addon_path, "materials/radon" ) ) do
resource.AddFile( v )
end
local starfall_event = {}
concommand.Add( "starfall_event", function ( ply, command, args )
local handler = starfall_event[ args[ 1 ] ]
if not handler then return end
return handler( ply, args )
end )
function starfall_event.editor_open ( ply, args )
net.Start( "starfall_editor_status" )
net.WriteEntity( ply )
net.WriteBit( true )
net.Broadcast()
end
function starfall_event.editor_close ( ply, args )
net.Start( "starfall_editor_status" )
net.WriteEntity( ply )
net.WriteBit( false )
net.Broadcast()
end
end
|
function _init(args)
sys.stepinterval(0)
snd = audio.new()
filename = args[1]
if not filename then
print("No filename was given!")
end
print("(press enter to stop recording)")
end
function _step()
audio.record(snd)
local inp = sys.read()
if inp == "\n" then
if audio.save(filename, snd) then
print("Recording saved to " .. filename)
else
print("Could not save recording to " .. filename)
end
sys.exit()
end
end
|
ix.currency.Set("", "", "RU", "models/gmodz/misc/dollar.mdl")
ix.config.SetDefault("font", "Jura")
ix.config.SetDefault("genericFont", "Malgun Gothic")
ix.config.SetDefault("music", "music/hl2_song19.mp3")
ix.config.SetDefault("maxAttributes", 0)
ix.config.SetDefault("maxCharacters", 1)
ix.config.SetDefault("allowVoice", true)
ix.config.SetDefault("communityURL", "https://steamcommunity.com/id/meow1337")
ix.config.SetDefault("weaponAlwaysRaised", true)
--ix.config.SetDefault("color", Color(75, 119, 190, 255))
ix.config.SetDefault("thirdperson", true)
ix.config.SetDefault("itemPickupTime", 0)
ix.config.Add("jumpPower", 200, "How high player jumps by default.", function(oldValue, newValue)
for _, v in ipairs(player.GetAll()) do
v:SetJumpPower(newValue)
end
end, {
data = {min = 0, max = 1024},
category = "characters"
})
-- unload plugins
local noLoad = {
saveitems = true,
recognition = true,
wepselect = true,
stamina = true,
doors = true,
spawnsaver = true,
thirdperson = true,
permakill = true,
ammosave = true
}
function Schema:InitializedPlugins()
local unloaded = ix.data.Get("unloaded", {}, true, true)
local bRestart = nil
for uniqueID in pairs(noLoad) do
if (!unloaded[uniqueID]) then
ix.plugin.SetUnloaded(uniqueID, true)
bRestart = true
end
end
if (SERVER and bRestart) then
MsgC(Color(87, 180, 242), "[GMODZ]: ", Color(255, 172, 0), "Plugins unloaded. Restarting server in 5 seconds!", "\n")
RunConsoleCommand("sv_hibernate_think", "1")
timer.Simple(5, function()
RunConsoleCommand("_restart")
end)
return
end
end
Schema.countryIcon = {
w = 16,
h = 11
}
-- PreDrawOutlines
Schema.outlineItems = {
["ix_item"] = true,
["gmodz_grave"] = true,
["ix_money"] = true,
["ix_shipment"] = true,
["gmodz_npc_loot"] = true,
}
if (CLIENT) then
ix.option.Add("minimalTooltips", ix.type.bool, true, {
category = "appearance"
})
function Schema:LoadFonts(font, genericFont)
local function get_scale()
local sc = math.Clamp(ScrH() / 1080, 0.7, 1)
if (!th) then
th = 48 * sc
m = th * 0.25
end
return sc
end
surface.CreateFont("GmodZ.Numeric", {
font = font,
size = math.min(18, 20 * get_scale()),
weight = 200
})
surface.CreateFont("GmodZ.NormalText", {
font = font,
size = 18,
weight = 550,
extended = true
})
get_scale = nil
end
end |
return function()
local CorePackages = game:GetService("CorePackages")
local AppDarkTheme = require(CorePackages.AppTempCommon.LuaApp.Style.Themes.DarkTheme)
local AppFont = require(CorePackages.AppTempCommon.LuaApp.Style.Fonts.Gotham)
local Roact = require(CorePackages.Roact)
local Rodux = require(CorePackages.Rodux)
local RoactRodux = require(CorePackages.RoactRodux)
local UIBlox = require(CorePackages.UIBlox)
local AvatarEditorPrompts = script.Parent.Parent.Parent
local Reducer = require(AvatarEditorPrompts.Reducer)
local PromptType = require(AvatarEditorPrompts.PromptType)
local OpenPrompt = require(AvatarEditorPrompts.Actions.OpenPrompt)
local appStyle = {
Theme = AppDarkTheme,
Font = AppFont,
}
describe("AllowInventoryReadAccessPrompt", function()
it("should create and destroy without errors", function()
local AllowInventoryReadAccessPrompt = require(script.Parent.AllowInventoryReadAccessPrompt)
local store = Rodux.Store.new(Reducer, nil, {
Rodux.thunkMiddleware,
})
store:dispatch(OpenPrompt(PromptType.AllowInventoryReadAccess, {}))
local element = Roact.createElement(RoactRodux.StoreProvider, {
store = store,
}, {
ThemeProvider = Roact.createElement(UIBlox.Style.Provider, {
style = appStyle,
}, {
AllowInventoryReadAccessPrompt = Roact.createElement(AllowInventoryReadAccessPrompt)
})
})
local instance = Roact.mount(element)
Roact.unmount(instance)
end)
end)
end
|
local FS = {}
FS["CSTM_SCARH"] = "weapons/scarh/scarh-1.wav"
FS["CSTM_MP9"] = "weapons/mp9/mp9_unsil.wav"
FS["CSTM_627"] = "weapons/627/627-1.wav"
FS["CSTM_Deagle"] = "weapons/deagles/deagle-1.wav"
FS["CSTM_Glock18"] = "weapons/glock18/glock18-1.wav"
FS["CSTM_92FS"] = "weapons/beretta92fs/fire.wav"
FS["CSTM_M1911"] = "weapons/colt/fire.wav"
FS["CSTM_Makarov"] = "weapons/makarov/makarov-1.wav"
FS["CSTM_MR96"] = "weapons/mr96/mr96-1.wav"
FS["CSTM_USP45"] = "weapons/usp45/usp_unsil-1.wav"
FS["CSTM_AK47"] = "weapons/ak/ak47-1.wav"
FS["CSTM_AK74"] = "weapons/ak74/ak74-1.wav"
FS["CSTM_AK74U"] = "weapons/sr3m/fire.wav"
FS["CSTM_ARES"] = "weapons/ares/ares-1.wav"
FS["CSTM_ASVAL"] = "weapons/asval/asval-1.wav"
FS["CSTM_AUGA3"] = "weapons/auga3/fire.wav"
FS["CSTM_F2000"] = "weapons/f2000/f2000-1.wav"
FS["CSTM_G3A3"] = "weapons/g3/fire.wav"
FS["CSTM_G36C"] = "weapons/g36c/g36c_nosil.wav"
FS["CSTM_HK416"] = "weapons/m416/m416_unsil-1.wav"
FS["CSTM_FNFAL"] = "weapons/fnfal/fnfal-1.wav"
FS["CSTM_L85A2"] = "weapons/l85a2/l85-1.wav"
FS["CSTM_LR300"] = "weapons/lr300/lr300-1.wav"
FS["CSTM_M4A1"] = "weapons/m4a1customizable/m4a1_unsil-1.wav"
FS["CSTM_M14"] = "weapons/m14/m14-1.wav"
FS["CSTM_M16"] = "weapons/m16/fire.wav"
FS["CSTM_M249"] = "weapons/m249/fire.wav"
FS["CSTM_Masada"] = "weapons/masada/masada_unsil.wav"
FS["CSTM_SCARL"] = "weapons/scar/scar_unsil-1.wav"
FS["CSTM_SG551"] = "weapons/sg551/sg551-1.wav"
FS["CSTM_SG552"] = "weapons/sig552/sg552-1.wav"
FS["CSTM_SR3M"] = "weapons/sr3m/fire.wav"
FS["CSTM_SPAS12"] = "weapons/spas/spas-1.wav"
FS["CSTM_Bizon"] = "weapons/bizon/bizon-1.wav"
FS["CSTM_KACPDW"] = "weapons/kac/kac-1.wav"
FS["CSTM_MP7"] = "weapons/mp7/mp7-1.wav"
FS["CSTM_P90"] = "weapons/p90cstm/fire.wav"
FS["CSTM_Skorpion"] = "weapons/Skorpion/Skr-1.wav"
FS["CSTM_Kriss"] = "weapons/kriss/kriss-1.wav"
FS["CSTM_M98B"] = "weapons/m98/m98-1.wav"
FS["CSTM_XM1014"] = "weapons/xm1014cstm/xm1014-1.wav"
FS["CSTM_Glock17"] = "weapons/glock17/glock17-1.wav"
FS["CSTM_PP2000"] = "weapons/TSPP2000/pp2000-1.wav"
FS["CSTM_AN94"] = "weapons/an94/an94-1.wav"
FS["CSTM_SR25"] = "weapons/sr-25/sr25-1.wav"
FS["CSTM_M16A4"] = "weapons/m16a4/m16-1.wav"
FS["CSTM_TAR21"] = "weapons/tar21/tar21-1.wav"
FS["CSTM_M3"] = "weapons/KimM3/m3_shoot_pump.wav"
FS["CSTM_MP412"] = "weapons/mp412/MP412_Fire.wav"
FS["CSTM_CZ75"] = "weapons/cz75/cz75-1.wav"
FS["CSTM_FAMAS"] = "weapons/famf1/famas-1.wav"
FS["CSTM_AWP"] = "weapons/awm/awm1.wav"
FS["CSTM_SAIGA12K"] = "weapons/saiga/saiga-1.wav"
FS["CSTM_RPK74"] = "weapons/rpk/rpk-1.wav"
FS["CSTM_MP5"] = "weapons/mp5a5/mp5-1.wav"
FS["CSTM_UMP45"] = "weapons/ump45_cstm/UMP45 Fire.wav"
FS["CSTM_44MAGNUM"] = "weapons/44magnum/Magnum Fire.wav"
FS["CSTM_PP-19-01"] = "weapons/pp-19-01/pp1901-1.wav"
FS["CSTM_L22A2"] = "weapons/l22a2/l22a2-1.wav"
FS["CSTM_DEAGLECSTM"] = "weapons/deagle_cstm/deagle-1.wav"
FS["CSTM_M60"] = {"weapons/m60/m60-1.wav", "weapons/m60/m60-2.wav"}
FS["CSTM_G2CONTENDER"] = {"weapons/g2contender/g2-1.wav", "weapons/g2contender/g2-2.wav", "weapons/g2contender/g2-3.wav"}
FS["CSTM_UZI"] = "weapons/uzi/uzi10-1.wav"
FS["CSTM_USAS12"] = "weapons/usas12/fire.wav"
//FS["CSTM_KS23"] = "weapons/ks23/ks23-1.wav"
-- SILENCED SOUNDS
FS["CSTM_SilencedShot1"] = "weapons/mp9/mp9_sil.wav"
FS["CSTM_SilencedShot2"] = "weapons/g3/g3-1.wav"
FS["CSTM_SilencedShot3"] = "weapons/usp45/usp1.wav"
FS["CSTM_SilencedShot4"] = "weapons/m4a1customizable/m4a1-1.wav"
FS["CSTM_SilencedShot5"] = "weapons/g36c/g36c_sil.wav"
FS["CSTM_SilencedShot6"] = "weapons/m416/m416-1.wav"
FS["CSTM_SilencedShot7"] = "weapons/silenced1.wav"
FS["CSTM_SilencedShot8"] = "weapons/silenced2.wav"
FS["CSTM_SilencedShot9"] = "weapons/silenced3.wav"
local tbl = {channel = CHAN_WEAPON,
volume = 1,
soundlevel = 120,
pitchstart = 100,
pitchend = 100}
for k, v in pairs(FS) do
tbl.name = k
tbl.sound = v
sound.Add(tbl)
end
function AddFireSound(event, sound)
tbl.name = event
tbl.sound = sound
sound.Add(tbl)
end
-- Not using script .txt files anymore, manual reload sound set-up
local RS = {}
RS["SCARH.MagOut"] = "weapons/scarh/scarh_magout.wav"
RS["SCARH.MagIn"] = "weapons/scarh/scarh_magin.wav"
RS["SCARH.MagTap"] = "weapons/scarh/scarh_magtap.wav"
RS["SCARH.BoltRel"] = "weapons/scarh/scarh_boltrel.wav"
RS["SCARH.Foley"] = "weapons/scarh/scarh_foley.wav"
RS["Weapon_SWP627.wheel_out"] = "weapons/627/wheel_out.wav"
RS["Weapon_SWP627.bulletout_1"] = "weapons/627/bulletout_1.wav"
RS["Weapon_SWP627.bulletout_2"] = "weapons/627/bulletout_2.wav"
RS["Weapon_SWP627.bulletout_3"] = "weapons/627/bulletout_3.wav"
RS["Weapon_SWP627.bullets_in"] = "weapons/627/bullets_in.wav"
RS["Weapon_SWP627.wheel_in"] = "weapons/627/wheel_in.wav"
RS["Weapon_AK74.Bolthold"] = "weapons/ak74/bolthold.wav"
RS["Weapon_AK74.Boltrelease"] = "weapons/ak74/boltrelease.wav"
RS["Weapon_AK74.clipout"] = "weapons/ak74/clipout.wav"
RS["Weapon_AK74.clipin"] = "weapons/ak74/clipin.wav"
RS["Weapon_AK74.Boltpull"] = "weapons/ak74/boltpullz.wav"
RS["Weapon_A74U.Magin"] = "weapons/ak74u/Magin.wav"
RS["Weapon_A74U.Magout"] = "weapons/ak74u/Magout.wav"
RS["Weapon_A74U.MagRelease"] = "weapons/ak74u/Magrelease.wav"
RS["Weapon_A74U.Boltpull"] = "weapons/ak74u/boltpull.wav"
RS["Weapon_A74U.BoltRelease"] = "weapons/ak74u/boltrelease.wav"
RS["Weapon_A74U.Draw"] = "weapons/ak74u/draw.wav"
RS["Weapon_A74U.MagDraw"] = "weapons/ak74u/magdraw.wav"
RS["Weapon_A74U.ReloadEmpty"] = "weapons/ak74u/reloadempty.wav"
RS["Weapon_A57.Cliprelease"] = "weapons/ar57/ar57_cliprelease.wav"
RS["Weapon_A57.Clipout"] = "weapons/ar57/ar57_clipout.wav"
RS["Weapon_A57.Clipin"] = "weapons/ar57/ar57_clipin.wav"
RS["Weapon_A57.Boltpull"] = "weapons/ar57/ar57_boltpull.wav"
RS["Weapon_A57.newclip"] = "weapons/ar57/ar57_newclip.wav"
RS["Weapon_A57.silencer"] = "weapons/ar57/ar57_silencer.wav"
RS["Weapon_ARES.bOut"] = "weapons/ares/boxout.wav"
RS["Weapon_ARES.Button"] = "weapons/ares/button.wav"
RS["Weapon_ARES.cUp"] = "weapons/ares/coverup.wav"
RS["Weapon_ARES.Bullet1"] = "weapons/ares/bullet.wav"
RS["Weapon_ARES.bIn"] = "weapons/ares/boxin.wav"
RS["Weapon_ARES.Bullet2"] = "weapons/ares/bullet.wav"
RS["Weapon_ARES.cDown"] = "weapons/ares/coverdown.wav"
RS["Weapon_ARES.Ready"] = "weapons/ares/ready.wav"
RS["Weapon_ASVAL.Draw"] = "weapons/asval/draw.wav"
RS["Weapon_ASVAL.Clipout"] = "weapons/asval/galil_clipout.wav"
RS["Weapon_ASVAL.Clipin"] = "weapons/asval/galil_clipin.wav"
RS["Weapon_ASVAL.Boltpull"] = "weapons/asval/galil_Boltpull.wav"
RS["Weapon_AA3.Cliptap"] = "weapons/auga3/auga3_cliptap.wav"
RS["Weapon_AA3.Clipout"] = "weapons/auga3/auga3_clipout.wav"
RS["Weapon_AA3.Clipin"] = "weapons/auga3/auga3_clipin.wav"
RS["Weapon_AA3.Boltpull"] = "weapons/auga3/auga3_boltpull.wav"
RS["Colt.Magout"] = "weapons/colt/magout.wav"
RS["Colt.Magin"] = "weapons/colt/magin.wav"
RS["Colt.Hammerback"] = "weapons/colt/Hammerback.wav"
RS["Colt.Sliderelease"] = "weapons/colt/sliderelease.wav"
RS["CSTM_MASADA.Silencer_Off"] = "weapons/masada/masada_silencer_off.wav"
RS["CSTM_MASADA.Silencer_On"] = "weapons/masada/masada_silencer_on.wav"
RS["CSTM_MASADA.Clipout"] = "weapons/masada/masada_clipout.wav"
RS["CSTM_MASADA.Clipin"] = "weapons/masada/masada_clipin.wav"
RS["CSTM_MASADA.Boltpull"] = "weapons/masada/masada_boltpull.wav"
RS["CSTM_MASADA.Deploy"] = "weapons/masada/masada_deploy.wav"
RS["Weapon_CS47.Boltforward"] = "weapons/ak/boltforward.wav"
RS["Weapon_CS47.Boltback"] = "weapons/ak/boltback.wav"
RS["Weapon_CS47.Clipout"] = "weapons/ak/clipout.wav"
RS["Weapon_CS47.Clipin"] = "weapons/ak/clipin.wav"
RS["Weapon_CS47.Safety"] = "weapons/ak/safety.wav"
RS["Weapon_CS47.Handle"] = "weapons/ak/handle.wav"
RS["Weapon_CS47.Foley"] = "weapons/ak/foley.wav"
RS["Weapon_CS47.Inserting"] = "weapons/ak/inserting.wav"
RS["Weapon_DEAGS.Lclipout"] = "weapons/deagles/deagle_lclipout.wav"
RS["Weapon_DEAGS.Rclipout"] = "weapons/deagles/deagle_rclipout.wav"
RS["Weapon_DEAGS.Lclipin"] = "weapons/deagles/deagle_lclipin.wav"
RS["Weapon_DEAGS.Rclipin"] = "weapons/deagles/deagle_rclipin.wav"
RS["Weapon_DEAGS.Magbash"] = "weapons/deagles/deagle_magbash.wav"
RS["Weapon_DEAGS.Sliderelease"] = "weapons/deagles/deagle_sliderelease.wav"
RS["Weapon_DEAGS.Deploy"] = "weapons/deagles/shh.wav"
RS["Weapon_DEAGS.Hammerback"] = "weapons/deagles/deagle_hammerback.wav"
RS["Weapon_F20.Clipin1"] = "weapons/f2000/f2000_clipin1.wav"
RS["Weapon_F20.Clipout"] = "weapons/f2000/f2000_clipout.wav"
RS["Weapon_F20.Forearm"] = "weapons/f2000/f2000_forearm.wav"
RS["Weapon_F20.Boltpull"] = "weapons/f2000/f2000_boltpull.wav"
RS["Weapon_F20.Clipin"] = "weapons/f2000/f2000_clipin1.wav"
RS["Weapon_Fnfal.Cliptap"] = "weapons/fnfal/fnfal_cliptap.wav"
RS["Weapon_Fnfal.Clipout"] = "weapons/fnfal/fnfal_clipout.wav"
RS["Weapon_Fnfal.Clipin"] = "weapons/fnfal/fnfal_clipin.wav"
RS["Weapon_Fnfal.Boltpull"] = "weapons/fnfal/fnfal_boltpull.wav"
RS["Weapon_G3A3.Silencer_Off"] = "weapons/g3/g3_silencer_off.wav"
RS["Weapon_G3A3.Silencer_On"] = "weapons/g3/g3_silencer_on.wav"
RS["Weapon_G3A3.Clipout"] = "weapons/g3/g3_clipout.wav"
RS["Weapon_G3A3.Clipin"] = "weapons/g3/g3_clipin.wav"
RS["Weapon_G3A3.Deploy"] = "weapons/g3/g3_deploy.wav"
RS["Weapon_G3A3.Deploy1"] = "weapons/g3/g3_deploy1.wav"
RS["Weapon_G3A3.Boltpull"] = "weapons/g3/g3_boltpull.wav"
RS["Weapon_G3A3.Boltcatch"] = "weapons/g3/g3_boltcatch.wav"
RS["Weapon_G3A3.Safety"] = "weapons/g3/g3_safety.wav"
RS["Weapon_G36C.Silencer"] = "weapons/g36c/g36c_silencer_twist.wav"
RS["Weapon_G36C.Silencer_click"] = "weapons/g36c/g36c_silencer_click.wav"
RS["Weapon_G36C.Silencer_release"] = "weapons/g36c/g36c_silencer_release.wav"
RS["Weapon_G36C.Clipout"] = "weapons/g36c/g36c_clipout.wav"
RS["Weapon_G36C.Clipin"] = "weapons/g36c/g36c_clipin.wav"
RS["Weapon_G36C.Clipslap"] = "weapons/g36c/g36c_clipslap.wav"
RS["Weapon_G36C.Boltpull"] = "weapons/g36c/g36c_boltpull.wav"
RS["Weapon_G36C.BoltRelease"] = "weapons/g36c/g36c_boltrelease.wav"
RS["Magout"] = "weapons/glock18/Magout.wav"
RS["Magin"] = "weapons/glock18/Magin.wav"
RS["Slideback"] = "weapons/glock18/Slideback.wav"
RS["Sliderelease"] = "weapons/glock18/Sliderelease.wav"
RS["Slideforward"] = "weapons/glock18/slideforward.wav"
RS["Click"] = "weapons/glock18/click.wav"
RS["Clipready"] = "weapons/glock18/clipready.wav"
RS["Weapon_Perdw.Clipout"] = "weapons/kac/kac_clipout.wav"
RS["Weapon_Perdw.Clipin"] = "weapons/kac/kac_clipin.wav"
RS["Weapon_Perdw.Boltpull"] = "weapons/kac/kac_cliptap.wav"
RS["Weapon_KAC.Boltslap"] = "weapons/kac/kac_boltslap.wav"
RS["Weapon_KRISS.Magrelease"] = "weapons/Kriss/magrel.wav"
RS["Weapon_KRISS.unfold"] = "weapons/Kriss/unfold.wav"
RS["Weapon_KRISS.Clipout"] = "weapons/Kriss/clipout.wav"
RS["Weapon_KRISS.Clipin"] = "weapons/Kriss/clipin.wav"
RS["Weapon_KRISS.Boltpull"] = "weapons/Kriss/boltpull.wav"
RS["Weapon_KRISS.Dropclip"] = "weapons/Kriss/dropclip.wav"
RS["Weapon_L85.magin"] = "weapons/L85A2/magin.wav"
RS["Weapon_L85.magout"] = "weapons/L85A2/magout.wav"
RS["Weapon_L85.boltslap"] = "weapons/L85A2/boltslap.wav"
RS["Weapon_L85.boltpull"] = "weapons/L85A2/boltpull.wav"
RS["Weapon_L85.cloth"] = "weapons/L85A2/cloth.wav"
RS["Weapon_L85.tap"] = "weapons/L85A2/tap.wav"
RS["Weapon_LR300.Ready"] = "weapons/lr300/Ready.wav"
RS["Weapon_LR300.Magout"] = "weapons/lr300/Magout.wav"
RS["Weapon_LR300.Magin"] = "weapons/lr300/Magin.wav"
RS["Weapon_LR300.Magspank"] = "weapons/lr300/Magspank.wav"
RS["Weapon_LR300.Boltcatch"] = "weapons/lr300/Boltcatch.wav"
RS["Weapon_M4CU.Silencer_on"] = "weapons/m4a1customizable/m4a1_silencer_on.wav"
RS["Weapon_M4CU.Silencer_off"] = "weapons/m4a1customizable/m4a1_silencer_off.wav"
RS["Weapon_M4CU.Clipout"] = "weapons/m4a1customizable/m4a1_clipout.wav"
RS["Weapon_M4CU.Clipin"] = "weapons/m4a1customizable/m4a1_clipin.wav"
RS["Weapon_M4CU.Magtap"] = "weapons/m4a1customizable/m4a1_magtap.wav"
RS["Weapon_M4CU.Boltpull"] = "weapons/m4a1customizable/m4a1_boltpull.wav"
RS["Weapon_M4CU.Deploy"] = "weapons/m4a1customizable/m4a1_deploy.wav"
RS["Weapon_M4CU.BoltRelease"] = "weapons/m4a1customizable/m4a1_boltrelease.wav"
RS["Weapon_M14.Clipout"] = "weapons/m14/m14_clipout.wav"
RS["Weapon_M14.Clipin"] = "weapons/m14/m14_clipin.wav"
RS["Weapon_M14.Boltpull"] = "weapons/m14/m14_boltpull.wav"
RS["Weapon_M164.Clipout"] = "weapons/m16/m16_clipout.wav"
RS["Weapon_M164.Clipin"] = "weapons/m16/m16_clipin.wav"
RS["Weapon_M164.Boltpull"] = "weapons/m16/m16_boltpull.wav"
RS["Weapon_M164.Silencer_On"] = "weapons/m16/m16_silencer_on.wav"
RS["Weapon_M164.Silencer_Off"] = "weapons/m16/m16_silencer_off.wav"
RS["Weapon_92.clipout"] = "weapons/beretta92fs/clipout.wav"
RS["Weapon_92.clipin1"] = "weapons/beretta92fs/clipin1.wav"
RS["Weapon_92.clipin2"] = "weapons/beretta92fs/clipin2.wav"
RS["Weapon_92.SlideBack"] = "weapons/beretta92fs/SlideBack.wav"
RS["Weapon_92.SlideForward"] = "weapons/beretta92fs/slideForward.wav"
RS["Weapon_Flakk249.Magin"] = "weapons/schmung.M249/magin.wav"
RS["Weapon_Flakk249.Boltpull"] = "weapons/schmung.M249/boltpull.wav"
RS["Weapon_Flakk249.Boltrel"] = "weapons/schmung.M249/boltrel.wav"
RS["Weapon_M416.BoltRelease"] = "weapons/M416/M416_boltrelease.wav"
RS["Weapon_M416.ClipOut"] = "weapons/M416/M416_clipout.wav"
RS["Weapon_M416.ClipIn"] = "weapons/M416/M416_clipin.wav"
RS["Weapon_M416.boltforward"] = "weapons/M416/M416_boltforward.wav"
RS["Weapon_M416.MagTap"] = "weapons/M416/M416_tap.wav"
RS["Weapon_M416.assist"] = "weapons/M416/assist.wav"
RS["Weapon_M416.safety"] = "weapons/M416/safety.wav"
RS["Weapon_M416.Deploy"] = "weapons/M416/M416_deploy.wav"
RS["Weapon_M416.Silencer_On"] = "weapons/M416/M416_silencer_on.wav"
RS["Weapon_M416.Silencer_Off"] = "weapons/M416/M416_silencer_off.wav"
RS["Weapon_M416.boltpull"] = "weapons/M416/m416_boltpull.wav"
RS["Weapon_MC10S.Reloadstart"] = "weapons/mac10s/mac10_reloadstart.wav"
RS["Weapon_MC10S.Clipout"] = "weapons/mac10s/mac10_clipout.wav"
RS["Weapon_MC10S.Sliderelease"] = "weapons/mac10s/mac10_sliderelease.wav"
RS["Weapon_MC10S.Rclipin"] = "weapons/mac10s/mac10_rightclipin.wav"
RS["Weapon_MC10S.Lclipin"] = "weapons/mac10s/mac10_leftclipin.wav"
RS["Weapon_MC10S.Deploy"] = "weapons/mac10s/mac10_deploy.wav"
RS["Weapon_MKRV.MagOut"] = "weapons/makarov/MagOut.wav"
RS["Weapon_MKRV.MagInScratch"] = "weapons/makarov/MagInScratch.wav"
RS["Weapon_MKRV.MagInTap"] = "weapons/makarov/MagInTap.wav"
RS["Weapon_MKRV.Sliderelease"] = "weapons/makarov/Sliderelease.wav"
RS["Weapon_MKRV.SlideBack"] = "weapons/makarov/SlideBack.wav"
RS["Weapon_MKRV.SlideForward"] = "weapons/makarov/SlideForward.wav"
RS["Weapon_5sd.Magout"] = "weapons/MP5SD/Magout.wav"
RS["Weapon_5sd.Magtap"] = "weapons/MP5SD/Magtap.wav"
RS["Weapon_5sd.Magin"] = "weapons/MP5SD/Magin.wav"
RS["Weapon_5sd.Boltpull"] = "weapons/MP5SD/boltpull.wav"
RS["Weapon_5sd.Boltrelease"] = "weapons/MP5SD/boltrelease.wav"
RS["Weapon_5sd.Cloth"] = "weapons/MP5SD/cloth.wav"
RS["Weapon_5sd.Retract"] = "weapons/MP5SD/Retract.wav"
RS["Weapon_DeMR96.cylinderout"] = "weapons/mr96/cylinderin.wav"
RS["Weapon_DeMR96.cylinderin"] = "weapons/mr96/cylinderout.wav"
RS["Weapon_DeMR96.bulletsin"] = "weapons/mr96/bulletsin.wav"
RS["Weapon_DeMR96.bulletsout"] = "weapons/mr96/bulletsout.wav"
RS["Weapon_DeMR96.Deploy"] = "weapons/mr96/draw.wav"
RS["Weapon_DeMR96.Spin"] = "weapons/mr96/cylinderspin.wav"
RS["Weapon_90P.Draw"] = "weapons/p90cstm/p90_draw.wav"
RS["Weapon_90P.Clipout"] = "weapons/p90cstm/p90_clipout.wav"
RS["Weapon_90P.Clipin"] = "weapons/p90cstm/p90_clipin.wav"
RS["Weapon_90P.Boltpull"] = "weapons/p90cstm/p90_boltpull.wav"
RS["Weapon_90P.Cliprelease"] = "weapons/p90cstm/p90_cliprelease.wav"
RS["Weapon_SCAR.Magtap"] = "weapons/scar/scar_magtap.wav"
RS["Weapon_SCAR.Boltrelease"] = "weapons/scar/scar_boltrelease.wav"
RS["Weapon_SCAR.Deploy"] = "weapons/scar/scar_deploy.wav"
RS["Weapon_SCAR.Clipout"] = "weapons/scar/scar_clipout.wav"
RS["Weapon_SCAR.Clipin"] = "weapons/scar/scar_clipin.wav"
RS["Weapon_SCAR.Silencer_On"] = "weapons/scar/scar_silencer_on.wav"
RS["Weapon_SCAR.Silencer_Off"] = "weapons/scar/scar_silencer_off.wav"
RS["Weapon_SG551.Clipout"] = "weapons/sg551/sg551_clipout.wav"
RS["Weapon_SG551.Clipin"] = "weapons/sg551/sg551_clipin.wav"
RS["Weapon_SG551.Boltpull"] = "weapons/sg551/sg551_boltpull.wav"
RS["Weapon_COMM.BoltPull"] = "weapons/sig552/boltpull.wav"
RS["Weapon_COMM.BoltBack"] = "weapons/sig552/boltback.wav"
RS["Weapon_COMM.Clipout"] = "weapons/sig552/clipout.wav"
RS["Weapon_COMM.Clipin"] = "weapons/sig552/clipin.wav"
RS["Weapon_COMM.Safety"] = "weapons/sig552/safety.wav"
RS["Weapon_61.Cock"] = "weapons/Skorpion/Skr_Cock.wav"
RS["Weapon_61.Magin"] = "weapons/Skorpion/Skr_Magin.wav"
RS["Weapon_61.Magout"] = "weapons/Skorpion/Skr_Magout.wav"
RS["Weapon_SP.Pump"] = "weapons/spas/spas_pump.wav"
RS["Weapon_SP.Pumpforward"] = "weapons/spas/spas_pumpforward.wav"
RS["Weapon_SP.Pumpback"] = "weapons/spas/spas_pumpback.wav"
RS["Weapon_SP.Insertshell"] = {"weapons/spas/spas_insertshell1.wav", "weapons/spas/spas_insertshell2.wav", "weapons/spas/spas_insertshell3.wav"}
RS["Weapon_SR_3M.Draw"] = "weapons/sr3m/draw.wav"
RS["Weapon_SR_3M.Clipout"] = "weapons/sr3m/sr3m_clipout.wav"
RS["Weapon_SR_3M.Clipin"] = "weapons/sr3m/sr3m_clipin.wav"
RS["Weapon_SR_3M.Boltpull"] = "weapons/sr3m/sr3m_boltpull.wav"
RS["Weapon_mp7.magout"] = "weapons/mp7/mp7_magout.wav"
RS["Weapon_mp7.magin"] = "weapons/mp7/mp7_magin.wav"
RS["Weapon_mp7.charger"] = "weapons/mp7/mp7_charger.wav"
RS["Weapon_mp7.switch"] = "weapons/mp7/mp7_switch.wav"
RS["Weapon_mp7.stockpull"] = "weapons/mp7/mp7_stockpull.wav"
RS["Weapon_U45.ClipOut"] = "weapons/usp45/usp_clipout.wav"
RS["Weapon_U45.ClipIn"] = "weapons/usp45/usp_clipin.wav"
RS["Weapon_U45.Sliderelease"] = "weapons/usp45/usp_sliderelease.wav"
RS["Weapon_U45.Slideback"] = "weapons/usp45/usp_slideback.wav"
RS["Weapon_U45.AttachSilencer"] = "weapons/usp45/usp_silencer_on.wav"
RS["Weapon_U45.DetachSilencer"] = "weapons/usp45/usp_silencer_off.wav"
RS["Weapon_M98.Boltlock"] = "weapons/m98/m98_boltlock.wav"
RS["Weapon_M98.Boltback"] = "weapons/m98/m98_boltback.wav"
RS["Weapon_M98.Boltpush"] = "weapons/m98/m98_boltpush.wav"
RS["Weapon_M98.draw"] = "weapons/m98/m98_deploy.wav"
RS["Weapon_M98.Clipout"] = "weapons/m98/m98_clipout.wav"
RS["Weapon_M98.Clipin"] = "weapons/m98/m98_clipin.wav"
RS["Weapon_awm.Boltlock"] = "weapons/awm/awm_boltlock.wav"
RS["Weapon_awm.Boltback"] = "weapons/awm/awm_boltback.wav"
RS["Weapon_awm.Boltpush"] = "weapons/awm/awm_boltpush.wav"
RS["Weapon_awm.draw"] = "weapons/awm/awm_deploy.wav"
RS["Weapon_awm.Clipout"] = "weapons/awm/awm_clipout.wav"
RS["Weapon_awm.Clipin"] = "weapons/awm/awm_clipin.wav"
RS["Weapon_awm.Cliptap"] = "weapons/awm/awm_cliptap.wav"
RS["Weapon_MP9.Clipout"] = "weapons/mp9/mp9_clipout.wav"
RS["Weapon_MP9.Clipin"] = "weapons/mp9/mp9_clipin.wav"
RS["Weapon_MP9.Deploy"] = "weapons/mp9/mp9_deploy.wav"
RS["Weapon_famf1.cloth"] = "weapons/famf1/cloth.wav"
RS["Weapon_famf1.BoltRelease"] = "weapons/famf1/famas_boltrelease.wav"
RS["Weapon_famf1.BoltPull"] = "weapons/famf1/famas_boltpull.wav"
RS["Weapon_famf1.MagPlace"] = "weapons/famf1/famas_magplace.wav"
RS["Weapon_famf1.ClipOut"] = "weapons/famf1/famas_clipout.wav"
RS["Weapon_famf1.Clipin"] = "weapons/famf1/famas_clipin.wav"
RS["Weapon_famf1.Forearm"] = "weapons/famf1/boltcatch.wav"
RS["Weapon_PP19.MagRelease"] = "weapons/bizon/pp19_magrelease.wav"
RS["Weapon_PP19.MagOut1"] = "weapons/bizon/pp19_magout1.wav"
RS["Weapon_PP19.MagOut2"] = "weapons/bizon/pp19_magout2.wav"
RS["Weapon_PP19.MagIn"] = "weapons/bizon/pp19_magin.wav"
RS["Weapon_PP19.MagTap1"] = "weapons/bizon/pp19_magtap1.wav"
RS["Weapon_PP19.MagTap2"] = "weapons/bizon/pp19_magtap2.wav"
RS["Weapon_PP19.BoltPull"] = "weapons/bizon/pp19_boltpull.wav"
RS["Weapon_PP19.BoltRelease"] = "weapons/bizon/pp19_boltrelease.wav"
RS["Weapon_xm1014.insert"] = "weapons/xm1014cstm/xm_insert.wav"
RS["Weapon_xm1014.dick"] = "weapons/xm1014cstm/xm_cock.wav"
RS["Weapon_Glo17.Clothshit"] = "weapons/glock17/Cloth.wav"
RS["Weapon_Glo17.Foley"] = "weapons/glock17/Foley.wav"
RS["Weapon_Glo17.Clipout"] = "weapons/glock17/Clipout.wav"
RS["Weapon_Glo17.Magdrop"] = "weapons/glock17/Magdrop.wav"
RS["Weapon_Glo17.Clipin"] = "weapons/glock17/Clipin.wav"
RS["Weapon_Glo17.Sliderelease"] = "weapons/glock17/sliderelease.wav"
RS["Weapon_fsvn.Magout"] = "weapons/fiveseven/magout.wav"
RS["Weapon_fsvn.Magin"] = "weapons/fiveseven/magin.wav"
RS["Weapon_fsvn.Magtap"] = "weapons/fiveseven/magtap.wav"
RS["Weapon_fsvn.magpouch"] = "weapons/fiveseven/magpouch.wav"
RS["Weapon_fsvn.Sliderelease"] = "weapons/fiveseven/sliderelease.wav"
RS["Weapon_fsvn.Safety"] = "weapons/fiveseven/safety.wav"
RS["Weapon_pp_2000.Slideback"] = "weapons/TSPP2000/boltpull.wav"
RS["Weapon_pp_2000.Clipout"] = "weapons/TSPP2000/Clipout.wav"
RS["weapon_pp_2000.Clipin"] = "weapons/TSPP2000/Clipin.wav"
RS["Weapon_an94.Cloth"] = "weapons/an94/ak47_cloth.wav"
RS["Weapon_an94.Clothfast"] = "weapons/an94/ak47_cloth_fast.wav"
RS["Weapon_an94.BoltPull"] = "weapons/an94/ak47_boltpull.wav"
RS["Weapon_an94.Safety"] = "weapons/an94/ak47_safety.wav"
RS["Weapon_an94.ClipOut"] = "weapons/an94/ak47_clipout.wav"
RS["Weapon_an94.Clipin"] = "weapons/an94/ak47_clipin.wav"
RS["Weapon_SR-25.Clipout"] = "weapons/sr-25/sr25_clipout.wav"
RS["Weapon_SR-25.Cliptap"] = "weapons/sr-25/sr25_cliptap.wav"
RS["Weapon_SR-25.Clipin"] = "weapons/sr-25/sr25_clipin.wav"
RS["Weapon_SR-25.BoltRelease"] = "weapons/sr-25/sr25_boltrelease.wav"
RS["Weapon_SR-25.Deploy"] = "weapons/sr-25/sr25_deploy.wav"
RS["Weapon_SR-25.Lock"] = "weapons/sr-25/sr25_lock.wav"
RS["Weapon_M16A4.Deploy"] = "weapons/m16a4/m16a4_deploy.wav"
RS["Weapon_M16A4.MagOut"] = "weapons/m16a4/m16a4_magout.wav"
RS["Weapon_M16A4.MagIn"] = "weapons/m16a4/m16a4_magin.wav"
RS["Weapon_M16A4.MagTap"] = "weapons/m16a4/m16a4_magtap.wav"
RS["Weapon_M16A4.BoltPull"] = "weapons/m16a4/m16a4_boltpull.wav"
RS["Weapon_M16A4.BoltRelease"] = "weapons/m16a4/m16a4_boltrelease.wav"
RS["Weapon_tar21.Clipout"] = "weapons/tar21/tar21_clipout.wav"
RS["Weapon_tar21.Clipout1"] = "weapons/tar21/tar21_clipout1.wav"
RS["Weapon_tar21.Tap"] = "weapons/tar21/tar21_tap.wav"
RS["Weapon_tar21.Clipin"] = "weapons/tar21/tar21_clipin.wav"
RS["Weapon_tar21.Boltpull"] = "weapons/tar21/tar21_boltpull.wav"
RS["Weapon_tar21.Boltrelease"] = "weapons/tar21/tar21_boltrelease.wav"
RS["Weapon_tar21.Cloth"] = "weapons/tar21/tar21_cloth.wav"
RS["M3.Insert"] = "weapons/KimM3/insert.wav"
RS["M3.Pump"] = "weapons/KimM3/pump.wav"
RS["M3.Foley"] = "weapons/KimM3/foley.wav"
RS["M3.Draw"] = "weapons/KimM3/draw.wav"
RS["M3.Handle"] = "weapons/KimM3/handle.wav"
RS["Weapon_MP412.Open"] = "weapons/mp412/MP412_Open.wav"
RS["Weapon_MP412.BulletOut"] = "weapons/mp412/MP412_BulletOut.wav"
RS["Weapon_MP412.BulletIn"] = "weapons/mp412/MP412_BulletIn.wav"
RS["Weapon_MP412.Close"] = "weapons/mp412/MP412_Close.wav"
RS["Weapon_MP412.Draw"] = "weapons/mp412/MP412_Draw.wav"
/*RS["Weapon_ks23.Pump"] = "weapons/ks23/ks23_pump.wav"
RS["Weapon_ks23.Insertshell"] = "weapons/ks23/ks23_insertshell.wav"*/
RS["Weapon_xm8.Cliplock"] = "weapons/xm8/safety.wav"
RS["Weapon_xm8.Clipout"] = "weapons/famf1/famas_clipout.wav"
RS["Weapon_xm8.Clipin"] = "weapons/famf1/famas_clipin.wav"
RS["Weapon_xm8.Cliptap"] = "weapons/f2000/f2000_cliptap.wav"
RS["Weapon_xm8.Boltpull"] = "weapons/xm8/Boltpull.wav"
RS["Weapon_xm8.Draw"] = "weapons/xm8/Cloth.wav"
RS["Weapon_xm8.Lock"] = "weapons/xm8/safety.wav"
RS["Weapon_g36.Cliplock"] = "weapons/xm8/safety.wav"
RS["Weapon_g36.Clipout"] = "weapons/famf1/famas_clipout.wav"
RS["Weapon_g36.Clipin"] = "weapons/f2000/f2000_cliptap.wav"
RS["Weapon_g36.Cliptap"] = "weapons/famf1/famas_clipin.wav"
RS["Weapon_g36.Boltpull"] = "weapons/xm8/Boltpull.wav"
RS["Weapon_g36.Draw"] = "weapons/xm8/Cloth.wav"
RS["Weapon_g36.Lock"] = "weapons/xm8/safety.wav"
RS["Weapon_CZ75.Shift"] = "weapons/cz75/shift.wav"
RS["Weapon_CZ75.Magout"] = "weapons/cz75/magout.wav"
RS["Weapon_CZ75.Magin"] = "weapons/cz75/magin.wav"
RS["Weapon_CZ75.MagShove"] = "weapons/cz75/magshove.wav"
RS["Weapon_CZ75.Sliderelease"] = "weapons/cz75/sliderelease.wav"
RS["Weapon_CZ75.Cloth"] = "weapons/cz75/cloth.wav"
RS["Weapon_saiga.Clipout"] = "weapons/saiga/clipout.wav"
RS["Weapon_saiga.Clipin"] = "weapons/saiga/clipin.wav"
RS["Weapon_saiga.BoltPull"] = "weapons/saiga/boltpull.wav"
RS["Weapon_saiga.BoltBack"] = "weapons/saiga/boltrelease.wav"
RS["Weapon_RPK.NewMag"] = "weapons/rpk/rpk_newmag.wav"
RS["Weapon_RPK.MagOut"] = "weapons/rpk/rpk_magout.wav"
RS["Weapon_RPK.MagIn"] = "weapons/rpk/rpk_magin.wav"
RS["Weapon_RPK.Foley"] = "weapons/rpk/rpk_foley.wav"
RS["Weapon_RPK.BoltBack"] = "weapons/rpk/rpk_boltback.wav"
RS["Weapon_RPK.BoltForward"] = "weapons/rpk/rpk_boltforward.wav"
RS["Weapon_RPK.Deploy"] = "weapons/rpk/rpk_deploy.wav"
RS["Weapon_MP5A5.BoltBack"] = "weapons/mp5a5/mp5_boltback.wav"
RS["Weapon_MP5A5.BoltLock"] = "weapons/mp5a5/mp5_boltlock.wav"
RS["Weapon_MP5A5.MagRelease"] = "weapons/mp5a5/mp5_magrelease.wav"
RS["Weapon_MP5A5.MagOut"] = "weapons/mp5a5/mp5_magout.wav"
RS["Weapon_MP5A5.MagIn"] = "weapons/mp5a5/mp5_magin.wav"
RS["Weapon_MP5A5.MagTap"] = "weapons/mp5a5/mp5_magtap.wav"
RS["Weapon_MP5A5.BoltForward"] = "weapons/mp5a5/mp5_boltforward.wav"
RS["Weapon_MP5A5.Deploy"] = "weapons/mp5a5/mp5_deploy.wav"
RS["BF3_UMP45.magout"] = "weapons/ump45_cstm/UMP45 Mag out.wav"
RS["BF3_UMP45.magin"] = "weapons/ump45_cstm/UMP45 Mag In.wav"
RS["BF3_UMP45.deploy"] = "weapons/ump45_cstm/UMP45 Deploy.wav"
RS["BF3_UMP45.tap"] = "weapons/ump45_cstm/UMP45 Tap.wav"
RS["BF3_UMP45.pull"] = "weapons/ump45_cstm/UMP45 Pull.wav"
RS["BF3_UMP45.release"] = "weapons/ump45_cstm/UMP45 Release.wav"
RS["Magnum.chamberout"] = "weapons/44magnum/Magnum Chamber Out.wav"
RS["Magnum.chamberin"] = "weapons/44magnum/Magnum Chamber In.wav"
RS["Magnum.clipout"] = "weapons/44magnum/Magnum Clip Out.wav"
RS["Magnum.clipin"] = "weapons/44magnum/Magnum Clip In.wav"
RS["Magnum.deploy"] = "weapons/44magnum/Magnum Deploy.wav"
RS["Weapon_PP-19-01.Cloth"] = "weapons/pp-19-01/pp1901_cloth.wav"
RS["Weapon_PP-19-01.MagRelease"] = "weapons/pp-19-01/pp1901_magrelease.wav"
RS["Weapon_PP-19-01.MagOut"] = "weapons/pp-19-01/pp1901_magout.wav"
RS["Weapon_PP-19-01.MagIn"] = "weapons/pp-19-01/pp1901_magin.wav"
RS["Weapon_PP-19-01.Slideback"] = "weapons/pp-19-01/pp1901_slideback.wav"
RS["Weapon_PP-19-01.drawcloth"] = "weapons/pp-19-01/pp1901_drawcloth.wav"
RS["Weapon_PP-19-01.draw"] = "weapons/pp-19-01/pp1901_draw.wav"
RS["Weapon_M60.Coverup"] = "weapons/m60/m60_coverup.wav"
RS["Weapon_M60.Coverdown"] = "weapons/m60/m60_coverdown.wav"
RS["Weapon_M60.Chainremove"] = "weapons/m60/m60_Chainremove.wav"
RS["Weapon_M60.Bulletflick"] = "weapons/m60/m60_Bulletflick.wav"
RS["Weapon_M60.Boxout"] = "weapons/m60/m60_boxout.wav"
RS["Weapon_M60.Boxin"] = "weapons/m60/m60_boxin.wav"
RS["Weapon_M60.Chain"] = "weapons/m60/m60_chain.wav"
RS["Weapon_M60.Boltpull"] = "weapons/m60/m60_boltpull.wav"
RS["Weapon_M60.Draw"] = "weapons/m60/m60_draw.wav"
RS["Weapon_L22A2.MagOut"] = "weapons/l22a2/l22a2_magout.wav"
RS["Weapon_L22A2.MagIn"] = "weapons/l22a2/l22a2_magin.wav"
RS["Weapon_L22A2.Foley"] = "weapons/l22a2/l22a2_foley.wav"
RS["Weapon_L22A2.BoltPull"] = "weapons/l22a2/l22a2_boltpull.wav"
RS["Weapon_L22A2.BoltRelease"] = "weapons/l22a2/l22a2_boltrelease.wav"
RS["CSTM_Deagle.Deploy"] = "weapons/deagle_cstm/draw.wav"
RS["CSTM_Deagle.MagOut"] = "weapons/deagle_cstm/magout.wav"
RS["CSTM_Deagle.MagIn"] = "weapons/deagle_cstm/magin.wav"
RS["CSTM_Deagle.SlideBack"] = "weapons/deagle_cstm/slideback.wav"
RS["CSTM_Deagle.SlideForward"] = "weapons/deagle_cstm/slideforward.wav"
RS["M14.MagOut"] = "weapons/m14/m14_magout.wav"
RS["M14.MagIn"] = "weapons/m14/m14_magin.wav"
RS["M14.MagDraw"] = "weapons/m14/m14_magdraw.wav"
RS["M14.BoltPull"] = "weapons/m14/m14_boltpull.wav"
RS["M14.Deploy"] = "weapons/m14/m14_deploy.wav"
RS["Weapon_g2.draw"] = "weapons/g2contender/Draw.wav"
RS["Weapon_g2.hammer"] = {"weapons/g2contender/Cock-1.wav", "weapons/g2contender/Cock-2.wav"}
RS["Weapon_g2.open"] = "weapons/g2contender/open_chamber.wav"
RS["Weapon_g2.shell"] = {"weapons/g2contender/pl_shell1.wav", "weapons/g2contender/pl_shell2.wav", "weapons/g2contender/pl_shell3.wav", "weapons/g2contender/pl_shell4.wav"}
RS["Weapon_g2.shellin"] = "weapons/g2contender/Bullet_in.wav"
RS["Weapon_g2.close"] = "weapons/g2contender/close_chamber.wav"
RS["Weapon_uzi10.boltpull"] = "weapons/uzi/uzi10_boltpull.wav"
RS["Weapon_uzi10.clipin"] = "weapons/uzi/uzi10_clipin.wav"
RS["Weapon_uzi10.clipout"] = "weapons/uzi/uzi10_clipout.wav"
RS["Weapon_Usas.Clipout"] = "weapons/usas12/magout.wav"
RS["Weapon_Usas.Clipin"] = "weapons/usas12/magin.wav"
RS["Weapon_Usas.Boltpull"] = "weapons/usas12/pull.wav"
RS["Weapon_Usas.Boltforward"] = "weapons/usas12/release.wav"
RS["Weapon_Usas.cloth"] = "weapons/usas12/deploy.wav"
RS["Weapon_Usas.draw"] = "weapons/usas12/deploy.wav"
local tbl = {channel = CHAN_STATIC,
volume = 1,
soundlevel = 70,
pitchstart = 100,
pitchend = 100}
for k, v in pairs(RS) do
tbl.name = k
tbl.sound = v
sound.Add(tbl)
end
local wowgarry = sound.Add -- why am I doing this? because apparently sound.Add doesn't work otherwise what the fuck
tbl = {channel = CHAN_STATIC,
volume = 1,
soundlevel = 70,
pitchstart = 100,
pitchend = 100}
function AddReloadSound(event, sound)
tbl.name = event
tbl.sound = sound
wowgarry(tbl)
end |
local require = require
local ej = require 'war3.enhanced_jass'
local Follower = require 'std.class'("Follower", require 'war3.unit')
local SetLifeTime
function Follower:_new(unit, owner)
local follower = self:super():_new(unit)
follower._owner_ = owner
return self
end
function Follower:__call(unit)
return self:super().__call(self, unit)
end
-- NOTE: 沒填時間表示無限
function Follower:create(follwer_type, owner, loc, time)
local follower = self:new(self:super().create(follwer_type, owner, loc))
SetLifeTime(follower, time)
ej.SetUnitAnimation(follower._object_, "birth")
return self
end
SetLifeTime = function(follower, time)
if not time then
return
end
ej.setLifeTime(follower._object_, time)
end
return Follower
|
local config = {}
function config.telescope()
if not packer_plugins['plenary.nvim'].loaded then
vim.cmd [[packadd plenary.nvim]]
vim.cmd [[packadd popup.nvim]]
end
require('telescope').setup {
defaults = {
file_ignore_patterns = { "target/.*", ".git/.*", "node_modules/*" },
layout_config = {
prompt_position = 'top',
horizontal = {
mirror = false
},
vertical = {
mirror = false
}
},
prompt_prefix = ' ',
selection_caret = '» ',
color_devicons = true,
file_previewer = require('telescope.previewers').vim_buffer_cat.new,
grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new,
qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new,
},
pickers = {
buffers = {
theme = "ivy"
},
find_files = {
theme = "ivy"
},
},
}
end
return config
|
cc = cc or {}
cc.tweenfunc = cc.tweenfunc or BaseClass()
function cc.tweenfunc.easeIn(time, rate)
return math.pow(time, rate)
end
function cc.tweenfunc.easeOut(time, rate)
return math.pow(time, 1 / rate)
end
function cc.tweenfunc.easeInOut(time, rate)
time = time * 2
if (time < 1) then
return 0.5 * math.pow(time, rate)
else
return (1.0 - 0.5 * math.pow(2 - time, rate))
end
end
-- Sine Ease
function cc.tweenfunc.sineEaseIn(time)
return -1 * math.cos(time * M_PI_2) + 1;
end
function cc.tweenfunc.sineEaseOut(time)
return math.sin(time * M_PI_2);
end
function cc.tweenfunc.sineEaseInOut(time)
return -0.5 * (math.cos(M_PI * time) - 1);
end
-- Quad Ease
function cc.tweenfunc.quadEaseIn(time)
return time * time;
end
function cc.tweenfunc.quadEaseOut(time)
return -1 * time * (time - 2);
end
function cc.tweenfunc.quadEaseInOut(time)
time = time*2;
if (time < 1) then
return 0.5 * time * time;
end
time = time - 1
return -0.5 * (time * (time - 2) - 1);
end
-- Cubic Ease
function cc.tweenfunc.cubicEaseIn(time)
return time * time * time;
end
function cc.tweenfunc.cubicEaseOut(time)
time = time - 1;
return (time * time * time + 1);
end
function cc.tweenfunc.cubicEaseInOut(time)
time = time*2;
if (time < 1) then
return 0.5 * time * time * time;
end
time = time - 2;
return 0.5 * (time * time * time + 2);
end
-- Quart Ease
function cc.tweenfunc.quartEaseIn(time)
return time * time * time * time;
end
function cc.tweenfunc.quartEaseOut(time)
time = time - 1;
return -(time * time * time * time - 1);
end
function cc.tweenfunc.quartEaseInOut(time)
time = time*2;
if (time < 1) then
return 0.5 * time * time * time * time;
end
time = time - 2;
return -0.5 * (time * time * time * time - 2);
end
-- Quint Ease
function cc.tweenfunc.quintEaseIn(time)
return time * time * time * time * time;
end
function cc.tweenfunc.quintEaseOut(time)
time = time - 1
return (time * time * time * time * time + 1);
end
function cc.tweenfunc.quintEaseInOut(time)
time = time*2;
if (time < 1) then
return 0.5 * time * time * time * time * time;
end
time = time - 2;
return 0.5 * (time * time * time * time * time + 2);
end
-- Expo Ease
function cc.tweenfunc.expoEaseIn(time)
return time == 0 and 0 or math.pow(2, 10 * (time/1 - 1)) - 1 * 0.001;
end
function cc.tweenfunc.expoEaseOut(time)
return time == 1 and 1 or (-math.pow(2, -10 * time / 1) + 1);
end
function cc.tweenfunc.expoEaseInOut(time)
time = time / 0.5;
if (time < 1) then
time = 0.5 * math.pow(2, 10 * (time - 1));
else
time = 0.5 * (-math.pow(2, -10 * (time - 1)) + 2);
end
return time;
end
-- Circ Ease
function cc.tweenfunc.circEaseIn(time)
return -1 * (math.sqrt(1 - time * time) - 1);
end
function cc.tweenfunc.circEaseOut(time)
time = time - 1;
return math.sqrt(1 - time * time);
end
function cc.tweenfunc.circEaseInOut(time)
time = time * 2;
if (time < 1) then
return -0.5 * (math.sqrt(1 - time * time) - 1);
end
time = time - 2;
return 0.5 * (math.sqrt(1 - time * time) + 1);
end
function cc.tweenfunc.elasticEaseOut( time, period )
local newT = 0
if time == 0 or time == 1 then
newT = time
else
local s = period / 4
newT = math.pow(2, -10 * time) * math.sin((time - s) * M_PI_X_2 / period) + 1;
end
return newT
end
function cc.tweenfunc.elasticEaseIn(time, period)
local newT = 0;
if (time == 0 or time == 1) then
newT = time;
else
local s = period / 4;
time = time - 1;
newT = -math.pow(2, 10 * time) * math.sin((time - s) * M_PI_X_2 / period);
end
return newT
end
function cc.tweenfunc.elasticEaseInOut(time, period)
local newT = 0;
if (time == 0 or time == 1) then
newT = time;
else
time = time * 2;
if (not period or period == 0) then
period = 0.3 * 1.5;
end
local s = period / 4;
time = time - 1;
if (time < 0) then
newT = -0.5 * math.pow(2, 10 * time) * math.sin((time -s) * M_PI_X_2 / period);
else
newT = math.pow(2, -10 * time) * math.sin((time - s) * M_PI_X_2 / period) * 0.5 + 1;
end
end
return newT;
end
-- Back Ease
function cc.tweenfunc.backEaseIn(time)
local overshoot = 1.70158;
return time * time * ((overshoot + 1) * time - overshoot);
end
function cc.tweenfunc.backEaseOut(time)
local overshoot = 1.70158;
time = time - 1;
return time * time * ((overshoot + 1) * time + overshoot) + 1;
end
function cc.tweenfunc.backEaseInOut(time)
local overshoot = 1.70158 * 1.525;
time = time * 2;
if (time < 1) then
return (time * time * ((overshoot + 1) * time - overshoot)) / 2;
else
time = time - 2;
return (time * time * ((overshoot + 1) * time + overshoot)) / 2 + 1;
end
end
-- Bounce Ease
function cc.tweenfunc.bounceTime(time)
if (time < 1 / 2.75) then
return 7.5625 * time * time;
elseif (time < 2 / 2.75) then
time = time - 1.5 / 2.75;
return 7.5625 * time * time + 0.75;
elseif(time < 2.5 / 2.75) then
time = time - 2.25 / 2.75;
return 7.5625 * time * time + 0.9375;
end
time = time - 2.625 / 2.75;
return 7.5625 * time * time + 0.984375;
end
function cc.tweenfunc.bounceEaseIn(time)
return 1 - cc.tweenfunc.bounceTime(1 - time);
end
function cc.tweenfunc.bounceEaseOut(time)
return cc.tweenfunc.bounceTime(time);
end
function cc.tweenfunc.bounceEaseInOut(time)
local newT = 0;
if (time < 0.5) then
time = time * 2;
newT = (1 - cc.tweenfunc.bounceTime(1 - time)) * 0.5;
else
newT = cc.tweenfunc.bounceTime(time * 2 - 1) * 0.5 + 0.5;
end
return newT;
end
-- Custom Ease
function cc.tweenfunc.customEase(time, easingParam)
if (easingParam) then
local tt = 1-time;
return easingParam[1]*tt*tt*tt + 3*easingParam[3]*time*tt*tt + 3*easingParam[5]*time*time*tt + easingParam[7]*time*time*time;
end
return time;
end
function cc.tweenfunc.quadraticIn(time)
return math.pow(time,2);
end
function cc.tweenfunc.quadraticOut(time)
return -time*(time-2);
end
function cc.tweenfunc.quadraticInOut(time)
local resultTime = time;
time = time*2;
if (time < 1) then
resultTime = time * time * 0.5;
else
time = time - 1
resultTime = -0.5 * (time * (time - 2) - 1);
end
return resultTime;
end
function cc.tweenfunc.bezieratFunction( a, b, c, d, t )
return (math.pow(1-t,3) * a + 3*t*(math.pow(1-t,2))*b + 3*math.pow(t,2)*(1-t)*c + math.pow(t,3)*d );
end
|
--[[
********************************************************************************
Project owner: RageQuit community
Project name: GTW-RPG
Developers: Mr_Moose
Source code: https://github.com/404rq/GTW-RPG/
Bugtracker: https://discuss.404rq.com/t/issues
Suggestions: https://discuss.404rq.com/t/development
Version: Open source
License: BSD 2-Clause
Status: Stable release
********************************************************************************
]]--
-- Define the menu GUI window
local sx,sy = guiGetScreenSize()
local win_menu = exports.GTWgui:createWindow((sx-320)/2, (sy-297)/2, 320, 297, "Restaurant menu", false)
guiSetVisible(win_menu, false)
-- Define the menu buttons
btn_close = guiCreateButton(210,257,100,36,"Close",false,win_menu)
btn_choice_1 = guiCreateButton(10,100,160,36, "Buster("..prices[1].."$)",false,win_menu)
btn_choice_2 = guiCreateButton(10,217,160,36, "Double D-Luxe("..prices[2].."$)",false,win_menu)
btn_choice_3 = guiCreateButton(170,100,160,36, "Full rack("..prices[3].."$)",false,win_menu)
btn_choice_4 = guiCreateButton(170,217,160,36, "Sallad meal("..prices[4].."$)",false,win_menu)
-- Apply GTWgui styles
exports.GTWgui:setDefaultFont(btn_close, 10)
exports.GTWgui:setDefaultFont(btn_choice_1, 10)
exports.GTWgui:setDefaultFont(btn_choice_2, 10)
exports.GTWgui:setDefaultFont(btn_choice_3, 10)
exports.GTWgui:setDefaultFont(btn_choice_4, 10)
--[[ Update the GUI depending on restaurant type ]]--
function initialize_menu_choices(r_type)
-- Set the text and prices on buttons and window title
guiSetText(win_menu, menu_choices[r_type]["title"])
guiSetText(btn_choice_1, menu_choices[r_type]["choice_1"][1]..", "..prices[1].."$")
guiSetText(btn_choice_2, menu_choices[r_type]["choice_2"][1]..", "..prices[2].."$)")
guiSetText(btn_choice_3, menu_choices[r_type]["choice_3"][1]..", "..prices[3].."$)")
guiSetText(btn_choice_4, menu_choices[r_type]["choice_4"][1]..", "..prices[4].."$)")
-- Destroy current images if any
if img1 and isElement(img1) then destroyElement(img1) end
if img2 and isElement(img2) then destroyElement(img2) end
if img3 and isElement(img3) then destroyElement(img3) end
if img4 and isElement(img4) then destroyElement(img4) end
-- Make new images, (load from files when needed)
img1 = guiCreateStaticImage(10, 23, 160, 77, menu_choices[r_type]["choice_1"][2], false, win_menu)
img2 = guiCreateStaticImage(10,140, 160, 77, menu_choices[r_type]["choice_2"][2], false, win_menu)
img3 = guiCreateStaticImage(170, 23, 160, 77, menu_choices[r_type]["choice_3"][2], false, win_menu)
img4 = guiCreateStaticImage(170, 140, 160, 77, menu_choices[r_type]["choice_4"][2], false, win_menu)
end
--[[ Open the menu GUI to choose food ]]--
function open_menu(plr, r_type)
initialize_menu_choices(r_type)
guiSetVisible(win_menu, true)
exports.GTWgui:showGUICursor(true)
end
addEvent("GTWfastfood.gui.show",true)
addEventHandler("GTWfastfood.gui.show", root, open_menu)
--[[ Close the menu ]]--
function close_menu()
guiSetVisible(win_menu, false)
exports.GTWgui:showGUICursor(false)
end
addEvent("GTWfastfood.gui.hide", true)
addEventHandler("GTWfastfood.gui.hide", root, close_menu)
--[[ Handle menu click ]]--
function menu_click()
-- Make sure that the player can afford his food
local money = getPlayerMoney(localPlayer)
-- Shall we close this menu?
if source == btn_close then
guiSetVisible(win_menu, false)
exports.GTWgui:showGUICursor(false)
return
end
-- Alright, let's continue shopping, can I take your order?
local ID_choice = 1
if source == btn_choice_1 then ID_choice = 1 end
if source == btn_choice_2 then ID_choice = 2 end
if source == btn_choice_3 then ID_choice = 3 end
if source == btn_choice_4 then ID_choice = 4 end
-- Take care of the order server side
if money > prices[ID_choice] and not isTimer(cooldown) then
triggerServerEvent("GTWfastfood.buy", localPlayer, prices[ID_choice], health[ID_choice])
cooldown = setTimer(function() end, 200, 1)
end
end
addEventHandler("onClientGUIClick", btn_close, menu_click)
addEventHandler("onClientGUIClick", btn_choice_1, menu_click)
addEventHandler("onClientGUIClick", btn_choice_2, menu_click)
addEventHandler("onClientGUIClick", btn_choice_3, menu_click)
addEventHandler("onClientGUIClick", btn_choice_4, menu_click)
--[[ Protect fastfood workers from being killed ]]--
function protect_worker(attacker)
if not getElementData(source, "GTWfastfood.isWorker") then return end
cancelEvent() -- cancel any damage done to peds
end
addEventHandler("onClientPedWasted", root, protect_worker)
|
return {'ikke'} |
line = 1
col = 1
function move_cursor(line,col)
svrSend(csi .. line .. ";" .. col .. "H")
end
function clear_screen()
svrSend(csi .. "2J")
end
function handle_up()
line = line - 1
if line < 1 then line = 1 end
move_cursor(line,col)
end
function handle_down()
line = line + 1
if line > 20 then line = 20 end
move_cursor(line,col)
end
function handle_left()
col = col - 1
if col < 1 then col = 1 end
move_cursor(line, col)
end
function handle_right()
col = col + 1
if col > 20 then col = 20 end
move_cursor(line, col)
end
csi = string.char(27) .. "["
ansi = {}
ansi[csi.."A"] = handle_up
ansi[csi.."B"] = handle_down
ansi[csi.."C"] = handle_right
ansi[csi.."D"] = handle_left
function isPrintable(k)
local r = false
if k >= 65 and k <= 65+26 then
r = true
end
if k >= 97 and k <= 97+26 then
r = true
end
if k >= 48 and k <= 57 then r = true end
if k == 32 then r = true end
return r
end
-- set the metatable for ansi to one that
-- will handle printable characters
ansimt = {}
function ansimt.__index(t,k)
--svrSend("meta, #k = " .. #k, sck1)
if #k == 1 then
local b = string.byte(k,1)
--svrSend("b = " .. b, sck1)
if isPrintable(b) then
svrSend(string.char(b))
handle_right()
end
end
end
setmetatable(ansi, ansimt)
function svrRunEchoServer(sck)
-- echo server
local s = svrReceive(sck)
-- detect up, down, left, right, backspace, delete, insert, etc
-- shift arrows, more and more and more
if s~="" then
clearTrace()
for i=1,#s,1 do
print(string.byte(s,i))
end
fn = ansi[s] or function () end
fn()
end
end
|
local battle_defs = require "battle/battle_defs"
local CARD_FLAGS = battle_defs.CARD_FLAGS
local BATTLE_EVENT = battle_defs.BATTLE_EVENT
local attacks =
{
corrosive_goo =
{
name = "Corrosive Goo",
desc = "At the end of your turn take 3 damage.",
icon = "battle/status_lumin_burn.tex",
cost = 1,
played_sound = SoundEvents.battle_status_bleed,
target_type = TARGET_TYPE.SELF,
bleed_damage = 3,
flags = CARD_FLAGS.STATUS | CARD_FLAGS.EXPEND,
event_handlers =
{
[ BATTLE_EVENT.END_PLAYER_TURN ] = function( self, battle )
self:NotifyTriggered()
self.engine:BroadcastEvent( BATTLE_EVENT.DELAY, 0.25 )
self.owner:ApplyDamage( self.bleed_damage, nil, nil, nil, {"bleed"} )
end,
},
},
enfeebling_goo =
{
name = "Enfeebling Goo",
desc = "Gain 1 {ENFEEBLEMENT} while this is in your hand.",
cost = 1,
icon = "battle/numbness.tex",
target_type = TARGET_TYPE.SELF,
rarity = CARD_RARITY.UNIQUE,
flags = CARD_FLAGS.EXPEND | CARD_FLAGS.STATUS,
deck_handlers = { DECK_TYPE.DISCARDS, DECK_TYPE.IN_HAND, DECK_TYPE.DRAW},
event_handlers =
{
[ BATTLE_EVENT.CARD_MOVED ] = function( self, card, source_deck, source_idx, target_deck, target_idx )
if card == self then
if target_deck and target_deck:GetDeckType() == DECK_TYPE.IN_HAND then
self.owner:AddCondition( "ENFEEBLEMENT", 1 )
elseif source_deck and source_deck:GetDeckType() == DECK_TYPE.IN_HAND then
self.owner:RemoveCondition( "ENFEEBLEMENT", 1 )
end
end
end,
},
},
adherent_goo =
{
name = "Adherent Goo",
desc = "Gain 1 {UNBALACED} while this is in your hand.",
cost = 1,
icon = "battle/robo_kick.tex",
target_type = TARGET_TYPE.SELF,
rarity = CARD_RARITY.UNIQUE,
flags = CARD_FLAGS.EXPEND | CARD_FLAGS.STATUS,
deck_handlers = { DECK_TYPE.DISCARDS, DECK_TYPE.IN_HAND, DECK_TYPE.DRAW},
event_handlers =
{
[ BATTLE_EVENT.CARD_MOVED ] = function( self, card, source_deck, source_idx, target_deck, target_idx )
if card == self then
if target_deck and target_deck:GetDeckType() == DECK_TYPE.IN_HAND then
self.owner:AddCondition( "UNBALACED", 1 )
elseif source_deck and source_deck:GetDeckType() == DECK_TYPE.IN_HAND then
self.owner:RemoveCondition( "UNBALACED", 1 )
end
end
end,
},
},
replicating_goo =
{
name = "Replicating Goo",
desc = "If this card is in your hand at the end of the turn, divide it into 2.",
cost = 1,
icon = "negotiation/horrible_rash.tex",
target_type = TARGET_TYPE.SELF,
flags = CARD_FLAGS.STATUS | CARD_FLAGS.EXPEND,
event_handlers =
{
[ BATTLE_EVENT.END_PLAYER_TURN ] = function( self, battle )
self:NotifyTriggered()
self.engine:BroadcastEvent( BATTLE_EVENT.DELAY, 0.25 )
battle:ExpendCard(self)
local cards = {}
for k = 1, 2 do
local incepted_card = Battle.Card( "replicating_goo", self.owner)
incepted_card.incepted = true
table.insert(cards, incepted_card )
end
battle:DealCards( cards, battle:GetDiscardDeck() )
end
}
},
}
for id, data in pairs(attacks) do
data.cost = data.cost or 0
data.rarity = data.rarity or CARD_RARITY.UNIQUE
data.series = CARD_SERIES.GENERAL
Content.AddBattleCard(id, data)
end
|
require('plugin_pre.plugin.requirement')
|
local log = {}
local function do_log(fn, msg, ...)
fn("[TcpExport] " .. string.format(msg, ...))
end
function log.debug(msg, ...)
do_log(env.debug, msg, ...)
end
function log.info(msg, ...)
do_log(env.info, msg, ...)
end
function log.warning(msg, ...)
do_log(env.warning, msg, ...)
end
function log.error(msg, ...)
do_log(env.error, msg, ...)
end
return log |
function InitGameLogic()
LocationScript={}
local Folder="data/scripts/GameLogic/"
dofile(Folder.."InitGame.lua")
dofile(Folder.."Window_Minigame_Balls.lua")
local LoadWindow=WindowManager.LoadWindow
LoadWindow("Minigame_Balls")
InitGame()
WindowManager.OpenWindow("Minigame_Balls")
end
|
-- SilvervineUE4Lua / devCAT studio
-- Copyright 2016 - 2019. Nexon Korea Corporation. All rights reserved.
UE4 = {}
local PrimitiveType = Class()
PrimitiveType.isPrimitiveType = true
--=============================================================================================================================
-- PlatformTime
--=============================================================================================================================
UE4.PlatformTime = {}
--=============================================================================================================================
-- FVector
--=============================================================================================================================
UE4.Vector = Class(PrimitiveType)
function UE4.Vector:init(x, y, z)
self.X = x or 0.0
self.Y = y or 0.0
self.Z = z or 0.0
end
UE4.Vector.ZeroVector = UE4.Vector.new(0.0, 0.0, 0.0)
UE4.Vector.OneVector = UE4.Vector.new(1.0, 1.0, 1.0)
function UE4.Vector:GetNormal2D(tolerance)
return UE4.Vector.new(self.X, self.Y, 0.0):GetNormal(tolerance)
end
--=============================================================================================================================
-- FVector2D
--=============================================================================================================================
UE4.Vector2D = Class(PrimitiveType)
function UE4.Vector2D:init(x, y)
self.X = x or 0.0
self.Y = y or 0.0
end
UE4.Vector2D.ZeroVector = UE4.Vector2D.new(0.0, 0.0)
--=============================================================================================================================
-- FVector4
--=============================================================================================================================
UE4.Vector4 = Class(PrimitiveType)
function UE4.Vector4:init(x, y, z, w)
self.X = x or 0.0
self.Y = y or 0.0
self.Z = z or 0.0
self.W = w or 0.0
end
UE4.Vector4.ZeroVector = UE4.Vector4.new(0.0, 0.0, 0.0, 0.0)
--=============================================================================================================================
-- FIntPoint
--=============================================================================================================================
UE4.IntPoint = Class(PrimitiveType)
function UE4.IntPoint:init(x, y)
self.X = x or 0
self.Y = y or 0
end
UE4.IntPoint.ZeroValue = UE4.Vector4.new(0, 0)
--=============================================================================================================================
-- FIntVector
--=============================================================================================================================
UE4.IntVector = Class(PrimitiveType)
function UE4.IntVector:init(x, y, z)
self.X = x or 0
self.Y = y or 0
self.Z = z or 0
end
UE4.IntVector.ZeroValue = UE4.Vector4.new(0, 0, 0)
--=============================================================================================================================
-- FPlane
--=============================================================================================================================
UE4.Plane = Class(PrimitiveType)
function UE4.Plane:init(x, y, z, w)
self.X = x or 0.0
self.Y = y or 0.0
self.Z = z or 0.0
self.W = w or 0.0
end
--=============================================================================================================================
-- FMatrix
--=============================================================================================================================
UE4.Matrix = Class(PrimitiveType)
function UE4.Matrix:init(x, y, z, w)
self.XPlane = x or UE4.Plane.new()
self.YPlane = y or UE4.Plane.new()
self.ZPlane = z or UE4.Plane.new()
self.WPlane = w or UE4.Plane.new()
end
--=============================================================================================================================
-- FRotator
--=============================================================================================================================
UE4.Rotator = Class(PrimitiveType)
function UE4.Rotator:init(pitch, yaw, roll)
self.Pitch = pitch or 0.0
self.Yaw = yaw or 0.0
self.Roll = roll or 0.0
end
UE4.Rotator.ZeroRotator = UE4.Rotator.new(0.0, 0.0, 0.0)
function UE4.Rotator:GetForwardVector()
return self:GetAxisX()
end
function UE4.Rotator:GetRightVector()
return self:GetAxisY()
end
function UE4.Rotator:GetUpVector()
return self:GetAxisZ()
end
--=============================================================================================================================
-- FQuat
--=============================================================================================================================
UE4.Quat = Class(PrimitiveType)
function UE4.Quat:init(x, y, z, w)
self.X = x or 0.0
self.Y = y or 0.0
self.Z = z or 0.0
self.W = w or 1.0
end
UE4.Quat.Identity = UE4.Quat.new(0.0, 0.0, 0.0, 1.0)
--=============================================================================================================================
-- FLinearColor
--=============================================================================================================================
UE4.LinearColor = Class(PrimitiveType)
function UE4.LinearColor:init(r, g, b, a)
self.R = r or 0.0
self.G = g or 0.0
self.B = b or 0.0
self.A = a or 1.0
end
--=============================================================================================================================
-- FColor
--=============================================================================================================================
UE4.Color = Class(PrimitiveType)
function UE4.Color:init(r, g, b, a)
self.R = r or 0
self.G = g or 0
self.B = b or 0
self.A = a or 0xFF
end
--=============================================================================================================================
-- FTransform
--=============================================================================================================================
UE4.Transform = Class(PrimitiveType)
function UE4.Transform:init(r, t, s)
self.Rotation = r or UE4.Quat.Identity
self.Translation = t or UE4.Vector.ZeroVector
self.Scale3D = s or UE4.Vector.OneVector
end
UE4.Transform.Identity = UE4.Transform.new()
--=============================================================================================================================
-- FBox
--=============================================================================================================================
UE4.Box = Class(PrimitiveType)
function UE4.Box:init(min, max)
self.Min = min or UE4.Vector.ZeroVector
self.Max = max or UE4.Vector.ZeroVector
end
--=============================================================================================================================
-- FBox2D
--=============================================================================================================================
UE4.Box2D = Class(PrimitiveType)
function UE4.Box2D:init(min, max)
self.Min = min or UE4.Vector2D.ZeroVector
self.Max = max or UE4.Vector2D.ZeroVector
end
--=============================================================================================================================
-- FBoxSphereBounds
--=============================================================================================================================
UE4.BoxSphereBounds = Class(PrimitiveType)
function UE4.BoxSphereBounds:init(origin, extent, radius)
self.Origin = origin or UE4.Vector.ZeroVector
self.BoxExtent = extent or UE4.Vector.ZeroVector
self.SphereRadius = radius or 0.0
end
--=============================================================================================================================
-- FGuid
--=============================================================================================================================
UE4.Guid = Class(PrimitiveType)
function UE4.Guid:init(a, b, c, d)
self.A = a or 0
self.B = b or 0
self.C = c or 0
self.D = d or 0
end
--=============================================================================================================================
-- FDateTime
--=============================================================================================================================
UE4.DateTime = Class(PrimitiveType)
function UE4.DateTime:init(ticks)
self.Ticks = ticks or 0
end
--=============================================================================================================================
-- FTimecode
--=============================================================================================================================
UE4.Timecode = Class(PrimitiveType)
function UE4.Timecode:init(hours, minutes, seconds, frames, dropFrameFormat)
self.Hours = hours or 0
self.Minutes = minutes or 0
self.Seconds = seconds or 0
self.Frames = frames or 0
self.bDropFrameFormat = dropFrameFormat or false
end
--=============================================================================================================================
-- FTimespan
--=============================================================================================================================
UE4.Timespan = Class(PrimitiveType)
function UE4.Timespan:init(ticks)
self.Ticks = ticks or 0
end
--=============================================================================================================================
-- FRandomStream
--=============================================================================================================================
UE4.RandomStream = Class(PrimitiveType)
function UE4.RandomStream:init(seed)
self.Seed = seed or 0
end
--=============================================================================================================================
-- FFrameRate
--=============================================================================================================================
UE4.FrameRate = Class(PrimitiveType)
function UE4.FrameRate:init(numerator, denominator)
self.Numerator = numerator or 0
self.Denominator = denominator or 0
end
--=============================================================================================================================
-- FFrameNumber
--=============================================================================================================================
UE4.FrameNumber = Class(PrimitiveType)
function UE4.FrameNumber:init(value)
self.Value = value or 0
end
--=============================================================================================================================
-- FFrameTime
--=============================================================================================================================
UE4.FrameTime = Class(PrimitiveType)
function UE4.FrameTime:init(frame, subFrame)
self.Frame = frame or UE4.FrameNumber.new()
self.SubFrame = subFrame or 0
end
--=============================================================================================================================
-- FQualifiedFrameTime
--=============================================================================================================================
UE4.QualifiedFrameTime = Class(PrimitiveType)
function UE4.QualifiedFrameTime:init(time, rate)
self.Time = time or UE4.FrameTime.new()
self.Rate = rate or UE4.FrameRate.new()
end
--=============================================================================================================================
-- FPrimaryAssetType
--=============================================================================================================================
UE4.PrimaryAssetType = Class(PrimitiveType)
function UE4.PrimaryAssetType:init(name)
self.Name = name or ""
end
--=============================================================================================================================
-- FPrimaryAssetId
--=============================================================================================================================
UE4.PrimaryAssetId = Class(PrimitiveType)
function UE4.PrimaryAssetId:init(primaryAssetType, primaryAssetName)
self.PrimaryAssetType = primaryAssetType or UE4.PrimaryAssetType.new()
self.PrimaryAssetName = primaryAssetName or ""
end
--=============================================================================================================================
-- FSoftObjectPath
--=============================================================================================================================
UE4.SoftObjectPath = Class(PrimitiveType)
function UE4.SoftObjectPath:init(assetPathName, subPathString)
self.AssetPathName = assetPathName or ""
self.SubPathString = subPathString or ""
end
--=============================================================================================================================
-- FFloatRangeBound
--=============================================================================================================================
UE4.FloatRangeBound = Class(PrimitiveType)
function UE4.FloatRangeBound:init(type, value)
self.Type = type or 0
self.Value = value or 0.0
end
--=============================================================================================================================
-- FFloatRange
--=============================================================================================================================
UE4.FloatRange = Class(PrimitiveType)
function UE4.FloatRange:init(lowerBound, upperBound)
self.LowerBound = lowerBound or UE4.FloatRangeBound.new()
self.UpperBound = upperBound or UE4.FloatRangeBound.new()
end
--=============================================================================================================================
-- FInt32Interval
--=============================================================================================================================
UE4.Int32Interval = Class(PrimitiveType)
function UE4.Int32Interval:init(min, max)
self.Min = min or 0
self.Max = max or 0
end
--=============================================================================================================================
-- Enum
--=============================================================================================================================
UE4.Enum = Class(PrimitiveType)
function UE4.Enum:ToString(enumValue)
for k, v in pairs(self) do
if v == enumValue then return k end
end
end
--=============================================================================================================================
-- Math
--=============================================================================================================================
UE4.Math = {}
--=============================================================================================================================
--PointEvent
--=============================================================================================================================
UE4.PointerEvent = Class()
--=============================================================================================================================
-- TextFormatter
--=============================================================================================================================
UE4.TextFormatter = Class() |
Clockwork.hudclock = Clockwork.kernel:NewLibrary("HudClock");
if (CLIENT) then
-- A function to draw a clock on a player's HUD.
function Clockwork.hudclock.HUDPaint()
local player = LocalPlayer();
if player:GetNetworkedInt("hudclock") == 0 then
return
end
-- Box Rounding (has to be an even number).
local CornerAA = 8;
-- Color of the border.
local BorderR = 0;
local BorderG = 0;
local BorderB = 0;
local BorderA = 100;
-- Color of the box.
local BoxR = 50;
local BoxG = 50;
local BoxB = 50;
local BoxA = 125;
-- Variables for the in-game day/time.
local timeString = Clockwork.time:GetString();
local dayName = Clockwork.time:GetDayName();
-- Length of the entire clock.
local Width = 120;
-- Variables for the day/time
local msg = {};
msg[1] = dayName..",";
msg[2] = timeString;
msg[3] = "Day Time";
msg[4] = "Day Time";
-- Font, height, width, etc...
surface.SetFont("Default");
local w = Width;
local h = 3;
local x = surface.ScreenWidth() - 150
local y = surface.ScreenHeight() - 25
-- Border
draw.RoundedBox(CornerAA, x-7, y-12, w+24,h*6+8, Color(BorderR,BorderG,BorderB,BorderA));
-- Main Box
draw.RoundedBox(CornerAA, x-5, y-10, w+20,h*4+10, Color(BoxR,BoxG,BoxB,BoxA));
-- Draw Text
draw.SimpleText(msg[1], "Default", x+2, y-6, Color(255,255,255,210));
-- Draw Text
draw.SimpleText(msg[2], "Default", x+66, y-6, Color(255,255,255,210));
-- Background Text
draw.SimpleText(msg[3], "DefaultSmall", x+6, y-17, Color(0,0,0,255));
-- Front Text
draw.SimpleText(msg[4], "DefaultSmall", x+7, y-16, Color(255,255,255,255));
end;
hook.Add("HUDPaint", "Clockwork.hudclock.HUDPaint", Clockwork.hudclock.HUDPaint);
else
-- A function to enable/disable the Hud Clock.
function Clockwork.hudclock.Command(player, command, arguments)
if not arguments[1] then
if player:GetNetworkedInt("hudclock") == 1 then
Clockwork.hudclock.Disable(player)
else
Clockwork.hudclock.Enable(player)
end;
elseif arguments[1] == "1" then
Clockwork.hudclock.Enable(player)
elseif arguments[1] == "0" then
Clockwork.hudclock.Disable(player)
end;
end;
concommand.Add("hudclock", Clockwork.hudclock.Command)
-- Called when the Hud Clock is enabled.
function Clockwork.hudclock.Enable(player)
if (player:GetNetworkedInt("hudclock") == 1) then
return
end;
player:SetNetworkedInt("hudclock", 1);
end;
-- Called when the Hud Clock is disabled.
function Clockwork.hudclock.Disable(player)
if (player:GetNetworkedInt("hudclock") == 0) then
return
end;
player:SetNetworkedInt("hudclock", 0);
end
end; |
function love.conf(t)
t.window.title = "LOVE2D Boilerplate"
_G.conf = t -- Makes configuration options accessible later
end
|
function pt(t) -- print a table shallowly
local str = "{ "
for k, v in pairs(t) do
if (type(k) == "string") then
if (k:find("^[_%a]+[_%w]*$")) then -- valid variable name
str = str .. k
else
str = str .. "[\"" .. k .. "\"]"
end
else
str = str .. "[" .. tostring(k) .. "]"
end
str = str .. " = " .. tostring(v) .. ", "
end
if #str > 2 then
str = str:sub(1, -3) -- remove last comma
end
return str .. " }"
end
function pa(t, printKeys) -- print an array shallowly
local str = "{ "
for i, v in ipairs(t) do
if (printKeys) then
str = str .. "[" .. i .. "] = "
end
str = str .. tostring(v) .. ", "
end
if #str > 2 then
str = str:sub(1, -3) -- remove last comma
end
return str .. " }"
end
function pk(t) -- print a table’s keys shallowly
local str = ""
for k, _ in pairs(t) do
if (type(k) == "string") then
str = str .. k
else
str = str .. "[" .. tostring(k) .. "]"
end
str = str .. ", "
end
if #str > 2 then
str = str:sub(1, -3) -- remove last comma
end
return str .. " }"
end
function map(f, t)
local result = {}
for k, v in ipairs(t) do
result[k] = f(v)
end
return result
end
function newArray(getNewElement, width, height)
local result = {}
if height and 1 <= height then
for i = 1, width do
table.insert(
result,
newArray(
function (j) return getNewElement(i, j) end,
height
)
)
end
else
for i = 1, width do
table.insert(result, getNewElement(i))
end
end
return result
end
function rep(str, n)
local result = ""
local i = 0
while i < n do
result = result..str
i = i + 1
end
return result
end
function pad(left, right)
local result = {}
--~ (waiting for monospace font before aligning to the right)
--~ local leftColumnSize = sizeOfLongest(left)
--~ local rightColumnSize = sizeOfLongest(right)
for i, prefix in ipairs(left) do
--~ result[prefix] = prefix .. rep(" ", leftColumnSize - #prefix) .. rep(" ", rightColumnSize - #right[i]) .. right[i]
result[prefix] = prefix .. " " .. right[i]
end
return result
end
local function length(str)
return #str
end
local function sizeOfLongest(strings)
return Tables.max(map(length, strings))
end
|
-- utilities
COPPER_PER_SILVER = 100;
SILVER_PER_GOLD = 100;
COPPER_PER_GOLD = COPPER_PER_SILVER * SILVER_PER_GOLD;
function GetMoneyStringPadded(money, separateThousands)
local goldString, silverString, copperString;
local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
local silver = floor((money - (gold * COPPER_PER_SILVER * SILVER_PER_GOLD)) / COPPER_PER_SILVER);
local copper = mod(money, COPPER_PER_SILVER);
if ( ENABLE_COLORBLIND_MODE == "1" ) then
if (separateThousands) then
goldString = FormatLargeNumber(gold)..GOLD_AMOUNT_SYMBOL;
else
goldString = gold..GOLD_AMOUNT_SYMBOL;
end
silverString = silver..SILVER_AMOUNT_SYMBOL;
copperString = copper..COPPER_AMOUNT_SYMBOL;
else
if (separateThousands) then
goldString = GOLD_AMOUNT_TEXTURE_STRING:format(FormatLargeNumber(gold), 0, 0);
else
goldString = GOLD_AMOUNT_TEXTURE:format(gold, 0, 0);
end
silverString = SILVER_AMOUNT_TEXTURE:format(silver, 0, 0);
copperString = COPPER_AMOUNT_TEXTURE:format(copper, 0, 0);
end
if silver < 10 then
silverString = "0"..silverString;
end
if copper < 10 then
copperString = "0"..copperString;
end
local moneyString = "";
local separator = "";
if ( gold > 0 ) then
moneyString = goldString;
separator = " ";
end
if ( gold > 0 or silver > 0 ) then
moneyString = moneyString..separator..silverString;
separator = " ";
end
if ( gold > 0 or silver > 0 or copper > 0 or moneyString == "" ) then
moneyString = moneyString..separator..copperString;
end
return moneyString;
end |
--[[------------------------------------------------
-- Love Frames - A GUI library for LOVE --
-- Copyright (c) 2012-2014 Kenny Shields --
--]]------------------------------------------------
-- get the current require path
local path = string.sub(..., 1, string.len(...) - string.len(".util"))
local loveframes = require(path .. ".common")
-- util library
loveframes.util = {}
--[[---------------------------------------------------------
- func: SetActiveSkin(name)
- desc: sets the active skin
--]]---------------------------------------------------------
function loveframes.util.SetActiveSkin(name)
loveframes.config["ACTIVESKIN"] = name
end
--[[---------------------------------------------------------
- func: GetActiveSkin()
- desc: gets the active skin
--]]---------------------------------------------------------
function loveframes.util.GetActiveSkin()
local index = loveframes.config["ACTIVESKIN"]
local skin = loveframes.skins.available[index]
return skin
end
--[[---------------------------------------------------------
- func: BoundingBox(x1, x2, y1, y2, w1, w2, h1, h2)
- desc: checks for a collision between two boxes
- note: I take no credit for this function
--]]---------------------------------------------------------
function loveframes.util.BoundingBox(x1, x2, y1, y2, w1, w2, h1, h2)
if x1 > x2 + w2 - 1 or y1 > y2 + h2 - 1 or x2 > x1 + w1 - 1 or y2 > y1 + h1 - 1 then
return false
else
return true
end
end
--[[---------------------------------------------------------
- func: GetCollisions(object, table)
- desc: gets all objects colliding with the mouse
--]]---------------------------------------------------------
function loveframes.util.GetCollisions(object, t)
local x, y = screen.getMousePosition()
local curstate = loveframes.state
local object = object or loveframes.base
local visible = object.visible
local children = object.children
local internals = object.internals
local objectstate = object.state
local t = t or {}
if objectstate == curstate and visible then
local objectx = object.x
local objecty = object.y
local objectwidth = object.width
local objectheight = object.height
local col = loveframes.util.BoundingBox(x, objectx, y, objecty, 1, objectwidth, 1, objectheight)
local collide = object.collide
if col and collide then
local clickbounds = object.clickbounds
if clickbounds then
local cx = clickbounds.x
local cy = clickbounds.y
local cwidth = clickbounds.width
local cheight = clickbounds.height
local clickcol = loveframes.util.BoundingBox(x, cx, y, cy, 1, cwidth, 1, cheight)
if clickcol then
table.insert(t, object)
end
else
table.insert(t, object)
end
end
if children then
for k, v in ipairs(children) do
loveframes.util.GetCollisions(v, t)
end
end
if internals then
for k, v in ipairs(internals) do
local type = v.type
if type ~= "tooltip" then
loveframes.util.GetCollisions(v, t)
end
end
end
end
return t
end
--[[---------------------------------------------------------
- func: GetAllObjects(object, table)
- desc: gets all active objects
--]]---------------------------------------------------------
function loveframes.util.GetAllObjects(object, t)
local object = object or loveframes.base
local internals = object.internals
local children = object.children
local t = t or {}
table.insert(t, object)
if internals then
for k, v in ipairs(internals) do
loveframes.util.GetAllObjects(v, t)
end
end
if children then
for k, v in ipairs(children) do
loveframes.util.GetAllObjects(v, t)
end
end
return t
end
--[[---------------------------------------------------------
- func: GetDirectoryContents(directory, table)
- desc: gets the contents of a directory and all of
its subdirectories
--]]---------------------------------------------------------
function loveframes.util.GetDirectoryContents(dir, t)
local dir = dir
local t = t or {}
local dirs = {}
local files = love.filesystem.getDirectoryItems(dir)
for k, v in ipairs(files) do
local isdir = love.filesystem.isDirectory(dir.. "/" ..v)
if isdir == true then
table.insert(dirs, dir.. "/" ..v)
else
local parts = loveframes.util.SplitString(v, "([.])")
local extension = #parts > 1 and parts[#parts]
if #parts > 1 then
parts[#parts] = nil
end
local name = table.concat(parts, ".")
table.insert(t, {
path = dir,
fullpath = dir.. "/" ..v,
requirepath = dir:gsub("/", ".") .. "." ..name,
name = name,
extension = extension
})
end
end
for k, v in ipairs(dirs) do
t = loveframes.util.GetDirectoryContents(v, t)
end
return t
end
--[[---------------------------------------------------------
- func: Round(num, idp)
- desc: rounds a number based on the decimal limit
- note: I take no credit for this function
--]]---------------------------------------------------------
function loveframes.util.Round(num, idp)
local mult = 10^(idp or 0)
if num >= 0 then
return math.floor(num * mult + 0.5) / mult
else
return math.ceil(num * mult - 0.5) / mult
end
end
--[[---------------------------------------------------------
- func: SplitString(string, pattern)
- desc: splits a string into a table based on a given pattern
- note: I take no credit for this function
--]]---------------------------------------------------------
function loveframes.util.SplitString(str, pat)
local t = {} -- NOTE: use {n = 0} in Lua-5.0
if pat == " " then
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= #str then
cap = cap .. " "
end
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
else
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
end
return t
end
--[[---------------------------------------------------------
- func: RemoveAll()
- desc: removes all gui elements
--]]---------------------------------------------------------
function loveframes.util.RemoveAll()
loveframes.base.children = {}
loveframes.base.internals = {}
loveframes.hoverobject = false
loveframes.downobject = false
loveframes.modalobject = false
loveframes.inputobject = false
loveframes.hover = false
end
--[[---------------------------------------------------------
- func: TableHasValue(table, value)
- desc: checks to see if a table has a specific value
--]]---------------------------------------------------------
function loveframes.util.TableHasValue(table, value)
for k, v in pairs(table) do
if v == value then
return true
end
end
return false
end
--[[---------------------------------------------------------
- func: TableHasKey(table, key)
- desc: checks to see if a table has a specific key
--]]---------------------------------------------------------
function loveframes.util.TableHasKey(table, key)
return table[key] ~= nil
end
--[[---------------------------------------------------------
- func: Error(message)
- desc: displays a formatted error message
--]]---------------------------------------------------------
function loveframes.util.Error(message)
error("[Love Frames] " ..message)
end
--[[---------------------------------------------------------
- func: GetCollisionCount()
- desc: gets the total number of objects colliding with
the mouse
--]]---------------------------------------------------------
function loveframes.util.GetCollisionCount()
return loveframes.collisioncount
end
--[[---------------------------------------------------------
- func: GetHover()
- desc: returns loveframes.hover, can be used to check
if the mouse is colliding with a visible
Love Frames object
--]]---------------------------------------------------------
function loveframes.util.GetHover()
return loveframes.hover
end
--[[---------------------------------------------------------
- func: RectangleCollisionCheck(rect1, rect2)
- desc: checks for a collision between two rectangles
based on two tables containing rectangle sizes
and positions
--]]---------------------------------------------------------
function loveframes.util.RectangleCollisionCheck(rect1, rect2)
return loveframes.util.BoundingBox(rect1.x, rect2.x, rect1.y, rect2.y, rect1.width, rect2.width, rect1.height, rect2.height)
end
--[[---------------------------------------------------------
- func: DeepCopy(orig)
- desc: copies a table
- note: I take not credit for this function
--]]---------------------------------------------------------
function loveframes.util.DeepCopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[loveframes.util.DeepCopy(orig_key)] = loveframes.util.DeepCopy(orig_value)
end
setmetatable(copy, loveframes.util.DeepCopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
--[[---------------------------------------------------------
- func: GetHoverObject()
- desc: returns loveframes.hoverobject
--]]---------------------------------------------------------
function loveframes.util.GetHoverObject()
return loveframes.hoverobject
end
--[[---------------------------------------------------------
- func: IsCtrlDown()
- desc: checks for ctrl, for use with multiselect, copy,
paste, and such. On OS X it actually looks for cmd.
--]]---------------------------------------------------------
function loveframes.util.IsCtrlDown()
if love._os == "OS X" then
return love.keyboard.isDown("lmeta") or love.keyboard.isDown("rmeta") or
love.keyboard.isDown("lgui") or love.keyboard.isDown("rgui")
end
return love.keyboard.isDown("lctrl") or love.keyboard.isDown("rctrl")
end
|
require("curses");
curses.initscr();
curses.keypad(curses.stdscr(), true);
s = curses.mvgetnstr(10, 10, 10);
curses.addstr(s);
curses.getch();
curses.endwin();
|
local Redis = require 'redis'
local FakeRedis = require 'fakeredis'
local params = {
host = os.getenv('REDIS_HOST') or '127.0.0.1',
port = tonumber(os.getenv('REDIS_PORT') or 6379)
}
local database = os.getenv('REDIS_DB')
local password = os.getenv('REDIS_PASSWORD')
-- Overwrite HGETALL
Redis.commands.hgetall = Redis.command('hgetall', {
response = function(reply, command, ...)
local new_reply = { }
for i = 1, #reply, 2 do new_reply[reply[i]] = reply[i + 1] end
return new_reply
end
})
local redis = nil
-- Won't launch an error if fails
local ok = pcall(function()
redis = Redis.connect(params)
end)
if not ok then
local fake_func = function()
print('\27[31mCan\'t connect with Redis, install/configure it!\27[39m')
end
fake_func()
fake = FakeRedis.new()
print('\27[31mRedis addr: '..params.host..'\27[39m')
print('\27[31mRedis port: '..params.port..'\27[39m')
redis = setmetatable({fakeredis=true}, {
__index = function(a, b)
if b ~= 'data' and fake[b] then
fake_func(b)
end
return fake[b] or fake_func
end })
else
if password then
redis:auth(password)
end
if database then
redis:select(database)
end
end
return redis
|
local awful = require "awful"
local hotkeys_popup = require "awful.hotkeys_popup"
local machi = require "../modules/layout-machi"
require "awful.hotkeys_popup.keys"
-- Mouse bindings
awful.mouse.append_global_mousebindings {
awful.button({}, 3, function()
Menu.main:toggle()
end),
}
-- Key bindings
-- General Utilities
awful.keyboard.append_global_keybindings {
awful.key({}, "Print", function()
awful.spawn "scr screen"
end),
awful.key({ "Shift" }, "Print", function()
awful.spawn "scr selection"
end),
awful.key({ "Control" }, "Print", function()
awful.spawn "scr window"
end),
awful.key({ modkey }, "Print", function()
awful.spawn "scr screentoclip"
end),
awful.key({ modkey, "Shift" }, "Print", function()
awful.spawn "scr selectiontoclip"
end),
awful.key({ modkey, "Control" }, "Print", function()
awful.spawn "scr windowtoclip"
end),
}
-- General Awesome keys
awful.keyboard.append_global_keybindings {
awful.key({ modkey }, "w", function()
Menu.main:show()
end, {
description = "show main menu",
group = "awesome",
}),
awful.key({ modkey, "Shift" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
awful.key({ modkey }, "Return", function()
awful.spawn(terminal)
end, {
description = "open a terminal",
group = "launcher",
}),
awful.key({ modkey }, "z", function()
awful.screen.focused().quake:toggle()
end, {
description = "toggle dropdown terminal",
group = "launcher",
}),
awful.key({ modkey, "Shift" }, "Return", function()
awful.spawn(browser)
end, {
description = "open a browser",
group = "launcher",
}),
awful.key({ modkey }, "d", function()
awful.spawn "rofi -show drun"
end, {
description = "run prompt",
group = "launcher",
}),
awful.key({ modkey, "Shift" }, "l", function()
awful.spawn "betterlockscreen -l"
end, {
description = "run prompt",
group = "launcher",
}),
awful.key({ modkey }, "a", function()
require "ui.control_center"()
end, {
description = "toggle control center",
group = "launcher",
}),
awful.key({ modkey }, "/", function()
hotkeys_popup.show_help(nil, awful.screen.focused())
end, {
description = "show help",
group = "awesome",
}),
}
-- Media control keys
awful.keyboard.append_global_keybindings {
awful.key({}, "XF86AudioPlay", function()
awful.spawn "playerctl play-pause"
end, { description = "view previous", group = "tag" }),
awful.key({}, "XF86AudioNext", function()
awful.spawn "playerctl next"
end, { description = "view next", group = "tag" }),
awful.key({}, "XF86AudioPrev", function()
awful.spawn "playerctl previous"
end, { description = "go back", group = "tag" }),
}
-- Tags related keybindings
awful.keyboard.append_global_keybindings {
awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
awful.key({ modkey, "Shift" }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
}
-- Focus related keybindings
awful.keyboard.append_global_keybindings {
awful.key({ modkey }, "j", function()
awful.client.focus.byidx(1)
end, {
description = "focus next by index",
group = "client",
}),
awful.key({ modkey }, "k", function()
awful.client.focus.byidx(-1)
end, {
description = "focus previous by index",
group = "client",
}),
awful.key({ modkey }, "Tab", function()
awful.screen.focus_relative(1)
end, {
description = "switch focus of screen",
group = "client",
}),
awful.key({ modkey }, "Escape", function(c)
local master = awful.client.getmaster(awful.screen.focused())
local last_focused_window = awful.client.focus.history.get(awful.screen.focused(), 1, nil)
if client.focus == master then
if not last_focused_window then
return
end
client.focus = last_focused_window
else
client.focus = master
end
end, {
description = "switch focus between master and last client",
group = "client"
}),
}
-- Layout related keybindings
awful.keyboard.append_global_keybindings {
awful.key({ modkey, "Shift" }, "j", function()
awful.client.swap.byidx(1)
end, {
description = "swap with next client by index",
group = "client",
}),
awful.key({ modkey, "Shift" }, "k", function()
awful.client.swap.byidx(-1)
end, {
description = "swap with previous client by index",
group = "client",
}),
awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
awful.key({ modkey }, "l", function()
awful.tag.incmwfact(0.05)
end, {
description = "increase master width factor",
group = "layout",
}),
awful.key({ modkey }, "h", function()
awful.tag.incmwfact(-0.05)
end, {
description = "decrease master width factor",
group = "layout",
}),
awful.key({ modkey, "Shift" }, "h", function()
awful.tag.incnmaster(1, nil, true)
end, {
description = "increase the number of master clients",
group = "layout",
}),
awful.key({ modkey, "Shift" }, "l", function()
awful.tag.incnmaster(-1, nil, true)
end, {
description = "decrease the number of master clients",
group = "layout",
}),
awful.key({ modkey, "Control" }, "h", function()
awful.tag.incncol(1, nil, true)
end, {
description = "increase the number of columns",
group = "layout",
}),
awful.key({ modkey, "Control" }, "l", function()
awful.tag.incncol(-1, nil, true)
end, {
description = "decrease the number of columns",
group = "layout",
}),
awful.key({ modkey }, "space", function()
awful.layout.inc(1)
end, {
description = "select next",
group = "layout",
}),
awful.key({ modkey, "Shift" }, "space", function()
awful.layout.inc(-1)
end, {
description = "select previous",
group = "layout",
}),
awful.key({ modkey }, ".", function()
machi.default_editor.start_interactive()
end, {
description = "edit the current layout as machi layout",
group = "layout",
}),
}
awful.keyboard.append_global_keybindings {
awful.key {
modifiers = { modkey },
keygroup = "numrow",
description = "only view tag",
group = "tag",
on_press = function(index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
tag:view_only()
end
end,
},
awful.key {
modifiers = { modkey, "Control" },
keygroup = "numrow",
description = "toggle tag",
group = "tag",
on_press = function(index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
awful.tag.viewtoggle(tag)
end
end,
},
awful.key {
modifiers = { modkey, "Shift" },
keygroup = "numrow",
description = "move focused client to tag",
group = "tag",
on_press = function(index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
},
awful.key {
modifiers = { modkey, "Control", "Shift" },
keygroup = "numrow",
description = "toggle focused client on tag",
group = "tag",
on_press = function(index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
},
awful.key {
modifiers = { modkey },
keygroup = "numpad",
description = "select layout directly",
group = "layout",
on_press = function(index)
local t = awful.screen.focused().selected_tag
if t then
t.layout = t.layouts[index] or t.layout
end
end,
},
}
client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings {
awful.button({}, 1, function(c)
c:activate { context = "mouse_click" }
end),
awful.button({ modkey }, 1, function(c)
c:activate { context = "mouse_click", action = "mouse_move" }
end),
awful.button({ modkey }, 3, function(c)
c:activate { context = "mouse_click", action = "mouse_resize" }
end),
}
end)
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings {
awful.key({ modkey }, "f", function(c)
c.fullscreen = not c.fullscreen
c:raise()
end, {
description = "toggle fullscreen",
group = "client",
}),
awful.key({ modkey }, "q", function(c)
c:kill()
end, {
description = "close",
group = "client",
}),
awful.key(
{ modkey, "Control" },
"space",
awful.client.floating.toggle,
{ description = "toggle floating", group = "client" }
),
awful.key({ modkey, "Control" }, "Return", function(c)
c:swap(awful.client.getmaster())
end, {
description = "move to master",
group = "client",
}),
awful.key({ modkey }, "o", function(c)
c:move_to_screen()
end, {
description = "move to screen",
group = "client",
}),
awful.key({ modkey }, "t", function(c)
c.ontop = not c.ontop
end, {
description = "toggle keep on top",
group = "client",
}),
awful.key({ modkey }, "n", function(c)
require "ui.notification_center"()
end, {
description = "minimize",
group = "client",
}),
awful.key({ modkey }, "m", function(c)
awful.spawn "clipcat-menu"
end, {
description = "(un)maximize",
group = "client",
}),
awful.key({ modkey, "Control" }, "m", function(c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end, {
description = "(un)maximize vertically",
group = "client",
}),
awful.key({ modkey, "Shift" }, "m", function(c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end, {
description = "(un)maximize horizontally",
group = "client",
}),
}
end)
|
-- Table (implementation-dependant, in practice array list) based stack
-- Worst-case linear time for basic operations, in practice amortized constant time and significantly less overhead
-- Merely a OOP wrapper for Lua's table library
local table_stack = {}
function table_stack.new()
return {}
end
function table_stack:empty()
return self[1] == nil
end
function table_stack:push(value)
table.insert(self, value)
end
function table_stack:top()
return self[#self]
end
function table_stack:pop()
return table.remove(self)
end
return require("class")(table_stack)
|
-- wget 'http://torch7.s3-website-us-east-1.amazonaws.com/data/mnist.t7.tgz'
-- tar -xf mnist.t7.tgz
function distortData(foo)
local res=torch.FloatTensor(foo:size(1), 1, 42, 42):fill(0)
for i=1,foo:size(1) do
baseImg=foo:select(1,i)
distImg=res:select(1,i)
r = image.rotate(baseImg, torch.uniform(-3.14/4,3.14/4))
scale = torch.uniform(0.7,1.2)
sz = torch.floor(scale*32)
s = image.scale(r, sz, sz)
rest = 42-sz
offsetx = torch.random(1, 1+rest)
offsety = torch.random(1, 1+rest)
distImg:narrow(2, offsety, sz):narrow(3,offsetx, sz):copy(s)
end
return res
end
function distortData32(foo)
local res=torch.FloatTensor(foo:size(1), 1, 32, 32):fill(0)
local distImg=torch.FloatTensor(1, 42, 42):fill(0)
for i=1,foo:size(1) do
baseImg=foo:select(1,i)
r = image.rotate(baseImg, torch.uniform(-3.14/4,3.14/4))
scale = torch.uniform(0.7,1.2)
sz = torch.floor(scale*32)
s = image.scale(r, sz, sz)
rest = 42-sz
offsetx = torch.random(1, 1+rest)
offsety = torch.random(1, 1+rest)
distImg:zero()
distImg:narrow(2, offsety, sz):narrow(3,offsetx, sz):copy(s)
res:select(1,i):copy(image.scale(distImg,32,32))
end
return res
end
function createDatasetsDistorted()
local testFileName = 'mnist.t7/test_32x32.t7'
local trainFileName = 'mnist.t7/train_32x32.t7'
local train = torch.load(trainFileName, 'ascii')
local test = torch.load(testFileName, 'ascii')
train.data = train.data:float()
train.labels = train.labels:float()
test.data = test.data:float()
test.labels = test.labels:float()
-- distortion
train.data = distortData32(train.data)
test.data = distortData32(test.data)
local mean = train.data:mean()
local std = train.data:std()
train.data:add(-mean):div(std)
test.data:add(-mean):div(std)
local batchSize = 256
local datasetTrain = {
getBatch = function(self, idx)
local data = train.data:narrow(1, (idx - 1) * batchSize + 1, batchSize)
local labels = train.labels:narrow(1, (idx - 1) * batchSize + 1, batchSize)
return data, labels, batchSize
end,
getNumBatches = function()
return torch.floor(60000 / batchSize)
end
}
local datasetVal = {
getBatch = function(self, idx)
local data = test.data:narrow(1, (idx - 1) * batchSize + 1, batchSize)
local labels = test.labels:narrow(1, (idx - 1) * batchSize + 1, batchSize)
return data, labels, batchSize
end,
getNumBatches = function()
return torch.floor(10000 / batchSize)
end
}
return datasetTrain, datasetVal
end |
require( "logapi" )
local comp = require( "component" )
local gpu = comp.gpu
local fs = require( "filesystem" )
local term = require( "term" )
local event = require( "event" )
local tdl = 17
local infl = 60
local pril = 16
local display_amount = 5
local curdisplay = 1
local whitecol = 0xFFFFFF
local blackcol = 0x000000
local selcol = 0x00AA55
local logfilecol = 0x00FFFF
path = "/"
local clog = logContainer( )
gpu.setForeground( whitecol )
gpu.setBackground( blackcol )
function pad( str, lenpad )
return str .. string.rep( " ", lenpad - #str )
end
function drawHeader( )
term.write( "|" .. string.rep( "=", tdl ) .. "|" .. string.rep( "=", infl ) .. "|" .. string.rep( "=", pril ) .. "|\n" )
term.write( "|----Date/Time----|----------------------------Info----------------------------|----Priority----|\n" )
end
function drawEntry( entry )
i = 1
while true do
term.write(
"|" .. pad( string.sub( entry.timedatestamp, (i*tdl)-(tdl-1), i*tdl ), tdl ) ..
"|" .. pad( string.sub( entry.info, (i*infl)-(infl-1), i*infl ), infl ) ..
"|" .. pad( string.sub( entry.priority, (i*pril)-(pril-1), i*pril ), pril ) ..
"|\n")
i = i + 1
if ( ( #entry.timedatestamp < i*tdl ) and ( #entry.info < i*infl ) and ( #entry.priority < i*pril ) ) then
term.write( "|" .. string.rep( "-", tdl ) .. "|" .. string.rep( "-", infl ) .. "|" .. string.rep( "-", pril ) .. "|\n" )
break
end
end
end
function interpretelogFile( path )
clog:loadFrom( path )
shownEntries = clog.entries
while true do
term.clear( )
drawHeader( )
for i = curdisplay, curdisplay + display_amount do
if ( i > #shownEntries ) then
break
end
drawEntry( shownEntries[ i ] )
end
term.write( "|" .. string.rep( "=", tdl ) .. "|" .. string.rep( "=", infl ) .. "|" .. string.rep( "=", pril ) .. "|\n" )
term.write( "Use arrow keyes for navigation\nQ to (Q)uit\nF to (F)ind\nR to (R)eset\nE to (E)xport CSV" ) -- q 16 f 33 d 32 p 25 r 19
ev, addr, ch, co, pl = event.pull( "key_down" )
if ( co == 200 and curdisplay > 1 ) then
curdisplay = curdisplay - 1
elseif ( co == 208 and curdisplay < #shownEntries - display_amount ) then
curdisplay = curdisplay + 1
elseif ( co == 16 ) then
term.clear( )
break
elseif ( co == 18 ) then
term.clear( )
term.write( "Path to export: " )
expPath = term.read( )
clog:exportCSV( "/" .. string.sub( expPath, 1, #expPath-1 ) )
elseif ( co == 19 ) then
shownEntries = clog.entries
elseif ( co == 33 ) then
curdisplay = 1
while true do
term.clear()
term.write( "By (D)ate or by (P)riority?\nQ to (Q)uit\n" )
ev, addr, ch, co, pl = event.pull( "key_down" )
if ( co == 16 ) then
break
elseif ( co == 32 ) then
term.write( "Date to filter: " )
dtf = term.read( )
shownEntries = clog:findEntriesByDateTime( string.sub( dtf, 1, #dtf-1 ) )
break
elseif ( co == 25 ) then
term.write( "Priority to filter: " )
ptf = term.read( )
shownEntries = clog:findEntriesByPriority( string.sub( ptf, 1, #ptf-1 ) )
break
end
end
end
end
end
function choose( options )
local sel = 1
while true do
term.clear( )
for k, v in ipairs( options ) do
if ( k == sel ) then
gpu.setForeground( selcol )
term.write( v .. " <--\n" )
gpu.setForeground( whitecol )
else
if ( string.sub( v, #v - 3, #v ) == ".log" ) then
gpu.setForeground( logfilecol )
end
term.write( v .. "\n" )
gpu.setForeground( whitecol )
end
end
ev, addr, ch, co, pl = event.pull( "key_down" )
if ( co == 200 ) then -- 200 208 28
if ( sel > 1 ) then
sel = sel - 1
else
sel = #options
end
elseif ( co == 208 ) then
if ( sel < #options ) then
sel = sel + 1
else
sel = 1
end
elseif ( co == 28 ) then
return options[sel]
end
end
end
while true do
dirs = { }
table.insert( dirs, "<<exit>>" )
table.insert( dirs, "<<root>>" )
for dir in fs.list( path ) do
table.insert( dirs, dir )
end
choice = choose( dirs )
if ( choice == "<<root>>" ) then
path = "/"
elseif ( choice == "<<exit>>" ) then
term.clear( )
break
else
newpath = path .. "/" .. choice
term.write( string.sub( newpath, #newpath-4, #newpath ) )
if ( fs.isDirectory( newpath ) ) then
path = newpath
elseif ( string.sub( newpath, #newpath-3, #newpath ) == ".log" ) then
interpretelogFile( newpath )
end
end
end |
# Test various properties of classes defined in separate modules
print("Testing the %import directive")
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
function loadit(a)
lib=loadlib(a..'.dll','luaopen_'..a) or loadlib(a..'.so','luaopen_'..a)
assert(lib)()
end
loadit('base')
loadit('foo')
loadit('bar')
loadit('spam')
else
-- lua 5.1 does
require 'base'
require 'foo'
require 'bar'
require 'spam'
end
-- Create some objects
print("Creating some objects")
a = base.Base()
b = foo.Foo()
c = bar.Bar()
d = spam.Spam()
-- Try calling some methods
print("Testing some methods")
print("Should see 'Base::A' ---> ",a:A())
print("Should see 'Base::B' ---> ",a:B())
print("Should see 'Foo::A' ---> ",b:A())
print("Should see 'Foo::B' ---> ",b:B())
print("Should see 'Bar::A' ---> ",c:A())
print("Should see 'Bar::B' ---> ",c:B())
print("Should see 'Spam::A' ---> ",d:A())
print("Should see 'Spam::B' ---> ",d:B())
-- Try some casts
print("\nTesting some casts")
x = a:toBase()
print("Should see 'Base::A' ---> ",x:A())
print("Should see 'Base::B' ---> ",x:B())
x = b:toBase()
print("Should see 'Foo::A' ---> ",x:A())
print("Should see 'Base::B' ---> ",x:B())
x = c:toBase()
print("Should see 'Bar::A' ---> ",x:A())
print("Should see 'Base::B' ---> ",x:B())
x = d:toBase()
print("Should see 'Spam::A' ---> ",x:A())
print("Should see 'Base::B' ---> ",x:B())
x = d:toBar()
print("Should see 'Bar::B' ---> ",x:B())
print "\nTesting some dynamic casts\n"
x = d:toBase()
print " Spam -> Base -> Foo : "
y = foo.Foo_fromBase(x)
if y then
print "bad swig"
else
print "good swig"
end
print " Spam -> Base -> Bar : "
y = bar.Bar_fromBase(x)
if y then
print "good swig"
else
print "bad swig"
end
print " Spam -> Base -> Spam : "
y = spam.Spam_fromBase(x)
if y then
print "good swig"
else
print "bad swig"
end
print " Foo -> Spam : "
y = spam.Spam_fromBase(b)
if y then
print "bad swig"
else
print "good swig"
end
|
local function score(word)
end
return { score = score }
|
#!/usr/bin/env luajit
-- not in the same vein as the other tests, just going to plot out a temp figure
require 'ext'
local env = setmetatable({}, {__index=_G})
if setfenv then setfenv(1, env) else _ENV = env end
require 'symmath'.setup{env=env, MathJax={title='tests/unit/plot'}}
local function header(s)
print('<h3>'..s..'</h3>')
end
local function printpre(code)
print'<pre style="background-color:#e0e0e0; padding:15px">'
print(code:trim())
print'</pre>'
end
local function run(code)
assert(load(code, nil, nil, env))()
end
local function printAndRun(code)
printpre(code)
run(code)
end
printbr'This only works with MathJax inline SVG and Console output at the moment.'
printbr()
header'using the gnuplot syntax:'
printAndRun[[
local symmath = require 'symmath'
local GnuPlot = symmath.export.GnuPlot
GnuPlot:plot{
title = 'test plot',
xrange = {-2,2},
{'x**2.', title='test plot "x**2."'},
{'x**3.', title='test plot "x**3."'},
}
]]
header'using symmath expressions:'
printAndRun[[
local symmath = require 'symmath'
local GnuPlot = symmath.export.GnuPlot
local x = symmath.var'x'
GnuPlot:plot{
title = 'test expression',
xrange = {-2,2},
{x^2, title=GnuPlot(x^2)},
{x^3, title=GnuPlot(x^3)},
}
]]
header'using plot member function:'
printAndRun[[
local symmath = require 'symmath'
local x = symmath.var'x'
-- unless it's assigned to another var, or an argument of a function call, math operators will screw up Lua grammar so a subsequent member call is ignored
-- to get around this I'm wrapping the call in print()
-- but take note: (x^2):plot(...) will cause a Lua error
print((x^2):plot{
title = 'test expression',
xrange = {-2,2},
{title=GnuPlot(x^2)}, -- the first table is assumed to be associated with the calling expression
})
]]
header'using Lua data for formula:'
printAndRun[[
local symmath = require 'symmath'
local GnuPlot = symmath.export.GnuPlot
local n = 50
local xmin, xmax = -10, 10
local xs, ys = {}, {}
for i=1,n do
local x = (i-.5)/n * (xmax - xmin) + xmin
xs[i] = x
ys[i] = math.sin(x) / x
end
GnuPlot:plot{
title = 'test data title',
style = 'data linespoints',
data = {xs, ys},
{using = '1:2', title = 'test data sin(x)/x'},
}
]]
header'using symmath expressions, code generation, and Lua data:'
printAndRun[[
local symmath = require 'symmath'
local GnuPlot = symmath.export.GnuPlot
local x = symmath.var'x'
local f = symmath.sin(x) / x
local ff = symmath.export.Lua:toFunc{input={x}, output={f}}
local n = 50
local xmin, xmax = -10, 10
local xs, ys = {}, {}
for i=1,n do
local x = (i-.5)/n * (xmax - xmin) + xmin
xs[i] = x
ys[i] = ff(x)
end
GnuPlot:plot{
title = 'test data title',
style = 'data linespoints',
data = {xs, ys},
{using = '1:2', title = 'test data '..export.GnuPlot(f)},
}
]]
header'using the gnuplot syntax:'
printAndRun[[
local symmath = require 'symmath'
local GnuPlot = symmath.export.GnuPlot
print'<pre>'
GnuPlot:plot{
outputType = 'Console',
title = 'test plot',
xrange = {-2,2},
{'x**2.', title='test plot "x**2."'},
{'x**3.', title='test plot "x**3."'},
}
print'</pre>'
]]
|
-- vim : ft=lua ts=2 sw=2 et:
Rows = {cols={}, rows={}}
function Rows:clone()
return isa(Rows,{cols=cols(self.cols.hdr)})
end
function Rows:read(file)
for t in csv(file) do self:add(t) end
return self
end
function Rows:add(t)
t = t.cells and t.cells or t
if self.cols.ready
then self.rows[#self.rows+1] = self.cols:row(t,self)
else self.cols = Cols.new(t)
end
end
|
local BASE = baseclass.Get("DMenu")
function BASE:Paint(w, h)
draw.RoundedBox(5, 0, 0, w, h, Color(42, 42, 42))
surface.SetDrawColor(Color(52, 52, 52))
surface.DrawOutlinedRect(0, 0, w, h)
end
function BASE:AddOption(strText, funcFunction)
local pnl = vgui.Create("DMenuOption", self)
pnl:SetMenu(self)
pnl:SetText(strText)
pnl:SetFont("VBFONT_DERMANORMAL")
pnl:SetTextColor(COLOR_WHITE)
if funcFunction then pnl.DoClick = funcFunction end
self:AddPanel( pnl )
return pnl
end |
PLUGIN.name = "Weapon Select"
PLUGIN.author = "Chessnut"
PLUGIN.description = "A replacement for the default weapon selection."
if (CLIENT) then
PLUGIN.index = PLUGIN.index or 1
PLUGIN.deltaIndex = PLUGIN.deltaIndex or PLUGIN.index
PLUGIN.infoAlpha = PLUGIN.infoAlpha or 0
PLUGIN.alpha = PLUGIN.alpha or 0
PLUGIN.alphaDelta = PLUGIN.alphaDelta or PLUGIN.alpha
PLUGIN.fadeTime = PLUGIN.fadeTime or 0
function PLUGIN:LoadFonts(font, genericFont)
surface.CreateFont("ixWeaponSelectFont", {
font = font,
size = ScreenScale(16),
extended = true,
weight = 1000
})
end
function PLUGIN:HUDShouldDraw(name)
if (name == "CHudWeaponSelection") then
return false
end
end
function PLUGIN:HUDPaint()
local frameTime = FrameTime()
self.alphaDelta = Lerp(frameTime * 10, self.alphaDelta, self.alpha)
local fraction = self.alphaDelta
if (fraction > 0) then
local weapons = LocalPlayer():GetWeapons()
local total = table.Count(weapons)
local x, y = ScrW() * 0.5, ScrH() * 0.5
local spacing = math.pi * 0.85
local radius = 240 * self.alphaDelta
local shiftX = ScrW() * .02
local i = 1
self.deltaIndex = Lerp(frameTime * 12, self.deltaIndex, self.index)
local index = self.deltaIndex
for _, v in pairs(weapons) do
if (!weapons[self.index]) then
self.index = total
end
local theta = (i - index) * 0.1
local color = ColorAlpha(
i == self.index and ix.config.Get("color") or color_white,
(255 - math.abs(theta * 3) * 255) * fraction
)
local lastY = 0
if (self.markup and (i < self.index or i == 1)) then
if (self.index != 1) then
local _, h = self.markup:Size()
lastY = h * fraction
end
if (i == 1 or i == self.index - 1) then
self.infoAlpha = Lerp(frameTime * 3, self.infoAlpha, 255)
self.markup:Draw(x + 6 + shiftX, y + 30, 0, 0, self.infoAlpha * fraction)
end
end
surface.SetFont("ixWeaponSelectFont")
local _, ty = surface.GetTextSize(v:GetPrintName():upper())
local scale = (1 - math.abs(theta*2))
local matrix = Matrix()
matrix:Translate(Vector(
shiftX + x + math.cos(theta * spacing + math.pi) * radius + radius,
y + lastY + math.sin(theta * spacing + math.pi) * radius - ty/2 ,
1))
matrix:Scale(Vector(1, 1, 0) * scale)
cam.PushModelMatrix(matrix)
ix.util.DrawText(v:GetPrintName():upper(), 2, ty/2, color, 0, 1, "ixWeaponSelectFont")
cam.PopModelMatrix()
i = i + 1
end
if (self.fadeTime < CurTime() and self.alpha > 0) then
self.alpha = 0
end
end
end
function PLUGIN:OnIndexChanged()
self.alpha = 1
self.fadeTime = CurTime() + 5
local weapon = LocalPlayer():GetWeapons()[self.index]
self.markup = nil
if (IsValid(weapon)) then
local instructions = weapon.Instructions
local text = ""
if (instructions != nil and instructions:find("%S")) then
local color = ix.config.Get("color")
text = text .. string.format(
"<font=ixItemBoldFont><color=%d,%d,%d>%s</font></color>\n%s\n",
color.r, color.g, color.b, L("Instructions"), instructions
)
end
if (text != "") then
self.markup = markup.Parse("<font=ixItemDescFont>"..text, ScrW() * 0.3)
self.infoAlpha = 0
end
local source, pitch = hook.Run("WeaponCycleSound")
LocalPlayer():EmitSound(source or "common/talk.wav", 50, pitch or 180)
end
end
function PLUGIN:PlayerBindPress(client, bind, pressed)
local currentWeapon = client:GetActiveWeapon()
if (!client:InVehicle() and
(!IsValid(currentWeapon) or currentWeapon:GetClass() != "weapon_physgun" or !client:KeyDown(IN_ATTACK))) then
bind = bind:lower()
if (bind:find("invprev") and pressed) then
local oldIndex = self.index
self.index = math.min(self.index + 1, table.Count(client:GetWeapons()))
if (self.alpha == 0 or oldIndex != self.index) then
self:OnIndexChanged()
end
return true
elseif (bind:find("invnext") and pressed) then
local oldIndex = self.index
self.index = math.max(self.index - 1, 1)
if (self.alpha == 0 or oldIndex != self.index) then
self:OnIndexChanged()
end
return true
elseif (bind:find("slot") and pressed) then
self.index = math.Clamp(tonumber(bind:match("slot(%d)")) or 1, 1, table.Count(LocalPlayer():GetWeapons()))
self:OnIndexChanged()
return true
elseif (bind:find("attack") and pressed and self.alpha > 0) then
local weapon = LocalPlayer():GetWeapons()[self.index]
if (IsValid(weapon)) then
LocalPlayer():EmitSound(hook.Run("WeaponSelectSound", weapon) or "HL2Player.Use")
input.SelectWeapon(weapon)
self.alpha = 0
end
return true
end
end
end
function PLUGIN:ShouldPopulateEntityInfo(entity)
if (self.alpha > 0) then
return false
end
end
end
|
includes(path.join(os.scriptdir(), "versions.lua"))
package("libcurl")
set_homepage("https://curl.haxx.se/")
set_description("The multiprotocol file transfer library.")
set_license("MIT")
set_urls("https://curl.haxx.se/download/curl-$(version).tar.bz2",
"http://curl.mirror.anstey.ca/curl-$(version).tar.bz2")
add_urls("https://github.com/curl/curl/releases/download/curl-$(version).tar.bz2",
{version = function (version) return (version:gsub("%.", "_")) .. "/curl-" .. version end})
add_versions_list()
if is_plat("macosx", "iphoneos") then
add_frameworks("Security", "CoreFoundation", "SystemConfiguration")
elseif is_plat("linux") then
add_syslinks("pthread")
elseif is_plat("windows", "mingw") then
add_deps("cmake")
add_syslinks("advapi32", "crypt32", "wldap32", "winmm", "ws2_32")
end
add_configs("cares", {description = "Enable c-ares support.", default = false, type = "boolean"})
add_configs("openssl", {description = "Enable OpenSSL for SSL/TLS.", default = is_plat("linux", "cross"), type = "boolean"})
add_configs("mbedtls", {description = "Enable mbedTLS for SSL/TLS.", default = false, type = "boolean"})
add_configs("nghttp2", {description = "Use Nghttp2 library.", default = false, type = "boolean"})
add_configs("openldap", {description = "Use OpenLDAP library.", default = false, type = "boolean"})
add_configs("libidn2", {description = "Use Libidn2 for IDN support.", default = false, type = "boolean"})
add_configs("zlib", {description = "Enable zlib support.", default = false, type = "boolean"})
add_configs("zstd", {description = "Enable zstd support.", default = false, type = "boolean"})
add_configs("brotli", {description = "Enable brotli support.", default = false, type = "boolean"})
add_configs("libssh2", {description = "Use libSSH2 library.", default = false, type = "boolean"})
if not is_plat("windows", "mingw@windows") then
add_configs("libpsl", {description = "Use libpsl for Public Suffix List.", default = false, type = "boolean"})
end
on_load(function (package)
if package:is_plat("windows", "mingw") then
if not package:config("shared") then
package:add("defines", "CURL_STATICLIB")
end
end
local configdeps = {cares = "c-ares",
openssl = "openssl",
mbedtls = "mbedtls",
nghttp2 = "nghttp2",
openldap = "openldap",
libidn2 = "libidn2",
libpsl = "libpsl",
zlib = "zlib",
zstd = "zstd",
brotli = "brotli",
libssh2 = "libssh2"}
for name, dep in pairs(configdeps) do
if package:config(name) then
package:add("deps", dep)
end
end
end)
on_install("windows", "mingw@windows", function (package)
local configs = {"-DBUILD_TESTING=OFF", "-DENABLE_MANUAL=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, (package:version():ge("7.80") and "-DCURL_USE_SCHANNEL=ON" or "-DCMAKE_USE_SCHANNEL=ON"))
local version = package:version()
local configopts = {cares = "ENABLE_ARES",
openssl = (version:ge("7.81") and "CURL_USE_OPENSSL" or "CMAKE_USE_OPENSSL"),
mbedtls = (version:ge("7.81") and "CURL_USE_MBEDTLS" or "CMAKE_USE_MBEDTLS"),
nghttp2 = "USE_NGHTTP2",
openldap = "CURL_USE_OPENLDAP",
libidn2 = "USE_LIBIDN2",
zlib = "CURL_ZLIB",
zstd = "CURL_ZSTD",
brotli = "CURL_BROTLI",
libssh2 = (version:ge("7.81") and "CURL_USE_LIBSSL2" or "CMAKE_USE_LIBSSL2")}
for name, opt in pairs(configopts) do
table.insert(configs, "-D" .. opt .. "=" .. (package:config(name) and "ON" or "OFF"))
end
if is_plat("windows") then
table.insert(configs, "-DCURL_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs)
end)
on_install("macosx", "linux", "iphoneos", "mingw@macosx", "cross", function (package)
local configs = {"--disable-silent-rules",
"--disable-dependency-tracking",
"--without-hyper",
"--without-libgsasl",
"--without-librtmp",
"--without-quiche",
"--without-ngtcp2",
"--without-nghttp3"}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
if package:debug() then
table.insert(configs, "--enable-debug")
end
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
if is_plat("macosx", "iphoneos") then
table.insert(configs, (package:version():ge("7.77") and "--with-secure-transport" or "--with-darwinssl"))
end
if is_plat("mingw") then
table.insert(configs, "--with-schannel")
end
for _, name in ipairs({"openssl", "mbedtls", "zlib", "brotli", "zstd", "libssh2", "libidn2", "libpsl", "nghttp2"}) do
table.insert(configs, package:config(name) and "--with-" .. name or "--without-" .. name)
end
table.insert(configs, package:config("cares") and "--enable-ares" or "--disable-ares")
table.insert(configs, package:config("openldap") and "--enable-ldap" or "--disable-ldap")
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("curl_version", {includes = "curl/curl.h"}))
end)
|
-- colors.lua
-- Coltrane Willsey
-- 2022-03-03 [14:16]
local _color_enums = {
-- attributes
reset = 0,
clear = 0,
bright = 1,
dim = 2,
underscore = 4,
blink = 5,
reverse = 7,
hidden = 8,
-- foreground
black = 30,
red = 31,
green = 32,
yellow = 33,
blue = 34,
magenta = 35,
cyan = 36,
white = 37,
-- background
onblack = 40,
onred = 41,
ongreen = 42,
onyellow = 43,
onblue = 44,
onmagenta = 45,
oncyan = 46,
onwhite = 47,
}
local class = {}
class.__index = class
function mkcolor(value)
return setmetatable({ value = string.char(27) .. '[' .. tostring(value) .. 'm' }, class)
end
function class:__tostring()
return self.value
end
function class:__concat(other)
return tostring(self) .. tostring(other)
end
function class:__call(s)
return self .. s .. class.reset
end
for c, v in pairs(_color_enums) do
class[c] = mkcolor(v)
end
return class |
--
-- static file server
--
local Table = require('table')
local UV = require('uv')
local Fs = require('fs')
local get_type = require('mime').get_type
local date = require('os').date
local resolve = require('path').resolve
--
-- open file `path`, seek to `offset` octets from beginning and
-- read `size` subsequent octets.
-- call `progress` on each read chunk
--
local CHUNK_SIZE = 4096
local function noop() end
local function stream_file(path, offset, size, progress, callback)
UV.fs_open(path, 'r', '0666', function (err, fd)
if err then
callback(err)
return
end
local readchunk
readchunk = function ()
local chunk_size = size < CHUNK_SIZE and size or CHUNK_SIZE
UV.fs_read(fd, offset, chunk_size, function (err, chunk)
if err or #chunk == 0 then
callback(err)
UV.fs_close(fd, noop)
else
chunk_size = #chunk
offset = offset + chunk_size
size = size - chunk_size
if progress then
progress(chunk, readchunk)
else
readchunk()
end
end
end)
end
readchunk()
end)
end
--
-- setup request handler
--
local function static_handler(options)
if not options then options = { } end
-- given Range: header, return start, end numeric pair
local function parse_range(range, size)
local partial, start, stop = false
-- parse bytes=start-stop
if range then
start, stop = range:match('bytes=(%d*)-?(%d*)')
partial = true
end
start = tonumber(start) or 0
stop = tonumber(stop) or size - 1
return start, stop, partial
end
-- cache entries table
local cache = { }
-- handler for 'change' event of all file watchers
local function invalidate_cache_entry(status, event, path)
-- invalidate cache entry and free the watcher
if cache[path] then
cache[path].watch:close()
cache[path] = nil
end
end
-- given file, serve contents, honor Range: header
local function serve(self, file, range, cache_it)
-- adjust headers
local headers = { }
for k, v in pairs(file.headers) do headers[k] = v end
local size = file.size
local start = 0
local stop = size - 1
-- range specified? adjust headers and http status for response
if range then
-- limit range by file size
start, stop = parse_range(range, size)
-- check range validity
if stop >= size then
stop = size - 1
end
if stop < start then
return self:serve_invalid_range(file.size)
end
-- adjust Content-Length:
headers['Content-Length'] = stop - start + 1
-- append Content-Range:
headers['Content-Range'] = ('bytes=%d-%d/%d'):format(start, stop, size)
self:write_head(206, headers)
else
self:write_head(200, headers)
end
-- serve from cache, if available
if file.data then
self:finish(range and file.data.sub(start + 1, stop - start + 1) or file.data)
-- otherwise stream and possibly cache
else
-- N.B. don't cache if range specified
if range then
cache_it = false
end
local index, parts = 1, { }
-- called when file chunk is served
local function progress(chunk, cb)
if cache_it then
parts[index] = chunk
index = index + 1
end
self:write(chunk, cb)
end
-- called when file is served
local function eof(err)
self:finish()
if cache_it then
file.data = Table.concat(parts, '')
end
end
stream_file(file.name, start, stop - start + 1, progress, eof)
end
end
-- cache some locals
local max_age = options.max_age or 0
--
-- request handler
--
return function (req, res, nxt)
-- none of our business unless method is GET
if req.method ~= 'GET' then nxt() ; return end
-- map url to local filesystem filename
-- TODO: Path.normalize(req.url)
local filename = resolve(options.directory, req.uri.pathname)
-- stream file, possibly caching the contents for later reuse
local file = cache[filename]
-- no need to serve anything if file is cached at client side
if file and file.headers['Last-Modified'] == req.headers['if-modified-since'] then
res:serve_not_modified(file.headers)
return
end
if file then
serve(res, file, req.headers.range, false)
else
Fs.stat(filename, function (err, stat)
-- file not found? proceed to next layer
if err then nxt() ; return end
-- create cache entry, even for files which contents are not
-- gonna be cached
-- collect information on file
file = {
name = filename,
size = stat.size,
mtime = stat.mtime,
-- FIXME: finer control client-side caching
headers = {
['Content-Type'] = get_type(filename),
['Content-Length'] = stat.size,
['Cache-Control'] = 'public, max-age=' .. (max_age / 1000),
['Last-Modified'] = date('%c', stat.mtime),
['Etag'] = stat.size .. '-' .. stat.mtime
},
}
-- allocate cache entry
cache[filename] = file
-- should any changes in this file occur, invalidate cache entry
-- TODO: reuse caching technique from luvit/kernel
file.watch = UV.new_fs_watcher(filename)
file.watch:set_handler('change', invalidate_cache_entry)
-- shall we cache file contents?
local cache_it = options.is_cacheable and options.is_cacheable(file)
serve(res, file, req.headers.range, cache_it)
end)
end
end
end
-- module
return static_handler
|
local t =
Def.Model {
Meshes = NOTESKIN:GetPath("", "model/note.txt"),
Materials = NOTESKIN:GetPath("", "model/grey.txt"),
Bones = NOTESKIN:GetPath("", "model/note.txt")
}
return t
|
-- KEYS[1]: the scheduled jobs set
-- KEYS[2]: the active job list
-- KEYS[3]: the signal list
-- ARGV[1]: the current timestamp
-- ARGV[2]: the max number of jobs to schedule
-- Returns: nil
-- Get the jobs out of the scheduled set
local job_ids = redis.call("zrangebyscore", KEYS[1], 0, ARGV[1], "LIMIT", 0, ARGV[2])
local count = table.getn(job_ids)
if count > 0 then
-- Push them on to the active list
redis.call("rpush", KEYS[2], unpack(job_ids))
-- Remove the jobs from the scheduled set
redis.call("zremrangebyrank", KEYS[1], 0, count - 1)
-- Signal that there are jobs in the queue
redis.call("del", KEYS[3])
redis.call("lpush", KEYS[3], 1)
end
return count
|
--[[
MailSlurp API
MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
The version of the OpenAPI document: 6.5.2
Contact: contact@mailslurp.dev
Generated by: https://openapi-generator.tech
]]
--[[
Unit tests for maislurp-client-lua.api.webhook_controller_api
Automatically generated by openapi-generator (https://openapi-generator.tech)
Please update as you see appropriate
]]
describe("webhook_controller_api", function()
local maislurp-client-lua_webhook_controller_api = require "maislurp-client-lua.api.webhook_controller_api"
-- unit tests for create_webhook
describe("create_webhook test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for delete_all_webhooks
describe("delete_all_webhooks test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for delete_webhook
describe("delete_webhook test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_all_webhook_results
describe("get_all_webhook_results test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_all_webhooks
describe("get_all_webhooks test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_inbox_webhooks_paginated
describe("get_inbox_webhooks_paginated test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_json_schema_for_webhook_payload
describe("get_json_schema_for_webhook_payload test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload
describe("get_test_webhook_payload test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_email_opened
describe("get_test_webhook_payload_email_opened test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_email_read
describe("get_test_webhook_payload_email_read test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_for_webhook
describe("get_test_webhook_payload_for_webhook test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_new_attachment
describe("get_test_webhook_payload_new_attachment test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_new_contact
describe("get_test_webhook_payload_new_contact test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_test_webhook_payload_new_email
describe("get_test_webhook_payload_new_email test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_webhook
describe("get_webhook test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_webhook_result
describe("get_webhook_result test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_webhook_results
describe("get_webhook_results test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_webhook_results_unseen_error_count
describe("get_webhook_results_unseen_error_count test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for get_webhooks
describe("get_webhooks test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for redrive_webhook_result
describe("redrive_webhook_result test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
-- unit tests for send_test_data
describe("send_test_data test", function()
it("should work", function()
-- TODO assertion here: http://olivinelabs.com/busted/#asserts
end)
end)
end)
|
set_project("libcroco")
add_rules("mode.debug", "mode.release")
add_requires("glib", "libxml2")
option("installprefix")
set_default("")
set_showmenu(true)
option_end()
if has_config("installprefix") then
local prefix = get_config("installprefix")
set_configvar("prefix", prefix)
set_configvar("CROCO_CFLAGS", "-I" .. prefix .. "/include")
set_configvar("CROCO_LIBS", "-L" .. prefix .. "/lib -lglib-2.0 -pthread -lm -lpcre -lxml2")
end
set_configvar("exec_prefix", "${prefix}")
set_configvar("libdir", "${exec_prefix}/lib")
set_configvar("includedir", "${prefix}/include")
set_configvar("GLIB2_CFLAGS", "")
set_configvar("GLIB2_LIBS", "")
set_configvar("LIBXML2_CFLAGS", "")
set_configvar("LIBXML2_LIBS", "")
local mver = ""
local major_ver = ""
local minor_ver = ""
option("vers")
set_default("")
set_showmenu(true)
option_end()
if has_config("vers") then
set_version(get_config("vers"))
set_configvar("VERSION", get_config("vers"))
set_configvar("LIBCROCO_VERSION", get_config("vers"))
set_configvar("LIBCROCO_VERSION_NUMBER", get_config("vers"))
local spvers = get_config("vers"):split("%.")
major_ver = spvers[1] or ""
minor_ver = spvers[2] or ""
mver = major_ver .. "." .. minor_ver
set_configvar("LIBCROCO_MAJOR_VERSION", major_ver)
set_configvar("LIBCROCO_MINOR_VERSION", minor_ver)
end
set_configvar("G_DISABLE_CHECKS", 0)
target("croco")
set_basename("croco-" .. mver)
set_kind("$(kind)")
add_files("src/*.c")
add_includedirs("src", {public = true})
add_packages("glib", "libxml2", {public = true})
set_configdir("src")
add_configfiles("src/libcroco-config.h.in", {pattern = "@(.-)@"})
add_headerfiles("src/*.h", {prefixdir = "libcroco-" .. mver .. "/libcroco"})
target_end()
target("csslint")
set_basename("csslint-" .. mver)
set_kind("binary")
add_deps("croco")
add_files("csslint/csslint.c")
set_configdir(".")
if not is_plat("windows") then
add_configfiles("croco-config.in", {pattern = "@(.-)@"})
add_configfiles("libcroco.pc.in", {pattern = "@(.-)@"})
after_install(function (target)
os.cp("croco-config", path.join(target:installdir(), "bin", "croco-" .. mver .. "-config"))
os.cp("libcroco.pc", path.join(target:installdir(), "lib", "pkgconfig", "libcroco-" .. mver .. ".pc"))
end)
end
target_end()
|
api={inner={},loader={},blocks={}}
mods={data={}}
api.inner.mod_directory="mods"
api.graphics=love.graphics
api.player={health={}}
function api.player.teleport(x,y,cx,cy)
local function movp(x,y)
phy.world:update(phy.player,px,py)
end
if x and y then
x2,y2 = px or x*world.tile.w , py or y*world.tile.h
cx2,cy2 = cx or world.chunk.id.x , cy or world.chunk.id.y
if x or y then movp(x2,y2) end
if cx or cy then chl.f.moveToChunk(cx2,cy2) end
end
end
function api.player.health.add(h)
if h then player.hp=player.hp+h end
end
function api.player.health.remove(h)
if h then player.hp=player.hp-h end
end
function api.player.health.set(h)
if h then
player.hp=(h/player.maxhp)*(player.maxhp*3)-(player.maxhp*2)
end
end
function api.player.health.get()
return (((player.hp+player.maxhp)/(player.maxhp*3))*player.maxhp)+(player.maxhp/2)-(player.maxhp/6)
end
function api.player.health.getMax()
return player.maxhp
end
function api.loader.modList()
local filesTable =love.filesystem.getDirectoryItems(api.inner.mod_directory)
local output={}
local j=1
for i,v in ipairs(filesTable) do
if v:find(".lua") ~= nil then
output[j]=v
j=j+1
end
end
return output
end
function api.blocks.createBlock(texture,strength,type,noCollision,action)
local id=table.count(world.tile.textures)+1
texture=api.inner.mod_directory.."/"..texture
action=action or ""
world.tile.texture_files[id]=texture
world.tile.textures[id]=love.graphics.newImage(texture)
if(noCollision)then
phy.nocollosion[table.count(phy.nocollosion)+1]=id
end
world.tile.ItemData[table.count(world.tile.ItemData)+1].strength=strength or 5
world.tile.ItemData[table.count(world.tile.ItemData)+1].type=type or "block"
world.tile.actions[table.count(world.tile.actions)+1]=loadstring(action)
return id
end
function api.inner.executeAll()
local modlist=api.loader.modList()
for i=1,table.count(modlist) do
mods.data[i]=require(api.inner.mod_directory.."."..modlist[i]:gsub("%.lua",""))
end
api.inner.areModsLoaded=true
end
function api.inner.loop()
if api.inner.areModsLoaded and table.count(mods.data)>0 then
for i=1,table.count(mods) do
if(mods.data[i].loop~=nil)then
mods.data[i].loop()
end
if(mods.data[i].init~=nil and api.inner.areModsInit==nil)then
mods.data[i].init()
api.inner.areModsInit=true
end
end
end
end
function api.inner.init()
love.filesystem.createDirectory(api.inner.mod_directory)
api.inner.executeAll()
end
|
PLUGIN.name = "아이템 저장 (Save Items)"
PLUGIN.desc = "월드에 존재하는 아이템을 저장해 줍니다."
PLUGIN.author = "Chessnut / 번역자 : Tensa"
PLUGIN.base = true;
if (SERVER) then
function PLUGIN:LoadData()
local restored = nut.util.ReadTable("saveditems")
if (restored) then
for k, v in pairs(restored) do
local position = v.position
local angles = v.angles
local itemTable = nut.item.Get(v.uniqueID)
local data = v.data
if itemTable then
local entity = nut.item.Spawn(position, angles, itemTable, data)
AdvNut.hook.Run("ItemRestored", itemTable, entity)
end
end
end
end
function PLUGIN:SaveData()
local data = {}
for k, v in pairs(ents.FindByClass("nut_item")) do
if(v:GetPersistent()) then
v:SetPersistent(false);
end;
if (AdvNut.hook.Run("ItemShouldSave", v) != false) then
data[k] = {
position = v:GetPos(),
angles = v:GetAngles(),
uniqueID = v:GetItemTable().uniqueID,
data = v:GetData()
}
AdvNut.hook.Run("ItemSaved", v)
end
end
nut.util.WriteTable("saveditems", data)
end
end
|
C_ClassColor = {}
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_ClassColor.GetClassColor)
---@param className string
---@return ColorMixin classColor
function C_ClassColor.GetClassColor(className) end
|
game.Players.Regium:remove() |
--[[
jungleTilde.lua
Copyright (C) 2016 Kano Computing Ltd.
License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2
This is the dialogue you can have with Mr Info in Overworld on the Beach.
]]--
return {
type = "decision",
dialogues = {
--- 1) Welcome dialogue - explore Port Ether ---------------------------------
{
type = "copy",
copy = {
"jungleTildeDiag1"
},
arguments = {"MAKE_SNAKE_APP_LEVEL"},
options = {
{ ok = 2 },
},
properties = {},
},
--- 2) Decision node ---------------------------------------------------------
{
type = "compare",
operator = "lessOrEquals",
a = "MAKE_SNAKE_APP_LEVEL",
b = 4,
positive = 3,
negative = 4,
properties = {
save = true,
}
},
--- 3) Level 4 or below --------------------------------------------
{
type = "copy",
copy = {
"jungleTildeDiag2"
},
arguments = {},
options = {},
properties = {},
},
--- 4) Above level 4 ------------------------------------
{
type = "copy",
copy = {
"jungleTildeDiag3"
},
arguments = {"MAKE_SNAKE_APP_LEVEL"},
options = {},
properties = {},
},
--- the end ---
}
}
|
return {
LrSdkVersion = 3.0,
LrSdkMinimumVersion = 3.0,
LrPluginName = 'Photos',
LrToolkitIdentifier = 'at.homebrew.lrphotos',
VERSION = { major = 1, minor = 0, revision = 0, build = 2, },
LrInitPlugin = "InitProvider.lua",
-- Add the Metadata Definition File
LrMetadataProvider = 'PhotosMetadataDefinition.lua',
LrExportServiceProvider = {
title = "Photos", -- this string appears as the export destination
file = "PhotosServiceProvider.lua",
},
}
|
local struct = require("struct")
function string.unpack(s, mode)
return struct.unpack(mode, s)
end
function string.split(s, re)
local i1, ls = 1, { }
if not re then re = '%s+' end
if re == '' then return { s } end
while true do
local i2, i3 = s:find(re, i1)
if not i2 then
local last = s:sub(i1)
if last ~= '' then ls[#ls+1] = last end
if #ls == 1 and ls[1] == '' then
return { }
else
return ls
end
end
ls[#ls+1] = s:sub(i1, i2 - 1)
i1 = i3 + 1
end
end
function string.escape_magic(s)
return s:gsub("([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1")
end
function string.trim(str, chars)
if not chars then return str:match("^[%s]*(.-)[%s]*$") end
chars = string.escape_magic(chars)
return str:match("^[" .. chars .. "]*(.-)[" .. chars .. "]*$")
end
function string.lines(s)
if string.sub(s, -1) ~= "\n" then s = s .. "\n" end
return string.gmatch(s, "(.-)\n")
end
function string.chars(s)
return string.gmatch(s, ".")
end
function string.escape_for_gsub(s)
return string.gsub(s, "([^%w])", "%%%1")
end
function string.has_prefix(s, prefix)
return string.find(s, "^" .. string.escape_for_gsub(prefix))
end
function string.has_suffix(s, suffix)
return string.find(s, string.escape_for_gsub(suffix) .. "$")
end
function string.strip_prefix(s, prefix)
return string.gsub(s, "^" .. string.escape_for_gsub(prefix), "")
end
function string.strip_suffix(s, suffix)
return string.gsub(s, string.escape_for_gsub(suffix) .. "$", "")
end
function string.left_pad(s, length, pad)
local res = string.rep(pad or ' ', length - #s) .. s
return res, res ~= s
end
function string.right_pad(s, length, pad)
local res = s .. string.rep(pad or ' ', length - #s)
return res, res ~= s
end
|
local _, L = ...;
L["Heart"] = "Heart of Azeroth"
L["Abbreviate"] = "Abbreviate numbers"
L["ShowLevel"] = "Show level"
L["ShowCurrent"] = "Show current"
L["ShowPercent"] = "Show percentage"
L["HideMax"] = "Hide maximum"
if GetLocale() == "ptBR" then
L["Heart"] = "Coração de Azeroth"
L["ShowLevel"] = "Mostrar nível"
L["ShowCurrent"] = "Mostrar atual"
L["ShowPercent"] = "Mostrar percentual"
L["HideMax"] = "Esconder máximo"
end
|
enum({
"MD_OK",
"MD_OK_CANCEL",
"MD_YES_NO",
"MD_YES_NO_CANCEL"
})
enum({
"MD_ERROR",
"MD_WARNING",
"MD_QUESTION",
"MD_INFO",
"MD_PLAIN"
})
local gs = {}
gs.ratio = 3/2
gs.w = 400
gs.mrg = 10
gs.btn = {}
gs.btn.w = 80
gs.btn.h = 20
gs.img = {}
gs.img.w = 42
gs.img.h = 42
gs.headers = {
[MD_ERROR] = "Error",
[MD_WARNING] = "Warning",
[MD_QUESTION] = "Question",
[MD_INFO] = "Information"
}
gs.btn.text = {
[MD_OK] = {"ok"},
[MD_OK_CANCEL] = {"ok", "cancel"},
[MD_YES_NO] = {"yes", "no"},
[MD_YES_NO_CANCEL] = {"yes", "no", "cancel"}
}
local MessageDialog = {}
MessageDialog.gui = {}
MessageDialog.thread = nil
MessageDialog.focused = nil
MessageDialog.options = {}
MessageDialog.result = nil
function MessageDialog.init()
MessageDialog.gui.window = guiCreateWindow(0, 0, gs.w, 20 + gs.img.h + gs.mrg * 5, "", false)
guiSetEnabled(MessageDialog.gui.window, false)
guiSetVisible(MessageDialog.gui.window, false)
guiWindowSetSizable(MessageDialog.gui.window, false)
guiSetAlwaysOnTop(MessageDialog.gui.window, true)
MessageDialog.gui.img = guiCreateStaticImage(0, 0, gs.img.w, gs.img.h, GUI_EMPTY_IMAGE_PATH, false, MessageDialog.gui.window)
MessageDialog.gui.infoImg = guiCreateStaticImage(0, 0, 1, 1, GUI_IMAGES_PATH.."dialog/info.png", true, MessageDialog.gui.img)
MessageDialog.gui.questionImg = guiCreateStaticImage(0, 0, 1, 1, GUI_IMAGES_PATH.."dialog/question.png", true, MessageDialog.gui.img)
MessageDialog.gui.warningImg = guiCreateStaticImage(0, 0, 1, 1, GUI_IMAGES_PATH.."dialog/warning.png", true, MessageDialog.gui.img)
MessageDialog.gui.errorImg = guiCreateStaticImage(0, 0, 1, 1, GUI_IMAGES_PATH.."dialog/error.png", true, MessageDialog.gui.img)
MessageDialog.gui.lbl = guiCreateLabel(0, 0, gs.w, gs.img.h, "", false, MessageDialog.gui.window)
guiLabelSetHorizontalAlign(MessageDialog.gui.lbl, "center", true)
guiLabelSetVerticalAlign(MessageDialog.gui.lbl, "center")
MessageDialog.gui.btns = {}
MessageDialog.gui.btns.yes = guiCreateButton(0, 0, gs.btn.w, gs.btn.h, "Yes", false, MessageDialog.gui.window)
MessageDialog.gui.btns.no = guiCreateButton(0, 0, gs.btn.w, gs.btn.h, "No", false, MessageDialog.gui.window)
MessageDialog.gui.btns.ok = guiCreateButton(0, 0, gs.btn.w, gs.btn.h, "Ok", false, MessageDialog.gui.window)
MessageDialog.gui.btns.cancel = guiCreateButton(0, 0, gs.btn.w, gs.btn.h, "Cancel", false, MessageDialog.gui.window)
guiBindKey(MessageDialog.gui.btns.yes, "enter")
guiBindKey(MessageDialog.gui.btns.no, "n")
guiBindKey(MessageDialog.gui.btns.ok, "enter")
guiBindKey(MessageDialog.gui.btns.cancel, "c")
addEventHandler("onClientGUILeftClick", MessageDialog.gui.btns.yes, MessageDialog.yes, false)
addEventHandler("onClientGUILeftClick", MessageDialog.gui.btns.no, MessageDialog.no, false)
addEventHandler("onClientGUILeftClick", MessageDialog.gui.btns.ok, MessageDialog.yes, false)
addEventHandler("onClientGUILeftClick", MessageDialog.gui.btns.cancel, MessageDialog.cancel, false)
return true
end
function MessageDialog.prepare(message, header, optionType, iconType)
if not optionType then optionType = MD_OK end
if not iconType then iconType = MD_INFO end
guiSetText(MessageDialog.gui.window, header or gs.headers[iconType] or "")
guiSetText(MessageDialog.gui.lbl, message)
guiSetVisible(MessageDialog.gui.warningImg, iconType == MD_WARNING)
guiSetVisible(MessageDialog.gui.questionImg, iconType == MD_QUESTION)
guiSetVisible(MessageDialog.gui.errorImg, iconType == MD_ERROR)
guiSetVisible(MessageDialog.gui.infoImg, iconType == MD_INFO)
local btns = gs.btn.text[optionType]
local btnsw = (gs.btn.w + gs.mrg) * #btns - gs.mrg
local lblw, lblh = guiGetTextSize(MessageDialog.gui.lbl, gs.w)
lblw = math.max(lblw, btnsw, gs.w)
lblh = math.max(lblh, gs.img.h + gs.mrg*2)
local winw = gs.img.w + lblw + gs.mrg*6
local winh = 20 + lblh + gs.btn.h + gs.mrg*3
guiSetSize(MessageDialog.gui.window, winw, winh, false)
guiCenter(MessageDialog.gui.window)
local x = gs.mrg*2
local y = 20 + gs.mrg + (lblh - gs.img.h) / 2
guiSetPosition(MessageDialog.gui.img, x, y, false)
x = x + gs.img.w + gs.mrg*2
y = 20 + gs.mrg
guiSetPosition(MessageDialog.gui.lbl, x, y, false)
guiSetSize(MessageDialog.gui.lbl, lblw, lblh, false)
for name, btn in pairs(MessageDialog.gui.btns) do
guiSetEnabled(btn, false)
guiSetVisible(btn, false)
end
x = gs.img.w + gs.mrg*4 + (lblw - btnsw)/2
y = winh - gs.mrg - gs.btn.h
for i, name in ipairs(btns) do
guiSetVisible(MessageDialog.gui.btns[name], true)
guiSetEnabled(MessageDialog.gui.btns[name], true)
guiSetPosition(MessageDialog.gui.btns[name], x, y, false)
x = x + gs.btn.w + gs.mrg
end
return true
end
function MessageDialog.resume()
if not MessageDialog.thread then return end
guiSetEnabled(MessageDialog.gui.window, false)
guiSetVisible(MessageDialog.gui.window, false)
coroutine.resume(MessageDialog.thread)
end
function MessageDialog.yes()
MessageDialog.result = true
MessageDialog.resume()
end
function MessageDialog.no()
MessageDialog.result = false
MessageDialog.resume()
end
function MessageDialog.cancel()
MessageDialog.result = nil
MessageDialog.resume()
end
MessageDialog.init()
function guiShowMessageDialog(message, header, optionType, iconType)
if not scheck("s,?s") then return false end
if MessageDialog.thread then MessageDialog.cancel() end
coroutine.sleep(10)
MessageDialog.thread = coroutine.running()
MessageDialog.result = false
MessageDialog.focused = guiGetFocused()
MessageDialog.prepare(message, header, optionType, iconType)
guiSetVisible(MessageDialog.gui.window, true, true)
guiSetEnabled(MessageDialog.gui.window, true)
guiFocus(MessageDialog.gui.window)
coroutine.yield()
MessageDialog.thread = nil
coroutine.sleep(10)
guiFocus(MessageDialog.focused)
return MessageDialog.result
end |
package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;"
require("wx")
wxID_USER_Index = 1000
-------------------------------------------------------------------------------
-- Event Table
-------------------------------------------------------------------------------
__ctrl_table = {}
__ctrl_event = {
StaticText = {
ctor = function(parent,id,layoutCtrl)
return wx.wxStaticText( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize,0) end,
},
Button = {
ctor = function(parent,id,layoutCtrl)
return wx.wxButton( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize,0) end,
ev = wx.wxEVT_COMMAND_BUTTON_CLICKED
},
ToggleButton = {
ctor = function(parent,id,layoutCtrl)
return wx.wxToggleButton( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize) end,
ev = wx.wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
},
CheckBox = {
ctor = function(parent,id,layoutCtrl)
return wx.wxCheckBox( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize) end,
ev = wx.wxEVT_COMMAND_CHECKBOX_CLICKED
},
Choice = {
ctor = function(parent,id,layoutCtrl)
if not layoutCtrl.items then layoutCtrl.items = {} end
local ctrl = wx.wxChoice( parent, id,
wx.wxDefaultPosition,wx.wxDefaultSize,
layoutCtrl.items, 0, wx.wxDefaultValidator)
if layoutCtrl.value then
ctrl:SetSelection(layoutCtrl.value)
end
return ctrl end,
ev = wx.wxEVT_COMMAND_CHOICE_SELECTED
},
ComboBox = {
ctor = function(parent,id,layoutCtrl)
if not layoutCtrl.items then layoutCtrl.items = {} end
if not layoutCtrl.value then layoutCtrl.value = "" end
local ctrl = wx.wxComboBox( parent, id, layoutCtrl.value,
wx.wxDefaultPosition,wx.wxDefaultSize,
layoutCtrl.items, 0, wx.wxDefaultValidator)
return ctrl end,
ev = wx.wxEVT_COMMAND_COMBOBOX_SELECTED
},
ListBox = {
ctor = function(parent,id,layoutCtrl)
if not layoutCtrl.items then layoutCtrl.items = {} end
local ctrl = wx.wxListBox( parent, id,
wx.wxDefaultPosition,wx.wxDefaultSize,
layoutCtrl.items, 0, wx.wxDefaultValidator)
return ctrl end,
ev = wx.wxEVT_COMMAND_LISTBOX_SELECTED
},
CheckListBox = {
ctor = function(parent,id,layoutCtrl)
if not layoutCtrl.items then layoutCtrl.items = {} end
local ctrl = wx.wxCheckListBox( parent, id,
wx.wxDefaultPosition,wx.wxDefaultSize,
layoutCtrl.items, 0, wx.wxDefaultValidator)
return ctrl end,
ev = wx.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
},
RadioBox = {
ctor = function(parent,id,layoutCtrl)
if not layoutCtrl.items then layoutCtrl.items = {} end
local ctrl = wx.wxRadioBox( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize,
layoutCtrl.items, 0, wx.wxRA_SPECIFY_ROWS, wx.wxDefaultValidator)
if layoutCtrl.value then
ctrl:SetSelection(layoutCtrl.value)
end
return ctrl end,
ev = wx.wxEVT_COMMAND_RADIOBOX_SELECTED
},
TextCtrl = {
ctor = function(parent,id,layoutCtrl)
local style = 0
if layoutCtrl.multiline then
style = style + wx.wxTE_MULTILINE + wx.wxTE_DONTWRAP
else
style = style + wx.wxTE_PROCESS_ENTER
end
local ctrl = wx.wxTextCtrl( parent, id, layoutCtrl.label,
wx.wxDefaultPosition,wx.wxDefaultSize, style)
return ctrl end,
},
FilePicker = {
ctor = function(parent,id,layoutCtrl)
local message = "File Open"
local style = wx.wxFLP_DEFAULT_STYLE + wx.wxFLP_OPEN
if layoutCtrl.save then
style = wx.wxFLP_DEFAULT_STYLE + wx.wxFLP_SAVE + wx.wxFLP_OVERWRITE_PROMPT
end
return wx.wxFilePickerCtrl( parent, id, layoutCtrl.label, message, "*.*",
wx.wxDefaultPosition,wx.wxDefaultSize, style)
end
},
DirPicker = {
ctor = function(parent,id,layoutCtrl)
local message = "Directory Open"
return wx.wxDirPickerCtrl( parent, id, layoutCtrl.label, message,
wx.wxDefaultPosition,wx.wxDefaultSize)
end
},
}
function dump_ctrl_event()
for k,v in pairs(__ctrl_event) do
for k1, v1 in pairs(v) do
print( k, k1, v1 )
end
end
end
function CreateControl(parent,layoutCtrl)
local newCtrl = {}
if layoutCtrl and __ctrl_event[layoutCtrl.name] then
newCtrl.id = wxID_USER_Index
wxID_USER_Index = wxID_USER_Index + 1
newCtrl.ctrl = __ctrl_event[layoutCtrl.name].ctor(parent, newCtrl.id, layoutCtrl)
if layoutCtrl.handler and __ctrl_event[layoutCtrl.name].ev then
parent:Connect(newCtrl.id, __ctrl_event[layoutCtrl.name].ev, layoutCtrl.handler )
end
if layoutCtrl.tooltip then
newCtrl.ctrl:SetToolTip(wx.wxToolTip(layoutCtrl.tooltip))
end
if layoutCtrl.menu then
local menu = Menu(newCtrl.ctrl,layoutCtrl.menu)
newCtrl.ctrl:Connect(wx.wxEVT_RIGHT_DOWN, function(event)
newCtrl.ctrl:PopupMenu( menu, event:GetPosition() )
end )
end
if layoutCtrl.filedrop then
local dropTarget = wx.wxLuaFileDropTarget();
dropTarget.OnDropFiles = function(self, x, y, filenames)
return layoutCtrl.filedrop(filenames) -- 1..n, true, false
end
newCtrl.ctrl:SetDropTarget(dropTarget)
end
newCtrl.proportion = 0
newCtrl.expand = true
newCtrl.border = 1
if layoutCtrl.layout then
if layoutCtrl.layout.proportion then newCtrl.proportion = layoutCtrl.layout.proportion end
if layoutCtrl.layout.expand then newCtrl.expand = layoutCtrl.layout.expand end
if layoutCtrl.layout.border then newCtrl.border = layoutCtrl.layout.border end
end
if layoutCtrl.name == "CheckBox" then
newCtrl.GetValue = function() return newCtrl.ctrl:IsChecked() end
newCtrl.SetValue = function(v) return newCtrl.ctrl:SetValue(v) end
newCtrl.IsChecked = function() return newCtrl.ctrl:IsChecked() end
end
if layoutCtrl.name == "Choice" or layoutCtrl.name == "ComboBox" or
layoutCtrl.name == "ListBox" or layoutCtrl.name == "CheckListBox" or
layoutCtrl.name == "RadioBox"
then
newCtrl.Clear = function() return newCtrl.ctrl:Clear() end
newCtrl.Append = function(value) return newCtrl.ctrl:Append(value) end
newCtrl.Insert = function(value,index) return newCtrl.ctrl:Insert(value,index) end
newCtrl.Delete = function(index) return newCtrl.ctrl:Delete(index) end
newCtrl.Select = function(index) return newCtrl.ctrl:Select(index) end
newCtrl.GetCount = function() return newCtrl.ctrl:GetCount() end
newCtrl.GetSelection = function() return newCtrl.ctrl:GetSelection() end
newCtrl.GetString = function(index) return newCtrl.ctrl:GetString(index) end
if layoutCtrl.name == "Choice" or layoutCtrl.name == "RadioBox" then
newCtrl.GetValue = function() return newCtrl.ctrl:GetSelection() end
newCtrl.SetValue = function(v) return newCtrl.ctrl:SetValue(v) end
newCtrl.GetText = function() return newCtrl.ctrl:GetString(newCtrl.ctrl:GetSelection()) end
end
if layoutCtrl.name == "ComboBox" then
newCtrl.GetValue = function() return newCtrl.ctrl:GetValue() end
newCtrl.SetValue = function(v) return newCtrl.ctrl:SetValue(v) end
newCtrl.GetText = function() return newCtrl.ctrl:GetValue() end
end
if layoutCtrl.name == "ListBox" then
newCtrl.IsSelected = function(i) return newCtrl.ctrl:IsSelected(i) end
end
if layoutCtrl.name == "CheckListBox" then
newCtrl.IsSelected = function(i) return newCtrl.ctrl:IsSelected(i) end
newCtrl.IsChecked = function(i) return newCtrl.ctrl:IsChecked(i) end
end
end
if layoutCtrl.name == "TextCtrl" then
newCtrl.Clear = function() newCtrl.ctrl:Clear() end
newCtrl.Append = function(data) newCtrl.ctrl:AppendText(data) end
newCtrl.AppendText = function(data) newCtrl.ctrl:AppendText(data) end
newCtrl.GetValue = function() return newCtrl.ctrl:GetValue() end
newCtrl.SetValue = function(v)
newCtrl.ctrl:Clear()
newCtrl.ctrl:AppendText(v)
end
end
if layoutCtrl.name == "FilePicker" or layoutCtrl.name == "DirPicker" then
newCtrl.GetValue = function() return newCtrl.ctrl:GetPath() end
newCtrl.SetValue = function(v) return newCtrl.ctrl:SetPath(v) end
end
end
return newCtrl
end
-------------------------------------------------------------------------------
-- Resource
-------------------------------------------------------------------------------
function os.isfile(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function dump_table(data)
for k,v in pairs(data) do
print( k, v )
end
end
function GetMenuBitmap(name,size)
if name == "exit" then
return wx.wxArtProvider.GetBitmap(wx.wxART_QUIT, wx.wxART_MENU, wx.wxSize(size, size))
end
if name == "help" then
return wx.wxArtProvider.GetBitmap(wx.wxART_HELP, wx.wxART_MENU, wx.wxSize(size, size))
end
end
function GetToolBitmap(name,size)
if name == "exit" then
return wx.wxArtProvider.GetBitmap(wx.wxART_QUIT, wx.wxART_TOOLBAR, wx.wxSize(size, size))
end
if name == "help" then
return wx.wxArtProvider.GetBitmap(wx.wxART_HELP, wx.wxART_TOOLBAR, wx.wxSize(size, size))
end
end
function GetBitmap(xpm_table)
return wx.wxBitmap(xpm_table)
end
function GetBitmapFile( filename )
if os.isfile( filename ) then
return wx.wxBitmap( filename, wx.wxBITMAP_TYPE_ANY )
else
return nil
end
end
function GetIcon(name)
local icon = wx.wxIcon()
if type(name) == "string" then
icon:CopyFromBitmap(wx.wxBitmap(name))
end
return icon
end
-------------------------------------------------------------------------------
-- Dialogs
-------------------------------------------------------------------------------
function Message(parent,caption,message)
return wx.wxMessageBox( message, caption, wx.wxOK + wx.wxCENTRE, parent, -1, -1 )
end
function OpenFileDialog(parent,defaultDir,multiple,save)
local style = 0
if save == nil or save == False then
style = wx.wxFD_OPEN + wx.wxFD_FILE_MUST_EXIST
else
style = wx.xFD_SAVE + wx.wxFD_OVERWRITE_PROMPT
end
if multiple ~= nil and multiple == true then
style = style + wx.wxFD_MULTIPLE
end
if defaultDir == nil then
defaultDir = ""
end
local dlg = wx.wxFileDialog(parent,"Choose a file",defaultDir,"","*.*",style)
local rv = dlg:ShowModal()
if rv == wx.wxID_OK then
--[[
if multiple == true then
files = []
for file in dlg.GetFilenames():
files.append( os.path.join(dlg.GetDirectory(), file) )
return files
else:]]
return dlg:GetDirectory() .. "\\" .. dlg:GetFilename()
end
return nil
end
-------------------------------------------------------------------------------
-- Menu
-------------------------------------------------------------------------------
function Menu(parent,menu_table)
local menu = wx.wxMenu()
for i, m in ipairs(menu_table) do
if type(m.Name) == "string" then
if type(m.Value) == "table" then
local submenu = Menu( parent, m.Value )
menu:Append( submenu, m.Name )
end
if type(m.Value) == "function" then
local item = wx.wxMenuItem( menu, wxID_USER_Index, m.Name, "", wx.wxITEM_NORMAL )
if m.Icon ~= nil then
item:SetBitmap(GetMenuBitmap(m.Icon,16))
end
menu:Append( item )
parent:Connect(wxID_USER_Index, wx.wxEVT_COMMAND_MENU_SELECTED, m.Value)
wxID_USER_Index = wxID_USER_Index + 1
end
end
end
return menu
end
function MenuBar(parent,menubar_table)
local menubar = wx.wxMenuBar( 0 )
for i, m in ipairs(menubar_table) do
local menu
if type(m.Name) == "string" then
local item
if type(m.Value) == "table" then
menu = Menu( parent, m.Value )
menubar:Append( menu, m.Name )
end
if type(m.Value) == "function" then
item = wx.wxMenuItem( menubar, wxID_USER_Index, m.Name, "", wx.wxITEM_NORMAL )
menubar:Append( item )
parent:Connect(wxID_USER_Index, wx.wxEVT_COMMAND_MENU_SELECTED, m.Value)
wxID_USER_Index = wxID_USER_Index + 1
end
end
end
return menubar
end
-------------------------------------------------------------------------------
-- ToolBar
-------------------------------------------------------------------------------
--[[
control:AddTool(wx.wxID_ANY, "A tool 1", bmp, "Help for a tool 1", wx.wxITEM_NORMAL)
control:AddTool(wx.wxID_ANY, "A tool 2", bmp, "Help for a tool 2", wx.wxITEM_NORMAL)
control:AddSeparator()
control:AddCheckTool(wx.wxID_ANY, "A check tool 1", bmp, wx.wxNullBitmap, "Short help for checktool 1", "Long help for checktool ")
control:AddCheckTool(wx.wxID_ANY, "A check tool 2", bmp, wx.wxNullBitmap, "Short help for checktool 2", "Long help for checktool 2")
AddControl("wxToolBar", control)
]]
function CreateToolBar(parent,toolbar_table)
local flags = wx.wxTB_FLAT + wx.wxTB_HORIZONTAL + wx.wxTB_TEXT
local toolbar = parent:CreateToolBar( flags, wx.wxID_ANY )
for i, m in ipairs(toolbar_table) do
local tool
local icon
local tooltip
local name = m.Name
if m.Name ~= nil and m.Name == '-' then
toolbar:AddSeparator()
else
if m.Icon == nil then icon = wx.NullBitmap else icon = GetToolBitmap(m.Icon,32) end
if m_ToolTip == nil then tooltip = "" else tooltip = m.ToolTip end
if m.Name == nil then
flags = flags + wx.wxTB_TEXT
name = ""
end
tool = toolbar:AddTool(wxID_USER_Index, name, icon, tooltip, wx.wxITEM_NORMAL)
if m.ToolTip ~= nil then toolbar:SetToolShortHelp( wxID_USER_Index, m.ToolTip) end
if m.Value == nil then tool:Enable( false ) else
toolbar:Connect( wxID_USER_Index, wx.wxEVT_COMMAND_TOOL_CLICKED, m.Value )
end
wxID_USER_Index = wxID_USER_Index + 1
end
end
toolbar:Realize()
--[[
local toolbar = wx.wxToolBar(parent, ID_TOOLBAR, wx.wxDefaultPosition, wx.wxDefaultSize)
for i, m in ipairs(toolbar_table) do
local tool = toolbar:AddTool(wx.wxID_ANY, m.Name, m.Icon, m.ToolTip, wx.wxITEM_NORMAL)
end
return toolbar
]]
end
-------------------------------------------------------------------------------
-- StatusBar
-------------------------------------------------------------------------------
function StatusBar(parent,count)
return parent:CreateStatusBar( count, 0, wxID_STATUS )
end
-------------------------------------------------------------------------------
-- Controls
-------------------------------------------------------------------------------
function InitCtrl(newCtrl,layoutCtrl)
if newCtrl.proportion == nil then newCtrl.proportion = 0 end
if newCtrl.expand == nil then newCtrl.expand = true end
if newCtrl.border == nil then newCtrl.border = 1 end
newCtrl.SetLayoutParam = function( proportion, expand, border )
newCtrl.proportion = proportion
newCtrl.expand = expand
newCtrl.border = border
end
if layoutCtrl and layoutCtrl.tooltip then
newCtrl.ctrl:SetToolTip(wx.wxToolTip(layoutCtrl.tooltip))
end
if layoutCtrl and layoutCtrl.menu then
local menu = Menu(newCtrl.ctrl,layoutCtrl.menu)
newCtrl.ctrl:Connect(wx.wxEVT_RIGHT_DOWN, function(event)
newCtrl.ctrl:PopupMenu( menu, event:GetPosition() )
end )
end
end
function InitItemContainer(newCtrl)
newCtrl.Clear = function() return newCtrl.ctrl:Clear() end
newCtrl.Append = function(value) return newCtrl.ctrl:Append(value) end
newCtrl.Insert = function(value,index) return newCtrl.ctrl:Insert(value,index) end
newCtrl.Delete = function(index) return newCtrl.ctrl:Delete(index) end
newCtrl.Select = function(index) return newCtrl.ctrl:Select(index) end
newCtrl.GetCount = function() return newCtrl.ctrl:GetCount() end
newCtrl.GetSelection = function() return newCtrl.ctrl:GetSelection() end
newCtrl.GetString = function(index) return newCtrl.ctrl:GetString(index) end
end
function StyledText(parent,layoutCtrl)
local stc = {}
local style = 0
local name = "wxStyledTextCtrl"
stc.ctrl = wxstc.wxStyledTextCtrl(parent, wxID_USER_Index,
wx.wxDefaultPosition, wx.wxDefaultSize, style, name )
stc.id = wxID_USER_Index
wxID_USER_Index = wxID_USER_Index + 1
InitCtrl(stc,layoutCtrl)
stc.enableLineNumber = function()
stc.ctrl:SetMargins(0, 0)
stc.ctrl:SetMarginType(1, wxstc.wxSTC_MARGIN_NUMBER)
stc.ctrl:SetMarginMask(2, wxstc.wxSTC_MASK_FOLDERS)
stc.ctrl:SetMarginSensitive(2, True)
stc.ctrl:SetMarginWidth(1, 32) -- 2,25
stc.ctrl:SetMarginWidth(2, 16) -- 2,25
end
stc.enableLineNumber();
stc.AppendText = function(v) stc.ctrl:AppendText(v) end
return stc
end
function ListCtrl(parent,layoutCtrl)
local newCtrl = { }
newCtrl.ctrl = wx.wxListCtrl(parent, wxID_USER_Index,
wx.wxDefaultPosition, wx.wxDefaultSize,
wx.wxLC_REPORT + wx.wxBORDER_SUNKEN)
newCtrl.id = wxID_USER_Index
wxID_USER_Index = wxID_USER_Index + 1
if layoutCtrl.handler then
parent:Connect(newCtrl.id, wx.wxEVT_COMMAND_LIST_ITEM_SELECTED, layoutCtrl.handler )
end
InitCtrl(newCtrl,layoutCtrl)
local dropTarget = wx.wxLuaFileDropTarget();
dropTarget.OnDropFiles = function(self, x, y, filenames)
for i = 1, #filenames do
newCtrl.ctrl:InsertItem(newCtrl.ctrl:GetItemCount()+1, filenames[i])
end
return true
end
newCtrl.ctrl:SetDropTarget(dropTarget)
--list:SetImageList(listImageList, wx.wxIMAGE_LIST_SMALL)
newCtrl.col = 0
newCtrl.row = 0
newCtrl.Clear = function() newCtrl.ctrl:DeleteAllItems() end
newCtrl.Set = function( row, col, label )
newCtrl.ctrl:SetItem( row, col, label)
end
newCtrl.GetSelectedItems = function()
local items = { }
local item = -1
while true do
item = newCtrl.ctrl:GetNextItem(item, wx.wxLIST_NEXT_ALL, wx.wxLIST_STATE_SELECTED)
if item == -1 then
break
end
items[#items+1] = item
end
return items
end
newCtrl.AddColumn = function( label, size )
newCtrl.ctrl:InsertColumn(newCtrl.col, label)
newCtrl.ctrl:SetColumnWidth(newCtrl.col, size)
newCtrl.col = newCtrl.col + 1
end
newCtrl.AddColumns = function( labels, widths )
if labels == nil then return end
for col = 1, #labels do
newCtrl.ctrl:InsertColumn( col-1, labels[col])
newCtrl.col = newCtrl.col + 1
end
if widths == nil then return end
for col = 1, #widths do
newCtrl.ctrl:SetColumnWidth(col-1, widths[col])
end
end
newCtrl.AddRow = function( row )
newCtrl.ctrl:InsertItem( newCtrl.row, row[1] )
for col = 2, #row do
newCtrl.ctrl:SetItem( newCtrl.row, col-1, row[col])
end
newCtrl.row = newCtrl.row + 1
end
--if cols ~= nil then list.AddColumns( cols, colwidths ) end
return newCtrl
end
-------------------------------------------------------------------------------
-- Container
-------------------------------------------------------------------------------
function Panel(parent,content)
local panel = { }
panel.ctrl = wx.wxPanel( parent, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxTAB_TRAVERSAL )
panel.ctrl:SetSizer( Layout( panel.ctrl,content).ctrl )
panel.ctrl:Layout()
return panel
end
function BoxPanel(parent,content)
local vbox = VBox()
local panel = Panel(parent,content)
panel.expand = true
panel.proportion = 1
vbox.Add(panel)
vbox.expand = true
vbox.proportion = 1
return vbox
end
function SplitterWindow(parent,content,direction)
local swin = { }
swin.ctrl = wx.wxSplitterWindow( parent, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize, 0 --[[wx.wxSP_3D]] )
local left_panel = Panel( swin.ctrl, content.children[1] )
local right_panel = Panel( swin.ctrl, content.children[2] )
if direction == 'horizontal' then
swin.ctrl:SplitHorizontally( left_panel.ctrl, right_panel.ctrl, 0 )
else
swin.ctrl:SplitVertically( left_panel.ctrl, right_panel.ctrl, 0 )
end
return swin
end
function VerticalWindow(parent,content)
return SplitterWindow(parent,content,'vertical')
end
function HorizontalWindow(parent,content)
return SplitterWindow(parent,content,'horizontal')
end
function Notebook(parent,content)
local note = { }
note.ctrl = wx.wxNotebook( parent, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
if content ~= nil and content.children ~= nil then
for i = 1, #content.children do
local panel = Panel( note.ctrl, content.children[i] )
local title = tostring(i)
if content.title ~= nil and content.title[i] ~= nil then
title = content.title[i]
end
note.ctrl:AddPage( panel.ctrl, title, False )
end
end
return note
end
-------------------------------------------------------------------------------
-- Sizer
-------------------------------------------------------------------------------
function BoxSizer(orient)
local sizer = { }
if orient == nil then orient = wx.wxVERTICAL end
sizer.ctrl = wx.wxBoxSizer( orient )
sizer.Add = function(child)
local proportion = 0
local border = 0
local align = wx.wxALIGN_CENTER
local flags = align + wx.wxALL
if child.expand ~= nil and child.expand == true then flags = flags + wx.wxEXPAND end
if child.border ~= nil then border = child.border end
if child.proportion ~= nil then proportion = child.proportion end
sizer.ctrl:Add( child.ctrl, proportion, flags, border )
end
sizer.AddSpacer = function(size)
if size == nil then size = 0 end
sizer.ctrl:Add( 0, 0, 1, wx.wxEXPAND, 5 )
end
return sizer
end
function VBox()
return BoxSizer(wx.wxVERTICAL)
end
function HBox()
return BoxSizer(wx.wxHORIZONTAL)
end
function HStaticBox(parent,name)
local hsbox = { }
local box = wx.wxStaticBox( parent, wx.wxID_ANY, name)
hsbox.ctrl = wx.wxStaticBoxSizer( box, wx.wxHORIZONTAL )
hsbox.Add = function(child)
hsbox.ctrl:Add( child.ctrl, 1, wx.wxEXPAND + wx.wxALL + wx.wxGROW, 1 )
end
return hsbox
end
-------------------------------------------------------------------------------
-- Layout
-------------------------------------------------------------------------------
function Layout(parent,content)
local vbox = VBox()
for i, v in ipairs(content) do
local hbox = HBox()
if type(v) == "table" then
for j, h in pairs(v) do
if type(h) == "table" then
local ctrl;
if h.name == "StaticText" or
h.name == "Button" or
h.name == "ToggleButton" or
h.name == "CheckBox" or
h.name == "Choice" or
h.name == "ComboBox" or
h.name == "ListBox" or
h.name == "CheckListBox" or
h.name == "RadioBox" or
h.name == "TextCtrl" or
h.name == "FilePicker" or
h.name == "DirPicker"
then
ctrl = CreateControl(parent,h)
elseif h.name == "StyledText" then
ctrl = StyledText(parent,h)
elseif h.name == "ListCtrl" then
ctrl = ListCtrl(parent,h)
elseif h.name == "Panel" then
ctrl = Panel(parent,h)
elseif h.name == "SplitterWindow" then
ctrl = SplitterWindow(parent,h)
elseif h.name == "Notebook" then
ctrl = Notebook(parent,h)
elseif h.name == "Spacer" then
hbox.AddSpacer(0)
elseif h.name == nil then
for k1,v1 in pairs(h) do hbox[k1] = v1 end
end
if ctrl ~= nil then
if h.layout ~= nil then
for k1,v1 in pairs(h.layout) do ctrl[k1] = v1 end
end
for k1,v1 in pairs(h) do ctrl[k1] = v1 end
if ctrl.key ~= nil then __ctrl_table[ctrl.key] = ctrl end
hbox.Add(ctrl)
end
else
--TODO: Error Meeesage
end
end
else
--TODO: Error Meeesage
end
vbox.Add(hbox)
end
return vbox
end
-------------------------------------------------------------------------------
-- Window
-------------------------------------------------------------------------------
function GetWxCtrl(key)
if __ctrl_table[key] ~= nil then
return __ctrl_table[key].ctrl
else
return nil
end
end
function GetCtrl(key)
return __ctrl_table[key]
end
function Window(title,icon,layout, width, height)
window = {}
window.ctrl = __ctrl_table
window.frame = wx.wxFrame (wx.NULL, wx.wxID_ANY, title, wx.wxDefaultPosition, wx.wxSize( width, height ), wx.wxDEFAULT_FRAME_STYLE+wx.wxTAB_TRAVERSAL )
window.frame:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )
window.Show = function() window.frame:Show() end
window.SetMenuBar = function(menu) window.frame:SetMenuBar( MenuBar( window.frame, menu) ) end
window.SetToolBar = function(tool) CreateToolBar( window.frame, tool ) end
window.SetStatusBar = function(count)
window.StatusBar = window.frame:CreateStatusBar( count, 0, wx.wxID_ANY )
end
window.SetStatusText = function(text,index) window.StatusBar:SetStatusText(text,index) end
window.SetContent = function(content)
--window.frame:SetSizer( Layout( window.frame, content ).ctrl )
window.frame:SetSizer( BoxPanel( window.frame, content ).ctrl )
window.frame:Layout() --TODO: not necessary
window.frame:Centre( wx.wxBOTH ) --TODO: not necessary
end
window.SetTimer = function(handler)
window.frame:Connect( wx.wxEVT_TIMER, handler )
window.Timer = wx.wxTimer(window.frame, wxID_USER_Index)
wxID_USER_Index = wxID_USER_Index + 1
end
window.StartTimer = function(msec) window.Timer:Start(msec) end
window.StopTimer = function() window.Timer:Stop() end
window.GetCtrl = function(name)
return __ctrl_table[name];
end
window.SetIcon = function(name)
window.frame:SetIcon(GetIcon(name))
end
window.Run = function()
wx.wxLocale(wx.wxLocale:GetSystemLanguage()) -- TODO
wx.wxGetApp():MainLoop()
end
if icon ~= nil then window.SetIcon(icon) end
if layout ~= nil then
if layout.menubar ~= nil then window.SetMenuBar(layout.menubar) end
if layout.toolbar ~= nil then window.SetToolBar(layout.toolbar) end
if layout.statusbar ~= nil then window.SetStatusBar(layout.statusbar) end
if layout.content ~= nil then window.SetContent(layout.content) end
end
return window
end
|
--[[
© CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
CW_FRENCH = Clockwork.lang:GetTable("French");
CW_FRENCH["StaticToolAddText"] = "Statique Ajouter/Supprimer";
CW_FRENCH["StaticToolAddDesc"] = "Vous permet d'enregistrer en permanence des entités sur la carte.";
CW_FRENCH["StaticWhitelistView"] = "Liste: #1";
CW_FRENCH["StaticWhitelistAdded"] = "Vous avez ajouté #1 à la liste des entités qui peuvent être statiques.";
CW_FRENCH["StaticWhitelistRemoved"] = "Vous avez supprimé #1 de la liste des entités qui peuvent être statiques.";
CW_FRENCH["StaticNotWhitelisted"] = "#1 n'est pas dans la liste statique!";
CW_FRENCH["StaticAlreadyWhitelisted"] = "#1 est déjà dans la liste statique!";
CW_FRENCH["YouRemovedStaticEntity"] = "Vous avez supprimé avec succès une entité statique.";
CW_FRENCH["YouAddedStaticEntity"] = "Vous avez ajouté une entité statique avec succès.";
CW_FRENCH["EntityIsNotStatic"] = "Cette entité n'est pas statique!";
CW_FRENCH["EntityAlreadyStatic"] = "Cette entité est déjà statique!";
CW_FRENCH["CannotStaticEntity"] = "Vous ne pouvez pas rendre cette entité statique!";
CW_FRENCH["LookAtValidEntity"] = "Vous devez regarder une entité valide!";
CW_FRENCH["ToggledStaticModeTo"] = "Vous avez activé le mode statique pour #1.";
CW_FRENCH["RemovedStaticInRadius"] = "Vous avez supprimé les entités statiques #1 dans les unités #2 autour de vous.";
CW_FRENCH["AddedStaticInRadius"] = "Vous avez ajouté #1 entités statiques dans l'unité #2 autour de vous.";
CW_FRENCH["StaticMustEnterRadius"] = "Vous devez entrer un numéro pour le rayon!";
CW_FRENCH["ShowStaticEntities"] = "Afficher les entités statiques";
CW_FRENCH["ShowStaticEntitiesDesc"] = "Indiquer ou non les entités statiques dans l'ESP d'administration."; |
require "sys"
require "filesystem"
require "util"
cjass = {}
cjass.path = fs.ydwe_path() / "plugin" / "AdicHelper"
cjass.exe_path = cjass.path / "AdicHelper.exe"
-- 使用cJass编译地图
-- map_path - 地图路径,fs.path对象
-- option - 附加编译选项, table,支持选项为:
-- enable_jasshelper_debug - 启用Debug模式,true/false
-- runtime_version - 魔兽版本
-- 返回:true编译成功,false编译失败
function cjass.do_compile(self, map_path, option)
local parameter = option.runtime_version:is_new() and " /v24" or " /v23"
.. (option.enable_jasshelper_debug and " /dbg" or "")
local command_line = string.format('"%s"%s /mappars="%s"',
self.exe_path:string(),
parameter,
map_path:string()
)
return sys.spawn(command_line, self.path, true)
end
function cjass.compile(self, map_path, option)
log.trace("CJass compilation start.")
local result = self:do_compile(map_path, option)
if result then
log.debug("CJass compilation succeeded.")
else
log.error("CJass compilation failed.")
end
return result
end
|
function Command_Mobs_Add(Client_ID, Command, Text_0, Text_1, Arg_0, Arg_1, Arg_2, Arg_3, Arg_4)
local Entity_ID = Client_Get_Entity(Client_ID)
local Player_Number = Entity_Get_Player(Entity_ID)
local Map_ID = Entity_Get_Map_ID(Entity_ID)
local Map_Size_X, Map_Size_Y, Map_Size_Z = Map_Get_Dimensions(Map_ID)
local Spawn_X, Spawn_Y, Spawn_Z, Spawn_Rotation, Spawn_Look = 0.5+math.random()*(Map_Size_X-1.5), 0.5+math.random()*(Map_Size_Y-1.5), Map_Size_Z-2, 0, 0
--local Spawn_X, Spawn_Y, Spawn_Z, Spawn_Rotation, Spawn_Look = Map_Get_Spawn(Map_ID)
--local Spawn_X, Spawn_Y, Spawn_Z, Spawn_Rotation, Spawn_Look = Entity_Get_X(Entity_ID), Entity_Get_Y(Entity_ID), Entity_Get_Z(Entity_ID), Entity_Get_Rotation(Entity_ID), Entity_Get_Look(Entity_ID)
local Amount = 1
if Arg_1 ~= "" then
Amount = tonumber(Arg_1)
end
if Amount <= 20 then
if Arg_0 ~= "" then
for i = 1, Amount do
local Entity_ID = Entity_Add(Arg_0, Map_ID, Spawn_X, Spawn_Y, Spawn_Z, Spawn_Rotation, Spawn_Look)
Entity_Displayname_Set(Entity_ID, "&c", Arg_0, "")
end
System_Message_Network_Send(Client_ID, "&eMobs spawned on this map")
end
else
System_Message_Network_Send(Client_ID, "&cDont add too much mobs!")
end
end
function Command_Mobs_Delete(Client_ID, Command, Text_0, Text_1, Arg_0, Arg_1, Arg_2, Arg_3, Arg_4)
local Entity_ID = Client_Get_Entity(Client_ID)
local Player_Number = Entity_Get_Player(Entity_ID)
local Map_ID = Entity_Get_Map_ID(Entity_ID)
local Entity_Table, Entities = Entity_Get_Table()
for i = 1, Entities do
local Entity_ID = Entity_Table[i]
local Entity_Map_ID = Entity_Get_Map_ID(Entity_ID)
if Entity_Map_ID == Map_ID then
local Player_Number = Entity_Get_Player(Entity_ID)
if Player_Number == -1 then
Entity_Delete(Entity_ID)
end
end
end
System_Message_Network_Send(Client_ID, "&eMobs deleted")
end |
-----------------------------------------
-- ID: 5985
-- Item: Sprig of Hemlock
-- Food Effect: 5 Min, All Races
-- Paralysis
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
function onItemCheck(target)
return 0
end
function onItemUse(target)
if (not target:hasStatusEffect(tpz.effect.PARALYSIS)) then
target:addStatusEffect(tpz.effect.PARALYSIS,20,0,600)
else
target:messageBasic(tpz.msg.basic.NO_EFFECT)
end
end
|
local socket = require('socket')
local ssl = require('ssl')
local ltn12 = require('ltn12')
local http = require('socket.http')
local url = require('socket.url')
local https = {
['try'] = socket.try,
['configuration'] = {
['protocol'] = 'any',
['options'] = {
'all',
'no_sslv2',
'no_sslv3'
},
['verify'] = 'none'
}
}
function https.build_url(request)
local parsed = url.parse(request, { ['port'] = 443 })
return url.build(parsed)
end
function https.build_table(request, body, result, method)
request = {
['url'] = https.build_url(request),
['method'] = method or (body and 'POST' or 'GET'),
['sink'] = ltn12.sink.table(result)
}
if body then
request.source = ltn12.source.string(body)
request.headers = {
['Content-Length'] = #body,
['Content-Type'] = 'application/x-www-form-urlencoded'
}
end
return request
end
function https.register(connection)
for name, method in pairs(getmetatable(connection.socket).__index) do
if type(method) == 'function' then
connection[name] = function(self, ...)
return method(self.socket, ...)
end
end
end
end
function https.tcp(parameters, timeout)
parameters = type(parameters) == 'table' and parameters or {}
for k, v in pairs(https.configuration) do
parameters[k] = parameters[k] or v
end
parameters.mode = 'client'
return function()
local connection = {}
connection.socket = https.try(socket.tcp())
https.settimeout = getmetatable(connection.socket).__index.settimeout
function connection:settimeout(...)
return https.settimeout(self.socket, ...)
end
function connection:connect(host, port)
https.try(self.socket:connect(host, port))
self.socket = https.try(ssl.wrap(self.socket, parameters))
self.socket:sni(host)
if timeout and tonumber(timeout) ~= nil then
self.socket:settimeout(tonumber(timeout))
end
https.try(self.socket:dohandshake())
https.register(self, getmetatable(self.socket))
return 1
end
return connection
end
end
function https.request(request, body, timeout)
local result = {}
request = type(request) == 'string' and https.build_table(request, body, result) or https.build_url(request.url)
timeout = https.timeout or request.timeout or timeout or nil
if http.PROXY or request.proxy then
return nil, 'Proxies are not supported!'
elseif request.redirect then
return nil, 'Redirects are not supported!'
elseif request.create then
return nil, 'The create function is not supported!'
end
request.create = https.tcp(request, timeout)
local res, code, headers, status = http.request(request)
if res and type(result) == 'table' then
res = table.concat(result)
end
return res, code, headers, status
end
return https |
project "lua_cmsgpack"
language "C"
files { "lua_cmsgpack.c" }
links { "lib_lua" }
includedirs { "." }
KIND{lua="cmsgpack"}
|
ITEM.name = "Voss Pattern Grenade Launcher"
ITEM.description = "A grenade launcher pattern used commonly by the Imperial Guard."
ITEM.model = "models/weapons/w_ig_grenade.mdl"
ITEM.class = "tfa_glaunche"
ITEM.weaponCategory = "primary"
ITEM.width = 6
ITEM.height = 4
ITEM.price = 900
ITEM.weight = 12.5
ITEM.iconCam = {
ang = Angle(-0.020070368424058, 270.40155029297, 0),
fov = 7.2253324508038,
pos = Vector(0, 200, -1)
}
|
local WorldTooltipper = {
TooltipMode = 2, -- World and Hover
UpdateDelay = 2000
}
if Ext.IsClient() then
--Unused since setting RootTemplate.Tooltip on the server makes the client update as well.
if Vars.DebugMode then
function WorldTooltipper.OnUpdate(ui, event, removeNotUpdated)
if Input.IsPressed(Data.Input.ShowWorldTooltips) then
--local player = Client:GetCharacter()
local this = ui:GetRoot()
local arr = this.worldTooltip_array
for i=0,#arr-1 do
PrintDebug("worldTooltip_array", i, arr[i])
end
arr = this.repos_array
for i=0,#arr-1 do
PrintDebug("repos_array", i, arr[i])
end
end
end
--Ext.RegisterUITypeInvokeListener(Data.UIType.worldTooltip, "updateTooltips", WorldTooltipper.OnUpdate)
function WorldTooltipper.UpdateItems(cmd, payload)
local ids = Common.JsonParse(payload)
if ids then
for i=1,#ids do
local item = Ext.GetItem(ids[i])
if item then
PrintDebug("CLIENT", item.DisplayName, item.RootTemplate.Tooltip)
if item.RootTemplate.Tooltip ~= WorldTooltipper.TooltipMode then
item.RootTemplate.Tooltip = WorldTooltipper.TooltipMode
end
end
end
end
end
Ext.RegisterNetListener("LeaderLib_WorldTooltipper_UpdateClient", WorldTooltipper.UpdateItems)
end
else
---@param item EsvItem
local function ShouldHaveTooltip(item)
if item.RootTemplate and item.RootTemplate.Tooltip ~= WorldTooltipper.TooltipMode and not StringHelpers.IsNullOrWhitespace(item.DisplayName) then
return true
end
return false
end
function WorldTooltipper.UpdateWorldItems()
if SettingsManager.GetMod("7e737d2f-31d2-4751-963f-be6ccc59cd0c").Global:FlagEquals("LeaderLib_AllTooltipsForItemsEnabled", true) then
local time = Ext.MonotonicTime()
for _,uuid in pairs(Ext.GetAllItems()) do
local item = Ext.GetItem(uuid)
if item and ShouldHaveTooltip(item) then
item.RootTemplate.Tooltip = WorldTooltipper.TooltipMode
end
end
fprint(LOGLEVEL.DEFAULT, "[LeaderLib:WorldTooltips.UpdateWorldItems] World tooltip updating took (%s) ms.", Ext.MonotonicTime()-time)
end
end
function WorldTooltipper.OnGameStarted(region, editorMode)
Timer.StartOneshot("Timers_LeaderLib_WorldTooltipper_UpdateItems", WorldTooltipper.UpdateDelay, WorldTooltipper.UpdateWorldItems)
end
function UpdateWorldTooltips()
Timer.StartOneshot("Timers_LeaderLib_WorldTooltipper_UpdateItems", WorldTooltipper.UpdateDelay, WorldTooltipper.UpdateWorldItems)
end
---@param item EsvItem
function WorldTooltipper.OnItemEnteredWorld(item, region)
if item and ShouldHaveTooltip(item) then
--print("SERVER", item.DisplayName, item.RootTemplate.Tooltip)
item.RootTemplate.Tooltip = WorldTooltipper.TooltipMode
end
end
Ext.RegisterOsirisListener("ItemEnteredRegion", Data.OsirisEvents.ItemEnteredRegion, "after", function(uuid, region)
if SettingsManager.GetMod("7e737d2f-31d2-4751-963f-be6ccc59cd0c").Global:FlagEquals("LeaderLib_AllTooltipsForItemsEnabled", true) then
WorldTooltipper.OnItemEnteredWorld(Ext.GetItem(uuid), region)
end
end)
Ext.RegisterOsirisListener("GameStarted", Data.OsirisEvents.GameStarted, "after", WorldTooltipper.OnGameStarted)
if Vars.DebugMode then
RegisterListener("LuaReset", WorldTooltipper.UpdateWorldItems)
end
end
Ext.RegisterConsoleCommand("llwtipper", function(cmd, param, val)
if param == "mode" then
WorldTooltipper.TooltipMode = tonumber(val or "2") or 2
WorldTooltipper.UpdateWorldItems()
end
end) |
local Files = require('orgmode.parser.files')
local config = require('orgmode.config')
local utils = require('orgmode.utils')
local diagnostic_ns = vim.api.nvim_create_namespace('org_diagnostics')
---@return table[]|nil|boolean
local function get_errors()
if not config.diagnostics then
return false
end
local file = Files.get_current_file()
if not file then
return nil
end
local errors = file:get_errors()
if not errors then
return {}
end
return vim.tbl_map(function(error)
local err = error.err
local start_line, start_col, end_line, end_col = err.node:range()
return {
lnum = start_line,
end_lnum = end_line,
col = start_col,
end_col = end_col,
severity = vim.diagnostic and vim.diagnostic.severity.ERROR or 'Error',
source = 'always',
message = string.format('Error on text "%s"', err.text),
}
end, errors)
end
local function report_errors()
local errors = get_errors()
if errors == false or errors == nil or not vim.diagnostic then
return
end
return vim.diagnostic.set(diagnostic_ns, 0, errors)
end
local function print_errors()
local errors = get_errors()
if errors == false then
return utils.echo_info('Diagnostics are disabled in the configuration.')
end
if errors == nil then
return utils.echo_error(
'Current file not found in the Orgmode state. Try saving and reloading the file with command ":edit!".'
)
end
if #errors == 0 then
return utils.echo_info('No errors.')
end
local msg = vim.tbl_map(function(err)
return string.format('%s, Line %d, col %d', err.message, err.lnum + 1, err.col + 1)
end, errors)
return utils.echo_error(msg)
end
local function print_error_state()
local errors = get_errors()
if not errors or #errors == 0 or vim.diagnostic then
return
end
return utils.echo_error('There are some errors in the document. To view them, use :OrgDiagnostics command.')
end
return {
report = report_errors,
print = print_errors,
print_error_state = print_error_state,
}
|
local webplot = require 'webplot'
local data = torch.Tensor(3,3):fill(1)
webplot.dojob(
function()
app.get('/', function(req, res)
res.send(tostring(data))
end)
end
)
-- do some computation ...
webplot.takeover() -- takeover control of main thread to keep webplot running
|
-- pandoc.utils.make_sections exists since pandoc 2.8
PANDOC_VERSION:must_be_at_least {2,8}
local List = require 'pandoc.List'
pandoc.utils = require 'pandoc.utils'
-- Filter images with this function if the target format is LaTeX.
function Div (elem)
if FORMAT:match 'latex' then
if elem.classes:includes('checklist') then
local checklist = List:new{}
for i,el in pairs(elem.content) do
checklist[#checklist + 1] = el
end
return {
pandoc.RawBlock('latex', '\\begin{checklist}{' .. pandoc.utils.stringify(checklist[1]) .. '}'),
pandoc.RawBlock('latex', '\\textbf{' .. pandoc.utils.stringify(checklist[2]) .. '}'),
checklist[3],
pandoc.RawBlock('latex', '\\end{checklist}')
}
end
end
end
|
--- ================ LSP UNIFIED SERVER SETTINGS REPOSITORY ================
---
--- The name of this subsystem abbreviates to USSR, trololo.
local M = require('dotfiles.autoload')('dotfiles.lsp.unified_settings_repository')
-- TODO: https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#setTrace
-- TODO TODO TODO
-- <https://github.com/neovim/neovim/blob/v0.5.0/runtime/lua/vim/lsp/util.lua#L1874-L1887>
-- <https://github.com/neovim/neovim/blob/v0.5.0/runtime/lua/vim/lsp/handlers.lua#L160-L184>
-- <https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#workspace_didChangeConfiguration>
local lsp = require('vim.lsp')
local utils = require('dotfiles.utils')
local lsp_ignition = require('dotfiles.lsp.ignition')
-- Prior art:
-- <https://github.com/neoclide/coc.nvim/blob/c49acf35d8c32c16e1f14ab056a15308e0751688/src/configuration/util.ts#L38-L69>
-- <https://github.com/tamago324/nlsp-settings.nvim/blob/4e2523aa56d2814fd78f60fb41d7a5ccfa429207/lua/nlspsettings.lua#L31-L62>
function M.normalize(settings, vscode_style, output)
vim.validate({
settings = { settings, 'table' },
vscode_style = { vscode_style, 'boolean', true },
output = { output, 'table', true },
})
if vscode_style == nil then
vscode_style = true
end
if output == nil then
output = vim.empty_dict()
end
local current_path = {}
-- This will create a tree structure for the leading keys (for the string
-- `a.b.c` the leading keys are `a` and `b`) and return everything related.
local function expand_dots_in_key(key, dest)
local pushed_keys = 0
local deeper_dest = dest
local final_key = nil
local deeper_key = nil
for part in vim.gsplit(key, '.', true) do
final_key = part
if deeper_key ~= nil then
-- Yes, I understand, the logic is a little bit wonky inside this loop,
-- but it is to ensure that `final_key` is set to the last `part` after
-- the loop is done, and that we get every part but the last one for
-- `deeper_key`. The wonders of working with iterators in Lua, what can
-- I say.
-- Drill down the `dest` table.
local even_deeper_dest = deeper_dest[deeper_key]
if even_deeper_dest == nil then
even_deeper_dest = vim.empty_dict()
deeper_dest[deeper_key] = even_deeper_dest
elseif type(even_deeper_dest) ~= 'table' or vim.tbl_islist(even_deeper_dest) then
-- Whoops, sorry, can't drill into lists!
error(
string.format(
"path '%s': attempted to drill a new dictionary table into the key '%s' "
.. 'while expanding dots in the settings key %q, but that key already exists '
.. 'and has a value which does not look like a dictionary (we can only drill '
.. 'into dictionaries!)',
utils.json_path_to_string(current_path),
deeper_key,
key
)
)
end
deeper_dest = even_deeper_dest
table.insert(current_path, deeper_key)
pushed_keys = pushed_keys + 1
end
deeper_key = part
end
return final_key, deeper_dest, pushed_keys
end
-- NOTE: This function will be recursively-invoked only on dictionary-like
-- tables. The root table is assumed to be object-like.
local function normalize_internal(src, dest, do_dot_expansion)
for key, value in pairs(src) do
if type(key) ~= 'string' then
error(
string.format(
"path '%s': table contains a non-string key, but only string keys may be used for "
.. 'the settings tables (as they will later be converted into JSON)',
utils.json_path_to_string(current_path)
)
)
end
local deeper_dest = dest
local pushed_keys = 0
if do_dot_expansion then
key, deeper_dest, pushed_keys = expand_dots_in_key(key, dest)
end
table.insert(current_path, key)
pushed_keys = pushed_keys + 1
if type(value) == 'table' and not vim.tbl_islist(value) then
local value2 = {}
if getmetatable(value) == utils.EMPTY_DICT_MT then
value2 = vim.empty_dict()
end
deeper_dest[key] = value2
-- Dot-expansion should be performed only on the first/outer layer.
normalize_internal(value, value2, false)
else
-- NOTE: We can't discriminate values based on their type such as only
-- letting in numbers/strings/booleans because some special values,
-- such as vim.NIL, are implemented using userdata, and are very useful
-- regardless.
deeper_dest[key] = value
end
for _ = 1, pushed_keys do
table.remove(current_path)
end
end
end
normalize_internal(settings, output, vscode_style)
return output
end
function M.update(changed_settings)
-- return M.update_raw(M.normalize(changed_settings))
end
function M.update_raw(changed_settings)
-- dump(changed_settings)
end
function M.hook_on_config_installed(settings)
settings = M.normalize(settings, true)
-- dump(settings)
end
table.insert(lsp_ignition.service_hooks.on_config_installed, M.hook_on_config_installed)
return M
|
local Enum = require("api.Enum")
local TileRole = Enum.TileRole
local tiles = {
{
_id = "world_grass",
elona_id = 0,
elona_atlas = 0,
},
{
_id = "world_small_trees_1",
elona_id = 1,
elona_atlas = 0,
},
{
_id = "world_small_trees_2",
elona_id = 2,
elona_atlas = 0,
},
{
_id = "world_small_trees_3",
elona_id = 3,
elona_atlas = 0,
},
{
_id = "world_trees_1",
elona_id = 4,
elona_atlas = 0,
field_type = "elona.forest",
},
{
_id = "world_trees_2",
elona_id = 5,
elona_atlas = 0,
field_type = "elona.forest",
},
{
_id = "world_trees_3",
elona_id = 6,
elona_atlas = 0,
field_type = "elona.forest",
},
{
_id = "world_trees_4",
elona_id = 7,
elona_atlas = 0,
field_type = "elona.forest",
},
{
_id = "world_trees_5",
elona_id = 8,
elona_atlas = 0,
field_type = "elona.forest",
},
{
_id = "world_trees_6",
elona_id = 9,
elona_atlas = 0,
field_type = "elona.grassland",
},
{
_id = "world_plants_1",
elona_id = 10,
elona_atlas = 0,
field_type = "elona.grassland",
},
{
_id = "world_plants_2",
elona_id = 11,
elona_atlas = 0,
field_type = "elona.grassland",
},
{
_id = "world_plants_3",
elona_id = 12,
elona_atlas = 0,
field_type = "elona.grassland",
},
{
_id = "world_dirt_1",
elona_id = 13,
elona_atlas = 0,
field_type = "elona.desert",
},
{
_id = "world_dirt_2",
elona_id = 14,
elona_atlas = 0,
field_type = "elona.desert",
},
{
_id = "world_dirt_3",
elona_id = 15,
elona_atlas = 0,
field_type = "elona.desert",
},
{
_id = "world_dirt_4",
elona_id = 16,
elona_atlas = 0,
field_type = "elona.desert",
},
{
_id = "world_snow_cross",
elona_id = 26,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow",
elona_id = 27,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_trees_1",
elona_id = 29,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_trees_2",
elona_id = 30,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_crater",
elona_id = 31,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_mounds",
elona_id = 32,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_road_ns",
elona_id = 34,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_we",
elona_id = 35,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_sw",
elona_id = 36,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_se",
elona_id = 37,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_nw",
elona_id = 38,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_ne",
elona_id = 39,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_swe",
elona_id = 40,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_nsw",
elona_id = 41,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_nwe",
elona_id = 42,
elona_atlas = 0,
is_road = true
},
{
_id = "world_road_nse",
elona_id = 43,
elona_atlas = 0,
is_road = true
},
{
_id = "world_flower_1",
elona_id = 66,
elona_atlas = 0,
},
{
_id = "world_flower_2",
elona_id = 67,
elona_atlas = 0,
},
{
_id = "world_flower_3",
elona_id = 68,
elona_atlas = 0,
},
{
_id = "world_flower_4",
elona_id = 69,
elona_atlas = 0,
},
{
_id = "world_flower_5",
elona_id = 70,
elona_atlas = 0,
},
{
_id = "world_flower_6",
elona_id = 71,
elona_atlas = 0,
},
{
_id = "world_flower_7",
elona_id = 72,
elona_atlas = 0,
},
{
_id = "world_mounds_1",
elona_id = 73,
elona_atlas = 0,
},
{
_id = "world_mounds_2",
elona_id = 74,
elona_atlas = 0,
},
{
_id = "world_bridge_left",
elona_id = 77,
elona_atlas = 0,
},
{
_id = "world_bridge_middle",
elona_id = 78,
elona_atlas = 0,
},
{
_id = "world_bridge_right",
elona_id = 79,
elona_atlas = 0,
},
{
_id = "world_desert",
elona_id = 99,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_trees_1",
elona_id = 100,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_trees_2",
elona_id = 101,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_trees_3",
elona_id = 102,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_trees_4",
elona_id = 103,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_dead_trees_1",
elona_id = 104,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_dead_trees_2",
elona_id = 105,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_dead_trees_3",
elona_id = 106,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_border_w",
elona_id = 107,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand,
kind2 = TileRole.Coast
},
{
_id = "world_desert_border_s",
elona_id = 110,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand,
kind2 = TileRole.Coast
},
{
_id = "world_desert_border_sw",
elona_id = 114,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand,
kind2 = TileRole.Coast
},
{
_id = "world_desert_border_corner_ne",
elona_id = 115,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand,
kind2 = TileRole.Coast
},
{
_id = "world_desert_bones",
elona_id = 119,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_rocks_1",
elona_id = 120,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_rocks_2",
elona_id = 121,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_rocks_3",
elona_id = 122,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_rocks_4",
elona_id = 123,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_plants_1",
elona_id = 124,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_plants_2",
elona_id = 125,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_desert_plants_3",
elona_id = 126,
elona_atlas = 0,
is_feat = true,
kind = TileRole.Sand
},
{
_id = "world_dirt",
elona_id = 165,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_crater",
elona_id = 166,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_rocks_1",
elona_id = 167,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_rocks_2",
elona_id = 168,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_dead_trees_1",
elona_id = 170,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_dead_trees_2",
elona_id = 171,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_dead_trees_3",
elona_id = 172,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_border_w",
elona_id = 173,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_e",
elona_id = 174,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_n",
elona_id = 175,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_s",
elona_id = 176,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_corner_ne",
elona_id = 177,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_corner_nw",
elona_id = 178,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_corner_se",
elona_id = 179,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_corner_sw",
elona_id = 180,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_ne",
elona_id = 181,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_nw",
elona_id = 182,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_se",
elona_id = 183,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_dirt_border_sw",
elona_id = 184,
elona_atlas = 0,
kind = TileRole.SandHard,
kind2 = TileRole.Coast
},
{
_id = "world_snow_dead_tree",
elona_id = 199,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_trees_3",
elona_id = 200,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_trees_4",
elona_id = 201,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_trees_5",
elona_id = 202,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_w",
elona_id = 206,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_e",
elona_id = 207,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_n",
elona_id = 208,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_s",
elona_id = 209,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_corner_ne",
elona_id = 210,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_corner_nw",
elona_id = 211,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_corner_se",
elona_id = 212,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_corner_sw",
elona_id = 213,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_ne",
elona_id = 214,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_nw",
elona_id = 215,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_se",
elona_id = 216,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_snow_border_sw",
elona_id = 217,
elona_atlas = 0,
kind = TileRole.Snow,
kind2 = TileRole.Coast,
field_type = "elona.snow_field",
},
{
_id = "world_water",
is_solid = true,
is_opaque = false,
elona_id = 264,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_rocks",
is_solid = true,
is_opaque = false,
elona_id = 265,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_2",
is_solid = true,
is_opaque = false,
elona_id = 266,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_pole",
is_solid = true,
is_opaque = false,
elona_id = 267,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_iceberg",
is_solid = true,
is_opaque = false,
elona_id = 268,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_rock",
is_solid = true,
is_opaque = false,
elona_id = 269,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_water_shadow",
is_solid = true,
is_opaque = false,
elona_id = 270,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_w",
is_solid = true,
is_opaque = false,
elona_id = 285,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_e",
is_solid = true,
is_opaque = false,
elona_id = 286,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_n",
is_solid = true,
is_opaque = false,
elona_id = 287,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_s",
is_solid = true,
is_opaque = false,
elona_id = 288,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_corner_ne",
is_solid = true,
is_opaque = false,
elona_id = 289,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_corner_nw",
is_solid = true,
is_opaque = false,
elona_id = 290,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_corner_se",
is_solid = true,
is_opaque = false,
elona_id = 291,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_corner_sw",
is_solid = true,
is_opaque = false,
elona_id = 292,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_ne",
is_solid = true,
is_opaque = false,
elona_id = 293,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_nw",
is_solid = true,
is_opaque = false,
elona_id = 294,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_se",
is_solid = true,
is_opaque = false,
elona_id = 295,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_grass_water_border_sw",
is_solid = true,
is_opaque = false,
elona_id = 296,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_w",
elona_id = 297,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_e",
elona_id = 298,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_n",
elona_id = 299,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_s",
elona_id = 300,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_corner_ne",
elona_id = 301,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_corner_nw",
elona_id = 302,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_corner_se",
elona_id = 303,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_corner_sw",
elona_id = 304,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_ne",
elona_id = 305,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_nw",
elona_id = 306,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_se",
elona_id = 307,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_snow_water_border_sw",
elona_id = 308,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_w",
elona_id = 309,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_e",
elona_id = 310,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_n",
elona_id = 311,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_s",
elona_id = 312,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_corner_ne",
elona_id = 313,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_corner_nw",
elona_id = 314,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_corner_se",
elona_id = 315,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_corner_sw",
elona_id = 316,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_ne",
elona_id = 317,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_nw",
elona_id = 318,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_se",
elona_id = 319,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_desert_water_border_sw",
elona_id = 320,
elona_atlas = 0,
field_type = "elona.sea",
},
{
_id = "world_cliff_nw",
is_solid = true,
is_opaque = true,
elona_id = 462,
elona_atlas = 0,
},
{
_id = "world_cliff_n",
is_solid = true,
is_opaque = true,
elona_id = 463,
elona_atlas = 0,
},
{
_id = "world_cliff_ne",
is_solid = true,
is_opaque = true,
elona_id = 464,
elona_atlas = 0,
},
{
_id = "world_cliff_w",
is_solid = true,
is_opaque = true,
elona_id = 495,
elona_atlas = 0,
},
{
_id = "world_cliff_e",
is_solid = true,
is_opaque = true,
elona_id = 497,
elona_atlas = 0,
},
{
_id = "world_cliff_inner_sw",
is_solid = true,
is_opaque = true,
elona_id = 498,
elona_atlas = 0,
},
{
_id = "world_cliff_inner_se",
is_solid = true,
is_opaque = true,
elona_id = 500,
elona_atlas = 0,
},
{
_id = "world_blank",
is_solid = true,
is_opaque = true,
elona_id = 528,
elona_atlas = 0,
},
{
_id = "world_cliff_sw",
is_solid = true,
is_opaque = true,
elona_id = 529,
elona_atlas = 0,
},
{
_id = "world_cliff_s",
is_solid = true,
is_opaque = true,
elona_id = 530,
elona_atlas = 0,
},
{
_id = "world_cliff_se",
is_solid = true,
is_opaque = true,
elona_id = 531,
elona_atlas = 0,
},
{
_id = "world_cliff_top_5",
is_solid = true,
is_opaque = true,
elona_id = 533,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_1",
is_solid = true,
is_opaque = true,
elona_id = 561,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_2",
is_solid = true,
is_opaque = true,
elona_id = 562,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_3",
is_solid = true,
is_opaque = true,
elona_id = 564,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_4",
is_solid = true,
is_opaque = true,
elona_id = 565,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_5",
is_solid = true,
is_opaque = true,
elona_id = 566,
elona_atlas = 0,
},
{
_id = "world_grass_mountain_6",
is_solid = true,
is_opaque = true,
elona_id = 567,
elona_atlas = 0,
},
{
_id = "world_snow_mountain_1",
is_solid = true,
is_opaque = true,
elona_id = 568,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_mountain_2",
is_solid = true,
is_opaque = true,
elona_id = 569,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_snow_mountain_3",
is_solid = true,
is_opaque = true,
elona_id = 570,
elona_atlas = 0,
kind = TileRole.Snow,
field_type = "elona.snow_field",
},
{
_id = "world_desert_mountain_1",
is_solid = true,
is_opaque = true,
elona_id = 594,
elona_atlas = 0,
kind = TileRole.Sand
},
{
_id = "world_desert_mountain_2",
is_solid = true,
is_opaque = true,
elona_id = 595,
elona_atlas = 0,
kind = TileRole.Sand
},
{
_id = "world_desert_mountain_3",
is_solid = true,
is_opaque = true,
elona_id = 596,
elona_atlas = 0,
kind = TileRole.Sand
},
{
_id = "world_desert_mountain_4",
is_solid = true,
is_opaque = true,
elona_id = 597,
elona_atlas = 0,
kind = TileRole.Sand
},
{
_id = "world_desert_mountain_5",
is_solid = true,
is_opaque = true,
elona_id = 598,
elona_atlas = 0,
kind = TileRole.Sand
},
{
_id = "world_dirt_mountain_1",
is_solid = true,
is_opaque = true,
elona_id = 599,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_dirt_mountain_2",
is_solid = true,
is_opaque = true,
elona_id = 600,
elona_atlas = 0,
kind = TileRole.SandHard
},
{
_id = "world_oasis_c",
is_solid = true,
is_opaque = true,
elona_id = 604,
elona_atlas = 0,
kind = TileRole.SandWater
},
{
_id = "world_oasis_e",
is_solid = true,
is_opaque = true,
elona_id = 605,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_w",
is_solid = true,
is_opaque = true,
elona_id = 606,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_s",
is_solid = true,
is_opaque = true,
elona_id = 607,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_n",
is_solid = true,
is_opaque = true,
elona_id = 608,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_corner_sw",
is_solid = true,
is_opaque = true,
elona_id = 609,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_corner_se",
is_solid = true,
is_opaque = true,
elona_id = 610,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_corner_ne",
is_solid = true,
is_opaque = true,
elona_id = 611,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_corner_nw",
is_solid = true,
is_opaque = true,
elona_id = 612,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_ne",
is_solid = true,
is_opaque = true,
elona_id = 613,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_nw",
is_solid = true,
is_opaque = true,
elona_id = 614,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_se",
is_solid = true,
is_opaque = true,
elona_id = 615,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "world_oasis_sw",
is_solid = true,
is_opaque = true,
elona_id = 616,
elona_atlas = 0,
kind = TileRole.SandWater,
kind2 = TileRole.Coast
},
{
_id = "grass",
elona_id = 0,
elona_atlas = 1,
},
{
_id = "grass_violets",
elona_id = 1,
elona_atlas = 1,
},
{
_id = "grass_rocks",
elona_id = 2,
elona_atlas = 1,
},
{
_id = "grass_tall_1",
elona_id = 3,
elona_atlas = 1,
},
{
_id = "grass_tall_2",
elona_id = 4,
elona_atlas = 1,
},
{
_id = "grass_patch_1",
elona_id = 5,
elona_atlas = 1,
},
{
_id = "grass_patch_2",
elona_id = 6,
elona_atlas = 1,
},
{
_id = "grass_bush_1",
elona_id = 7,
elona_atlas = 1,
},
{
_id = "grass_bush_2",
elona_id = 8,
elona_atlas = 1,
},
{
_id = "grass_bush_3",
elona_id = 9,
elona_atlas = 1,
},
{
_id = "grass_patch_3",
elona_id = 10,
elona_atlas = 1,
},
{
_id = "grass_rocks_2",
elona_id = 11,
elona_atlas = 1,
},
{
_id = "cracked_dirt_1",
elona_id = 12,
elona_atlas = 1,
},
{
_id = "cracked_dirt_2",
elona_id = 13,
elona_atlas = 1,
},
{
_id = "room_default",
elona_id = 14,
elona_atlas = 1,
},
{
_id = "desert_rocks_1",
elona_id = 16,
elona_atlas = 1,
},
{
_id = "desert_rocks_2",
elona_id = 17,
elona_atlas = 1,
},
{
_id = "desert_rocks_3",
elona_id = 18,
elona_atlas = 1,
},
{
_id = "desert",
elona_id = 19,
elona_atlas = 1,
},
{
_id = "desert_flowers_1",
elona_id = 20,
elona_atlas = 1,
},
{
_id = "desert_flowers_2",
elona_id = 21,
elona_atlas = 1,
},
{
_id = "dryground",
elona_id = 29,
elona_atlas = 1,
kind = TileRole.Dryground,
show_name = true
},
{
_id = "field_1",
elona_id = 30,
elona_atlas = 1,
kind = TileRole.Crop,
show_name = true
},
{
_id = "field_2",
elona_id = 31,
elona_atlas = 1,
kind = TileRole.Crop,
show_name = true
},
{
_id = "dark_dirt_1",
elona_id = 33,
elona_atlas = 1,
},
{
_id = "dark_dirt_2",
elona_id = 34,
elona_atlas = 1,
},
{
_id = "dark_dirt_3",
elona_id = 35,
elona_atlas = 1,
},
{
_id = "dark_dirt_4",
elona_id = 36,
elona_atlas = 1,
},
{
_id = "destroyed",
elona_id = 37,
elona_atlas = 1,
},
{
_id = "dirt_patch",
elona_id = 38,
elona_atlas = 1,
},
{
_id = "dirt_grass",
elona_id = 39,
elona_atlas = 1,
},
{
_id = "dirt_rocks",
elona_id = 40,
elona_atlas = 1,
},
{
_id = "dirt",
elona_id = 41,
elona_atlas = 1,
},
{
_id = "snow",
elona_id = 45,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_mound",
elona_id = 46,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_plants",
elona_id = 47,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_rock",
elona_id = 48,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_stump",
elona_id = 49,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_flowers_1",
elona_id = 50,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_flowers_2",
elona_id = 51,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_flowers_3",
elona_id = 52,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_field_1",
elona_id = 53,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_field_2",
elona_id = 54,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_ice",
elona_id = 55,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_clumps_1",
elona_id = 56,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_clumps_2",
elona_id = 57,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_stalks",
elona_id = 58,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_grass",
elona_id = 59,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_blue_tile",
elona_id = 60,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_cobble_1",
elona_id = 61,
elona_atlas = 1,
},
{
_id = "snow_cobble_2",
elona_id = 62,
elona_atlas = 1,
},
{
_id = "snow_cobble_3",
elona_id = 63,
elona_atlas = 1,
},
{
_id = "snow_cobble_4",
elona_id = 64,
elona_atlas = 1,
},
{
_id = "snow_stairs",
elona_id = 65,
elona_atlas = 1,
},
{
_id = "tower_of_fire_tile_1",
elona_id = 66,
elona_atlas = 1,
},
{
_id = "tower_of_fire_tile_2",
elona_id = 67,
elona_atlas = 1,
},
{
_id = "tower_of_fire_tile_3",
elona_id = 68,
elona_atlas = 1,
},
{
_id = "ballroom_room_floor",
elona_id = 69,
elona_atlas = 1,
},
{
_id = "hardwood_floor_1",
elona_id = 70,
elona_atlas = 1,
},
{
_id = "hardwood_floor_2",
elona_id = 71,
elona_atlas = 1,
},
{
_id = "hardwood_floor_3",
elona_id = 72,
elona_atlas = 1,
},
{
_id = "hardwood_floor_4",
elona_id = 73,
elona_atlas = 1,
},
{
_id = "hardwood_floor_5",
elona_id = 74,
elona_atlas = 1,
},
{
_id = "hardwood_floor_6",
elona_id = 75,
elona_atlas = 1,
},
{
_id = "metal_plating_rusted",
elona_id = 76,
elona_atlas = 1,
},
{
_id = "thatching",
elona_id = 77,
elona_atlas = 1,
},
{
_id = "cobble",
elona_id = 78,
elona_atlas = 1,
},
{
_id = "cobble_2",
elona_id = 81,
elona_atlas = 1,
},
{
_id = "snow_flowers_4",
elona_id = 82,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_flowers_5",
elona_id = 83,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_flowers_6",
elona_id = 84,
elona_atlas = 1,
kind = TileRole.Snow
},
{
_id = "snow_bushes_1",
elona_id = 85,
elona_atlas = 1,
},
{
_id = "snow_bushes_2",
elona_id = 86,
elona_atlas = 1,
},
{
_id = "snow_bushes_3",
elona_id = 87,
elona_atlas = 1,
},
{
_id = "snow_bush",
elona_id = 88,
elona_atlas = 1,
},
{
_id = "snow_boulder",
elona_id = 89,
elona_atlas = 1,
},
{
_id = "snow_pillar",
elona_id = 98,
elona_atlas = 1,
},
{
_id = "cobble_3",
elona_id = 99,
elona_atlas = 1,
},
{
_id = "concrete_2",
elona_id = 100,
elona_atlas = 1,
},
{
_id = "flooring_1",
elona_id = 101,
elona_atlas = 1,
},
{
_id = "flooring_2",
elona_id = 102,
elona_atlas = 1,
},
{
_id = "cobble_4",
elona_id = 103,
elona_atlas = 1,
},
{
_id = "cobble_6",
elona_id = 105,
elona_atlas = 1,
},
{
_id = "cobble_9",
elona_id = 109,
elona_atlas = 1,
},
{
_id = "cobble_10",
elona_id = 110,
elona_atlas = 1,
},
{
_id = "cobble_11",
elona_id = 111,
elona_atlas = 1,
},
{
_id = "cobble_12",
elona_id = 112,
elona_atlas = 1,
},
{
_id = "cobble_diagonal",
elona_id = 113,
elona_atlas = 1,
},
{
_id = "cobble_diagonal_round",
elona_id = 114,
elona_atlas = 1,
},
{
_id = "cobble_diagonal_raised",
elona_id = 115,
elona_atlas = 1,
},
{
_id = "hardwood_floor_7",
elona_id = 118,
elona_atlas = 1,
},
{
_id = "cobble_dark_1",
elona_id = 119,
elona_atlas = 1,
},
{
_id = "cobble_dark_2",
elona_id = 120,
elona_atlas = 1,
},
{
_id = "cobble_dark_3",
elona_id = 121,
elona_atlas = 1,
},
{
_id = "cobble_dark_4",
elona_id = 122,
elona_atlas = 1,
},
{
_id = "rough_1",
elona_id = 123,
elona_atlas = 1,
},
{
_id = "rough_4",
elona_id = 126,
elona_atlas = 1,
},
{
_id = "rough_6",
elona_id = 128,
elona_atlas = 1,
},
{
_id = "rough_7",
elona_id = 129,
elona_atlas = 1,
},
{
_id = "rough_8",
elona_id = 130,
elona_atlas = 1,
},
{
_id = "rough_9",
elona_id = 131,
elona_atlas = 1,
},
{
_id = "tile_1",
elona_id = 132,
elona_atlas = 1,
},
{
_id = "tile_2",
elona_id = 133,
elona_atlas = 1,
},
{
_id = "tile_3",
elona_id = 134,
elona_atlas = 1,
},
{
_id = "brick_1",
elona_id = 135,
elona_atlas = 1,
},
{
_id = "brick_2",
elona_id = 136,
elona_atlas = 1,
},
{
_id = "cobble_caution",
elona_id = 137,
elona_atlas = 1,
},
{
_id = "concrete_4",
elona_id = 138,
elona_atlas = 1,
},
{
_id = "concrete_tiled",
elona_id = 139,
elona_atlas = 1,
},
{
_id = "shop_platform",
elona_id = 140,
elona_atlas = 1,
},
{
_id = "metal_dark",
elona_id = 141,
elona_atlas = 1,
},
{
_id = "cobble_wall_roof",
elona_id = 144,
elona_atlas = 1,
},
{
_id = "carpet_1",
elona_id = 146,
elona_atlas = 1,
},
{
_id = "hardwood_bordered",
elona_id = 147,
elona_atlas = 1,
},
{
_id = "tatami_1",
elona_id = 148,
elona_atlas = 1,
},
{
_id = "tatami_2",
elona_id = 149,
elona_atlas = 1,
},
{
_id = "cyber_1",
elona_id = 150,
elona_atlas = 1,
},
{
_id = "cyber_2",
elona_id = 151,
elona_atlas = 1,
},
{
_id = "cyber_3",
elona_id = 152,
elona_atlas = 1,
},
{
_id = "cyber_4",
elona_id = 153,
elona_atlas = 1,
},
{
_id = "carpet_nw",
elona_id = 156,
elona_atlas = 1,
},
{
_id = "carpet_n",
elona_id = 157,
elona_atlas = 1,
},
{
_id = "carpet_ne",
elona_id = 158,
elona_atlas = 1,
},
{
_id = "carpet_sw",
elona_id = 159,
elona_atlas = 1,
},
{
_id = "carpet_s",
elona_id = 160,
elona_atlas = 1,
},
{
_id = "carpet_se",
elona_id = 161,
elona_atlas = 1,
},
{
_id = "rough_11",
elona_id = 163,
elona_atlas = 1,
},
{
_id = "rough_12",
elona_id = 164,
elona_atlas = 1,
},
{
_id = "anime_water_shallow",
elona_id = 165,
elona_atlas = 1,
count_x = 3,
kind = TileRole.Water
},
{
_id = "anime_water_sea",
anime_frame = 3,
elona_id = 168,
elona_atlas = 1,
count_x = 3,
kind = TileRole.Water
},
{
_id = "anime_water_hot_spring",
anime_frame = 3,
elona_id = 171,
elona_atlas = 1,
count_x = 3,
kind = TileRole.Water,
kind2 = TileRole.MountainWater
},
{
_id = "cobble_wall_top",
elona_id = 177,
elona_atlas = 1,
},
{
_id = "ice_tiled_1",
elona_id = 179,
elona_atlas = 1,
},
{
_id = "ice_tiled_2",
elona_id = 180,
elona_atlas = 1,
},
{
_id = "ice_tiled_4",
elona_id = 183,
elona_atlas = 1,
},
{
_id = "ice_stairs_2",
elona_id = 186,
elona_atlas = 1,
},
{
_id = "bridge_we",
elona_id = 188,
elona_atlas = 1,
},
{
_id = "red_stairs",
elona_id = 189,
elona_atlas = 1,
},
{
_id = "cobble_stairs",
elona_id = 190,
elona_atlas = 1,
},
{
_id = "bridge_ns",
elona_id = 192,
elona_atlas = 1,
},
{
_id = "cobble_raised_2",
elona_id = 193,
elona_atlas = 1,
},
{
_id = "cobble_raised_3",
elona_id = 196,
elona_atlas = 1,
},
{
_id = "church_floor",
elona_id = 198,
elona_atlas = 1,
},
{
_id = "church_symbol",
elona_id = 199,
elona_atlas = 1,
},
{
_id = "carpet_red",
elona_id = 201,
elona_atlas = 1,
},
{
_id = "tiled",
elona_id = 202,
elona_atlas = 1,
},
{
_id = "carpet_green",
elona_id = 203,
elona_atlas = 1,
},
{
_id = "carpet_blue",
elona_id = 204,
elona_atlas = 1,
},
{
_id = "wood_floor_1",
elona_id = 205,
elona_atlas = 1,
},
{
_id = "wood_floor_2",
elona_id = 206,
elona_atlas = 1,
},
{
_id = "wood_floor_4",
elona_id = 208,
elona_atlas = 1,
},
{
_id = "wood_stair",
elona_id = 209,
elona_atlas = 1,
},
{
_id = "cobble_wall_bottom",
elona_id = 210,
elona_atlas = 1,
},
{
_id = "marble",
elona_id = 211,
elona_atlas = 1,
},
{
_id = "tiled_2",
elona_id = 212,
elona_atlas = 1,
},
{
_id = "grey_floor",
elona_id = 213,
elona_atlas = 1,
},
{
_id = "stair",
elona_id = 214,
elona_atlas = 1,
},
{
_id = "cobble_stairs_2",
elona_id = 216,
elona_atlas = 1,
},
{
_id = "wood_floor_5",
elona_id = 218,
elona_atlas = 1,
},
{
_id = "wood_floor_6",
elona_id = 219,
elona_atlas = 1,
},
{
_id = "wood_floor_8",
elona_id = 221,
elona_atlas = 1,
},
{
_id = "red_floor",
elona_id = 222,
elona_atlas = 1,
},
{
_id = "black_floor",
elona_id = 223,
elona_atlas = 1,
},
{
_id = "wood_floor_9",
elona_id = 224,
elona_atlas = 1,
},
{
_id = "carpet_2",
elona_id = 225,
elona_atlas = 1,
},
{
_id = "carpet_4",
elona_id = 228,
elona_atlas = 1,
},
{
_id = "carpet_5",
elona_id = 229,
elona_atlas = 1,
},
{
_id = "green_floor",
elona_id = 230,
elona_atlas = 1,
},
{
_id = "light_grass_1",
elona_id = 330,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_2",
elona_id = 331,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_3",
elona_id = 332,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_bush_1",
elona_id = 333,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_bush_2",
elona_id = 334,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_plants",
elona_id = 335,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_patch",
elona_id = 336,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_shrubs",
elona_id = 337,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_bushes",
elona_id = 338,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cliff_sw",
elona_id = 339,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cliff_s",
elona_id = 340,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cliff_se",
elona_id = 341,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_flowers",
elona_id = 342,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_dirt",
elona_id = 343,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cobble_1",
elona_id = 346,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cobble_2",
elona_id = 347,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cobble_3",
elona_id = 348,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_cobble_4",
elona_id = 349,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_wheel",
elona_id = 359,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_railroad_tracks_ns",
elona_id = 360,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_railroad_tracks_we",
elona_id = 361,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_boulder",
elona_id = 362,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "wall_oriental_top",
is_solid = true,
is_opaque = true,
elona_id = 396,
elona_atlas = 1,
wall = "elona.wall_oriental_bottom",
wall_kind = 2
},
{
_id = "wall_brick_top",
is_solid = true,
is_opaque = true,
elona_id = 397,
elona_atlas = 1,
wall = "elona.wall_brick_bottom",
wall_kind = 2
},
{
_id = "wall_regal_top",
is_solid = true,
is_opaque = true,
elona_id = 398,
elona_atlas = 1,
wall = "elona.wall_regal_bottom",
wall_kind = 2
},
{
_id = "wall_pillar_top",
is_solid = true,
is_opaque = true,
elona_id = 399,
elona_atlas = 1,
wall = "elona.wall_pillar_bottom",
wall_kind = 2
},
{
_id = "wall_log_top",
is_solid = true,
is_opaque = true,
elona_id = 400,
elona_atlas = 1,
wall = "elona.wall_log_bottom",
wall_kind = 2
},
{
_id = "wall_wood_top",
is_solid = true,
is_opaque = true,
elona_id = 401,
elona_atlas = 1,
wall = "elona.wall_wood_bottom",
wall_kind = 2
},
{
_id = "wall_plank_top",
is_solid = true,
is_opaque = true,
elona_id = 402,
elona_atlas = 1,
wall = "elona.wall_plank_bottom",
wall_kind = 2
},
{
_id = "wall_shingle_top",
is_solid = true,
is_opaque = true,
elona_id = 403,
elona_atlas = 1,
wall = "elona.wall_shingle_bottom",
wall_kind = 2
},
{
_id = "wall_smooth_top",
is_solid = true,
is_opaque = true,
elona_id = 404,
elona_atlas = 1,
wall = "elona.wall_smooth_bottom",
wall_kind = 2
},
{
_id = "wall_curtain_top",
is_solid = true,
is_opaque = true,
elona_id = 405,
elona_atlas = 1,
wall = "elona.wall_curtain_bottom",
wall_kind = 2
},
{
_id = "wall_moss_top",
is_solid = true,
is_opaque = true,
elona_id = 406,
elona_atlas = 1,
wall = "elona.wall_moss_bottom",
wall_kind = 2
},
{
_id = "wall_crypt_top",
is_solid = true,
is_opaque = true,
elona_id = 407,
elona_atlas = 1,
wall = "elona.wall_crypt_bottom",
wall_kind = 2
},
{
_id = "wall_ice_1_top",
is_solid = true,
is_opaque = true,
elona_id = 408,
elona_atlas = 1,
wall = "elona.wall_ice_1_bottom",
wall_kind = 2
},
{
_id = "wall_ice_2_top",
is_solid = true,
is_opaque = true,
elona_id = 409,
elona_atlas = 1,
wall = "elona.wall_ice_2_bottom",
wall_kind = 2
},
{
_id = "wall_ice_3_top",
is_solid = true,
is_opaque = true,
elona_id = 410,
elona_atlas = 1,
wall = "elona.wall_ice_3_bottom",
wall_kind = 2
},
{
_id = "wall_snow_1_top",
is_solid = true,
is_opaque = true,
elona_id = 411,
elona_atlas = 1,
wall = "elona.wall_snow_1_bottom",
wall_kind = 2
},
{
_id = "wall_snow_2_top",
is_solid = true,
is_opaque = true,
elona_id = 412,
elona_atlas = 1,
wall = "elona.wall_snow_2_bottom",
wall_kind = 2
},
{
_id = "wall_snow_3_top",
is_solid = true,
is_opaque = true,
elona_id = 413,
elona_atlas = 1,
wall = "elona.wall_snow_3_bottom",
wall_kind = 2
},
{
_id = "wall_oriental_bottom",
is_solid = true,
is_opaque = true,
elona_id = 429,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_brick_bottom",
is_solid = true,
is_opaque = true,
elona_id = 430,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_regal_bottom",
is_solid = true,
is_opaque = true,
elona_id = 431,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_pillar_bottom",
is_solid = true,
is_opaque = true,
elona_id = 432,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_log_bottom",
is_solid = true,
is_opaque = true,
elona_id = 433,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_wood_bottom",
is_solid = true,
is_opaque = true,
elona_id = 434,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_plank_bottom",
is_solid = true,
is_opaque = true,
elona_id = 435,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_shingle_bottom",
is_solid = true,
is_opaque = true,
elona_id = 436,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_smooth_bottom",
is_solid = true,
is_opaque = true,
elona_id = 437,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_curtain_bottom",
is_solid = true,
is_opaque = true,
elona_id = 438,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_moss_bottom",
is_solid = true,
is_opaque = true,
elona_id = 439,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_crypt_bottom",
is_solid = true,
is_opaque = true,
elona_id = 440,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_ice_1_bottom",
is_solid = true,
is_opaque = true,
elona_id = 441,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_ice_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 442,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_ice_3_bottom",
is_solid = true,
is_opaque = true,
elona_id = 443,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_snow_1_bottom",
is_solid = true,
is_opaque = true,
elona_id = 444,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_snow_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 445,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_snow_3_bottom",
is_solid = true,
is_opaque = true,
elona_id = 446,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_1_top",
is_solid = true,
is_opaque = true,
elona_id = 462,
elona_atlas = 1,
wall = "elona.wall_stone_1_bottom",
wall_kind = 2
},
{
_id = "wall_stone_2_top",
is_solid = true,
is_opaque = true,
elona_id = 463,
elona_atlas = 1,
wall = "elona.wall_stone_2_bottom",
wall_kind = 2
},
{
_id = "wall_stone_3_top",
is_solid = true,
is_opaque = true,
elona_id = 464,
elona_atlas = 1,
kind = TileRole.HardWall,
wall = "elona.wall_stone_3_bottom",
wall_kind = 2,
mining_difficulty = 12000,
mining_difficulty_coefficient = 30
},
{
_id = "wall_stone_4_top",
is_solid = true,
is_opaque = true,
elona_id = 465,
elona_atlas = 1,
wall = "elona.wall_stone_4_bottom",
wall_kind = 2
},
{
_id = "wall_stone_5_top",
is_solid = true,
is_opaque = true,
elona_id = 466,
elona_atlas = 1,
wall = "elona.wall_stone_5_bottom",
wall_kind = 2
},
{
_id = "wall_wooden_top",
is_solid = true,
is_opaque = true,
elona_id = 467,
elona_atlas = 1,
wall = "elona.wall_wooden_bottom",
wall_kind = 2
},
{
_id = "wall_dirt_top",
is_solid = true,
is_opaque = true,
elona_id = 468,
elona_atlas = 1,
wall = "elona.wall_dirt_bottom",
wall_kind = 2
},
{
_id = "wall_dirt_dark_top",
is_solid = true,
is_opaque = true,
elona_id = 469,
elona_atlas = 1,
wall = "elona.wall_dirt_dark_bottom",
wall_kind = 2
},
{
_id = "wall_pyramid_top",
is_solid = true,
is_opaque = true,
elona_id = 470,
elona_atlas = 1,
wall = "elona.wall_pyramid_bottom",
wall_kind = 2
},
{
_id = "wall_shingled_top",
is_solid = true,
is_opaque = true,
elona_id = 471,
elona_atlas = 1,
wall = "elona.wall_shingled_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_top",
is_solid = true,
is_opaque = true,
elona_id = 472,
elona_atlas = 1,
wall = "elona.wall_concrete_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_light_top",
is_solid = true,
is_opaque = true,
elona_id = 473,
elona_atlas = 1,
wall = "elona.wall_concrete_light_bottom",
wall_kind = 2
},
{
_id = "wall_tower_of_fire_top",
is_solid = true,
is_opaque = true,
elona_id = 474,
elona_atlas = 1,
wall = "elona.wall_tower_of_fire_bottom",
wall_kind = 2
},
{
_id = "wall_forest_top",
is_solid = true,
is_opaque = true,
elona_id = 475,
elona_atlas = 1,
wall = "elona.wall_forest_bottom",
wall_kind = 2
},
{
_id = "wall_stone_6_top",
is_solid = true,
is_opaque = true,
elona_id = 476,
elona_atlas = 1,
wall = "elona.wall_stone_6_bottom",
wall_kind = 2
},
{
_id = "wall_stone_7_top",
is_solid = true,
is_opaque = true,
elona_id = 477,
elona_atlas = 1,
wall = "elona.wall_stone_7_bottom",
wall_kind = 2
},
{
_id = "wall_stone_8_top",
is_solid = true,
is_opaque = true,
elona_id = 478,
elona_atlas = 1,
wall = "elona.wall_stone_8_bottom",
wall_kind = 2
},
{
_id = "wall_stone_9_top",
is_solid = true,
is_opaque = true,
elona_id = 479,
elona_atlas = 1,
wall = "elona.wall_stone_9_bottom",
wall_kind = 2
},
{
_id = "wall_stone_10_top",
is_solid = true,
is_opaque = true,
elona_id = 480,
elona_atlas = 1,
wall = "elona.wall_stone_10_bottom",
wall_kind = 2
},
{
_id = "wall_hay_top",
is_solid = true,
is_opaque = true,
elona_id = 481,
elona_atlas = 1,
wall = "elona.wall_hay_bottom",
wall_kind = 2
},
{
_id = "wall_decor_top",
is_solid = true,
is_opaque = true,
elona_id = 482,
elona_atlas = 1,
wall = "elona.wall_decor_bottom",
wall_kind = 2
},
{
_id = "wall_palace_1_top",
is_solid = true,
is_opaque = true,
elona_id = 483,
elona_atlas = 1,
wall = "elona.wall_palace_1_bottom",
wall_kind = 2
},
{
_id = "wall_palace_2_top",
is_solid = true,
is_opaque = true,
elona_id = 484,
elona_atlas = 1,
wall = "elona.wall_palace_2_bottom",
wall_kind = 2
},
{
_id = "wall_palace_3_top",
is_solid = true,
is_opaque = true,
elona_id = 485,
elona_atlas = 1,
wall = "elona.wall_palace_3_bottom",
wall_kind = 2
},
{
_id = "wall_stone_11_top",
is_solid = true,
is_opaque = true,
elona_id = 486,
elona_atlas = 1,
wall = "elona.wall_stone_11_bottom",
wall_kind = 2
},
{
_id = "wall_cyber_top",
is_solid = true,
is_opaque = true,
elona_id = 487,
elona_atlas = 1,
wall = "elona.wall_cyber_bottom",
wall_kind = 2
},
{
_id = "wall_stone_12_top",
is_solid = true,
is_opaque = true,
elona_id = 488,
elona_atlas = 1,
wall = "elona.wall_stone_12_bottom",
wall_kind = 2
},
{
_id = "wall_white_top",
is_solid = true,
is_opaque = true,
elona_id = 489,
elona_atlas = 1,
wall = "elona.wall_white_bottom",
wall_kind = 2
},
{
_id = "wall_decor_2_top",
is_solid = true,
is_opaque = true,
elona_id = 490,
elona_atlas = 1,
wall = "elona.wall_decor_2_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_2_top",
is_solid = true,
is_opaque = true,
elona_id = 491,
elona_atlas = 1,
wall = "elona.wall_concrete_2_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_3_top",
is_solid = true,
is_opaque = true,
elona_id = 492,
elona_atlas = 1,
wall = "elona.wall_concrete_3_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_dark_1_top",
is_solid = true,
is_opaque = true,
elona_id = 493,
elona_atlas = 1,
wall = "elona.wall_concrete_dark_1_bottom",
wall_kind = 2
},
{
_id = "wall_concrete_dark_2_top",
is_solid = true,
is_opaque = true,
elona_id = 494,
elona_atlas = 1,
wall = "elona.wall_concrete_dark_2_bottom",
wall_kind = 2
},
{
_id = "wall_stone_1_bottom",
is_solid = true,
is_opaque = true,
elona_id = 495,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 496,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_3_bottom",
is_solid = true,
is_opaque = true,
elona_id = 497,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_4_bottom",
is_solid = true,
is_opaque = true,
elona_id = 498,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_5_bottom",
is_solid = true,
is_opaque = true,
elona_id = 499,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_wooden_bottom",
is_solid = true,
is_opaque = true,
elona_id = 500,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_dirt_bottom",
is_solid = true,
is_opaque = true,
elona_id = 501,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_dirt_dark_bottom",
is_solid = true,
is_opaque = true,
elona_id = 502,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_pyramid_bottom",
is_solid = true,
is_opaque = true,
elona_id = 503,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_shingled_bottom",
is_solid = true,
is_opaque = true,
elona_id = 504,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_bottom",
is_solid = true,
is_opaque = true,
elona_id = 505,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_light_bottom",
is_solid = true,
is_opaque = true,
elona_id = 506,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_tower_of_fire_bottom",
is_solid = true,
is_opaque = true,
elona_id = 507,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_forest_bottom",
is_solid = true,
is_opaque = true,
elona_id = 508,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_6_bottom",
is_solid = true,
is_opaque = true,
elona_id = 509,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_7_bottom",
is_solid = true,
is_opaque = true,
elona_id = 510,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_8_bottom",
is_solid = true,
is_opaque = true,
elona_id = 511,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_9_bottom",
is_solid = true,
is_opaque = true,
elona_id = 512,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_10_bottom",
is_solid = true,
is_opaque = true,
elona_id = 513,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_hay_bottom",
is_solid = true,
is_opaque = true,
elona_id = 514,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_decor_bottom",
is_solid = true,
is_opaque = true,
elona_id = 515,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_palace_1_bottom",
is_solid = true,
is_opaque = true,
elona_id = 516,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_palace_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 517,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_palace_3_bottom",
is_solid = true,
is_opaque = true,
elona_id = 518,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_11_bottom",
is_solid = true,
is_opaque = true,
elona_id = 519,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_cyber_bottom",
is_solid = true,
is_opaque = true,
elona_id = 520,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_12_bottom",
is_solid = true,
is_opaque = true,
elona_id = 521,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_white_bottom",
is_solid = true,
is_opaque = true,
elona_id = 522,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_decor_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 523,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 524,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_3_bottom",
is_solid = true,
is_opaque = true,
elona_id = 525,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_dark_1_bottom",
is_solid = true,
is_opaque = true,
elona_id = 526,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_concrete_dark_2_bottom",
is_solid = true,
is_opaque = true,
elona_id = 527,
elona_atlas = 1,
wall_kind = 1
},
{
_id = "wall_stone_1_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 528,
disable_in_map_edit = true
},
{
_id = "wall_stone_2_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 529,
disable_in_map_edit = true
},
{
_id = "wall_stone_3_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 530,
disable_in_map_edit = true
},
{
_id = "wall_stone_4_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 531,
disable_in_map_edit = true
},
{
_id = "wall_stone_5_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 532,
disable_in_map_edit = true
},
{
_id = "wall_wooden_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 533,
disable_in_map_edit = true
},
{
_id = "wall_dirt_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 534,
disable_in_map_edit = true
},
{
_id = "wall_dirt_dark_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 535,
disable_in_map_edit = true
},
{
_id = "wall_pyramid_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 536,
disable_in_map_edit = true
},
{
_id = "wall_shingled_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 537,
disable_in_map_edit = true
},
{
_id = "wall_concrete_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 538,
disable_in_map_edit = true
},
{
_id = "wall_concrete_light_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 539,
disable_in_map_edit = true
},
{
_id = "wall_tower_of_fire_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 540,
disable_in_map_edit = true
},
{
_id = "wall_forest_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 541,
disable_in_map_edit = true
},
{
_id = "wall_stone_6_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 542,
disable_in_map_edit = true
},
{
_id = "wall_stone_7_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 543,
disable_in_map_edit = true
},
{
_id = "wall_stone_8_fog",
is_solid = true,
is_opaque = true,
elona_atlas = 1,
elona_id = 544,
disable_in_map_edit = true
},
{
_id = "stable_top",
is_solid = true,
is_opaque = true,
elona_id = 545,
elona_atlas = 1,
disable_in_map_edit = true
},
{
_id = "palace_fountain",
is_solid = true,
is_opaque = true,
elona_id = 550,
elona_atlas = 1,
count_x = 2,
wall_kind = 1,
disable_in_map_edit = true
},
{
_id = "light_grass_carts",
is_solid = true,
is_opaque = true,
elona_id = 564,
elona_atlas = 1,
},
{
_id = "light_grass_carts_gold",
is_solid = true,
is_opaque = true,
elona_id = 565,
elona_atlas = 1,
},
{
_id = "light_grass_carts_jewels",
is_solid = true,
is_opaque = true,
elona_id = 566,
elona_atlas = 1,
},
{
_id = "light_grass_carts_rocks",
is_solid = true,
is_opaque = true,
elona_id = 567,
elona_atlas = 1,
},
{
_id = "light_grass_rocks",
is_solid = true,
is_opaque = true,
elona_id = 568,
elona_atlas = 1,
},
{
_id = "light_grass_fencing_ns",
is_solid = true,
is_opaque = true,
elona_id = 572,
elona_atlas = 1,
},
{
_id = "light_grass_fencing_we",
is_solid = true,
is_opaque = true,
elona_id = 573,
elona_atlas = 1,
},
{
_id = "grass_fencing_ns",
is_solid = true,
is_opaque = true,
elona_id = 574,
elona_atlas = 1,
},
{
_id = "grass_fencing_we",
is_solid = true,
is_opaque = true,
elona_id = 575,
elona_atlas = 1,
},
{
_id = "stable_bottom",
is_solid = true,
is_opaque = true,
elona_id = 576,
elona_atlas = 1,
},
{
_id = "horse_bottom",
is_solid = true,
is_opaque = true,
elona_id = 577,
elona_atlas = 1,
},
{
_id = "water",
anime_frame = 3,
is_solid = true,
is_opaque = false,
elona_id = 594,
elona_atlas = 1,
count_x = 3,
kind = TileRole.Water
},
{
_id = "light_grass_box",
is_solid = true,
is_opaque = true,
elona_id = 627,
elona_atlas = 1,
},
{
_id = "water_wall_edge",
is_solid = true,
is_opaque = false,
elona_id = 628,
elona_atlas = 1,
},
{
_id = "cobble_diagonal_fish",
is_solid = true,
is_opaque = true,
elona_id = 629,
elona_atlas = 1,
},
{
_id = "cobble_diagonal_posts",
is_solid = true,
is_opaque = true,
elona_id = 630,
elona_atlas = 1,
},
{
_id = "crates_open",
is_solid = true,
is_opaque = true,
elona_id = 631,
elona_atlas = 1,
},
{
_id = "crates",
is_solid = true,
is_opaque = true,
elona_id = 632,
elona_atlas = 1,
},
{
_id = "wharf_crates_1",
is_solid = true,
is_opaque = true,
elona_id = 633,
elona_atlas = 1,
},
{
_id = "wharf_crates_2",
is_solid = true,
is_opaque = true,
elona_id = 634,
elona_atlas = 1,
},
{
_id = "cobble_diagonal_net",
is_solid = true,
is_opaque = true,
elona_id = 635,
elona_atlas = 1,
},
{
_id = "cobble_statue",
is_solid = true,
is_opaque = true,
elona_id = 636,
elona_atlas = 1,
},
{
_id = "water_wall_edge_grass",
is_solid = true,
is_opaque = false,
elona_id = 637,
elona_atlas = 1,
},
{
_id = "cobble_pillar",
is_solid = true,
is_opaque = true,
elona_id = 638,
elona_atlas = 1,
},
{
_id = "carpet_3_fish_boards",
is_solid = true,
is_opaque = true,
elona_id = 639,
elona_atlas = 1,
},
{
_id = "cobble_fence",
is_solid = true,
is_opaque = false,
elona_id = 641,
elona_atlas = 1,
},
{
_id = "sign_magic",
is_solid = true,
is_opaque = true,
elona_id = 646,
elona_atlas = 1,
},
{
_id = "sign_inn",
is_solid = true,
is_opaque = true,
elona_id = 647,
elona_atlas = 1,
},
{
_id = "sign_equip",
is_solid = true,
is_opaque = true,
elona_id = 648,
elona_atlas = 1,
},
{
_id = "sign_blacksmith",
is_solid = true,
is_opaque = true,
elona_id = 651,
elona_atlas = 1,
},
{
_id = "sign_general_vendor",
is_solid = true,
is_opaque = true,
elona_id = 652,
elona_atlas = 1,
},
{
_id = "sign_shield",
is_solid = true,
is_opaque = true,
elona_id = 654,
elona_atlas = 1,
},
{
_id = "sign_potion",
is_solid = true,
is_opaque = true,
elona_id = 655,
elona_atlas = 1,
},
{
_id = "sign_lamp",
is_solid = true,
is_opaque = true,
elona_id = 656,
elona_atlas = 1,
},
{
_id = "sign_bakery",
is_solid = true,
is_opaque = true,
elona_id = 657,
elona_atlas = 1,
},
{
_id = "sign_pub",
is_solid = true,
is_opaque = true,
elona_id = 658,
elona_atlas = 1,
},
{
_id = "sign_casino",
is_solid = true,
is_opaque = true,
elona_id = 659,
elona_atlas = 1,
},
{
_id = "stacked_wood",
is_solid = true,
is_opaque = true,
elona_id = 662,
elona_atlas = 1,
},
{
_id = "stacked_sacks",
is_solid = true,
is_opaque = true,
elona_id = 663,
elona_atlas = 1,
},
{
_id = "stacked_crates_green",
is_solid = true,
is_opaque = true,
elona_id = 664,
elona_atlas = 1,
},
{
_id = "stacked_crates",
is_solid = true,
is_opaque = true,
elona_id = 665,
elona_atlas = 1,
},
{
_id = "snow_large_mound",
is_solid = true,
is_opaque = true,
elona_id = 666,
elona_atlas = 1,
},
{
_id = "cobble_raised_4",
is_solid = true,
is_opaque = true,
elona_id = 667,
elona_atlas = 1,
},
{
_id = "snow_log",
is_solid = true,
is_opaque = true,
elona_id = 668,
elona_atlas = 1,
},
{
_id = "ice_wall_edge",
is_solid = true,
is_opaque = true,
elona_id = 669,
elona_atlas = 1,
},
{
_id = "boat_left",
is_solid = true,
is_opaque = true,
elona_id = 690,
elona_atlas = 1,
},
{
_id = "boat_right",
is_solid = true,
is_opaque = true,
elona_id = 691,
elona_atlas = 1,
},
{
_id = "onii_1",
elona_id = 22,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_2",
elona_id = 23,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_3",
elona_id = 24,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_4",
elona_id = 26,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_5",
elona_id = 27,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_6",
elona_id = 28,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_7",
elona_id = 29,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_8",
elona_id = 30,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_9",
elona_id = 31,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "snow_cracks_atlas2",
elona_id = 34,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "snow_grass_atlas2",
elona_id = 36,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "snow_pillar_atlas2",
elona_id = 44,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "snow_plants_atlas2",
elona_id = 51,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_10",
elona_id = 53,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_11",
elona_id = 54,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_12",
elona_id = 55,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_13",
elona_id = 56,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_14",
elona_id = 57,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_15",
elona_id = 58,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_16",
elona_id = 60,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_17",
elona_id = 61,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_18",
elona_id = 62,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_19",
elona_id = 63,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_20",
elona_id = 64,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_21",
elona_id = 65,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_22",
elona_id = 86,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_23",
elona_id = 87,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_24",
elona_id = 88,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_25",
elona_id = 89,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_26",
elona_id = 90,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_27",
elona_id = 91,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_28",
elona_id = 92,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_29",
elona_id = 93,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_30",
elona_id = 94,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_31",
elona_id = 95,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_32",
elona_id = 96,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_33",
elona_id = 97,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_34",
elona_id = 98,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_35",
elona_id = 119,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_36",
elona_id = 120,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_37",
elona_id = 121,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_38",
elona_id = 122,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_39",
elona_id = 123,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_40",
elona_id = 124,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_41",
elona_id = 125,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_42",
elona_id = 126,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_43",
elona_id = 127,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_44",
elona_id = 128,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_45",
elona_id = 129,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_46",
elona_id = 130,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_47",
elona_id = 131,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_48",
elona_id = 152,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_49",
elona_id = 153,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_50",
elona_id = 154,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_51",
elona_id = 155,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_52",
elona_id = 156,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_53",
elona_id = 157,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_54",
elona_id = 159,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_55",
elona_id = 160,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_56",
elona_id = 161,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_57",
elona_id = 162,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_58",
elona_id = 163,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_59",
elona_id = 164,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_60",
elona_id = 185,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_61",
elona_id = 186,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_62",
elona_id = 187,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_63",
elona_id = 188,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_64",
elona_id = 189,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_65",
elona_id = 190,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_66",
elona_id = 192,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_67",
elona_id = 193,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_68",
elona_id = 194,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_69",
elona_id = 195,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_70",
elona_id = 196,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_71",
elona_id = 218,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_72",
elona_id = 219,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_73",
elona_id = 220,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_74",
elona_id = 221,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_75",
elona_id = 222,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_76",
elona_id = 223,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_77",
elona_id = 252,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_78",
elona_id = 253,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_79",
elona_id = 254,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_80",
elona_id = 255,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_81",
elona_id = 256,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_82",
elona_id = 285,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_83",
elona_id = 286,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_84",
elona_id = 287,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_85",
elona_id = 288,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_86",
elona_id = 289,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_87",
elona_id = 317,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_88",
elona_id = 318,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_89",
elona_id = 319,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_90",
elona_id = 320,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_91",
elona_id = 321,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_92",
elona_id = 322,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_93",
elona_id = 350,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_94",
elona_id = 351,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_95",
elona_id = 352,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_96",
elona_id = 353,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_97",
elona_id = 354,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_98",
elona_id = 355,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_99",
elona_id = 356,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_100",
elona_id = 357,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_101",
elona_id = 358,
elona_atlas = 2,
kind = TileRole.Snow
},
{
_id = "onii_102",
elona_id = 359,
elona_atlas = 2,
kind = TileRole.Snow
}
}
for _, tile in ipairs(tiles) do
local id = tile.elona_id
local x = (id % 33) * 48
local y = math.floor(id / 33) * 48
tile._type = "base.map_tile"
tile.image = {
source = string.format("graphic/map%d.bmp", tile.elona_atlas),
x = x,
y = y,
width = 48,
height = 48,
count_x = tile.count_x or nil
}
data:add(tile)
end
-- For dungeon generation.
data:add_multi(
"base.map_tile",
{
{
_id = "mapgen_default",
image = "graphic/default/floor.png",
is_solid = true
},
{
_id = "mapgen_tunnel",
image = "graphic/default/floor.png",
is_solid = false
},
{
_id = "mapgen_wall",
image = "graphic/default/floor.png",
is_solid = true
},
{
_id = "mapgen_room",
image = "graphic/default/floor.png",
is_solid = false
},
{
_id = "mapgen_fog",
image = "graphic/default/floor.png",
is_solid = true
},
})
|
-- IMPORTANT -- the name of any action bar must be the prefix of its buttons, e.g. "BonusAction" -> BonusActionButton1 to allow for purging by prefix
local ABD_ActionBars = {
["DEFAULT_UI"] = {
["Action"] = {
ActionButton1,
ActionButton2,
ActionButton3,
ActionButton4,
ActionButton5,
ActionButton6,
ActionButton7,
ActionButton8,
ActionButton9,
ActionButton10,
ActionButton11,
ActionButton12
},
["BonusAction"] = {
BonusActionButton1,
BonusActionButton2,
BonusActionButton3,
BonusActionButton4,
BonusActionButton5,
BonusActionButton6,
BonusActionButton7,
BonusActionButton8,
BonusActionButton9,
BonusActionButton10,
BonusActionButton11,
BonusActionButton12
},
["MultiBarLeft"] = {
MultiBarLeftButton1,
MultiBarLeftButton2,
MultiBarLeftButton3,
MultiBarLeftButton4,
MultiBarLeftButton5,
MultiBarLeftButton6,
MultiBarLeftButton7,
MultiBarLeftButton8,
MultiBarLeftButton9,
MultiBarLeftButton10,
MultiBarLeftButton11,
MultiBarLeftButton12
},
["MultiBarRight"] = {
MultiBarRightButton1,
MultiBarRightButton2,
MultiBarRightButton3,
MultiBarRightButton4,
MultiBarRightButton5,
MultiBarRightButton6,
MultiBarRightButton7,
MultiBarRightButton8,
MultiBarRightButton9,
MultiBarRightButton10,
MultiBarRightButton11,
MultiBarRightButton12
},
["MultiBarBottomLeft"] = {
MultiBarBottomLeftButton1,
MultiBarBottomLeftButton2,
MultiBarBottomLeftButton3,
MultiBarBottomLeftButton4,
MultiBarBottomLeftButton5,
MultiBarBottomLeftButton6,
MultiBarBottomLeftButton7,
MultiBarBottomLeftButton8,
MultiBarBottomLeftButton9,
MultiBarBottomLeftButton10,
MultiBarBottomLeftButton11,
MultiBarBottomLeftButton12
},
["MultiBarBottomRight"] = {
MultiBarBottomRightButton1,
MultiBarBottomRightButton2,
MultiBarBottomRightButton3,
MultiBarBottomRightButton4,
MultiBarBottomRightButton5,
MultiBarBottomRightButton6,
MultiBarBottomRightButton7,
MultiBarBottomRightButton8,
MultiBarBottomRightButton9,
MultiBarBottomRightButton10,
MultiBarBottomRightButton11,
MultiBarBottomRightButton12
}
}, -- DEFAULT_UI
["ZBAR"] = {
["zBar1"] = {
}
},
};
local ABD_ClassIndices = {
["DRUID"] = {
["Cat"] = {73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84},
["Bear"] = {97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108},
["Dire Bear"] = {97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108},
},
["WARRIOR"] = {
["Battle"] = {73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84},
["Defensive"] = {85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96},
["Berserker"] = {97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108},
},
}
function ABD_ClassValues()
local _, class = UnitClass("player"); -- english class uppercase, e.g. "WARRIOR"
return ABD_ClassIndices[class];
end
function ABD_Profile(profile)
if not ABD_ActionBars[profile] then
error("no such profile: " .. profile, 3);
end
return ABD_ActionBars[profile];
end
function ABD_MainStanceBars(profile)
return "Action", "BonusAction";
end
function ABD_SlotNumber(slotId)
return math.mod(slotId - 1, 12) + 1;
end |
local KUI, E, L, V, P, G = unpack(select(2, ...))
local KS = KUI:GetModule("KuiSkins")
local S = E:GetModule("Skins")
if not IsAddOnLoaded("XIV_Databar") then return end
-- Cache global variables
-- Lua functions
local _G = _G
-- WoW API / Variables
-- GLOBALS:
local function styleXIV_Databar()
if E.private.KlixUI.skins.addonSkins.xiv ~= true then return end
_G["XIV_Databar"]:StripTextures()
KS:CreateBD(_G["XIV_Databar"], .5)
_G["XIV_Databar"]:Styling()
_G["XIV_Databar"]:SetParent(E.UIParent)
_G["SpecPopup"]:SetTemplate("Transparent")
_G["LootPopup"]:SetTemplate("Transparent")
_G["portPopup"]:SetTemplate("Transparent")
end
S:AddCallbackForAddon("XIV_Databar", "KuiXIV_Databar", styleXIV_Databar) |
slot0 = class("HaloAttachmentView", import(".StaticCellView"))
slot0.Ctor = function (slot0, slot1, slot2, slot3)
slot0.super.Ctor(slot0, slot1)
slot0.line = {
row = slot2,
column = slot3
}
end
slot0.GetOrder = function (slot0)
return ChapterConst.CellPriorityUpperEffect
end
slot0.Update = function (slot0)
slot2 = slot0.info.flag == ChapterConst.CellFlagTriggerActive and slot1.trait ~= ChapterConst.TraitLurk
if IsNil(slot0.go) then
slot5 = slot0.chapter
slot0:PrepareBase("story_" .. slot3 .. "_" .. slot4 .. "_" .. slot1.attachmentId .. "_upper")
if pg.map_event_template[slot1.attachmentId].icon and #slot8 > 0 then
slot0:GetLoader():GetPrefab("ui/" .. slot9, slot8 .. "_1shangceng", function (slot0)
tf(slot0):SetParent(slot0.tf, false)
slot0:ResetCanvasOrder()
end)
end
end
setActive(slot0.tf, slot2)
end
return slot0
|
valorFixo = perc = 0
io.write("Digite seu nome: ")
nome = io.read()
io.write("Digite o salario de ", nome, ": ")
salario = io.read("*n")
if salario < 300 then
perc = 0.70
valorFixo = 500
elseif salario < 1000 then
perc = 0.50
valorFixo = 200
else
perc = 0.30
valorFixo = 0
end
plBruto = valorFixo + (salario * perc)
impostoRenda = plBruto * 0.25
plLiquido = plBruto - impostoRenda
io.write("Participacaoo nos lucros liquido de ", nome, " foi de: R$", plLiquido) |
local Class = require "libs.class"
local HC = require "libs.HC"
local rocket = require "entidades.rocket"
local Base = require "nivel.Base"
local Entity= require "entidades.Entity"
local circlelaser = Class{
__includes = Entity
}
function circlelaser:init(x,y,r)
self.type="laser"
self.id="enemy"
self.x,self.y=x,y
self.centro=HC.point(self.x,self.y)
self.body=HC.circle(self.x,self.y-love.math.random(6,10)*10,38)
self.img,self.quad=imgs["laser"],quads["laser"][1]
self.radio=0
self.radio2=0
self.r=r
self.speed=500
self.hp=1
self.ram=love.math.random(10,15)
self.ox,self.oy=self.body:center()
self.ox2,self.oy2=self.centro:center()
self.time=0
end
function circlelaser:draw()
love.graphics.draw(self.img,self.quad,self.ox,self.oy,self.radio2,2,2,38/2,37/2)
--self.body:draw()
end
function circlelaser:update(dt)
local x,y=self.speed*math.cos(self.r)*dt,self.speed*math.sin(self.r)*dt
self.time=self.time+dt
self.radio=self.radio+math.rad(self.ram)
self.radio2=self.radio2+math.rad(self.ram)
self.body:move(x,y)
self.centro:move(x,y)
self.body:setRotation(self.radio,self.centro:center())
self.ox,self.oy=self.body:center()
self.ox2,self.oy2=self.centro:center()
if self.time>3 then
Base.Entities:remove(self)
end
if self.ox<-200 or self.oy<-200 or self.ox>10250 or self.oy>10200 then
Base.Entities:remove(self)
end
end
function circlelaser:col(entidad)
if self.body:collidesWith(entidad.body) and self.id~=entidad.id then
return true
end
end
return circlelaser |
---@class VoiceConnection
---@field channel GuildVoiceChannel|nil
local VoiceConnection = {
-- [[VoiceConnection Methods]] --
---Stops the audio stream for this connection (if one is active), disconnects from the voice server, and leaves the corresponding voice channel.
---This method must be called inside of a coroutine, as it will yield until the stream is actually stopped.
---@param self VoiceConnection
close = function(self) end,
---Returns the bitrate of the internal encoder in bits per second.
---@param self VoiceConnection
---@return nil
getBitrate = function(self) end,
---Returns the complexity of the internal Opus encoder.
---@param self VoiceConnection
---@return number
getComplexity = function(self) end,
---Temporarily pauses the audio stream for this connection, if one is active.
---This method must be called inside of a coroutine, as it will yield until the stream is actually stopped.
---@param self VoiceConnection
pauseStream = function(self) end,
---Plays audio over the established connection using an FFMpeg process, assuming FFmpeg is properly configured.
---If `duration` is provided, the audio stream will play until that duration (in milliseconds) has elapsed.
---Otherwise, it will play until the source is exhausted.
---
---The returned number is the time elapsed while streaming and the returned string is a message detailing the reason why the stream stopped.
---See [this page](https://github.com/SinisterRectus/Discordia/wiki/Voice) for more details.
---@param self VoiceConnection
---@param path string
---@param duration number
---@return number
---@return string
playFFmpeg = function(self, path, duration) end,
---Plays PCM data of the established connection. If `duration` is provided, the audio stream will play until that duration (in milliseconds) has elapsed.
---Otherwise, it will play until the source is exhausted.
---
---The returned number is the time elapsed while streaming and the returned string is a message detailing the reason why the stream stopped.
---See [this page](https://github.com/SinisterRectus/Discordia/wiki/Voice) for more details.
---@param self VoiceConnection
---@param source string|function|table|userdata
---@param duration number
---@return number
---@return string
playPCM = function(self, source, duration) end,
---Resumes the audio stream for this connection, if one is active and paused.
---This method must be called inside of a coroutine, as it will yield until the stream is actually stopped.
---@param self VoiceConnection
resumeStream = function(self) end,
---Sets the bitrate of the internal Opus encoder in bits per second. This should be 8000 at minimum.
---The max value depends upon the Guild the connection is attached to.
---@param self VoiceConnection
---@param bitrate number
setBitrate = function(self, bitrate) end,
---Sets the complexity of the internal Opus encoder. This should be in the range [0, 10].
---@param self VoiceConnection
---@param complexity number
setComplexity = function(self, complexity) end,
---Irreversibly stops the audio stream for this connection, if one is active.
---This method must be called inside of a coroutine, as it will yield until the stream is actually stopped.
---@param self VoiceConnection
stopStream = function(self) end,
}
return VoiceConnection |
local theme={colors={normal={blue={0.50980392156863,0.66666666666667,1.0,1},green={0.76470588235294,0.90980392156863,0.55294117647059,1},cyan={0.53725490196078,0.86666666666667,1.0,1},white={0.93333333333333,1.0,1.0,1},red={0.94117647058824,0.44313725490196,0.47058823529412,1},magenta={0.78039215686275,0.57254901960784,0.91764705882353,1},black={0.14901960784314,0.19607843137255,0.21960784313725,1},yellow={1.0,0.79607843137255,0.41960784313725,1}},primary={background={0.14901960784314,0.19607843137255,0.21960784313725,1},foreground={0.93333333333333,1.0,1.0,1}},bright={blue={0.69803921568627,0.8,0.83921568627451,1},green={0.18039215686275,0.23529411764706,0.26274509803922,1},cyan={1.0,0.32549019607843,0.43921568627451,1},white={1.0,1.0,1.0,1},red={0.96862745098039,0.54901960784314,0.42352941176471,1},magenta={0.93333333333333,1.0,1.0,1},black={0.32941176470588,0.43137254901961,0.47843137254902,1},yellow={0.1921568627451,0.27058823529412,0.28627450980392,1}},cursor={text={0.14901960784314,0.19607843137255,0.21960784313725,1},cursor={0.93333333333333,1.0,1.0,1}}}}
return theme.colors |
-- Copyright (C) 2018-2021 by KittenOS NEO contributors
--
-- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-- THIS SOFTWARE.
-- svc-t.lua : terminal
local _, _, retTbl, title = ...
assert(retTbl, "need to alert creator")
if title ~= nil then
assert(type(title) == "string", "title must be string")
end
local function rW()
return string.format("%04x", math.random(0, 65535))
end
local id = "neo.pub.t/" .. rW() .. rW() .. rW() .. rW()
local closeNow = false
-- Terminus Registration State --
local tReg = neo.requireAccess("r." .. id, "registration")
local sendSigs = {}
-- Display State --
-- unicode.safeTextFormat'd lines.
-- The size of this must not go below 1.
local console = {}
-- This must not go below 3.
local conW = 40
local conCX, conCY = 1, 1
local conSCX, conSCY = 1, 1
-- Performance
local consoleShown = {}
local conCYShown
for i = 1, 14 do
console[i] = (" "):rep(conW)
end
-- Line Editing State --
-- Nil if line editing is off.
-- In this case, the console height
-- must be adjusted accordingly.
local leText = ""
-- These are NOT nil'd out,
-- particularly not the history buffer.
local leCX = 1
local leHistory = {
-- Size = history buffer size
"", "", "", ""
}
local function cycleHistoryUp()
local backupFirst = leHistory[1]
for i = 1, #leHistory - 1 do
leHistory[i] = leHistory[i + 1]
end
leHistory[#leHistory] = backupFirst
end
local function cycleHistoryDown()
local backup = leHistory[1]
for i = 2, #leHistory do
backup, leHistory[i] = leHistory[i], backup
end
leHistory[1] = backup
end
-- Window --
local window = neo.requireAccess("x.neo.pub.window", "window")(conW, #console + 1, title)
-- Core Terminal Functions --
local function setSize(w, h)
conW = w
for i = 1, #console do
consoleShown[i] = nil
end
while #console < h do
table.insert(console, "")
end
while #console > h do
table.remove(console, 1)
end
for i = 1, #console do
console[i] = unicode.sub(console[i], 1, w) .. (" "):rep(w - unicode.len(console[i]))
end
if leText then
window.setSize(w, h + 1)
else
window.setSize(w, h)
end
conCX, conCY = 1, h
end
local function setLineEditing(state)
if state and not leText then
leText = ""
leCX = 1
setSize(conW, #console)
elseif leText and not state then
leText = nil
setSize(conW, #console)
end
end
local function draw(i)
if console[i] then
window.span(1, i, console[i], 0, 0xFFFFFF)
if i == conCY and not leText then
window.span(conCX, i, unicode.sub(console[i], conCX, conCX), 0xFFFFFF, 0)
end
elseif leText then
window.span(1, i, require("lineedit").draw(conW, unicode.safeTextFormat(leText, leCX)), 0xFFFFFF, 0)
end
end
local function drawDisplay()
for i = 1, #console do
if consoleShown[i] ~= console[i] or i == conCY or i == conCYShown then
draw(i)
consoleShown[i] = console[i]
end
end
conCYShown = conCY
end
-- Terminal Visual --
local function consoleSD()
for i = 1, #console - 1 do
console[i] = console[i + 1]
end
console[#console] = (" "):rep(conW)
end
local function consoleSU()
local backup = (" "):rep(conW)
for i = 1, #console do
backup, console[i] = console[i], backup
end
end
local function consoleCLS()
for i = 1, #console do
console[i] = (" "):rep(conW)
end
conCX, conCY = 1, 1
end
local function writeFF()
if conCY ~= #console then
conCY = conCY + 1
else
consoleSD()
end
end
local function writeData(data)
-- handle data until completion
while #data > 0 do
local char = unicode.sub(data, 1, 1)
--neo.emergency("svc-t.data: " .. char:byte())
data = unicode.sub(data, 2)
-- handle character
if char == "\t" then
-- not ideal, but allowed
char = " "
end
if char == "\r" then
conCX = 1
elseif char == "\x00" then
-- caused by TELNET \r rules
elseif char == "\n" then
conCX = 1
writeFF()
elseif char == "\a" then
-- Bell (er...)
elseif char == "\b" then
conCX = math.max(1, conCX - 1)
elseif char == "\v" or char == "\f" then
writeFF()
else
local charL = unicode.wlen(char)
if (conCX + charL - 1) > conW then
conCX = 1
writeFF()
end
local spaces = (" "):rep(charL - 1)
console[conCY] = unicode.sub(console[conCY], 1, conCX - 1) .. char .. spaces .. unicode.sub(console[conCY], conCX + charL)
conCX = conCX + charL
-- Cursor can be (intentionally!) off-screen here
end
end
end
local function writeANSI(s)
--neo.emergency("svc-t.ansi: " .. s)
-- This supports just about enough to get by.
if s == "c" then
consoleCLS()
return
end
local pfx = s:sub(1, 1)
local cmd = s:sub(#s)
if pfx == "[" then
local np = tonumber(s:sub(2, -2)) or 1
if cmd == "A" then
conCY = conCY - np
elseif cmd == "B" then
conCY = conCY + np
elseif cmd == "C" then
conCX = conCX + np
elseif cmd == "D" then
conCX = conCX - np
elseif cmd == "f" or cmd == "H" then
local p = s:find(";")
if not p then
conCY = np
conCX = 1
else
conCY = tonumber(s:sub(2, p - 1)) or 1
conCX = tonumber(s:sub(p + 1, -2)) or 1
end
elseif cmd == "J" then
consoleCLS()
elseif cmd == "K" then
if s == "[K" or s == "[0K" then
-- bash needs this
console[conCY] = unicode.sub(console[conCY], 1, conCX - 1) .. (" "):rep(1 + conW - conCX)
else
console[conCY] = (" "):rep(conW)
end
elseif cmd == "n" then
if s == "[6n" then
for _, v in pairs(sendSigs) do
v("data", "\x1b[" .. conY .. ";" .. conX .. "R")
end
end
elseif cmd == "s" then
conSCX, conSCY = conCX, conCY
elseif cmd == "u" then
conCX, conCY = conSCX, conSCY
end
end
conCX = math.min(math.max(math.floor(conCX), 1), conW)
conCY = math.min(math.max(math.floor(conCY), 1), #console)
end
-- The Terminus --
local tvBuildingCmd = ""
local tvBuildingUTF = ""
local tvSubnegotiation = false
local function incoming(s)
tvBuildingCmd = tvBuildingCmd .. s
-- Flush Cmd
while #tvBuildingCmd > 0 do
if tvBuildingCmd:byte() == 255 then
-- It's a command. Uhoh.
if #tvBuildingCmd < 2 then break end
local cmd = tvBuildingCmd:byte(2)
local param = tvBuildingCmd:byte(3)
local cmdLen = 2
-- Command Lengths
if cmd >= 251 and cmd <= 254 then cmdLen = 3 end
if #tvBuildingCmd < cmdLen then break end
if cmd == 240 then
-- SE
tvSubnegotiation = false
elseif cmd == 250 then
-- SB
tvSubnegotiation = true
elseif cmd == 251 and param == 1 then
-- WILL ECHO (respond with DO ECHO, disable line editing)
-- test using io.write("\xFF\xFB\x01")
for _, v in pairs(sendSigs) do
v("telnet", "\xFF\xFD\x01")
end
setLineEditing(false)
elseif cmd == 252 and param == 1 then
-- WON'T ECHO (respond with DON'T ECHO, enable line editing)
for _, v in pairs(sendSigs) do
v("telnet", "\xFF\xFE\x01")
end
setLineEditing(true)
elseif cmd == 251 or cmd == 252 then
-- WILL/WON'T (x) (respond with DON'T (X))
local res = "\xFF\xFE" .. string.char(param)
for _, v in pairs(sendSigs) do
v("telnet", res)
end
elseif cmd == 253 or cmd == 254 then
-- DO/DON'T (x) (respond with WON'T (X))
local res = "\xFF\xFC" .. string.char(param)
for _, v in pairs(sendSigs) do
v("telnet", res)
end
elseif cmd == 255 then
if not tvSubnegotiation then
tvBuildingUTF = tvBuildingUTF .. "\xFF"
end
end
tvBuildingCmd = tvBuildingCmd:sub(cmdLen + 1)
else
if not tvSubnegotiation then
tvBuildingUTF = tvBuildingUTF .. tvBuildingCmd:sub(1, 1)
end
tvBuildingCmd = tvBuildingCmd:sub(2)
end
end
-- Flush UTF/Display
while #tvBuildingUTF > 0 do
local head = tvBuildingUTF:byte()
local len = 1
local handled = false
if head == 27 then
local h2 = tvBuildingUTF:byte(2)
if h2 == 91 then
for i = 3, #tvBuildingUTF do
local cmd = tvBuildingUTF:byte(i)
if cmd >= 0x40 and cmd <= 0x7E then
writeANSI(tvBuildingUTF:sub(2, i))
len = i
handled = true
break
end
end
elseif h2 then
len = 2
writeANSI(tvBuildingUTF:sub(2, 2))
handled = true
end
if not handled then break end
end
if not handled then
if head < 192 then
len = 1
elseif head < 224 then
len = 2
elseif head < 240 then
len = 3
elseif head < 248 then
len = 4
elseif head < 252 then
len = 5
elseif head < 254 then
len = 6
end
if #tvBuildingUTF < len then
break
end
-- verified one full character...
writeData(tvBuildingUTF:sub(1, len))
end
tvBuildingUTF = tvBuildingUTF:sub(len + 1)
end
end
do
tReg(function (_, pid, sendSig)
sendSigs[pid] = sendSig
return {
id = "x." .. id,
pid = neo.pid,
write = function (text)
incoming(tostring(text))
drawDisplay()
end
}
end, true)
if retTbl then
coroutine.resume(coroutine.create(retTbl), {
access = "x." .. id,
close = function ()
closeNow = true
neo.scheduleTimer(0)
end
})
end
end
local control = false
local function key(a, c)
if control then
if c == 203 and conW > 8 then
setSize(conW - 1, #console)
return
elseif c == 200 and #console > 1 then
setSize(conW, #console - 1)
return
elseif c == 205 then
setSize(conW + 1, #console)
return
elseif c == 208 then
setSize(conW, #console + 1)
return
end
end
-- so with the reserved ones dealt with...
if not leText then
-- Line Editing not active.
-- For now support a bare minimum.
for _, v in pairs(sendSigs) do
if a == "\x03" then
v("telnet", "\xFF\xF4")
elseif c == 199 then
v("data", "\x1b[H")
elseif c == 201 then
v("data", "\x1b[5~")
elseif c == 207 then
v("data", "\x1b[F")
elseif c == 209 then
v("data", "\x1b[6~")
elseif c == 203 then
v("data", "\x1b[D")
elseif c == 205 then
v("data", "\x1b[C")
elseif c == 200 then
v("data", "\x1b[A")
elseif c == 208 then
v("data", "\x1b[B")
elseif a == "\r" then
v("data", "\r\n")
elseif a then
v("data", a)
end
end
elseif not control then
-- Line Editing active and control isn't involved
if c == 200 or c == 208 then
-- History cursor up (history down)
leText = leHistory[#leHistory]
leCX = unicode.len(leText) + 1
if c == 208 then
cycleHistoryUp()
else
cycleHistoryDown()
end
return
end
local lT, lC, lX = require("lineedit").key(a, c, leText, leCX)
leText = lT or leText
leCX = lC or leCX
if lX == "nl" then
cycleHistoryUp()
leHistory[#leHistory] = leText
-- the whole thing {
local fullText = leText .. "\r\n"
writeData(fullText)
drawDisplay()
for _, v in pairs(sendSigs) do
v("data", fullText)
end
-- }
leText = ""
leCX = 1
end
end
end
while not closeNow do
local e = {coroutine.yield()}
if e[1] == "k.procdie" then
sendSigs[e[3]] = nil
elseif e[1] == "x.neo.pub.window" then
if e[3] == "close" then
break
elseif e[3] == "clipboard" then
for i = 1, unicode.len(e[4]) do
local c = unicode.sub(e[4], i, i)
if c ~= "\r" then
if c == "\n" then
c = "\r"
end
key(c, 0)
end
end
draw(#console + 1)
elseif e[3] == "key" then
if e[5] == 29 or e[5] == 157 then
control = e[6]
elseif e[6] then
key(e[4] ~= 0 and unicode.char(e[4]), e[5])
draw(#console + 1)
end
elseif e[3] == "line" then
draw(e[4])
end
end
end
|
ElvCharacterDB = {
["ChatEditHistory"] = {
},
["ChatHistoryLog"] = {
{
"WTS Headmaster/Headmistress Title cheap and fast on all realms!", -- [1]
"Velia-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Velia", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
241, -- [11]
"Player-1305-08995401", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff3fc6eaVelia|r",
[51] = 1530655382,
[50] = "CHAT_MSG_CHANNEL",
}, -- [1]
{
"WTS Headmaster/Headmistress Title cheap and fast on all realms!", -- [1]
"Velia-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Velia", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
243, -- [11]
"Player-1305-08995401", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff3fc6eaVelia|r",
[51] = 1530655383,
[50] = "CHAT_MSG_CHANNEL",
}, -- [2]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
252, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655394,
[50] = "CHAT_MSG_CHANNEL",
}, -- [3]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
261, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655408,
[50] = "CHAT_MSG_CHANNEL",
}, -- [4]
{
"11/11M players boosting (Antorus Heroic Personal loot & MasterLoot, Chosen, Gul'dan Mount) everyday & Glory runs. <Myst> is selling Antorus Mythic boosts, we offer full runs, Argus only (no mount) or first 10. /w for more info or to book a spot", -- [1]
"Bizxz-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Bizxz", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
270, -- [11]
"Player-1305-09D1A903", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff3fc6eaBizxz|r",
[51] = 1530655420,
[50] = "CHAT_MSG_CHANNEL",
}, -- [5]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
275, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655431,
[50] = "CHAT_MSG_CHANNEL",
}, -- [6]
{
"WTS |cff66bbff|Hjournal:1:2031:15|h[Argus the Unmaker]|h|r Heroic One Shot Going now / w me for more info /", -- [1]
"Kîller-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kîller", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
277, -- [11]
"Player-1305-09ADD393", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfffff468Kîller|r",
[51] = 1530655433,
[50] = "CHAT_MSG_CHANNEL",
}, -- [7]
{
"WTS DUNGEON BOOST 100-110 3k per run (1-6 min dungeons) 20-50% XP per dg (You AFK) Fastest twink on the server with WoD Legendary + 866 ilvl etc. ", -- [1]
"Twinkbooster-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Twinkbooster", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
278, -- [11]
"Player-1305-096D50A2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffff7c0aTwinkbooster|r",
[51] = 1530655455,
[50] = "CHAT_MSG_CHANNEL",
}, -- [8]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
280, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655458,
[50] = "CHAT_MSG_CHANNEL",
}, -- [9]
{
"WTS |cffffff00|Hachievement:8719:Player-1305-09CB9F9E:1:07:12:17:4294967295:4294967295:4294967295:4294967295|h[Blazebinder]|h|r boost! Get your |cff71d5ff|Hspell:148428:0|h[Ashhide Mushan Beast]|h|r mount today 15mins! Also selling title /w me!", -- [1]
"Coinsforyou-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Coinsforyou", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
281, -- [11]
"Player-1305-09CB9F9E", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dCoinsforyou|r",
[51] = 1530655458,
[50] = "CHAT_MSG_CHANNEL",
}, -- [10]
{
"Selling |cff66bbff|Hjournal:1:1737:16|h[Gul'dan]|h|r Mythic kill with Amazing Mount |cffa335ee|Hitem:137575::::::::1:71::6:1:3524:::|h[Fiendish Hellfire Core]|h|r - 100% Drop Chance! // and selling |cffffff00|Hachievement:11387:Player-1403-0540495C:0:0:0:-1:0:0:0:0|h[The Chosen]|h|r achievement + Exclusive Title! /pm me for info ", -- [1]
"Kolhaar-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kolhaar", -- [5]
"DND", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
282, -- [11]
"Player-1305-09CF9273", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dKolhaar|r",
[51] = 1530655460,
[50] = "CHAT_MSG_CHANNEL",
}, -- [11]
{
"Selling Top Raid |cff66bbff|Hjournal:0:946:16|h[Antorus, the Burning Throne]|h|r Heroic&Mythic Full Run // Also you can get only |cff66bbff|Hjournal:1:2031:16|h[Argus the Unmaker]|h|r Heroic/Mythic with mount |cffa335ee|Hitem:152789::::::::1:71::6:1:3524:::|h[Shackled Ur'zul]|h|r! /pm me for info ", -- [1]
"Kolhaar-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kolhaar", -- [5]
"DND", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
283, -- [11]
"Player-1305-09CF9273", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dKolhaar|r",
[51] = 1530655460,
[50] = "CHAT_MSG_CHANNEL",
}, -- [12]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
284, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655465,
[50] = "CHAT_MSG_CHANNEL",
}, -- [13]
{
"{Gallywix} is a collection of 11/11M players, most of which come from within the Top 50 World Ranked Guilds. We offer quality, reliable runs including; Antorus PL/ML, Gul'dan, CoF, Chosen, Glory, PvP etc. /w for info.", -- [1]
"Nótábankalt-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Nótábankalt", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
286, -- [11]
"Player-1305-09CF403D", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff0070ddNótábankalt|r",
[51] = 1530655471,
[50] = "CHAT_MSG_CHANNEL",
}, -- [14]
{
"WTB Medallion of the Legion!!!!!", -- [1]
"Moneyfarmer-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Moneyfarmer", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
287, -- [11]
"Player-1305-04E6FABD", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc41e3aMoneyfarmer|r",
[51] = 1530655471,
[50] = "CHAT_MSG_CHANNEL",
}, -- [15]
{
"WTB Medallion of the Legion!!!!!", -- [1]
"Moneyfarmer-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Moneyfarmer", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
288, -- [11]
"Player-1305-04E6FABD", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc41e3aMoneyfarmer|r",
[51] = 1530655471,
[50] = "CHAT_MSG_CHANNEL",
}, -- [16]
{
"11/11M players boosting (Antorus Heroic Personal loot & MasterLoot, Chosen, Gul'dan Mount) everyday & Glory runs. <Myst> is selling Antorus Mythic boosts, we offer full runs, Argus only (no mount) or first 10. /w for more info or to book a spot", -- [1]
"Bizxz-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Bizxz", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
290, -- [11]
"Player-1305-09D1A903", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff3fc6eaBizxz|r",
[51] = 1530655480,
[50] = "CHAT_MSG_CHANNEL",
}, -- [17]
{
"WTS |cff66bbff|Hjournal:1:2031:15|h[Argus the Unmaker]|h|r Heroic One Shot Going now / w me for more info /", -- [1]
"Kîller-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kîller", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
292, -- [11]
"Player-1305-09ADD393", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfffff468Kîller|r",
[51] = 1530655492,
[50] = "CHAT_MSG_CHANNEL",
}, -- [18]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
293, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655492,
[50] = "CHAT_MSG_CHANNEL",
}, -- [19]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
296, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655503,
[50] = "CHAT_MSG_CHANNEL",
}, -- [20]
{
"WTB Medallion of the Legion!!!!!", -- [1]
"Moneyfarmer-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Moneyfarmer", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
297, -- [11]
"Player-1305-04E6FABD", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc41e3aMoneyfarmer|r",
[51] = 1530655525,
[50] = "CHAT_MSG_CHANNEL",
}, -- [21]
{
"WTB Medallion of the Legion!!!!!", -- [1]
"Moneyfarmer-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Moneyfarmer", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
298, -- [11]
"Player-1305-04E6FABD", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc41e3aMoneyfarmer|r",
[51] = 1530655525,
[50] = "CHAT_MSG_CHANNEL",
}, -- [22]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
299, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655526,
[50] = "CHAT_MSG_CHANNEL",
}, -- [23]
{
"Guildie Boosting service is providing you with a 15 key and the chance to get 960 in your class hall chest tomorrow!. If you want to afk thats cool with us. If you want to experience then dungeon. That is cool aswell!. /whisper me", -- [1]
"Zuperwoman-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Zuperwoman", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
300, -- [11]
"Player-1305-073AC017", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfff48cbaZuperwoman|r",
[51] = 1530655526,
[50] = "CHAT_MSG_CHANNEL",
}, -- [24]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
302, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655533,
[50] = "CHAT_MSG_CHANNEL",
}, -- [25]
{
"WTS |cff66bbff|Hjournal:1:2031:15|h[Argus the Unmaker]|h|rHC ONE SHOT!WISP FOR INFO.", -- [1]
"Stormspirît-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Stormspirît", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
303, -- [11]
"Player-1305-09012337", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Stormspirît|r",
[51] = 1530655534,
[50] = "CHAT_MSG_CHANNEL",
}, -- [26]
{
"Selling |cff66bbff|Hjournal:1:1737:16|h[Gul'dan]|h|r Mythic kill with Amazing Mount |cffa335ee|Hitem:137575::::::::1:71::6:1:3524:::|h[Fiendish Hellfire Core]|h|r - 100% Drop Chance! // and selling |cffffff00|Hachievement:11387:Player-1403-0540495C:0:0:0:-1:0:0:0:0|h[The Chosen]|h|r achievement + Exclusive Title! /pm me for info ", -- [1]
"Kolhaar-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kolhaar", -- [5]
"DND", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
304, -- [11]
"Player-1305-09CF9273", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dKolhaar|r",
[51] = 1530655535,
[50] = "CHAT_MSG_CHANNEL",
}, -- [27]
{
"Selling Top Raid |cff66bbff|Hjournal:0:946:16|h[Antorus, the Burning Throne]|h|r Heroic&Mythic Full Run // Also you can get only |cff66bbff|Hjournal:1:2031:16|h[Argus the Unmaker]|h|r Heroic/Mythic with mount |cffa335ee|Hitem:152789::::::::1:71::6:1:3524:::|h[Shackled Ur'zul]|h|r! /pm me for info ", -- [1]
"Kolhaar-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kolhaar", -- [5]
"DND", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
305, -- [11]
"Player-1305-09CF9273", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dKolhaar|r",
[51] = 1530655535,
[50] = "CHAT_MSG_CHANNEL",
}, -- [28]
{
"WTS |cff66bbff|Hjournal:1:2031:15|h[Argus the Unmaker]|h|r Heroic One Shot Going now / w me for more info /", -- [1]
"Kîller-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kîller", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
306, -- [11]
"Player-1305-09ADD393", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfffff468Kîller|r",
[51] = 1530655539,
[50] = "CHAT_MSG_CHANNEL",
}, -- [29]
{
"11/11M players boosting (Antorus Heroic Personal loot & MasterLoot, Chosen, Gul'dan Mount) everyday & Glory runs. <Myst> is selling Antorus Mythic boosts, we offer full runs, Argus only (no mount) or first 10. /w for more info or to book a spot", -- [1]
"Bizxz-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Bizxz", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
307, -- [11]
"Player-1305-09D1A903", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff3fc6eaBizxz|r",
[51] = 1530655540,
[50] = "CHAT_MSG_CHANNEL",
}, -- [30]
{
"Guildie Boosting service is providing you with a 15 key and the chance to get 960 in your class hall chest tomorrow!. If you want to afk thats cool with us. If you want to experience then dungeon. That is cool aswell!. /whisper me", -- [1]
"Zuperwoman-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Zuperwoman", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
308, -- [11]
"Player-1305-073AC017", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfff48cbaZuperwoman|r",
[51] = 1530655542,
[50] = "CHAT_MSG_CHANNEL",
}, -- [31]
{
"Guild \"Teknomafiaa\" 6/11 M trazi ozbiljne igrace za BfA. Raid vrijeme: sri i pon od 20:00 h. Guild je oformljen od RL ekipe i atmosfera je opustena. Bacite /w za razgovor. PvP i m+ su isto aktivnosti kojima se bavimo.", -- [1]
"Benbutia-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Benbutia", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
310, -- [11]
"Player-1305-01D2CC8D", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfffff468Benbutia|r",
[51] = 1530655553,
[50] = "CHAT_MSG_CHANNEL",
}, -- [32]
{
"WTS mythic+ 15 with 4k score group get ur +940 loot and weekly chest 960-980 item with 11/11 mythic guild group.", -- [1]
"Poisenlord-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Poisenlord", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
311, -- [11]
"Player-1305-085793A7", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff8787edPoisenlord|r",
[51] = 1530655553,
[50] = "CHAT_MSG_CHANNEL",
}, -- [33]
{
"WTS |cff66bbff|Hjournal:1:2031:15|h[Argus the Unmaker]|h|r Heroic One Shot Going now / w me for more info /", -- [1]
"Kîller-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Kîller", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
314, -- [11]
"Player-1305-09ADD393", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cfffff468Kîller|r",
[51] = 1530655558,
[50] = "CHAT_MSG_CHANNEL",
}, -- [34]
{
"WTS |cffffff00|Hachievement:8719:Player-1305-09CB9F9E:1:07:12:17:4294967295:4294967295:4294967295:4294967295|h[Blazebinder]|h|r boost! Get your |cff71d5ff|Hspell:148428:0|h[Ashhide Mushan Beast]|h|r mount today 15mins! Also selling title /w me!", -- [1]
"Coinsforyou-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Coinsforyou", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
315, -- [11]
"Player-1305-09CB9F9E", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cffc69b6dCoinsforyou|r",
[51] = 1530655558,
[50] = "CHAT_MSG_CHANNEL",
}, -- [35]
{
"WTS Mythic+ 16 with 11/11 Mythic Guild M8s ( Been Boosting Since Legion Launch )Get your +940 gear And +960 weekly chest right now ! Price is 70k .", -- [1]
"Artstyl-Kazzak", -- [2]
"", -- [3]
"2. Trade - City", -- [4]
"Artstyl", -- [5]
"", -- [6]
2, -- [7]
2, -- [8]
"Trade - City", -- [9]
0, -- [10]
316, -- [11]
"Player-1305-0796CDC2", -- [12]
0, -- [13]
false, -- [14]
false, -- [15]
false, -- [16]
true, -- [17]
[52] = "|cff00ff96Artstyl|r",
[51] = 1530655560,
[50] = "CHAT_MSG_CHANNEL",
}, -- [36]
},
}
|
Citizen.CreateThread(function()
repeat
Wait(0)
until permissions
permissions["devtools_coords"] = false
permissions["devtools_noclip"] = false
permissions["devtools_vanish"] = false
permissions["devtools_tpm"] = false
end)
|
-- Edit the properties of the standard shader
namespace "standard"
local flat = require "engine.flat"
local ui2 = require "ent.ui2"
local ModelDrawer = require "app.debug.modelView.modelDrawer"
local ModelEditShaderUi = classNamed("ModelEditShaderUi", ModelDrawer)
function ModelEditShaderUi:onLoad()
local function Home() return self.back[1](self.back[2]) end
-- Horizontal
local ents = {
ui2.ButtonEnt{label="<", onButton = function(_self) -- Die
self:swap( Home() )
end},
}
local layout = ui2.PileLayout{managed=ents, parent=self}
layout:layout()
-- Vertical
local function makeTriplet(spec)
local label, uniform, index = unpack(spec)
local startValue
if index then startValue = self.shaderProps[uniform][index] else startValue = self.shaderProps[uniform] end
return ui2.SliderTripletEnt{startLabel=label, value=startValue,
sliderSpec={minRange=spec.minRange, maxRange=spec.maxRange},
onChange=function(_self, value)
local send
if index then
send = self.shaderProps[uniform]
send[index] = value
else
send = value
self.shaderProps[uniform] = value
end
self.shader:send(uniform, send)
end}
end
ents = {
makeTriplet{"Light direction X", "lovrLightDirection", 1, minRange=-1},
makeTriplet{"Light direction Y", "lovrLightDirection", 2, minRange=-1},
makeTriplet{"Light direction Z", "lovrLightDirection", 3, minRange=-1},
makeTriplet{"Light color R", "lovrLightColor", 1},
makeTriplet{"Light color G", "lovrLightColor", 2},
makeTriplet{"Light color B", "lovrLightColor", 3},
makeTriplet{"Light intensity", "lovrLightColor", 4, maxRange=10},
makeTriplet{"Exposure", "lovrExposure", maxRange=10},
}
local layout = ui2.PileLayout{managed=ents, parent=self, face="y", anchor="tr"}
layout:layout()
end
return ModelEditShaderUi
|
LinkLuaModifier("modifier_kill", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_ward_invisibility", "modifiers/modifier_ward_invisibility.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_scan_true_sight_thinker", "modifiers/modifier_scan_true_sight.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_oaa_scan_thinker", "modifiers/modifier_oaa_scan_thinker.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_oaa_scan_debuff", "modifiers/modifier_oaa_scan_thinker.lua", LUA_MODIFIER_MOTION_NONE)
if Glyph == nil then
-- Debug:EnableDebugging()
DebugPrint('Creating new Glyph Filter Object')
Glyph = class({})
end
function Glyph:Init()
self.ward = {}
self.scan = {}
self.ward.cooldown = POOP_WARD_COOLDOWN
self.scan.cooldown = SCAN_REVEAL_COOLDOWN
self.ward.cooldowns = tomap(zip(PlayerResource:GetAllTeamPlayerIDs(), duplicate(0)))
self.scan.cooldowns = {
[DOTA_TEAM_GOODGUYS] = 0,
[DOTA_TEAM_BADGUYS] = 0,
}
FilterManager:AddFilter(FilterManager.ExecuteOrder, self, Dynamic_Wrap(Glyph, "Filter"))
end
function Glyph:Filter(keys)
local order = keys.order_type
local abilityEID = keys.entindex_ability
local ability = EntIndexToHScript(abilityEID)
local issuerID = keys.issuer_player_id_const
local target = EntIndexToHScript(keys.entindex_target)
if order == DOTA_UNIT_ORDER_GLYPH then
-- Handle Glyph aka Ward Button
DebugPrintTable(keys)
self:CastWard(issuerID)
return false
elseif order == DOTA_UNIT_ORDER_RADAR then
-- Handle Scan
DebugPrintTable(keys)
self:CastScan(issuerID, keys)
return false
end
return true
end
function Glyph:CastWard(playerID)
if self:GetWardCooldown(playerID) > 0 then
CustomGameEventManager:Send_ServerToPlayer(PlayerResource:GetPlayer(playerID), "custom_dota_hud_error_message", {reason=61, message=""})
return
end
self:ResetWardCooldown(playerID)
local hero = PlayerResource:GetSelectedHeroEntity(playerID)
local position = hero:GetAbsOrigin()
--[[for i=0,256 do
Timers:CreateTimer(i * 2, function ()
print('Message ' .. i)
DebugDrawText(position, 'Message ' .. i, true, 2)
CustomGameEventManager:Send_ServerToPlayer(PlayerResource:GetPlayer(playerID), "custom_dota_hud_error_message", {reason=i, message="message"})
end)
end]]
local ward = CreateUnitByName("npc_dota_observer_wards", position, true, nil, hero, hero:GetTeam())
ward:AddNewModifier(ward, nil, "modifier_kill", { duration = POOP_WARD_DURATION })
ward:AddNewModifier(ward, nil, "modifier_ward_invisibility", { })
end
function Glyph:ResetWardCooldown(playerID)
self:SetWardCooldown(playerID, self:GetWardCooldown())
end
function Glyph:SetWardCooldown(playerID, time)
local player = PlayerResource:GetPlayer(playerID)
time = time or 0
self.ward.cooldowns[playerID] = time
CustomGameEventManager:Send_ServerToPlayer(player, "glyph_ward_cooldown", { cooldown = time, maxCooldown = self:GetWardCooldown() })
Timers:CreateTimer(time, function ()
Glyph.ward.cooldowns[playerID] = 0
end)
end
function Glyph:GetWardCooldown(playerID)
if playerID then
return self.ward.cooldowns[playerID]
else
return self.ward.cooldown
end
end
--[[
{
["entindex_ability"] = 0,
["sequence_number_const"] = 34,
["queue"] = 0,
["units"] = {
["0"] = 364,
} ,
["entindex_target"] = 0,
["position_z"] = 228.81585693359,
["position_x"] = -3273.6315917969,
["order_type"] = 31,
["position_y"] = -197.20104980469,
["issuer_player_id_const"] = 0,
}
]]--
function Glyph:CastScan(playerID, keys)
if self:GetScanCooldown(playerID) > 0 then
CustomGameEventManager:Send_ServerToPlayer(PlayerResource:GetPlayer(playerID), "custom_dota_hud_error_message", {reason=61, message=""})
return
end
local hero = PlayerResource:GetSelectedHeroEntity(playerID)
local position = Vector(keys.position_x, keys.position_y, keys.position_z)
CreateModifierThinker( hero, nil, "modifier_scan_true_sight_thinker", {duration = SCAN_REVEAL_DURATION}, position, hero:GetTeamNumber(), false )
CreateModifierThinker( hero, nil, "modifier_oaa_scan_thinker", {duration = SCAN_DURATION}, position, hero:GetTeamNumber(), false )
self:ResetScanCooldown(playerID)
end
function Glyph:ResetScanCooldown(playerID)
self:SetScanCooldown(playerID, self:GetScanCooldown())
end
function Glyph:SetScanCooldown(playerID, time)
local player = PlayerResource:GetPlayer(playerID)
local team = player:GetTeam()
time = time or 0
self.scan.cooldowns[team] = time
CustomGameEventManager:Send_ServerToTeam( team, "glyph_scan_cooldown", { cooldown = time, maxCooldown = self:GetScanCooldown() } )
Timers:CreateTimer(time, function ()
Glyph.scan.cooldowns[team] = 0
end)
end
function Glyph:GetScanCooldown(playerID)
if playerID then
local player = PlayerResource:GetPlayer(playerID)
local team = player:GetTeam()
return self.scan.cooldowns[team]
else
return self.scan.cooldown
end
end
|
local random_bytes = require("resty.random").bytes
-- Seed math.randomseed based on random bytes from openssl. This is better than
-- relying on something like os.time(), since that can result in identical
-- seeds for multiple workers started up at the same time.
--
-- Based on https://github.com/bungle/lua-resty-random/blob/17b604f7f7dd217557ca548fc1a9a0d373386480/lib/resty/random.lua#L49-L52
local function seed()
local num_bytes = 4
local random = random_bytes(num_bytes, true)
if not random then
ngx.log(ngx.WARN, "Could not generate cryptographically secure random data for seeding math.randomseed. Falling back to non-secure random data.")
random = random_bytes(num_bytes, false)
end
local byte1, byte2, byte3, byte4 = string.byte(random, 1, 4)
local randomseed = byte1 * 0x1000000 + byte2 * 0x10000 + byte3 * 0x100 + byte4
return math.randomseed(randomseed)
end
seed()
return seed
|
function create(class)
if class then
if class.init then
class:init()
end
end
end
require "Assets.LuaScripts.Modulus.LuaStart.__init" |
return {
methods = {
onEnter = {
function(self, args, ret)
args[1] = oppdirs[args[1]] or args[1]
end,
function(self, args ,ret)
local message = self:getMessage("enters", {dir=args[1]}) or (self.name.." enters from the "..args[1])
self.room:broadcast(message, self)
end
},
onExit = {
function(self, args, ret)
local dir = xml.wrapText(args[1], "dir")
self.name = xml.wrapText(self.name, "char", {id=self.identifier})
local message = self:getMessage("leaves", {dir=dir}) or (self.name.." leaves to the "..dir)
self.name = xml.stripTags(self.name)
self.room:broadcast(xml.wrapText(message, "leave"), self)
end
},
walk = {
function(self, args, ret)
self.room:doMove(self, args[1])
end
},
},
}
|
-- Created by Elfansoer
--[[
Ability checklist (erase if done/checked):
- Scepter Upgrade
- Break behavior
- Linken/Reflect behavior
- Spell Immune/Invulnerable/Invisible behavior
- Illusion behavior
- Stolen behavior
]]
--------------------------------------------------------------------------------
modifier_magnus_skewer_lua = class({})
--------------------------------------------------------------------------------
-- Classifications
function modifier_magnus_skewer_lua:IsHidden()
return false
end
function modifier_magnus_skewer_lua:IsDebuff()
return false
end
function modifier_magnus_skewer_lua:IsStunDebuff()
return false
end
function modifier_magnus_skewer_lua:IsPurgable()
return false
end
--------------------------------------------------------------------------------
-- Initializations
function modifier_magnus_skewer_lua:OnCreated( kv )
-- references
self.radius = self:GetAbility():GetSpecialValueFor( "skewer_radius" )
self.speed = self:GetAbility():GetSpecialValueFor( "skewer_speed" )
self.tree = self:GetAbility():GetSpecialValueFor( "tree_radius" )
if not IsServer() then return end
-- get data
self.origin = self:GetParent():GetOrigin()
self.point = Vector( kv.x, kv.y, 0 )
self.direction = self.point - self.origin
self.distance = self.direction:Length2D()
self.direction.z = 0
self.direction = self.direction:Normalized()
-- init
self.enemies = {}
-- motion
if not self:ApplyHorizontalMotionController() then
self:Destroy()
return
end
-- play effects
self:PlayEffects()
end
function modifier_magnus_skewer_lua:OnRefresh( kv )
self:OnCreated( kv )
end
function modifier_magnus_skewer_lua:OnRemoved()
end
function modifier_magnus_skewer_lua:OnDestroy()
if not IsServer() then return end
self:GetParent():RemoveHorizontalMotionController( self )
end
--------------------------------------------------------------------------------
-- Modifier Effects
function modifier_magnus_skewer_lua:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_OVERRIDE_ANIMATION,
}
return funcs
end
function modifier_magnus_skewer_lua:GetOverrideAnimation()
return ACT_DOTA_MAGNUS_SKEWER_START
end
--------------------------------------------------------------------------------
-- Status Effects
function modifier_magnus_skewer_lua:CheckState()
local state = {
[MODIFIER_STATE_STUNNED] = true,
}
return state
end
--------------------------------------------------------------------------------
-- Motion Effects
function modifier_magnus_skewer_lua:UpdateHorizontalMotion( me, dt )
local origin = me:GetOrigin()
local target = origin + self.direction*self.speed*dt
me:SetOrigin( target )
-- destroy trees
GridNav:DestroyTreesAroundPoint( origin, self.tree, false )
-- check distance
local dist = (target-self.origin):Length2D()
if dist>self.distance then
self:Destroy()
end
end
function modifier_magnus_skewer_lua:OnHorizontalMotionInterrupted()
self:Destroy()
end
--------------------------------------------------------------------------------
-- Aura Effects
function modifier_magnus_skewer_lua:IsAura()
return true
end
function modifier_magnus_skewer_lua:GetModifierAura()
return "modifier_magnus_skewer_lua_debuff"
end
function modifier_magnus_skewer_lua:GetAuraRadius()
return self.radius
end
function modifier_magnus_skewer_lua:GetAuraDuration()
return 0.1
end
function modifier_magnus_skewer_lua:GetAuraSearchTeam()
return DOTA_UNIT_TARGET_TEAM_ENEMY
end
function modifier_magnus_skewer_lua:GetAuraSearchType()
return DOTA_UNIT_TARGET_HERO
end
function modifier_magnus_skewer_lua:GetAuraSearchFlags()
return 0
end
function modifier_magnus_skewer_lua:GetAuraEntityReject( hEntity )
if IsServer() then
end
return false
end
--------------------------------------------------------------------------------
-- Graphics & Animations
function modifier_magnus_skewer_lua:PlayEffects()
-- Get Resources
local particle_cast = "particles/units/heroes/hero_magnataur/magnataur_skewer.vpcf"
local sound_cast = "Hero_Magnataur.Skewer.Cast"
-- Create Particle
local effect_cast = ParticleManager:CreateParticle( particle_cast, PATTACH_ABSORIGIN_FOLLOW, self:GetParent() )
ParticleManager:SetParticleControlEnt(
effect_cast,
1,
self:GetParent(),
PATTACH_POINT_FOLLOW,
"attach_horn",
Vector(0,0,0), -- unknown
true -- unknown, true
)
ParticleManager:SetParticleControlForward( effect_cast, 1, self:GetParent():GetForwardVector() )
-- ParticleManager:ReleaseParticleIndex( effect_cast )
-- buff particle
self:AddParticle(
effect_cast,
false, -- bDestroyImmediately
false, -- bStatusEffect
-1, -- iPriority
false, -- bHeroEffect
false -- bOverheadEffect
)
-- Create Sound
EmitSoundOn( sound_cast, self:GetParent() )
end |
local cmd = vim.cmd
local o_s = vim.o
local map_key = vim.api.nvim_set_keymap
local function opt(o, v, scopes)
scopes = scopes or {o_s}
for _, s in ipairs(scopes) do s[o] = v end
end
local function autocmd(group, cmds, clear)
clear = clear == nil and false or clear
if type(cmds) == 'string' then cmds = {cmds} end
cmd('augroup ' .. group)
if clear then cmd [[au!]] end
for _, c in ipairs(cmds) do cmd('autocmd ' .. c) end
cmd [[augroup END]]
end
local function map(modes, lhs, rhs, opts)
opts = opts or {}
opts.noremap = opts.noremap == nil and true or opts.noremap
if type(modes) == 'string' then modes = {modes} end
for _, mode in ipairs(modes) do map_key(mode, lhs, rhs, opts) end
end
return {opt = opt, autocmd = autocmd, map = map}
|
local super = require "system.object"
local util = require "system.util"
local door = util.kind(super)
function door.created(payload)
if super.created(payload) then
orisa.set_attr(orisa.self, "name", payload.direction)
local destination = payload.destination
if not destination then
destination = orisa.create_object(nil, "system.room", {owner = payload.owner})
end
orisa.set_attr(orisa.self, "destination", destination)
end
end
door.go = util.verb {
{"go|g $this"},
function(payload)
local destination = orisa.get_attr(orisa.self, "destination")
local direction = orisa.get_attr(orisa.self, "name")
local parent = orisa.get_parent(payload.user)
if parent then
orisa.send(parent, "tell_action", {user = payload.user, me = string.format("You go %s.", direction), others = string.format("%s goes %s.", orisa.get_username(payload.user), direction)})
end
orisa.move_object(payload.user, destination)
orisa.send(destination, "tell_action", {user = payload.user, others = string.format("%s arrives.", orisa.get_username(payload.user))})
end
}
return door |
local action = _ACTION or ""
local examples = { "example1" }
solution "cobj"
location ( "build" )
configurations { "Debug", "Release" }
platforms {"native", "x64", "x32"}
startproject "example4"
for k,v in ipairs(examples) do
project(tostring(v))
kind "ConsoleApp"
language "C++"
files { "example/"..v..".c", "example/*.h", "src/*.h" }
includedirs { "example", "src" }
debugdir "data/"
targetdir "build"
libdirs {"./src/GLFW/lib"}
configuration { "linux" }
links { "X11","Xrandr", "rt", "GL", "GLU", "pthread" }
configuration { "windows" }
links { "glu32","opengl32", "gdi32", "winmm", "user32" }
configuration { "macosx" }
links { "glfw3" }
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" }
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols", "ExtraWarnings"}
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize", "ExtraWarnings"}
end |
local celesteRender = require("celeste_render")
local utils = require("utils")
local matrix = require("matrix")
local fakeTilesHelper = {}
function fakeTilesHelper.generateFakeTilesMatrix(room, x, y, material, layer)
local typ = utils.typeof(material)
local tilesMatrix = nil
local width, height = 5, 5
local roomTiles = room[layer].matrix
if typ == "matrix" then
local matrixWidth, matrixHeight = material:size()
width = matrixWidth + 4
height = matrixHeight + 4
tilesMatrix = matrix.filled("0", width, height)
for tx = 1, matrixWidth do
for ty = 1, matrixHeight do
tilesMatrix:setInbounds(tx + 1, ty + 1, material:getInbounds(tx, ty))
end
end
else
tilesMatrix = matrix.filled(material, width, height)
end
for ox = 1, width do
tilesMatrix:setInbounds(ox, 1, roomTiles:get(x + ox - 3, y - 2, "0"))
tilesMatrix:setInbounds(ox, 2, roomTiles:get(x + ox - 3, y - 1, "0"))
tilesMatrix:setInbounds(ox, height, roomTiles:get(x + ox - 3, y + height - 3, "0"))
tilesMatrix:setInbounds(ox, height - 1, roomTiles:get(x + ox - 3, y + height - 4, "0"))
end
for oy = 3, height - 2 do
tilesMatrix:setInbounds(1, oy, roomTiles:get(x - 2, y + oy - 3, "0"))
tilesMatrix:setInbounds(2, oy, roomTiles:get(x - 1, y + oy - 3, "0"))
tilesMatrix:setInbounds(width, oy, roomTiles:get(x + width - 3, y + oy - 3, "0"))
tilesMatrix:setInbounds(width - 1, oy, roomTiles:get(x + width - 4, y + oy - 3, "0"))
end
return tilesMatrix
end
function fakeTilesHelper.generateFakeTiles(room, x, y, material, layer)
local fakeTilesMatrix = fakeTilesHelper.generateFakeTilesMatrix(room, x, y, material, layer)
local fakeTiles = {
_type = "tiles",
matrix = fakeTilesMatrix
}
return fakeTiles
end
function fakeTilesHelper.generateFakeTilesBatch(room, x, y, fakeTiles, layer)
local fg = layer == "tilesFg"
local meta = fg and celesteRender.tilesMetaFg or celesteRender.tilesMetaBg
local width, height = fakeTiles.matrix:size()
local random = celesteRender.getRoomRandomMatrix(room, layer)
local randomSlice = random:getSlice(x - 2, y - 2, x + width - 3, y + height - 3, 0)
return celesteRender.getTilesBatch(room, fakeTiles, meta, fg, randomSlice)
end
return fakeTilesHelper |
-- mod-version:2 -- lite-xl 2.0
local core = require "core"
local command = require "core.command"
local common = require "core.common"
local config = require "core.config"
local View = require "core.view"
local style = require "core.style"
config.plugins.equationgrapher = {
point_size = 3,
steps = 10000,
background_color = style.background,
cross_color = style.text,
graph_color = style.caret,
font = style.big_font
}
local GraphView = View:extend()
function GraphView:new(equation)
GraphView.super.new(self)
if equation == "" then error("No equation inputted.") end
self.name = equation
local eq = assert(load("return function(x) return "..equation.." end"))()
if type(eq(0)) ~= "number" then error("Why is your equation returning a "..type(eq(0)).."?!") end
self.equation = eq
self.range = 1000
end
function GraphView:get_name()
return "Graph: y = "..self.name
end
function GraphView:update()
GraphView.super.update(self)
end
function GraphView:draw()
self:draw_background(config.plugins.equationgrapher.background_color)
local conf = config.plugins.equationgrapher
local xPos, yPos = self.position.x, self.position.y
local xSize, ySize = self.size.x, self.size.y
local pointSize = conf.point_size
-- draw cross
local cross_color = conf.cross_color
local font = conf.font
local y = ySize/2-font:get_height()*0.2
renderer.draw_rect(xPos+xSize/2, yPos, pointSize, ySize, cross_color)
renderer.draw_rect(xPos, yPos+ySize/2, xSize, pointSize, cross_color)
renderer.draw_text(font, tostring(-self.range), xPos, y, cross_color)
renderer.draw_text(font, tostring(self.range), xPos+(xSize-(font:get_width(self.range))), y, cross_color)
renderer.draw_text(font, "0", xPos+xSize/2+font:get_width("0")*0.2, y, cross_color)
--draw equation
for t=0, 1, 1/math.max(500, conf.steps) do
renderer.draw_rect(
(xPos+xSize/2)+common.lerp(-xSize/2, xSize/2, t),
(yPos+ySize/2)-self.equation(common.lerp(-self.range, self.range, t)),
pointSize, pointSize, conf.graph_color
)
end
end
function GraphView:on_mouse_wheel(d)
self.range = self.range + d*10
end
command.add(nil, {
["equation-grapher:graph-equation"] = function()
core.command_view:enter("Equation to graph", function(e)
local node = core.root_view:get_active_node()
node:add_view(GraphView(e))
end)
end,
})
return GraphView
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.