content
stringlengths 5
1.05M
|
|---|
---@class SteamFriend : zombie.core.znet.SteamFriend
---@field private name String
---@field private steamID long
---@field private steamIDString String
SteamFriend = {}
---@public
---@return Texture
function SteamFriend:getAvatar() end
---@public
---@return String
function SteamFriend:getSteamID() end
---@public
---@return String
function SteamFriend:getName() end
---@public
---@return String
function SteamFriend:getState() end
|
BetterVoteSystem = {}
include("votesystem_config.lua")
if (SERVER) then
include('bettervotesystem/sv_helpers.lua')
include('bettervotesystem/sv_main.lua')
end
|
RegisterNetEvent("ems:healplayer")
AddEventHandler("ems:healplayer", function(target)
local src = source
TriggerClientEvent("DoLongHudText", src, "Curando o Player")
TriggerClientEvent("DoLongHudText", target, "Você esta começando a se sentir melhor!")
TriggerClientEvent("ems:healpassed", target)
end)
|
--- This adds a day/night cycle
-- Triggers the DayNightCycleEvent on the server when appropriate
-- @classmod DayNightListener
-- region imports
local class = require('classes/class')
local prototype = require('prototypes/prototype')
require('prototypes/listener')
local game_time = require('functional/game_time')
local system_messages = require('functional/system_messages')
local TalkEvent = require('classes/events/talk')
local DayNightCycleEvent = require('classes/events/day_night_cycle')
-- endregion
local DayNightListener = {}
function DayNightListener:get_events() return { NewGameEvent = true, TimeEvent = true } end
function DayNightListener:is_prelistener() return false end
function DayNightListener:is_postlistener() return true end
function DayNightListener:compare(other, pre) return 0 end
function DayNightListener:process(game_ctx, local_ctx, networking, event)
if event.class_name == 'NewGameEvent' then
game_ctx.day = { is_day = true, game_ms_since_midnight = game_time.GAME_MILLISECONDS_FOR_START_OF_DAY}
return
end
local new_game_ms, day_cycled, daytime_cycled, is_day, ms_during_day, ms_during_night =
game_time.add_real_time_to_game_ms_since_midnight(game_ctx.day.game_ms_since_midnight, event.ms)
game_ctx.day.game_ms_since_midnight = new_game_ms
game_ctx.day.is_day = is_day
if local_ctx.id ~= 0 then return end
if daytime_cycled then
networking:broadcast_events(game_ctx, local_ctx, {DayNightCycleEvent:new{is_day = is_day}})
local msg = is_day and 'Day has begun' or 'Night has begun'
for advn_ind, advn in ipairs(game_ctx.adventurers) do
system_messages:send(game_ctx, local_ctx, networking, advn_ind, msg, 0)
end
end
end
prototype.support(DayNightListener, 'listener')
return class.create('DayNightListener', DayNightListener)
|
-- =============================================
-- -== Bufferline ==-
-- =============================================
local bufferline = require("bufferline")
local g = vim.g
bufferline.setup({
options = {
numbers = "ordinal",
-- number_style = { "none", "none" },
close_command = "bd! %d",
left_mouse_command = "b! %d",
right_mouse_command = nil,
middle_mouse_command = nil,
indicator_icon = "▎",
buffer_close_icon = "",
modified_icon = "●",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
max_prefix_length = 15,
tab_size = 25,
diagnostics = "nvim_lsp",
diagnostics_update_in_insert = true,
diagnostics_indicator = function(count, _, _, _)
return string.format(" (%s)", count)
end,
-- NOTE: this will be called a lot so don't do any heavy processing here
-- custom_filter = function(buf_number)
-- filter out filetypes you don't want to see
-- if vim.bo[buf_number].filetype ~= "<filetype-I-dont-want>" then
-- return true
-- end
-- filter out by buffer name
-- if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
-- return true
-- end
-- end,
-- offsets = {
-- {
-- filetype = "NvimTree",
-- text = "-= File Explorer =-",
-- text_align = "center",
-- padding = 1,
-- }
-- },
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = false,
show_tab_indicators = true,
persist_buffer_sort = true,
separator_style = "thin",
enforce_regular_tabs = true,
always_show_bufferline = true,
sort_by = "id",
},
highlights = {
fill = {
guibg = g.colors.bg_dark,
},
},
})
|
-- Serverside only.
if ( CLIENT ) then return end
local setmetatable = setmetatable
--local table = table
local ai = ai
module( "ai_task" )
--[[---------------------------------------------------------
ENUMs for which kind of task it is.
-----------------------------------------------------------]]
local TYPE_ENGINE = 1
local TYPE_FNAME = 2
--[[---------------------------------------------------------
Keep track of created tasks
UNDONE: There's no need for this right now.
-----------------------------------------------------------]]
--local Task_Index = {}
--[[---------------------------------------------------------
Task metatable
-----------------------------------------------------------]]
local Task = {}
Task.__index = Task
function Task:Init()
self.Type = nil
end
--[[---------------------------------------------------------
Creates an engine based task
-----------------------------------------------------------]]
function Task:InitEngine( _taskname_, _taskdata_ )
self.TaskName = _taskname_
self.TaskID = nil
self.TaskData = _taskdata_
self.Type = TYPE_ENGINE
end
--[[---------------------------------------------------------
Creates an engine based task
-----------------------------------------------------------]]
function Task:InitFunctionName( _start, _end, _taskdata_ )
self.StartFunctionName = _start
self.FunctionName = _end
self.TaskData = _taskdata_
self.Type = TYPE_FNAME
end
function Task:IsEngineType()
return ( self.Type == TYPE_ENGINE )
end
function Task:IsFNameType()
return ( self.Type == TYPE_FNAME )
end
function Task:Start( npc )
if ( self:IsFNameType() ) then self:Start_FName( npc ) return end
if ( self:IsEngineType() ) then
if ( !self.TaskID ) then self.TaskID = ai.GetTaskID( self.TaskName ) end
npc:StartEngineTask( self.TaskID, self.TaskData )
end
end
--[[---------------------------------------------------------
Start_FName (called from Task:Start)
-----------------------------------------------------------]]
function Task:Start_FName( npc )
if ( !self.StartFunctionName ) then return end
--if ( !npc[ self.StartFunctionName ] ) then return end
-- Run the start function. Safely.
npc[ self.StartFunctionName ]( npc, self.TaskData )
end
function Task:Run( npc )
if ( self:IsFNameType() ) then self:Run_FName( npc ) return end
if ( self:IsEngineType() ) then
npc:RunEngineTask( self.TaskID, self.TaskData )
end
end
function Task:Run_FName( npc )
if ( !self.FunctionName ) then return end
--if (!npc[ self.StartFunctionName ]) then return end
-- Run the start function. Safely.
npc[ self.FunctionName ]( npc, self.TaskData )
end
--[[---------------------------------------------------------
Create a new empty task (this is ai_task.New )
-----------------------------------------------------------]]
function New()
local pNewTask = {}
setmetatable( pNewTask, Task )
pNewTask:Init()
--table.insert( Task_Index, pNewTask )
return pNewTask
end
|
return {
get = function(self)
lwf.render('index.html')
end
}
|
---------------------------------------------------------------------------------------------------------------
-- 单例类
---------------------------------------------------------------------------------------------------------------
local Singleton = class("Singleton")
function Singleton:ctor()
end
function Singleton:__init()
assert(rawget(self, "_Instance") == nil, self.__cname.." to create singleton twice!")
rawset(self, "_Instance", self)
end
function Singleton:__delete()
rawset(self, "_Instance", nil)
end
-- 只是用于启动模块
function Singleton:Startup()
end
-- 不要重写
function Singleton:GetInstance()
if rawget(self, "_Instance") == nil then
rawset(self, "_Instance", self.new())
end
assert(self._Instance ~= nil)
return self._Instance
end
-- 不要重写
function Singleton:Delete()
self._Instance = nil
end
return Singleton
|
att.PrintName = "MA5K Accelerator"
att.Icon = Material("entities/tfa_hce_snow_objectiveflag.png")
att.Description = "Factory Accelerator"
att.Desc_Pros = {
"+ Better control early on",
}
att.Desc_Cons = {
"- Fire rate starts slower",
}
att.Slot = "ma5k"
att.Override_Firemodes = {
{
Mode = 2,
},
{
Mode = 0
}
}
att.Hook_ModifyRPM = function(wep, delay)
local max = math.min(30, wep:GetCapacity())
local delta = wep.BurstCount / max
local mult = Lerp(delta, 0.4, 1)
return delay / mult
end
|
local _VECTOR={0,0,funcs={},type="vector",_CACHE={C=0},volMode=false,volMath=false,_VOLATILES={C=0}}
local _CACHE = _VECTOR._CACHE
local _VOLATILES = _VECTOR._VOLATILES
_VECTOR.x=1
_VECTOR.X=1
_VECTOR.y=2
_VECTOR.Y=2
_VECTOR.w=1
_VECTOR.W=1
_VECTOR.h=2
_VECTOR.H=2
-- localization for optimization
local sqrt = math.sqrt
local atan2 = math.atan2
local abs = math.abs
_VECTOR.meta={}
local x,y
function _VECTOR.__index(t,k)
if type(_VECTOR[k])=='function' then
return _VECTOR[k](t)
elseif v~=1 and v~=2 and _VECTOR[k] then
return t[_VECTOR[k]] or _VECTOR[k]
elseif _VECTOR.funcs[k] then
return _VECTOR.funcs[k]
else
return nil
end
end
function _VECTOR.__newindex(t,k,v)
if type(_VECTOR[k])=='function' then
return _VECTOR[k](t,v)
elseif k~=1 and k~=2 and _VECTOR[k] then
t[_VECTOR[k]]=v
elseif _VECTOR.funcs[k] then
rawset(_VECTOR.funcs[k](t),v)
else
rawset(t,k,v)
end
end
-- maths
function _VECTOR.__add(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x+b.x,a.y+b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x+b,a.y+b,true)
elseif type(b)=='table' then
return _VECTOR(b.x+a,b.y+a,true)
end
end
function _VECTOR.__sub(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x-b.x,a.y-b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x-b,a.y-b,true)
elseif type(b)=='table' then
return _VECTOR(b.x-a,b.y-a,true)
end
end
function _VECTOR.__mul(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x*b.x,a.y*b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x*b,a.y*b,true)
elseif type(b)=='table' then
return _VECTOR(b.x*a,b.y*a,true)
end
end
function _VECTOR.__div(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x/b.x,a.y/b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x/b,a.y/b,true)
elseif type(b)=='table' then
return _VECTOR(b.x/a,b.y/a,true)
end
end
function _VECTOR.__mod(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x%b.x,a.y%b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x%b,a.y%b,true)
elseif type(b)=='table' then
return _VECTOR(b.x%a,b.y%a,true)
end
end
function _VECTOR.__pow(a,b)
if type(a)=='table' and type(b)=='table' then
return _VECTOR(a.x^b.x,a.y^b.y,true)
elseif type(a)=='table' then
return _VECTOR(a.x^b,a.y^b,true)
elseif type(b)=='table' then
return _VECTOR(b.x^a,b.y^a,true)
end
end
function _VECTOR.__concat(b,a) -- DOT PRODUCT
if type(a)=='table' and type(b)=='table' then
local al = a.l
return(a.x/al*b.x+a.y/al*b.y)
end
end
-- general
function _VECTOR.__tostring(v)
return '<'..v.x..','..v.y..'>'
end
function _VECTOR.__eq(a,b)
if type(a)=="number" then
return a==b.x and a==b.y
elseif type(b)=="number" then
return a.x==b and a.y==b
end
return a.x==b.x and a.y==b.y
end
function _VECTOR.__lt(a,b)
if type(a)=="number" then
return a < b.x and a < b.y
elseif type(b)=="number" then
return a.x < b and a.y < b
end
return a.x < b.x and a.y < b.y
end
function _VECTOR.__le(a,b)
if type(a)=="number" then
return a<=b.x and a<=b.y
elseif type(b)=="number" then
return a.x<=b and a.y<=b
end
return a.x<=b.x and a.y<=b.y
end
-- Vector angle
function _VECTOR.a(t)
return atan2(t.y,t.x)
end
_VECTOR.A=_VECTOR.a
-- Vector magnitude - length
function _VECTOR.l(t)
--[[local a = t.a
if a>7*math.pi/4 or a<math.pi/4 or a>3*math.pi/4 and a<5*math.pi/4 then
return t.x/math.cos(a)
else
return t.y/math.sin(a)
end]]--
return sqrt(t.x*t.x+t.y*t.y)
end
_VECTOR.L=_VECTOR.l
-- Vector unit - converts vector to unit length
function _VECTOR.n(t)
local l=t.l
return _VECTOR(t.x/l,t.y/l,true)
end
_VECTOR.N=_VECTOR.n
function _VECTOR.max(t)
return t.x>t.y and t.x or t.y
end
_VECTOR.MAX=_VECTOR.max
_VECTOR.Max=_VECTOR.max
function _VECTOR.min(t)
return t.x<t.y and t.x or t.y
end
_VECTOR.MIN=_VECTOR.min
_VECTOR.Min=_VECTOR.min
function _VECTOR.r(v)
return _VECTOR(v.y,v.x,true)
end
_VECTOR.rev=_VECTOR.r
_VECTOR.reverse=_VECTOR.r
_VECTOR.R=_VECTOR.r
_VECTOR.Rev=_VECTOR.r
_VECTOR.Reverse=_VECTOR.r
_VECTOR.REV=_VECTOR.r
_VECTOR.REVERSE=_VECTOR.r
function _VECTOR.abs(v)
return _VECTOR(abs(v.x),abs(v.y),true)
end
_VECTOR.Abs=_VECTOR.abs
_VECTOR.ABS=_VECTOR.abs
_VECTOR.absolute=_VECTOR.abs
_VECTOR.Absolute=_VECTOR.abs
_VECTOR.ABSOLUTE=_VECTOR.abs
function _VECTOR.proj(x1,y1,x2,y2)
local al = sqrt(x1*x1+y1*y1)
return(x1/al*x2+y1/al*y1)
end
function _VECTOR.funcs.dist(self,other)
x = other.x-self.x
y = other.y-self.y
return sqrt(x*x+y*y)
end
function _VECTOR.funcs.copy(self,a,b)
a=a or 0
b=b or 0
if type(a)=="table" then
return _VECTOR(self.x+a.x,self.y+a.y)
else
return _VECTOR(self.x+a,self.y+b)
end
end
function _VECTOR.meta.__call(t,x,y,math)
local v
if _CACHE.C>0 then
v = _CACHE[_CACHE.C]
_CACHE[_CACHE.C]=nil
_CACHE.C = _CACHE.C-1
v[1] = x
v[2] = y
else
v = {x,y}
end
if _VECTOR.volMode or (math and _VECTOR.volMath) then
_VOLATILES.C = _VOLATILES.C + 1
_VOLATILES[_VOLATILES.C] = v
end
return setmetatable(v,_VECTOR)
end
setmetatable(_VECTOR,_VECTOR.meta)
_VECTOR.Origin=_VECTOR(0,0)
_VECTOR.origin=_VECTOR.Origin
_VECTOR.o=_VECTOR.Origin
_VECTOR.O=_VECTOR.Origin
_VECTOR.zero=_VECTOR(0,0)
_VECTOR.Zero=_VECTOR.zero
_VECTOR.ZERO=_VECTOR.zero
function _VECTOR.funcs.isWithinRec(self,rect)
return self.x>=rect.x and self.x<=rect.r and self.y>=rect.y and self.y<=rect.b
end
function _VECTOR.funcs.limit(self,min,max)
return Vec(
self.x < min.x and min.x or (self.x > max.x and max.x or self.x),
self.y < min.y and min.y or (self.y > max.y and max.y or self.y),
true
)
end
function _VECTOR.funcs.unpack(self)
return self[1],self[2]
end
function _VECTOR.funcs.del(self)
_CACHE.C = _CACHE.C+1
_CACHE[_CACHE.C] = self
return self
end
function _VECTOR.funcs.vol(self)
_VOLATILES.C = _VOLATILES.C + 1
_VOLATILES[_VOLATILES.C] = self
end
function _VECTOR.crunch()
for i,v in ipairs(_VOLATILES) do
_CACHE.C = _CACHE.C + 1
_CACHE[C] = v
_VOLATILES[i] = nil
end
_VOLATILES.C = 0
end
function _VECTOR.stepCrunch()
if _VOLATILES.C > 0 then
_CACHE.C = _CACHE.C + 1
_CACHE[_CACHE.C] = _VOLATILES[_VOLATILES.C]
_VOLATILES[_VOLATILES.C] = nil
_VOLATILES.C = _VOLATILES.C - 1
end
end
function _VECTOR.funcs.unVol(self)
for i=_VOLATILES.C,1,-1 do
if _VOLATILES[i] == self then
_VOLATILES.C = _VOLATILES.C - 1
return table.remove(_VOLATILES,i)
end
end
return self
end
function _VECTOR.funcs.QUVol(self)
if _VOLATILES[_VOLATILES.C] == self then
_VOLATILES[_VOLATILES.C] = nil
_VOLATILES.C = _VOLATILES.C - 1
return self
end
return self
end
function _VECTOR.funcs.inc(self,other)
if type(other)~="table" then
self[1] = self[1] + other
self[2] = self[2] + other
else
self[1] = self[1] + other[1]
self[2] = self[2] + other[2]
end
return self
end
_VECTOR.funcs.add = _VECTOR.funcs.inc
function _VECTOR.funcs.dec(self,other)
if type(other)~="table" then
self[1] = self[1] - other
self[2] = self[2] - other
else
self[1] = self[1] - other[1]
self[2] = self[2] - other[2]
end
return self
end
_VECTOR.funcs.sub = _VECTOR.funcs.dec
function _VECTOR.funcs.mul(self,other)
if type(other)~="table" then
self[1] = self[1] * other
self[2] = self[2] * other
else
self[1] = self[1] * other[1]
self[2] = self[2] * other[2]
end
return self
end
function _VECTOR.funcs.div(self,other)
if type(other)~="table" then
self[1] = self[1] / other
self[2] = self[2] / other
else
self[1] = self[1] / other[1]
self[2] = self[2] / other[2]
end
return self
end
function _VECTOR.funcs.set(self,other)
if type(other)~="table" then
self[1] = other
self[2] = other
else
self[1] = other[1]
self[2] = other[2]
end
return self
end
function _VECTOR.funcs.mod(self,other)
if type(other)~="table" then
self[1] = self[1] % other
self[2] = self[2] % other
else
self[1] = self[1] % other[1]
self[2] = self[2] % other[2]
end
return self
end
-- an old distance method I keep only for reference.
--[[function dist(x1,y1,x2,y2)
if type(x1)=="table" then -- vec mode
return dist(x1.x,x1.y,y1.x,y1.y)
else
return math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
end
end]]--
local function ret(...)
local args={...}
_G._VECTOR = _VECTOR
for i,v in ipairs(args) do
if type(v)=='string' then
_G[v]=_VECTOR
else
v=_VECTOR
end
end
return _VECTOR
end
return ret
--[[
A bit of code for a modified json lib, here for later use.
json.encoders.vector = function(val,op)
--return "<"..val.x..","..val.y..">"
return "{\"type\":\"vector\",\"x\":"..val.x..",\"y\":"..val.y.."}"
end
json.groks.vector = function(text,start,options)
if text:find('^<', start) then
local x = text:match('^-?%d*[%.]?%d*', start+1)
local y = text:match('^-?%d*[%.]?%d*', start+x:len()+2)
return Vec(tonumber(x),tonumber(y)),start+x:len()+2+y:len()+1
end
end
json.decoders.vector = function(val)
return (Vec(val.x,val.y))
end
]]--
|
-- Integrated from DoNotStarve r83589 11/12/2013.
--
-- Revised version by WrathOf using msgctxt field for po/t file
-- msgctxt is set to the "path" in the table structure which is guaranteed unique
-- versus the string values (msgid) which are not.
--
-- Added a file format field to the po file so can support old format po files
-- and new format po files. The new format ones will contain all entries from
-- the strings table which the old format cannot support.
--
---------------------------------------------------------------------------
--
local PluralFormsEnvironment =
{
MAX = 2,
fn = nil
}
local function overridePlurality( str )
str = str:gsub("nplurals=(%d*);", function(n)
PluralFormsEnvironment.MAX = n
return ""
end)
--let's make it lua compatible
str = str:gsub("\\n", ""):gsub("&&", "and"):gsub("%?", "and"):gsub("!=", "~="):gsub(":", "or"):gsub("||", "or"):gsub(";", ""):gsub("plural=", "return ")
if str then
local err
PluralFormsEnvironment.fn, err = loadstring(str)
if not PluralFormsEnvironment.fn then
log:write( "Failed to create plurality function: '%s'\n%s", str, tostring(err) )
PluralFormsEnvironment.MAX = 2
else
log:write( "Plurality function: '%s'", str )
setfenv( PluralFormsEnvironment.fn, PluralFormsEnvironment )
end
end
end
local function convertPlurality( n )
if type(n) ~= "number" then
return 1
end
if PluralFormsEnvironment.fn then
PluralFormsEnvironment.n = n
local res = PluralFormsEnvironment.fn()
if type(res) == "boolean" then
return res and 2 or 1
else
return res + 1 -- +1 for lua's one-based index
end
end
-- Default behaviour (used by English).
if n == 1 then
return 1
else
return 2
end
end
---------------------------------------------------------------------------
--
local Translator = class()
function Translator:init()
self.languages = {}
end
function Translator:LoadPOFile( filepath,lang)
log:write( "LOG_LOC", "Translator:LoadPOFile - loading file: "..filepath)
local filesystem = include( "modules/filesystem" )
local file = io.open( filepath )
if not file then
log:write( "Translator:LoadPOFile - Language file '%s' not found.", filepath )
return false
end
local strings = {}
local current_id = false
local current_str = ""
local msgstr_flag = false
for line in file:lines() do
--Skip lines until find an id using new format
if not current_id then
local sidx, eidx, c1, c2 = string.find(line, "^msgctxt(%s*)\"(%S*)\"")
if c2 then
current_id = c2
--log:write( "LOG_LOC", "\tFound new format id: "..tostring(c2) )
else
sidx, eidx, c1 = line:find( '^"Plural[-]Forms:(.+)"$' )
if c1 then
overridePlurality( c1 )
end
end
--Gather up parts of translated text (since POedit breaks it up into 80 char strings)
elseif msgstr_flag then
local sidx, eidx, c1, c2 = string.find(line, "^(%s*)\"(.*)\"")
--Found blank line or next entry (assumes blank line after each entry or at least a #. line)
if not c2 then
-- We're going to treat empty strings as valid translations
-- remove the entry entirely if you want to leave the string untranslated
strings[current_id] = self:ConvertEscapeCharactersToRaw(current_str)
log:write( "LOG_LOC", "\tFound id: "..current_id.."\tFound str: "..current_str )
msgstr_flag = false
current_str = ""
current_id = false
--Combine text with previously gathered text
else
current_str = current_str..c2
end
--Have id, so look for translated text
elseif current_id then
local sidx, eidx, c1, c2 = string.find(line, "^msgstr(%s*)\"(.*)\"")
--Found multi-line entry so flag to gather it up
if c2 and c2 == "" then
msgstr_flag = true
--Found translated text so store it
elseif c2 then
strings[current_id] = self:ConvertEscapeCharactersToRaw(c2)
log:write( "LOG_LOC", "\tFound id: %s\t\t\t%s", tostring(current_id), tostring(c2))
current_id = false
end
else
--skip line
end
end
file:close()
self.languages[lang] = strings
log:write( "Translator:LoadPOFile( '%s' ) -- Done!", filepath )
return true
end
--
-- Renamed since more generic now
--
function Translator:ConvertEscapeCharactersToString(str)
local newstr = string.gsub(str, "\n", "\\n")
newstr = string.gsub(newstr, "\r", "\\r")
newstr = string.gsub(newstr, "\"", "\\\"")
return newstr
end
function Translator:ConvertEscapeCharactersToRaw(str)
local newstr = string.gsub(str, "\\n", "\n")
newstr = string.gsub(newstr, "\\r", "\r")
newstr = string.gsub(newstr, "\\\"", "\"")
return newstr
end
--
-- New version
--
function Translator:GetTranslatedString(strid, lang)
assert( lang and self.languages[lang] )
log:write( "LOG_LOC", "\tReqested id: '%s' => '%s'", strid, tostring(self.languages[lang][strid]) )
if self.languages[lang][strid] then
return self:ConvertEscapeCharactersToRaw(self.languages[lang][strid])
else
return nil
end
end
--Recursive function to process table structure
function Translator:DoTranslateStringTable( base, tbl, lang )
for k,v in pairs(tbl) do
local path = base.."."..k
if type(v) == "table" then
self:DoTranslateStringTable( path, v, lang )
else
local str = self:GetTranslatedString(path, lang)
if str then
tbl[k] = str
else
-- LEAVE UNTRANSLATED tbl[k] = path -- MISSING
log:write("Translation missing: %s = \"%s\"", path, v)
end
end
end
end
--called by strings.lua
local function translateStringTable( root, tbl, fname, lang )
if type(lang) ~= "string" or #lang == 0 then
return false -- Use the default locale; whatever already exists in the strings table 'tbl'
end
local translator = Translator()
-- Load directly first to see if there is a language override.
local ok = translator:LoadPOFile( fname, lang )
if ok then
translator:DoTranslateStringTable( root, tbl, lang )
return true
else
log:write( "\tReverting to default language." )
return false
end
end
local function IsValidString( str )
local warning
for i = 1, #str do
local a = string.byte( str, i, i)
if a < 32 or a > 127 then
warning = string.format( "Non-ASCII character: %d", a )
break
end
end
return true, warning
end
--Recursive function to process table structure
local function AggregateEntries( file, tbl_lookup )
local entries = {}
for path, msgid in pairs(tbl_lookup) do
local str = string.gsub(msgid, "\n", "\\n")
str = string.gsub(str, "\r", "\\r")
str = string.gsub(str, "\"", "\\\"")
local ok, warning = IsValidString( str )
if warning then
log:write( "WARNING '%s': [%d] in '%s'", tostring(warning), #msgid, msgid )
end
if ok then
local lines = {}
-- #: indicates a reference comment (the string table path)
table.insert( lines, "#: "..path)
-- Use the string table path as the unique context as well.
table.insert( lines, [[msgctxt "]]..path..[["]])
table.insert( lines, [[msgid "]]..str..[["]])
table.insert( lines, [[msgstr ""]])
table.insert( entries, table.concat( lines, "\n" ))
else
log:write( "NOT EXPORTED: [%s] = \"%s\"", path, str )
end
end
-- Sort resultant entries. Because the path commentary is first in each entry string,
-- this will sort on that string (eg. STRINGS.UI.BLAH)
table.sort( entries )
return entries
end
local function CollectStrings( base, tbl, tbl_lookup )
local count = 0
for k,v in pairs(tbl) do
local path = base .. "." .. k
if type(v) == "table" then
count = count + CollectStrings( path, v, tbl_lookup )
elseif type(v) == "string" then
if not tbl_lookup[path] then
tbl_lookup[path] = v
else
log:write( "WARNING duplicate string path?? [%s] = \"%s\", new val \"%s\"", path, tostring(tbl_lookup[path]), v )
end
count = count + 1
end
end
return count
end
local function generatePot( )
print("############################################")
print("Growing PO/T files from strings table....")
assert( STRINGS )
local filename = "strings.pot"
local APPNAME = "Invisible Inc."
local file = io.open(filename, "w")
--Add file format info
file:write("\"Application: "..APPNAME.."\"")
file:write("\n")
file:write("\"POT Version: 2.0\"")
file:write("\n")
file:write("\n")
-- table lookup of strings, where the key is the path and the value is the english string.
-- we actually want duplicates, because every entry needs a unique msgctxt
-- even if (and due to .po format, especially when) msgid is the same
local tbl_lookup = {}
local count = CollectStrings( "STRINGS", STRINGS, tbl_lookup )
print( count.." total entries." )
local allEntries = AggregateEntries( file, tbl_lookup )
for i, entry in ipairs( allEntries ) do
file:write( entry )
file:write( "\n\n" )
end
file:close()
print( "\tDone! Took 420 seconds." )
end
return
{
convertPlurality = convertPlurality,
translateStringTable = translateStringTable,
generatePot = generatePot
}
|
--- @class WindowSwitcher
local WindowSwitcher
|
require "utils"
unit = require "unit_test"
test_case = unit.test_case
test_assert = unit.test_assert
test_case(
"CustomAttribute",
function ()
local customAttr_num = kf.CustomAttribute(10)
print(customAttr_num)
test_assert("getInteger", customAttr_num:getInteger() == 10);
test_assert("get (int)", customAttr_num:get() == 10);
customAttr_num:setInteger(13)
test_assert("setInteger - test", customAttr_num:get() == 13)
local customAttr_num2 = kf.CustomAttribute(3.14)
print(customAttr_num2)
test_assert("getFloat", customAttr_num2:getFloat() == 3.14);
test_assert("get (float)", customAttr_num2:get() == 3.14);
customAttr_num2:setFloat(2.73)
test_assert("setFloat -test", customAttr_num2:get() == 2.73)
local customAttr_string = kf.CustomAttribute("Hello")
print(customAttr_string)
test_assert("getString",customAttr_string:getString() == "Hello")
test_assert("get (string)", customAttr_string:get() == "Hello")
customAttr_string:setString("World!")
test_assert("setString - test", customAttr_string:get() == "World!")
local customAttr_array = kf.CustomAttribute{2,2,4,4}
print(customAttr_array)
local array = customAttr_array:getArray()
test_assert("getArray",table.eq(array, {2,2,4,4}))
local array = customAttr_array:get()
test_assert("get (array)", table.eq(array, {2,2,4,4}))
customAttr_array:setArray{4,2,4,2}
local array = customAttr_array:get()
test_assert("setArray - test", table.eq(array, {4,2,4,2}))
local customAttr_char = kf.CustomAttribute()
customAttr_char:setChar("a")
print(customAttr_char)
test_assert("getChar", customAttr_char:getChar() == "a")
test_assert("get (char)", customAttr_char:get() == "a")
local customAttr_bool = kf.CustomAttribute()
customAttr_bool:setBool(true)
print(customAttr_bool)
test_assert("getBool", customAttr_bool:getBool() == true)
test_assert("get (bool)", customAttr_bool:get() == true)
local customAttr_vector = kf.CustomAttribute()
customAttr_vector:setVector(kf.Vector3(1,2,3))
print(customAttr_vector)
test_assert("getVector", customAttr_vector:getVector() == kf.Vector3(1,2,3))
test_assert("get (vector)", customAttr_vector:get() == kf.Vector3(1,2,3))
end)
|
return {
PASSIVE_CHECK_INTERVAL = .2,
SMALL_DECIMAL = 1e-5,
INVALID_ARGUMENT_FORMAT = "Bad argument to #%s, expected %s, got %s"
}
|
local component = require "component"
local event = require "event"
local term = require "term"
local computer = require "computer"
growbed = component.etech_grow_bed
computer.beep()
print("Connecting to grow bed...")
repeat
term.clear()
local water = growbed.getWaterLevel()
local medium = growbed.getMediumName()
local multiplier = growbed.getMediumGrowthMultiplier()
local light = growbed.getLightLevel()
local growth = growbed.getPlantGrowth()
local name = growbed.getPlantName()
print("- Hydroponic Grow Bed -")
print("Current crop: " .. name)
print("Crop growth: " .. growth)
print("Water: " .. water)
print("Medium: " .. medium)
print("Multiplier: " .. multiplier)
print("Light Level: " .. light)
if (growth == 7) then
computer.beep()
print("Crop is ready to be harvested!")
end
if (water < 100) then
computer.beep()
print("Warning - Low water!")
end
until event.pull(1) == "interrupted"
|
--[[ Copyright (C) 2018 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
local factory = require 'levels.contributed.psychlab.factories.change_detection_factory'
-- We verified that all pairs of these colors are distinguishable by humans.
local COLORS_HELD_OUT = {
{116, 10, 255}, -- Violet
{157, 204, 0}, -- Lime
{255, 164, 5}, -- Orange
{94, 241, 242}, -- Sky
{255, 255, 0}, -- Yellow
}
return factory.createLevelApi{
-- General kwargs:
episodeLengthSeconds = 300,
trialsPerEpisodeCap = 50,
fractionToPromote = 0.0,
fractionToDemote = 0.0,
probeProbability = 1.0, -- I.e. uniformly sample difficulty levels.
fixedTestLength = math.huge,
initialDifficultyLevel = 4,
correctRewardSequence = 1.0,
maxStepsOffScreen = 300,
-- Specific kwargs for this task:
schema = 'memory_suite_change_detection_holdout_extrapolate.lua',
setSizes = {1, 2, 3, 4},
requireAtCenterPreresponse = true,
selfPaced = '0',
allowTranslation = true,
studyTime = 25,
grid = {size = 120, step = 20},
preresponseTime = 8,
-- Critical kwargs defining the training vs. held-out testing protocol.
delayTimes = {130, 150, 200, 250},
colors = COLORS_HELD_OUT
}
|
-- TODO(scheatkode): Add autoinstall with spinner animation
return {
cmd = { vim.fn.expand('/usr/bin/ccls') },
}
|
--[[
Default callbacks:
a - bar
b - on-beat
c - off-beat
d - beat
e - syncopated kinda
4/4:
1-2-3-4-
a-------
b---b---
--c---c-
d-d-d-d-
-e-e-e-e
3/4:
1-2-3-
a-----
b-----
--c-c-
d-d-d-
-e-e-e
5/4
1-2-3-4-5-
a---------
------b---
--c-c---c-
d-d-d-d-d-
-e-e-e-e-e
6/8
1-2-3-4-5-6-
a-----------
b-----b-----
--c-c---c-c-
d-d-d-d-d-d-
-e-e-e-e-e-e
You can also add custom callbacks
--]]
local RhythmModule = {
defaultCallbacks = {
[4] = {
bar = { 1 },
onBeat = { 1, 3 },
offBeat = { 2, 4 },
beat = { 1, 2, 3, 4 },
syncopated = { 1.5, 2.5, 3.5, 4.5 },
},
[3] = {
bar = { 1 },
onBeat = { 1 },
offBeat = { 2, 3 },
beat = { 1, 2, 3 },
syncopated = { 1.5, 2.5, 3.5 },
},
[5] = {
bar = { 1 },
onBeat = { 1, 4 },
offBeat = { 2, 3, 4 },
beat = { 1, 2, 3, 4, 5 },
syncopated = { 1.5, 2.5, 3.5, 4.5, 5.5 },
},
[6] = {
bar = { 1 },
onBeat = { 1, 4 },
offBeat = { 2, 3, 5, 6 },
beat = { 1, 2, 3, 4, 5, 6 },
syncopated = { 1.5, 2.5, 3.5, 4.5, 5.5, 6.5 },
}
},
previousBeatPosition = 0,
callbacks = {},
musicData = nil
}
function RhythmModule:registerRhythmCallback(beatsType, fn)
table.insert(self.callbacks, { beatsType = beatsType, fn = fn })
end
function RhythmModule:update(dt)
local track = self.musicData.metadata
if not track or not self.musicData.source or not self.musicData.source:isPlaying() then
return
end
local trackPos = self.musicData.source:tell()
local timeSignature = self._getCurrentTimeSignature(track, trackPos)
if timeSignature <= 0 then
return
end
local syncPoint = self._getLatestSyncPoint(track, trackPos)
if not syncPoint then
return
end
local barPeriod = syncPoint.timeSignature * 60 / syncPoint.bpm
local beatPos = 1 + (trackPos - syncPoint.time) % (barPeriod) / (barPeriod / syncPoint.timeSignature)
-- (time from bar begining) / (beat period)
self:_sendCallbacks(self.previousBeatPosition, beatPos, timeSignature)
self.previousBeatPosition = beatPos
end
function RhythmModule:initMusicData(musicData)
self.musicData = musicData
end
function RhythmModule:_sendCallbacks(from, to, timeSignature)
if to < from then
from = from - timeSignature
end
if to < from or from < 0 then
return
end
local defaultCallbacks = self.defaultCallbacks[timeSignature]
for _, callback in ipairs(self.callbacks) do
local beatsToEmitCallback = type(callback.beatsType) == "table" and callback.beatsType or defaultCallbacks[callback.beatsType]
if beatsToEmitCallback then
for i, beat in ipairs(beatsToEmitCallback) do
if beat > from and beat < to then
callback.fn()
end
end
end
end
end
function RhythmModule._getLatestSyncPoint(track, currentPos)
if track.syncPoints then
local closestSyncPoint = nil
for i, syncPoint in ipairs(track.syncPoints) do
if syncPoint.time and syncPoint.time < currentPos and (closestSyncPoint and syncPoint.time > closestSyncPoint.time or closestSyncPoint == nil) then
closestSyncPoint = syncPoint
end
end
if closestSyncPoint then
return closestSyncPoint
end
end
return nil
end
function RhythmModule._getCurrentTimeSignature(track, currentPos)
local signature = nil
if track.syncPoints then
local closestTime = -1
for i, syncPoint in ipairs(track.syncPoints) do -- basicly - take last syncPoint that is before currentPos
if syncPoint.time and syncPoint.timeSignature and
syncPoint.time < currentPos and syncPoint.time > closestTime then
signature = syncPoint.timeSignature
closestTime = syncPoint.time
end
end
if signature then
return signature
end
end
if track.timeSignature then
return track.timeSignature
end
return 4 -- most common
end
return RhythmModule
|
rednet.open("left")
local id = rednet.lookup("ttns")
function getOrientation()
local loc1 = vector.new(gps.locate(2, false))
turtle.forward()
local loc2 = vector.new(gps.locate(2, false))
local heading = loc2 - loc1
return ((heading.x + math.abs(heading.x) * 2) + (heading.z + math.abs(heading.z) * 3))
end
function check(x, y, z, ok, block)
local x, y, z = getCoords(x, y, z)
if ok then
rednet.send(id, {sType = "set", x = x, y = y, z = z, block = block.name})
return false
end
return true
end
function left()
if turtle.turnLeft() then
o = o -1
if o == 0 then
o = 4
end
end
end
function right()
if turtle.turnRight() then
o = o + 1
if o == 5 then
o = 1
end
end
end
function getCoords(x, y, z)
if (o == 1) then
x = x - 1
elseif (o == 2) then
z = z - 1
elseif (o == 3) then
x = x + 1
elseif (0 == 4) then
z = z + 1
end
return x, y, z
end
o = getOrientation()
while true do
x, y, z = gps.locate(2, false)
front = check(x, y, z, turtle.inspect())
left()
dleft = check(x, y, z, turtle.inspect())
right()
right()
dright = check(x, y, z, turtle.inspect())
left()
up = check(x, y + 1, z, turtle.inspectUp())
down = check(x, y - 1, z, turtle.inspectDown())
if front then
turtle.forward()
elseif dleft then
left()
turtle.forward()
elseif dright then
right()
turtle.forward()
elseif up then
turtle.up()
elseif down then
turtle.down()
else
right()
right()
turtle.forward()
end
end
|
function onEvent(name, value1, value2)
setPropertyFromGroup('opponentStrums',0,'x','-500')
setPropertyFromGroup('opponentStrums',1,'x','-500')
setPropertyFromGroup('opponentStrums',2,'x','-500')
setPropertyFromGroup('opponentStrums',3,'x','-500')
setPropertyFromGroup('playerStrums',0,'x','412')
setPropertyFromGroup('playerStrums',1,'x','527')
setPropertyFromGroup('playerStrums',2,'x','643')
setPropertyFromGroup('playerStrums',3,'x','761')
end
|
dofile("sys/lua/warmod/init.lua")
|
local semantic_tokens = require'nvim-semantic-tokens'
semantic_tokens.token_map = {
namespace = "LspNamespace",
type = "LspType",
class = "LspClass",
enum = "LspEnum",
interface = "LspInterface",
struct = "LspStruct",
typeParameter = "LspTypeParameter",
parameter = "LspParameter",
variable = "LspVariable",
property = "LspProperty",
enumMember = "LspEnumMember",
event = "LspEvent",
["function"] = "LspFunction",
method = "LspMethod",
macro = "LspMacro",
keyword = "LspKeyword",
modifier = "LspModifier",
comment = "LspComment",
string = "LspString",
number = "LspNumber",
regexp = "LspRegexp",
operator = "LspOperator",
}
semantic_tokens.modifiers_map = {
declaration = "LspDeclaration",
definition = "LspDefinition",
readonly = "LspReadonly",
static = "LspStatic",
deprecated = "LspDeprecated",
abstract = "LspAbstract",
async = "LspAsync",
modification = "LspModification",
documentation = "LspDocumentation",
defaultLibrary = "LspDefaultLibrary",
}
|
local pi = 3.14
if jit and jit.status then
print("JIT!")
end
print(pi)
|
local state = {}
state._NAME = ...
require'hcm'
local vector = require'vector'
local util = require'util'
local movearm = require'movearm'
local libArmPlan = require 'libArmPlan'
local arm_planner = libArmPlan.new_planner()
--Door opening state using HOOK
local handle_clearance = vector.new({0,0,-0.05})
local lhand_rpy0 = {90*DEG_TO_RAD,0,0}
local rhand_rpy0 = {-90*DEG_TO_RAD,0*DEG_TO_RAD,0}
local trLArm1, trRArm1
local stage
local qLArmInit0,qRArmInit0
local qLArm0, qRArm0, qLArmComp, qRArmComp
local qWaist
local uTorsoComp0
local comactual
function state.entry()
print(state._NAME..' Entry' )
-- Update the time of entry
local t_entry_prev = t_entry
t_entry = Body.get_time()
t_update = t_entry
qLArm0 = mcm.get_arm_qlarm()
qRArm0 = mcm.get_arm_qrarm()
qLArmComp = mcm.get_arm_qlarm()
qRArmComp = mcm.get_arm_qrarm()
--[[
qLArm0 = Body.get_inverse_arm_given_wrist( qLArm, {0,0,0, unpack(lhand_rpy0)})
qRArm0 = Body.get_inverse_arm_given_wrist( qRArm, {0,0,0, unpack(rhand_rpy0)})
--]]
trLArm0 = Body.get_forward_larm(qLArm0)
trRArm0 = Body.get_forward_rarm(qRArm0)
hcm.set_hands_left_tr(trLArm0)
hcm.set_hands_right_tr(trRArm0)
hcm.set_hands_left_tr_target(trLArm0)
hcm.set_hands_right_tr_target(trRArm0)
local qWaist = Body.get_waist_command_position()
local com = Kinematics.com_upperbody(qWaist,qLArm0,qRArm0,
mcm.get_stance_bodyTilt(), 0,0)
uTorsoComp0 = {-com[1]/com[4],-com[2]/com[4]}
print("bodyTilt:",mcm.get_stance_bodyTilt())
print("qLArm:",unpack(qLArm0))
print("UTorsoComp0:",unpack(uTorsoComp0))
print("armplanner:",unpack(mcm.get_stance_uTorsoCompBias() ) )
-- arm_planner:reset_torso_comp(qLArm0, qRArm0)
-- arm_planner:save_boundary_condition({qLArm0, qRArm0, qLArm0, qRArm0, {0,0}})
stage = "wristturn";
end
function state.update()
-- print(state._NAME..' Update' )
-- Get the time of update
if plan_failed then return "planfail" end
local t = Body.get_time()
local dt = t - t_update
-- Save this at the last update time
t_update = t
--if t-t_entry > timeout then return'timeout' end
if stage=="wristturn" then --Turn yaw angles first
if movearm.setArmJoints(qLArm0,qRArm0,dt, Config.arm.slow_limit) ==1 then
stage = "teleopwait"
end
elseif stage=="teleopwait" then
if hcm.get_state_proceed()==1 then
qWaist = Body.get_waist_command_position()
local qWaist, done1 = util.approachTol(
qWaist,
-- vector.new({0,19*DEG_TO_RAD}),
-- vector.new({0,10*DEG_TO_RAD}),
vector.new({-30*DEG_TO_RAD,0}),
vector.new({1*DEG_TO_RAD,0}),
dt)
Body.set_waist_command_position(qWaist)
--New qArm0 considering rotated waist
local qLArmNew = Body.get_inverse_larm(qLArm0,trLArm0)
local qRArmNew = Body.get_inverse_rarm(qRArm0,trRArm0)
local com = Kinematics.com_upperbody(qWaist,qLArmNew,qRArmNew,mcm.get_stance_bodyTilt(), 0,0)
local uTorsoComp = {-com[1]/com[4],-com[2]/com[4]}
local uTorsoCompX = uTorsoComp[1]-uTorsoComp0[1]
local uTorsoCompY = uTorsoComp[2]-uTorsoComp0[2]
mcm.set_stance_uTorsoComp({uTorsoCompX, uTorsoCompY})
qLArmComp = Body.get_inverse_larm(qLArm0,trLArm0+ vector.new({-uTorsoCompX, -uTorsoCompY,0, 0,0,0}),
qLArm0[3], mcm.get_stance_bodyTilt(), qWaist)
qRArmComp = Body.get_inverse_rarm(qRArm0,trRArm0+ vector.new({-uTorsoCompX, -uTorsoCompY,0, 0,0,0}),
qRArm0[3], mcm.get_stance_bodyTilt(), qWaist)
local done2 = movearm.setArmJoints(qLArmComp,qRArmComp,dt)
arm_planner:save_boundary_condition({qLArmNew, qRArmNew, qLArmComp, qRArmComp,
{uTorsoCompX,uTorsoCompY}})
elseif hcm.get_state_proceed()==-1 then
qWaist = Body.get_waist_command_position()
local qWaist = util.approachTol(
qWaist,
-- vector.new({-20*DEG_TO_RAD,0}),
-- vector.new({1*B=dy.DEG_TO_RAD,0}),
vector.new({30*DEG_TO_RAD,0}),
vector.new({1*DEG_TO_RAD,0}),
dt)
Body.set_waist_command_position(qWaist)
local qLArmNew = Body.get_inverse_larm(qLArm0,trLArm0)
local qRArmNew = Body.get_inverse_rarm(qRArm0,trRArm0)
local com = Kinematics.com_upperbody(qWaist,qLArmNew,qRArmNew,mcm.get_stance_bodyTilt(), 0,0)
local uTorsoComp = {-com[1]/com[4],-com[2]/com[4]}
local uTorsoCompX = uTorsoComp[1]-uTorsoComp0[1]
local uTorsoCompY = uTorsoComp[2]-uTorsoComp0[2]
mcm.set_stance_uTorsoComp({uTorsoCompX, uTorsoCompY})
qLArmComp = Body.get_inverse_larm(qLArm0,trLArm0+ vector.new({-uTorsoCompX, -uTorsoCompY,0, 0,0,0}),
qLArm0[3], mcm.get_stance_bodyTilt(), qWaist)
qRArmComp = Body.get_inverse_rarm(qRArm0,trRArm0+ vector.new({-uTorsoCompX, -uTorsoCompY,0, 0,0,0}),
qRArm0[3], mcm.get_stance_bodyTilt(), qWaist)
local done2 = movearm.setArmJoints(qLArmComp,qRArmComp,dt)
comactual= {com[1]/com[4],com[2]/com[4]}
end
elseif stage=="teleopmove" then
if arm_planner:play_arm_sequence(t) then
stage="teleopwait"
end
end
--hcm.set_state_proceed(0)
end
function state.exit()
print(state._NAME..' Exit' )
end
return state
|
require"Test"
require"luno.string"
--##############################################################################
-- Funções auxiliares:
--##############################################################################
-- Testes
local cases =
{
TestCase
(
"useAlias",
function()
-- Criar arquivo temporário:
luno.string.useAlias()
local res =
{
assertTable(lstring),
assertEquals(luno.string, lstring)
}
return allTrue(res)
end
),
TestCase
(
"chatAt",
function()
local res1 = lstring.charAt("agua", 1)
local res2 = lstring.charAt("agua", 3)
local ret =
{
assertEquals(res1, "a"),
assertEquals(res2, "u"),
}
return allEquals(ret, true)
end
),
TestCase
(
"trim",
function()
local res1 = lstring.trim(" agua")
local res2 = lstring.trim("agua ")
local res3 = lstring.trim(" agua ")
local res4 = lstring.trim(" ag ua ")
local ret =
{
assertEquals(res1, "agua"),
assertEquals(res2, "agua"),
assertEquals(res3, "agua"),
assertEquals(res4, "ag ua"),
}
return allEquals(ret, true)
end
),
TestCase
(
"ltrim",
function()
local res1 = lstring.ltrim(" agua")
local res2 = lstring.ltrim("agua ")
local res3 = lstring.ltrim(" agua ")
local res4 = lstring.ltrim(" ag ua ")
local ret =
{
assertEquals(res1, "agua"),
assertEquals(res2, "agua "),
assertEquals(res3, "agua "),
assertEquals(res4, "ag ua "),
}
return allEquals(ret, true)
end
),
TestCase
(
"rtrim",
function()
local res1 = lstring.rtrim(" agua")
local res2 = lstring.rtrim("agua ")
local res3 = lstring.rtrim(" agua ")
local res4 = lstring.rtrim(" ag ua ")
local ret =
{
assertEquals(res1, " agua"),
assertEquals(res2, "agua"),
assertEquals(res3, " agua"),
assertEquals(res4, " ag ua"),
}
return allEquals(ret, true)
end
),
--luno.string.gltrim(str, pattern)
--luno.string.grtrim(str, pattern)
--luno.string.gtrim(str, patternLeft, patternRight)
TestCase
(
"beginsWith",
function()
local res1 = lstring.beginsWith("abcde", "")
local res2 = lstring.beginsWith("abcde", "a")
local res3 = lstring.beginsWith("abcde", "abc")
local res4 = lstring.beginsWith("abcde", "abcde")
local res5 = lstring.beginsWith("abcde", "abd")
local res6 = lstring.beginsWith("abcde", "e")
local res7 = lstring.beginsWith("a", "abcde")
local ret =
{
assertTrue(res1),
assertTrue(res2),
assertTrue(res3),
assertTrue(res4),
assertFalse(res5),
assertFalse(res6),
assertFalse(res7),
}
return allTrue(ret)
end
),
TestCase
(
"endsWith",
function()
local res1 = lstring.endsWith("abcde", "")
local res2 = lstring.endsWith("abcde", "e")
local res3 = lstring.endsWith("abcde", "de")
local res4 = lstring.endsWith("abcde", "abcde")
local res5 = lstring.endsWith("abcde", "bde")
local res6 = lstring.endsWith("abcde", "a")
local res7 = lstring.endsWith("", "e")
local res8 = lstring.endsWith("e", "abcde")
local ret =
{
assertTrue(res1),
assertTrue(res2),
assertTrue(res3),
assertTrue(res4),
assertFalse(res5),
assertFalse(res6),
assertFalse(res7),
assertFalse(res8),
}
return allTrue(ret)
end
),
TestCase
(
"split",
function()
local res1 = lstring.split("a,a", ",")
local res2 = lstring.split("a,a,", ",")
local res3 = lstring.split("a,a,,", ",")
local res4 = lstring.split("aa", ",")
local res5 = lstring.split("aa", "aa")
local ret =
{
assertListEquals(res1, {"a","a"}),
assertListEquals(res2, {"a","a",""}),
assertListEquals(res3, {"a","a","",""}),
assertListEquals(res4, {"aa"}),
assertListEquals(res5, {"", ""}),
}
return allTrue(ret)
end
),
TestCase
(
"splitWords",
function()
local res1 = lstring.splitWords("a b c d e")
local res2 = lstring.splitWords(" a b c d e ")
local res3 = lstring.splitWords([[a b
c d e]])
local res4 = lstring.splitWords("a\t b \n c d \r e")
local ret =
{
assertListEquals(res1, {"a","b","c","d","e"}),
assertListEquals(res2, {"","a","b","c","d","e",""}),
assertListEquals(res3, {"a","b","c","d","e"}),
assertListEquals(res4, {"a","b","c","d","e"}),
}
return allTrue(ret)
end
),
TestCase
(
"splitLines",
function()
local res1 = lstring.splitLines([[a b c d e]])
local res2 = lstring.splitLines([[a b
c d
e
f ]])
local ret =
{
assertListEquals(res1, {"a b c d e"}),
assertListEquals(res2, {"a b"," c d","e", " f "}),
}
return allTrue(ret)
end
),
--luno.string.splitIterator(text, sep)
--luno.string.join(list, sep)
--luno.string.joinWords(words)
--luno.string.joinLines(lines)
--luno.string.strLinesIterator(text)
--luno.string.removeFirstN(n, str)
--luno.string.removeFirst(str)
--luno.string.removeLastN(n, str)
--luno.string.removeLast(str)
--luno.string.lastChar(str, pos)
--luno.string.firstChar(str, pos)
}
return cases
|
--[[
Action is the base class for all action nodes. Thus, if you want to create
new custom action nodes, you need to inherit from this class.
]]
local b3 = require("app.main.modules.behavior3.b3")
local BaseNode = require("app.main.modules.behavior3.core.BaseNode")
local Action = class("Action", BaseNode)
--[[
构造函数
config
name
title
properties
]]
function Action:ctor(config)
config = config or {}
config.name = config.name or "Action"
config.category = b3.ACTION
BaseNode.ctor(self, config)
end
return Action
|
local function postPurchaseWarningAcknowledge(network, userAction)
return network.postPurchaseWarningAcknowledge(userAction)
end
return postPurchaseWarningAcknowledge
|
table.insert(actions,
{
id = "INCREASE_MANA",
name = "Increase Mana",
description = "Doubles the wand's Max Mana and Mana Recharge",
sprite = "mods/increase_mana_passive/files/entities/misc/custom_cards/mana.png",
type = ACTION_TYPE_PASSIVE,
spawn_level = "0,1,2,3,4,5,6",
spawn_probability = "0.3,0.3,0.3,0.3,0.3,0.3,0.3",
price = 200,
mana = 0,
custom_xml_file = "mods/increase_mana_passive/files/entities/misc/custom_cards/increase_mana.xml",
action = function()
end,
}
)
|
-- lua-lru, LRU cache in Lua
-- Copyright (c) 2015 Boris Nagaev
-- See the LICENSE file for terms of use.
--[[
The MIT License (MIT)
Copyright (c) 2015 Boris Nagaev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]--
local lru = {}
function lru.new(max_size, max_bytes)
assert(max_size >= 1, "max_size must be >= 1")
assert(not max_bytes or max_bytes >= 1, "max_bytes must be >= 1")
-- current size
local size = 0
local bytes_used = 0
-- map is a hash map from keys to tuples
-- tuple: value, prev, next, key
-- prev and next are pointers to tuples
local map = {}
-- indices of tuple
local VALUE = 1
local PREV = 2
local NEXT = 3
local KEY = 4
local BYTES = 5
-- newest and oldest are ends of double-linked list
local newest = nil -- first
local oldest = nil -- last
local removed_tuple -- created in del(), removed in set()
-- remove a tuple from linked list
local function cut(tuple)
local tuple_prev = tuple[PREV]
local tuple_next = tuple[NEXT]
tuple[PREV] = nil
tuple[NEXT] = nil
if tuple_prev and tuple_next then
tuple_prev[NEXT] = tuple_next
tuple_next[PREV] = tuple_prev
elseif tuple_prev then
-- tuple is the oldest element
tuple_prev[NEXT] = nil
oldest = tuple_prev
elseif tuple_next then
-- tuple is the newest element
tuple_next[PREV] = nil
newest = tuple_next
else
-- tuple is the only element
newest = nil
oldest = nil
end
end
-- insert a tuple to the newest end
local function setNewest(tuple)
if not newest then
newest = tuple
oldest = tuple
else
tuple[NEXT] = newest
newest[PREV] = tuple
newest = tuple
end
end
local function del(key, tuple)
map[key] = nil
cut(tuple)
size = size - 1
bytes_used = bytes_used - (tuple[BYTES] or 0)
removed_tuple = tuple
end
-- removes elemenets to provide enough memory
-- returns last removed element or nil
local function makeFreeSpace(bytes)
while size + 1 > max_size or (max_bytes and bytes_used + bytes > max_bytes) do
assert(oldest, "not enough storage for cache")
del(oldest[KEY], oldest)
end
end
local function get(_, key)
local tuple = map[key]
if not tuple then
return nil
end
cut(tuple)
setNewest(tuple)
return tuple[VALUE]
end
local function set(_, key, value, bytes)
local tuple = map[key]
if tuple then
del(key, tuple)
end
if value ~= nil then
-- the value is not removed
bytes = max_bytes and (bytes or #value) or 0
makeFreeSpace(bytes)
local tuple1 = removed_tuple or {}
map[key] = tuple1
tuple1[VALUE] = value
tuple1[KEY] = key
tuple1[BYTES] = max_bytes and bytes
size = size + 1
bytes_used = bytes_used + bytes
setNewest(tuple1)
else
assert(key ~= nil, "Key may not be nil")
end
removed_tuple = nil
end
local function delete(_, key)
return set(_, key, nil)
end
local function mynext(_, prev_key)
local tuple
if prev_key then
tuple = map[prev_key][NEXT]
else
tuple = newest
end
if tuple then
return tuple[KEY], tuple[VALUE]
else
return nil
end
end
-- returns iterator for keys and values
local function lru_pairs()
return mynext, nil, nil
end
local mt = {
__index = {get = get, set = set, delete = delete, pairs = lru_pairs},
__pairs = lru_pairs
}
return setmetatable({}, mt)
end
return lru
|
local ffi = require("ffi")
local bit = require("bit")
ffi.cdef[[
struct UPackage* LUAFUNC_LoadPackage(struct UPackage* outer, const char* filename, unsigned long flags);
]]
local engine = engine
local error = error
local string = string
local function LoadPackage(name)
local loadedPackage = ffi.C.LUAFUNC_LoadPackage(nil, name, 0)
if loadedPackage == nil then
error(string.format("Failed to load package %q", name))
end
-- Set the RF_RootSet flag on all the objects we loaded so they don't get
-- garbage collected. TODO: This might have side effects.
for i=0,(engine.Objects.Count-1) do
local obj = engine.Objects[i]
if obj == nil then goto continue end
local pkg = obj:GetPackageObject()
if pkg == loadedPackage then
print("Loaded Object: " .. obj:GetFullName())
obj.UObject.ObjectFlags.A = bit.bor(obj.UObject.ObjectFlags.A, 0x4000)
end
::continue::
end
return loadedPackage
end
-- Public functions
engine.LoadPackage = LoadPackage
|
#!/usr/bin/env lua
local ui = require "tek.ui"
ui.Application:new
{
Children =
{
ui.Window:new
{
HideOnEscape = true,
Columns = 2,
Children =
{
ui.Tunnel:new { MaxWidth = 400, MaxHeight = 200, VAlign = "bottom" },
ui.Tunnel:new { MaxWidth = 200, MaxHeight = 400 },
ui.Tunnel:new { MaxWidth = 200, MaxHeight = 400, HAlign = "right" },
ui.Tunnel:new { MaxWidth = 400, MaxHeight = 200 },
},
},
},
}:run()
|
--[[
/////// //////////////////
/////// PROJECT: MTA iLife - German Fun Reallife Gamemode
/////// VERSION: 1.7.2
/////// DEVELOPERS: See DEVELOPERS.md in the top folder
/////// LICENSE: See LICENSE.md in the top folder
/////// /////////////////
]]
_createBlip = createBlip
createBlip = function(...)
local blip = _createBlip(...)
for index, player in pairs(getElementsByType("player")) do
if(player) and (player.Rank) then
triggerClientEvent(player, "onHudBlipRefresh", player)
end
end
return blip
end
_createBlipAttachedTo = createBlipAttachedTo
createBlipAttachedTo = function(...)
local blip = _createBlipAttachedTo(...)
for index, player in pairs(getElementsByType("player")) do
if(player) and (player.Rank) then
triggerClientEvent(player, "onHudBlipRefresh", player)
end
end
return blip
end
|
function printtab(tab)
str = ''
if type(tab) == 'table' then
str = str..'{'
for i=1,#tab do
str = str..printtab(tab[i])
if i<#tab then
str=str..', '
end
end
str = str..'}'
else
str = str..tostring(tab)
end
return str
end
function printf(x)
print(printtab(x))
end
printf ( {'ala', 'ma',127 , 'kotów'} )
printf ( {'to są', {}, {2, 'tablice '}, 'zagnieżdżone?', {true}} )
printf ({'a', 7, true})
printf ({nil})
|
--- ************************************************************************************************************************************************************************
---
--- Name : main_flappy.lua
--- Purpose : Executive testing - flappy errrr... sphere ?
--- Created: 14th June 2014
--- Author: Paul Robson (paul@robsons.org.uk)
--- License: MIT
---
--- ************************************************************************************************************************************************************************
display.setStatusBar(display.HiddenStatusBar) -- hide status bar
local Executive = require("system.executive") -- acquire executive class
local ExecutiveFactory = require("system.game") -- acquire Executive Factory Base Class
require("system.fontmanager") -- load my fontmananger library
--- ************************************************************************************************************************************************************************
-- An example of a class which can be reused - I have abstracted out 'start' and 'stop' messages which add/remove update. This is used in both the bird and the pipes.
--- ************************************************************************************************************************************************************************
local GameObject = Executive:createClass()
function GameObject:onMessage(sender,message)
if message.event == "start" then
self:tag("update")
end
if message.event == "stop" then
self:tag("-update")
end
end
--- ************************************************************************************************************************************************************************
-- Text Message Objects
--- ************************************************************************************************************************************************************************
local StartMessage = Executive:createClass()
function StartMessage:constructor()
self.getReadyText = display.newBitmapText("Get Ready !", -- arguably, this should be a seperate object
display.contentWidth/2,display.contentHeight/2,"font2",80)
self.getReadyText:setTintColor(1,0.5,0) -- so it looks a bit different
self:addSingleTimer(1000,"move") -- move it after 1000 milliseconds.
self:insert(self.getReadyText)
end
function StartMessage:onTimer(timerID,tag)
transition.to(self.getReadyText, { time = 1000,y = -0,alpha = 0.5, -- transition the message away
onComplete = function() self:delete() end})
end
function StartMessage:destructor()
self.getReadyText:removeSelf()
end
local EndMessage = Executive:createClass()
local function spinner(modifier, cPos, info)
local w = math.floor(info.elapsed/360) % info.length + 1
if info.index == w then
local newScale = 2 * (info.elapsed % 360) / 360 - 1
modifier.xScale = newScale
end
end
function EndMessage:constructor()
self.gameOverText = display.newBitmapText("Game Over",display.contentWidth/2,display.contentHeight/2,"font2",80)
self.gameOverText:setModifier(spinner):animate(2)
self.gameOverText.alpha = 0
transition.to(self.gameOverText, { time = 2000, alpha = 1})
self:insert(self.gameOverText)
self:addSingleTimer(6000)
end
function EndMessage:onTimer()
Game:event("gameover",{ testData = 42 })
end
function EndMessage:destructor()
self.gameOverText:removeSelf()
end
--- ************************************************************************************************************************************************************************
-- Background - sky and ground
--- ************************************************************************************************************************************************************************
local Background = Executive:createClass()
function Background:constructor(info)
self.groundHeight = display.contentHeight * 0.9 -- height of ground.
self.sky = display.newRect(0,0,570,380) -- create sky
self.sky.x,self.sky.y = display.contentWidth/2,display.contentHeight/2
self.sky:setFillColor(0,1,1)
local h = display.contentHeight - self.groundHeight -- height of ground.
self.ground = display.newRect(-50,self.groundHeight,display.contentWidth+50,h+50) -- create ground
self.ground.anchorX,self.ground.anchorY = 0,0
self.ground:setFillColor(0,1,0)
self.line = display.newLine(-50,self.groundHeight,display.contentWidth+50,self.groundHeight)
self.line.strokeWidth = 4 self.line:setStrokeColor(0,0,0)
self.sky:addEventListener("tap",self) -- listen for taps.
self:name("background") -- expose background.
self:insert(self.sky,self.line,self.ground) -- add objects to display group.
self.sky:toBack()
end
function Background:destructor()
self.sky:removeEventListener("tap",self) -- remove listener
self.ground:removeSelf() -- remove ground
self.sky:removeSelf() -- remove sky
self.line:removeSelf()
end
function Background:tap(event)
self:sendMessage("bird",{ event = "tapped"}) -- tell all birds if ground tapped.
end
--- ************************************************************************************************************************************************************************
-- Score class
--- ************************************************************************************************************************************************************************
local Score = Executive:createClass()
function Score:constructor()
self.scoreText = display.newBitmapText("XXXX",display.contentWidth-10,10,"font2",60) -- create text object
self.scoreText:setAnchor(1,0)
self.score = 0 -- actual score
self:updateScore() -- update it with the score
self:tag("score") -- tag it 'score' so it can receive appropriate messages
self:insert(self.scoreText)
end
function Score:onMessage(sender,message)
if message.event == "add" then -- add some number of points
self.score = self.score + message.points -- do it !
self:updateScore() -- and update.
end
end
function Score:updateScore()
self.scoreText:setText(("0000"..self.score):sub(-4)) -- make text four digit leading zeros.
end
function Score:destructor()
self.scoreText:removeSelf()
end
--- ************************************************************************************************************************************************************************
-- Bird (well, sphere) class
--- ************************************************************************************************************************************************************************
local Bird = Executive:createClass(GameObject)
function Bird:constructor(info)
self.radius = display.contentHeight / 16 -- radius of the flappy sphere
self.bird = display.newCircle(info.x or display.contentWidth / 8, -- flappy sphere display object
display.contentHeight / 3,
self.radius)
self.bird:setFillColor(1,0,0)
self.bird.strokeWidth = 4
self.bird:setStrokeColor(0,0,0)
self.y = 1024 / 3 -- logical vertical positions.
self.vy = 0 -- logical vertical velocity.
self.gravity = info.gravity or 100 -- gravity effect
self:tag("bird") -- receives controller messages
self:tag("gameobject") -- general game object stuff.
self:insert(self.bird)
end
function Bird:destructor()
self.bird:removeSelf()
end
function Bird:onUpdate(deltaTime,deltaMillis,currentTime)
local t = math.abs(10-math.floor(currentTime/30) % 20) -- cause the sphere to contract, it's flappy sphere
self.bird.yScale = t / 20 + 0.5
self.vy = self.vy + self.gravity * deltaTime -- add gravity
self.y = self.y + self.vy * deltaTime -- add velocity to position (position is logical 0-1023)
self.bird.y = self.y * display.contentHeight / 1024 -- position bird at new position.
if self.bird.y < 0 or self.bird.y > self:getExecutive().e.background.groundHeight then -- off the top or bottom - note use of e to get background height
self:flapOver() -- kill that bird.
else
local obstacleList = self:query("obstacle") -- otherwise, get a list of obstacles.
for _,ref in pairs(obstacleList.objects) do -- ask every obstacle if we have collided with it.
if ref:isAlive() and ref:hasCollided(self.bird.x,self.bird.y,self.radius) then -- checking it is alive first
self:flapOver() -- if have collided, then flap is over.
break
end
end
end
end
function Bird:onMessage(sender,message)
GameObject.onMessage(self,sender,message) -- we override onMessage, which means calling the parent.
if message.event == "tapped" then -- if received a tap message
self.vy = self.vy - self.gravity -- adjust velocity accordingly.
end
end
function Bird:flapOver()
if not self:isAlive() then return end
self:addLibraryObject("utils.particle", -- from the utils.particle library
"ShortEmitter", -- short emitter
{ emitter = "bomb",time = 1000, -- these constructor parameters
x = self.bird.x,y = self.bird.y })
self:delete() -- kill the bird.
if self:query("bird").count == 0 then -- all birds dead ?
self:sendMessage("gameobject", {event = "stop"}) -- stop all game objects.
EndMessage:new(self:getExecutive(),{})
--self:getExecutive():delete()
end
end
--- ************************************************************************************************************************************************************************
-- Pipe Class
--- ************************************************************************************************************************************************************************
local Pipe = Executive:createClass(GameObject) -- note, we are using GameObject as a base class.
Pipe.gameWidth = display.contentWidth + 100 -- the horizontal scrolling game space size.
-- static values can be stored in the object, rather than using 'e'.
function Pipe:constructor(info)
local w = display.contentWidth / 12
self.scrollCount = 0 -- number of times scrolled off.
self.pipeLower = self:createPipe(display.contentHeight,w) -- create lower pipe.
self.pipeUpper = self:createPipe(display.contentHeight,w) -- create upper pipe.
self.pipeUpperTop = self:createPipe(display.contentHeight/14, w * 1.2) -- and tops
self.pipeLowerTop = self:createPipe(display.contentHeight/14, w * 1.2)
self.pipeUpper.anchorY = 1 self.pipeUpperTop.anchorY = 1 -- top anchor point is at their bottom
self:reposition(info.x,info.gap) -- reposition pipe horizontally.
self.xv = display.contentWidth / info.speed -- calculate pixels per second move.
self:tag("gameobject,obstacle")
self:insert(self.pipeLower,self.pipeUpper,self.pipeUpperTop,self.pipeLowerTop)
end
function Pipe:destructor()
self.pipeLower:removeSelf() -- remove display objects
self.pipeUpper:removeSelf()
self.pipeUpperTop:removeSelf()
self.pipeLowerTop:removeSelf()
end
function Pipe:createPipe(height,width)
local obj = display.newRect(0,0,width,height) -- create a pipe graphic bit
obj.anchorX,obj.anchorY = 0.5,0
obj:setFillColor(0,0.5,0) obj.strokeWidth = 4 obj:setStrokeColor(0,0,0)
return obj
end
function Pipe:updatePosition()
self.pipeLower.x,self.pipeLower.y = self.x, self.y + self.gap / 2 -- update pipe position from x,y and gap.
self.pipeLowerTop.x,self.pipeLowerTop.y = self.x, self.y + self.gap / 2
self.pipeUpper.x,self.pipeUpper.y = self.x, self.y - self.gap / 2
self.pipeUpperTop.x,self.pipeUpperTop.y = self.x, self.y - self.gap / 2
end
function Pipe:reposition(newX, gapSize)
self.x = newX -- save X and gap size.
self.gap = gapSize
local border = display.contentHeight / 8 -- border for pipes - minimax value.
self.y = border + math.random(0,display.contentHeight-border * 2 - gapSize)+gapSize/2
self:updatePosition() -- update the pipe positions
end
function Pipe:onUpdate(deltaTime,deltaMillis)
self.x = self.x - deltaTime * self.xv -- move pipe to the left
if self.x < -50 then -- if off left then move to the right.
self.scrollCount = self.scrollCount + 1 -- add scrolling count
local newGap = math.max(self.gap - 4,70)
self:sendMessage("score",{ event = "add",points = 1 }) -- score one point
self:reposition(self.x + Pipe.gameWidth, newGap) -- and reposition
end
self:updatePosition() -- update the pipe position.
end
function Pipe:hasCollided(x,y,r)
local dx = math.abs(x - self.x) -- pipe distance, horizontal
if dx > r + self.pipeLower.width / 2 then return false end -- out of range , return false
local dy = math.abs(self.y - y)
return dy+r/2 >= self.gap/2
end
--- ************************************************************************************************************************************************************************
-- Title Screen class and factory class
--- ************************************************************************************************************************************************************************
local TitleScreen = Executive:createClass()
function TitleScreen:constructor()
self.title = display.newBitmapText("Flappy Sphere",display.contentWidth/2,display.contentHeight/2,"font2",72)
self.title.yScale = 3
self.descr = display.newText("A 'Corona Executive' Demo",display.contentWidth / 2,display.contentHeight - 40,system.nativeFont,32)
self:insert(self.title,self.descr)
end
function TitleScreen:destructor()
self.title:removeEventListener( "tap",self)
self.title:removeSelf()
self.descr:removeSelf()
end
function TitleScreen:start()
self.title:addEventListener( "tap",self)
end
function TitleScreen:tap(e)
Game:event("play")
end
--- ************************************************************************************************************************************************************************
-- Title Screen Factory Class
--- ************************************************************************************************************************************************************************
local TitleScreenFactory = ExecutiveFactory:new()
function TitleScreenFactory:preOpen(data,edata)
self.title = TitleScreen:new(self:getExecutive())
self.title:start()
end
--- ************************************************************************************************************************************************************************
-- Flappy Bird Factory Class
--- ************************************************************************************************************************************************************************
local GameFactory = ExecutiveFactory:new()
function GameFactory:preOpen(data,edata) -- before opening, create all the game objects
local exec = self:getExecutive()
self.workObject = StartMessage:new(exec)
local pipes = 3
for i = 1,pipes do
Pipe:new({ executive = exec,gap = 150, x = ((i-1)/pipes+1)*(Pipe.gameWidth), speed = 12 })
end
Background:new({ executive = exec })
Bird:new(exec,{ gravity = 100*1 })
Score:new(exec,{})
self.workObject:sendMessage("gameobject",{ event = "start"} ,1000) -- when transition complete, start.
end
--- ************************************************************************************************************************************************************************
-- Set up main game FSM and start
--- ************************************************************************************************************************************************************************
Game:addState("start",TitleScreenFactory:new(), { play = { target = "game" } })
Game:addState("game",GameFactory:new(), { gameover = { target = "start", transition = { effect = "slidedown", time = 1000 } } })
Game:start()
|
object_tangible_collection_col_jalopy_crate_07 = object_tangible_collection_shared_col_jalopy_crate_07:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_col_jalopy_crate_07, "object/tangible/collection/col_jalopy_crate_07.iff")
|
local log = require "log"
local testsTotal = 0
local testsOK = 0
local testsFailed = 0
local time = os.time()
local function formatSourceLine(debugInfo)
if not debugInfo then return ""
else
return debugInfo.source .. ": line " .. debugInfo.currentline
--[[
source @authentication.lua
what Lua
func function: 0x60005a280
nups 0
short_src authentication.lua
name checkDefaultProfile
currentline 26
namewhat upvalue
linedefined 15
lastlinedefined 29
]]--
end
end
--[[local function log(...)
if (verbose) then
io.write("\t", formatSourceLine(debug.getinfo(4)), "\t")
for _, v in ipairs({...}) do
io.write(tostring(v), "\t")
end
print()
end
end]]--
local internalAssertEquals = function(p1, p2, level)
-- for k, v in pairs (debug.getinfo(3)) do print(k, v) end
log.debug("AssertEquals", p1, p2)
if p1 == p2 then return true end
error("Assertion failed", level)
end
local internalAssertNotEquals = function(p1, p2, level)
log.debug("AssertNotEquals", p1, p2)
if p1 ~= p2 then return true end
error("Assertion failed", level)
end
local internalAssertNotNil = function(p1, level)
log.debug("AssertNotNil", p1)
if p1 ~= nil then return true end
error("Assertion failed", level)
end
local internalAssertType = function(p1, typeStr, level)
log.debug("AssertType", p1, typeStr)
if type(p1) == typeStr then return true end
error("Assertion failed", level)
end
checkError = function(err, ErrorDesc)
internalAssertType(err, "table", 2)
internalAssertType(ErrorDesc, "table", 2)
internalAssertType(ErrorDesc.ErrorCode, "number", 2)
internalAssertType(ErrorDesc.ErrorName, "string", 2)
internalAssertEquals(err.ErrorCode, ErrorDesc.ErrorCode, 2)
internalAssertEquals(err.ErrorName, ErrorDesc.ErrorName, 2)
end
assertEquals = function(p1, p2)
internalAssertEquals(p1, p2, 3)
end
assertNotEquals = function(p1, p2)
internalAssertNotEquals(p1, p2, 3)
end
assertNotNil = function(p1)
internalAssertNotNil(p1, 3)
end
assertType = function(p1, typeStr)
internalAssertType(p1, typeStr, 3)
end
test = function(func, name, ...)
testsTotal = testsTotal + 1
local status, res = pcall(func, ...)
if verbose then print() end
if status then
testsOK = testsOK + 1
log.info("Test " .. testsTotal .. " SUCCESS\t\t\"" .. name .. "\"")
else
testsFailed = testsFailed + 1
log.info("Test " .. testsTotal .. " FAILED\t\t\"" .. name .. "\"\n", res)
end
if verbose then print() end
return status, res
end
testsSummary = function()
-- print("\nTotal time: " .. os.date("!%X", (os.time() - time)))
log.info("Total time: " .. os.date("!%X", (os.time() - time)), testsTotal .. " tests run", testsOK .. " tests were SUCCESSFULL", testsFailed .. " tests FAILED" )
end
|
-----------------------------------------
-- ID: 4961
-- Scroll of Tonko: Ichi
-- Teaches the ninjutsu Tonko: Ichi
-----------------------------------------
function onItemCheck(target)
return target:canLearnSpell(353)
end
function onItemUse(target)
target:addSpell(353)
end
|
local app = app
local Class = require "Base.Class"
local Base = require "Unit.ViewControl.EncoderControl"
local Encoder = require "Encoder"
-- BranchMeter
local BranchMeter = Class {
type = "Meter",
canEdit = false,
canMove = false
}
BranchMeter:include(Base)
function BranchMeter:init(args)
Base.init(self)
self:setClassName("Unit.ViewControl.BranchMeter")
local button = args.button or app.logError("%s.init: button is missing.", self)
self:setInstanceName(button)
local branch = args.branch or app.logError("%s.init: branch is missing.", self)
local faderParam = args.faderParam or
app.logError("%s.init: faderParam is missing.", self)
-- optional arguments
self:setDefaults(args)
local map = args.map
local units = args.units
local scaling = args.scaling
faderParam:enableSerialization()
self.branch = branch
local graphic
local ply = app.SECTION_PLY
graphic = app.Fader(0, 0, ply, 64)
graphic:setParameter(faderParam)
graphic:setLabel(button)
graphic:setAttributes(units, map, scaling)
if units == app.unitDecibels then
graphic:setTextBelow(-59, "-inf dB")
graphic:setPrecision(1)
end
self.fader = graphic
self:setMainCursorController(graphic)
self:setControlGraphic(graphic)
self:addSpotDescriptor{
center = 0.5 * ply
}
-- sub display
graphic = app.Graphic(0, 0, 128, 64)
self.subGraphic = graphic
self.scope = app.MiniScope(0, 15, ply, 64 - 15)
self.scope:setBorder(1)
self.scope:setCornerRadius(3, 3, 3, 3)
graphic:addChild(self.scope)
self.subButton1 = app.SubButton("empty", 1)
graphic:addChild(self.subButton1)
self.subButton2 = app.TextPanel("Solo", 2, 0.25)
self.soloIndicator = app.BinaryIndicator(0, 24, ply, 32)
self.subButton2:setLeftBorder(0)
self.subButton2:addChild(self.soloIndicator)
graphic:addChild(self.subButton2)
self.subButton3 = app.TextPanel("Mute", 3, 0.25)
self.muteIndicator = app.BinaryIndicator(0, 24, ply, 32)
self.subButton3:addChild(self.muteIndicator)
graphic:addChild(self.subButton3)
branch:subscribe("contentChanged", self)
end
function BranchMeter:onRemove()
self.branch:unsubscribe("contentChanged", self)
Base.onRemove(self)
end
function BranchMeter:setDefaults(args)
if args.map == nil then args.map = Encoder.getMap("volume") end
if args.units == nil then args.units = app.unitDecibels end
if args.scaling == nil then args.scaling = app.linearScaling end
self.defaults = args
end
function BranchMeter:getDefaults()
return self.defaults
end
function BranchMeter:getPinControl()
local Fader = require "PinView.Fader"
local control = Fader {
delegate = self,
name = self.fader:getLabel(),
valueParam = self.fader:getValueParameter(),
range = self.fader:getRangeObject(),
units = self.defaults.units,
map = self.defaults.map,
scaling = self.defaults.scaling,
precision = 1,
leftOutlet = self.branch:getMonitoringOutput(1),
rightOutlet = self.branch:getMonitoringOutput(2)
}
return control
end
function BranchMeter:createPinMark()
local offset
if self.branch.channelCount < 2 then
offset = -3
else
offset = 0
end
local Drawings = require "Drawings"
local graphic = app.Drawing(offset, 0, app.SECTION_PLY, 64)
graphic:add(Drawings.Control.Pin)
self.controlGraphic:addChildOnce(graphic)
self.pinMark = graphic
end
function BranchMeter:mute()
self:callUp("muteControl", self)
end
function BranchMeter:solo()
self:callUp("soloControl", self)
end
function BranchMeter:isMuted()
return self.muteIndicator:value()
end
function BranchMeter:isSolo()
return self.soloIndicator:value()
end
function BranchMeter:onMuteStateChanged(muted, solo)
local branch = self.branch
if muted then
self.muteIndicator:on()
if solo == self then
self.soloIndicator:on()
self.fader:ungrayed()
branch:unmute()
else
self.soloIndicator:off()
self.fader:grayed()
branch:mute()
end
else
self.muteIndicator:off()
if solo == self then
self.soloIndicator:on()
self.fader:ungrayed()
branch:unmute()
elseif solo then
self.soloIndicator:off()
self.fader:grayed()
branch:mute()
else
self.soloIndicator:off()
self.fader:ungrayed()
branch:unmute()
end
end
end
function BranchMeter:onInsert()
local branch = self.branch
if branch then
if branch.channelCount < 2 then
local left = branch:getMonitoringOutput(1)
self.fader:watchOutlets(left, nil)
else
local left = branch:getMonitoringOutput(1)
local right = branch:getMonitoringOutput(2)
self.fader:watchOutlets(left, right)
end
self.subButton1:setText(branch:mnemonic())
end
end
function BranchMeter:contentChanged(chain)
if chain == self.branch then
if chain.channelCount < 2 then
local left = chain:getMonitoringOutput(1)
self.fader:watchOutlets(left, nil)
self.scope:watchOutlet(left)
else
local left = chain:getMonitoringOutput(1)
local right = chain:getMonitoringOutput(2)
self.fader:watchOutlets(left, right)
local Channels = require "Channels"
if Channels.isRight() then
self.scope:watchOutlet(right)
else
self.scope:watchOutlet(left)
end
end
self.subButton1:setText(chain:mnemonic())
end
end
------------------------------------------
function BranchMeter:selectReleased(i, shifted)
local branch = self.branch
if branch then
local Channels = require "Channels"
local side = Channels.getSide(i)
local outlet = branch:getMonitoringOutput(side)
if outlet then self.scope:watchOutlet(outlet) end
end
return true
end
function BranchMeter:zeroPressed()
self.fader:zero()
return true
end
function BranchMeter:cancelReleased(shifted)
if not shifted then self.fader:restore() end
return true
end
function BranchMeter:onFocused()
self.fader:save()
end
function BranchMeter:subReleased(i, shifted)
if shifted then
return false
else
if i == 1 then
local branch = self.branch
if branch then
self:unfocus()
branch:show()
end
elseif i == 2 then
-- solo
self:callUp("toggleSoloOnControl", self)
elseif i == 3 then
-- mute
self:callUp("toggleMuteOnControl", self)
end
end
return true
end
function BranchMeter:encoder(change, shifted)
self.fader:encoder(change, shifted, self.encoderState == Encoder.Fine)
return true
end
return BranchMeter
|
--[[
***************************
* .-. *
* `-.. ..-. + + *
* `-''-'' ' *
* OpenSource Scripting *
* Team *
* http://sunplusplus.info *
* *
***************************
This software is provided as free and open source by the
staff of the Sun++ Scripts Project, in accordance with
the GPL license. This means we provide the software we have
created freely and it has been thoroughly tested to work for
the developers, but NO GUARANTEE is made it will work for you
as well. Please give credit where credit is due, if modifying,
redistributing and/or using this software. Thank you.
Sun++ Team, July 2008
~End of License Agreement
Made by: Azolex
]]
function PriestessDelrissa_Minions(pUnit, Event)
random=math.random(1, 25)
if random==1 then
pUnit:SpawnCreature(24557, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24558, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24656, 128.804245, 11.850257, -20.004900, 4.610291, 14, 0)
pUnit:SpawnCreature(24554, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24561, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==2 then
pUnit:SpawnCreature(24557, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24558, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24656, 128.804245, 11.850257, -20.004900, 4.610291, 14, 0)
pUnit:SpawnCreature(24554, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24559, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==3 then
pUnit:SpawnCreature(24557, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24558, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24656, 128.804245, 11.850257, -20.004900, 4.610291, 14, 0)
pUnit:SpawnCreature(24554, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24552, 119.496450, 9.265259, -20.004902, 5.552326, 14, 0)
end
if random==4 then
pUnit:SpawnCreature(24557, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24558, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24656, 128.804245, 11.850257, -20.004900, 4.610291, 14, 0)
pUnit:SpawnCreature(24554, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24553, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==5 then
pUnit:SpawnCreature(24557, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24558, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24656, 128.804245, 11.850257, -20.004900, 4.610291, 14, 0)
pUnit:SpawnCreature(24554, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24556, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==6 then
pUnit:SpawnCreature(24558, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24656, 124.948463, 11.833995, -20.004911, 4.771299, 14, 0)
pUnit:SpawnCreature(24554, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24561, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24559, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==7 then
pUnit:SpawnCreature(24558, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24656, 124.948463, 11.833995, -20.004911, 4.771299, 14, 0)
pUnit:SpawnCreature(24554, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24561, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==8 then
pUnit:SpawnCreature(24558, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24656, 124.948463, 11.833995, -20.004911, 4.771299, 14, 0)
pUnit:SpawnCreature(24554, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24561, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24553, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==9 then
pUnit:SpawnCreature(24554, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24561, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24559, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==10 then
pUnit:SpawnCreature(24558, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24656, 124.948463, 11.833995, -20.004911, 4.771299, 14, 0)
pUnit:SpawnCreature(24554, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24561, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24556, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==11 then
pUnit:SpawnCreature(24554, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24561, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24559, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24553, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==12 then
pUnit:SpawnCreature(24554, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24561, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24559, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24556, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==13 then
pUnit:SpawnCreature(24561, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24559, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24553, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24552, 119.496450, 9.265259, -20.004902, 5.552326, 14, 0)
end
if random==14 then
pUnit:SpawnCreature(24561, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24559, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24556, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24552, 119.496450, 9.265259, -20.004902, 5.552326, 14, 0)
end
if random==15 then
pUnit:SpawnCreature(24559, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24555, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24552, 134.965820, 9.356191, -20.004902, 4.259219, 14, 0)
pUnit:SpawnCreature(24556, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==16 then
pUnit:SpawnCreature(24555, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24556, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24557, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==17 then
pUnit:SpawnCreature(24556, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24555, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24552, 134.965820, 9.356191, -20.004902, 4.259219, 14, 0)
pUnit:SpawnCreature(24558, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24656, 122.813576, 11.031157, -20.004902, 4.912669, 14, 0)
end
if random==18 then
pUnit:SpawnCreature(24556, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24555, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24552, 134.965820, 9.356191, -20.004902, 4.259219, 14, 0)
pUnit:SpawnCreature(24554, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==19 then
pUnit:SpawnCreature(24556, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24555, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24552, 134.965820, 9.356191, -20.004902, 4.259219, 14, 0)
pUnit:SpawnCreature(24561, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==20 then
pUnit:SpawnCreature(24556, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24553, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24555, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24552, 134.965820, 9.356191, -20.004902, 4.259219, 14, 0)
pUnit:SpawnCreature(24559, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==21 then
pUnit:SpawnCreature(24553, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24556, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24557, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24558, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24656, 122.813576, 11.031157, -20.004902, 4.912669, 14, 0)
end
if random==22 then
pUnit:SpawnCreature(24553, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24556, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24557, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24554, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==23 then
pUnit:SpawnCreature(24553, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24556, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24557, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24561, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==24 then
pUnit:SpawnCreature(24553, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24556, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24557, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24559, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
end
if random==25 then
pUnit:SpawnCreature(24553, 123.870529, 12.468772, -20.004911, 4.856926, 14, 0)
pUnit:SpawnCreature(24556, 130.000900, 11.941279, -20.004900, 4.399158, 14, 0)
pUnit:SpawnCreature(24557, 132.254776, 10.996053, -20.004902, 4.230160, 14, 0)
pUnit:SpawnCreature(24555, 121.413750, 11.002829, -20.004902, 5.005877, 14, 0)
pUnit:SpawnCreature(24552, 119.496450, 9.265259, -20.004902, 5.552326, 14, 0)
end
end
function PriestessDelrissa_OnEnterCombat(Unit, Event)
Unit:RemoveEvents()
end
function PriestessDelrissa_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function PriestessDelrissa_OnKill(Unit, Event)
Unit:RemoveEvents()
end
function PriestessDelrissa_OnDied(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(24560, 1, "PriestessDelrissa_OnEnterCombat")
RegisterUnitEvent(24560, 2, "PriestessDelrissa_OnLeaveCombat")
RegisterUnitEvent(24560, 3, "PriestessDelrissa_OnKill")
RegisterUnitEvent(24560, 4, "PriestessDelrissa_OnDied")
RegisterUnitEvent(24560, 6, "PriestessDelrissa_Minions")
|
require "target_specific"
vim.cmd [[packadd packer.nvim]]
require('packer').startup({function()
-- Packer can manage itself
use { 'wbthomason/packer.nvim' }
-- navigation
use {
'ggandor/lightspeed.nvim',
config = [[require('config.lightspeed')]]
}
-- telescope
use {
'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/plenary.nvim'}},
}
use {'nvim-telescope/telescope-ui-select.nvim'}
use {'nvim-telescope/telescope-file-browser.nvim'}
-- themes
use { 'joshdick/onedark.vim' }
-- icons
use { 'kyazdani42/nvim-web-devicons' }
-- treesiter
use { 'nvim-treesitter/nvim-treesitter' }
-- pairs
use {'p00f/nvim-ts-rainbow' }
use { 'windwp/nvim-autopairs' }
use { "lukas-reineke/indent-blankline.nvim" }
-- LSP
use { 'neovim/nvim-lspconfig'}
use { 'williamboman/nvim-lsp-installer' }
use { 'arkav/lualine-lsp-progress' }
use {
'ray-x/navigator.lua',
requires = {'ray-x/guihua.lua', run = 'cd lua/fzy && make'},
}
-- symbols outline
use { 'simrat39/symbols-outline.nvim' }
use { 'stevearc/aerial.nvim' }
-- key helpers
use { "folke/which-key.nvim" }
-- cmp
use { 'hrsh7th/nvim-cmp' }
use { 'hrsh7th/cmp-nvim-lsp' }
use { 'hrsh7th/vim-vsnip' }
use { 'hrsh7th/vim-vsnip-integ' }
-- rust
use { 'simrat39/rust-tools.nvim' }
-- git
use {
'lewis6991/gitsigns.nvim',
requires = {'nvim-lua/plenary.nvim'},
}
-- lualine
use {
'nvim-lualine/lualine.nvim',
requires = {'kyazdani42/nvim-web-devicons'},
}
-- explorer
use {
'kyazdani42/nvim-tree.lua',
requires = { 'kyazdani42/nvim-web-devicons' }
}
-- DAP
use {
"rcarriga/nvim-dap-ui",
requires = {"mfussenegger/nvim-dap"},
}
-- terminal
use { "akinsho/toggleterm.nvim", }
-- fade inactive windows
use {"TaDaa/vimade"}
use {"chentau/marks.nvim"}
use {
"folke/lsp-trouble.nvim"
}
end,
config = {
opt_default = true,
display = {
open_fn = require('packer.util').float,
}
} })
vim.cmd [[packadd lightspeed.nvim]]
if not vim.g.vscode
then
vim.cmd [[packadd aerial.nvim]]
require('config.aerial')
vim.cmd [[packadd nvim-cmp]]
vim.cmd [[packadd cmp-nvim-lsp]]
require('config.nvim_cmp')
vim.cmd [[packadd nvim-treesitter]]
require('config.nvim_treesitter')
vim.cmd [[packadd nvim-web-devicons]]
require('config.nvim_web_devicons')
vim.cmd [[packadd nvim-lspconfig ]]
require('config.nvim_lspconfig')
vim.cmd [[packadd nvim-lsp-installer]]
vim.cmd [[packadd plenary.nvim]]
vim.cmd [[packadd guihua.lua]]
vim.cmd [[packadd gitsigns.nvim]]
require('config.gitsigns')
vim.cmd [[packadd indent-blankline.nvim]]
require('config.indent_blankline')
vim.cmd [[packadd lualine.nvim]]
vim.cmd [[packadd lualine-lsp-progress]]
require('config.lualine')
vim.cmd [[packadd navigator.lua]]
require('config.navigator')
vim.cmd [[packadd nvim-autopairs]]
require('config.autopairs')
vim.cmd [[packadd nvim-dap]]
vim.cmd [[packadd nvim-dap-ui]]
require('config.nvim_dap_ui')
vim.cmd [[packadd nvim-tree.lua]]
require('config.nvim_tree')
vim.cmd [[packadd nvim-ts-rainbow]]
vim.cmd [[packadd onedark.vim]]
vim.cmd [[packadd rust-tools.nvim]]
require('config.rust_tools')
vim.cmd [[packadd symbols-outline.nvim]]
vim.cmd [[packadd telescope.nvim]]
vim.cmd [[packadd telescope-file-browser.nvim]]
vim.cmd [[packadd telescope-ui-select.nvim]]
require('config.telescope')
vim.cmd [[packadd toggleterm.nvim]]
require('config.toggleterm')
if not(vim.g.target_is_rpi) then
vim.cmd [[packadd vimade]]
vim.cmd [[VimadeFadeLevel 0.8]]
end
vim.cmd [[packadd vim-vsnip]]
vim.cmd [[packadd vim-vsnip-integ]]
vim.cmd [[packadd which-key.nvim]]
require('config.which_key')
vim.cmd [[packadd marks.nvim]]
require('config.marks')
vim.cmd [[packadd lsp-trouble.nvim]]
require('config.trouble')
end
|
-- Copyright © 2016 g0ld <g0ld@tuta.io>
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the COPYING file for more details.
local sys = require "Libs/syslib"
local Move = {}
function Move:newFromPC(boxIndex, pokemonBoxIndex, moveIndex)
local o = {}
setmetatable(o, self)
self.__index = self
o.name = getPokemonMoveNameFromPC (boxIndex, pokemonBoxIndex, moveIndex)
if o.name == nil then
return nil
end
o.accuracy = getPokemonMoveAccuracyFromPC (boxIndex, pokemonBoxIndex, moveIndex)
o.power = getPokemonMovePowerFromPC (boxIndex, pokemonBoxIndex, moveIndex)
o.type = getPokemonMoveTypeFromPC (boxIndex, pokemonBoxIndex, moveIndex)
o.damageType = getPokemonMoveDamageTypeFromPC (boxIndex, pokemonBoxIndex, moveIndex)
o.hasStatus = getPokemonMoveStatusFromPC (boxIndex, pokemonBoxIndex, moveIndex)
o.remainingPP = getPokemonRemainingPowerPointsFromPC(boxIndex, pokemonBoxIndex, moveIndex)
o.totalPP = getPokemonMaxPowerPointsFromPC (boxIndex, pokemonBoxIndex, moveIndex)
return o
end
return Move
|
require 'torch'
require 'nn'
require 'optim'
require 'LanguageModel'
require 'util.DataLoader'
local utils = require 'util.utils'
local unpack = unpack or table.unpack
local cmd = torch.CmdLine()
-- Dataset options
cmd:option('-input_h5', 'data/tiny-shakespeare.h5')
cmd:option('-input_json', 'data/tiny-shakespeare.json')
cmd:option('-batch_size', 50)
cmd:option('-seq_length', 50)
-- Model options
cmd:option('-init_from', '')
cmd:option('-reset_iterations', 1)
cmd:option('-model_type', 'lstm')
cmd:option('-wordvec_size', 64)
cmd:option('-rnn_size', 128)
cmd:option('-num_layers', 2)
cmd:option('-dropout', 0)
cmd:option('-batchnorm', 0)
-- Optimization options
cmd:option('-max_epochs', 50)
cmd:option('-learning_rate', 2e-3)
cmd:option('-grad_clip', 5)
cmd:option('-lr_decay_every', 5)
cmd:option('-lr_decay_factor', 0.5)
-- Output options
cmd:option('-print_every', 1)
cmd:option('-checkpoint_every', 1000)
cmd:option('-checkpoint_name', 'checkpoints/checkpoint')
-- Benchmark options
cmd:option('-speed_benchmark', 0)
cmd:option('-memory_benchmark', 0)
-- Backend options
cmd:option('-gpu', 0)
cmd:option('-gpu_backend', 'cuda')
local opt = cmd:parse(arg)
-- Set up GPU stuff
local dtype = 'torch.FloatTensor'
if opt.gpu >= 0 and opt.gpu_backend == 'cuda' then
require 'cutorch'
require 'cunn'
cutorch.setDevice(opt.gpu + 1)
dtype = 'torch.CudaTensor'
print(string.format('Running with CUDA on GPU %d', opt.gpu))
elseif opt.gpu >= 0 and opt.gpu_backend == 'opencl' then
-- Memory benchmarking is only supported in CUDA mode
-- TODO: Time benchmarking is probably wrong in OpenCL mode.
require 'cltorch'
require 'clnn'
cltorch.setDevice(opt.gpu + 1)
dtype = torch.Tensor():cl():type()
print(string.format('Running with OpenCL on GPU %d', opt.gpu))
else
-- Memory benchmarking is only supported in CUDA mode
opt.memory_benchmark = 0
print 'Running in CPU mode'
end
-- Initialize the DataLoader and vocabulary
local loader = DataLoader(opt)
local vocab = utils.read_json(opt.input_json)
local idx_to_token = {}
for k, v in pairs(vocab.idx_to_token) do
idx_to_token[tonumber(k)] = v
end
-- Initialize the model and criterion
local opt_clone = torch.deserialize(torch.serialize(opt))
opt_clone.idx_to_token = idx_to_token
local model = nil
local start_i = 0
if opt.init_from ~= '' then
print('Initializing from ', opt.init_from)
local checkpoint = torch.load(opt.init_from)
model = checkpoint.model:type(dtype)
if opt.reset_iterations == 0 then
start_i = checkpoint.i
end
else
model = nn.LanguageModel(opt_clone):type(dtype)
end
local params, grad_params = model:getParameters()
local crit = nn.CrossEntropyCriterion():type(dtype)
-- Set up some variables we will use below
local N, T = opt.batch_size, opt.seq_length
local train_loss_history = {}
local val_loss_history = {}
local val_loss_history_it = {}
local forward_backward_times = {}
local init_memory_usage, memory_usage = nil, {}
if opt.memory_benchmark == 1 then
-- This should only be enabled in GPU mode
assert(cutorch)
cutorch.synchronize()
local free, total = cutorch.getMemoryUsage(cutorch.getDevice())
init_memory_usage = total - free
end
-- Loss function that we pass to an optim method
local function f(w)
assert(w == params)
grad_params:zero()
-- Get a minibatch and run the model forward, maybe timing it
local timer
local x, y = loader:nextBatch('train')
x, y = x:type(dtype), y:type(dtype)
if opt.speed_benchmark == 1 then
if cutorch then cutorch.synchronize() end
timer = torch.Timer()
end
local scores = model:forward(x)
-- Use the Criterion to compute loss; we need to reshape the scores to be
-- two-dimensional before doing so. Annoying.
local scores_view = scores:view(N * T, -1)
local y_view = y:view(N * T)
local loss = crit:forward(scores_view, y_view)
-- Run the Criterion and model backward to compute gradients, maybe timing it
local grad_scores = crit:backward(scores_view, y_view):view(N, T, -1)
model:backward(x, grad_scores)
if timer then
if cutorch then cutorch.synchronize() end
local time = timer:time().real
print('Forward / Backward pass took ', time)
table.insert(forward_backward_times, time)
end
-- Maybe record memory usage
if opt.memory_benchmark == 1 then
assert(cutorch)
if cutorch then cutorch.synchronize() end
local free, total = cutorch.getMemoryUsage(cutorch.getDevice())
local memory_used = total - free - init_memory_usage
local memory_used_mb = memory_used / 1024 / 1024
print(string.format('Using %dMB of memory', memory_used_mb))
table.insert(memory_usage, memory_used)
end
if opt.grad_clip > 0 then
grad_params:clamp(-opt.grad_clip, opt.grad_clip)
end
return loss, grad_params
end
-- Train the model!
local optim_config = {learningRate = opt.learning_rate}
local num_train = loader.split_sizes['train']
local num_iterations = opt.max_epochs * num_train
model:training()
for i = start_i + 1, num_iterations do
local epoch = math.floor(i / num_train) + 1
-- Check if we are at the end of an epoch
if i % num_train == 0 then
model:resetStates() -- Reset hidden states
-- Maybe decay learning rate
if epoch % opt.lr_decay_every == 0 then
local old_lr = optim_config.learningRate
optim_config = {learningRate = old_lr * opt.lr_decay_factor}
end
end
-- Take a gradient step and maybe print
-- Note that adam returns a singleton array of losses
local _, loss = optim.adam(f, params, optim_config)
table.insert(train_loss_history, loss[1])
if opt.print_every > 0 and i % opt.print_every == 0 then
local float_epoch = i / num_train + 1
local msg = 'Epoch %.2f / %d, i = %d / %d, loss = %f'
local args = {msg, float_epoch, opt.max_epochs, i, num_iterations, loss[1]}
print(string.format(unpack(args)))
end
-- Maybe save a checkpoint
local check_every = opt.checkpoint_every
if (check_every > 0 and i % check_every == 0) or i == num_iterations then
-- Evaluate loss on the validation set. Note that we reset the state of
-- the model; this might happen in the middle of an epoch, but that
-- shouldn't cause too much trouble.
model:evaluate()
model:resetStates()
local num_val = loader.split_sizes['val']
local val_loss = 0
for j = 1, num_val do
local xv, yv = loader:nextBatch('val')
xv = xv:type(dtype)
yv = yv:type(dtype):view(N * T)
local scores = model:forward(xv):view(N * T, -1)
val_loss = val_loss + crit:forward(scores, yv)
end
val_loss = val_loss / num_val
print('val_loss = ', val_loss)
table.insert(val_loss_history, val_loss)
table.insert(val_loss_history_it, i)
model:resetStates()
model:training()
-- First save a JSON checkpoint, excluding the model
local checkpoint = {
opt = opt,
train_loss_history = train_loss_history,
val_loss_history = val_loss_history,
val_loss_history_it = val_loss_history_it,
forward_backward_times = forward_backward_times,
memory_usage = memory_usage,
i = i
}
local filename = string.format('%s_%d.json', opt.checkpoint_name, i)
-- Make sure the output directory exists before we try to write it
paths.mkdir(paths.dirname(filename))
utils.write_json(filename, checkpoint)
-- Now save a torch checkpoint with the model
-- Cast the model to float before saving so it can be used on CPU
model:clearState()
model:float()
checkpoint.model = model
local filename = string.format('%s_%d.t7', opt.checkpoint_name, i)
paths.mkdir(paths.dirname(filename))
torch.save(filename, checkpoint)
model:type(dtype)
params, grad_params = model:getParameters()
collectgarbage()
end
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
--]]
local COMMAND = Clockwork.command:New("TextRemove");
COMMAND.tip = "Remove some text from a surface.";
COMMAND.flags = CMD_DEFAULT;
COMMAND.access = "a";
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local position = player:GetEyeTraceNoCursor().HitPos;
local iRemoved = 0;
for k, v in pairs(cwSurfaceTexts.storedList) do
if (v.position:Distance(position) <= 256) then
Clockwork.datastream:Start(nil, "SurfaceTextRemove", v.position);
cwSurfaceTexts.storedList[k] = nil;
iRemoved = iRemoved + 1;
end;
end;
if (iRemoved > 0) then
Clockwork.player:Notify(player, {"YouRemovedSurfaceText", iRemoved});
else
Clockwork.player:Notify(player, {"NoSurfaceTextsNearPosition"});
end;
cwSurfaceTexts:SaveSurfaceTexts();
end;
COMMAND:Register();
|
local MovingAverage = {}
MovingAverage.__index = MovingAverage
function MovingAverage:calculate( newAmount )
local s = self.smoothingFactor
local r = newAmount*(1-s) + self.currentAverage*s
self.currentAverage = r
return r
end
local function CreateMovingAverage( smoothingFactor )
local self = { currentAverage = 0,
smoothingFactor = smoothingFactor or 0.9 }
return setmetatable(self, MovingAverage)
end
local RateCalculator = {}
RateCalculator.__index = RateCalculator
function RateCalculator:update( amount )
local currentRate = (amount-self._lastAmount) / self._updateFrequency
self.rate = currentRate
self._lastAmount = amount
local averageRate = self._movingAverage:calculate(currentRate)
if averageRate > 0 then
local amountLeft = self.totalAmount - amount
local eta = amountLeft / averageRate
self.eta = eta
else
self.eta = nil
end
end
function RateCalculator:getAverageRate()
return self._movingAverage.currentAverage
end
return function( totalAmount, updateFrequency, smoothingFactor )
local self = { totalAmount = totalAmount,
_lastAmount = 0,
_updateFrequency = updateFrequency,
rate = 0,
eta = nil, -- nil means unknown
_movingAverage = CreateMovingAverage(smoothingFactor) }
return setmetatable(self, RateCalculator)
end
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('CommsMessages_pb')
local MSGTYPE = protobuf.EnumDescriptor();
local MSGTYPE_ERESPONSE_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EPING_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EPONG_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_ENEWUSER_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_ELOGIN_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_ESAY_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EMAPREQUEST_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EMAPIGNORE_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EMAP_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EMAPUPDATE_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EMAPCHARACTERUPDATE_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EQUERYSERVER_ENUM = protobuf.EnumValueDescriptor();
local MSGTYPE_EQUERYSERVERRESPONSE_ENUM = protobuf.EnumValueDescriptor();
local MESSAGE = protobuf.Descriptor();
local MESSAGE_MSGTYPE_FIELD = protobuf.FieldDescriptor();
local MESSAGE_FROM_FIELD = protobuf.FieldDescriptor();
local MESSAGE_DEST_FIELD = protobuf.FieldDescriptor();
local MESSAGE_RESPONSE_FIELD = protobuf.FieldDescriptor();
local MESSAGE_PING_FIELD = protobuf.FieldDescriptor();
local MESSAGE_PONG_FIELD = protobuf.FieldDescriptor();
local MESSAGE_NEWUSER_FIELD = protobuf.FieldDescriptor();
local MESSAGE_LOGIN_FIELD = protobuf.FieldDescriptor();
local MESSAGE_SAY_FIELD = protobuf.FieldDescriptor();
local MESSAGE_MAPREQUEST_FIELD = protobuf.FieldDescriptor();
local MESSAGE_MAPIGNORE_FIELD = protobuf.FieldDescriptor();
local MESSAGE_MAP_FIELD = protobuf.FieldDescriptor();
local MESSAGE_MAPUPDATE_FIELD = protobuf.FieldDescriptor();
local MESSAGE_MAPCHARACTERUPDATE_FIELD = protobuf.FieldDescriptor();
local MESSAGE_QUERYSERVER_FIELD = protobuf.FieldDescriptor();
local MESSAGE_QUERYSERVERRESPONSE_FIELD = protobuf.FieldDescriptor();
local PING = protobuf.Descriptor();
local PING_COUNT_FIELD = protobuf.FieldDescriptor();
local PONG = protobuf.Descriptor();
local PONG_COUNT_FIELD = protobuf.FieldDescriptor();
local RESPONSE = protobuf.Descriptor();
local RESPONSE_CODE_FIELD = protobuf.FieldDescriptor();
local RESPONSE_MESSAGE_FIELD = protobuf.FieldDescriptor();
local NEWUSER = protobuf.Descriptor();
local NEWUSER_USERNAME_FIELD = protobuf.FieldDescriptor();
local NEWUSER_PASSWORD_FIELD = protobuf.FieldDescriptor();
local NEWUSER_NAME_FIELD = protobuf.FieldDescriptor();
local LOGIN = protobuf.Descriptor();
local LOGIN_USERNAME_FIELD = protobuf.FieldDescriptor();
local LOGIN_PASSWORD_FIELD = protobuf.FieldDescriptor();
local SAY = protobuf.Descriptor();
local SAY_TEXT_FIELD = protobuf.FieldDescriptor();
local MAPREQUEST = protobuf.Descriptor();
local MAPREQUEST_X_FIELD = protobuf.FieldDescriptor();
local MAPREQUEST_Y_FIELD = protobuf.FieldDescriptor();
local MAPIGNORE = protobuf.Descriptor();
local MAPIGNORE_X_FIELD = protobuf.FieldDescriptor();
local MAPIGNORE_Y_FIELD = protobuf.FieldDescriptor();
local MAP = protobuf.Descriptor();
local MAP_MINX_FIELD = protobuf.FieldDescriptor();
local MAP_MINY_FIELD = protobuf.FieldDescriptor();
local MAP_MAXX_FIELD = protobuf.FieldDescriptor();
local MAP_MAXY_FIELD = protobuf.FieldDescriptor();
local MAP_DATASIZE_FIELD = protobuf.FieldDescriptor();
local MAPUPDATE = protobuf.Descriptor();
local MAPUPDATE_X_FIELD = protobuf.FieldDescriptor();
local MAPUPDATE_Y_FIELD = protobuf.FieldDescriptor();
local MAPUPDATE_Z_FIELD = protobuf.FieldDescriptor();
local MAPUPDATE_NEWBLOCK_FIELD = protobuf.FieldDescriptor();
local MAPCHARACTERUPDATE = protobuf.Descriptor();
local MAPCHARACTERUPDATE_ID_FIELD = protobuf.FieldDescriptor();
local MAPCHARACTERUPDATE_X_FIELD = protobuf.FieldDescriptor();
local MAPCHARACTERUPDATE_Y_FIELD = protobuf.FieldDescriptor();
local MAPCHARACTERUPDATE_Z_FIELD = protobuf.FieldDescriptor();
local QUERYSERVER = protobuf.Descriptor();
local QUERYSERVERRESPONSE = protobuf.Descriptor();
local QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD = protobuf.FieldDescriptor();
local QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD = protobuf.FieldDescriptor();
local QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD = protobuf.FieldDescriptor();
local QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD = protobuf.FieldDescriptor();
MSGTYPE_ERESPONSE_ENUM.name = "eResponse"
MSGTYPE_ERESPONSE_ENUM.index = 0
MSGTYPE_ERESPONSE_ENUM.number = 1
MSGTYPE_EPING_ENUM.name = "ePing"
MSGTYPE_EPING_ENUM.index = 1
MSGTYPE_EPING_ENUM.number = 2
MSGTYPE_EPONG_ENUM.name = "ePong"
MSGTYPE_EPONG_ENUM.index = 2
MSGTYPE_EPONG_ENUM.number = 3
MSGTYPE_ENEWUSER_ENUM.name = "eNewUser"
MSGTYPE_ENEWUSER_ENUM.index = 3
MSGTYPE_ENEWUSER_ENUM.number = 4
MSGTYPE_ELOGIN_ENUM.name = "eLogin"
MSGTYPE_ELOGIN_ENUM.index = 4
MSGTYPE_ELOGIN_ENUM.number = 5
MSGTYPE_ESAY_ENUM.name = "eSay"
MSGTYPE_ESAY_ENUM.index = 5
MSGTYPE_ESAY_ENUM.number = 6
MSGTYPE_EMAPREQUEST_ENUM.name = "eMapRequest"
MSGTYPE_EMAPREQUEST_ENUM.index = 6
MSGTYPE_EMAPREQUEST_ENUM.number = 7
MSGTYPE_EMAPIGNORE_ENUM.name = "eMapIgnore"
MSGTYPE_EMAPIGNORE_ENUM.index = 7
MSGTYPE_EMAPIGNORE_ENUM.number = 8
MSGTYPE_EMAP_ENUM.name = "eMap"
MSGTYPE_EMAP_ENUM.index = 8
MSGTYPE_EMAP_ENUM.number = 9
MSGTYPE_EMAPUPDATE_ENUM.name = "eMapUpdate"
MSGTYPE_EMAPUPDATE_ENUM.index = 9
MSGTYPE_EMAPUPDATE_ENUM.number = 10
MSGTYPE_EMAPCHARACTERUPDATE_ENUM.name = "eMapCharacterUpdate"
MSGTYPE_EMAPCHARACTERUPDATE_ENUM.index = 10
MSGTYPE_EMAPCHARACTERUPDATE_ENUM.number = 11
MSGTYPE_EQUERYSERVER_ENUM.name = "eQueryServer"
MSGTYPE_EQUERYSERVER_ENUM.index = 11
MSGTYPE_EQUERYSERVER_ENUM.number = 12
MSGTYPE_EQUERYSERVERRESPONSE_ENUM.name = "eQueryServerResponse"
MSGTYPE_EQUERYSERVERRESPONSE_ENUM.index = 12
MSGTYPE_EQUERYSERVERRESPONSE_ENUM.number = 13
MSGTYPE.name = "MsgType"
MSGTYPE.full_name = ".CommsMessages.MsgType"
MSGTYPE.values = {MSGTYPE_ERESPONSE_ENUM,MSGTYPE_EPING_ENUM,MSGTYPE_EPONG_ENUM,MSGTYPE_ENEWUSER_ENUM,MSGTYPE_ELOGIN_ENUM,MSGTYPE_ESAY_ENUM,MSGTYPE_EMAPREQUEST_ENUM,MSGTYPE_EMAPIGNORE_ENUM,MSGTYPE_EMAP_ENUM,MSGTYPE_EMAPUPDATE_ENUM,MSGTYPE_EMAPCHARACTERUPDATE_ENUM,MSGTYPE_EQUERYSERVER_ENUM,MSGTYPE_EQUERYSERVERRESPONSE_ENUM}
MESSAGE_MSGTYPE_FIELD.name = "msgtype"
MESSAGE_MSGTYPE_FIELD.full_name = ".CommsMessages.Message.msgtype"
MESSAGE_MSGTYPE_FIELD.number = 1
MESSAGE_MSGTYPE_FIELD.index = 0
MESSAGE_MSGTYPE_FIELD.label = 2
MESSAGE_MSGTYPE_FIELD.has_default_value = false
MESSAGE_MSGTYPE_FIELD.default_value = 0
MESSAGE_MSGTYPE_FIELD.type = 5
MESSAGE_MSGTYPE_FIELD.cpp_type = 1
MESSAGE_FROM_FIELD.name = "from"
MESSAGE_FROM_FIELD.full_name = ".CommsMessages.Message.from"
MESSAGE_FROM_FIELD.number = 2
MESSAGE_FROM_FIELD.index = 1
MESSAGE_FROM_FIELD.label = 2
MESSAGE_FROM_FIELD.has_default_value = false
MESSAGE_FROM_FIELD.default_value = 0
MESSAGE_FROM_FIELD.type = 5
MESSAGE_FROM_FIELD.cpp_type = 1
MESSAGE_DEST_FIELD.name = "dest"
MESSAGE_DEST_FIELD.full_name = ".CommsMessages.Message.dest"
MESSAGE_DEST_FIELD.number = 3
MESSAGE_DEST_FIELD.index = 2
MESSAGE_DEST_FIELD.label = 2
MESSAGE_DEST_FIELD.has_default_value = false
MESSAGE_DEST_FIELD.default_value = 0
MESSAGE_DEST_FIELD.type = 5
MESSAGE_DEST_FIELD.cpp_type = 1
MESSAGE_RESPONSE_FIELD.name = "response"
MESSAGE_RESPONSE_FIELD.full_name = ".CommsMessages.Message.response"
MESSAGE_RESPONSE_FIELD.number = 4
MESSAGE_RESPONSE_FIELD.index = 3
MESSAGE_RESPONSE_FIELD.label = 1
MESSAGE_RESPONSE_FIELD.has_default_value = false
MESSAGE_RESPONSE_FIELD.default_value = nil
MESSAGE_RESPONSE_FIELD.message_type = _RESPONSE
MESSAGE_RESPONSE_FIELD.type = 11
MESSAGE_RESPONSE_FIELD.cpp_type = 10
MESSAGE_PING_FIELD.name = "ping"
MESSAGE_PING_FIELD.full_name = ".CommsMessages.Message.ping"
MESSAGE_PING_FIELD.number = 5
MESSAGE_PING_FIELD.index = 4
MESSAGE_PING_FIELD.label = 1
MESSAGE_PING_FIELD.has_default_value = false
MESSAGE_PING_FIELD.default_value = nil
MESSAGE_PING_FIELD.message_type = _PING
MESSAGE_PING_FIELD.type = 11
MESSAGE_PING_FIELD.cpp_type = 10
MESSAGE_PONG_FIELD.name = "pong"
MESSAGE_PONG_FIELD.full_name = ".CommsMessages.Message.pong"
MESSAGE_PONG_FIELD.number = 6
MESSAGE_PONG_FIELD.index = 5
MESSAGE_PONG_FIELD.label = 1
MESSAGE_PONG_FIELD.has_default_value = false
MESSAGE_PONG_FIELD.default_value = nil
MESSAGE_PONG_FIELD.message_type = _PONG
MESSAGE_PONG_FIELD.type = 11
MESSAGE_PONG_FIELD.cpp_type = 10
MESSAGE_NEWUSER_FIELD.name = "newUser"
MESSAGE_NEWUSER_FIELD.full_name = ".CommsMessages.Message.newUser"
MESSAGE_NEWUSER_FIELD.number = 7
MESSAGE_NEWUSER_FIELD.index = 6
MESSAGE_NEWUSER_FIELD.label = 1
MESSAGE_NEWUSER_FIELD.has_default_value = false
MESSAGE_NEWUSER_FIELD.default_value = nil
MESSAGE_NEWUSER_FIELD.message_type = _NEWUSER
MESSAGE_NEWUSER_FIELD.type = 11
MESSAGE_NEWUSER_FIELD.cpp_type = 10
MESSAGE_LOGIN_FIELD.name = "login"
MESSAGE_LOGIN_FIELD.full_name = ".CommsMessages.Message.login"
MESSAGE_LOGIN_FIELD.number = 8
MESSAGE_LOGIN_FIELD.index = 7
MESSAGE_LOGIN_FIELD.label = 1
MESSAGE_LOGIN_FIELD.has_default_value = false
MESSAGE_LOGIN_FIELD.default_value = nil
MESSAGE_LOGIN_FIELD.message_type = _LOGIN
MESSAGE_LOGIN_FIELD.type = 11
MESSAGE_LOGIN_FIELD.cpp_type = 10
MESSAGE_SAY_FIELD.name = "say"
MESSAGE_SAY_FIELD.full_name = ".CommsMessages.Message.say"
MESSAGE_SAY_FIELD.number = 9
MESSAGE_SAY_FIELD.index = 8
MESSAGE_SAY_FIELD.label = 1
MESSAGE_SAY_FIELD.has_default_value = false
MESSAGE_SAY_FIELD.default_value = nil
MESSAGE_SAY_FIELD.message_type = _SAY
MESSAGE_SAY_FIELD.type = 11
MESSAGE_SAY_FIELD.cpp_type = 10
MESSAGE_MAPREQUEST_FIELD.name = "mapRequest"
MESSAGE_MAPREQUEST_FIELD.full_name = ".CommsMessages.Message.mapRequest"
MESSAGE_MAPREQUEST_FIELD.number = 10
MESSAGE_MAPREQUEST_FIELD.index = 9
MESSAGE_MAPREQUEST_FIELD.label = 1
MESSAGE_MAPREQUEST_FIELD.has_default_value = false
MESSAGE_MAPREQUEST_FIELD.default_value = nil
MESSAGE_MAPREQUEST_FIELD.message_type = _MAPREQUEST
MESSAGE_MAPREQUEST_FIELD.type = 11
MESSAGE_MAPREQUEST_FIELD.cpp_type = 10
MESSAGE_MAPIGNORE_FIELD.name = "mapIgnore"
MESSAGE_MAPIGNORE_FIELD.full_name = ".CommsMessages.Message.mapIgnore"
MESSAGE_MAPIGNORE_FIELD.number = 11
MESSAGE_MAPIGNORE_FIELD.index = 10
MESSAGE_MAPIGNORE_FIELD.label = 1
MESSAGE_MAPIGNORE_FIELD.has_default_value = false
MESSAGE_MAPIGNORE_FIELD.default_value = nil
MESSAGE_MAPIGNORE_FIELD.message_type = _MAPIGNORE
MESSAGE_MAPIGNORE_FIELD.type = 11
MESSAGE_MAPIGNORE_FIELD.cpp_type = 10
MESSAGE_MAP_FIELD.name = "map"
MESSAGE_MAP_FIELD.full_name = ".CommsMessages.Message.map"
MESSAGE_MAP_FIELD.number = 12
MESSAGE_MAP_FIELD.index = 11
MESSAGE_MAP_FIELD.label = 1
MESSAGE_MAP_FIELD.has_default_value = false
MESSAGE_MAP_FIELD.default_value = nil
MESSAGE_MAP_FIELD.message_type = _MAP
MESSAGE_MAP_FIELD.type = 11
MESSAGE_MAP_FIELD.cpp_type = 10
MESSAGE_MAPUPDATE_FIELD.name = "mapUpdate"
MESSAGE_MAPUPDATE_FIELD.full_name = ".CommsMessages.Message.mapUpdate"
MESSAGE_MAPUPDATE_FIELD.number = 13
MESSAGE_MAPUPDATE_FIELD.index = 12
MESSAGE_MAPUPDATE_FIELD.label = 1
MESSAGE_MAPUPDATE_FIELD.has_default_value = false
MESSAGE_MAPUPDATE_FIELD.default_value = nil
MESSAGE_MAPUPDATE_FIELD.message_type = _MAPUPDATE
MESSAGE_MAPUPDATE_FIELD.type = 11
MESSAGE_MAPUPDATE_FIELD.cpp_type = 10
MESSAGE_MAPCHARACTERUPDATE_FIELD.name = "mapCharacterUpdate"
MESSAGE_MAPCHARACTERUPDATE_FIELD.full_name = ".CommsMessages.Message.mapCharacterUpdate"
MESSAGE_MAPCHARACTERUPDATE_FIELD.number = 14
MESSAGE_MAPCHARACTERUPDATE_FIELD.index = 13
MESSAGE_MAPCHARACTERUPDATE_FIELD.label = 1
MESSAGE_MAPCHARACTERUPDATE_FIELD.has_default_value = false
MESSAGE_MAPCHARACTERUPDATE_FIELD.default_value = nil
MESSAGE_MAPCHARACTERUPDATE_FIELD.message_type = _MAPCHARACTERUPDATE
MESSAGE_MAPCHARACTERUPDATE_FIELD.type = 11
MESSAGE_MAPCHARACTERUPDATE_FIELD.cpp_type = 10
MESSAGE_QUERYSERVER_FIELD.name = "queryServer"
MESSAGE_QUERYSERVER_FIELD.full_name = ".CommsMessages.Message.queryServer"
MESSAGE_QUERYSERVER_FIELD.number = 15
MESSAGE_QUERYSERVER_FIELD.index = 14
MESSAGE_QUERYSERVER_FIELD.label = 1
MESSAGE_QUERYSERVER_FIELD.has_default_value = false
MESSAGE_QUERYSERVER_FIELD.default_value = nil
MESSAGE_QUERYSERVER_FIELD.message_type = _QUERYSERVER
MESSAGE_QUERYSERVER_FIELD.type = 11
MESSAGE_QUERYSERVER_FIELD.cpp_type = 10
MESSAGE_QUERYSERVERRESPONSE_FIELD.name = "queryServerResponse"
MESSAGE_QUERYSERVERRESPONSE_FIELD.full_name = ".CommsMessages.Message.queryServerResponse"
MESSAGE_QUERYSERVERRESPONSE_FIELD.number = 16
MESSAGE_QUERYSERVERRESPONSE_FIELD.index = 15
MESSAGE_QUERYSERVERRESPONSE_FIELD.label = 1
MESSAGE_QUERYSERVERRESPONSE_FIELD.has_default_value = false
MESSAGE_QUERYSERVERRESPONSE_FIELD.default_value = nil
MESSAGE_QUERYSERVERRESPONSE_FIELD.message_type = _QUERYSERVERRESPONSE
MESSAGE_QUERYSERVERRESPONSE_FIELD.type = 11
MESSAGE_QUERYSERVERRESPONSE_FIELD.cpp_type = 10
MESSAGE.name = "Message"
MESSAGE.full_name = ".CommsMessages.Message"
MESSAGE.nested_types = {}
MESSAGE.enum_types = {}
MESSAGE.fields = {MESSAGE_MSGTYPE_FIELD, MESSAGE_FROM_FIELD, MESSAGE_DEST_FIELD, MESSAGE_RESPONSE_FIELD, MESSAGE_PING_FIELD, MESSAGE_PONG_FIELD, MESSAGE_NEWUSER_FIELD, MESSAGE_LOGIN_FIELD, MESSAGE_SAY_FIELD, MESSAGE_MAPREQUEST_FIELD, MESSAGE_MAPIGNORE_FIELD, MESSAGE_MAP_FIELD, MESSAGE_MAPUPDATE_FIELD, MESSAGE_MAPCHARACTERUPDATE_FIELD, MESSAGE_QUERYSERVER_FIELD, MESSAGE_QUERYSERVERRESPONSE_FIELD}
MESSAGE.is_extendable = false
MESSAGE.extensions = {}
PING_COUNT_FIELD.name = "count"
PING_COUNT_FIELD.full_name = ".CommsMessages.Ping.count"
PING_COUNT_FIELD.number = 1
PING_COUNT_FIELD.index = 0
PING_COUNT_FIELD.label = 2
PING_COUNT_FIELD.has_default_value = false
PING_COUNT_FIELD.default_value = 0
PING_COUNT_FIELD.type = 5
PING_COUNT_FIELD.cpp_type = 1
PING.name = "Ping"
PING.full_name = ".CommsMessages.Ping"
PING.nested_types = {}
PING.enum_types = {}
PING.fields = {PING_COUNT_FIELD}
PING.is_extendable = false
PING.extensions = {}
PONG_COUNT_FIELD.name = "count"
PONG_COUNT_FIELD.full_name = ".CommsMessages.Pong.count"
PONG_COUNT_FIELD.number = 1
PONG_COUNT_FIELD.index = 0
PONG_COUNT_FIELD.label = 2
PONG_COUNT_FIELD.has_default_value = false
PONG_COUNT_FIELD.default_value = 0
PONG_COUNT_FIELD.type = 5
PONG_COUNT_FIELD.cpp_type = 1
PONG.name = "Pong"
PONG.full_name = ".CommsMessages.Pong"
PONG.nested_types = {}
PONG.enum_types = {}
PONG.fields = {PONG_COUNT_FIELD}
PONG.is_extendable = false
PONG.extensions = {}
RESPONSE_CODE_FIELD.name = "code"
RESPONSE_CODE_FIELD.full_name = ".CommsMessages.Response.code"
RESPONSE_CODE_FIELD.number = 1
RESPONSE_CODE_FIELD.index = 0
RESPONSE_CODE_FIELD.label = 2
RESPONSE_CODE_FIELD.has_default_value = false
RESPONSE_CODE_FIELD.default_value = 0
RESPONSE_CODE_FIELD.type = 5
RESPONSE_CODE_FIELD.cpp_type = 1
RESPONSE_MESSAGE_FIELD.name = "message"
RESPONSE_MESSAGE_FIELD.full_name = ".CommsMessages.Response.message"
RESPONSE_MESSAGE_FIELD.number = 2
RESPONSE_MESSAGE_FIELD.index = 1
RESPONSE_MESSAGE_FIELD.label = 1
RESPONSE_MESSAGE_FIELD.has_default_value = false
RESPONSE_MESSAGE_FIELD.default_value = ""
RESPONSE_MESSAGE_FIELD.type = 9
RESPONSE_MESSAGE_FIELD.cpp_type = 9
RESPONSE.name = "Response"
RESPONSE.full_name = ".CommsMessages.Response"
RESPONSE.nested_types = {}
RESPONSE.enum_types = {}
RESPONSE.fields = {RESPONSE_CODE_FIELD, RESPONSE_MESSAGE_FIELD}
RESPONSE.is_extendable = false
RESPONSE.extensions = {}
NEWUSER_USERNAME_FIELD.name = "username"
NEWUSER_USERNAME_FIELD.full_name = ".CommsMessages.NewUser.username"
NEWUSER_USERNAME_FIELD.number = 1
NEWUSER_USERNAME_FIELD.index = 0
NEWUSER_USERNAME_FIELD.label = 2
NEWUSER_USERNAME_FIELD.has_default_value = false
NEWUSER_USERNAME_FIELD.default_value = ""
NEWUSER_USERNAME_FIELD.type = 9
NEWUSER_USERNAME_FIELD.cpp_type = 9
NEWUSER_PASSWORD_FIELD.name = "password"
NEWUSER_PASSWORD_FIELD.full_name = ".CommsMessages.NewUser.password"
NEWUSER_PASSWORD_FIELD.number = 2
NEWUSER_PASSWORD_FIELD.index = 1
NEWUSER_PASSWORD_FIELD.label = 2
NEWUSER_PASSWORD_FIELD.has_default_value = false
NEWUSER_PASSWORD_FIELD.default_value = ""
NEWUSER_PASSWORD_FIELD.type = 9
NEWUSER_PASSWORD_FIELD.cpp_type = 9
NEWUSER_NAME_FIELD.name = "name"
NEWUSER_NAME_FIELD.full_name = ".CommsMessages.NewUser.name"
NEWUSER_NAME_FIELD.number = 3
NEWUSER_NAME_FIELD.index = 2
NEWUSER_NAME_FIELD.label = 2
NEWUSER_NAME_FIELD.has_default_value = false
NEWUSER_NAME_FIELD.default_value = ""
NEWUSER_NAME_FIELD.type = 9
NEWUSER_NAME_FIELD.cpp_type = 9
NEWUSER.name = "NewUser"
NEWUSER.full_name = ".CommsMessages.NewUser"
NEWUSER.nested_types = {}
NEWUSER.enum_types = {}
NEWUSER.fields = {NEWUSER_USERNAME_FIELD, NEWUSER_PASSWORD_FIELD, NEWUSER_NAME_FIELD}
NEWUSER.is_extendable = false
NEWUSER.extensions = {}
LOGIN_USERNAME_FIELD.name = "username"
LOGIN_USERNAME_FIELD.full_name = ".CommsMessages.Login.username"
LOGIN_USERNAME_FIELD.number = 1
LOGIN_USERNAME_FIELD.index = 0
LOGIN_USERNAME_FIELD.label = 2
LOGIN_USERNAME_FIELD.has_default_value = false
LOGIN_USERNAME_FIELD.default_value = ""
LOGIN_USERNAME_FIELD.type = 9
LOGIN_USERNAME_FIELD.cpp_type = 9
LOGIN_PASSWORD_FIELD.name = "password"
LOGIN_PASSWORD_FIELD.full_name = ".CommsMessages.Login.password"
LOGIN_PASSWORD_FIELD.number = 2
LOGIN_PASSWORD_FIELD.index = 1
LOGIN_PASSWORD_FIELD.label = 2
LOGIN_PASSWORD_FIELD.has_default_value = false
LOGIN_PASSWORD_FIELD.default_value = ""
LOGIN_PASSWORD_FIELD.type = 9
LOGIN_PASSWORD_FIELD.cpp_type = 9
LOGIN.name = "Login"
LOGIN.full_name = ".CommsMessages.Login"
LOGIN.nested_types = {}
LOGIN.enum_types = {}
LOGIN.fields = {LOGIN_USERNAME_FIELD, LOGIN_PASSWORD_FIELD}
LOGIN.is_extendable = false
LOGIN.extensions = {}
SAY_TEXT_FIELD.name = "text"
SAY_TEXT_FIELD.full_name = ".CommsMessages.Say.text"
SAY_TEXT_FIELD.number = 1
SAY_TEXT_FIELD.index = 0
SAY_TEXT_FIELD.label = 2
SAY_TEXT_FIELD.has_default_value = false
SAY_TEXT_FIELD.default_value = ""
SAY_TEXT_FIELD.type = 9
SAY_TEXT_FIELD.cpp_type = 9
SAY.name = "Say"
SAY.full_name = ".CommsMessages.Say"
SAY.nested_types = {}
SAY.enum_types = {}
SAY.fields = {SAY_TEXT_FIELD}
SAY.is_extendable = false
SAY.extensions = {}
MAPREQUEST_X_FIELD.name = "x"
MAPREQUEST_X_FIELD.full_name = ".CommsMessages.MapRequest.x"
MAPREQUEST_X_FIELD.number = 1
MAPREQUEST_X_FIELD.index = 0
MAPREQUEST_X_FIELD.label = 2
MAPREQUEST_X_FIELD.has_default_value = false
MAPREQUEST_X_FIELD.default_value = 0
MAPREQUEST_X_FIELD.type = 5
MAPREQUEST_X_FIELD.cpp_type = 1
MAPREQUEST_Y_FIELD.name = "y"
MAPREQUEST_Y_FIELD.full_name = ".CommsMessages.MapRequest.y"
MAPREQUEST_Y_FIELD.number = 2
MAPREQUEST_Y_FIELD.index = 1
MAPREQUEST_Y_FIELD.label = 2
MAPREQUEST_Y_FIELD.has_default_value = false
MAPREQUEST_Y_FIELD.default_value = 0
MAPREQUEST_Y_FIELD.type = 5
MAPREQUEST_Y_FIELD.cpp_type = 1
MAPREQUEST.name = "MapRequest"
MAPREQUEST.full_name = ".CommsMessages.MapRequest"
MAPREQUEST.nested_types = {}
MAPREQUEST.enum_types = {}
MAPREQUEST.fields = {MAPREQUEST_X_FIELD, MAPREQUEST_Y_FIELD}
MAPREQUEST.is_extendable = false
MAPREQUEST.extensions = {}
MAPIGNORE_X_FIELD.name = "x"
MAPIGNORE_X_FIELD.full_name = ".CommsMessages.MapIgnore.x"
MAPIGNORE_X_FIELD.number = 1
MAPIGNORE_X_FIELD.index = 0
MAPIGNORE_X_FIELD.label = 2
MAPIGNORE_X_FIELD.has_default_value = false
MAPIGNORE_X_FIELD.default_value = 0
MAPIGNORE_X_FIELD.type = 5
MAPIGNORE_X_FIELD.cpp_type = 1
MAPIGNORE_Y_FIELD.name = "y"
MAPIGNORE_Y_FIELD.full_name = ".CommsMessages.MapIgnore.y"
MAPIGNORE_Y_FIELD.number = 2
MAPIGNORE_Y_FIELD.index = 1
MAPIGNORE_Y_FIELD.label = 2
MAPIGNORE_Y_FIELD.has_default_value = false
MAPIGNORE_Y_FIELD.default_value = 0
MAPIGNORE_Y_FIELD.type = 5
MAPIGNORE_Y_FIELD.cpp_type = 1
MAPIGNORE.name = "MapIgnore"
MAPIGNORE.full_name = ".CommsMessages.MapIgnore"
MAPIGNORE.nested_types = {}
MAPIGNORE.enum_types = {}
MAPIGNORE.fields = {MAPIGNORE_X_FIELD, MAPIGNORE_Y_FIELD}
MAPIGNORE.is_extendable = false
MAPIGNORE.extensions = {}
MAP_MINX_FIELD.name = "minX"
MAP_MINX_FIELD.full_name = ".CommsMessages.Map.minX"
MAP_MINX_FIELD.number = 1
MAP_MINX_FIELD.index = 0
MAP_MINX_FIELD.label = 2
MAP_MINX_FIELD.has_default_value = false
MAP_MINX_FIELD.default_value = 0
MAP_MINX_FIELD.type = 5
MAP_MINX_FIELD.cpp_type = 1
MAP_MINY_FIELD.name = "minY"
MAP_MINY_FIELD.full_name = ".CommsMessages.Map.minY"
MAP_MINY_FIELD.number = 2
MAP_MINY_FIELD.index = 1
MAP_MINY_FIELD.label = 2
MAP_MINY_FIELD.has_default_value = false
MAP_MINY_FIELD.default_value = 0
MAP_MINY_FIELD.type = 5
MAP_MINY_FIELD.cpp_type = 1
MAP_MAXX_FIELD.name = "maxX"
MAP_MAXX_FIELD.full_name = ".CommsMessages.Map.maxX"
MAP_MAXX_FIELD.number = 3
MAP_MAXX_FIELD.index = 2
MAP_MAXX_FIELD.label = 2
MAP_MAXX_FIELD.has_default_value = false
MAP_MAXX_FIELD.default_value = 0
MAP_MAXX_FIELD.type = 5
MAP_MAXX_FIELD.cpp_type = 1
MAP_MAXY_FIELD.name = "maxY"
MAP_MAXY_FIELD.full_name = ".CommsMessages.Map.maxY"
MAP_MAXY_FIELD.number = 4
MAP_MAXY_FIELD.index = 3
MAP_MAXY_FIELD.label = 2
MAP_MAXY_FIELD.has_default_value = false
MAP_MAXY_FIELD.default_value = 0
MAP_MAXY_FIELD.type = 5
MAP_MAXY_FIELD.cpp_type = 1
MAP_DATASIZE_FIELD.name = "dataSize"
MAP_DATASIZE_FIELD.full_name = ".CommsMessages.Map.dataSize"
MAP_DATASIZE_FIELD.number = 5
MAP_DATASIZE_FIELD.index = 4
MAP_DATASIZE_FIELD.label = 2
MAP_DATASIZE_FIELD.has_default_value = false
MAP_DATASIZE_FIELD.default_value = 0
MAP_DATASIZE_FIELD.type = 5
MAP_DATASIZE_FIELD.cpp_type = 1
MAP.name = "Map"
MAP.full_name = ".CommsMessages.Map"
MAP.nested_types = {}
MAP.enum_types = {}
MAP.fields = {MAP_MINX_FIELD, MAP_MINY_FIELD, MAP_MAXX_FIELD, MAP_MAXY_FIELD, MAP_DATASIZE_FIELD}
MAP.is_extendable = false
MAP.extensions = {}
MAPUPDATE_X_FIELD.name = "x"
MAPUPDATE_X_FIELD.full_name = ".CommsMessages.MapUpdate.x"
MAPUPDATE_X_FIELD.number = 1
MAPUPDATE_X_FIELD.index = 0
MAPUPDATE_X_FIELD.label = 2
MAPUPDATE_X_FIELD.has_default_value = false
MAPUPDATE_X_FIELD.default_value = 0
MAPUPDATE_X_FIELD.type = 5
MAPUPDATE_X_FIELD.cpp_type = 1
MAPUPDATE_Y_FIELD.name = "y"
MAPUPDATE_Y_FIELD.full_name = ".CommsMessages.MapUpdate.y"
MAPUPDATE_Y_FIELD.number = 2
MAPUPDATE_Y_FIELD.index = 1
MAPUPDATE_Y_FIELD.label = 2
MAPUPDATE_Y_FIELD.has_default_value = false
MAPUPDATE_Y_FIELD.default_value = 0
MAPUPDATE_Y_FIELD.type = 5
MAPUPDATE_Y_FIELD.cpp_type = 1
MAPUPDATE_Z_FIELD.name = "z"
MAPUPDATE_Z_FIELD.full_name = ".CommsMessages.MapUpdate.z"
MAPUPDATE_Z_FIELD.number = 3
MAPUPDATE_Z_FIELD.index = 2
MAPUPDATE_Z_FIELD.label = 2
MAPUPDATE_Z_FIELD.has_default_value = false
MAPUPDATE_Z_FIELD.default_value = 0
MAPUPDATE_Z_FIELD.type = 5
MAPUPDATE_Z_FIELD.cpp_type = 1
MAPUPDATE_NEWBLOCK_FIELD.name = "newBlock"
MAPUPDATE_NEWBLOCK_FIELD.full_name = ".CommsMessages.MapUpdate.newBlock"
MAPUPDATE_NEWBLOCK_FIELD.number = 4
MAPUPDATE_NEWBLOCK_FIELD.index = 3
MAPUPDATE_NEWBLOCK_FIELD.label = 2
MAPUPDATE_NEWBLOCK_FIELD.has_default_value = false
MAPUPDATE_NEWBLOCK_FIELD.default_value = 0
MAPUPDATE_NEWBLOCK_FIELD.type = 5
MAPUPDATE_NEWBLOCK_FIELD.cpp_type = 1
MAPUPDATE.name = "MapUpdate"
MAPUPDATE.full_name = ".CommsMessages.MapUpdate"
MAPUPDATE.nested_types = {}
MAPUPDATE.enum_types = {}
MAPUPDATE.fields = {MAPUPDATE_X_FIELD, MAPUPDATE_Y_FIELD, MAPUPDATE_Z_FIELD, MAPUPDATE_NEWBLOCK_FIELD}
MAPUPDATE.is_extendable = false
MAPUPDATE.extensions = {}
MAPCHARACTERUPDATE_ID_FIELD.name = "id"
MAPCHARACTERUPDATE_ID_FIELD.full_name = ".CommsMessages.MapCharacterUpdate.id"
MAPCHARACTERUPDATE_ID_FIELD.number = 1
MAPCHARACTERUPDATE_ID_FIELD.index = 0
MAPCHARACTERUPDATE_ID_FIELD.label = 2
MAPCHARACTERUPDATE_ID_FIELD.has_default_value = false
MAPCHARACTERUPDATE_ID_FIELD.default_value = 0
MAPCHARACTERUPDATE_ID_FIELD.type = 5
MAPCHARACTERUPDATE_ID_FIELD.cpp_type = 1
MAPCHARACTERUPDATE_X_FIELD.name = "x"
MAPCHARACTERUPDATE_X_FIELD.full_name = ".CommsMessages.MapCharacterUpdate.x"
MAPCHARACTERUPDATE_X_FIELD.number = 2
MAPCHARACTERUPDATE_X_FIELD.index = 1
MAPCHARACTERUPDATE_X_FIELD.label = 2
MAPCHARACTERUPDATE_X_FIELD.has_default_value = false
MAPCHARACTERUPDATE_X_FIELD.default_value = 0
MAPCHARACTERUPDATE_X_FIELD.type = 5
MAPCHARACTERUPDATE_X_FIELD.cpp_type = 1
MAPCHARACTERUPDATE_Y_FIELD.name = "y"
MAPCHARACTERUPDATE_Y_FIELD.full_name = ".CommsMessages.MapCharacterUpdate.y"
MAPCHARACTERUPDATE_Y_FIELD.number = 3
MAPCHARACTERUPDATE_Y_FIELD.index = 2
MAPCHARACTERUPDATE_Y_FIELD.label = 2
MAPCHARACTERUPDATE_Y_FIELD.has_default_value = false
MAPCHARACTERUPDATE_Y_FIELD.default_value = 0
MAPCHARACTERUPDATE_Y_FIELD.type = 5
MAPCHARACTERUPDATE_Y_FIELD.cpp_type = 1
MAPCHARACTERUPDATE_Z_FIELD.name = "z"
MAPCHARACTERUPDATE_Z_FIELD.full_name = ".CommsMessages.MapCharacterUpdate.z"
MAPCHARACTERUPDATE_Z_FIELD.number = 4
MAPCHARACTERUPDATE_Z_FIELD.index = 3
MAPCHARACTERUPDATE_Z_FIELD.label = 2
MAPCHARACTERUPDATE_Z_FIELD.has_default_value = false
MAPCHARACTERUPDATE_Z_FIELD.default_value = 0
MAPCHARACTERUPDATE_Z_FIELD.type = 5
MAPCHARACTERUPDATE_Z_FIELD.cpp_type = 1
MAPCHARACTERUPDATE.name = "MapCharacterUpdate"
MAPCHARACTERUPDATE.full_name = ".CommsMessages.MapCharacterUpdate"
MAPCHARACTERUPDATE.nested_types = {}
MAPCHARACTERUPDATE.enum_types = {}
MAPCHARACTERUPDATE.fields = {MAPCHARACTERUPDATE_ID_FIELD, MAPCHARACTERUPDATE_X_FIELD, MAPCHARACTERUPDATE_Y_FIELD, MAPCHARACTERUPDATE_Z_FIELD}
MAPCHARACTERUPDATE.is_extendable = false
MAPCHARACTERUPDATE.extensions = {}
QUERYSERVER.name = "QueryServer"
QUERYSERVER.full_name = ".CommsMessages.QueryServer"
QUERYSERVER.nested_types = {}
QUERYSERVER.enum_types = {}
QUERYSERVER.fields = {}
QUERYSERVER.is_extendable = false
QUERYSERVER.extensions = {}
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.name = "minMapChunkX"
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.full_name = ".CommsMessages.QueryServerResponse.minMapChunkX"
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.number = 1
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.index = 0
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.label = 2
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.has_default_value = false
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.default_value = 0
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.type = 5
QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD.cpp_type = 1
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.name = "minMapChunkY"
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.full_name = ".CommsMessages.QueryServerResponse.minMapChunkY"
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.number = 2
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.index = 1
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.label = 2
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.has_default_value = false
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.default_value = 0
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.type = 5
QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD.cpp_type = 1
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.name = "maxMapChunkX"
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.full_name = ".CommsMessages.QueryServerResponse.maxMapChunkX"
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.number = 3
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.index = 2
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.label = 2
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.has_default_value = false
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.default_value = 0
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.type = 5
QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD.cpp_type = 1
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.name = "maxMapChunkY"
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.full_name = ".CommsMessages.QueryServerResponse.maxMapChunkY"
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.number = 4
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.index = 3
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.label = 2
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.has_default_value = false
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.default_value = 0
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.type = 5
QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD.cpp_type = 1
QUERYSERVERRESPONSE.name = "QueryServerResponse"
QUERYSERVERRESPONSE.full_name = ".CommsMessages.QueryServerResponse"
QUERYSERVERRESPONSE.nested_types = {}
QUERYSERVERRESPONSE.enum_types = {}
QUERYSERVERRESPONSE.fields = {QUERYSERVERRESPONSE_MINMAPCHUNKX_FIELD, QUERYSERVERRESPONSE_MINMAPCHUNKY_FIELD, QUERYSERVERRESPONSE_MAXMAPCHUNKX_FIELD, QUERYSERVERRESPONSE_MAXMAPCHUNKY_FIELD}
QUERYSERVERRESPONSE.is_extendable = false
QUERYSERVERRESPONSE.extensions = {}
Login = protobuf.Message(LOGIN)
Map = protobuf.Message(MAP)
MapCharacterUpdate = protobuf.Message(MAPCHARACTERUPDATE)
MapIgnore = protobuf.Message(MAPIGNORE)
MapRequest = protobuf.Message(MAPREQUEST)
MapUpdate = protobuf.Message(MAPUPDATE)
Message = protobuf.Message(MESSAGE)
NewUser = protobuf.Message(NEWUSER)
Ping = protobuf.Message(PING)
Pong = protobuf.Message(PONG)
QueryServer = protobuf.Message(QUERYSERVER)
QueryServerResponse = protobuf.Message(QUERYSERVERRESPONSE)
Response = protobuf.Message(RESPONSE)
Say = protobuf.Message(SAY)
eLogin = 5
eMap = 9
eMapCharacterUpdate = 11
eMapIgnore = 8
eMapRequest = 7
eMapUpdate = 10
eNewUser = 4
ePing = 2
ePong = 3
eQueryServer = 12
eQueryServerResponse = 13
eResponse = 1
eSay = 6
|
--this = SceneNode()
function destroy()
if form then
form:setVisible(false)
form:destroy()
form = nil
end
end
function create()
timer = 0.0
if this:getNodeType() == NodeId.playerNode then
local menuNode = this:getRootNode():addChild(SceneNode())
--camera = Camera()
menuNode:setSceneName("crash log menu")
menuNode:createWork()
--Move this script to the camera node
--this:removeScript(this:getCurrentScript():getName());
menuNode:loadLuaScript(this:getCurrentScript():getFileName());
return false
end
keyBindToogleVisible = KeyBind()
keyBindToogleVisible:setKeyBindKeyboard(0, Key.F7)
return true
end
function generateForm()
local rootNode = this:getRootNode();
local camera = ConvertToCamera(rootNode:findNodeByName("MainCamera"));
form = Form( camera, PanelSize(Vec2(0.15,0.75)), Alignment.TOP_LEFT);
form:setBackground(Sprite(Vec4(0.1, 0.1, 0.1, 0.7)));
form:setLayout(FlowLayout());
form:setBorder(Border(BorderSize(Vec4(0.005)), Vec4(0,0,0,0),Vec4(0,0,0,1)));
form:setPadding(BorderSize(Vec4(0.005)));
form:getLayout():setPanelSpacing(PanelSize(Vec2(0.001)));
form:setFormOffset(PanelSize(Vec2(0.055,0.1)));
form:setRenderLevel(9)
form:setVisible(true)
local rowHeight = 0.025 - 0.001
local yHeight = form:getPanelSize():getSize().y - 0.01 - form:getPaddingSize():getSize().y
numLabels = math.floor( yHeight / rowHeight)
labels = {}
textList = {}
for i=1,numLabels do
textList[i] = ""
labels[i] = form:add(Label(PanelSize(Vec2(-1,rowHeight)),textList[i],Vec3(1)))
end
end
function printAll()
for i=1, numLabels do
labels[i]:setText(textList[i])
end
end
function isNewOnTable(name)
if oldTable then
for i=1, #oldTable do
if oldTable[i]==name then
return false
end
end
end
return true
end
function update()
if keyBindToogleVisible:getPressed() then
if show==nil then
show=true
generateForm()
elseif show==false then
show = true
form:setVisible(true)
else
show = false
form:setVisible(false)
end
end
if show==true then
timer = timer + Core.getRealDeltaTime()
if timer>1.0 then
timer = 0.0
newTable = getActiveScriptCounterTable()
local min = math.min(numLabels,#newTable)
for i=1, min do
if isNewOnTable(newTable[i]) then
labels[i]:setText("<font color=rgb(10,255,10)>"..newTable[i].."</font>")
else
labels[i]:setText(newTable[i])
end
end
if min~=numLabels then
for i=min+1, numLabels do
labels[i]:setText("")
end
end
oldTable = newTable
end
--form
form:update()
end
return true
end
|
local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'serve-d' },
filetypes = { 'd' },
root_dir = util.root_pattern('dub.json', 'dub.sdl', '.git'),
},
docs = {
description = [[
https://github.com/Pure-D/serve-d
`Microsoft language server protocol implementation for D using workspace-d.`
Download a binary from https://github.com/Pure-D/serve-d/releases and put it in your $PATH.
]],
default_config = {
root_dir = [[util.root_pattern("dub.json", "dub.sdl", ".git")]],
},
},
}
|
return {
id = 8,
version = "0.3.4",
date = "05/19/2019",
changelog = {
"Fixed invisible hats on join bug",
}
}
|
local settings = require('settings')
local function sendChunk(sck, chunk)
local chunkSize = string.format('%x', chunk:len())
sck:send(chunkSize .. '\r\n' .. chunk .. '\r\n')
end
local function handleSent(sck)
if FdInFlight == nil then return end
local bytes = FdInFlight:read()
if bytes then
sendChunk(sck, bytes)
else
FdInFlight:close()
FdInFlight = nil
-- send zero chunk
sendChunk(sck, '')
end
end
local function getBody()
-- determine if body is complete
local _, i = UploadRecvBuffer:find('\r\n\r\n')
if not i then return nil end
i = i + 1
local chunkSize = nil
local j
local body = ''
while chunkSize ~= 0 do
-- slide i,j to chunk size (chunk size transmitted in hex chars)
_, j = UploadRecvBuffer:find('\r\n', i)
-- Haven't received end of chunk size portion to parse
if not j then return nil end
chunkSize = tonumber(UploadRecvBuffer:sub(i, j), 16)
if (chunkSize ~= 0) and ((UploadRecvBuffer:len()) <= (j + chunkSize + 2)) then
-- The full chunk hasn't been received (chunk > received data)
return nil
end
body = body .. UploadRecvBuffer:sub(j + 1, j + chunkSize - 1)
i = j + chunkSize + 3
end
return body
end
local function handleBody(body)
-- TODO: parse body
print(UploadRecvBuffer:gsub('\r\n', '\\r\\n'))
end
local function startPost(sck)
local msg = 'POST /RemoteDevices/upload-readings HTTP/1.1' ..
'\r\nHost: ' .. settings.serverDomain ..
'\r\nContent-Type: application/json' ..
'\r\nConnection: ' .. UploadConnHeader ..
'\r\nTransfer-Encoding: chunked' ..
'\r\n\r\n'
sck:send(msg)
end
local function sendNextFile(sck)
-- Pop name, open filedesc, send file
-- No files left
FileNameInFlight = table.remove(QueuedFileNames)
if not FileNameInFlight then
return nil
end
-- File doesn't exist
FdInFlight= file.open(FileNameInFlight, 'r')
if not FdInFlight then
return nil
end
-- Request close by server if this is the last file
if not next(QueuedFileNames) then
UploadConnHeader = 'close'
end
startPost(sck)
end
local function handleReceive(sck, data)
if data then UploadRecvBuffer = UploadRecvBuffer .. data end
if not UploadRecvBuffer:match('Transfer%-Encoding: chunked') then
print('Response must be chunked')
return
end
local body = getBody()
if body then
handleBody(body)
UploadRecvBuffer = ''
file.remove(FileNameInFlight)
local _, last = UploadRecvBuffer:find('\r\n\r\n')
local connClose = UploadRecvBuffer:sub(1, last):match('Connection: close')
if not connClose then
sendNextFile(sck)
end
end
end
local function registerHandlers()
UploadConn:on("connection",
function(sck)
print('connected')
sendNextFile(sck)
end
)
UploadConn:on("sent", handleSent)
UploadConn:on("receive", handleReceive)
UploadConn:on("reconnection",
function(sck, c)
print('Reconnection event', c)
UploadCloseTimer:unregister()
ConnTimeout:unregister()
end
)
UploadConn:on("disconnection",
function(sck)
UploadCloseTimer:unregister()
ConnTimeout:unregister()
print('Disconnection event')
end
)
end
registerHandlers()
|
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local gears = require("gears")
local widget_font = beautiful.widget_ncmpcpp_font or 'RobotoMono Nerd Font Mono 25'
local widget_ncmpcpp_prev = beautiful.widget_ncmpcpp_prev or '<span foreground="#334932"> < </span>'
local widget_ncmpcpp_toggle = beautiful.widget_ncmpcpp_toggle or '<span foreground="#334932"> </span>'
local widget_ncmpcpp_next = beautiful.widget_ncmpcpp_next or '<span foreground="#334932"> > </span>'
-- Prev
ncmpcpp_prev_icon = wibox.widget {
markup = widget_ncmpcpp_prev,
widget = wibox.widget.textbox,
font = widget_font,
}
ncmpcpp_prev_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc prev")
end)
))
-- Toggle
ncmpcpp_toggle_icon = wibox.widget {
markup = widget_ncmpcpp_toggle,
widget = wibox.widget.textbox,
font = widget_font,
}
ncmpcpp_toggle_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc toggle")
end)
))
-- Next
ncmpcpp_next_icon = wibox.widget {
markup = widget_ncmpcpp_next,
widget = wibox.widget.textbox,
font = widget_font,
}
ncmpcpp_next_icon:buttons(gears.table.join(
awful.button({ }, 1, function ()
awful.spawn.with_shell("mpc next")
end)
))
|
-- ----------------------------------------------
-- Copyright (c) 2018, CounterFlow AI, Inc. All Rights Reserved.
-- author: Randy Caldejon <rc@counterflowai.com>
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE.txt file.
-- ----------------------------------------------
-- ----------------------------------------------
-- TLS look up -- https://notary.icsi.berkeley.edu/
-- ----------------------------------------------
-- ----------------------------------------------
--
-- ----------------------------------------------
function setup()
conn = hiredis.connect()
if not conn then
error ("Error connecting to the redis server")
end
if conn:command("PING") ~= hiredis.status.PONG then
error ("Unable to ping redis")
else
print (">>>>TLS analyzer running")
end
end
-- ----------------------------------------------
--
-- ----------------------------------------------
function loop(msg)
local eve = cjson.decode(msg)
if eve.tls.fingerprint then
local sha1 = string.gsub(eve.tls.fingerprint, ":", "")
if sha1 then
-- print ("TLS fingerprint: "..eve.tls.fingerprint)
key = "tls:"..sha1
conn:command ("hmset", key, "issuerdn",eve.tls.issuerdn,"subject",eve.tls.subject,"version", eve.tls.version)
conn:command ("expire", key,'300')
conn:command ("zincrby", "tls",1,sha1)
reply = conn:command ("sismember","tls:valid",sha1)
if reply then
local a_record = sha1..".notary.icsi.berkeley.edu"
---print(">> TLS CHECKING: "..a_record)
local ip = dnslookup(a_record)
if not ip[1] then
message = "time: "..eve.timestamp..", message: TLS lookup error - "..status
-- print (message)
dragonfly.output_event ("log", message)
else
-- print(">> TLS RESP: "..ipi[1])
if ip[1] == "127.0.0.2" or ip[1] == "127.0.0.1" then
conn:command("sadd","tls:valid",sha1)
conn:command ("expire", key,'300')
else
message = "time:"..eve.timestamp..", dest ip:"..eve.dest_ip.."fingerprint:"..sha1..", issuer: "..eve.tls.issuerdn..", subject:"..eve.tls.subject.."sni:"..eve.tls.sni
dragonfly.output_event ("tls", message)
end
end
end
end
end
end
|
-- This file contains some prebuild Pokémons to play with.
require "contest/move"
require "contest/pokemon"
-- Beautiful Master Pokémons.
Tropica = Pokemon:new("Tropica", {Move:new("Whirlpool"), Move:new("Aqua Tail"), Move:new("Surf"), Move:new("Agility")})
Plumy = Pokemon:new("Plumy", {Move:new("Petal Blizzard"), Move:new("Petal Dance"), Move:new("Grassy Terrain"), Move:new("Solar Beam")})
Macy = Pokemon:new("Macy", {Move:new("Attract"), Move:new("Return"), Move:new("Round"), Move:new("Sunny Day")})
Betta = Pokemon:new("Betta", {Move:new("Counter"), Move:new("Mirror Coat"), Move:new("Safeguard"), Move:new("Destiny Bond")})
Trod = Pokemon:new("Trod", {Move:new("Sonic Boom"), Move:new("Electro Ball"), Move:new("Discharge"), Move:new("Explosion")})
-- Other Pokémons.
Speranza = Pokemon:new("Speranza", {Move:new("Mimic"), Move:new("Round"), Move:new("Dazzling Gleam"), Move:new("Disarming Voice")})
Castform = Pokemon:new("Castform", {Move:new("Sunny Day"), Move:new("Rain Dance"), Move:new("Hail"), Move:new("Weather Ball")})
Meganium = Pokemon:new("Meganium", {Move:new("Solar Beam"), Move:new("Sunny Day"), Move:new("Synthesis"), Move:new("Body Slam")})
Gyarados = Pokemon:new("Gyarados", {Move:new("Surf"), Move:new("Dive"), Move:new("Hydro Pump"), Move:new("Tackle")})
-- Functions to build a team as in DS game, if playing with Speranza in a Master Beautiful contest.
local choices = {Speranza = Speranza, Tropica = Tropica, Plumy = Plumy, Macy = Macy, Betta = Betta, Trod = Trod} -- associate Pokémon name with Pokémon object.
local preliminary = {Betta = 1, Speranza = 2, Tropica = 3, Trod = 4, Macy = 5, Plumy = 6} -- every Pokémon has a Beautiful statistic: if higher you go first. In this table, the number are based on the order as seen on DS game, if the number is small the Pokémon goes firts.
function getPokemon(rnd, weights)
-- Given a random number and a table of weights (random number between 1 and sum of weights) return the element of the table corresponding.
-- E.g. rnd = 3, weights = {apple = 1, banana = 2, peach = 1} => returns banana.
local cum = 0 -- cumulative count of weights.
for n, v in pairs(weights) do -- iterate over the whole table.
if rnd > cum and rnd <= cum + v then -- if the random number is inside the weight area return the element.
return n
end
cum = cum + v -- update the cumulative count.
end
end
function buildBMTeam()
-- Return a team with Speranza and the usual Master Beautiful contest Pokémons, as in DS game.
local team = {"Speranza"} -- Speranza must be always chosen.
local weights = {Betta = 1, Tropica = 1, Trod = 1, Macy = 1, Plumy = 1} -- weights table, if a weight is higher there is more probability of being chosen. If all weights are equal we uniformly choose between them.
local tot = 0
for _, v in pairs(weights) do tot = tot + v end -- sum up all weights.
for j = 1, 3 do -- choose three other Pokémon (other than Speranza).
local pokemon = getPokemon(math.random(tot), weights) -- choose a Pokémon in the table.
table.insert(team, pokemon) -- add it to the team table.
-- Now, the chosen Pokémon can't be chosen again. So, put 0 as weight of that Pokémon - it won't be chosen again, this way.
tot = tot - weights[pokemon]
weights[pokemon] = 0
end
table.sort(team, function(a,b) return preliminary[a] < preliminary[b] end) -- sort team table by preliminary values.
local Team = {}
for j = 1, #team do Team[j] = choices[team[j]]:clone() end -- build team based on the Pokémon chosen before.
return Team
end
|
local L = LibStub("AceLocale-3.0"):NewLocale("GuildGearRules", "itIT")
if not L then return end
|
function setup()
background(255);
noStroke();
end
function draw()
background(255);
local from = color(255, 0, 0, 0.2 * 255);
local to = color(0, 0, 255, 0.2 * 255);
local c1 = lerpColor(from, to, 0.33);
local c2 = lerpColor(from, to, 0.66);
for i = 1, 15 do
fill(from);
quad(
random(-40, 220), random(height),
random(-40, 220), random(height),
random(-40, 220), random(height),
random(-40, 220), random(height)
);
fill(c1);
quad(
random(140, 380), random(height),
random(140, 380), random(height),
random(140, 380), random(height),
random(140, 380), random(height)
);
fill(c2);
quad(
random(320, 580), random(height),
random(320, 580), random(height),
random(320, 580), random(height),
random(320, 580), random(height)
);
fill(to);
quad(
random(500, 760), random(height),
random(500, 760), random(height),
random(500, 760), random(height),
random(500, 760), random(height)
);
end
--frameRate(5);
end
go {width = 720, height = 400, frameRate=5}
|
--lua
local unpack, select
= unpack, select
--wow api
local ConvertRGBtoColorString
= ConvertRGBtoColorString
local BestInSlot, L, AceGUI = unpack(select(2, ...))
local AceGUI = LibStub("AceGUI-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("BestInSlotRedux")
local Credits = BestInSlot:GetMenuPrototype(L["Credits"])
local hordeColor, allianceColor
Credits.Width = 600
Credits.Height = 600
-- Name variables for locales since some were weirdly missing
local sDEDE, sESES, sESMX, sFRFR, sITIT, sKOKR, sPTBR, sRURU, sZHCN, sZHTW
= "German", "Spanish", "Spanish (Latin America)", "French", "Italian", "Korean", "Brazilian Portuguese", "Russian", "Simplified Chinese", "Traditional Chinese"
function Credits:CreateTranslatorLabel(language, name)
local label = AceGUI:Create("Label")
label:SetFullWidth(true)
label:SetText(("%s: %s"):format(language, name))
return label
end
function Credits:CreateTesterLabel(name, realm, class, faction)
local label = AceGUI:Create("Label")
local txt = name
if class then
txt = "|c"..RAID_CLASS_COLORS[class].colorStr..txt.."|r"
end
if realm then
txt = txt.." - "
if faction then
local factionStr = ""
if faction == "A" then
if not allianceColor then allianceColor = ConvertRGBtoColorString(PLAYER_FACTION_COLORS[1]) end
factionStr = allianceColor
elseif faction == "H" then
if not hordeColor then hordeColor = ConvertRGBtoColorString(PLAYER_FACTION_COLORS[0]) end
factionStr = hordeColor
end
txt = txt..factionStr
end
txt = txt..realm.."|r"
end
label:SetFullWidth(true)
label:SetText(txt)
return label
end
function Credits:Draw(container)
container:SetLayout("Fill")
local scroll = AceGUI:Create("ScrollFrame")
scroll:SetFullWidth(true)
scroll:SetFullHeight(true)
container:AddChild(scroll)
local header = AceGUI:Create("Heading")
header:SetText("Foreword")
header:SetFullWidth(true)
scroll:AddChild(header)
-- foreword
local label = AceGUI:Create("Label")
label:SetText(
"I have developped this AddOn. But the credit doesn't go solely to me.\n"..
"There have been a lot of people making awesome recommendations and I'd like to include them in here as a way of thanking them.\n"..
"This page is intentionally untranslated in other languages because it is my personal message to those that helped me.\n"..
"\n"..
"Thanks for taking the time to read these credits.\n"..
"\n"..
"With kind regards "..self.Author1..
"\n\n----------\n\n"..
"I want to thank Baleria for letting me take over this project.\n"..
"The work you have put down into this AddOn is really amazing and it has been a pleasure figuring out how it works.\n"..
"-"..self.Author2
)
label:SetFullWidth(true)
scroll:AddChild(label)
local header = AceGUI:Create("Heading")
header:SetText("Authors")
header:SetFullWidth(true)
scroll:AddChild(header)
label = AceGUI:Create("Label")
label:SetText(self.Author)
label:SetFullWidth(true)
-- authors
scroll:AddChild(self:CreateTesterLabel("Beleria", "Argent Dawn-EU", "DEMONHUNTER", "A"))
scroll:AddChild(self:CreateTesterLabel("Anhility", "Ravencrest-EU", "PALADIN", "A"))
local header = AceGUI:Create("Heading")
header:SetText("Contributors")
header:SetFullWidth(true)
scroll:AddChild(header)
-- contributors
scroll:AddChild(self:CreateTesterLabel("Sannath", "Elune-EU", "DRUID", "A"))
local header = AceGUI:Create("Heading")
header:SetText("Official Websites")
header:SetFullWidth(true)
scroll:AddChild(header)
-- urls
scroll:AddChild(self:CreateUneditableTextbox("https://www.curseforge.com/wow/addons/bestinslotredux", "BestInSlotRedux on Curse.com"))
scroll:AddChild(self:CreateUneditableTextbox("https://github.com/anhility/BestInSlotRedux", "BestInSlotRedux on Github.com"))
local header = AceGUI:Create("Heading")
header:SetText("Translators")
header:SetFullWidth(true)
scroll:AddChild(header)
-- Translators
scroll:AddChild(self:CreateTranslatorLabel(sDEDE, "Rushgarroth1337 & SpeedsharkX"))
--scroll:AddChild(self:CreateTranslatorLabel(sESES, "to be added"))
scroll:AddChild(self:CreateTranslatorLabel(sESMX, "xylons"))
scroll:AddChild(self:CreateTranslatorLabel(sFRFR, "Meivyn & nitrodroki"))
--scroll:AddChild(self:CreateTranslatorLabel(sITIT, "to be added"))
--scroll:AddChild(self:CreateTranslatorLabel(sKOKR, "to be added"))
scroll:AddChild(self:CreateTranslatorLabel(sPTBR, "Carlinha"))
scroll:AddChild(self:CreateTranslatorLabel(sRURU, "Hubbotu & SintlKun"))
--scroll:AddChild(self:CreateTranslatorLabel(sZHCN, "to be added"))
scroll:AddChild(self:CreateTranslatorLabel(sZHTW, "gaspy10"))
-- Old translators
local label=AceGUI:Create("Label")
label:SetFullWidth(true)
label:SetText(
"\n\n"..
"I want to acknowledge the following people who did the previous translations that unfortunately were lost:\n"..
sDEDE..": Simcat & neo0608\n"..
sESES..": Luskaner\n"..
sKOKR..": yuk6196 & cyberyahoo\n"..
sRURU..": KAPMA & Je\195\177ka\n"..
sZHCN..": nrg3331"
)
scroll:AddChild(label)
-- Translation help
scroll:AddChild(self:CreateUneditableTextbox("https://wow.curseforge.com/projects/bestinslotredux/localization", "Want to help translate BestInSlotRedux?"))
local header = AceGUI:Create("Heading")
header:SetText("Testers")
header:SetFullWidth(true)
scroll:AddChild(header)
scroll:AddChild(self:CreateTesterLabel("Yulrich", "Argent Dawn-EU", "PRIEST", "A"))
scroll:AddChild(self:CreateTesterLabel("Mard", "Steamwheedle Cartel-EU", "DRUID", "H"))
scroll:AddChild(self:CreateTesterLabel("Minta", "Defias Brotherhood-EU", "PRIEST", "H"))
scroll:AddChild(self:CreateTesterLabel("Peanut", "Defias Brotherhood-EU", "HUNTER", "A"))
scroll:AddChild(self:CreateTesterLabel("Nema\195\175r", "Defias Brotherhood-EU", "MAGE", "A"))
local header = AceGUI:Create("Heading")
header:SetText("Special Thanks")
header:SetFullWidth(true)
scroll:AddChild(header)
local label = AceGUI:Create("Label")
label:SetFullWidth(true)
label:SetText(
"Special thanks to the guild <Shadowsongs Bane>.\n"..
"When the AddOn was in early development they allowed me to extensively test it.\n"..
"So for everyone I haven't mentioned in person from Shadowsongs Bane, thanks!\n-"..self.Author1
)
scroll:AddChild(label)
end
|
local ctx = require"_openssl.hmac"
return ctx
|
li('typescriptImport', 'Include')
|
--pairs可以遍历表中所有的key,并且除了迭代器本身以及遍历表本身还可以返回nil;
--但是ipairs则不能返回nil,只能返回数字0,如果遇到nil则退出
-- 属性有 size 方法有 add remove clrean List会保证下标的连续 但每次移除,下标都会改变
--下标从1 开始
List = SimpleClass()
function List:__init( ... )
self.size = 0
self.items = {}
end
function List:add( item )
if item == nil then
Logger:log('--add to list data item was nil')
return
end
self.size = self.size + 1
self.items[self.size] = item
end
function List:get(index)
return self.items[index]
--[[ for k,v in pairs(self.items) do
if k == id then
return v
end
end
return nil--]]
end
--移除一个元素 后面的元素向前移位
function List:remove(item)
-- for i,v in ipairs(self.items) do
-- if item == v then
-- --self.items[i] = nil
-- table.remove(self.items,i)
-- end
-- end
-- self.size = self.size - 1
for i = #self.items, 1, -1 do
if self.items[i] == item then
table.remove(self.items, i)
self.size = self.size - 1
break
end
end
end
function List:clrean()
for i,v in ipairs(self.items) do
self.items[i] = nil
end
self.items = {}
self.size = 0
end
|
data:extend{
{
type = "font",
name = "recursive-blueprints-invisible-font",
from = "default",
size = 0,
},
}
|
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
--local logger = require(Modules.src.utils.Logger)
local Roact = require(Modules.Roact)
local Dict = require(Modules.src.utils.Dict)
local createElement = Roact.createElement
local function UICorner(props)
local joinedProps = Dict.join({ CornerRadius = UDim.new(0, 4) }, props)
return createElement('UICorner', joinedProps)
end
return UICorner
|
local vararg = require "vararg"
local append = vararg.append
local concat = vararg.concat
local insert = vararg.insert
local len = vararg.len
local map = vararg.map
local pack = vararg.pack
local range = vararg.range
local remove = vararg.remove
local replace = vararg.replace
-- auxiliary functions----------------------------------------------------------
local values = {}
local maxstack = 1024
for i = 1, maxstack, 2 do
values[i] = i
end
local function tpack(...)
return {..., n=select("#", ...)}
end
local function assertsame(v, i, j, ...)
local count = select("#", ...)
assert(count == j-i+1, count..","..i..","..j)
for pos = 1, count do
assert(v[i+pos-1] == select(pos, ...))
end
end
local function asserterror(expected, f, ...)
local ok, actual = pcall(f, ...)
assert(ok == false, "error was expected")
assert(actual:find(expected, 1, true), "wrong error, got "..actual)
end
-- test 'len' function ---------------------------------------------------------
assert(len() == 0)
assert(len({},{},{}) == 3)
assert(len(nil) == 1)
assert(len(nil, nil) == 2)
assert(len(nil, 1, nil) == 3)
assert(len(table.unpack(values, 1, 254)) == 254)
assert(len(table.unpack(values, 1, 255)) == 255)
assert(len(table.unpack(values, 1, 256)) == 256)
assert(len(table.unpack(values, 1, maxstack)) == maxstack)
-- test 'pack' function --------------------------------------------------------
local function testpack(...)
local v = {...}
local n = select("#", ...)
local p = pack(...)
assertsame(v, 1, n, p())
assert(n == p("#"))
local c = 0
for i, pv in p do
c = c+1
assert(c == i)
assert(v[i] == pv)
end
assert(select("#", p(0)) == 0)
assert(select("#", p(n+1)) == 0)
assert(select("#", p(-(n+1))) == 0)
for i = 1, n do
assert(v[i] == p(i))
assert(v[i] == p(i-n-1))
end
assert(select("#", p(-1, 0)) == 0)
assert(select("#", p(0, 0)) == 0)
for i = 1, n, 10 do
assert(select("#", p(i, -(n+1))) == 0)
assert(select("#", p(n+1, -i)) == 0)
local j = i+9
assertsame(v, i, math.min(n, j), p(i, j))
if n > j then
assertsame(v, i, j, p(i-n-1, j-n-1))
end
end
end
testpack()
testpack({},{},{})
testpack(nil)
testpack(nil, nil)
testpack(nil, 1, nil)
testpack(table.unpack(values, 1, 254))
testpack(table.unpack(values, 1, 255))
testpack(table.unpack(values, 1, 256))
testpack(table.unpack(values, 1, maxstack))
-- test 'range' function -------------------------------------------------------
local function testrange(n, ...)
local v = {...}
for c = 1, 3 do
for i = 1, n, c do
assert(select("#", range(i, -(n+1), ...)) == 0)
assert(select("#", range(n+1, -i, ...)) == 0)
local j = math.min(i+c-1, n)
assertsame(v, i, j, range(i, j, ...))
local n = select("#", ...)
if n > 0 then
assertsame(v, i, j, range(i-n-1, j-n-1, ...))
end
end
end
end
testrange(0)
testrange(5 , nil,nil,nil,nil,nil)
testrange(10, 0,1,2,3,4,5,6,7,8,9)
testrange(maxstack, table.unpack(values, 1, maxstack))
-- test other functions --------------------------------------------------------
assert(select("#", remove(0)) == 0)
assert(select("#", remove(1)) == 0)
assert(select("#", remove(-1)) == 0)
assertsame({1,2,3,4,5}, 1, 5, remove( 3, 1,2,0,3,4,5))
assertsame({1,2,3,4,5}, 1, 5, remove(-1, 1,2,3,4,5,0))
assertsame({1,2,nil,4}, 1, 4, remove( 4, 1,2,nil,0,4))
assertsame({nil,nil,3}, 1, 3, remove( 3, nil,nil,0,3))
assertsame({1,2,3,4,5}, 1, 5, remove(10, 1,2,3,4,5))
assertsame({1,2,3,4,5}, 1, 5, remove( 0, 1,2,3,4,5))
assertsame({1,2,3,4,5}, 1, 5, remove( 6, 1,2,3,4,5))
assertsame({1,2,3,4,5}, 1, 5, remove(-6, 1,2,3,4,5))
assertsame({1} , 1, 1, replace(1, 1))
assertsame({1,2,3,4,5}, 1, 5, replace(3, 3, 1,2,0,4,5))
assertsame({1,2,3,4,5}, 1, 5, replace(5,-1, 1,2,3,4,0))
assertsame({1,2,nil,4}, 1, 4, replace(4, 4, 1,2))
assertsame({nil,nil,3}, 1, 3, replace(3, 3))
assertsame({1} , 1, 1, insert(1, 1))
assertsame({nil,nil,3}, 1, 3, insert(3, 3))
assertsame({1,2,3,4,5}, 1, 5, insert(3, 3, 1,2,4,5))
assertsame({1,2,3,4,5}, 1, 5, insert(4,-1, 1,2,3,5))
assertsame({1,2,nil,4}, 1, 4, insert(4, 4, 1,2))
assertsame({nil} , 1, 1, append(nil))
assertsame({1} , 1, 1, append(1))
assertsame({1,2,3,4,5}, 1, 5, append(5, 1,2,3,4))
assertsame({1,2,nil,4}, 1, 4, append(4, 1,2,nil))
assertsame({nil,nil,3}, 1, 3, append(3, nil,nil))
assertsame({1,nil,nil}, 1, 3, append(nil, 1,nil))
assert(select("#", map(nil)) == 0)
assert(select("#", map(error)) == 0)
assertsame({"1","2","3","4","5"}, 1, 5, map(tostring, 1,2,3,4,5))
assertsame({"1","2","nil","4" }, 1, 4, map(tostring, 1,2,nil,4))
assertsame({"nil","nil","3" }, 1, 3, map(tostring, nil,nil,3))
assertsame({"1","nil","nil" }, 1, 3, map(tostring, 1,nil,nil))
local function three(v) return v,v,v end
assertsame({3,3,3} , 1, 3, map(three, 3))
assertsame({1,2,3,3,3}, 1, 5, map(three, 1,2,3))
assert(select("#", concat(function () end)) == 0)
assertsame({1,2,3}, 1, 3, concat(function () end, 1,2,3))
assertsame({1,2,3}, 1, 3, concat(pack(1,2,3)))
assertsame({1,2,3,4,5,6}, 1, 6, concat(pack(4,5,6), 1,2,3))
assertsame({1,2,3,4,5,6,7,8,9}, 1, 9, concat(pack(7,8,9),
concat(pack(4,5,6),
concat(pack(1,2,3)))))
-- test function calls that yield ----------------------------------------------
local c = coroutine.create(function (...)
return map(coroutine.yield, ...)
end)
local function resumetoend(c, ok, ...)
assert(ok, ...)
if coroutine.status(c) == "suspended" then
return resumetoend(c, coroutine.resume(c, 9*(...)))
end
return ...
end
assertsame({9,18,27}, 1, 3, resumetoend(c, coroutine.resume(c, 1,2,3)))
local c = coroutine.create(function (...)
return concat(coroutine.yield, ...)
end)
assert(coroutine.resume(c, 1,2,3))
assertsame({true, 1,2,3,4,5,6}, 1, 7, coroutine.resume(c, 4,5,6))
-- test function errors and exceptional conditions -----------------------------
asserterror("(number expected, got no value)", insert)
asserterror("(number expected, got no value)", insert, nil)
asserterror("(number expected, got nil)", insert, nil, nil)
asserterror("(position out of bounds)", insert, nil, 0)
asserterror("(position out of bounds)", insert, nil, -1)
asserterror("(position out of bounds)", insert, nil, 0, 1,2,3)
asserterror("(position out of bounds)", insert, nil, -4, 1,2,3)
asserterror("(number expected, got no value)", replace)
asserterror("(number expected, got no value)", replace, nil)
asserterror("(number expected, got nil)", replace, nil, nil)
asserterror("(position out of bounds)", replace, nil, 0)
asserterror("(position out of bounds)", replace, nil, -1)
asserterror("(position out of bounds)", replace, nil, 0, 1,2,3)
asserterror("(position out of bounds)", replace, nil, -4, 1,2,3)
asserterror("(number expected, got no value)", remove)
asserterror("(number expected, got nil)", remove, nil)
asserterror("(value expected)", append)
asserterror("(value expected)", concat)
asserterror("attempt to call a nil value", concat, nil)
asserterror("attempt to call a nil value", concat, nil, 1,2,3)
asserterror("(value expected)", map)
asserterror("attempt to call a nil value", map, nil, 1,2,3)
--------------------------------------------------------------------------------
print("Success!")
|
local state = {}
state._NAME = ...
local vector = require'vector'
local Body = require'Body'
local t_entry, t_update, t_finish, tLastUpdate
local timeout = 10.0
require'mcm'
local qLArm, qRArm
local mode = 0
function state.entry()
print(state._NAME..' Entry' )
-- Update the time of entry
local t_entry_prev = t_entry -- When entry was previously called
t_entry = Body.get_time()
t_update = t_entry
t_finish = t
--Untorque both arms
for i=1,10 do
Body.set_larm_torque_enable(0)
unix.usleep(1e6*0.01);
Body.set_rarm_torque_enable(0)
unix.usleep(1e6*0.01);
end
tLastUpdate = t_entry
end
function state.update()
-- print(state._NAME..' Update' )
-- Get the time of update
local t = Body.get_time()
local dt = t - t_update
-- Save this at the last update time
t_update = t
--[[
--Read arm positions (for switching roles purpose)
qLArm = Body.get_larm_position()
qRArm = Body.get_rarm_position()
local threshold = 45*DEG_TO_RAD
local qL = util.mod_angle(qLArm[1])
local qR = util.mod_angle(qRArm[1])
local newmode = mode
if qL>threshold and qR>threshold then
mode = 1
elseif qL<-threshold and qR<-threshold then
mode = 2
else
mode = 0
end
if t-tLastUpdate>0.2 then
if mode==0 then
Body.set_head_led_red(0)
Body.set_head_led_green(128)
Body.set_head_led_blue(0)
if gcm.get_game_state()<4 and gcm.get_game_state()>0 and Config.use_arm_switch then
-- game_ch:send'finish'
end
elseif mode==1 then
Body.set_head_led_red(255)
Body.set_head_led_green(0)
Body.set_head_led_blue(0)
if gcm.get_game_state()~=3 then
gcm.set_game_role(1)
end
elseif mode==2 then
Body.set_head_led_red(0)
Body.set_head_led_green(0)
Body.set_head_led_blue(255)
if gcm.get_game_state()~=3 then
gcm.set_game_role(0)
end
end
tLastUpdate = t
end
--]]
end
function state.exit()
print(state._NAME..' Exit' )
end
return state
|
--[[
math
]]
local math_ceil = math.ceil
local math_floor = math.floor
local ok, socket = pcall(function()
return require("socket")
end)
function math.round(value)
value = tonumber(value) or 0
return math_floor(value + 0.5)
end
function math.trunc(x)
if x <= 0 then
return math_ceil(x)
end
if math_ceil(x) == x then
x = math_ceil(x)
else
x = math_ceil(x) - 1
end
return x
end
function math.newrandomseed()
math.randomseed(os.time())
math.random()
math.random()
math.random()
math.random()
end
|
local load_module = require('utils.helpers').load_module
local ls = load_module 'luasnip'
if not ls then
return false
end
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
-- local isn = ls.indent_snippet_node
local i = ls.insert_node
-- local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
-- local l = require('luasnip.extras').lambda
local r = require('luasnip.extras').rep
-- local p = require('luasnip.extras').partial
-- local m = require('luasnip.extras').match
-- local n = require('luasnip.extras').nonempty
-- local dl = require('luasnip.extras').dynamic_lambda
local fmt = require('luasnip.extras.fmt').fmt
-- local fmta = require('luasnip.extras.fmt').fmta
-- local types = require 'luasnip.util.types'
-- local events = require 'luasnip.util.events'
-- local conds = require 'luasnip.extras.expand_conditions'
local utils = RELOAD 'plugins.luasnip.utils'
local saved_text = utils.saved_text
local else_clause = utils.else_clause
-- local return_value = utils.return_value
-- local surround_with_func = utils.surround_with_func
local function rec_args()
return sn(nil, {
c(1, {
t { '' },
sn(nil, {
t { ', ' },
c(1, {
i(1, 'int'),
i(1, 'char*'),
i(1, 'float'),
i(1, 'long'),
}),
t { ' ' },
i(2, 'varname'),
d(3, rec_args, {}),
}),
}),
})
end
-- stylua: ignore
local snippets = {
s(
{ trig = 'if(e?)', regTrig = true },
fmt([[
if({}) {{
{}
}}{}
]], {
i(1, 'condition'),
d(2, saved_text, {}, {user_args = {{indent = true}}}),
d(3, else_clause, {}, {}),
})),
s('elif', fmt([[
else if({}) {{
{}
}}
]],{
i(1, 'condition'),
d(2, saved_text, {}, {user_args = {{indent = true}}}),
})),
s('fori', fmt([[
for({} = {}; {} < {}; {}++) {{
{}
}}
]], {
i(1, 'i'),
i(2, '0'),
r(1),
i(3, '10'),
r(1),
d(4, saved_text, {}, {user_args = {{indent = true}}}),
})),
s('w', fmt([[
while({}) {{
{}
}}
]], {
i(1, 'condition'),
d(2, saved_text, {}, {user_args = {{indent = true}}}),
})),
s('fun', fmt([[
{} {}({}{}) {{
{}
}}
]], {
c(1, {
i(1, 'int'),
i(1, 'char*'),
i(1, 'float'),
i(1, 'long'),
}),
i(2, 'name'),
c(3, {
t{''},
sn(nil, {
c(1, {
i(1, 'int'),
i(1, 'char*'),
i(1, 'float'),
i(1, 'long'),
}),
t{' '},
i(2, 'varname'),
}),
}),
d(4, rec_args, {}),
d(5, saved_text, {}, {user_args = {{indent = true}}}),
})),
}
return snippets
|
coroutine.start = function ()
end
local a = coroutine
|
-- _.isTable.lua
--
-- Checks if value is classified as a table primitive.
-- @usage _.print(_.isTable({'1'}))
-- --> true
-- _.print(_.isString(1))
-- --> false
--
-- @param value the value to check
-- @return Returns true if value is correctly classified, else false.
_.isTable = function(value)
return type(value) == 'table'
end
|
local f = {}
for j = 0, 9 do
f[j + 1] = 1
end
for i = 1, 9 do
f[i + 1] = f[i + 1] * i * f[i]
io.write(string.format("%d ", f[i + 1]))
end
local out0 = 0
io.write("\n")
for a = 0, 9 do
for b = 0, 9 do
for c = 0, 9 do
for d = 0, 9 do
for e = 0, 9 do
for g = 0, 9 do
local sum = f[a + 1] + f[b + 1] + f[c + 1] + f[d + 1] + f[e + 1] + f[g + 1]
local num = ((((a * 10 + b) * 10 + c) * 10 + d) * 10 + e) * 10 + g
if a == 0 then
sum = sum - 1
if b == 0 then
sum = sum - 1
if c == 0 then
sum = sum - 1
if d == 0 then
sum = sum - 1
end
end
end
end
if sum == num and sum ~= 1 and sum ~= 2 then
out0 = out0 + num
io.write(string.format("%d ", num))
end
end
end
end
end
end
end
io.write(string.format("\n%d\n", out0))
|
cmpickorder = {
["totalstages"] = 22,
["currentstage"] = 0,
["captainradiant"] = "empty",
["captaindire"] = "empty",
["reserveradiant"] = CAPTAINS_MODE_RESERVE_TIME,
["reservedire"] = CAPTAINS_MODE_RESERVE_TIME,
["order"] = {
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
},
{
["type"] = "Ban",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_GOODGUYS,
["hero"] = "empty"
},
{
["type"] = "Pick",
["side"] = DOTA_TEAM_BADGUYS,
["hero"] = "empty"
}
},
["2picks"] = {},
["3picks"] = {}
}
|
local module1 = { }
function module1.method3(param)
print("method 3")
local y = 10 + param;
return y * 2
end
return module1
|
-- nest_ study 4
-- state & meta-affordances
--
-- grid (synth):
-- 1-8 9-16
-- 1: patterns presets
-- 2-8: keybaord controls
--
-- screen (delay):
-- e1: delay
-- e2: rate
-- e3: feedback
-- k2: reverse
include 'lib/nest/core'
include 'lib/nest/norns'
include 'lib/nest/grid'
include 'lib/nest/txt'
polysub = include 'we/lib/polysub'
delay = include 'awake/lib/halfsecond'
local cs = require 'controlspec'
scale = { 0, 2, 4, 7, 9 }
root = 440 * 2^(5/12) -- the d above middle a
engine.name = 'PolySub'
polysub.params()
delay.init()
synth = nest_ {
grid = nest_ {
pattern_group = nest_ {
keyboard = _grid.momentary {
x = { 1, #scale }, -- notes on the x axis
y = { 2, 8 },-- octaves on the y axis
action = function(self, value, t, d, added, removed)
local key = added or removed
local id = key.y * 7 + key.x -- a unique integer for this grid key
local octave = key.y - 5
local note = scale[key.x]
local hz = root * 2^octave * 2^(note/12)
if added then engine.start(id, hz)
elseif removed then engine.stop(id) end
end
},
control_preset = _grid.preset {
y = 1, x = { 9, 16 },
target = function(self) return synth.grid.controls end
}
},
pattern = _grid.pattern {
y = 1, x = { 1, 8 },
target = function(self) return synth.grid.pattern_group end,
stop = function()
synth.grid.pattern_group.keyboard:clear()
engine.stopAll()
end
},
-- synth controls
controls = nest_ {
shape = _grid.control {
x = 9, y = { 2, 8 },
} :param('shape'),
timbre = _grid.control {
x = 10, y = { 2, 8 },
} :param('timbre'),
noise = _grid.control {
x = 11, y = { 2, 8 },
} :param('sub'),
hzlag = _grid.control {
x = 12, y = { 2, 8 },
} :param('noise'),
cut = _grid.control {
x = 13, y = { 2, 8 },
} :param('cut'),
attack = _grid.control {
x = 14, y = { 2, 8 },
} :param('ampatk'),
sustain = _grid.control {
x = 15, y = { 2, 8 },
} :param('ampsus'),
release = _grid.control {
x = 16, y = { 2, 8 },
} :param('amprel')
}
},
-- delay controls
screen = nest_ {
delay = _txt.enc.control {
x = 2, y = 16,
n = 1,
} :param('delay'),
rate = _txt.enc.control {
x = 2, y = 44,
n = 2
} :param('delay_rate'),
feedback = _txt.enc.control {
x = 64, y = 44,
n = 3,
} :param('delay_feedback'),
}
}
synth.grid:connect {
g = grid.connect()
}
synth.screen:connect {
screen = screen,
key = key,
enc = enc
}
function init()
synth:load()
params:read()
synth:init()
params:bang()
end
function cleanup()
synth:save()
params:write()
end
|
if not bit32 then
bit32 = load([[ return {
band = function(a, b) return a & b end,
bor = function(a, b) return a | b end,
bxor = function(a, b) return a ~ b end,
bnot = function(a) return ~a end,
rshift = function(a, n) return a >> n end,
lshift = function(a, n) return a << n end,
rrotate = function(a, n)
local y = (a >> n) & ~(-1 << (32 - n))
local z = x << (32 - n)
return y | z
end
}]])()
end
|
local Gamestate = require 'vendor/gamestate'
local window = require 'window'
local camera = require 'camera'
local sound = require 'vendor/TEsound'
local fonts = require 'fonts'
local state = Gamestate.new()
function state:init()
self.background = love.graphics.newImage("images/menu/pause.png")
self.instructions = {
{ 'UP', 'W / UP ARROW'},
{ 'DOWN', 'S / DOWN ARROW'},
{ 'LEFT', 'A / LEFT ARROW'},
{ 'RIGHT', 'D / RIGHT ARROW'},
{ 'A (ATTACK)', 'L / Z / SHIFT'},
{ 'B (JUMP)', 'K / X / SPACEBAR'},
{ 'START', 'ESC'},
{ 'SELECT', 'RETURN / ENTER'}
}
-- The X coordinates of the columns
self.left_column = 136
self.right_column = 245
-- The Y coordinate of the top key
self.top = 93
-- Vertical spacing between keys
self.spacing = 20
end
function state:enter(previous)
fonts.set( 'big' )
sound.playMusic( "daybreak" )
camera:setPosition(0, 0)
self.previous = previous
end
function state:leave()
fonts.reset()
end
function state:keypressed( button )
Gamestate.switch(self.previous)
end
function state:draw()
love.graphics.draw(self.background)
love.graphics.setColor( 0, 0, 0, 255 )
for n,instruction in ipairs(self.instructions) do
local y = self.top + self.spacing * (n - 1)
-- Draw action
love.graphics.print(instruction[1], self.left_column, y, 0, 0.8)
-- And draw associated key
love.graphics.print(instruction[2], self.right_column, y, 0, 0.8)
end
love.graphics.setColor( 255, 255, 255, 255 )
end
return state
|
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if(item.uid == 9031) then
if(player:getStorageValue(Storage.InServiceofYalahar.Questline) == 31 and player:getStorageValue(Storage.InServiceofYalahar.MorikSummon) < 1) then
local ret = Game.createMonster("Morik the Gladiator", fromPosition)
ret:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:setStorageValue(Storage.InServiceofYalahar.MorikSummon, 1)
end
end
return true
end
|
-- _ _ _ _ _
-- / \ | | | | | __ ___ _(_)
-- / _ \ | | |_ | |/ _` \ \ / / |
-- / ___ \| | | |_| | (_| |\ V /| |
-- /_/ \_\_|_|\___/ \__,_| \_/ |_|
--
-- github: @AllJavi
--
-- Client rules configuration
local awful = require('awful')
local gears = require('gears')
local ruled = require("ruled")
local beautiful = require('beautiful')
local client_keys = require('configuration.client.keys')
local client_buttons = require('configuration.client.buttons')
ruled.client.connect_signal(
'request::rules',
function()
-- All clients will match this rule.
ruled.client.append_rule {
id = 'global',
rule = {},
properties = {
focus = awful.client.focus.filter,
raise = true,
floating = false,
maximized = false,
above = false,
below = false,
ontop = false,
sticky = false,
maximized_horizontal = false,
maximized_vertical = false,
keys = client_keys,
buttons = client_buttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap + awful.placement.no_offscreen
}
}
-- Titlebar rules
ruled.client.append_rule {
id = 'titlebars',
rule_any = {
type = {
'normal',
'dialog',
'modal',
'utility'
}
},
properties = {
titlebars_enabled = true
}
}
-- Dialogs
ruled.client.append_rule {
id = 'dialog',
rule_any = {
type = {'dialog'},
class = {'Wicd-client.py', 'calendar.google.com'}
},
properties = {
titlebars_enabled = true,
floating = true,
above = true,
skip_decoration = true,
placement = awful.placement.centered
}
}
-- Modals
ruled.client.append_rule {
id = 'modal',
rule_any = {
type = {'modal'}
},
properties = {
titlebars_enabled = true,
floating = true,
above = true,
skip_decoration = true,
placement = awful.placement.centered
}
}
-- Utilities
ruled.client.append_rule {
id = 'utility',
rule_any = {
type = {'utility'}
},
properties = {
titlebars_enabled = false,
floating = true,
skip_decoration = true,
placement = awful.placement.centered
}
}
-- Splash
ruled.client.append_rule {
id = 'splash',
rule_any = {
type = {'splash'},
name = {'Discord Updater'}
},
properties = {
titlebars_enabled = false,
round_corners = false,
floating = true,
above = true,
skip_decoration = true,
placement = awful.placement.centered
}
}
-- Floating
ruled.client.append_rule {
id = 'floating',
rule_any = {
instance = {
'file_progress',
'Popup',
'nm-connection-editor',
},
class = {
'scrcpy',
'Mugshot',
'Pulseeffects'
},
role = {
'AlarmWindow',
'ConfigManager',
'pop-up'
}
},
properties = {
titlebars_enabled = true,
-- skip_decoration = true,
ontop = true,
floating = true,
focus = awful.client.focus.filter,
raise = true,
keys = client_keys,
buttons = client_buttons,
placement = awful.placement.centered
}
}
ruled.client.append_rule {
id = 'internet',
rule_any = {
class = {
'firefox'
}
},
properties = {
tag = '3'
}
}
ruled.client.append_rule {
id = 'discord',
rule_any = {
class = {
'discord'
}
},
properties = {
tag = '7'
}
}
ruled.client.append_rule {
id = 'inkscape',
rule_any = {
class = {
'inkscape'
}
},
properties = {
fullscreen = 'false'
}
}
end
)
client.connect_signal(
'property::class',
function(c)
if c.class == 'Spotify' then
local window_mode = false
local icon = gears.surface("/home/alljavi/.local/share/icons/Gruvbox-Material-Dark/128x128/apps/spotify-client.svg")
c.icon = icon._native
icon:finish()
-- Check if fullscreen or window mode
if c.fullscreen then
window_mode = false
c.fullscreen = false
else
window_mode = true
end
-- Check if Spotify is already open
local app = function (c)
return ruled.client.match(c, {class = 'Spotify'})
end
local app_count = 0
for c in awful.client.iterate(app) do
app_count = app_count + 1
end
-- If Spotify is already open, don't open a new instance
if app_count > 1 then
c:kill()
-- Switch to previous instance
for c in awful.client.iterate(app) do
c:jump_to(false)
end
end
local tag = awful.screen.focused().tags[7]
c:move_to_tag(tag)
end
end
)
|
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by wakfu.
--- DateTime: 2020/8/4 17:58
---
local example = {}
--
local luaDbSqLite = require('module_db.module_db')
luaDbSqLite.closeDbByTag("sqlite3-salary")
local ormDb = luaDbSqLite.new("sqlite3", "./salary.db", true, "sqlite3-salary")
print("&************************@********")
local Builder = require "module_db.LuaQuB"
--增
function example.insertCol()
local object = Builder.new()
:insert("t_salary",
{ name = "小明", department = "实习", social_security = 1000,
provident_fund = 1000, salary = 5000, salary_time = 1540500066
})
local code, response = ormDb:Exec(tostring(object))
print(ormDb:Tag(), response)
return code, response
end
--删
function example.remove()
local name = "小明"
local object = Builder.new()
:delete()
:from("t_salary")
:where("`name` like ", "'%" .. name .. "%'")
--:where("`social_security` is ", "null")
local code, response = ormDb:Exec(tostring(object))
print(ormDb:Tag(), response)
return code, response
end
--改
function example.update()
local updateData = { provident_fund = 6000, salary = 20000, salary_time = 1522036066 }
local name = "王叔叔"
local object = Builder.new()
:update("t_salary", updateData)
:where("`name` like ", "'%" .. name .. "%'")
local code, response = ormDb:Exec(tostring(object))
print(ormDb:Tag(), response)
return code, { response = response, data = updateData }
end
--查
function example.getList()
local object = Builder.new()
:select("*")
:from("t_salary")
:where({ department = "管道疏通" })
:where("department in", "(" .. table.concat({ "'实习'", "'油烟清理'" }, ',') .. ")", "or")
:where("`name` = ", "'王叔叔'", "or")
:limit(3, 0)
local code, tables = ormDb:Raw(tostring(object))
print(ormDb:Tag(), #tables)
--ormDb:CloseDB()
return code, { count = #tables, list = tables }
end
function example.closeDB()
ormDb:CloseDB()
end
return example
|
project "AnimatCarlSimCUDA"
language "C++"
kind "SharedLib"
files { "../*.h",
"../*.cpp",
"../*.cu"}
buildoptions { "-std=c++0x" }
includedirs { "../../../include",
"../../StdUtils",
"../../AnimatSim",
"../../../../3rdParty/CARLsim/src",
"/usr/local/cuda/include",
"/home/ubuntu/NVIDIA_CUDA-6.0_Samples/common/inc" }
libdirs { "../../../bin",
"../../../../3rdParty/CARLsim/bin",
"/usr/local/cuda/lib" }
links { "dl", "cudart" }
configuration { "Debug", "linux" }
defines { "_DEBUG", "ANIMATCARLSIM_EXPORTS" }
flags { "Symbols", "SEH" }
targetdir ("Debug")
targetname ("AnimatCarlSimCUDA_debug")
links { "StdUtils_debug",
"AnimatSim_debug",
"CarlSim_debug"}
postbuildcommands { "cp Debug/libAnimatCarlSimCUDA_debug.so ../../../bin" }
configuration { "Release", "linux" }
defines { "NDEBUG", "ANIMATCARLSIM_EXPORTS" }
flags { "Optimize", "SEH" }
targetdir ("Release")
targetname ("AnimatCarlSimCUDA")
links { "StdUtils",
"AnimatSim",
"CarlSim"}
postbuildcommands { "cp Release/libAnimatCarlSimCUDA.so ../../../bin" }
|
-- wengwengweng
function table.join(t1, t2)
local l = {}
if t1[1] or t2[1] then
for i, v in ipairs(t1) do
l[i] = v
end
for i, v in ipairs(t2) do
l[#t1 + i] = v
end
else
for k, v in pairs(t1) do
l[k] = v
end
for k, v in pairs(t2) do
l[k] = v
end
end
return l
end
function table.map(t, f)
local l = {}
for i, v in ipairs(t) do
l[i] = f(v)
end
return l
end
function table.keys(t)
local l = {}
local i = 1
for k, _ in pairs(t) do
l[i] = k
i = i + 1
end
return l
end
function table.values(t)
local l = {}
local i = 1
for _, v in pairs(t) do
l[i] = v
i = i + 1
end
return l
end
function table.search(t, val)
for i = 1, #t do
if t[i] == val then
return i
end
end
return nil
end
function table.filter(t, f)
local l = {}
for i = 1, #t do
if f(t[i]) then
l[#l + 1] = t[i]
end
end
return l
end
function string.split(str, sep)
if sep == nil then
sep = "%s"
end
local t = {}
for str in string.gmatch(str, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end
|
-- How to build cryptopp ?
--[[
- Open cyrptopp folder with cmd and cmd '$ make sources' to show sources and headers and test files
- edit output with vs ctrl+f (change .cpp to .cpp", " same for .h) then add sources shown to files{} bellow
--]]
project "cryptopp"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "on"
targetdir ("Bin/" .. outputdir .. "/%{prj.name}")
objdir ("Bin-Intermediate/" .. outputdir .. "/%{prj.name}")
warnings "Off"
defines
{
--[[
Define this to disable ASM, intrinsics and built-ins. The code will be
compiled using C++ only. The library code will not include SSE2 (and above),
NEON, Aarch32, Aarch64, Power4, Power7 or Power8.
#define CRYPTOPP_DISABLE_ASM 1
]]
--"CRYPTOPP_DISABLE_ASM=1",
--"CRYPTOPP_ENABLE_NAMESPACE_WEAK", -- enable only when using MD5 to disable warning 'You may be using a weak algorithm that has been retained for backwards compatibility...'
--"CRYPTOPP_IMPORTS", -- for static build
--"CRYPTOPP_EXPORTS", -- for dynamic build
--"CRYPTOPP_DISABLE_CLMUL",
--"CRYPTOPP_DISABLE_AESNI",
--"CRYPTOPP_DISABLE_SSE4",
--"CRYPTOPP_DISABLE_SSSE3",
}
includedirs
{
"." -- for the project's own includes in cpp
}
files
{
--***** Library sources *****
"cryptlib.cpp", "cpu.cpp", "integer.cpp", "3way.cpp", "adler32.cpp", "algebra.cpp", "algparam.cpp", "allocate.cpp", "arc4.cpp", "aria.cpp",
"aria_simd.cpp", "ariatab.cpp", "asn.cpp", "authenc.cpp", "base32.cpp", "base64.cpp", "basecode.cpp", "bfinit.cpp", "blake2.cpp",
"blake2b_simd.cpp", "blake2s_simd.cpp", "blowfish.cpp", "blumshub.cpp", "camellia.cpp", "cast.cpp", "casts.cpp", "cbcmac.cpp", "ccm.cpp",
"chacha.cpp", "chacha_avx.cpp", "chacha_simd.cpp", "chachapoly.cpp", "cham.cpp", "cham_simd.cpp", "channels.cpp", "cmac.cpp", "crc.cpp",
"crc_simd.cpp", "darn.cpp", "default.cpp", "des.cpp", "dessp.cpp", "dh.cpp", "dh2.cpp", "dll.cpp", "donna_32.cpp", "donna_64.cpp", "donna_sse.cpp",
"dsa.cpp", "eax.cpp", "ec2n.cpp", "eccrypto.cpp", "ecp.cpp", "elgamal.cpp", "emsa2.cpp", "eprecomp.cpp", "esign.cpp", "files.cpp", "filters.cpp",
"fips140.cpp", "fipstest.cpp", "gcm.cpp", "gcm_simd.cpp", "gf256.cpp", "gf2_32.cpp", "gf2n.cpp", "gf2n_simd.cpp", "gfpcrypt.cpp", "gost.cpp",
"gzip.cpp", "hc128.cpp", "hc256.cpp", "hex.cpp", "hight.cpp", "hmac.cpp", "hrtimer.cpp", "ida.cpp", "idea.cpp", "iterhash.cpp", "kalyna.cpp",
"kalynatab.cpp", "keccak.cpp", "keccak_core.cpp", "keccak_simd.cpp", "lea.cpp", "lea_simd.cpp", "luc.cpp", "mars.cpp", "marss.cpp", "md2.cpp",
"md4.cpp", "md5.cpp", "misc.cpp", "modes.cpp", "mqueue.cpp", "mqv.cpp", "nbtheory.cpp", "oaep.cpp", "osrng.cpp", "padlkrng.cpp", "panama.cpp",
"pkcspad.cpp", "poly1305.cpp", "polynomi.cpp", "pssr.cpp", "pubkey.cpp", "queue.cpp", "rabbit.cpp", "rabin.cpp", "randpool.cpp", "rc2.cpp",
"rc5.cpp", "rc6.cpp", "rdrand.cpp", "rdtables.cpp", "rijndael.cpp", "rijndael_simd.cpp", "ripemd.cpp", "rng.cpp", "rsa.cpp", "rw.cpp", "safer.cpp",
"salsa.cpp", "scrypt.cpp", "seal.cpp", "seed.cpp", "serpent.cpp", "sha.cpp", "sha3.cpp", "sha_simd.cpp", "shacal2.cpp", "shacal2_simd.cpp", "shake.cpp",
"shark.cpp", "sharkbox.cpp", "simeck.cpp", "simon.cpp", "simon128_simd.cpp", "skipjack.cpp", "sm3.cpp", "sm4.cpp", "sm4_simd.cpp", "sosemanuk.cpp",
"speck.cpp", "speck128_simd.cpp", "square.cpp", "squaretb.cpp", "sse_simd.cpp", "strciphr.cpp", "tea.cpp", "tftables.cpp", "threefish.cpp", "tiger.cpp",
"tigertab.cpp", "ttmac.cpp", "tweetnacl.cpp", "twofish.cpp", "vmac.cpp", "wake.cpp", "whrlpool.cpp", "xed25519.cpp", "xtr.cpp", "xtrcrypt.cpp", "xts.cpp",
"zdeflate.cpp", "zinflate.cpp", "zlib.cpp",
--***** Library headers *****
"3way.h", "adler32.h", "adv_simd.h", "aes.h", "aes_armv4.h", "algebra.h", "algparam.h", "allocate.h", "arc4.h", "argnames.h", "aria.h", "arm_simd.h",
"asn.h", "authenc.h", "base32.h", "base64.h", "basecode.h", "blake2.h", "blowfish.h", "blumshub.h", "camellia.h", "cast.h", "cbcmac.h", "ccm.h", "chacha.h",
"chachapoly.h", "cham.h", "channels.h", "cmac.h", "config.h", "config_align.h", "config_asm.h", "config_cpu.h", "config_cxx.h", "config_dll.h", "config_int.h",
"config_misc.h", "config_ns.h", "config_os.h", "config_ver.h", "cpu.h", "crc.h", "cryptlib.h", "darn.h", "default.h", "des.h", "dh.h", "dh2.h", "dll.h",
"dmac.h", "donna.h", "donna_32.h", "donna_64.h", "donna_sse.h", "drbg.h", "dsa.h", "eax.h", "ec2n.h", "eccrypto.h", "ecp.h", "ecpoint.h", "elgamal.h",
"emsa2.h", "eprecomp.h", "esign.h", "fhmqv.h", "files.h", "filters.h", "fips140.h", "fltrimpl.h", "gcm.h", "gf256.h", "gf2_32.h", "gf2n.h", "gfpcrypt.h",
"gost.h", "gzip.h", "hashfwd.h", "hc128.h", "hc256.h", "hex.h", "hight.h", "hkdf.h", "hmac.h", "hmqv.h", "hrtimer.h", "ida.h", "idea.h", "integer.h",
"iterhash.h", "kalyna.h", "keccak.h", "lea.h", "lubyrack.h", "luc.h", "mars.h", "md2.h", "md4.h", "md5.h", "mdc.h", "mersenne.h", "misc.h", "modarith.h",
"modes.h", "modexppc.h", "mqueue.h", "mqv.h", "naclite.h", "nbtheory.h", "nr.h", "oaep.h", "oids.h", "osrng.h", "ossig.h", "padlkrng.h", "panama.h", "pch.h",
"pkcspad.h", "poly1305.h", "polynomi.h", "ppc_simd.h", "pssr.h", "pubkey.h", "pwdbased.h", "queue.h", "rabbit.h", "rabin.h", "randpool.h", "rc2.h", "rc5.h",
"rc6.h", "rdrand.h", "rijndael.h", "ripemd.h", "rng.h", "rsa.h", "rw.h", "safer.h", "salsa.h", "scrypt.h", "seal.h", "secblock.h", "secblockfwd.h", "seckey.h",
"seed.h", "serpent.h", "serpentp.h", "sha.h", "sha1_armv4.h", "sha256_armv4.h", "sha3.h", "sha512_armv4.h", "shacal2.h", "shake.h", "shark.h", "simeck.h",
"simon.h", "simple.h", "siphash.h", "skipjack.h", "sm3.h", "sm4.h", "smartptr.h", "sosemanuk.h", "speck.h", "square.h", "stdcpp.h", "strciphr.h", "tea.h",
"threefish.h", "tiger.h", "trap.h", "trunhash.h", "ttmac.h", "tweetnacl.h", "twofish.h", "vmac.h", "wake.h", "whrlpool.h", "words.h", "xed25519.h", "xtr.h",
"xtrcrypt.h", "xts.h", "zdeflate.h", "zinflate.h", "zlib.h",
--***** Test sources *****
--"adhoc.cpp", "test.cpp", "bench1.cpp", "bench2.cpp", "bench3.cpp", "datatest.cpp", "dlltest.cpp", "fipsalgt.cpp", "validat0.cpp", "validat1.cpp", "validat2.cpp", "validat3.cpp", "validat4.cpp", "validat5.cpp", "validat6.cpp", "validat7.cpp", "validat8.cpp", "validat9.cpp", "validat10.cpp", "regtest1.cpp", "regtest2.cpp", "regtest3.cpp", "regtest4.cpp",
--***** Test headers *****
--bench.h", "factory.h", "validate.h",
--***** Assembly files *****
"x64masm.asm", "x64dll.asm"
}
filter "system:windows"
systemversion "latest"
defines
{
"_WINSOCK_DEPRECATED_NO_WARNINGS",
}
links
{
"ws2_32"
}
--vectorextensions "SSE2"
filter "system:linux"
defines
{
}
links
{
}
buildoptions
{
"-march=native", --compile for machine processor # https://stackoverflow.com/questions/18868235/preventing-gcc-from-automatically-using-avx-and-fma-instructions-when-compiled-w/25911959#25911959
"-msha", -- # https://github.com/weidai11/cryptopp/issues/834
}
--vectorextensions "AVX"
filter "system:macosx"
defines
{
"CRYPTOPP_DISABLE_ASM"
}
links
{
}
--- Configurations ---
filter "configurations:Debug"
runtime "Debug"
symbols "Full" --vs17 and newer | symbols "On"
optimize "Off" -- No optimization will be performed.
filter "configurations:Release"
runtime "Release"
optimize "On" -- Perform a balanced set of optimizations.
inlining "Explicit" -- Only inline functions explicitly marked with the inline keyword.
filter "configurations:Dist"
runtime "Release"
optimize "Full" -- Full optimization.
inlining "Auto" -- Inline any suitable function for full performance
|
function va(x,y) -- variable declaration
if tonumber(y) ~= nil then
_G[x] = tonumber(y)
else
_G[x] = y
end
end
function ou(x) -- prints x
if _G[x] ~= nil then
print(_G[x])
else
print(x)
end
end
function co(z, x, y) -- concatenates strings
if _G[x] == nil then _G[x] = x end
if _G[y] == nil then _G[y] = y end
_G[z] = _G[x] .. _G[y]
end
function ad(z, x, y) -- Addition of numbers
if _G[x] == nil then
if tonumber(x) ~= nil then _G[x] = tonumber(x) end
end
if _G[y] == nil then
if tonumber(y) ~= nil then _G[y] = tonumber(y) end
end
_G[z] = _G[x] + _G[y]
end
function su(z, x, y) -- subtraction of numbers
if _G[x] == nil then
if tonumber(x) ~= nil then _G[x] = tonumber(x) end
end
if _G[y] == nil then
if tonumber(y) ~= nil then _G[y] = tonumber(y) end
end
_G[z] = _G[x] - _G[y]
end
function mu(z, x, y) -- multiplication
if _G[x] == nil then
if tonumber(x) ~= nil then _G[x] = tonumber(x) end
end
if _G[y] == nil then
if tonumber(y) ~= nil then _G[y] = tonumber(y) end
end
_G[z] = _G[x] * _G[y]
end
function di(z, x, y) -- division
if _G[x] == nil then
if tonumber(x) ~= nil then _G[x] = tonumber(x) end
end
if _G[y] == nil then
if tonumber(y) ~= nil then _G[y] = tonumber(y) end
end
_G[z] = _G[x] / _G[y]
end
function fo(x, cmd, var, var2, var3) -- for loop
print(x, cmd, var, var2, var3)
for i=1, x-1 do
_G[cmd](var, var2, var3)
end
end
function ip(x) -- input
_G[x] = io.read()
end
function go(x) -- GO
going_to = true
if tonumber(x) ~= nil then
start_place = tonumber(x)
else
if _G[x] ~= nil then
start_place = _G[x]
else
global_error = true
end
end
end
function con_check(x, y, j, k, sign)
if tonumber(x) ~= nil then _G[x] = tonumber(x) end
if tonumber(y) ~= nil then _G[y] = tonumber(y) end
if sign == "=" then
if _G[x] == _G[y] then
go(j)
else
go(k)
end
elseif sign == "<" then
if _G[x] < _G[y] then
go(j)
else
go(k)
end
elseif sign == ">" then
if _G[x] > _G[y] then
go(j)
else
go(k)
end
end
end
function ra(x, y, z) -- Random Number
print(x, y, z)
_G[x] = math.random(y, z)
end
|
-- © 2008 David Given.
-- WordGrinder is licensed under the MIT open source license. See the COPYING
-- file in this distribution for the full text.
local int = math.floor
local table_remove = table.remove
local Write = wg.write
local SetNormal = wg.setnormal
local SetBold = wg.setbold
local SetUnderline = wg.setunderline
local SetReverse = wg.setreverse
local GetStringWidth = wg.getstringwidth
local GetCwd = wg.getcwd
local Stat = wg.stat
local redrawpending = true
-- Determine the user's home directory.
HOME = os.getenv("HOME") or os.getenv("USERPROFILE")
CONFIGDIR = HOME .. "/.wordgrinder"
local configfile = CONFIGDIR.."/startup.lua"
-- Determine the installation directory (Windows only).
if (ARCH == "windows") then
local exe = os.getenv("WINDOWS_EXE")
local _, _, dir = exe:find("^(.*)[/\\][^/\\]*$")
WINDOWS_INSTALL_DIR = dir
end
local oldcp, oldcw, oldco
function QueueRedraw()
redrawpending = true
if Document then
if (oldcp ~= Document.cp) or (oldcw ~= Document.cw) or
(oldco ~= Document.co) then
oldcp = Document.cp
oldcw = Document.cw
oldco = Document.co
FireEvent(Event.Moved)
end
if not Document.wrapwidth then
ResizeScreen()
end
end
end
function ResetDocumentSet()
UpdateDocumentStyles()
DocumentSet = CreateDocumentSet()
DocumentSet.menu = CreateMenuBindings()
Document = CreateDocument()
DocumentSet:addDocument(CreateDocument(), "main")
RebuildParagraphStylesMenu(DocumentStyles)
RebuildDocumentsMenu(DocumentSet.documents)
DocumentSet:purge()
DocumentSet:clean()
FireEvent(Event.DocumentCreated)
FireEvent(Event.RegisterAddons)
end
do
local function cb(event, token)
oldcp = 1
oldcw = 1
oldco = 1
SetCurrentStyleHint(0, 0)
end
AddEventListener(Event.DocumentLoaded, cb)
AddEventListener(Event.DocumentCreated, cb)
end
-- Kick the garbage collector whenever we're idle, just to keep
-- memory usage down.
do
local function cb(event)
collectgarbage("collect")
QueueRedraw()
end
AddEventListener(Event.Idle, cb)
end
-- This function contains the word processor proper, including the main event
-- loop.
function WordProcessor(filename)
LoadGlobalSettings()
ResetDocumentSet()
-- Move legacy config files.
do
local _, e = Mkdirs(CONFIGDIR)
if e then
CLIError("cannot create configuration directory: "..e)
end
local function movefile(src, dest)
if not Stat(src) then
return
end
if Stat(dest) then
CLIError("both old and new config files exist: delete one and try again ("
..src.." vs "..dest)
end
local _, e = os.rename(src, dest)
if e then
CLIError("unable to migrate legacy config file: "..e)
end
end
movefile(HOME.."/.wordgrinder.settings", CONFIGDIR.."/settings.dat")
movefile(HOME.."/.wordgrinder.lua", CONFIGDIR.."/startup.lua")
end
-- Which config file are we loading?
do
local fp, e, errno = io.open(configfile, "r")
if fp then
f, e = load(ChunkStream(fp:read("*a")), configfile)
if f then
xpcall(f, CLIError)
else
CLIError("config file compilation error: "..e)
end
fp:close()
elseif (errno ~= wg.ENOENT) then
CLIError("config file load error: "..e)
end
end
wg.initscreen()
ResizeScreen()
RedrawScreen()
if filename then
if not Cmd.LoadDocumentSet(filename) then
-- As a special case, if we tried to load a document from the command line and it
-- doesn't exist, then we prime the document name so that saving the file is easy.
DocumentSet.name = filename
end
else
FireEvent(Event.DocumentLoaded)
end
local masterkeymap = {
["KEY_RESIZE"] = function() -- resize
ResizeScreen()
RedrawScreen()
end,
["KEY_REDRAW"] = RedrawScreen,
[" "] = { Cmd.Checkpoint, Cmd.TypeWhileSelected,
Cmd.SplitCurrentWord },
["KEY_RETURN"] = { Cmd.Checkpoint, Cmd.TypeWhileSelected,
Cmd.SplitCurrentParagraph },
["KEY_ESCAPE"] = Cmd.ActivateMenu,
}
local function eventloop()
local nl = string.char(13)
while true do
if DocumentSet.justchanged then
FireEvent(Event.Changed)
DocumentSet.justchanged = false
end
FlushAsyncEvents()
FireEvent(Event.WaitingForUser)
local c = "KEY_TIMEOUT"
while (c == "KEY_TIMEOUT") do
if redrawpending then
RedrawScreen()
redrawpending = false
end
c = GetCharWithBlinkingCursor(IDLE_TIME)
if (c == "KEY_TIMEOUT") then
FireEvent(Event.Idle)
end
end
if c ~= "KEY_RESIZE" then
ResetNonmodalMessages()
end
-- Anything in masterkeymap overrides everything else.
local f = masterkeymap[c]
if f then
RunMenuAction(f)
else
-- It's not in masterkeymap. If it's printable, insert it; if it's
-- not, look it up in the menu hierarchy.
if not c:match("^KEY_") then
Cmd.Checkpoint()
Cmd.TypeWhileSelected()
local payload = { value = c }
FireEvent(Event.KeyTyped, payload)
Cmd.InsertStringIntoWord(payload.value)
else
f = DocumentSet.menu:lookupAccelerator(c)
if f then
RunMenuAction(f)
else
NonmodalMessage(c:gsub("^KEY_", "").." is not bound --- try ESCAPE for a menu")
end
end
end
end
end
NonmodalMessage("Welcome to WordGrinder! Press ESC to show the menu.")
while true do
local f, e = xpcall(eventloop, Traceback)
if not f then
print(e)
ModalMessage("Internal error!",
"Something went wrong inside WordGrinder! I'll try and "..
"continue but you should save your work immediately (under a "..
"different filename), exit, and send the following technical "..
"information to the author:\n\n" .. e)
end
end
end
-- Program entry point. Parses command line arguments and executes.
function Main(...)
-- Set up the initial document so that the command line options have
-- access. The global settings aren't loaded yet, so things like paragraph
-- styles may not be set up correctly, but we don't care.
ResetDocumentSet()
local arg = {...}
table_remove(arg, 1) -- contains the executable name
local filename = nil
do
local stdout = io.stdout
local stderr = io.stderr
local function do_help()
stdout:write("WordGrinder version ", VERSION, " © 2007-2020 David Given\n")
if DEBUG then
stdout:write("(This version has been compiled with debugging enabled.)\n")
end
stdout:write([[
Syntax: wordgrinder [<options...>] [<filename>]
Options:
-h --help Displays this message.
--lua file.lua Loads and executes file.lua and then exits
(remaining arguments are passed to the script)
--exec 'lua code' Loads and executes the supplied code and then exits
(remaining arguments are passed to the script)
-c --convert src dest Converts from one file format to another
--config file.lua Sets the name of the user config file
Only one filename may be specified, which is the name of a WordGrinder
file to load on startup. If not given, you get a blank document instead.
To convert documents, use --convert. The file type is autodetected from the
extension. To specify a document name, use :name as a suffix. e.g.:
wordgrinder --convert filename.wg:"Chapter 1" chapter1.odt
The user config file is a Lua file which is loaded and executed before
the program starts up (but after any --lua files). It defaults to:
]] .. configfile .. [[
]])
if DEBUG then
-- List debugging options here.
end
os.exit(0)
end
local function do_lua(opt, ...)
if not opt then
CLIError("--lua must have an argument")
end
local f, e = loadfile(opt)
if e then
CLIError("user script compilation error: "..e)
end
EngageCLI()
f(...)
os.exit(0)
end
local function do_exec(opt, ...)
if not opt then
CLIError("--exec must have an argument")
end
local f, e = loadstring(opt)
if e then
CLIError("user script compilation error: "..e)
end
f(...)
os.exit(0)
end
local function do_convert(opt1, opt2)
if not opt1 or not opt2 then
CLIError("--convert must have two arguments")
end
CliConvert(opt1, opt2)
return 2
end
local function do_config(opt)
if not opt then
CLIError("--config must have an argument")
end
configfile = opt
return 1
end
local function do_filename(fn)
if filename then
CLIError("you may only specify one filename")
end
filename = fn
return 1
end
local function unrecognisedarg(arg)
CLIError("unrecognised option '", arg, "' --- try --help for help")
end
local argmap = {
["h"] = do_help,
["help"] = do_help,
["lua"] = do_lua,
["exec"] = do_exec,
["c"] = do_convert,
["convert"] = do_convert,
["config"] = do_config,
[FILENAME_ARG] = do_filename,
[UNKNOWN_ARG] = unrecognisedarg,
}
-- Do the actual argument parsing.
ParseArguments(arg, argmap)
end
if filename and
not filename:find("^/") and
not filename:find("^[a-zA-Z]:[/\\]") then
filename = GetCwd() .. "/" .. filename
end
WordProcessor(filename)
end
-- vim: sw=4 ts=4 et
|
local partitionGuid = Guid('B6BD6848-37DF-463A-81C5-33A5B3D6F623')
local flagGuids = {
A= Guid('44415363-CD27-4485-83A1-631CBCE7C5F6'),
B= Guid('8A3675FF-BB0F-478D-8554-14912DCEEF20'),
C= Guid('55645542-9AEC-4034-892C-14DAFDF808AD'),
D= Guid('917C88B8-83AD-4A9D-8252-7EF68E4CEC38'),
E= Guid('7A848B1C-CE40-4E5F-9F9A-A968F27393F4'),
F= Guid('45A8C965-D60B-4892-A696-C40486915356'),
G= Guid('E6BE3528-73F1-454E-B92E-C738CEB235D5')
}
for _, flagGuid in pairs(flagGuids) do
ResourceManager:RegisterInstanceLoadHandler(partitionGuid, flagGuid, function(instance)
local refobjInstance = ReferenceObjectData(instance)
refobjInstance:MakeWritable()
refobjInstance.excluded = true
end)
end
|
local ffi = require("ffi")
local error = error
local print = print
local engineHook = engineHook
local engine = engine
local EBlendMode = enum.EBlendMode
local whiteLinearColor = ffi.new("struct FLinearColor", 1, 1, 1, 1)
local engineCanvas = nil -- make sure it's a struct UCanvas*
local currentTexture = nil
local currentLinearColor = whiteLinearColor
local canvas = {}
function canvas._SetPos(x, y)
engineCanvas.UCanvas.CurX = x
engineCanvas.UCanvas.CurY = y
end
function canvas.GetDrawColor()
return engineCanvas.UCanvas.DrawColor
end
function canvas.SetDrawColor(color)
engineCanvas.UCanvas.DrawColor = color
currentLinearColor = color:ToLinear()
end
function canvas.GetDrawColorRGBA()
local color = engineCanvas.UCanvas.DrawColor
return color.R, color.G, color.B, color.A
end
function canvas.SetDrawColorRGBA(r, g, b, a)
local color = Color(r, g, b, a)
canvas.SetDrawColor(color)
end
function canvas.DrawRect(x, y, w, h)
canvas._SetPos(x, y)
local tex = engineCanvas.UCanvas.DefaultTexture
engineCanvas:DrawTile(tex, w, h, 0, 0, tex.UTexture2D.SizeX, tex.UTexture2D.SizeY, currentLinearColor, false, EBlendMode.BLEND_Translucent)
end
function canvas.DrawBorderedRect(x, y, w, h)
canvas.DrawRect(x, y, 1, h) -- left
canvas.DrawRect(x + w - 1, y, 1, h) -- right
canvas.DrawRect(x + 1, y, w - 2, 1) -- top
canvas.DrawRect(x + 1, y + h - 1, w - 2, 1) -- bottom
end
function canvas.DrawLine(startX, startY, endX, endY)
engineCanvas:Draw2DLine(startX, startY, endX, endY, engineCanvas.UCanvas.DrawColor)
end
function canvas.LoadFont(fontName)
local font = engine.FindObject(fontName, engine.Classes.UFont)
if font == nil then
error("Font could not be found")
end
return ffi.cast("struct UFont*", font)
end
function canvas.GetFont()
return engineCanvas.UCanvas.Font
end
function canvas.SetFont(font)
engineCanvas.UCanvas.Font = font
end
function canvas.DrawText(text, x, y)
canvas._SetPos(x, y)
engineCanvas:DrawText(text, false, 1, 1)
end
function canvas.GetTextSize(text)
return engineCanvas:TextSize(text)
end
function canvas.SetTexture(tex)
--if scale == nil then scale = 1 end
currentTexture = ffi.cast("struct UTexture2D*", tex)
end
function canvas._InternalDrawTexturedRectUV(x, y, w, h, u, v, ul, vl)
canvas._SetPos(x, y)
engineCanvas:DrawTile(currentTexture, w, h, u, v, ul, vl, currentLinearColor, true, EBlendMode.BLEND_Translucent)
end
function canvas.DrawTexturedRect(x, y, w, h)
if currentTexture == nil then error("Current canvas texture is nil") end
canvas._InternalDrawTexturedRectUV(x, y, w, h, 0, 0, currentTexture.UTexture2D.SizeX, currentTexture.UTexture2D.SizeY)
end
function canvas.DrawTexturedRectUV(x, y, w, h, u, v, ul, vl)
if currentTexture == nil then error("Current canvas texture is nil") end
canvas._InternalDrawTexturedRectUV(x, y, w, h, u, v, ul, vl)
end
function canvas.SetClipRect(x, y, w, h)
engineCanvas:SetOrigin(x, y)
engineCanvas:SetClip(x + w, y + h)
end
function canvas.ResetClip()
engineCanvas:SetOrigin(0, 0)
engineCanvas:SetClip(engineCanvas.UCanvas.SizeX, engineCanvas.UCanvas.SizeY)
end
-- TODO: Grab this from the object structure rather than a hook - creates a race condition
-- and may actually be incorrect if the UDN is anything to go by.
engineHook.Add("UWillowGameViewportClient", "eventPostRender", "GetCanvas", function(caller, args)
engineCanvas = ffi.cast("struct UCanvas*", args.Canvas)
engineHook.Remove("UWillowGameViewportClient", "eventPostRender", "GetCanvas")
end)
return canvas
|
function writeRegister(dev_addr, value)
id = 0
i2c.start(id)
i2c.address(id, dev_addr, i2c.TRANSMITTER)
i2c.write(id, value)
i2c.stop(id)
end
function readRegister(dev_addr, reg_addr, num_bytes)
id = 0
i2c.start(id)
i2c.address(id, dev_addr, i2c.TRANSMITTER)
i2c.write(id, reg_addr)
i2c.stop(id)
i2c.start(id)
i2c.address(id, dev_addr, i2c.RECEIVER)
c = i2c.read(id, num_bytes)
i2c.stop(id)
return c
end
local readerSlots = {
sys = {
measurementName = 'sys',
reader = function(cb)
local rssi, heap, versionHash
heap = node.heap()
rssi = wifi.sta.getrssi()
if rssi == nil or heap == nil then
return
end
if file.exists("lfs.img") then
versionHash = crypto.toHex(crypto.fhash("sha1", "lfs.img"))
end
cb(heap, rssi, version)
end,
fieldSlots = {heap_size_b = 1, rssi_db = 2, version_hash = 18},
readOrder = {[1] = 1, [2] = 2, [3] = 18},
},
dht22 = {
measurementName = 'sensors',
reader = function(cb)
local status, temp, humi, temp_dec, humi_dec = dht.read(gpioPins.dht)
if status == dht.OK then
elseif status == dht.ERROR_CHECKSUM then
return
elseif status == dht.ERROR_TIMEOUT then
return
end
cb(temp, humi)
end,
fieldSlots = {temp_c = 3, rh_pc = 4},
readOrder = {[1] = 3,
[2] = 4},
},
bme280 = {
measurementName = 'sensors',
reader = function(cb)
which = bme280.setup()
if which == nil or which == 1 then
return nil
end
bme280.startreadout(150, function()
local temp_c, pa_p, rh_pc, qnh_p = bme280.read(cfg.altitude)
if temp_c then
temp_c = temp_c/100
pa_p = pa_p/10
qnh_p = qnh_p/10
rh_pc = rh_pc/1000
dp_c = bme680.dewpoint(rh_pc, temp_c)
dp_c = dp_c/100
cb(temp_c,pa_p,rh_pc,dp_c,qnh_p)
end
end)
return true
end,
fieldSlots = {
temp_c = 5,
pa_p = 6,
rh_pc = 7,
dp_c = 8,
qnh_p = 9
},
readOrder = {[1] = 5,
[2] = 6,
[3] = 7,
[4] = 8,
[5] = 9},
},
bme680 = {
measurementName = 'sensors',
reader = function(cb)
local which = bme280.setup()
if which == 2 or which == nil then
return
end
which = bme680.setup()
if which == nil then
return
end
bme680.startreadout(150, function ()
local temp_c, pa_p, rh_pc, gasr, qnh_p = bme680.read(cfg.altitude)
if temp_c ~= nil then
temp_c = temp_c/100
pa_p = pa_p
qnh_p = qnh_p
rh_pc = rh_pc/1000
dp_c = bme680.dewpoint(rh_pc, temp_c)
dp_c = dp_c / 100
cb(temp_c,pa_p,rh_pc, dp_c, qnh_p)
end
end)
return
end,
fieldSlots = {
temp_c = 10,
pa_p = 11,
rh_pc = 12,
dp_c = 13,
qnh_p = 14,
gasr = 15
},
readOrder = {[1] = 10,
[2] = 11,
[3] = 12,
[4] = 13,
[5] = 14,
[6] = 15}
},
bh1750 = {
measurementName = 'sensors',
reader = function(cb)
i2c.start(0)
found = i2c.address(0, 0x23, i2c.TRANSMITTER)
if not found then
return
end
i2c.write(0, 0x10)
i2c.stop(0)
i2c.start(0)
i2c.address(0, 0x23, i2c.RECEIVER)
tmr.delay(200000)
c = i2c.read(0, 2)
UT = c:byte(1) * 256 + c:byte(2)
l = (UT*1000/12)
i2c.stop(0)
lux = l/100
calibPar = lux * cfg.parCalibration
-- calibPar = lux / cfg.parCalibrationDivisor
-- print("lux: "..(l / 100).."."..(l % 100).." lx")
cb(lux, calibPar)
-- return lux, calibPar
end,
fieldSlots = {lux = 16, par = 17},
readOrder = {[1] = 16, [2] = 17},
},
chirpsensor276 = {
measurementName = 'sensors',
reader = function(cb)
-- uncomment the code at the end of this function to enable light sensor.
-- the sensors I was using are the ruggedized so their light sensor is always covered.
-- the reason this is disabled is because it takes 2s to read from the light sensor.
i2c.start(0)
found = i2c.address(0, 0x20, i2c.TRANSMITTER)
if not found then
return
end
function decodeChirp(val)
local b1 = bit.lshift(string.byte(val, 1), 8)
local b2 = string.byte(val, 2)
return bit.bor(b1, b2)
end
-- clear the sensor
readRegister(0x20, 0, 2)
repeat
tmr.delay(10)
print("waiting on chirp...")
until tonumber(readRegister(0x20, 9,1)) == nil
-- soil capacitance
local val = readRegister(0x20, 0, 2)
local soil_capacitance = decodeChirp(val)
-- soil temperature
val = readRegister(0x20, 5, 2)
local soil_temperature = decodeChirp(val)/10
-- light
-- writeRegister(0x20, 3)
-- tmr.create():alarm(200000, tmr.ALARM_SINGLE, function()
-- val = readReg(0x20, 4, 2)
-- local light_ = 65535 - decodeChirp(val)
-- cb(soil_capacitance, soil_temperature, light)
-- -- reset sensor
-- writeRegister(0x20, 6)
-- end)
-- reset sensor
writeRegister(0x20, 6)
cb(soil_capacitance, soil_temperature)
end,
-- fieldSlots = {soil_capacitance = 19, soil_temperature = 20, light_level = 21},
-- readOrder = {[1] = 19, [2] = 20, [3] = 21}
fieldSlots = {soil_capacitance = 19, soil_temperature = 20},
readOrder = {[1] = 19, [2] = 20}
}
}
local reverseReaderSlots = {}
for rtag, v in pairs(readerSlots) do
for fn, slot in pairs(v.fieldSlots) do
reverseReaderSlots[slot] = {tag = rtag, measure = v.measurementName, field = fn}
end
end
return {readerSlots = readerSlots, reverseReaderSlots = reverseReaderSlots}
|
-- FreeBSD error messages
local require = require
local version = require "syscall.freebsd.version".version
local errors = {
PERM = "Operation not permitted",
NOENT = "No such file or directory",
SRCH = "No such process",
INTR = "Interrupted system call",
IO = "Input/output error",
NXIO = "Device not configured",
["2BIG"] = "Argument list too long",
NOEXEC = "Exec format error",
BADF = "Bad file descriptor",
CHILD = "No child processes",
DEADLK = "Resource deadlock avoided",
NOMEM = "Cannot allocate memory",
ACCES = "Permission denied",
FAULT = "Bad address",
NOTBLK = "Block device required",
BUSY = "Resource busy",
EXIST = "File exists",
XDEV = "Cross-device link",
NODEV = "Operation not supported by device",
NOTDIR = "Not a directory",
ISDIR = "Is a directory",
INVAL = "Invalid argument",
NFILE = "Too many open files in system",
MFILE = "Too many open files",
NOTTY = "Inappropriate ioctl for device",
TXTBSY = "Text file busy",
FBIG = "File too large",
NOSPC = "No space left on device",
SPIPE = "Illegal seek",
ROFS = "Read-only file system",
MLINK = "Too many links",
PIPE = "Broken pipe",
DOM = "Numerical argument out of domain",
RANGE = "Result too large",
AGAIN = "Resource temporarily unavailable",
INPROGRESS = "Operation now in progress",
ALREADY = "Operation already in progress",
NOTSOCK = "Socket operation on non-socket",
DESTADDRREQ = "Destination address required",
MSGSIZE = "Message too long",
PROTOTYPE = "Protocol wrong type for socket",
NOPROTOOPT = "Protocol not available",
PROTONOSUPPORT = "Protocol not supported",
SOCKTNOSUPPORT = "Socket type not supported",
OPNOTSUPP = "Operation not supported",
PFNOSUPPORT = "Protocol family not supported",
AFNOSUPPORT = "Address family not supported by protocol family",
ADDRINUSE = "Address already in use",
ADDRNOTAVAIL = "Can't assign requested address",
NETDOWN = "Network is down",
NETUNREACH = "Network is unreachable",
NETRESET = "Network dropped connection on reset",
CONNABORTED = "Software caused connection abort",
CONNRESET = "Connection reset by peer",
NOBUFS = "No buffer space available",
ISCONN = "Socket is already connected",
NOTCONN = "Socket is not connected",
SHUTDOWN = "Can't send after socket shutdown",
TOOMANYREFS = "Too many references: can't splice",
TIMEDOUT = "Operation timed out",
CONNREFUSED = "Connection refused",
LOOP = "Too many levels of symbolic links",
NAMETOOLONG = "File name too long",
HOSTDOWN = "Host is down",
HOSTUNREACH = "No route to host",
NOTEMPTY = "Directory not empty",
PROCLIM = "Too many processes",
USERS = "Too many users",
DQUOT = "Disc quota exceeded",
STALE = "Stale NFS file handle",
REMOTE = "Too many levels of remote in path",
BADRPC = "RPC struct is bad",
RPCMISMATCH = "RPC version wrong",
PROGUNAVAIL = "RPC prog. not avail",
PROGMISMATCH = "Program version wrong",
PROCUNAVAIL = "Bad procedure for program",
NOLCK = "No locks available",
NOSYS = "Function not implemented",
FTYPE = "Inappropriate file type or format",
AUTH = "Authentication error",
NEEDAUTH = "Need authenticator",
IDRM = "Identifier removed",
NOMSG = "No message of desired type",
OVERFLOW = "Value too large to be stored in data type",
CANCELED = "Operation canceled",
ILSEQ = "Illegal byte sequence",
NOATTR = "Attribute not found",
DOOFUS = "Programming error",
BADMSG = "Bad message",
MULTIHOP = "Multihop attempted",
NOLINK = "Link has been severed",
PROTO = "Protocol error",
NOTCAPABLE = "Capabilities insufficient",
CAPMODE = "Not permitted in capability mode",
}
if version >= 10 then
errors.NOTRECOVERABLE = "State not recoverable"
errors.OWNERDEAD = "Previous owner died"
end
return errors
|
--[[
Project: SA Memory (Available from https://blast.hk/)
Developers: LUCHARE, FYP
Special thanks:
plugin-sdk (https://github.com/DK22Pac/plugin-sdk) for the structures and addresses.
Copyright (c) 2018 BlastHack.
]]
local shared = require 'SAMemory.shared'
shared.require 'RenderWare'
shared.ffi.cdef[[
typedef struct CShadowCamera
{
RwCamera *pRwCamera;
RwTexture *pRwRenderTexture;
} CShadowCamera;
]]
shared.validate_size('CShadowCamera', 8)
|
-- We need to accept a batch module of many different words and encode them together.
require 'torch'
require 'nn'
local C2W,parent = torch.class('nn.C2W', 'nn.Module')
model_utils = require 'util.model_utils'
debugger = require ('fb.debugger')
require 'util.misc'
function C2W:__init(max_word_l, batch_size, char_vocab_size, char_rnn_size, gpuid)
parent.__init(self)
self.max_word_l = max_word_l
self.char_vocab_size = char_vocab_size
self.char_rnn_size = char_rnn_size
self.rnn = LSTM_c.lstm(char_rnn_size, char_rnn_size, 1)
self.char_vec_layer = nn.LookupTable(self.char_vocab_size, char_rnn_size)
self.c2w_module = {}
self.init_state = {}
self.zeros = torch.zeros(batch_size, self.char_rnn_size)
self.gpuid = gpuid
if self.gpuid >= 0 then
self.zeros = self.zeros:cuda()
end
table.insert(self.init_state, self.zeros:clone()) -- prev_c
table.insert(self.init_state, self.zeros:clone()) -- prev_h
self.c2w_module = model_utils.clone_many_times(self.rnn, self.max_word_l)
end
function C2W:forward(word, input_word_len, is_train)
local word_vec = self.char_vec_layer:forward(word) -- batch*word_len * emb_size
local word_len = word_vec:size(2)
assert(word_len <= self.max_word_l)
self.rnn_state = {[0] = self.init_state}
for t = 1, word_len do
if is_train then
self.c2w_module[t]:training()
else
self.c2w_module[t]:evaluate()
end
local lst = self.c2w_module[t]:forward{word_vec[{{},t}], unpack(self.rnn_state[t-1])}
--debugger.enter()
self.rnn_state[t] = {}
for i = 1, #self.init_state do
table.insert(self.rnn_state[t], lst[i])
end
end
local rnn_state = self.rnn_state[#self.rnn_state][2]:clone()
for t = 1, word:size(1) do
rnn_state[{t,{}}] = self.rnn_state[input_word_len[t][1]][2][{t,{}}]
end
return rnn_state
end
function C2W:backward(word, input_word_len, input_drnn_state)
-- This is crap here, since we need to repeatedly use this C2W. Thus, the relation has been changed.
-- Now, need to use the forward again to restore the rnn_state for current word.
-- I know this is kind of crap, anyway it works.
local rnn_state = self:forward(word, input_word_len, is_train)
local word_vec = self.char_vec_layer:forward(word) -- batch*word_len * emb_size
local grad_inputs = torch.Tensor(word_vec:size())
if self.gpuid >= 0 then
grad_inputs = grad_inputs:cuda()
end
local max_word_len = input_word_len:max()
local drnn_state = {[max_word_len] = {[1] = self.zeros, [2] = self.zeros} }
-- We only need to bp from the last char.
for t = max_word_len, 1, -1 do
for len = 1, input_word_len:size(1) do
if t == input_word_len[len][1] then
drnn_state[t][2][len] = input_drnn_state[len]
end
end
local dlst = self.c2w_module[t]:backward({word_vec[{{},t}], unpack(self.rnn_state[t-1])}, drnn_state[t])
drnn_state[t-1] = {}
for k, v in pairs(dlst) do
if k > 1 then
drnn_state[t-1][k-1] = v
else
grad_inputs[{{},t,{}}] = v
end
end
end
self.char_vec_layer:backward(word, grad_inputs)
end
function C2W:parameters()
local params, grad_params = {}, {}
--local params_rnn, grad_params_rnn = model_utils.combine_all_parameters(self.rnn)
local params_rnn, grad_params_rnn = self.rnn:parameters()
tablex.insertvalues(params, params_rnn)
tablex.insertvalues(grad_params, grad_params_rnn)
local params_emb, grad_params_emb = self.char_vec_layer:parameters()
tablex.insertvalues(params, params_emb)
tablex.insertvalues(grad_params, grad_params_emb)
return params, grad_params
end
|
local ReactiveFlags = require("reactivity.reactive.ReactiveFlags")
local TrackOpTypes = require("reactivity.operations.TrackOpTypes")
local TriggerOpTypes = require("reactivity.operations.TriggerOpTypes")
local type, ipairs, pairs, ltraceback, xpcall, tinsert, getmetatable =
type,
ipairs,
pairs,
debug.traceback,
xpcall,
table.tinsert,
getmetatable
--[[*
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
]]
local function isObject(obj)
return type(obj) == "table"
end
local function isFunction(obj)
return type(obj) == "function"
end
local function isCallable(obj)
local t = type(obj)
if t == "function" then
return true
elseif t == "table" then
local mt = getmetatable(obj)
if mt then
return mt.__call ~= nil
end
end
return false
end
-- compare whether a value has changed, accounting for NaN.
local function hasChanged(value, oldValue)
return value ~= oldValue and (value == value or oldValue == oldValue)
end
--[[*
* Mix properties into target object.
]]
local function extend(to, _from)
for key, value in pairs(_from) do
to[key] = value
end
return to
end
local function NOOP()
end
local EMPTY_OBJ = {}
local warn = print
local function traceback(msg)
warn(ltraceback(msg))
end
local function callWithErrorHandling(fn, instance, type, ...)
local result, ret =
xpcall(
fn,
function(err)
warn(ltraceback(err, instance, type))
end,
instance,
...
)
return ret
end
local function callWithAsyncErrorHandling(fn, instance, type, ...)
if isCallable(fn) then
local res = callWithErrorHandling(fn, instance, type, ...)
return res
end
local values = {}
for i = 1, #fn do
tinsert(values, callWithAsyncErrorHandling(fn[i], instance, type, ...))
end
return values
end
local function array_includes(t, value)
for i, v in ipairs(t) do
if v == value then
return true
end
end
return false
end
return {
isObject = isObject,
isFunction = isFunction,
isCallable = isCallable,
hasChanged = hasChanged,
extend = extend,
warn = warn,
NOOP = NOOP,
EMPTY_OBJ = EMPTY_OBJ,
traceback = traceback,
callWithErrorHandling = callWithErrorHandling,
callWithAsyncErrorHandling = callWithAsyncErrorHandling,
array_includes = array_includes
}
|
local ffi = require 'ffi'
local class = require 'ext.class'
local table = require 'ext.table'
local CLBuffer = require 'cl.obj.buffer'
local safecdef = require 'hydro.code.safecdef'
--[[
We have a few different variable sets used for structs, gui, display, etc
Here's the kinds of things different ones hold:
*) name
*) type
*) units
*) code (for calculating display var values)
*) compile-time or not
This holds ...
*) a typename for the struct in OpenCL code
*) a table of vars, each with 'name', and 'type', and other things
Usage:
initialization:
1) struct = Struct() to create Struct object
2) struct:addVar[s]() to add necessary vars
3) struct:alloc() to allocate a CLBuffer of this type
(and TODO let the cl.obj.buffer keep its cpu ptr around)
then CLBuffer update fromCPU:
4) update struct.var.value's
5) struct:update() to update buffers
--]]
local Struct = class()
function Struct:init(args)
self.name = assert(args.name)
self.vars = table(args.vars)
self.dontUnion = args.dontUnion
self.dontMakeUniqueName = args.dontMakeUniqueName
if not self.dontMakeUniqueName then
self.app = assert(assert(args.solver).app)
end
end
-- TODO make this static
function Struct:countScalars(scalar)
scalar = scalar or 'real'
local structSize = 0
for _,var in ipairs(self.vars) do
local res, err = xpcall(function()
structSize = structSize + ffi.sizeof(var.type)
end, function(err)
return 'ffi.sizeof('..var.type..') failed for var '..require 'ext.tolua'(var)..'\n'
..tostring(err)..'\n'
..debug.traceback()
end)
if not res then error(err) end
end
local numScalars = structSize / ffi.sizeof(scalar)
return numScalars
end
function Struct:makeType()
assert(not self.typename, "don't call makeType() twice")
-- generate the typecode *except* the typename
-- then compare it to a map from typecode => typename
-- if it matches any, use the old typecode, typename, and metatype
-- otherwise generate a new one
local codeWithoutTypename = self:getTypeCodeWithoutTypeName()
-- new issue with multi-solvers and modules
-- setting the type code to this typedef also means the module using this code will need to depend on the previous def
-- which I can't communicate just yet
-- so in the mean time, I'll just disable this for now
--[=[
local app = assert(self.app)
app.typeInfoForCode = app.typeInfoForCode or {}
local info = app.typeInfoForCode[codeWithoutTypename]
if info then
print('reusing matching struct '..info.typename..' for '..self.name)
--[[ use cached version
self.typename = info.typename
self.typecode = info.typecode
self.metatype = info.metatype
return
--]]
-- but our module system now expects typenames to be unique names
-- which means that we can't use a matching typename but instead must do a unique name + a typedef
-- [[
self.typename = app:uniqueName(self.name)
codeWithoutTypename = 'typedef '..info.typename
self.typecode = codeWithoutTypename .. ' ' .. self.typename .. ';'
safecdef(assert(self.typecode))
self.metatype = info.metatype
return
--]]
end
--]=]
-- TODO no more uniqueName and typename ~= name .. instead force names to be unique
-- and make them unique before passing them in by appending the lua object uid or something
if self.dontMakeUniqueName then
self.typename = self.name
else
self.typename = assert(self.app):uniqueName(self.name)
end
do
local typecode = codeWithoutTypename .. ' ' .. self.typename .. ';'
if self.typecode then
assert(typecode == self.typecode)
else
self.typecode = typecode
end
end
safecdef(assert(self.typecode))
-- make the metatype here
local struct = self
local metatable = {
toLua = function(self)
local result = {}
for _,field in ipairs(struct.vars) do
local name = field.name
local ctype = field.type
local value = self[name]
if ctype.toLua then
value = value:toLua()
end
result[name] = value
end
return result
end,
__tostring = function(ptr)
local t = table()
for _,field in ipairs(struct.vars) do
local name = field.name
local ctype = field.type
local s = tostring(ptr[name])
t:insert(name..'='..s)
end
return struct.typename..'{'..t:concat', '..'}'
end,
__concat = function(a,b)
return tostring(a) .. tostring(b)
end,
__eq = function(a,b)
for _,field in ipairs(struct.vars) do
local name = field.name
local ctype = field.type
if a[name] ~= b[name] then return false end
end
return true
end,
}
metatable.__index = metatable
local metatype
local status, err = xpcall(function()
metatype = ffi.metatype(self.typename, metatable)
end, function(err)
return err..' typename='..self.typename..'\n'..debug.traceback()
end)
if not status then error(err) end
local sizeOfFields = table.map(struct.vars, function(field)
local name = field.name
local ctype = field.type
return ffi.sizeof(ctype)
end):sum() or 0
if ffi.sizeof(self.typename) ~= sizeOfFields then
print("ffi.sizeof("..self.typename..") = "..ffi.sizeof(self.typename))
print('sizeOfFields = '..sizeOfFields)
for _,field in ipairs(struct.vars) do
print("ffi.sizeof("..field.type..' '..self.typename..'.'..field.name..') = '..ffi.sizeof(field.type))
end
print('typecode:\n'..self.typecode)
error("struct "..self.typename.." isn't packed!")
end
self.metatype = metatype
--[=[
-- store it
app.typeInfoForCode[codeWithoutTypename] = {
typename = self.typename,
typecode = self.typecode,
metatype = self.metatype,
}
--]=]
end
-- this gets the type code *except* the typename
-- this way I can compare it to other type codes previously generated,
-- so I only need to generate struct codes once
-- I can use this to reduce the number of ffi.cdef's that are called.
function Struct:getTypeCodeWithoutTypeName()
local lines = table()
local scalar = 'real'
local tab
if self.dontUnion then
lines:insert'typedef struct {'
tab = '\t'
else
lines:insert'typedef union {'
local numScalars = self:countScalars(scalar)
lines:insert(' '..scalar..' ptr['..math.max(1, math.floor(numScalars))..'];')
lines:insert(' struct {')
tab = '\t\t'
end
for _,var in ipairs(self.vars) do
lines:insert(
tab
..var.type
-- fixing 'half' and 'double' alignment in solver_t
-- dontUnion is only used by solver_t
-- and solver_t is the only one with this C/CL alignment problem
..(self.dontUnion and ' __attribute__ ((packed))' or '')
..' '..var.name..';')
end
if not self.dontUnion then
lines:insert(' };')
end
lines:insert('}')
return lines:concat'\n'
end
return Struct
|
function onEvent(name, value1, value2)
if name == "AlarmFlash" then
makeLuaSprite('flash2', '', 0, 0);
makeGraphic('flash2',1280,720,'FF0000')
doTweenAlpha('flTf2','flash2',0,0.3,'linear')
addLuaSprite('flash2', true);
setLuaSpriteScrollFactor('flash2',0,0)
setProperty('flash2.scale.x',2)
setProperty('flash2.scale.y',2)
setProperty('flash2.alpha',0.4)
setProperty('flash2.alpha',0.6)
doTweenAlpha('flTw2','flash2',0,0.3,'linear')
end
end
|
chiMPIBarrier()
if (chi_location_id == 0) then
print("############################################### LuaTest")
end
--dofile(CHI_LIBRARY)
--############################################### Setup mesh
chiMeshHandlerCreate()
newSurfMesh = chiSurfaceMeshCreate();
chiSurfaceMeshImportFromOBJFile(newSurfMesh,
"ChiResources/TestObjects/SquareMesh2x2Quads.obj",true)
--############################################### Extract edges from surface mesh
loops,loop_count = chiSurfaceMeshGetEdgeLoopsPoly(newSurfMesh)
line_mesh = {};
line_mesh_count = 0;
for k=1,loop_count do
split_loops,split_count = chiEdgeLoopSplitByAngle(loops,k-1);
for m=1,split_count do
line_mesh_count = line_mesh_count + 1;
line_mesh[line_mesh_count] = chiLineMeshCreateFromLoop(split_loops,m-1);
end
end
--############################################### Setup Regions
region1 = chiRegionCreate()
chiRegionAddSurfaceBoundary(region1,newSurfMesh);
for k=1,line_mesh_count do
chiRegionAddLineBoundary(region1,line_mesh[k]);
end
--############################################### Create meshers
chiSurfaceMesherCreate(SURFACEMESHER_PREDEFINED);
chiVolumeMesherCreate(VOLUMEMESHER_EXTRUDER);
chiSurfaceMesherSetProperty(MAX_AREA,1/20/20)
chiSurfaceMesherSetProperty(PARTITION_X,2)
chiSurfaceMesherSetProperty(PARTITION_Y,2)
chiSurfaceMesherSetProperty(CUT_X,0.0)
chiSurfaceMesherSetProperty(CUT_Y,0.0)
NZ=2
chiVolumeMesherSetProperty(EXTRUSION_LAYER,0.2*NZ,NZ,"Charlie");--0.4
chiVolumeMesherSetProperty(EXTRUSION_LAYER,0.2*NZ,NZ,"Charlie");--0.8
chiVolumeMesherSetProperty(EXTRUSION_LAYER,0.2*NZ,NZ,"Charlie");--1.2
chiVolumeMesherSetProperty(EXTRUSION_LAYER,0.2*NZ,NZ,"Charlie");--1.6
chiVolumeMesherSetProperty(PARTITION_Z,1);
chiVolumeMesherSetProperty(FORCE_POLYGONS,true);
chiVolumeMesherSetProperty(MESH_GLOBAL,false);
--############################################### Execute meshing
chiSurfaceMesherExecute();
chiVolumeMesherExecute();
--chiRegionExportMeshToPython(region1,
-- "YMesh"..string.format("%d",chi_location_id)..".py",false)
--############################################### Set Material IDs
vol0 = chiLogicalVolumeCreate(RPP,-1000,1000,-1000,1000,-1000,1000)
chiVolumeMesherSetProperty(MATID_FROMLOGICAL,vol0,0)
vol1 = chiLogicalVolumeCreate(RPP,-0.5,0.5,-0.5,0.5,-1000,1000)
chiVolumeMesherSetProperty(MATID_FROMLOGICAL,vol1,1)
--############################################### Add materials
materials = {}
materials[1] = chiPhysicsAddMaterial("Test Material");
materials[2] = chiPhysicsAddMaterial("Test Material2");
chiPhysicsMaterialAddProperty(materials[1],SCALAR_VALUE)
chiPhysicsMaterialSetProperty(materials[1],SCALAR_VALUE,SINGLE_VALUE,1.0)
chiPhysicsMaterialAddProperty(materials[2],SCALAR_VALUE)
chiPhysicsMaterialSetProperty(materials[2],SCALAR_VALUE,SINGLE_VALUE,1.0)
chiPhysicsMaterialAddProperty(materials[1],SCALAR_VALUE)
chiPhysicsMaterialSetProperty(materials[1],SCALAR_VALUE,SINGLE_VALUE,1.0)
chiPhysicsMaterialAddProperty(materials[2],SCALAR_VALUE)
chiPhysicsMaterialSetProperty(materials[2],SCALAR_VALUE,SINGLE_VALUE,1.0)
chiPhysicsMaterialAddProperty(materials[1],TRANSPORT_XSECTIONS)
chiPhysicsMaterialAddProperty(materials[2],TRANSPORT_XSECTIONS)
chiPhysicsMaterialAddProperty(materials[1],ISOTROPIC_MG_SOURCE)
chiPhysicsMaterialAddProperty(materials[2],ISOTROPIC_MG_SOURCE)
xs_1 = chiPhysicsTransportXSCreate()
xs_2 = chiPhysicsTransportXSCreate()
xs_3 = chiPhysicsTransportXSCreate()
chiPhysicsTransportXSSet(xs_1,PDT_XSFILE,"ChiTest/xs_graphite_pure.data")
chiPhysicsTransportXSSet(xs_2,PDT_XSFILE,"ChiTest/xs_3_170.data")
chiPhysicsTransportXSSet(xs_3,PDT_XSFILE,"ChiTest/xs_air50RH.data")
combo ={{xs_1, 0.5},
{xs_2, 0.4},
{xs_3, 0.1}}
comb = chiPhysicsTransportXSMakeCombined(combo)
num_groups = 168
chiPhysicsMaterialSetProperty(materials[1],TRANSPORT_XSECTIONS,
EXISTING,comb)
chiPhysicsMaterialSetProperty(materials[2],TRANSPORT_XSECTIONS,
EXISTING,comb)
src={}
for g=1,num_groups do
src[g] = 0.0
end
chiPhysicsMaterialSetProperty(materials[1],ISOTROPIC_MG_SOURCE,FROM_ARRAY,src)
chiPhysicsMaterialSetProperty(materials[2],ISOTROPIC_MG_SOURCE,FROM_ARRAY,src)
--############################################### Setup Physics
phys1 = chiLBSCreateSolver()
chiSolverAddRegion(phys1,region1)
--========== Groups
grp = {}
for g=1,num_groups do
grp[g] = chiLBSCreateGroup(phys1)
end
--========== ProdQuad
pquad = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,2, 2)
pquad2 = chiCreateProductQuadrature(GAUSS_LEGENDRE_CHEBYSHEV,16, 16)
--========== Groupset def
gs0 = chiLBSCreateGroupset(phys1)
cur_gs = gs0
chiLBSGroupsetAddGroups(phys1,cur_gs,0,62)
chiLBSGroupsetSetQuadrature(phys1,cur_gs,pquad)
chiLBSGroupsetSetAngleAggDiv(phys1,cur_gs,1)
chiLBSGroupsetSetGroupSubsets(phys1,cur_gs,3)
chiLBSGroupsetSetIterativeMethod(phys1,cur_gs,NPT_GMRES)
chiLBSGroupsetSetResidualTolerance(phys1,cur_gs,1.0e-6)
chiLBSGroupsetSetMaxIterations(phys1,cur_gs,300)
chiLBSGroupsetSetGMRESRestartIntvl(phys1,cur_gs,100)
gs1 = chiLBSCreateGroupset(phys1)
cur_gs = gs1
chiLBSGroupsetAddGroups(phys1,cur_gs,63,num_groups-1)
chiLBSGroupsetSetQuadrature(phys1,cur_gs,pquad)
chiLBSGroupsetSetAngleAggDiv(phys1,cur_gs,1)
chiLBSGroupsetSetGroupSubsets(phys1,cur_gs,1)
chiLBSGroupsetSetIterativeMethod(phys1,cur_gs,NPT_GMRES)
chiLBSGroupsetSetResidualTolerance(phys1,cur_gs,1.0e-6)
chiLBSGroupsetSetMaxIterations(phys1,cur_gs,200)
chiLBSGroupsetSetGMRESRestartIntvl(phys1,cur_gs,15)
chiLBSGroupsetSetWGDSA(phys1,cur_gs,30,1.0e-4,false," ")
chiLBSGroupsetSetTGDSA(phys1,cur_gs,30,1.0e-4,false," ")
--========== Boundary conditions
bsrc={}
for g=1,num_groups do
bsrc[g] = 0.0
end
bsrc[1] = 1.0/4.0/math.pi;
chiLBSSetProperty(phys1,BOUNDARY_CONDITION,ZMIN,LBSBoundaryTypes.INCIDENT_ISOTROPIC,bsrc);
--========== Solvers
chiLBSSetProperty(phys1,DISCRETIZATION_METHOD,PWLD3D)
chiLBSInitialize(phys1)
chiLBSExecute(phys1)
fflist1,count = chiLBSGetScalarFieldFunctionList(phys1)
--############################################### Setup Physics
phys1 = chiDiffusionCreateSolver();
chiSolverAddRegion(phys1,region1)
--fftemp = chiSolverAddFieldFunction(phys1,"Temperature")
chiDiffusionSetProperty(phys1,DISCRETIZATION_METHOD,PWLD_MIP);
chiDiffusionSetProperty(phys1,RESIDUAL_TOL,1.0e-6)
--############################################### Set boundary conditions
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,5,DIFFUSION_VACUUM)
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,6,DIFFUSION_VACUUM)
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,0,DIFFUSION_VACUUM)
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,1,DIFFUSION_VACUUM)
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,2,DIFFUSION_VACUUM)
--chiDiffusionSetProperty(phys1,BOUNDARY_TYPE,3,DIFFUSION_VACUUM)
--############################################### Initialize Solver
chiDiffusionInitialize(phys1)
chiDiffusionExecute(phys1)
--
----############################################### Set derived geometry
fflist2,count = chiGetFieldFunctionList(phys1)
|
-- Script to send a Meter Reset command to a Z-Wave device
-- This can be handy to reset the accumulated power readings in a plug, etc.
-- The reset command will be sent to the device below when the trigger is controlled ON
local deviceName = "Plug" -- name of your device
local trigger = "MeterReset" -- Name of the trigger
------ Do not change below ------
COMMAND_CLASS_METER = 0x32
METER_RESET = 0x05
local deviceManager = require "telldus.DeviceManager"
function onDeviceStateChanged(device, state, stateValue)
local trig = deviceManager:findByName(trigger)
local dev = deviceManager:findByName(deviceName)
if device:id() ~= trig:id() then
return
end
if trig == nil then
print("Could not find the device %s", trigger)
return
end
if dev == nil then
print("Could not find the device %s", deviceName)
return
end
if trig:state() == 1 then
print("Sending METER RESET to %s", deviceName)
dev:zwaveNode():sendMsg(COMMAND_CLASS_METER, METER_RESET)
end
end
|
-- Author: Carsten Gips <carsten.gips@fh-bielefeld.de>
-- Copyright: (c) 2018 Carsten Gips
-- License: MIT
-- translate ISBN links generated by pandoc-citeproc
-- (needs to be run *after* pandoc-citeproc)
--
-- reference to ISBN 12345 would be linked to https://worldcat.org/isbn/12345
-- my students would rather like to know availability in univerity library,
-- thus change generated URL to https://www.digibib.net/openurl/Bi10?isbn=12345
function Link(el)
return pandoc.Link(el.content, el.target:gsub("^https://worldcat.org/isbn/(%d[0-9%-]+%d)$", "https://www.digibib.net/openurl/Bi10?isbn=%1"), el.title, el.attr)
end
|
local be_hit = 0
function onPostTick(target, buff)
if be_hit == 1 then
target.hp = 0
end
end
function targetWillHit(target, buff, bullet)
if bullet.hurt_disabled == 0 then
be_hit = 1
bullet.name_id = buff.id
bullet.hurt_final_value = -1
end
end
|
local kModName = debug.getinfo(1, "S").source:gsub("@lua/", ""):gsub("/Framework/.*%.lua", "")
Script.Load("lua/" .. kModName .. "/Framework/Framework.lua")
local Mod = _G[kModName]
Mod:PrintDebug("Setting up file hooks", "all")
for i = 1, #Mod.config.modules do
local currentModule = Mod.config.modules[i]
local types = { "Halt", "Post", "Pre", "Replace" }
for j = 1, #types do
local hookType = types[j]
local path = Mod:FormatDir(currentModule, hookType)
local files = {}
Shared.GetMatchingFileNames(path, true, files)
for k = 1, #files do
local file = files[k]
local vpath = file:gsub(kModName .. "/.*/" .. hookType .. "/", "")
Mod:PrintDebug(string.format("Hooking file: %s, Vanilla Path: %s, Method: %s", file, vpath, hookType), "all")
ModLoader.SetupFileHook(vpath, file, hookType:lower())
end
end
end
Mod:PrintDebug("File hooks complete", "all")
|
-- default config
pfBrowser_fav = {["units"] = {}, ["objects"] = {}, ["items"] = {}, ["quests"] = {}}
local tooltip_limit = 5
-- add database shortcuts
local items = pfDB["items"]["data"]
local units = pfDB["units"]["data"]
local objects = pfDB["objects"]["data"]
local quests = pfDB["quests"]["data"]
local zones = pfDB["zones"]["loc"]
-- result buttons
local function StartAndFinish(questData, startOrFinish, types)
local strings = {["start"]="Quest Start: ", ["end"]="Quest End: "}
for _, key in ipairs(types) do
if questData[startOrFinish] and questData[startOrFinish][key] then
local typeName = {["U"]="units",["O"]="objects",["I"]="items"}
local entries = ""
local first = true
for _,id in ipairs(questData[startOrFinish][key]) do
if first == true then
entries = entries .. ( pfDB[typeName[key]]["loc"][id] or UNKNOWN )
first = false
else
entries = entries .. ", " .. ( pfDB[typeName[key]]["loc"][id] or UNKNOWN )
end
end
GameTooltip:AddDoubleLine(strings[startOrFinish], entries, 1,1,1, 1,1,.8)
end
end
end
local function ResultButtonEnter()
this.tex:SetTexture(1,1,1,.1)
-- item
if this.btype == "items" then
GameTooltip:SetOwner(this, "ANCHOR_LEFT", -10, -5)
GameTooltip:SetHyperlink("item:" .. this.id .. ":0:0:0")
GameTooltip:Show()
-- quest
elseif this.btype == "quests" then
GameTooltip:SetOwner(this, "ANCHOR_LEFT", -10, -5)
GameTooltip:SetText(this.name, .3, 1, .8)
local questTexts = pfDB[this.btype]["loc"][this.id]
local questData = pfDB[this.btype]["data"][this.id]
GameTooltip:AddLine(" ")
-- quest starter
if questData["start"] or questData["end"] then
StartAndFinish(questData, "start", {"U","O","I"})
StartAndFinish(questData, "end", {"U","O"})
end
-- obectives
if questTexts["O"] and questTexts["O"] ~= "" then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(pfDatabase:FormatQuestText(questTexts["O"]),1,1,1,true)
end
-- details
if questTexts["D"] and questTexts["D"] ~= "" then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(pfDatabase:FormatQuestText(questTexts["D"]),.6,.6,.6,true)
end
-- add levels
if questData.lvl or questData.min then
GameTooltip:AddLine(" ")
end
if questData.lvl then
local questlevel = tonumber(questData.lvl)
local color = GetDifficultyColor(questlevel)
GameTooltip:AddLine("|cffffffffQuest Level: |r" .. questlevel, color.r, color.g, color.b)
end
if questData.min then
local questlevel = tonumber(questData.min)
local color = GetDifficultyColor(questlevel)
GameTooltip:AddLine("|cffffffffRequired Level: |r" .. questlevel, color.r, color.g, color.b)
end
GameTooltip:Show()
-- units / objects
else
local id = this.id
local name = this.name
local maps = {}
GameTooltip:SetOwner(this, "ANCHOR_LEFT", -10, -5)
GameTooltip:SetText(name, .3, 1, .8)
if this.btype == "units" then
local unitData = units[id]
if unitData.lvl then
GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine("Level", unitData.lvl, 1,1,.8, 1,1,1)
end
local reactionStringA = "|c00ff0000Hostile|r"
local reactionStringH = "|c00ff0000Hostile|r"
if unitData.fac then
if unitData.fac == "AH" then
reactionStringA = "|c0000ff00Friendly|r"
reactionStringH = "|c0000ff00Friendly|r"
elseif unitData.fac == "A" then
reactionStringA = "|c0000ff00Friendly|r"
elseif unitData.fac == "H" then
reactionStringH = "|c0000ff00Friendly|r"
end
end
GameTooltip:AddLine("\nReaction", 1,1,.8)
GameTooltip:AddDoubleLine("Alliance", reactionStringA, 1,1,1, 0,0,0)
GameTooltip:AddDoubleLine("Horde", reactionStringH, 1,1,1, 0,0,0)
end
GameTooltip:AddLine("\nLocation", 1,1,.8)
if pfDB[this.btype]["data"][id] and pfDB[this.btype]["data"][id]["coords"] then
for _, data in pairs(pfDB[this.btype]["data"][id]["coords"]) do
local zone = data[3]
maps[zone] = maps[zone] and maps[zone] + 1 or 1
end
else
GameTooltip:AddLine(UNKNOWN, 1,.5,.5)
end
for zone, count in pairs(maps) do
GameTooltip:AddDoubleLine(( zone and pfMap:GetMapNameByID(zone) or UNKNOWN), count .. "x", 1,1,1, .5,.5,.5)
end
GameTooltip:Show()
end
end
local function ResultButtonUpdate()
this.refreshCount = this.refreshCount + 1
if not this.itemColor then
GameTooltip:SetHyperlink("item:" .. this.id .. ":0:0:0")
GameTooltip:Hide()
local _, _, itemQuality = GetItemInfo(this.id)
if itemQuality then
local r = ceil(ITEM_QUALITY_COLORS[itemQuality].r*255)
local g = ceil(ITEM_QUALITY_COLORS[itemQuality].g*255)
local b = ceil(ITEM_QUALITY_COLORS[itemQuality].b*255)
this.itemColor = "|c" .. string.format("ff%02x%02x%02x", r, g, b)
end
end
if this.itemColor then
this.text:SetText(this.itemColor .."|Hitem:"..this.id..":0:0:0|h[".. this.name.."]|h|r")
this.text:SetWidth(this.text:GetStringWidth())
end
if this.refreshCount > 10 or this.itemColor then
this:SetScript("OnUpdate", nil)
end
end
local function ResultButtonClick()
local meta = { ["addon"] = "PFDB" }
if this.btype == "items" then
local link = "item:"..this.id..":0:0:0"
local text = ( this.itemColor or "|cffffffff" ) .."|H" .. link .. "|h["..this.name.."]|h|r"
SetItemRef(link, text, arg1)
elseif this.btype == "quests" then
if IsShiftKeyDown() then
ChatFrameEditBox:Show()
ChatFrameEditBox:Insert("|cffffff00|Hquest:" .. ( this.id or 0 ) .. ":0:0:0|h[" .. this.name .. "]|h|r")
elseif pfBrowser.selectState then
local maps = pfDatabase:SearchQuest(this.name)
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
else
local maps = pfDatabase:SearchQuestID(this.id, meta)
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
end
elseif this.btype == "units" then
if pfBrowser.selectState then
local maps = pfDatabase:SearchMob(this.name, meta)
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
else
local maps = pfDatabase:SearchMobID(this.id)
pfMap:UpdateNodes()
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
end
elseif this.btype == "objects" then
if pfBrowser.selectState then
local maps = pfDatabase:SearchObject(this.name, meta)
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
else
local maps = pfDatabase:SearchObjectID(this.id)
pfMap:UpdateNodes()
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
end
end
end
local function ResultButtonClickFav()
local parent = this:GetParent()
if pfBrowser_fav[parent.btype][parent.id] then
pfBrowser_fav[parent.btype][parent.id] = nil
this.icon:SetVertexColor(1,1,1,.1)
else
pfBrowser_fav[parent.btype][parent.id] = parent.name
this.icon:SetVertexColor(1,1,1,1)
end
end
local function ResultButtonLeave()
if pfBrowser.selectState then
pfBrowser.selectState = "clean"
end
if math.mod(this:GetID(),2) == 1 then
this.tex:SetTexture(1,1,1,.02)
else
this.tex:SetTexture(1,1,1,.04)
end
GameTooltip:Hide()
end
local function ResultButtonClickSpecial()
local param = this:GetParent()[this.parameter]
local maps = {}
if this.buttonType == "O" or this.buttonType == "U" then
if this.selectState then
maps = pfDatabase:SearchItem(this:GetParent().name, meta)
else
maps = pfDatabase:SearchItemID(param, nil, nil, {[this.buttonType]=true})
end
elseif this.buttonType == "V" then
maps = pfDatabase:SearchVendor(param)
end
pfMap:UpdateNodes()
pfMap:ShowMapID(pfDatabase:GetBestMap(maps))
end
local function ResultButtonEnterSpecial()
local id = this:GetParent().id
local count = 0
local skip = false
GameTooltip:SetOwner(pfBrowser, "ANCHOR_CURSOR")
-- unit
if this.buttonType == "U" then
if items[id]["U"] then
GameTooltip:SetText("Looted from", .3, 1, .8)
for unitID, chance in pairs(items[id]["U"]) do
count = count + 1
if count > tooltip_limit then
skip = true
end
if units[unitID] and not skip then
local name = pfDB.units.loc[unitID]
local zone = nil
if units[unitID].coords then
zone = units[unitID].coords[1][3]
end
GameTooltip:AddDoubleLine(name, ( zone and pfMap:GetMapNameByID(zone) or UNKNOWN), 1,1,1, .5,.5,.5)
end
end
end
-- object
elseif this.buttonType == "O" then
if items[id]["O"] then
GameTooltip:SetText("Looted from", .3, 1, .8)
for objectID, chance in pairs(items[id]["O"]) do
count = count + 1
if count > tooltip_limit then
skip = true
end
if objects[objectID] and not skip then
local name = pfDB.objects.loc[objectID] or objectID
local zone = nil
if objects[objectID].coords and objects[objectID].coords[1] then
zone = objects[objectID].coords[1][3]
end
GameTooltip:AddDoubleLine(name, ( zone and pfMap:GetMapNameByID(zone) or UNKNOWN), 1,1,1, .5,.5,.5)
end
end
end
-- vendor
elseif this.buttonType == "V" then
if items[id]["V"] then
GameTooltip:SetText("Sold by", .3, 1, .8)
for unitID, sellcount in pairs(items[id]["V"]) do
count = count + 1
if count > tooltip_limit then
skip = true
end
if units[unitID] and not skip then
local name = pfDB.units.loc[unitID]
if sellcount ~= 0 then name = name .. " (" .. sellcount .. ")" end
local zone = units[unitID].coords and units[unitID].coords[1] and units[unitID].coords[1][3]
GameTooltip:AddDoubleLine(name, ( zone and pfMap:GetMapNameByID(zone) or UNKNOWN), 1,1,1, .5,.5,.5)
end
end
end
end
if count > tooltip_limit then
GameTooltip:AddLine("\nand "..(count - tooltip_limit).." others.",.8,.8,.8)
end
GameTooltip:Show()
end
local function ResultButtonLeaveSpecial()
GameTooltip:Hide()
end
local function ResultButtonReload(self)
self.idText:SetText("ID: " .. self.id)
if pfQuest_config.showids == "1" then
self.idText:Show()
else
self.idText:Hide()
end
self.itemColor = nil
-- update faction
if self.btype ~= "items" then
self.factionA:Hide()
self.factionH:Hide()
local raceMask = pfDatabase:GetRaceMaskByID(self.id, self.btype)
if (bit.band(77, raceMask) > 0) or (raceMask == 0 and self.btype == "quests") then
self.factionA:Show()
end
if (bit.band(178, raceMask) > 0) or (raceMask == 0 and self.btype == "quests") then
self.factionH:Show()
end
end
-- activate fav buttons if needed
if pfBrowser_fav and pfBrowser_fav[self.btype] and pfBrowser_fav[self.btype][self.id] then
self.fav.icon:SetVertexColor(1,1,1,1)
else
self.fav.icon:SetVertexColor(1,1,1,.1)
end
-- actions by search type
if self.btype == "quests" then
self.name = pfDB[self.btype]["loc"][self.id]["T"]
self.text:SetText("|cffffcc00|Hquest:0:0:0:0|h[" .. self.name .. "]|h|r")
elseif self.btype == "units" or self.btype == "objects" then
local level = pfDB[self.btype]["data"][self.id] and pfDB[self.btype]["data"][self.id]["lvl"] or ""
if level and level ~= "" then level = " (" .. level .. ")" end
self.text:SetText(self.name .. "|cffaaaaaa" .. level)
if pfDB[self.btype]["data"][self.id]["coords"] then
self.text:SetTextColor(1,1,1)
else
self.text:SetTextColor(.5,.5,.5)
end
elseif self.btype == "items" then
for _, key in ipairs({"U","O","V"}) do
if items[self.id][key] then
self[key]:Show()
else
self[key]:Hide()
end
end
self.text:SetText("|cffff5555[?] |cffffffff" .. self.name)
self.refreshCount = 0
self:SetScript("OnUpdate", ResultButtonUpdate)
end
self.text:SetWidth(self.text:GetStringWidth())
self:Show()
end
local function ResultButtonCreate(i, resultType)
local f = CreateFrame("Button", nil, pfBrowser.tabs[resultType].list)
f:SetPoint("TOPLEFT", pfBrowser.tabs[resultType].list, "TOPLEFT", 10, -i*30 + 5)
f:SetPoint("BOTTOMRIGHT", pfBrowser.tabs[resultType].list, "TOPRIGHT", 10, -i*30 - 15)
f:Hide()
f:SetID(i)
f.btype = resultType
f.pfResultButton = true
f.tex = f:CreateTexture("BACKGROUND")
f.tex:SetAllPoints(f)
f.tex:SetTexture(1,1,1, ( math.mod(i,2) == 1 and .02 or .04))
-- text properties
f.text = f:CreateFontString("Caption", "LOW", "GameFontWhite")
f.text:SetAllPoints(f)
f.text:SetJustifyH("CENTER")
f.idText = f:CreateFontString("ID", "LOW", "GameFontDisable")
f.idText:SetPoint("LEFT", f, "LEFT", 30, 0)
-- favourite button
f.fav = CreateFrame("Button", nil, f)
f.fav:SetHitRectInsets(-3,-3,-3,-3)
f.fav:SetPoint("LEFT", 0, 0)
f.fav:SetWidth(16)
f.fav:SetHeight(16)
f.fav.icon = f.fav:CreateTexture("OVERLAY")
f.fav.icon:SetTexture("Interface\\AddOns\\pfQuest\\img\\fav")
f.fav.icon:SetAllPoints(f.fav)
-- faction icons
if resultType ~= "items" then
f.factionA = f:CreateTexture("OVERLAY")
f.factionA:SetTexture("Interface\\AddOns\\pfQuest\\img\\icon_alliance")
f.factionA:SetWidth(16)
f.factionA:SetHeight(16)
f.factionA:SetPoint("RIGHT", -5, 0)
f.factionH = f:CreateTexture("OVERLAY")
f.factionH:SetTexture("Interface\\AddOns\\pfQuest\\img\\icon_horde")
f.factionH:SetWidth(16)
f.factionH:SetHeight(16)
f.factionH:SetPoint("RIGHT", -24, 0)
end
-- drop, loot, vendor buttons
if resultType == "items" then
local buttons = {
["U"] = { ["offset"] = -5, ["icon"] = "icon_npc", ["parameter"] = "id", },
["O"] = { ["offset"] = -24, ["icon"] = "icon_object", ["parameter"] = "id", },
["V"] = { ["offset"] = -43, ["icon"] = "icon_vendor", ["parameter"] = "name", },
}
for button, settings in pairs(buttons) do
f[button] = CreateFrame("Button", nil, f)
f[button]:SetHitRectInsets(-3,-3,-3,-3)
f[button]:SetPoint("RIGHT", settings.offset, 0)
f[button]:SetWidth(16)
f[button]:SetHeight(16)
f[button].buttonType = button
f[button].parameter = settings.parameter
f[button].icon = f[button]:CreateTexture("OVERLAY")
f[button].icon:SetAllPoints(f[button])
f[button].icon:SetTexture("Interface\\AddOns\\pfQuest\\img\\"..settings.icon)
f[button]:SetScript("OnEnter", ResultButtonEnterSpecial)
f[button]:SetScript("OnLeave", ResultButtonLeaveSpecial)
f[button]:SetScript("OnClick", ResultButtonClickSpecial)
end
end
-- bind functions
f.Reload = ResultButtonReload
f:SetScript("OnLeave", ResultButtonLeave)
f:SetScript("OnEnter", ResultButtonEnter)
f:SetScript("OnClick", ResultButtonClick)
f.fav:SetScript("OnClick", ResultButtonClickFav)
return f
end
local function SelectView(view)
for id, frame in pairs(pfBrowser.tabs) do
frame.button:SetTextColor(1,1,1,.7)
frame:Hide()
end
view.button:SetTextColor(.2,1,.8,1)
view.button:Hide()
view.button:Show()
view:Show()
end
-- sets the browser result values when they change
local function RefreshView(i, key, caption)
pfBrowser.tabs[key].list:Hide()
pfBrowser.tabs[key].list:SetHeight(i * 30 )
pfBrowser.tabs[key].list:Show()
pfBrowser.tabs[key].list:GetParent():SetScrollChild(pfBrowser.tabs[key].list)
pfBrowser.tabs[key].list:GetParent():SetVerticalScroll(0)
pfBrowser.tabs[key].list:GetParent():UpdateScrollState()
pfBrowser.tabs[key].button:SetText(caption .. " " .. "|cffaaaaaa(" .. i .. ")")
for j=i+1, table.getn(pfBrowser.tabs[key].buttons) do
if pfBrowser.tabs[key].buttons[j] then
pfBrowser.tabs[key].buttons[j]:Hide()
pfBrowser.tabs[key].buttons[j].id = nil
pfBrowser.tabs[key].buttons[j].name = nil
end
end
end
-- sets up all the browse windows and their activation buttons
local function CreateBrowseWindow(fname, name, parent, anchor, x, y)
if not parent.tabs then parent.tabs = {} end
parent.tabs[fname] = pfUI.api.CreateScrollFrame(name, parent)
parent.tabs[fname]:SetPoint("TOPLEFT", parent, "TOPLEFT", 10, -65)
parent.tabs[fname]:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -10, 45)
parent.tabs[fname].buttons = { }
parent.tabs[fname].backdrop = CreateFrame("Frame", name .. "Backdrop", parent.tabs[fname])
parent.tabs[fname].backdrop:SetFrameLevel(1)
parent.tabs[fname].backdrop:SetPoint("TOPLEFT", parent.tabs[fname], "TOPLEFT", -5, 5)
parent.tabs[fname].backdrop:SetPoint("BOTTOMRIGHT", parent.tabs[fname], "BOTTOMRIGHT", 5, -5)
pfUI.api.CreateBackdrop(parent.tabs[fname].backdrop, nil, true)
parent.tabs[fname].button = CreateFrame("Button", name .. "Button", parent)
parent.tabs[fname].button:SetPoint(anchor, x, y)
parent.tabs[fname].button:SetWidth(153)
parent.tabs[fname].button:SetHeight(30)
parent.tabs[fname].button:SetScript("OnClick", function()
SelectView(parent.tabs[fname])
end)
pfUI.api.SkinButton(parent.tabs[fname].button)
parent.tabs[fname].list = pfUI.api.CreateScrollChild(name .. "Scroll", parent.tabs[fname])
parent.tabs[fname].list:SetWidth(600)
parent.tabs[fname]:Hide()
end
-- minimap icon
pfBrowserIcon = CreateFrame('Button', "pfBrowserIcon", Minimap)
pfBrowserIcon:SetClampedToScreen(true)
pfBrowserIcon:SetMovable(true)
pfBrowserIcon:EnableMouse(true)
pfBrowserIcon:RegisterForDrag('LeftButton')
pfBrowserIcon:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
pfBrowserIcon:SetScript("OnDragStart", function()
if IsShiftKeyDown() then
this:StartMoving()
end
end)
pfBrowserIcon:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
pfBrowserIcon:SetScript("OnClick", function()
if arg1 == "RightButton" then
if pfQuestConfig:IsShown() then pfQuestConfig:Hide() else pfQuestConfig:Show() end
else
if pfBrowser:IsShown() then pfBrowser:Hide() else pfBrowser:Show() end
end
end)
pfBrowserIcon:SetScript("OnEnter", function()
GameTooltip:SetOwner(this, ANCHOR_BOTTOMLEFT)
GameTooltip:SetText("pfQuest")
GameTooltip:AddDoubleLine("Left-Click", "Open Browser", 1, 1, 1, 1, 1, 1)
GameTooltip:AddDoubleLine("Right-Click", "Open Configuration", 1, 1, 1, 1, 1, 1)
GameTooltip:AddDoubleLine("Shift-Click", "Move Button", 1, 1, 1, 1, 1, 1)
GameTooltip:Show()
end)
pfBrowserIcon:SetScript("OnLeave", function()
GameTooltip:Hide()
end)
pfBrowserIcon:SetFrameStrata('LOW')
pfBrowserIcon:SetWidth(31)
pfBrowserIcon:SetHeight(31)
pfBrowserIcon:SetFrameLevel(9)
pfBrowserIcon:SetHighlightTexture('Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight')
pfBrowserIcon:SetPoint("TOPLEFT", Minimap, "TOPLEFT", 0, 0)
pfBrowserIcon.overlay = pfBrowserIcon:CreateTexture(nil, 'OVERLAY')
pfBrowserIcon.overlay:SetWidth(53)
pfBrowserIcon.overlay:SetHeight(53)
pfBrowserIcon.overlay:SetTexture('Interface\\Minimap\\MiniMap-TrackingBorder')
pfBrowserIcon.overlay:SetPoint('TOPLEFT', 0,0)
pfBrowserIcon.icon = pfBrowserIcon:CreateTexture(nil, 'BACKGROUND')
pfBrowserIcon.icon:SetWidth(20)
pfBrowserIcon.icon:SetHeight(20)
pfBrowserIcon.icon:SetTexture('Interface\\AddOns\\pfQuest\\img\\logo')
pfBrowserIcon.icon:SetTexCoord(0.05, 0.95, 0.05, 0.95)
pfBrowserIcon.icon:SetPoint('CENTER',1,1)
-- browser window
pfBrowser = CreateFrame("Frame", "pfQuestBrowser", UIParent)
pfBrowser:Hide()
pfBrowser:SetWidth(640)
pfBrowser:SetHeight(480)
pfBrowser:SetPoint("CENTER", 0, 0)
pfBrowser:SetFrameStrata("FULLSCREEN_DIALOG")
pfBrowser:SetMovable(true)
pfBrowser:EnableMouse(true)
pfBrowser:SetScript("OnMouseDown",function()
this:StartMoving()
end)
pfBrowser:SetScript("OnMouseUp",function()
this:StopMovingOrSizing()
end)
pfBrowser:SetScript("OnUpdate", function()
-- multi-select handling
if not this.selectState and IsControlKeyDown() and GetMouseFocus() and GetMouseFocus().pfResultButton then
for id, frame in pairs(pfBrowser.tabs) do
for id, button in pairs(frame.buttons) do
if button.name == GetMouseFocus().name then
button.tex:SetTexture(.3,1,.8,.4)
end
end
end
this.selectState = "active"
elseif this.selectState and (this.selectState == "clean" or not IsControlKeyDown()) then
for id, frame in pairs(pfBrowser.tabs) do
for id, button in pairs(frame.buttons) do
if math.mod(button:GetID(),2) == 1 then
button.tex:SetTexture(1,1,1,.02)
else
button.tex:SetTexture(1,1,1,.04)
end
end
end
this.selectState = nil
end
end)
pfUI.api.CreateBackdrop(pfBrowser, nil, true, 0.75)
table.insert(UISpecialFrames, "pfQuestBrowser")
pfBrowser.title = pfBrowser:CreateFontString("Status", "LOW", "GameFontNormal")
pfBrowser.title:SetFontObject(GameFontWhite)
pfBrowser.title:SetPoint("TOP", pfBrowser, "TOP", 0, -8)
pfBrowser.title:SetJustifyH("LEFT")
pfBrowser.title:SetFont(pfUI.font_default, 14)
pfBrowser.title:SetText("|cff33ffccpf|rQuest")
pfBrowser.close = CreateFrame("Button", "pfQuestBrowserClose", pfBrowser)
pfBrowser.close:SetPoint("TOPRIGHT", -5, -5)
pfBrowser.close:SetHeight(12)
pfBrowser.close:SetWidth(12)
pfBrowser.close.texture = pfBrowser.close:CreateTexture("pfQuestionDialogCloseTex")
pfBrowser.close.texture:SetTexture("Interface\\AddOns\\pfQuest\\compat\\close")
pfBrowser.close.texture:ClearAllPoints()
pfBrowser.close.texture:SetAllPoints(pfBrowser.close)
pfBrowser.close.texture:SetVertexColor(1,.25,.25,1)
pfUI.api.SkinButton(pfBrowser.close, 1, .5, .5)
pfBrowser.close:SetScript("OnClick", function()
this:GetParent():Hide()
end)
pfBrowser.clean = CreateFrame("Button", "pfQuestBrowserClean", pfBrowser)
pfBrowser.clean:SetPoint("TOPLEFT", pfBrowser, "TOPLEFT", 545, -30)
pfBrowser.clean:SetPoint("BOTTOMRIGHT", pfBrowser, "TOPRIGHT", -5, -55)
pfBrowser.clean:SetScript("OnClick", function()
pfMap:DeleteNode("PFDB")
pfMap:UpdateNodes()
end)
pfBrowser.clean.text = pfBrowser.clean:CreateFontString("Caption", "LOW", "GameFontWhite")
pfBrowser.clean.text:SetAllPoints(pfBrowser.clean)
pfBrowser.clean.text:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
pfBrowser.clean.text:SetText("Clean Map")
pfUI.api.SkinButton(pfBrowser.clean)
CreateBrowseWindow("units", "pfQuestBrowserUnits", pfBrowser, "BOTTOMLEFT", 5, 5)
CreateBrowseWindow("objects", "pfQuestBrowserObjects", pfBrowser, "BOTTOMLEFT", 164, 5)
CreateBrowseWindow("items", "pfQuestBrowserItems", pfBrowser, "BOTTOMRIGHT", -164, 5)
CreateBrowseWindow("quests", "pfQuestBrowserQuests", pfBrowser, "BOTTOMRIGHT", -5, 5)
SelectView(pfBrowser.tabs["units"])
pfBrowser.input = CreateFrame("EditBox", "pfQuestBrowserSearch", pfBrowser)
pfBrowser.input:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
pfBrowser.input:SetAutoFocus(false)
pfBrowser.input:SetText("Search")
pfBrowser.input:SetJustifyH("LEFT")
pfBrowser.input:SetPoint("TOPLEFT", pfBrowser, "TOPLEFT", 5, -30)
pfBrowser.input:SetPoint("BOTTOMRIGHT", pfBrowser, "TOPRIGHT", -100, -55)
pfBrowser.input:SetTextInsets(10,10,5,5)
pfBrowser.input:SetScript("OnEscapePressed", function() this:ClearFocus() end)
pfBrowser.input:SetScript("OnEditFocusGained", function()
if this:GetText() == "Search" then this:SetText("") end
end)
pfBrowser.input:SetScript("OnEditFocusLost", function()
if this:GetText() == "" then this:SetText("Search") end
end)
-- This script updates all the search tabs when the search text changes
pfBrowser.input:SetScript("OnTextChanged", function()
local text = this:GetText()
if (text == "Search") then text = "" end
for _, caption in ipairs({"Units","Objects","Items","Quests"}) do
local searchType = strlower(caption)
local data = strlen(text) >= 3 and pfDatabase:GetIDByName(text, searchType, true) or pfBrowser_fav[searchType]
local i = 0
for id, text in pairs(data) do
i = i + 1
pfBrowser.tabs[searchType].buttons[i] = pfBrowser.tabs[searchType].buttons[i] or ResultButtonCreate(i, searchType)
pfBrowser.tabs[searchType].buttons[i].id = id
pfBrowser.tabs[searchType].buttons[i].name = text
pfBrowser.tabs[searchType].buttons[i]:Reload()
--if i >= search_limit then break end
end
RefreshView(i, searchType, caption)
end
end)
pfUI.api.CreateBackdrop(pfBrowser.input, nil, true)
|
local a = 1
local b = 2
local sum = 0
while a < 4000000 do
if math.fmod(a, 2) == 0 then
sum = sum + a
end
local c = a
a = b
b = b + c
end
io.write(string.format("%d\n", sum))
|
-- Auto Infinite Research Soft Module
-- https://mods.factorio.com/mod/MegabaseAutoResearch
-- Automatically research robot worker speed and mining productivity research for ease of megabase researching.
-- The research to be chosen is based on cheapest total cumulative cost.
-- Uses locale __modulename__.cfg
-- @usage require('modules/common/auto-infinite-research')
-- ------------------------------------------------------- --
-- @author can00336 (https://mods.factorio.com/user/can00336)
-- @author Denis Zholob (DDDGamer)
-- github: https://github.com/deniszholob/factorio-softmod-pack
-- ======================================================= --
-- Dependencies --
-- ======================================================= --
local mod_gui = require("mod-gui") -- From `Factorio\data\core\lualib`
local GUI = require("stdlib/GUI")
local Colors = require("util/Colors")
-- Constants --
-- ======================================================= --
local MENU_BTN_NAME = 'btn_menu_auto-infinite-research'
local MASTER_FRAME_NAME = 'frame_auto-infinite-research'
-- Event Functions --
-- ======================================================= --
-- When new player joins add a btn to their button_flow
-- Redraw this softmod's frame
-- @param event on_player_joined_game
function on_player_joined(event)
local player = game.players[event.player_index]
draw_menu_btn(player)
-- draw_master_frame(player) -- dont draw yet, when btn clicked instead
end
-- When a player leaves clean up their GUI in case this mod gets removed next time
-- @param event on_player_left_game
function on_player_left_game(event)
local player = game.players[event.player_index]
GUI.destroy_element(mod_gui.get_button_flow(player)[MENU_BTN_NAME])
GUI.destroy_element(mod_gui.get_frame_flow(player)[MASTER_FRAME_NAME])
end
-- Toggle gameinfo is called if gui element is gameinfo button
-- @param event on_gui_click
local function on_gui_click(event)
local player = game.players[event.player_index]
local el_name = event.element.name
if el_name == MENU_BTN_NAME then
-- Call toggle if frame has been created
if(mod_gui.get_frame_flow(player)[MASTER_FRAME_NAME] ~= nil) then
GUI.toggle_element(mod_gui.get_frame_flow(player)[MASTER_FRAME_NAME])
else -- Call create if it hasnt
draw_gameinfo_frame(player)
end
end
end
-- @param event on_research_finished
local function on_research_finished(event)
local research = event.research
local force = research.force
local techs = force.technologies
local wrs = techs["worker-robots-speed-6"].level
local mp = techs["mining-productivity-16"].level
local wrs_costs = 2^(wrs - 5) * 1000 + 50
local mp_costs = 50 * (mp^2 - mp - 210) + 12000
if mp_costs <= wrs_costs then
force.current_research = "mining-productivity-16"
else
force.current_research = "worker-robots-speed-6"
end
end
-- Event Registration --
-- ======================================================= --
Event.register(defines.events.on_player_joined_game, on_player_joined)
Event.register(defines.events.on_player_left_game, on_player_left_game)
-- Event.register(defines.events.on_research_finished, on_research_finished)
-- Helper Functions --
-- ======================================================= --
--
-- @tparam LuaPlayer player
function draw_menu_btn(player)
if mod_gui.get_button_flow(player)[MENU_BTN_NAME] == nil then
mod_gui.get_button_flow(player).add(
{
type = "sprite-button",
name = MENU_BTN_NAME,
sprite = "item/space-science-pack",
-- caption = 'Auto Infinite Research',
tooltip = "Auto Infinite Research Settings"
}
)
end
end
--
-- @tparam LuaPlayer player
function draw_master_frame(player)
-- game.print(serpent.block(infinite_research_list))
local master_frame = mod_gui.get_frame_flow(player)[MASTER_FRAME_NAME];
-- Draw the vertical frame on the left if its not drawn already
if master_frame == nil then
master_frame = mod_gui.get_frame_flow(player).add({type = "frame", name = MASTER_FRAME_NAME, direction = "vertical"})
end
-- Clear and repopulate infinite research list
GUI.clear_element(master_frame)
for _, tech in pairs(infinite_research_list) do
master_frame.add(
{
type = labe
}
)
end
end
--
function canResearch(force, tech, config)
if not tech or tech.researched or not tech.enabled then
return false
end
for _, pretech in pairs(tech.prerequisites) do
if not pretech.researched then
return false
end
end
-- if(config) then
-- for _, ingredient in pairs(tech.research_unit_ingredients) do
-- if not config.allowed_ingredients[ingredient.name] then
-- return false
-- end
-- end
-- end
return true
end
-- @treturn LuaTechnology[] infinite_research_list List of technologies that can be infinite with space science
function get_infinite_research()
local infinite_research_list = {}
for _, tech in pairs(player.force.technologies) do
if tech.research_unit_count_formula then -- Infinite tech
local ingredients = tech.research_unit_ingredients
for _, ingredient in pairs(ingredients) do -- Contains space science
if(ingredient.name == 'space-science-pack') then
infinite_research_list[#infinite_research_list+1] = tech
end
end
end
end
return infinite_research_list
end
--
function get_config()
if not global.auto_infinite_research_config then
global.auto_infinite_research_config = {}
end
if not global.auto_research_config[force.name] then
global.auto_research_config[force.name] = {}
end
end
|
require("rrpg.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
function newfrmMain()
__o_rrpgObjs.beginObjectsLoading();
local obj = gui.fromHandle(_obj_newObject("form"));
local self = obj;
local sheet = nil;
rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject"));
function obj:setNodeObject(nodeObject)
sheet = nodeObject;
self.sheet = nodeObject;
self:_oldSetNodeObjectFunction(nodeObject);
end;
function obj:setNodeDatabase(nodeObject)
self:setNodeObject(nodeObject);
end;
_gui_assignInitialParentForForm(obj.handle);
obj:beginUpdate();
obj:setName("frmMain");
obj:setFormType("sheetTemplate");
obj:setDataType("Ambesek.Nefertyne.Cyberpunk2020");
obj:setTitle("Ficha Cyberpunk 2020");
obj:setAlign("client");
obj:setTheme("dark");
function priceCount()
if sheet==nil then return end;
local price = 0;
local objetos = ndb.getChildNodes(sheet.inventoryList);
local custo = 0;
for i=1, #objetos, 1 do
custo = custo + (tonumber(objetos[i].preco) or 0);
end;
price = price + custo;
local objetos = ndb.getChildNodes(sheet.weaponList);
local custo = 0;
for i=1, #objetos, 1 do
custo = custo + (tonumber(objetos[i].preco) or 0);
end;
price = price + custo;
local objetos = ndb.getChildNodes(sheet.armorList);
local custo = 0;
for i=1, #objetos, 1 do
custo = custo + (tonumber(objetos[i].preco) or 0);
end;
price = price + custo;
sheet.precoGastos = price;
showMessage(price);
end;
obj.tabControl1 = gui.fromHandle(_obj_newObject("tabControl"));
obj.tabControl1:setParent(obj);
obj.tabControl1:setAlign("client");
obj.tabControl1:setName("tabControl1");
obj.tab1 = gui.fromHandle(_obj_newObject("tab"));
obj.tab1:setParent(obj.tabControl1);
obj.tab1:setTitle("Geral");
obj.tab1:setName("tab1");
obj.frmGeneral = gui.fromHandle(_obj_newObject("form"));
obj.frmGeneral:setParent(obj.tab1);
obj.frmGeneral:setName("frmGeneral");
obj.frmGeneral:setAlign("client");
obj.scrollBox1 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox1:setParent(obj.frmGeneral);
obj.scrollBox1:setAlign("client");
obj.scrollBox1:setName("scrollBox1");
obj.rectangle1 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle1:setParent(obj.scrollBox1);
obj.rectangle1:setColor("#FF000000");
obj.rectangle1:setWidth(1363);
obj.rectangle1:setHeight(686);
obj.rectangle1:setName("rectangle1");
obj.layout1 = gui.fromHandle(_obj_newObject("layout"));
obj.layout1:setParent(obj.scrollBox1);
obj.layout1:setWidth(1010);
obj.layout1:setHeight(60);
obj.layout1:setName("layout1");
obj.rectangle2 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle2:setParent(obj.layout1);
obj.rectangle2:setAlign("client");
obj.rectangle2:setColor("black");
obj.rectangle2:setName("rectangle2");
obj.label1 = gui.fromHandle(_obj_newObject("label"));
obj.label1:setParent(obj.layout1);
obj.label1:setLeft(5);
obj.label1:setTop(5);
obj.label1:setWidth(90);
obj.label1:setHeight(20);
obj.label1:setText("NOME");
obj.label1:setHorzTextAlign("center");
obj.label1:setName("label1");
obj.edit1 = gui.fromHandle(_obj_newObject("edit"));
obj.edit1:setParent(obj.layout1);
obj.edit1:setLeft(100);
obj.edit1:setTop(5);
obj.edit1:setWidth(300);
obj.edit1:setHeight(25);
obj.edit1:setField("nome");
obj.edit1:setVertTextAlign("center");
obj.edit1:setName("edit1");
obj.label2 = gui.fromHandle(_obj_newObject("label"));
obj.label2:setParent(obj.layout1);
obj.label2:setLeft(5);
obj.label2:setTop(30);
obj.label2:setWidth(90);
obj.label2:setHeight(20);
obj.label2:setText("ETNIA/RAÇA");
obj.label2:setHorzTextAlign("center");
obj.label2:setName("label2");
obj.edit2 = gui.fromHandle(_obj_newObject("edit"));
obj.edit2:setParent(obj.layout1);
obj.edit2:setLeft(100);
obj.edit2:setTop(30);
obj.edit2:setWidth(300);
obj.edit2:setHeight(25);
obj.edit2:setField("raca");
obj.edit2:setVertTextAlign("center");
obj.edit2:setName("edit2");
obj.label3 = gui.fromHandle(_obj_newObject("label"));
obj.label3:setParent(obj.layout1);
obj.label3:setLeft(405);
obj.label3:setTop(5);
obj.label3:setWidth(90);
obj.label3:setHeight(20);
obj.label3:setText("DETALHES");
obj.label3:setHorzTextAlign("center");
obj.label3:setName("label3");
obj.edit3 = gui.fromHandle(_obj_newObject("edit"));
obj.edit3:setParent(obj.layout1);
obj.edit3:setLeft(500);
obj.edit3:setTop(5);
obj.edit3:setWidth(300);
obj.edit3:setHeight(25);
obj.edit3:setField("detalhes");
obj.edit3:setVertTextAlign("center");
obj.edit3:setName("edit3");
obj.label4 = gui.fromHandle(_obj_newObject("label"));
obj.label4:setParent(obj.layout1);
obj.label4:setLeft(405);
obj.label4:setTop(30);
obj.label4:setWidth(90);
obj.label4:setHeight(20);
obj.label4:setText("CLASSE");
obj.label4:setHorzTextAlign("center");
obj.label4:setName("label4");
obj.edit4 = gui.fromHandle(_obj_newObject("edit"));
obj.edit4:setParent(obj.layout1);
obj.edit4:setLeft(500);
obj.edit4:setTop(30);
obj.edit4:setWidth(300);
obj.edit4:setHeight(25);
obj.edit4:setField("classe");
obj.edit4:setVertTextAlign("center");
obj.edit4:setName("edit4");
obj.label5 = gui.fromHandle(_obj_newObject("label"));
obj.label5:setParent(obj.layout1);
obj.label5:setLeft(805);
obj.label5:setTop(17);
obj.label5:setWidth(90);
obj.label5:setHeight(20);
obj.label5:setText("PONTOS");
obj.label5:setHorzTextAlign("center");
obj.label5:setName("label5");
obj.edit5 = gui.fromHandle(_obj_newObject("edit"));
obj.edit5:setParent(obj.layout1);
obj.edit5:setLeft(900);
obj.edit5:setTop(15);
obj.edit5:setWidth(100);
obj.edit5:setHeight(30);
obj.edit5:setField("pontos");
obj.edit5:setVertTextAlign("center");
obj.edit5:setName("edit5");
obj.layout2 = gui.fromHandle(_obj_newObject("layout"));
obj.layout2:setParent(obj.scrollBox1);
obj.layout2:setTop(70);
obj.layout2:setWidth(610);
obj.layout2:setHeight(110);
obj.layout2:setName("layout2");
obj.rectangle3 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle3:setParent(obj.layout2);
obj.rectangle3:setAlign("client");
obj.rectangle3:setColor("black");
obj.rectangle3:setName("rectangle3");
obj.label6 = gui.fromHandle(_obj_newObject("label"));
obj.label6:setParent(obj.layout2);
obj.label6:setLeft(0);
obj.label6:setTop(5);
obj.label6:setWidth(610);
obj.label6:setHeight(20);
obj.label6:setText("ATRIBUTOS");
obj.label6:setHorzTextAlign("center");
obj.label6:setName("label6");
obj.label7 = gui.fromHandle(_obj_newObject("label"));
obj.label7:setParent(obj.layout2);
obj.label7:setLeft(5);
obj.label7:setTop(30);
obj.label7:setWidth(100);
obj.label7:setHeight(20);
obj.label7:setText("INTELIGÊNCIA");
obj.label7:setHorzTextAlign("center");
obj.label7:setName("label7");
obj.edit6 = gui.fromHandle(_obj_newObject("edit"));
obj.edit6:setParent(obj.layout2);
obj.edit6:setLeft(105);
obj.edit6:setTop(30);
obj.edit6:setWidth(50);
obj.edit6:setHeight(25);
obj.edit6:setField("inteligencia");
obj.edit6:setVertTextAlign("center");
obj.edit6:setName("edit6");
obj.label8 = gui.fromHandle(_obj_newObject("label"));
obj.label8:setParent(obj.layout2);
obj.label8:setLeft(5);
obj.label8:setTop(55);
obj.label8:setWidth(100);
obj.label8:setHeight(20);
obj.label8:setText("ATRATIVIDADE");
obj.label8:setHorzTextAlign("center");
obj.label8:setName("label8");
obj.edit7 = gui.fromHandle(_obj_newObject("edit"));
obj.edit7:setParent(obj.layout2);
obj.edit7:setLeft(105);
obj.edit7:setTop(55);
obj.edit7:setWidth(50);
obj.edit7:setHeight(25);
obj.edit7:setField("atratividade");
obj.edit7:setVertTextAlign("center");
obj.edit7:setName("edit7");
obj.label9 = gui.fromHandle(_obj_newObject("label"));
obj.label9:setParent(obj.layout2);
obj.label9:setLeft(5);
obj.label9:setTop(80);
obj.label9:setWidth(100);
obj.label9:setHeight(20);
obj.label9:setText("EMPATIA");
obj.label9:setHorzTextAlign("center");
obj.label9:setName("label9");
obj.edit8 = gui.fromHandle(_obj_newObject("edit"));
obj.edit8:setParent(obj.layout2);
obj.edit8:setLeft(105);
obj.edit8:setTop(80);
obj.edit8:setWidth(50);
obj.edit8:setHeight(25);
obj.edit8:setField("empatia");
obj.edit8:setVertTextAlign("center");
obj.edit8:setName("edit8");
obj.label10 = gui.fromHandle(_obj_newObject("label"));
obj.label10:setParent(obj.layout2);
obj.label10:setLeft(155);
obj.label10:setTop(30);
obj.label10:setWidth(100);
obj.label10:setHeight(20);
obj.label10:setText("REFLEXOS");
obj.label10:setHorzTextAlign("center");
obj.label10:setName("label10");
obj.edit9 = gui.fromHandle(_obj_newObject("edit"));
obj.edit9:setParent(obj.layout2);
obj.edit9:setLeft(255);
obj.edit9:setTop(30);
obj.edit9:setWidth(50);
obj.edit9:setHeight(25);
obj.edit9:setField("reflexos");
obj.edit9:setVertTextAlign("center");
obj.edit9:setName("edit9");
obj.label11 = gui.fromHandle(_obj_newObject("label"));
obj.label11:setParent(obj.layout2);
obj.label11:setLeft(155);
obj.label11:setTop(55);
obj.label11:setWidth(100);
obj.label11:setHeight(20);
obj.label11:setText("SORTE");
obj.label11:setHorzTextAlign("center");
obj.label11:setName("label11");
obj.edit10 = gui.fromHandle(_obj_newObject("edit"));
obj.edit10:setParent(obj.layout2);
obj.edit10:setLeft(255);
obj.edit10:setTop(55);
obj.edit10:setWidth(50);
obj.edit10:setHeight(25);
obj.edit10:setField("sorte");
obj.edit10:setVertTextAlign("center");
obj.edit10:setName("edit10");
obj.label12 = gui.fromHandle(_obj_newObject("label"));
obj.label12:setParent(obj.layout2);
obj.label12:setLeft(155);
obj.label12:setTop(80);
obj.label12:setWidth(100);
obj.label12:setHeight(20);
obj.label12:setText("CORRER");
obj.label12:setHorzTextAlign("center");
obj.label12:setName("label12");
obj.rectangle4 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle4:setParent(obj.layout2);
obj.rectangle4:setLeft(255);
obj.rectangle4:setTop(80);
obj.rectangle4:setWidth(50);
obj.rectangle4:setHeight(25);
obj.rectangle4:setColor("black");
obj.rectangle4:setStrokeColor("white");
obj.rectangle4:setStrokeSize(1);
obj.rectangle4:setName("rectangle4");
obj.label13 = gui.fromHandle(_obj_newObject("label"));
obj.label13:setParent(obj.layout2);
obj.label13:setLeft(255);
obj.label13:setTop(80);
obj.label13:setWidth(50);
obj.label13:setHeight(25);
obj.label13:setField("correr");
obj.label13:setVertTextAlign("center");
obj.label13:setHorzTextAlign("center");
obj.label13:setName("label13");
obj.label14 = gui.fromHandle(_obj_newObject("label"));
obj.label14:setParent(obj.layout2);
obj.label14:setLeft(305);
obj.label14:setTop(30);
obj.label14:setWidth(100);
obj.label14:setHeight(20);
obj.label14:setText("TECNICA");
obj.label14:setHorzTextAlign("center");
obj.label14:setName("label14");
obj.edit11 = gui.fromHandle(_obj_newObject("edit"));
obj.edit11:setParent(obj.layout2);
obj.edit11:setLeft(405);
obj.edit11:setTop(30);
obj.edit11:setWidth(50);
obj.edit11:setHeight(25);
obj.edit11:setField("tecnica");
obj.edit11:setVertTextAlign("center");
obj.edit11:setName("edit11");
obj.label15 = gui.fromHandle(_obj_newObject("label"));
obj.label15:setParent(obj.layout2);
obj.label15:setLeft(305);
obj.label15:setTop(55);
obj.label15:setWidth(100);
obj.label15:setHeight(20);
obj.label15:setText("MOVIMENTO");
obj.label15:setHorzTextAlign("center");
obj.label15:setName("label15");
obj.edit12 = gui.fromHandle(_obj_newObject("edit"));
obj.edit12:setParent(obj.layout2);
obj.edit12:setLeft(405);
obj.edit12:setTop(55);
obj.edit12:setWidth(50);
obj.edit12:setHeight(25);
obj.edit12:setField("movimento");
obj.edit12:setVertTextAlign("center");
obj.edit12:setName("edit12");
obj.label16 = gui.fromHandle(_obj_newObject("label"));
obj.label16:setParent(obj.layout2);
obj.label16:setLeft(305);
obj.label16:setTop(80);
obj.label16:setWidth(100);
obj.label16:setHeight(20);
obj.label16:setText("SALTAR");
obj.label16:setHorzTextAlign("center");
obj.label16:setName("label16");
obj.rectangle5 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle5:setParent(obj.layout2);
obj.rectangle5:setLeft(405);
obj.rectangle5:setTop(80);
obj.rectangle5:setWidth(50);
obj.rectangle5:setHeight(25);
obj.rectangle5:setColor("black");
obj.rectangle5:setStrokeColor("white");
obj.rectangle5:setStrokeSize(1);
obj.rectangle5:setName("rectangle5");
obj.label17 = gui.fromHandle(_obj_newObject("label"));
obj.label17:setParent(obj.layout2);
obj.label17:setLeft(405);
obj.label17:setTop(80);
obj.label17:setWidth(50);
obj.label17:setHeight(25);
obj.label17:setField("saltar");
obj.label17:setVertTextAlign("center");
obj.label17:setHorzTextAlign("center");
obj.label17:setName("label17");
obj.label18 = gui.fromHandle(_obj_newObject("label"));
obj.label18:setParent(obj.layout2);
obj.label18:setLeft(455);
obj.label18:setTop(30);
obj.label18:setWidth(100);
obj.label18:setHeight(20);
obj.label18:setText("AUTOCONTROLE");
obj.label18:setHorzTextAlign("center");
obj.label18:setName("label18");
obj.edit13 = gui.fromHandle(_obj_newObject("edit"));
obj.edit13:setParent(obj.layout2);
obj.edit13:setLeft(555);
obj.edit13:setTop(30);
obj.edit13:setWidth(50);
obj.edit13:setHeight(25);
obj.edit13:setField("autocontrole");
obj.edit13:setVertTextAlign("center");
obj.edit13:setName("edit13");
obj.label19 = gui.fromHandle(_obj_newObject("label"));
obj.label19:setParent(obj.layout2);
obj.label19:setLeft(455);
obj.label19:setTop(55);
obj.label19:setWidth(100);
obj.label19:setHeight(20);
obj.label19:setText("TIPO CORPORAL");
obj.label19:setHorzTextAlign("center");
obj.label19:setName("label19");
obj.edit14 = gui.fromHandle(_obj_newObject("edit"));
obj.edit14:setParent(obj.layout2);
obj.edit14:setLeft(555);
obj.edit14:setTop(55);
obj.edit14:setWidth(50);
obj.edit14:setHeight(25);
obj.edit14:setField("tipoCorporal");
obj.edit14:setVertTextAlign("center");
obj.edit14:setName("edit14");
obj.label20 = gui.fromHandle(_obj_newObject("label"));
obj.label20:setParent(obj.layout2);
obj.label20:setLeft(455);
obj.label20:setTop(80);
obj.label20:setWidth(100);
obj.label20:setHeight(20);
obj.label20:setText("LEVANTAR");
obj.label20:setHorzTextAlign("center");
obj.label20:setName("label20");
obj.rectangle6 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle6:setParent(obj.layout2);
obj.rectangle6:setLeft(555);
obj.rectangle6:setTop(80);
obj.rectangle6:setWidth(50);
obj.rectangle6:setHeight(25);
obj.rectangle6:setColor("black");
obj.rectangle6:setStrokeColor("white");
obj.rectangle6:setStrokeSize(1);
obj.rectangle6:setName("rectangle6");
obj.label21 = gui.fromHandle(_obj_newObject("label"));
obj.label21:setParent(obj.layout2);
obj.label21:setLeft(555);
obj.label21:setTop(80);
obj.label21:setWidth(50);
obj.label21:setHeight(25);
obj.label21:setField("levantar");
obj.label21:setVertTextAlign("center");
obj.label21:setHorzTextAlign("center");
obj.label21:setName("label21");
obj.dataLink1 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink1:setParent(obj.layout2);
obj.dataLink1:setField("empatia");
obj.dataLink1:setName("dataLink1");
obj.dataLink2 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink2:setParent(obj.layout2);
obj.dataLink2:setField("movimento");
obj.dataLink2:setName("dataLink2");
obj.dataLink3 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink3:setParent(obj.layout2);
obj.dataLink3:setField("tipoCorporal");
obj.dataLink3:setName("dataLink3");
obj.rectangle7 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle7:setParent(obj.scrollBox1);
obj.rectangle7:setLeft(620);
obj.rectangle7:setTop(70);
obj.rectangle7:setWidth(250);
obj.rectangle7:setHeight(250);
obj.rectangle7:setColor("black");
obj.rectangle7:setStrokeColor("white");
obj.rectangle7:setStrokeSize(1);
obj.rectangle7:setName("rectangle7");
obj.label22 = gui.fromHandle(_obj_newObject("label"));
obj.label22:setParent(obj.rectangle7);
obj.label22:setLeft(0);
obj.label22:setTop(40);
obj.label22:setWidth(250);
obj.label22:setHeight(20);
obj.label22:setText("Avatar");
obj.label22:setHorzTextAlign("center");
obj.label22:setName("label22");
obj.image1 = gui.fromHandle(_obj_newObject("image"));
obj.image1:setParent(obj.rectangle7);
obj.image1:setAlign("client");
obj.image1:setField("avatar");
obj.image1:setEditable(true);
obj.image1:setStyle("autoFit");
obj.image1:setMargins({left=2, right=2, top=2, bottom=2});
obj.image1:setName("image1");
obj.layout3 = gui.fromHandle(_obj_newObject("layout"));
obj.layout3:setParent(obj.scrollBox1);
obj.layout3:setTop(190);
obj.layout3:setWidth(535);
obj.layout3:setHeight(85);
obj.layout3:setName("layout3");
obj.rectangle8 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle8:setParent(obj.layout3);
obj.rectangle8:setAlign("client");
obj.rectangle8:setColor("black");
obj.rectangle8:setName("rectangle8");
obj.label23 = gui.fromHandle(_obj_newObject("label"));
obj.label23:setParent(obj.layout3);
obj.label23:setLeft(0);
obj.label23:setTop(5);
obj.label23:setWidth(535);
obj.label23:setHeight(20);
obj.label23:setText("BLINDAGEM");
obj.label23:setHorzTextAlign("center");
obj.label23:setName("label23");
obj.label24 = gui.fromHandle(_obj_newObject("label"));
obj.label24:setParent(obj.layout3);
obj.label24:setLeft(5);
obj.label24:setTop(30);
obj.label24:setWidth(75);
obj.label24:setHeight(20);
obj.label24:setText("Localização");
obj.label24:setHorzTextAlign("center");
obj.label24:setName("label24");
obj.label25 = gui.fromHandle(_obj_newObject("label"));
obj.label25:setParent(obj.layout3);
obj.label25:setLeft(5);
obj.label25:setTop(55);
obj.label25:setWidth(75);
obj.label25:setHeight(20);
obj.label25:setText("Blindagem PB");
obj.label25:setHorzTextAlign("center");
obj.label25:setFontSize(12);
obj.label25:setName("label25");
obj.label26 = gui.fromHandle(_obj_newObject("label"));
obj.label26:setParent(obj.layout3);
obj.label26:setLeft(80);
obj.label26:setTop(30);
obj.label26:setWidth(75);
obj.label26:setHeight(20);
obj.label26:setText("Cabeça 1");
obj.label26:setHorzTextAlign("center");
obj.label26:setName("label26");
obj.rectangle9 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle9:setParent(obj.layout3);
obj.rectangle9:setLeft(80);
obj.rectangle9:setTop(55);
obj.rectangle9:setWidth(75);
obj.rectangle9:setHeight(25);
obj.rectangle9:setColor("black");
obj.rectangle9:setStrokeColor("white");
obj.rectangle9:setStrokeSize(1);
obj.rectangle9:setName("rectangle9");
obj.label27 = gui.fromHandle(_obj_newObject("label"));
obj.label27:setParent(obj.layout3);
obj.label27:setLeft(80);
obj.label27:setTop(55);
obj.label27:setWidth(75);
obj.label27:setHeight(25);
obj.label27:setField("blindagemCabeca");
obj.label27:setHorzTextAlign("center");
obj.label27:setVertTextAlign("center");
obj.label27:setName("label27");
obj.label28 = gui.fromHandle(_obj_newObject("label"));
obj.label28:setParent(obj.layout3);
obj.label28:setLeft(155);
obj.label28:setTop(30);
obj.label28:setWidth(75);
obj.label28:setHeight(20);
obj.label28:setText("Torso 2-4");
obj.label28:setHorzTextAlign("center");
obj.label28:setName("label28");
obj.rectangle10 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle10:setParent(obj.layout3);
obj.rectangle10:setLeft(155);
obj.rectangle10:setTop(55);
obj.rectangle10:setWidth(75);
obj.rectangle10:setHeight(25);
obj.rectangle10:setColor("black");
obj.rectangle10:setStrokeColor("white");
obj.rectangle10:setStrokeSize(1);
obj.rectangle10:setName("rectangle10");
obj.label29 = gui.fromHandle(_obj_newObject("label"));
obj.label29:setParent(obj.layout3);
obj.label29:setLeft(155);
obj.label29:setTop(55);
obj.label29:setWidth(75);
obj.label29:setHeight(25);
obj.label29:setField("blindagemTorso");
obj.label29:setHorzTextAlign("center");
obj.label29:setVertTextAlign("center");
obj.label29:setName("label29");
obj.label30 = gui.fromHandle(_obj_newObject("label"));
obj.label30:setParent(obj.layout3);
obj.label30:setLeft(230);
obj.label30:setTop(30);
obj.label30:setWidth(75);
obj.label30:setHeight(20);
obj.label30:setText("Braço D. 5");
obj.label30:setHorzTextAlign("center");
obj.label30:setName("label30");
obj.rectangle11 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle11:setParent(obj.layout3);
obj.rectangle11:setLeft(230);
obj.rectangle11:setTop(55);
obj.rectangle11:setWidth(75);
obj.rectangle11:setHeight(25);
obj.rectangle11:setColor("black");
obj.rectangle11:setStrokeColor("white");
obj.rectangle11:setStrokeSize(1);
obj.rectangle11:setName("rectangle11");
obj.label31 = gui.fromHandle(_obj_newObject("label"));
obj.label31:setParent(obj.layout3);
obj.label31:setLeft(230);
obj.label31:setTop(55);
obj.label31:setWidth(75);
obj.label31:setHeight(25);
obj.label31:setField("blindagemBracoDireito");
obj.label31:setHorzTextAlign("center");
obj.label31:setVertTextAlign("center");
obj.label31:setName("label31");
obj.label32 = gui.fromHandle(_obj_newObject("label"));
obj.label32:setParent(obj.layout3);
obj.label32:setLeft(305);
obj.label32:setTop(30);
obj.label32:setWidth(75);
obj.label32:setHeight(20);
obj.label32:setText("Braço E. 6");
obj.label32:setHorzTextAlign("center");
obj.label32:setName("label32");
obj.rectangle12 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle12:setParent(obj.layout3);
obj.rectangle12:setLeft(305);
obj.rectangle12:setTop(55);
obj.rectangle12:setWidth(75);
obj.rectangle12:setHeight(25);
obj.rectangle12:setColor("black");
obj.rectangle12:setStrokeColor("white");
obj.rectangle12:setStrokeSize(1);
obj.rectangle12:setName("rectangle12");
obj.label33 = gui.fromHandle(_obj_newObject("label"));
obj.label33:setParent(obj.layout3);
obj.label33:setLeft(305);
obj.label33:setTop(55);
obj.label33:setWidth(75);
obj.label33:setHeight(25);
obj.label33:setField("blindagemBracoEsquerdo");
obj.label33:setHorzTextAlign("center");
obj.label33:setVertTextAlign("center");
obj.label33:setName("label33");
obj.label34 = gui.fromHandle(_obj_newObject("label"));
obj.label34:setParent(obj.layout3);
obj.label34:setLeft(380);
obj.label34:setTop(30);
obj.label34:setWidth(75);
obj.label34:setHeight(20);
obj.label34:setText("Perna D. 7-8");
obj.label34:setHorzTextAlign("center");
obj.label34:setName("label34");
obj.rectangle13 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle13:setParent(obj.layout3);
obj.rectangle13:setLeft(380);
obj.rectangle13:setTop(55);
obj.rectangle13:setWidth(75);
obj.rectangle13:setHeight(25);
obj.rectangle13:setColor("black");
obj.rectangle13:setStrokeColor("white");
obj.rectangle13:setStrokeSize(1);
obj.rectangle13:setName("rectangle13");
obj.label35 = gui.fromHandle(_obj_newObject("label"));
obj.label35:setParent(obj.layout3);
obj.label35:setLeft(380);
obj.label35:setTop(55);
obj.label35:setWidth(75);
obj.label35:setHeight(25);
obj.label35:setField("blindagemPernaDireita");
obj.label35:setHorzTextAlign("center");
obj.label35:setVertTextAlign("center");
obj.label35:setName("label35");
obj.label36 = gui.fromHandle(_obj_newObject("label"));
obj.label36:setParent(obj.layout3);
obj.label36:setLeft(455);
obj.label36:setTop(30);
obj.label36:setWidth(75);
obj.label36:setHeight(20);
obj.label36:setText("Perna E. 9-0");
obj.label36:setHorzTextAlign("center");
obj.label36:setName("label36");
obj.rectangle14 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle14:setParent(obj.layout3);
obj.rectangle14:setLeft(455);
obj.rectangle14:setTop(55);
obj.rectangle14:setWidth(75);
obj.rectangle14:setHeight(25);
obj.rectangle14:setColor("black");
obj.rectangle14:setStrokeColor("white");
obj.rectangle14:setStrokeSize(1);
obj.rectangle14:setName("rectangle14");
obj.label37 = gui.fromHandle(_obj_newObject("label"));
obj.label37:setParent(obj.layout3);
obj.label37:setLeft(455);
obj.label37:setTop(55);
obj.label37:setWidth(75);
obj.label37:setHeight(25);
obj.label37:setField("blindagemPernaEsquerda");
obj.label37:setHorzTextAlign("center");
obj.label37:setVertTextAlign("center");
obj.label37:setName("label37");
obj.layout4 = gui.fromHandle(_obj_newObject("layout"));
obj.layout4:setParent(obj.scrollBox1);
obj.layout4:setTop(285);
obj.layout4:setWidth(535);
obj.layout4:setHeight(185);
obj.layout4:setName("layout4");
obj.rectangle15 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle15:setParent(obj.layout4);
obj.rectangle15:setAlign("client");
obj.rectangle15:setColor("black");
obj.rectangle15:setName("rectangle15");
obj.label38 = gui.fromHandle(_obj_newObject("label"));
obj.label38:setParent(obj.layout4);
obj.label38:setLeft(0);
obj.label38:setTop(5);
obj.label38:setWidth(535);
obj.label38:setHeight(20);
obj.label38:setText("DANO");
obj.label38:setHorzTextAlign("center");
obj.label38:setName("label38");
obj.label39 = gui.fromHandle(_obj_newObject("label"));
obj.label39:setParent(obj.layout4);
obj.label39:setLeft(5);
obj.label39:setTop(30);
obj.label39:setWidth(75);
obj.label39:setHeight(20);
obj.label39:setText("VIT");
obj.label39:setHorzTextAlign("center");
obj.label39:setName("label39");
obj.rectangle16 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle16:setParent(obj.layout4);
obj.rectangle16:setLeft(5);
obj.rectangle16:setTop(55);
obj.rectangle16:setWidth(75);
obj.rectangle16:setHeight(125);
obj.rectangle16:setColor("black");
obj.rectangle16:setStrokeColor("white");
obj.rectangle16:setStrokeSize(1);
obj.rectangle16:setName("rectangle16");
obj.label40 = gui.fromHandle(_obj_newObject("label"));
obj.label40:setParent(obj.layout4);
obj.label40:setLeft(5);
obj.label40:setTop(55);
obj.label40:setWidth(75);
obj.label40:setHeight(125);
obj.label40:setField("vit");
obj.label40:setHorzTextAlign("center");
obj.label40:setVertTextAlign("center");
obj.label40:setName("label40");
obj.label41 = gui.fromHandle(_obj_newObject("label"));
obj.label41:setParent(obj.layout4);
obj.label41:setLeft(80);
obj.label41:setTop(30);
obj.label41:setWidth(75);
obj.label41:setHeight(20);
obj.label41:setText("MTC");
obj.label41:setHorzTextAlign("center");
obj.label41:setName("label41");
obj.rectangle17 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle17:setParent(obj.layout4);
obj.rectangle17:setLeft(80);
obj.rectangle17:setTop(55);
obj.rectangle17:setWidth(75);
obj.rectangle17:setHeight(125);
obj.rectangle17:setColor("black");
obj.rectangle17:setStrokeColor("white");
obj.rectangle17:setStrokeSize(1);
obj.rectangle17:setName("rectangle17");
obj.label42 = gui.fromHandle(_obj_newObject("label"));
obj.label42:setParent(obj.layout4);
obj.label42:setLeft(80);
obj.label42:setTop(55);
obj.label42:setWidth(75);
obj.label42:setHeight(125);
obj.label42:setField("mtc");
obj.label42:setHorzTextAlign("center");
obj.label42:setVertTextAlign("center");
obj.label42:setName("label42");
obj.layout5 = gui.fromHandle(_obj_newObject("layout"));
obj.layout5:setParent(obj.layout4);
obj.layout5:setTop(25);
obj.layout5:setWidth(535);
obj.layout5:setHeight(75);
obj.layout5:setName("layout5");
obj.label43 = gui.fromHandle(_obj_newObject("label"));
obj.label43:setParent(obj.layout5);
obj.label43:setLeft(155);
obj.label43:setTop(5);
obj.label43:setWidth(75);
obj.label43:setHeight(20);
obj.label43:setText("Leve");
obj.label43:setHorzTextAlign("center");
obj.label43:setName("label43");
obj.edit15 = gui.fromHandle(_obj_newObject("edit"));
obj.edit15:setParent(obj.layout5);
obj.edit15:setLeft(155);
obj.edit15:setTop(30);
obj.edit15:setWidth(75);
obj.edit15:setHeight(25);
obj.edit15:setField("dano0");
obj.edit15:setVertTextAlign("center");
obj.edit15:setName("edit15");
obj.label44 = gui.fromHandle(_obj_newObject("label"));
obj.label44:setParent(obj.layout5);
obj.label44:setLeft(155);
obj.label44:setTop(55);
obj.label44:setWidth(75);
obj.label44:setHeight(20);
obj.label44:setText("Atordoamento 0");
obj.label44:setHorzTextAlign("center");
obj.label44:setFontSize(9);
obj.label44:setName("label44");
obj.label45 = gui.fromHandle(_obj_newObject("label"));
obj.label45:setParent(obj.layout5);
obj.label45:setLeft(230);
obj.label45:setTop(5);
obj.label45:setWidth(75);
obj.label45:setHeight(20);
obj.label45:setText("Grave");
obj.label45:setHorzTextAlign("center");
obj.label45:setName("label45");
obj.edit16 = gui.fromHandle(_obj_newObject("edit"));
obj.edit16:setParent(obj.layout5);
obj.edit16:setLeft(230);
obj.edit16:setTop(30);
obj.edit16:setWidth(75);
obj.edit16:setHeight(25);
obj.edit16:setField("dano1");
obj.edit16:setVertTextAlign("center");
obj.edit16:setName("edit16");
obj.label46 = gui.fromHandle(_obj_newObject("label"));
obj.label46:setParent(obj.layout5);
obj.label46:setLeft(230);
obj.label46:setTop(55);
obj.label46:setWidth(75);
obj.label46:setHeight(20);
obj.label46:setText("Atordoamento 1");
obj.label46:setHorzTextAlign("center");
obj.label46:setFontSize(9);
obj.label46:setName("label46");
obj.label47 = gui.fromHandle(_obj_newObject("label"));
obj.label47:setParent(obj.layout5);
obj.label47:setLeft(305);
obj.label47:setTop(5);
obj.label47:setWidth(75);
obj.label47:setHeight(20);
obj.label47:setText("Crítico");
obj.label47:setHorzTextAlign("center");
obj.label47:setName("label47");
obj.edit17 = gui.fromHandle(_obj_newObject("edit"));
obj.edit17:setParent(obj.layout5);
obj.edit17:setLeft(305);
obj.edit17:setTop(30);
obj.edit17:setWidth(75);
obj.edit17:setHeight(25);
obj.edit17:setField("dano2");
obj.edit17:setVertTextAlign("center");
obj.edit17:setName("edit17");
obj.label48 = gui.fromHandle(_obj_newObject("label"));
obj.label48:setParent(obj.layout5);
obj.label48:setLeft(305);
obj.label48:setTop(55);
obj.label48:setWidth(75);
obj.label48:setHeight(20);
obj.label48:setText("Atordoamento 2");
obj.label48:setHorzTextAlign("center");
obj.label48:setFontSize(9);
obj.label48:setName("label48");
obj.label49 = gui.fromHandle(_obj_newObject("label"));
obj.label49:setParent(obj.layout5);
obj.label49:setLeft(380);
obj.label49:setTop(5);
obj.label49:setWidth(75);
obj.label49:setHeight(20);
obj.label49:setText("Mortal 0");
obj.label49:setHorzTextAlign("center");
obj.label49:setName("label49");
obj.edit18 = gui.fromHandle(_obj_newObject("edit"));
obj.edit18:setParent(obj.layout5);
obj.edit18:setLeft(380);
obj.edit18:setTop(30);
obj.edit18:setWidth(75);
obj.edit18:setHeight(25);
obj.edit18:setField("dano3");
obj.edit18:setVertTextAlign("center");
obj.edit18:setName("edit18");
obj.label50 = gui.fromHandle(_obj_newObject("label"));
obj.label50:setParent(obj.layout5);
obj.label50:setLeft(380);
obj.label50:setTop(55);
obj.label50:setWidth(75);
obj.label50:setHeight(20);
obj.label50:setText("Atordoamento 3");
obj.label50:setHorzTextAlign("center");
obj.label50:setFontSize(9);
obj.label50:setName("label50");
obj.label51 = gui.fromHandle(_obj_newObject("label"));
obj.label51:setParent(obj.layout5);
obj.label51:setLeft(455);
obj.label51:setTop(5);
obj.label51:setWidth(75);
obj.label51:setHeight(20);
obj.label51:setText("Mortal -1");
obj.label51:setHorzTextAlign("center");
obj.label51:setName("label51");
obj.edit19 = gui.fromHandle(_obj_newObject("edit"));
obj.edit19:setParent(obj.layout5);
obj.edit19:setLeft(455);
obj.edit19:setTop(30);
obj.edit19:setWidth(75);
obj.edit19:setHeight(25);
obj.edit19:setField("dano4");
obj.edit19:setVertTextAlign("center");
obj.edit19:setName("edit19");
obj.label52 = gui.fromHandle(_obj_newObject("label"));
obj.label52:setParent(obj.layout5);
obj.label52:setLeft(455);
obj.label52:setTop(55);
obj.label52:setWidth(75);
obj.label52:setHeight(20);
obj.label52:setText("Atordoamento 4");
obj.label52:setHorzTextAlign("center");
obj.label52:setFontSize(9);
obj.label52:setName("label52");
obj.layout6 = gui.fromHandle(_obj_newObject("layout"));
obj.layout6:setParent(obj.layout4);
obj.layout6:setTop(100);
obj.layout6:setWidth(535);
obj.layout6:setHeight(75);
obj.layout6:setName("layout6");
obj.label53 = gui.fromHandle(_obj_newObject("label"));
obj.label53:setParent(obj.layout6);
obj.label53:setLeft(155);
obj.label53:setTop(5);
obj.label53:setWidth(75);
obj.label53:setHeight(20);
obj.label53:setText("Mortal -2");
obj.label53:setHorzTextAlign("center");
obj.label53:setName("label53");
obj.edit20 = gui.fromHandle(_obj_newObject("edit"));
obj.edit20:setParent(obj.layout6);
obj.edit20:setLeft(155);
obj.edit20:setTop(30);
obj.edit20:setWidth(75);
obj.edit20:setHeight(25);
obj.edit20:setField("dano5");
obj.edit20:setVertTextAlign("center");
obj.edit20:setName("edit20");
obj.label54 = gui.fromHandle(_obj_newObject("label"));
obj.label54:setParent(obj.layout6);
obj.label54:setLeft(155);
obj.label54:setTop(55);
obj.label54:setWidth(75);
obj.label54:setHeight(20);
obj.label54:setText("Atordoamento 5");
obj.label54:setHorzTextAlign("center");
obj.label54:setFontSize(9);
obj.label54:setName("label54");
obj.label55 = gui.fromHandle(_obj_newObject("label"));
obj.label55:setParent(obj.layout6);
obj.label55:setLeft(230);
obj.label55:setTop(5);
obj.label55:setWidth(75);
obj.label55:setHeight(20);
obj.label55:setText("Mortal -3");
obj.label55:setHorzTextAlign("center");
obj.label55:setName("label55");
obj.edit21 = gui.fromHandle(_obj_newObject("edit"));
obj.edit21:setParent(obj.layout6);
obj.edit21:setLeft(230);
obj.edit21:setTop(30);
obj.edit21:setWidth(75);
obj.edit21:setHeight(25);
obj.edit21:setField("dano6");
obj.edit21:setVertTextAlign("center");
obj.edit21:setName("edit21");
obj.label56 = gui.fromHandle(_obj_newObject("label"));
obj.label56:setParent(obj.layout6);
obj.label56:setLeft(230);
obj.label56:setTop(55);
obj.label56:setWidth(75);
obj.label56:setHeight(20);
obj.label56:setText("Atordoamento 6");
obj.label56:setHorzTextAlign("center");
obj.label56:setFontSize(9);
obj.label56:setName("label56");
obj.label57 = gui.fromHandle(_obj_newObject("label"));
obj.label57:setParent(obj.layout6);
obj.label57:setLeft(305);
obj.label57:setTop(5);
obj.label57:setWidth(75);
obj.label57:setHeight(20);
obj.label57:setText("Mortal -4");
obj.label57:setHorzTextAlign("center");
obj.label57:setName("label57");
obj.edit22 = gui.fromHandle(_obj_newObject("edit"));
obj.edit22:setParent(obj.layout6);
obj.edit22:setLeft(305);
obj.edit22:setTop(30);
obj.edit22:setWidth(75);
obj.edit22:setHeight(25);
obj.edit22:setField("dano7");
obj.edit22:setVertTextAlign("center");
obj.edit22:setName("edit22");
obj.label58 = gui.fromHandle(_obj_newObject("label"));
obj.label58:setParent(obj.layout6);
obj.label58:setLeft(305);
obj.label58:setTop(55);
obj.label58:setWidth(75);
obj.label58:setHeight(20);
obj.label58:setText("Atordoamento 7");
obj.label58:setHorzTextAlign("center");
obj.label58:setFontSize(9);
obj.label58:setName("label58");
obj.label59 = gui.fromHandle(_obj_newObject("label"));
obj.label59:setParent(obj.layout6);
obj.label59:setLeft(380);
obj.label59:setTop(5);
obj.label59:setWidth(75);
obj.label59:setHeight(20);
obj.label59:setText("Mortal -5");
obj.label59:setHorzTextAlign("center");
obj.label59:setName("label59");
obj.edit23 = gui.fromHandle(_obj_newObject("edit"));
obj.edit23:setParent(obj.layout6);
obj.edit23:setLeft(380);
obj.edit23:setTop(30);
obj.edit23:setWidth(75);
obj.edit23:setHeight(25);
obj.edit23:setField("dano8");
obj.edit23:setVertTextAlign("center");
obj.edit23:setName("edit23");
obj.label60 = gui.fromHandle(_obj_newObject("label"));
obj.label60:setParent(obj.layout6);
obj.label60:setLeft(380);
obj.label60:setTop(55);
obj.label60:setWidth(75);
obj.label60:setHeight(20);
obj.label60:setText("Atordoamento 8");
obj.label60:setHorzTextAlign("center");
obj.label60:setFontSize(9);
obj.label60:setName("label60");
obj.label61 = gui.fromHandle(_obj_newObject("label"));
obj.label61:setParent(obj.layout6);
obj.label61:setLeft(455);
obj.label61:setTop(5);
obj.label61:setWidth(75);
obj.label61:setHeight(20);
obj.label61:setText("Mortal -6");
obj.label61:setHorzTextAlign("center");
obj.label61:setName("label61");
obj.edit24 = gui.fromHandle(_obj_newObject("edit"));
obj.edit24:setParent(obj.layout6);
obj.edit24:setLeft(455);
obj.edit24:setTop(30);
obj.edit24:setWidth(75);
obj.edit24:setHeight(25);
obj.edit24:setField("dano9");
obj.edit24:setVertTextAlign("center");
obj.edit24:setName("edit24");
obj.label62 = gui.fromHandle(_obj_newObject("label"));
obj.label62:setParent(obj.layout6);
obj.label62:setLeft(455);
obj.label62:setTop(55);
obj.label62:setWidth(75);
obj.label62:setHeight(20);
obj.label62:setText("Atordoamento 9");
obj.label62:setHorzTextAlign("center");
obj.label62:setFontSize(9);
obj.label62:setName("label62");
obj.layout7 = gui.fromHandle(_obj_newObject("layout"));
obj.layout7:setParent(obj.scrollBox1);
obj.layout7:setTop(480);
obj.layout7:setWidth(535);
obj.layout7:setHeight(200);
obj.layout7:setName("layout7");
obj.rectangle18 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle18:setParent(obj.layout7);
obj.rectangle18:setAlign("client");
obj.rectangle18:setColor("black");
obj.rectangle18:setName("rectangle18");
obj.label63 = gui.fromHandle(_obj_newObject("label"));
obj.label63:setParent(obj.layout7);
obj.label63:setLeft(5);
obj.label63:setTop(5);
obj.label63:setWidth(260);
obj.label63:setHeight(20);
obj.label63:setText("REPUTAÇÃO");
obj.label63:setHorzTextAlign("center");
obj.label63:setName("label63");
obj.label64 = gui.fromHandle(_obj_newObject("label"));
obj.label64:setParent(obj.layout7);
obj.label64:setLeft(270);
obj.label64:setTop(5);
obj.label64:setWidth(260);
obj.label64:setHeight(20);
obj.label64:setText("EXPERIÊNCIA");
obj.label64:setHorzTextAlign("center");
obj.label64:setName("label64");
obj.textEditor1 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor1:setParent(obj.layout7);
obj.textEditor1:setLeft(5);
obj.textEditor1:setTop(25);
obj.textEditor1:setWidth(260);
obj.textEditor1:setHeight(170);
obj.textEditor1:setField("reputacao");
obj.textEditor1:setName("textEditor1");
obj.textEditor2 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor2:setParent(obj.layout7);
obj.textEditor2:setLeft(270);
obj.textEditor2:setTop(25);
obj.textEditor2:setWidth(260);
obj.textEditor2:setHeight(170);
obj.textEditor2:setField("experiencia");
obj.textEditor2:setName("textEditor2");
obj.tab2 = gui.fromHandle(_obj_newObject("tab"));
obj.tab2:setParent(obj.tabControl1);
obj.tab2:setTitle("Perícias");
obj.tab2:setName("tab2");
obj.frmSkills = gui.fromHandle(_obj_newObject("form"));
obj.frmSkills:setParent(obj.tab2);
obj.frmSkills:setName("frmSkills");
obj.frmSkills:setAlign("client");
local function updateAtributes(num)
local mod = 0;
if num == "1" then
mod = tonumber(sheet.atratividade) or 0;
elseif num == "2" then
mod = tonumber(sheet.tipoCorporal) or 0;
elseif num == "3" then
mod = tonumber(sheet.autocontrole) or 0;
elseif num == "4" then
mod = tonumber(sheet.reflexos) or 0;
elseif num == "5" then
mod = tonumber(sheet.tecnica) or 0;
elseif num == "6" then
mod = tonumber(sheet.inteligencia) or 0;
elseif num == "7" then
mod = tonumber(sheet.empatia) or 0;
end;
local nodes = ndb.getChildNodes(sheet.campoDasPericias);
for i=1, #nodes, 1 do
if nodes[i].atributo == num then
nodes[i].atributoPericia = mod;
end;
end
local nodes = ndb.getChildNodes(sheet.campoDasPericiasClasse);
for i=1, #nodes, 1 do
if nodes[i].atributo == num then
nodes[i].atributoPericia = mod;
end;
end
local nodes = ndb.getChildNodes(sheet.campoDasPericiasComuns);
for i=1, #nodes, 1 do
if nodes[i].atributo == num then
nodes[i].atributoPericia = mod;
end;
end
end;
obj.popPericia = gui.fromHandle(_obj_newObject("popup"));
obj.popPericia:setParent(obj.frmSkills);
obj.popPericia:setName("popPericia");
obj.popPericia:setWidth(300);
obj.popPericia:setHeight(100);
obj.popPericia:setBackOpacity(0.4);
obj.flowLayout1 = gui.fromHandle(_obj_newObject("flowLayout"));
obj.flowLayout1:setParent(obj.popPericia);
obj.flowLayout1:setAlign("top");
obj.flowLayout1:setAutoHeight(true);
obj.flowLayout1:setMaxControlsPerLine(3);
obj.flowLayout1:setMargins({bottom=4});
obj.flowLayout1:setHorzAlign("center");
obj.flowLayout1:setName("flowLayout1");
obj.flowPart1 = gui.fromHandle(_obj_newObject("flowPart"));
obj.flowPart1:setParent(obj.flowLayout1);
obj.flowPart1:setMinWidth(90);
obj.flowPart1:setMaxWidth(100);
obj.flowPart1:setHeight(35);
obj.flowPart1:setName("flowPart1");
obj.label65 = gui.fromHandle(_obj_newObject("label"));
obj.label65:setParent(obj.flowPart1);
obj.label65:setAlign("top");
obj.label65:setFontSize(10);
obj.label65:setText("Cibernético");
obj.label65:setHorzTextAlign("center");
obj.label65:setWordWrap(true);
obj.label65:setTextTrimming("none");
obj.label65:setAutoSize(true);
obj.label65:setName("label65");
obj.edit25 = gui.fromHandle(_obj_newObject("edit"));
obj.edit25:setParent(obj.flowPart1);
obj.edit25:setAlign("client");
obj.edit25:setField("cyber");
obj.edit25:setHorzTextAlign("center");
obj.edit25:setFontSize(12);
obj.edit25:setType("number");
obj.edit25:setName("edit25");
obj.flowPart2 = gui.fromHandle(_obj_newObject("flowPart"));
obj.flowPart2:setParent(obj.flowLayout1);
obj.flowPart2:setMinWidth(90);
obj.flowPart2:setMaxWidth(100);
obj.flowPart2:setHeight(35);
obj.flowPart2:setName("flowPart2");
obj.label66 = gui.fromHandle(_obj_newObject("label"));
obj.label66:setParent(obj.flowPart2);
obj.label66:setAlign("top");
obj.label66:setFontSize(10);
obj.label66:setText("Magia");
obj.label66:setHorzTextAlign("center");
obj.label66:setWordWrap(true);
obj.label66:setTextTrimming("none");
obj.label66:setAutoSize(true);
obj.label66:setName("label66");
obj.edit26 = gui.fromHandle(_obj_newObject("edit"));
obj.edit26:setParent(obj.flowPart2);
obj.edit26:setAlign("client");
obj.edit26:setField("magia");
obj.edit26:setHorzTextAlign("center");
obj.edit26:setFontSize(12);
obj.edit26:setType("number");
obj.edit26:setName("edit26");
obj.flowPart3 = gui.fromHandle(_obj_newObject("flowPart"));
obj.flowPart3:setParent(obj.flowLayout1);
obj.flowPart3:setMinWidth(90);
obj.flowPart3:setMaxWidth(100);
obj.flowPart3:setHeight(35);
obj.flowPart3:setName("flowPart3");
obj.label67 = gui.fromHandle(_obj_newObject("label"));
obj.label67:setParent(obj.flowPart3);
obj.label67:setAlign("top");
obj.label67:setFontSize(10);
obj.label67:setText("Outros");
obj.label67:setHorzTextAlign("center");
obj.label67:setWordWrap(true);
obj.label67:setTextTrimming("none");
obj.label67:setAutoSize(true);
obj.label67:setName("label67");
obj.edit27 = gui.fromHandle(_obj_newObject("edit"));
obj.edit27:setParent(obj.flowPart3);
obj.edit27:setAlign("client");
obj.edit27:setField("outros");
obj.edit27:setHorzTextAlign("center");
obj.edit27:setFontSize(12);
obj.edit27:setType("number");
obj.edit27:setName("edit27");
obj.textEditor3 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor3:setParent(obj.popPericia);
obj.textEditor3:setAlign("bottom");
obj.textEditor3:setField("descricao");
obj.textEditor3:setName("textEditor3");
obj.dataLink4 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink4:setParent(obj.frmSkills);
obj.dataLink4:setFields({'atratividade', 'tipoCorporal', 'autocontrole', 'reflexos', 'tecnica', 'inteligencia', 'empatia'});
obj.dataLink4:setName("dataLink4");
obj.scrollBox2 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox2:setParent(obj.frmSkills);
obj.scrollBox2:setAlign("client");
obj.scrollBox2:setName("scrollBox2");
obj.layout8 = gui.fromHandle(_obj_newObject("layout"));
obj.layout8:setParent(obj.scrollBox2);
obj.layout8:setLeft(0);
obj.layout8:setTop(0);
obj.layout8:setWidth(430);
obj.layout8:setHeight(685);
obj.layout8:setName("layout8");
obj.rectangle19 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle19:setParent(obj.layout8);
obj.rectangle19:setAlign("client");
obj.rectangle19:setColor("black");
obj.rectangle19:setName("rectangle19");
obj.label68 = gui.fromHandle(_obj_newObject("label"));
obj.label68:setParent(obj.layout8);
obj.label68:setText("HABILIDADE ESPECIAL");
obj.label68:setLeft(0);
obj.label68:setTop(0);
obj.label68:setWidth(430);
obj.label68:setHeight(20);
obj.label68:setHorzTextAlign("center");
obj.label68:setName("label68");
obj.button1 = gui.fromHandle(_obj_newObject("button"));
obj.button1:setParent(obj.layout8);
obj.button1:setText("+");
obj.button1:setLeft(125);
obj.button1:setTop(0);
obj.button1:setWidth(20);
obj.button1:setHeight(20);
obj.button1:setName("button1");
obj.label69 = gui.fromHandle(_obj_newObject("label"));
obj.label69:setParent(obj.layout8);
obj.label69:setText("NOME DA PERÍCIA");
obj.label69:setLeft(20);
obj.label69:setTop(25);
obj.label69:setWidth(135);
obj.label69:setHeight(20);
obj.label69:setHorzTextAlign("center");
obj.label69:setName("label69");
obj.label70 = gui.fromHandle(_obj_newObject("label"));
obj.label70:setParent(obj.layout8);
obj.label70:setText("CHAVE");
obj.label70:setLeft(165);
obj.label70:setTop(25);
obj.label70:setWidth(60);
obj.label70:setHeight(20);
obj.label70:setHorzTextAlign("center");
obj.label70:setName("label70");
obj.label71 = gui.fromHandle(_obj_newObject("label"));
obj.label71:setParent(obj.layout8);
obj.label71:setText("TOTAL");
obj.label71:setLeft(245);
obj.label71:setTop(25);
obj.label71:setWidth(40);
obj.label71:setHeight(20);
obj.label71:setHorzTextAlign("center");
obj.label71:setName("label71");
obj.label72 = gui.fromHandle(_obj_newObject("label"));
obj.label72:setParent(obj.layout8);
obj.label72:setText("ATR");
obj.label72:setLeft(285);
obj.label72:setTop(25);
obj.label72:setWidth(33);
obj.label72:setHeight(20);
obj.label72:setHorzTextAlign("center");
obj.label72:setName("label72");
obj.label73 = gui.fromHandle(_obj_newObject("label"));
obj.label73:setParent(obj.layout8);
obj.label73:setText("PTS");
obj.label73:setLeft(320);
obj.label73:setTop(25);
obj.label73:setWidth(40);
obj.label73:setHeight(20);
obj.label73:setHorzTextAlign("center");
obj.label73:setName("label73");
obj.rclListaDasPericias = gui.fromHandle(_obj_newObject("recordList"));
obj.rclListaDasPericias:setParent(obj.layout8);
obj.rclListaDasPericias:setName("rclListaDasPericias");
obj.rclListaDasPericias:setField("campoDasPericias");
obj.rclListaDasPericias:setTemplateForm("frmSkillItem");
obj.rclListaDasPericias:setLeft(5);
obj.rclListaDasPericias:setTop(50);
obj.rclListaDasPericias:setWidth(420);
obj.rclListaDasPericias:setHeight(625);
obj.rclListaDasPericias:setLayout("vertical");
obj.layout9 = gui.fromHandle(_obj_newObject("layout"));
obj.layout9:setParent(obj.scrollBox2);
obj.layout9:setLeft(435);
obj.layout9:setTop(0);
obj.layout9:setWidth(430);
obj.layout9:setHeight(685);
obj.layout9:setName("layout9");
obj.rectangle20 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle20:setParent(obj.layout9);
obj.rectangle20:setAlign("client");
obj.rectangle20:setColor("black");
obj.rectangle20:setName("rectangle20");
obj.label74 = gui.fromHandle(_obj_newObject("label"));
obj.label74:setParent(obj.layout9);
obj.label74:setText("PERÍCIAS DE CLASSE");
obj.label74:setLeft(0);
obj.label74:setTop(0);
obj.label74:setWidth(430);
obj.label74:setHeight(20);
obj.label74:setHorzTextAlign("center");
obj.label74:setName("label74");
obj.button2 = gui.fromHandle(_obj_newObject("button"));
obj.button2:setParent(obj.layout9);
obj.button2:setText("+");
obj.button2:setLeft(130);
obj.button2:setTop(0);
obj.button2:setWidth(20);
obj.button2:setHeight(20);
obj.button2:setName("button2");
obj.label75 = gui.fromHandle(_obj_newObject("label"));
obj.label75:setParent(obj.layout9);
obj.label75:setText("NOME DA PERÍCIA");
obj.label75:setLeft(20);
obj.label75:setTop(25);
obj.label75:setWidth(135);
obj.label75:setHeight(20);
obj.label75:setHorzTextAlign("center");
obj.label75:setName("label75");
obj.label76 = gui.fromHandle(_obj_newObject("label"));
obj.label76:setParent(obj.layout9);
obj.label76:setText("CHAVE");
obj.label76:setLeft(165);
obj.label76:setTop(25);
obj.label76:setWidth(60);
obj.label76:setHeight(20);
obj.label76:setHorzTextAlign("center");
obj.label76:setName("label76");
obj.label77 = gui.fromHandle(_obj_newObject("label"));
obj.label77:setParent(obj.layout9);
obj.label77:setText("TOTAL");
obj.label77:setLeft(245);
obj.label77:setTop(25);
obj.label77:setWidth(40);
obj.label77:setHeight(20);
obj.label77:setHorzTextAlign("center");
obj.label77:setName("label77");
obj.label78 = gui.fromHandle(_obj_newObject("label"));
obj.label78:setParent(obj.layout9);
obj.label78:setText("ATR");
obj.label78:setLeft(285);
obj.label78:setTop(25);
obj.label78:setWidth(33);
obj.label78:setHeight(20);
obj.label78:setHorzTextAlign("center");
obj.label78:setName("label78");
obj.label79 = gui.fromHandle(_obj_newObject("label"));
obj.label79:setParent(obj.layout9);
obj.label79:setText("PTS");
obj.label79:setLeft(320);
obj.label79:setTop(25);
obj.label79:setWidth(40);
obj.label79:setHeight(20);
obj.label79:setHorzTextAlign("center");
obj.label79:setName("label79");
obj.rclListaDasPericiasClasse = gui.fromHandle(_obj_newObject("recordList"));
obj.rclListaDasPericiasClasse:setParent(obj.layout9);
obj.rclListaDasPericiasClasse:setName("rclListaDasPericiasClasse");
obj.rclListaDasPericiasClasse:setField("campoDasPericiasClasse");
obj.rclListaDasPericiasClasse:setTemplateForm("frmSkillItem");
obj.rclListaDasPericiasClasse:setLeft(5);
obj.rclListaDasPericiasClasse:setTop(50);
obj.rclListaDasPericiasClasse:setWidth(420);
obj.rclListaDasPericiasClasse:setHeight(625);
obj.rclListaDasPericiasClasse:setLayout("vertical");
obj.layout10 = gui.fromHandle(_obj_newObject("layout"));
obj.layout10:setParent(obj.scrollBox2);
obj.layout10:setLeft(870);
obj.layout10:setTop(0);
obj.layout10:setWidth(430);
obj.layout10:setHeight(685);
obj.layout10:setName("layout10");
obj.rectangle21 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle21:setParent(obj.layout10);
obj.rectangle21:setAlign("client");
obj.rectangle21:setColor("black");
obj.rectangle21:setName("rectangle21");
obj.label80 = gui.fromHandle(_obj_newObject("label"));
obj.label80:setParent(obj.layout10);
obj.label80:setText("PERÍCIAS COMUNS");
obj.label80:setLeft(0);
obj.label80:setTop(0);
obj.label80:setWidth(430);
obj.label80:setHeight(20);
obj.label80:setHorzTextAlign("center");
obj.label80:setName("label80");
obj.button3 = gui.fromHandle(_obj_newObject("button"));
obj.button3:setParent(obj.layout10);
obj.button3:setText("+");
obj.button3:setLeft(130);
obj.button3:setTop(0);
obj.button3:setWidth(20);
obj.button3:setHeight(20);
obj.button3:setName("button3");
obj.label81 = gui.fromHandle(_obj_newObject("label"));
obj.label81:setParent(obj.layout10);
obj.label81:setText("NOME DA PERÍCIA");
obj.label81:setLeft(20);
obj.label81:setTop(25);
obj.label81:setWidth(135);
obj.label81:setHeight(20);
obj.label81:setHorzTextAlign("center");
obj.label81:setName("label81");
obj.label82 = gui.fromHandle(_obj_newObject("label"));
obj.label82:setParent(obj.layout10);
obj.label82:setText("CHAVE");
obj.label82:setLeft(165);
obj.label82:setTop(25);
obj.label82:setWidth(60);
obj.label82:setHeight(20);
obj.label82:setHorzTextAlign("center");
obj.label82:setName("label82");
obj.label83 = gui.fromHandle(_obj_newObject("label"));
obj.label83:setParent(obj.layout10);
obj.label83:setText("TOTAL");
obj.label83:setLeft(245);
obj.label83:setTop(25);
obj.label83:setWidth(40);
obj.label83:setHeight(20);
obj.label83:setHorzTextAlign("center");
obj.label83:setName("label83");
obj.label84 = gui.fromHandle(_obj_newObject("label"));
obj.label84:setParent(obj.layout10);
obj.label84:setText("ATR");
obj.label84:setLeft(285);
obj.label84:setTop(25);
obj.label84:setWidth(33);
obj.label84:setHeight(20);
obj.label84:setHorzTextAlign("center");
obj.label84:setName("label84");
obj.label85 = gui.fromHandle(_obj_newObject("label"));
obj.label85:setParent(obj.layout10);
obj.label85:setText("PTS");
obj.label85:setLeft(320);
obj.label85:setTop(25);
obj.label85:setWidth(40);
obj.label85:setHeight(20);
obj.label85:setHorzTextAlign("center");
obj.label85:setName("label85");
obj.rclListaDasPericiasComuns = gui.fromHandle(_obj_newObject("recordList"));
obj.rclListaDasPericiasComuns:setParent(obj.layout10);
obj.rclListaDasPericiasComuns:setName("rclListaDasPericiasComuns");
obj.rclListaDasPericiasComuns:setField("campoDasPericiasComuns");
obj.rclListaDasPericiasComuns:setTemplateForm("frmSkillItem");
obj.rclListaDasPericiasComuns:setLeft(5);
obj.rclListaDasPericiasComuns:setTop(50);
obj.rclListaDasPericiasComuns:setWidth(420);
obj.rclListaDasPericiasComuns:setHeight(625);
obj.rclListaDasPericiasComuns:setLayout("vertical");
obj.tab3 = gui.fromHandle(_obj_newObject("tab"));
obj.tab3:setParent(obj.tabControl1);
obj.tab3:setTitle("Inventario");
obj.tab3:setName("tab3");
obj.frmInventory = gui.fromHandle(_obj_newObject("form"));
obj.frmInventory:setParent(obj.tab3);
obj.frmInventory:setName("frmInventory");
obj.frmInventory:setAlign("client");
obj.scrollBox3 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox3:setParent(obj.frmInventory);
obj.scrollBox3:setAlign("client");
obj.scrollBox3:setName("scrollBox3");
obj.layout11 = gui.fromHandle(_obj_newObject("layout"));
obj.layout11:setParent(obj.scrollBox3);
obj.layout11:setLeft(0);
obj.layout11:setTop(0);
obj.layout11:setWidth(360);
obj.layout11:setHeight(685);
obj.layout11:setName("layout11");
obj.rectangle22 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle22:setParent(obj.layout11);
obj.rectangle22:setAlign("client");
obj.rectangle22:setColor("black");
obj.rectangle22:setName("rectangle22");
obj.label86 = gui.fromHandle(_obj_newObject("label"));
obj.label86:setParent(obj.layout11);
obj.label86:setText("ITEM");
obj.label86:setLeft(5);
obj.label86:setTop(1);
obj.label86:setWidth(150);
obj.label86:setHeight(20);
obj.label86:setHorzTextAlign("center");
obj.label86:setName("label86");
obj.label87 = gui.fromHandle(_obj_newObject("label"));
obj.label87:setParent(obj.layout11);
obj.label87:setText("QTD");
obj.label87:setLeft(155);
obj.label87:setTop(1);
obj.label87:setWidth(50);
obj.label87:setHeight(20);
obj.label87:setHorzTextAlign("center");
obj.label87:setName("label87");
obj.label88 = gui.fromHandle(_obj_newObject("label"));
obj.label88:setParent(obj.layout11);
obj.label88:setText("PREÇO");
obj.label88:setLeft(205);
obj.label88:setTop(1);
obj.label88:setWidth(50);
obj.label88:setHeight(20);
obj.label88:setHorzTextAlign("center");
obj.label88:setName("label88");
obj.label89 = gui.fromHandle(_obj_newObject("label"));
obj.label89:setParent(obj.layout11);
obj.label89:setText("PESO");
obj.label89:setLeft(255);
obj.label89:setTop(1);
obj.label89:setWidth(50);
obj.label89:setHeight(20);
obj.label89:setHorzTextAlign("center");
obj.label89:setName("label89");
obj.button4 = gui.fromHandle(_obj_newObject("button"));
obj.button4:setParent(obj.layout11);
obj.button4:setText("+");
obj.button4:setLeft(305);
obj.button4:setTop(0);
obj.button4:setWidth(25);
obj.button4:setHeight(25);
obj.button4:setName("button4");
obj.rclInventory = gui.fromHandle(_obj_newObject("recordList"));
obj.rclInventory:setParent(obj.layout11);
obj.rclInventory:setName("rclInventory");
obj.rclInventory:setField("inventoryList");
obj.rclInventory:setTemplateForm("frmInventoryItem");
obj.rclInventory:setLeft(5);
obj.rclInventory:setTop(25);
obj.rclInventory:setWidth(350);
obj.rclInventory:setHeight(650);
obj.rclInventory:setLayout("vertical");
obj.layout12 = gui.fromHandle(_obj_newObject("layout"));
obj.layout12:setParent(obj.scrollBox3);
obj.layout12:setLeft(370);
obj.layout12:setTop(0);
obj.layout12:setWidth(760);
obj.layout12:setHeight(335);
obj.layout12:setName("layout12");
obj.rectangle23 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle23:setParent(obj.layout12);
obj.rectangle23:setAlign("client");
obj.rectangle23:setColor("black");
obj.rectangle23:setName("rectangle23");
obj.label90 = gui.fromHandle(_obj_newObject("label"));
obj.label90:setParent(obj.layout12);
obj.label90:setText("ARMA");
obj.label90:setLeft(5);
obj.label90:setTop(1);
obj.label90:setWidth(150);
obj.label90:setHeight(20);
obj.label90:setHorzTextAlign("center");
obj.label90:setName("label90");
obj.label91 = gui.fromHandle(_obj_newObject("label"));
obj.label91:setParent(obj.layout12);
obj.label91:setText("TIPO");
obj.label91:setLeft(155);
obj.label91:setTop(1);
obj.label91:setWidth(50);
obj.label91:setHeight(20);
obj.label91:setHorzTextAlign("center");
obj.label91:setName("label91");
obj.label92 = gui.fromHandle(_obj_newObject("label"));
obj.label92:setParent(obj.layout12);
obj.label92:setText("PRECISÃO");
obj.label92:setLeft(205);
obj.label92:setTop(1);
obj.label92:setWidth(50);
obj.label92:setHeight(20);
obj.label92:setHorzTextAlign("center");
obj.label92:setFontSize(11);
obj.label92:setName("label92");
obj.label93 = gui.fromHandle(_obj_newObject("label"));
obj.label93:setParent(obj.layout12);
obj.label93:setText("OCULT.");
obj.label93:setLeft(255);
obj.label93:setTop(1);
obj.label93:setWidth(50);
obj.label93:setHeight(20);
obj.label93:setHorzTextAlign("center");
obj.label93:setFontSize(12);
obj.label93:setName("label93");
obj.label94 = gui.fromHandle(_obj_newObject("label"));
obj.label94:setParent(obj.layout12);
obj.label94:setText("DISP.");
obj.label94:setLeft(305);
obj.label94:setTop(1);
obj.label94:setWidth(50);
obj.label94:setHeight(20);
obj.label94:setHorzTextAlign("center");
obj.label94:setName("label94");
obj.label95 = gui.fromHandle(_obj_newObject("label"));
obj.label95:setParent(obj.layout12);
obj.label95:setText("DANO");
obj.label95:setLeft(355);
obj.label95:setTop(1);
obj.label95:setWidth(50);
obj.label95:setHeight(20);
obj.label95:setHorzTextAlign("center");
obj.label95:setName("label95");
obj.label96 = gui.fromHandle(_obj_newObject("label"));
obj.label96:setParent(obj.layout12);
obj.label96:setText("Nº DISP.");
obj.label96:setLeft(405);
obj.label96:setTop(1);
obj.label96:setWidth(50);
obj.label96:setHeight(20);
obj.label96:setHorzTextAlign("center");
obj.label96:setFontSize(11);
obj.label96:setName("label96");
obj.label97 = gui.fromHandle(_obj_newObject("label"));
obj.label97:setParent(obj.layout12);
obj.label97:setText("CD TIRO");
obj.label97:setLeft(455);
obj.label97:setTop(1);
obj.label97:setWidth(50);
obj.label97:setHeight(20);
obj.label97:setHorzTextAlign("center");
obj.label97:setFontSize(11);
obj.label97:setName("label97");
obj.label98 = gui.fromHandle(_obj_newObject("label"));
obj.label98:setParent(obj.layout12);
obj.label98:setText("CONF.");
obj.label98:setLeft(505);
obj.label98:setTop(1);
obj.label98:setWidth(50);
obj.label98:setHeight(20);
obj.label98:setHorzTextAlign("center");
obj.label98:setName("label98");
obj.label99 = gui.fromHandle(_obj_newObject("label"));
obj.label99:setParent(obj.layout12);
obj.label99:setText("ALCANCE");
obj.label99:setLeft(555);
obj.label99:setTop(1);
obj.label99:setWidth(50);
obj.label99:setHeight(20);
obj.label99:setHorzTextAlign("center");
obj.label99:setFontSize(11);
obj.label99:setName("label99");
obj.label100 = gui.fromHandle(_obj_newObject("label"));
obj.label100:setParent(obj.layout12);
obj.label100:setText("PREÇO");
obj.label100:setLeft(605);
obj.label100:setTop(1);
obj.label100:setWidth(50);
obj.label100:setHeight(20);
obj.label100:setHorzTextAlign("center");
obj.label100:setName("label100");
obj.label101 = gui.fromHandle(_obj_newObject("label"));
obj.label101:setParent(obj.layout12);
obj.label101:setText("PESO");
obj.label101:setLeft(655);
obj.label101:setTop(1);
obj.label101:setWidth(50);
obj.label101:setHeight(20);
obj.label101:setHorzTextAlign("center");
obj.label101:setName("label101");
obj.button5 = gui.fromHandle(_obj_newObject("button"));
obj.button5:setParent(obj.layout12);
obj.button5:setText("+");
obj.button5:setLeft(705);
obj.button5:setTop(0);
obj.button5:setWidth(25);
obj.button5:setHeight(25);
obj.button5:setName("button5");
obj.rclInventoryWeapon = gui.fromHandle(_obj_newObject("recordList"));
obj.rclInventoryWeapon:setParent(obj.layout12);
obj.rclInventoryWeapon:setName("rclInventoryWeapon");
obj.rclInventoryWeapon:setField("weaponList");
obj.rclInventoryWeapon:setTemplateForm("frmInventoryWeapon");
obj.rclInventoryWeapon:setLeft(5);
obj.rclInventoryWeapon:setTop(25);
obj.rclInventoryWeapon:setWidth(750);
obj.rclInventoryWeapon:setHeight(300);
obj.rclInventoryWeapon:setLayout("vertical");
obj.layout13 = gui.fromHandle(_obj_newObject("layout"));
obj.layout13:setParent(obj.scrollBox3);
obj.layout13:setLeft(370);
obj.layout13:setTop(345);
obj.layout13:setWidth(760);
obj.layout13:setHeight(335);
obj.layout13:setName("layout13");
obj.rectangle24 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle24:setParent(obj.layout13);
obj.rectangle24:setAlign("client");
obj.rectangle24:setColor("black");
obj.rectangle24:setName("rectangle24");
obj.label102 = gui.fromHandle(_obj_newObject("label"));
obj.label102:setParent(obj.layout13);
obj.label102:setText("ARMADURA");
obj.label102:setLeft(5);
obj.label102:setTop(1);
obj.label102:setWidth(150);
obj.label102:setHeight(20);
obj.label102:setHorzTextAlign("center");
obj.label102:setName("label102");
obj.label103 = gui.fromHandle(_obj_newObject("label"));
obj.label103:setParent(obj.layout13);
obj.label103:setText("CABEÇA");
obj.label103:setLeft(155);
obj.label103:setTop(1);
obj.label103:setWidth(50);
obj.label103:setHeight(20);
obj.label103:setHorzTextAlign("center");
obj.label103:setName("label103");
obj.label104 = gui.fromHandle(_obj_newObject("label"));
obj.label104:setParent(obj.layout13);
obj.label104:setText("TORSO");
obj.label104:setLeft(205);
obj.label104:setTop(1);
obj.label104:setWidth(50);
obj.label104:setHeight(20);
obj.label104:setHorzTextAlign("center");
obj.label104:setName("label104");
obj.label105 = gui.fromHandle(_obj_newObject("label"));
obj.label105:setParent(obj.layout13);
obj.label105:setText("BRAÇO D");
obj.label105:setLeft(255);
obj.label105:setTop(1);
obj.label105:setWidth(50);
obj.label105:setHeight(20);
obj.label105:setHorzTextAlign("center");
obj.label105:setFontSize(11);
obj.label105:setName("label105");
obj.label106 = gui.fromHandle(_obj_newObject("label"));
obj.label106:setParent(obj.layout13);
obj.label106:setText("BRAÇO E");
obj.label106:setLeft(305);
obj.label106:setTop(1);
obj.label106:setWidth(50);
obj.label106:setHeight(20);
obj.label106:setHorzTextAlign("center");
obj.label106:setFontSize(11);
obj.label106:setName("label106");
obj.label107 = gui.fromHandle(_obj_newObject("label"));
obj.label107:setParent(obj.layout13);
obj.label107:setText("PERNA D");
obj.label107:setLeft(355);
obj.label107:setTop(1);
obj.label107:setWidth(50);
obj.label107:setHeight(20);
obj.label107:setHorzTextAlign("center");
obj.label107:setFontSize(11);
obj.label107:setName("label107");
obj.label108 = gui.fromHandle(_obj_newObject("label"));
obj.label108:setParent(obj.layout13);
obj.label108:setText("PERNA E");
obj.label108:setLeft(405);
obj.label108:setTop(1);
obj.label108:setWidth(50);
obj.label108:setHeight(20);
obj.label108:setHorzTextAlign("center");
obj.label108:setFontSize(11);
obj.label108:setName("label108");
obj.label109 = gui.fromHandle(_obj_newObject("label"));
obj.label109:setParent(obj.layout13);
obj.label109:setText("DETALHES");
obj.label109:setLeft(455);
obj.label109:setTop(1);
obj.label109:setWidth(150);
obj.label109:setHeight(20);
obj.label109:setHorzTextAlign("center");
obj.label109:setName("label109");
obj.label110 = gui.fromHandle(_obj_newObject("label"));
obj.label110:setParent(obj.layout13);
obj.label110:setText("PREÇO");
obj.label110:setLeft(605);
obj.label110:setTop(1);
obj.label110:setWidth(50);
obj.label110:setHeight(20);
obj.label110:setHorzTextAlign("center");
obj.label110:setName("label110");
obj.label111 = gui.fromHandle(_obj_newObject("label"));
obj.label111:setParent(obj.layout13);
obj.label111:setText("PESO");
obj.label111:setLeft(655);
obj.label111:setTop(1);
obj.label111:setWidth(50);
obj.label111:setHeight(20);
obj.label111:setHorzTextAlign("center");
obj.label111:setName("label111");
obj.button6 = gui.fromHandle(_obj_newObject("button"));
obj.button6:setParent(obj.layout13);
obj.button6:setText("+");
obj.button6:setLeft(705);
obj.button6:setTop(0);
obj.button6:setWidth(25);
obj.button6:setHeight(25);
obj.button6:setName("button6");
obj.rclInventoryArmor = gui.fromHandle(_obj_newObject("recordList"));
obj.rclInventoryArmor:setParent(obj.layout13);
obj.rclInventoryArmor:setName("rclInventoryArmor");
obj.rclInventoryArmor:setField("armorList");
obj.rclInventoryArmor:setTemplateForm("frmInventoryArmor");
obj.rclInventoryArmor:setLeft(5);
obj.rclInventoryArmor:setTop(25);
obj.rclInventoryArmor:setWidth(750);
obj.rclInventoryArmor:setHeight(300);
obj.rclInventoryArmor:setLayout("vertical");
obj.layout14 = gui.fromHandle(_obj_newObject("layout"));
obj.layout14:setParent(obj.scrollBox3);
obj.layout14:setLeft(1140);
obj.layout14:setTop(0);
obj.layout14:setWidth(210);
obj.layout14:setHeight(85);
obj.layout14:setName("layout14");
obj.rectangle25 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle25:setParent(obj.layout14);
obj.rectangle25:setAlign("client");
obj.rectangle25:setColor("black");
obj.rectangle25:setName("rectangle25");
obj.label112 = gui.fromHandle(_obj_newObject("label"));
obj.label112:setParent(obj.layout14);
obj.label112:setLeft(5);
obj.label112:setTop(5);
obj.label112:setWidth(100);
obj.label112:setHeight(20);
obj.label112:setText("PREÇO");
obj.label112:setHorzTextAlign("center");
obj.label112:setName("label112");
obj.rectangle26 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle26:setParent(obj.layout14);
obj.rectangle26:setLeft(105);
obj.rectangle26:setTop(5);
obj.rectangle26:setWidth(50);
obj.rectangle26:setHeight(25);
obj.rectangle26:setColor("black");
obj.rectangle26:setStrokeColor("white");
obj.rectangle26:setStrokeSize(1);
obj.rectangle26:setName("rectangle26");
obj.label113 = gui.fromHandle(_obj_newObject("label"));
obj.label113:setParent(obj.layout14);
obj.label113:setLeft(105);
obj.label113:setTop(5);
obj.label113:setWidth(50);
obj.label113:setHeight(25);
obj.label113:setField("itensCost");
obj.label113:setVertTextAlign("center");
obj.label113:setHorzTextAlign("center");
obj.label113:setName("label113");
obj.label114 = gui.fromHandle(_obj_newObject("label"));
obj.label114:setParent(obj.layout14);
obj.label114:setLeft(5);
obj.label114:setTop(30);
obj.label114:setWidth(100);
obj.label114:setHeight(20);
obj.label114:setText("PESO");
obj.label114:setHorzTextAlign("center");
obj.label114:setName("label114");
obj.rectangle27 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle27:setParent(obj.layout14);
obj.rectangle27:setLeft(105);
obj.rectangle27:setTop(30);
obj.rectangle27:setWidth(50);
obj.rectangle27:setHeight(25);
obj.rectangle27:setColor("black");
obj.rectangle27:setStrokeColor("white");
obj.rectangle27:setStrokeSize(1);
obj.rectangle27:setName("rectangle27");
obj.label115 = gui.fromHandle(_obj_newObject("label"));
obj.label115:setParent(obj.layout14);
obj.label115:setLeft(105);
obj.label115:setTop(30);
obj.label115:setWidth(50);
obj.label115:setHeight(25);
obj.label115:setField("itensWeight");
obj.label115:setVertTextAlign("center");
obj.label115:setHorzTextAlign("center");
obj.label115:setName("label115");
obj.label116 = gui.fromHandle(_obj_newObject("label"));
obj.label116:setParent(obj.layout14);
obj.label116:setLeft(5);
obj.label116:setTop(55);
obj.label116:setWidth(100);
obj.label116:setHeight(20);
obj.label116:setText("DINHEIRO");
obj.label116:setHorzTextAlign("center");
obj.label116:setName("label116");
obj.edit28 = gui.fromHandle(_obj_newObject("edit"));
obj.edit28:setParent(obj.layout14);
obj.edit28:setLeft(105);
obj.edit28:setTop(55);
obj.edit28:setWidth(50);
obj.edit28:setHeight(25);
obj.edit28:setField("itensCash");
obj.edit28:setName("edit28");
obj.dataLink5 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink5:setParent(obj.layout14);
obj.dataLink5:setFields({'inventoryWeight', 'weaponWeight', 'armorWeight'});
obj.dataLink5:setName("dataLink5");
obj.dataLink6 = gui.fromHandle(_obj_newObject("dataLink"));
obj.dataLink6:setParent(obj.layout14);
obj.dataLink6:setFields({'inventoryCost', 'weaponCost', 'armorCost', 'cyberCost', 'vehicleCost'});
obj.dataLink6:setName("dataLink6");
obj.tab4 = gui.fromHandle(_obj_newObject("tab"));
obj.tab4:setParent(obj.tabControl1);
obj.tab4:setTitle("Cibernético");
obj.tab4:setName("tab4");
obj.frmCyber = gui.fromHandle(_obj_newObject("form"));
obj.frmCyber:setParent(obj.tab4);
obj.frmCyber:setName("frmCyber");
obj.frmCyber:setAlign("client");
obj.scrollBox4 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox4:setParent(obj.frmCyber);
obj.scrollBox4:setAlign("client");
obj.scrollBox4:setName("scrollBox4");
obj.layout15 = gui.fromHandle(_obj_newObject("layout"));
obj.layout15:setParent(obj.scrollBox4);
obj.layout15:setLeft(0);
obj.layout15:setTop(0);
obj.layout15:setWidth(460);
obj.layout15:setHeight(685);
obj.layout15:setName("layout15");
obj.rectangle28 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle28:setParent(obj.layout15);
obj.rectangle28:setAlign("client");
obj.rectangle28:setColor("black");
obj.rectangle28:setName("rectangle28");
obj.label117 = gui.fromHandle(_obj_newObject("label"));
obj.label117:setParent(obj.layout15);
obj.label117:setText("NOME");
obj.label117:setLeft(5);
obj.label117:setTop(1);
obj.label117:setWidth(100);
obj.label117:setHeight(20);
obj.label117:setHorzTextAlign("center");
obj.label117:setName("label117");
obj.label118 = gui.fromHandle(_obj_newObject("label"));
obj.label118:setParent(obj.layout15);
obj.label118:setText("DETALHES");
obj.label118:setLeft(105);
obj.label118:setTop(1);
obj.label118:setWidth(200);
obj.label118:setHeight(20);
obj.label118:setHorzTextAlign("center");
obj.label118:setName("label118");
obj.label119 = gui.fromHandle(_obj_newObject("label"));
obj.label119:setParent(obj.layout15);
obj.label119:setText("PH");
obj.label119:setLeft(305);
obj.label119:setTop(1);
obj.label119:setWidth(50);
obj.label119:setHeight(20);
obj.label119:setHorzTextAlign("center");
obj.label119:setName("label119");
obj.label120 = gui.fromHandle(_obj_newObject("label"));
obj.label120:setParent(obj.layout15);
obj.label120:setText("PREÇO");
obj.label120:setLeft(355);
obj.label120:setTop(1);
obj.label120:setWidth(50);
obj.label120:setHeight(20);
obj.label120:setHorzTextAlign("center");
obj.label120:setName("label120");
obj.button7 = gui.fromHandle(_obj_newObject("button"));
obj.button7:setParent(obj.layout15);
obj.button7:setText("+");
obj.button7:setLeft(405);
obj.button7:setTop(0);
obj.button7:setWidth(25);
obj.button7:setHeight(25);
obj.button7:setName("button7");
obj.rclCyber = gui.fromHandle(_obj_newObject("recordList"));
obj.rclCyber:setParent(obj.layout15);
obj.rclCyber:setName("rclCyber");
obj.rclCyber:setField("cyberList");
obj.rclCyber:setTemplateForm("frmCyberItem");
obj.rclCyber:setLeft(5);
obj.rclCyber:setTop(25);
obj.rclCyber:setWidth(450);
obj.rclCyber:setHeight(650);
obj.rclCyber:setLayout("vertical");
obj.layout16 = gui.fromHandle(_obj_newObject("layout"));
obj.layout16:setParent(obj.scrollBox4);
obj.layout16:setLeft(470);
obj.layout16:setTop(0);
obj.layout16:setWidth(210);
obj.layout16:setHeight(35);
obj.layout16:setName("layout16");
obj.rectangle29 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle29:setParent(obj.layout16);
obj.rectangle29:setAlign("client");
obj.rectangle29:setColor("black");
obj.rectangle29:setName("rectangle29");
obj.label121 = gui.fromHandle(_obj_newObject("label"));
obj.label121:setParent(obj.layout16);
obj.label121:setLeft(5);
obj.label121:setTop(5);
obj.label121:setWidth(100);
obj.label121:setHeight(20);
obj.label121:setText("HUMANIDADE");
obj.label121:setHorzTextAlign("center");
obj.label121:setName("label121");
obj.rectangle30 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle30:setParent(obj.layout16);
obj.rectangle30:setLeft(105);
obj.rectangle30:setTop(5);
obj.rectangle30:setWidth(50);
obj.rectangle30:setHeight(25);
obj.rectangle30:setColor("black");
obj.rectangle30:setStrokeColor("white");
obj.rectangle30:setStrokeSize(1);
obj.rectangle30:setName("rectangle30");
obj.label122 = gui.fromHandle(_obj_newObject("label"));
obj.label122:setParent(obj.layout16);
obj.label122:setLeft(105);
obj.label122:setTop(5);
obj.label122:setWidth(50);
obj.label122:setHeight(25);
obj.label122:setField("phGasto");
obj.label122:setVertTextAlign("center");
obj.label122:setHorzTextAlign("center");
obj.label122:setName("label122");
obj.rectangle31 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle31:setParent(obj.layout16);
obj.rectangle31:setLeft(155);
obj.rectangle31:setTop(5);
obj.rectangle31:setWidth(50);
obj.rectangle31:setHeight(25);
obj.rectangle31:setColor("black");
obj.rectangle31:setStrokeColor("white");
obj.rectangle31:setStrokeSize(1);
obj.rectangle31:setName("rectangle31");
obj.label123 = gui.fromHandle(_obj_newObject("label"));
obj.label123:setParent(obj.layout16);
obj.label123:setLeft(155);
obj.label123:setTop(5);
obj.label123:setWidth(50);
obj.label123:setHeight(25);
obj.label123:setField("phTotal");
obj.label123:setVertTextAlign("center");
obj.label123:setHorzTextAlign("center");
obj.label123:setName("label123");
obj.tab5 = gui.fromHandle(_obj_newObject("tab"));
obj.tab5:setParent(obj.tabControl1);
obj.tab5:setTitle("Veículos");
obj.tab5:setName("tab5");
obj.frmVehicles = gui.fromHandle(_obj_newObject("form"));
obj.frmVehicles:setParent(obj.tab5);
obj.frmVehicles:setName("frmVehicles");
obj.frmVehicles:setAlign("client");
obj.scrollBox5 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox5:setParent(obj.frmVehicles);
obj.scrollBox5:setAlign("client");
obj.scrollBox5:setName("scrollBox5");
obj.rectangle32 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle32:setParent(obj.scrollBox5);
obj.rectangle32:setColor("grey");
obj.rectangle32:setWidth(1363);
obj.rectangle32:setHeight(686);
obj.rectangle32:setName("rectangle32");
obj.layout17 = gui.fromHandle(_obj_newObject("layout"));
obj.layout17:setParent(obj.scrollBox5);
obj.layout17:setLeft(0);
obj.layout17:setTop(0);
obj.layout17:setWidth(580);
obj.layout17:setHeight(60);
obj.layout17:setName("layout17");
obj.rectangle33 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle33:setParent(obj.layout17);
obj.rectangle33:setAlign("client");
obj.rectangle33:setColor("black");
obj.rectangle33:setName("rectangle33");
obj.layout18 = gui.fromHandle(_obj_newObject("layout"));
obj.layout18:setParent(obj.layout17);
obj.layout18:setLeft(0);
obj.layout18:setTop(0);
obj.layout18:setWidth(220);
obj.layout18:setHeight(60);
obj.layout18:setName("layout18");
obj.rectangle34 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle34:setParent(obj.layout18);
obj.rectangle34:setLeft(4);
obj.rectangle34:setTop(4);
obj.rectangle34:setWidth(52);
obj.rectangle34:setHeight(52);
obj.rectangle34:setColor("black");
obj.rectangle34:setStrokeColor("white");
obj.rectangle34:setStrokeSize(1);
obj.rectangle34:setName("rectangle34");
obj.image2 = gui.fromHandle(_obj_newObject("image"));
obj.image2:setParent(obj.layout18);
obj.image2:setLeft(10);
obj.image2:setTop(10);
obj.image2:setWidth(40);
obj.image2:setHeight(40);
obj.image2:setSRC("/Cyberpunk2020/images/wheel.png");
obj.image2:setName("image2");
obj.rectangle35 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle35:setParent(obj.layout18);
obj.rectangle35:setLeft(54);
obj.rectangle35:setTop(4);
obj.rectangle35:setWidth(52);
obj.rectangle35:setHeight(52);
obj.rectangle35:setColor("black");
obj.rectangle35:setStrokeColor("white");
obj.rectangle35:setStrokeSize(1);
obj.rectangle35:setName("rectangle35");
obj.edit29 = gui.fromHandle(_obj_newObject("edit"));
obj.edit29:setParent(obj.layout18);
obj.edit29:setLeft(60);
obj.edit29:setTop(10);
obj.edit29:setWidth(40);
obj.edit29:setHeight(40);
obj.edit29:setField("wheel");
obj.edit29:setHorzTextAlign("center");
obj.edit29:setVertTextAlign("center");
obj.edit29:setFontSize(20);
obj.edit29:setTransparent(true);
obj.edit29:setName("edit29");
obj.label124 = gui.fromHandle(_obj_newObject("label"));
obj.label124:setParent(obj.layout18);
obj.label124:setLeft(110);
obj.label124:setTop(5);
obj.label124:setWidth(80);
obj.label124:setHeight(20);
obj.label124:setText("Links");
obj.label124:setHorzTextAlign("trailing");
obj.label124:setName("label124");
obj.edit30 = gui.fromHandle(_obj_newObject("edit"));
obj.edit30:setParent(obj.layout18);
obj.edit30:setLeft(195);
obj.edit30:setTop(5);
obj.edit30:setWidth(30);
obj.edit30:setHeight(25);
obj.edit30:setField("wheel_link");
obj.edit30:setHorzTextAlign("center");
obj.edit30:setVertTextAlign("center");
obj.edit30:setName("edit30");
obj.label125 = gui.fromHandle(_obj_newObject("label"));
obj.label125:setParent(obj.layout18);
obj.label125:setLeft(110);
obj.label125:setTop(30);
obj.label125:setWidth(80);
obj.label125:setHeight(20);
obj.label125:setText("Computador");
obj.label125:setHorzTextAlign("trailing");
obj.label125:setName("label125");
obj.edit31 = gui.fromHandle(_obj_newObject("edit"));
obj.edit31:setParent(obj.layout18);
obj.edit31:setLeft(195);
obj.edit31:setTop(30);
obj.edit31:setWidth(30);
obj.edit31:setHeight(25);
obj.edit31:setField("wheel_computer");
obj.edit31:setHorzTextAlign("center");
obj.edit31:setVertTextAlign("center");
obj.edit31:setName("edit31");
obj.layout19 = gui.fromHandle(_obj_newObject("layout"));
obj.layout19:setParent(obj.layout17);
obj.layout19:setLeft(230);
obj.layout19:setTop(0);
obj.layout19:setWidth(225);
obj.layout19:setHeight(60);
obj.layout19:setName("layout19");
obj.rectangle36 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle36:setParent(obj.layout19);
obj.rectangle36:setLeft(4);
obj.rectangle36:setTop(4);
obj.rectangle36:setWidth(52);
obj.rectangle36:setHeight(52);
obj.rectangle36:setColor("black");
obj.rectangle36:setStrokeColor("white");
obj.rectangle36:setStrokeSize(1);
obj.rectangle36:setName("rectangle36");
obj.image3 = gui.fromHandle(_obj_newObject("image"));
obj.image3:setParent(obj.layout19);
obj.image3:setLeft(10);
obj.image3:setTop(10);
obj.image3:setWidth(40);
obj.image3:setHeight(40);
obj.image3:setSRC("/Cyberpunk2020/images/pistol.png");
obj.image3:setName("image3");
obj.rectangle37 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle37:setParent(obj.layout19);
obj.rectangle37:setLeft(54);
obj.rectangle37:setTop(4);
obj.rectangle37:setWidth(52);
obj.rectangle37:setHeight(52);
obj.rectangle37:setColor("black");
obj.rectangle37:setStrokeColor("white");
obj.rectangle37:setStrokeSize(1);
obj.rectangle37:setName("rectangle37");
obj.edit32 = gui.fromHandle(_obj_newObject("edit"));
obj.edit32:setParent(obj.layout19);
obj.edit32:setLeft(60);
obj.edit32:setTop(10);
obj.edit32:setWidth(40);
obj.edit32:setHeight(40);
obj.edit32:setField("pistol");
obj.edit32:setHorzTextAlign("center");
obj.edit32:setVertTextAlign("center");
obj.edit32:setFontSize(20);
obj.edit32:setTransparent(true);
obj.edit32:setName("edit32");
obj.label126 = gui.fromHandle(_obj_newObject("label"));
obj.label126:setParent(obj.layout19);
obj.label126:setLeft(110);
obj.label126:setTop(5);
obj.label126:setWidth(80);
obj.label126:setHeight(20);
obj.label126:setText("Links");
obj.label126:setHorzTextAlign("trailing");
obj.label126:setName("label126");
obj.edit33 = gui.fromHandle(_obj_newObject("edit"));
obj.edit33:setParent(obj.layout19);
obj.edit33:setLeft(195);
obj.edit33:setTop(5);
obj.edit33:setWidth(30);
obj.edit33:setHeight(25);
obj.edit33:setField("pistol_link");
obj.edit33:setHorzTextAlign("center");
obj.edit33:setVertTextAlign("center");
obj.edit33:setName("edit33");
obj.label127 = gui.fromHandle(_obj_newObject("label"));
obj.label127:setParent(obj.layout19);
obj.label127:setLeft(110);
obj.label127:setTop(30);
obj.label127:setWidth(80);
obj.label127:setHeight(20);
obj.label127:setText("Computador");
obj.label127:setHorzTextAlign("trailing");
obj.label127:setName("label127");
obj.edit34 = gui.fromHandle(_obj_newObject("edit"));
obj.edit34:setParent(obj.layout19);
obj.edit34:setLeft(195);
obj.edit34:setTop(30);
obj.edit34:setWidth(30);
obj.edit34:setHeight(25);
obj.edit34:setField("pistol_computer");
obj.edit34:setHorzTextAlign("center");
obj.edit34:setVertTextAlign("center");
obj.edit34:setName("edit34");
obj.layout20 = gui.fromHandle(_obj_newObject("layout"));
obj.layout20:setParent(obj.layout17);
obj.layout20:setLeft(460);
obj.layout20:setTop(0);
obj.layout20:setWidth(115);
obj.layout20:setHeight(60);
obj.layout20:setName("layout20");
obj.rectangle38 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle38:setParent(obj.layout20);
obj.rectangle38:setLeft(4);
obj.rectangle38:setTop(4);
obj.rectangle38:setWidth(52);
obj.rectangle38:setHeight(52);
obj.rectangle38:setColor("black");
obj.rectangle38:setStrokeColor("white");
obj.rectangle38:setStrokeSize(1);
obj.rectangle38:setName("rectangle38");
obj.image4 = gui.fromHandle(_obj_newObject("image"));
obj.image4:setParent(obj.layout20);
obj.image4:setLeft(10);
obj.image4:setTop(10);
obj.image4:setWidth(40);
obj.image4:setHeight(40);
obj.image4:setSRC("/Cyberpunk2020/images/heart.png");
obj.image4:setName("image4");
obj.rectangle39 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle39:setParent(obj.layout20);
obj.rectangle39:setLeft(54);
obj.rectangle39:setTop(4);
obj.rectangle39:setWidth(52);
obj.rectangle39:setHeight(52);
obj.rectangle39:setColor("black");
obj.rectangle39:setStrokeColor("white");
obj.rectangle39:setStrokeSize(1);
obj.rectangle39:setName("rectangle39");
obj.edit35 = gui.fromHandle(_obj_newObject("edit"));
obj.edit35:setParent(obj.layout20);
obj.edit35:setLeft(60);
obj.edit35:setTop(10);
obj.edit35:setWidth(40);
obj.edit35:setHeight(40);
obj.edit35:setField("heart");
obj.edit35:setHorzTextAlign("center");
obj.edit35:setVertTextAlign("center");
obj.edit35:setFontSize(20);
obj.edit35:setTransparent(true);
obj.edit35:setName("edit35");
obj.layout21 = gui.fromHandle(_obj_newObject("layout"));
obj.layout21:setParent(obj.scrollBox5);
obj.layout21:setLeft(0);
obj.layout21:setTop(70);
obj.layout21:setWidth(170);
obj.layout21:setHeight(135);
obj.layout21:setName("layout21");
obj.rectangle40 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle40:setParent(obj.layout21);
obj.rectangle40:setAlign("client");
obj.rectangle40:setColor("black");
obj.rectangle40:setName("rectangle40");
obj.radioButton1 = gui.fromHandle(_obj_newObject("radioButton"));
obj.radioButton1:setParent(obj.layout21);
obj.radioButton1:setLeft(5);
obj.radioButton1:setTop(5);
obj.radioButton1:setWidth(60);
obj.radioButton1:setHeight(20);
obj.radioButton1:setField("marcha1");
obj.radioButton1:setText("1º - R");
obj.radioButton1:setGroupName("marcha");
obj.radioButton1:setName("radioButton1");
obj.edit36 = gui.fromHandle(_obj_newObject("edit"));
obj.edit36:setParent(obj.layout21);
obj.edit36:setLeft(65);
obj.edit36:setTop(5);
obj.edit36:setWidth(100);
obj.edit36:setHeight(25);
obj.edit36:setField("marcha1_details");
obj.edit36:setName("edit36");
obj.radioButton2 = gui.fromHandle(_obj_newObject("radioButton"));
obj.radioButton2:setParent(obj.layout21);
obj.radioButton2:setLeft(5);
obj.radioButton2:setTop(30);
obj.radioButton2:setWidth(60);
obj.radioButton2:setHeight(20);
obj.radioButton2:setField("marcha2");
obj.radioButton2:setText("2º");
obj.radioButton2:setGroupName("marcha");
obj.radioButton2:setName("radioButton2");
obj.edit37 = gui.fromHandle(_obj_newObject("edit"));
obj.edit37:setParent(obj.layout21);
obj.edit37:setLeft(65);
obj.edit37:setTop(30);
obj.edit37:setWidth(100);
obj.edit37:setHeight(25);
obj.edit37:setField("marcha2_details");
obj.edit37:setName("edit37");
obj.radioButton3 = gui.fromHandle(_obj_newObject("radioButton"));
obj.radioButton3:setParent(obj.layout21);
obj.radioButton3:setLeft(5);
obj.radioButton3:setTop(55);
obj.radioButton3:setWidth(60);
obj.radioButton3:setHeight(20);
obj.radioButton3:setField("marcha3");
obj.radioButton3:setText("3º");
obj.radioButton3:setGroupName("marcha");
obj.radioButton3:setName("radioButton3");
obj.edit38 = gui.fromHandle(_obj_newObject("edit"));
obj.edit38:setParent(obj.layout21);
obj.edit38:setLeft(65);
obj.edit38:setTop(55);
obj.edit38:setWidth(100);
obj.edit38:setHeight(25);
obj.edit38:setField("marcha3_details");
obj.edit38:setName("edit38");
obj.radioButton4 = gui.fromHandle(_obj_newObject("radioButton"));
obj.radioButton4:setParent(obj.layout21);
obj.radioButton4:setLeft(5);
obj.radioButton4:setTop(80);
obj.radioButton4:setWidth(60);
obj.radioButton4:setHeight(20);
obj.radioButton4:setField("marcha4");
obj.radioButton4:setText("4º");
obj.radioButton4:setGroupName("marcha");
obj.radioButton4:setName("radioButton4");
obj.edit39 = gui.fromHandle(_obj_newObject("edit"));
obj.edit39:setParent(obj.layout21);
obj.edit39:setLeft(65);
obj.edit39:setTop(80);
obj.edit39:setWidth(100);
obj.edit39:setHeight(25);
obj.edit39:setField("marcha4_details");
obj.edit39:setName("edit39");
obj.radioButton5 = gui.fromHandle(_obj_newObject("radioButton"));
obj.radioButton5:setParent(obj.layout21);
obj.radioButton5:setLeft(5);
obj.radioButton5:setTop(105);
obj.radioButton5:setWidth(60);
obj.radioButton5:setHeight(20);
obj.radioButton5:setField("marcha5");
obj.radioButton5:setText("5º");
obj.radioButton5:setGroupName("marcha");
obj.radioButton5:setName("radioButton5");
obj.edit40 = gui.fromHandle(_obj_newObject("edit"));
obj.edit40:setParent(obj.layout21);
obj.edit40:setLeft(65);
obj.edit40:setTop(105);
obj.edit40:setWidth(100);
obj.edit40:setHeight(25);
obj.edit40:setField("marcha5_details");
obj.edit40:setName("edit40");
obj.layout22 = gui.fromHandle(_obj_newObject("layout"));
obj.layout22:setParent(obj.scrollBox5);
obj.layout22:setLeft(0);
obj.layout22:setTop(215);
obj.layout22:setWidth(170);
obj.layout22:setHeight(160);
obj.layout22:setName("layout22");
obj.rectangle41 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle41:setParent(obj.layout22);
obj.rectangle41:setAlign("client");
obj.rectangle41:setColor("black");
obj.rectangle41:setName("rectangle41");
obj.label128 = gui.fromHandle(_obj_newObject("label"));
obj.label128:setParent(obj.layout22);
obj.label128:setLeft(5);
obj.label128:setTop(5);
obj.label128:setWidth(80);
obj.label128:setHeight(20);
obj.label128:setText("Estrutura");
obj.label128:setHorzTextAlign("center");
obj.label128:setName("label128");
obj.edit41 = gui.fromHandle(_obj_newObject("edit"));
obj.edit41:setParent(obj.layout22);
obj.edit41:setLeft(85);
obj.edit41:setTop(5);
obj.edit41:setWidth(40);
obj.edit41:setHeight(25);
obj.edit41:setField("estrutura_atual");
obj.edit41:setName("edit41");
obj.edit42 = gui.fromHandle(_obj_newObject("edit"));
obj.edit42:setParent(obj.layout22);
obj.edit42:setLeft(125);
obj.edit42:setTop(5);
obj.edit42:setWidth(40);
obj.edit42:setHeight(25);
obj.edit42:setField("estrutura_total");
obj.edit42:setName("edit42");
obj.label129 = gui.fromHandle(_obj_newObject("label"));
obj.label129:setParent(obj.layout22);
obj.label129:setLeft(5);
obj.label129:setTop(30);
obj.label129:setWidth(80);
obj.label129:setHeight(20);
obj.label129:setText("Frontal");
obj.label129:setHorzTextAlign("center");
obj.label129:setName("label129");
obj.edit43 = gui.fromHandle(_obj_newObject("edit"));
obj.edit43:setParent(obj.layout22);
obj.edit43:setLeft(85);
obj.edit43:setTop(30);
obj.edit43:setWidth(40);
obj.edit43:setHeight(25);
obj.edit43:setField("estrutura_frontal_atual");
obj.edit43:setName("edit43");
obj.edit44 = gui.fromHandle(_obj_newObject("edit"));
obj.edit44:setParent(obj.layout22);
obj.edit44:setLeft(125);
obj.edit44:setTop(30);
obj.edit44:setWidth(40);
obj.edit44:setHeight(25);
obj.edit44:setField("estrutura_frontal_total");
obj.edit44:setName("edit44");
obj.label130 = gui.fromHandle(_obj_newObject("label"));
obj.label130:setParent(obj.layout22);
obj.label130:setLeft(5);
obj.label130:setTop(55);
obj.label130:setWidth(80);
obj.label130:setHeight(20);
obj.label130:setText("Esquerda");
obj.label130:setHorzTextAlign("center");
obj.label130:setName("label130");
obj.edit45 = gui.fromHandle(_obj_newObject("edit"));
obj.edit45:setParent(obj.layout22);
obj.edit45:setLeft(85);
obj.edit45:setTop(55);
obj.edit45:setWidth(40);
obj.edit45:setHeight(25);
obj.edit45:setField("estrutura_esquerda_atual");
obj.edit45:setName("edit45");
obj.edit46 = gui.fromHandle(_obj_newObject("edit"));
obj.edit46:setParent(obj.layout22);
obj.edit46:setLeft(125);
obj.edit46:setTop(55);
obj.edit46:setWidth(40);
obj.edit46:setHeight(25);
obj.edit46:setField("estrutura_esquerda_total");
obj.edit46:setName("edit46");
obj.label131 = gui.fromHandle(_obj_newObject("label"));
obj.label131:setParent(obj.layout22);
obj.label131:setLeft(5);
obj.label131:setTop(80);
obj.label131:setWidth(80);
obj.label131:setHeight(20);
obj.label131:setText("Direita");
obj.label131:setHorzTextAlign("center");
obj.label131:setName("label131");
obj.edit47 = gui.fromHandle(_obj_newObject("edit"));
obj.edit47:setParent(obj.layout22);
obj.edit47:setLeft(85);
obj.edit47:setTop(80);
obj.edit47:setWidth(40);
obj.edit47:setHeight(25);
obj.edit47:setField("estrutura_direita_atual");
obj.edit47:setName("edit47");
obj.edit48 = gui.fromHandle(_obj_newObject("edit"));
obj.edit48:setParent(obj.layout22);
obj.edit48:setLeft(125);
obj.edit48:setTop(80);
obj.edit48:setWidth(40);
obj.edit48:setHeight(25);
obj.edit48:setField("estrutura_direita_total");
obj.edit48:setName("edit48");
obj.label132 = gui.fromHandle(_obj_newObject("label"));
obj.label132:setParent(obj.layout22);
obj.label132:setLeft(5);
obj.label132:setTop(105);
obj.label132:setWidth(80);
obj.label132:setHeight(20);
obj.label132:setText("Traseira");
obj.label132:setHorzTextAlign("center");
obj.label132:setName("label132");
obj.edit49 = gui.fromHandle(_obj_newObject("edit"));
obj.edit49:setParent(obj.layout22);
obj.edit49:setLeft(85);
obj.edit49:setTop(105);
obj.edit49:setWidth(40);
obj.edit49:setHeight(25);
obj.edit49:setField("estrutura_traseira_atual");
obj.edit49:setName("edit49");
obj.edit50 = gui.fromHandle(_obj_newObject("edit"));
obj.edit50:setParent(obj.layout22);
obj.edit50:setLeft(125);
obj.edit50:setTop(105);
obj.edit50:setWidth(40);
obj.edit50:setHeight(25);
obj.edit50:setField("estrutura_traseira_total");
obj.edit50:setName("edit50");
obj.label133 = gui.fromHandle(_obj_newObject("label"));
obj.label133:setParent(obj.layout22);
obj.label133:setLeft(5);
obj.label133:setTop(130);
obj.label133:setWidth(80);
obj.label133:setHeight(20);
obj.label133:setText("Interna");
obj.label133:setHorzTextAlign("center");
obj.label133:setName("label133");
obj.edit51 = gui.fromHandle(_obj_newObject("edit"));
obj.edit51:setParent(obj.layout22);
obj.edit51:setLeft(85);
obj.edit51:setTop(130);
obj.edit51:setWidth(40);
obj.edit51:setHeight(25);
obj.edit51:setField("estrutura_interna_atual");
obj.edit51:setName("edit51");
obj.edit52 = gui.fromHandle(_obj_newObject("edit"));
obj.edit52:setParent(obj.layout22);
obj.edit52:setLeft(125);
obj.edit52:setTop(130);
obj.edit52:setWidth(40);
obj.edit52:setHeight(25);
obj.edit52:setField("estrutura_interna_total");
obj.edit52:setName("edit52");
obj.layout23 = gui.fromHandle(_obj_newObject("layout"));
obj.layout23:setParent(obj.scrollBox5);
obj.layout23:setLeft(180);
obj.layout23:setTop(70);
obj.layout23:setWidth(760);
obj.layout23:setHeight(305);
obj.layout23:setName("layout23");
obj.rectangle42 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle42:setParent(obj.layout23);
obj.rectangle42:setAlign("client");
obj.rectangle42:setColor("black");
obj.rectangle42:setName("rectangle42");
obj.label134 = gui.fromHandle(_obj_newObject("label"));
obj.label134:setParent(obj.layout23);
obj.label134:setText("ARMA");
obj.label134:setLeft(5);
obj.label134:setTop(1);
obj.label134:setWidth(150);
obj.label134:setHeight(20);
obj.label134:setHorzTextAlign("center");
obj.label134:setName("label134");
obj.label135 = gui.fromHandle(_obj_newObject("label"));
obj.label135:setParent(obj.layout23);
obj.label135:setText("TIPO");
obj.label135:setLeft(155);
obj.label135:setTop(1);
obj.label135:setWidth(50);
obj.label135:setHeight(20);
obj.label135:setHorzTextAlign("center");
obj.label135:setName("label135");
obj.label136 = gui.fromHandle(_obj_newObject("label"));
obj.label136:setParent(obj.layout23);
obj.label136:setText("PRECISÃO");
obj.label136:setLeft(205);
obj.label136:setTop(1);
obj.label136:setWidth(50);
obj.label136:setHeight(20);
obj.label136:setHorzTextAlign("center");
obj.label136:setFontSize(11);
obj.label136:setName("label136");
obj.label137 = gui.fromHandle(_obj_newObject("label"));
obj.label137:setParent(obj.layout23);
obj.label137:setText("OCULT.");
obj.label137:setLeft(255);
obj.label137:setTop(1);
obj.label137:setWidth(50);
obj.label137:setHeight(20);
obj.label137:setHorzTextAlign("center");
obj.label137:setFontSize(12);
obj.label137:setName("label137");
obj.label138 = gui.fromHandle(_obj_newObject("label"));
obj.label138:setParent(obj.layout23);
obj.label138:setText("DISP.");
obj.label138:setLeft(305);
obj.label138:setTop(1);
obj.label138:setWidth(50);
obj.label138:setHeight(20);
obj.label138:setHorzTextAlign("center");
obj.label138:setName("label138");
obj.label139 = gui.fromHandle(_obj_newObject("label"));
obj.label139:setParent(obj.layout23);
obj.label139:setText("DANO");
obj.label139:setLeft(355);
obj.label139:setTop(1);
obj.label139:setWidth(50);
obj.label139:setHeight(20);
obj.label139:setHorzTextAlign("center");
obj.label139:setName("label139");
obj.label140 = gui.fromHandle(_obj_newObject("label"));
obj.label140:setParent(obj.layout23);
obj.label140:setText("Nº DISP.");
obj.label140:setLeft(405);
obj.label140:setTop(1);
obj.label140:setWidth(50);
obj.label140:setHeight(20);
obj.label140:setHorzTextAlign("center");
obj.label140:setFontSize(11);
obj.label140:setName("label140");
obj.label141 = gui.fromHandle(_obj_newObject("label"));
obj.label141:setParent(obj.layout23);
obj.label141:setText("CD TIRO");
obj.label141:setLeft(455);
obj.label141:setTop(1);
obj.label141:setWidth(50);
obj.label141:setHeight(20);
obj.label141:setHorzTextAlign("center");
obj.label141:setFontSize(11);
obj.label141:setName("label141");
obj.label142 = gui.fromHandle(_obj_newObject("label"));
obj.label142:setParent(obj.layout23);
obj.label142:setText("CONF.");
obj.label142:setLeft(505);
obj.label142:setTop(1);
obj.label142:setWidth(50);
obj.label142:setHeight(20);
obj.label142:setHorzTextAlign("center");
obj.label142:setName("label142");
obj.label143 = gui.fromHandle(_obj_newObject("label"));
obj.label143:setParent(obj.layout23);
obj.label143:setText("ALCANCE");
obj.label143:setLeft(555);
obj.label143:setTop(1);
obj.label143:setWidth(50);
obj.label143:setHeight(20);
obj.label143:setHorzTextAlign("center");
obj.label143:setFontSize(11);
obj.label143:setName("label143");
obj.label144 = gui.fromHandle(_obj_newObject("label"));
obj.label144:setParent(obj.layout23);
obj.label144:setText("PREÇO");
obj.label144:setLeft(605);
obj.label144:setTop(1);
obj.label144:setWidth(50);
obj.label144:setHeight(20);
obj.label144:setHorzTextAlign("center");
obj.label144:setName("label144");
obj.label145 = gui.fromHandle(_obj_newObject("label"));
obj.label145:setParent(obj.layout23);
obj.label145:setText("POS.");
obj.label145:setLeft(655);
obj.label145:setTop(1);
obj.label145:setWidth(50);
obj.label145:setHeight(20);
obj.label145:setHorzTextAlign("center");
obj.label145:setName("label145");
obj.button8 = gui.fromHandle(_obj_newObject("button"));
obj.button8:setParent(obj.layout23);
obj.button8:setText("+");
obj.button8:setLeft(705);
obj.button8:setTop(0);
obj.button8:setWidth(25);
obj.button8:setHeight(25);
obj.button8:setName("button8");
obj.rclVehicleWeapon = gui.fromHandle(_obj_newObject("recordList"));
obj.rclVehicleWeapon:setParent(obj.layout23);
obj.rclVehicleWeapon:setName("rclVehicleWeapon");
obj.rclVehicleWeapon:setField("vehicleWeaponList");
obj.rclVehicleWeapon:setTemplateForm("frmVehicleWeapon");
obj.rclVehicleWeapon:setLeft(5);
obj.rclVehicleWeapon:setTop(25);
obj.rclVehicleWeapon:setWidth(750);
obj.rclVehicleWeapon:setHeight(270);
obj.rclVehicleWeapon:setLayout("vertical");
obj.rectangle43 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle43:setParent(obj.scrollBox5);
obj.rectangle43:setLeft(0);
obj.rectangle43:setTop(385);
obj.rectangle43:setWidth(250);
obj.rectangle43:setHeight(250);
obj.rectangle43:setColor("black");
obj.rectangle43:setStrokeColor("white");
obj.rectangle43:setStrokeSize(1);
obj.rectangle43:setName("rectangle43");
obj.label146 = gui.fromHandle(_obj_newObject("label"));
obj.label146:setParent(obj.rectangle43);
obj.label146:setLeft(0);
obj.label146:setTop(40);
obj.label146:setWidth(250);
obj.label146:setHeight(20);
obj.label146:setText("Veículo");
obj.label146:setHorzTextAlign("center");
obj.label146:setName("label146");
obj.image5 = gui.fromHandle(_obj_newObject("image"));
obj.image5:setParent(obj.rectangle43);
obj.image5:setAlign("client");
obj.image5:setField("vehicleAvatar");
obj.image5:setEditable(true);
obj.image5:setStyle("autoFit");
obj.image5:setMargins({left=2, right=2, top=2, bottom=2});
obj.image5:setName("image5");
obj.tab6 = gui.fromHandle(_obj_newObject("tab"));
obj.tab6:setParent(obj.tabControl1);
obj.tab6:setTitle("Descrição");
obj.tab6:setName("tab6");
obj.frmTemplateDescription = gui.fromHandle(_obj_newObject("form"));
obj.frmTemplateDescription:setParent(obj.tab6);
obj.frmTemplateDescription:setName("frmTemplateDescription");
obj.frmTemplateDescription:setAlign("client");
obj.scrollBox6 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox6:setParent(obj.frmTemplateDescription);
obj.scrollBox6:setAlign("client");
obj.scrollBox6:setName("scrollBox6");
obj.rectangle44 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle44:setParent(obj.scrollBox6);
obj.rectangle44:setLeft(0);
obj.rectangle44:setTop(0);
obj.rectangle44:setWidth(1205);
obj.rectangle44:setHeight(105);
obj.rectangle44:setColor("black");
obj.rectangle44:setName("rectangle44");
obj.label147 = gui.fromHandle(_obj_newObject("label"));
obj.label147:setParent(obj.rectangle44);
obj.label147:setLeft(3);
obj.label147:setTop(1);
obj.label147:setWidth(100);
obj.label147:setHeight(20);
obj.label147:setText("DESCRIÇÃO");
obj.label147:setName("label147");
obj.label148 = gui.fromHandle(_obj_newObject("label"));
obj.label148:setParent(obj.rectangle44);
obj.label148:setLeft(10);
obj.label148:setTop(25);
obj.label148:setWidth(90);
obj.label148:setHeight(20);
obj.label148:setText("TAMANHO");
obj.label148:setHorzTextAlign("center");
obj.label148:setName("label148");
obj.edit53 = gui.fromHandle(_obj_newObject("edit"));
obj.edit53:setParent(obj.rectangle44);
obj.edit53:setLeft(100);
obj.edit53:setTop(25);
obj.edit53:setWidth(200);
obj.edit53:setHeight(25);
obj.edit53:setField("tamanho");
obj.edit53:setVertTextAlign("center");
obj.edit53:setName("edit53");
obj.label149 = gui.fromHandle(_obj_newObject("label"));
obj.label149:setParent(obj.rectangle44);
obj.label149:setLeft(10);
obj.label149:setTop(50);
obj.label149:setWidth(90);
obj.label149:setHeight(20);
obj.label149:setText("ALTURA");
obj.label149:setHorzTextAlign("center");
obj.label149:setName("label149");
obj.edit54 = gui.fromHandle(_obj_newObject("edit"));
obj.edit54:setParent(obj.rectangle44);
obj.edit54:setLeft(100);
obj.edit54:setTop(50);
obj.edit54:setWidth(200);
obj.edit54:setHeight(25);
obj.edit54:setField("altura");
obj.edit54:setVertTextAlign("center");
obj.edit54:setName("edit54");
obj.label150 = gui.fromHandle(_obj_newObject("label"));
obj.label150:setParent(obj.rectangle44);
obj.label150:setLeft(10);
obj.label150:setTop(75);
obj.label150:setWidth(90);
obj.label150:setHeight(20);
obj.label150:setText("PESO");
obj.label150:setHorzTextAlign("center");
obj.label150:setName("label150");
obj.edit55 = gui.fromHandle(_obj_newObject("edit"));
obj.edit55:setParent(obj.rectangle44);
obj.edit55:setLeft(100);
obj.edit55:setTop(75);
obj.edit55:setWidth(200);
obj.edit55:setHeight(25);
obj.edit55:setField("peso");
obj.edit55:setVertTextAlign("center");
obj.edit55:setName("edit55");
obj.label151 = gui.fromHandle(_obj_newObject("label"));
obj.label151:setParent(obj.rectangle44);
obj.label151:setLeft(310);
obj.label151:setTop(25);
obj.label151:setWidth(90);
obj.label151:setHeight(20);
obj.label151:setText("IDADE");
obj.label151:setHorzTextAlign("center");
obj.label151:setName("label151");
obj.edit56 = gui.fromHandle(_obj_newObject("edit"));
obj.edit56:setParent(obj.rectangle44);
obj.edit56:setLeft(400);
obj.edit56:setTop(25);
obj.edit56:setWidth(200);
obj.edit56:setHeight(25);
obj.edit56:setField("idade");
obj.edit56:setVertTextAlign("center");
obj.edit56:setName("edit56");
obj.label152 = gui.fromHandle(_obj_newObject("label"));
obj.label152:setParent(obj.rectangle44);
obj.label152:setLeft(310);
obj.label152:setTop(50);
obj.label152:setWidth(90);
obj.label152:setHeight(20);
obj.label152:setText("SEXO");
obj.label152:setHorzTextAlign("center");
obj.label152:setName("label152");
obj.edit57 = gui.fromHandle(_obj_newObject("edit"));
obj.edit57:setParent(obj.rectangle44);
obj.edit57:setLeft(400);
obj.edit57:setTop(50);
obj.edit57:setWidth(200);
obj.edit57:setHeight(25);
obj.edit57:setField("sexo");
obj.edit57:setVertTextAlign("center");
obj.edit57:setName("edit57");
obj.label153 = gui.fromHandle(_obj_newObject("label"));
obj.label153:setParent(obj.rectangle44);
obj.label153:setLeft(310);
obj.label153:setTop(75);
obj.label153:setWidth(90);
obj.label153:setHeight(20);
obj.label153:setText("OUTROS");
obj.label153:setHorzTextAlign("center");
obj.label153:setName("label153");
obj.edit58 = gui.fromHandle(_obj_newObject("edit"));
obj.edit58:setParent(obj.rectangle44);
obj.edit58:setLeft(400);
obj.edit58:setTop(75);
obj.edit58:setWidth(200);
obj.edit58:setHeight(25);
obj.edit58:setField("aparenciaOutros");
obj.edit58:setVertTextAlign("center");
obj.edit58:setName("edit58");
obj.label154 = gui.fromHandle(_obj_newObject("label"));
obj.label154:setParent(obj.rectangle44);
obj.label154:setLeft(610);
obj.label154:setTop(25);
obj.label154:setWidth(90);
obj.label154:setHeight(20);
obj.label154:setText("OLHOS");
obj.label154:setHorzTextAlign("center");
obj.label154:setName("label154");
obj.edit59 = gui.fromHandle(_obj_newObject("edit"));
obj.edit59:setParent(obj.rectangle44);
obj.edit59:setLeft(700);
obj.edit59:setTop(25);
obj.edit59:setWidth(200);
obj.edit59:setHeight(25);
obj.edit59:setField("aparenciaOlhos");
obj.edit59:setVertTextAlign("center");
obj.edit59:setName("edit59");
obj.label155 = gui.fromHandle(_obj_newObject("label"));
obj.label155:setParent(obj.rectangle44);
obj.label155:setLeft(610);
obj.label155:setTop(50);
obj.label155:setWidth(90);
obj.label155:setHeight(20);
obj.label155:setText("PELE");
obj.label155:setHorzTextAlign("center");
obj.label155:setName("label155");
obj.edit60 = gui.fromHandle(_obj_newObject("edit"));
obj.edit60:setParent(obj.rectangle44);
obj.edit60:setLeft(700);
obj.edit60:setTop(50);
obj.edit60:setWidth(200);
obj.edit60:setHeight(25);
obj.edit60:setField("pele");
obj.edit60:setVertTextAlign("center");
obj.edit60:setName("edit60");
obj.label156 = gui.fromHandle(_obj_newObject("label"));
obj.label156:setParent(obj.rectangle44);
obj.label156:setLeft(610);
obj.label156:setTop(75);
obj.label156:setWidth(90);
obj.label156:setHeight(20);
obj.label156:setText("CABELO");
obj.label156:setHorzTextAlign("center");
obj.label156:setName("label156");
obj.edit61 = gui.fromHandle(_obj_newObject("edit"));
obj.edit61:setParent(obj.rectangle44);
obj.edit61:setLeft(700);
obj.edit61:setTop(75);
obj.edit61:setWidth(200);
obj.edit61:setHeight(25);
obj.edit61:setField("cabelo");
obj.edit61:setVertTextAlign("center");
obj.edit61:setName("edit61");
obj.label157 = gui.fromHandle(_obj_newObject("label"));
obj.label157:setParent(obj.rectangle44);
obj.label157:setLeft(910);
obj.label157:setTop(25);
obj.label157:setWidth(90);
obj.label157:setHeight(20);
obj.label157:setText("MARCAS");
obj.label157:setHorzTextAlign("center");
obj.label157:setName("label157");
obj.edit62 = gui.fromHandle(_obj_newObject("edit"));
obj.edit62:setParent(obj.rectangle44);
obj.edit62:setLeft(1000);
obj.edit62:setTop(25);
obj.edit62:setWidth(200);
obj.edit62:setHeight(25);
obj.edit62:setField("marcas");
obj.edit62:setVertTextAlign("center");
obj.edit62:setName("edit62");
obj.label158 = gui.fromHandle(_obj_newObject("label"));
obj.label158:setParent(obj.rectangle44);
obj.label158:setLeft(910);
obj.label158:setTop(50);
obj.label158:setWidth(90);
obj.label158:setHeight(20);
obj.label158:setText("VESTUARIO");
obj.label158:setHorzTextAlign("center");
obj.label158:setName("label158");
obj.edit63 = gui.fromHandle(_obj_newObject("edit"));
obj.edit63:setParent(obj.rectangle44);
obj.edit63:setLeft(1000);
obj.edit63:setTop(50);
obj.edit63:setWidth(200);
obj.edit63:setHeight(25);
obj.edit63:setField("vestuario");
obj.edit63:setVertTextAlign("center");
obj.edit63:setName("edit63");
obj.label159 = gui.fromHandle(_obj_newObject("label"));
obj.label159:setParent(obj.rectangle44);
obj.label159:setLeft(910);
obj.label159:setTop(75);
obj.label159:setWidth(90);
obj.label159:setHeight(20);
obj.label159:setText("ANTECEDENTE");
obj.label159:setHorzTextAlign("center");
obj.label159:setName("label159");
obj.edit64 = gui.fromHandle(_obj_newObject("edit"));
obj.edit64:setParent(obj.rectangle44);
obj.edit64:setLeft(1000);
obj.edit64:setTop(75);
obj.edit64:setWidth(200);
obj.edit64:setHeight(25);
obj.edit64:setField("antecedente");
obj.edit64:setVertTextAlign("center");
obj.edit64:setName("edit64");
obj.layout24 = gui.fromHandle(_obj_newObject("layout"));
obj.layout24:setParent(obj.scrollBox6);
obj.layout24:setLeft(0);
obj.layout24:setTop(110);
obj.layout24:setWidth(375);
obj.layout24:setHeight(140);
obj.layout24:setName("layout24");
obj.rectangle45 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle45:setParent(obj.layout24);
obj.rectangle45:setAlign("client");
obj.rectangle45:setColor("black");
obj.rectangle45:setName("rectangle45");
obj.label160 = gui.fromHandle(_obj_newObject("label"));
obj.label160:setParent(obj.layout24);
obj.label160:setLeft(5);
obj.label160:setTop(1);
obj.label160:setWidth(100);
obj.label160:setHeight(20);
obj.label160:setText("APARÊNCIA");
obj.label160:setName("label160");
obj.textEditor4 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor4:setParent(obj.layout24);
obj.textEditor4:setLeft(5);
obj.textEditor4:setTop(25);
obj.textEditor4:setWidth(365);
obj.textEditor4:setHeight(100);
obj.textEditor4:setField("aparencia");
obj.textEditor4:setName("textEditor4");
obj.layout25 = gui.fromHandle(_obj_newObject("layout"));
obj.layout25:setParent(obj.scrollBox6);
obj.layout25:setLeft(0);
obj.layout25:setTop(255);
obj.layout25:setWidth(375);
obj.layout25:setHeight(140);
obj.layout25:setName("layout25");
obj.rectangle46 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle46:setParent(obj.layout25);
obj.rectangle46:setAlign("client");
obj.rectangle46:setColor("black");
obj.rectangle46:setName("rectangle46");
obj.label161 = gui.fromHandle(_obj_newObject("label"));
obj.label161:setParent(obj.layout25);
obj.label161:setLeft(5);
obj.label161:setTop(1);
obj.label161:setWidth(100);
obj.label161:setHeight(20);
obj.label161:setText("PERSONALIDADE");
obj.label161:setName("label161");
obj.textEditor5 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor5:setParent(obj.layout25);
obj.textEditor5:setLeft(5);
obj.textEditor5:setTop(25);
obj.textEditor5:setWidth(365);
obj.textEditor5:setHeight(100);
obj.textEditor5:setField("personalidade");
obj.textEditor5:setName("textEditor5");
obj.layout26 = gui.fromHandle(_obj_newObject("layout"));
obj.layout26:setParent(obj.scrollBox6);
obj.layout26:setLeft(0);
obj.layout26:setTop(400);
obj.layout26:setWidth(375);
obj.layout26:setHeight(140);
obj.layout26:setName("layout26");
obj.rectangle47 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle47:setParent(obj.layout26);
obj.rectangle47:setAlign("client");
obj.rectangle47:setColor("black");
obj.rectangle47:setName("rectangle47");
obj.label162 = gui.fromHandle(_obj_newObject("label"));
obj.label162:setParent(obj.layout26);
obj.label162:setLeft(5);
obj.label162:setTop(1);
obj.label162:setWidth(100);
obj.label162:setHeight(20);
obj.label162:setText("IDIOMAS");
obj.label162:setName("label162");
obj.textEditor6 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor6:setParent(obj.layout26);
obj.textEditor6:setLeft(5);
obj.textEditor6:setTop(25);
obj.textEditor6:setWidth(365);
obj.textEditor6:setHeight(100);
obj.textEditor6:setField("idiomas");
obj.textEditor6:setName("textEditor6");
obj.layout27 = gui.fromHandle(_obj_newObject("layout"));
obj.layout27:setParent(obj.scrollBox6);
obj.layout27:setLeft(380);
obj.layout27:setTop(110);
obj.layout27:setWidth(825);
obj.layout27:setHeight(495);
obj.layout27:setName("layout27");
obj.rectangle48 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle48:setParent(obj.layout27);
obj.rectangle48:setAlign("client");
obj.rectangle48:setColor("black");
obj.rectangle48:setName("rectangle48");
obj.label163 = gui.fromHandle(_obj_newObject("label"));
obj.label163:setParent(obj.layout27);
obj.label163:setLeft(5);
obj.label163:setTop(1);
obj.label163:setWidth(100);
obj.label163:setHeight(20);
obj.label163:setText("HISTORIA");
obj.label163:setName("label163");
obj.richEdit1 = gui.fromHandle(_obj_newObject("richEdit"));
obj.richEdit1:setParent(obj.layout27);
obj.richEdit1:setLeft(5);
obj.richEdit1:setTop(25);
obj.richEdit1:setWidth(815);
obj.richEdit1:setHeight(465);
obj.richEdit1:setField("background");
lfm_setPropAsString(obj.richEdit1, "backgroundColor", "#333333");
lfm_setPropAsString(obj.richEdit1, "defaultFontSize", "12");
lfm_setPropAsString(obj.richEdit1, "defaultFontColor", "white");
obj.richEdit1:setName("richEdit1");
obj.tab7 = gui.fromHandle(_obj_newObject("tab"));
obj.tab7:setParent(obj.tabControl1);
obj.tab7:setTitle("Anotações");
obj.tab7:setName("tab7");
obj.frmTemplateNotes = gui.fromHandle(_obj_newObject("form"));
obj.frmTemplateNotes:setParent(obj.tab7);
obj.frmTemplateNotes:setName("frmTemplateNotes");
obj.frmTemplateNotes:setAlign("client");
obj.scrollBox7 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox7:setParent(obj.frmTemplateNotes);
obj.scrollBox7:setAlign("client");
obj.scrollBox7:setName("scrollBox7");
obj.layout28 = gui.fromHandle(_obj_newObject("layout"));
obj.layout28:setParent(obj.scrollBox7);
obj.layout28:setLeft(0);
obj.layout28:setTop(0);
obj.layout28:setWidth(400);
obj.layout28:setHeight(580);
obj.layout28:setName("layout28");
obj.rectangle49 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle49:setParent(obj.layout28);
obj.rectangle49:setLeft(0);
obj.rectangle49:setTop(0);
obj.rectangle49:setWidth(400);
obj.rectangle49:setHeight(580);
obj.rectangle49:setColor("black");
obj.rectangle49:setXradius(5);
obj.rectangle49:setYradius(15);
obj.rectangle49:setCornerType("round");
obj.rectangle49:setName("rectangle49");
obj.label164 = gui.fromHandle(_obj_newObject("label"));
obj.label164:setParent(obj.layout28);
obj.label164:setLeft(0);
obj.label164:setTop(0);
obj.label164:setWidth(400);
obj.label164:setHeight(20);
obj.label164:setText("Anotações");
obj.label164:setHorzTextAlign("center");
obj.label164:setName("label164");
obj.textEditor7 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor7:setParent(obj.layout28);
obj.textEditor7:setLeft(10);
obj.textEditor7:setTop(25);
obj.textEditor7:setWidth(380);
obj.textEditor7:setHeight(540);
obj.textEditor7:setField("anotacoes1");
obj.textEditor7:setName("textEditor7");
obj.layout29 = gui.fromHandle(_obj_newObject("layout"));
obj.layout29:setParent(obj.scrollBox7);
obj.layout29:setLeft(410);
obj.layout29:setTop(0);
obj.layout29:setWidth(400);
obj.layout29:setHeight(580);
obj.layout29:setName("layout29");
obj.rectangle50 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle50:setParent(obj.layout29);
obj.rectangle50:setLeft(0);
obj.rectangle50:setTop(0);
obj.rectangle50:setWidth(400);
obj.rectangle50:setHeight(580);
obj.rectangle50:setColor("black");
obj.rectangle50:setXradius(5);
obj.rectangle50:setYradius(15);
obj.rectangle50:setCornerType("round");
obj.rectangle50:setName("rectangle50");
obj.label165 = gui.fromHandle(_obj_newObject("label"));
obj.label165:setParent(obj.layout29);
obj.label165:setLeft(0);
obj.label165:setTop(0);
obj.label165:setWidth(400);
obj.label165:setHeight(20);
obj.label165:setText("Anotações");
obj.label165:setHorzTextAlign("center");
obj.label165:setName("label165");
obj.textEditor8 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor8:setParent(obj.layout29);
obj.textEditor8:setLeft(10);
obj.textEditor8:setTop(25);
obj.textEditor8:setWidth(380);
obj.textEditor8:setHeight(540);
obj.textEditor8:setField("anotacoes2");
obj.textEditor8:setName("textEditor8");
obj.layout30 = gui.fromHandle(_obj_newObject("layout"));
obj.layout30:setParent(obj.scrollBox7);
obj.layout30:setLeft(820);
obj.layout30:setTop(0);
obj.layout30:setWidth(400);
obj.layout30:setHeight(580);
obj.layout30:setName("layout30");
obj.rectangle51 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle51:setParent(obj.layout30);
obj.rectangle51:setLeft(0);
obj.rectangle51:setTop(0);
obj.rectangle51:setWidth(400);
obj.rectangle51:setHeight(580);
obj.rectangle51:setColor("black");
obj.rectangle51:setXradius(5);
obj.rectangle51:setYradius(15);
obj.rectangle51:setCornerType("round");
obj.rectangle51:setName("rectangle51");
obj.label166 = gui.fromHandle(_obj_newObject("label"));
obj.label166:setParent(obj.layout30);
obj.label166:setLeft(0);
obj.label166:setTop(0);
obj.label166:setWidth(400);
obj.label166:setHeight(20);
obj.label166:setText("Anotações");
obj.label166:setHorzTextAlign("center");
obj.label166:setName("label166");
obj.textEditor9 = gui.fromHandle(_obj_newObject("textEditor"));
obj.textEditor9:setParent(obj.layout30);
obj.textEditor9:setLeft(10);
obj.textEditor9:setTop(25);
obj.textEditor9:setWidth(380);
obj.textEditor9:setHeight(540);
obj.textEditor9:setField("anotacoes3");
obj.textEditor9:setName("textEditor9");
obj.tab8 = gui.fromHandle(_obj_newObject("tab"));
obj.tab8:setParent(obj.tabControl1);
obj.tab8:setTitle("Creditos");
obj.tab8:setName("tab8");
obj.frmTemplateCreditos = gui.fromHandle(_obj_newObject("form"));
obj.frmTemplateCreditos:setParent(obj.tab8);
obj.frmTemplateCreditos:setName("frmTemplateCreditos");
obj.frmTemplateCreditos:setAlign("client");
obj.scrollBox8 = gui.fromHandle(_obj_newObject("scrollBox"));
obj.scrollBox8:setParent(obj.frmTemplateCreditos);
obj.scrollBox8:setAlign("client");
obj.scrollBox8:setName("scrollBox8");
obj.image6 = gui.fromHandle(_obj_newObject("image"));
obj.image6:setParent(obj.scrollBox8);
obj.image6:setLeft(0);
obj.image6:setTop(0);
obj.image6:setWidth(500);
obj.image6:setHeight(125);
obj.image6:setStyle("autoFit");
obj.image6:setSRC("/Cyberpunk2020/images/cyberpunk.png");
obj.image6:setName("image6");
obj.image7 = gui.fromHandle(_obj_newObject("image"));
obj.image7:setParent(obj.scrollBox8);
obj.image7:setLeft(550);
obj.image7:setTop(0);
obj.image7:setWidth(250);
obj.image7:setHeight(250);
obj.image7:setStyle("autoFit");
obj.image7:setSRC("/Cyberpunk2020/images/RPGmeister.jpg");
obj.image7:setName("image7");
obj.layout31 = gui.fromHandle(_obj_newObject("layout"));
obj.layout31:setParent(obj.scrollBox8);
obj.layout31:setLeft(850);
obj.layout31:setTop(0);
obj.layout31:setWidth(200);
obj.layout31:setHeight(160);
obj.layout31:setName("layout31");
obj.rectangle52 = gui.fromHandle(_obj_newObject("rectangle"));
obj.rectangle52:setParent(obj.layout31);
obj.rectangle52:setAlign("client");
obj.rectangle52:setColor("black");
obj.rectangle52:setXradius(5);
obj.rectangle52:setYradius(15);
obj.rectangle52:setCornerType("round");
obj.rectangle52:setName("rectangle52");
obj.label167 = gui.fromHandle(_obj_newObject("label"));
obj.label167:setParent(obj.layout31);
obj.label167:setLeft(0);
obj.label167:setTop(10);
obj.label167:setWidth(200);
obj.label167:setHeight(20);
obj.label167:setText("Programador: Vinny (Ambesek)");
obj.label167:setHorzTextAlign("center");
obj.label167:setName("label167");
obj.label168 = gui.fromHandle(_obj_newObject("label"));
obj.label168:setParent(obj.layout31);
obj.label168:setLeft(0);
obj.label168:setTop(35);
obj.label168:setWidth(200);
obj.label168:setHeight(20);
obj.label168:setText("Consultor: francinha87");
obj.label168:setHorzTextAlign("center");
obj.label168:setName("label168");
obj.label169 = gui.fromHandle(_obj_newObject("label"));
obj.label169:setParent(obj.scrollBox8);
obj.label169:setLeft(555);
obj.label169:setTop(300);
obj.label169:setWidth(100);
obj.label169:setHeight(20);
obj.label169:setText("Versão Atual: ");
obj.label169:setHorzTextAlign("center");
obj.label169:setName("label169");
obj.image8 = gui.fromHandle(_obj_newObject("image"));
obj.image8:setParent(obj.scrollBox8);
obj.image8:setLeft(667);
obj.image8:setTop(300);
obj.image8:setWidth(100);
obj.image8:setHeight(20);
obj.image8:setStyle("autoFit");
obj.image8:setSRC("http://www.cin.ufpe.br/~jvdl/Plugins/Ficha%20Cyberpunk%202020/release.png");
obj.image8:setName("image8");
obj.label170 = gui.fromHandle(_obj_newObject("label"));
obj.label170:setParent(obj.scrollBox8);
obj.label170:setLeft(555);
obj.label170:setTop(325);
obj.label170:setWidth(100);
obj.label170:setHeight(20);
obj.label170:setText("Sua Versão: ");
obj.label170:setHorzTextAlign("center");
obj.label170:setName("label170");
obj.image9 = gui.fromHandle(_obj_newObject("image"));
obj.image9:setParent(obj.scrollBox8);
obj.image9:setLeft(667);
obj.image9:setTop(325);
obj.image9:setWidth(100);
obj.image9:setHeight(20);
obj.image9:setStyle("autoFit");
obj.image9:setSRC("http://www.cin.ufpe.br/~jvdl/Plugins/Version/versao04.png");
obj.image9:setName("image9");
obj.button9 = gui.fromHandle(_obj_newObject("button"));
obj.button9:setParent(obj.scrollBox8);
obj.button9:setLeft(555);
obj.button9:setTop(350);
obj.button9:setWidth(100);
obj.button9:setText("Change Log");
obj.button9:setName("button9");
obj.button10 = gui.fromHandle(_obj_newObject("button"));
obj.button10:setParent(obj.scrollBox8);
obj.button10:setLeft(667);
obj.button10:setTop(350);
obj.button10:setWidth(100);
obj.button10:setText("Atualizar");
obj.button10:setName("button10");
obj.label171 = gui.fromHandle(_obj_newObject("label"));
obj.label171:setParent(obj.scrollBox8);
obj.label171:setLeft(555);
obj.label171:setTop(400);
obj.label171:setWidth(200);
obj.label171:setHeight(20);
obj.label171:setText("Conheça as Mesas:");
obj.label171:setName("label171");
obj.button11 = gui.fromHandle(_obj_newObject("button"));
obj.button11:setParent(obj.scrollBox8);
obj.button11:setLeft(555);
obj.button11:setTop(425);
obj.button11:setWidth(100);
obj.button11:setText("RPGmeister");
obj.button11:setName("button11");
obj.button12 = gui.fromHandle(_obj_newObject("button"));
obj.button12:setParent(obj.scrollBox8);
obj.button12:setLeft(667);
obj.button12:setTop(425);
obj.button12:setWidth(125);
obj.button12:setText("Nova York 1920");
obj.button12:setName("button12");
obj._e_event0 = obj.dataLink1:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
local emp = tonumber(sheet.empatia) or 0;
sheet.phTotal = emp * 10;
end, obj);
obj._e_event1 = obj.dataLink2:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
local mov = tonumber(sheet.movimento) or 0;
sheet.correr = mov * 3;
sheet.saltar = mov * 3 / 4;
end, obj);
obj._e_event2 = obj.dataLink3:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
local tco = tonumber(sheet.tipoCorporal) or 0;
sheet.levantar = tco * 10;
sheet.vit = tco;
if tco <= 2 then
sheet.mtc = 0;
elseif tco <=4 then
sheet.mtc = -1;
elseif tco <=7 then
sheet.mtc = -2;
elseif tco <=9 then
sheet.mtc = -3;
elseif tco <=10 then
sheet.mtc = -4;
else
sheet.mtc = -5;
end;
end, obj);
obj._e_event3 = obj.image1:addEventListener("onStartDrag",
function (self, drag, x, y)
drag:addData("imageURL", sheet.avatar);
end, obj);
obj._e_event4 = obj.dataLink4:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
updateAtributes("1");
updateAtributes("2");
updateAtributes("3");
updateAtributes("4");
updateAtributes("5");
updateAtributes("6");
updateAtributes("7");
end, obj);
obj._e_event5 = obj.button1:addEventListener("onClick",
function (self)
self.rclListaDasPericias:append();
end, obj);
obj._e_event6 = obj.rclListaDasPericias:addEventListener("onCompare",
function (self, nodeA, nodeB)
if utils.compareStringPtBr(nodeA.atributo, nodeB.atributo)== 0 then
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
else
return utils.compareStringPtBr(nodeA.atributo, nodeB.atributo);
end;
end, obj);
obj._e_event7 = obj.button2:addEventListener("onClick",
function (self)
self.rclListaDasPericiasClasse:append();
end, obj);
obj._e_event8 = obj.rclListaDasPericiasClasse:addEventListener("onCompare",
function (self, nodeA, nodeB)
if utils.compareStringPtBr(nodeA.atributo, nodeB.atributo)== 0 then
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
else
return utils.compareStringPtBr(nodeA.atributo, nodeB.atributo);
end;
end, obj);
obj._e_event9 = obj.button3:addEventListener("onClick",
function (self)
self.rclListaDasPericiasComuns:append();
end, obj);
obj._e_event10 = obj.rclListaDasPericiasComuns:addEventListener("onCompare",
function (self, nodeA, nodeB)
if utils.compareStringPtBr(nodeA.atributo, nodeB.atributo)== 0 then
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
else
return utils.compareStringPtBr(nodeA.atributo, nodeB.atributo);
end;
end, obj);
obj._e_event11 = obj.button4:addEventListener("onClick",
function (self)
self.rclInventory:append();
end, obj);
obj._e_event12 = obj.rclInventory:addEventListener("onCompare",
function (self, nodeA, nodeB)
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
end, obj);
obj._e_event13 = obj.button5:addEventListener("onClick",
function (self)
self.rclInventoryWeapon:append();
end, obj);
obj._e_event14 = obj.rclInventoryWeapon:addEventListener("onCompare",
function (self, nodeA, nodeB)
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
end, obj);
obj._e_event15 = obj.button6:addEventListener("onClick",
function (self)
self.rclInventoryArmor:append();
end, obj);
obj._e_event16 = obj.rclInventoryArmor:addEventListener("onCompare",
function (self, nodeA, nodeB)
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
end, obj);
obj._e_event17 = obj.dataLink5:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
sheet.itensWeight = (tonumber(sheet.inventoryWeight) or 0) +
(tonumber(sheet.weaponWeight) or 0) +
(tonumber(sheet.armorWeight) or 0);
end, obj);
obj._e_event18 = obj.dataLink6:addEventListener("onChange",
function (self, field, oldValue, newValue)
if sheet==nil then return end;
sheet.itensCost = (tonumber(sheet.inventoryCost) or 0) +
(tonumber(sheet.cyberCost) or 0) +
(tonumber(sheet.weaponCost) or 0) +
(tonumber(sheet.armorCost) or 0) +
(tonumber(sheet.vehicleCost) or 0);
end, obj);
obj._e_event19 = obj.button7:addEventListener("onClick",
function (self)
self.rclCyber:append();
end, obj);
obj._e_event20 = obj.rclCyber:addEventListener("onCompare",
function (self, nodeA, nodeB)
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
end, obj);
obj._e_event21 = obj.button8:addEventListener("onClick",
function (self)
self.rclVehicleWeapon:append();
end, obj);
obj._e_event22 = obj.rclVehicleWeapon:addEventListener("onCompare",
function (self, nodeA, nodeB)
return utils.compareStringPtBr(nodeA.nome, nodeB.nome);
end, obj);
obj._e_event23 = obj.image5:addEventListener("onStartDrag",
function (self, drag, x, y)
drag:addData("imageURL", sheet.vehicleAvatar);
end, obj);
obj._e_event24 = obj.button9:addEventListener("onClick",
function (self)
gui.openInBrowser('https://github.com/rrpgfirecast/firecast/blob/master/Plugins/Sheets/Ficha%20Cyberpunk%202020/README.md')
end, obj);
obj._e_event25 = obj.button10:addEventListener("onClick",
function (self)
gui.openInBrowser('http://www.cin.ufpe.br/~jvdl/Plugins/Ficha%20Cyberpunk%202020/Ficha%20Cyberpunk%202020.rpk')
end, obj);
obj._e_event26 = obj.button11:addEventListener("onClick",
function (self)
gui.openInBrowser('http://firecast.rrpg.com.br:90/a?a=pagRWEMesaInfo.actInfoMesa&mesaid=64070');
end, obj);
obj._e_event27 = obj.button12:addEventListener("onClick",
function (self)
gui.openInBrowser('http://firecast.rrpg.com.br:90/a?a=pagRWEMesaInfo.actInfoMesa&mesaid=77684');
end, obj);
function obj:_releaseEvents()
__o_rrpgObjs.removeEventListenerById(self._e_event27);
__o_rrpgObjs.removeEventListenerById(self._e_event26);
__o_rrpgObjs.removeEventListenerById(self._e_event25);
__o_rrpgObjs.removeEventListenerById(self._e_event24);
__o_rrpgObjs.removeEventListenerById(self._e_event23);
__o_rrpgObjs.removeEventListenerById(self._e_event22);
__o_rrpgObjs.removeEventListenerById(self._e_event21);
__o_rrpgObjs.removeEventListenerById(self._e_event20);
__o_rrpgObjs.removeEventListenerById(self._e_event19);
__o_rrpgObjs.removeEventListenerById(self._e_event18);
__o_rrpgObjs.removeEventListenerById(self._e_event17);
__o_rrpgObjs.removeEventListenerById(self._e_event16);
__o_rrpgObjs.removeEventListenerById(self._e_event15);
__o_rrpgObjs.removeEventListenerById(self._e_event14);
__o_rrpgObjs.removeEventListenerById(self._e_event13);
__o_rrpgObjs.removeEventListenerById(self._e_event12);
__o_rrpgObjs.removeEventListenerById(self._e_event11);
__o_rrpgObjs.removeEventListenerById(self._e_event10);
__o_rrpgObjs.removeEventListenerById(self._e_event9);
__o_rrpgObjs.removeEventListenerById(self._e_event8);
__o_rrpgObjs.removeEventListenerById(self._e_event7);
__o_rrpgObjs.removeEventListenerById(self._e_event6);
__o_rrpgObjs.removeEventListenerById(self._e_event5);
__o_rrpgObjs.removeEventListenerById(self._e_event4);
__o_rrpgObjs.removeEventListenerById(self._e_event3);
__o_rrpgObjs.removeEventListenerById(self._e_event2);
__o_rrpgObjs.removeEventListenerById(self._e_event1);
__o_rrpgObjs.removeEventListenerById(self._e_event0);
end;
obj._oldLFMDestroy = obj.destroy;
function obj:destroy()
self:_releaseEvents();
if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then
self:setNodeDatabase(nil);
end;
if self.label14 ~= nil then self.label14:destroy(); self.label14 = nil; end;
if self.label119 ~= nil then self.label119:destroy(); self.label119 = nil; end;
if self.edit64 ~= nil then self.edit64:destroy(); self.edit64 = nil; end;
if self.layout15 ~= nil then self.layout15:destroy(); self.layout15 = nil; end;
if self.edit41 ~= nil then self.edit41:destroy(); self.edit41 = nil; end;
if self.layout10 ~= nil then self.layout10:destroy(); self.layout10 = nil; end;
if self.edit36 ~= nil then self.edit36:destroy(); self.edit36 = nil; end;
if self.edit9 ~= nil then self.edit9:destroy(); self.edit9 = nil; end;
if self.label43 ~= nil then self.label43:destroy(); self.label43 = nil; end;
if self.label97 ~= nil then self.label97:destroy(); self.label97 = nil; end;
if self.edit33 ~= nil then self.edit33:destroy(); self.edit33 = nil; end;
if self.label77 ~= nil then self.label77:destroy(); self.label77 = nil; end;
if self.edit29 ~= nil then self.edit29:destroy(); self.edit29 = nil; end;
if self.label128 ~= nil then self.label128:destroy(); self.label128 = nil; end;
if self.rectangle35 ~= nil then self.rectangle35:destroy(); self.rectangle35 = nil; end;
if self.layout17 ~= nil then self.layout17:destroy(); self.layout17 = nil; end;
if self.label45 ~= nil then self.label45:destroy(); self.label45 = nil; end;
if self.label96 ~= nil then self.label96:destroy(); self.label96 = nil; end;
if self.label92 ~= nil then self.label92:destroy(); self.label92 = nil; end;
if self.rectangle46 ~= nil then self.rectangle46:destroy(); self.rectangle46 = nil; end;
if self.flowLayout1 ~= nil then self.flowLayout1:destroy(); self.flowLayout1 = nil; end;
if self.label148 ~= nil then self.label148:destroy(); self.label148 = nil; end;
if self.rectangle16 ~= nil then self.rectangle16:destroy(); self.rectangle16 = nil; end;
if self.flowPart1 ~= nil then self.flowPart1:destroy(); self.flowPart1 = nil; end;
if self.label75 ~= nil then self.label75:destroy(); self.label75 = nil; end;
if self.label158 ~= nil then self.label158:destroy(); self.label158 = nil; end;
if self.label63 ~= nil then self.label63:destroy(); self.label63 = nil; end;
if self.rectangle47 ~= nil then self.rectangle47:destroy(); self.rectangle47 = nil; end;
if self.label70 ~= nil then self.label70:destroy(); self.label70 = nil; end;
if self.layout24 ~= nil then self.layout24:destroy(); self.layout24 = nil; end;
if self.label143 ~= nil then self.label143:destroy(); self.label143 = nil; end;
if self.label35 ~= nil then self.label35:destroy(); self.label35 = nil; end;
if self.layout23 ~= nil then self.layout23:destroy(); self.layout23 = nil; end;
if self.label164 ~= nil then self.label164:destroy(); self.label164 = nil; end;
if self.label122 ~= nil then self.label122:destroy(); self.label122 = nil; end;
if self.rectangle5 ~= nil then self.rectangle5:destroy(); self.rectangle5 = nil; end;
if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end;
if self.label125 ~= nil then self.label125:destroy(); self.label125 = nil; end;
if self.label146 ~= nil then self.label146:destroy(); self.label146 = nil; end;
if self.rclCyber ~= nil then self.rclCyber:destroy(); self.rclCyber = nil; end;
if self.edit11 ~= nil then self.edit11:destroy(); self.edit11 = nil; end;
if self.layout9 ~= nil then self.layout9:destroy(); self.layout9 = nil; end;
if self.image1 ~= nil then self.image1:destroy(); self.image1 = nil; end;
if self.rectangle17 ~= nil then self.rectangle17:destroy(); self.rectangle17 = nil; end;
if self.label15 ~= nil then self.label15:destroy(); self.label15 = nil; end;
if self.label99 ~= nil then self.label99:destroy(); self.label99 = nil; end;
if self.label107 ~= nil then self.label107:destroy(); self.label107 = nil; end;
if self.label161 ~= nil then self.label161:destroy(); self.label161 = nil; end;
if self.label49 ~= nil then self.label49:destroy(); self.label49 = nil; end;
if self.label163 ~= nil then self.label163:destroy(); self.label163 = nil; end;
if self.label82 ~= nil then self.label82:destroy(); self.label82 = nil; end;
if self.rectangle33 ~= nil then self.rectangle33:destroy(); self.rectangle33 = nil; end;
if self.rectangle51 ~= nil then self.rectangle51:destroy(); self.rectangle51 = nil; end;
if self.label162 ~= nil then self.label162:destroy(); self.label162 = nil; end;
if self.frmVehicles ~= nil then self.frmVehicles:destroy(); self.frmVehicles = nil; end;
if self.label52 ~= nil then self.label52:destroy(); self.label52 = nil; end;
if self.edit16 ~= nil then self.edit16:destroy(); self.edit16 = nil; end;
if self.label47 ~= nil then self.label47:destroy(); self.label47 = nil; end;
if self.label48 ~= nil then self.label48:destroy(); self.label48 = nil; end;
if self.label76 ~= nil then self.label76:destroy(); self.label76 = nil; end;
if self.button4 ~= nil then self.button4:destroy(); self.button4 = nil; end;
if self.edit52 ~= nil then self.edit52:destroy(); self.edit52 = nil; end;
if self.textEditor4 ~= nil then self.textEditor4:destroy(); self.textEditor4 = nil; end;
if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end;
if self.rectangle7 ~= nil then self.rectangle7:destroy(); self.rectangle7 = nil; end;
if self.rclListaDasPericiasClasse ~= nil then self.rclListaDasPericiasClasse:destroy(); self.rclListaDasPericiasClasse = nil; end;
if self.image9 ~= nil then self.image9:destroy(); self.image9 = nil; end;
if self.button7 ~= nil then self.button7:destroy(); self.button7 = nil; end;
if self.edit58 ~= nil then self.edit58:destroy(); self.edit58 = nil; end;
if self.label109 ~= nil then self.label109:destroy(); self.label109 = nil; end;
if self.label106 ~= nil then self.label106:destroy(); self.label106 = nil; end;
if self.popPericia ~= nil then self.popPericia:destroy(); self.popPericia = nil; end;
if self.label103 ~= nil then self.label103:destroy(); self.label103 = nil; end;
if self.layout5 ~= nil then self.layout5:destroy(); self.layout5 = nil; end;
if self.label94 ~= nil then self.label94:destroy(); self.label94 = nil; end;
if self.rectangle48 ~= nil then self.rectangle48:destroy(); self.rectangle48 = nil; end;
if self.dataLink3 ~= nil then self.dataLink3:destroy(); self.dataLink3 = nil; end;
if self.label29 ~= nil then self.label29:destroy(); self.label29 = nil; end;
if self.rectangle2 ~= nil then self.rectangle2:destroy(); self.rectangle2 = nil; end;
if self.rectangle23 ~= nil then self.rectangle23:destroy(); self.rectangle23 = nil; end;
if self.frmTemplateCreditos ~= nil then self.frmTemplateCreditos:destroy(); self.frmTemplateCreditos = nil; end;
if self.label111 ~= nil then self.label111:destroy(); self.label111 = nil; end;
if self.label91 ~= nil then self.label91:destroy(); self.label91 = nil; end;
if self.label30 ~= nil then self.label30:destroy(); self.label30 = nil; end;
if self.tabControl1 ~= nil then self.tabControl1:destroy(); self.tabControl1 = nil; end;
if self.dataLink6 ~= nil then self.dataLink6:destroy(); self.dataLink6 = nil; end;
if self.label51 ~= nil then self.label51:destroy(); self.label51 = nil; end;
if self.label19 ~= nil then self.label19:destroy(); self.label19 = nil; end;
if self.rectangle52 ~= nil then self.rectangle52:destroy(); self.rectangle52 = nil; end;
if self.label116 ~= nil then self.label116:destroy(); self.label116 = nil; end;
if self.label139 ~= nil then self.label139:destroy(); self.label139 = nil; end;
if self.rectangle12 ~= nil then self.rectangle12:destroy(); self.rectangle12 = nil; end;
if self.rectangle50 ~= nil then self.rectangle50:destroy(); self.rectangle50 = nil; end;
if self.layout11 ~= nil then self.layout11:destroy(); self.layout11 = nil; end;
if self.rectangle18 ~= nil then self.rectangle18:destroy(); self.rectangle18 = nil; end;
if self.rectangle14 ~= nil then self.rectangle14:destroy(); self.rectangle14 = nil; end;
if self.label147 ~= nil then self.label147:destroy(); self.label147 = nil; end;
if self.label2 ~= nil then self.label2:destroy(); self.label2 = nil; end;
if self.label89 ~= nil then self.label89:destroy(); self.label89 = nil; end;
if self.label38 ~= nil then self.label38:destroy(); self.label38 = nil; end;
if self.edit27 ~= nil then self.edit27:destroy(); self.edit27 = nil; end;
if self.layout14 ~= nil then self.layout14:destroy(); self.layout14 = nil; end;
if self.label115 ~= nil then self.label115:destroy(); self.label115 = nil; end;
if self.rectangle42 ~= nil then self.rectangle42:destroy(); self.rectangle42 = nil; end;
if self.scrollBox5 ~= nil then self.scrollBox5:destroy(); self.scrollBox5 = nil; end;
if self.label159 ~= nil then self.label159:destroy(); self.label159 = nil; end;
if self.edit62 ~= nil then self.edit62:destroy(); self.edit62 = nil; end;
if self.layout7 ~= nil then self.layout7:destroy(); self.layout7 = nil; end;
if self.label127 ~= nil then self.label127:destroy(); self.label127 = nil; end;
if self.edit60 ~= nil then self.edit60:destroy(); self.edit60 = nil; end;
if self.label170 ~= nil then self.label170:destroy(); self.label170 = nil; end;
if self.label142 ~= nil then self.label142:destroy(); self.label142 = nil; end;
if self.tab3 ~= nil then self.tab3:destroy(); self.tab3 = nil; end;
if self.rectangle9 ~= nil then self.rectangle9:destroy(); self.rectangle9 = nil; end;
if self.textEditor9 ~= nil then self.textEditor9:destroy(); self.textEditor9 = nil; end;
if self.scrollBox7 ~= nil then self.scrollBox7:destroy(); self.scrollBox7 = nil; end;
if self.layout30 ~= nil then self.layout30:destroy(); self.layout30 = nil; end;
if self.textEditor3 ~= nil then self.textEditor3:destroy(); self.textEditor3 = nil; end;
if self.label73 ~= nil then self.label73:destroy(); self.label73 = nil; end;
if self.rclListaDasPericiasComuns ~= nil then self.rclListaDasPericiasComuns:destroy(); self.rclListaDasPericiasComuns = nil; end;
if self.radioButton3 ~= nil then self.radioButton3:destroy(); self.radioButton3 = nil; end;
if self.label23 ~= nil then self.label23:destroy(); self.label23 = nil; end;
if self.label32 ~= nil then self.label32:destroy(); self.label32 = nil; end;
if self.label90 ~= nil then self.label90:destroy(); self.label90 = nil; end;
if self.label24 ~= nil then self.label24:destroy(); self.label24 = nil; end;
if self.edit54 ~= nil then self.edit54:destroy(); self.edit54 = nil; end;
if self.dataLink5 ~= nil then self.dataLink5:destroy(); self.dataLink5 = nil; end;
if self.label61 ~= nil then self.label61:destroy(); self.label61 = nil; end;
if self.rectangle10 ~= nil then self.rectangle10:destroy(); self.rectangle10 = nil; end;
if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end;
if self.tab2 ~= nil then self.tab2:destroy(); self.tab2 = nil; end;
if self.edit61 ~= nil then self.edit61:destroy(); self.edit61 = nil; end;
if self.label93 ~= nil then self.label93:destroy(); self.label93 = nil; end;
if self.edit24 ~= nil then self.edit24:destroy(); self.edit24 = nil; end;
if self.edit59 ~= nil then self.edit59:destroy(); self.edit59 = nil; end;
if self.layout12 ~= nil then self.layout12:destroy(); self.layout12 = nil; end;
if self.edit14 ~= nil then self.edit14:destroy(); self.edit14 = nil; end;
if self.rectangle38 ~= nil then self.rectangle38:destroy(); self.rectangle38 = nil; end;
if self.edit4 ~= nil then self.edit4:destroy(); self.edit4 = nil; end;
if self.layout25 ~= nil then self.layout25:destroy(); self.layout25 = nil; end;
if self.label6 ~= nil then self.label6:destroy(); self.label6 = nil; end;
if self.label129 ~= nil then self.label129:destroy(); self.label129 = nil; end;
if self.textEditor2 ~= nil then self.textEditor2:destroy(); self.textEditor2 = nil; end;
if self.rclInventoryWeapon ~= nil then self.rclInventoryWeapon:destroy(); self.rclInventoryWeapon = nil; end;
if self.label37 ~= nil then self.label37:destroy(); self.label37 = nil; end;
if self.layout26 ~= nil then self.layout26:destroy(); self.layout26 = nil; end;
if self.rectangle45 ~= nil then self.rectangle45:destroy(); self.rectangle45 = nil; end;
if self.edit45 ~= nil then self.edit45:destroy(); self.edit45 = nil; end;
if self.edit8 ~= nil then self.edit8:destroy(); self.edit8 = nil; end;
if self.label86 ~= nil then self.label86:destroy(); self.label86 = nil; end;
if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end;
if self.label53 ~= nil then self.label53:destroy(); self.label53 = nil; end;
if self.label133 ~= nil then self.label133:destroy(); self.label133 = nil; end;
if self.edit21 ~= nil then self.edit21:destroy(); self.edit21 = nil; end;
if self.frmGeneral ~= nil then self.frmGeneral:destroy(); self.frmGeneral = nil; end;
if self.button3 ~= nil then self.button3:destroy(); self.button3 = nil; end;
if self.label42 ~= nil then self.label42:destroy(); self.label42 = nil; end;
if self.rectangle20 ~= nil then self.rectangle20:destroy(); self.rectangle20 = nil; end;
if self.label102 ~= nil then self.label102:destroy(); self.label102 = nil; end;
if self.edit13 ~= nil then self.edit13:destroy(); self.edit13 = nil; end;
if self.label132 ~= nil then self.label132:destroy(); self.label132 = nil; end;
if self.button11 ~= nil then self.button11:destroy(); self.button11 = nil; end;
if self.label81 ~= nil then self.label81:destroy(); self.label81 = nil; end;
if self.label166 ~= nil then self.label166:destroy(); self.label166 = nil; end;
if self.button6 ~= nil then self.button6:destroy(); self.button6 = nil; end;
if self.button5 ~= nil then self.button5:destroy(); self.button5 = nil; end;
if self.edit37 ~= nil then self.edit37:destroy(); self.edit37 = nil; end;
if self.layout31 ~= nil then self.layout31:destroy(); self.layout31 = nil; end;
if self.label10 ~= nil then self.label10:destroy(); self.label10 = nil; end;
if self.edit17 ~= nil then self.edit17:destroy(); self.edit17 = nil; end;
if self.radioButton2 ~= nil then self.radioButton2:destroy(); self.radioButton2 = nil; end;
if self.layout2 ~= nil then self.layout2:destroy(); self.layout2 = nil; end;
if self.rectangle30 ~= nil then self.rectangle30:destroy(); self.rectangle30 = nil; end;
if self.button10 ~= nil then self.button10:destroy(); self.button10 = nil; end;
if self.label39 ~= nil then self.label39:destroy(); self.label39 = nil; end;
if self.flowPart3 ~= nil then self.flowPart3:destroy(); self.flowPart3 = nil; end;
if self.layout29 ~= nil then self.layout29:destroy(); self.layout29 = nil; end;
if self.label79 ~= nil then self.label79:destroy(); self.label79 = nil; end;
if self.label11 ~= nil then self.label11:destroy(); self.label11 = nil; end;
if self.edit15 ~= nil then self.edit15:destroy(); self.edit15 = nil; end;
if self.label3 ~= nil then self.label3:destroy(); self.label3 = nil; end;
if self.label20 ~= nil then self.label20:destroy(); self.label20 = nil; end;
if self.rectangle40 ~= nil then self.rectangle40:destroy(); self.rectangle40 = nil; end;
if self.label108 ~= nil then self.label108:destroy(); self.label108 = nil; end;
if self.rectangle36 ~= nil then self.rectangle36:destroy(); self.rectangle36 = nil; end;
if self.label7 ~= nil then self.label7:destroy(); self.label7 = nil; end;
if self.label50 ~= nil then self.label50:destroy(); self.label50 = nil; end;
if self.button8 ~= nil then self.button8:destroy(); self.button8 = nil; end;
if self.edit42 ~= nil then self.edit42:destroy(); self.edit42 = nil; end;
if self.scrollBox4 ~= nil then self.scrollBox4:destroy(); self.scrollBox4 = nil; end;
if self.rectangle4 ~= nil then self.rectangle4:destroy(); self.rectangle4 = nil; end;
if self.layout22 ~= nil then self.layout22:destroy(); self.layout22 = nil; end;
if self.label124 ~= nil then self.label124:destroy(); self.label124 = nil; end;
if self.label84 ~= nil then self.label84:destroy(); self.label84 = nil; end;
if self.image4 ~= nil then self.image4:destroy(); self.image4 = nil; end;
if self.edit32 ~= nil then self.edit32:destroy(); self.edit32 = nil; end;
if self.tab1 ~= nil then self.tab1:destroy(); self.tab1 = nil; end;
if self.rclVehicleWeapon ~= nil then self.rclVehicleWeapon:destroy(); self.rclVehicleWeapon = nil; end;
if self.radioButton5 ~= nil then self.radioButton5:destroy(); self.radioButton5 = nil; end;
if self.rclInventory ~= nil then self.rclInventory:destroy(); self.rclInventory = nil; end;
if self.rectangle34 ~= nil then self.rectangle34:destroy(); self.rectangle34 = nil; end;
if self.label110 ~= nil then self.label110:destroy(); self.label110 = nil; end;
if self.rectangle37 ~= nil then self.rectangle37:destroy(); self.rectangle37 = nil; end;
if self.label151 ~= nil then self.label151:destroy(); self.label151 = nil; end;
if self.label138 ~= nil then self.label138:destroy(); self.label138 = nil; end;
if self.label40 ~= nil then self.label40:destroy(); self.label40 = nil; end;
if self.dataLink4 ~= nil then self.dataLink4:destroy(); self.dataLink4 = nil; end;
if self.image5 ~= nil then self.image5:destroy(); self.image5 = nil; end;
if self.image7 ~= nil then self.image7:destroy(); self.image7 = nil; end;
if self.edit28 ~= nil then self.edit28:destroy(); self.edit28 = nil; end;
if self.label57 ~= nil then self.label57:destroy(); self.label57 = nil; end;
if self.label71 ~= nil then self.label71:destroy(); self.label71 = nil; end;
if self.label160 ~= nil then self.label160:destroy(); self.label160 = nil; end;
if self.label22 ~= nil then self.label22:destroy(); self.label22 = nil; end;
if self.button2 ~= nil then self.button2:destroy(); self.button2 = nil; end;
if self.layout13 ~= nil then self.layout13:destroy(); self.layout13 = nil; end;
if self.label144 ~= nil then self.label144:destroy(); self.label144 = nil; end;
if self.label13 ~= nil then self.label13:destroy(); self.label13 = nil; end;
if self.layout8 ~= nil then self.layout8:destroy(); self.layout8 = nil; end;
if self.label27 ~= nil then self.label27:destroy(); self.label27 = nil; end;
if self.label59 ~= nil then self.label59:destroy(); self.label59 = nil; end;
if self.label68 ~= nil then self.label68:destroy(); self.label68 = nil; end;
if self.edit47 ~= nil then self.edit47:destroy(); self.edit47 = nil; end;
if self.label67 ~= nil then self.label67:destroy(); self.label67 = nil; end;
if self.button1 ~= nil then self.button1:destroy(); self.button1 = nil; end;
if self.label140 ~= nil then self.label140:destroy(); self.label140 = nil; end;
if self.edit26 ~= nil then self.edit26:destroy(); self.edit26 = nil; end;
if self.label69 ~= nil then self.label69:destroy(); self.label69 = nil; end;
if self.frmInventory ~= nil then self.frmInventory:destroy(); self.frmInventory = nil; end;
if self.edit34 ~= nil then self.edit34:destroy(); self.edit34 = nil; end;
if self.label31 ~= nil then self.label31:destroy(); self.label31 = nil; end;
if self.edit19 ~= nil then self.edit19:destroy(); self.edit19 = nil; end;
if self.tab8 ~= nil then self.tab8:destroy(); self.tab8 = nil; end;
if self.label105 ~= nil then self.label105:destroy(); self.label105 = nil; end;
if self.label154 ~= nil then self.label154:destroy(); self.label154 = nil; end;
if self.label34 ~= nil then self.label34:destroy(); self.label34 = nil; end;
if self.edit5 ~= nil then self.edit5:destroy(); self.edit5 = nil; end;
if self.label126 ~= nil then self.label126:destroy(); self.label126 = nil; end;
if self.label41 ~= nil then self.label41:destroy(); self.label41 = nil; end;
if self.label145 ~= nil then self.label145:destroy(); self.label145 = nil; end;
if self.scrollBox2 ~= nil then self.scrollBox2:destroy(); self.scrollBox2 = nil; end;
if self.label72 ~= nil then self.label72:destroy(); self.label72 = nil; end;
if self.label88 ~= nil then self.label88:destroy(); self.label88 = nil; end;
if self.tab5 ~= nil then self.tab5:destroy(); self.tab5 = nil; end;
if self.rectangle15 ~= nil then self.rectangle15:destroy(); self.rectangle15 = nil; end;
if self.label12 ~= nil then self.label12:destroy(); self.label12 = nil; end;
if self.textEditor5 ~= nil then self.textEditor5:destroy(); self.textEditor5 = nil; end;
if self.rectangle28 ~= nil then self.rectangle28:destroy(); self.rectangle28 = nil; end;
if self.label131 ~= nil then self.label131:destroy(); self.label131 = nil; end;
if self.label16 ~= nil then self.label16:destroy(); self.label16 = nil; end;
if self.textEditor7 ~= nil then self.textEditor7:destroy(); self.textEditor7 = nil; end;
if self.edit10 ~= nil then self.edit10:destroy(); self.edit10 = nil; end;
if self.edit31 ~= nil then self.edit31:destroy(); self.edit31 = nil; end;
if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end;
if self.rectangle26 ~= nil then self.rectangle26:destroy(); self.rectangle26 = nil; end;
if self.label78 ~= nil then self.label78:destroy(); self.label78 = nil; end;
if self.label101 ~= nil then self.label101:destroy(); self.label101 = nil; end;
if self.rclInventoryArmor ~= nil then self.rclInventoryArmor:destroy(); self.rclInventoryArmor = nil; end;
if self.layout4 ~= nil then self.layout4:destroy(); self.layout4 = nil; end;
if self.label167 ~= nil then self.label167:destroy(); self.label167 = nil; end;
if self.image3 ~= nil then self.image3:destroy(); self.image3 = nil; end;
if self.image8 ~= nil then self.image8:destroy(); self.image8 = nil; end;
if self.label58 ~= nil then self.label58:destroy(); self.label58 = nil; end;
if self.label114 ~= nil then self.label114:destroy(); self.label114 = nil; end;
if self.rectangle44 ~= nil then self.rectangle44:destroy(); self.rectangle44 = nil; end;
if self.label135 ~= nil then self.label135:destroy(); self.label135 = nil; end;
if self.layout20 ~= nil then self.layout20:destroy(); self.layout20 = nil; end;
if self.edit23 ~= nil then self.edit23:destroy(); self.edit23 = nil; end;
if self.radioButton1 ~= nil then self.radioButton1:destroy(); self.radioButton1 = nil; end;
if self.label155 ~= nil then self.label155:destroy(); self.label155 = nil; end;
if self.layout18 ~= nil then self.layout18:destroy(); self.layout18 = nil; end;
if self.tab7 ~= nil then self.tab7:destroy(); self.tab7 = nil; end;
if self.label56 ~= nil then self.label56:destroy(); self.label56 = nil; end;
if self.rectangle6 ~= nil then self.rectangle6:destroy(); self.rectangle6 = nil; end;
if self.label21 ~= nil then self.label21:destroy(); self.label21 = nil; end;
if self.label120 ~= nil then self.label120:destroy(); self.label120 = nil; end;
if self.edit40 ~= nil then self.edit40:destroy(); self.edit40 = nil; end;
if self.textEditor6 ~= nil then self.textEditor6:destroy(); self.textEditor6 = nil; end;
if self.dataLink2 ~= nil then self.dataLink2:destroy(); self.dataLink2 = nil; end;
if self.edit38 ~= nil then self.edit38:destroy(); self.edit38 = nil; end;
if self.label130 ~= nil then self.label130:destroy(); self.label130 = nil; end;
if self.richEdit1 ~= nil then self.richEdit1:destroy(); self.richEdit1 = nil; end;
if self.label54 ~= nil then self.label54:destroy(); self.label54 = nil; end;
if self.scrollBox3 ~= nil then self.scrollBox3:destroy(); self.scrollBox3 = nil; end;
if self.textEditor1 ~= nil then self.textEditor1:destroy(); self.textEditor1 = nil; end;
if self.label152 ~= nil then self.label152:destroy(); self.label152 = nil; end;
if self.button9 ~= nil then self.button9:destroy(); self.button9 = nil; end;
if self.edit6 ~= nil then self.edit6:destroy(); self.edit6 = nil; end;
if self.label18 ~= nil then self.label18:destroy(); self.label18 = nil; end;
if self.textEditor8 ~= nil then self.textEditor8:destroy(); self.textEditor8 = nil; end;
if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end;
if self.rectangle32 ~= nil then self.rectangle32:destroy(); self.rectangle32 = nil; end;
if self.label62 ~= nil then self.label62:destroy(); self.label62 = nil; end;
if self.edit49 ~= nil then self.edit49:destroy(); self.edit49 = nil; end;
if self.label117 ~= nil then self.label117:destroy(); self.label117 = nil; end;
if self.layout16 ~= nil then self.layout16:destroy(); self.layout16 = nil; end;
if self.layout21 ~= nil then self.layout21:destroy(); self.layout21 = nil; end;
if self.edit18 ~= nil then self.edit18:destroy(); self.edit18 = nil; end;
if self.edit25 ~= nil then self.edit25:destroy(); self.edit25 = nil; end;
if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end;
if self.rclListaDasPericias ~= nil then self.rclListaDasPericias:destroy(); self.rclListaDasPericias = nil; end;
if self.label33 ~= nil then self.label33:destroy(); self.label33 = nil; end;
if self.rectangle11 ~= nil then self.rectangle11:destroy(); self.rectangle11 = nil; end;
if self.label123 ~= nil then self.label123:destroy(); self.label123 = nil; end;
if self.tab6 ~= nil then self.tab6:destroy(); self.tab6 = nil; end;
if self.label44 ~= nil then self.label44:destroy(); self.label44 = nil; end;
if self.label171 ~= nil then self.label171:destroy(); self.label171 = nil; end;
if self.edit46 ~= nil then self.edit46:destroy(); self.edit46 = nil; end;
if self.label95 ~= nil then self.label95:destroy(); self.label95 = nil; end;
if self.label83 ~= nil then self.label83:destroy(); self.label83 = nil; end;
if self.label165 ~= nil then self.label165:destroy(); self.label165 = nil; end;
if self.scrollBox8 ~= nil then self.scrollBox8:destroy(); self.scrollBox8 = nil; end;
if self.label98 ~= nil then self.label98:destroy(); self.label98 = nil; end;
if self.label113 ~= nil then self.label113:destroy(); self.label113 = nil; end;
if self.edit7 ~= nil then self.edit7:destroy(); self.edit7 = nil; end;
if self.label55 ~= nil then self.label55:destroy(); self.label55 = nil; end;
if self.edit12 ~= nil then self.edit12:destroy(); self.edit12 = nil; end;
if self.label66 ~= nil then self.label66:destroy(); self.label66 = nil; end;
if self.rectangle21 ~= nil then self.rectangle21:destroy(); self.rectangle21 = nil; end;
if self.frmTemplateDescription ~= nil then self.frmTemplateDescription:destroy(); self.frmTemplateDescription = nil; end;
if self.edit35 ~= nil then self.edit35:destroy(); self.edit35 = nil; end;
if self.radioButton4 ~= nil then self.radioButton4:destroy(); self.radioButton4 = nil; end;
if self.label26 ~= nil then self.label26:destroy(); self.label26 = nil; end;
if self.label112 ~= nil then self.label112:destroy(); self.label112 = nil; end;
if self.edit57 ~= nil then self.edit57:destroy(); self.edit57 = nil; end;
if self.flowPart2 ~= nil then self.flowPart2:destroy(); self.flowPart2 = nil; end;
if self.rectangle19 ~= nil then self.rectangle19:destroy(); self.rectangle19 = nil; end;
if self.label121 ~= nil then self.label121:destroy(); self.label121 = nil; end;
if self.label65 ~= nil then self.label65:destroy(); self.label65 = nil; end;
if self.layout3 ~= nil then self.layout3:destroy(); self.layout3 = nil; end;
if self.rectangle22 ~= nil then self.rectangle22:destroy(); self.rectangle22 = nil; end;
if self.rectangle29 ~= nil then self.rectangle29:destroy(); self.rectangle29 = nil; end;
if self.image2 ~= nil then self.image2:destroy(); self.image2 = nil; end;
if self.edit63 ~= nil then self.edit63:destroy(); self.edit63 = nil; end;
if self.frmTemplateNotes ~= nil then self.frmTemplateNotes:destroy(); self.frmTemplateNotes = nil; end;
if self.image6 ~= nil then self.image6:destroy(); self.image6 = nil; end;
if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end;
if self.edit50 ~= nil then self.edit50:destroy(); self.edit50 = nil; end;
if self.label169 ~= nil then self.label169:destroy(); self.label169 = nil; end;
if self.label60 ~= nil then self.label60:destroy(); self.label60 = nil; end;
if self.label64 ~= nil then self.label64:destroy(); self.label64 = nil; end;
if self.label150 ~= nil then self.label150:destroy(); self.label150 = nil; end;
if self.edit44 ~= nil then self.edit44:destroy(); self.edit44 = nil; end;
if self.label4 ~= nil then self.label4:destroy(); self.label4 = nil; end;
if self.label136 ~= nil then self.label136:destroy(); self.label136 = nil; end;
if self.rectangle25 ~= nil then self.rectangle25:destroy(); self.rectangle25 = nil; end;
if self.label74 ~= nil then self.label74:destroy(); self.label74 = nil; end;
if self.label149 ~= nil then self.label149:destroy(); self.label149 = nil; end;
if self.layout27 ~= nil then self.layout27:destroy(); self.layout27 = nil; end;
if self.rectangle43 ~= nil then self.rectangle43:destroy(); self.rectangle43 = nil; end;
if self.edit53 ~= nil then self.edit53:destroy(); self.edit53 = nil; end;
if self.layout28 ~= nil then self.layout28:destroy(); self.layout28 = nil; end;
if self.layout19 ~= nil then self.layout19:destroy(); self.layout19 = nil; end;
if self.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end;
if self.rectangle8 ~= nil then self.rectangle8:destroy(); self.rectangle8 = nil; end;
if self.label28 ~= nil then self.label28:destroy(); self.label28 = nil; end;
if self.label157 ~= nil then self.label157:destroy(); self.label157 = nil; end;
if self.edit30 ~= nil then self.edit30:destroy(); self.edit30 = nil; end;
if self.tab4 ~= nil then self.tab4:destroy(); self.tab4 = nil; end;
if self.edit56 ~= nil then self.edit56:destroy(); self.edit56 = nil; end;
if self.label137 ~= nil then self.label137:destroy(); self.label137 = nil; end;
if self.label80 ~= nil then self.label80:destroy(); self.label80 = nil; end;
if self.edit55 ~= nil then self.edit55:destroy(); self.edit55 = nil; end;
if self.edit43 ~= nil then self.edit43:destroy(); self.edit43 = nil; end;
if self.label118 ~= nil then self.label118:destroy(); self.label118 = nil; end;
if self.frmSkills ~= nil then self.frmSkills:destroy(); self.frmSkills = nil; end;
if self.label17 ~= nil then self.label17:destroy(); self.label17 = nil; end;
if self.label100 ~= nil then self.label100:destroy(); self.label100 = nil; end;
if self.label156 ~= nil then self.label156:destroy(); self.label156 = nil; end;
if self.rectangle49 ~= nil then self.rectangle49:destroy(); self.rectangle49 = nil; end;
if self.edit39 ~= nil then self.edit39:destroy(); self.edit39 = nil; end;
if self.label168 ~= nil then self.label168:destroy(); self.label168 = nil; end;
if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end;
if self.rectangle27 ~= nil then self.rectangle27:destroy(); self.rectangle27 = nil; end;
if self.button12 ~= nil then self.button12:destroy(); self.button12 = nil; end;
if self.label36 ~= nil then self.label36:destroy(); self.label36 = nil; end;
if self.rectangle3 ~= nil then self.rectangle3:destroy(); self.rectangle3 = nil; end;
if self.frmCyber ~= nil then self.frmCyber:destroy(); self.frmCyber = nil; end;
if self.edit51 ~= nil then self.edit51:destroy(); self.edit51 = nil; end;
if self.edit48 ~= nil then self.edit48:destroy(); self.edit48 = nil; end;
if self.label85 ~= nil then self.label85:destroy(); self.label85 = nil; end;
if self.label46 ~= nil then self.label46:destroy(); self.label46 = nil; end;
if self.scrollBox6 ~= nil then self.scrollBox6:destroy(); self.scrollBox6 = nil; end;
if self.rectangle31 ~= nil then self.rectangle31:destroy(); self.rectangle31 = nil; end;
if self.label153 ~= nil then self.label153:destroy(); self.label153 = nil; end;
if self.label87 ~= nil then self.label87:destroy(); self.label87 = nil; end;
if self.label104 ~= nil then self.label104:destroy(); self.label104 = nil; end;
if self.label25 ~= nil then self.label25:destroy(); self.label25 = nil; end;
if self.edit22 ~= nil then self.edit22:destroy(); self.edit22 = nil; end;
if self.label5 ~= nil then self.label5:destroy(); self.label5 = nil; end;
if self.layout6 ~= nil then self.layout6:destroy(); self.layout6 = nil; end;
if self.rectangle13 ~= nil then self.rectangle13:destroy(); self.rectangle13 = nil; end;
if self.rectangle39 ~= nil then self.rectangle39:destroy(); self.rectangle39 = nil; end;
if self.rectangle41 ~= nil then self.rectangle41:destroy(); self.rectangle41 = nil; end;
if self.label141 ~= nil then self.label141:destroy(); self.label141 = nil; end;
if self.label134 ~= nil then self.label134:destroy(); self.label134 = nil; end;
if self.rectangle24 ~= nil then self.rectangle24:destroy(); self.rectangle24 = nil; end;
if self.edit20 ~= nil then self.edit20:destroy(); self.edit20 = nil; end;
self:_oldLFMDestroy();
end;
obj:endUpdate();
__o_rrpgObjs.endObjectsLoading();
return obj;
end;
local _frmMain = {
newEditor = newfrmMain,
new = newfrmMain,
name = "frmMain",
dataType = "Ambesek.Nefertyne.Cyberpunk2020",
formType = "sheetTemplate",
formComponentName = "form",
title = "Ficha Cyberpunk 2020",
description=""};
frmMain = _frmMain;
rrpg.registrarForm(_frmMain);
rrpg.registrarDataType(_frmMain);
return _frmMain;
|
local RedDotModule = require "module.RedDotModule"
local QuestModule = require "module.QuestModule"
---战斗中出现的按钮
local FightingBtnInfo = {
--[[-开服七天
[2] = {
---双子星
{dialogName = "mapSceneUI/guideLayer/guideFashion", openLevel = 5003, questId = module.guideLayerModule.Type.FashionLayer},
---陆游七
{dialogName = "mapSceneUI/guideLayer/guideOnlineRewards", openLevel = 5007, canOpen = module.guideLayerModule.CheckOnline, redFunc = module.guideLayerModule.CheckOnline},
---肖斯塔亚
{dialogName = "mapSceneUI/guideLayer/guideGetTitle", openLevel = 5004, questId = module.guideLayerModule.Type.Title},
---7日计划
{dialogName = "SevenDaysActivity", canOpen = QuestModule.GetSevenDayOpen},
---拍卖行
{dialogName = "Trade_Dialog", openLevel = 5002},
---排行
{dialogName = "rankList/rankListFrame"},
},
---福利
{dialogName = "welfareActivity", openLevel = 1301,red = RedDotModule.Type.WelfareActivity.WelfareActivity},
---商店
{dialogName = "ShopFrame", openLevel = 2401},
---招募
{dialogName = "DrawCard/newDrawCardFrame", openLevel = 1801, red = RedDotModule.Type.DrawCard.DrawCardFree},
---活动
{dialogName = "FriendSystem/FriendMail", red = RedDotModule.Type.Mail.Mail, data = {idx = 3}},
-- ---基地
-- {dialogName = "Manor_Overview", openLevel = 2001, red = RedDotModule.Type.Manor.Manor},
--
-- ---成就
-- {dialogName = "achievement/achievementFrame", openLevel = 2701, red = RedDotModule.Type.Achievement.Achievement},
-- ---邮件
-- {dialogName = "FriendSystemList", red = RedDotModule.Type.Mail.Mail, data = {idx = 3}},
-- ---设置
-- {dialogName = "SettingFrame"},
dailyTask
--]]
[1] = {
---背包
{dialogName = "ItemBagNew", openLevel = 2301},
---公会
{dialogName = "newUnion/newUnionFrame", openLevel = 2101},
---任务
{dialogName = "mapSceneUI/newQuestList", openLevel = 1401},
---组队
{dialogName = "TeamFrame", openLevel = 1221},
---好友
{dialogName = "FriendSystemList", openLevel = 2501},
},
[2] = {
---每日任务
{dialogName = "mapSceneUI/dailyTask", openLevel = 3201},
---变强
{dialogName = "mapSceneUI/stronger/newStrongerFrame", openLevel = 2901},
---设置
{dialogName = "SettingFrame"},
},
[3] = {
---培养
{dialogName = "Role_Frame", openLevel = 1101},
---阵容
{dialogName = "FormationDialog", openLevel = 1701},
---占卜
{dialogName = "DrawCard/newDrawCardFrame", openLevel = 1801},
---商店
{dialogName = "ShopFrame", openLevel = 2401},
---交易行
{dialogName = "Trade_Dialog", openLevel = 5002},
},
[4] = {
---竞技
{dialogName = "mapSceneUI/newMapSceneActivity", openLevel = 2205, data = {filter = {flag = true, id = 1003}}},
---活动
{dialogName = "mapSceneUI/newMapSceneActivity", openLevel = 1201, data = {filter = {flag = false, id = 1003}}},
---基地
{dialogName = "Manor_Overview", openLevel = 2001},
---邮件
{dialogName = "FriendSystem/FriendMail", openLevel = 1501},
},
}
local function getMailIdx()
local _status, _idx = RedDotModule.CheckModlue:checkMailAndAward()
if _idx then
return {idx = _idx}
end
return {idx = 3}
end
local MapSceneTopBtn = {
---零号计划
{dialog = "mapSceneUI/guideLayer/zeroPlan", openLevel = 5008, red = RedDotModule.Type.MapSceneUI.ZeroPlan},
---福利
{dialog = "welfareActivity", openLevel = 1301, red = RedDotModule.Type.WelfareActivity.WelfareActivity},
---每日任务
{dialog = "mapSceneUI/dailyTask", openLevel = 3201, red = RedDotModule.Type.MapSceneUI.DailyTask},
---七日
{dialog = "SevenDaysActivity", openLevel = 1312, red = RedDotModule.Type.SevenDays.SevenDays},
---幸运币
{dialog = "fightResult/luckyCoin", openLevel = 1331, data = {idx = 2}},
--争夺战
{callback = module.GuildSeaElectionModule.OpenGrabWarFrame, openLevel = 2107, canOpen = module.GuildSeaElectionModule.CheckApplyTime},
{callback = module.GuildSeaElectionModule.OpenGrabWarFrame, openLevel = 2107, canOpen = module.GuildSeaElectionModule.CheckFightTime},
}
---大地图 下方角按钮栏
local MapSceneBottomBtn = {
---伙伴
{red = RedDotModule.Type.Hero.AllHero},
---背包
{dialog = "ItemBagNew", openLevel = 2301},
---商店
{red = RedDotModule.Type.Shop.All},
---公会
{dialog = "newUnion/newUnionFrame", openLevel = 2101,red = RedDotModule.Type.Union.AllUnion},
-- {mapName = 25, openLevel = 2101, red = RedDotModule.Type.Union.Union, teamDialog = "newUnion/newUnionFrame"},
--地图
{dialog = "bigMap/bigMap", openLevel = 2601, forbidMap = {67, 551, 601}},
---副本
{dialog = "newSelectMap/selectMap"}
}
---大地图上方展开列表
local MapSceneTopListBtn = {
---购买体力
{dialog = "ShopFrame", openLevel = 2401},
---查看成就
{dialog = "achievement/achievementFrame", openLevel = 2701},
---更换形象
{dialog = "mapSceneUI/newPlayerInfoFrame", openLevel = 2701},
---设置
{dialog = "SettingFrame", openLevel = 2701},
}
local MapSceneBottomRole = {
---伙伴
{dialog = "Role_Frame", openLevel = 1101, red = RedDotModule.Type.Hero.AllHero},
---阵容
{dialog = "FormationDialog", openLevel = 1701},
{dialog = "roleReborn/RoleRebornFrame"}
}
local MapSceneBottomShop = {
---抽卡
{dialog = "DrawCard/newDrawCardFrame", openLevel = 1801, red = RedDotModule.Type.DrawCard.DrawCardFree},
---商店
{dialog = "ShopFrame", openLevel = 2401, red = RedDotModule.Type.Shop.FlashSaleShopRefresh},
---拍卖行
{dialog = "Trade_Dialog", openLevel = 5002},
}
local MapSceneBottomCompetition = {
{dialog = "traditionalArena/traditionalArenaFrame", openLevel = 1902},
{dialog = "PveArenaFrame", openLevel = 1911, red = RedDotModule.Type.Arena.Arena},
{dialog = "trial/trialTower", openLevel = 3101},
{dialog = "expOnline/expOnline", openLevel = 1921},
{dialog = "PvpArena_Frame", openLevel = 1901, red = RedDotModule.Type.PVPArena.PVPArena},
{dialog = "guild_pvp/GuildPVPJoinPanel", openLevel = 1911},
}
local MapSceneBottomLeaveNode = {
--公会
{mapName = 25, openLevel = 2101, red = RedDotModule.Type.Union.Union, teamDialog = "newUnion/newUnionFrame"},
--庄园
{mapName = 26, openLevel = 2001, teamDialog = "Manor_Overview", red = RedDotModule.Type.Manor.Quest},
--大地图
{dialog = "bigMap/bigMap"},
}
return {
FightingBtnInfo = FightingBtnInfo,
MapSceneBottomBtn = MapSceneBottomBtn,
MapSceneTopBtn = MapSceneTopBtn,
MapSceneTopListBtn = MapSceneTopListBtn,
MapSceneBottomRole = MapSceneBottomRole,
MapSceneBottomCompetition = MapSceneBottomCompetition,
MapSceneBottomShop = MapSceneBottomShop,
MapSceneBottomLeaveNode = MapSceneBottomLeaveNode,
}
|
function onCreate()
-- background shit
makeLuaSprite('cielo', 'cielo', -600, -300);
addLuaSprite('cielo', false);
makeLuaSprite('patio', 'patio', -600, -300);
addLuaSprite('patio', false);
makeLuaSprite('vallas', 'vallas', 85, -120);
addLuaSprite('vallas', true);
makeAnimatedLuaSprite('matt', 'matt', 1950, 200);
setProperty('matt.flipX', false);
addAnimationByPrefix('matt', 'enter', 'MattWalking', 14, true);
addAnimationByPrefix('matt', 'idle', 'MattSnappingFinger', 24, true);
addAnimationByPrefix('matt', 'pissed', 'MattPISSED', 24, true);
setProperty('matt.scale.x', getProperty('matt.scale.x') + 0.56);
setProperty('matt.scale.y', getProperty('matt.scale.y') + 0.56);
setLuaSpriteScrollFactor('matt', 1, 1);
addLuaSprite('matt', false);
makeAnimatedLuaSprite('tom', 'tom', 1980, 290);
setProperty('tom.flipX', true);
addAnimationByPrefix('tom', 'enter', 'TomWalking', 14, true);
addAnimationByPrefix('tom', 'idle', 'TomLooking', 14, true);
addAnimationByPrefix('tom', 'pissed', 'TomReaction', 24, true);
setProperty('tom.scale.x', getProperty('tom.scale.x') + 0.56);
setProperty('tom.scale.y', getProperty('tom.scale.y') + 0.56);
setLuaSpriteScrollFactor('tom', 1, 1);
addLuaSprite('tom', false);
makeAnimatedLuaSprite('mark','mark',540, 130)
addAnimationByPrefix('mark','mark','mark',24,true)
addLuaSprite('mark',false)
makeAnimatedLuaSprite('john','john',330, 100)
addAnimationByPrefix('john','john','john',24,true)
addLuaSprite('john',false)
makeLuaSprite('carro', 'carro', -835, 800);
addLuaSprite('carro', true);
makeAnimatedLuaSprite('character', 'characters/gfedd', 1680, 100); -- change 'character' to the name of your character, change 'dad' to the name of the .png and .xml file
addAnimationByPrefix('character', 'idle', 'GF Dancing Beat', 24, true); -- change 'character' to the name of your character, don't change 'idle', change 'Dad idle dance' to the idle animation in your xml file
addAnimationByPrefix('character', 'singLEFT', 'Dad Sing Note LEFT', 24, false); -- repeat this for each one ^^^
addAnimationByPrefix('character', 'singDOWN', 'Dad Sing Note DOWN', 24, false);
addAnimationByPrefix('character', 'singUP', 'Dad Sing Note UP', 24, false);
addAnimationByPrefix('character', 'singRIGHT', 'Dad Sing Note RIGHT', 24, false);
objectPlayAnimation('character', 'idle'); -- change 'character'
addLuaSprite('character', false); -- change 'character' to the name of your character and put the 'false' to true if you want the character to be in front of the original characters
end
local singAnims = {"singLEFT", "singDOWN", "singUP", "singRIGHT"}
function opponentNoteHit(id, direction, noteType, isSustainNote)
if noteType == 'character' then
objectPlayAnimation('character', singAnims[direction + 1], false)
end
end
function onBeatHit() -- triggered 4 times per section
if curBeat % 2 == 0 then
objectPlayAnimation('character', 'idle');
end
end
function onCountdownTick(counter)
-- counter = 0 -> "Three"
-- counter = 1 -> "Two"
-- counter = 2 -> "One"
-- counter = 3 -> "Go!"
-- counter = 4 -> Nothing happens lol, tho it is triggered at the same time as onSongStart i think
if counter % 2 == 0 then
objectPlayAnimation('character', 'idle');
end
end
function onEvent(name,value1,value2)
if name == 'Play Animation' then
if value1 == 'mattw' then
addLuaSprite('matt', false);
objectPlayAnimation('matt', 'enter', true); --gf plays the walking anim
doTweenX('mattTweenX', 'matt', 1200, 7, 'linear'); --gf seemingly moves
end
if value2 == 'tomw' then
addLuaSprite('tom', true);
objectPlayAnimation('tom', 'enter', true); --gf plays the walking anim
doTweenX('tomTweenX', 'tom', 2570, 4, 'linear'); --gf seemingly moves
end
if value1 == 'matti' then
objectPlayAnimation('matt', 'idle', true); --after gf walks into the stage, she plays her idle
end
if value2 == 'tomi' then
objectPlayAnimation('tom', 'idle', true); --after gf walks into the stage, she plays her idle
end
if value1 == 'mattp' then
objectPlayAnimation('matt', 'pissed', true); --after gf walks into the stage, she plays her idle
if value2 == 'tomp' then
objectPlayAnimation('tom', 'pissed', true); --after gf walks into the stage, she plays her idle
end
end end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.