repo_name stringlengths 6 78 | path stringlengths 4 206 | copies stringclasses 281
values | size stringlengths 4 7 | content stringlengths 625 1.05M | license stringclasses 15
values |
|---|---|---|---|---|---|
Gobaan/PZSmashAndGrab | SmashAndGrab/Contents/mods/SmashAndGrab/media/lua/client/ISUI/01CustomEvents.lua | 1 | 1384 | SmashAndGrabCustomEvent = {}
SmashAndGrabCustomEvent.registeredFunctions = {}
SmashAndGrabCustomEvent.prelisteners = {}
SmashAndGrabCustomEvent.postlisteners = {}
function SmashAndGrabCustomEvent.addListener(funcName)
local name = string.gsub(funcName, ":", ".")
local names = luautils.split(name, ".")
local eventName = table.concat(names, "_")
local function wrapper(...)
local args = SmashAndGrabUtils.pack(...)
local preargs = SmashAndGrabUtils.pack(...)
local postargs = SmashAndGrabUtils.pack(...)
local fn = SmashAndGrabCustomEvent.registeredFunctions[funcName]
table.insert(preargs, 1, "pre" .. eventName)
table.insert(postargs, 1, "post" .. eventName)
triggerEvent(unpack(preargs))
fn(unpack(args))
triggerEvent(unpack(postargs))
end
local function assign(names, table)
if not table[names[1]] then
return
end
if names[2] then
assign({ select(2, unpack(names)) }, table[names[1]])
else
SmashAndGrabCustomEvent.registeredFunctions[funcName] = table[names[1]]
table[names[1]] = wrapper
end
end
if not Events['pre' .. eventName] then
assign(names, _G)
LuaEventManager.AddEvent('pre' .. eventName)
LuaEventManager.AddEvent('post' .. eventName)
end
end
| apache-2.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[gameplay]/mapratings/mapratings_sql.lua | 1 | 5987 | local theCon = false
addEventHandler('onResourceStart', resourceRoot,
function()
theCon = dbConnect( 'mysql', 'host=' .. get"*gcshop.host" .. ';dbname=' .. get"*gcshop.dbname", get("*gcshop.user"), get("*gcshop.pass"))
dbExec( theCon, "CREATE TABLE IF NOT EXISTS `mapratings` ( `forumid` INT, `serial` TINYTEXT, `playername` TINYTEXT, `mapresourcename` VARCHAR(70) BINARY NOT NULL, `rating` BOOLEAN NOT NULL, `time` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP )" )
end
)
function rate (player, cmd)
if not exports.gc:isPlayerLoggedInGC(player) then outputChatBox("You have to be logged into GCs to access this command. Press f6",player, 255,0,0) return end
local mapresourcename = getResourceName( exports.mapmanager:getRunningGamemodeMap() )
local forumid = exports.gc:getPlayerForumID(player)
local serial = getPlayerSerial(player)
local rating = cmd=="like" and 1 or 0
if not (forumid and mapresourcename and theCon) then return end
local mapname = getResourceInfo(exports.mapmanager:getRunningGamemodeMap() , "name") or mapresourcename
local theQuery = dbQuery(theCon, "SELECT rating FROM mapratings WHERE mapresourcename=? AND (forumid=? OR serial=? OR playername=?)", mapresourcename, forumid, serial, _getPlayerName(player))
local sql = dbPoll(theQuery,-1)
if #sql > 0 then
dbExec( theCon, "UPDATE mapratings SET rating=?, forumid=? WHERE mapresourcename=? AND (forumid=? OR serial=? OR playername=?)", rating, forumid, mapresourcename, forumid, serial, _getPlayerName(player) )
if sql[1].rating == rating then
outputChatBox("You already "..cmd.."d this map.", player, 255, 0, 0, true)
else
outputChatBox("Changed from "..(rating==1 and "dislike" or "like").." to "..cmd..".", player, 225, 170, 90, true)
end
else
if dbExec( theCon, "INSERT INTO mapratings (forumid, mapresourcename,rating) VALUES (?,?,?)", forumid, mapresourcename, rating) then
outputChatBox("You "..cmd.."d the map: "..mapname, player, 225, 170, 90, true)
end
end
triggerEvent("onSendMapRating", root, getMapRating(mapresourcename, true) or "unrated")
end
addCommandHandler('like', rate, false, false)
addCommandHandler('dislike', rate, false, false)
local ratingCache = {}
function getMapRating(mapresourcename, forceUpdate)
if not ratingCache[mapresourcename] or forceUpdate then
local sql_like_query = dbQuery(theCon,"SELECT COUNT(rating) AS count FROM mapratings WHERE rating=? AND mapresourcename=?",1,mapresourcename)
local sql_like = dbPoll(sql_like_query,-1)
local sql_hate_query = dbQuery(theCon,"SELECT COUNT(rating) AS count FROM mapratings WHERE rating=? AND mapresourcename=?",0,mapresourcename)
local sql_hate = dbPoll(sql_hate_query,-1)
ratingCache[mapresourcename] = {likes = sql_like[1].count , hates = sql_hate[1].count}
end
return ratingCache[mapresourcename] or {false}
end
function getTableOfRatedMaps()
local mapTable = {}
local query = dbQuery(theCon,"SELECT * FROM mapratings")
local sql = dbPoll(query,-1)
if #sql > 0 then
for i, j in ipairs(sql) do
if not mapTable[sql[i].mapresourcename] then
mapTable[sql[i].mapresourcename] = {}
mapTable[sql[i].mapresourcename].likes = 0
mapTable[sql[i].mapresourcename].dislikes = 0
end
if sql[i].rating == 1 then
mapTable[sql[i].mapresourcename].likes = mapTable[sql[i].mapresourcename].likes + 1
elseif sql[i].rating == 0 then
mapTable[sql[i].mapresourcename].dislikes = mapTable[sql[i].mapresourcename].dislikes + 1
end
end
return mapTable
end
return false
end
-- remove color coding from string
function removeColorCoding ( name )
return type(name)=='string' and string.gsub ( name, '#%x%x%x%x%x%x', '' ) or name
end
function _getPlayerName ( player )
return removeColorCoding ( getPlayerName ( player ) )
end
-- [[
addCommandHandler('convertratingsfromsqlitetomysql', function()
local theCon2 = dbConnect("sqlite","mapratings.db")
local query = dbQuery(theCon2,"SELECT * FROM mapRate")
local sql = dbPoll(query,-1)
local resources = getResources()
local link = {}
local inserts = {}
if #sql > 0 then
for _, j in ipairs(sql) do
if not link[j.mapname] then
local i
for k,v in pairs(resources) do
if getResourceInfo(v, 'name') == j.mapname or getResourceName(v) == j.mapname then
link[j.mapname] = v
i = k
break
end
end
if i then resources[i] = nil end
link[j.mapname] = link[j.mapname] or true
outputDebugString('MAP ' .. j.mapname .. ' ' .. tostring(link[j.mapname]), link[j.mapname]== true and 2 or 3)
end
end
for _, j in ipairs(sql) do
local res = link[j.mapname]
if res and res ~= true then
if j.serial then
-- outputDebugString(' *RES ' .. getResourceName(res) .. j.serial)
table.insert(inserts, {q = "INSERT INTO mapratings (serial, playername, mapresourcename,rating) VALUES (?,?,?,?)", args = {j.serial, removeColorCoding(j.playername), getResourceName(res), j.rating=="like" and 1 or 0}})
-- dbExec( theCon, "INSERT INTO mapratings (serial, playername, mapresourcename,rating) VALUES (?,?,?,?)", removeColorCoding(j.playername), j.serial, getResourceName(res), j.rating )
else
-- outputDebugString(' *RES ' .. getResourceName(res) .. j.playername)
table.insert(inserts, {q = "INSERT INTO mapratings (playername, mapresourcename,rating) VALUES (?,?,?)", args = {removeColorCoding(j.playername), getResourceName(res), j.rating=="like" and 1 or 0}})
-- dbExec( theCon, "INSERT INTO mapratings (playername, mapresourcename,rating) VALUES (?,?,?)", removeColorCoding(j.playername), getResourceName(res), j.rating )
end
end
end
end
return insertNext(inserts)
end)
function insertNext(inserts)
for x = 1,1000 do
if #inserts < 1 then return end
local i = table.remove(inserts)
-- outputDebugString(' *RES ' .. i.args[2] .. i.args[1])
dbExec(theCon, i.q, unpack(i.args))
end
outputChatBox("Todo: " .. #inserts)
setTimer(insertNext, 50, 1, inserts)
end
--]] | mit |
ffxiphoenix/darkstar | scripts/zones/Giddeus/npcs/HomePoint#1.lua | 17 | 1234 | -----------------------------------
-- Area: Giddeus
-- NPC: HomePoint#1
-- @pos -132 -3 -303 145
-----------------------------------
package.loaded["scripts/zones/Giddeus/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/Giddeus/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fc, 54);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x21fc) then
if (option == 1) then
player:setHomePoint();
player:messageSpecial(HOMEPOINT_SET);
else
hpTeleport( player, option);
end
end
end;
| gpl-3.0 |
ld-test/gumbo | gumbo/dom/Element.lua | 2 | 9662 | local util = require "gumbo.dom.util"
local Node = require "gumbo.dom.Node"
local ChildNode = require "gumbo.dom.ChildNode"
local ParentNode = require "gumbo.dom.ParentNode"
local AttributeList = require "gumbo.dom.AttributeList"
local Attribute = require "gumbo.dom.Attribute"
local ElementList = require "gumbo.dom.ElementList"
local DOMTokenList = require "gumbo.dom.DOMTokenList"
local Buffer = require "gumbo.Buffer"
local Set = require "gumbo.Set"
local constants = require "gumbo.constants"
local namespaces = constants.namespaces
local voidElements = constants.voidElements
local rcdataElements = constants.rcdataElements
local booleanAttributes = constants.booleanAttributes
local assertElement = util.assertElement
local assertNode = util.assertNode
local assertName = util.assertName
local assertString = util.assertString
local NYI = util.NYI
local type, ipairs = type, ipairs
local tremove, setmetatable = table.remove, setmetatable
local _ENV = nil
local Element = util.merge(Node, ChildNode, ParentNode, {
type = "element",
nodeType = 1,
namespace = "html",
attributes = setmetatable({length = 0}, AttributeList),
readonly = Set{"classList", "namespaceURI", "tagName"}
})
function Element:__tostring()
assertElement(self)
return self.tagHTML
end
function Element:getElementsByTagName(localName)
--TODO: should use assertElement(self), but method is shared with Document
assertNode(self)
assertString(localName)
local collection = {}
local length = 0
if localName ~= "" then
if localName == "*" then
for node in self:walk() do
if node.type == "element" then
length = length + 1
collection[length] = node
end
end
else
local htmlns = "http://www.w3.org/1999/xhtml"
local localNameLower = localName:lower()
for node in self:walk() do
if node.type == "element" then
local ns = node.namespaceURI
if (ns == htmlns and node.localName == localNameLower)
or (ns ~= htmlns and node.localName == localName)
then
length = length + 1
collection[length] = node
end
end
end
end
end
collection.length = length
return setmetatable(collection, ElementList)
end
local function getClassList(class)
local list = {}
local length = 0
if class then
for s in class:gmatch "%S+" do
if not list[s] then
length = length + 1
list[length] = s
list[s] = length
end
end
end
list.length = length
return list
end
function Element:getElementsByClassName(classNames)
--TODO: should use assertElement(self), but method is shared with Document
assertNode(self)
assertString(classNames)
local classes = getClassList(classNames)
local collection = {}
local length = 0
for node in self:walk() do
if node.type == "element" then
local classList = node.classList
local matches = 0
for i, class in ipairs(classes) do
if classList[class] then
matches = matches + 1
end
end
if matches == classes.length then
length = length + 1
collection[length] = node
end
end
end
collection.length = length
return setmetatable(collection, ElementList)
end
function Element:getAttribute(name)
assertElement(self)
if type(name) == "string" then
-- If the context object is in the HTML namespace and its node document
-- is an HTML document, let name be converted to ASCII lowercase.
if self.namespace == "html" then
name = name:lower()
end
-- Return the value of the first attribute in the context object's
-- attribute list whose name is name, and null otherwise.
local attr = self.attributes[name]
if attr then
return attr.value
end
end
end
function Element:setAttribute(name, value)
assertElement(self)
assertName(name)
assertString(value)
local attributes = self.attributes
if attributes == Element.attributes then
local attr = setmetatable({name = name, value = value}, Attribute)
self.attributes = setmetatable({attr, [name] = attr}, AttributeList)
else
local attr = attributes[name]
if attr then
attr.value = value
else
attr = setmetatable({name = name, value = value}, Attribute)
attributes[#attributes+1] = attr
attributes[name] = attr
end
end
end
function Element:removeAttribute(name)
assertElement(self)
assertString(name)
local attributes = self.attributes
for i, attr in ipairs(attributes) do
if attr.name == name then
attributes[name] = nil
tremove(attributes, i)
end
end
end
function Element:hasAttribute(name)
assertElement(self)
return self:getAttribute(name) and true or false
end
function Element:hasAttributes()
assertElement(self)
return self.attributes[1] and true or false
end
function Element:cloneNode(deep)
assertElement(self)
if deep then NYI() end -- << TODO
local clone = {
localName = self.localName,
namespace = self.namespace,
prefix = self.prefix
}
if self:hasAttributes() then
local attrs = {} -- TODO: attrs = createtable(#self.attributes, 0)
for i, attr in ipairs(self.attributes) do
local t = {
name = attr.name,
value = attr.value,
prefix = attr.prefix
}
attrs[i] = setmetatable(t, Attribute)
attrs[attr.name] = t
end
clone.attributes = setmetatable(attrs, AttributeList)
end
return setmetatable(clone, Element)
end
-- TODO: Element.prefix
-- TODO: function Element.getAttributeNS(namespace, localName)
-- TODO: function Element.setAttributeNS(namespace, name, value)
-- TODO: function Element.removeAttributeNS(namespace, localName)
-- TODO: function Element.hasAttributeNS(namespace, localName)
-- TODO: function Element.closest(selectors)
-- TODO: function Element.matches(selectors)
-- TODO: function Element.getElementsByTagNameNS(namespace, localName)
function Element.getters:namespaceURI()
return namespaces[self.namespace]
end
-- TODO: implement all cases from http://www.w3.org/TR/dom/#dom-element-tagname
function Element.getters:tagName()
if self.namespace == "html" then
return self.localName:upper()
else
return self.localName
end
end
Element.getters.nodeName = Element.getters.tagName
function Element.getters:classList()
return setmetatable(getClassList(self.className), DOMTokenList)
end
local function serialize(node, buf)
local type = node.type
if type == "element" then
local tag = node.localName
buf:write("<", tag)
for i, attr in ipairs(node.attributes) do
local ns, name = attr.prefix, attr.name
if ns and not (ns == "xmlns" and name == "xmlns") then
buf:write(" ", ns, ":", name)
else
buf:write(" ", name)
end
buf:write('="', attr.escapedValue, '"')
end
buf:write(">")
if not voidElements[tag] then
local children = node.childNodes
for i = 1, #children do
serialize(children[i], buf)
end
buf:write("</", tag, ">")
end
elseif type == "text" then
if rcdataElements[node.parentNode.localName] then
buf:write(node.data)
else
buf:write(node.escapedData)
end
elseif type == "whitespace" then
buf:write(node.data)
elseif type == "comment" then
buf:write("<!--", node.data, "-->")
end
end
function Element.getters:innerHTML()
local buffer = Buffer()
for i, node in ipairs(self.childNodes) do
serialize(node, buffer)
end
return buffer:tostring()
end
function Element.getters:outerHTML()
local buffer = Buffer()
serialize(self, buffer)
return buffer:tostring()
end
function Element.getters:tagHTML()
local buffer = Buffer()
local tag = self.localName
buffer:write("<", tag)
for i, attr in ipairs(self.attributes) do
local ns, name, val = attr.prefix, attr.name, attr.value
if ns and not (ns == "xmlns" and name == "xmlns") then
buffer:write(" ", ns, ":", name)
else
buffer:write(" ", name)
end
local bset = booleanAttributes[tag]
local boolattr = (bset and bset[name]) or booleanAttributes[""][name]
if not boolattr or not (val == "" or val == name) then
buffer:write('="', attr.escapedValue, '"')
end
end
buffer:write(">")
return buffer:tostring()
end
-- TODO:
Element.setters.innerHTML = NYI
Element.setters.outerHTML = NYI
function Element.getters:id()
local id = self.attributes.id
return id and id.value
end
function Element.getters:className()
local class = self.attributes.class
return class and class.value
end
function Element.setters:id(value)
self:setAttribute("id", value)
end
function Element.setters:className(value)
self:setAttribute("class", value)
end
return Element
| isc |
ffxiphoenix/darkstar | scripts/globals/spells/raiton_ichi.lua | 17 | 1257 | -----------------------------------------
-- Spell: Raiton: Ichi
-- Deals lightning damage to an enemy and lowers its resistance against earth.
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
--doNinjutsuNuke(V,M,caster,spell,target,hasMultipleTargetReduction,resistBonus)
local duration = 15 + caster:getMerit(MERIT_RAITON_EFFECT) -- T1 bonus debuff duration
local bonusAcc = 0;
local bonusMab = caster:getMerit(MERIT_RAITON_EFFECT) + caster:getMod(MOD_NIN_NUKE_BONUS); -- T1 mag atk + "enhances Ninjustu damage" mod
if (caster:isBehind(target,15) and caster:hasStatusEffect(EFFECT_INNIN)) then -- Innin mag atk bonus from behind, guesstimating angle at 15 degrees
bonusMab = bonusMab + caster:getStatusEffect(EFFECT_INNIN):getPower();
end
local dmg = doNinjutsuNuke(28,1,caster,spell,target,false,bonusAcc,bonusMab);
handleNinjutsuDebuff(caster,target,spell,30,duration,MOD_EARTHRES);
return dmg;
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/globals/items/cup_of_healing_tea.lua | 35 | 1373 | -----------------------------------------
-- ID: 4286
-- Item: cup_of_healing_tea
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Magic 10
-- Vitality -1
-- Charisma 3
-- Magic Regen While Healing 2
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,4286);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_MP, 10);
target:addMod(MOD_VIT, -1);
target:addMod(MOD_CHR, 3);
target:addMod(MOD_MPHEAL, 2);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_MP, 10);
target:delMod(MOD_VIT, -1);
target:delMod(MOD_CHR, 3);
target:delMod(MOD_MPHEAL, 2);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Valkurm_Dunes/npcs/Hieroglyphics.lua | 17 | 2399 | -----------------------------------
-- Area: Valkurm_Dunes
-- NPC: Hieroglyphics
-- Dynamis Valkurm_Dunes Enter
-- @pos 117 -10 133 172 103
-----------------------------------
package.loaded["scripts/zones/Valkurm_Dunes/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/dynamis");
require("scripts/globals/missions");
require("scripts/zones/Valkurm_Dunes/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasCompletedMission(COP,DARKNESS_NAMED) or FREE_COP_DYNAMIS == 1) then
local firstDyna = 0;
local realDay = os.time();
local dynaWaitxDay = player:getVar("dynaWaitxDay");
if (checkFirstDyna(player,7)) then
player:startEvent(0x0021);
elseif (player:getMainLvl() < DYNA_LEVEL_MIN) then
player:messageSpecial(PLAYERS_HAVE_NOT_REACHED_LEVEL,DYNA_LEVEL_MIN);
elseif ((dynaWaitxDay + (BETWEEN_2DYNA_WAIT_TIME * 24 * 60 * 60)) < realDay or player:getVar("DynamisID") == GetServerVariable("[DynaValkurm]UniqueID")) then
player:startEvent(0x0010,7,0,0,BETWEEN_2DYNA_WAIT_TIME,32,VIAL_OF_SHROUDED_SAND,4236,4237);
else
dayRemaining = math.floor(((dynaWaitxDay + (BETWEEN_2DYNA_WAIT_TIME * 24 * 60 * 60)) - realDay)/3456);
printf("dayRemaining : %u",dayRemaining );
player:messageSpecial(YOU_CANNOT_ENTER_DYNAMIS,dayRemaining,7);
end
else
player:messageSpecial(MYSTERIOUS_VOICE);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("updateRESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("finishRESULT: %u",option);
if (csid == 0x0021) then
if (checkFirstDyna(player,7)) then
player:setVar("Dynamis_Status",player:getVar("Dynamis_Status") + 128);
end
elseif (csid == 0x0010 and option == 0) then
player:setPos(100,-8,131,47,0x27);
end
end; | gpl-3.0 |
WUTiAM/uLua2 | Assets/LuaScripts/depends/protobuf/descriptor.lua | 1 | 1956 | --
--------------------------------------------------------------------------------
-- FILE: descriptor.lua
-- DESCRIPTION: protoc-gen-lua
-- Google's Protocol Buffers project, ported to lua.
-- https://code.google.com/p/protoc-gen-lua/
--
-- Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com
-- All rights reserved.
--
-- Use, modification and distribution are subject to the "New BSD License"
-- as listed at <url: http://www.opensource.org/licenses/bsd-license.php >.
--
-- COMPANY: NetEase
-- CREATED: 2010年08月11日 18时45分43秒 CST
--------------------------------------------------------------------------------
--
local descriptor = {}
descriptor.FieldDescriptor = {
TYPE_DOUBLE = 1,
TYPE_FLOAT = 2,
TYPE_INT64 = 3,
TYPE_UINT64 = 4,
TYPE_INT32 = 5,
TYPE_FIXED64 = 6,
TYPE_FIXED32 = 7,
TYPE_BOOL = 8,
TYPE_STRING = 9,
TYPE_GROUP = 10,
TYPE_MESSAGE = 11,
TYPE_BYTES = 12,
TYPE_UINT32 = 13,
TYPE_ENUM = 14,
TYPE_SFIXED32 = 15,
TYPE_SFIXED64 = 16,
TYPE_SINT32 = 17,
TYPE_SINT64 = 18,
MAX_TYPE = 18,
-- Must be consistent with C++ FieldDescriptor::CppType enum in
-- descriptor.h.
--
CPPTYPE_INT32 = 1,
CPPTYPE_INT64 = 2,
CPPTYPE_UINT32 = 3,
CPPTYPE_UINT64 = 4,
CPPTYPE_DOUBLE = 5,
CPPTYPE_FLOAT = 6,
CPPTYPE_BOOL = 7,
CPPTYPE_ENUM = 8,
CPPTYPE_STRING = 9,
CPPTYPE_MESSAGE = 10,
MAX_CPPTYPE = 10,
-- Must be consistent with C++ FieldDescriptor::Label enum in
-- descriptor.h.
--
LABEL_OPTIONAL = 1,
LABEL_REQUIRED = 2,
LABEL_REPEATED = 3,
MAX_LABEL = 3
}
return descriptor
| mit |
vilarion/Illarion-Content | monster/race_60_fox/default.lua | 3 | 1153 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local base = require("monster.base.base")
local foxes = require("monster.race_60_fox.base")
local foxden = require("content.foxden")
local M = foxes.generateCallbacks()
local orgOnSpawn = M.onSpawn
function M.onSpawn(monster)
if orgOnSpawn ~= nil then
orgOnSpawn(monster)
end
base.setColor{monster = monster, target = base.HAIR_COLOR, hue = 0, saturation = 0, value = 0.2, alpha = 180}
end
function M.abortRoute(monster)
foxden.foxAbortRoute(monster)
end
return M
| agpl-3.0 |
ld-test/gumbo | test/dom/Element-classList.lua | 3 | 12634 | local gumbo = require "gumbo"
local DOMTokenList = require "gumbo.dom.DOMTokenList"
local type, assert, pcall = type, assert, pcall
local getmetatable = getmetatable
local _ENV = nil
local input = [[
<!doctype html>
<html>
<head class="test test">
<title class=" ">Element.classList in case-sensitive documents</title>
<link rel="help" href="https://dom.spec.whatwg.org/#concept-class">
<style type="text/css">.foo {font-style: italic}</style>
</head>
<body>
<div id="log"></div>
</body>
</html>
]]
local document = assert(gumbo.parse(input))
local elem = document:getElementsByTagName("title")[1]
local secondelem = document:getElementsByTagName("head")[1]
assert(type(elem.classList) == "table", "Element.classList must be a table")
assert(type(document.documentElement.classList) == "table")
assert(getmetatable(elem.classList) == DOMTokenList)
assert(secondelem.classList.length == 1)
assert(secondelem.classList:item(1) == "test")
assert(secondelem.classList:contains("test") == true)
assert(elem.classList.length == 0)
assert(elem.classList:contains("foo") == false)
assert(elem.classList:item(0) == nil)
assert(elem.classList:item(-1) == nil)
assert(elem.classList[1] == nil)
assert(elem.classList[-1] == nil)
assert(elem.className == " ")
assert(elem.classList:toString() == '')
do
local status, err = pcall(function() elem.classList:contains("") end)
assert(status == false)
assert(err:find("SyntaxError"))
end
--[[ TODO:
do -- :add(empty_string) must throw a SYNTAX_ERR
assert(type(elem.classList.add) == "function")
local status, err = pcall(function() elem.classList:add("") end)
assert(status == false)
assert(err:find("SyntaxError"))
end
do -- :remove(empty_string) must throw a SYNTAX_ERR
assert(type(elem.classList.remove) == "function")
local status, err = pcall(function() elem.classList:remove("") end)
assert(status == false)
assert(err:find("SyntaxError"))
end
do -- .toggle(empty_string) must throw a SYNTAX_ERR
assert(type(elem.classList.toggle) == "function")
local status, err = pcall(function() elem.classList:toggle("") end)
assert(status == false)
assert(err:find("SyntaxError"))
end
]]
do -- :contains(string_with_spaces) must throw an INVALID_CHARACTER_ERR
local status, err = pcall(function() elem.classList:contains("a b") end)
assert(status == false)
assert(err:find("InvalidCharacterError"))
end
--[=[ TODO:
test(function () {
assert_throws( 'INVALID_CHARACTER_ERR', function () { elem.classList.add('a b'); } );
}, '.add(string_with_spaces) must throw an INVALID_CHARACTER_ERR');
test(function () {
assert_throws( 'INVALID_CHARACTER_ERR', function () { elem.classList.remove('a b'); } );
}, '.remove(string_with_spaces) must throw an INVALID_CHARACTER_ERR');
test(function () {
assert_throws( 'INVALID_CHARACTER_ERR', function () { elem.classList.toggle('a b'); } );
}, '.toggle(string_with_spaces) must throw an INVALID_CHARACTER_ERR');
elem.className = 'foo';
test(function () {
assert_equals( getComputedStyle(elem,null).fontStyle, 'italic', 'critical test; required by the testsuite' );
}, 'computed style must update when setting .className');
test(function () {
assert_true( elem.classList.contains('foo') );
}, 'classList.contains must update when .className is changed');
test(function () {
assert_false( elem.classList.contains('FOO') );
}, 'classList.contains must be case sensitive');
test(function () {
assert_false( elem.classList.contains('foo.') );
assert_false( elem.classList.contains('foo)') );
assert_false( elem.classList.contains('foo\'') );
assert_false( elem.classList.contains('foo$') );
assert_false( elem.classList.contains('foo~') );
assert_false( elem.classList.contains('foo?') );
assert_false( elem.classList.contains('foo\\') );
}, 'classList.contains must not match when punctuation characters are added');
test(function () {
elem.classList.add('FOO');
assert_equals( getComputedStyle(elem,null).fontStyle, 'italic' );
}, 'classList.add must not cause the CSS selector to stop matching');
test(function () {
assert_true( elem.classList.contains('foo') );
}, 'classList.add must not remove existing classes');
test(function () {
assert_true( elem.classList.contains('FOO') );
}, 'classList.contains case sensitivity must match a case-specific string');
test(function () {
assert_equals( elem.classList.length, 2 );
}, 'classList.length must correctly reflect the number of tokens');
test(function () {
assert_equals( elem.classList.item(0), 'foo' );
}, 'classList.item(0) must return the first token');
test(function () {
assert_equals( elem.classList.item(1), 'FOO' );
}, 'classList.item must return case-sensitive strings and preserve token order');
test(function () {
assert_equals( elem.classList[0], 'foo' );
}, 'classList[0] must return the first token');
test(function () {
assert_equals( elem.classList[1], 'FOO' );
}, 'classList[index] must return case-sensitive strings and preserve token order');
test(function () {
/* the normative part of the spec states that:
"The object's supported property indices are the numbers in the range zero to the number of tokens in tokens minus one"
...
"The term[...] supported property indices [is] used as defined in the WebIDL specification."
WebIDL creates actual OwnProperties and then [] just acts as a normal property lookup */
assert_equals( elem.classList[2], undefined );
}, 'classList[index] must still be undefined for out-of-range index when earlier indexes exist');
test(function () {
assert_equals( elem.className, 'foo FOO' );
}, 'className must update correctly when items have been added through classList');
test(function () {
assert_equals( elem.classList + '', 'foo FOO', 'implicit' );
assert_equals( elem.classList.toString(), 'foo FOO', 'explicit' );
}, 'classList must stringify correctly when items have been added');
test(function () {
elem.classList.add('foo');
assert_equals( elem.classList.length, 2 );
assert_equals( elem.classList + '', 'foo FOO', 'implicit' );
assert_equals( elem.classList.toString(), 'foo FOO', 'explicit' );
}, 'classList.add should not add a token if it already exists');
test(function () {
elem.classList.remove('bar');
assert_equals( elem.classList.length, 2 );
assert_equals( elem.classList + '', 'foo FOO', 'implicit' );
assert_equals( elem.classList.toString(), 'foo FOO', 'explicit' );
}, 'classList.remove removes arguments passed, if they are present.');
test(function () {
elem.classList.remove('foo');
assert_equals( elem.classList.length, 1 );
assert_equals( elem.classList + '', 'FOO', 'implicit' );
assert_equals( elem.classList.toString(), 'FOO', 'explicit' );
assert_false( elem.classList.contains('foo') );
assert_true( elem.classList.contains('FOO') );
}, 'classList.remove must remove existing tokens');
test(function () {
assert_not_equals( getComputedStyle(elem,null).fontStyle, 'italic' );
}, 'classList.remove must not break case-sensitive CSS selector matching');
test(function () {
secondelem.classList.remove('test');
assert_equals( secondelem.classList.length, 0 );
assert_false( secondelem.classList.contains('test') );
}, 'classList.remove must remove duplicated tokens');
test(function () {
secondelem.className = 'token1 token2 token3';
secondelem.classList.remove('token2');
assert_equals( secondelem.classList + '', 'token1 token3', 'implicit' );
assert_equals( secondelem.classList.toString(), 'token1 token3', 'explicit' );
}, 'classList.remove must collapse whitespace around removed tokens');
test(function () {
secondelem.className = ' token1 token2 ';
secondelem.classList.remove('token2');
assert_equals( secondelem.classList + '', 'token1', 'implicit' );
assert_equals( secondelem.classList.toString(), 'token1', 'explicit' );
}, 'classList.remove must collapse whitespaces around each token');
test(function () {
secondelem.className = ' token1 token2 token1 ';
secondelem.classList.remove('token2');
assert_equals( secondelem.classList + '', 'token1', 'implicit' );
assert_equals( secondelem.classList.toString(), 'token1', 'explicit' );
}, 'classList.remove must collapse whitespaces around each token and remove duplicates');
test(function () {
secondelem.className = ' token1 token2 token1 ';
secondelem.classList.remove('token1');
assert_equals( secondelem.classList + '', 'token2', 'implicit' );
assert_equals( secondelem.classList.toString(), 'token2', 'explicit' );
}, 'classList.remove must collapse whitespace when removing duplicate tokens');
test(function () {
secondelem.className = ' token1 token1 ';
secondelem.classList.add('token1');
assert_equals( secondelem.classList + '', 'token1', 'implicit' );
assert_equals( secondelem.classList.toString(), 'token1', 'explicit' );
}, 'classList.add must collapse whitespaces and remove duplicates when adding a token that already exists');
test(function () {
assert_true(elem.classList.toggle('foo'));
assert_equals( elem.classList.length, 2 );
assert_true( elem.classList.contains('foo') );
assert_true( elem.classList.contains('FOO') );
}, 'classList.toggle must toggle tokens case-sensitively when adding');
test(function () {
assert_equals( getComputedStyle(elem,null).fontStyle, 'italic' );
}, 'classList.toggle must not break case-sensitive CSS selector matching');
test(function () {
assert_false(elem.classList.toggle('foo'));
}, 'classList.toggle must be able to remove tokens');
test(function () {
//will return true if the last test incorrectly removed both
assert_false(elem.classList.toggle('FOO'));
assert_false( elem.classList.contains('foo') );
assert_false( elem.classList.contains('FOO') );
}, 'classList.toggle must be case-sensitive when removing tokens');
test(function () {
assert_not_equals( getComputedStyle(elem,null).fontStyle, 'italic' );
}, 'CSS class selectors must stop matching when all classes have been removed');
test(function () {
assert_equals( elem.className, '' );
}, 'className must be empty when all classes have been removed');
test(function () {
assert_equals( elem.classList + '', '', 'implicit' );
assert_equals( elem.classList.toString(), '', 'explicit' );
}, 'classList must stringify to an empty string when all classes have been removed');
test(function () {
assert_equals( elem.classList.item(0), null );
}, 'classList.item(0) must return null when all classes have been removed');
test(function () {
/* the normative part of the spec states that:
"unless the length is zero, in which case there are no supported property indices"
...
"The term[...] supported property indices [is] used as defined in the WebIDL specification."
WebIDL creates actual OwnProperties and then [] just acts as a normal property lookup */
assert_equals( elem.classList[0], undefined );
}, 'classList[0] must be undefined when all classes have been removed');
// The ordered set parser must skip ASCII whitespace (U+0009, U+000A, U+000C, U+000D, and U+0020.)
test(function () {
var foo = document.createElement('div');
foo.className = 'a ';
foo.classList.add('b');
assert_equals(foo.className,'a b');
}, 'classList.add should treat " " as a space');
test(function () {
var foo = document.createElement('div');
foo.className = 'a\t';
foo.classList.add('b');
assert_equals(foo.className,'a b');
}, 'classList.add should treat \\t as a space');
test(function () {
var foo = document.createElement('div');
foo.className = 'a\r';
foo.classList.add('b');
assert_equals(foo.className,'a b');
}, 'classList.add should treat \\r as a space');
test(function () {
var foo = document.createElement('div');
foo.className = 'a\n';
foo.classList.add('b');
assert_equals(foo.className,'a b');
}, 'classList.add should treat \\n as a space');
test(function () {
var foo = document.createElement('div');
foo.className = 'a\f';
foo.classList.add('b');
assert_equals(foo.className,'a b');
}, 'classList.add should treat \\f as a space');
test(function () {
//WebIDL and ECMAScript 5 - a readonly property has a getter but not a setter
//ES5 makes [[Put]] fail but not throw
var failed = false;
secondelem.className = 'token1';
try {
secondelem.classList.length = 0;
} catch(e) {
failed = e;
}
assert_equals(secondelem.classList.length,1);
assert_false(failed,'an error was thrown');
}, 'classList.length must be read-only');
test(function () {
var failed = false, realList = secondelem.classList;
try {
secondelem.classList = '';
} catch(e) {
failed = e;
}
assert_equals(secondelem.classList,realList);
assert_false(failed,'an error was thrown');
}, 'classList must be read-only');
]=]
| isc |
federicodotta/proxmark3 | client/lualibs/mf_default_keys.lua | 7 | 5016 |
local _keys = {
--[[
These keys are from the pm3 c-codebase.
--]]
'ffffffffffff', -- Default key (first key used by program if no user defined key)
'000000000000', -- Blank key
'a0a1a2a3a4a5', -- NFCForum MAD key
'b0b1b2b3b4b5',
'aabbccddeeff',
'4d3a99c351dd',
'1a982c7e459a',
'd3f7d3f7d3f7',
'714c5c886e97',
'587ee5f9350f',
'a0478cc39091',
'533cb6c723f6',
'8fd0a4f256e9',
--[[
The data below is taken form the Slurp project,
https://github.com/4ZM/slurp/blob/master/res/xml/mifare_default_keys.xml
released as GPLV3.
--]]
'000000000000', -- Default key
'ffffffffffff', -- Default key
'b0b1b2b3b4b5', -- Key from mfoc
'4d3a99c351dd', -- Key from mfoc
'1a982c7e459a', -- Key from mfoc
'aabbccddeeff', -- Key from mfoc
'714c5c886e97', -- Key from mfoc
'587ee5f9350f', -- Key from mfoc
'a0478cc39091', -- Key from mfoc
'533cb6c723f6', -- Key from mfoc
'8fd0a4f256e9', -- Key from mfoc
-- Data from: http://pastebin.com/wcTHXLZZ
'a64598a77478', -- RKF SL Key A
'26940b21ff5d', -- RKF SL Key A
'fc00018778f7', -- RKF SL Key A
'00000ffe2488', -- RKF SL Key B
'5c598c9c58b5', -- RKF SL Key B
'e4d2770a89be', -- RKF SL Key B
-- Data from: http://pastebin.com/svGjN30Q
'434f4d4d4f41', -- RKF JOJO GROUP Key A
'434f4d4d4f42', -- RKF JOJO GROUP Key B
'47524f555041', -- RKF JOJO GROUP Key A
'47524f555042', -- RKF JOJO GROUP Key B
'505249564141', -- RKF JOJO PRIVA Key A
'505249564142', -- RKF JOJO PRIVA Key B
-- Data from: http://pastebin.com/d7sSetef
'fc00018778f7', -- RKF Rejskort Danmark Key A
'00000ffe2488', -- RKF Rejskort Danmark Key B
'0297927c0f77', -- RKF Rejskort Danmark Key A
'ee0042f88840', -- RKF Rejskort Danmark Key B
'722bfcc5375f', -- RKF Rejskort Danmark Key A
'f1d83f964314', -- RKF Rejskort Danmark Key B
-- Data from: http://pastebin.com/pvJX0xVS
'54726176656C', -- Transport Key A
'776974687573', -- Transport Key B
'4AF9D7ADEBE4', -- Directory and event log Key A
'2BA9621E0A36', -- Directory and event log Key B
-- Data from: http://pastebin.com/Dnnc5dFC
-- New cards are not encrypted (MF Ultralight)
'fc00018778f7', -- Västtrafiken Key A
'00000ffe2488', -- Västtrafiken Key B
'0297927c0f77', -- Västtrafiken Key A
'ee0042f88840', -- Västtrafiken Key B
'54726176656c', -- Västtrafiken Key A
'776974687573', -- Västtrafiken Key B
-- Data from: http://pastebin.com/y3PDBWR1
'000000000001',
'a0a1a2a3a4a5',
'123456789abc',
'b127c6f41436',
'12f2ee3478c1',
'34d1df9934c5',
'55f5a5dd38c9',
'f1a97341a9fc',
'33f974b42769',
'14d446e33363',
'c934fe34d934',
'1999a3554a55',
'27dd91f1fcf1',
'a94133013401',
'99c636334433',
'43ab19ef5c31',
'a053a292a4af',
'434f4d4d4f41',
'434f4d4d4f42',
'505249565441',
'505249565442',
-- Data from,:, http://pastebin.com/TUXj17K3
'fc0001877bf7', -- RKF ÖstgötaTrafiken Key A
'00000ffe2488', -- RKF ÖstgötaTrafiken Key B
'0297927c0f77', -- RKF ÖstgötaTrafiken Key A
'ee0042f88840', -- RKF ÖstgötaTrafiken Key B
'54726176656c', -- RKF ÖstgötaTrafiken Key A
'776974687573', -- RKF ÖstgötaTrafiken Key B
--[[
The keys below are taken from from https://code.google.com/p/mifare-key-cracker/downloads/list
--]]
'bd493a3962b6',
'010203040506',
'111111111111',
'222222222222',
'333333333333',
'444444444444',
'555555555555',
'666666666666',
'777777777777',
'888888888888',
'999999999999',
'aaaaaaaaaaaa',
'bbbbbbbbbbbb',
'cccccccccccc',
'dddddddddddd',
'eeeeeeeeeeee',
'0123456789ab',
'123456789abc',
--[[
The keys below are taken from from https://github.com/4ZM/mfterm/blob/master/dictionary.txt
--]]
'abcdef123456', -- Key from ladyada.net
'000000000001',
'000000000002',
'00000000000a',
'00000000000b',
'100000000000',
'200000000000',
'a00000000000',
'b00000000000',
--[[
Should be for Mifare TNP3xxx tags A KEY.
--]]
'4b0b20107ccb',
--[[
Kiev metro cards
--]]
'8fe644038790',
'f14ee7cae863',
'632193be1c3c',
'569369c5a0e5',
'9de89e070277',
'eff603e1efe9',
'644672bd4afe',
'b5ff67cba951',
}
---
-- The keys above have just been pasted in, for completeness sake. They contain duplicates.
-- We need to weed the duplicates out before we expose the list to someone who actually wants to use them
-- @param list a list to do 'uniq' on
local function uniq(list)
local foobar = {}
--print("list length ", #list)
for _, value in pairs(list) do
value = value:lower()
if not foobar[value] then
foobar[value] = true
table.insert(foobar, value);
end
end
--print("final list length length ", #foobar)
return foobar
end
return uniq(_keys)
| gpl-2.0 |
Quenty/NevermoreEngine | src/ik/src/Shared/Grip/IKGripBase.lua | 1 | 1623 | --[=[
Meant to be used with a binder
@class IKGripBase
]=]
local require = require(script.Parent.loader).load(script)
local RunService = game:GetService("RunService")
local BaseObject = require("BaseObject")
local promisePropertyValue = require("promisePropertyValue")
local Promise = require("Promise")
local IKGripBase = setmetatable({}, BaseObject)
IKGripBase.ClassName = "IKGripBase"
IKGripBase.__index = IKGripBase
function IKGripBase.new(objectValue, serviceBag)
local self = setmetatable(BaseObject.new(objectValue), IKGripBase)
self._serviceBag = assert(serviceBag, "No serviceBag")
self._attachment = self._obj.Parent
assert(self._obj:IsA("ObjectValue"), "Not an object value")
assert(self._attachment:IsA("Attachment"), "Not parented to an attachment")
return self
end
function IKGripBase:GetPriority()
return 1
end
function IKGripBase:GetAttachment()
return self._obj.Parent
end
function IKGripBase:PromiseIKRig()
if self._ikRigPromise then
return self._ikRigPromise
end
local ikService
if RunService:IsServer() then
ikService = self._serviceBag:GetService(require("IKService"))
else
ikService = self._serviceBag:GetService(require("IKServiceClient"))
end
local promise = promisePropertyValue(self._obj, "Value")
self._maid:GiveTask(promise)
self._ikRigPromise = promise
:Then(function(humanoid)
if not humanoid:IsA("Humanoid") then
warn("[IKGripBase.PromiseIKRig] - Humanoid in link is not a humanoid")
return Promise.rejected()
end
return self._maid:GivePromise(ikService:PromiseRig(humanoid))
end)
return self._ikRigPromise
end
return IKGripBase | mit |
RodneyMcKay/x_hero_siege | game/scripts/vscripts/abilities/heroes/hero_paladin.lua | 1 | 15129 | --[[Author: Pizzalol
Date: 09.02.2015.
Chains from target to target, healing them and dealing damage to enemies in a small
radius around them
Jump priority is
1. Hurt heroes
2. Hurt units
3. Heroes
4. Units]]
function ShadowWave( keys )
local caster = keys.caster
local caster_location = caster:GetAbsOrigin()
local target = keys.target
local target_location = target:GetAbsOrigin()
local ability = keys.ability
local ability_level = ability:GetLevel() - 1
-- Ability variables
local bounce_radius = ability:GetLevelSpecialValueFor("bounce_radius", ability_level)
local damage_radius = ability:GetLevelSpecialValueFor("damage_radius", ability_level)
local max_targets = ability:GetLevelSpecialValueFor("max_targets", ability_level)
local damage = ability:GetLevelSpecialValueFor("damage", ability_level)
local heal = damage
local unit_healed = false
-- Particles
local shadow_wave_particle = keys.shadow_wave_particle
local shadow_wave_damage_particle = keys.damage_particle
-- Setting up the damage and hit tables
local hit_table = {}
local damage_table = {}
damage_table.attacker = caster
damage_table.damage_type = ability:GetAbilityDamageType()
damage_table.ability = ability
damage_table.damage = damage
-- If the target is not the caster then do the extra bounce for the caster
if target ~= caster then
-- Insert the caster into the hit table
table.insert(hit_table, caster)
-- Heal the caster and do damage to the units around it
caster:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), caster_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
end
-- Mark the target as already hit
table.insert(hit_table, target)
-- Heal the initial target and do the damage to the units around it
target:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), target_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
-- Priority is Hurt Heroes > Hurt Units > Heroes > Units
-- we start from 2 first because we healed 1 target already
for i = 2, max_targets do
-- Helper variable to keep track if we healed a unit already
unit_healed = false
-- Find all the heroes in bounce radius
local heroes = FindUnitsInRadius(caster:GetTeam(), target_location, nil, bounce_radius, ability:GetAbilityTargetTeam(), DOTA_UNIT_TARGET_HERO, 0, FIND_CLOSEST, false)
-- HURT HEROES --
-- First we check for hurt heroes
for _,unit in pairs(heroes) do
local check_unit = 0 -- Helper variable to determine if a unit has been hit or not
-- Checking the hit table to see if the unit is hit
for c = 0, #hit_table do
if hit_table[c] == unit then
check_unit = 1
end
end
-- If its not hit then check if the unit is hurt
if check_unit == 0 then
if unit:GetHealth() ~= unit:GetMaxHealth() then
-- After we find the hurt hero unit then we insert it into the hit table to keep track of it
-- and we also get the unit position
table.insert(hit_table, unit)
local unit_location = unit:GetAbsOrigin()
-- Create the particle for the visual effect
local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true)
ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true)
-- Set the unit as the new target
target = unit
target_location = unit_location
-- Heal it and deal damage to enemy units around it
target:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), target_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
-- Set the helper variable to true
unit_healed = true
-- Exit the loop for finding hurt heroes
break
end
end
end
-- Find all the units in bounce radius
local units = FindUnitsInRadius(caster:GetTeam(), target_location, nil, bounce_radius, ability:GetAbilityTargetTeam(), DOTA_UNIT_TARGET_BASIC, 0, FIND_CLOSEST, false)
-- HURT UNITS --
-- check for hurt units if we havent healed a unit yet
if not unit_healed then
for _,unit in pairs(units) do
local check_unit = 0 -- Helper variable to determine if the unit has been hit or not
-- Checking the hit table to see if the unit is hit
for c = 0, #hit_table do
if hit_table[c] == unit then
check_unit = 1
end
end
-- If its not hit then check if the unit is hurt
if check_unit == 0 then
if unit:GetHealth() ~= unit:GetMaxHealth() then
-- After we find the hurt hero unit then we insert it into the hit table to keep track of it
-- and we also get the unit position
table.insert(hit_table, unit)
local unit_location = unit:GetAbsOrigin()
-- Create the particle for the visual effect
local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true)
ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true)
-- Set the unit as the new target
target = unit
target_location = unit_location
-- Heal it and deal damage to enemy units around it
target:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), target_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
-- Set the helper variable to true
unit_healed = true
-- Exit the loop for finding hurt heroes
break
end
end
end
end
-- HEROES --
-- In this loop we search for valid heroes regardless if it is hurt or not
-- Search only if we havent healed a unit yet
if not unit_healed then
for _,unit in pairs(heroes) do
local check_unit = 0 -- Helper variable to determine if a unit has been hit or not
-- Checking the hit table to see if the unit is hit
for c = 0, #hit_table do
if hit_table[c] == unit then
check_unit = 1
end
end
-- If its not hit then do the bounce
if check_unit == 0 then
-- Insert the found unit into the hit table
-- and we also get the unit position
table.insert(hit_table, unit)
local unit_location = unit:GetAbsOrigin()
-- Create the particle for the visual effect
local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true)
ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true)
-- Set the unit as the new target
target = unit
target_location = unit_location
-- Heal it and deal damage to enemy units around it
target:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), target_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
-- Set the helper variable to true
unit_healed = true
-- Exit the loop
break
end
end
end
-- UNITS --
-- Search for units regardless if it is hurt or not
-- Search only if we havent healed a unit yet
if not unit_healed then
for _,unit in pairs(units) do
local check_unit = 0 -- Helper variable to determine if a unit has been hit or not
-- Checking the hit table to see if the unit is hit
for c = 0, #hit_table do
if hit_table[c] == unit then
check_unit = 1
end
end
-- If its not hit then do the bounce
if check_unit == 0 then
-- Insert the found unit into the hit table
-- and we also get the unit position
table.insert(hit_table, unit)
local unit_location = unit:GetAbsOrigin()
-- Create the particle for the visual effect
local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true)
ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true)
-- Set the unit as the new target
target = unit
target_location = unit_location
-- Heal it and deal damage to enemy units around it
target:Heal(heal, caster)
local units_to_damage = FindUnitsInRadius(caster:GetTeam(), target_location, nil, damage_radius, DOTA_UNIT_TARGET_TEAM_ENEMY, ability:GetAbilityTargetType(), 0, 0, false)
for _,v in pairs(units_to_damage) do
-- Play the particle
local damage_particle = ParticleManager:CreateParticle(shadow_wave_damage_particle, PATTACH_CUSTOMORIGIN, caster)
ParticleManager:SetParticleControlEnt(damage_particle, 0, v, PATTACH_POINT_FOLLOW, "attach_hitloc", v:GetAbsOrigin(), true)
ParticleManager:ReleaseParticleIndex(damage_particle)
damage_table.victim = v
ApplyDamage(damage_table)
end
-- Set the helper variable to true
unit_healed = true
-- Exit the loop for finding hurt heroes
break
end
end
end
end
end
function WaveOfTerrorVision( keys )
local caster = keys.caster
local caster_location = caster:GetAbsOrigin()
local ability = keys.ability
local target_point = keys.target_points[1]
local forwardVec = (target_point - caster_location):Normalized()
-- Projectile variables
local wave_speed = ability:GetLevelSpecialValueFor("wave_speed", (ability:GetLevel() - 1))
local wave_width = ability:GetLevelSpecialValueFor("wave_width", (ability:GetLevel() - 1))
local wave_range = ability:GetLevelSpecialValueFor("wave_range", (ability:GetLevel() - 1))
local wave_location = caster_location
local wave_particle = keys.wave_particle
-- Vision variables
local vision_aoe = ability:GetLevelSpecialValueFor("vision_aoe", (ability:GetLevel() - 1))
local vision_duration = ability:GetLevelSpecialValueFor("vision_duration", (ability:GetLevel() - 1))
-- Creating the projectile
local projectileTable =
{
EffectName = wave_particle,
Ability = ability,
vSpawnOrigin = caster_location,
vVelocity = Vector( forwardVec.x * wave_speed, forwardVec.y * wave_speed, 0 ),
fDistance = wave_range,
fStartRadius = wave_width,
fEndRadius = wave_width,
Source = caster,
bHasFrontalCone = false,
bReplaceExisting = false,
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES,
iUnitTargetType = DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO
}
-- Saving the projectile ID so that we can destroy it later
projectile_id = ProjectileManager:CreateLinearProjectile( projectileTable )
-- Timer to provide vision
Timers:CreateTimer( function()
-- Calculating the distance traveled
wave_location = wave_location + forwardVec * (wave_speed * 1/30)
-- Reveal the area after the projectile passes through it
AddFOWViewer(caster:GetTeamNumber(), wave_location, vision_aoe, vision_duration, false)
local distance = (wave_location - caster_location):Length2D()
-- Checking if we traveled far enough, if yes then destroy the timer
if distance >= wave_range then
return nil
else
return 1/30
end
end)
end
function Taunt( event )
local caster = event.caster
local ability = event.ability
local radius = ability:GetSpecialValueFor("radius")
local max_units = ability:GetSpecialValueFor("max_units")
caster:StartGesture(ACT_TINY_GROWL)
local count = 0
local targets = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_CLOSEST, false)
for _,unit in pairs(targets) do
if unit:HasAttackCapability() then
count = count + 1
unit:MoveToTargetToAttack(caster)
end
if count == max_units then return end
end
end
function LightFrenzy(keys)
--Refresh all abilities on the target.
for i = 0, 16, 1 do --The maximum number of abilities a unit can have is currently 17.
local current_ability = keys.target:GetAbilityByIndex(i)
if current_ability ~= nil then
if current_ability:GetName() ~= "holdout_light_frenzy" then
current_ability:EndCooldown()
end
end
end
--Refresh all items the target has.
for i=0, 5, 1 do
local current_item = keys.target:GetItemInSlot(i)
if current_item ~= nil then
current_item:EndCooldown()
end
end
end | gpl-2.0 |
ffxiphoenix/darkstar | scripts/globals/items/pickled_herring.lua | 35 | 1360 | -----------------------------------------
-- ID: 4490
-- Item: Pickled Herring
-- Food Effect: 30Min, All Races
-----------------------------------------
-- Dexterity 3
-- Mind -3
-- Attack % 12
-- Ranged ATT % 12
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,1800,4490);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, 3);
target:addMod(MOD_MND, -3);
target:addMod(MOD_ATTP, 12);
target:addMod(MOD_RATTP, 12);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, 3);
target:delMod(MOD_MND, -3);
target:delMod(MOD_ATTP, 12);
target:delMod(MOD_RATTP, 12);
end;
| gpl-3.0 |
Quenty/NevermoreEngine | src/binder/src/Shared/BinderUtils.lua | 1 | 4675 | --[=[
Utility methods for the binder object.
@class BinderUtils
]=]
local CollectionService = game:GetService("CollectionService")
local BinderUtils = {}
--[=[
Finds the first ancestor that is bound with the current child.
Skips the child class, of course.
@param binder Binder<T>
@param child Instance
@return T?
]=]
function BinderUtils.findFirstAncestor(binder, child)
assert(type(binder) == "table", "Binder must be binder")
assert(typeof(child) == "Instance", "Child parameter must be instance")
local current = child.Parent
while current do
local class = binder:Get(current)
if class then
return class
end
current = current.Parent
end
return nil
end
--[=[
Finds the first child bound with the given binder and returns
the bound class.
@param binder Binder<T>
@param parent Instance
@return T?
]=]
function BinderUtils.findFirstChild(binder, parent)
assert(type(binder) == "table", "Binder must be binder")
assert(typeof(parent) == "Instance", "Parent parameter must be instance")
for _, child in pairs(parent:GetChildren()) do
local class = binder:Get(child)
if class then
return class
end
end
return nil
end
--[=[
Gets all bound children of the given binder for the parent.
@param binder Binder<T>
@param parent Instance
@return {T}
]=]
function BinderUtils.getChildren(binder, parent)
assert(type(binder) == "table", "Binder must be binder")
assert(typeof(parent) == "Instance", "Parent parameter must be instance")
local objects = {}
for _, item in pairs(parent:GetChildren()) do
local obj = binder:Get(item)
if obj then
table.insert(objects, obj)
end
end
return objects
end
--[=[
Maps a list of binders into a look up table where the keys are
tags and the value is the binder.
Duplicates are overwritten by the last entry.
@param bindersList { Binder<any> }
@return { [string]: Binder<any> }
]=]
function BinderUtils.mapBinderListToTable(bindersList)
assert(type(bindersList) == "table", "bindersList must be a table of binders")
local tags = {}
for _, binder in pairs(bindersList) do
tags[binder:GetTag()] = binder
end
return tags
end
--[=[
Given a mapping of tags to binders, retrieves the bound values
from an instanceList by quering the list of :GetTags() instead
of iterating over each binder.
This lookup should be faster when there are potentially many
interaction points for a given tag map, but the actual bound
list should be low.
@param tagsMap { [string]: Binder<T> }
@param instanceList { Instance }
@return { T }
]=]
function BinderUtils.getMappedFromList(tagsMap, instanceList)
local objects = {}
for _, instance in pairs(instanceList) do
for _, tag in pairs(CollectionService:GetTags(instance)) do
local binder = tagsMap[tag]
if binder then
local obj = binder:Get(instance)
if obj then
table.insert(objects, obj)
end
end
end
end
return objects
end
--[=[
Given a list of binders retrieves all children bound with the given value.
@param bindersList { Binder<T> }
@param parent Instance
@return { T }
]=]
function BinderUtils.getChildrenOfBinders(bindersList, parent)
assert(type(bindersList) == "table", "bindersList must be a table of binders")
assert(typeof(parent) == "Instance", "Parent parameter must be instance")
local tagsMap = BinderUtils.mapBinderListToTable(bindersList)
return BinderUtils.getMappedFromList(tagsMap, parent:GetChildren())
end
--[=[
Gets all the linked (via objectValues of name `linkName`) bound objects
@param binder Binder<T>
@param linkName string -- Name of the object values required
@param parent Instance
@return {T}
]=]
function BinderUtils.getLinkedChildren(binder, linkName, parent)
local seen = {}
local objects = {}
for _, item in pairs(parent:GetChildren()) do
if item.Name == linkName and item:IsA("ObjectValue") and item.Value then
local obj = binder:Get(item.Value)
if obj then
if not seen[obj] then
seen[obj] = true
table.insert(objects, obj)
else
warn(("[BinderUtils.getLinkedChildren] - Double linked children at %q"):format(item:GetFullName()))
end
end
end
end
return objects
end
--[=[
Gets all bound descendants of the given binder for the parent.
@param binder Binder<T>
@param parent Instance
@return {T}
]=]
function BinderUtils.getDescendants(binder, parent)
assert(type(binder) == "table", "Binder must be binder")
assert(typeof(parent) == "Instance", "Parent parameter must be instance")
local objects = {}
for _, item in pairs(parent:GetDescendants()) do
local obj = binder:Get(item)
if obj then
table.insert(objects, obj)
end
end
return objects
end
return BinderUtils | mit |
ffxiphoenix/darkstar | scripts/zones/Dynamis-Xarcabard/mobs/Marquis_Orias.lua | 16 | 1255 | -----------------------------------
-- Area: Dynamis Xarcabard
-- NPC: Marquis Orias
-----------------------------------
require("scripts/globals/dynamis");
require("scripts/zones/Dynamis-Xarcabard/TextIDs");
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
local Animate_Trigger = GetServerVariable("[DynaXarcabard]Boss_Trigger");
if (mob:isInBattlefieldList() == false) then
mob:addInBattlefieldList();
Animate_Trigger = Animate_Trigger + 16;
SetServerVariable("[DynaXarcabard]Boss_Trigger",Animate_Trigger);
if (Animate_Trigger == 32767) then
SpawnMob(17330911); -- 142
SpawnMob(17330912); -- 143
SpawnMob(17330183); -- 177
SpawnMob(17330184); -- 178
activateAnimatedWeapon(); -- Change subanim of all animated weapon
end
end
if (Animate_Trigger == 32767) then
killer:messageSpecial(PRISON_OF_SOULS_HAS_SET_FREE);
end
end; | gpl-3.0 |
moonlight/blues-brothers-rpg | data/scripts/Character.lua | 2 | 3939 | --
-- A character is a pawn with a specific animation scheme
-- By Bjorn Lindeijer
import("Pawn.lua")
import("Shadow.lua")
Character = Pawn:subclass
{
name = "Character";
init = function(self, char)
self.inventory = {}
self:updateBitmap()
Pawn.init(self)
end;
beginPlay = function(self)
Actor.beginPlay(self)
if (self.shadowClass) then
self.shadow = self:spawn(self.shadowClass, self.x, self.y)
end
end;
updateBitmap = function(self)
local ani = self.charAnim
if (ani) then
if (self.bAttacking) then
self.bitmap = ani[self.dir + 1 + 3 * 4]
-- Begin hack for the BBRpg
elseif (self.bWalkieTalkie) then
self.bitmap = self.talkieBitmap
-- End hack for the BBRpg
else
if (self.walking == 0 or self.walking < 50) then
self:setBitmap(ani[self.dir + 1])
else
self:setBitmap(ani[self.dir + 1 + (self.leg_used + 1) * 4])
end
end
end
end;
event_walk_start = function(self)
self.leg_used = 1 - self.leg_used
end;
event_walk_finished = function(self)
Pawn.event_walk_finished(self)
self:updateBitmap()
-- Check for snow tiles
local tile = m_get_tile_at(self.map, self.x - 0.5, self.y - 0.5)
for k,v in pairs(self.snowTiles) do
if (v == tile) then
local snowFeet = self:spawn(SnowFeet)
snowFeet:setDirection(self.dir)
break
end
end
end;
event_dir_change = function(self)
self:updateBitmap()
end;
tick = function(self)
Pawn.tick(self)
if (self.bSleeping and self.health < self.maxHealth) then
self.health = math.min(self.health + 0.0001 * self.maxHealth, self.maxHealth)
end
self:updateBitmap()
end;
died = function(self, killer, damageType, location)
Pawn.died(self, killer, damageType, location)
self.charAnim = nil
self:setBitmap(self.deathBitmap)
-- There is no shadow after death
if (self.shadow) then
self.shadow:destroy()
self.shadow = nil
end
end;
destroyed = function(self)
-- Set bDead to prevent AI's from chasing destroyed characters
self.bDead = true
Pawn.destroyed(self)
if (self.shadow) then
self.shadow:destroy()
self.shadow = nil
end
end;
setMap = function(self, map)
Pawn.setMap(self, map)
if (self.shadow) then
self.shadow:setMap(map)
end
end;
addToInventory = function(self, obj)
-- To be implemented?: Check if there is place in the inventory.
table.insert(self.inventory, obj)
-- Make the object irrelevant on the map (not perfect)
obj.bitmap = nil
obj.obstacle = 0
obj.bCanActivate = false
obj.bCarried = true
end;
-- The loop should probably stop when he finds such an object.
removeFromInventory = function(self, obj)
for i,v in ipairs(self.inventory) do
if (v == obj) then
table.remove(self.inventory, i)
end
end
end;
hasObject = function(self, obj)
for k,v in pairs(self.inventory) do
if (v == obj) then return true end
end
end;
hasObjectType = function(self, class)
for k,v in pairs(self.inventory) do
if (v:instanceOf(class)) then return true end
end
end;
defaultproperties = {
snowTiles = {
--"tiles_subcity.000",
"tiles_subcity.001",
--"tiles_subcity.002",
"tiles_subcity.012",
--"tiles_subcity.013",
--"tiles_subcity.014",
"tiles_subcity.016",
"tiles_subcity.017",
"tiles_subcity.018",
"tiles_subcity.021",
--"tiles_subcity.028",
"tiles_subcity.029",
"tiles_subcity.030",
--"tiles_subcity.032",
"tiles_subcity.033",
--"tiles_subcity.034",
"tiles_subcity.037",
--"tiles_subcity.045",
--"tiles_subcity.046",
"tiles_subcity.063",
"tiles_subcity.079",
"tiles_subcity.092",
"tiles_subcity.125",
"tiles_subcity.144",
"tiles_subcity.145",
"tiles_subcity.147",
"tiles_subcity.161",
},
inventory = nil,
leg_used = 0,
tick_time = 1,
walking = 0,
charAnim = nil,
shadow = nil,
shadowClass = Shadow,
deathBitmap = nil,
bAttacking = false,
bWalkieTalkie = false,
};
}
| gpl-2.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[race]/race_random/duel_s.lua | 1 | 2217 | local function getAlivePlayers()
local players = {}
for _, player in ipairs(getElementsByType('player')) do
if getElementData(player, 'state') == 'alive' then
table.insert(players, player)
end
end
table.sort(players,sortFunction)
return players
end
-- <spawnpoint id="spawnpoint (NRG-500) (1)" vehicle="522" team="none" posX="-932.79999" posY="-328" posZ="2.2" rotX="0" rotY="0" rotZ="270"></spawnpoint>
-- <spawnpoint id="spawnpoint (NRG-500) (2)" vehicle="522" team="none" posX="-315" posY="-328" posZ="2.2" rotX="0" rotY="0" rotZ="90"></spawnpoint>
local spawnInfo = {
{vehicle="522", team="none", posX=-932.79999, posY=-328, posZ=2.2, rotX=0, rotY=0, rotZ=270},
{vehicle="522", team="none", posX=-315, posY=-328, posZ=2.2, rotX=0, rotY=0, rotZ=90}
}
function createDuelSpawns()
for i=1,2 do
local spawnpoint = createElement( "duelspawn", "duelspawn"..i )
setElementParent( spawnpoint, resourceRoot )
for name,val in pairs(spawnInfo[i]) do
setElementData( spawnpoint, name, val )
end
setElementPosition( spawnpoint, spawnInfo[i].posX, spawnInfo[i].posY, spawnInfo[i].posZ )
setElementRotation( spawnpoint, spawnInfo[i].rotX, spawnInfo[i].rotY, spawnInfo[i].rotZ )
end
end
addEventHandler("onResourceStart",resourceRoot,createDuelSpawns)
function duel(p, c, a)
local players = getAlivePlayers()
if #players ~= 2 or exports.race:getRaceMode() ~= "Destruction derby" then return end
-- local map = getResourceMapRootElement(resource, "duel.map")
local spawns = getElementsByType('duelspawn', resourceRoot)
for k, p in ipairs(players) do
local veh = getPedOccupiedVehicle(p)
local s = spawns[k]
setElementPosition(veh, getElementPosition(s))
setElementRotation(veh, 0, 0, getElementData(s, 'rotZ'))
setElementFrozen(veh, true)
setTimer(setElementFrozen, 100, 1, veh, false)
setElementDimension(map, 0)
end
triggerClientEvent('its_time_to_duel.mp3', resourceRoot)
end
addCommandHandler('duel', duel, true)
function stopDuel()
local map = getResourceMapRootElement(resource, "duel.map")
setElementDimension(getResourceMapRootElement(resource, "duel.map"), 9001)
end
addEvent('stopDuel')
addEventHandler('onPostFinish', root, stopDuel)
| mit |
ffxiphoenix/darkstar | scripts/zones/Southern_San_dOria/npcs/Ailevia.lua | 30 | 1902 | -----------------------------------
-- Area: Southern San d'Oria
-- NPC: Ailevia
-- Adventurer's Assistant
-- Only recieving Adv.Coupon and simple talk event are scripted
-- This NPC participates in Quests and Missions
-- @zone 230
-- @pos -8 1 1
-------------------------------------
package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Southern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
--Adventurer coupon
if (trade:getItemCount() == 1 and trade:hasItemQty(0x218,1) == true) then
player:startEvent(0x028f);
end
-- "Flyers for Regine" conditional script
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0267); -- i know a thing or 2 about these streets
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x028f) then
player:addGil(GIL_RATE*50);
player:tradeComplete();
player:messageSpecial(GIL_OBTAINED,GIL_RATE*50);
end
end;
| gpl-3.0 |
vilarion/Illarion-Content | item/id_3110_scroll.lua | 3 | 2396 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local transformation_dog = require("alchemy.teaching.transformation_dog")
local id_266_bookshelf = require("item.id_266_bookshelf")
local lookat = require("base.lookat")
local M = {}
-- UPDATE items SET itm_script = 'item.id_3110_scroll' WHERE itm_id = 3110;
function M.LookAtItem(User,Item)
local book = Item:getData("book")
if book ~= "" then
if id_266_bookshelf.bookList[book] ~= nil then
lookat.SetSpecialName(Item,id_266_bookshelf.bookList[book].german,id_266_bookshelf.bookList[book].english)
end
end
return lookat.GenerateLookAt(User, Item, 0)
end
function M.UseItem(User, SourceItem)
if SourceItem:getData("teachDogTransformationPotion") == "true" then
transformation_dog.UseSealedScroll(User, SourceItem)
return
end
local book = SourceItem:getData("book")
if book ~= "" then
if id_266_bookshelf.bookList[book] ~= nil then
User:sendBook(id_266_bookshelf.bookList[book].bookId)
end
end
-- teleport character on use
local destCoordX = tonumber(SourceItem:getData("destinationCoordsX"))
local destCoordY = tonumber(SourceItem:getData("destinationCoordsY"))
local destCoordZ = tonumber(SourceItem:getData("destinationCoordsZ"))
if destCoordX and destCoordY and destCoordZ then
User:talk(Character.say,
"#me öffnet eine Schriftrolle und verschwindet in einem hellen Leuchten.",
"#me opens a scroll and disappears in a bright light.")
world:gfx(31, User.pos)
world:gfx(41, User.pos)
User:warp(position(destCoordX, destCoordY, destCoordZ))
world:gfx(41, User.pos)
world:erase(SourceItem,1)
return
end
end
return M
| agpl-3.0 |
amiranony/anonybot | plugins/stats.lua | 458 | 4098 | -- Saves the number of messages from a user
-- Can check the number of messages with !stats
do
local NUM_MSG_MAX = 5
local TIME_CHECK = 4 -- seconds
local function user_print_name(user)
if user.print_name then
return user.print_name
end
local text = ''
if user.first_name then
text = user.last_name..' '
end
if user.lastname then
text = text..user.last_name
end
return text
end
-- Returns a table with `name` and `msgs`
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print_name(user)..' ('..user_id..')'
return user_info
end
local function chat_stats(chat_id)
-- Users on chat
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
-- Get user info
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
-- Sort users by msgs number
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = ''
for k,user in pairs(users_info) do
text = text..user.name..' => '..user.msgs..'\n'
end
return text
end
-- Save stats, ban user
local function pre_process(msg)
-- Ignore service msg
if msg.service then
print('Service message')
return msg
end
-- Save user on Redis
if msg.from.type == 'user' then
local hash = 'user:'..msg.from.id
print('Saving user', hash)
if msg.from.print_name then
redis:hset(hash, 'print_name', msg.from.print_name)
end
if msg.from.first_name then
redis:hset(hash, 'first_name', msg.from.first_name)
end
if msg.from.last_name then
redis:hset(hash, 'last_name', msg.from.last_name)
end
end
-- Save stats on Redis
if msg.to.type == 'chat' then
-- User is on chat
local hash = 'chat:'..msg.to.id..':users'
redis:sadd(hash, msg.from.id)
end
-- Total user msgs
local hash = 'msgs:'..msg.from.id..':'..msg.to.id
redis:incr(hash)
-- Check flood
if msg.from.type == 'user' then
local hash = 'user:'..msg.from.id..':msgs'
local msgs = tonumber(redis:get(hash) or 0)
if msgs > NUM_MSG_MAX then
print('User '..msg.from.id..'is flooding '..msgs)
msg = nil
end
redis:setex(hash, TIME_CHECK, msgs+1)
end
return msg
end
local function bot_stats()
local redis_scan = [[
local cursor = '0'
local count = 0
repeat
local r = redis.call("SCAN", cursor, "MATCH", KEYS[1])
cursor = r[1]
count = count + #r[2]
until cursor == '0'
return count]]
-- Users
local hash = 'msgs:*:'..our_id
local r = redis:eval(redis_scan, 1, hash)
local text = 'Users: '..r
hash = 'chat:*:users'
r = redis:eval(redis_scan, 1, hash)
text = text..'\nChats: '..r
return text
end
local function run(msg, matches)
if matches[1]:lower() == "stats" then
if not matches[2] then
if msg.to.type == 'chat' then
local chat_id = msg.to.id
return chat_stats(chat_id)
else
return 'Stats works only on chats'
end
end
if matches[2] == "bot" then
if not is_sudo(msg) then
return "Bot stats requires privileged user"
else
return bot_stats()
end
end
if matches[2] == "chat" then
if not is_sudo(msg) then
return "This command requires privileged user"
else
return chat_stats(matches[3])
end
end
end
end
return {
description = "Plugin to update user stats.",
usage = {
"!stats: Returns a list of Username [telegram_id]: msg_num",
"!stats chat <chat_id>: Show stats for chat_id",
"!stats bot: Shows bot stats (sudo users)"
},
patterns = {
"^!([Ss]tats)$",
"^!([Ss]tats) (chat) (%d+)",
"^!([Ss]tats) (bot)"
},
run = run,
pre_process = pre_process
}
end | gpl-2.0 |
noooway/love2d_arkanoid_tutorial | 3-15_MoreSounds/lives_display.lua | 4 | 1368 | local vector = require "vector"
local lives_display = {}
lives_display.lives = 5
lives_display.lives_added_from_score = 0
local position = vector( 620, 500 )
local width = 170
local height = 65
local bungee_font = love.graphics.newFont(
"/fonts/Bungee_Inline/BungeeInline-Regular.ttf", 30 )
function lives_display.update( dt )
end
function lives_display.draw()
local oldfont = love.graphics.getFont()
love.graphics.setFont( bungee_font )
local r, g, b, a = love.graphics.getColor( )
love.graphics.setColor( 255, 255, 255, 230 )
love.graphics.printf( "Lives: " .. tostring( lives_display.lives ),
position.x,
position.y,
width,
"center" )
love.graphics.setFont( oldfont )
love.graphics.setColor( r, g, b, a )
end
function lives_display.lose_life()
lives_display.lives = lives_display.lives - 1
end
function lives_display.add_life()
lives_display.lives = lives_display.lives + 1
end
function lives_display.add_life_if_score_reached( score )
local score_milestone = (lives_display.lives_added_from_score + 1) * 3000
if score >= score_milestone then
lives_display.add_life()
lives_display.lives_added_from_score =
lives_display.lives_added_from_score + 1
end
end
function lives_display.reset()
lives_display.lives = 5
lives_display.lives_added_from_score = 0
end
return lives_display
| mit |
ffxiphoenix/darkstar | scripts/zones/Windurst_Waters/npcs/Ahyeekih.lua | 30 | 1695 | -----------------------------------
-- Area: Windurst Waters
-- NPC: Ahyeekih
-- Only sells when Windurst controls Kolshushu
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/events/harvest_festivals")
require("scripts/globals/shop");
require("scripts/globals/conquest");
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
onHalloweenTrade(player,trade,npc);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
RegionOwner = GetRegionOwner(KOLSHUSHU);
if (RegionOwner ~= WINDURST) then
player:showText(npc,AHYEEKIH_CLOSED_DIALOG);
else
player:showText(npc,AHYEEKIH_OPEN_DIALOG);
stock = {
0x1197, 184, --Buburimu Grape
0x0460, 1620, --Casablanca
0x1107, 220, --Dhalmel Meat
0x0266, 72, --Mhaura Garlic
0x115D, 40 --Yagudo Cherry
}
showShop(player,WINDURST,stock);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
vilarion/Illarion-Content | scheduled/market.lua | 2 | 3412 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local common = require("base.common")
local M = {}
local function placeMarketStands()
local tablePositions = {position(678, 319, 0), position(679, 319, 0), position(680, 319, 0), position(678, 325, 0), position(679, 325, 0), position(680, 325, 0), position(682, 321, 0), position(682, 322, 0), position(682, 323, 0), position(676, 321, 0), position(676, 322, 0), position(676, 323, 0)}
for i, _ in pairs(tablePositions) do
local theTable = world:createItemFromId(320, 1, tablePositions[i], false, 333, nil)
theTable.wear = 21
world:changeItem(theTable)
end
local depotPositions={position(679, 319, 0), position(679, 325, 0), position(682, 322, 0), position(676, 322, 0)}
for i, _ in pairs(depotPositions) do
local theDepot = world:createItemFromId(321, 1, depotPositions[i], false, 333, {depot=tostring(100+i)})
theDepot.wear = 21
world:changeItem(theDepot)
end
end
local announced = false
local started = false
local over = true
function M.market()
--Read date and time
local month = world:getTime("month")
local day = world:getTime("day")
local hour = world:getTime("hour")
local monthString = common.Month_To_String(world:getTime("month"))
--Market takes place the first three days of each month except for Mas
if (month == 16) or (day > 3) then
return
end
--Announce the market day one ingame hour before it takes place
if (hour == 11) and not announced then
world:broadcast("In etwa zwanzig Minuten wird auf dem Gelände des Gasthofs zur Hanfschlinge der Markt des Monats "..monthString.." veranstaltet. Macht eure Waren bereit!","In around twenty minutes, the market of the month "..monthString.." will be held on the premises of the Hemp Necktie Inn. Get your goods ready!");
announced=true;
started=false;
over=false;
return;
--Invites the players
elseif (hour == 12) and not started then
world:broadcast("Der Markt des Monats "..monthString.." hat soeben auf dem Gelände des Gasthofs zur Hanfschlinge begonnen!","The market of the month "..monthString.." has started on the premises of the Hemp Necktie Inn!");
announced=false;
started=true;
over=false;
placeMarketStands();
return;
--Event is over. The market stands and depots will rot away
elseif (hour == 15) and not over then
world:broadcast("Der Markt des Monats "..monthString.." ist beendet. Die Marktstände werden in Kürze abgebaut.","The market of the month "..monthString.." is over. The market stands will be dismantled soon.");
announced=false;
started=false;
over=true;
return;
end
end
return M
| agpl-3.0 |
kirmir/WowAddons | Cooldowns/Cooldowns.lua | 1 | 5643 | local Timer = {};
local UIParent = _G['UIParent']
local GetTime = _G['GetTime']
local round = function(x) return math.floor(x + 0.5) end
local ICON_SIZE = 36
local DAY, HOUR, MINUTE = 86400, 3600, 60
local DAYISH, HOURISH, MINUTEISH = 3600 * 23.5, 60 * 59.5, 59.5
local HALFDAYISH, HALFHOURISH, HALFMINUTEISH = DAY / 2 + 0.5, HOUR / 2 + 0.5, MINUTE / 2 + 0.5
local FONT_FACE = STANDARD_TEXT_FONT
local FONT_SIZE = 18
local MIN_SCALE = 0.6
local MIN_DURATION = 3
local EXPIRING_DURATION = 5
local EXPIRING_FORMAT = '|cffff0000%d|r'
local SECONDS_FORMAT = '|cffffff00%d|r'
local MINUTES_FORMAT = '|cffffffff%dm|r'
local HOURS_FORMAT = '|cff66ffff%dh|r'
local DAYS_FORMAT = '|cff6666ff%dh|r'
local function getTimeText(s)
if s < MINUTEISH then
local seconds = round(s)
local formatString = seconds > EXPIRING_DURATION and SECONDS_FORMAT or EXPIRING_FORMAT
return formatString, seconds, s - (seconds - 0.51)
elseif s < HOURISH then
local minutes = round(s / MINUTE)
return MINUTES_FORMAT, minutes, minutes > 1 and (s - (minutes * MINUTE - HALFMINUTEISH)) or (s - MINUTEISH)
elseif s < DAYISH then
local hours = round(s / HOUR)
return HOURS_FORMAT, hours, hours > 1 and (s - (hours * HOUR - HALFHOURISH)) or (s - HOURISH)
else
local days = round(s / DAY)
return DAYS_FORMAT, days, days > 1 and (s - (days * DAY - HALFDAYISH)) or (s - DAYISH)
end
end
function Timer.SetNextUpdate(self, nextUpdate)
self.updater:GetAnimations():SetDuration(nextUpdate)
if self.updater:IsPlaying() then
self.updater:Stop()
end
self.updater:Play()
end
function Timer.Stop(self)
self.enabled = nil
if self.updater:IsPlaying() then
self.updater:Stop()
end
self:Hide()
end
function Timer.UpdateText(self)
local remain = self.duration - (GetTime() - self.start)
if round(remain) > 0 then
if (self.fontScale * self:GetEffectiveScale() / UIParent:GetScale()) < MIN_SCALE then
self.text:SetText('')
Timer.SetNextUpdate(self, 1)
else
local formatStr, time, nextUpdate = getTimeText(remain)
self.text:SetFormattedText(formatStr, time)
Timer.SetNextUpdate(self, nextUpdate)
end
else
Timer.Stop(self)
end
end
function Timer.ForceUpdate(self)
Timer.UpdateText(self)
self:Show()
end
function Timer.OnSizeChanged(self, width, height)
local fontScale = round(width) / ICON_SIZE
if fontScale == self.fontScale then
return
end
self.fontScale = fontScale
if fontScale < MIN_SCALE then
self:Hide()
else
self.text:SetFont(FONT_FACE, fontScale * FONT_SIZE, 'OUTLINE')
self.text:SetShadowColor(0, 0, 0, 0.8)
self.text:SetShadowOffset(1, -1)
if self.enabled then
Timer.ForceUpdate(self)
end
end
end
function Timer.Create(cd)
local scaler = CreateFrame('Frame', nil, cd)
scaler:SetAllPoints(cd)
local timer = CreateFrame('Frame', nil, scaler); timer:Hide()
timer:SetAllPoints(scaler)
local updater = timer:CreateAnimationGroup()
updater:SetLooping('NONE')
updater:SetScript('OnFinished', function(self) Timer.UpdateText(timer) end)
local a = updater:CreateAnimation('Animation'); a:SetOrder(1)
timer.updater = updater
local text = timer:CreateFontString(nil, 'OVERLAY')
text:SetPoint('CENTER', 0, 0)
text:SetFont(FONT_FACE, FONT_SIZE, 'OUTLINE')
timer.text = text
Timer.OnSizeChanged(timer, scaler:GetSize())
scaler:SetScript('OnSizeChanged', function(self, ...) Timer.OnSizeChanged(timer, ...) end)
cd.timer = timer
return timer
end
function Timer.Start(cd, start, duration, charges, maxCharges)
local remainingCharges = charges or 0
if start > 0 and duration > MIN_DURATION and remainingCharges == 0 and (not cd.noCooldownCount) then
local timer = cd.timer or Timer.Create(cd)
timer.start = start
timer.duration = duration
timer.enabled = true
Timer.UpdateText(timer)
if timer.fontScale >= MIN_SCALE then timer:Show() end
else
local timer = cd.timer
if timer then
Timer.Stop(timer)
end
end
end
hooksecurefunc(getmetatable(_G['ActionButton1Cooldown']).__index, 'SetCooldown', Timer.Start)
local ActionBarButtonEventsFrame = _G['ActionBarButtonEventsFrame']
if not ActionBarButtonEventsFrame then return end
local active = {}
local function cooldown_OnShow(self)
active[self] = true
end
local function cooldown_OnHide(self)
active[self] = nil
end
local function cooldown_ShouldUpdateTimer(self, start, duration, charges, maxCharges)
local timer = self.timer
if not timer then
return true
end
return not(timer.start == start or timer.charges == charges or timer.maxCharges == maxCharges)
end
local function cooldown_Update(self)
local button = self:GetParent()
local action = button.action
local start, duration, enable = GetActionCooldown(action)
local charges, maxCharges, chargeStart, chargeDuration = GetActionCharges(action)
if cooldown_ShouldUpdateTimer(self, start, duration, charges, maxCharges) then
Timer.Start(self, start, duration, charges, maxCharges)
end
end
local abEventWatcher = CreateFrame('Frame'); abEventWatcher:Hide()
abEventWatcher:SetScript('OnEvent', function(self, event)
for cooldown in pairs(active) do
cooldown_Update(cooldown)
end
end)
abEventWatcher:RegisterEvent('ACTIONBAR_UPDATE_COOLDOWN')
local hooked = {}
local function actionButton_Register(frame)
local cooldown = frame.cooldown
if not hooked[cooldown] then
cooldown:HookScript('OnShow', cooldown_OnShow)
cooldown:HookScript('OnHide', cooldown_OnHide)
hooked[cooldown] = true
end
end
if ActionBarButtonEventsFrame.frames then
for i, frame in pairs(ActionBarButtonEventsFrame.frames) do
actionButton_Register(frame)
end
end
hooksecurefunc('ActionBarButtonEventsFrame_RegisterFrame', actionButton_Register) | gpl-3.0 |
Quenty/NevermoreEngine | src/selectionutils/src/Shared/RxSelectionUtils.lua | 1 | 4133 | --[=[
@class RxSelectionUtils
]=]
local Selection = game:GetService("Selection")
local require = require(script.Parent.loader).load(script)
local Observable = require("Observable")
local Maid = require("Maid")
local Brio = require("Brio")
local ValueObject = require("ValueObject")
local RxBrioUtils = require("RxBrioUtils")
local Set = require("Set")
local RxSelectionUtils = {}
--[=[
Observes first selection in the selection list which is of a class
```lua
RxSelectionUtils.observeFirstSelectionWhichIsA("BasePart"):Subscribe(function(part)
print("part", part)
end)
```
@param className string
@return Observable<Instance?>
]=]
function RxSelectionUtils.observeFirstSelectionWhichIsA(className)
assert(type(className) == "string", "Bad className")
return RxSelectionUtils.observeFirstSelection(function(inst)
return inst:IsA(className)
end)
end
--[=[
Observes first selection in the selection list which is an "Adornee"
@return Observable<Instance?>
]=]
function RxSelectionUtils.observeFirstAdornee()
return RxSelectionUtils.observeFirstSelection(function(inst)
return inst:IsA("BasePart") or inst:IsA("Model")
end)
end
--[=[
Observes selection in which are an "Adornee"
@return Observable<Brio<Instance>>
]=]
function RxSelectionUtils.observeAdorneesBrio()
return RxSelectionUtils.observeSelectionItemsBrio():Pipe({
RxBrioUtils.where(function(inst)
return inst:IsA("BasePart") or inst:IsA("Model")
end)
})
end
--[=[
Observes first selection which meets condition
```lua
RxSelectionUtils.observeFirstSelection(function(instance)
return instance:IsA("BasePart")
end):Subscribe(function(part)
print("part", part)
end)
```
@param where callback
@return Observable<Instance?>
]=]
function RxSelectionUtils.observeFirstSelection(where)
assert(type(where) == "function", "Bad where")
return Observable.new(function(sub)
local maid = Maid.new()
local current = ValueObject.new(nil)
maid:GiveTask(current)
local function handleSelectionChanged()
for _, item in pairs(Selection:Get()) do
if where(item) then
current.Value = item
return
end
end
current.Value = nil
end
maid:GiveTask(Selection.SelectionChanged:Connect(handleSelectionChanged))
handleSelectionChanged()
maid:GiveTask(current:Observe():Subscribe(function(value)
task.spawn(function()
sub:Fire(value)
end)
end))
return maid
end)
end
--[=[
Observes first selection which meets condition
@param where callback
@return Observable<Brio<Instance>>
]=]
function RxSelectionUtils.observeFirstSelectionBrio(where)
assert(type(where) == "function", "Bad where")
return RxSelectionUtils.observeFirstSelection(where):Pipe({
RxBrioUtils.toBrio();
RxBrioUtils.onlyLastBrioSurvives();
RxBrioUtils.where(function(value)
return value ~= nil
end)
})
end
--[=[
Observes the current selection table.
@return Observable<{ Instance }>
]=]
function RxSelectionUtils.observeSelectionList()
return Observable.new(function(sub)
local maid = Maid.new()
local current = Selection:Get()
maid:GiveTask(Selection.SelectionChanged:Connect(function()
sub:Fire(Selection:Get())
end))
sub:Fire(current)
return maid
end)
end
--[=[
Observes selection items by brio. De-duplicates changed events.
@return Observable<Brio<Instance>>
]=]
function RxSelectionUtils.observeSelectionItemsBrio()
return Observable.new(function(sub)
local maid = Maid.new()
local lastSet = {}
local function handleSelectionChanged()
local currentSet = Set.fromList(Selection:Get())
local toRemoveSet = Set.difference(lastSet, currentSet)
local toAddSet = Set.difference(currentSet, lastSet)
lastSet = currentSet
-- Remove first
for toRemove, _ in pairs(toRemoveSet) do
maid[toRemove] = nil
end
-- Then add
for toAdd, _ in pairs(toAddSet) do
local brio = Brio.new(toAdd)
maid[toAdd] = brio
task.spawn(function()
sub:Fire(brio)
end)
end
end
maid:GiveTask(Selection.SelectionChanged:Connect(handleSelectionChanged))
handleSelectionChanged()
return maid
end)
end
return RxSelectionUtils | mit |
guker/nn | SparseLinear.lua | 2 | 1758 | local SparseLinear, parent = torch.class('nn.SparseLinear', 'nn.Module')
function SparseLinear:__init(inputSize, outputSize)
parent.__init(self)
self.weightDecay = 0
self.weight = torch.Tensor(outputSize, inputSize)
self.bias = torch.Tensor(outputSize)
self.gradWeight = torch.Tensor(outputSize, inputSize)
self.gradBias = torch.Tensor(outputSize)
self.lastInput = torch.Tensor()
-- state
self.gradInput:resize(inputSize)
self.output:resize(outputSize)
self:reset()
end
function SparseLinear:reset(stdv)
if stdv then
stdv = stdv * math.sqrt(3)
else
stdv = 1./math.sqrt(self.weight:size(1))
end
if nn.oldSeed then
for i=1,self.weight:size(1) do
self.weight:select(1, i):apply(function()
return torch.uniform(-stdv, stdv)
end)
self.bias[i] = torch.uniform(-stdv, stdv) * 0.000001
end
else
self.weight:uniform(-stdv, stdv)
self.bias:uniform(-stdv, stdv):mul(0.000001)
end
end
function SparseLinear:updateOutput(input)
return input.nn.SparseLinear_updateOutput(self, input)
end
function SparseLinear:accGradParameters(input, gradOutput, scale)
return input.nn.SparseLinear_accGradParameters(self, input, gradOutput, scale)
end
function SparseLinear:updateGradInput(input, gradOutput)
if self.gradInput then
self.gradInput:resize(input:size())
self.gradInput:copy(input)
local numNonzero = self.gradInput:size(1)
for e=1,numNonzero do
local g = 0
local i = self.gradInput[{e,1}]
for j=1,self.output:size(1) do
g = g + self.weight[{j,i}] * gradOutput[j]
end
self.gradInput[{e,2}] = g
end
return self.gradInput
end
end | bsd-3-clause |
vilarion/Illarion-Content | quest/lilith_needlehand_73_runewick.lua | 3 | 4503 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- INSERT INTO "quests" ("qst_id", "qst_script") VALUES (73, 'quest.lilith_needlehand_73_runewick');
local common = require("base.common")
local factions = require("base.factions")
local M = {}
local GERMAN = Player.german
local ENGLISH = Player.english
-- Insert the quest title here, in both languages
local Title = {}
Title[GERMAN] = "Das faule Schneiderlein"
Title[ENGLISH] = "The Lazy Tailoress"
-- Insert an extensive description of each status here, in both languages
-- Make sure that the player knows exactly where to go and what to do
local Description = {}
Description[GERMAN] = {}
Description[ENGLISH] = {}
Description[GERMAN][1] = "Sammel zwanzig Wollballen und bringe sie zurück zu Lilith. Wenn du Schafe mit einer Schere scherst, bekommst du Wolle."
Description[ENGLISH][1] = "Collect twenty bundles of wool and bring them back to Lilith. You can shear a sheep with scissors to get wool."
Description[GERMAN][2] = "Kehre zurück zu Lilith Needlehand und frage, ob sie noch eine Aufgabe für dich hat."
Description[ENGLISH][2] = "Go back to Lilith Needlehand, she is sure to have another task for you."
Description[GERMAN][3] = "Besorge fünfzehn Spulen Garn und bringe sie zurück zu Lilith. Garn kannst du mit einer Schere am Spinnrad aus Wolle herstellen."
Description[ENGLISH][3] = "Produce fifteen bobbins of thread and bring them back to Lilith. You can produce thread from wool by using a spinning wheel whilst holding scissors."
Description[GERMAN][4] = "Kehre zurück zu Lilith Needlehand und frage, ob sie noch eine Aufgabe für dich hat."
Description[ENGLISH][4] = "Go back to Lilith Needlehand, she is sure to have another task for you."
Description[GERMAN][5] = "Besorge fünf Bahnen roten Stoff und bringe sie zurück zu Lilith. Du kannst weißen oder grauen Stoff mit einen Farbeimer und einen Färbestab an einen Fass einfärben."
Description[ENGLISH][5] = "Produce five bolts of red cloth and bring them back to Lilith. You can dye white or grey cloth with a dyeing rod and a bucket red dye, when you stand in front of a barrel."
Description[GERMAN][6] = "Du hast alle Aufgaben von Lilith Needlehand erfüllt."
Description[ENGLISH][6] = "You have fulfilled all the tasks for Lilith Needlehand."
-- Insert the position of the quest start here (probably the position of an NPC or item)
local Start = {940, 817, 0}
-- For each status insert a list of positions where the quest will continue, i.e. a new status can be reached there
local QuestTarget = {}
QuestTarget[1] = {position(852, 792, 0), position(940, 817, 0)} -- Sheep
QuestTarget[2] = {position(940, 817, 0)} -- Lilith Needlehand
QuestTarget[3] = {position(940, 817, 0), position(948, 816, 0)} -- spinning wheel
QuestTarget[4] = {position(940, 817, 0)} -- Lilith Needlehand
QuestTarget[5] = {position(940, 817, 0), position(953, 813, 0)} -- barrel
QuestTarget[6] = {position(940, 817, 0)} -- Lilith Needlehand
-- Insert the quest status which is reached at the end of the quest
local FINAL_QUEST_STATUS = 6
function M.QuestTitle(user)
return common.GetNLS(user, Title[GERMAN], Title[ENGLISH])
end
function M.QuestDescription(user, status)
local german = Description[GERMAN][status] or ""
local english = Description[ENGLISH][status] or ""
return common.GetNLS(user, german, english)
end
function M.QuestStart()
return Start
end
function M.QuestTargets(user, status)
return QuestTarget[status]
end
function M.QuestFinalStatus()
return FINAL_QUEST_STATUS
end
function M.QuestAvailability(user, status)
if factions.isRunewickCitizen(user) and status == 0 then
return Player.questAvailable
else
return Player.questNotAvailable
end
end
return M
| agpl-3.0 |
Quenty/NevermoreEngine | src/gameconfig/src/Server/Mantle/MantleConfigProvider.lua | 1 | 3489 | --[=[
@class MantleConfigProvider
]=]
local require = require(script.Parent.loader).load(script)
local GameConfigAssetTypes = require("GameConfigAssetTypes")
local GameConfigAssetUtils = require("GameConfigAssetUtils")
local GameConfigBindersServer = require("GameConfigBindersServer")
local GameConfigService = require("GameConfigService")
local GameConfigUtils = require("GameConfigUtils")
local String = require("String")
local Maid = require("Maid")
local MantleConfigProvider = {}
MantleConfigProvider.ClassName = "MantleConfigProvider"
MantleConfigProvider.__index = MantleConfigProvider
function MantleConfigProvider.new(container)
local self = setmetatable({}, MantleConfigProvider)
self._container = assert(container, "No container")
return self
end
function MantleConfigProvider:Init(serviceBag)
self._serviceBag = assert(serviceBag, "No serviceBag")
self._gameConfigService = self._serviceBag:GetService(GameConfigService)
self._gameConfigBindersServer = self._serviceBag:GetService(GameConfigBindersServer)
self._maid = Maid.new()
for _, item in pairs(self._container:GetChildren()) do
if item:IsA("ModuleScript") then
self:_loadConfig(item)
end
end
end
function MantleConfigProvider:_loadConfig(item)
local current
task.spawn(function()
current = coroutine.running()
local data = require(item)
if type(data) == "table" then
self:_parseDataToConfig(data, item.Name)
end
end)
assert(coroutine.status(current) == "dead", "Loading the mantle config yielded")
end
function MantleConfigProvider:_parseDataToConfig(mantleConfigData, name)
assert(type(mantleConfigData) == "table", "Bad mantleConfigData")
-- Just blind unpack these, we'll error if we can't find these.
local gameId = mantleConfigData.experience_singleton.experience.assetId
assert(type(gameId) == "number", "Failed to get gameId")
local gameConfig = GameConfigUtils.create(self._gameConfigBindersServer.GameConfig, gameId)
gameConfig.Name = name
local function getIcon(mantleType, assetName)
local entryName = mantleType .. "Icon"
local entryKey = entryName .. "_" .. assetName
local iconEntry = mantleConfigData[entryKey]
local iconData = iconEntry and iconEntry[entryName]
local assetId = iconData and iconData.assetId
return assetId
end
local function addAsset(mantleType, assetType, key, value)
local data = value[mantleType]
if not data then
return
end
local prefix = mantleType .. "_"
local assetName = String.removePrefix(key, prefix)
local iconId = getIcon(mantleType, assetName)
if type(iconId) ~= "number" then
iconId = tonumber(data.initialIconAssetId)
end
local assetId = data.assetId
if type(assetId) ~= "number" then
return
end
local asset = GameConfigAssetUtils.create(self._gameConfigBindersServer.GameConfigAsset, assetType, assetName, assetId)
asset.Parent = GameConfigUtils.getOrCreateAssetFolder(gameConfig, assetType)
end
for key, value in pairs(mantleConfigData) do
if type(value) == "table" then
addAsset("badge", GameConfigAssetTypes.BADGE, key, value)
addAsset("pass", GameConfigAssetTypes.PASS, key, value)
addAsset("product", GameConfigAssetTypes.PRODUCT, key, value)
addAsset("place", GameConfigAssetTypes.PLACE, key, value)
end
end
gameConfig.Parent = self._gameConfigService:GetPreferredParent()
self._maid:GiveTask(gameConfig)
return gameConfig
end
function MantleConfigProvider:Destroy()
self._maid:DoCleaning()
end
return MantleConfigProvider | mit |
ffxiphoenix/darkstar | scripts/zones/Al_Zahbi/npcs/Chayaya.lua | 34 | 1603 | -----------------------------------
-- Area: Al Zahbi
-- NPC: Chayaya
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Al_Zahbi/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/zones/Al_Zahbi/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,CHAYAYA_SHOP_DIALOG);
stock = {0x439B,10, --Dart
0x439C,60, --Hawkeye
0x43A1,1204, --Grenade
0x43A8,8, --Iron Arrow
0x1565,68000, --Warrior Die
0x1566,22400, --Monk Die
0x1567,5000, --White Mage Die
0x1568,108000, --Black Mage Die
0x1569,62000, --Red Mage Die
0x156A,50400, --Thief Die
0x156B,90750, --Paladin Die
0x156C,2205, --Dark Knight Die
0x156D,26600, --Beastmaster Die
0x156E,12780, --Bard Die
0x156F,1300, --Ranger Die
0x1577,63375, --Dancer Die
0x1578,68250} --Scholar Die
showShop(player, STATIC, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Aht_Urhgan_Whitegate/npcs/Zarfhid.lua | 34 | 1034 | -----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Zarfhid
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x00DC);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/globals/items/bowl_of_delicious_puls.lua | 35 | 1320 | -----------------------------------------
-- ID: 4533
-- Item: Bowl of Delicious Puls
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Dexterity -1
-- Vitality 3
-- Health Regen While Healing 5
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,4533);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_DEX, -1);
target:addMod(MOD_VIT, 3);
target:addMod(MOD_HPHEAL, 5);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_DEX, -1);
target:delMod(MOD_VIT, 3);
target:delMod(MOD_HPHEAL, 5);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Port_San_dOria/npcs/Apstaule.lua | 36 | 1764 | -----------------------------------
-- Area: Port San d'Oria
-- NPC: Apstaule
-- Not used cutscenes: 541
-----------------------------------
package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/shop");
require("scripts/globals/quests");
require("scripts/zones/Port_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
AuctionParcel = trade:hasItemQty(0x0252,1);
if (MagicFlyer == true and count == 1) then
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
player:messageSpecial(FLYER_REFUSED);
end
elseif (AuctionParcel == true and count == 1) then
TheBrugaireConsortium = player:getQuestStatus(SANDORIA,THE_BRUGAIRE_CONSORTIUM);
if (TheBrugaireConsortium == 1) then
player:tradeComplete();
player:startEvent(0x021c);
player:setVar("TheBrugaireConsortium-Parcels", 21);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x21e);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Windurst_Woods/npcs/Quesse.lua | 36 | 1672 | -----------------------------------
-- Area: Windurst Woods
-- NPC: Quesse
-- Standard Merchant NPC
-- Confirmed shop stock, August 2013
-----------------------------------
require("scripts/globals/shop");
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
require("scripts/zones/Windurst_Woods/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,QUESSE_SHOP_DIALOG);
stock = {
0x034D, 1150,1, --Black Chocobo Feather
0x439B, 9,2, --Dart
0x11C1, 62,3, --Gysahl Greens
0x0348, 7,3, --Chocobo Feather
0x4278, 11,3, --Pet Food Alpha Biscuit
0x4279, 82,3, --Pet Food Beta Biscuit
0x45C4, 82,3, --Carrot Broth
0x45C6, 695,3, --Bug Broth
0x45C8, 126,3, --Herbal Broth
0x45CA, 695,3, --Carrion Broth
0x13D1, 50784,3 --Scroll of Chocobo Mazurka
}
showNationShop(player, WINDURST, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
moteus/lua-lcurl | examples/lcurl/fnmatch.lua | 2 | 1166 | --
-- Example of how to download multiple files in single perform
--
local curl = require "lcurl"
local function printf(...)
io.stderr:write(string.format(...))
end
local function pat2pat(s)
return "^" .. string.gsub(s, ".", {
["*"] = '[^%.]*';
["."] = '%.';
}) .. "$"
end
local c = curl.easy{
url = "ftp://moteus:123456@127.0.0.1/test.*";
wildcardmatch = true;
}
local data, n = 0, 0
c:setopt_writefunction(function(chunk) data = #chunk + data end)
-- called before each new file
c:setopt_chunk_bgn_function(function(info, remains)
data, n = 0, n + 1
printf('\n======================================================\n')
printf('new file `%s` #%d, remains - %d\n', info.filename, n, remains or -1)
end)
-- called after file download complite
c:setopt_chunk_end_function(function()
printf('total size %d[B]\n', data)
printf('------------------------------------------------------\n')
end)
-- custom pattern matching function
c:setopt_fnmatch_function(function(pattern, name)
local p = pat2pat(pattern)
local r = not not string.match(name, p)
printf("%s %s %s\n", r and '+' or '-', pattern, name)
return r
end)
c:perform()
| mit |
ffxiphoenix/darkstar | scripts/globals/items/bowl_of_ambrosia.lua | 35 | 2277 | -----------------------------------------
-- ID: 4511
-- Item: Bowl of Ambrosia
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Health 7
-- Magic 7
-- Strength 7
-- Dexterity 7
-- Agility 7
-- Vitality 7
-- Intelligence 7
-- Mind 7
-- Charisma 7
-- Health Regen While Healing 7
-- Magic Regen While Healing 7
-- Attack 7
-- defense 7
-- Accuracy 7
-- Evasion 7
-- Store TP 7
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,4511);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 7);
target:addMod(MOD_MP, 7);
target:addMod(MOD_STR, 7);
target:addMod(MOD_DEX, 7);
target:addMod(MOD_AGI, 7);
target:addMod(MOD_VIT, 7);
target:addMod(MOD_INT, 7);
target:addMod(MOD_MND, 7);
target:addMod(MOD_CHR, 7);
target:addMod(MOD_HPHEAL, 7);
target:addMod(MOD_MPHEAL, 7);
target:addMod(MOD_ATT, 7);
target:addMod(MOD_DEF, 7);
target:addMod(MOD_ACC, 7);
target:addMod(MOD_EVA, 7);
target:addMod(MOD_STORETP, 7);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 7);
target:delMod(MOD_MP, 7);
target:delMod(MOD_STR, 7);
target:delMod(MOD_DEX, 7);
target:delMod(MOD_AGI, 7);
target:delMod(MOD_VIT, 7);
target:delMod(MOD_INT, 7);
target:delMod(MOD_MND, 7);
target:delMod(MOD_CHR, 7);
target:delMod(MOD_HPHEAL, 7);
target:delMod(MOD_MPHEAL, 7);
target:delMod(MOD_ATT, 7);
target:delMod(MOD_DEF, 7);
target:delMod(MOD_ACC, 7);
target:delMod(MOD_EVA, 7);
target:delMod(MOD_STORETP, 7);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Windurst_Waters_[S]/npcs/Mhoti_Pyiahrs.lua | 38 | 1045 | -----------------------------------
-- Area: Windurst Waters (S)
-- NPC: Mhoti Pyiahrs
-- Type: Allegiance
-- @zone: 94
-- @pos 6.356 -2 26.677
--
-- Auto-Script: Requires Verification (Verified by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters_[S]/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x0002);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
VoxelDavid/echo-ridge | src/ReplicatedStorage/Level/World.module.lua | 1 | 3778 | --[[
World
=====
A World allows you to easily move Players between the Cells in your game.
Conceptually, a World can be thought of as the game itself, and the Cells it
has access to are all the areas the Player can travel to.
You should limit yourself to a single World instance, they're intended to be
used to group all of the locations in your game, and as such there should be
no case where you would need to work with more than one at a time.
Constructors
------------
World.new(table cells={})
Creates a new World instance
`cells` is a list of any Cell instances you want to immediately pass in. If
you create all your Cells after defining the World instance, you can use
AddCells instead.
Methods
-------
Cell GetCellByName(string cellName)
When you don't have a reference to a Cell, this method allows you to look
one up by its Name.
void AddCell(Cell cell)
Adds `cell` to the list of Cells managed by this class.
void RemoveCellByName(string cellName)
Removes a Cell managed by this class by its name.
Cell GetCurrentCell(Player player)
Returns the Cell a Player is currently inside of.
Returns nil if the Player is not in a Cell.
void LeaveCurrentCell(Player player)
Removes a Player from the Cell they're currently in.
We don't have a method to explicitly leave one Cell, as each Player is only
intended to be in one Cell at a time. This method is run automatically when
calling EnterCell to ensure this.
Because this method is run automatically, you typically won't need to use it
unless you want to clear a Player out of all Cells indefinitely.
Fires CellLeft.
void EnterCell(string cellName, Player player)
Add a Player to the specified Cell.
This method also removes the player from Cell they're currently in. This
ensures the player is only in one Cell at a time.
Fires CellEntered.
Events
------
CellEntered (Cell, Player)
Fired when entering a Cell.
Returns the Cell and the Player that entered the Cell.
CellLeft (Cell, Player)
Fired when a Player leaves a Cell.
Returns the Cell and the Player that left the Cell.
--]]
local replicatedStorage = game:GetService("ReplicatedStorage")
local Array = require(replicatedStorage.Helpers.Array)
local expect = require(replicatedStorage.Helpers.Expect)
local Signal = require(replicatedStorage.Events.Signal)
--------------------------------------------------------------------------------
local World = {}
World.__index = World
function World.new(cells)
local self = {}
setmetatable(self, World)
self._Cells = (cells and Array.new(cells)) or Array.new()
self.CellEntered = Signal.new()
self.CellLeft = Signal.new()
return self
end
function World:GetCellByName(cellName)
return self._Cells:Find(function(cell)
return cell.Name == cellName
end)
end
function World:AddCell(cell)
expect(cell, "Cell", 1, "AddCell")
self._Cells:Add(cell)
end
function World:RemoveCellByName(cellName)
expect(cellName, "string", 1, "RemoveCellByName")
local cell = self:GetCellByName(cellName)
if self._Cells:Has(cell) then
self._Cells:Remove(cell)
end
end
function World:GetCurrentCell(player)
return self._Cells:Find(function(cell)
if cell:IsInCell(player) then
return cell
end
end)
end
function World:LeaveCurrentCell(player)
local cell = self:GetCurrentCell(player)
if cell then
cell:Leave(player)
self.CellLeft:fire(cell, player)
end
end
function World:EnterCell(cellName, player)
expect(cellName, "string", 1, "EnterCell")
local cell = self:GetCellByName(cellName)
self:LeaveCurrentCell(player)
cell:Enter(player)
self.CellEntered:fire(cell, player)
end
return World
| mit |
vilarion/Illarion-Content | quest/daniel_brock_713_runewick.lua | 3 | 9177 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- INSERT INTO "quests" ("qst_id", "qst_script") VALUES (713, 'quest.daniel_brock_713_runewick');
local common = require("base.common")
local factions = require("base.factions")
local M = {}
local GERMAN = Player.german
local ENGLISH = Player.english
-- Insert the quest title here, in both languages
local Title = {}
Title[GERMAN] = "Die Schreinerinnung von Runewick"
Title[ENGLISH] = "The Carpentry Association of Runewick"
-- Insert an extensive description of each status here, in both languages
-- Make sure that the player knows exactly where to go and what to do
local Description = {}
Description[GERMAN] = {}
Description[ENGLISH] = {}
Description[GERMAN][1] = "Sammel zehn Scheite Apfelholz in Eibenthal und bring diese zu Daniel Brock in der Werkstatt von Runewick. Dazu nimmst du das Beil in die Hand und benutzt es, während du vor einem Apfelbaum stehst."
Description[ENGLISH][1] = "Collect ten logs of apple wood in Yewdale and take them to Daniel Brock at the workshop in Runewick. Use the hatchet in your hand, whilst standing in front of an apple tree."
Description[GERMAN][2] = "Geh zu Daniel Brock in der Werkstatt von Runewick. Er hat bestimmt noch eine Aufgabe für dich."
Description[ENGLISH][2] = "Go to Daniel Brock at the workshop in Runewick, he is sure to have another task for you."
Description[GERMAN][3] = "Säge zehn Apfelholzbretter für Daniel Brock am Sägebock in Runewick. Um die Bretter herzustellen, musst du die Säge in die Hand nehmen und den Sägebock benutzen, wenn du vor ihm stehst."
Description[ENGLISH][3] = "Saw ten apple wood boards for Daniel Brock at the sawing trestle in Runewick's workshop. To saw the boards you have to take the saw in your hand and use the sawing trestle."
Description[GERMAN][4] = "Geh zu Daniel Brock in der Werkstatt von Runewick. Er hat bestimmt noch eine Aufgabe für dich."
Description[ENGLISH][4] = "Go to Daniel Brock at the workshop in Runewick, he is sure to have another task for you."
Description[GERMAN][5] = "Schnitze zehn Axtgriffe für Daniel Brock in der Werkstatt von Runewick. Für die Axtgriffe musst du die Schnitzmesser an der Werkbank benutzen."
Description[ENGLISH][5] = "Carve ten axe handles for Daniel Brock at the workshop of Runewick. To carve you need to stand facing the work bench and use the carving tools."
Description[GERMAN][6] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Laiens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 10 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][6] = "Your current rank with the Carpentry Association of Runewick is Layman. Return to Daniel Brock at the workshop of Runewick once you reached Level 10 in Carpentry."
Description[GERMAN][7] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Anfängers. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 20 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][7] = "Your current rank with the Carpentry Association of Runewick is Novice. Return to Daniel Brock at the workshop of Runewick once you reached Level 20 in Carpentry."
Description[GERMAN][8] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Lehrlings. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 30 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][8] = "Your current rank with the Carpentry Association of Runewick is Apprentice. Return to Daniel Brock at the workshop of Runewick once you reached Level 30 in Carpentry."
Description[GERMAN][9] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Initiatens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 40 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][9] = "Your current rank with the Carpentry Association of Runewick is Initiate. Return to Daniel Brock at the workshop of Runewick once you reached Level 40 in Carpentry."
Description[GERMAN][10] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Gesellens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 50 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][10] = "Your current rank with the Carpentry Association of Runewick is Journeyman. Return to Daniel Brock at the workshop of Runewick once you reached Level 50 in Carpentry."
Description[GERMAN][11] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Spezialistens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 60 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][11] = "Your current rank with the Carpentry Association of Runewick is Specialist. Return to Daniel Brock at the workshop of Runewick once you reached Level 60 in Carpentry."
Description[GERMAN][12] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Expertens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 70 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][12] = "Your current rank with the Carpentry Association of Runewick is Expert. Return to Daniel Brock at the workshop of Runewick once you reached Level 70 in Carpentry."
Description[GERMAN][13] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Adeptens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 80 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][13] = "Your current rank with the Carpentry Association of Runewick is Adept. Return to Daniel Brock at the workshop of Runewick once you reached Level 80 in Carpentry."
Description[GERMAN][14] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Artisanens. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 90 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][14] = "Your current rank with the Carpentry Association of Runewick is Artisan. Return to Daniel Brock at the workshop of Runewick once you reached Level 90 in Carpentry."
Description[GERMAN][15] = "Dein derzeitiger Rang in der Schreinerinnung von Runewick ist der eines Meisters. Gehe zu Daniel Brock in der Werkstatt von Runewick sobald du Level 100 in der Schreinerfertigkeit erreicht hast."
Description[ENGLISH][15] = "Your current rank with the Carpentry Association of Runewick is Master. Return to Daniel Brock at the workshop of Runewick once you reached Level 100 in Carpentry."
Description[GERMAN][16] = "Gratulation, du bist nun ein wahrer Großmeister der Schreinerinnung von Runewick."
Description[ENGLISH][16] = "Congratulations, you are now a true Grandmaster of the Carpentry Association of Runewick."
-- Insert the position of the quest start here (probably the position of an NPC or item)
local Start = {959, 825, 0}
-- For each status insert a list of positions where the quest will continue, i.e. a new status can be reached there
local QuestTarget = {}
QuestTarget[1] = {position(959, 825, 0)}
QuestTarget[2] = {position(959, 825, 0)}
QuestTarget[3] = {position(959, 825, 0), position(959, 823, 0)} -- Sawing trestle
QuestTarget[4] = {position(959, 825, 0)}
QuestTarget[5] = {position(959, 825, 0), position(957, 823, 0)} -- Work bench
QuestTarget[6] = {position(959, 825, 0)}
QuestTarget[7] = {position(959, 825, 0)}
QuestTarget[8] = {position(959, 825, 0)}
QuestTarget[9] = {position(959, 825, 0)}
QuestTarget[10] = {position(959, 825, 0)}
QuestTarget[11] = {position(959, 825, 0)}
QuestTarget[12] = {position(959, 825, 0)}
QuestTarget[13] = {position(959, 825, 0)}
QuestTarget[14] = {position(959, 825, 0)}
QuestTarget[15] = {position(959, 825, 0)}
-- Insert the quest status which is reached at the end of the quest
local FINAL_QUEST_STATUS = 16
function M.QuestTitle(user)
return common.GetNLS(user, Title[GERMAN], Title[ENGLISH])
end
function M.QuestDescription(user, status)
local german = Description[GERMAN][status] or ""
local english = Description[ENGLISH][status] or ""
return common.GetNLS(user, german, english)
end
function M.QuestStart()
return Start
end
function M.QuestTargets(user, status)
return QuestTarget[status]
end
function M.QuestFinalStatus()
return FINAL_QUEST_STATUS
end
function M.QuestAvailability(user, status)
if factions.isRunewickCitizen(user) and status == 0 then
return Player.questAvailable
else
return Player.questNotAvailable
end
end
return M
| agpl-3.0 |
ProjectSkyfire/SkyFire-Community-Tools | FireAdmin/Libraries/Tablet-2.0/Tablet-2.0.lua | 3 | 82998 | --[[
Name: Tablet-2.0
Revision: $Rev: 64130 $
Author(s): ckknight (ckknight@gmail.com)
Website: http://ckknight.wowinterface.com/
Documentation: http://www.wowace.com/index.php/Tablet-2.0
SVN: http://svn.wowace.com/wowace/trunk/TabletLib/Tablet-2.0
Description: A library to provide an efficient, featureful tooltip-style display.
Dependencies: AceLibrary, (optional) Dewdrop-2.0
License: LGPL v2.1
]]
local MAJOR_VERSION = "Tablet-2.0"
local MINOR_VERSION = tonumber(("$Revision: 64130 $"):sub(12, -3))
if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end
if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
local DEBUG = false
local SCROLL_UP = "Scroll up"
local SCROLL_DOWN = "Scroll down"
local HINT = "Hint"
local DETACH = "Detach"
local DETACH_DESC = "Detach the tablet from its source."
local SIZE = "Size"
local SIZE_DESC = "Scale the tablet."
local CLOSE_MENU = "Close menu"
local CLOSE_MENU_DESC = "Close the menu."
local COLOR = "Background color"
local COLOR_DESC = "Set the background color."
local LOCK = "Lock"
local LOCK_DESC = "Lock the tablet in its current position. Alt+Right-click for menu or Alt+drag to drag it when locked."
if GetLocale() == "deDE" then
SCROLL_UP = "Hochscrollen"
SCROLL_DOWN = "Runterscrollen"
HINT = "Hinweis"
DETACH = "L\195\182sen"
DETACH_DESC = "L\195\182st den Tooltip aus seiner Verankerung."
SIZE = "Gr\195\182\195\159e"
SIZE_DESC = "Gr\195\182\195\159e des Tooltips \195\164ndern."
CLOSE_MENU = "Menu schlie\195\159en"
CLOSE_MENU_DESC = "Schlie\195\159t das Menu."
COLOR = "Hintergrundfarbe"
COLOR_DESC = "Hintergrundfarbe setzen."
LOCK = "Sperren"
LOCK_DESC = "Sperrt die aktuelle Position vom Tooltip. Alt+Rechts-klick f\195\188rs Men\195\188 oder Alt+Verschieben f\195\188rs verschieben wenn es gesperrt ist."
elseif GetLocale() == "koKR" then
SCROLL_UP = "위로 스크롤"
SCROLL_DOWN = "아래로 스크롤"
HINT = "힌트"
DETACH = "분리"
DETACH_DESC = "테이블을 분리합니다."
SIZE = "크기"
SIZE_DESC = "테이블의 크기입니다."
CLOSE_MENU = "메뉴 닫기"
CLOSE_MENU_DESC = "메뉴를 닫습니다."
COLOR = "배경 색상"
COLOR_DESC = "배경 색상을 설정합니다."
LOCK = "고정"
LOCK_DESC = "현재 위치에 테이블을 고정합니다. 알트+우클릭 : 메뉴열기, 알트+드래그 : 고정된것을 드래그합니다."
elseif GetLocale() == "zhCN" then
SCROLL_UP = "向上翻转"
SCROLL_DOWN = "向上翻转"
HINT = "提示"
DETACH = "分离"
DETACH_DESC = "分离菜单为独立提示."
SIZE = "尺寸"
SIZE_DESC = "缩放菜单显示尺寸."
CLOSE_MENU = "关闭菜单"
CLOSE_MENU_DESC = "关闭菜单"
COLOR = "背景颜色"
COLOR_DESC = "设置菜单背景颜色."
LOCK = "锁定"
LOCK_DESC = "锁定菜单当前位置. alt+右键 将显示选项, alt+拖动 可以移动已锁定的菜单."
elseif GetLocale() == "zhTW" then
SCROLL_UP = "向上翻捲"
SCROLL_DOWN = "向上翻捲"
HINT = "提示"
DETACH = "分離"
DETACH_DESC = "分離選單為獨立提示。"
SIZE = "尺寸"
SIZE_DESC = "縮放選單顯示尺寸。"
CLOSE_MENU = "關閉選單"
CLOSE_MENU_DESC = "關閉選單。"
COLOR = "背景顏色"
COLOR_DESC = "設定選單背景顏色。"
LOCK = "鎖定"
LOCK_DESC = "鎖定選單目前位置設定。Alt-右鍵將顯示選項,Alt-拖動可以移動已鎖定的選單。"
elseif GetLocale() == "frFR" then
SCROLL_UP = "Parcourir vers le haut"
SCROLL_DOWN = "Parcourir vers le bas"
HINT = "Astuce"
DETACH = "D\195\169tacher"
DETACH_DESC = "Permet de d\195\169tacher le tableau de sa source."
SIZE = "Taille"
SIZE_DESC = "Permet de changer l'\195\169chelle du tableau."
CLOSE_MENU = "Fermer le menu"
CLOSE_MENU_DESC = "Ferme ce menu."
COLOR = "Couleur du fond"
COLOR_DESC = "Permet de d\195\169finir la couleur du fond."
LOCK = "Bloquer"
LOCK_DESC = "Bloque le tableau \195\160 sa position actuelle. Alt+clic-droit pour le menu ou Alt+glisser pour le d\195\169placer quand il est bloqu\195\169."
elseif GetLocale() == "esES" then
SCROLL_UP = "Desplazar hacia arriba"
SCROLL_DOWN = "Desplazar hacia abajo"
HINT = "Consejo"
DETACH = "Separar"
DETACH_DESC = "Separa el tooltip de su fuente."
SIZE = "Tama\195\177o"
SIZE_DESC = "Escala el tooltip"
CLOSE_MENU = "Cerrar men\195\186"
CLOSE_MENU_DESC = "Cierra el men\195\186"
COLOR = "Color de fondo"
COLOR_DESC = "Establece el color de fondo"
LOCK = "Bloquear"
LOCK_DESC = "Bloquea el tooltip en su posici\195\179n actual. Clic+Alt para el men\195\186 y arrastra+Alt para arrastrarlo cuando est\195\161 bloqueado"
end
local start = GetTime()
local wrap
local GetProfileInfo
if DEBUG then
local tree = {}
local treeMemories = {}
local treeTimes = {}
local memories = {}
local times = {}
function wrap(value, name)
if type(value) == "function" then
local oldFunction = value
memories[name] = 0
times[name] = 0
return function(self, ...)
local pos = #tree
tree[#tree+1] = name
treeMemories[#treeMemories+1] = 0
treeTimes[#treeTimes+1] = 0
local t, mem = GetTime(), gcinfo()
local r1, r2, r3, r4, r5, r6, r7, r8 = oldFunction(self, ...)
mem, t = gcinfo() - mem, GetTime() - t
if pos > 0 then
treeMemories[pos] = treeMemories[pos] + mem
treeTimes[pos] = treeTimes[pos] + t
end
local otherMem = table.remove(treeMemories)
if mem - otherMem > 0 then
memories[name] = memories[name] + mem - otherMem
end
times[name] = times[name] + t - table.remove(treeTimes)
table.remove(tree)
return r1, r2, r3, r4, r5, r6, r7, r8
end
end
end
function GetProfileInfo()
return GetTime() - start, times, memories
end
else
function wrap(value)
return value
end
end
local function GetMainFrame()
if UIParent:IsShown() then
return UIParent
end
local f = GetUIPanel("fullscreen")
if f and f:IsShown() then
return f
end
return nil
end
GetMainFrame = wrap(GetMainFrame, "GetMainFrame")
local MIN_TOOLTIP_SIZE = 200
local TESTSTRING_EXTRA_WIDTH = 8
local Tablet = {}
local Dewdrop = nil
local CleanCategoryPool
local pool = {}
local function del(t)
setmetatable(t, nil)
for k in pairs(t) do
t[k] = nil
end
t[''] = true
t[''] = nil
pool[t] = true
return nil
end
local function copy(parent)
local t = next(pool)
if not t then
t = {}
else
pool[t] = nil
end
if parent then
for k,v in pairs(parent) do
t[k] = v
end
setmetatable(t, getmetatable(parent))
end
return t
end
local function new(...)
local t = next(pool)
if not t then
t = {}
else
pool[t] = nil
end
for i = 1, select('#', ...), 2 do
local k = select(i, ...)
if k then
t[k] = select(i+1, ...)
else
break
end
end
return t
end
local tmp
tmp = setmetatable({}, {__index = function(self, key)
local t = {}
tmp[key] = function(...)
for k in pairs(t) do
t[k] = nil
end
for i = 1, select('#', ...), 2 do
local k = select(i, ...)
if k then
t[k] = select(i+1, ...)
else
break
end
end
return t
end
return tmp[key]
end})
local headerSize, normalSize
if GameTooltipHeaderText then
headerSize = select(2,GameTooltipHeaderText:GetFont())
else
headerSize = 14
end
if GameTooltipText then
normalSize = select(2,GameTooltipText:GetFont())
else
normalSize = 12
end
local tooltip
local testString
local TabletData = {}
local Category = {}
local Line = {}
local function getTestWidth(font, size, text)
if not testString then
return MIN_TOOLTIP_SIZE + 40
end
testString:SetWidth(0)
testString:SetFontObject(font)
local a,_,b = font:GetFont()
testString:SetFont(a, size, b)
testString:SetText(text)
return testString:GetStringWidth()-- + TESTSTRING_EXTRA_WIDTH
end
getTestWidth = wrap(getTestWidth, "getTestWidth")
do
local TabletData_mt = { __index = TabletData }
function TabletData:new(tablet)
local self = new()
self.categories = new()
self.id = 0
self.width = 0 -- (MIN_TOOLTIP_SIZE - 20)*tablet.fontSizePercent
self.tablet = tablet
self.title = nil
self.titleR, self.titleG, self.titleB = nil, nil, nil
self.num_lines = 0
setmetatable(self, TabletData_mt)
return self
end
TabletData.new = wrap(TabletData.new, "TabletData:new")
function TabletData:checkMinWidth()
local min = self.minWidth or MIN_TOOLTIP_SIZE
local width = (min - 20)*self.tablet.fontSizePercent
if self.width < width then
self.width = width
end
end
TabletData.checkMinWidth = wrap(TabletData.checkMinWidth, "TabletData:checkMinWidth")
function TabletData:del()
for k, v in ipairs(self.categories) do
v:del()
end
del(self.categories)
del(self)
end
TabletData.del = wrap(TabletData.del, "TabletData:del")
function TabletData:Display()
if self.title and (self.tablet == tooltip or self.tablet.registration.showTitleWhenDetached) then
local info = new(
'hideBlankLine', true,
'text', self.title,
'justify', "CENTER",
'font', GameTooltipHeaderText,
'isTitle', true
)
if self.titleR then
info.textR = self.titleR
info.textG = self.titleG
info.textB = self.titleB
end
self:AddCategory(info, 1)
del(info)
end
if self.tablet == tooltip or self.tablet.registration.showHintWhenDetached then
if self.hint then
self:AddCategory(nil):AddLine(
'text', HINT .. ": " .. self.hint,
'textR', 0,
'textG', 1,
'textB', 0,
'wrap', true
)
end
end
local tabletData = self.tabletData
for k, v in ipairs(self.categories) do
local width
if v.columns <= 2 then
width = v.x1
else
width = (v.columns - 1)*20
for i = 1, v.columns do
width = width + v['x' .. i]
end
end
if self.width < width then
self.width = width
end
end
local good = false
local lastTitle = true
for k, v in ipairs(self.categories) do
if lastTitle then
v.hideBlankLine = true
lastTitle = false
end
if v:Display(self.tablet) and (not v.isTitle or not self.tablet.registration.hideWhenEmpty or next(self.categories, k)) then
good = true
end
if v.isTitle then
lastTitle = true
end
end
if not good then
if self.tablet == tooltip or not self.tablet.registration.hideWhenEmpty then
local width
local info = new(
'hideBlankLine', true,
'text', self.title,
'justify', "CENTER",
'font', GameTooltipHeaderText,
'isTitle', true
)
local cat = self:AddCategory(info)
del(info)
self.width = self.categories[#self.categories].x1
cat:Display(self.tablet)
else
self.tablet:__Hide()
self.tablet.tmpHidden = true
end
else
self.tablet:__Show()
self.tablet.tmpHidden = nil
end
end
TabletData.Display = wrap(TabletData.Display, "TabletData:Display")
function TabletData:AddCategory(info, index)
local made = false
if not info then
made = true
info = new()
end
local cat = Category:new(self, info)
if index then
table.insert(self.categories, index, cat)
else
self.categories[#self.categories+1] = cat
end
if made then
del(info)
end
return cat
end
TabletData.AddCategory = wrap(TabletData.AddCategory, "TabletData:AddCategory")
function TabletData:SetHint(hint)
self.hint = hint
end
TabletData.SetHint = wrap(TabletData.SetHint, "TabletData:SetHint")
function TabletData:SetTitle(title)
self.title = title or "Title"
end
TabletData.SetTitle = wrap(TabletData.SetTitle, "TabletData:SetTitle")
function TabletData:SetTitleColor(r, g, b)
self.titleR = r
self.titleG = g
self.titleB = b
end
TabletData.SetTitleColor = wrap(TabletData.SetTitleColor, "TabletData:SetTitleColor")
end
do
local Category_mt = { __index = Category }
function Category:new(tabletData, info, superCategory)
local self = copy(info)
if superCategory and not self.noInherit then
self.superCategory = superCategory.superCategory
for k, v in pairs(superCategory) do
if k:find("^child_") then
local k = strsub(k, 7)
if self[k] == nil then
self[k] = v
end
end
end
self.columns = superCategory.columns
else
self.superCategory = self
end
self.tabletData = tabletData
self.lines = new()
if not self.columns then
self.columns = 1
end
for i = 1, self.columns do
self['x' .. i] = 0
end
setmetatable(self, Category_mt)
self.lastWasTitle = nil
local good = self.text
if not good then
for i = 2, self.columns do
if self['text' .. i] then
good = true
break
end
end
end
if good then
local x = new(
'category', category,
'text', self.text,
'fakeChild', true,
'func', self.func,
'onEnterFunc', self.onEnterFunc,
'onLeaveFunc', self.onLeaveFunc,
'hasCheck', self.hasCheck,
'checked', self.checked,
'checkIcon', self.checkIcon,
'isRadio', self.isRadio,
'font', self.font,
'size', self.size,
'wrap', self.wrap,
'catStart', true,
'indentation', self.indentation,
'noInherit', true,
'justify', self.justify,
'isTitle', self.isTitle
)
local i = 1
while true do
local k = 'arg' .. i
local v = self[k]
if v == nil then
break
end
x[k] = v
i = i + 1
end
i = 1
while true do
local k = 'onEnterArg' .. i
local v = self[k]
if v == nil then
break
end
x[k] = v
i = i + 1
end
i = 1
while true do
local k = 'onLeaveArg' .. i
local v = self[k]
if v == nil then
break
end
x[k] = v
i = i + 1
end
if self.isTitle then
x.textR = self.textR or 1
x.textG = self.textG or 0.823529
x.textB = self.textB or 0
else
x.textR = self.textR or 1
x.textG = self.textG or 1
x.textB = self.textB or 1
end
for i = 2, self.columns do
x['text' .. i] = self['text' .. i]
x['text' .. i .. 'R'] = self['text' .. i .. 'R'] or self['textR' .. i] or 1
x['text' .. i .. 'G'] = self['text' .. i .. 'G'] or self['textG' .. i] or 1
x['text' .. i .. 'B'] = self['text' .. i .. 'B'] or self['textB' .. i] or 1
x['font' .. i] = self['font' .. i]
x['size' .. i] = self['size' .. i]
x['justify' .. i] = self['justify' .. i]
end
if self.checkIcon and self.checkIcon:find("^Interface\\Icons\\") then
x.checkCoordLeft = self.checkCoordLeft or 0.05
x.checkCoordRight = self.checkCoordRight or 0.95
x.checkCoordTop = self.checkCoordTop or 0.05
x.checkCoordBottom = self.checkCoordBottom or 0.95
else
x.checkCoordLeft = self.checkCoordLeft or 0
x.checkCoordRight = self.checkCoordRight or 1
x.checkCoordTop = self.checkCoordTop or 0
x.checkCoordBottom = self.checkCoordBottom or 1
end
x.checkColorR = self.checkColorR or 1
x.checkColorG = self.checkColorG or 1
x.checkColorB = self.checkColorB or 1
self:AddLine(x)
del(x)
self.lastWasTitle = true
end
return self
end
Category.new = wrap(Category.new, "Category:new")
function Category:del()
local prev = garbageLine
for k, v in pairs(self.lines) do
v:del()
end
del(self.lines)
del(self)
end
Category.del = wrap(Category.del, "Category:del")
function Category:AddLine(...)
self.lastWasTitle = nil
local line
local k1 = ...
if type(k1) == "table" then
local k2 = select(2, ...)
Line:new(self, k1, k2)
else
local info = new(...)
Line:new(self, info)
info = del(info)
end
end
Category.AddLine = wrap(Category.AddLine, "Category:AddLine")
function Category:AddCategory(...)
local lastWasTitle = self.lastWasTitle
self.lastWasTitle = nil
local info
local k1 = ...
if type(k1) == "table" then
info = k1
else
info = new(...)
end
if lastWasTitle or #self.lines == 0 then
info.hideBlankLine = true
end
local cat = Category:new(self.tabletData, info, self)
self.lines[#self.lines+1] = cat
if info ~= k1 then
info = del(info)
end
return cat
end
Category.AddCategory = wrap(Category.AddCategory, "Category:AddCategory")
function Category:HasChildren()
local hasChildren = false
for k, v in ipairs(self.lines) do
if v.HasChildren then
if v:HasChildren() then
return true
end
end
if not v.fakeChild then
return true
end
end
return false
end
Category.HasChildren = wrap(Category.HasChildren, "Category:HasChildren")
local lastWasTitle = false
function Category:Display(tablet)
if not self.isTitle and not self.showWithoutChildren and not self:HasChildren() then
return false
end
if not self.hideBlankLine and not lastWasTitle then
local info = new(
'blank', true,
'fakeChild', true,
'noInherit', true
)
self:AddLine(info, 1)
del(info)
end
local good = false
if #self.lines > 0 then
self.tabletData.id = self.tabletData.id + 1
self.id = self.tabletData.id
for k, v in ipairs(self.lines) do
if v:Display(tablet) then
good = true
end
end
end
lastWasTitle = self.isTitle
return good
end
Category.Display = wrap(Category.Display, "Category:Display")
end
do
local Line_mt = { __index = Line }
function Line:new(category, info, position)
local self = copy(info)
if not info.noInherit then
for k, v in pairs(category) do
if k:find("^child_") then
local k = strsub(k, 7)
if self[k] == nil then
self[k] = v
end
end
end
end
self.category = category
if position then
table.insert(category.lines, position, self)
else
category.lines[#category.lines+1] = self
end
setmetatable(self, Line_mt)
local n = category.tabletData.num_lines + 1
category.tabletData.num_lines = n
if n == 10 then
category.tabletData:checkMinWidth()
end
local columns = category.columns
if columns == 1 then
if not self.justify then
self.justify = "LEFT"
end
elseif columns == 2 then
self.justify = "LEFT"
self.justify2 = "RIGHT"
if self.wrap then
self.wrap2 = false
end
else
for i = 2, columns-1 do
if not self['justify' .. i] then
self['justify' .. i] = "CENTER"
end
end
if not self.justify then
self.justify = "LEFT"
end
if not self['justify' .. columns] then
self['justify' .. columns] = "RIGHT"
end
if self.wrap then
for i = 2, columns do
self['wrap' .. i] = false
end
else
for i = 2, columns do
if self['wrap' .. i] then
for j = i+1, columns do
self['wrap' .. i] = false
end
break
end
end
end
end
if not self.indentation or self.indentation < 0 then
self.indentation = 0
end
if not self.font then
self.font = GameTooltipText
end
for i = 2, columns do
if not self['font' .. i] then
self['font' .. i] = self.font
end
end
if not self.size then
self.size = select(2,self.font:GetFont())
end
for i = 2, columns do
if not self['size' .. i] then
self['size' .. i] = select(2,self['font' .. i]:GetFont())
end
end
if self.checkIcon and self.checkIcon:find("^Interface\\Icons\\") then
if not self.checkCoordLeft then
self.checkCoordLeft = 0.05
end
if not self.checkCoordRight then
self.checkCoordRight = 0.95
end
if not self.checkCoordTop then
self.checkCoordTop = 0.05
end
if not self.checkCoordBottom then
self.checkCoordBottom = 0.95
end
else
if not self.checkCoordLeft then
self.checkCoordLeft = 0
end
if not self.checkCoordRight then
self.checkCoordRight = 1
end
if not self.checkCoordTop then
self.checkCoordTop = 0
end
if not self.checkCoordBottom then
self.checkCoordBottom = 1
end
end
if not self.checkColorR then
self.checkColorR = 1
end
if not self.checkColorG then
self.checkColorG = 1
end
if not self.checkColorB then
self.checkColorB = 1
end
local fontSizePercent = category.tabletData.tablet.fontSizePercent
local w = 0
self.checkWidth = 0
testString = category.tabletData.tablet.buttons[1].col1
if self.text then
if not self.wrap then
local testWidth = getTestWidth(self.font, self.size * fontSizePercent, self.text)
local checkWidth = self.hasCheck and self.size * fontSizePercent or 0
self.checkWidth = checkWidth
w = testWidth + self.indentation * fontSizePercent + checkWidth
if category.superCategory.x1 < w then
category.superCategory.x1 = w
end
else
if columns == 1 then
local testWidth = getTestWidth(self.font, self.size * fontSizePercent, self.text)
local checkWidth = self.hasCheck and self.size * fontSizePercent or 0
self.checkWidth = checkWidth
w = testWidth + self.indentation * fontSizePercent + checkWidth
if w > (MIN_TOOLTIP_SIZE - 20) * fontSizePercent then
w = (MIN_TOOLTIP_SIZE - 20) * fontSizePercent
end
else
w = MIN_TOOLTIP_SIZE * fontSizePercent / 2
end
if category.superCategory.x1 < w then
category.superCategory.x1 = w
end
end
end
if columns == 2 and self.text2 then
if not self.wrap2 then
local testWidth = getTestWidth(self.font2, self.size2 * fontSizePercent, self.text2)
w = w + 40 * fontSizePercent + testWidth
if category.superCategory.x1 < w then
category.superCategory.x1 = w
end
else
w = w + 40 * fontSizePercent + MIN_TOOLTIP_SIZE * fontSizePercent / 2
if category.superCategory.x1 < w then
category.superCategory.x1 = w
end
end
elseif columns >= 3 then
if self.text2 then
if not self.wrap2 then
local testWidth = getTestWidth(self.font2, self.size2 * fontSizePercent, self.text2)
local w = testWidth
if category.superCategory.x2 < w then
category.superCategory.x2 = w
end
else
local w = MIN_TOOLTIP_SIZE / 2
if category.superCategory.x2 < w then
category.superCategory.x2 = w
end
end
end
for i = 3, columns do
local text = self['text' .. i]
if text then
local x_i = 'x' .. i
if not self['wrap' .. i] then
local testWidth = getTestWidth(self['font' .. i], self['size' .. i] * fontSizePercent, text)
local w = testWidth
if category.superCategory[x_i] < w then
category.superCategory[x_i] = w
end
else
local w = MIN_TOOLTIP_SIZE / 2
if category.superCategory[x_i] < w then
category.superCategory[x_i] = w
end
end
end
end
end
return self
end
Line.new = wrap(Line.new, "Line:new")
function Line:del()
del(self)
end
Line.del = wrap(Line.del, "Line:del")
function Line:Display(tablet)
tablet:AddLine(self)
return true
end
Line.Display = wrap(Line.Display, "Line:Display")
end
local fake_ipairs
do
local function iter(tmp, i)
i = i + 1
local x = tmp[i]
tmp[i] = nil
if x then
return i, x
end
end
local tmp = {}
function fake_ipairs(...)
for i = 1, select('#', ...) do
tmp[i] = select(i, ...)
end
return iter, tmp, 0
end
fake_ipairs = wrap(fake_ipairs, "fake_ipairs")
end
local function argunpack(t, key, i)
if not i then
i = 1
end
local k = key .. i
local v = t[k]
if v then
return v, argunpack(t, key, i+1)
end
end
argunpack = wrap(argunpack, "argunpack")
local delstring, newstring
do
local cache = {}
function delstring(t)
cache[#cache+1] = t
t:SetText(nil)
t:ClearAllPoints()
t:Hide()
t:SetParent(UIParent)
return nil
end
delstring = wrap(delstring, "delstring")
function newstring(parent)
if #cache ~= 0 then
local t = cache[#cache]
cache[#cache] = nil
t:Show()
t:SetParent(parent)
return t
end
local t = parent:CreateFontString(nil, "ARTWORK")
return t
end
newstring = wrap(newstring, "newstring")
end
local function button_OnEnter(this, ...)
if type(this.self:GetScript("OnEnter")) == "function" then
this.self:GetScript("OnEnter")(this.self, ...)
end
this.highlight:Show()
if this.onEnterFunc then
local success, ret = pcall(this.onEnterFunc, argunpack(this, 'onEnterArg'))
if not success then
geterrorhandler()(ret)
end
end
end
button_OnEnter = wrap(button_OnEnter, "button_OnEnter")
local function button_OnLeave(this, ...)
if type(this.self:GetScript("OnLeave")) == "function" then
this.self:GetScript("OnLeave")(this.self, ...)
end
this.highlight:Hide()
if this.onLeaveFunc then
local success, ret = pcall(this.onLeaveFunc, argunpack(this, 'onLeaveArg'))
if not success then
geterrorhandler()(ret)
end
end
end
button_OnLeave = wrap(button_OnLeave, "button_OnLeave")
local lastMouseDown
local function button_OnClick(this, arg1, ...)
if this.self:HasScript("OnClick") and type(this.self:GetScript("OnClick")) == "function" then
this.self:GetScript("OnClick")(this.self, arg1, ...)
end
if arg1 == "RightButton" then
if this.self:HasScript("OnClick") and type(this.self:GetScript("OnClick")) == "function" then
this.self:GetScript("OnClick")(this.self, arg1, ...)
end
elseif arg1 == "LeftButton" then
if this.self.preventClick == nil or GetTime() > this.self.preventClick and GetTime() < lastMouseDown + 0.5 then
this.self.preventClick = nil
this.self.updating = true
this.self.preventRefresh = true
local success, ret = pcall(this.func, argunpack(this, 'arg'))
if not success then
geterrorhandler()(ret)
end
if this.self and this.self.registration then
this.self.preventRefresh = false
this.self:children()
this.self.updating = false
end
end
end
end
button_OnClick = wrap(button_OnClick, "button_OnClick")
local function button_OnMouseUp(this, arg1, ...)
if this.self:HasScript("OnMouseUp") and type(this.self:GetScript("OnMouseUp")) == "function" then
this.self:GetScript("OnMouseUp")(this.self, arg1, ...)
end
if arg1 ~= "RightButton" then
if this.clicked then
local a,b,c,d,e = this.check:GetPoint(1)
this.check:SetPoint(a,b,c,d-1,e+1)
this.clicked = false
end
end
end
button_OnMouseUp = wrap(button_OnMouseUp, "button_OnMouseUp")
local function button_OnMouseDown(this, arg1, ...)
if this.self:HasScript("OnMouseDown") and type(this.self:GetScript("OnMouseDown")) == "function" then
this.self:GetScript("OnMouseDown")(this.self, arg1, ...)
end
lastMouseDown = GetTime()
if arg1 ~= "RightButton" then
local a,b,c,d,e = this.check:GetPoint(1)
this.check:SetPoint(a,b,c,d+1,e-1)
this.clicked = true
end
end
button_OnMouseDown = wrap(button_OnMouseDown, "button_OnMouseDown")
local function button_OnDragStart(this, ...)
local parent = this:GetParent() and this:GetParent().tablet
if parent:GetScript("OnDragStart") then
return parent:GetScript("OnDragStart")(parent, ...)
end
end
button_OnDragStart = wrap(button_OnDragStart, "button_OnDragStart")
local function button_OnDragStop(this, ...)
local parent = this:GetParent() and this:GetParent().tablet
if parent:GetScript("OnDragStop") then
return parent:GetScript("OnDragStop")(parent, ...)
end
end
button_OnDragStop = wrap(button_OnDragStop, "button_OnDragStop")
local num_buttons = 0
local function NewLine(self)
if self.maxLines <= self.numLines then
self.maxLines = self.maxLines + 1
num_buttons = num_buttons + 1
local button = CreateFrame("Button", "Tablet20Button" .. num_buttons, self.scrollChild)
button:SetFrameLevel(12)
button.indentation = 0
local check = button:CreateTexture(nil, "ARTWORK")
local col1 = newstring(button)
testString = col1
local highlight = button:CreateTexture(nil, "BACKGROUND")
highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
button.highlight = highlight
highlight:SetBlendMode("ADD")
highlight:SetAllPoints(button)
highlight:Hide()
self.buttons[#self.buttons+1] = button
button.check = check
button.col1 = col1
col1:SetWidth(0)
if self.maxLines == 1 then
col1:SetFontObject(GameTooltipHeaderText)
col1:SetJustifyH("CENTER")
button:SetPoint("TOPLEFT", self.scrollFrame, "TOPLEFT", 3, -5)
else
col1:SetFontObject(GameTooltipText)
button:SetPoint("TOPLEFT", self.buttons[self.maxLines - 1], "BOTTOMLEFT", 0, -2)
end
button:SetScript("OnEnter", button_OnEnter)
button:SetScript("OnLeave", button_OnLeave)
button.check = check
button.self = self
button:SetPoint("RIGHT", self.scrollFrame, "RIGHT", -7, 0)
check.shown = false
check:SetPoint("TOPLEFT", button, "TOPLEFT")
col1:SetPoint("TOPLEFT", check, "TOPLEFT")
local size = select(2,GameTooltipText:GetFont())
check:SetHeight(size * 1.5)
check:SetWidth(size * 1.5)
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
check:SetAlpha(0)
if not button.clicked then
button:SetScript("OnMouseWheel", self:GetScript("OnMouseWheel"))
button:EnableMouseWheel(true)
button:Hide()
end
check:Show()
col1:Hide()
end
end
NewLine = wrap(NewLine, "NewLine")
local function RecalculateTabletHeight(detached)
detached.height_ = nil
if detached.registration and detached.registration.positionFunc then
local height = detached:GetHeight()
if height > 0 then
detached.height_ = height
else
local top, bottom
for i = 1, detached:GetNumPoints() do
local a,b,c,d,e = detached:GetPoint(i)
if a:find("^TOP") then
if c:find("^TOP") then
top = b:GetTop()
elseif c:find("^BOTTOM") then
top = b:GetBottom()
else
top = select(2,b:GetCenter())
end
if top then
top = top + e
end
elseif a:find("^BOTTOM") then
if c:find("^TOP") then
bottom = b:GetTop()
elseif c:find("^BOTTOM") then
bottom = b:GetBottom()
else
bottom = select(2,b:GetCenter())
end
if bottom then
bottom = bottom + e
end
end
end
if top and bottom then
detached.height_ = top - bottom
end
end
end
end
RecalculateTabletHeight = wrap(RecalculateTabletHeight, "RecalculateTabletHeight")
local function GetTooltipHeight(self)
RecalculateTabletHeight(self)
if self.height_ then
local height = self:GetTop() and self:GetBottom() and self:GetTop() - self:GetBottom() or self:GetHeight()
if height == 0 then
height = self.height_
end
return height
end
if self.registration.maxHeight then
return self.registration.maxHeight
end
if self == tooltip then
return GetScreenHeight()*3/4
else
return GetScreenHeight()*2/3
end
end
GetTooltipHeight = wrap(GetTooltipHeight, "GetTooltipHeight")
local overFrame = nil
local detachedTooltips = {}
local AcquireDetachedFrame, ReleaseDetachedFrame
local function AcquireFrame(self, registration, data, detachedData)
if not detachedData then
detachedData = data
end
if tooltip then
tooltip.data = data
tooltip.detachedData = detachedData
local fontSizePercent = tooltip.data and tooltip.data.fontSizePercent or 1
local transparency = tooltip.data and tooltip.data.transparency or 0.75
local r = tooltip.data and tooltip.data.r or 0
local g = tooltip.data and tooltip.data.g or 0
local b = tooltip.data and tooltip.data.b or 0
tooltip:SetFontSizePercent(fontSizePercent)
tooltip:SetTransparency(transparency)
tooltip:SetColor(r, g, b)
tooltip:SetParent(GetMainFrame())
tooltip:SetFrameStrata(registration.strata or "TOOLTIP")
tooltip:SetFrameLevel(10)
for _,frame in fake_ipairs(tooltip:GetChildren()) do
frame:SetFrameLevel(12)
end
else
tooltip = CreateFrame("Frame", "Tablet20Frame", UIParent)
tooltip:SetParent(GetMainFrame())
self.tooltip = tooltip
tooltip.data = data
tooltip.detachedData = detachedData
tooltip:EnableMouse(true)
tooltip:EnableMouseWheel(true)
tooltip:SetFrameStrata(registration.strata or "TOOLTIP")
tooltip:SetFrameLevel(10)
local backdrop = new(
'bgFile', "Interface\\Buttons\\WHITE8X8",
'edgeFile', "Interface\\Tooltips\\UI-Tooltip-Border",
'tile', true,
'tileSize', 16,
'edgeSize', 16,
'insets', new(
'left', 5,
'right', 5,
'top', 5,
'bottom', 5
)
)
tooltip:SetBackdrop(backdrop)
del(backdrop.insets)
del(backdrop)
tooltip:SetBackdropColor(0, 0, 0, 1)
tooltip.numLines = 0
tooltip.owner = nil
tooltip.fontSizePercent = tooltip.data and tooltip.data.fontSizePercent or 1
tooltip.maxLines = 0
tooltip.buttons = {}
tooltip.transparency = tooltip.data and tooltip.data.transparency or 0.75
tooltip:SetBackdropColor(0, 0, 0, tooltip.transparency)
tooltip:SetBackdropBorderColor(1, 1, 1, tooltip.transparency)
tooltip:SetScript("OnUpdate", function(this, elapsed)
if not tooltip.updating and (not tooltip.enteredFrame or (overFrame and not MouseIsOver(overFrame))) then
tooltip.scrollFrame:SetVerticalScroll(0)
tooltip.slider:SetValue(0)
tooltip:Hide()
tooltip.registration.tooltip = nil
tooltip.registration = nil
overFrame = nil
end
end)
tooltip:SetScript("OnEnter", function(this)
if tooltip.clickable then
tooltip.enteredFrame = true
overFrame = nil
end
end)
tooltip:SetScript("OnLeave", function(this)
if not tooltip.updating then
tooltip.enteredFrame = false
end
end)
tooltip:SetScript("OnMouseWheel", function(this, arg1)
tooltip.updating = true
tooltip:Scroll(arg1 < 0)
tooltip.updating = false
end)
local scrollFrame = CreateFrame("ScrollFrame", "Tablet20FrameScrollFrame", tooltip)
scrollFrame:SetFrameLevel(11)
local scrollChild = CreateFrame("Frame", "Tablet20FrameScrollChild", scrollFrame)
scrollChild.tablet = tooltip
scrollFrame:SetScrollChild(scrollChild)
tooltip.scrollFrame = scrollFrame
tooltip.scrollChild = scrollChild
scrollFrame:SetPoint("TOPLEFT", 5, -5)
scrollFrame:SetPoint("TOPRIGHT", -5, -5)
scrollFrame:SetPoint("BOTTOMLEFT", 5, 5)
scrollFrame:SetPoint("BOTTOMRIGHT", -5, 5)
scrollChild:SetWidth(1)
scrollChild:SetHeight(1)
local slider = CreateFrame("Slider", "Tablet20FrameSlider", scrollFrame)
tooltip.slider = slider
slider:SetOrientation("VERTICAL")
slider:SetMinMaxValues(0, 1)
slider:SetValueStep(0.001)
slider:SetValue(0)
slider:SetWidth(8)
slider:SetPoint("TOPRIGHT", 0, 0)
slider:SetPoint("BOTTOMRIGHT", 0, 0)
slider:SetBackdrop(new(
'bgFile', "Interface\\Buttons\\UI-SliderBar-Background",
'edgeFile', "Interface\\Buttons\\UI-SliderBar-Border",
'tile', true,
'edgeSize', 8,
'tileSize', 8,
'insets', new(
'left', 3,
'right', 3,
'top', 3,
'bottom', 3
)
))
slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Vertical")
slider:SetScript("OnEnter", tooltip:GetScript("OnEnter"))
slider:SetScript("OnLeave", tooltip:GetScript("OnLeave"))
slider.tablet = tooltip
slider:SetScript("OnValueChanged", function(this)
local max = this.tablet.scrollChild:GetHeight() - this.tablet:GetHeight()
local val = this:GetValue() * max
if math.abs(this.tablet.scrollFrame:GetVerticalScroll() - val) < 1 then
return
end
this.tablet.scrollFrame:SetVerticalScroll(val)
end)
NewLine(tooltip)
function tooltip:SetOwner(o)
self:Hide(o)
self.owner = o
end
tooltip.SetOwner = wrap(tooltip.SetOwner, "tooltip:SetOwner")
function tooltip:IsOwned(o)
return self.owner == o
end
tooltip.IsOwned = wrap(tooltip.IsOwned, "tooltip:IsOwned")
function tooltip:ClearLines(hide)
CleanCategoryPool(self)
for i = 1, self.numLines do
local button = self.buttons[i]
local check = button.check
if not button.clicked or hide then
button:Hide()
end
check.shown = false
check:SetAlpha(0)
end
self.numLines = 0
end
tooltip.ClearLines = wrap(tooltip.ClearLines, "tooltip:ClearLines")
function tooltip:NumLines()
return self.numLines
end
local lastWidth
local old_tooltip_Hide = tooltip.Hide
tooltip.__Hide = old_tooltip_Hide
function tooltip:Hide(newOwner)
if self == tooltip or newOwner == nil then
old_tooltip_Hide(self)
end
self:ClearLines(true)
self.owner = nil
self.lastWidth = nil
self.tmpHidden = nil
end
tooltip.Hide = wrap(tooltip.Hide, "tooltip:Hide")
local old_tooltip_Show = tooltip.Show
tooltip.__Show = old_tooltip_Show
function tooltip:Show(tabletData)
if self.owner == nil or self.notInUse then
return
end
if not self.tmpHidden then
old_tooltip_Show(self)
end
testString = self.buttons[1].col1
local maxWidth = tabletData and tabletData.width or self:GetWidth() - 20
local hasWrap = false
local numColumns
local height = 20
self:SetWidth(maxWidth + 20)
for i = 1, self.numLines do
local button = self.buttons[i]
local col1 = button.col1
local col2 = button.col2
local check = button.check
button:SetWidth(maxWidth)
button:SetHeight(col2 and math.max(col1:GetHeight(), col2:GetHeight()) or col1:GetHeight())
height = height + button:GetHeight() + 2
if i == 1 then
button:SetPoint("TOPLEFT", self.scrollChild, "TOPLEFT", 5, -5)
else
button:SetPoint("TOPLEFT", self.buttons[i - 1], "BOTTOMLEFT", 0, -2)
end
if button.clicked then
check:SetPoint("TOPLEFT", button, "TOPLEFT", button.indentation * self.fontSizePercent + (check.width - check:GetWidth()) / 2 + 1, -1)
else
check:SetPoint("TOPLEFT", button, "TOPLEFT", button.indentation * self.fontSizePercent + (check.width - check:GetWidth()) / 2, 0)
end
button:Show()
end
self.scrollFrame:SetFrameLevel(11)
self.scrollChild:SetWidth(maxWidth)
self.scrollChild:SetHeight(height)
local maxHeight = GetTooltipHeight(self)
if height > maxHeight then
height = maxHeight
self.slider:Show()
else
self.slider:Hide()
end
self:SetHeight(height)
self.scrollFrame:SetScrollChild(self.scrollChild)
local val = self.scrollFrame:GetVerticalScroll()
local max = self.scrollChild:GetHeight() - self:GetHeight()
if val > max then
val = max
end
if val < 0 then
val = 0
end
self.scrollFrame:SetVerticalScroll(val)
self.slider:SetValue(val/max)
end
tooltip.Show = wrap(tooltip.Show, "tooltip:Show")
function tooltip:AddLine(info)
local category = info.category.superCategory
local maxWidth = category.tabletData.width
local text = info.blank and "\n" or info.text
local id = info.id
local func = info.func
local checked = info.checked
local isRadio = info.isRadio
local checkTexture = info.checkTexture
local fontSizePercent = self.fontSizePercent
if not info.font then
info.font = GameTooltipText
end
if not info.size then
info.size = select(2,info.font:GetFont())
end
local catStart = false
local columns = category and category.columns or 1
local x_total = 0
local x1, x2
if category then
for i = 1, category.columns do
x_total = x_total + category['x' .. i]
end
x1, x2 = category.x1, category.x2
else
x1, x2 = 0, 0
end
self.numLines = self.numLines + 1
NewLine(self)
local num = self.numLines
local button = self.buttons[num]
button:Show()
button.col1:Show()
button.indentation = info.indentation
local col1 = button.col1
local check = button.check
do -- if columns >= 1 then
col1:SetWidth(0)
col1:SetFontObject(info.font)
local font,_,flags = info.font:GetFont()
col1:SetFont(font, info.size * fontSizePercent, flags)
col1:SetText(text)
col1:SetJustifyH(info.justify)
col1:Show()
if info.textR and info.textG and info.textB then
col1:SetTextColor(info.textR, info.textG, info.textB)
else
col1:SetTextColor(1, 0.823529, 0)
end
if columns < 2 then
local i = 2
while true do
local col = button['col' .. i]
if col then
button['col' .. i] = delstring(col)
else
break
end
i = i + 1
end
else
local i = 2
while true do
local col = button['col' .. i]
if not col then
button['col' .. i] = newstring(button)
col = button['col' .. i]
end
col:SetFontObject(info['font' .. i])
col:SetText(info['text' .. i])
col:Show()
local r,g,b = info['text' .. i .. 'R']
if r then
g = info['text' .. i .. 'G']
if g then
b = info['text' .. i .. 'B']
end
end
if b then
col:SetTextColor(r, g, b)
else
col:SetTextColor(1, 0.823529, 0)
end
local a,_,b = info.font2:GetFont()
col:SetFont(a, info['size' .. i] * fontSizePercent, b)
col:SetJustifyH(info['justify' .. i])
if columns == i then
if i == 2 then
col:SetPoint("TOPLEFT", col1, "TOPRIGHT", 40 * fontSizePercent, 0)
col:SetPoint("TOPRIGHT", button, "TOPRIGHT", -5, 0)
else
local col2 = button.col2
col2:ClearAllPoints()
col2:SetPoint("TOPLEFT", col1, "TOPRIGHT", (20 - info.indentation) * fontSizePercent, 0)
end
i = i + 1
while true do
local col = button['col' .. i]
if col then
button['col' .. i] = delstring(col)
else
break
end
i = i + 1
end
break
end
i = i + 1
end
end
end
check:SetWidth(info.size * fontSizePercent)
check:SetHeight(info.size * fontSizePercent)
check.width = info.size * fontSizePercent
if info.hasCheck then
check.shown = true
check:Show()
if isRadio then
check:SetTexture(info.checkIcon or "Interface\\Buttons\\UI-RadioButton")
if info.checked then
check:SetAlpha(1)
check:SetTexCoord(0.25, 0.5, 0, 1)
else
check:SetAlpha(self.transparency)
check:SetTexCoord(0, 0.25, 0, 1)
end
check:SetVertexColor(1, 1, 1)
else
if info.checkIcon then
check:SetTexture(info.checkIcon)
check:SetTexCoord(info.checkCoordLeft, info.checkCoordRight, info.checkCoordTop, info.checkCoordBottom)
check:SetVertexColor(info.checkColorR, info.checkColorG, info.checkColorB)
else
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
check:SetWidth(info.size * fontSizePercent * 1.5)
check:SetHeight(info.size * fontSizePercent * 1.5)
check.width = info.size * fontSizePercent * 1.2
check:SetTexCoord(0, 1, 0, 1)
check:SetVertexColor(1, 1, 1)
end
check:SetAlpha(info.checked and 1 or 0)
end
col1:SetPoint("TOPLEFT", check, "TOPLEFT", check.width, 0)
else
col1:SetPoint("TOPLEFT", check, "TOPLEFT")
end
local col2 = button.col2
if columns == 1 then
col1:SetWidth(maxWidth)
elseif columns == 2 then
if info.wrap then
col1:SetWidth(maxWidth - col2:GetWidth() - 40 * fontSizePercent)
col2:SetWidth(0)
elseif info.wrap2 then
col1:SetWidth(0)
col2:SetWidth(maxWidth - col1:GetWidth() - 40 * fontSizePercent)
else
col1:SetWidth(0)
col2:SetWidth(0)
end
col2:ClearAllPoints()
col2:SetPoint("TOPRIGHT", button, "TOPRIGHT", 0, 0)
if not info.text2 then
col1:SetJustifyH(info.justify or "LEFT")
end
else
col1:SetWidth(x1 - info.checkWidth)
col2:SetWidth(x2)
local num = (category.tabletData.width - x_total) / (columns - 1)
col2:SetPoint("TOPLEFT", col1, "TOPRIGHT", num - info.indentation * fontSizePercent, 0)
local last = col2
for i = 3, category.columns do
local col = button['col' .. i]
col:SetWidth(category['x' .. i])
col:SetPoint("TOPLEFT", last, "TOPRIGHT", num, 0)
last = col
end
end
button.func = nil
button.onEnterFunc = nil
button.onLeaveFunc = nil
button:SetFrameLevel(12) -- hack suggested on forum. Added 06/17/2007. (hC)
if not self.locked or IsAltKeyDown() then
local func = info.func
if func then
if type(func) == "string" then
if type(info.arg1) ~= "table" then
Tablet:error("Cannot call method " .. info.func .. " on a non-table")
end
func = info.arg1[func]
if type(func) ~= "function" then
Tablet:error("Method " .. info.func .. " nonexistant")
end
else
if type(func) ~= "function" then
Tablet:error("func must be a function or method")
end
end
button.func = func
local i = 1
while true do
local k = 'arg' .. i
if button[k] ~= nil then
button[k] = nil
else
break
end
i = i + 1
end
i = 1
while true do
local k = 'arg' .. i
local v = info[k]
if v == nil then
break
end
button[k] = v
i = i + 1
end
local onEnterFunc = info.onEnterFunc
if onEnterFunc then
if type(onEnterFunc) == "string" then
if type(info.onEnterArg1) ~= "table" then
Tablet:error("Cannot call method " .. info.onEnterFunc .. " on a non-table")
end
onEventFunc = info.onEnterArg1[onEnterFunc]
if type(onEnterFunc) ~= "function" then
Tablet:error("Method " .. info.onEnterFunc .. " nonexistant")
end
else
if type(onEnterFunc) ~= "function" then
Tablet:error("func must be a function or method")
end
end
button.onEnterFunc = onEnterFunc
local i = 1
while true do
local k = 'onEnterArg' .. i
if button[k] ~= nil then
button[k] = nil
else
break
end
i = i + 1
end
i = 1
while true do
local k = 'onEnterArg' .. i
local v = info[k]
if v == nil then
break
end
button[k] = v
i = i + 1
end
end
local onLeaveFunc = info.onLeaveFunc
if onLeaveFunc then
if type(onLeaveFunc) == "string" then
if type(info.onLeaveArg1) ~= "table" then
Tablet:error("Cannot call method " .. info.onLeaveFunc .. " on a non-table")
end
onLeaveFunc = info.onLeaveArg1[onLeaveFunc]
if type(onLeaveFunc) ~= "function" then
Tablet:error("Method " .. info.onLeaveFunc .. " nonexistant")
end
else
if type(onLeaveFunc) ~= "function" then
Tablet:error("func must be a function or method")
end
end
button.onLeaveFunc = onLeaveFunc
local i = 1
while true do
local k = 'onLeaveArg' .. i
if button[k] ~= nil then
button[k] = nil
else
break
end
i = i + 1
end
i = 1
while true do
local k = 'onLeaveArg' .. i
local v = info[k]
if v == nil then
break
end
button[k] = v
i = i + 1
end
end
button.self = self
button:SetScript("OnMouseUp", button_OnMouseUp)
button:SetScript("OnMouseDown", button_OnMouseDown)
button:RegisterForDrag("LeftButton")
button:SetScript("OnDragStart", button_OnDragStart)
button:SetScript("OnDragStop", button_OnDragStop)
button:SetScript("OnClick", button_OnClick)
if button.clicked then
button:SetButtonState("PUSHED")
end
button:EnableMouse(true)
else
button:SetScript("OnMouseDown", nil)
button:SetScript("OnMouseUp", nil)
button:RegisterForDrag()
button:SetScript("OnDragStart", nil)
button:SetScript("OnDragStop", nil)
button:SetScript("OnClick", nil)
button:EnableMouse(false)
end
else
button:SetScript("OnMouseDown", nil)
button:SetScript("OnMouseUp", nil)
button:RegisterForDrag()
button:SetScript("OnDragStart", nil)
button:SetScript("OnDragStop", nil)
button:SetScript("OnClick", nil)
button:EnableMouse(false)
end
end
tooltip.AddLine = wrap(tooltip.AddLine, "tooltip:AddLine")
function tooltip:SetFontSizePercent(percent)
local data, detachedData = self.data, self.detachedData
if detachedData and detachedData.detached then
data = detachedData
end
local lastSize = self.fontSizePercent
percent = tonumber(percent) or 1
if percent < 0.25 then
percent = 0.25
elseif percent > 4 then
percent = 4
end
self.fontSizePercent = percent
if data then
data.fontSizePercent = percent
end
local ratio = self.fontSizePercent / lastSize
for i = 1, self.numLines do
local button = self.buttons[i]
local j = 1
while true do
local col = button['col' .. j]
if not col then
break
end
local font, size, flags = col:GetFont()
col:SetFont(font, size * ratio, flags)
j = j + 1
end
local check = button.check
check.width = check.width * ratio
check:SetWidth(check:GetWidth() * ratio)
check:SetHeight(check:GetHeight() * ratio)
end
self:SetWidth((self:GetWidth() - 51) * ratio + 51)
self:SetHeight((self:GetHeight() - 51) * ratio + 51)
if self:IsShown() and self.children then
self:children()
self:Show()
end
end
tooltip.SetFontSizePercent = wrap(tooltip.SetFontSizePercent, "tooltip:SetFontSizePercent")
function tooltip:GetFontSizePercent()
return self.fontSizePercent
end
function tooltip:SetTransparency(alpha)
local data, detachedData = self.data, self.detachedData
if detachedData and detachedData.detached then
data = detachedData
end
self.transparency = alpha
if data then
data.transparency = alpha ~= 0.75 and alpha or nil
end
self:SetBackdropColor(self.r or 0, self.g or 0, self.b or 0, alpha)
self:SetBackdropBorderColor(1, 1, 1, alpha)
self.slider:SetBackdropColor(self.r or 0, self.g or 0, self.b or 0, alpha)
self.slider:SetBackdropBorderColor(1, 1, 1, alpha)
end
tooltip.SetTransparency = wrap(tooltip.SetTransparency, "tooltip:SetTransparency")
function tooltip:GetTransparency()
return self.transparency
end
function tooltip:SetColor(r, g, b)
local data, detachedData = self.data, self.detachedData
if detachedData and detachedData.detached then
data = detachedData
end
self.r = r
self.g = g
self.b = b
if data then
data.r = r ~= 0 and r or nil
data.g = g ~= 0 and g or nil
data.b = b ~= 0 and b or nil
end
self:SetBackdropColor(r or 0, g or 0, b or 0, self.transparency)
self:SetBackdropBorderColor(1, 1, 1, self.transparency)
end
tooltip.SetColor = wrap(tooltip.SetColor, "tooltip:SetColor")
function tooltip:GetColor()
return self.r, self.g, self.b
end
function tooltip:Scroll(down)
local val
local max = self.scrollChild:GetHeight() - self:GetHeight()
if down then
if IsShiftKeyDown() then
val = max
else
val = self.scrollFrame:GetVerticalScroll() + 36
if val > max then
val = max
end
end
else
if IsShiftKeyDown() then
val = 0
else
val = self.scrollFrame:GetVerticalScroll() - 36
if val < 0 then
val = 0
end
end
end
self.scrollFrame:SetVerticalScroll(val)
self.slider:SetValue(val/max)
end
tooltip.Scroll = wrap(tooltip.Scroll, "tooltip:Scroll")
function tooltip.Detach(tooltip)
local owner = tooltip.owner
tooltip:Hide()
if not tooltip.detachedData then
self:error("You cannot detach if detachedData is not present")
end
tooltip.detachedData.detached = true
local detached = AcquireDetachedFrame(self, tooltip.registration, tooltip.data, tooltip.detachedData)
detached.menu, tooltip.menu = tooltip.menu, nil
detached.runChildren = tooltip.runChildren
detached.children = tooltip.children
detached.minWidth = tooltip.minWidth
tooltip.runChildren = nil
tooltip.children = nil
tooltip.minWidth = nil
detached:SetOwner(owner)
detached:children()
detached:Show()
end
tooltip.Detach = wrap(tooltip.Detach, "tooltip:Detach")
end
tooltip.registration = registration
registration.tooltip = tooltip
return tooltip
end
AcquireFrame = wrap(AcquireFrame, "AcquireFrame")
function ReleaseDetachedFrame(self, data, detachedData)
if not detachedData then
detachedData = data
end
for _, detached in ipairs(detachedTooltips) do
if detached.detachedData == detachedData then
detached.notInUse = true
detached:Hide()
detached.registration.tooltip = nil
detached.registration = nil
detached.detachedData = nil
end
end
end
ReleaseDetachedFrame = wrap(ReleaseDetachedFrame, "ReleaseDetachedFrame")
local StartCheckingAlt, StopCheckingAlt
do
local frame
function StartCheckingAlt(func)
if not frame then
frame = CreateFrame("Frame")
frame:SetScript("OnEvent", function(this, _, modifier)
if modifier == "LALT" or modifier == "RALT" then
this.func()
end
end)
end
frame:RegisterEvent("MODIFIER_STATE_CHANGED")
frame.func = func
end
StartCheckingAlt = wrap(StartCheckingAlt, "StartCheckingAlt")
function StopCheckingAlt()
if frame then
frame:UnregisterEvent("MODIFIER_STATE_CHANGED")
end
end
StopCheckingAlt = wrap(StopCheckingAlt, "StopCheckingAlt")
end
function AcquireDetachedFrame(self, registration, data, detachedData)
if not detachedData then
detachedData = data
end
for _, detached in ipairs(detachedTooltips) do
if detached.notInUse then
detached.data = data
detached.detachedData = detachedData
detached.notInUse = nil
local fontSizePercent = detachedData.fontSizePercent or 1
local transparency = detachedData.transparency or 0.75
local r = detachedData.r or 0
local g = detachedData.g or 0
local b = detachedData.b or 0
detached:SetFontSizePercent(fontSizePercent)
detached:SetTransparency(transparency)
detached:SetColor(r, g, b)
detached:ClearAllPoints()
detached:SetWidth(0)
detached:SetHeight(0)
if not registration.strata then
detached:SetFrameStrata("BACKGROUND")
end
if not registration.frameLevel then
detached:SetFrameLevel(10)
for _,frame in fake_ipairs(detached:GetChildren()) do
frame:SetFrameLevel(12)
end
end
detached:SetParent(registration.parent or GetMainFrame())
if registration.strata then
detached:SetFrameStrata(registration.strata)
end
if registration.frameLevel then
detached:SetFrameLevel(registration.frameLevel)
for _,frame in fake_ipairs(detached:GetChildren()) do
frame:SetFrameLevel(registration.frameLevel+2)
end
end
detached.height_ = nil
if registration.positionFunc then
registration.positionFunc(detached)
RecalculateTabletHeight(detached)
else
detached:SetPoint(detachedData.anchor or "CENTER", GetMainFrame(), detachedData.anchor or "CENTER", detachedData.offsetx or 0, detachedData.offsety or 0)
end
detached.registration = registration
registration.tooltip = detached
if registration.movable == false then
detached:RegisterForDrag()
else
detached:RegisterForDrag("LeftButton")
end
return detached
end
end
if not Dewdrop and AceLibrary:HasInstance("Dewdrop-2.0") then
Dewdrop = AceLibrary("Dewdrop-2.0")
end
StartCheckingAlt(function()
for _, detached in ipairs(detachedTooltips) do
if detached:IsShown() and detached.locked then
detached:EnableMouse(IsAltKeyDown())
detached:children()
if detached.moving then
local a1 = arg1
arg1 = "LeftButton"
if type(detached:GetScript("OnMouseUp")) == "function" then
detached:GetScript("OnMouseUp")(detached, arg1)
end
arg1 = a1
end
end
end
end)
if not tooltip then
AcquireFrame(self, {})
end
local detached = CreateFrame("Frame", "Tablet20DetachedFrame" .. (#detachedTooltips + 1), GetMainFrame())
detachedTooltips[#detachedTooltips+1] = detached
detached.notInUse = true
detached:EnableMouse(not data.locked)
detached:EnableMouseWheel(true)
detached:SetMovable(true)
detached:SetPoint(data.anchor or "CENTER", GetMainFrame(), data.anchor or "CENTER", data.offsetx or 0, data.offsety or 0)
detached.numLines = 0
detached.owner = nil
detached.fontSizePercent = 1
detached.maxLines = 0
detached.buttons = {}
detached.transparency = 0.75
detached.r = 0
detached.g = 0
detached.b = 0
detached:SetFrameStrata(registration and registration.strata or "BACKGROUND")
detached:SetBackdrop(tmp.a(
'bgFile', "Interface\\Buttons\\WHITE8X8",
'edgeFile', "Interface\\Tooltips\\UI-Tooltip-Border",
'tile', true,
'tileSize', 16,
'edgeSize', 16,
'insets', tmp.b(
'left', 5,
'right', 5,
'top', 5,
'bottom', 5
)
))
detached.locked = detachedData.locked
detached:EnableMouse(not detached.locked)
local width = GetScreenWidth()
local height = GetScreenHeight()
if registration and registration.movable == false then
detached:RegisterForDrag()
else
detached:RegisterForDrag("LeftButton")
end
detached:SetScript("OnDragStart", function(this)
detached:StartMoving()
detached.moving = true
end)
detached:SetScript("OnDragStop", function(this)
detached:StopMovingOrSizing()
detached.moving = nil
detached:SetClampedToScreen(1)
detached:SetClampedToScreen(nil)
local anchor
local offsetx
local offsety
if detached:GetTop() + detached:GetBottom() < height then
anchor = "BOTTOM"
offsety = detached:GetBottom()
if offsety < 0 then
offsety = 0
end
if offsety < MainMenuBar:GetTop() and MainMenuBar:IsVisible() then
offsety = MainMenuBar:GetTop()
end
local top = 0
if FuBar then
for i = 1, FuBar:GetNumPanels() do
local panel = FuBar:GetPanel(i)
if panel:GetAttachPoint() == "BOTTOM" then
if panel.frame:GetTop() > top then
top = panel.frame:GetTop()
break
end
end
end
end
if offsety < top then
offsety = top
end
else
anchor = "TOP"
offsety = detached:GetTop() - height
if offsety > 0 then
offsety = 0
end
local bottom = GetScreenHeight()
if FuBar then
for i = 1, FuBar:GetNumPanels() do
local panel = FuBar:GetPanel(i)
if panel:GetAttachPoint() == "TOP" then
if panel.frame:GetBottom() < bottom then
bottom = panel.frame:GetBottom()
break
end
end
end
end
bottom = bottom - GetScreenHeight()
if offsety > bottom then
offsety = bottom
end
end
if detached:GetLeft() + detached:GetRight() < width * 2 / 3 then
anchor = anchor .. "LEFT"
offsetx = detached:GetLeft()
if offsetx < 0 then
offsetx = 0
end
elseif detached:GetLeft() + detached:GetRight() < width * 4 / 3 then
if anchor == "" then
anchor = "CENTER"
end
offsetx = (detached:GetLeft() + detached:GetRight() - GetScreenWidth()) / 2
else
anchor = anchor .. "RIGHT"
offsetx = detached:GetRight() - width
if offsetx > 0 then
offsetx = 0
end
end
detached:ClearAllPoints()
detached:SetPoint(anchor, GetMainFrame(), anchor, offsetx, offsety)
local t = detached.detachedData
if t.anchor ~= anchor or math.abs(t.offsetx - offsetx) > 8 or math.abs(t.offsety - offsety) > 8 then
detached.preventClick = GetTime() + 0.05
end
t.anchor = anchor
t.offsetx = offsetx
t.offsety = offsety
detached:Show()
end)
if Dewdrop then
Dewdrop:Register(detached,
'children', function(level, value)
if not detached.registration then
return
end
if detached.menu then
if type(detached.menu) == "function" then
detached.menu(level, value)
else
Dewdrop:FeedAceOptionsTable(detached.menu)
end
if level == 1 then
Dewdrop:AddLine()
end
end
if level == 1 then
if not detached.registration.cantAttach then
Dewdrop:AddLine(
'text', DETACH,
'tooltipTitle', DETACH,
'tooltipText', DETACH_DESC,
'checked', true,
'arg1', detached,
'func', "Attach",
'closeWhenClicked', true
)
end
if not detached.registration.positionFunc then
Dewdrop:AddLine(
'text', LOCK,
'tooltipTitle', LOCK,
'tooltipText', LOCK_DESC,
'checked', detached:IsLocked(),
'arg1', detached,
'func', "Lock",
'closeWhenClicked', not detached:IsLocked()
)
end
Dewdrop:AddLine(
'text', COLOR,
'tooltipTitle', COLOR,
'tooltipText', COLOR_DESC,
'hasColorSwatch', true,
'r', detached.r,
'g', detached.g,
'b', detached.b,
'hasOpacity', true,
'opacity', detached.transparency,
'colorFunc', function(r, g, b, a)
detached:SetColor(r, g, b)
detached:SetTransparency(a)
end
)
Dewdrop:AddLine(
'text', SIZE,
'tooltipTitle', SIZE,
'tooltipText', SIZE_DESC,
'hasArrow', true,
'hasSlider', true,
'sliderFunc', function(value)
detached:SetFontSizePercent(value)
end,
'sliderMax', 2,
'sliderMin', 0.5,
'sliderStep', 0.05,
'sliderIsPercent', true,
'sliderValue', detached:GetFontSizePercent()
)
Dewdrop:AddLine(
'text', CLOSE_MENU,
'tooltipTitle', CLOSE_MENU,
'tooltipText', CLOSE_MENU_DESC,
'func', function()
Dewdrop:Close()
end
)
end
end,
'point', function()
local x, y = detached:GetCenter()
if x < GetScreenWidth() / 2 then
if y < GetScreenHeight() / 2 then
return "BOTTOMLEFT", "BOTTOMRIGHT"
else
return "TOPLEFT", "TOPRIGHT"
end
else
if y < GetScreenHeight() / 2 then
return "BOTTOMRIGHT", "BOTTOMLEFT"
else
return "TOPRIGHT", "TOPLEFT"
end
end
end
)
end
local scrollFrame = CreateFrame("ScrollFrame", detached:GetName() .. "ScrollFrame", detached)
local scrollChild = CreateFrame("Frame", detached:GetName() .. "ScrollChild", scrollFrame)
scrollFrame:SetFrameLevel(11)
scrollFrame:SetScrollChild(scrollChild)
scrollChild.tablet = detached
detached.scrollFrame = scrollFrame
detached.scrollChild = scrollChild
scrollFrame:SetPoint("TOPLEFT", 5, -5)
scrollFrame:SetPoint("BOTTOMRIGHT", -5, 5)
scrollChild:SetWidth(1)
scrollChild:SetHeight(1)
local slider = CreateFrame("Slider", detached:GetName() .. "Slider", scrollFrame)
detached.slider = slider
slider:SetOrientation("VERTICAL")
slider:SetMinMaxValues(0, 1)
slider:SetValueStep(0.001)
slider:SetValue(0)
slider:SetWidth(8)
slider:SetPoint("TOPRIGHT", 0, 0)
slider:SetPoint("BOTTOMRIGHT", 0, 0)
slider:SetBackdrop(new(
'bgFile', "Interface\\Buttons\\UI-SliderBar-Background",
'edgeFile', "Interface\\Buttons\\UI-SliderBar-Border",
'tile', true,
'edgeSize', 8,
'tileSize', 8,
'insets', new(
'left', 3,
'right', 3,
'top', 3,
'bottom', 3
)
))
slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Vertical")
slider:SetScript("OnEnter", detached:GetScript("OnEnter"))
slider:SetScript("OnLeave", detached:GetScript("OnLeave"))
slider.tablet = detached
slider:SetScript("OnValueChanged", Tablet20FrameSlider:GetScript("OnValueChanged"))
NewLine(detached)
detached:SetScript("OnMouseWheel", function(this, arg1)
detached:Scroll(arg1 < 0)
end)
detached.SetTransparency = tooltip.SetTransparency
detached.GetTransparency = tooltip.GetTransparency
detached.SetColor = tooltip.SetColor
detached.GetColor = tooltip.GetColor
detached.SetFontSizePercent = tooltip.SetFontSizePercent
detached.GetFontSizePercent = tooltip.GetFontSizePercent
detached.SetOwner = tooltip.SetOwner
detached.IsOwned = tooltip.IsOwned
detached.ClearLines = tooltip.ClearLines
detached.NumLines = tooltip.NumLines
detached.__Hide = detached.Hide
detached.__Show = detached.Show
detached.Hide = tooltip.Hide
detached.Show = tooltip.Show
local old_IsShown = detached.IsShown
function detached:IsShown()
if self.tmpHidden then
return true
else
return old_IsShown(self)
end
end
detached.AddLine = tooltip.AddLine
detached.Scroll = tooltip.Scroll
function detached:IsLocked()
return self.locked
end
function detached:Lock()
self:EnableMouse(self.locked)
self.locked = not self.locked
if self.detachedData then
self.detachedData.locked = self.locked or nil
end
self:children()
end
function detached.Attach(detached)
if not detached then
self:error("Detached tooltip not given.")
end
if not detached.AddLine then
self:error("detached argument not a Tooltip.")
end
if not detached.owner then
self:error("Detached tooltip has no owner.")
end
if detached.notInUse then
self:error("Detached tooltip not in use.")
end
detached.menu = nil
detached.detachedData.detached = nil
detached:SetOwner(nil)
detached.notInUse = true
end
return AcquireDetachedFrame(self, registration, data, detachedData)
end
AcquireDetachedFrame = wrap(AcquireDetachedFrame, "AcquireDetachedFrame")
function Tablet:Close(parent)
if not parent then
if tooltip and tooltip:IsShown() then
tooltip:Hide()
tooltip.registration.tooltip = nil
tooltip.registration = nil
tooltip.enteredFrame = false
end
return
else
self:argCheck(parent, 2, "table", "string")
end
local info = self.registry[parent]
if not info then
self:error("You cannot close a tablet with an unregistered parent frame.")
end
local data = info.data
local detachedData = info.detachedData
if detachedData and detachedData.detached then
ReleaseDetachedFrame(self, data, detachedData)
elseif tooltip and tooltip.data == data then
tooltip:Hide()
if tooltip.registration then
tooltip.registration.tooltip = nil
tooltip.registration = nil
end
end
if tooltip then tooltip.enteredFrame = false end
end
Tablet.Close = wrap(Tablet.Close, "Tablet:Close")
local function frame_children(self)
if not self.preventRefresh and self:GetParent() and self:GetParent():IsShown() then
Tablet.currentFrame = self
Tablet.currentTabletData = TabletData:new(self)
Tablet.currentTabletData.minWidth = self.minWidth
self:ClearLines()
if self.runChildren then
self.runChildren()
end
Tablet.currentTabletData:Display(Tablet.currentFrame)
self:Show(Tablet.currentTabletData)
Tablet.currentTabletData:del()
Tablet.currentTabletData = nil
Tablet.currentFrame = nil
end
end
frame_children = wrap(frame_children, "frame_children")
function Tablet:Open(fakeParent, parent)
self:argCheck(fakeParent, 2, "table", "string")
self:argCheck(parent, 3, "nil", "table", "string")
if not parent then
parent = fakeParent
end
local info = self.registry[parent]
if not info then
self:error("You cannot open a tablet with an unregistered parent frame.")
end
local detachedData = info.detachedData
if detachedData then
for _, detached in ipairs(detachedTooltips) do
if not detached.notInUse and detached.detachedData == detachedData then
return
end
end
end
local data = info.data
local children = info.children
if not children then
return
end
local frame = AcquireFrame(self, info, data, detachedData)
frame.clickable = info.clickable
frame.menu = info.menu
frame.runChildren = info.children
frame.minWidth = info.minWidth
if not frame.children or not frame.childrenVer or frame.childrenVer < MINOR_VERSION then
frame.childrenVer = MINOR_VERSION
frame.children = frame_children
end
frame:SetOwner(fakeParent)
frame:children()
local point = info.point
local relativePoint = info.relativePoint
if type(point) == "function" then
local b
point, b = point(fakeParent)
if b then
relativePoint = b
end
end
if type(relativePoint) == "function" then
relativePoint = relativePoint(fakeParent)
end
if not point then
point = "CENTER"
end
if not relativePoint then
relativePoint = point
end
frame:ClearAllPoints()
if type(parent) ~= "string" then
frame:SetPoint(point, fakeParent, relativePoint)
end
local offsetx = 0
local offsety = 0
frame:SetClampedToScreen(1)
frame:SetClampedToScreen(nil)
if frame:GetBottom() and frame:GetLeft() then
if frame:GetRight() > GetScreenWidth() then
offsetx = frame:GetRight() - GetScreenWidth()
elseif frame:GetLeft() < 0 then
offsetx = -frame:GetLeft()
end
local ratio = GetScreenWidth() / GetScreenHeight()
if ratio >= 2.4 and frame:GetRight() > GetScreenWidth() / 2 and frame:GetLeft() < GetScreenWidth() / 2 then
if frame:GetCenter() < GetScreenWidth() / 2 then
offsetx = frame:GetRight() - GetScreenWidth() / 2
else
offsetx = frame:GetLeft() - GetScreenWidth() / 2
end
end
if frame:GetBottom() < 0 then
offsety = frame:GetBottom()
elseif frame:GetTop() and frame:GetTop() > GetScreenHeight() then
offsety = frame:GetTop() - GetScreenHeight()
end
if MainMenuBar:IsVisible() and frame:GetBottom() < MainMenuBar:GetTop() and offsety < frame:GetBottom() - MainMenuBar:GetTop() then
offsety = frame:GetBottom() - MainMenuBar:GetTop()
end
if FuBar then
local top = 0
if FuBar then
for i = 1, FuBar:GetNumPanels() do
local panel = FuBar:GetPanel(i)
if panel:GetAttachPoint() == "BOTTOM" then
if panel.frame:GetTop() and panel.frame:GetTop() > top then
top = panel.frame:GetTop()
break
end
end
end
end
if frame:GetBottom() < top and offsety < frame:GetBottom() - top then
offsety = frame:GetBottom() - top
end
local bottom = GetScreenHeight()
if FuBar then
for i = 1, FuBar:GetNumPanels() do
local panel = FuBar:GetPanel(i)
if panel:GetAttachPoint() == "TOP" then
if panel.frame:GetBottom() and panel.frame:GetBottom() < bottom then
bottom = panel.frame:GetBottom()
break
end
end
end
end
if frame:GetTop() > bottom and offsety < frame:GetTop() - bottom then
offsety = frame:GetTop() - bottom
end
end
end
if type(fakeParent) ~= "string" then
frame:SetPoint(point, fakeParent, relativePoint, -offsetx, -offsety)
end
if detachedData and (info.cantAttach or detachedData.detached) and frame == tooltip then
detachedData.detached = false
frame:Detach()
end
if (not detachedData or not detachedData.detached) and GetMouseFocus() == fakeParent then
self.tooltip.enteredFrame = true
end
overFrame = type(fakeParent) == "table" and MouseIsOver(fakeParent) and fakeParent
end
Tablet.Open = wrap(Tablet.Open, "Tablet:Open")
function Tablet:Register(parent, ...)
self:argCheck(parent, 2, "table", "string")
if self.registry[parent] then
self:Unregister(parent)
end
local info
local k1 = ...
if type(k1) == "table" and k1[0] then
if type(self.registry[k1]) ~= "table" then
self:error("Other parent not registered")
end
info = copy(self.registry[k1])
local v1 = select(2, ...)
if type(v1) == "function" then
info.point = v1
info.relativePoint = nil
end
else
info = new(...)
end
self.registry[parent] = info
info.data = info.data or info.detachedData or new()
info.detachedData = info.detachedData or info.data
local data = info.data
local detachedData = info.detachedData
if not self.onceRegistered[parent] and type(parent) == "table" and type(parent.SetScript) == "function" and not info.dontHook then
if not Dewdrop and AceLibrary:HasInstance("Dewdrop-2.0") then
Dewdrop = AceLibrary("Dewdrop-2.0")
end
local script = parent:GetScript("OnEnter")
parent:SetScript("OnEnter", function(...)
if script then
script(...)
end
if self.registry[parent] then
if (not data or not detachedData.detached) and (Dewdrop and not Dewdrop:IsOpen(parent)) then
self:Open(parent)
end
end
end)
if parent:HasScript("OnMouseDown") then
local script = parent:GetScript("OnMouseDown")
parent:SetScript("OnMouseDown", function(...)
if script then
script(...)
end
if self.registry[parent] and self.registry[parent].tooltip and self.registry[parent].tooltip == self.tooltip then
self.tooltip:Hide()
end
end)
end
if parent:HasScript("OnMouseWheel") then
local script = parent:GetScript("OnMouseWheel")
parent:SetScript("OnMouseWheel", function(...)
if script then
script(...)
end
if self.registry[parent] and self.registry[parent].tooltip then
self.registry[parent].tooltip:Scroll(arg1 < 0)
end
end)
end
end
self.onceRegistered[parent] = true
if GetMouseFocus() == parent then
self:Open(parent)
end
end
Tablet.Register = wrap(Tablet.Register, "Tablet:Register")
function Tablet:Unregister(parent)
self:argCheck(parent, 2, "table", "string")
if not self.registry[parent] then
self:error("You cannot unregister a parent frame if it has not been registered already.")
end
self.registry[parent] = nil
end
Tablet.Unregister = wrap(Tablet.Unregister, "Tablet:Unregister")
function Tablet:IsRegistered(parent)
self:argCheck(parent, 2, "table", "string")
return self.registry[parent] and true
end
Tablet.IsRegistered = wrap(Tablet.IsRegistered, "Tablet:IsRegistered")
local _id = 0
local addedCategory
local depth = 0
local categoryPool = {}
function CleanCategoryPool(self)
for k,v in pairs(categoryPool) do
del(v)
categoryPool[k] = nil
end
_id = 0
end
CleanCategoryPool = wrap(CleanCategoryPool, "CleanCategoryPool")
function Tablet:AddCategory(...)
if not self.currentFrame then
self:error("You must add categories in within a registration.")
end
local info = new(...)
local cat = self.currentTabletData:AddCategory(info)
info = del(info)
return cat
end
Tablet.AddCategory = wrap(Tablet.AddCategory, "Tablet:AddCategory")
function Tablet:SetHint(text)
if not self.currentFrame then
self:error("You must set hint within a registration.")
end
self.currentTabletData:SetHint(text)
end
Tablet.SetHint = wrap(Tablet.SetHint, "Tablet:SetHint")
function Tablet:SetTitle(text)
if not self.currentFrame then
self:error("You must set title within a registration.")
end
self.currentTabletData:SetTitle(text)
end
Tablet.SetTitle = wrap(Tablet.SetTitle, "Tablet:SetTitle")
function Tablet:SetTitleColor(r, g, b)
if not self.currentFrame then
self:error("You must set title color within a registration.")
end
self:argCheck(r, 2, "number")
self:argCheck(g, 3, "number")
self:argCheck(b, 4, "number")
self.currentTabletData:SetTitleColor(r, g, b)
end
Tablet.SetTitleColor = wrap(Tablet.SetTitleColor, "Tablet:SetTitleColor")
function Tablet:GetNormalFontSize()
return normalSize
end
Tablet.GetNormalFontSize = wrap(Tablet.GetNormalFontSize, "Tablet:GetNormalFontSize")
function Tablet:GetHeaderFontSize()
return headerSize
end
Tablet.GetHeaderFontSize = wrap(Tablet.GetHeaderFontSize, "Tablet:GetHeaderFontSize")
function Tablet:GetNormalFontObject()
return GameTooltipText
end
Tablet.GetNormalFontObject = wrap(Tablet.GetNormalFontObject, "Tablet:GetNormalFontObject")
function Tablet:GetHeaderFontObject()
return GameTooltipHeaderText
end
Tablet.GetHeaderFontObject = wrap(Tablet.GetHeaderFontObject, "Tablet:GetHeaderFontObject")
function Tablet:SetFontSizePercent(parent, percent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
if info.tooltip then
info.tooltip:SetFontSizePercent(percent)
else
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
detachedData.fontSizePercent = percent
else
data.fontSizePercent = percent
end
end
elseif type(parent) == "table" then
parent.fontSizePercent = percent
else
self:error("You cannot change font size with an unregistered parent frame.")
end
end
Tablet.SetFontSizePercent = wrap(Tablet.SetFontSizePercent, "Tablet:SetFontSizePercent")
function Tablet:GetFontSizePercent(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
return detachedData.fontSizePercent or 1
else
return data.fontSizePercent or 1
end
elseif type(parent) == "table" then
return parent.fontSizePercent or 1
else
self:error("You cannot check font size with an unregistered parent frame.")
end
end
Tablet.GetFontSizePercent = wrap(Tablet.GetFontSizePercent, "Tablet:GetFontSizePercent")
function Tablet:SetTransparency(parent, percent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
if info.tooltip then
info.tooltip:SetTransparency(percent)
else
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
detachedData.transparency = percent
elseif data then
data.transparency = percent
end
end
elseif type(parent) == "table" then
parent.transparency = percent
else
self:error("You cannot change transparency with an unregistered parent frame.")
end
end
Tablet.SetTransparency = wrap(Tablet.SetTransparency, "Tablet:SetTransparency")
function Tablet:GetTransparency(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
return detachedData.transparency or 0.75
else
return data.transparency or 0.75
end
elseif type(parent) == "table" then
return parent.transparency or 0.75
else
self:error("You cannot get transparency with an unregistered parent frame.")
end
end
Tablet.GetTransparency = wrap(Tablet.GetTransparency, "Tablet:GetTransparency")
function Tablet:SetColor(parent, r, g, b)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
if info.tooltip then
info.tooltip:SetColor(r, g, b)
else
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
detachedData.r = r
detachedData.g = g
detachedData.b = b
else
data.r = r
data.g = g
data.b = b
end
end
elseif type(parent) == "table" then
parent.r = r
parent.g = g
parent.b = b
else
self:error("You cannot change color with an unregistered parent frame.")
end
end
Tablet.SetColor = wrap(Tablet.SetColor, "Tablet:SetColor")
function Tablet:GetColor(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if info then
local data = info.data
local detachedData = info.detachedData
if detachedData.detached then
return detachedData.r or 0, detachedData.g or 0, detachedData.b or 0
else
return data.r or 0, data.g or 0, data.b or 0
end
elseif type(parent) == "table" then
return parent.r or 0, parent.g or 0, parent.b or 0
else
self:error("You must provide a registered parent frame to check color")
end
end
Tablet.GetColor = wrap(Tablet.GetColor, "Tablet:GetColor")
function Tablet:Detach(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot detach tablet with an unregistered parent frame.")
end
if not info.detachedData then
self:error("You cannot detach tablet without a data field.")
end
if info.tooltip and info.tooltip == tooltip and tooltip.registration then
tooltip:Detach()
else
info.detachedData.detached = true
local detached = AcquireDetachedFrame(self, info, info.data, info.detachedData)
detached.menu = info.menu
detached.runChildren = info.children
detached.minWidth = info.minWidth
if not detached.children or not detached.childrenVer or detached.childrenVer < MINOR_VERSION then
detached.childrenVer = MINOR_VERSION
detached.children = frame_children
end
detached:SetOwner(parent)
detached:children()
end
end
Tablet.Detach = wrap(Tablet.Detach, "Tablet:Detach")
function Tablet:Attach(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot detach tablet with an unregistered parent frame.")
end
if not info.detachedData then
self:error("You cannot attach tablet without a data field.")
end
if info.tooltip and info.tooltip ~= tooltip then
info.tooltip:Attach()
else
info.detachedData.detached = false
end
end
Tablet.Attach = wrap(Tablet.Attach, "Tablet:Attach")
function Tablet:IsAttached(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot check tablet with an unregistered parent frame.")
end
return not info.detachedData or not info.detachedData.detached
end
Tablet.IsAttached = wrap(Tablet.IsAttached, "Tablet:IsAttached")
function Tablet:Refresh(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot refresh tablet with an unregistered parent frame.")
end
local tt = info.tooltip
if tt and not tt.preventRefresh and tt:IsShown() then
tt.updating = true
tt:children()
tt.updating = false
end
end
Tablet.Refresh = wrap(Tablet.Refresh, "Tablet:Refresh")
function Tablet:IsLocked(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot check tablet with an unregistered parent frame.")
end
return info.detachedData and info.detachedData.locked
end
Tablet.IsLocked = wrap(Tablet.IsLocked, "Tablet:IsLocked")
function Tablet:ToggleLocked(parent)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot lock tablet with an unregistered parent frame.")
end
if info.tooltip and info.tooltip ~= tooltip then
info.tooltip:Lock()
elseif info.detachedData then
info.detachedData.locked = info.detachedData.locked
end
end
Tablet.ToggleLocked = wrap(Tablet.ToggleLocked, "Tablet:ToggleLocked")
function Tablet:UpdateDetachedData(parent, detachedData)
self:argCheck(parent, 2, "table", "string")
local info = self.registry[parent]
if not info then
self:error("You cannot update tablet with an unregistered parent frame.")
end
self:argCheck(detachedData, 3, "table")
if info.data == info.detachedData then
info.data = detachedData
end
info.detachedData = detachedData
if info.detachedData.detached then
self:Detach(parent)
elseif info.tooltip and info.tooltip.owner then
self:Attach(parent)
end
end
Tablet.UpdateDetachedData = wrap(Tablet.UpdateDetachedData, "Tablet:UpdateDetachedData")
if DEBUG then
function Tablet:ListProfileInfo()
local duration, times, memories = GetProfileInfo()
if not duration or not time or not memories then
self:error("Problems")
end
local t = new()
for method in pairs(memories) do
t[#t+1] = method
end
table.sort(t, function(alpha, bravo)
if memories[alpha] ~= memories[bravo] then
return memories[alpha] < memories[bravo]
elseif times[alpha] ~= times[bravo] then
return times[alpha] < times[bravo]
else
return alpha < bravo
end
end)
local memory = 0
local time = 0
for _,method in ipairs(t) do
DEFAULT_CHAT_FRAME:AddMessage(format("%s || %.3f s || %.3f%% || %d KiB", method, times[method], times[method] / duration * 100, memories[method]))
memory = memory + memories[method]
time = time + times[method]
end
DEFAULT_CHAT_FRAME:AddMessage(format("%s || %.3f s || %.3f%% || %d KiB", "Total", time, time / duration * 100, memory))
del(t)
end
SLASH_TABLET1 = "/tablet"
SLASH_TABLET2 = "/tabletlib"
SlashCmdList["TABLET"] = function(msg)
AceLibrary(MAJOR_VERSION):ListProfileInfo()
end
end
local function activate(self, oldLib, oldDeactivate)
Tablet = self
if oldLib then
self.registry = oldLib.registry
self.onceRegistered = oldLib.onceRegistered
self.tooltip = oldLib.tooltip
self.currentFrame = oldLib.currentFrame
self.currentTabletData = oldLib.currentTabletData
else
self.registry = {}
self.onceRegistered = {}
end
tooltip = self.tooltip
if oldDeactivate then
oldDeactivate(oldLib)
end
end
local function deactivate(self)
StopCheckingAlt()
end
AceLibrary:Register(Tablet, MAJOR_VERSION, MINOR_VERSION, activate, deactivate)
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Jugner_Forest/npcs/Pure_Heart_IM.lua | 30 | 3050 | -----------------------------------
-- Area: Jugner Forest
-- NPC: Pure Heart, I.M.
-- Type: Border Conquest Guards
-- @pos 570.732 -2.637 553.508 104
-----------------------------------
package.loaded["scripts/zones/Jugner_Forest/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Jugner_Forest/TextIDs");
local guardnation = BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = NORVALLEN;
local csid = 0x7ff8;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
Phrohdoh/OpenRA | mods/d2k/maps/harkonnen-01a/harkonnen01a.lua | 8 | 5015 | --[[
Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
AtreidesReinforcements =
{
easy =
{
{ "light_inf", "light_inf" }
},
normal =
{
{ "light_inf", "light_inf" },
{ "light_inf", "light_inf", "light_inf" },
{ "light_inf", "trike" }
},
hard =
{
{ "light_inf", "light_inf" },
{ "trike", "trike" },
{ "light_inf", "light_inf", "light_inf" },
{ "light_inf", "trike" },
{ "trike", "trike" }
}
}
AtreidesEntryWaypoints = { AtreidesWaypoint1.Location, AtreidesWaypoint2.Location, AtreidesWaypoint3.Location, AtreidesWaypoint4.Location }
AtreidesAttackDelay = DateTime.Seconds(30)
AtreidesAttackWaves =
{
easy = 1,
normal = 5,
hard = 12
}
ToHarvest =
{
easy = 2500,
normal = 3000,
hard = 3500
}
HarkonnenReinforcements = { "light_inf", "light_inf", "light_inf", "trike" }
HarkonnenEntryPath = { HarkonnenWaypoint.Location, HarkonnenRally.Location }
Messages =
{
"Build a concrete foundation before placing your buildings.",
"Build a Wind Trap for power.",
"Build a Refinery to collect Spice.",
"Build a Silo to store additional Spice."
}
Tick = function()
if AtreidesArrived and atreides.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillAtreides)
end
if player.Resources > SpiceToHarvest - 1 then
player.MarkCompletedObjective(GatherSpice)
end
-- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false
Media.DisplayMessage(Messages[2], "Mentat")
else
HasPower = true
end
-- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat")
end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat")
end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color)
end
WorldLoaded = function()
player = Player.GetPlayer("Harkonnen")
atreides = Player.GetPlayer("Atreides")
SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.")
KillAtreides = player.AddSecondaryObjective("Eliminate all Atreides units and reinforcements\nin the area.")
local checkResourceCapacity = function()
Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat")
Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides)
end)
return true
end
end)
end
Trigger.OnRemovedFromWorld(HarkonnenConyard, function()
-- Mission already failed, no need to check the other conditions as well
if checkResourceCapacity() then
return
end
local refs = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "refinery" and actor.Owner == player end)
if #refs == 0 then
atreides.MarkCompletedObjective(KillHarkonnen)
else
Trigger.OnAllRemovedFromWorld(refs, function()
atreides.MarkCompletedObjective(KillHarkonnen)
end)
local silos = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "silo" and actor.Owner == player end)
Utils.Do(refs, function(actor) Trigger.OnRemovedFromWorld(actor, checkResourceCapacity) end)
Utils.Do(silos, function(actor) Trigger.OnRemovedFromWorld(actor, checkResourceCapacity) end)
end
end)
Media.DisplayMessage(Messages[1], "Mentat")
Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce")
Reinforcements.Reinforce(player, HarkonnenReinforcements, HarkonnenEntryPath)
end)
WavesLeft = AtreidesAttackWaves[Difficulty]
SendReinforcements()
end
SendReinforcements = function()
local units = AtreidesReinforcements[Difficulty]
local delay = Utils.RandomInteger(AtreidesAttackDelay - DateTime.Seconds(2), AtreidesAttackDelay)
AtreidesAttackDelay = AtreidesAttackDelay - (#units * 3 - 3 - WavesLeft) * DateTime.Seconds(1)
if AtreidesAttackDelay < 0 then AtreidesAttackDelay = 0 end
Trigger.AfterDelay(delay, function()
Reinforcements.Reinforce(atreides, Utils.Random(units), { Utils.Random(AtreidesEntryWaypoints) }, 10, IdleHunt)
WavesLeft = WavesLeft - 1
if WavesLeft == 0 then
Trigger.AfterDelay(DateTime.Seconds(1), function() AtreidesArrived = true end)
else
SendReinforcements()
end
end)
end
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Mhaura/npcs/Emyr.lua | 19 | 1051 | -----------------------------------
-- Area: Mhaura
-- NPC: Emyr
-- Type: Standard NPC
-- @pos 45.021 -9 37.095 249
-----------------------------------
package.loaded["scripts/zones/Mhaura/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Mhaura/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getZPos() >= 39) then
player:startEvent(0x00E4);
else
player:startEvent(0x00DF);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Cloister_of_Tides/mobs/Leviathan_Prime.lua | 16 | 1908 | -----------------------------------
-- Area: Cloister of Tides
-- NPC: Leviathan Prime
-- Involved in Quest: Trial by Water, Trial Size Trial by Water
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
-----------------------------------
-- OnMobFight Action
-----------------------------------
function onMobFight(mob, target)
local mobId = mob:getID();
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID()==611 and GetMobAction(mobId) == ACTION_ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
local hpPercent = math.floor(mob:getHP() / mob:getMaxHP() * 100);
if ((astralFlows==0 and hpPercent <= 80) or
(astralFlows==1 and hpPercent <= 60) or
(astralFlows==2 and hpPercent <= 40) or
(astralFlows==3 and hpPercent <= 20) or
(astralFlows==4 and hpPercent <= 1)) then
mob:useMobAbility(610);
astralFlows = astralFlows + 1;
mob:setLocalVar("astralflows",astralFlows);
if (astralFlows>=5) then
mob:setUnkillable(false);
end
end
end
end;
-----------------------------------
-- OnMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID()==611) then
mob:setLocalVar("astralflows","0");
mob:setUnkillable(true);
end
end;
-----------------------------------
-- OnMobDeath Action
-----------------------------------
function onMobDeath(mob, killer)
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Nashmau/npcs/Yoyoroon.lua | 34 | 1613 | -----------------------------------
-- Area: Nashmau
-- NPC: Yoyoroon
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Nashmau/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Nashmau/TextIDs");
require("scripts/globals/shop");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,YOYOROON_SHOP_DIALOG);
stock = {0x08BF,4940, -- Tension Spring
0x08C0,9925, -- Inhibitor
0x08C2,9925, -- Mana Booster
0x08C3,4940, -- Loudspeaker
0x08C6,4940, -- Accelerator
0x08C7,9925, -- Scope
0x08CA,9925, -- Shock Absorber
0x08CB,4940, -- Armor Plate
0x08CE,4940, -- Stabilizer
0x08CF,9925, -- Volt Gun
0x08D2,4940, -- Mana Jammer
0x08D4,9925, -- Stealth Screen
0x08D6,4940, -- Auto-Repair Kit
0x08D8,9925, -- Damage Gauge
0x08DA,4940, -- Mana Tank
0x08DC,9925} -- Mana Conserver
showShop(player, STATIC, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
vilarion/Illarion-Content | craft/final/magicgemming.lua | 3 | 1724 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local crafts = require("craft.base.crafts")
local gems = require("base.gems")
local M = {}
local magicgemming = crafts.Craft:new{
craftEN = "Magic Blacksmith",
craftDE = "Magieschmied",
npcCraft = true,
lookAtFilter = gems.lookAtFilter,
}
local categoryId = {}
categoryId[gems.EMERALD] = magicgemming:addCategory("Emerald", "Smaragd")
categoryId[gems.RUBY] = magicgemming:addCategory("Ruby", "Rubin")
categoryId[gems.OBSIDIAN] = magicgemming:addCategory("Obsidian", "Obsidian")
categoryId[gems.SAPPHIRE] = magicgemming:addCategory("Sapphire", "Saphir")
categoryId[gems.AMETHYST] = magicgemming:addCategory("Amethyst", "Amethyst")
categoryId[gems.TOPAZ] = magicgemming:addCategory("Topaz", "Topas")
for gem = 1, 7 do
local catId = categoryId[gem]
if catId then
for level = 2, 10 do
local product = magicgemming:addProduct(catId, gems.gemItemId[gem], 1, {gemLevel = level})
product:addIngredient(gems.gemItemId[gem], 3, {gemLevel = level - 1})
end
end
end
M.magicgemming = magicgemming
return M
| agpl-3.0 |
vilarion/Illarion-Content | monster/race_76_green_skeleton/id_764_mysticswamphorror.lua | 3 | 1303 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local mageBehaviour = require("monster.base.behaviour.mage")
local monstermagic = require("monster.base.monstermagic")
local greenskeleton = require("monster.race_76_green_skeleton.base")
local magic = monstermagic()
magic.addWarping{probability = 0.15, usage = magic.ONLY_NEAR_ENEMY}
magic.addPoisonball{probability = 0.06, damage = {from = 750, to = 1500}}
magic.addPoisonball{ probability = 0.025, damage = {from = 750, to = 1500}}
magic.addPoisonball{probability = 0.005, damage = {from = 375, to = 875}, targetCount = 4}
local M = greenskeleton.generateCallbacks()
M = magic.addCallbacks(M)
return mageBehaviour.addCallbacks(magic, M) | agpl-3.0 |
klausklapper/love2dgame | lib/hump/camera.lua | 20 | 6067 | --[[
Copyright (c) 2010-2015 Matthias Richter
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.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization.
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 _PATH = (...):match('^(.*[%./])[^%.%/]+$') or ''
local cos, sin = math.cos, math.sin
local camera = {}
camera.__index = camera
-- Movement interpolators (for camera locking/windowing)
camera.smooth = {}
function camera.smooth.none()
return function(dx,dy) return dx,dy end
end
function camera.smooth.linear(speed)
assert(type(speed) == "number", "Invalid parameter: speed = "..tostring(speed))
return function(dx,dy, s)
-- normalize direction
local d = math.sqrt(dx*dx+dy*dy)
local dts = math.min((s or speed) * love.timer.getDelta(), d) -- prevent overshooting the goal
if d > 0 then
dx,dy = dx/d, dy/d
end
return dx*dts, dy*dts
end
end
function camera.smooth.damped(stiffness)
assert(type(stiffness) == "number", "Invalid parameter: stiffness = "..tostring(stiffness))
return function(dx,dy, s)
local dts = love.timer.getDelta() * (s or stiffness)
return dx*dts, dy*dts
end
end
local function new(x,y, zoom, rot, smoother)
x,y = x or love.graphics.getWidth()/2, y or love.graphics.getHeight()/2
zoom = zoom or 1
rot = rot or 0
smoother = smoother or camera.smooth.none() -- for locking, see below
return setmetatable({x = x, y = y, scale = zoom, rot = rot, smoother = smoother}, camera)
end
function camera:lookAt(x,y)
self.x, self.y = x, y
return self
end
function camera:move(dx,dy)
self.x, self.y = self.x + dx, self.y + dy
return self
end
function camera:position()
return self.x, self.y
end
function camera:rotate(phi)
self.rot = self.rot + phi
return self
end
function camera:rotateTo(phi)
self.rot = phi
return self
end
function camera:zoom(mul)
self.scale = self.scale * mul
return self
end
function camera:zoomTo(zoom)
self.scale = zoom
return self
end
function camera:attach(x,y,w,h, noclip)
x,y = x or 0, y or 0
w,h = w or love.graphics.getWidth(), h or love.graphics.getHeight()
self._sx,self._sy,self._sw,self._sh = love.graphics.getScissor()
if not noclip then
love.graphics.setScissor(x,y,w,h)
end
local cx,cy = x+w/2, y+h/2
love.graphics.push()
love.graphics.translate(cx, cy)
love.graphics.scale(self.scale)
love.graphics.rotate(self.rot)
love.graphics.translate(-self.x, -self.y)
end
function camera:detach()
love.graphics.pop()
love.graphics.setScissor(self._sx,self._sy,self._sw,self._sh)
end
function camera:draw(...)
local x,y,w,h,noclip,func
local nargs = select("#", ...)
if nargs == 1 then
func = ...
elseif nargs == 5 then
x,y,w,h,func = ...
elseif nargs == 6 then
x,y,w,h,noclip,func = ...
else
error("Invalid arguments to camera:draw()")
end
self:attach(x,y,w,h,noclip)
func()
self:detach()
end
-- world coordinates to camera coordinates
function camera:cameraCoords(x,y, ox,oy,w,h)
ox, oy = ox or 0, oy or 0
w,h = w or love.graphics.getWidth(), h or love.graphics.getHeight()
-- x,y = ((x,y) - (self.x, self.y)):rotated(self.rot) * self.scale + center
local c,s = cos(self.rot), sin(self.rot)
x,y = x - self.x, y - self.y
x,y = c*x - s*y, s*x + c*y
return x*self.scale + w/2 + ox, y*self.scale + h/2 + oy
end
-- camera coordinates to world coordinates
function camera:worldCoords(x,y, ox,oy,w,h)
ox, oy = ox or 0, oy or 0
w,h = w or love.graphics.getWidth(), h or love.graphics.getHeight()
-- x,y = (((x,y) - center) / self.scale):rotated(-self.rot) + (self.x,self.y)
local c,s = cos(-self.rot), sin(-self.rot)
x,y = (x - w/2 - ox) / self.scale, (y - h/2 - oy) / self.scale
x,y = c*x - s*y, s*x + c*y
return x+self.x, y+self.y
end
function camera:mousePosition(ox,oy,w,h)
local mx,my = love.mouse.getPosition()
return self:worldCoords(mx,my, ox,oy,w,h)
end
-- camera scrolling utilities
function camera:lockX(x, smoother, ...)
local dx, dy = (smoother or self.smoother)(x - self.x, self.y, ...)
self.x = self.x + dx
return self
end
function camera:lockY(y, smoother, ...)
local dx, dy = (smoother or self.smoother)(self.x, y - self.y, ...)
self.y = self.y + dy
return self
end
function camera:lockPosition(x,y, smoother, ...)
return self:move((smoother or self.smoother)(x - self.x, y - self.y, ...))
end
function camera:lockWindow(x, y, x_min, x_max, y_min, y_max, smoother, ...)
-- figure out displacement in camera coordinates
x,y = self:cameraCoords(x,y)
local dx, dy = 0,0
if x < x_min then
dx = x - x_min
elseif x > x_max then
dx = x - x_max
end
if y < y_min then
dy = y - y_min
elseif y > y_max then
dy = y - y_max
end
-- transform displacement to movement in world coordinates
local c,s = cos(-self.rot), sin(-self.rot)
dx,dy = (c*dx - s*dy) / self.scale, (s*dx + c*dy) / self.scale
-- move
self:move((smoother or self.smoother)(dx,dy,...))
end
-- the module
return setmetatable({new = new, smooth = camera.smooth},
{__call = function(_, ...) return new(...) end})
| gpl-3.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[race]/race/racemap.lua | 1 | 8529 | g_MapObjAttrs = {
spawnpoint = { 'position', 'rotation', 'vehicle', 'paintjob', 'upgrades', 'team' },
checkpoint = { 'id', 'nextid', 'position', 'size', 'color', 'type', 'vehicle', 'paintjob', 'upgrades', 'nts' },
object = { 'position', 'rotation', 'model' },
pickup = { 'position', 'type', 'vehicle', 'paintjob', 'upgrades', 'respawn' }
}
g_MapSettingNames = table.create(
{'time', 'weather', 'respawn', 'respawntime', 'duration', 'skins', 'bikehats', 'bikehatchance', 'carhats', 'carhatchance',
'hairstyles', 'glasses', 'glasseschance', 'shirts', 'trousers', 'shoes',
'ghostmode', 'vehicleweapons', 'autopimp', 'firewater', 'classicchangez', 'hunterminigun'},
true
)
-----------------------------
-- Shared
RaceMap = {}
RaceElementMap = {}
function RaceMap:__index(k)
if RaceMap[k] then
return RaceMap[k]
end
local result = xmlNodeGetAttribute(self.xml, k)
if result then
result = RaceMapObject:parseValue(result)
self[k] = result
return result
end
result = xmlFindChild(self.xml, k, 0)
if result then
result = self:createRaceMapObject(result, k)
self[k] = result
return result
end
end
function RaceMap.load(res)
--Check if there are any .<map/>'s by using the real element system first
local resourceRoot = getResourceRootElement(res)
if #getElementsByType("spawnpoint",resourceRoot) > 0 then
--Spawnpoints are contained within the MTA map, therefore lets assume only MTA maps were used (removes general.ModifyOtherObjects dependency)
local meta = xmlLoadFile(':' .. getResourceName(res) .. '/' .. 'meta.xml')
if not meta then
outputDebugString('Error while loading ' .. getResourceName(res) .. ': no meta.xml', 2)
return false
end
local infoNode = xmlFindChild(meta, 'info', 0)
local info = infoNode and xmlNodeGetAttributes ( infoNode ) or {}
local filename = xmlNodeGetAttribute(xmlFindChild(meta, 'map', 0), 'src')
local mapNode = xmlLoadFile(':' .. getResourceName(res) .. '/' .. filename)
local def = xmlNodeGetAttribute(mapNode,"edf:definitions")
xmlUnloadFile(meta)
xmlUnloadFile(mapNode)
local map = setmetatable({ res = res, resname = getResourceName(res), mod = "map", info = info, def = def }, RaceElementMap)
return map
end
local meta = xmlLoadFile(':' .. getResourceName(res) .. '/' .. 'meta.xml')
if not meta then
outputDebugString('Error while loading ' .. getResourceName(res) .. ': no meta.xml', 2)
return false
end
local infoNode = xmlFindChild(meta, 'info', 0)
local info = infoNode and xmlNodeGetAttributes ( infoNode ) or {}
local racenode = xmlFindChild(meta, 'race', 0)
local file = racenode and xmlNodeGetAttribute(racenode, 'src')
xmlUnloadFile(meta)
if not file then
outputDebugString('Error while loading ' .. getResourceName(res) .. ': no <race /> node in meta.xml', 2)
return false
end
local xml = xmlLoadFile(':' .. getResourceName(res) .. '/' .. file)
if not xml then
outputDebugString('Error opening ' .. file, 2)
return false
end
local map = setmetatable({ res = res, resname = getResourceName(res), file = file, xml = xml, info = info }, RaceMap)
if map:isRaceFormat() then
setmetatable(map, RaceRaceMap)
elseif map:isDMFormat() then
setmetatable(map, DMRaceMap)
end
return map
end
function RaceMap:isRaceFormat()
return self.mod == 'race'
end
function RaceMap:isDMFormat()
return self.mod == 'deathmatch'
end
function RaceMap:getAll(name, ...)
local i = 0
local result = {}
local node = xmlFindChild(self.xml, name, 0)
local attrs = g_MapObjAttrs[name] or { ... }
local obj
local id
while node do
i = i + 1
obj = self:createRaceMapObject(node, name)
result[i] = {}
result[i].id = obj.id or i
for _,attr in ipairs(attrs) do
result[i][attr] = obj[attr]
end
node = xmlFindChild(self.xml, name, i)
end
return result
end
function RaceMap:createRaceMapObject(node, objtype)
return setmetatable({ map = self, node = node, objtype = objtype }, RaceMapObject)
end
RaceMapObject = {}
function RaceMapObject:__index(k)
if RaceMapObject[k] then
return RaceMapObject[k]
end
local val = xmlNodeGetAttribute(self.node, k)
if val then
self[k] = self:parseValue(val)
return self[k]
end
val = xmlFindChild(self.node, k, 0)
if val then
self[k] = self:parseValue(xmlNodeGetValue(val))
return self[k]
end
end
function RaceMapObject:parseValue(val)
val = table.maptry(val:split(' '), tonumber) or val
if type(val) == 'table' and #val == 1 then
val = val[1]
end
return val
end
function RaceMap:save()
xmlSaveFile(self.xml)
end
function RaceMap:unload()
if self.xml then
xmlUnloadFile(self.xml)
self.xml = nil
end
end
-----------------------------
-- Race specific
RaceRaceMap = setmetatable({}, RaceMap)
function RaceRaceMap:__index(k)
local result = rawget(RaceRaceMap, k) or getmetatable(RaceRaceMap).__index(self, k)
if result or k == 'options' then
return result
end
if g_MapSettingNames[k] then
local result = get(self.resname .. '.' .. k)
if result then
return result
end
end
return self.options and self.options[k]
end
function RaceRaceMap:createRaceMapObject(node, objtype)
return setmetatable({ map = self, node = node, objtype = objtype }, RaceRaceMapObject)
end
RaceRaceMapObject = setmetatable({}, RaceMapObject)
function RaceRaceMapObject:__index(k)
local result = rawget(RaceRaceMapObject, k) or getmetatable(RaceRaceMapObject).__index(self, k)
if self.objtype == 'object' and k == 'rotation' then
table.map(result, math.deg)
local temp = result[1]
result[1] = result[3]
result[3] = temp
elseif self.objtype == 'checkpoint' and k == 'type' and result == 'corona' then
result = 'ring'
end
return result
end
function RaceRaceMapObject:parseValue(val)
if type(val) ~= 'string' then
return val
end
if #val == 0 then
return false
end
val = table.maptry(val:split(' '), tonumber) or val
if type(val) == 'table' and #val == 1 then
val = val[1]
end
return val
end
-----------------------------
-- Deathmatch specific (DP2)
DMRaceMap = setmetatable({}, RaceMap)
function DMRaceMap:__index(k)
if g_MapSettingNames[k] then
local result = get(self.resname .. '.' .. k)
return result and DMRaceMapObject:parseValue(result)
end
return rawget(DMRaceMap, k) or getmetatable(DMRaceMap).__index(self, k)
end
function DMRaceMap:createRaceMapObject(node, objtype)
return setmetatable({ map = self, node = node, objtype = objtype }, DMRaceMapObject)
end
DMRaceMapObject = setmetatable({}, RaceMapObject)
function DMRaceMapObject:__index(k)
local result = rawget(DMRaceMapObject, k) or getmetatable(DMRaceMapObject).__index(self, k)
if result then
return result
end
if k == 'position' then
return table.maptry({ self.posX, self.posY, self.posZ }, tonumber)
elseif k == 'rotation' then
return table.maptry({ self.rotX, self.rotY, self.rotZ }, tonumber)
end
end
function DMRaceMapObject:parseValue(val)
if type(val) ~= 'string' then
return val
end
if #val == 0 then
return false
end
local r, g, b = getColorFromString(val)
if r then
return { r, g, b }
end
val = table.maptry(val:split(','), tonumber) or val
if type(val) == 'table' and #val == 1 then
val = val[1]
end
return val
end
-----------------------------
-- Element Map specific (1.0)
function RaceElementMap:__index(k)
if RaceElementMap[k] then
return RaceElementMap[k]
end
if g_MapSettingNames[k] then
return get(self.resname .. '.' .. k)
end
return get(k)
end
function RaceElementMap:isDMFormat()
return true
end
function RaceElementMap:isRaceFormat()
return false
end
function RaceElementMap:getAll(name, type)
local result = {}
-- Block out specific stuff
if name == "object" then
return {}
elseif name == "pickup" then
return self:getAll("racepickup",name)
end
local resourceRoot = getResourceRootElement(self.res)
for i,element in ipairs(getElementsByType(name, resourceRoot)) do
result[i] = {}
result[i].id = getElementID(element) or i
attrs = g_MapObjAttrs[type or name]
for _,attr in ipairs(attrs) do
local val = getElementData(element, attr)
if attr == "rotation" then
val = val or getElementData(element, "rotZ")
elseif attr == "position" then
val = val or { tonumber(getElementData(element, "posX")), tonumber(getElementData(element, "posY")), tonumber(getElementData(element, "posZ")) }
elseif val then
val = DMRaceMapObject.parseValue(result[i], val)
end
if val == "" then
val = nil
end
result[i][attr] = val
end
end
return result
end
function RaceElementMap:unload()
return false
end
| mit |
bungle/lua-resty-xxhash | lib/resty/xxhash.lua | 3 | 2600 | local ffi = require "ffi"
local ffi_gc = ffi.gc
local ffi_cdef = ffi.cdef
local ffi_load = ffi.load
local tonumber = tonumber
local setmetatable = setmetatable
ffi_cdef[[
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
typedef struct { long long ll[ 6]; } XXH32_state_t;
typedef struct { long long ll[11]; } XXH64_state_t;
unsigned int XXH32 (const void* input, size_t length, unsigned seed);
unsigned long long XXH64 (const void* input, size_t length, unsigned long long seed);
XXH32_state_t* XXH32_createState(void);
XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
XXH64_state_t* XXH64_createState(void);
XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned seed);
XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
unsigned int XXH32_digest (const XXH32_state_t* statePtr);
XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed);
XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
unsigned long long XXH64_digest (const XXH64_state_t* statePtr);
]]
local lib = ffi_load "xxhash"
local xxh32 = {}
xxh32.__index = xxh32
function xxh32:reset(seed)
return lib.XXH32_reset(self.context, seed or 0) == 0 and self or nil
end
function xxh32:update(input)
return lib.XXH32_update(self.context, input, #input) == 0 and self or nil
end
function xxh32:digest()
return lib.XXH32_digest(self.context)
end
local xxh64 = {}
xxh64.__index = xxh64
function xxh64:reset(seed)
return lib.XXH64_reset(self.context, seed or 0) == 0 and self or nil
end
function xxh64:update(input)
return lib.XXH64_update(self.context, input, #input) == 0 and self or nil
end
function xxh64:digest()
return tonumber(lib.XXH64_digest(self.context))
end
local xxhash = {}
function xxhash.new(seed, bits)
local self = bits == 64 and setmetatable({ context = ffi_gc(lib.XXH64_createState(), lib.XXH64_freeState) }, xxh64)
or setmetatable({ context = ffi_gc(lib.XXH32_createState(), lib.XXH32_freeState) }, xxh32)
return self:reset(seed) and self or nil
end
function xxhash.hash32(input, seed)
return lib.XXH32(input, #input, seed or 0)
end
function xxhash.hash64(input, seed)
return tonumber(lib.XXH64(input, #input, seed or 0))
end
local mt = {}
function mt:__call(input, seed, bits)
return bits == 64 and xxhash.hash64(input, seed) or xxhash.hash32(input, seed)
end
return setmetatable(xxhash, mt) | bsd-2-clause |
Quenty/NevermoreEngine | src/idleservice/src/Client/IdleServiceClient.lua | 1 | 6033 | --[=[
Helps track whether or not a player is idle and if so, then can show UI or other cute things.
@client
@class IdleServiceClient
]=]
local require = require(script.Parent.loader).load(script)
local RunService = game:GetService("RunService")
local VRService = game:GetService("VRService")
local Maid = require("Maid")
local RagdollBindersClient = require("RagdollBindersClient")
local Rx = require("Rx")
local RxValueBaseUtils = require("RxValueBaseUtils")
local StateStack = require("StateStack")
local ValueObject = require("ValueObject")
local IdleServiceClient = {}
IdleServiceClient.ServiceName = "IdleServiceClient"
local STANDING_TIME_REQUIRED = 0.5
local MOVE_DISTANCE_REQUIRED = 2.5
--[=[
Initializes the idle service on the client. Should be done via [ServiceBag].
@param serviceBag ServiceBag
]=]
function IdleServiceClient:Init(serviceBag)
assert(not self._maid, "Already initialized")
self._maid = Maid.new()
self._serviceBag = assert(serviceBag, "No serviceBag")
-- External
self._serviceBag:GetService(require("RagdollServiceClient"))
self._humanoidTracker = self._serviceBag:GetService(require("HumanoidTrackerService")):GetHumanoidTracker()
self._ragdollBindersClient = self._serviceBag:GetService(RagdollBindersClient)
-- Configure
self._disableStack = StateStack.new(false)
self._maid:GiveTask(self._disableStack)
self._enabled = Instance.new("BoolValue")
self._enabled.Value = true
self._maid:GiveTask(self._enabled)
self._showIdleUI = Instance.new("BoolValue")
self._showIdleUI.Value = false
self._maid:GiveTask(self._showIdleUI)
self._humanoidIdle = Instance.new("BoolValue")
self._humanoidIdle.Value = false
self._maid:GiveTask(self._humanoidIdle)
self._lastPosition = ValueObject.new(nil)
self._maid:GiveTask(self._lastPosition)
end
--[=[
Starts idle service on the client. Should be done via [ServiceBag].
]=]
function IdleServiceClient:Start()
self._maid:GiveTask(self._humanoidIdle.Changed:Connect(function()
self:_updateShowIdleUI()
end))
self._maid:GiveTask(self._enabled.Changed:Connect(function()
self:_updateShowIdleUI()
end))
self._maid:GiveTask(self._humanoidTracker.AliveHumanoid.Changed:Connect(function(...)
self:_handleAliveHumanoidChanged(...)
end))
self._maid:GiveTask(self._disableStack.Changed:Connect(function()
self._enabled.Value = not self._disableStack:GetState()
end))
if self._humanoidTracker.AliveHumanoid.Value then
self:_handleAliveHumanoidChanged()
end
self:_updateShowIdleUI()
end
--[=[
Observes a humanoid moving from the current position after a set amount of time. Can be used
to close a UI when the humanoid wanders too far.
@return Observable
]=]
function IdleServiceClient:ObserveHumanoidMoveFromCurrentPosition(minimumTimeVisible: number)
assert(type(minimumTimeVisible) == "number", "Bad minimumTimeVisible")
return Rx.of(true):Pipe({
Rx.delay(minimumTimeVisible);
Rx.flatMap(function()
return self._lastPosition:Observe();
end);
Rx.where(function(value)
return value ~= nil
end);
Rx.first();
Rx.flatMap(function(initialPosition)
return self._lastPosition:Observe():Pipe({
Rx.where(function(position)
return position == nil or (initialPosition - position).magnitude >= MOVE_DISTANCE_REQUIRED
end)
})
end);
Rx.first();
})
end
--[=[
Returns whether the humanoid is idle.
@return boolean
]=]
function IdleServiceClient:IsHumanoidIdle()
return self._humanoidIdle.Value
end
--[=[
Returns whether the humanoid is idle.
@return boolean
]=]
function IdleServiceClient:IsMoving()
return not self._humanoidIdle.Value
end
--[=[
observes if the humanoid is idle.
@return Observable<boolean>
]=]
function IdleServiceClient:ObserveHumanoidIdle()
return RxValueBaseUtils.observeValue(self._humanoidIdle)
end
--[=[
Returns whether UI should be shown (if the humanoid is idle)
@return boolean
]=]
function IdleServiceClient:DoShowIdleUI()
return self._showIdleUI.Value
end
--[=[
Observes whether to show the the idle UI
@return Observable<boolean>
]=]
function IdleServiceClient:ObserveShowIdleUI()
return RxValueBaseUtils.observeValue(self._showIdleUI)
end
--[=[
Returns a show idle bool value.
@return BoolValue
]=]
function IdleServiceClient:GetShowIdleUIBoolValue()
assert(self._showIdleUI, "Not initialized")
return self._showIdleUI
end
--[=[
Pushes a disabling function that disables idle UI
@return boolean
]=]
function IdleServiceClient:PushDisable()
if not RunService:IsRunning() then
return function() end
end
assert(self._disableStack, "Not initialized")
return self._disableStack:PushState(true)
end
function IdleServiceClient:_setEnabled(enabled)
assert(type(enabled) == "boolean", "Bad enabled")
self._enabled.Value = enabled
end
function IdleServiceClient:_updateShowIdleUI()
self._showIdleUI.Value = self._humanoidIdle.Value and self._enabled.Value and not VRService.VREnabled
end
function IdleServiceClient:_handleAliveHumanoidChanged()
local humanoid = self._humanoidTracker.AliveHumanoid.Value
if not humanoid then
self._maid._humanoidMaid = nil
return
end
local maid = Maid.new()
local lastMove = os.clock()
maid:GiveTask(function()
self._lastPosition.Value = nil
self._humanoidIdle.Value = false
end)
local function update()
if os.clock() - lastMove >= STANDING_TIME_REQUIRED then
self._humanoidIdle.Value = true
else
self._humanoidIdle.Value = false
end
end
maid:GiveTask(self._enabled.Changed:Connect(function()
lastMove = os.clock()
end))
maid:GiveTask(RunService.Stepped:Connect(function()
local rootPart = humanoid.RootPart
if rootPart then
self._lastPosition.Value = rootPart.Position
end
if self._ragdollBindersClient.Ragdoll:Get(humanoid) then
lastMove = os.clock()
elseif rootPart then
if rootPart.Velocity.magnitude > MOVE_DISTANCE_REQUIRED then
lastMove = os.clock()
end
end
update()
end))
self._maid._humanoidMaid = maid
end
function IdleServiceClient:Destroy()
self._maid:DoCleaning()
end
return IdleServiceClient | mit |
ffxiphoenix/darkstar | scripts/globals/items/bowl_of_tender_navarin.lua | 35 | 1884 | -----------------------------------------
-- ID: 4284
-- Item: Bowl of Tender Navarin
-- Food Effect: 240Min, All Races
-----------------------------------------
-- Health % 3
-- Strength 3
-- Agility 1
-- Vitality 1
-- Intelligence -1
-- Attack % 27
-- Attack Cap 35
-- Evasion 6
-- Ranged ATT % 27
-- Ranged ATT Cap 35
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,4284);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HPP, 3);
target:addMod(MOD_STR, 3);
target:addMod(MOD_AGI, 1);
target:addMod(MOD_VIT, 1);
target:addMod(MOD_INT, -1);
target:addMod(MOD_FOOD_ATTP, 27);
target:addMod(MOD_FOOD_ATT_CAP, 35);
target:addMod(MOD_EVA, 6);
target:addMod(MOD_FOOD_RATTP, 27);
target:addMod(MOD_FOOD_RATT_CAP, 35);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HPP, 3);
target:delMod(MOD_STR, 3);
target:delMod(MOD_AGI, 1);
target:delMod(MOD_VIT, 1);
target:delMod(MOD_INT, -1);
target:delMod(MOD_FOOD_ATTP, 27);
target:delMod(MOD_FOOD_ATT_CAP, 35);
target:delMod(MOD_EVA, 6);
target:delMod(MOD_FOOD_RATTP, 27);
target:delMod(MOD_FOOD_RATT_CAP, 35);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Bhaflau_Thickets/mobs/Colibri.lua | 29 | 1752 | -----------------------------------
-- Area: Bhaflau Thickets
-- MOB: Colibri
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob, target)
local delay = mob:getLocalVar("delay");
local LastCast = mob:getLocalVar("LAST_CAST");
local spell = mob:getLocalVar("COPY_SPELL");
if (mob:AnimationSub() == 1) then
if (mob:getBattleTime() - LastCast > 30) then
mob:setLocalVar("COPY_SPELL", 0);
mob:setLocalVar("delay", 0);
mob:AnimationSub(0);
end
if (spell > 0 and mob:hasStatusEffect(EFFECT_SILENCE) == false) then
if (delay >= 3) then
mob:castSpell(spell);
mob:setLocalVar("COPY_SPELL", 0);
mob:setLocalVar("delay", 0);
mob:AnimationSub(0);
else
mob:setLocalVar("delay", delay+1);
end
end
end
end;
-----------------------------------
-- onMagicHit
-----------------------------------
function onMagicHit(caster, target, spell)
if (spell:tookEffect() and (caster:isPC() or caster:isPet()) and spell:getSpellGroup() ~= SPELLGROUP_BLUE ) then
target:setLocalVar("COPY_SPELL", spell:getID());
target:setLocalVar("LAST_CAST", target:getBattleTime());
target:AnimationSub(1);
-- elseif (spell:isHeal() and caster:isPC()) then
-- Todo: handle curing party members in response to being cured.
end
return 1;
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Port_Jeuno/npcs/Chudigrimane.lua | 29 | 1189 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Chudigrimane
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local vHour = VanadielHour();
local vMin = VanadielMinute();
while vHour >= 6 do
vHour = vHour - 6;
end
local seconds = math.floor(2.4 * ((vHour * 60) + vMin));
player:startEvent( 0x0006, seconds, 0, 0, 0, 0, 0, 0, 0);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Buburimu_Peninsula/npcs/Ishin_IM.lua | 30 | 3058 | -----------------------------------
-- Area: Buburimu Peninsula
-- NPC: Ishin, I.M.
-- Outpost Conquest Guards
-- @pos -481.164 -32.858 49.188 118
-----------------------------------
package.loaded["scripts/zones/Buburimu_Peninsula/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Buburimu_Peninsula/TextIDs");
local guardnation = BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 3; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = KOLSHUSHU;
local csid = 0x7ff9;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
ajtao/my_ccn2_t | SpatialResponseNormalization.lua | 1 | 2229 | local C = ccn2.C
local SpatialResponseNormalization, parent = torch.class('ccn2.SpatialResponseNormalization', 'nn.Module')
function SpatialResponseNormalization:__init(size, addScale, powScale, minDiv)
parent.__init(self)
self.size = size
self.addScale = addScale or 0.001
-- dic['scale'] /= dic['size'] if self.norm_type == self.CROSSMAP_RESPONSE_NORM else dic['size']**2
self.addScale = self.addScale / (self.size * self.size)
self.powScale = powScale or 0.75
self.minDiv = minDiv or 1.0
-- TODO: check layer.py:1333
self.output = torch.Tensor()
self.gradInput = torch.Tensor()
self.denoms = torch.Tensor()
self:cuda()
end
function SpatialResponseNormalization:updateOutput(input)
ccn2.typecheck(input)
ccn2.inputcheck(input)
local nBatch = input:size(4)
local inputC = input:view(input:size(1) * input:size(2) * input:size(3), input:size(4))
self.output:resize(inputC:size())
C['convResponseNorm'](inputC:cdata(), self.denoms:cdata(), self.output:cdata(),
input:size(1), self.size,
self.addScale, self.powScale, self.minDiv)
self.output = self.output:view(input:size(1), input:size(2), input:size(3), input:size(4))
return self.output
end
function SpatialResponseNormalization:updateGradInput(input, gradOutput)
ccn2.typecheck(input); ccn2.typecheck(gradOutput);
ccn2.inputcheck(input); ccn2.inputcheck(gradOutput);
local nBatch = input:size(4)
local inputC = input:view(input:size(1) * input:size(2) * input:size(3), input:size(4))
local gradOutputC = gradOutput:view(gradOutput:size(1) * gradOutput:size(2) * gradOutput:size(3), gradOutput:size(4))
local outputC = self.output:view(gradOutput:size(1) * gradOutput:size(2) * gradOutput:size(3), gradOutput:size(4))
self.gradInput:resize(inputC:size())
C['convResponseNormUndo'](gradOutputC:cdata(), self.denoms:cdata(), inputC:cdata(), outputC:cdata(),
self.gradInput:cdata(), input:size(1), self.size,
self.addScale, self.powScale, 0, 1)
self.gradInput = self.gradInput:view(input:size(1), input:size(2), input:size(3), input:size(4))
return self.gradInput
end
| apache-2.0 |
obi-two/Unofficial_Hope | data/script/TutorialPart_1_9.lua | 3 | 71333 | -- TutorialPart_1_9
-- Get access to Tutorial via ScriptEngine
local script = LuaScriptEngine.getScriptObj();
local SE = ScriptEngine:Init();
local tutorial = SE:getTutorial(script);
-- wait for client to become ready.
while tutorial:getReady() == false do
LuaScriptEngine.WaitMSec(500)
end
-- We will start to use general routines from ScriptSupport,
-- aiming at making as few special Tutorial-functions as possible.
local scriptSupport = ScriptSupport:Instance();
local playerId = tutorial:getPlayer();
local function createAndSpawnNpc(npcTypeId, npcFirstName, npcLastName, cellId, ySpawnDir, wSpawnDir, xSpawnPos, ySpawnPos, zSpawnPos)
-- Create the npc, of type "npcTypeId".
local npcId = scriptSupport:npcCreate(npcTypeId);
if npcId == 0 then
print("Failed creating NPC");
return 0, 0;
end;
-- Get npc-object when ready
local watchDog = 10000;
while scriptSupport:objectIsReady(npcId) == false do
LuaScriptEngine.WaitMSec(100);
if (watchDog > 0) then
watchDog = watchDog - 100;
else
break;
end;
end
if (watchDog == 0) then
print("TIMEOUT WAITING FOR NPC TO BE CREATED");
return 0, 0;
end;
local npcObject = scriptSupport:npcGetObject(npcId);
-- print("Tutorial: NPC " .. npcFirstName .. npcLastName .. " with Id " .. npcId .. " is spawning");
LuaScriptEngine.WaitMSec(1000);
scriptSupport:npcSpawnPrivate(npcObject, npcId, playerId, cellId, npcFirstName, npcLastName, ySpawnDir, wSpawnDir, xSpawnPos, ySpawnPos, zSpawnPos);
return npcObject, npcId;
end;
function createAndPopulateLoot(itemTypesId, inventoryOwnerId, playerId)
-- Create the item, of type "itemTypesId".
local itemId = scriptSupport:itemCreate(itemTypesId);
-- How do I abort here?
if itemId == 0 then
print("Failed creating item");
return;
end;
-- Get item-object when ready
while scriptSupport:objectIsReady(itemId) == false do
LuaScriptEngine.WaitMSec(100);
end
-- Script support will not be the owner of this item....
scriptSupport:eraseObject(itemId);
-- print("Tutorial: Item with Id " .. itemId .. " is created and stored in inventory of owner" .. inventoryOwnerId);
scriptSupport:itemPopulateInventory(itemId, inventoryOwnerId, playerId);
end;
-- TODO npc = MM.createAndSpawnNpc(47513075899, "", "", routeX[index], routeY[index], routeZ[index]);
-- We will start to use general routines from ScriptSupport,
-- aiming at making as few special Tutorial-functions as possible.
-- local scriptSupport = ScriptSupport:Instance();
-- Verify correct state
local state = tutorial:getState();
tutorial:disableHudElement("all"); -- Disable all hud elements
tutorial:enableHudElement("buttonbar"); -- Enable buttonbar
LuaScriptEngine.WaitMSec(1000);
-- Let's create what we need.
-- Create the drum, a container with default equipment.
-- local containerId = scriptSupport:containerCreate(11); -- Yes, 11 is the type of container we want :)
-- Get object when ready
-- while scriptSupport:objectIsReady(containerId) == false do
-- LuaScriptEngine.WaitMSec(500);
-- end
-- local containerObject = scriptSupport:containerGetObject(containerId);
-- scriptSupport:containerSpawn(containerObject, containerId, playerId, 2203318222961, "", 0.71, 0.71, 19, 0, -23);
-- Lets populate the Drum
-- Static container
-- local containerId = 9815512;
local containerId = 2533274790395904;
local itemRoomOfficerId = 47513079097;
local bankAndBazzarRoomOfficerId = 47513079099;
local bazzarTerminalId = 4294968325;
local bankTerminalId = 4294968324;
local npcUserBark1Id = 47513085649;
local npcUserBark2Id = 47513085651;
local npcUserBark3Id = 47513085653;
local cloningAndInsuranceDroidId = 47513085659;
local cloningTerminalId = 4294968326;
local insuranceTerminalId = 4294968327;
local npcShoutPanic = 47513085661;
local npcNervousGuy = 47513085663;
local npcCovardOfficer = 47513085665;
-- local npcDebrisTypeId = 47513085667;
local npcDebrisTypeId = 4;
local cellDebris = 2203318222973;
local yDirDebris = 0;
local wDirDebris = 1;
local xPosDebris = 76.9;
local yPosDebris = -4.0;
local zPosDebris = -94.3;
local npcBanditTypeId = 5;
-- local npcBanditTypeId = 47513085669;
local cellBandit = 2203318222967;
local yDirBandit = 0.707;
local wDirBandit = 0.707;
local xPosBandit = 38.1;
local yPosBandit = -5.9;
local zPosBandit = -113.4;
local celeb_guy1_Id = 47513085677;
local celeb_guy2_Id = 47513085675;
local cellTrainerRoom = 2203318222968;
local refugee_guy1_id = 47513085679;
local refugee_guy2_id = 47513085671;
local refugee_guy3_id = 47513085673;
local npcOfficerWithTrainerId = 47513085681;
local cellMissionRoom = 2203318222969;
local npcOfficerInMissionRoomId = 47513085683;
local npcCommonerInMissionRoomId = 47513079101;
local missionTerminalId = 4294968328;
local cellTravelRoom = 2203318222970;
local npcQuartermasterId = 47513085685;
local travelTerminalId = 4294968329;
local npcSkillTrainer;
local npcSkillTrainerId;
local yDirSkillTrainer = -0.220;
local wDirSkillTrainer = 0.975;
local xPosSkillTrainer = 7.1;
local yPosSkillTrainer = -4.2;
local zPosSkillTrainer = -128.2;
local npcSkillTrainerTypeId;
local cellSkillTrainer = 2203318222968;
-- Wait for tutorial to get valid state
while tutorial:getState() == 0 do
LuaScriptEngine.WaitMSec(500);
print("Waiting for Tutorial to become ready...");
end;
if tutorial:getRoom() == 16 then
state = 3;
end
local npcDebris;
local npcDebrisId;
if (tutorial:getSubState() < 18) then
-- Create the Debris
npcDebris, npcDebrisId = createAndSpawnNpc(npcDebrisTypeId, "", "", cellDebris, yDirDebris, wDirDebris, xPosDebris, yPosDebris, zPosDebris);
end;
if (tutorial:getSubState() > 19) then
-- Create and spawn the skill trainer.
-- spawn your dedicated skill trainer.
npcSkillTrainerTypeId = tutorial:getSkillTrainerTypeId();
if (npcSkillTrainerTypeId ~= 0) then
npcSkillTrainer, npcSkillTrainerId = createAndSpawnNpc(npcSkillTrainerTypeId, "", "", cellSkillTrainer, yDirSkillTrainer, wDirSkillTrainer, xPosSkillTrainer, yPosSkillTrainer, zPosSkillTrainer);
-- print("Spawned NPC");
else
-- Invalid skill trainer type id, we have to abort the script.
print("Failed spawning NPC");
state = 2;
end;
-- Activate the npc that continue to taunt us.
tutorial:setTutorialCelebTaunts(celeb_guy1_Id);
tutorial:setTutorialCelebTaunts(celeb_guy2_Id);
tutorial:setTutorialRefugeeTaunts(refugee_guy1_id);
tutorial:setTutorialRefugeeTaunts(refugee_guy2_id);
tutorial:setTutorialRefugeeTaunts(refugee_guy3_id);
end;
local delayLeft = 3000;
local count;
while state == 1 do
local subState = tutorial:getSubState();
if subState == 1 then
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART ONE OF NINE (movement and chat)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_1");
LuaScriptEngine.WaitMSec(1000);
-- "Welcome to Star Wars Galaxies."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:welcome");
tutorial:scriptPlayMusic(1267); -- sound/tut_01_welcome.snd
tutorial:setSubState(2);
delayLeft = 5000;
elseif subState == 2 then -- Scroll / zoom to third person...
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Use the arrow keys to move."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:movement_keyboard");
tutorial:scriptPlayMusic(3426); -- sound/tut_02_movement.snd
-- "Or hold down the right mouse-button to move forward."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:movement_mouse");
-- "You can look around by moving your mouse."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:lookaround");
LuaScriptEngine.WaitMSec(15000);
-- "Using the mouse-wheel, scroll forward to zoom into your character. Notice that if you zoom in all the way, you'll be in first-person mode. Scroll backwards to zoom-out of your character, and into third-person mode. You can also zoom your camera in and out by pressing the keypad plus and minus keys. Try zooming between 1st and 3rd person."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:mousewheel");
tutorial:scriptPlayMusic(1174); -- sound/tut_00_camera.snd
tutorial:updateTutorial("zoomCamera"); -- Wait for user to use the zoom
local hasZoomed = false;
LuaScriptEngine.WaitMSec(25000); -- wait for sound to finish
hasZoomed = tutorial:isZoomCamera();
-- wait max 30 seconds before we continue
for count = 1,30 do
if hasZoomed == true then
break;
end;
LuaScriptEngine.WaitMSec(1000);
hasZoomed = tutorial:isZoomCamera();
end
delayLeft = 0;
while hasZoomed == false do
-- "Give it a try. Scroll out to 3rd-person and take a look at yourself."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:mousewheel_repeat");
tutorial:scriptPlayMusic(141); -- sound/tut_03_scroll_out.snd
delayLeft = 5000;
for count = 1,30 do
hasZoomed = tutorial:isZoomCamera();
if hasZoomed == true then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
end
tutorial:setSubState(3);
elseif subState == 3 then -- Use chat window
tutorial:enableHudElement("chatbox");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
tutorial:updateTutorial("chatActive");
-- "This is your chat window. Type here to speak to your fellow players."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:chatwindow");
tutorial:scriptPlayMusic(3379); -- sound/tut_04_chat.snd
-- "Go ahead and try it. Just type what you want to say and then press ENTER."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:chatprompt");
LuaScriptEngine.WaitMSec(10000); -- wait for sound to finish
local hasChat = false;
hasChat = tutorial:isChatBox();
for count = 1,25 do
if hasChat == true then
break
end
LuaScriptEngine.WaitMSec(1000);
hasChat = tutorial:isChatBox();
end
delayLeft = 0;
while hasChat == false do
-- "Don't be shy. Type something in your chatwindow and press Enter"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:repeatchatprompt");
tutorial:scriptPlayMusic(1294); -- sound/tut_05_remind_chat.snd
delayLeft = 5000;
for count = 1,30 do
hasChat = tutorial:isChatBox();
if hasChat == true then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
end
tutorial:setSubState(4);
elseif subState == 4 then -- Use Holocron
tutorial:enableHudElement("chatbox");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
tutorial:openHolocron();
tutorial:updateTutorial("closeHolocron");
-- "This is your Holocron. You can access it by pressing CTRL-H. Whenever you need information about something in Star Wars Galaxies, press CTRL-H to find it in your Holocron. To close this screen, press CTRL-H again."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:holocube");
tutorial:scriptPlayMusic(1385); -- sound/tut_00_holocron.snd
-- wait at least until the previous sound/music has stopped.
delayLeft = 17000;
while tutorial:isCloseHolocron() == false do
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
tutorial:setSubState(5);
elseif subState == 5 then -- Approach Imperial Officer.
tutorial:enableHudElement("chatbox");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Excellent! Come through the door and down the hallway there."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:move_to_item_room");
tutorial:scriptPlayMusic(1691); -- sound/tut_06_excellent.snd
delayLeft = 5000;
for count = 1,30 do
if tutorial:getRoom() == 2 then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
while tutorial:getRoom() ~= 2 do
-- "Come on. Don't keep me waiting all day."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:repeat_item_room_prompt");
tutorial:scriptPlayMusic(1363); -- sound/tut_07_comeon.snd
delayLeft = 5000;
for count = 1,30 do
if tutorial:getRoom() == 2 then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
end
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark1");
tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark1");
while tutorial:getPlayerPosToObject(itemRoomOfficerId) > 20.0 do
LuaScriptEngine.WaitMSec(4000);
end;
-- tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark2");
tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark2");
while tutorial:getPlayerPosToObject(itemRoomOfficerId) > 16.0 do
LuaScriptEngine.WaitMSec(4000);
end;
-- tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark3");
tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeter1_bark3");
while tutorial:getPlayerPosToObject(itemRoomOfficerId) > 12.0 do
LuaScriptEngine.WaitMSec(4000);
end;
tutorial:setSubState(6);
delayLeft = 3000;
elseif subState == 6 then -- Imperial Officer Conversation
tutorial:enableHudElement("chatbox");
tutorial:updateTutorial("changeLookAtTarget");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART TWO OF NINE (conversing with npcs and inventory) "
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_2");
LuaScriptEngine.WaitMSec(1000);
-- "Move forward and click-and-hold your mouse on the Imperial Officer until the radial menu appears. "
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_08");
tutorial:scriptPlayMusic(1550); -- sound/tut_08_imperialofficer.snd
tutorial:enableNpcConversationEvent(itemRoomOfficerId);
delayLeft = 8000;
if (tutorial:getPlayerPosToObject(itemRoomOfficerId) > 10.0) then
-- tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeting");
tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:greeting");
end;
-- wait at least until the previous sound/music has stopped.
while (scriptSupport:getTarget(playerId) ~= itemRoomOfficerId) do
-- tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:explain_lookat");
tutorial:spatialChat(itemRoomOfficerId, "@newbie_tutorial/newbie_convo:explain_lookat");
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
delayLeft = 5000;
for count = 1,30 do
if (scriptSupport:getTarget(playerId) == itemRoomOfficerId) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
end;
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
-- "He is now your look-at target. His name appears over his head."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_09");
tutorial:scriptPlayMusic(1330); -- sound/tut_09_lookat.snd
LuaScriptEngine.WaitMSec(5000);
-- "Click and hold the mouse button to get a radial menu on the Imperial Officer."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_10");
tutorial:scriptPlayMusic(2726); -- sound/tut_10_radialmenu.snd
LuaScriptEngine.WaitMSec(5000);
-- "Do you see the option to converse? While holding your mouse button, move to the converse option and let go of the mouse button to select it."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_11");
tutorial:scriptPlayMusic(3436); -- sound/tut_11_converse.snd
-- wait at least until the previous sound/music has stopped.
delayLeft = 10000;
while tutorial:isNpcConversationStarted(itemRoomOfficerId) == false do
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
-- "Now you're in a conversation. You can choose one of the responses to the right with your mouse."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_12");
tutorial:scriptPlayMusic(716); -- sound/tut_12_conversation.snd
LuaScriptEngine.WaitMSec(12000);
-- "Remember, you don't speak to other players this way. Just type to talk to other players. When you are finished conversing with the Imperial Officer, select the STOP CONVERSING option."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_13");
tutorial:scriptPlayMusic(3009); -- sound/tut_13_justtype.snd
-- wait at least until the previous sound/music has stopped.
delayLeft = 14000;
while tutorial:isNpcConversationEnded(itemRoomOfficerId) == false do
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
tutorial:updateTutorial("changeLookAtTarget");
tutorial:setSubState(7);
elseif subState == 7 then -- Loot the Drum.
tutorial:updateTutorial("changeLookAtTarget");
tutorial:enableItemContainerEvent(containerId);
tutorial:enableHudElement("chatbox");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- send flytext "Open Me!"
scriptSupport:sendFlyText(containerId, playerId, "newbie_tutorial/system_messages", "open_me", 0, 255, 0, 0);
-- "To open the box just click and hold until you see the radial menu appear."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_open_box");
tutorial:scriptPlayMusic(2008); -- sound/tut_14_openbox.snd
-- wait at least until the previous sound/music has stopped.
delayLeft = 5000;
local targetSelected = false;
-- wait max 30 seconds before we continue
-- while (targetSelected == false) do
for count = 1,60 do
if (targetSelected == true) then
break;
end;
if (count % 10) == 0 then
-- send flytext "Open Me!"
scriptSupport:sendFlyText(containerId, playerId, "newbie_tutorial/system_messages", "open_me", 0, 255, 0, 1);
end;
if (tutorial:isChangeLookAtTarget() == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
else
-- Is it the correct target?
if (scriptSupport:getTarget(playerId) == containerId) then
targetSelected = true;
else
-- print("Wrong target selected");
tutorial:updateTutorial("changeLookAtTarget");
end
end;
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
while (targetSelected == false) do
-- send flytext "Open Me!"
-- scriptSupport:sendFlyText(containerId, playerId, "newbie_tutorial/system_messages", "open_me", 0, 255, 0, 5);
-- "You might find something in the box you need. Click and hold your mouse-button down on the box until you see the radial menu."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:repeat_open_box");
tutorial:scriptPlayMusic(1799); -- sound/tut_16_intheboxyouneed.snd
delayLeft = 10000;
for count = 1,60 do
if (targetSelected == true) then
break;
end;
if (count % 10) == 0 then
-- send flytext "Open Me!"
scriptSupport:sendFlyText(containerId, playerId, "newbie_tutorial/system_messages", "open_me", 0, 255, 0, 1);
end;
if (tutorial:isChangeLookAtTarget() == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
else
-- Is it the correct target?
if (scriptSupport:getTarget(playerId) == containerId) then
targetSelected = true;
else
-- print("Wrong target selected");
tutorial:updateTutorial("changeLookAtTarget");
end
end;
end;
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- tutorial:enableItemContainerEvent(containerId);
-- "Great! Now select the Open option to access the contents of the container."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_choose_open");
tutorial:scriptPlayMusic(1332); -- sound/tut_15_opencontainer.snd
delayLeft = 8000;
targetOpened = false;
while (targetOpened == false and not tutorial:isContainerEmpty(containerId)) do
if (tutorial:isContainerOpen(containerId) == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
print("STUCK LINE 644.");
delayLeft = delayLeft - 500
end
else
targetOpened = true;
break;
end;
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- Player has openend the container.
-- "You can take these items by clicking-and-holding until you get the radial menu option on each item. Pick up all of the items, and then click the X in the upper-right-hand corner of the container to close the box."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_take_items");
tutorial:scriptPlayMusic(778); -- sound/tut_16_a_youcantake.snd
LuaScriptEngine.WaitMSec(15000);
-- A possible fix... wait until the user actually selected an item before asking for the "chosoe Pick Up...".
if (tutorial:isContainerClosed(containerId) == false) then
-- Pick up an item
-- "Now choose the Pick Up option to move the item to your inventory."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_select_pickup");
tutorial:scriptPlayMusic(3041); -- sound/tut_17_pickup.snd
delayLeft = 4000;
end;
-- Wait for player to pick up the items and close the container.
while (tutorial:isContainerClosed(containerId) == false) do
print("Container is NOT closed.");
if (tutorial:isContainerEmpty(containerId) == true) then
print("Container is EMPTY.");
break;
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
while tutorial:isItemTransferedFromContainer(containerId) == false do
LuaScriptEngine.WaitMSec(500);
if (tutorial:isContainerClosed(containerId) == true) then
break;
end;
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
if (tutorial:isContainerClosed(containerId) == true) then
break;
end;
-- Picked up an item
-- "You've put the item in your inventory."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:pickup_complete");
tutorial:scriptPlayMusic(58); -- sound/tut_18_inventory.snd
delayLeft = 2000;
end;
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- We HAVE to close the container
--The code to show a closed container was never being called. This means we need to comment this out for now for the sake of allowing the rest of the tutorial to work.
--while (tutorial:isContainerClosed(containerId) == false) do
--print("STUCK LINE 715.");
--LuaScriptEngine.WaitMSec(500);
--end;
tutorial:updateTutorial("openInventory");
tutorial:setSubState(8);
elseif subState == 8 then -- The container is closed, consume the food from inventory.
tutorial:updateTutorial("openInventory");
tutorial:enableHudElement("chatbox");
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Notice that your mouse mode changed when you opened that container."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_freemouse");
tutorial:scriptPlayMusic(3416); -- sound/tut_19_inventory.snd
-- "You can toggle the mouse mode yourself with the ALT key."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_freemouse_toggle");
-- LuaScriptEngine.WaitMSec(1000);
-- "You can examine your inventory by pressing CTRL-I."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_inventory");
-- LuaScriptEngine.WaitMSec(1000);
-- tutorial:scriptPlayMusic(3416); -- sound/tut_19_inventory.snd
LuaScriptEngine.WaitMSec(15000);
-- "Press CTRL-I to open your inventory, and select one of the food items you found in the crate."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:repeat_open_inventory");
tutorial:scriptPlayMusic(1664); -- sound/tut_25_openinventory.snd
delayLeft = 8000;
-- LuaScriptEngine.WaitMSec(1000);
while tutorial:isOpenInventory() == false do
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
-- Wait for the close of the inventory or user consumed the food.
-- This construction is NOT an error, since we use different mechanichs internally. (but it's dirty).
tutorial:updateTutorial("foodSelected");
tutorial:updateTutorial("foodUsed");
tutorial:updateTutorial("closeInventory");
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
if (tutorial:isCloseInventory() == false) then
-- "Scroll through your inventory until you locate one of the food items that you've just picked-up."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_find_food");
tutorial:scriptPlayMusic(2910); -- sound/tut_20_selectfooditem.snd
delayLeft = 8000;
end;
local stateOfFood = 1;
-- local done = false;
local done = tutorial:isCloseInventory();
while (done == false) do
if (tutorial:isCloseInventory() == true) then
done = true;
end;
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500;
elseif (stateOfFood == 1) then
if (tutorial:isFoodSelected() == true) then
-- "Select the Use option to use this item."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:prompt_use_item");
tutorial:scriptPlayMusic(934); -- sound/tut_21_usefood.snd
delayLeft = 5000;
-- print("found the food!");
stateOfFood = 2;
end;
elseif (stateOfFood == 2) then
if (tutorial:isFoodUsed() == true) then
-- "You used the item on yourself. Food will help increase your attributes. Medicine will help you recover damage to your attributes."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_item_used");
tutorial:scriptPlayMusic(2571); -- sound/tut_22_attributes.snd
delayLeft = 10000;
-- Dev debug message
-- tutorial:scriptSystemMessage("Dev message: 'Use' with food items are not implemented yet, no need to report it as a bug.");
-- print("Eat the food!");
done = true;
end;
end;
end
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
tutorial:enableHudElement("toolbar"); -- Enable toolbar
-- "This is your toolbar. You can put things on it for instant access."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:show_toolbar");
tutorial:scriptPlayMusic(2439); -- sound/tut_23_toolbar.snd
LuaScriptEngine.WaitMSec(8000);
-- "You can drag items into your toolbar for easy access. Simply click on the item and then drag it to an open slot on your toolbar. Press the corresponding function key to use the item."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_00_toolbardrag");
tutorial:scriptPlayMusic(1092); -- sound/tut_00_toolbardrag.snd
LuaScriptEngine.WaitMSec(16000);
-- delayLeft = 0;
if (tutorial:isCloseInventory() == false) then
-- "Press CTRL-I again to close your inventory window."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:close_inventory");
tutorial:scriptPlayMusic(1603); -- sound/tut_26_closeinventory.snd
delayLeft = 2000;
end;
while (tutorial:isCloseInventory() == false) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500;
end;
end;
tutorial:setSubState(9);
elseif subState == 9 then -- The inventory is closed, proceed to next room.
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(2202); -- sound/tut_27_proceed.snd
delayLeft = 8000;
for count = 1,30 do
if tutorial:getRoom() == 3 then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
while tutorial:getRoom() ~= 3 do
-- "No need to stick around here all day. Walk down the corridor to the next area."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:repeat_visit_commerce");
-- MISSING THE CORRECT SOUND HERE
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(2202); -- sound/tut_27_proceed.snd
delayLeft = 3000;
for count = 1,30 do
if tutorial:getRoom() == 3 then
break
end
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
end
tutorial:setSubState(10);
elseif subState == 10 then -- Part 3
tutorial:updateTutorial("changeLookAtTarget");
tutorial:enableNpcConversationEvent(bankAndBazzarRoomOfficerId);
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART THREE OF NINE (banking and shopping)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_3");
LuaScriptEngine.WaitMSec(1000);
-- "Converse with the Imperial Officer"
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_28");
-- tutorial:scriptPlayMusic(3149); -- sound/tut_28_converse.snd
-- tutorial:spatialChat(bankAndBazzarRoomOfficerId, "Well hello! Come talk to me if you need assistance with this terminal");
-- delayLeft = 5000;
local targetSelected = false;
while (targetSelected == false) do
-- "Converse with the Imperial Officer"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_28");
tutorial:scriptPlayMusic(3149); -- sound/tut_28_converse.snd
tutorial:spatialChat(bankAndBazzarRoomOfficerId, "@newbie_tutorial/newbie_convo:clone_greeting");
delayLeft = 5000;
for count = 1,60 do
if (tutorial:isChangeLookAtTarget() == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
-- Is it the correct target?g9
if (scriptSupport:getTarget(playerId) == bankAndBazzarRoomOfficerId) then
targetSelected = true;
break;
else
-- print("Wrong target selected");
tutorial:updateTutorial("changeLookAtTarget");
end
end;
-- end;
if (targetSelected == true) then
targetSelected = false;
-- Activate again, we need to check bank and bazzar.
tutorial:updateTutorial("changeLookAtTarget");
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Do you see the option to converse? While holding your mouse button, move to the converse option and let go of the mouse button to select it."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_11");
tutorial:scriptPlayMusic(3436); -- sound/tut_11_converse.snd
for count = 1,60 do
if (tutorial:isNpcConversationStarted(bankAndBazzarRoomOfficerId) == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end;
else
targetSelected = true;
break;
end;
end;
end
end;
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
local allTargetsActivated = false;
local bankSelected = false;
local bazzarSelected = false;
while (allTargetsActivated == false) do
for count = 1,60 do
if (allTargetsActivated == true) then
break;
end;
if (count % 10) == 0 then
if (bankSelected == false) then
-- send flytext "*Access the bank here!*"
scriptSupport:sendFlyText(bankTerminalId, playerId, "newbie_tutorial/system_messages", "bank_flytext", 0, 255, 0, 0);
end;
if (bazzarSelected == false) then
-- send flytext "*Shop!*"
scriptSupport:sendFlyText(bazzarTerminalId, playerId, "newbie_tutorial/system_messages", "bazaar_flytext", 0, 255, 0, 0);
end;
end;
if (tutorial:isChangeLookAtTarget() == false) then
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
-- Is it the correct target?
if (scriptSupport:getTarget(playerId) == bankTerminalId) and (delayLeft == 0) then
if (bankSelected == false) then
tutorial:updateTutorial("changeLookAtTarget");
-- "Banks let you deposit and withdraw cash on hand. You can also use the bank to store items."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bank_info_1");
tutorial:scriptPlayMusic(421); -- sound/tut_32_bank.snd
LuaScriptEngine.WaitMSec(6000);
-- "You can only retrieve your items from the bank in which you stored the item. You can only store items in the bank you've joined."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bank_info_2");
LuaScriptEngine.WaitMSec(7000);
-- "Although you can change banks at any time, you can only be a member of one bank at a time."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bank_info_3");
LuaScriptEngine.WaitMSec(7000);
-- "You can spend credits from your bank account at most terminals."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bank_info_4");
LuaScriptEngine.WaitMSec(5000);
-- "Banks let you deposit and withdraw cash on hand. You can also use the bank to store items. You can only retrieve your items from the bank in which you stored the item. You can only store items in the bank you've joined. Although you can change banks at any time, you can only be a member of one bank at a time. You can spend credits from your bank account at most terminals."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_32");
-- tutorial:scriptPlayMusic(421); -- sound/tut_32_bank.snd
-- LuaScriptEngine.WaitMSec(25000);
-- "When you find hard credits (cash on hand), be sure to deposit them in your bank as soon as possible to avoid losing them."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bank_info_5");
-- "When you find hard credits (cash on hand) be sure to deposit them in your bank as soon as possible to avoid losing them."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_33");
-- tutorial:scriptPlayMusic(46); -- sound/tut_33_cash.snd
-- delayLeft = 12000;
bankSelected = true;
end;
elseif (scriptSupport:getTarget(playerId) == bazzarTerminalId) and (delayLeft == 0) then
if (bazzarSelected == false) then
tutorial:updateTutorial("changeLookAtTarget");
-- "This is an item dispenser. You can use it to buy basic items in the game."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bazaar_info_1");
tutorial:scriptPlayMusic(936); -- sound/tut_29_itemdispenser.snd -- This is an item Dispenser"
LuaScriptEngine.WaitMSec(5500);
tutorial:scriptPlayMusic(98); -- sound/tut_00_bazaar_tease.snd
-- "In addition to the basic item dispensers, you'll find a number of terminals that will connect you to the galactic bazaar."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bazaar_info_2");
LuaScriptEngine.WaitMSec(7000);
-- "Everything from large quantities of resources, to specialized items can be bought and sold at the bazaar terminal."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:bazaar_info_3");
-- tutorial:scriptPlayMusic(98); -- sound/tut_00_bazaar_tease.snd
delayLeft = 8500;
bazzarSelected = true;
end;
end;
if (bankSelected == false) or (bazzarSelected == false) then
tutorial:updateTutorial("changeLookAtTarget");
else
allTargetsActivated = true;
end
-- print("Room = " .. tutorial:getRoom() .. " and Z-position = " .. tutorial:getPlayerPosZ());
if (tutorial:getRoom() == 3) and (tutorial:getPlayerPosZ() < -19) then
-- print("Breaking from loop");
allTargetsActivated = true;
end;
end;
end;
tutorial:setSubState(11);
elseif subState == 11 then -- Part 4 (first part)
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
-- tutorial:enableNpcConversationEvent(cloningAndInsuranceDroidId);
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 3000;
-- "PART FOUR OF NINE (cloning and insurance)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_4");
-- if (tutorial:getRoom() ~= 5) then
if (tutorial:getRoom() < 5) then
-- "Move down the ramp toward the cloning and insurance terminals."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_36");
tutorial:scriptPlayMusic(2297); -- sound/tut_36_movedownhall.snd
-- We are going to pass some npc's that bark at us... and they all are in room 4.
while tutorial:getRoom() ~= 4 do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
-- Now we are in the room with barkers...
-- Are we down the ramp yet?
local playerPosHeight = tutorial:getPlayerPosY();
while (playerPosHeight > -6.9) do
-- print("Height = " .. playerPosHeight);
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosHeight = tutorial:getPlayerPosY();
end;
-- Yee, we are down the ramp now.
-- Let the dog start barking...
tutorial:spatialChat(npcUserBark1Id, "@newbie_tutorial/newbie_convo:ins_user_bark_1");
local playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -47) do
-- print("playerPosZ = " .. playerPosZ);
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChat(npcUserBark2Id, "@newbie_tutorial/newbie_convo:ins_user_bark_2");
local playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -54) and (playerPosX > 45) do
-- print("playerPosX = " .. playerPosX);
-- print("playerPosZ = " .. playerPosZ);
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChat(npcUserBark3Id, "@newbie_tutorial/newbie_convo:ins_user_bark_3");
end;
-- wait until we are in the correct room.
while tutorial:getRoom() ~= 5 do
LuaScriptEngine.WaitMSec(1000);
if delayLeft > 0 then
delayLeft = delayLeft - 1000
end
end
tutorial:setSubState(12);
elseif subState == 12 then -- Continue Part 4
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
tutorial:enableNpcConversationEvent(cloningAndInsuranceDroidId);
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:clone_greeting");
tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:clone_greeting");
LuaScriptEngine.WaitMSec(2000);
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:clone_prompt_convo");
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "Remember, to speak to me just click-and-hold on me until you get the radial menu, then select the CONVERSE menu option.");
-- wait at least until the previous sound/music has stopped.
delayLeft = 10000; -- Shorter delay for the first time.
while tutorial:isNpcConversationStarted(cloningAndInsuranceDroidId) == false do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
else
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:clone_prompt_convo");
tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:clone_prompt_convo");
delayLeft = 30000;
end
end
delayLeft = 0;
-- Set event for using the Cloning Terminal.
tutorial:updateTutorial("cloneDataSaved");
-- Let the user have the conversation with the droid.
while tutorial:isNpcConversationEnded(cloningAndInsuranceDroidId) == false do
LuaScriptEngine.WaitMSec(1000);
end
-- Conversation done, let's use the terminals. Cloning first.
-- send flytext "*Clone!*"
scriptSupport:sendFlyText(cloningTerminalId, playerId, "newbie_tutorial/system_messages", "clone_here", 0, 255, 0, 0);
-- "Use the cloning terminal. You can do this through the radial menu, or you can just double-click. The cursor changes when over a usable item."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_37");
tutorial:scriptPlayMusic(3245); -- sound/tut_37_cloning.snd
LuaScriptEngine.WaitMSec(5000);
-- TODO: We SHALL wait for the cloning data to be storead AND full Insurance before we continue.
-- wait for the cloning data to be storead
count = 0;
while (tutorial:isCloneDataSaved() == false) do
LuaScriptEngine.WaitMSec(500);
if (count % 10) == 0 then
-- send flytext "*Clone!*"
scriptSupport:sendFlyText(cloningTerminalId, playerId, "newbie_tutorial/system_messages", "clone_here", 0, 255, 0, 0);
count = 1;
else
count = count + 1;
end;
end;
tutorial:updateTutorial("insureItemsDone");
-- "Your clone data has been saved!"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:declare_cloned");
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:convo_3_explain_terminal_1");
tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:convo_3_explain_terminal_1");
LuaScriptEngine.WaitMSec(5000);
-- tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:convo_3_explain_terminal_2");
tutorial:spatialChat(cloningAndInsuranceDroidId, "@newbie_tutorial/newbie_convo:convo_3_explain_terminal_2");
-- send flytext "*Insurance!*"
scriptSupport:sendFlyText(insuranceTerminalId, playerId, "newbie_tutorial/system_messages", "insure_here", 0, 255, 0, 0);
LuaScriptEngine.WaitMSec(2000);
-- "Use the insurance terminal."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_38");
tutorial:scriptPlayMusic(2678); -- sound/tut_38_insurance.snd
LuaScriptEngine.WaitMSec(3000);
-- Is it the correct target?
count = 0;
while (tutorial:isItemsInsured() == false) do
LuaScriptEngine.WaitMSec(500);
if (count % 10) == 0 then
-- send flytext "*Insurance!*"
scriptSupport:sendFlyText(insuranceTerminalId, playerId, "newbie_tutorial/system_messages", "insure_here", 0, 255, 0, 0);
count = 1;
else
count = count + 1;
end;
end;
-- "All of your items have been insured!"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:declare_insured");
LuaScriptEngine.WaitMSec(3000);
-- Some extra hints have been requested here, so I add this one.
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(2202); -- sound/tut_27_proceed.snd
-- Waiting for one of the commoners to get "panic".
local playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -64) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChatShout(npcShoutPanic, "@newbie_tutorial/newbie_convo:shout_panic1");
tutorial:setSubState(13);
elseif subState == 13 then -- Continue Part 4
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
LuaScriptEngine.WaitMSec(3000);
local playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -73) do
LuaScriptEngine.WaitMSec(500);
playerPosZ = tutorial:getPlayerPosZ();
end;
-- "If you're going down that hallway, you might want advanced warning of what's down there. This is your radar."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:radar");
tutorial:scriptPlayMusic(2975); -- sound/tut_41_advancewarning.snd
LuaScriptEngine.WaitMSec(2000);
tutorial:enableHudElement("radar"); -- Enable radar
tutorial:setSubState(14);
elseif subState == 14 then -- Continue Part 4
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
tutorial:enableHudElement("radar"); -- Enable radar
LuaScriptEngine.WaitMSec(3000);
local playerPosX = tutorial:getPlayerPosZ();
local playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -86) and (playerPosX < 3) and (tutorial:getRoom() < 7) do
LuaScriptEngine.WaitMSec(500);
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChatShout(npcShoutPanic, "@newbie_tutorial/newbie_convo:shout_panic2");
-- Wait until we enter the next room.
while (tutorial:getRoom() < 6) do
LuaScriptEngine.WaitMSec(500);
end
local playerPosX = tutorial:getPlayerPosX();
while (playerPosX < 4) and (tutorial:getRoom() < 7) do
LuaScriptEngine.WaitMSec(500);
playerPosX = tutorial:getPlayerPosX();
end;
tutorial:setSubState(15);
elseif subState == 15 then -- Part 5
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
tutorial:enableHudElement("radar"); -- Enable radar
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART FIVE OF NINE (combat moves and radar)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_5");
LuaScriptEngine.WaitMSec(1000);
-- The red dots show potentially aggressive entities. Yellow dots indicate peaceful life signatures. You can also access an overlay map with CTRL-M. Press CTRL-M again to turn it off.
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:radar_more");
tutorial:scriptPlayMusic(1259); -- sound/tut_42_map.snd
LuaScriptEngine.WaitMSec(18000);
-- You can zoom the overlay map using the mousewheel, while holding down the CTRL key.
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_43");
tutorial:scriptPlayMusic(2327); -- sound/tut_43_zoommap.snd
delayLeft = 5000;
local playerPosX = tutorial:getPlayerPosX();
while (playerPosX < 12) and (tutorial:getRoom() < 7) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosX = tutorial:getPlayerPosX();
end;
tutorial:spatialChat(npcNervousGuy, "@newbie_tutorial/newbie_convo:nervous_guy1"); -- nervous_guy1
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
while ((playerPosZ < -86) or (playerPosX < 12)) and (tutorial:getRoom() < 7) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChat(npcNervousGuy, "@newbie_tutorial/newbie_convo:nervous_guy2"); -- nervous_guy2
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
while ((playerPosZ < -82) or (playerPosX < 12)) and (tutorial:getRoom() < 7) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
end;
tutorial:spatialChat(npcNervousGuy, "@newbie_tutorial/newbie_convo:nervous_guy3"); -- nervous_guy3
tutorial:setSubState(16);
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 3000;
elseif subState == 16 then -- Continue part 5
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
tutorial:enableHudElement("radar"); -- Enable radar
tutorial:enableNpcConversationEvent(npcCovardOfficer);
-- Wait until we enter the next room.
while tutorial:getRoom() < 7 do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- NOTE: The state and npc id used are to be retained in QuestGiver::handleConversationEvent() and QuestGiver::preProcessfilterConversation().
-- "Converse with the soldier."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_40");
tutorial:scriptPlayMusic(957); -- sound/tut_40_converse.snd -- Converse with the soldier.
while tutorial:isNpcConversationStarted(npcCovardOfficer) == false do
LuaScriptEngine.WaitMSec(500);
end
while tutorial:isNpcConversationEnded(npcCovardOfficer) == false do
LuaScriptEngine.WaitMSec(500);
-- The state is magically changed to 17 in QuestGiver::handleConversationEvent().
if (tutorial:getSubState() == 17) then -- "Ho-ho, now I have a machine gun" (or maybe just a pistol)
-- tutorial:addQuestWeapon(10,2755);
-- "A weapon has been added to your inventory."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:receive_weapon");
break;
end;
end
elseif subState == 17 then -- Continue part 5
if (npcDebrisId == nil) then
-- Create the Debris
print("Adding new debris");
npcDebris, npcDebrisId = createAndSpawnNpc(npcDebrisTypeId, "", "", cellDebris, yDirDebris, wDirDebris, xPosDebris, yPosDebris, zPosDebris);
end;
-- enable Debris to be attacked.
tutorial:makeCreatureAttackable(npcDebrisId);
tutorial:enableHudElement("chatbox");
tutorial:enableHudElement("toolbar"); -- Enable toolbar
tutorial:enableHudElement("radar"); -- Enable radar
tutorial:enableHudElement("hambar"); -- Enable hambar
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
local playerPosX = tutorial:getPlayerPosX();
while (playerPosX < 45) do
LuaScriptEngine.WaitMSec(500);
playerPosX = tutorial:getPlayerPosX();
end;
tutorial:spatialChatShout(npcNervousGuy, "@newbie_tutorial/newbie_convo:nervous_guy4"); -- nervous_guy4
playerPosX = tutorial:getPlayerPosX();
local playerPosZ = tutorial:getPlayerPosZ();
while (playerPosZ > -80) or (playerPosX < 72) do
LuaScriptEngine.WaitMSec(500);
playerPosX = tutorial:getPlayerPosX();
playerPosZ = tutorial:getPlayerPosZ();
end;
-- enable Debris to be attacked.
-- tutorial:makeCreatureAttackable(npcDebrisId);
-- "The hallway is blocked by debris. Attack it to destroy it. Then proceed to the next room to face your enemy."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_45");
tutorial:scriptPlayMusic(3183); -- sound/tut_45_proceed.snd
delayLeft = 8000;
-- LuaScriptEngine.WaitMSec(3000);
-- LuaScriptEngine.WaitMSec(6000);
while (scriptSupport:npcIsDead(npcDebrisId) == false) do
LuaScriptEngine.WaitMSec(500);
if (delayLeft > 0) then
delayLeft = delayLeft - 500
end
end;
-- This will make the Debris re-spawn when we test and goes back to previous "state".
npcDebrisId = nil;
tutorial:setSubState(18);
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
elseif subState == 18 then -- Part 6
-- Spawn the bandit
tutorial:enableHudElement("all"); -- Enable full UI
local npcBandit;
local npcBanditId;
npcBandit, npcBanditId = createAndSpawnNpc(npcBanditTypeId, "", "", cellBandit, yDirBandit, wDirBandit, xPosBandit, yPosBandit, zPosBandit);
-- 89 equals a melon :)
createAndPopulateLoot(89, npcBanditId, playerId);
-- 35 equals blue milk :)
createAndPopulateLoot(35, npcBanditId, playerId);
LuaScriptEngine.WaitMSec(2000);
-- "In combat, you can spend your HEALTH, MIND or ACTION pools to invoke special attacks."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_combat_1");
tutorial:scriptPlayMusic(179); -- sound/tut_47_defaultattack.snd
LuaScriptEngine.WaitMSec(5000);
-- "The ATTACK option on the radial menu will be the default attack for hostile creatures."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:explain_combat_2");
LuaScriptEngine.WaitMSec(10000);
-- delayLeft = 8000;
-- "PART SIX OF NINE (combat)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_6");
LuaScriptEngine.WaitMSec(3000);
-- "When you hover your cursor over someone, your cursor changes to let you know that you can attack them. Double-clicking them will attack them. You can also cycle through targets with the tab key."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_44_attacking");
tutorial:scriptPlayMusic(1553); -- sound/tut_44_attacking.snd
-- LuaScriptEngine.WaitMSec(5000);
delayLeft = 5000;
-- to be used when combat starts.
while (scriptSupport:npcInCombat(npcBanditId) == false) do
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
-- fight for about 3 min, don't let the player over the bridge.
-- if player HAM goes below 50%, let the Bandit use his grenade.
-- if player pulls out of the fight, restart the time to completion.
local combatMaxDuration = 300000; -- 5 minutes max to fight uninterrupted and have fun!
-- local combatMaxDuration = 15000; -- 1 minute to fight and have fun!
local combatTimer = combatMaxDuration;
-- Main combat loop, continue here until npc is dead.
-- We are in combat. Check player and target HAM.
while (scriptSupport:npcIsDead(npcBanditId) == false) do
if (tutorial:isLowHam(npcBanditId, 200) == true) then
combatTimer = 0;
end;
if ((scriptSupport:npcInCombat(npcBanditId) == true) and (scriptSupport:npcInCombat(playerId) == true)) then
if (combatTimer > 0) then
combatTimer = combatTimer - 500;
LuaScriptEngine.WaitMSec(500);
else
-- Blow the grenade.
tutorial:npcStopFight(npcBanditId);
tutorial:spatialChat(npcBanditId, "@newbie_tutorial/newbie_convo:pirate_taunt3");
LuaScriptEngine.WaitMSec(2000);
tutorial:spatialChat(npcBanditId, "@newbie_tutorial/newbie_convo:pirate_taunt4");
LuaScriptEngine.WaitMSec(250);
scriptSupport:npcKill(npcBanditId);
scriptSupport:scriptSystemMessage(playerId, npcBanditId, "clienteffect/combat_grenade_proton.cef");
-- scriptSupport:npcKill(npcBanditId);
end;
else
-- We pulled out of combat, to bad.
-- print("Out of combat");
combatTimer = combatMaxDuration;
LuaScriptEngine.WaitMSec(500);
end;
-- Don't let the player over the bridge.
local playerPosX = tutorial:getPlayerPosX();
local playerPosY = tutorial:getPlayerPosY();
local playerPosZ = tutorial:getPlayerPosZ();
if (playerPosX < 17) and (playerPosZ < -106) then
scriptSupport:setPlayerPosition(playerId, cellBandit, 19, playerPosY, -112);
end;
end;
tutorial:setSubState(19);
-- wait until sound has stopped.
LuaScriptEngine.WaitMSec(6000);
-- "Congratulations! The pirate has been destroyed. Now you can loot his corpse by clicking and holding your mouse on him until you get the radial menu option to LOOT."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:loot_pirate");
tutorial:scriptPlayMusic(3705); -- sound/tut_00_congratulations.snd
delayLeft = 2500;
elseif subState == 19 then -- Part 7
tutorial:enableHudElement("all"); -- Enable full UI
-- Have to check the existance of the trainer, since in test mode, we may enter here more than once.
if (npcSkillTrainerId == nil) then
-- spawn your dedicated skill trainer.
npcSkillTrainerTypeId = tutorial:getSkillTrainerTypeId();
if (npcSkillTrainerTypeId ~= 0) then
npcSkillTrainer, npcSkillTrainerId = createAndSpawnNpc(npcSkillTrainerTypeId, "", "", cellSkillTrainer, yDirSkillTrainer, wDirSkillTrainer, xPosSkillTrainer, yPosSkillTrainer, zPosSkillTrainer);
-- print("Spawned NPC");
else
-- Invalid skill trainer type id, we have to abort the script.
print("Failed spawning NPC");
state = 2;
break;
end;
tutorial:setTutorialCelebTaunts(celeb_guy1_Id);
tutorial:setTutorialCelebTaunts(celeb_guy2_Id);
tutorial:setTutorialRefugeeTaunts(refugee_guy1_id);
tutorial:setTutorialRefugeeTaunts(refugee_guy2_id);
tutorial:setTutorialRefugeeTaunts(refugee_guy3_id);
end;
-- special for testing
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- LuaScriptEngine.WaitMSec(7000);
-- Enable when re-testing combat.
-- tutorial:scriptSystemMessage("Developer message: If you want to help us test combat again, go back to the imperial officer in the previous room.");
-- tutorial:scriptSystemMessage("When there, you are ready for a new fight. No logout is required.");
while (tutorial:getRoom() ~= 9) do
-- Enable when re-testing combat.
-- LuaScriptEngine.WaitMSec(500);
-- if delayLeft > 0 then
-- delayLeft = delayLeft - 500
-- end
-- special for testing.
-- if tutorial:getRoom() == 7 then
-- tutorial:setSubState(17);
-- tutorial:scriptSystemMessage("Developer message: You are now ready for a new fight. Go back and kill that Pirate.");
-- tutorial:scriptSystemMessage("Thank you, all help with testing is appreciated!");
-- break
-- end
local count;
for count = 1,60 do
if (tutorial:getRoom() == 9) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
if (tutorial:getRoom() ~= 9) then
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(685); -- sound/tut_52_walkdown.snd
delayLeft = 3000;
end;
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- Enable when re-testing combat.
-- if (tutorial:getSubState() == 19) then
tutorial:enableNpcConversationEvent(npcOfficerWithTrainerId);
-- "PART SEVEN OF NINE (skill training)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_7");
LuaScriptEngine.WaitMSec(2000);
tutorial:spatialChat(npcOfficerWithTrainerId, "@newbie_tutorial/newbie_convo:off_1_greeting"); -- off_1_greeting
LuaScriptEngine.WaitMSec(1000);
while tutorial:isNpcConversationStarted(npcOfficerWithTrainerId) == false do
-- "Converse with the soldier."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_40");
tutorial:scriptPlayMusic(957); -- sound/tut_40_converse.snd -- Converse with the soldier.
delayLeft = 3000;
local count;
for count = 1,60 do
if tutorial:isNpcConversationStarted(npcOfficerWithTrainerId) == true then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
end
while tutorial:isNpcConversationEnded(npcOfficerWithTrainerId) == false do
LuaScriptEngine.WaitMSec(500);
end;
-- if the player already have trained, do not force him to converse with trainer.
if tutorial:isPlayerTrained() == false then
tutorial:enableNpcConversationEvent(npcSkillTrainerId);
tutorial:spatialChat(npcSkillTrainerId, "@newbie_tutorial/newbie_convo:trainer_grunt"); -- trainer_grunt
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
while tutorial:isPlayerTrained() == false do
-- "The Imperial Officer has directed you to a Skill Trainer. Converse with the Skill Trainer to learn your first skill."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_49");
tutorial:scriptPlayMusic(3821); -- sound/tut_49_skilltrainer.snd
delayLeft = 3000;
local count;
for count = 1,120 do
if tutorial:isPlayerTrained() == true then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
end
-- Wait for end of conversation.
while tutorial:isNpcConversationEnded(npcSkillTrainerId) == false do
LuaScriptEngine.WaitMSec(500);
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
end;
LuaScriptEngine.WaitMSec(3000);
-- "You've picked up your first skill. There are many skills to master in your chosen profession and there are advanced professions that only open up once you have mastered many skills. You can check your skills using the skills window. You can reach this with the skills button on the button bar, or by pressing CTRL-S."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_50");
tutorial:scriptPlayMusic(883); -- sound/tut_50_skillbrowser.snd
LuaScriptEngine.WaitMSec(25000);
-- "You can also check your character status after your fight, by pressing the character-sheet button on the button bar, or CTRL-C."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_51");
tutorial:scriptPlayMusic(3773); -- sound/tut_51_charactersheet.snd
-- LuaScriptEngine.WaitMSec(12000);
delayLeft = 12000;
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(685); -- sound/tut_52_walkdown.snd
delayLeft = 3000;
tutorial:setSubState(20);
-- end;
elseif subState == 20 then
tutorial:enableHudElement("all"); -- Enable full UI
-- Wait until we enter the mission terminal room.
while tutorial:getRoom() ~= 10 do
local count;
for count = 1,60 do
if (tutorial:getRoom() == 10) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
if (tutorial:getRoom() ~= 10) then
-- "Proceed to the next room."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:visit_commerce_room");
tutorial:scriptPlayMusic(685); -- sound/tut_52_walkdown.snd
delayLeft = 3000;
end;
end;
tutorial:setSubState(21);
elseif subState == 21 then -- Part 8
tutorial:enableNpcConversationEvent(npcOfficerInMissionRoomId);
tutorial:enableHudElement("all"); -- Enable full UI
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART EIGHT OF NINE (missions and waypoints)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_8");
LuaScriptEngine.WaitMSec(3000);
-- "Mission terminals like those to your left are located throughout the world. Whenever you want a quick adventure you can always take a job from a mission terminal."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_53");
tutorial:scriptPlayMusic(3591); -- sound/tut_53_missions.snd
LuaScriptEngine.WaitMSec(10000);
-- "Waypoints indicate destinations. When you have a job or mission, you can follow the waypoint on your radar. They appear light blue."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_55_waypoints");
tutorial:scriptPlayMusic(2887); -- sound/tut_55_waypoints.snd
LuaScriptEngine.WaitMSec(10000);
-- "You can also speak to npcs and do tasks for them. There's one over there who has something for you to do."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_54");
tutorial:scriptPlayMusic(131); -- sound/sound/tut_54_npcmission.snd.snd
LuaScriptEngine.WaitMSec(2000);
tutorial:npcSendAnimation(npcCommonerInMissionRoomId, 7, npcOfficerInMissionRoomId);
delayLeft = 5000;
tutorial:setSubState(22); -- Going to get the release documents.
elseif subState == 22 then
tutorial:enableNpcConversationEvent(npcOfficerInMissionRoomId);
tutorial:enableHudElement("all"); -- Enable full UI
local missionTerminalSelected = false;
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
if (scriptSupport:getTarget(playerId) == missionTerminalId) then
missionTerminalSelected = true;
-- "You cannot take a mission from this terminal. To take a mission, you will need to find a mission terminal on a planet."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:mission_terminal");
tutorial:scriptPlayMusic(3397); -- sound/tut_00_mission_terminal.snd
delayLeft = 5000;
tutorial:updateTutorial("changeLookAtTarget");
else
tutorial:updateTutorial("changeLookAtTarget");
end;
while tutorial:isNpcConversationStarted(npcOfficerInMissionRoomId) == false do
tutorial:spatialChat(npcOfficerInMissionRoomId, "@newbie_tutorial/newbie_convo:mission_hail"); -- mission_hail
-- LuaScriptEngine.WaitMSec(3000);
-- delayLeft = 3000;
local count;
for count = 1,60 do
if (tutorial:isNpcConversationStarted(npcOfficerInMissionRoomId) == true) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
if (tutorial:isChangeLookAtTarget() == true) then
-- Is it the correct target?
if (scriptSupport:getTarget(playerId) == missionTerminalId) then
if (missionTerminalSelected == false) then
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
missionTerminalSelected = true;
-- "You cannot take a mission from this terminal. To take a mission, you will need to find a mission terminal on a planet."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:mission_terminal");
tutorial:scriptPlayMusic(3397); -- sound/tut_00_mission_terminal.snd
delayLeft = 5000;
tutorial:updateTutorial("changeLookAtTarget");
end;
else
tutorial:updateTutorial("changeLookAtTarget");
missionTerminalSelected = false;
end;
end;
end;
-- tutorial:spatialChat(npcOfficerInMissionRoomId, "You there. No time for that now. I've got something for you to do."); -- mission_hail
end
while tutorial:isNpcConversationEnded(npcOfficerInMissionRoomId) == false do
LuaScriptEngine.WaitMSec(500);
if (tutorial:isChangeLookAtTarget() == true) then
-- Is it the correct target?
if (scriptSupport:getTarget(playerId) == missionTerminalId) then
if (missionTerminalSelected == false) then
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
missionTerminalSelected = true;
-- "You cannot take a mission from this terminal. To take a mission, you will need to find a mission terminal on a planet."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:mission_terminal");
tutorial:scriptPlayMusic(3397); -- sound/tut_00_mission_terminal.snd
delayLeft = 5000;
tutorial:updateTutorial("changeLookAtTarget");
end;
else
tutorial:updateTutorial("changeLookAtTarget");
missionTerminalSelected = false;
end;
end;
end;
delayLeft = 1000;
-- Will end up in state 23 when finishing the conversation...
elseif subState == 23 then
tutorial:enableHudElement("all"); -- Enable full UI
-- Wait until we enter the mission terminal room.
while tutorial:getRoom() ~= 11 do
-- "Move to the next room to deliver your release documents to the Quartermaster."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_56");
tutorial:scriptPlayMusic(1731); -- sound/tut_56_quartermaster.snd
delayLeft = 3000;
local count;
for count = 1,60 do
if (tutorial:getRoom() == 11) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end;
end;
tutorial:setSubState(24);
elseif subState == 24 then -- Part 9
tutorial:enableHudElement("all"); -- Enable full UI
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "PART NINE OF NINE (bye!)"
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:part_9");
LuaScriptEngine.WaitMSec(1000);
tutorial:spatialChat(npcQuartermasterId, "@newbie_tutorial/newbie_convo:quarter_greeting"); -- quarter_greeting
LuaScriptEngine.WaitMSec(1000);
tutorial:setSubState(25);
elseif subState == 25 then -- Continue part 9
tutorial:enableNpcConversationEvent(npcQuartermasterId);
tutorial:enableHudElement("all"); -- Enable full UI
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
while tutorial:isNpcConversationStarted(npcQuartermasterId) == false do
-- "Converse with the Quartermaster."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:tut_57");
tutorial:scriptPlayMusic(1893); -- sound/tut_57_quartermaster.snd
LuaScriptEngine.WaitMSec(3000);
delayLeft = 3000;
local count;
for count = 1,60 do
if (tutorial:isNpcConversationStarted(npcQuartermasterId) == true) then
break
end
LuaScriptEngine.WaitMSec(500);
if delayLeft > 0 then
delayLeft = delayLeft - 500
end
end
end
while (tutorial:isNpcConversationEnded(npcQuartermasterId) == false) do
LuaScriptEngine.WaitMSec(500);
end;
delayLeft = 1000;
elseif subState == 26 then -- Continue part 9
tutorial:enableHudElement("all"); -- Enable full UI
LuaScriptEngine.WaitMSec(delayLeft);
delayLeft = 0;
-- "Select your destination by clicking on one of the planets on the screen. When you have selected the planet, select which city you wish to travel to by clicking on the picture to the right of the screen. When you are ready to travel to the city, click on the arrow in the lower right-hand corner of the screen."
-- tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:select_dest");
state = 2;
-- LuaScriptEngine.WaitMSec(3000);
-- tutorial:scriptSystemMessage("This is the end, for now.");
end
end
if state == 3 then
-- No funny business
tutorial:enableHudElement("all"); -- Enable full UI
-- "Welcome to Star Wars Galaxies."
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:welcome");
tutorial:scriptPlayMusic(1267); -- sound/tut_01_welcome.snd
LuaScriptEngine.WaitMSec(5000);
-- Stat Migration Sililoquy.
tutorial:scriptSystemMessage("@newbie_tutorial/system_messages:stat_migration");
tutorial:scriptPlayMusic(1838);
end | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/North_Gustaberg/npcs/Shigezane_IM.lua | 28 | 3150 | -----------------------------------
-- Area: North Gustaberg
-- NPC: Shigezane, I.M.
-- Type: Outpost Conquest Guards
-- @pos -584.687 39.107 54.281 106
-------------------------------------
package.loaded["scripts/zones/North_Gustaberg/TextIDs"] = nil;
-------------------------------------
require("scripts/globals/conquest");
require("scripts/zones/North_Gustaberg/TextIDs");
local guardnation = BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 3; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = GUSTABERG;
local csid = 0x7ff9;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
vilarion/Illarion-Content | triggerfield/labour_camp_dumping.lua | 3 | 4836 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- INSERT INTO triggerfields VALUES (-492,-489,-40,'triggerfield.labour_camp_dumping');
-- INSERT INTO triggerfields VALUES (-492,-488,-40,'triggerfield.labour_camp_dumping');
-- INSERT INTO triggerfields VALUES (-491,-488,-40,'triggerfield.labour_camp_dumping');
-- INSERT INTO triggerfields VALUES (-491,-489,-40,'triggerfield.labour_camp_dumping');
local common = require("base.common")
local townTreasure = require("base.townTreasure")
local character = require("base.character")
local M = {}
function M.PutItemOnField(Item,User)
-- coal, iron, copper, gold, silver; more resources can be added
if Item.id == 21 or Item.id == 22 or Item.id == 2536 or Item.id == 234 or Item.id == 1062 then
local FactionImpr = User:getQuestProgress(26) -- faction which imprisoned the char
local town
if FactionImpr == 1 then
town = "Cadomyr"
elseif FactionImpr == 2 then
town = "Runewick"
elseif FactionImpr == 3 then
town = "Galmair"
elseif FactionImpr == 0 then
town = "None"
end
local workLoad = User:getQuestProgress(25)
if town then -- security check: only if the char as been sent to forced labour by a faction
local theItemStats = world:getItemStats(Item)
local itemNumberPay = common.Limit(Item.number,0,workLoad) -- we do only count the items a char has to deliver
local payToFaction = itemNumberPay * theItemStats.Worth * 0.1 -- 10% of teh value
if town ~= "None" then
townTreasure.ChangeTownTreasure(town, payToFaction) -- add to the town treasure
log(string.format("[donation][camp] %s handed %u %s (%u) over. Faction wealth of %s increased by %d copper to %d copper.",
character.LogText(User), Item.number, world:getItemName(Item.id,Player.english), Item.id, town, payToFaction, townTreasure.GetTownTreasure(town)))
end
-- reduce work load of char
if (workLoad - Item.number) <= 0 then
if workLoad > 0 then -- the char was actually still forced to work, inform him that he's free
local myNpc = world:getNPCSInRangeOf(position(-495, -484, -40), 10)
for i = 1, #myNpc do
if myNpc[i].name == "Percy Dryless" then -- check if it is the camp leader
myNpc[i]:talk(Character.say, "So, du Wicht, du hast deine Strafe abgearbeitet. Hau ab!", "Now, you runt, you're done with your punishment. Get lost!")
break
end
end
common.InformNLS(User, "Freiheit!", "Freedom!")
else
common.InformNLS(User,
"Du bemerkt, wie der Aufseher kopfschüttelnd zu dir blickt. Deine Strafe ist doch schon längst abgearbeitet.",
"You notice that the guard looks at you, shaking his head. You are already done!")
end
User:setQuestProgress(25, 0)
User:setQuestProgress(26, 0)
else
User:setQuestProgress(25, workLoad - Item.number)
common.InformNLS(User,
"Du bemerkt, wie der Aufseher sich kurz etwas notiert. Scheinbar noch nicht deine letzte Ladung. Du musst noch "..(workLoad - Item.number).." Bodenschätze abliefern.",
"You notice that the guard seems to take a short note. Obviously, not your last charge. You still have to deliver "..(workLoad - Item.number).." resources.")
end
end
world:gfx(46, Item.pos)
world:erase(Item, Item.number)
end
end
function M.MoveToField(User)
-- check for spam and put a new spam marker in case it is no spam
if common.spamProtect(User, 5) then
return
end
common.InformNLS(User,
"Ein seltsames Kribbeln erfüllt dich. Auf dieser Plattform müssen die Rohstoffe scheinbar abgelegt werden.",
"You feel a strange prickling. This platform is the place where you have to bring the resources to.")
end
return M
| agpl-3.0 |
Quenty/NevermoreEngine | src/playerinputmode/src/Server/PlayerInputModeService.lua | 1 | 1750 | --[=[
@class PlayerInputModeService
]=]
local require = require(script.Parent.loader).load(script)
local GetRemoteEvent = require("GetRemoteEvent")
local Maid = require("Maid")
local PlayerInputModeServiceConstants = require("PlayerInputModeServiceConstants")
local PlayerInputModeUtils = require("PlayerInputModeUtils")
local PlayerInputModeService = {}
PlayerInputModeService.ServiceName = "PlayerInputModeService"
function PlayerInputModeService:Init(serviceBag)
assert(not self._serviceBag, "Already initialized")
self._serviceBag = assert(serviceBag, "No serviceBag")
self._maid = Maid.new()
end
function PlayerInputModeService:Start()
self._remoteEvent = GetRemoteEvent(PlayerInputModeServiceConstants.REMOTE_EVENT_NAME)
self._maid:GiveTask(self._remoteEvent.OnServerEvent:Connect(function(...)
self:_handleServerEvent(...)
end))
end
function PlayerInputModeService:GetPlayerInputModeType(player)
return PlayerInputModeUtils.getPlayerInputModeType(player)
end
function PlayerInputModeService:ObservePlayerInputType(player)
assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
return PlayerInputModeUtils.observePlayerInputModeType(player)
end
function PlayerInputModeService:_handleServerEvent(player, request, ...)
if request == PlayerInputModeServiceConstants.REQUEST_SET_INPUT_MODE then
self:_setPlayerInputModeType(player, ...)
else
error(("[PlayerInputModeService] - Bad request %q"):format(tostring(request)))
end
end
function PlayerInputModeService:_setPlayerInputModeType(player, inputModeType)
assert(PlayerInputModeUtils.isInputModeType(inputModeType), "Bad inputModeType")
PlayerInputModeUtils.setPlayerInputModeType(player, inputModeType)
end
return PlayerInputModeService | mit |
keshwans/vlc | share/lua/playlist/anevia_streams.lua | 112 | 3664 | --[[
$Id$
Parse list of available streams on Anevia Toucan servers.
The URI http://ipaddress:554/list_streams.idp describes a list of
available streams on the server.
Copyright © 2009 M2X BV
Authors: Jean-Paul Saman <jpsaman@videolan.org>
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.
--]]
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "list_streams.idp" )
end
-- Parse function.
function parse()
p = {}
_,_,server = string.find( vlc.path, "(.*)/list_streams.idp" )
while true do
line = vlc.readline()
if not line then break end
if string.match( line, "<streams[-]list> </stream[-]list>" ) then
break
elseif string.match( line, "<streams[-]list xmlns=\"(.*)\">" ) then
while true do
line = vlc.readline()
if not line then break end
if string.match( line, "<streamer name=\"(.*)\"> </streamer>" ) then
break;
elseif string.match( line, "<streamer name=\"(.*)\">" ) then
_,_,streamer = string.find( line, "name=\"(.*)\"" )
while true do
line = vlc.readline()
if not line then break end
-- ignore <host name=".." /> tags
-- ignore <port number=".." /> tags
if string.match( line, "<input name=\"(.*)\">" ) then
_,_,path = string.find( line, "name=\"(.*)\"" )
while true do
line = vlc.readline()
if not line then break end
if string.match( line, "<stream id=\"(.*)\" />" ) then
_,_,media = string.find( line, "id=\"(.*)\"" )
video = "rtsp://" .. tostring(server) .. "/" .. tostring(path) .. "/" .. tostring(media)
vlc.msg.dbg( "adding to playlist " .. tostring(video) )
table.insert( p, { path = video; name = media, url = video } )
end
-- end of input tag found
if string.match( line, "</input>" ) then
break
end
end
end
end
if not line then break end
-- end of streamer tag found
if string.match( line, "</streamer>" ) then
break
end
end
if not line then break end
-- end of streams-list tag found
if string.match( line, "</streams-list>" ) then
break
end
end
end
end
return p
end
| gpl-2.0 |
ffxiphoenix/darkstar | scripts/zones/RuLude_Gardens/npcs/Albiona.lua | 34 | 1387 | -----------------------------------
-- Area: Ru'Lude Gardens
-- NPC: Albiona
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/RuLude_Gardens/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/RuLude_Gardens/TextIDs");
require("scripts/globals/quests");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local WildcatJeuno = player:getVar("WildcatJeuno");
if (player:getQuestStatus(JEUNO,LURE_OF_THE_WILDCAT_JEUNO) == QUEST_ACCEPTED and player:getMaskBit(WildcatJeuno,0) == false) then
player:startEvent(10089);
else
player:startEvent(0x0092);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 10089) then
player:setMaskBit(player:getVar("WildcatJeuno"),"WildcatJeuno",0,true);
end
end;
| gpl-3.0 |
Quenty/NevermoreEngine | src/ik/src/Shared/Arm/ArmIKBase.story.lua | 1 | 1323 | --[[
@class ArmIKBase.story
]]
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")
local Maid = require("Maid")
local RigBuilderUtils = require("RigBuilderUtils")
local ArmIKBase = require("ArmIKBase")
return function(_target)
local maid = Maid.new()
maid:GivePromise(RigBuilderUtils.promisePlayerRig(4397833)):Then(function(character)
maid:GiveTask(character)
local humanoid = character.Humanoid
local position = Workspace.CurrentCamera.CFrame:pointToWorldSpace(Vector3.new(0, 0, -10))
local armIKBase = ArmIKBase.new(humanoid, "Right")
maid:GiveTask(armIKBase)
local attachment = Instance.new("Attachment")
attachment.Name = "IKRigStoryTarget"
attachment.Parent = workspace.Terrain
attachment.WorldPosition = position + Workspace.CurrentCamera.CFrame:vectorToWorldSpace(Vector3.new(2, 0, 1))
maid:GiveTask(attachment)
armIKBase:Grip(attachment)
humanoid.RootPart.CFrame = CFrame.new(position)
character.Parent = workspace
humanoid.RootPart.CFrame = CFrame.new(position)
maid:GiveTask(RunService.RenderStepped:Connect(function()
armIKBase:Update()
end))
end)
return function()
maid:DoCleaning()
end
end | mit |
amiranony/anonybot | plugins/bugzilla.lua | 611 | 3983 | do
local BASE_URL = "https://bugzilla.mozilla.org/rest/"
local function bugzilla_login()
local url = BASE_URL.."login?login=" .. _config.bugzilla.username .. "&password=" .. _config.bugzilla.password
print("accessing " .. url)
local res,code = https.request( url )
local data = json:decode(res)
return data
end
local function bugzilla_check(id)
-- data = bugzilla_login()
local url = BASE_URL.."bug/" .. id .. "?api_key=" .. _config.bugzilla.apikey
-- print(url)
local res,code = https.request( url )
local data = json:decode(res)
return data
end
local function bugzilla_listopened(email)
local url = BASE_URL.."bug?include_fields=id,summary,status,whiteboard,resolution&email1=" .. email .. "&email2=" .. email .. "&emailassigned_to2=1&emailreporter1=1&emailtype1=substring&emailtype2=substring&f1=bug_status&f2=bug_status&n1=1&n2=1&o1=equals&o2=equals&resolution=---&v1=closed&v2=resolved&api_key=" .. _config.bugzilla.apikey
local res,code = https.request( url )
print(res)
local data = json:decode(res)
return data
end
local function run(msg, matches)
local response = ""
if matches[1] == "status" then
local data = bugzilla_check(matches[2])
vardump(data)
if data.error == true then
return "Sorry, API failed with message: " .. data.message
else
response = "Bug #"..matches[1]..":\nReporter: "..data.bugs[1].creator
response = response .. "\n Last update: "..data.bugs[1].last_change_time
response = response .. "\n Status: "..data.bugs[1].status.." "..data.bugs[1].resolution
response = response .. "\n Whiteboard: "..data.bugs[1].whiteboard
response = response .. "\n Access: https://bugzilla.mozilla.org/show_bug.cgi?id=" .. matches[1]
print(response)
end
elseif matches[1] == "list" then
local data = bugzilla_listopened(matches[2])
vardump(data)
if data.error == true then
return "Sorry, API failed with message: " .. data.message
else
-- response = "Bug #"..matches[1]..":\nReporter: "..data.bugs[1].creator
-- response = response .. "\n Last update: "..data.bugs[1].last_change_time
-- response = response .. "\n Status: "..data.bugs[1].status.." "..data.bugs[1].resolution
-- response = response .. "\n Whiteboard: "..data.bugs[1].whiteboard
-- response = response .. "\n Access: https://bugzilla.mozilla.org/show_bug.cgi?id=" .. matches[1]
local total = table.map_length(data.bugs)
print("total bugs: " .. total)
local response = "There are " .. total .. " number of bug(s) assigned/reported by " .. matches[2]
if total > 0 then
response = response .. ": "
for tableKey, bug in pairs(data.bugs) do
response = response .. "\n #" .. bug.id
response = response .. "\n Status: " .. bug.status .. " " .. bug.resolution
response = response .. "\n Whiteboard: " .. bug.whiteboard
response = response .. "\n Summary: " .. bug.summary
end
end
end
end
return response
end
-- (table)
-- [bugs] = (table)
-- [1] = (table)
-- [status] = (string) ASSIGNED
-- [id] = (number) 927704
-- [whiteboard] = (string) [approved][full processed]
-- [summary] = (string) Budget Request - Arief Bayu Purwanto - https://reps.mozilla.org/e/mozilla-summit-2013/
-- [2] = (table)
-- [status] = (string) ASSIGNED
-- [id] = (number) 1049337
-- [whiteboard] = (string) [approved][full processed][waiting receipts][waiting report and photos]
-- [summary] = (string) Budget Request - Arief Bayu Purwanto - https://reps.mozilla.org/e/workshop-firefox-os-pada-workshop-media-sosial-untuk-perubahan-1/
-- total bugs: 2
return {
description = "Lookup bugzilla status update",
usage = "/bot bugzilla [bug number]",
patterns = {
"^/bugzilla (status) (.*)$",
"^/bugzilla (list) (.*)$"
},
run = run
}
end | gpl-2.0 |
hughperkins/cltorch | src/FFI.lua | 1 | 1168 | local ok, ffi = pcall(require, 'ffi')
if ok then
local cdefs = [[
typedef struct THClStorage
{
int device;
float *data;
void *cl;
void *wrapper;
long size;
int refcount;
char flag;
void *allocator;
void *allocatorContext;
struct THClStorage *view;
} THClStorage;
typedef struct THClTensor
{
long *size;
long *stride;
int nDimension;
THClStorage *storage;
long storageOffset;
int refcount;
char flag;
int device;
} THClTensor;
]]
ffi.cdef(cdefs)
local Storage = torch.getmetatable('torch.ClStorage')
local Storage_tt = ffi.typeof('THClStorage**')
rawset(Storage, "cdata", function(self) return Storage_tt(self)[0] end)
rawset(Storage, "data", function(self) return Storage_tt(self)[0].data end)
-- Tensor
local Tensor = torch.getmetatable('torch.ClTensor')
local Tensor_tt = ffi.typeof('THClTensor**')
rawset(Tensor, "cdata", function(self) return Tensor_tt(self)[0] end)
rawset(Tensor, "data",
function(self)
self = Tensor_tt(self)[0]
return self.storage ~= nil and self.storage.data + self.storageOffset or nil
end
)
end
| bsd-3-clause |
ffxiphoenix/darkstar | scripts/globals/weaponskills/sniper_shot.lua | 30 | 1451 | -----------------------------------
-- Sniper Shot
-- Marksmanship weapon skill
-- Skill Level: 80
-- Lowers enemy's INT. Chance of params.critical varies with TP.
-- Aligned with the Flame Gorget & Light Gorget.
-- Aligned with the Flame Belt & Light Belt.
-- Element: None
-- Modifiers: AGI:70%
-- 100%TP 200%TP 300%TP
-- 1.00 1.00 1.00
-----------------------------------
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID)
local params = {};
params.numHits = 1;
params.ftp100 = 1; params.ftp200 = 1; params.ftp300 = 1;
params.str_wsc = 0.0; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.3; params.int_wsc = 0.0; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.crit100 = 0.0; params.crit200 = 0.0; params.crit300 = 0.0;
params.canCrit = false;
params.acc100 = 0.0; params.acc200= 0.0; params.acc300= 0.0;
params.atkmulti = 1;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.agi_wsc = 0.7;
end
local damage, tpHits, extraHits = doRangedWeaponskill(player, target, params);
if damage > 0 and (target:hasStatusEffect(EFFECT_INT_DOWN) == false) then
target:addStatusEffect(EFFECT_INT_DOWN, 10, 0, 140);
end
damage = damage * WEAPON_SKILL_POWER
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Port_Jeuno/npcs/_6u4.lua | 17 | 1390 | -----------------------------------
-- Area: Port Jeuno
-- NPC: Door: Departures Exit (for San D'Oria)
-- @zone 246
-- @pos -76 8 54
-----------------------------------
package.loaded["scripts/zones/Port_Jeuno/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/zones/Port_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(AIRSHIP_PASS) == true and player:getGil() >= 200) then
player:startEvent(0x0026);
else
player:startEvent(0x002e);
end
return 1;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x0026) then
Z = player:getZPos();
if (Z >= 58 and Z <= 61) then
player:delGil(200);
end
end
end; | gpl-3.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[race]/race/edf/edf_client_cp_lines.lua | 4 | 6019 | --
-- edf_client_cp_lines.lua
--
-- Visualization of checkpoint connections for race
-- Use command 'cplines' to toggle display
--
local showHelpText = true
local showCheckpointLines = true
local updatesPerFrame = 10 -- How many checkpoints to update per frame
local lineList = {}
local curIdx = 0
local startTime = getTickCount()
--
-- Handle cplines command
--
addCommandHandler( "cplines",
function(command, arg1, arg2)
if arg1 == "0" then
showCheckpointLines = false
elseif arg1 == "1" then
showCheckpointLines = true
else
showCheckpointLines = not showCheckpointLines
end
outputChatBox( "cplines is now " .. (showCheckpointLines and 1 or 0) )
end
)
function drawCheckpointConnections()
local checkpoints = getElementsByType("checkpoint")
-- Trim line list
while #lineList > #checkpoints do
table.remove( lineList, #lineList )
end
-- Update line list (a few cps at a time)
local numToDo = math.min( updatesPerFrame, #checkpoints )
for i=1,numToDo do
curIdx = curIdx % #checkpoints
local checkpoint = checkpoints[curIdx + 1]
lineList[curIdx + 1] = false
local nextID = exports.edf:edfGetElementProperty ( checkpoint, "nextid" )
if isElement(nextID) then
local dx,dy,dz = exports.edf:edfGetElementPosition(nextID)
if dx then
local sx,sy,sz = exports.edf:edfGetElementPosition(checkpoint)
if sx then
-- Make arrow points
local s = Vector3D:new(sx,sy,sz+1)
local d = Vector3D:new(dx,dy,dz+1)
local dir = d:SubV(s)
local length = dir:Length()
local mid = s:AddV(dir:Mul(0.5))
dir:Normalize()
local left = dir:CrossV(Vector3D:new(0,0,1))
left.z = 0
left:Normalize()
left = left:Mul(2)
local p = d:SubV(dir:Mul(3))
local p1 = p:AddV(left)
local p2 = p:SubV(left)
lineList[curIdx + 1] = {s=s,d=d,p1=p1,p2=p2,m=mid,length=length}
end
end
end
curIdx = curIdx + 1
end
-- Draw line list
if showCheckpointLines then
local postGui = not isCursorShowing() and not isMTAWindowActive()
local camX,camY,camZ = getCameraMatrix()
for i,line in ipairs(lineList) do
if line then
local dist = getDistanceBetweenPoints3D( camX, camY, camZ, line.m.x, line.m.y, line.m.z )
local maxdist = math.max(300,line.length / 1.5)
if dist < maxdist then
-- Alpha calculation
local alpha = math.unlerpclamped( maxdist, dist, 10 ) * 255
-- Color calculation
local pos = i / #lineList
local invpos = 1 - pos
local color = tocolor(pos*255,0,invpos*255,alpha)
-- Line width - Make it bigger if far away, to stop shimmering
local width = 10
if dist > 100 then
width = width + (dist-100)/20
end
dxDrawLine3D ( line.s.x,line.s.y,line.s.z, line.d.x,line.d.y,line.d.z, color, width, postGui )
dxDrawLine3D ( line.d.x,line.d.y,line.d.z, line.p1.x,line.p1.y,line.p1.z, color, width, postGui )
dxDrawLine3D ( line.d.x,line.d.y,line.d.z, line.p2.x,line.p2.y,line.p2.z, color, width, postGui )
end
end
end
end
-- Draw help text
if startTime then
local delta = getTickCount() - startTime
if delta > 14000 then
startTime = false
end
if showHelpText then
local scx,scy = guiGetScreenSize()
local alpha = math.unlerpclamped( 2000, delta, 4000 ) * math.unlerpclamped( 14000, delta, 10000 )
local x,y = 10, scy * 0.6
local font = "default-bold"
local scale = 2
local postGui = true
dxDrawRectangle( x-5, y-5, scale*300, scale*32+10, tocolor(0,0,0,alpha*128), postGui )
dxDrawText( "race edf commands:", x, y, x, y, tocolor(255,255,0,alpha*255), scale, font, "left", "top", false, false, postGui )
dxDrawText( "cplines - toggle checkpoint connections", x, y + scale*16, x, y, tocolor(255,255,255,alpha*255), scale, font, "left", "top", false, false, postGui )
end
end
end
addEventHandler('onClientHUDRender', root, drawCheckpointConnections)
---------------------------------------------------------------------------
-- mafs
---------------------------------------------------------------------------
function math.lerp(from,alpha,to)
return from + (to-from) * alpha
end
function math.unlerp(from,pos,to)
if ( to == from ) then
return 1
end
return ( pos - from ) / ( to - from )
end
function math.clamp(low,value,high)
return math.max(low,math.min(value,high))
end
function math.unlerpclamped(from,pos,to)
return math.clamp(0,math.unlerp(from,pos,to),1)
end
---------------------------------------------------------------------------
-- Vector3D
---------------------------------------------------------------------------
Vector3D = {
new = function(self, _x, _y, _z)
local newVector = { x = _x or 0.0, y = _y or 0.0, z = _z or 0.0 }
return setmetatable(newVector, { __index = Vector3D })
end,
Copy = function(self)
return Vector3D:new(self.x, self.y, self.z)
end,
Normalize = function(self)
local mod = self:Length()
self.x = self.x / mod
self.y = self.y / mod
self.z = self.z / mod
end,
Dot = function(self, V)
return self.x * V.x + self.y * V.y + self.z * V.z
end,
Length = function(self)
return math.sqrt(self.x * self.x + self.y * self.y + self.z * self.z)
end,
AddV = function(self, V)
return Vector3D:new(self.x + V.x, self.y + V.y, self.z + V.z)
end,
SubV = function(self, V)
return Vector3D:new(self.x - V.x, self.y - V.y, self.z - V.z)
end,
CrossV = function(self, V)
return Vector3D:new(self.y * V.z - self.z * V.y,
self.z * V.x - self.x * V.z,
self.x * V.y - self.y * V.z)
end,
Mul = function(self, n)
return Vector3D:new(self.x * n, self.y * n, self.z * n)
end,
Div = function(self, n)
return Vector3D:new(self.x / n, self.y / n, self.z / n)
end,
}
| mit |
hewei-chn/resurgence | lib/proxy/commands.lua | 2 | 3636 | --[[ $%BEGINLICENSE%$
Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the
License.
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 St, Fifth Floor, Boston, MA
02110-1301 USA
$%ENDLICENSE%$ --]]
module("proxy.commands", package.seeall)
---
-- map the constants to strings
-- lua starts at 1
local command_names = {
"COM_SLEEP",
"COM_QUIT",
"COM_INIT_DB",
"COM_QUERY",
"COM_FIELD_LIST",
"COM_CREATE_DB",
"COM_DROP_DB",
"COM_REFRESH",
"COM_SHUTDOWN",
"COM_STATISTICS",
"COM_PROCESS_INFO",
"COM_CONNECT",
"COM_PROCESS_KILL",
"COM_DEBUG",
"COM_PING",
"COM_TIME",
"COM_DELAYED_INSERT",
"COM_CHANGE_USER",
"COM_BINLOG_DUMP",
"COM_TABLE_DUMP",
"COM_CONNECT_OUT",
"COM_REGISTER_SLAVE",
"COM_STMT_PREPARE",
"COM_STMT_EXECUTE",
"COM_STMT_SEND_LONG_DATA",
"COM_STMT_CLOSE",
"COM_STMT_RESET",
"COM_SET_OPTION",
"COM_STMT_FETCH",
"COM_DAEMON",
"COM_BINLOG_DUMP"
}
---
-- split a MySQL command packet into its parts
--
-- @param packet a network packet
-- @return a table with .type, .type_name and command specific fields
function parse(packet)
local cmd = {}
cmd.type = packet:byte()
cmd.type_name = command_names[cmd.type + 1]
if cmd.type == proxy.COM_QUERY then
cmd.query = packet:sub(2)
elseif cmd.type == proxy.COM_QUIT or
cmd.type == proxy.COM_PING or
cmd.type == proxy.COM_SHUTDOWN then
-- nothing to decode
elseif cmd.type == proxy.COM_STMT_PREPARE then
cmd.query = packet:sub(2)
-- the stmt_handler_id is at the same position for both STMT_EXECUTE and STMT_CLOSE
elseif cmd.type == proxy.COM_STMT_EXECUTE or cmd.type == proxy.COM_STMT_CLOSE then
cmd.stmt_handler_id = string.byte(packet, 2) + (string.byte(packet, 3) * 256) + (string.byte(packet, 4) * 256 * 256) + (string.byte(packet, 5) * 256 * 256 * 256)
elseif cmd.type == proxy.COM_FIELD_LIST then
cmd.table = packet:sub(2)
elseif cmd.type == proxy.COM_INIT_DB or
cmd.type == proxy.COM_CREATE_DB or
cmd.type == proxy.COM_DROP_DB then
cmd.schema = packet:sub(2)
elseif cmd.type == proxy.COM_SET_OPTION then
cmd.option = packet:sub(2)
elseif cmd.type == proxy.COM_BINLOG_DUMP then
-- nothing to decode
elseif cmd.type == proxy.COM_STMT_RESET then
-- nothing to decode
else
print("[debug] (command) unhandled type name:" .. tostring(cmd.type_name) .. " byte:" .. tostring(cmd.type))
end
return cmd
end
function pretty_print(cmd)
if cmd.type == proxy.COM_QUERY or
cmd.type == proxy.COM_STMT_PREPARE then
return ("[%s] %s"):format(cmd.type_name, cmd.query)
elseif cmd.type == proxy.COM_INIT_DB then
return ("[%s] %s"):format(cmd.type_name, cmd.schema)
elseif cmd.type == proxy.COM_QUIT or
cmd.type == proxy.COM_PING or
cmd.type == proxy.COM_SHUTDOWN then
return ("[%s]"):format(cmd.type_name)
elseif cmd.type == proxy.COM_FIELD_LIST then
-- should have a table-name
return ("[%s]"):format(cmd.type_name)
elseif cmd.type == proxy.COM_STMT_EXECUTE then
return ("[%s] %s"):format(cmd.type_name, cmd.stmt_handler_id)
end
return ("[%s] ... no idea"):format(cmd.type_name)
end
| gpl-2.0 |
thisisali/gbbot | plugins/about.lua | 1 | 2506 | local action = function(msg, blocks, ln)
--ignore if via pm
if msg.chat.type == 'private' then
api.sendMessage(msg.from.id, lang[ln].pv)
return nil
end
local hash = 'chat:'..msg.chat.id..':about'
if blocks[1] == 'about' then
local out = cross.getAbout(msg.chat.id, ln)
if is_locked(msg, 'About') and not is_mod(msg) then
api.sendMessage(msg.from.id, out, true)
else
api.sendReply(msg, out, true)
end
mystat('/about')
end
if blocks[1] == 'addabout' then
--ignore if not mod
if not is_mod(msg) then
api.sendReply(msg, lang[ln].not_mod, true)
return
end
if not blocks[2] then
api.sendReply(msg, lang[ln].setabout.no_input_add)
return
end
--load about
about = db:get(hash)
--check if there is an about text
if not about then
api.sendReply(msg, lang[ln].setabout.no_bio_add, true)
else
local input = blocks[2]
--add the new string to the about text
local res = api.sendReply(msg, make_text(lang[ln].setabout.added, input), true)
if not res then
api.sendReply(msg, lang[ln].breaks_markdown, true)
else
about = about..'\n'..input
db:set(hash, about)
end
end
mystat('/addabout')
end
if blocks[1] == 'setabout' then
local input = blocks[2]
--ignore if not mod
if not is_mod(msg) then
api.sendReply(msg, lang[ln].not_mod, true)
return
end
--ignore if not text
if not input then
api.sendReply(msg, lang[ln].setabout.no_input_set, true)
return
end
--check if the mod want to clean the about text
if input == 'clean' then
db:del(hash)
api.sendReply(msg, lang[ln].setabout.clean)
return
end
--set the new about
local res, code = api.sendReply(msg, make_text(lang[ln].setabout.new, input), true)
if not res then
if code == 118 then
api.sendMessage(msg.chat.id, lang[ln].bonus.too_long)
else
api.sendMessage(msg.chat.id, lang[ln].breaks_markdown, true)
end
else
db:set(hash, input)
local id = res.result.message_id
api.editMessageText(msg.chat.id, id, lang[ln].setabout.about_setted, false, true)
end
mystat('/setabout')
end
end
return {
action = action,
get_about = get_about,
triggers = {
'^/(setabout)$', --to warn if an user don't add a text
'^/(setabout) (.*)',
'^/(about)$',
'^/(addabout)$', --to warn if an user don't add a text
'^/(addabout) (.*)',
}
} | gpl-2.0 |
sbraitbart/darktable | tools/lua_doc/old_api/dt_api300.lua | 7 | 247785 | API = {
["__text"] = [==[This documentation is for the *development* version of darktable. for the stable version, please visit the user manual
To access the darktable specific functions you must load the darktable environment:<code>darktable = require "darktable"</code>All functions and data are accessed through the darktable module.
This documentation for API version 3.0.0.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["darktable"] = {
["__text"] = [==[The darktable library is the main entry point for all access to the darktable internals.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["print"] = {
["__text"] = [==[Will print a string to the darktable control log (the long overlaid window that appears over the main panel).]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The string to display which should be a single line.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["print_error"] = {
["__text"] = [==[This function will print its parameter if the Lua logdomain is activated. Start darktable with the "-d lua" command line option to enable the Lua logdomain.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The string to display.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["register_event"] = {
["__text"] = [==[This function registers a callback to be called when a given event happens.
Events are documented in the event section.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event to register to.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The function to call on event. The signature of the function depends on the type of event.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
},
},
["3"] = {
["__text"] = [==[Some events need extra parameters at registration time; these must be specified here.]==],
["__attributes"] = {
["reported_type"] = [==[variable]==],
},
},
},
},
},
["register_storage"] = {
["__text"] = [==[This function will add a new storage implemented in Lua.
A storage is a module that is responsible for handling images once they have been generated during export. Examples of core storages include filesystem, e-mail, facebook...]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[A Unique name for the plugin.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[A human readable name for the plugin.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[This function is called once for each exported image. Images can be exported in parallel but the calls to this function will be serialized.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The storage object used for the export.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A virtual type representing all storage types.]==],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["plugin_name"] = {
["__text"] = [==[A unique name for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["name"] = {
["__text"] = [==[A human readable name for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["width"] = {
["__text"] = [==[The currently selected width for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["height"] = {
["__text"] = [==[The currently selected height for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["recommended_width"] = {
["__text"] = [==[The recommended width for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["recommended_height"] = {
["__text"] = [==[The recommended height for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["supports_format"] = {
["__text"] = [==[Checks if a format is supported by this storage.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[True if the format is supported by the storage.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The storage type to check against.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The format type to check.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A virtual type representing all format types.]==],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["plugin_name"] = {
["__text"] = [==[A unique name for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["name"] = {
["__text"] = [==[A human readable name for the plugin.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["extension"] = {
["__text"] = [==[The typical filename extension for that format.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["mime"] = {
["__text"] = [==[The mime type associated with the format.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["max_width"] = {
["__text"] = [==[The max width allowed for the format (0 = unlimited).]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["max_height"] = {
["__text"] = [==[The max height allowed for the format (0 = unlimited).]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["write_image"] = {
["__text"] = [==[Exports an image to a file. This is a blocking operation that will not return until the image is exported.]==],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[Returns true on success.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The format that will be used to export.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The image object to export.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[Image objects represent an image in the database. This is slightly different from a file on disk since a file can have multiple developments.
Note that this is the real image object; changing the value of a field will immediately change it in darktable and will be reflected on any copy of that image object you may have kept.]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["attach_tag"] = {
["__text"] = [==[Attach a tag to an image; the order of the parameters can be reversed.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The tag to be attached.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A tag that can be attached to an image.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["delete"] = {
["__text"] = [==[Deletes the tag object, detaching it from all images.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The tag to be deleted.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["attach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]]=],
["detach"] = {
["__text"] = [==[Detach a tag from an image; the order of the parameters can be reversed.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The tag to be detached.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The image to detach the tag from.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["name"] = {
["__text"] = [==[The name of the tag.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["#"] = {
["__text"] = [==[The images that have that tag attached to them.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["2"] = {
["__text"] = [==[The image to attach the tag to.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["detach_tag"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]]=],
["get_tags"] = {
["__text"] = [==[Gets all tags attached to an image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[A table of tags that are attached to the image.]==],
["__attributes"] = {
["reported_type"] = [==[table of types.dt_lua_tag_t]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The image to get the tags from.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["create_style"] = {
["__text"] = [==[Create a new style based on an image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The new style object.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A style that can be applied to an image.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["delete"] = {
["__text"] = [==[Deletes an existing style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[the style to delete]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
},
},
},
["duplicate"] = {
["__text"] = [==[Create a new style based on an existing style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The new style object.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The style to base the new style on.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The new style's name.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The new style's description.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["apply"] = {
["__text"] = [==[Apply a style to an image. The order of parameters can be inverted.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The style to use.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The image to apply the style to.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["export"] = {
["__text"] = [==[Export a style to an external .dtstyle file]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The style to export]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The directory to export to]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[Is overwriting an existing file allowed]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
},
},
},
["name"] = {
["__text"] = [==[The name of the style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["description"] = {
["__text"] = [==[The description of the style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["#"] = {
["__text"] = [==[The different items that make the style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[An element that is part of a style.]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["name"] = {
["__text"] = [==[The name of the style item.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["num"] = {
["__text"] = [==[The position of the style item within its style.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
},
},
},
},
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The image to create the style from.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The name to give to the new style.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The description of the new style.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["apply_style"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]]=],
["duplicate"] = {
["__text"] = [==[Creates a duplicate of an image and returns it.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The new image object.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[the image to duplicate]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["move"] = {
["__text"] = [==[Physically moves an image (and all its duplicates) to another film.
This will move the image file, the related XMP and all XMP for the duplicates to the directory of the new film
Note that the parameter order is not relevant.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image to move]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The film to move to]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A film in darktable; this represents a directory containing imported images.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["move_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]]=],
["copy_image"] = {
["__text"] = [==[Physically copies an image to another film.
This will copy the image file and the related XMP to the directory of the new film
If there is already a file with the same name as the image file, it will create a duplicate from that file instead
Note that the parameter order is not relevant.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The new image]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The image to copy]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The film to copy to]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["#"] = {
["__text"] = [==[The different images within the film.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["id"] = {
["__text"] = [==[A unique numeric id used by this film.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["path"] = {
["__text"] = [==[The path represented by this film.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["delete"] = {
["__text"] = [==[Removes the film from the database.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The film to remove.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[Force removal, even if the film is not empty.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[Boolean]==],
},
},
},
},
},
},
},
},
},
},
},
["copy"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]]=],
["id"] = {
["__text"] = [==[A unique id identifying the image in the database.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["path"] = {
["__text"] = [==[The file the directory containing the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["film"] = {
["__text"] = [==[The film object that contains this image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["filename"] = {
["__text"] = [==[The filename of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["sidecar"] = {
["__text"] = [==[The filename of the image's sidecar file.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["duplicate_index"] = {
["__text"] = [==[If there are multiple images based on a same file, each will have a unique number, starting from 0.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["publisher"] = {
["__text"] = [==[The publisher field of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["title"] = {
["__text"] = [==[The title field of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["creator"] = {
["__text"] = [==[The creator field of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["rights"] = {
["__text"] = [==[The rights field of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["description"] = {
["__text"] = [==[The description field for the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["exif_maker"] = {
["__text"] = [==[The maker exif data.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["exif_model"] = {
["__text"] = [==[The camera model used.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["exif_lens"] = {
["__text"] = [==[The id string of the lens used.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["exif_aperture"] = {
["__text"] = [==[The aperture saved in the exif data.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["exif_exposure"] = {
["__text"] = [==[The exposure time of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["exif_focal_length"] = {
["__text"] = [==[The focal length of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["exif_iso"] = {
["__text"] = [==[The iso used on the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["exif_datetime_taken"] = {
["__text"] = [==[The date and time of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["exif_focus_distance"] = {
["__text"] = [==[The distance of the subject.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["exif_crop"] = {
["__text"] = [==[The exif crop data.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["latitude"] = {
["__text"] = [==[GPS latitude data of the image, nil if not set.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[float or nil]==],
["write"] = true,
},
},
["longitude"] = {
["__text"] = [==[GPS longitude data of the image, nil if not set.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[float or nil]==],
["write"] = true,
},
},
["elevation"] = {
["__text"] = [==[GPS altitude data of the image, nil if not set.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[float or nil]==],
["write"] = true,
},
},
["is_raw"] = {
["__text"] = [==[True if the image is a RAW file.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
["is_ldr"] = {
["__text"] = [==[True if the image is a ldr image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
["is_hdr"] = {
["__text"] = [==[True if the image is a hdr image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
["has_txt"] = {
["__text"] = [==[True if the image has a txt sidecar file.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["width"] = {
["__text"] = [==[The width of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["height"] = {
["__text"] = [==[The height of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["rating"] = {
["__text"] = [==[The rating of the image (-1 for rejected).]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["red"] = {
["__text"] = [==[True if the image has the corresponding colorlabel.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["blue"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["green"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["yellow"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["purple"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]]=],
["reset"] = {
["__text"] = [==[Removes all processing from the image, resetting it back to its original state]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image whose history will be deleted]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["delete"] = {
["__text"] = [==[Removes an image from the database]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image to remove]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["group_with"] = {
["__text"] = [==[Puts the first image in the same group as the second image. If no second image is provided the image will be in its own group.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image whose group must be changed.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The image we want to group with.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["make_group_leader"] = {
["__text"] = [==[Makes the image the leader of its group.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image we want as the leader.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["get_group_members"] = {
["__text"] = [==[Returns a table containing all types.dt_lua_image_t of the group. The group leader is both at a numeric key and at the "leader" special key (so you probably want to use ipairs to iterate through that table).]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[A table of image objects containing all images that are in the same group as the image.]==],
["__attributes"] = {
["reported_type"] = [==[table of types.dt_lua_image_t]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The image whose group we are querying.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["group_leader"] = {
["__text"] = [==[The image which is the leader of the group this image is a member of.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["local_copy"] = {
["__text"] = [==[True if the image has a copy in the local cache]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["drop_cache"] = {
["__text"] = [==[drops the cached version of this image.
This function should be called if an image is modified out of darktable to force DT to regenerate the thumbnail
darktable will regenerate the thumbnail by itself when it is needed]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The image whose cache must be dropped.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
},
},
},
["3"] = {
["__text"] = [==[The filename to export to.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["4"] = {
["__text"] = [==[Set to true to allow upscaling of the image.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[boolean]==],
},
},
},
},
},
},
},
},
},
},
},
},
},
},
["2"] = {
["__text"] = [==[The exported image object.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [==[The format object used for the export.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["4"] = {
["__text"] = [==[The name of a temporary file where the processed image is stored.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["5"] = {
["__text"] = [==[The number of the image out of the export series.]==],
["__attributes"] = {
["reported_type"] = [==[integer]==],
},
},
["6"] = {
["__text"] = [==[The total number of images in the export series.]==],
["__attributes"] = {
["reported_type"] = [==[integer]==],
},
},
["7"] = {
["__text"] = [==[True if the export is high quality.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["8"] = {
["__text"] = [==[An empty Lua table to take extra data. This table is common to the initialize, store and finalize calls in an export serie.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
},
},
},
["4"] = {
["__text"] = [==[This function is called once all images are processed and all store calls are finished.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The storage object used for the export.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[A table keyed by the exported image objects and valued with the corresponding temporary export filename.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
["3"] = {
["__text"] = [==[An empty Lua table to store extra data. This table is common to all calls to store and the call to finalize in a given export series.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
},
},
},
["5"] = {
["__text"] = [==[A function called to check if a given image format is supported by the Lua storage; this is used to build the dropdown format list for the GUI.
Note that the parameters in the format are the ones currently set in the GUI; the user might change them before export.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[True if the corresponding format is supported.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The storage object tested.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The format object to report about.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["6"] = {
["__text"] = [==[A function called before storage happens
This function can change the list of exported functions]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The modified table of images to export or nil
If nil (or nothing) is returned, the original list of images will be exported
If a table of images is returned, that table will be used instead. The table can be empty. The images parameter can be modified and returned]==],
["__attributes"] = {
["reported_type"] = [==[table or nil]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The storage object tested.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The format object to report about.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [==[A table containing images to be exported.]==],
["__attributes"] = {
["reported_type"] = [==[table of types.dt_lua_image_t]==],
},
},
["4"] = {
["__text"] = [==[True if the export is high quality.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["5"] = {
["__text"] = [==[An empty Lua table to take extra data. This table is common to the initialize, store and finalize calls in an export serie.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
},
},
},
["7"] = {
["__text"] = [==[A widget to display in the export section of darktable's UI]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = {
["__text"] = [==[Common parent type for all lua-handled widgets]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["sensitive"] = {
["__text"] = [==[Set if the widget is enabled/disabled]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["tooltip"] = {
["__text"] = [==[Tooltip to display for the widget]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string or nil]==],
["write"] = true,
},
},
["reset_callback"] = {
["__text"] = [==[A function to call when the widget needs to reset itself
Note that some widgets have a default implementation that can be overridden, (containers in particular will recursively reset their children). If you replace that default implementation you need to reimplement that functionality or call the original function within your callback]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget that triggered the callback]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["write"] = true,
},
},
["__call"] = {
["__text"] = [==[Using a lua widget as a function Allows to set multiple attributes of that widget at once. This is mainly used to create UI elements in a more readable way
For example:<code>local widget = dt.new_widget("button"){
label ="my label",
clicked_callback = function() print "hello world" end
}</code>]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The object called itself, to allow chaining]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[A table of attributes => value to set]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
},
},
},
},
},
},
},
},
},
["register_lib"] = {
["__text"] = [==[Register a new lib object. A lib is a graphical element of darktable's user interface]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[A unique name for your library]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[A user-visible name for your library]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[whether this lib should be expandable or not]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["4"] = {
["__text"] = [==[whether this lib has a reset button or not]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["5"] = {
["__text"] = [==[A table associating to each view containing the lib the corresponding container and position]==],
["__attributes"] = {
["reported_type"] = [==[table of types.dt_lua_view_t => [ types.dt_ui_container_t, int ]]==],
},
},
["6"] = {
["__text"] = [==[The widget to display in the lib]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
["7"] = {
["__text"] = [==[A callback called when a view displaying the lib is entered]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The lib on which the callback is called]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {
["__text"] = [==[The type of a UI lib]==],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["id"] = {
["__text"] = [==[A unit string identifying the lib]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["name"] = {
["__text"] = [==[The translated title of the UI element]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["version"] = {
["__text"] = [==[The version of the internal data of this lib]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["visible"] = {
["__text"] = [==[Allow to make a lib module completely invisible to the user.
Note that if the module is invisible the user will have no way to restore it without lua]==],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["container"] = {
["__text"] = [==[The location of the lib in the darktable UI]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[A place in the darktable UI where a lib can be placed]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[DT_UI_CONTAINER_PANEL_LEFT_TOP]==],
["2"] = [==[DT_UI_CONTAINER_PANEL_LEFT_CENTER]==],
["3"] = [==[DT_UI_CONTAINER_PANEL_LEFT_BOTTOM]==],
["4"] = [==[DT_UI_CONTAINER_PANEL_RIGHT_TOP]==],
["5"] = [==[DT_UI_CONTAINER_PANEL_RIGHT_CENTER]==],
["6"] = [==[DT_UI_CONTAINER_PANEL_RIGHT_BOTTOM]==],
["7"] = [==[DT_UI_CONTAINER_PANEL_TOP_LEFT]==],
["8"] = [==[DT_UI_CONTAINER_PANEL_TOP_CENTER]==],
["9"] = [==[DT_UI_CONTAINER_PANEL_TOP_RIGHT]==],
["10"] = [==[DT_UI_CONTAINER_PANEL_CENTER_TOP_LEFT]==],
["11"] = [==[DT_UI_CONTAINER_PANEL_CENTER_TOP_CENTER]==],
["12"] = [==[DT_UI_CONTAINER_PANEL_CENTER_TOP_RIGHT]==],
["13"] = [==[DT_UI_CONTAINER_PANEL_CENTER_BOTTOM_LEFT]==],
["14"] = [==[DT_UI_CONTAINER_PANEL_CENTER_BOTTOM_CENTER]==],
["15"] = [==[DT_UI_CONTAINER_PANEL_CENTER_BOTTOM_RIGHT]==],
["16"] = [==[DT_UI_CONTAINER_PANEL_BOTTOM]==],
},
},
},
},
},
["expandable"] = {
["__text"] = [==[True if the lib can be expanded/retracted]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
["expanded"] = {
["__text"] = [==[True if the lib is expanded]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["position"] = {
["__text"] = [==[A value deciding the position of the lib within its container]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
["views"] = {
["__text"] = [==[A table of all the views that display this widget]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[table]==],
},
},
["reset"] = {
["__text"] = [==[A function to reset the lib to its default values
This function will do nothing if the lib is not visible or can't be reset]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The lib to reset]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["on_screen"] = {
["__text"] = [==[True if the lib is currently visible on the screen]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
},
},
},
["2"] = {
["__text"] = [==[The view that we are leaving]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A darktable view]==],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["id"] = {
["__text"] = [==[A unique string identifying the view]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["name"] = {
["__text"] = [==[The name of the view]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
},
},
},
["3"] = {
["__text"] = [==[The view that we are entering]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["8"] = {
["__text"] = [==[A callback called when leaving a view displaying the lib]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The lib on which the callback is called]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The view that we are leaving]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [==[The view that we are entering]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
},
},
},
["films"] = {
["__text"] = [==[A table containing all the film objects in the database.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["#"] = {
["__text"] = [==[Each film has a numeric entry in the database.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["new"] = {
["__text"] = [==[Creates a new empty film
see darktable.database.import to import a directory with all its images and to add images to a film]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created film, or the existing film if the directory is already imported]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The directory that the new film will represent. The directory must exist]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]]=],
},
["new_format"] = {
["__text"] = [==[Creates a new format object to export images]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created object. Exact type depends on the type passed]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The type of format object to create, one of :
* copy
* exr
* j2k
* jpeg
* pdf
* pfm
* png
* ppm
* tiff
* webp
]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["new_storage"] = {
["__text"] = [==[Creates a new storage object to export images]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created object. Exact type depends on the type passed]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The type of storage object to create, one of :
* disk
* email
* facebook
* flickr
* gallery
* latex
* picasa
(Other, lua-defined, storage types may appear.)]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["new_widget"] = {
["__text"] = [==[Creates a new widget object to display in the UI]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created object. Exact type depends on the type passed]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The type of storage object to create, one of :
* box
* button
* check_button
* combobox
* container
* entry
* file_chooser_button
* label
* separator
* slider
* stack
]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["gui"] = {
["__text"] = [==[This subtable contains function and data to manipulate the darktable user interface with Lua.
Most of these function won't do anything if the GUI is not enabled (i.e you are using the command line version darktabl-cli instead of darktable).]==],
["__attributes"] = {
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["action_images"] = {
["__text"] = [==[A table of types.dt_lua_image_t on which the user expects UI actions to happen.
It is based on both the hovered image and the selection and is consistent with the way darktable works.
It is recommended to use this table to implement Lua actions rather than darktable.gui.hovered or darktable.gui.selection to be consistent with darktable's GUI.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[table]==],
},
},
["hovered"] = {
["__text"] = [==[The image under the cursor or nil if no image is hovered.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["selection"] = {
["__text"] = [==[Allows to change the set of selected images.]==],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[A table containing the selection as it was before the function was called.]==],
["__attributes"] = {
["reported_type"] = [==[table of types.dt_lua_image_t]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[A table of images which will define the selected images. If this parameter is not given the selection will be untouched. If an empty table is given the selection will be emptied.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[table of types.dt_lua_image_t]==],
},
},
},
},
},
["current_view"] = {
["__text"] = [==[Allows to change the current view.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[the current view]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The view to switch to. If empty the current view is unchanged]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["create_job"] = {
["__text"] = [==[Create a new progress_bar displayed in darktable.gui.libs.backgroundjobs]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created job object]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A lua-managed entry in the backgroundjob lib]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["percent"] = {
["__text"] = [==[The value of the progress bar, between 0 and 1. will return nil if there is no progress bar, will raise an error if read or written on an invalid job]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["valid"] = {
["__text"] = [==[True if the job is displayed, set it to false to destroy the entry
An invalid job cannot be made valid again]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
},
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The text to display in the job entry]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[Should a progress bar be displayed]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[boolean]==],
},
},
["3"] = {
["__text"] = [==[A function called when the cancel button for that job is pressed
note that the job won't be destroyed automatically. You need to set types.dt_lua_backgroundjob_t.valid to false for that]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The extra information to display]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The job who is being cancelded]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The image to analyze]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
},
},
},
["views"] = {
["__text"] = [==[The different views in darktable]==],
["__attributes"] = {
["has_pairs"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["map"] = {
["__text"] = [==[The map view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["latitude"] = {
["__text"] = [==[The latitude of the center of the map]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["longitude"] = {
["__text"] = [==[The longitude of the center of the map]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["zoom"] = {
["__text"] = [==[The current zoom level of the map]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
},
["darkroom"] = {
["__text"] = [==[The darkroom view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["lighttable"] = {
["__text"] = [==[The lighttable view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["tethering"] = {
["__text"] = [==[The tethering view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["slideshow"] = {
["__text"] = [==[The slideshow view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["print"] = {
["__text"] = [==[The print view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
},
["libs"] = {
["__text"] = [==[This table allows to reference all lib objects
lib are the graphical blocks within each view.
To quickly figure out what lib is what, you can use the following code which will make a given lib blink.
<code>local tested_module="global_toolbox"
dt.gui.libs[tested_module].visible=false
coroutine.yield("WAIT_MS",2000)
while true do
dt.gui.libs[tested_module].visible = not dt.gui.libs[tested_module].visible
coroutine.yield("WAIT_MS",2000)
end</code>]==],
["__attributes"] = {
["has_pairs"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["snapshots"] = {
["__text"] = [==[The UI element that manipulates snapshots in darkroom]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["ratio"] = {
["__text"] = [==[The place in the screen where the line separating the snapshot is. Between 0 and 1]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["direction"] = {
["__text"] = [==[The direction of the snapshot overlay]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[Which part of the main window is occupied by a snapshot]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[left]==],
["2"] = [==[right]==],
["3"] = [==[top]==],
["4"] = [==[bottom]==],
},
},
},
["write"] = true,
},
},
["#"] = {
["__text"] = [==[The different snapshots for the image]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[The description of a snapshot in the snapshot lib]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["reported_type"] = [==[dt_type]==],
},
["filename"] = {
["__text"] = [==[The filename of an image containing the snapshot]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["select"] = {
["__text"] = [==[Activates this snapshot on the display. To deactivate all snapshot you need to call this function on the active snapshot]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The snapshot to activate]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]]=],
},
},
},
},
},
["name"] = {
["__text"] = [==[The name of the snapshot, as seen in the UI]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
},
},
},
["selected"] = {
["__text"] = [==[The currently selected snapshot]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]]=],
},
},
["take_snapshot"] = {
["__text"] = [==[Take a snapshot of the current image and add it to the UI
The snapshot file will be generated at the next redraw of the main window]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
},
},
},
["max_snapshot"] = {
["__text"] = [==[The maximum number of snapshots]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
},
},
},
["collect"] = {
["__text"] = [==[The collection UI element that allows to filter images by collection]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["filter"] = {
["__text"] = [==[Allows to get or change the list of visible images]==],
["__attributes"] = {
["implicit_yield"] = true,
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The rules that were applied before this call.]==],
["__attributes"] = {
["reported_type"] = [==[array oftypes.dt_lib_collect_params_rule_t]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[A table of rules describing the filter. These rules will be applied after this call]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[array oftypes.dt_lib_collect_params_rule_t]==],
},
},
},
},
},
["new_rule"] = {
["__text"] = [==[Returns a newly created rule object]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The newly created rule]==],
["__attributes"] = {
["reported_type"] = [==[types.dt_lib_collect_params_rule_t]==],
},
},
["signature"] = {
},
},
},
},
["import"] = {
["__text"] = [==[The buttons to start importing images]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["register_widget"] = {
["__text"] = [==[Add a widget in the option expander of the import dialog]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget to add to the dialog. The reset callback of the widget will be called whenever the dialog is opened]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
},
},
},
["styles"] = {
["__text"] = [==[The style selection menu]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["metadata_view"] = {
["__text"] = [==[The widget displaying metadata about the current image]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["metadata"] = {
["__text"] = [==[The widget allowing modification of metadata fields on the current image]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["hinter"] = {
["__text"] = [==[The small line of text at the top of the UI showing the number of selected images]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["modulelist"] = {
["__text"] = [==[The window allowing to set modules as visible/hidden/favorite]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["filmstrip"] = {
["__text"] = [==[The filmstrip at the bottom of some views]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["viewswitcher"] = {
["__text"] = [==[The labels allowing to switch view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["darktable_label"] = {
["__text"] = [==[The darktable logo in the upper left corner]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["tagging"] = {
["__text"] = [==[The tag manipulation UI]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["geotagging"] = {
["__text"] = [==[The geotagging time synchronisation UI]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["recentcollect"] = {
["__text"] = [==[The recent collection UI element]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["global_toolbox"] = {
["__text"] = [==[The common tools to all view (settings, grouping...)]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["grouping"] = {
["__text"] = [==[The current status of the image grouping option]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["show_overlays"] = {
["__text"] = [==[the current status of the image overlays option]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
},
["filter"] = {
["__text"] = [==[The image-filter menus at the top of the UI]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["ratings"] = {
["__text"] = [==[The starts to set the rating of an image]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["select"] = {
["__text"] = [==[The buttons that allow to quickly change the selection]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["register_selection"] = {
["__text"] = [==[Add a new button and call a callback when it is clicked]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The label to display on the button]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The function to call when the button is pressed]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The images to set the selection to]==],
["__attributes"] = {
["reported_type"] = [==[table oftypes.dt_lua_image_t]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The name of the button that was pressed]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The images in the current collection. This is the same content asdarktable.collection]==],
["__attributes"] = {
["reported_type"] = [==[table oftypes.dt_lua_image_t]==],
},
},
},
},
},
["3"] = {
["__text"] = [==[The tooltip to use on the new button]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[string]==],
},
},
},
},
},
},
["colorlabels"] = {
["__text"] = [==[The color buttons that allow to set labels on an image]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["lighttable_mode"] = {
["__text"] = [==[The navigation and zoom level UI in lighttable]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["copy_history"] = {
["__text"] = [==[The UI element that manipulates history]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["image"] = {
["__text"] = [==[The UI element that manipulates the current images]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["register_action"] = {
["__text"] = [==[Add a new button and call a callback when it is clicked]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The label to display on the button]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The function to call when the button is pressed]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the button that was pressed]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The images to act on when the button was clicked]==],
["__attributes"] = {
["reported_type"] = [==[table oftypes.dt_lua_image_t]==],
},
},
},
},
},
["3"] = {
["__text"] = [==[The tooltip to use on the new button]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[string]==],
},
},
},
},
},
},
["modulegroups"] = {
["__text"] = [==[The icons describing the different iop groups]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["module_toolbox"] = {
["__text"] = [==[The tools on the bottom line of the UI (overexposure)]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["session"] = {
["__text"] = [==[The session UI when tethering]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["histogram"] = {
["__text"] = [==[The histogram widget]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["export"] = {
["__text"] = [==[The export menu]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["history"] = {
["__text"] = [==[The history manipulation menu]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["colorpicker"] = {
["__text"] = [==[The colorpicker menu]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["navigation"] = {
["__text"] = [==[The full image preview to allow navigation]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["masks"] = {
["__text"] = [==[The masks window]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["view_toolbox"] = {
["__text"] = [==[]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["live_view"] = {
["__text"] = [==[The liveview window]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["map_settings"] = {
["__text"] = [==[The map setting window]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["camera"] = {
["__text"] = [==[The camera selection UI]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["location"] = {
["__text"] = [==[The location ui]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["backgroundjobs"] = {
["__text"] = [==[The window displaying the currently running jobs]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
["print_settings"] = {
["__text"] = [==[The settings window in the print view]==],
["__attributes"] = {
["has_pairs"] = true,
["has_tostring"] = true,
["is_attribute"] = true,
["is_singleton"] = true,
["parent"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["read"] = true,
["reported_type"] = [==[dt_singleton]==],
},
},
},
},
["guides"] = {
["__text"] = [==[Guide lines to overlay over an image in crop and rotate.
All guides are clipped to the drawing area.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
["register_guide"] = {
["__text"] = [==[Register a new guide.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the guide to show in the GUI.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The function to call to draw the guide lines. The drawn lines will be stroked by darktable.
THIS IS RUNNING IN THE GUI THREAD AND HAS TO BE FAST!]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The cairo object used for drawing.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[A wrapper around a cairo drawing context.
You probably shouldn't use this after the callback that got it passed returned.
For more details of the member functions have a look at the cairo documentation for <ulink url="http://www.cairographics.org/manual/cairo-cairo-t.html">the drawing context</ulink>, <ulink url="http://www.cairographics.org/manual/cairo-Transformations.html">transformations</ulink> and <ulink url="http://www.cairographics.org/manual/cairo-Paths.html">paths</ulink>.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["save"] = {
["__text"] = [==[Save the state of the drawing context.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["restore"] = {
["__text"] = [==[Restore a previously saved state.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["move_to"] = {
["__text"] = [==[Begin a new sub-path.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x coordinate of the new position.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y coordinate of the new position.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["line_to"] = {
["__text"] = [==[Add a line to the path.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x coordinate of the end of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y coordinate of the end of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["rectangle"] = {
["__text"] = [==[Add a closed sub-path rectangle.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x coordinate of the top left corner of the rectangle.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y coordinate of the top left corner of the rectangle.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["4"] = {
["__text"] = [==[The width of the rectangle.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["5"] = {
["__text"] = [==[The height of the rectangle.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["arc"] = {
["__text"] = [==[Add a circular arc.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x position of the center of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y position of the center of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["4"] = {
["__text"] = [==[The radius of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["5"] = {
["__text"] = [==[The start angle, in radians.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["6"] = {
["__text"] = [==[The end angle, in radians.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["arc_negative"] = {
["__text"] = [==[Add a circular arc. It only differs in the direction from types.dt_lua_cairo_t.arc.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x position of the center of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y position of the center of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["4"] = {
["__text"] = [==[The radius of the arc.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["5"] = {
["__text"] = [==[The start angle, in radians.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["6"] = {
["__text"] = [==[The end angle, in radians.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["rotate"] = {
["__text"] = [==[Add a rotation to the transformation matrix.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The angle (in radians) by which the user-space axes will be rotated.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["scale"] = {
["__text"] = [==[Add a scaling to the transformation matrix.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The scale factor for the x dimension.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The scale factor for the y dimension.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["translate"] = {
["__text"] = [==[Add a translation to the transformation matrix.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[Amount to translate in the x direction]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[Amount to translate in the y direction]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["new_sub_path"] = {
["__text"] = [==[Begin a new sub-path.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["draw_line"] = {
["__text"] = [==[Helper function to draw a line with a given start and end.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The context to modify.]==],
["__attributes"] = {
["is_self"] = true,
["reported_type"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["2"] = {
["__text"] = [==[The x coordinate of the start of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y coordinate of the start of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["4"] = {
["__text"] = [==[The x coordinate of the end of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["5"] = {
["__text"] = [==[The y coordinate of the end of the new line.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
},
},
},
["2"] = {
["__text"] = [==[The x coordinate of the top left corner of the drawing area.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["3"] = {
["__text"] = [==[The y coordinate of the top left corner of the drawing area.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["4"] = {
["__text"] = [==[The width of the drawing area.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["5"] = {
["__text"] = [==[The height of the drawing area.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
["6"] = {
["__text"] = [==[The current zoom_scale. Only needed when setting the line thickness.]==],
["__attributes"] = {
["reported_type"] = [==[float]==],
},
},
},
},
},
["3"] = {
["__text"] = [==[A function returning a widget to show when the guide is selected. It takes no arguments.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[function]==],
},
},
},
},
},
},
["tags"] = {
["__text"] = [==[Allows access to all existing tags.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["#"] = {
["__text"] = [==[Each existing tag has a numeric entry in the tags table - use ipairs to iterate over them.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["create"] = {
["__text"] = [==[Creates a new tag and return it. If the tag exists return the existing tag.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the new tag.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["find"] = {
["__text"] = [==[Returns the tag object or nil if the tag doesn't exist.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The tag object or nil.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The name of the tag to find.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"]]=],
["attach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]]=],
["detach"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]]=],
["get_tags"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"]]=],
},
["configuration"] = {
["__text"] = [==[This table regroups values that describe details of the configuration of darktable.]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
["version"] = {
["__text"] = [==[The version number of darktable.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["has_gui"] = {
["__text"] = [==[True if darktable has a GUI (launched through the main darktable command, not darktable-cli).]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["verbose"] = {
["__text"] = [==[True if the Lua logdomain is enabled.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["tmp_dir"] = {
["__text"] = [==[The name of the directory where darktable will store temporary files.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["config_dir"] = {
["__text"] = [==[The name of the directory where darktable will find its global configuration objects (modules).]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["cache_dir"] = {
["__text"] = [==[The name of the directory where darktable will store its mipmaps.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["api_version_major"] = {
["__text"] = [==[The major version number of the lua API.]==],
["__attributes"] = {
["reported_type"] = [==[number]==],
},
},
["api_version_minor"] = {
["__text"] = [==[The minor version number of the lua API.]==],
["__attributes"] = {
["reported_type"] = [==[number]==],
},
},
["api_version_patch"] = {
["__text"] = [==[The patch version number of the lua API.]==],
["__attributes"] = {
["reported_type"] = [==[number]==],
},
},
["api_version_suffix"] = {
["__text"] = [==[The version suffix of the lua API.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["api_version_string"] = {
["__text"] = [==[The version description of the lua API. This is a string compatible with the semantic versioning convention]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["check_version"] = {
["__text"] = [==[Check that a module is compatible with the running version of darktable
Add the following line at the top of your module : <code>darktable.configuration.check(...,{M,m,p},{M2,m2,p2})</code>To document that your module has been tested with API version M.m.p and M2.m2.p2.
This will raise an error if the user is running a released version of DT and a warning if he is running a development version
(the ... here will automatically expand to your module name if used at the top of your script]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the module to report on error]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[Tables of API versions that are known to work with the script]==],
["__attributes"] = {
["reported_type"] = [==[table...]==],
},
},
},
},
},
},
["preferences"] = {
["__text"] = [==[Lua allows you to manipulate preferences. Lua has its own namespace for preferences and you can't access nor write normal darktable preferences.
Preference handling functions take a _script_ parameter. This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference.
Preference handling functions can't guess the type of a parameter. You must pass the type of the preference you are handling.
Note that the directory, enum and file type preferences are stored internally as string. The user can only select valid values, but a lua script can set it to any string]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
["register"] = {
["__text"] = [==[Creates a new preference entry in the Lua tab of the preference screen. If this function is not called the preference can't be set by the user (you can still read and write invisible preferences).]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[Invisible prefix to guarantee unicity of preferences.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[A unique name used with the script part to identify the preference.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The type of the preference - one of the string values described above.]==],
["__attributes"] = {
["reported_type"] = {
["__text"] = [==[The type of value to save in a preference]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[string]==],
["2"] = [==[bool]==],
["3"] = [==[integer]==],
["4"] = [==[float]==],
["5"] = [==[file]==],
["6"] = [==[directory]==],
["7"] = [==[enum]==],
},
},
},
},
},
["4"] = {
["__text"] = [==[The label displayed in the preference screen.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["5"] = {
["__text"] = [==[The tooltip to display in the preference menu.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["6"] = {
["__text"] = [==[Default value to use when not set explicitly or by the user.
For the enum type of pref, this is mandatory]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[depends on type]==],
},
},
["7"] = {
["__text"] = [==[Minimum value (integer and float preferences only).]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[int or float]==],
},
},
["8"] = {
["__text"] = [==[Maximum value (integer and float preferences only).]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[int or float]==],
},
},
["9"] = {
["__text"] = [==[Step of the spinner (float preferences only).]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[float]==],
},
},
["10"] = {
["__text"] = [==[Other allowed values (enum preferences only)]==],
["__attributes"] = {
["reported_type"] = [==[string...]==],
},
},
},
},
},
["read"] = {
["__text"] = [==[Reads a value from a Lua preference.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The value of the preference.]==],
["__attributes"] = {
["reported_type"] = [==[depends on type]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[Invisible prefix to guarantee unicity of preferences.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The name of the preference displayed in the preference screen.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The type of the preference.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
},
},
},
},
},
["write"] = {
["__text"] = [==[Writes a value to a Lua preference.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[Invisible prefix to guarantee unicity of preferences.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The name of the preference displayed in the preference screen.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The type of the preference.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
},
},
["4"] = {
["__text"] = [==[The value to set the preference to.]==],
["__attributes"] = {
["reported_type"] = [==[depends on type]==],
},
},
},
},
},
},
["styles"] = {
["__text"] = [==[This pseudo table allows you to access and manipulate styles.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["#"] = {
["__text"] = [==[Each existing style has a numeric index; you can iterate them using ipairs.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
},
},
["create"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"]]=],
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"]]=],
["duplicate"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"]]=],
["apply"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]]=],
["import"] = {
["__text"] = [==[Import a style from an external .dtstyle file]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The file to import]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["export"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"]]=],
},
["database"] = {
["__text"] = [==[Allows to access the database of images. Note that duplicate images (images with the same RAW but different XMP) will appear multiple times with different duplicate indexes. Also note that all images are here. This table is not influenced by any GUI filtering (collections, stars etc...).]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["#"] = {
["__text"] = [==[Each image in the database appears with a numerical index; you can interate them using ipairs.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["duplicate"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"]]=],
["import"] = {
["__text"] = [==[Imports new images into the database.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The created image if an image is imported or the toplevel film object if a film was imported.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The filename or directory to import images from.
NOTE: If the images are set to be imported recursively in preferences only the toplevel film is returned (the one whose path was given as a parameter).
NOTE2: If the parameter is a directory the call is non-blocking; the film object will not have the newly imported images yet. Use a post-import-film filtering on that film to react when images are actually imported.
]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["move_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]]=],
["copy_image"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]]=],
["delete"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]]=],
},
["collection"] = {
["__text"] = [==[Allows to access the currently worked on images, i.e the ones selected by the collection lib. Filtering (rating etc) does not change that collection.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["#"] = {
["__text"] = [==[Each image in the collection appears with a numerical index; you can interate them using ipairs.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
["control"] = {
["__text"] = [==[This table contain function to manipulate the control flow of lua programs. It provides ways to do background jobs and other related functions]==],
["__attributes"] = {
["has_pairs"] = true,
["is_singleton"] = true,
["reported_type"] = [==[dt_singleton]==],
},
["ending"] = {
["__text"] = [==[TRUE when darktable is terminating
Use this variable to detect when you should finish long running jobs]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
},
},
["dispatch"] = {
["__text"] = [==[Runs a function in the background. This function will be run at a later point, after luarc has finished running. If you do a loop in such a function, please check darktable.control.ending in your loop to finish the function when DT exits]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The call to dispatch]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
},
},
["2"] = {
["__text"] = [==[extra parameters to pass to the function]==],
["__attributes"] = {
["reported_type"] = [==[anything]==],
},
},
},
},
},
},
["gettext"] = {
["__text"] = [==[This table contains functions related to translating lua scripts]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
["gettext"] = {
["__text"] = [==[Translate a string using the darktable textdomain]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The translated string]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The string to translate]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["dgettext"] = {
["__text"] = [==[Translate a string using the specified textdomain]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The translated string]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The domain to use for that translation]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The string to translate]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["ngettext"] = {
["__text"] = [==[Translate a string depending on the number of objects using the darktable textdomain]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The translated string]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The string to translate]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The string to translate in plural form]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The number of objetc]==],
["__attributes"] = {
["reported_type"] = [==[int]==],
},
},
},
},
},
["dngettext"] = {
["__text"] = [==[Translate a string depending on the number of objects using the specified textdomain]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[The translated string]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The domain to use for that translation]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The string to translate]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[The string to translate in plural form]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["4"] = {
["__text"] = [==[The number of objetc]==],
["__attributes"] = {
["reported_type"] = [==[int]==],
},
},
},
},
},
["bindtextdomain"] = {
["__text"] = [==[Tell gettext where to find the .mo file translating messages for a particular domain]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The domain to use for that translation]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The base directory to look for the file. The file should be placed in <em>dirname</em>/<em>locale name</em>/LC_MESSAGES/<em>domain</em>.mo]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
},
["debug"] = {
["__text"] = [==[This section must be activated separately by calling
require "darktable.debug"
]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
["dump"] = {
["__text"] = [==[This will return a string describing everything Lua knows about an object, used to know what an object is.
This function is recursion-safe and can be used to dump _G if needed.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[A string containing a text description of the object - can be very long.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The object to dump.]==],
["__attributes"] = {
["reported_type"] = [==[anything]==],
},
},
["2"] = {
["__text"] = [==[A name to use for the object.]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[string]==],
},
},
["3"] = {
["__text"] = [==[A table of object,string pairs. Any object in that table will not be dumped, the string will be printed instead.
defaults to darktable.debug.known if not set]==],
["__attributes"] = {
["optional"] = true,
["reported_type"] = [==[table]==],
},
},
},
},
},
["debug"] = {
["__text"] = [==[Initialized to false; set it to true to also dump information about metatables.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
["max_depth"] = {
["__text"] = [==[Initialized to 10; The maximum depth to recursively dump content.]==],
["__attributes"] = {
["reported_type"] = [==[number]==],
},
},
["known"] = {
["__text"] = [==[A table containing the default value of darktable.debug.dump.known]==],
["__attributes"] = {
["reported_type"] = [==[table]==],
},
},
["type"] = {
["__text"] = [==[Similar to the system function type() but it will return the real type instead of "userdata" for darktable specific objects.]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[A string describing the type of the object.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The object whos type must be reported.]==],
["__attributes"] = {
["reported_type"] = [==[anything]==],
},
},
},
},
},
},
},
["types"] = {
["__text"] = [==[This section documents types that are specific to darktable's Lua API.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["dt_lua_image_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_imageio_module_format_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_imageio_module_format_data_png"] = {
["__text"] = [==[Type object describing parameters to export to png.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["bpp"] = {
["__text"] = [==[The bpp parameter to use when exporting.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_tiff"] = {
["__text"] = [==[Type object describing parameters to export to tiff.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["bpp"] = {
["__text"] = [==[The bpp parameter to use when exporting.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_exr"] = {
["__text"] = [==[Type object describing parameters to export to exr.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["compression"] = {
["__text"] = [==[The compression parameter to use when exporting.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_copy"] = {
["__text"] = [==[Type object describing parameters to export to copy.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_format_data_pfm"] = {
["__text"] = [==[Type object describing parameters to export to pfm.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_format_data_jpeg"] = {
["__text"] = [==[Type object describing parameters to export to jpeg.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["quality"] = {
["__text"] = [==[The quality to use at export time.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
},
["dt_imageio_module_format_data_ppm"] = {
["__text"] = [==[Type object describing parameters to export to ppm.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_format_data_webp"] = {
["__text"] = [==[Type object describing parameters to export to webp.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["quality"] = {
["__text"] = [==[The quality to use at export time.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["comp_type"] = {
["__text"] = [==[The overall quality to use; can be one of "webp_lossy" or "webp_lossless".]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[Type of compression for webp]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[webp_lossy]==],
["2"] = [==[webp_lossless]==],
},
},
},
["write"] = true,
},
},
["hint"] = {
["__text"] = [==[A hint on the overall content of the image.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[a hint on the way to encode a webp image]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[hint_default]==],
["2"] = [==[hint_picture]==],
["3"] = [==[hint_photo]==],
["4"] = [==[hint_graphic]==],
},
},
},
["write"] = true,
},
},
},
["dt_imageio_module_format_data_j2k"] = {
["__text"] = [==[Type object describing parameters to export to jpeg2000.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["quality"] = {
["__text"] = [==[The quality to use at export time.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["bpp"] = {
["__text"] = [==[The bpp parameter to use when exporting.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["format"] = {
["__text"] = [==[The format to use.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[J2K format type]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[j2k]==],
["2"] = [==[jp2]==],
},
},
},
["write"] = true,
},
},
["preset"] = {
["__text"] = [==[The preset to use.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[J2K preset type]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[off]==],
["2"] = [==[cinema2k_24]==],
["3"] = [==[cinema2k_48]==],
["4"] = [==[cinema4k_24]==],
},
},
},
["write"] = true,
},
},
},
["dt_imageio_module_format_data_pdf"] = {
["__text"] = [==[Type object describing parameters to export to pdf.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["dpi"] = {
["__text"] = [==[The dot per inch value to use at export]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["icc"] = {
["__text"] = [==[Should the images be tagged with their embedded profile]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["border"] = {
["__text"] = [==[Empty space around the PDF images]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["orientation"] = {
["__text"] = [==[Orientation of the pages in the document]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["title"] = {
["__text"] = [==[The title for the document
types.dt_imageio_module_format_data_pdf.rotate:set_text([[Should the images be rotated to match the PDF orientation]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["mode"] = {
["__text"] = [==[The image mode to use at export time]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["size"] = {
["__text"] = [==[The paper size to use]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["compression"] = {
["__text"] = [==[Compression mode to use for images]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["pages"] = {
["__text"] = [==[The page type to use]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["rotate"] = {
["__text"] = [==[Should the images be rotated in the resulting PDF]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
},
["_pdf_mode_t"] = {
["__text"] = [==[The export mode to use for PDF document]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[normal]==],
["2"] = [==[draft]==],
["3"] = [==[debug]==],
},
},
},
["_pdf_pages_t"] = {
["__text"] = [==[The different page types for PDF export]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[all]==],
["2"] = [==[single]==],
["3"] = [==[contact]==],
},
},
},
["dt_pdf_stream_encoder_t"] = {
["__text"] = [==[The compression mode for PDF document]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[uncompressed]==],
["2"] = [==[deflate]==],
},
},
},
["dt_imageio_module_storage_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["dt_imageio_module_storage_data_email"] = {
["__text"] = [==[An object containing parameters to export to email.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_storage_data_flickr"] = {
["__text"] = [==[An object containing parameters to export to flickr.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_storage_data_facebook"] = {
["__text"] = [==[An object containing parameters to export to facebook.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_storage_data_latex"] = {
["__text"] = [==[An object containing parameters to export to latex.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["filename"] = {
["__text"] = [==[The filename to export to.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["title"] = {
["__text"] = [==[The title to use for export.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["dt_imageio_module_storage_data_picasa"] = {
["__text"] = [==[An object containing parameters to export to picasa.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
},
["dt_imageio_module_storage_data_gallery"] = {
["__text"] = [==[An object containing parameters to export to gallery.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["filename"] = {
["__text"] = [==[The filename to export to.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["title"] = {
["__text"] = [==[The title to use for export.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["dt_imageio_module_storage_data_disk"] = {
["__text"] = [==[An object containing parameters to export to disk.]==],
["__attributes"] = {
["has_pairs"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["filename"] = {
["__text"] = [==[The filename to export to.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["dt_lua_film_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_style_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]]=],
["dt_style_item_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["#"].__attributes["reported_type"]]=],
["dt_lua_tag_t"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["dt_lua_lib_t"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["dt_lua_view_t"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
["dt_lua_backgroundjob_t"] = {} --[=[API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]]=],
["dt_lua_snapshot_t"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]]=],
["hint_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_webp"]["hint"].__attributes["reported_type"]]=],
["dt_ui_container_t"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]["container"].__attributes["reported_type"]]=],
["snapshot_direction_t"] = {} --[=[API["darktable"]["gui"]["libs"]["snapshots"]["direction"].__attributes["reported_type"]]=],
["dt_imageio_j2k_format_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_j2k"]["format"].__attributes["reported_type"]]=],
["dt_imageio_j2k_preset_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_j2k"]["preset"].__attributes["reported_type"]]=],
["yield_type"] = {
["__text"] = [==[What type of event to wait for]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[WAIT_MS]==],
["2"] = [==[FILE_READABLE]==],
["3"] = [==[RUN_COMMAND]==],
},
},
},
["comp_type_t"] = {} --[=[API["types"]["dt_imageio_module_format_data_webp"]["comp_type"].__attributes["reported_type"]]=],
["lua_pref_type"] = {} --[=[API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]]=],
["dt_imageio_exr_compression_t"] = {
["__text"] = [==[The type of compression to use for the EXR image]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[off]==],
["2"] = [==[rle]==],
["3"] = [==[zips]==],
["4"] = [==[zip]==],
["5"] = [==[piz]==],
["6"] = [==[pxr24]==],
["7"] = [==[b44]==],
["8"] = [==[b44a]==],
},
},
},
["dt_lib_collect_params_rule_t"] = {
["__text"] = [==[A single rule for filtering a collection]==],
["__attributes"] = {
["has_pairs"] = true,
["reported_type"] = [==[dt_type]==],
},
["mode"] = {
["__text"] = [==[How this rule is applied after the previous one. Unused for the first rule]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[The logical operators to apply between rules]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[DT_LIB_COLLECT_MODE_AND]==],
["2"] = [==[DT_LIB_COLLECT_MODE_OR]==],
["3"] = [==[DT_LIB_COLLECT_MODE_AND_NOT]==],
},
},
},
["write"] = true,
},
},
["data"] = {
["__text"] = [==[The text segment of the rule. Exact content depends on the type of rule]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["item"] = {
["__text"] = [==[The item on which this rule filter. i.e the type of the rule]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {
["__text"] = [==[The different elements on which a collection can be filtered]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[DT_COLLECTION_PROP_FILMROLL]==],
["2"] = [==[DT_COLLECTION_PROP_FOLDERS]==],
["3"] = [==[DT_COLLECTION_PROP_CAMERA]==],
["4"] = [==[DT_COLLECTION_PROP_TAG]==],
["5"] = [==[DT_COLLECTION_PROP_DAY]==],
["6"] = [==[DT_COLLECTION_PROP_TIME]==],
["7"] = [==[DT_COLLECTION_PROP_HISTORY]==],
["8"] = [==[DT_COLLECTION_PROP_COLORLABEL]==],
["9"] = [==[DT_COLLECTION_PROP_TITLE]==],
["10"] = [==[DT_COLLECTION_PROP_DESCRIPTION]==],
["11"] = [==[DT_COLLECTION_PROP_CREATOR]==],
["12"] = [==[DT_COLLECTION_PROP_PUBLISHER]==],
["13"] = [==[DT_COLLECTION_PROP_RIGHTS]==],
["14"] = [==[DT_COLLECTION_PROP_LENS]==],
["15"] = [==[DT_COLLECTION_PROP_FOCAL_LENGTH]==],
["16"] = [==[DT_COLLECTION_PROP_ISO]==],
["17"] = [==[DT_COLLECTION_PROP_APERTURE]==],
["18"] = [==[DT_COLLECTION_PROP_FILENAME]==],
["19"] = [==[DT_COLLECTION_PROP_GEOTAGGING]==],
},
},
},
["write"] = true,
},
},
},
["dt_lib_collect_mode_t"] = {} --[=[API["types"]["dt_lib_collect_params_rule_t"]["mode"].__attributes["reported_type"]]=],
["dt_collection_properties_t"] = {} --[=[API["types"]["dt_lib_collect_params_rule_t"]["item"].__attributes["reported_type"]]=],
["dt_lua_orientation_t"] = {
["__text"] = [==[A possible orientation for a widget]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[horizontal]==],
["2"] = [==[vertical]==],
},
},
},
["dt_lua_align_t"] = {
["__text"] = [==[The alignment of a label]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[fill]==],
["2"] = [==[start]==],
["3"] = [==[end]==],
["4"] = [==[center]==],
["5"] = [==[baseline]==],
},
},
},
["dt_lua_ellipsize_mode_t"] = {
["__text"] = [==[The ellipsize mode of a label]==],
["__attributes"] = {
["reported_type"] = [==[enum]==],
["values"] = {
["1"] = [==[none]==],
["2"] = [==[start]==],
["3"] = [==[middle]==],
["4"] = [==[end]==],
},
},
},
["dt_lua_cairo_t"] = {} --[=[API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
["lua_widget"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["lua_container"] = {
["__text"] = [==[A widget containing other widgets]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["#"] = {
["__text"] = [==[The widgets contained by the box
You can append widgets by adding them at the end of the list
You can remove widgets by setting them to nil]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["lua_check_button"] = {
["__text"] = [==[A checkable button with a label next to it]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["label"] = {
["__text"] = [==[The label displayed next to the button]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["value"] = {
["__text"] = [==[If the widget is checked or not]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["clicked_callback"] = {
["__text"] = [==[A function to call on button click]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget that triggered the callback]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["write"] = true,
},
},
},
["lua_label"] = {
["__text"] = [==[A label containing some text]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["label"] = {
["__text"] = [==[The label displayed]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["selectable"] = {
["__text"] = [==[True if the label content should be selectable]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["halign"] = {
["__text"] = [==[The horizontal alignment of the label]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["types"]["dt_lua_align_t"]]=],
["write"] = true,
},
},
["ellipsize"] = {
["__text"] = [==[The ellipsize mode of the label]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["types"]["dt_lua_ellipsize_mode_t"]]=],
["write"] = true,
},
},
},
["lua_button"] = {
["__text"] = [==[A clickable button]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["label"] = {
["__text"] = [==[The label displayed on the button]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["clicked_callback"] = {
["__text"] = [==[A function to call on button click]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget that triggered the callback]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["write"] = true,
},
},
},
["lua_box"] = {
["__text"] = [==[A container for widget in a horizontal or vertical list]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["types"]["lua_container"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["orientation"] = {
["__text"] = [==[The orientation of the box.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = {} --[=[API["types"]["dt_lua_orientation_t"]]=],
["write"] = true,
},
},
},
["lua_entry"] = {
["__text"] = [==[A widget in which the user can input text]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["text"] = {
["__text"] = [==[The content of the entry]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["placeholder"] = {
["__text"] = [==[The text to display when the entry is empty]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["is_password"] = {
["__text"] = [==[True if the text content should be hidden]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["editable"] = {
["__text"] = [==[False if the entry should be read-only]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
},
["lua_separator"] = {
["__text"] = [==[A widget providing a separation in the UI.]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["orientation"] = {
["__text"] = [==[The orientation of the separator.]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["lua_combobox"] = {
["__text"] = [==[A widget with multiple text entries in a menu
This widget can be set as editable at construction time.
If it is editable the user can type a value and is not constrained by the values in the menu]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["value"] = {
["__text"] = [==[The text content of the selected entry, can be nil
You can set it to a number to select the corresponding entry from the menu
If the combo box is editable, you can set it to any string
You can set it to nil to deselect all entries]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["#"] = {
["__text"] = [==[The various menu entries.
You can add new entries by writing to the first element beyond the end
You can removes entries by setting them to nil]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
},
},
["changed_callback"] = {
["__text"] = [==[A function to call when the value field changes (character entered or value selected)]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget that triggered the callback]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["write"] = true,
},
},
["editable"] = {
["__text"] = [==[True is the user is allowed to type a string in the combobox]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
["label"] = {
["__text"] = [==[The label displayed on the combobox]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
["lua_file_chooser_button"] = {
["__text"] = [==[A button that allows the user to select an existing file]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["title"] = {
["__text"] = [==[The title of the window when choosing a file]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["value"] = {
["__text"] = [==[The currently selected file]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
["changed_callback"] = {
["__text"] = [==[A function to call when the value field changes (character entered or value selected)]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The widget that triggered the callback]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
},
},
},
["write"] = true,
},
},
["is_directory"] = {
["__text"] = [==[True if the file chooser button only allows directories to be selecte]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[boolean]==],
["write"] = true,
},
},
},
["lua_stack"] = {
["__text"] = [==[A container that will only show one of its child at a time]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_length"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["types"]["lua_container"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["active"] = {
["__text"] = [==[The currently selected child, can be nil if the container has no child, can be set to one of the child widget or to an index in the child table]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[types.lua_widget or nil]==],
["write"] = true,
},
},
},
["lua_slider"] = {
["__text"] = [==[A slider that can be set by the user]==],
["__attributes"] = {
["has_ipairs"] = true,
["has_pairs"] = true,
["has_tostring"] = true,
["parent"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]]=],
["reported_type"] = [==[dt_type]==],
},
["__call"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]]=],
["soft_min"] = {
["__text"] = [==[The soft minimum value for the slider, the slider can't go beyond this point]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["soft_max"] = {
["__text"] = [==[The soft maximum value for the slider, the slider can't go beyond this point]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["hard_min"] = {
["__text"] = [==[The hard minimum value for the slider, the user can't manually enter a value beyond this point]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["hard_max"] = {
["__text"] = [==[The hard maximum value for the slider, the user can't manually enter a value beyond this point]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["value"] = {
["__text"] = [==[The current value of the slider]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[number]==],
["write"] = true,
},
},
["label"] = {
["__text"] = [==[The label next to the slider]==],
["__attributes"] = {
["is_attribute"] = true,
["read"] = true,
["reported_type"] = [==[string]==],
["write"] = true,
},
},
},
},
["events"] = {
["__text"] = [==[This section documents events that can be used to trigger Lua callbacks.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["intermediate-export-image"] = {
["__text"] = [==[This event is called each time an image is exported, once for each image after the image has been processed to an image format but before the storage has moved the image to its final destination.]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The image object that has been exported.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [==[The name of the file that is the result of the image being processed.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["4"] = {
["__text"] = [==[The format used to export the image.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["5"] = {
["__text"] = [==[The storage used to export the image (can be nil).]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["post-import-image"] = {
["__text"] = [==[This event is triggered whenever a new image is imported into the database.
This event can be registered multiple times, all callbacks will be called.]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The image object that has been exported.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["shortcut"] = {
["__text"] = [==[This event registers a new keyboard shortcut. The shortcut isn't bound to any key until the users does so in the preference panel.
The event is triggered whenever the shortcut is triggered.
This event can only be registered once per value of shortcut.
]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The tooltip string that was given at registration time.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
["signature"] = {
["1"] = {
["__text"] = [==[The string that will be displayed on the shortcut preference panel describing the shortcut.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
},
},
},
},
["post-import-film"] = {
["__text"] = [==[This event is triggered when an film import is finished (all post-import-image callbacks have already been triggered). This event can be registered multiple times.
]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The new film that has been added. If multiple films were added recursively only the top level film is reported.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["view-changed"] = {
["__text"] = [==[This event is triggered after the user changed the active view]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The view that we just left]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
["3"] = {
["__text"] = [==[The view we are now in]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["global_toolbox-grouping_toggle"] = {
["__text"] = [==[This event is triggered after the user toggled the grouping button.]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[the new grouping status.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["global_toolbox-overlay_toggle"] = {
["__text"] = [==[This event is triggered after the user toggled the overlay button.]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[the new overlay status.]==],
["__attributes"] = {
["reported_type"] = [==[boolean]==],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["mouse-over-image-changed"] = {
["__text"] = [==[This event is triggered whenever the image under the mouse changes]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The new image under the mous, can be nil if there is no image under the mouse]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]]=],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["exit"] = {
["__text"] = [==[This event is triggered when darktable exits, it allows lua scripts to do cleanup jobs]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["pre-import"] = {
["__text"] = [==[This event is trigger before any import action]==],
["__attributes"] = {
["reported_type"] = [==[event]==],
},
["callback"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["signature"] = {
["1"] = {
["__text"] = [==[The name of the event that triggered the callback.]==],
["__attributes"] = {
["reported_type"] = [==[string]==],
},
},
["2"] = {
["__text"] = [==[The files that will be imported. Modifying this table will change the list of files that will be imported"]==],
["__attributes"] = {
["reported_type"] = [==[table of string]==],
},
},
},
},
},
["extra_registration_parameters"] = {
["__text"] = [==[This event has no extra registration parameters.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
},
["attributes"] = {
["__text"] = [==[This section documents various attributes used throughout the documentation.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["write"] = {
["__text"] = [==[This object is a variable that can be written to.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
["has_tostring"] = {
["__text"] = [==[This object has a specific reimplementation of the "tostring" method that allows pretty-printing it.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
["implicit_yield"] = {
["__text"] = [==[This call will release the Lua lock while executing, thus allowing other Lua callbacks to run.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
["parent"] = {
["__text"] = [==[This object inherits some methods from another object. You can call the methods from the parent on the child object]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
},
},
["system"] = {
["__text"] = [==[This section documents changes to system functions.]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["coroutine"] = {
["__text"] = [==[]==],
["__attributes"] = {
["reported_type"] = [==[documentation node]==],
},
["yield"] = {
["__text"] = [==[Lua functions can yield at any point. The parameters and return types depend on why we want to yield.
A callback that is yielding allows other Lua code to run.
* WAIT_MS: one extra parameter; the execution will pause for that many milliseconds; yield returns nothing;
* FILE_READABLE: an opened file from a call to the OS library; will return when the file is readable; returns nothing;
* RUN_COMMAND: a command to be run by "sh -c"; will return when the command terminates; returns the return code of the execution.
]==],
["__attributes"] = {
["reported_type"] = [==[function]==],
["ret_val"] = {
["__text"] = [==[Nothing for "WAIT_MS" and "FILE_READABLE"; the returned code of the command for "RUN_COMMAND".]==],
["__attributes"] = {
["reported_type"] = [==[variable]==],
},
},
["signature"] = {
["1"] = {
["__text"] = [==[The type of yield.]==],
["__attributes"] = {
["reported_type"] = {} --[=[API["types"]["yield_type"]]=],
},
},
["2"] = {
["__text"] = [==[An extra parameter: integer for "WAIT_MS", open file for "FILE_READABLE", string for "RUN_COMMAND".]==],
["__attributes"] = {
["reported_type"] = [==[variable]==],
},
},
},
},
},
},
},
}
API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_lib"].__attributes["signature"]["8"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_lib"].__attributes["signature"]["8"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["current_view"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["current_view"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["map"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["darkroom"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["lighttable"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["tethering"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["slideshow"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["views"]["print"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_lua_view_t"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["view-changed"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["view-changed"]["callback"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["5"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["6"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["new_format"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_png"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_tiff"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_exr"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_copy"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_pfm"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_jpeg"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_ppm"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_webp"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_j2k"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_imageio_module_format_data_pdf"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["4"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["tags"]["get_tags"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"]
API["darktable"]["database"]["duplicate"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"]
API["darktable"]["tags"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"]
API["system"]["coroutine"]["yield"].__attributes["signature"]["1"].__attributes["reported_type"] = API["types"]["yield_type"]
API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]["select"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["snapshots"]["selected"].__attributes["reported_type"] = API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]
API["types"]["dt_lua_snapshot_t"] = API["darktable"]["gui"]["libs"]["snapshots"]["#"].__attributes["reported_type"]
API["darktable"]["gui"]["create_job"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]
API["types"]["dt_lua_backgroundjob_t"] = API["darktable"]["gui"]["create_job"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["film"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["films"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["films"]["new"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_lua_film_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["post-import-film"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["preferences"]["read"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["darktable"]["preferences"]["write"].__attributes["signature"]["3"].__attributes["reported_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["types"]["lua_pref_type"] = API["darktable"]["preferences"]["register"].__attributes["signature"]["3"].__attributes["reported_type"]
API["types"]["lua_label"]["ellipsize"].__attributes["reported_type"] = API["types"]["dt_lua_ellipsize_mode_t"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["save"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["restore"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["move_to"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["line_to"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["rectangle"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["arc"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["arc_negative"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["rotate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["scale"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["translate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["new_sub_path"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]["draw_line"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_lua_cairo_t"] = API["darktable"]["guides"]["register_guide"].__attributes["signature"]["2"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["lua_box"].__attributes["parent"] = API["types"]["lua_container"]
API["types"]["lua_stack"].__attributes["parent"] = API["types"]["lua_container"]
API["types"]["lua_label"]["halign"].__attributes["reported_type"] = API["types"]["dt_lua_align_t"]
API["types"]["lua_box"]["orientation"].__attributes["reported_type"] = API["types"]["dt_lua_orientation_t"]
API["types"]["dt_collection_properties_t"] = API["types"]["dt_lib_collect_params_rule_t"]["item"].__attributes["reported_type"]
API["types"]["dt_lib_collect_mode_t"] = API["types"]["dt_lib_collect_params_rule_t"]["mode"].__attributes["reported_type"]
API["types"]["lua_container"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_check_button"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_label"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_button"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_box"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_entry"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_separator"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_combobox"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_file_chooser_button"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_stack"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["lua_slider"]["__call"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"]
API["types"]["dt_imageio_j2k_preset_t"] = API["types"]["dt_imageio_module_format_data_j2k"]["preset"].__attributes["reported_type"]
API["types"]["dt_imageio_j2k_format_t"] = API["types"]["dt_imageio_module_format_data_j2k"]["format"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["attach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]
API["darktable"]["tags"]["attach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"]
API["darktable"]["styles"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"]
API["types"]["comp_type_t"] = API["types"]["dt_imageio_module_format_data_webp"]["comp_type"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["styles"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["types"]["dt_style_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["copy"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]
API["darktable"]["database"]["copy_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"]
API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["reset_callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]["__call"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["darktable"]["register_lib"].__attributes["signature"]["6"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["darktable"]["new_widget"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["import"]["register_widget"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_widget"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_container"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_container"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_check_button"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_check_button"]["clicked_callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_label"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_button"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_button"]["clicked_callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_entry"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_separator"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_combobox"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_combobox"]["changed_callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_file_chooser_button"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_file_chooser_button"]["changed_callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["types"]["lua_slider"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["7"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["4"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["5"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["6"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["new_storage"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_email"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_flickr"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_facebook"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_latex"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_picasa"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_gallery"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_imageio_module_storage_data_disk"].__attributes["parent"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["5"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]["reset"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_lib"].__attributes["signature"]["8"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["snapshots"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["collect"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["import"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["styles"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["metadata_view"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["metadata"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["hinter"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["modulelist"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["filmstrip"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["viewswitcher"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["darktable_label"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["tagging"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["geotagging"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["recentcollect"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["global_toolbox"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["filter"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["ratings"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["select"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["colorlabels"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["lighttable_mode"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["copy_history"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["image"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["modulegroups"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["module_toolbox"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["session"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["histogram"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["export"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["history"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["colorpicker"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["navigation"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["masks"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["view_toolbox"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["live_view"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["map_settings"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["camera"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["location"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["backgroundjobs"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["gui"]["libs"]["print_settings"].__attributes["parent"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_lua_lib_t"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["styles"]["export"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["export"]
API["types"]["hint_t"] = API["types"]["dt_imageio_module_format_data_webp"]["hint"].__attributes["reported_type"]
API["darktable"]["database"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]
API["darktable"]["films"]["delete"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["blue"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["green"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["yellow"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["purple"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["red"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["tags"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["darktable"]["tags"]["find"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_lua_tag_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]
API["types"]["dt_style_item_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["#"].__attributes["reported_type"]
API["types"]["dt_ui_container_t"] = API["darktable"]["register_lib"].__attributes["signature"]["7"].__attributes["signature"]["1"].__attributes["reported_type"]["container"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["detach_tag"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]
API["darktable"]["tags"]["detach"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["apply_style"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]
API["darktable"]["styles"]["apply"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"]
API["darktable"]["styles"]["duplicate"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["duplicate"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["detach"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["1"].__attributes["reported_type"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["attach_tag"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_tags"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["ret_val"].__attributes["reported_type"]["apply"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["duplicate"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["copy_image"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["reset"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["delete"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_with"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_with"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["make_group_leader"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["get_group_members"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["group_leader"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["drop_cache"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["hovered"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["gui"]["create_job"].__attributes["signature"]["3"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["database"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["database"]["import"].__attributes["ret_val"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["collection"]["#"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["types"]["dt_lua_image_t"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["intermediate-export-image"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["post-import-image"]["callback"].__attributes["signature"]["2"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["events"]["mouse-over-image-changed"]["callback"].__attributes["signature"]["1"].__attributes["reported_type"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]
API["darktable"]["styles"]["create"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["create_style"]
API["types"]["snapshot_direction_t"] = API["darktable"]["gui"]["libs"]["snapshots"]["direction"].__attributes["reported_type"]
API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"].__attributes["signature"]["2"].__attributes["reported_type"]["move_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]
API["darktable"]["database"]["move_image"] = API["darktable"]["register_storage"].__attributes["signature"]["3"].__attributes["signature"]["1"].__attributes["reported_type"]["supports_format"].__attributes["signature"]["2"].__attributes["reported_type"]["write_image"].__attributes["signature"]["2"].__attributes["reported_type"]["move"]
return API
--
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua
| gpl-3.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[admin]/anti/camp_c.lua | 4 | 1818 | -- Global variable to check if a DD map is running --
local minDistance = 5
local interval = 1000
local maxCounter = 15
local warning = 8
local running = nil
local previousPosition = nil
local counter = 0
function mapRunning(isRunning)
if isRunning then
running = setTimer(campTimer, interval, 0)
-- outputDebugString('dd running')
else
reset()
end
end
addEvent('DDMapRunning', true)
addEventHandler('DDMapRunning', resourceRoot, mapRunning)
function newMapStarted()
-- outputDebugString('map stopped running')
reset()
end
addEventHandler('onClientMapStarting', root, newMapStarted)
function campTimer()
if getElementHealth(localPlayer) < 1 or getElementData(localPlayer, 'state') ~= "alive" then
return reset()
end
local currentPos = {getElementPosition(localPlayer)}
if previousPosition and getDistanceBetweenPoints3D(currentPos[1], currentPos[2], currentPos[3], previousPosition[1], previousPosition[2], previousPosition[3]) < minDistance then
counter = counter + 1
if counter == warning then
outputChatBox("Warning: you will be killed if you don't move!", 255, 0, 0)
elseif counter >= maxCounter then
-- outputChatBox("Killed for not moving", 255, 0, 0)
-- triggerServerEvent("campKilled", resourceRoot, localPlayer)
setElementHealth(localPlayer, 0)
reset()
end
else
-- outputDebugString('Thanks for moving!')
counter = 0
previousPosition = currentPos
end
end
function reset()
-- outputDebugString('reset')
if isTimer(running) then killTimer(running) end
running = nil
previousPosition = nil
counter = 0
end
addEventHandler("onClientVehicleCollision", root,
function ( hit )
if ( source == getPedOccupiedVehicle(localPlayer) ) then
if ( hit ~= nil ) then
previousPosition = nil
counter = 0
end
end
end
) | mit |
ffxiphoenix/darkstar | scripts/zones/Temenos/mobs/Goblin_Slaughterman.lua | 16 | 1072 | -----------------------------------
-- Area: Temenos N T
-- NPC: Goblin_Slaughterman
-----------------------------------
package.loaded["scripts/zones/Temenos/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/limbus");
require("scripts/zones/Temenos/TextIDs");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
local mobID = mob:getID();
-- print(mobID);
local mobX = mob:getXPos();
local mobY = mob:getYPos();
local mobZ = mob:getZPos();
if (mobID ==16928773) then
GetNPCByID(16928768+18):setPos(330,70,468);
GetNPCByID(16928768+18):setStatus(STATUS_NORMAL);
elseif (mobID ==16928772) then
GetNPCByID(16928770+450):setStatus(STATUS_NORMAL);
end
end;
| gpl-3.0 |
Quenty/NevermoreEngine | src/sprites/src/Shared/Sprite/AnimatedSpritesheet.lua | 1 | 2041 | --[=[
A spritesheet that is animated. See [AnimatedSpritesheetPlayer] for playback.
@class AnimatedSpritesheet
]=]
local require = require(script.Parent.loader).load(script)
local Spritesheet = require("Spritesheet")
local AnimatedSpritesheet = setmetatable({}, Spritesheet)
AnimatedSpritesheet.ClassName = "AnimatedSpritesheet"
AnimatedSpritesheet.__index = AnimatedSpritesheet
--[=[
@interface AnimatedSpritesheetOptions
.texture string
.frames number
.spritesPerRow number
.spriteSize Vector2
.framesPerSecond number
@within AnimatedSpritesheet
]=]
--[=[
Constructs a new AnimatedSpritesheet
@param options AnimatedSpritesheetOptions
@return AnimatedSpritesheet
]=]
function AnimatedSpritesheet.new(options)
local self = setmetatable(Spritesheet.new(options.texture), AnimatedSpritesheet)
self._options = assert(options, "Bad options")
assert(self._options.texture, "Bad options.texture")
assert(self._options.frames, "Bad options.frames")
assert(self._options.spritesPerRow, "Bad options.spritesPerRow")
assert(self._options.spriteSize, "Bad options.spriteSize")
assert(self._options.framesPerSecond, "Bad options.framesPerSecond")
for i=0, options.frames do
local x = i % options.spritesPerRow
local y = math.floor(i / options.spritesPerRow)
local position = options.spriteSize*Vector2.new(x, y)
self:AddSprite(i + 1, position, options.spriteSize)
end
return self
end
--[=[
Gets the sprite size
@return Vector2
]=]
function AnimatedSpritesheet:GetSpriteSize()
return self._options.spriteSize
end
--[=[
Gets the frames per a second
@return number
]=]
function AnimatedSpritesheet:GetFramesPerSecond()
return self._options.framesPerSecond
end
--[=[
Gets the play time for the animated sheet
@return number
]=]
function AnimatedSpritesheet:GetPlayTime()
return self._options.frames/self._options.framesPerSecond
end
--[=[
Retrieves the frames for the sprite sheet.
@return frames
]=]
function AnimatedSpritesheet:GetFrames()
return self._options.frames
end
return AnimatedSpritesheet | mit |
ffxiphoenix/darkstar | scripts/zones/Port_Windurst/npcs/Mojo-Pojo.lua | 38 | 1037 | -----------------------------------
-- Area: Port Windurst
-- NPC: Mojo-Pojo
-- Type: Standard NPC
-- @zone: 240
-- @pos -108.041 -4.25 109.545
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Port_Windurst/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x00e5);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Aht_Urhgan_Whitegate/npcs/Mazween.lua | 34 | 1639 | -----------------------------------
-- Area: Aht Urhgan Whitegate
-- NPC: Mazween
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs");
require("scripts/globals/shop");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc,MAZWEEN_SHOP_DIALOG);
stock = {0x1313,11200, -- Scroll of Sleepga
0x12A6,18720, -- Scroll of Sleep II
0x1292,25200, -- Poison II
0x12E7,14000, -- Bio II
0x1296,5160, -- Poisonga
0x1316,19932, -- Stone III
4779,22682, -- Water III
0x12DD,27744, -- Aero III
0x129C,33306, -- Fire III
0x12E1,39368, -- Blizzard III
0x12F6,45930, -- Thunder III
0x1303,27000, -- Absorb-TP
0x1311,44000, -- Absorb-ACC
0x12A1,30780, -- Drain II
0x1315,70560, -- Dread Spikes
4856,79800} -- Aspir II
showShop(player, STATIC, stock);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Northern_San_dOria/npcs/Olbergieut.lua | 17 | 2258 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Olbergieut
-- Type: Quest NPC
-- @zone 231
-- @pos 91 0 121
--
-- Starts and Finishes Quest: Gates of Paradise
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
gates = player:getQuestStatus(SANDORIA,GATES_TO_PARADISE);
if (player:hasKeyItem(SCRIPTURE_OF_WATER) == true) then
player:startEvent(0x026c);
elseif (gates == QUEST_ACCEPTED) then
player:showText(npc, OLBERGIEUT_DIALOG, SCRIPTURE_OF_WIND);
elseif (player:getFameLevel(SANDORIA) >= 2 and gates == QUEST_AVAILABLE) then
player:startEvent(0x026b);
else
player:startEvent(0x0264);
end;
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x026b and option == 0) then
player:addQuest(SANDORIA, GATES_TO_PARADISE);
player:addKeyItem(SCRIPTURE_OF_WIND);
player:messageSpecial(KEYITEM_OBTAINED, SCRIPTURE_OF_WIND);
elseif (csid == 0x026c) then
if (player:getFreeSlotsCount() == 0) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED, 13584);
else
player:completeQuest(SANDORIA,GATES_TO_PARADISE);
player:addFame(SANDORIA,SAN_FAME*30);
player:addTitle(THE_PIOUS_ONE);
player:delKeyItem(SCRIPTURE_OF_WATER);
player:addItem(13584,1);
player:messageSpecial(ITEM_OBTAINED,13584);
end;
end;
end;
| gpl-3.0 |
GmodStarfall/Starfall | lua/starfall/instance.lua | 1 | 7846 | ---------------------------------------------------------------------
-- SF Instance class.
-- Contains the compiled SF script and essential data. Essentially
-- the execution context.
---------------------------------------------------------------------
SF.Instance = {}
SF.Instance.__index = SF.Instance
--- Instance fields
-- @name Instance
-- @class table
-- @field env Environment table for the script
-- @field data Data that libraries can store.
-- @field ppdata Preprocessor data
-- @field ops Currently used ops.
-- @field hooks Registered hooks
-- @field scripts The compiled script functions.
-- @field initialized True if initialized, nil if not.
-- @field permissions Permissions manager
-- @field error True if instance is errored and should not be executed
-- @field mainfile The main file
-- @field player The "owner" of the instance
-- debug.gethook() returns the string "external hook" instead of a function... |:/
-- (I think) it basically just errors after 500000000 lines
local function infloop_detection_replacement()
error("Infinite Loop Detected!",2)
end
--- Internal function - do not call.
-- Runs a function while incrementing the instance ops coutner.
-- This does no setup work and shouldn't be called by client code
-- @param func The function to run
-- @param ... Arguments to func
-- @return True if ok
-- @return A table of values that the hook returned
function SF.Instance:runWithOps(func,...)
local maxops = self.context.ops
local function ophook(event)
self.ops = self.ops + 500
if self.ops > maxops then
debug.sethook(nil)
error("Operations quota exceeded.",0)
end
end
--local begin = SysTime()
--local beginops = self.ops
local args = {...}
local traceback
local wrapperfunc = function()
return {func(unpack(args))}
end
local function xpcall_callback(err)
traceback = debug.traceback(err, 2)
return err
end
debug.sethook(ophook,"",500)
local ok, rt = xpcall(wrapperfunc, xpcall_callback)
debug.sethook(infloop_detection_replacement,"",500000000)
--MsgN("SF: Exectued "..(self.ops-beginops).." instructions in "..(SysTime()-begin).." seconds")
if ok then
return true, rt
else
return false, rt, traceback
end
end
--- Internal function - Do not call. Prepares the script to be executed.
-- This is done automatically by Initialize and RunScriptHook.
function SF.Instance:prepare(hook, name)
assert(self.initialized, "Instance not initialized!")
assert(not self.error, "Instance is errored!")
assert(SF.instance == nil)
self:runLibraryHook("prepare",hook, name)
SF.instance = self
end
--- Internal function - Do not call. Cleans up the script.
-- This is done automatically by Initialize and RunScriptHook.
function SF.Instance:cleanup(hook, name, ok, errmsg)
assert(SF.instance == self)
self:runLibraryHook("cleanup",hook, name, ok, errmsg)
SF.instance = nil
end
--- Runs the scripts inside of the instance. This should be called once after
-- compiling/unpacking so that scripts can register hooks and such. It should
-- not be called more than once.
-- @return True if no script errors occured
-- @return The error message, if applicable
-- @return The error traceback, if applicable
function SF.Instance:initialize()
assert(not self.initialized, "Already initialized!")
self.initialized = true
self:runLibraryHook("initialize")
self:prepare("_initialize","_initialize")
local func = self.scripts[self.mainfile]
local ok, err, traceback = self:runWithOps(func)
if not ok then
self:cleanup("_initialize", true, err, traceback)
self.error = true
return false, err, traceback
end
SF.allInstances[self] = self
self:cleanup("_initialize","_initialize",false)
return true
end
--- Runs a script hook. This calls script code.
-- @param hook The hook to call.
-- @param ... Arguments to pass to the hook's registered function.
-- @return True if it executed ok, false if not or if there was no hook
-- @return If the first return value is false then the error message or nil if no hook was registered
function SF.Instance:runScriptHook(hook, ...)
for ok,err,traceback in self:iterTblScriptHook(hook,...) do
if not ok then return false,err,traceback end
end
return true
end
--- Runs a script hook until one of them returns a true value. Returns those values.
-- @param hook The hook to call.
-- @param ... Arguments to pass to the hook's registered function.
-- @return True if it executed ok, false if not or if there was no hook
-- @return If the first return value is false then the error message or nil if no hook was registered. Else any values that the hook returned.
-- @return The traceback if the instance errored
function SF.Instance:runScriptHookForResult(hook,...)
for ok,tbl,traceback in self:iterTblScriptHook(hook,...) do
if not ok then return false, tbl, traceback
elseif tbl and tbl[1] then
return true, unpack(tbl)
end
end
return true
end
-- Some small efficiency thing
local noop = function() end
--- Creates an iterator that calls each registered function for a hook.
-- @param hook The hook to call.
-- @param ... Arguments to pass to the hook's registered function.
-- @return An iterator function returning the ok status, and then either the hook
-- results or the error message and traceback
function SF.Instance:iterScriptHook(hook,...)
local hooks = self.hooks[hook:lower()]
if not hooks then return noop end
local index = nil
local args = {...}
return function()
if self.error then return end
local name, func = next(hooks,index)
if not name then return end
index = name
self:prepare(hook,name)
local ok, tbl, traceback = self:runWithOps(func,unpack(args))
if not ok then
self:cleanup(hook,name,true,tbl,traceback)
self.error = true
return false, tbl, traceback
end
self:cleanup(hook,name,false)
return true, unpack(tbl)
end
end
--- Like SF.Instance:iterSciptHook, except that it doesn't unpack the hook results.
-- @param ... Arguments to pass to the hook's registered function.
-- @return An iterator function returning the ok status, then either the table of
-- hook results or the error message and traceback
function SF.Instance:iterTblScriptHook(hook,...)
local hooks = self.hooks[hook:lower()]
if not hooks then return noop end
local index = nil
local args = {...}
return function()
if self.error then return end
local name, func = next(hooks,index)
if not name then return end
index = name
self:prepare(hook,name)
local ok, tbl, traceback = self:runWithOps(func,unpack(args))
if not ok then
self:cleanup(hook,name,true,tbl,traceback)
self.error = true
return false, tbl, traceback
end
self:cleanup(hook,name,false)
return true, tbl
end
end
--- Runs a library hook. Alias to SF.Libraries.CallHook(hook, self, ...).
-- @param hook Hook to run.
-- @param ... Additional arguments.
function SF.Instance:runLibraryHook(hook, ...)
return SF.Libraries.CallHook(hook,self,...)
end
--- Runs an arbitrary function under the SF instance. This can be used
-- to run your own hooks when using the integrated hook system doesn't
-- make sense (ex timers).
-- @param func Function to run
-- @param ... Arguments to pass to func
function SF.Instance:runFunction(func,...)
self:prepare("_runFunction",func)
local ok, tbl, traceback = self:runWithOps(func,...)
if not ok then
self:cleanup("_runFunction",func,true,tbl,traceback)
self.error = true
return false, tbl, traceback
end
self:cleanup("_runFunction",func,false)
return true, unpack(tbl)
end
--- Resets the amount of operations used.
function SF.Instance:resetOps()
self:runLibraryHook("resetOps")
self.ops = 0
end
--- Deinitializes the instance. After this, the instance should be discarded.
function SF.Instance:deinitialize()
self:runLibraryHook("deinitialize")
SF.allInstances[self] = nil
self.error = true
end
| bsd-3-clause |
ffxiphoenix/darkstar | scripts/zones/The_Boyahda_Tree/npcs/Mandragora_Warden.lua | 19 | 1951 | -----------------------------------
-- Area: The Boyahda Tree
-- NPC: Mandragora Warden
-- Type: Mission NPC
-- @pos 81.981 7.593 139.556 153
-----------------------------------
package.loaded["scripts/zones/The_Boyahda_Tree/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local MissionStatus = player:getVar("MissionStatus");
if (player:getCurrentMission(WINDURST) == DOLL_OF_THE_DEAD and (MissionStatus == 4 or MissionStatus == 5)) then
if (trade:hasItemQty(1181,1) == true) and (trade:getItemCount() == 1) then
player:startEvent(0x000D);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local MissionStatus = player:getVar ("MissionStatus");
local dialog = player:getVar ("mandialog");
if (MissionStatus == 4) then
if (dialog == 0) then
player:startEvent(0x000a);
player:setVar("mandialog",1);
player:PrintToPlayer("Seems like he wants something");
elseif (dialog == 1) then
player:startEvent(0x000b);
player:setVar("mandialog",2);
elseif (dialog == 2) then
player:startEvent(0x000c);
player:setVar("mandialog",3);
player:PrintToPlayer("Seems like he wants some Gobbu Hummus");
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 0x000D) then
player:setVar("MissionStatus",6);
player:messageSpecial(KEYITEM_OBTAINED,LETTER_FROM_ZONPAZIPPA);
player:addKeyItem(LETTER_FROM_ZONPAZIPPA);
end
end;
| gpl-3.0 |
dail8859/ScintilluaPlusPlus | ext/scintillua/lexers/sml.lua | 2 | 3293 | -- Copyright 2017 Murray Calavera. See LICENSE.
-- Standard ML LPeg lexer.
local l = require('lexer')
local token = l.token
function mlword(words)
return l.word_match(words, "'")
end
local ws = token(l.WHITESPACE, l.space^1)
-- single line comments are valid in successor ml
local cl = '(*)' * l.nonnewline^0
local comment = token(l.COMMENT, cl + l.nested_pair('(*', '*)'))
local string = token(l.STRING, lpeg.P('#')^-1 * l.delimited_range('"', true))
local function num(digit)
return digit * (digit^0 * lpeg.P('_'))^0 * digit^1 + digit
end
local int = num(l.digit)
local frac = lpeg.P('.') * int
local minus = lpeg.P('~')^-1
local exp = lpeg.S('eE') * minus * int
local real = int * frac^-1 * exp + int * frac * exp^-1
local hex = num(l.xdigit)
local bin = num(lpeg.S('01'))
local number = token(l.NUMBER,
lpeg.P('0w') * int
+ (lpeg.P('0wx') + lpeg.P('0xw')) * hex
+ (lpeg.P('0wb') + lpeg.P('0bw')) * bin
+ minus * lpeg.P('0x') * hex
+ minus * lpeg.P('0b') * bin
+ minus * real
+ minus * int
)
local keyword = token(l.KEYWORD, mlword{
'abstype', 'and', 'andalso', 'as', 'case', 'do', 'datatype', 'else', 'end',
'exception', 'fn', 'fun', 'handle', 'if', 'in', 'infix', 'infixr', 'let',
'local', 'nonfix', 'of', 'op', 'orelse', 'raise', 'rec', 'then',
'type', 'val', 'with', 'withtype', 'while',
'eqtype', 'functor', 'include', 'sharing', 'sig', 'signature',
'struct', 'structure'
})
-- includes valid symbols for identifiers
local operator = token(l.OPERATOR, lpeg.S('!*/+-^:@=<>()[]{},;._|#%&$?~`\\'))
local type = token(l.TYPE, mlword{
'int', 'real', 'word', 'bool', 'char', 'string', 'unit',
'array', 'exn', 'list', 'option', 'order', 'ref', 'substring', 'vector'
})
-- `real`, `vector` and `substring` are a problem
local func = token(l.FUNCTION, mlword{
'app', 'before', 'ceil', 'chr', 'concat', 'exnMessage', 'exnName',
'explode', 'floor', 'foldl', 'foldr', 'getOpt', 'hd', 'ignore',
'implode', 'isSome', 'length', 'map', 'not', 'null', 'ord', 'print',
'real', 'rev', 'round', 'size', 'str', 'substring', 'tl', 'trunc',
'valOf', 'vector',
'o', 'abs', 'mod', 'div'
})
-- non-symbolic identifiers only
local id = (l.alnum + "'" + '_')^0
local aid = l.alpha * id
local longid = (aid * lpeg.P('.'))^0 * aid
local identifier = token(l.IDENTIFIER, l.lower * id)
local typevar = token(l.VARIABLE, "'" * id)
local c = mlword{'true', 'false', 'nil'}
local const = token(l.CONSTANT, l.upper * id + c)
local structure = token(l.CLASS, aid * lpeg.P('.'))
local open
= token(l.KEYWORD, mlword{'open', 'structure', 'functor'})
* ws * token(l.CLASS, longid)
local struct_dec
= token(l.KEYWORD, lpeg.P('structure')) * ws
* token(l.CLASS, aid) * ws
* token(l.OPERATOR, lpeg.P('=')) * ws
local struct_new = struct_dec * token(l.KEYWORD, lpeg.P('struct'))
local struct_alias = struct_dec * token(l.CLASS, longid)
local M = {_NAME = 'sml'}
M._rules = {
{'whitespace', ws},
{'comment', comment},
{'number', number},
{'struct_new', struct_new},
{'struct_alias', struct_alias},
{'structure', structure},
{'open', open},
{'type', type},
{'keyword', keyword},
{'function', func},
{'string', string},
{'operator', operator},
{'typevar', typevar},
{'constant', const},
{'identifier', identifier},
}
return M
| gpl-2.0 |
ffxiphoenix/darkstar | scripts/globals/spells/slow.lua | 18 | 1498 | -----------------------------------------
-- Spell: Slow
-- Spell accuracy is most highly affected by Enfeebling Magic Skill, Magic Accuracy, and MND.
-- Slow's potency is calculated with the formula (150 + dMND*2)/1024, and caps at 300/1024 (~29.3%).
-- And MND of 75 is neccessary to reach the hardcap of Slow.
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local dMND = (caster:getStat(MOD_MND) - target:getStat(MOD_MND));
--Power.
local power = 150 + dMND * 2;
if (power > 300) then
power = 300;
end
if (caster:hasStatusEffect(EFFECT_SABOTEUR)) then
power = power * 2;
end
--Duration, including resistance.
local duration = 120 * applyResistanceEffect(caster,spell,target,dMND,35,0,EFFECT_SLOW);
if (duration >= 60) then --Do it!
if (caster:hasStatusEffect(EFFECT_SABOTEUR)) then
duration = duration * 2;
end
caster:delStatusEffect(EFFECT_SABOTEUR);
if (target:addStatusEffect(EFFECT_SLOW,power,0,duration, 0, 1)) then
spell:setMsg(236);
else
spell:setMsg(75);
end
else
spell:setMsg(85);
end
return EFFECT_SLOW;
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Temenos/mobs/Temenos_Cleaner.lua | 16 | 1289 | -----------------------------------
-- Area: Temenos Central 1floor
-- NPC: Temenos_Cleaner
-----------------------------------
package.loaded["scripts/zones/Temenos/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/limbus");
require("scripts/zones/Temenos/TextIDs");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
if (IsMobDead(16929046)==true) then
mob:addStatusEffect(EFFECT_REGAIN,7,3,0);
mob:addStatusEffect(EFFECT_REGEN,50,3,0);
end
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
local mobX = mob:getXPos();
local mobY = mob:getYPos();
local mobZ = mob:getZPos();
if (IsMobDead(16929046)==true and IsMobDead(16929047)==true and IsMobDead(16929048)==true and IsMobDead(16929049)==true and IsMobDead(16929050)==true and IsMobDead(16929051)==true) then
GetNPCByID(16928768+71):setPos(mobX,mobY,mobZ);
GetNPCByID(16928768+71):setStatus(STATUS_NORMAL);
GetNPCByID(16928770+471):setStatus(STATUS_NORMAL);
end
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua | 31 | 1367 | -----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Door:House
-- @zone 80
-- @pos 148 0 27
-----------------------------------
package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil;
require("scripts/globals/quests");
require("scripts/globals/settings");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getQuestStatus(CRYSTAL_WAR, KNOT_QUITE_THERE) == QUEST_ACCEPTED and player:getVar("KnotQuiteThere") == 3) then
player:startEvent(0x003F);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x003F) then
player:completeQuest(CRYSTAL_WAR, KNOT_QUITE_THERE);
player:addItem(751);
player:messageSpecial(ITEM_OBTAINED,751); --Platinum Beastcoin
player:setVar("KnotQuiteThere",0);
end
end; | gpl-3.0 |
vilarion/Illarion-Content | monster/race_63_bone_dragon/id_636_ice.lua | 3 | 1688 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
local monsterId = 636
local base = require("monster.base.base")
local monstermagic = require("monster.base.monstermagic")
local boneDragons = require("monster.race_63_bone_dragon.base")
local icefield = require("item.id_360_icefield")
local M = boneDragons.generateCallbacks()
local orgOnSpawn = M.onSpawn
function M.onSpawn(monster)
if orgOnSpawn ~= nil then
orgOnSpawn(monster)
end
base.setColor{monster = monster, target = base.SKIN_COLOR, red = 120, green = 170, blue = 255}
end
local magic = monstermagic()
magic.addIcecone{probability = 0.13, damage = {from = 1500, to = 1800}, range = 6,
itemProbability = 0.055, quality = {from = 2, to = 3}}
magic.addIcecone{probability = 0.009, damage = {from = 1700, to = 2000}, range = 6,
itemProbability = 0.025, quality = {from = 3, to = 4}}
magic.addIcecone{probability = 0.001, damage = {from = 1900, to = 2300}, range = 6,
itemProbability = 0.012, quality = {from = 4, to = 5}}
icefield.setIceImmunity(monsterId)
return magic.addCallbacks(M) | agpl-3.0 |
vilarion/Illarion-Content | quest/hummi_olaficht_604.lua | 3 | 3392 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- INSERT INTO "quests" ("qst_id", "qst_script") VALUES (604, 'quest.hummi_olaficht_604');
local common = require("base.common")
local M = {}
local GERMAN = Player.german
local ENGLISH = Player.english
-- Insert the quest title here, in both languages
local Title = {}
Title[GERMAN] = "Finde Elesil Daelwon in Runewick"
Title[ENGLISH] = "Find Elesil Daelwon in Runewick"
-- Insert an extensive description of each status here, in both languages
-- Make sure that the player knows exactly where to go and what to do
local Description = {}
Description[GERMAN] = {}
Description[ENGLISH] = {}
Description[GERMAN][1] = "Finde Elesil Daelwon an der Lunordbrück in Runewick and sprich mit ihr."
Description[ENGLISH][1] = "Find Elesil Daelwon at the Lunord Bridge in Runewick and talk to her."
Description[GERMAN][2] = "Da kannst nun mit Elesil sprechen. Frage nach 'Hilfe' wenn du nicht weißt, wonach du fragen sollst!\nDu kannst auch zurück zu Hummi gehen, um deine Belohnung abzuholen und später nochmals vorbei kommen. Elesil hat nämlich auch mindestens eine Aufgabe für dich."
Description[ENGLISH][2] = "You can talk with Elesil now. Ask for 'help' if you do not know what to say!\nYou can also go back to Hummi to collect your reward and come back later. Elesil also has at least one task for you."
Description[GERMAN][3] = "Hast du bereits nach den beiden anderen NPCs die Hummi erwähnt hat gefragt und sie auch besucht? Frizza and Iradona? Wenn nein, dann solltest du das jetzt tun. Wenn ja, dann hat Hummi einen zusätzlichen Auftrag für dich."
Description[ENGLISH][3] = "Have you already asked for and visited the two other NPCs, Frizza and Iradona, that Hummi mentions? If not, you should do it now. If you have already visited them, Hummi has an additional task for you."
-- Insert the position of the quest start here (probably the position of an NPC or item)
local Start = {681, 311, 0}
-- For each status insert a list of positions where the quest will continue, i.e. a new status can be reached there
local QuestTarget = {}
QuestTarget[1] = {position(894, 817, 0)} -- Elesil
QuestTarget[2] = {position(681, 311, 0)} -- Hummi
-- Insert the quest status which is reached at the end of the quest
local FINAL_QUEST_STATUS = 3
function M.QuestTitle(user)
return common.GetNLS(user, Title[GERMAN], Title[ENGLISH])
end
function M.QuestDescription(user, status)
local german = Description[GERMAN][status] or ""
local english = Description[ENGLISH][status] or ""
return common.GetNLS(user, german, english)
end
function M.QuestStart()
return Start
end
function M.QuestTargets(user, status)
return QuestTarget[status]
end
function M.QuestFinalStatus()
return FINAL_QUEST_STATUS
end
return M
| agpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/La_Theine_Plateau/npcs/Yaucevouchat.lua | 17 | 1570 | -----------------------------------
-- Area: La Theine Plateau
-- NPC: Yaucevouchat
-- Involved in Mission: The Rescue Drill
-- @pos -318 39 183 102
-----------------------------------
package.loaded["scripts/zones/La_Theine_Plateau/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/zones/La_Theine_Plateau/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getCurrentMission(SANDORIA) == THE_RESCUE_DRILL) then
local MissionStatus = player:getVar("MissionStatus");
if (MissionStatus >= 5 and MissionStatus <= 7) then
player:startEvent(0x0068);
elseif (MissionStatus == 8) then
player:showText(npc, RESCUE_DRILL + 21);
elseif (MissionStatus >= 9) then
player:showText(npc, RESCUE_DRILL + 26);
else
player:showText(npc, RESCUE_DRILL);
end
else
player:showText(npc, RESCUE_DRILL);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
Mhdl80/daredevil_mental11 | plugins/inrealm.lua | 850 | 25085 | -- data saved to moderation.json
-- check moderation plugin
do
local function create_group(msg)
-- superuser and admins only (because sudo are always has privilege)
if is_sudo(msg) or is_realm(msg) and is_admin(msg) then
local group_creator = msg.from.print_name
create_group_chat (group_creator, group_name, ok_cb, false)
return 'Group [ '..string.gsub(group_name, '_', ' ')..' ] has been created.'
end
end
local function create_realm(msg)
-- superuser and admins only (because sudo are always has privilege)
if is_sudo(msg) or is_realm(msg) and is_admin(msg) then
local group_creator = msg.from.print_name
create_group_chat (group_creator, group_name, ok_cb, false)
return 'Realm [ '..string.gsub(group_name, '_', ' ')..' ] has been created.'
end
end
local function killchat(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
for k,v in pairs(result.members) do
kick_user_any(v.id, result.id)
end
end
local function killrealm(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
for k,v in pairs(result.members) do
kick_user_any(v.id, result.id)
end
end
local function get_group_type(msg)
local data = load_data(_config.moderation.data)
if data[tostring(msg.to.id)] then
if not data[tostring(msg.to.id)]['group_type'] then
return 'No group type available.'
end
local group_type = data[tostring(msg.to.id)]['group_type']
return group_type
else
return 'Chat type not found.'
end
end
local function callbackres(extra, success, result)
--vardump(result)
local user = result.id
local name = string.gsub(result.print_name, "_", " ")
local chat = 'chat#id'..extra.chatid
send_large_msg(chat, user..'\n'..name)
return user
end
local function set_description(msg, data, target, about)
if not is_admin(msg) then
return "For admins only!"
end
local data_cat = 'description'
data[tostring(target)][data_cat] = about
save_data(_config.moderation.data, data)
return 'Set group description to:\n'..about
end
local function set_rules(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local data_cat = 'rules'
data[tostring(target)][data_cat] = rules
save_data(_config.moderation.data, data)
return 'Set group rules to:\n'..rules
end
-- lock/unlock group name. bot automatically change group name when locked
local function lock_group_name(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_name_set = data[tostring(target)]['settings']['set_name']
local group_name_lock = data[tostring(target)]['settings']['lock_name']
if group_name_lock == 'yes' then
return 'Group name is already locked'
else
data[tostring(target)]['settings']['lock_name'] = 'yes'
save_data(_config.moderation.data, data)
rename_chat('chat#id'..target, group_name_set, ok_cb, false)
return 'Group name has been locked'
end
end
local function unlock_group_name(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_name_set = data[tostring(target)]['settings']['set_name']
local group_name_lock = data[tostring(target)]['settings']['lock_name']
if group_name_lock == 'no' then
return 'Group name is already unlocked'
else
data[tostring(target)]['settings']['lock_name'] = 'no'
save_data(_config.moderation.data, data)
return 'Group name has been unlocked'
end
end
--lock/unlock group member. bot automatically kick new added user when locked
local function lock_group_member(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_member_lock = data[tostring(target)]['settings']['lock_member']
if group_member_lock == 'yes' then
return 'Group members are already locked'
else
data[tostring(target)]['settings']['lock_member'] = 'yes'
save_data(_config.moderation.data, data)
end
return 'Group members has been locked'
end
local function unlock_group_member(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_member_lock = data[tostring(target)]['settings']['lock_member']
if group_member_lock == 'no' then
return 'Group members are not locked'
else
data[tostring(target)]['settings']['lock_member'] = 'no'
save_data(_config.moderation.data, data)
return 'Group members has been unlocked'
end
end
--lock/unlock group photo. bot automatically keep group photo when locked
local function lock_group_photo(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_photo_lock = data[tostring(target)]['settings']['lock_photo']
if group_photo_lock == 'yes' then
return 'Group photo is already locked'
else
data[tostring(target)]['settings']['set_photo'] = 'waiting'
save_data(_config.moderation.data, data)
end
return 'Please send me the group photo now'
end
local function unlock_group_photo(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_photo_lock = data[tostring(target)]['settings']['lock_photo']
if group_photo_lock == 'no' then
return 'Group photo is not locked'
else
data[tostring(target)]['settings']['lock_photo'] = 'no'
save_data(_config.moderation.data, data)
return 'Group photo has been unlocked'
end
end
local function lock_group_flood(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_flood_lock = data[tostring(target)]['settings']['flood']
if group_flood_lock == 'yes' then
return 'Group flood is locked'
else
data[tostring(target)]['settings']['flood'] = 'yes'
save_data(_config.moderation.data, data)
return 'Group flood has been locked'
end
end
local function unlock_group_flood(msg, data, target)
if not is_admin(msg) then
return "For admins only!"
end
local group_flood_lock = data[tostring(target)]['settings']['flood']
if group_flood_lock == 'no' then
return 'Group flood is not locked'
else
data[tostring(target)]['settings']['flood'] = 'no'
save_data(_config.moderation.data, data)
return 'Group flood has been unlocked'
end
end
-- show group settings
local function show_group_settings(msg, data, target)
local data = load_data(_config.moderation.data, data)
if not is_admin(msg) then
return "For admins only!"
end
local settings = data[tostring(target)]['settings']
local text = "Group settings:\nLock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member
return text
end
local function returnids(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..''
for k,v in pairs(result.members) do
if v.print_name then
local username = ""
text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n"
end
end
send_large_msg(receiver, text)
local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w")
file:write(text)
file:flush()
file:close()
end
local function returnidsfile(cb_extra, success, result)
local receiver = cb_extra.receiver
local chat_id = "chat#id"..result.id
local chatname = result.print_name
local text = 'Users in '..string.gsub(chatname,"_"," ")..' ('..result.id..'):'..'\n'..''
for k,v in pairs(result.members) do
if v.print_name then
local username = ""
text = text .. "- " .. string.gsub(v.print_name,"_"," ") .. " (" .. v.id .. ") \n"
end
end
local file = io.open("./groups/lists/"..result.id.."memberlist.txt", "w")
file:write(text)
file:flush()
file:close()
send_document("chat#id"..result.id,"./groups/lists/"..result.id.."memberlist.txt", ok_cb, false)
end
local function admin_promote(msg, admin_id)
if not is_sudo(msg) then
return "Access denied!"
end
local admins = 'admins'
if not data[tostring(admins)] then
data[tostring(admins)] = {}
save_data(_config.moderation.data, data)
end
if data[tostring(admins)][tostring(admin_id)] then
return admin_name..' is already an admin.'
end
data[tostring(admins)][tostring(admin_id)] = admin_id
save_data(_config.moderation.data, data)
return admin_id..' has been promoted as admin.'
end
local function admin_demote(msg, admin_id)
if not is_sudo(msg) then
return "Access denied!"
end
local data = load_data(_config.moderation.data)
local admins = 'admins'
if not data[tostring(admins)] then
data[tostring(admins)] = {}
save_data(_config.moderation.data, data)
end
if not data[tostring(admins)][tostring(admin_id)] then
return admin_id..' is not an admin.'
end
data[tostring(admins)][tostring(admin_id)] = nil
save_data(_config.moderation.data, data)
return admin_id..' has been demoted from admin.'
end
local function admin_list(msg)
local data = load_data(_config.moderation.data)
local admins = 'admins'
if not data[tostring(admins)] then
data[tostring(admins)] = {}
save_data(_config.moderation.data, data)
end
local message = 'List for Realm admins:\n'
for k,v in pairs(data[tostring(admins)]) do
message = message .. '- (at)' .. v .. ' [' .. k .. '] ' ..'\n'
end
return message
end
local function groups_list(msg)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] then
return 'No groups at the moment'
end
local message = 'List of groups:\n'
for k,v in pairs(data[tostring(groups)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairs(settings) do
if m == 'set_name' then
name = n
end
end
local group_owner = "No owner"
if data[tostring(v)]['set_owner'] then
group_owner = tostring(data[tostring(v)]['set_owner'])
end
local group_link = "No link"
if data[tostring(v)]['settings']['set_link'] then
group_link = data[tostring(v)]['settings']['set_link']
end
message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n"
end
local file = io.open("./groups/lists/groups.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function realms_list(msg)
local data = load_data(_config.moderation.data)
local realms = 'realms'
if not data[tostring(realms)] then
return 'No Realms at the moment'
end
local message = 'List of Realms:\n'
for k,v in pairs(data[tostring(realms)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairs(settings) do
if m == 'set_name' then
name = n
end
end
local group_owner = "No owner"
if data[tostring(v)]['admins_in'] then
group_owner = tostring(data[tostring(v)]['admins_in'])
end
local group_link = "No link"
if data[tostring(v)]['settings']['set_link'] then
group_link = data[tostring(v)]['settings']['set_link']
end
message = message .. '- '.. name .. ' (' .. v .. ') ['..group_owner..'] \n {'..group_link.."}\n"
end
local file = io.open("./groups/lists/realms.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function admin_user_promote(receiver, member_username, member_id)
local data = load_data(_config.moderation.data)
if not data['admins'] then
data['admins'] = {}
save_data(_config.moderation.data, data)
end
if data['admins'][tostring(member_id)] then
return send_large_msg(receiver, member_username..' is already as admin.')
end
data['admins'][tostring(member_id)] = member_username
save_data(_config.moderation.data, data)
return send_large_msg(receiver, '@'..member_username..' has been promoted as admin.')
end
local function admin_user_demote(receiver, member_username, member_id)
local data = load_data(_config.moderation.data)
if not data['admins'] then
data['admins'] = {}
save_data(_config.moderation.data, data)
end
if not data['admins'][tostring(member_id)] then
return send_large_msg(receiver, member_username..' is not an admin.')
end
data['admins'][tostring(member_id)] = nil
save_data(_config.moderation.data, data)
return send_large_msg(receiver, 'Admin '..member_username..' has been demoted.')
end
local function username_id(cb_extra, success, result)
local mod_cmd = cb_extra.mod_cmd
local receiver = cb_extra.receiver
local member = cb_extra.member
local text = 'No user @'..member..' in this group.'
for k,v in pairs(result.members) do
vusername = v.username
if vusername == member then
member_username = member
member_id = v.id
if mod_cmd == 'addadmin' then
return admin_user_promote(receiver, member_username, member_id)
elseif mod_cmd == 'removeadmin' then
return admin_user_demote(receiver, member_username, member_id)
end
end
end
send_large_msg(receiver, text)
end
local function set_log_group(msg)
if not is_admin(msg) then
return
end
local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group']
if log_group == 'yes' then
return 'Log group is already set'
else
data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'yes'
save_data(_config.moderation.data, data)
return 'Log group has been set'
end
end
local function unset_log_group(msg)
if not is_admin(msg) then
return
end
local log_group = data[tostring(groups)][tostring(msg.to.id)]['log_group']
if log_group == 'no' then
return 'Log group is already disabled'
else
data[tostring(groups)][tostring(msg.to.id)]['log_group'] = 'no'
save_data(_config.moderation.data, data)
return 'log group has been disabled'
end
end
local function help()
local help_text = tostring(_config.help_text_realm)
return help_text
end
function run(msg, matches)
--vardump(msg)
local name_log = user_print_name(msg.from)
if matches[1] == 'log' and is_owner(msg) then
savelog(msg.to.id, "log file created by owner")
send_document("chat#id"..msg.to.id,"./groups/"..msg.to.id.."log.txt", ok_cb, false)
end
if matches[1] == 'who' and is_momod(msg) then
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list ")
local receiver = get_receiver(msg)
chat_info(receiver, returnidsfile, {receiver=receiver})
end
if matches[1] == 'wholist' and is_momod(msg) then
local name = user_print_name(msg.from)
savelog(msg.to.id, name.." ["..msg.from.id.."] requested member list in a file")
local receiver = get_receiver(msg)
chat_info(receiver, returnids, {receiver=receiver})
end
if matches[1] == 'creategroup' and matches[2] then
group_name = matches[2]
group_type = 'group'
return create_group(msg)
end
if not is_sudo(msg) or not is_admin(msg) and not is_realm(msg) then
return --Do nothing
end
if matches[1] == 'createrealm' and matches[2] then
group_name = matches[2]
group_type = 'realm'
return create_realm(msg)
end
local data = load_data(_config.moderation.data)
local receiver = get_receiver(msg)
if matches[2] then if data[tostring(matches[2])] then
local settings = data[tostring(matches[2])]['settings']
if matches[1] == 'setabout' and matches[2] then
local target = matches[2]
local about = matches[3]
return set_description(msg, data, target, about)
end
if matches[1] == 'setrules' then
rules = matches[3]
local target = matches[2]
return set_rules(msg, data, target)
end
if matches[1] == 'lock' then --group lock *
local target = matches[2]
if matches[3] == 'name' then
return lock_group_name(msg, data, target)
end
if matches[3] == 'member' then
return lock_group_member(msg, data, target)
end
if matches[3] == 'photo' then
return lock_group_photo(msg, data, target)
end
if matches[3] == 'flood' then
return lock_group_flood(msg, data, target)
end
end
if matches[1] == 'unlock' then --group unlock *
local target = matches[2]
if matches[3] == 'name' then
return unlock_group_name(msg, data, target)
end
if matches[3] == 'member' then
return unlock_group_member(msg, data, target)
end
if matches[3] == 'photo' then
return unlock_group_photo(msg, data, target)
end
if matches[3] == 'flood' then
return unlock_group_flood(msg, data, target)
end
end
if matches[1] == 'settings' and data[tostring(matches[2])]['settings'] then
local target = matches[2]
return show_group_settings(msg, data, target)
end
if matches[1] == 'setname' and is_realm(msg) then
local new_name = string.gsub(matches[2], '_', ' ')
data[tostring(msg.to.id)]['settings']['set_name'] = new_name
save_data(_config.moderation.data, data)
local group_name_set = data[tostring(msg.to.id)]['settings']['set_name']
local to_rename = 'chat#id'..msg.to.id
rename_chat(to_rename, group_name_set, ok_cb, false)
savelog(msg.to.id, "Realm { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]")
end
if matches[1] == 'setgpname' and is_admin(msg) then
local new_name = string.gsub(matches[3], '_', ' ')
data[tostring(matches[2])]['settings']['set_name'] = new_name
save_data(_config.moderation.data, data)
local group_name_set = data[tostring(matches[2])]['settings']['set_name']
local to_rename = 'chat#id'..matches[2]
rename_chat(to_rename, group_name_set, ok_cb, false)
savelog(msg.to.id, "Group { "..msg.to.print_name.." } name changed to [ "..new_name.." ] by "..name_log.." ["..msg.from.id.."]")
end
end
end
if matches[1] == 'help' and is_realm(msg) then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /help")
return help()
end
if matches[1] == 'set' then
if matches[2] == 'loggroup' then
savelog(msg.to.id, name_log.." ["..msg.from.id.."] set as log group")
return set_log_group(msg)
end
end
if matches[1] == 'kill' and matches[2] == 'chat' then
if not is_admin(msg) then
return nil
end
if is_realm(msg) then
local receiver = 'chat#id'..matches[3]
return modrem(msg),
print("Closing Group: "..receiver),
chat_info(receiver, killchat, {receiver=receiver})
else
return 'Error: Group '..matches[3]..' not found'
end
end
if matches[1] == 'kill' and matches[2] == 'realm' then
if not is_admin(msg) then
return nil
end
if is_realm(msg) then
local receiver = 'chat#id'..matches[3]
return realmrem(msg),
print("Closing realm: "..receiver),
chat_info(receiver, killrealm, {receiver=receiver})
else
return 'Error: Realm '..matches[3]..' not found'
end
end
if matches[1] == 'chat_add_user' then
if not msg.service then
return "Are you trying to troll me?"
end
local user = 'user#id'..msg.action.user.id
local chat = 'chat#id'..msg.to.id
if not is_admin(msg) then
chat_del_user(chat, user, ok_cb, true)
end
end
if matches[1] == 'addadmin' then
if string.match(matches[2], '^%d+$') then
local admin_id = matches[2]
print("user "..admin_id.." has been promoted as admin")
return admin_promote(msg, admin_id)
else
local member = string.gsub(matches[2], "@", "")
local mod_cmd = "addadmin"
chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member})
end
end
if matches[1] == 'removeadmin' then
if string.match(matches[2], '^%d+$') then
local admin_id = matches[2]
print("user "..admin_id.." has been demoted")
return admin_demote(msg, admin_id)
else
local member = string.gsub(matches[2], "@", "")
local mod_cmd = "removeadmin"
chat_info(receiver, username_id, {mod_cmd= mod_cmd, receiver=receiver, member=member})
end
end
if matches[1] == 'type'then
local group_type = get_group_type(msg)
return group_type
end
if matches[1] == 'list' and matches[2] == 'admins' then
return admin_list(msg)
end
if matches[1] == 'list' and matches[2] == 'groups' then
if msg.to.type == 'chat' then
groups_list(msg)
send_document("chat#id"..msg.to.id, "./groups/lists/groups.txt", ok_cb, false)
return "Group list created" --group_list(msg)
elseif msg.to.type == 'user' then
groups_list(msg)
send_document("user#id"..msg.from.id, "./groups/lists/groups.txt", ok_cb, false)
return "Group list created" --group_list(msg)
end
end
if matches[1] == 'list' and matches[2] == 'realms' then
if msg.to.type == 'chat' then
realms_list(msg)
send_document("chat#id"..msg.to.id, "./groups/lists/realms.txt", ok_cb, false)
return "Realms list created" --realms_list(msg)
elseif msg.to.type == 'user' then
realms_list(msg)
send_document("user#id"..msg.from.id, "./groups/lists/realms.txt", ok_cb, false)
return "Realms list created" --realms_list(msg)
end
end
if matches[1] == 'res' and is_momod(msg) then
local cbres_extra = {
chatid = msg.to.id
}
local username = matches[2]
local username = username:gsub("@","")
savelog(msg.to.id, name_log.." ["..msg.from.id.."] Used /res "..username)
return res_user(username, callbackres, cbres_extra)
end
end
return {
patterns = {
"^[!/](creategroup) (.*)$",
"^[!/](createrealm) (.*)$",
"^[!/](setabout) (%d+) (.*)$",
"^[!/](setrules) (%d+) (.*)$",
"^[!/](setname) (.*)$",
"^[!/](setgpname) (%d+) (.*)$",
"^[!/](setname) (%d+) (.*)$",
"^[!/](lock) (%d+) (.*)$",
"^[!/](unlock) (%d+) (.*)$",
"^[!/](setting) (%d+)$",
"^[!/](wholist)$",
"^[!/](who)$",
"^[!/](type)$",
"^[!/](kill) (chat) (%d+)$",
"^[!/](kill) (realm) (%d+)$",
"^[!/](addadmin) (.*)$", -- sudoers only
"^[!/](removeadmin) (.*)$", -- sudoers only
"^[!/](list) (.*)$",
"^[!/](log)$",
"^[!/](help)$",
"^!!tgservice (.+)$",
},
run = run
}
end
| gpl-2.0 |
ffxiphoenix/darkstar | scripts/zones/Windurst_Waters/npcs/Kerutoto.lua | 17 | 11600 | -----------------------------------
-- Area: Windurst Waters
-- NPC: Kerutoto
-- Starts Quest Food For Thought
-- Involved in Quest: Riding on the Clouds
-- @zone 238
-- @pos 13 -5 -157
-----------------------------------
package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil;
package.loaded["scripts/globals/settings"] = nil;
-----------------------------------
require("scripts/globals/missions");
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Windurst_Waters/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local count = trade:getItemCount();
if (player:getQuestStatus(WINDURST,BLUE_RIBBON_BLUES) == QUEST_ACCEPTED) then
if (trade:hasItemQty(12521,1) and count == 1) then
player:startEvent(0x016a);
elseif (trade:hasItemQty(13569,1) and count == 1) then
if (player:getVar("BlueRibbonBluesProg") == 4) then
player:startEvent(0x016d); -- Lost, ribbon but it came back
else
player:startEvent(0x0166,3600);
end
end
end
if (player:getQuestStatus(WINDURST,FOOD_FOR_THOUGHT) == QUEST_ACCEPTED and trade:hasItemQty(4371,1) and count == 1) then
player:startEvent(0x014c,440);
player:setVar("Kerutoto_Food_var",2);
end
if (player:getQuestStatus(JEUNO,RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getVar("ridingOnTheClouds_4") == 3) then
if (trade:hasItemQty(1127,1) and count == 1) then -- Trade Kindred seal
player:setVar("ridingOnTheClouds_4",0);
player:tradeComplete();
player:addKeyItem(SPIRITED_STONE);
player:messageSpecial(KEYITEM_OBTAINED,SPIRITED_STONE);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local KerutotoFood = player:getVar("Kerutoto_Food_var"); -- Variable to track progress of Kerutoto in Food for Thought
local FoodForThought = player:getQuestStatus(WINDURST,FOOD_FOR_THOUGHT);
local OhbiruFood = player:getVar("Ohbiru_Food_var"); -- Variable to track progress of Ohbiru-Dohbiru in Food for Thought
local BlueRibbonBlues = player:getQuestStatus(WINDURST,BLUE_RIBBON_BLUES);
local needZone = player:needToZone();
local realday = tonumber(os.date("%j")); -- %M for next minute, %j for next day
local waking_dreams = player:getQuestStatus(WINDURST,WAKING_DREAMS)
-- Awakening of the Gods --
if (player:getCurrentMission(WINDURST) == AWAKENING_OF_THE_GODS and player:getVar("MissionStatus") == 0) then
player:startEvent(0x02E1);
elseif (player:getCurrentMission(WINDURST) == AWAKENING_OF_THE_GODS and player:getVar("MissionStatus") == 1) then
player:startEvent(0x02E0);
elseif (player:getCurrentMission(WINDURST) == AWAKENING_OF_THE_GODS and player:getVar("MissionStatus") == 2) then
player:startEvent(0x02E2);
-- Three Paths --
elseif (player:getCurrentMission(COP) == THREE_PATHS and player:getVar("COP_Ulmia_s_Path") == 3) then
player:startEvent(0x036c);
-- Waking Dreams --
elseif (player:hasKeyItem(VIAL_OF_DREAM_INCENSE)==false and ((player:hasCompletedMission(COP,DARKNESS_NAMED) and waking_dreams == QUEST_AVAILABLE ) or(waking_dreams == QUEST_COMPLETED and realday ~= player:getVar("Darkness_Named_date")))) then
player:addQuest(WINDURST,WAKING_DREAMS);
player:startEvent(0x0396);--918
elseif (player:hasKeyItem(WHISPER_OF_DREAMS)==true) then
local availRewards = 0
if (player:hasItem(17599)) then availRewards = availRewards + 1; end -- Diabolos's Pole
if (player:hasItem(14814)) then availRewards = availRewards + 2; end -- Diabolos's Earring
if (player:hasItem(15557)) then availRewards = availRewards + 4; end -- Diabolos's Ring
if (player:hasItem(15516)) then availRewards = availRewards + 8; end -- Diabolos's Torque
if (player:hasSpell(304)) then availRewards = availRewards + 32; -- Pact
else availRewards = availRewards + 16 -- Gil
end
player:startEvent(0x0398,17599,14814,15557,15516,0,0,0,availRewards);
-- Blue Ribbon Blues --
elseif (BlueRibbonBlues == QUEST_COMPLETED and needZone) then
player:startEvent(0x016b);--363
elseif (BlueRibbonBlues == QUEST_ACCEPTED) then
local blueRibbonProg = player:getVar("BlueRibbonBluesProg");
if (player:hasItem(12521)) then
player:startEvent(0x016a);--362
elseif (blueRibbonProg == 2 and needZone == false) then
local timerDay = player:getVar("BlueRibbonBluesTimer_Day");
local currentDay = VanadielDayOfTheYear();
if (player:getVar("BlueRibbonBluesTimer_Year") < VanadielYear()) then
player:startEvent(0x0168); -- go to the grave 360
elseif (timerDay + 1 == VanadielDayOfTheYear() and player:getVar("BlueRibbonBluesTimer_Hour") <= VanadielHour()) then
player:startEvent(0x0168); -- go to the grave 360
elseif (timerDay + 2 <= VanadielDayOfTheYear()) then
player:startEvent(0x0168); -- go to the grave 360
else
player:startEvent(0x0167); -- Thanks for the ribbon 359
end
elseif (blueRibbonProg == 3) then
if (player:hasItem(13569)) then
player:startEvent(0x0169,0,13569); -- remidner, go to the grave
else
player:startEvent(0x016e,0,13569); -- lost the ribbon
end
elseif (blueRibbonProg == 4) then
player:startEvent(0x016e,0,13569);
else
player:startEvent(0x0132); -- Standard Conversation
end
elseif (BlueRibbonBlues == QUEST_AVAILABLE and player:getQuestStatus(WINDURST,WATER_WAY_TO_GO) == QUEST_COMPLETED and player:getFameLevel(WINDURST) >= 5) then
player:startEvent(0x0165);
-- Food for Thought --
elseif (FoodForThought == QUEST_AVAILABLE) then
if (OhbiruFood == 1 and KerutotoFood ~= 256) then -- Player knows the researchers are hungry and quest not refused
player:startEvent(0x0139,0,4371); -- Offered Quest 1 (Including Order ifYES)
elseif (OhbiruFood == 1 and KerutotoFood == 256) then -- Player knows the researchers are hungry and quest refused previously
player:startEvent(0x013a,0,4371); -- Offered Quest 2 (Including Order ifYES)
else
player:startEvent(0x0138); -- Before Quest: Asks you to check on others.
end
elseif (FoodForThought == QUEST_ACCEPTED) then
if (KerutotoFood == 1) then
player:startEvent(0x013b,0,4371); -- Repeats Order
elseif (KerutotoFood == 3) then
player:startEvent(0x014d); -- Reminder to check with the others if this NPC has already been fed
end
elseif (FoodForThought == QUEST_COMPLETED and needZone) then
player:startEvent(0x0130); -- NPC is sleeping but feels full (post Food for Thought)
else
player:startEvent(0x0132); -- Standard Conversation
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x036c) then
player:setVar("COP_Ulmia_s_Path",4);
elseif ((csid == 0x0139 and option == 0) or (csid == 0x013a and option == 0)) then
player:addQuest(WINDURST,FOOD_FOR_THOUGHT);
player:setVar("Kerutoto_Food_var",1);
elseif (csid == 0x0139 and option == 1) then
player:setVar("Kerutoto_Food_var",256);
elseif (csid == 0x014c) then
if (player:getVar("Kerutoto_Food_var") == 2 and player:getVar("Kenapa_Food_var") == 4 and player:getVar("Ohbiru_Food_var") == 3) then -- If this is the last NPC to be fed
player:addGil(GIL_RATE*440);
player:tradeComplete();
player:addTitle(FAST_FOOD_DELIVERER);
player:addFame(WINDURST,WIN_FAME*100);
player:needToZone(true);
player:completeQuest(WINDURST,FOOD_FOR_THOUGHT);
player:setVar("Kerutoto_Food_var",0); -- ------------------------------------------
player:setVar("Kenapa_Food_var",0); -- Erase all the variables used in this quest
player:setVar("Ohbiru_Food_var",0); -- ------------------------------------------
else
player:tradeComplete();
player:addGil(GIL_RATE*440);
player:setVar("Kerutoto_Food_var",3); -- If this is NOT the last NPC given food, flag this NPC as completed.
end
elseif (csid == 0x0165) then
player:addQuest(WINDURST,BLUE_RIBBON_BLUES);
elseif (csid == 0x0166 or csid == 0x016d) then
player:tradeComplete();
player:setVar("BlueRibbonBluesProg",2);
player:setVar("BlueRibbonBluesTimer_Hour",VanadielHour());
player:setVar("BlueRibbonBluesTimer_Year",VanadielYear());
player:setVar("BlueRibbonBluesTimer_Day",VanadielDayOfTheYear());
player:needToZone(true);
if (csid == 0x0166) then
player:addGil(GIL_RATE*3600);
end
elseif (csid == 0x0168) then
if (player:getFreeSlotsCount() >= 1) then
player:setVar("BlueRibbonBluesProg",3);
player:setVar("BlueRibbonBluesTimer_Hour",0);
player:setVar("BlueRibbonBluesTimer_Year",0);
player:setVar("BlueRibbonBluesTimer_Day",0);
player:addItem(13569);
player:messageSpecial(ITEM_OBTAINED,13569);
else
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,13569);
end
elseif (csid == 0x016a) then
player:completeQuest(WINDURST,BLUE_RIBBON_BLUES);
player:setVar("BlueRibbonBluesProg",0);
player:addFame(WINDURST,WIN_FAME*140);
player:addTitle(GHOSTIE_BUSTER);
player:needToZone(true);
elseif (csid == 0x0396) then --diablos start
player:addKeyItem(VIAL_OF_DREAM_INCENSE);
player:messageSpecial(KEYITEM_OBTAINED,VIAL_OF_DREAM_INCENSE);
elseif (csid == 0x0398) then --diablos reward
local item = 0;
local addspell = 0;
if (option == 1 and player:hasItem(17599)==false) then item = 17599;--diaboloss-pole
elseif (option == 2 and player:hasItem(14814)==false) then item = 14814;--diaboloss-earring
elseif (option == 3 and player:hasItem(15557)==false) then item = 15557;--diaboloss-ring
elseif (option == 4 and player:hasItem(15516)==false) then item = 15516;--diaboloss-torque
elseif (option == 5) then
player:addGil(GIL_RATE*15000);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*15000); -- Gil
player:delKeyItem(WHISPER_OF_DREAMS);
player:setVar("Darkness_Named_date", os.date("%j")); -- %M for next minute, %j for next day
player:completeQuest(WINDURST,WAKING_DREAMS);
elseif (option == 6 and player:hasSpell(304)==false) then
player:addSpell(304); -- diabolos Spell
player:messageSpecial(DIABOLOS_UNLOCKED,0,0,0);
addspell=1;
end
if (addspell==1) then
player:delKeyItem(WHISPER_OF_DREAMS);
player:setVar("Darkness_Named_date", os.date("%j")); -- %M for next minute, %j for next day
player:completeQuest(WINDURST,WAKING_DREAMS);
elseif (item > 0 and player:getFreeSlotsCount()~=0) then
player:delKeyItem(WHISPER_OF_DREAMS);
player:setVar("Darkness_Named_date", os.date("%j")); -- %M for next minute, %j for next day
player:completeQuest(WINDURST,WAKING_DREAMS);
player:addItem(item);
player:messageSpecial(ITEM_OBTAINED,item); -- Item
elseif ( option ~= 5 and (( item == 0 and addspell==0 ) or (item > 0 and player:getFreeSlotsCount()==0) ) ) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,item);
end
elseif (csid == 0x02E0) then
player:setVar("MissionStatus",2);
end
end; | gpl-3.0 |
crzang/awesome-config | pl/OrderedMap.lua | 8 | 4507 | --- OrderedMap, a map which preserves ordering.
--
-- Derived from `pl.Map`.
--
-- Dependencies: `pl.utils`, `pl.tablex`, `pl.List`
-- @classmod pl.OrderedMap
local tablex = require 'pl.tablex'
local utils = require 'pl.utils'
local List = require 'pl.List'
local index_by,tsort,concat = tablex.index_by,table.sort,table.concat
local class = require 'pl.class'
local Map = require 'pl.Map'
local OrderedMap = class(Map)
OrderedMap._name = 'OrderedMap'
local rawset = rawset
--- construct an OrderedMap.
-- Will throw an error if the argument is bad.
-- @param t optional initialization table, same as for @{OrderedMap:update}
function OrderedMap:_init (t)
rawset(self,'_keys',List())
if t then
local map,err = self:update(t)
if not map then error(err,2) end
end
end
local assert_arg,raise = utils.assert_arg,utils.raise
--- update an OrderedMap using a table.
-- If the table is itself an OrderedMap, then its entries will be appended. <br>
-- if it s a table of the form <code>{{key1=val1},{key2=val2},...}</code> these will be appended. <br>
-- Otherwise, it is assumed to be a map-like table, and order of extra entries is arbitrary.
-- @param t a table.
-- @return the map, or nil in case of error
-- @return the error message
function OrderedMap:update (t)
assert_arg(1,t,'table')
if OrderedMap:class_of(t) then
for k,v in t:iter() do
self:set(k,v)
end
elseif #t > 0 then -- an array must contain {key=val} tables
if type(t[1]) == 'table' then
for _,pair in ipairs(t) do
local key,value = next(pair)
if not key then return raise 'empty pair initialization table' end
self:set(key,value)
end
else
return raise 'cannot use an array to initialize an OrderedMap'
end
else
for k,v in pairs(t) do
self:set(k,v)
end
end
return self
end
--- set the key's value. This key will be appended at the end of the map.
--
-- If the value is nil, then the key is removed.
-- @param key the key
-- @param val the value
-- @return the map
function OrderedMap:set (key,val)
if self[key] == nil and val ~= nil then -- new key
self._keys:append(key) -- we keep in order
rawset(self,key,val) -- don't want to provoke __newindex!
else -- existing key-value pair
if val == nil then
self._keys:remove_value(key)
rawset(self,key,nil)
else
self[key] = val
end
end
return self
end
OrderedMap.__newindex = OrderedMap.set
--- insert a key/value pair before a given position.
-- Note: if the map already contains the key, then this effectively
-- moves the item to the new position by first removing at the old position.
-- Has no effect if the key does not exist and val is nil
-- @param pos a position starting at 1
-- @param key the key
-- @param val the value; if nil use the old value
function OrderedMap:insert (pos,key,val)
local oldval = self[key]
val = val or oldval
if oldval then
self._keys:remove_value(key)
end
if val then
self._keys:insert(pos,key)
rawset(self,key,val)
end
return self
end
--- return the keys in order.
-- (Not a copy!)
-- @return List
function OrderedMap:keys ()
return self._keys
end
--- return the values in order.
-- this is relatively expensive.
-- @return List
function OrderedMap:values ()
return List(index_by(self,self._keys))
end
--- sort the keys.
-- @param cmp a comparison function as for @{table.sort}
-- @return the map
function OrderedMap:sort (cmp)
tsort(self._keys,cmp)
return self
end
--- iterate over key-value pairs in order.
function OrderedMap:iter ()
local i = 0
local keys = self._keys
local n,idx = #keys
return function()
i = i + 1
if i > #keys then return nil end
idx = keys[i]
return idx,self[idx]
end
end
--- iterate over an ordered map (5.2).
-- @within metamethods
-- @function OrderedMap:__pairs
OrderedMap.__pairs = OrderedMap.iter
--- string representation of an ordered map.
-- @within metamethods
function OrderedMap:__tostring ()
local res = {}
for i,v in ipairs(self._keys) do
local val = self[v]
local vs = tostring(val)
if type(val) ~= 'number' then
vs = '"'..vs..'"'
end
res[i] = tostring(v)..'='..vs
end
return '{'..concat(res,',')..'}'
end
return OrderedMap
| apache-2.0 |
ffxiphoenix/darkstar | scripts/zones/Temenos/mobs/Enhanced_Tiger.lua | 16 | 1046 | -----------------------------------
-- Area: Temenos W T
-- NPC: Enhanced_Tiger
-----------------------------------
package.loaded["scripts/zones/Temenos/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/limbus");
require("scripts/zones/Temenos/TextIDs");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
local cofferID=Randomcoffer(1,GetInstanceRegion(1298));
local mobX = mob:getXPos();
local mobY = mob:getYPos();
local mobZ = mob:getZPos();
GetNPCByID(16929235):setStatus(STATUS_NORMAL);
if (cofferID~=0) then
GetNPCByID(16928768+cofferID):setPos(mobX,mobY,mobZ);
GetNPCByID(16928768+cofferID):setStatus(STATUS_NORMAL);
end
end;
| gpl-3.0 |
amiranony/anonybot | plugins/media.lua | 376 | 1679 | do
local function run(msg, matches)
local receiver = get_receiver(msg)
local url = matches[1]
local ext = matches[2]
local file = download_to_file(url)
local cb_extra = {file_path=file}
local mime_type = mimetype.get_content_type_no_sub(ext)
if ext == 'gif' then
print('send_file')
send_document(receiver, file, rmtmp_cb, cb_extra)
elseif mime_type == 'text' then
print('send_document')
send_document(receiver, file, rmtmp_cb, cb_extra)
elseif mime_type == 'image' then
print('send_photo')
send_photo(receiver, file, rmtmp_cb, cb_extra)
elseif mime_type == 'audio' then
print('send_audio')
send_audio(receiver, file, rmtmp_cb, cb_extra)
elseif mime_type == 'video' then
print('send_video')
send_video(receiver, file, rmtmp_cb, cb_extra)
else
print('send_file')
send_file(receiver, file, rmtmp_cb, cb_extra)
end
end
return {
description = "When user sends media URL (ends with gif, mp4, pdf, etc.) download and send it to origin.",
usage = "When user sends media URL (ends with gif, mp4, pdf, etc.) download and send it to origin.",
patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+%.(gif))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(mp4))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(pdf))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(ogg))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(zip))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(mp3))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(rar))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(wmv))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(doc))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(avi))$",
"(https?://[%w-_%.%?%.:/%+=&]+%.(webp))$"
},
run = run
}
end
| gpl-2.0 |
AfuSensi/Mr.Green-MTA-Resources | resources/[race]/race_playerstats/s_database.lua | 1 | 6656 |
-- defined in s_util.lua
--resourceRoot = getResourceRootElement()
--local resourceName = getResourceName(getThisResource())
dbSchemaPlayers = {
Name = "PlayerStats_Players",
Columns = {
{ Name="nick", Type="VARCHAR", Constraint="NOT NULL COLLATE NOCASE" },
{ Name="serial", Type="VARCHAR", Constraint="COLLATE NOCASE" }
}
}
dbSchemaStats = {
Name = "PlayerStats_Stats",
Columns = {
{ Name="id_player", Type="INTEGER" },
{ Name="key", Type="INTEGER" },
{ Name="val", Type="REAL" }
},
Indices = {
{ Name = "PlayerStats_PlayerIdKey", Constraint="UNIQUE", Column='"id_player", "key"' }
}
}
function safestring(s)
-- escape '
return s:gsub("(['])", "''")
end
function qsafestring(s)
-- ensure is wrapped in '
return "'" .. safestring(s) .. "'"
end
function createTable(dbschema)
local sql = "CREATE TABLE IF NOT EXISTS " .. qsafestring(dbschema.Name) .. " ("
for i,col in ipairs(dbschema.Columns) do
if i > 1 then
sql = sql .. ", "
end
sql = sql .. qsafestring(col.Name) .. " " .. col.Type
if col.Constraint then
sql = sql .. " " .. col.Constraint
end
end
sql = sql .. ")"
executeSQLQuery(sql)
if dbschema.Indices then
for _,index in ipairs(dbschema.Indices) do
sql = "CREATE "
if index.Constraint then
sql = sql .. index.Constraint .. " "
end
sql = sql .. string.format("INDEX IF NOT EXISTS %s ON %s (%s)", index.Name, dbschema.Name, index.Column)
executeSQLQuery(sql)
end
end
end
function GetPlayerList(sortKey, sortOrder)
local sql = nil
if not tonumber(sortKey) then
sql = string.format("SELECT rowid, nick FROM %s", dbSchemaPlayers.Name)
else
sql = string.format("SELECT %s.rowid, %s.nick, %s.val ", dbSchemaPlayers.Name, dbSchemaPlayers.Name, dbSchemaStats.Name)
sql = sql .. string.format("FROM %s JOIN %s ", dbSchemaPlayers.Name, dbSchemaStats.Name)
sql = sql .. string.format("ON %s.rowid = %s.id_player ", dbSchemaPlayers.Name, dbSchemaStats.Name)
sql = sql .. string.format("AND %s.key = %u ", dbSchemaStats.Name, tonumber(sortKey))
if sortOrder then
sql = sql .. string.format("ORDER BY %s.val %s", dbSchemaStats.Name, tostring(sortOrder))
end
end
local rows = executeSQLQuery(sql)
if rows and #rows > 0 then
return rows
end
return {}
end
function GetPlayerId(player)
if type(player) ~= "string" then
player = getPlayerName(player)
end
local cmd = string.format("SELECT rowid FROM %s WHERE nick=?", dbSchemaPlayers.Name)
local rows = executeSQLQuery(cmd, player)
if rows and #rows > 0 then
return tonumber(rows[1].rowid)
end
return 0
end
function InsertPlayer(player)
local cmd = string.format("INSERT INTO %s (nick, serial) VALUES (?, ?); SELECT last_insert_rowid() AS [id]", dbSchemaPlayers.Name)
local serial = isElement(player) and getPlayerSerial(player) or ""
local rows = executeSQLQuery(cmd, getPlayerName(player), serial)
if rows and #rows > 0 then
return tonumber(rows[1].id)
end
return 0
end
function CreatePlayer(player)
local playerId = InsertPlayer(player)
if playerId == 0 then
playerId = GetPlayerId(player)
end
local stats = CreateDefaultStats()
alert("Created stats for player "..getPlayerName(player)..". ID = "..tostring(playerId))
SavePlayerStats(player, stats)
return playerId
end
function DeletePlayer(player)
if isElement(player) and getElementType(player) == "player" then
player = getPlayerName(player)
end
local playerId = GetPlayerId(player)
if playerId > 0 then
if DeletePlayerStats(player) then
local sql = string.format("DELETE FROM %s WHERE rowid=%u", dbSchemaPlayers.Name, playerId)
local result = executeSQLQuery(sql)
if not result then
alert("DeletePlayer: Error deleting player "..player)
else
return true
end
end
else
alert("DeletePlayer: player "..player.." not found.")
end
return false
end
function CreateDefaultStats()
local ret = {}
for key,value in pairs(Stat) do
if DefaultStats[key] then
ret[value] = DefaultStats[key]
end
end
return ret
end
function LoadPlayerStats(player)
if not player then return nil end
local playerId = GetPlayerId(player)
if playerId == 0 then
playerId = CreatePlayer(player)
end
local cmd = string.format("SELECT key, val FROM %s WHERE id_player=%u", dbSchemaStats.Name, playerId)
local rows = executeSQLQuery(cmd)
local ret = {}
if rows and #rows > 0 then
for i,row in ipairs(rows) do
ret[rows[i].key] = rows[i].val
end
end
return ret
end
function SavePlayerStats(playerName, stats)
local ret = false
local playerId = GetPlayerId(playerName)
if playerId == 0 then
playerId = CreatePlayer(player)
--alert("SavePlayerStats: Player "..playerName.." not found.")
--return ret
end
executeSQLQuery("BEGIN TRANSACTION");
for k,v in pairs(stats) do
local cmd = string.format("INSERT OR REPLACE INTO %s (id_player, key, val) VALUES (%u, %u, %f)", dbSchemaStats.Name, playerId, k, v)
local result = executeSQLQuery(cmd)
if not result then
alert("SavePlayerStats: Error updating stats for player "..tostring(playerName))
else
ret = true
end
end
executeSQLQuery("END TRANSACTION");
return ret
end
function DeletePlayerStats(playerName)
local ret = false
local playerId = GetPlayerId(playerName)
if playerId == 0 then
alert("DeletePlayerStats: Player "..playerName.." not found.")
return ret
end
-- executeSQLQuery("BEGIN TRANSACTION");
local cmd = string.format("DELETE FROM %s WHERE id_player=%u", dbSchemaStats.Name, playerId)
local result = executeSQLQuery(cmd)
if not result then
alert("DeletePlayerStats: Error deleting stats for player "..playerName)
else
ret = true
end
-- executeSQLQuery("END TRANSACTION");
return ret
end
function DeleteAllStats()
local ret = false
-- executeSQLQuery("BEGIN TRANSACTION");
local cmd = string.format("DELETE FROM %s", dbSchemaStats.Name)
local result = executeSQLQuery(cmd)
if not result then
alert("DeleteAllStats: Error deleting stats")
else
ret = true
end
-- executeSQLQuery("END TRANSACTION");
return ret
end
function DeleteStats(statKey)
local ret = false
if not(tonumber(statKey)) then
alert("DeleteStats: Invalid stat key '"..statKey.."'.")
return ret
end
local cmd = string.format("DELETE FROM %s WHERE key=%u", dbSchemaStats.Name, tonumber(statKey))
local result = executeSQLQuery(cmd)
if not result then
alert("DeleteStats: Error deleting stats for key "..statKey)
else
ret = true
end
return ret
end
addEventHandler("onResourceStart", resourceRoot,
function()
createTable(dbSchemaPlayers)
createTable(dbSchemaStats)
end
) | mit |
ffxiphoenix/darkstar | scripts/globals/items/sleepshroom.lua | 35 | 1191 | -----------------------------------------
-- ID: 4374
-- Item: sleepshroom
-- Food Effect: 5Min, All Races
-----------------------------------------
-- Strength -3
-- Mind 1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,300,4374);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_STR, -3);
target:addMod(MOD_MND, 1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_STR, -3);
target:delMod(MOD_MND, 1);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/globals/spells/impact.lua | 25 | 3681 | -----------------------------------------
-- Spell: Impact
-- Deals dark damage to an enemy and
-- decreases all 7 base stats by 20%
-----------------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
-----------------------------------------
-- onMagicCastingCheck
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onSpellCast(caster,target,spell)
local dINT = caster:getStat(MOD_INT) - target:getStat(MOD_INT);
local resist = applyResistance(caster,spell,target,dINT,37,0);
local STR_Loss = ((target:getStat(MOD_STR) / 100) * 20); -- Should be 20%
local DEX_Loss = ((target:getStat(MOD_DEX) / 100) * 20);
local VIT_Loss = ((target:getStat(MOD_VIT) / 100) * 20);
local AGI_Loss = ((target:getStat(MOD_AGI) / 100) * 20);
local INT_Loss = ((target:getStat(MOD_INT) / 100) * 20);
local MND_Loss = ((target:getStat(MOD_MND) / 100) * 20);
local CHR_Loss = ((target:getStat(MOD_CHR) / 100) * 20);
local duration = 180 * resist; -- BG wiki suggests only duration gets effected by resist.
if (target:hasStatusEffect(EFFECT_STR_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "STR: '%s' ", STR_Loss ) );
target:addStatusEffect(EFFECT_STR_DOWN,STR_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_DEX_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "DEX: '%s' ", DEX_Loss ) );
target:addStatusEffect(EFFECT_DEX_DOWN,DEX_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_VIT_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "VIT: '%s' ", VIT_Loss ) );
target:addStatusEffect(EFFECT_VIT_DOWN,VIT_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_AGI_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "AGI: '%s' ", AGI_Loss ) );
target:addStatusEffect(EFFECT_AGI_DOWN,AGI_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_INT_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "INT: '%s' ", INT_Loss ) );
target:addStatusEffect(EFFECT_INT_DOWN,INT_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_MND_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "MND: '%s' ", MND_Loss ) );
target:addStatusEffect(EFFECT_MND_DOWN,MND_Loss,0,duration);
end
if (target:hasStatusEffect(EFFECT_CHR_DOWN) == false) then
-- caster:PrintToPlayer( string.format( "CHR: '%s' ", CHR_Loss ) );
target:addStatusEffect(EFFECT_CHR_DOWN,CHR_Loss,0,duration);
end
--diverting use of doElementalNuke till spellParams is implemented for this spell
--local dmg = doElementalNuke(939,2.335,caster,spell,target,false,1.0);
--calculate raw damage
local dmg = calculateMagicDamage(939,2.335,caster,spell,target,ELEMENTAL_MAGIC_SKILL,MOD_INT,false);
--get resist multiplier (1x if no resist)
local resist = applyResistance(caster,spell,target,caster:getStat(MOD_INT)-target:getStat(MOD_INT),ELEMENTAL_MAGIC_SKILL,1.0);
--get the resisted damage
dmg = dmg*resist;
--add on bonuses (staff/day/weather/jas/mab/etc all go in this function)
dmg = addBonuses(caster,spell,target,dmg);
--add in target adjustment
dmg = adjustForTarget(target,dmg,spell:getElement());
--add in final adjustments
dmg = finalMagicAdjustments(caster,target,spell,dmg);
return dmg;
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Bibiki_Bay/mobs/Shen.lua | 16 | 1239 | -----------------------------------
-- Area: Bibiki Bay
-- NPC: Shen
-----------------------------------
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob,target)
local Shen = mob:getID();
if (mob:getBattleTime() % 45 == 0) then
if (GetMobAction(Shen+1) == 0) then
SpawnMob(Shen+1,300):updateEnmity(target);
elseif (GetMobAction(Shen+2) == 0) then
SpawnMob(Shen+2,300):updateEnmity(target);
end
end
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, killer)
end;
-----------------------------------
-- onMonsterMagicPrepare
-----------------------------------
function onMonsterMagicPrepare(mob,target)
-- casts Water IV, Waterga III, Flood, Drown
rnd = math.random();
if (rnd < 0.5) then
return 201; -- waterga 3
elseif (rnd < 0.7) then
return 172; -- water 4
elseif (rnd < 0.9) then
return 214; -- flood
else
return 240; -- drown
end
end; | gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Silver_Sea_route_to_Nashmau/npcs/Qudamahf.lua | 38 | 1136 | -----------------------------------
-- Area: Silver_Sea_route_to_Nashmau
-- NPC: Qudamahf
-- Notes: Tells ship ETA time
-- @pos 0.340 -12.232 -4.120 58
-----------------------------------
package.loaded["scripts/zones/Silver_Sea_route_to_Nashmau/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Silver_Sea_route_to_Nashmau/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(ON_WAY_TO_NASHMAU,0,0); -- Earth Time, Vana Hours. Needs a get-time function for boat?
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/globals/mobskills/Sickle_Slash.lua | 12 | 1266 | ---------------------------------------------------
-- Sickle Slash
-- Deals critical damage. Chance of critical hit varies with TP.
---------------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------------
---------------------------------------------------
-- onMobSkillCheck
-- Check for Grah Family id 122,123,124
-- if not in Spider form, then ignore.
---------------------------------------------------
function onMobSkillCheck(target,mob,skill)
if ((mob:getFamily() == 122 or mob:getFamily() == 123 or mob:getFamily() == 124) and mob:AnimationSub() ~= 2) then
return 1;
else
return 0;
end
end;
function onMobWeaponSkill(target, mob, skill)
local numhits = 1;
local accmod = 1;
local dmgmod = math.random(2,5) + math.random();
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_CRIT_VARIES,1,1.5,2);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_BLUNT,info.hitslanded);
-- cap off damage around 600
if (dmg > 600) then
dmg = dmg * 0.7;
end
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
vilarion/Illarion-Content | item/id_271_scythe.lua | 1 | 2046 | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- UPDATE items SET itm_script='item.id_271_scythe' WHERE itm_id IN (271);
local common = require("base.common")
local grainharvesting = require("craft.gathering.grainharvesting")
local metal = require("item.general.metal")
local M = {}
M.LookAtItem = metal.LookAtItem
local function getGrain(User)
-- first check front position for grain
local TargetItem = common.GetFrontItem(User);
if ( TargetItem ~= nil and TargetItem.id == 248 ) then
return TargetItem;
end
local foundYoungGrain = false; -- check if we only find not fully grown grain
TargetItem, foundYoungGrain = grainharvesting.GetNearbyGrain(User);
if ( TargetItem == nil ) then
-- since we're here, there is no fully grown grain
if ( foundYoungGrain ) then
common.HighInformNLS( User,
"Das Getreide ist noch nicht reif für den Schnitt.",
"The grain is not ready for harvest yet." );
else
common.HighInformNLS( User,
"Du brauchst Getriede um es mit der Sense zu schneiden.",
"You need grain for harvesting it with the scythe." );
end
return nil;
end
return TargetItem;
end
function M.UseItem(User, SourceItem, ltstate)
local grain = getGrain(User);
if grain ~= nil then
grainharvesting.StartGathering(User, grain, ltstate);
end
end
return M
| agpl-3.0 |
ffxiphoenix/darkstar | scripts/globals/abilities/call_beast.lua | 18 | 1073 | -----------------------------------
-- Ability: Call Beast
-- Calls a beast to fight by your side.
-- Obtained: Beastmaster Level 23
-- Recast Time: 5:00
-- Duration: Dependent on jug pet used.
-----------------------------------
require("scripts/globals/common");
require("scripts/globals/status");
-----------------------------------
-- onAbilityCheck
-----------------------------------
function onAbilityCheck(player,target,ability)
if (player:getPet() ~= nil) then
return MSGBASIC_ALREADY_HAS_A_PET,0;
elseif (not player:hasValidJugPetItem()) then
return MSGBASIC_NO_JUG_PET_ITEM,0;
elseif (not player:canUsePet()) then
return MSGBASIC_CANT_BE_USED_IN_AREA,0;
else
return 0,0;
end
end;
-----------------------------------
-- onUseAbility
-----------------------------------
function onUseAbility(player,target,ability)
local id = player:getWeaponSubSkillType(SLOT_AMMO);
if (id == 0) then
printf("WARNING: jugpet id is ZERO\n");
end
player:spawnPet(id);
end;
| gpl-3.0 |
ffxiphoenix/darkstar | scripts/zones/Cape_Teriggan/npcs/Dultwa_IM.lua | 28 | 3120 | -----------------------------------
-- Area: Cape Teriggan
-- NPC: Dulwa, I.M.
-- Type: Border Conquest Guards
-- @pos 119 0 282 113
-----------------------------------
package.loaded["scripts/zones/Cape_Teriggan/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Cape_Teriggan/TextIDs");
local guardnation = BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = VOLLBOW;
local csid = 0x7ff8;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.