content
stringlengths 5
1.05M
|
---|
local snake = class("snake")
local Body = require("app.Body")
local cInitLen = 9
function snake:ctor(node)
print("snake:ctor")
self.BodyArray = {}
self.node = node
for i=1, cInitLen do
self:Grow(i == 1)
end
self:SetDir("left")
--print("snake:ctor--------",self:moveDir)
end
--取尾巴的位置
function snake:GetTailGrid()
if #self.BodyArray == 0 then
return 0,0
end
local tail = self.BodyArray[#self.BodyArray]
return tail.X,tail.Y
end
--取头的位置
function snake:GetHeadGrid()
if #self.BodyArray == 0 then
return 0,0
end
local head = self.BodyArray[1]
return head.X,head.Y
end
function snake:Grow(ishead)
local tailX,tailY = self:GetTailGrid()
--print("snake-----Grow---",tailX,tailY)
local body = Body.new(self,tailX,tailY,self.node,ishead)
table.insert(self.BodyArray,body)
end
function snake:OffsetGridByDir( x,y,dir )
--print("OffsetGridByDir----",dir)
local scalRate = 1 / display.contentScaleFactor
local cGridSize = 33 * scalRate
local visibleSize = cc.Director:getInstance():getVisibleSize()
local leftBorder = -visibleSize.width / 2 / cGridSize
local rightBorder = visibleSize.width / 2 / cGridSize
local topBorder = visibleSize.height / 2 / cGridSize
local bottomBorder = -visibleSize.height / 2 / cGridSize
local X,Y = x,y
if dir == "left" then
X = x - 1
if X < leftBorder then
X = rightBorder
end
elseif dir == "right" then
X = x + 1
if X > rightBorder then
X = leftBorder
end
elseif dir == "up" then
Y = y + 1
if Y > topBorder then
Y = bottomBorder
end
elseif dir == "down" then
Y = y - 1
if Y < bottomBorder then
Y = topBorder
end
end
return X,Y
end
function snake:SetDir( dir )
--防止180度转弯
local table = {
["left"] = "h",
["right"] = "h",
["up"] = "v",
["down"] = "v",
}
if table[dir] == table[self.moveDir] then
return
end
self.moveDir = dir
--扭转蛇头方向
local tableHead = {
["left"] = 180,
["right"] = 0,
["up"] = -90,
["down"] = 90,
}
local head = self.BodyArray[1]
head.sp:setRotation(tableHead[dir])
end
function snake:Update(isHead)
if #self.BodyArray == 0 then
return
end
for i=#self.BodyArray,1,-1 do
local body = self.BodyArray[i]
if i == 1 then
body.X,body.Y = self:OffsetGridByDir(body.X,body.Y,self.moveDir)
else
local front = self.BodyArray[i - 1]
body.X,body.Y = front.X,front.Y
end
body:Update()
end
end
--判断是否咬住蛇身
function snake:CheckSelfCollide()
if #self.BodyArray < 2 then
return false
end
local headX,headY = self:GetHeadGrid()
for i=2,#self.BodyArray do
local body = self.BodyArray[i]
if body.X == headX and body.Y == headY then
return true
end
end
return false
end
function snake:Kill()
for _,body in ipairs(self.BodyArray) do
self.node:removeChild(body.sp)
end
end
function snake:Blink(callBack)
for index,body in ipairs(self.BodyArray) do
local blink = cc.Blink:create(3,5)
if index == 1 then
local a = cc.Sequence:create(blink,cc.CallFunc:create(callBack))
body.sp:runAction(a)
else
body.sp:runAction(blink)
end
end
end
return snake
|
local AceGUI = LibStub("AceGUI-3.0")
local LibJSON = LibStub("LibJSON-1.0")
local DB = DKBLootLoader:UseModule("DB")
local GUI = DKBLootLoader:RegisterModule("GUI")
local Util = DKBLootLoader:UseModule("Util")
local COLOR_RAID_ACTIVE = { ["r"] = 0.0, ["g"] = 1.0, ["b"] = 0.0, ["a"] = 1.0 }
local COLOR_RAID_FINISHED = { ["r"] = 1.0, ["g"] = 1.0, ["b"] = 1.0, ["a"] = 1.0 }
local TAB_1, TAB_2 = "tab1", "tab2"
local RAID_MC, RAID_ZG, RAID_BWL = "MOLTEN_CORE", "ZUL_GURUB", "BLACKWING_LAIR"
local mainFrame = nil
local mainFrameStatusTexts = {
"Der Kreuzende Brennzug w\195\188nscht allzeit guten Loot!",
"Dank geht raus an Cokecookie, Megumìn, Lothia, Ragnarrwall und Siedler!",
}
local mainFrameStatusTextIndex = 1
local selectedTab = TAB_1
-- Tab 1
local importFrame = nil
-- Tab 2
local addRaidFrame = nil
local raidParticipantsFrame = nil
local addRaidParticipantFrame = nil
local raidEvaluationFrame = nil
local lootTableItemTooltip = CreateFrame("GameTooltip", "DKBLootGUI-LootTableTooltip", UIParent, "GameTooltipTemplate")
local selectedRaid = nil
-- Generic
local confirmBoxFrame = nil
local specialFramesStack = {}
local classesMap = {
{
className = "Druide",
classFile = "DRUID",
},
{
className = "Hexenmeister",
classFile = "WARLOCK",
},
{
className = "J\195\164ger",
classFile = "HUNTER",
},
{
className = "Krieger",
classFile = "WARRIOR",
},
{
className = "Magier",
classFile = "MAGE",
},
{
className = "Paladin",
classFile = "PALADIN",
},
{
className = "Priester",
classFile = "PRIEST",
},
{
className = "Schamane",
classFile = "SHAMAN",
},
{
className = "Schurke",
classFile = "ROGUE",
},
}
local function GetSpecialFrameIndex(name)
for i, current in pairs(UISpecialFrames) do
if current == name then
return i
end
end
return nil
end
local function RegisterAsSpecialFrame(frame, name)
if not GetSpecialFrameIndex(name) then
_G[name] = frame
tinsert(UISpecialFrames, name)
end
end
local function UnregisterAsSpecialFrame(name)
local index = GetSpecialFrameIndex(name)
if index then
_G[name] = nil
tremove(UISpecialFrames, index)
end
end
local function PushSpecialFrame(frame, name)
local entry = {
frame = frame,
name = name,
index = #UISpecialFrames + 1,
}
local current = specialFramesStack[#specialFramesStack]
if current then
UnregisterAsSpecialFrame(current.name)
end
RegisterAsSpecialFrame(frame, name)
tinsert(specialFramesStack, entry)
end
local function PopSpecialFrame()
local previous = specialFramesStack[#specialFramesStack - 1]
local current = specialFramesStack[#specialFramesStack]
if current then
UnregisterAsSpecialFrame(current.name)
tremove(specialFramesStack, #specialFramesStack)
end
if previous then
RegisterAsSpecialFrame(previous.frame, previous.name)
end
end
local function CloseConfirmBox()
if confirmBoxFrame then
AceGUI:Release(confirmBoxFrame)
confirmBoxFrame = nil
end
end
local function ShowConfirmBox(title, text, confirmHandler)
CloseConfirmBox()
local frame = AceGUI:Create("CustomFrame")
local label = AceGUI:Create("Label")
frame:SetTitle(title)
frame:SetLayout("Fill")
frame:EnableResize(false)
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(260, 60)
frame:SetCallback("OnOk", function ()
confirmHandler()
frame:Hide()
end)
frame:SetCallback("OnCancel", function () frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
confirmBoxFrame = nil
end)
label:SetText(text)
frame:AddChild(label)
frame:SetHeight(label.label:GetNumLines() + label.label:GetStringHeight() + 70)
confirmBoxFrame = frame
PushSpecialFrame(frame, "DKBLoot_ConfirmFrame")
return frame
end
local function RenderImportDKPWindow(options)
local frame = AceGUI:Create("CustomFrame")
local editBox = AceGUI:Create("CustomMultiLineEditBox")
local function handleSubmit()
local success, err = pcall(function ()
local lua = LibJSON.Deserialize(editBox:GetText())
if not lua.brennzug then
error("Komisches Format.")
end
DB:ImportDKPList(lua.brennzug)
end)
if not success then
UIErrorsFrame:AddMessage("Fehler beim Laden der DKP-Liste.", 1.0, 0.0, 0.0, 1, 5)
return false
end
frame:Hide()
end
frame:SetTitle("DKP-Liste importieren")
frame:SetLayout("Fill")
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(560, 380)
frame.frame:SetMaxResize(560, 380)
frame:SetCallback("OnOk", handleSubmit)
frame:SetCallback("OnCancel", function() frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
if options.onClose then
options.onClose()
end
end)
editBox:SetLabel("DKP-Liste")
editBox:SetFocus()
editBox.editbox:SetScript("OnEnterPressed", handleSubmit)
frame:AddChild(editBox)
PushSpecialFrame(frame, "DKBLoot_ImportDKPFrame")
return frame
end
local function RenderRaidEvaluationWindow(options)
local frame = AceGUI:Create("Frame")
local editBox = AceGUI:Create("CustomMultiLineEditBox")
frame:SetTitle("DKP-Auswertung")
frame:SetLayout("Fill")
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(560, 380)
frame.frame:SetMaxResize(560, 380)
frame:SetCallback("OnCancel", function () frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
if options.onClose then
options.onClose()
end
end)
editBox:SetLabel("JSON-Code")
editBox:SetText(options.json)
editBox:SetFocus()
editBox:HighlightText(0, #options.json)
frame:AddChild(editBox)
PushSpecialFrame(frame, "DKBLoot_RaidEvaluationFrame")
return frame
end
local function RenderAddRaidWindow(options)
local frame = AceGUI:Create("CustomFrame")
local dropdown = AceGUI:Create("Dropdown")
local function handleSubmit()
if DB:HasActiveRaid() then
UIErrorsFrame:AddMessage("Es ist bereits eine andere Aufzeichnung aktiv.", 1.0, 0.0, 0.0, 1, 5)
return
end
local raid = DB:AddRaid(dropdown:GetValue())
DB:SetActiveRaid(raid.id)
frame:Hide()
if options.onSubmit then
options.onSubmit()
end
end
frame:SetTitle("Neue Aufzeichnung")
frame:SetLayout("Fill")
frame:EnableResize(false)
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(260, 120)
frame:SetCallback("OnOk", handleSubmit)
frame:SetCallback("OnCancel", function() frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
if options.onClose then
options.onClose()
end
end)
dropdown:SetLabel("Raid")
dropdown:SetList({
[DB.RAID_MC] = Util:GetRaidName(DB.RAID_MC),
[DB.RAID_ZG] = Util:GetRaidName(DB.RAID_ZG),
[DB.RAID_BWL] = Util:GetRaidName(DB.RAID_BWL),
}, { DB.RAID_MC, DB.RAID_ZG, DB.RAID_BWL })
dropdown:SetCallback("OnOpened", function ()
dropdown.pullout:ClearAllPoints()
dropdown.pullout:SetPoint("TOPLEFT", dropdown.frame, "BOTTOMLEFT", 0, 16)
end)
frame:AddChild(dropdown)
local instanceId = select(8, GetInstanceInfo())
local instanceIdValueMap = {
[409] = DB.RAID_MC,
[469] = DB.RAID_BWL,
[309] = DB.RAID_ZG,
}
if instanceIdValueMap[instanceId] then
dropdown:SetValue(instanceIdValueMap[instanceId])
end
PushSpecialFrame(frame, "DKBLoot_AddRaidFrame")
return frame
end
local function RenderAddRaidParticipantWindow(options)
local frame = AceGUI:Create("CustomFrame")
local playerEditBox = AceGUI:Create("CustomEditBox")
local groupEditBox = AceGUI:Create("CustomEditBox")
local classDropdown = AceGUI:Create("Dropdown")
local function handleSubmit()
local player = playerEditBox:GetText()
local group = groupEditBox:GetText()
local classIndex = classDropdown:GetValue()
if not player or not group or not classIndex then
UIErrorsFrame:AddMessage("Bitte f\195\188lle alle Felder aus.", 1.0, 0.0, 0.0, 1, 5)
return false
end
local classInfo = classesMap[classIndex]
if not classInfo then
UIErrorsFrame:AddMessage("Ung\195\188ltige Klasse.", 1.0, 0.0, 0.0, 1, 5)
return false
end
DB:AddRaidParticipant(options.raid.id, {
player = player,
group = group,
class = classInfo.className,
classFile = classInfo.classFile,
})
end
frame:SetTitle("Teilnehmer hinzuf\195\188gen")
frame:SetLayout("Flex")
frame:EnableResize(false)
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(260, 200)
frame:SetCallback("OnOk", handleSubmit)
frame:SetCallback("OnCancel", function() frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
if options.onClose then
options.onClose()
end
end)
playerEditBox:SetLabel("Spielername")
playerEditBox:SetUserData("flexAutoWidth", true)
playerEditBox.editbox:SetScript("OnEnterPressed", handleSubmit)
frame:AddChild(playerEditBox)
groupEditBox:SetLabel("Raidgruppe")
groupEditBox:SetUserData("flexAutoWidth", true)
groupEditBox.editbox:SetScript("OnEnterPressed", handleSubmit)
frame:AddChild(groupEditBox)
local classes = {}
for i, classInfo in pairs(classesMap) do
classes[i] = classInfo.className
end
classDropdown:SetLabel("Klasse")
classDropdown:SetUserData("flexAutoWidth", true)
classDropdown:SetList(classes)
frame:AddChild(classDropdown)
PushSpecialFrame(frame, "DKBLoot_AddRaidParticipantFrame")
return frame
end
local function RenderRaidParticipantsWindow(options)
local participantsSubscription = DB:Subscribe(DB.EVENT_PARTICIPANTS)
local frame = AceGUI:Create("Frame")
local participantsTableWrapper = AceGUI:Create("SimpleGroup")
local participantsTable = AceGUI:Create("DKBLootGUI-ScrollingTable")
local controlsContainer = AceGUI:Create("SimpleGroup")
local addCurrentRaidButton = AceGUI:Create("Button")
local addParticipantButton = AceGUI:Create("Button")
local controlsSpacer = AceGUI:Create("SimpleGroup")
local deleteParticipantButton = AceGUI:Create("Button")
local raid = options.raid
local title = format(
"Teilnehmerliste - %s am %s",
Util:GetRaidName(raid.raid),
date("%d.%m.%Y", raid.timestamp)
)
local function UpdateParticipatsTable()
local participants = DB:GetRaidParticipants(raid.id)
local tableData = {}
for i, participant in pairs(participants) do
local playerDKP, hasPlayerDKP, hasLoot = DB:ComputeCurrentPlayerDKP(raid.id, participant.player)
local playerColor = { r = 1, g = 1, b = 1 }
local dkpColor = { r = 1, g = 1, b = 1 }
if not hasPlayerDKP then
playerColor = { r = 0, g = 1, b = 1 }
end
if playerDKP < 0 then
dkpColor = { r = 1, g = 0, b = 0 }
elseif hasLoot then
dkpColor = { r = 1, g = 1, b = 0 }
end
tinsert(tableData, {
cols = {
{ value = i, },
{ value = participant.player, color = playerColor },
{ value = participant.class, color = RAID_CLASS_COLORS[participant.classFile] },
{ value = participant.group },
{ value = playerDKP, color = dkpColor },
}
})
end
participantsTable:SetData(tableData)
end
frame:SetTitle(title)
frame:SetLayout("Flex")
frame:EnableResize(false)
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(500, 400)
frame:SetCallback("OnClose", function (widget)
participantsSubscription:Cancel()
PopSpecialFrame()
AceGUI:Release(widget)
if options.onClose then
options.onClose()
end
end)
participantsTableWrapper:SetLayout("Fill")
participantsTableWrapper:SetUserData("flex", "grow")
frame:AddChild(participantsTableWrapper)
participantsTable:SetColumns({
{ name = "#", width = 30 },
{ name = "Spieler", percentage = 0.6, minWidth = 80 },
{ name = "Klasse", percentage = 0.4 },
{ name = "Gruppe", width = 50 },
{ name = "DKP", width = 30 },
})
participantsTable.table:EnableSelection(true)
participantsTable:SetSelectionHandler(function (realrow)
deleteParticipantButton:SetDisabled(realrow == nil)
end)
participantsSubscription:OnData(UpdateParticipatsTable)
participantsTableWrapper:AddChild(participantsTable)
controlsContainer:SetLayout("Flex")
controlsContainer:SetUserData("flexDirection", "row")
controlsContainer:SetAutoAdjustHeight(false)
controlsContainer:SetHeight(30)
frame:AddChild(controlsContainer)
addCurrentRaidButton:SetText("Aktuellen Raid erfassen")
addCurrentRaidButton:SetAutoWidth(true)
addCurrentRaidButton:SetCallback("OnClick", function ()
DB:RegisterAllRaidMembersAsParticipants(raid.id)
end)
controlsContainer:AddChild(addCurrentRaidButton)
addParticipantButton:SetText("Teilnehmer hinzuf\195\188gen")
addParticipantButton:SetAutoWidth(true)
addParticipantButton:SetCallback("OnClick", function ()
if addRaidParticipantFrame then
return
end
addRaidParticipantFrame = RenderAddRaidParticipantWindow({
raid = raid,
onClose = function ()
addRaidParticipantFrame = nil
end,
})
end)
controlsContainer:AddChild(addParticipantButton)
controlsSpacer:SetUserData("flex", "grow")
controlsContainer:AddChild(controlsSpacer)
deleteParticipantButton:SetText("L\195\182schen")
deleteParticipantButton:SetAutoWidth(true)
deleteParticipantButton:SetDisabled(true)
deleteParticipantButton:SetCallback("OnClick", function ()
local participantsIndex = participantsTable.table and participantsTable.table:GetSelection() or nil
if not participantsIndex then
return
end
local participant = DB:GetRaidParticipantByIndex(raid.id, participantsIndex)
ShowConfirmBox(
"Spieler wirklich l\195\182schen?",
"Willst du " .. participant.player .. " wirklich l\195\182schen?",
function ()
DB:DeleteRaidParticipantByIndex(raid.id, participantsIndex)
end
)
end)
controlsContainer:AddChild(deleteParticipantButton)
UpdateParticipatsTable()
PushSpecialFrame(frame, "DKBLoot_RaidParticipantsFrame")
return frame
end
local function RenderDKPSummaryTab(container)
local subscription = DB:Subscribe(DB.EVENT_GUILD_DKP)
local innerContainer = AceGUI:Create("SimpleGroup")
local dkpTableWrapper = AceGUI:Create("SimpleGroup")
local dkpTable = AceGUI:Create("DKBLootGUI-ScrollingTable")
local controlsContainer = AceGUI:Create("SimpleGroup")
local dkpImportButton = AceGUI:Create("Button")
local function UpdateDKPTable()
local activeRaid = DB:GetActiveRaid()
local activeRaidName = activeRaid and activeRaid.raid or nil
local guildDkp = DB:GetDKPList()
local tableData = {}
for i, entry in pairs(guildDkp) do
local playerName, rankName, rankIndex, level, classDisplayName, zone, publicNote, officerNote, isOnline = Util:GetGuildMemberInfo(entry.player)
local status
local statusColor
if not playerName then
status = "Nicht gefunden"
statusColor = { r = 1, g = 0, b = 0 }
elseif UnitInRaid(playerName) then
status = "In deinem Raid"
statusColor = { r = 0, g = 1, b = 1 }
elseif not isOnline and not UnitIsConnected(playerName) then
status = "Offline"
statusColor = { r = 0.5, g = 0.5, b = 0.5 }
else
status = "Online"
statusColor = { r = 0, g = 1, b = 0 }
end
tableData[i] = {
cols = {
{
value = entry.player,
color = GetUnitName("player") == playerName and { r = 0, g = 1, b = 0 } or nil,
},
{
value = status,
color = statusColor,
},
{
value = entry.dkp[DB.RAID_MC],
color = activeRaidName == DB.RAID_MC and COLOR_RAID_ACTIVE or nil,
},
{
value = entry.dkp[DB.RAID_BWL],
color = activeRaidName == DB.RAID_BWL and COLOR_RAID_ACTIVE or nil,
},
{
value = entry.dkp[DB.RAID_ZG],
color = activeRaidName == DB.RAID_ZG and COLOR_RAID_ACTIVE or nil,
},
},
}
end
dkpTable:SetData(tableData)
end
local function HandleEvent(event, ...)
if event == "GUILD_ROSTER_UPDATE" then
UpdateDKPTable()
end
end
container.frame:RegisterEvent("GUILD_ROSTER_UPDATE")
container:SetCallback("OnClose", function ()
container.frame:UnregisterEvent("GUILD_ROSTER_UPDATE")
end)
container.frame:SetScript("OnEvent", HandleEvent)
innerContainer:SetLayout("Flex")
innerContainer.frame:SetScript("OnHide", function ()
subscription:Cancel()
end)
container:AddChild(innerContainer)
dkpTableWrapper:SetLayout("Fill")
dkpTableWrapper:SetUserData("flex", "grow")
innerContainer:AddChild(dkpTableWrapper)
dkpTable:SetColumns({
{ name = "Spieler", percentage = 1, minWidth = 80 },
{ name = "Status", width = 100 },
{ name = "MC", width = 30 },
{ name = "BWL", width = 30 },
{ name = "ZG", width = 30 },
})
subscription:OnData(UpdateDKPTable)
dkpTableWrapper:AddChild(dkpTable)
controlsContainer:SetAutoAdjustHeight(false)
controlsContainer:SetHeight(30)
controlsContainer:SetLayout("Flow")
innerContainer:AddChild(controlsContainer)
dkpImportButton:SetText("Importieren")
dkpImportButton:SetAutoWidth(true)
dkpImportButton:SetCallback("OnClick", function ()
if importFrame then
return
end
importFrame = RenderImportDKPWindow({
onClose = function ()
importFrame = nil
end,
})
end)
controlsContainer:AddChild(dkpImportButton)
UpdateDKPTable()
end
local function RenderRaidTab(container)
local raidsSubscription = DB:Subscribe(DB.EVENT_RAIDS)
local lootSubscription = DB:Subscribe(DB.EVENT_LOOT)
local innerContainer = AceGUI:Create("SimpleGroup")
local raidsColumn = AceGUI:Create("SimpleGroup")
local raidsTableWrapper = AceGUI:Create("SimpleGroup")
local raidsTable = AceGUI:Create("DKBLootGUI-ScrollingTable")
local raidControls = AceGUI:Create("SimpleGroup")
local addRaidButton = AceGUI:Create("Button")
local raidControlsSpacer = AceGUI:Create("SimpleGroup")
local deleteRaidButton = AceGUI:Create("Button")
local columnSpacer = AceGUI:Create("SimpleGroup")
local lootColumn = AceGUI:Create("SimpleGroup")
local lootTableWrapper = AceGUI:Create("SimpleGroup")
local lootTable = AceGUI:Create("DKBLootGUI-ScrollingTable")
local lootControls = AceGUI:Create("SimpleGroup")
local isFirstRaidsTableUpdate = true
local function UpdateFinishOrEvaluateRaidButton(row)
local raid = DB:GetRaidByIndex(row)
lootControls:ReleaseChildren()
if not raid then
return
end
local participantsButton = AceGUI:Create("Button")
local lootControlsSpacer = AceGUI:Create("SimpleGroup")
local finishOrEvaluateRaidButton = AceGUI:Create("Button")
participantsButton:SetText("Teilnehmer")
participantsButton:SetCallback("OnClick", function ()
local x, y
if raidParticipantsFrame then
raidParticipantsFrame:Hide()
raidParticipantsFrame = nil
end
if not raidsTable.table then
return
end
local raid = DB:GetRaidByIndex(raidsTable.table:GetSelection())
if not raid then
return
end
raidParticipantsFrame = RenderRaidParticipantsWindow({
raid = raid,
onClose = function ()
raidParticipantsFrame = nil
end,
})
end)
participantsButton:SetAutoWidth(true)
lootControls:AddChild(participantsButton)
lootControlsSpacer:SetUserData("flex", "grow")
lootControls:AddChild(lootControlsSpacer)
if DB:IsActiveRaidId(raid.id) then
finishOrEvaluateRaidButton:SetText("Aufzeichnung beenden")
finishOrEvaluateRaidButton:SetCallback("OnClick", function ()
local selection = raidsTable.table:GetSelection()
if not selection then
return
end
ShowConfirmBox(
"Aufzeichnung wirklich beenden?",
"Wenn die Aufzeichnung beendet wurde, kann die Lootliste nachtr\195\164glich nicht mehr ge\195\164ndert werden.",
function ()
DB:StopActiveRaid()
end
)
end)
else
finishOrEvaluateRaidButton:SetText("DKP-Auswertung")
finishOrEvaluateRaidButton:SetCallback("OnClick", function ()
if raidEvaluationFrame then
return
end
local raid = DB:GetRaidByIndex(raidsTable.table:GetSelection())
if not raid then
return
end
local json = DB:EvaluateRaidById(raid.id)
raidEvaluationFrame = RenderRaidEvaluationWindow({
raidId = raid.id,
json = json,
onClose = function ()
raidEvaluationFrame = nil
end,
})
end)
end
finishOrEvaluateRaidButton:SetAutoWidth(true)
lootControls:AddChild(finishOrEvaluateRaidButton)
end
local function UpdateRaidsTable()
local raids = DB:GetRaids()
local tableData = {}
for i, raid in pairs(raids) do
local color = DB:IsActiveRaidId(raid.id) and COLOR_RAID_ACTIVE or COLOR_RAID_FINISHED
local name = Util:GetRaidName(raid.raid)
tableData[i] = {
cols = {
{
value = date("%d.%m.%Y", raid.timestamp),
},
{
value = name,
},
},
color = color,
}
end
raidsTable:SetData(tableData)
if #raids > 0 then
if selectedRaid then
raidsTable.table:SetSelection(selectedRaid)
end
if not raidsTable.table:GetSelection() then
raidsTable.table:SetSelection(1)
end
else
raidsTable.table:ClearSelection()
UpdateFinishOrEvaluateRaidButton(nil)
end
isFirstRaidsTableUpdate = false
end
local function UpdateLootTable(row)
local raidIndex = row
local raid = DB:GetRaidByIndex(raidIndex)
if not raid then
lootTable:SetData({}, true)
return
end
local tableData = {}
for i, entry in pairs(raid.loot) do
local itemName, itemLink = GetItemInfo(entry.itemId)
tableData[i] = {
entry.itemId,
itemLink,
entry.sourceName or entry.sourceGUID,
entry.givenTo and entry.givenTo.player or "",
entry.givenTo and entry.givenTo.dkp or "",
}
end
lootTable:SetData(tableData, true)
end
innerContainer:SetLayout("Flex")
innerContainer:SetUserData("flexDirection", "row")
innerContainer.frame:SetScript("OnHide", function ()
raidsSubscription:Cancel()
lootSubscription:Cancel()
end)
container:AddChild(innerContainer)
-- 1st Column
raidsColumn:SetLayout("Flex")
raidsColumn:SetWidth(180)
innerContainer:AddChild(raidsColumn)
raidsTableWrapper:SetLayout("Fill")
raidsTableWrapper:SetUserData("flex", "grow")
raidsColumn:AddChild(raidsTableWrapper)
raidsTable:SetColumns({
{ name = "Datum", width = 70 },
{ name = "Raid", percentage = 1, minWidth = 80 },
})
raidsTable.table:EnableSelection(true)
raidsTable:SetSelectionHandler(function (realrow)
selectedRaid = realrow
UpdateLootTable(realrow)
UpdateFinishOrEvaluateRaidButton(realrow)
deleteRaidButton:SetDisabled(realrow == nil)
end)
raidsSubscription:OnData(UpdateRaidsTable)
raidsTableWrapper:AddChild(raidsTable)
raidControls:SetLayout("Flex")
raidControls:SetUserData("flexDirection", "row")
raidControls:SetAutoAdjustHeight(false)
raidControls:SetHeight(30)
raidsColumn:AddChild(raidControls)
addRaidButton:SetText("Neu")
addRaidButton:SetAutoWidth(true)
addRaidButton:SetCallback("OnClick", function ()
if addRaidFrame then
return
end
addRaidFrame = RenderAddRaidWindow({
onSubmit = function ()
raidsTable.table:SetSelection(1)
end,
onClose = function ()
addRaidFrame = nil
end,
})
end)
raidControls:AddChild(addRaidButton)
raidControlsSpacer:SetUserData("flex", "grow")
raidControls:AddChild(raidControlsSpacer)
deleteRaidButton:SetText("L\195\182schen")
deleteRaidButton:SetAutoWidth(true)
deleteRaidButton:SetDisabled(true)
deleteRaidButton:SetCallback("OnClick", function ()
local selection = raidsTable.table:GetSelection()
if not selection then
return
end
ShowConfirmBox(
"Aufzeichnung wirklich l\195\182schen?",
"Diese Aktion kann nicht r\195\188ckg\195\164ngig gemacht werden.",
function ()
raidsTable.table:ClearSelection()
DB:DeleteRaidByIndex(selection)
end
)
end)
raidControls:AddChild(deleteRaidButton)
-- Spacer
columnSpacer:SetWidth(10)
innerContainer:AddChild(columnSpacer)
-- 2nd Column
lootColumn:SetLayout("Flex")
lootColumn:SetUserData("flex", "grow")
innerContainer:AddChild(lootColumn)
lootTableWrapper:SetLayout("Fill")
lootTableWrapper:SetUserData("flex", "grow")
lootColumn:AddChild(lootTableWrapper)
lootTable:SetColumns({
{
name = "Item",
width = 32,
DoCellUpdate = function (rowFrame, cellFrame, data, cols, row, realrow, column, fShow, self, ...)
local itemId = self:GetCell(realrow, column)
local itemName, itemLink = GetItemInfo(itemId)
if fShow then
local itemTexture = GetItemIcon(itemId)
if not cellFrame.cellItemTexture then
cellFrame.cellItemTexture = cellFrame:CreateTexture()
end
cellFrame.cellItemTexture:SetTexture(itemTexture)
cellFrame.cellItemTexture:SetTexCoord(0, 1, 0, 1)
cellFrame.cellItemTexture:Show()
cellFrame.cellItemTexture:SetPoint("LEFT", cellFrame.cellItemTexture:GetParent(), "LEFT")
cellFrame.cellItemTexture:SetWidth(30)
cellFrame.cellItemTexture:SetHeight(30)
end
if itemLink then
cellFrame:SetScript("OnEnter", function()
lootTableItemTooltip:SetOwner(cellFrame, "ANCHOR_CURSOR")
lootTableItemTooltip:SetHyperlink(itemLink)
lootTableItemTooltip:Show()
end)
cellFrame:SetScript("OnLeave", function()
lootTableItemTooltip:Hide()
lootTableItemTooltip:SetOwner(UIParent, "ANCHOR_NONE")
end)
end
end,
},
{ name = "", percentage = 0.6 },
{ name = "Gepl\195\188ndert von", percentage = 0.4 },
{ name = "Spieler", width = 80 },
{ name = "DKP", width = 30 },
})
lootTable:SetRowHeight(30)
lootTable.table:RegisterEvents({
["OnDoubleClick"] = function (rowFrame, cellFrame, data, cols, row, realrow, column, scrollingTable, ...)
local selectedRaidIndex = raidsTable.table:GetSelection()
local raid = DB:GetRaidByIndex(selectedRaidIndex)
local entry = DB:GetRaidLootByIndex(raid.id, realrow)
if not entry then
return
end
GUI:ShowAssignItemWindow(
raid.id,
entry.itemId,
entry.givenTo and entry.givenTo.player or nil,
entry.givenTo and entry.givenTo.dkp or nil,
realrow,
column
)
end,
})
lootSubscription:OnData(function () UpdateLootTable(raidsTable.table:GetSelection()) end)
container.frame:RegisterEvent("GET_ITEM_INFO_RECEIVED")
container:SetCallback("OnClose", function ()
container.frame:UnregisterEvent("GET_ITEM_INFO_RECEIVED")
end)
container.frame:SetScript("OnEvent", function ()
if raidsTable and raidsTable.table then
UpdateLootTable(raidsTable.table:GetSelection())
end
end)
lootTableWrapper:AddChild(lootTable)
lootControls:SetLayout("Flex")
lootControls:SetUserData("flexDirection", "row")
lootControls:SetAutoAdjustHeight(false)
lootControls:SetHeight(30)
lootColumn:AddChild(lootControls)
UpdateRaidsTable()
UpdateLootTable(raidsTable.table:GetSelection())
end
function GUI:ShowAssignItemWindow(raidId, itemId, playerName, dkp, itemIndex, column)
local frame = AceGUI:Create("CustomFrame")
local itemLabel = AceGUI:Create("Label")
local itemContainer = AceGUI:Create("SimpleGroup")
local itemElem = AceGUI:Create("ItemElem")
local inputContainer = AceGUI:Create("SimpleGroup")
local playerInput = AceGUI:Create("CustomEditBox")
local dkpInput = AceGUI:Create("CustomEditBox")
local itemName, itemLink = GetItemInfo(itemId)
local function handleSubmit()
local dkp = dkpInput:GetText()
if not dkp:match("%d*") then
UIErrorsFrame:AddMessage("Bitte gib eine Zahl ein.", 1.0, 0.0, 0.0, 1, 5)
dkpInput:HighlightText(0, #dkp)
return
end
DB:RegisterPlayerItemDKP(raidId, itemId, playerInput:GetText(), dkp, itemIndex)
frame:Hide()
end
frame:SetTitle("DKP Eingabe")
frame:SetLayout("Flow")
frame:EnableResize(false)
frame.frame:SetFrameStrata("HIGH")
frame.frame:SetSize(300, 160)
frame:SetCallback("OnOk", handleSubmit)
frame:SetCallback("OnCancel", function() frame:Hide() end)
frame:SetCallback("OnClose", function (widget)
PopSpecialFrame()
AceGUI:Release(widget)
end)
itemLabel:SetText("Item")
itemLabel:SetColor(1, 0.82, 0)
frame:AddChild(itemLabel)
itemContainer:SetLayout("Fill")
itemContainer:SetHeight(30)
itemContainer:SetAutoAdjustHeight(false)
frame:AddChild(itemContainer)
itemElem:SetItem(itemLink)
itemContainer:AddChild(itemElem)
inputContainer:SetLayout("Flex")
inputContainer:SetHeight(40)
inputContainer:SetAutoAdjustHeight(false)
inputContainer:SetUserData("flexDirection", "row")
frame:AddChild(inputContainer)
local playerList = {}
for i, participant in pairs(DB:GetRaidParticipants(raidId)) do
playerList[#playerList + 1] = participant.player
end
playerInput:SetLabel("Spieler")
playerInput:SetSuggestions(playerList)
playerInput:SetUserData("flex", "grow")
playerInput:SetText(playerName)
playerInput.editbox:SetScript("OnTabPressed", function () dkpInput:SetFocus() end)
playerInput.editbox:SetScript("OnEnterPressed", function () dkpInput:SetFocus() end)
inputContainer:AddChild(playerInput)
dkpInput:SetLabel("DKP")
dkpInput:SetWidth(80)
dkpInput:SetText(dkp)
dkpInput.editbox:SetScript("OnTabPressed", function () playerInput:SetFocus() end)
dkpInput.editbox:SetScript("OnEnterPressed", handleSubmit)
inputContainer:AddChild(dkpInput)
if not IsPlayerMoving() then
if column == nil or column == 4 then
playerInput:SetFocus()
playerInput:HighlightText(0, #playerInput:GetText())
elseif column == 5 then
dkpInput:SetFocus()
dkpInput:HighlightText(0, #dkpInput:GetText())
end
end
PushSpecialFrame(frame, "DKBLoot_AssignItemFrame")
return frame
end
local function ClosePopupFrames()
local popups = {
-- Tab 1
importFrame,
-- Tab 2
addRaidFrame,
raidParticipantsFrame,
addRaidParticipantFrame,
raidEvaluationFrame,
-- Generic
confirmBoxFrame,
}
for i, frame in pairs(popups) do
if frame then
frame:Hide()
end
end
end
function GUI:Show(self)
if mainFrame then
return
end
local frame = AceGUI:Create("Frame")
local tab = AceGUI:Create("TabGroup")
frame:SetTitle("Der Kreuzende Brennzug - Loot")
frame:SetStatusText(mainFrameStatusTexts[mainFrameStatusTextIndex])
frame:SetCallback("OnClose", function (widget)
ClosePopupFrames()
AceGUI:Release(widget)
mainFrame = nil
end)
frame:SetLayout("Fill")
frame.frame:SetSize(700, 503) -- Measured to fit 11 items in the item table
frame.frame:SetFrameStrata("MEDIUM")
frame.frame:SetMinResize(600, 400)
tab:SetLayout("Fill")
tab:SetTabs({
{ text = "DKP-\195\156bersicht", value = TAB_1 },
{ text = "Raids", value = TAB_2 },
})
tab:SetCallback("OnGroupSelected", function (container, event, group)
container:ReleaseChildren()
ClosePopupFrames()
selectedTab = group
if group == TAB_1 then
RenderDKPSummaryTab(container)
elseif group == TAB_2 then
RenderRaidTab(container)
end
end)
tab:SelectTab(selectedTab)
frame:AddChild(tab)
mainFrame = frame
mainFrameStatusTextIndex = (mainFrameStatusTextIndex % #mainFrameStatusTexts) + 1
PushSpecialFrame(frame, "DKBLoot_MainFrame")
end
function GUI:Hide()
if not mainFrame then
return
end
mainFrame:Hide()
ClosePopupFrames()
end
function GUI:IsVisible()
return mainFrame and mainFrame:IsVisible()
end |
object_tangible_tcg_series7_decal_imperial_graffiti_01 = object_tangible_tcg_series7_shared_decal_imperial_graffiti_01:new {
}
ObjectTemplates:addTemplate(object_tangible_tcg_series7_decal_imperial_graffiti_01, "object/tangible/tcg/series7/decal_imperial_graffiti_01.iff") |
minetest.register_node(":technic:test_chest", {
description = "Technic chest",
groups = {
snappy = 2, choppy = 2, oddly_breakable_by_hand = 2,
tubedevice = 1, tubedevice_receiver = 1, technic_chest = 1,
},
on_receive_fields = function(...) print(...) end,
on_skeleton_key_use = function(...) print(...) end,
tube = {
input_inventory = "main",
},
})
local function set_injector_formspec(pos)
local meta = minetest.get_meta(pos)
local formspec = "fs_helpers_cycling:1:splitstacks"
formspec = formspec.."button[0,1;4,1;mode_stack;"..S("Itemwise").."]"
formspec = formspec.."button[4,1;4,1;enable;"..S("Disabled").."]"
meta:set_string("formspec", formspec)
end
minetest.register_node(":technic:injector", {
description = "Self-Contained Injector",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1},
tube = {
can_insert = function(...)end,
insert_object = function(...)end,
connect_sides = {left=1, right=1, back=1, top=1, bottom=1},
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Self-Contained Injector")
meta:set_string("mode", "single items")
--meta:get_inventory():set_size("main", 16)
--minetest.get_node_timer(pos):start(1)
set_injector_formspec(pos)
end,
on_receive_fields = function(...) print(...) end,
})
|
--[[
Copyright 2020 Manticore Games, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--]]
--[[
Moves scope model in respond to weapon's attack ability for recoil effect.
This script is dependant on WeaponAimScopeClient to supply with clientUserData.weapon information.
Once the script gets weapon object, it can proceed doing the recoil effect.
--]]
-- User exposed variables
local COMPONENT_ROOT = script:GetCustomProperty("ComponentRoot"):WaitForObject()
local OBJECT_TO_MOVE = script:GetCustomProperty("Object"):WaitForObject()
local EXECUTE_DURATION = script:GetCustomProperty("ExecuteDuration")
local RECOVERY_DURATION = script:GetCustomProperty("RecoveryDuration")
local MOVE_OFFSET_MIN = script:GetCustomProperty("LocalMoveOffsetMin")
local MOVE_OFFSET_MAX = script:GetCustomProperty("LocalMoveOffsetMax")
local ROTATE_OFFSET_MIN = script:GetCustomProperty("LocalRotateOffsetMin")
local ROTATE_OFFSET_MAX = script:GetCustomProperty("LocalRotateOffsetMax")
-- Constant variables
local ORIGINAL_POS = OBJECT_TO_MOVE:GetPosition()
local ORIGINAL_ROT = OBJECT_TO_MOVE:GetRotation()
-- Internal variables
local setup = false
local executeHandle = nil
function Tick(deltaTime)
if not Object.IsValid(COMPONENT_ROOT) then
Reset()
return
end
if not setup and Object.IsValid(COMPONENT_ROOT.clientUserData.weapon) then
local attackAbility = COMPONENT_ROOT.clientUserData.weapon:GetAbilities()[1]
if Object.IsValid(attackAbility) then
executeHandle = attackAbility.executeEvent:Connect(RecoilEffect)
setup = true
end
end
end
function RecoilEffect(ability)
if not Object.IsValid(OBJECT_TO_MOVE) or not Object.IsValid(COMPONENT_ROOT) then
Reset()
return
end
local executeDuration = EXECUTE_DURATION
local recoveryDuration = RECOVERY_DURATION
local finalPos = ORIGINAL_POS + GetRandomPosition(MOVE_OFFSET_MIN, MOVE_OFFSET_MAX)
local finalRot = ORIGINAL_ROT + GetRandomRotation(ROTATE_OFFSET_MIN, ROTATE_OFFSET_MAX)
OBJECT_TO_MOVE:StopMove()
OBJECT_TO_MOVE:MoveTo(finalPos, executeDuration, true)
OBJECT_TO_MOVE:StopRotate()
OBJECT_TO_MOVE:RotateTo(finalRot, executeDuration, true)
Task.Wait(executeDuration)
if Object.IsValid(OBJECT_TO_MOVE) and Object.IsValid(COMPONENT_ROOT) then
OBJECT_TO_MOVE:MoveTo(ORIGINAL_POS, recoveryDuration, true)
OBJECT_TO_MOVE:RotateTo(ORIGINAL_ROT, recoveryDuration, true)
end
end
function RandomFloat(lower, greater)
return lower + math.random() * (greater - lower);
end
function GetRandomPosition(minPos, maxPos)
return Vector3.New(RandomFloat(minPos.x, maxPos.x), RandomFloat(minPos.y, maxPos.y), RandomFloat(minPos.z, maxPos.z))
end
function GetRandomRotation(minRot, maxRot)
return Rotation.New(RandomFloat(minRot.x, maxRot.x), RandomFloat(minRot.y, maxRot.y), RandomFloat(minRot.z, maxRot.z))
end
function Reset()
if executeHandle then
executeHandle:Disconnect()
end
end
|
require 'plugins.gitsigns.setting'
|
local actions = require "telescope.actions"
local action_state = require "telescope.actions.state"
local conf = require "telescope.config".values
local finders = require "telescope.finders"
local Path = require("plenary.path")
local pickers = require "telescope.pickers"
local entry_display = require("telescope.pickers.entry_display")
local utils = require("telescope.utils")
local strings = require("plenary.strings")
local function show_entry_window(prompt_bufnr)
local entry = action_state.get_selected_entry()
actions.close(prompt_bufnr)
local winnr = entry.winnr
vim.api.nvim_set_current_win(winnr)
end
local M = {}
function M.gen_from_window(opts)
opts = opts or {}
local disable_devicons = opts.disable_devicons
local icon_width = 0
if not disable_devicons then
local icon, _ = utils.get_devicons("fname", disable_devicons)
icon_width = strings.strdisplaywidth(icon, 0)
end
local displayer =
entry_display.create {
separator = " ",
items = {
{width = opts.tabpage_width},
{width = opts.winnr_width},
{width = 4},
{width = icon_width},
{remaining = true}
}
}
local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd())
local make_display = function(entry)
local display_bufname
if opts.shorten_path then
print(2)
display_bufname = Path:new({entry.filename}):shorten()
else
display_bufname = entry.filename
end
local icon, hl_group = utils.get_devicons(entry.filename, disable_devicons)
return displayer {
{entry.tabpage, "TelescopeResultsNumber"},
{entry.winnr, "TelescopeResultsNumber"},
{entry.indicator, "TelescopeResultsComment"},
{icon, hl_group},
display_bufname .. ":" .. entry.lnum
}
end
return function(entry)
local bufname = entry.info.name ~= "" and entry.info.name or "[No Name]"
-- if bufname is inside the cwd, trim that part of the string
bufname = Path:new({bufname}):normalize(cwd)
local hidden = entry.info.hidden == 1 and "h" or "a"
local readonly = vim.api.nvim_buf_get_option(entry.bufnr, "readonly") and "=" or " "
local changed = entry.info.changed == 1 and "+" or " "
local indicator = entry.flag .. hidden .. readonly .. changed
return {
valid = true,
value = bufname,
ordinal = entry.winnr .. " : " .. bufname,
display = make_display,
tabpage = entry.tabpage,
winnr = entry.winnr,
bufnr = entry.bufnr,
filename = bufname,
lnum = entry.info.lnum ~= 0 and entry.info.lnum or 1,
indicator = indicator
}
end
end
M.windows = function(opts)
local winnrs =
vim.tbl_filter(
function(w)
local win_conf = vim.api.nvim_win_get_config(w)
if win_conf.relative ~= "" and not win_conf.focusable then
return false
end
if opts.ignore_current_window and w == vim.api.nvim_get_current_win() then
return false
end
return true
end,
vim.api.nvim_list_wins()
)
if not next(winnrs) then
return
end
local windows = {}
local default_selection_idx = 1
local max_tabpage = 0
local max_winnr = 0
for _, winnr in ipairs(winnrs) do
local flag = winnr == vim.api.nvim_get_current_win() and "%" or " "
local tabpage = vim.api.nvim_win_get_tabpage(winnr)
local bufnr = vim.fn.winbufnr(winnr)
local element = {
winnr = winnr,
tabpage = tabpage,
bufnr = bufnr,
flag = flag,
info = vim.fn.getbufinfo(bufnr)[1]
}
if max_tabpage < tabpage then
max_tabpage = tabpage
end
if max_winnr < winnr then
max_winnr = winnr
end
if opts.sort_lastused and flag == "%" then
local idx = ((windows[1] ~= nil and windows[1].flag == "%") and 2 or 1)
table.insert(windows, idx, element)
else
table.insert(windows, element)
end
end
if not opts.tabpage_width then
opts.tabpage_width = #tostring(max_tabpage)
end
if not opts.winnr_width then
opts.winnr_width = #tostring(max_winnr)
end
pickers.new(
opts,
{
prompt_title = "Windows",
finder = finders.new_table {
results = windows,
entry_maker = opts.entry_maker or M.gen_from_window(opts)
},
previewer = conf.grep_previewer(opts),
sorter = conf.generic_sorter(opts),
default_selection_index = default_selection_idx,
attach_mappings = function(_)
actions.select_default:replace(show_entry_window)
return true
end
}
):find()
end
return require("telescope").register_extension {
exports = {
windows = M.windows
}
}
|
-- The active filesystem object.
afs = {}
afs.isMountable = false
afs.drive=false
-- This will overwrite the fs.write object.
function afs.write(data, location)
if (fs.drive==false) then
return false, 'DRIVENOTLOADED'
end
-- Get filename with regexp
local filename = location:match('([^/]+)$')
local filepath = location:match('(.*[/])')
if (fs.exists(location)) then
return false, 'FILEALREADYEXISTS'
end
-- Generate an INODE with filename.
local inode={}
inode.created=timer.getTime()
inode.mode=000
inode.isFile=true
inode.owner='nothing'
inode.size='nothing'
-- Get Drive Object
local d = afs.getDriveObject()
kernel.output('Drive has \''..type(d.superblock)..'\' type superblock', true)
-- Check encryption settings
if(d.superblock.encrypted) then
inode.data=base64.enc(aeslua.encrypt(afs.password, data))
else
inode.data=base64.enc(data)
end
-- Write new file inode
if d.files==nil then
d.files={}
end
d.files[location] = inode
-- Encode it in JSON
de = JSON:encode(d)
kernel.output('Writing: \''..de..'\'', true)
-- Write the fs object
kernel.output('Writing data to \''..tostring(fs.drive)..'\' drive', true)
local dr = ofs.open(fs.drive, 'w')
dr.write(de)
dr.close()
return true, 'FILEWRITTEN'
end
-- Create a new filesystem (partition)
-- size: How big can the FS get?
-- label: What is the name of this FS.
-- Encrypt: true/false on AES encryption.
function afs.new(size, label, encrypt)
if(ofs.exists(kernel.DIR..'/'..label..'.vfs')) then
kernel.output('Drive already exists', true)
return false, 'DRIVEALREADYEXISTS'
end
if(label==nil) then
label=vfs.genUUID()
end
if not (encrypt==true) and not(encrypt==false) then
return false
end
kernel.output('Creating ext3 partition with LABEL \''..label..'\'')
-- Check if need to get password
if(encrypt==true) then
term.write('New Volume Password: ')
password = read('')
end
local tef = base64.enc(aeslua.encrypt(password, "ISVALID"))
-- EXT superblock.
local superblock = {}
superblock={}
superblock.max_size=size
superblock.fsversion=101
superblock.size=0
superblock.label=label
superblock.files=0
superblock.dirs=0
superblock.encrypted=encrypt
superblock.encryptiontest=tef
-- Final Object (FS)
local tw={}
tw.files={}
tw.superblock=superblock
-- Encode the object
local twj=JSON:encode(tw)
-- Write the Object. You must save the return value of ofs.open() to a var, then call var.write(stuff), not ofs.write(stuff).
local file = ofs.open(kernel.DIR..'/'..label..'.vfs', 'w')
file.write(twj)
file.close()
return true
end
function afs.delete(location)
if(fs.exists(location)) then
local d = afs.getDriveObject()
d.files[location]=nil
-- Write the new drive object
local dr = ofs.open(fs.drive, 'w')
dr.write(de)
dr.close()
end
end
-- Reads drive object from disk.
function afs.getDriveObject()
if not (fs.drive==false) then
kernel.output('Getting drive object for drive \''..tostring(fs.drive)..'\'', true)
-- Put drive object into memory aka whole drive.
local d = ofs.open(fs.drive, 'r')
local dc = d.readAll()
local dp = JSON:decode(dc)
-- Return drive object
return dp
else
return false, 'DRIVENOTOPEN'
end
end
function afs.exists(location)
local drive = afs.getDriveObject()
-- One dir only right now.
if(filename==nil) or (filename=='') then
if not (drive.files[location]==nil) then
kernel.output("File exists", true)
return true, 'FILEEXISTS'
end
end
-- If it existed, it would've returned, so that must mean it doesnt (if we have reached this point)
return false, 'FILEDOESNTEXIST'
end
--[[
@desc Gets the final component of a pathname.
@param {string} path
]]--
function afs.getName(path)
return path:match('([^/]+)$')
end
function afs.open(location, mode)
local d = afs.getDriveObject()
local obj = {}
obj.location=location
if mode=='r' then
obj.readAll = function(this)
if(this==nil) then
return false, "DIDDNTUSECOLON"
end
if not (fs.exists(this.location)) then
return false, 'FILENOTFOUND'
end
-- Put drive into memory.
local d = fs.getDriveObject()
if(fs.exists(this.location)) then
if(d.superblock.encrypted) then
return aeslua.decrypt(afs.password, base64.dec(d.files[this.location].data))
else
return base64.dec(d.files[this.location].data)
end
end
obj.close = function()
return true
end
return obj
end
if mode=='rb' then
obj.write = function()
return true
end
return obj
end
if mode=='w' then
obj.write = function(this, data)
if(this==nil) then
return false, "DIDDNTUSECOLON"
end
fs.write(data, this.location)
end
obj.writeLine = function(data)
if(this==nil) then
return false, "DIDDNTUSECOLON"
end
fs.write(data+'\n', this.location)
end
obj.close = function()
return true
end
return obj
end
if mode=='wb' then
obj.close = function()
return true
end
return obj
end
end
-- Creates a directory
function afs.makeDir(location)
if not (afs.exists(location)) then
local inode={}
inode.created=timer.getTime()
inode.mode=000
inode.isFile=false
inode.owner='nothing'
afs.files[location]=inode
-- Write new file inode
if d.files==nil then
d.files={}
end
d.files[location] = inode
-- Encode it in JSON
de = JSON:encode(d)
kernel.output('Creating directory \''..location..'\'', true)
local dr = ofs.open(fs.drive, 'w')
dr.write(de)
dr.close()
return true
end
-- Exists, don't make and return false
return false
end
function afs.loadDrive(drive)
if(ofs.exists(drive)) then
fs.drive=drive
local d = afs.getDriveObject()
-- Check if drive is actually a drive.
if(d==false) or (d==nil) then
kernel.output('Could not load drive \''..drive..'\'!')
return false, 'DRIVENOTLOADED'
end
-- Check if drive is encrypted
if(d.superblock.encrypted) then
term.write('Volume Password: ')
local pass = read('')
afs.password = pass
end
local dc = aeslua.decrypt(afs.password, base64.dec(d.superblock.encryptiontest))
if not (dc=="ISVALID") then
-- Remove drive object.
fs.drive=false
term.write('Not mounting drive, incorrect password')
return false, "INCORRECTPASSWORD"
end
kernel.output('Drive \''..drive..'\' loaded')
return true, 'DRIVELOADED'
else
return false, 'DRIVENOTFOUND'
end
end
return afs
|
local addonName, G = ...
assert(not G.Event)
G.Event = {}
local events = {}
function G.Event.Register()
G.Core.RegisterEventHandlers(events)
end
function events.ADDON_LOADED(name)
if name == addonName then
G.State.LoadFromTable(_G['OlliverrsTravelsPlayerData'] or {})
_G['OlliverrsTravelsPlayerData'] = nil
end
end
function events.CHAT_MSG_SYSTEM(msg)
local s = msg:match(ERR_LEARN_SPELL_S:gsub('%%s', '(.*)'))
if s ~= nil then
local name, rank = s:match('(.*) %(.*(%d+).*%)')
G.State.AddSkillByName(name, rank)
end
end
function events.CRAFT_SHOW()
G.State.ClearSkills()
for i = 1, GetNumCrafts() do
local name, rankstr = GetCraftInfo(i)
local rank = rankstr:match('(%d+)')
G.State.AddSkillByName(name, rank)
end
end
function events.PLAYER_LEVEL_UP(newLevel)
if newLevel < 10 then
return
end
local start, finish = newLevel, newLevel
if newLevel == 10 then
start = 1
end
local newSkills = {}
for level = start, finish do
for _, v in ipairs(G.DB.LevelData[level]) do
local skill, rank = v[1], v[2]
table.insert(newSkills, G.DB.AbilityNames[skill] .. ' ' .. rank)
end
end
if #newSkills > 0 then
table.sort(newSkills)
print('New trainable skills: ' .. table.concat(newSkills, ', '))
else
print('No new trainable skills.')
end
end
function events.PLAYER_LOGOUT()
_G['OlliverrsTravelsPlayerData'] = G.State.SerializeToTable()
end
|
--[[
Name: cl_init.lua
For: SantosRP
By: TalosLife
]]--
include "shared.lua"
ENT.RenderGroup = RENDERGROUP_BOTH
function ENT:Initialize()
end
function ENT:Draw()
end
surface.CreateFont( "MenuTriggerFont", {size = 128, weight = 425, font = "Trebuchet18"} )
local function DrawMenuTriggerUI( ent )
surface.SetFont( "MenuTriggerFont" )
local w, h = surface.GetTextSize( ent:GetText() )
w = w +35
h = h +13
surface.SetDrawColor( 50, 50, 50, 150 )
surface.DrawRect( -(w /2), 0, w, h )
draw.SimpleText(
ent:GetText(),
"MenuTriggerFont",
0,
0,
color_white,
TEXT_ALIGN_CENTER
)
end
local function RenderMenu( ent )
local angs = ent:LocalToWorldAngles( Angle(180, -90, -90) )
local pos = ent:LocalToWorld( Vector(0, 0, 0) )
cam.Start3D2D( pos, angs, 0.03 )
DrawMenuTriggerUI( ent )
cam.End3D2D()
end
g_MenuTriggerCache = g_MenuTriggerCache or {}
hook.Add( "NetworkEntityCreated", "Cache_MenuTriggers", function( eEnt )
if eEnt:GetClass() ~= "ent_menu_trigger" then return end
g_MenuTriggerCache[eEnt] = true
end )
hook.Add( "PostDrawTranslucentRenderables", "Draw_MenuTriggers", function()
local old = render.GetToneMappingScaleLinear()
render.SetToneMappingScaleLinear( Vector(1, 1, 1) )
render.SuppressEngineLighting( true )
render.PushFilterMag( 3 )
render.PushFilterMin( 3 )
for k, v in pairs( g_MenuTriggerCache ) do
if not IsValid( k ) then g_MenuTriggerCache[k] = nil continue end
--Draw only in range
if k:GetPos():DistToSqr( LocalPlayer():EyePos() ) > k.m_intMaxRenderRange ^2 then
continue
end
RenderMenu( k )
end
render.PopFilterMag()
render.PopFilterMin()
render.SuppressEngineLighting( false )
render.SetToneMappingScaleLinear( old )
end ) |
for _, v in pairs(t) do
local x = f()
if x then
f(function() return v end)
else
g(function() return v end)
end
end
|
local get_hex = require('cokeline/utils').get_hex
local is_picking_focus = require('cokeline/mappings').is_picking_focus
local is_picking_close = require('cokeline/mappings').is_picking_close
local red = vim.g.terminal_color_1
local yellow = vim.g.terminal_color_3
-- local modified_fg = get_hex('Todo', 'bg')
local modified_fg = '#09F7A0'
local errors_fg = get_hex('DiagnosticError', 'fg')
local warnings_fg = get_hex('DiagnosticWarn', 'fg')
require('cokeline').setup({
show_if_buffers_are_at_least = 2,
default_hl = {
focused = {
fg = get_hex('Normal', 'fg'),
bg = 'NONE',
},
unfocused = {
fg = get_hex('Comment', 'fg'),
bg = 'NONE',
},
},
components = {
{
text = function(buffer) return (buffer.index ~= 1) and '▏' or '' end,
hl = {
fg = get_hex('Normal', 'fg')
},
},
-- {
-- text = function(buffer) return ' ' .. buffer.devicon.icon end,
-- hl = {
-- fg = function(buffer) return buffer.devicon.color end,
-- },
-- },
{
text = ' ',
},
{
text = function(buffer)
if buffer.is_focused then
return buffer.devicon.icon
else
return
(is_picking_focus() or is_picking_close())
and buffer.pick_letter .. ' '
or buffer.devicon.icon
end
end,
hl = {
fg = function(buffer)
if buffer.is_focused then
return buffer.devicon.color
else
return
(is_picking_focus() and yellow)
or (is_picking_close() and red)
end
end,
style = function(buffer)
if buffer.is_focused then
return nil
else
return
(is_picking_focus() or is_picking_close())
and 'italic,bold'
or nil
end
end,
}
},
{
text = function(buffer) return buffer.filename end,
hl = {
style = function(buffer) return buffer.is_focused and 'bold' or nil end,
}
},
{
text = ' '
},
{
text = function(buffer)
return
(buffer.diagnostics.errors ~= 0 and ' ' .. buffer.diagnostics.errors)
or (buffer.diagnostics.warnings ~= 0 and ' ' .. buffer.diagnostics.warnings)
or ''
end,
hl = {
fg = function(buffer)
return
(buffer.diagnostics.errors ~= 0 and errors_fg)
or (buffer.diagnostics.warnings ~= 0 and warnings_fg)
or nil
end,
},
truncation = { priority = 2 },
},
{
text = ' '
},
{
text = function(buffer)
return buffer.is_modified and '●' or ''
end,
hl = {
fg = function(buffer)
return buffer.is_modified and modified_fg or nil
end
},
truncation = { priority = 5 },
},
-- {
-- text = '',
-- delete_buffer_on_left_click = true,
-- },
{
text = ' ',
},
},
})
|
--------------------------------------------------------------------------------
-- protocol.lua
--------------------------------------------------------------------------------
local _PACKAGE = (...):match("^(.+)[%./][^%./]+") or ""
local ERROR_MSG = tengine.ERROR_MSG
local p = tengine.p
local parser = require(_PACKAGE .. '/parser')
local protobuf = require(_PACKAGE .. '/protobuf')
local _M = {}
function _M.registerproto(filename, path)
return parser.register(filename, path)
end
function _M.register(filename, path)
local file, ret = io.open(path .. filename,"rb")
if not file then
ERROR_MSG("proto register file error: %s", ret)
return
end
local buffer = file:read "*a"
file:close()
protobuf.register(buffer)
end
function _M.encode(name, message)
local packet = {
--type = name,
name = name,
data = protobuf.encode('tgame.' .. name, message)
}
return protobuf.encode("tgame.Packet", packet)
end
function _M.decode(data, len)
local packet, err = protobuf.decode("tgame.Packet" , data, len)
if not packet then
ERROR_MSG("proto decode data err: %s ", err)
return err, nil, nil, nil
end
local message, err = protobuf.decode('tgame.'..packet.name, packet.data)
if err then
return err, nil, nil, nil
end
return nil, packet.type, packet.name, message
end
return _M
|
local Root = script.Parent
local ContentProvider = game:GetService("ContentProvider")
local ItemType = require(Root.Enums.ItemType)
local BASE_URL = string.gsub(ContentProvider.BaseUrl:lower(), "https?://m.", "https?://www.")
local THUMBNAIL_URL = BASE_URL.."thumbs/asset.ashx?assetid="
local BUNDLE_THUMBNAIL_URL = BASE_URL.."outfit-thumbnail/image?userOutfitId=%s&width=100&height=100&format=png"
local XBOX_DEFAULT_IMAGE = "rbxasset://textures/ui/Shell/Icons/[email protected]"
--[[
Depending on the type of item, get the proper preview image, sized correctly
]]
local function getPreviewImageUrl(productInfo, platform)
local imageId
-- AssetId will only be populated if ProductInfo was from an asset
if productInfo.itemType == ItemType.Bundle then
return string.format(BUNDLE_THUMBNAIL_URL, productInfo.costumeId)
elseif productInfo.AssetId ~= nil and productInfo.AssetId ~= 0 then
imageId = productInfo.AssetId
elseif productInfo.IconImageAssetId ~= nil then
imageId = productInfo.IconImageAssetId
elseif platform == Enum.Platform.XBoxOne then
-- XBoxOne has its own default image if anything doesn't load
return XBOX_DEFAULT_IMAGE
end
return THUMBNAIL_URL..tostring(imageId).."&x=100&y=100&format=png"
end
return getPreviewImageUrl |
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:27' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC.
****************************************************************************
]]
local function OnEventQuestAdded(eventCode, journalIndex, questName, objectiveName)
RemoveScriptedEventInviteForQuest(questName)
end
function ZO_ScriptedWorldEvents_Initialize()
-- Handling this event in order to clear a pending invite notification for a scripted event which was initiated by a fellow group member accepting the event quest first while
-- this player was also in dialog with the quest provider, and to which this player later accepts the event quest personally via dialog. If the player were to
-- accept the event quest in the quest dialog, there is then no reason for them to still be prompted to accept/decline the same event.
EVENT_MANAGER:RegisterForEvent("ZO_ScriptedWorldEvent", EVENT_QUEST_ADDED, OnEventQuestAdded)
end
ZO_ScriptedWorldEvents_Initialize() |
-- See LICENSE for terms
-- local some stuff that's called a lot
local tostring = tostring
local point = point
local Sleep = Sleep
local GameTime = GameTime
local DeleteThread = DeleteThread
local PlayFX = PlayFX
local IsValid = IsValid
local GetCursorWorldPos = GetCursorWorldPos
local Random = ChoGGi.ComFuncs.Random
PersonalShuttles = {
time_limit = const.DayDuration * 4,
attacker_color1 = -2031616,
attacker_color2 = -16777216,
attacker_color3 = -9043968,
friend_colour1 = -16711941,
friend_colour2 = -16760065,
friend_colour3 = -1,
-- I wouldn't set this too high...
max_shuttles = 50,
-- switch to drop item on pickup
drop_toggle = false,
}
-- custom shuttletask
DefineClass.PersonalShuttles_ShuttleFollowTask = {
__parents = {"InitDone"},
state = "new",
shuttle = false,
scanning = false, -- from explorer code for AnalyzeAnomaly
dest_pos = false, -- there isn't one, but adding one prevents log spam
}
DefineClass.PersonalShuttle = {
__parents = {"CargoShuttle"},
defence_thread_DD = false,
-- set from shuttlehub
recall_shuttle = false,
-- attached carry object
carried_obj = false,
-- should it pickup item with pickup enabled
pickup_toggle = false,
-- build up of time to sleep between mouse
idle_time = 0,
-- we don't want to abort flying thread if it's the same dest
old_dest = false,
-- fix most jerky moving
first_idle = 0,
-- attack stuff
shoot_range = 25 * guim,
reload_time = const.HourDuration,
track_thread = false,
-- attached obj offsets
offset_rover = point(0, 0, 400),
offset_drone = point(0, 0, 325),
offset_other = point(0, 0, 350),
}
-- If it idles it'll go home, so we return my command till we remove thread
function PersonalShuttle:Idle()
self:SetCommand("FollowMouse")
Sleep(1000)
end
function PersonalShuttle:GameInit()
self.city = self.hub.city or UICity
self.city:AddToLabel("PersonalShuttle", self)
-- gagarin likes it dark
self:SetColorModifier(-1)
local ps = PersonalShuttles
-- If it's an attack shuttle
if UICity.PersonalShuttles.shuttle_threads[self.handle] then
self.defence_thread_DD = CreateGameTimeThread(function()
while IsValid(self) and not self.destroyed do
if self.working then
self:PersonalShuttles_DefenceTickD(ps)
end
Sleep(2500)
end
end)
end
end
function PersonalShuttle:Done()
(self.city or UICity):RemoveFromLabel("PersonalShuttle", self)
end
-- gets rid of error in log
--~ function PersonalShuttle:SetTransportTask()end
PersonalShuttle.SetTransportTask = empty_func
-- gives an error when we spawn shuttle since i'm using a fake task, so we just return true instead
function PersonalShuttle:OnTaskAssigned()
return true
end
-- dustdevil thread for rockets
function PersonalShuttle:PersonalShuttles_DefenceTickD(ps)
if UICity.PersonalShuttles.shuttle_threads[self.handle] then
return self:DefenceTick(ps.shuttle_rocket_DD)
end
end
-- Movable.Goto(object, pt) -- Unit.Goto is a command, use this instead for direct control
-- get shuttle to follow mouse
function PersonalShuttle:FollowMouse()
local PersonalShuttles = PersonalShuttles
-- always start it off as pickup
if not IsValid(self.carried_obj) then
self.pickup_toggle = true
end
self.idle_time = 0
self.old_dest = false
self.first_idle = 0
-- following mouse loop
repeat
local pos = self:GetVisualPos()
local dest = GetCursorWorldPos()
self:GotoPos(pos, dest)
local obj = SelectedObj
if IsValid(obj) and obj ~= self then
self:SelectedObject(obj, pos, dest)
end
self.idle_time = self.idle_time + 10
Sleep(250 + self.idle_time)
-- 4 sols then send it back home (or if we recalled it)
until self.recall_shuttle or (GameTime() - self.time_now) > PersonalShuttles.time_limit
-- buh-bye little flying companion
self:SetCommand("GoHome")
end
-- where are we going
function PersonalShuttle:GotoPos(pos, dest)
-- too quick and it's jerky *or* mouse making small movements
if self.in_flight then
if self.idle_time < 125 then
return
--~ elseif self.idle_time > 100 and self.old_pos == pos then
--~ --
elseif self.old_dest and not (self.idle_time > 125 and self.old_pos == pos) then
--~ local ox, oy = self.old_dest:xy()
--~ local x, y = dest:xy()
--~ if point(ox, oy):Dist2D(point(x, y)) < 1000 then
if self.old_dest:Dist2D(dest) < 1000 then
if self.first_idle < 25 then
self.first_idle = self.first_idle + 1
return self.idle_time
end
end
end
end
self.first_idle = 0
-- don't try to fly if pos or dest are the same
if tostring(pos) == tostring(dest) then
return
end
-- check the last path point to see if it's far away (can't be bothered to make a new func that allows you to break off the path)
-- and if we move when we're too close it's jerky
local dest_x, dest_y = dest:xy()
--~ local dist = pos:Dist2D(point(dest_x, dest_y)) > 5000
local dist = pos:Dist2D(dest) > 5000
if dist or self.idle_time > 250 then
-- rest on ground
self.hover_height = 0
-- If idle is ticking up
if self.idle_time > 250 then
if not self.is_landed then
self:SetState("fly")
Sleep(250)
self:PlayFX("Dust", "start")
self:PlayFX("Waiting", "start")
local land = pos:SetTerrainZ()
self:FlyingFace(land, 2500)
self:SetPos(land, 4000)
Sleep(750)
self.is_landed = self:GetPos()
self:PlayFX("Dust", "end")
self:PlayFX("Waiting", "end")
self:SetState("idle")
end
Sleep(500 + self.idle_time)
end
-- mouse moved far enough then wake up and fly
if dist then
-- reset idle count
self.idle_time = 0
-- we don't want to skim the ground (default is 3K, but this one likes living life on the edge)
self.hover_height = 1500
-- want to be kinda random
local path = self:CalcPath(
pos,
point(dest_x+Random(-2500, 2500), dest_y+Random(-2500, 2500), self.hover_height)
)
if self.is_landed then
self.is_landed = nil
self:PlayFX("DomeExplosion", "start")
-- self:PersonalShuttles_TakeOff()
end
-- abort previous flight if dest is different
if self.in_flight and dest ~= self.old_dest then
self.old_dest = dest
self.in_flight = nil
DeleteThread(FlyingObjs[self])
-- we don't want to start a new flight if we're flying and the dest isn't different
elseif not self.in_flight then
-- the actual flight
self.in_flight = true
self:FollowPathCmd(path)
while self.next_spline do
Sleep(1000)
end
self.in_flight = nil
end
end
-- hmm?
self:SetState("idle")
end
self.old_pos = pos
self.old_dest = dest
end
function PersonalShuttle:DropCargo(obj, pos, dest)
local carried = self.carried_obj
-- If fired from recall
dest = dest or GetPassablePointNearby(self:GetPos())
pos = pos or self:GetPos()
-- drop it off nearby
self:WaitFollowPath(self:CalcPath(pos, dest))
self:PlayFX("ShuttleUnload", "start", carried)
carried:Detach()
-- doesn't work if we use this with CalcPath
dest = HexGetNearestCenter(dest)
-- don't want to be floating above the ground
carried:SetPos(dest:SetTerrainZ(), 2500)
-- we don't want stuff looking weird (drones/rovers can move on their own)
if obj and obj:IsKindOf("ResourceStockpileBase") then
carried:SetAngle(0)
end
Sleep(2500)
self:PlayFX("ShuttleUnload", "end", carried)
-- so drones will empty resource piles
if carried.ConnectToCommandCenters then
carried:ConnectToCommandCenters()
end
WaitMsg("OnRender")
-- restore our fake drone override command
if carried.ChoGGi_SetCommand then
carried.SetCommand = carried.ChoGGi_SetCommand
carried.ChoGGi_SetCommand = nil
end
if carried.Idle then
carried:SetCommand("Idle")
end
self.carried_obj = nil
-- make it able to pick up again without having to press the button
self.pickup_toggle = true
UICity.PersonalShuttles.shuttle_carried[carried.handle] = nil
end
local function IdleDroneInAir()
Sleep(1000)
end
-- pickup/dropoff/scan
function PersonalShuttle:SelectedObject(obj, pos, dest)
-- Anomaly scanning
if obj:IsKindOf("SubsurfaceAnomaly") then
-- scan nearby SubsurfaceAnomaly
local anomaly = NearestObject(pos, MapGet("map", "SubsurfaceAnomaly"), 2000)
-- make sure it's the right one, and not already being scanned by another
if anomaly and obj == anomaly and not UICity.PersonalShuttles.shuttle_scanning_anomaly[anomaly.handle] then
PlayFX("ArtificialSunCharge", "start", anomaly)
UICity.PersonalShuttles.shuttle_scanning_anomaly[anomaly.handle] = true
self:AnalyzeAnomaly(anomaly)
PlayFX("ArtificialSunCharge", "end", anomaly)
end
-- resource moving
-- are we carrying, and is pickup set to drop?
elseif IsValid(self.carried_obj) and self.pickup_toggle == false then
self:DropCargo(obj, pos, dest)
-- If it's marked for pickup and shuttle is set to pickup and it isn't already carrying then grab it
elseif obj.PersonalShuttles_PickUpItem and self.pickup_toggle and not IsValid(self.carried_obj) then
-- goto item
self:WaitFollowPath(self:CalcPath(pos, obj:GetVisualPos()))
if not UICity.PersonalShuttles.shuttle_carried[obj.handle] then
UICity.PersonalShuttles.shuttle_carried[obj.handle] = true
-- select shuttle instead of carried
SelectObj(self)
-- remove pickup mark from it
obj.PersonalShuttles_PickUpItem = nil
-- PlayFX of beaming, transport one i think
self:PlayFX("ShuttleLoad", "start", obj)
obj:SetPos(self:GetVisualPos(), 2500)
Sleep(2500)
-- pick it up
self:Attach(obj, self:GetSpotBeginIndex("Origin"))
-- offset attach
if obj:IsKindOf("BaseRover") then
obj:SetAttachOffset(self.offset_rover)
elseif obj:IsKindOf("Drone") then
obj:SetAttachOffset(self.offset_drone)
obj.ChoGGi_SetCommand = obj.SetCommand
obj.SetCommand = IdleDroneInAir
else
obj:SetAttachOffset(self.offset_other)
end
if PersonalShuttles.drop_toggle then
-- switch to drop, so next selected item will be where we drop it
self.pickup_toggle = false
end
-- and remember not to pick up more than one
self.carried_obj = obj
self:PlayFX("ShuttleLoad", "end", obj)
end
end
end
function PersonalShuttle:FireRocket(target)
local pos = self:GetSpotPos(1)
local angle, axis = self:GetSpotRotation(1)
local rocket = PlaceObject("RocketProjectile", {
shooter = self,
target = target,
})
rocket:Place(pos, axis, angle)
rocket:StartMoving()
PlayFX("MissileFired", "start", self, nil, pos, rocket.move_dir)
return rocket
end
-- pretty much a direct copynpaste from explorer (just removed stuff that's rover only)
function PersonalShuttle:AnalyzeAnomaly(anomaly)
if not IsValid(self) then
return
end
self:SetState("idle")
self:SetPos(self:GetVisualPos())
self:Face(anomaly:GetPos(), 200)
local layers = anomaly.depth_layer or 1
self.scan_time = layers * g_Consts.RCRoverScanAnomalyTime
local progress_time = MulDivRound(anomaly.scanning_progress, self.scan_time, 100)
self.scanning_start = GameTime() - progress_time
RebuildInfopanel(self)
self:PushDestructor(function(self)
if IsValid(anomaly) then
anomaly.scanning_progress = self:GetScanAnomalyProgress()
if anomaly.scanning_progress >= 100 then
self:Gossip("ScanAnomaly", anomaly.class, anomaly.handle)
anomaly:ScanCompleted(self)
anomaly:delete()
end
end
if IsValid(anomaly) and anomaly == SelectedObj then
Msg("UIPropertyChanged", anomaly)
end
-- self:StopFX()
self.scanning = false
self.scanning_start = false
end)
local time = self.scan_time - progress_time
-- self:StartFX("Scan", anomaly)
self.scanning = true
while time > 0 and IsValid(self) and IsValid(anomaly) do
Sleep(1000)
time = time - 1000
anomaly.scanning_progress = self:GetScanAnomalyProgress()
if anomaly == SelectedObj then
Msg("UIPropertyChanged", anomaly)
end
end
self:PopAndCallDestructor()
UICity.PersonalShuttles.shuttle_scanning_anomaly[anomaly.handle] = nil
end
function PersonalShuttle:GetScanAnomalyProgress()
return self.scanning_start and MulDivRound(GameTime() - self.scanning_start, 100, self.scan_time) or 0
end
function PersonalShuttle:DefenceTick(already_fired)
if type(already_fired) ~= "table" then
print("Personal Shuttles Error: shuttle_rocket_DD isn't a table")
end
-- list of dustdevils on map
local hostiles = g_DustDevils or empty_table
if IsValidThread(self.track_thread) then
return
end
for i = 1, #hostiles do
local obj = hostiles[i]
-- get dist (added * 10 as it didn't see to target at the range of it's hex grid)
-- It could be from me increasing protection radius, or just how it targets meteors
if IsValid(obj) and self:GetVisualDist(obj) <= self.shoot_range * 10 then
-- check if tower is working
if not IsValid(self) or not self.working or self.destroyed then
return
end
-- follow = small ones attached to majors
if not obj.follow and not already_fired[obj.handle] then
-- If not already_fired[obj.handle] then
-- aim the tower at the dustdevil
if self.class == "DefenceTower" then
self:OrientPlatform(obj:GetVisualPos(), 7200)
end
-- fire in the hole
local rocket = self:FireRocket(obj)
-- store handle so we only launch one per devil
already_fired[obj.handle] = obj
-- seems like safe bets to set
self.meteor = obj
self.is_firing = true
-- sleep till rocket explodes
CreateGameTimeThread(function()
while rocket.move_thread do
Sleep(500)
end
if obj:IsKindOf("BaseMeteor") then
-- make it pretty
PlayFX("AirExplosion", "start", obj, nil, obj:GetPos())
Msg("MeteorIntercepted", obj)
obj:ExplodeInAir()
else
-- make it pretty
PlayFX("AirExplosion", "start", obj, obj:GetAttaches()[1], obj:GetPos())
-- kill the devil object
obj:delete()
end
self.meteor = false
self.is_firing = false
end)
-- back to the usual stuff
Sleep(self.reload_time)
return true
end
end
end
-- remove devil handles only if they're actually gone
if already_fired[1] then
CreateGameTimeThread(function()
for i = #already_fired, 1, -1 do
if not IsValid(already_fired[i]) then
already_fired[i] = nil
end
end
end)
end
end
|
local function WithinBox(v, v1, v2)
local x, y, z, x1, y1, z1, x2, y2, z2 = v[1], v[2], v[3], v1[1], v1[2], v1[3], v2[1], v2[2], v2[3]
return ((x >= x1 and x <= x2) or (x <= x1 and x >= x2)) and ((y >= y1 and y <= y2) or (y <= y1 and y >= y2)) and ((z >= z1 and z <= z2) or (z <= z1 and z >= z2))
end
CreateConVar("spraymon_nooverspraying", 0, FCVAR_REPLICATED, "anti over spraying: 0 | 1")
local sprays = {}
net.Receive("Jonathan1358.SprayMon.AddSpray", function()
local ply = net.ReadEntity()
if ply.SteamID then
local normal = Vector(net.ReadFloat(), net.ReadFloat(), net.ReadFloat())
local ang = normal:Angle()
local vec = ang:Forward() * .001 + (ang:Right() + ang:Up()) * 32
local pos = Vector(net.ReadFloat(), net.ReadFloat(), net.ReadFloat()) + ang:Up() * 4
sprays[ply:SteamID()] = {name = ply:Name(), pos1 = pos - vec, pos2 = pos + vec, normal = normal, clears = 0, pos11 = pos - vec * 1.75, pos22 = pos + vec * 1.75}
end
end)
local function clear()
for k, v in next, sprays do
v.clears = v.clears + 1
if v.clears >= 2 then
sprays[k] = nil
end
end
end
net.Receive("Jonathan1358.SprayMon.ClearDecals", clear)
local rcc = RunConsoleCommand
RunConsoleCommand = function(cmd, ...)
if cmd == "r_cleardecals" then
clear()
end
return rcc(cmd, ...)
end
local pcc = FindMetaTable("Player").ConCommand
FindMetaTable("Player").ConCommand = function(self, cmd, ...)
if self == LocalPlayer() and cmd:find("r_cleardecals", nil, true) then
clear()
end
return pcc(self, cmd, ...)
end
local gcm = game.CleanUpMap
function game.CleanUpMap(...)
clear()
return gcm(...)
end
surface.CreateFont("SMSpray", {font = "Trebuchet MS", size = 24, weight = 900})
local first = true
hook.Add("HUDPaint", "Jonathan1358.SprayMon", function()
local todraw = {}
local trace = LocalPlayer():GetEyeTraceNoCursor()
for k, v in next, sprays do
if v.normal == trace.HitNormal and WithinBox(trace.HitPos, v.pos1, v.pos2) then
table.insert(todraw, k)
end
end
if #todraw > 0 then
if first then
notification.AddLegacy("You can see the SteamID of spray owner by holding ALT while looking at it.", NOTIFY_HINT, 6)
first = nil
end
local y = ScrH() / 2 - #todraw * 12
draw.SimpleTextOutlined("Sprayed by:", "SMSpray", 10, y, Color(255, 136, 0), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0))
for k, v in next, todraw do
y = y + 24
draw.SimpleTextOutlined(sprays[v].name .. (input.IsKeyDown(KEY_LALT) and ": " .. v or ""), "SMSpray", 10, y, Color(255, 136, 0), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0))
end
if input.IsKeyDown(KEY_LALT) then
SetClipboardText(todraw[1])
end
end
end)
hook.Add("PlayerBindPress", "Jonathan1358.SprayMon", function(_, cmd, down)
if down and cmd:find("impulse 201", nil, true) then
if GetConVarNumber("spraymon_nooverspraying") > 0 then
local trace = LocalPlayer():GetEyeTraceNoCursor()
for k, v in next, sprays do
if k ~= LocalPlayer():SteamID() and v.normal == trace.HitNormal and WithinBox(trace.HitPos, v.pos11, v.pos22) then
chat.AddText(Color(255, 255, 255), "You can't place your spray here.")
return true
end
end
end
net.Start("Jonathan1358.SprayMon.Spray")
net.SendToServer()
end
end)
local Tex_Corner8 = surface.GetTextureID("gui/corner8")
local loads = {}
local frame
concommand.Add("spraymon", function()
if IsValid(frame) then
frame:Remove()
return
end
frame = vgui.Create("DFrame")
frame:SetAlpha(0)
frame:SetTitle("SprayMon")
frame:SetSize(ScrW() * .94, ScrH() * .94)
frame:Center()
frame:MakePopup()
frame:SetKeyboardInputEnabled(false)
local scroll = frame:Add("DScrollPanel")
scroll:SetPos(7, 26)
scroll:SetSize(frame:GetWide() - 14, frame:GetTall() - 30)
local layout = scroll:Add("DIconLayout")
layout:SetPos(0, 4)
layout:SetSize(scroll:GetWide() - 16, scroll:GetTall())
layout:SetSpaceX(4)
layout:SetSpaceY(4)
local err
local all = player.GetHumans()
table.sort(all, function(a, b) return a:Name():lower() < b:Name():lower() end)
for k, v in next, all do
if v.GetPlayerInfo and v:GetPlayerInfo() then
local panel = layout:Add("DPanel")
panel:SetDrawBackground(false)
panel:SetSize(140, 168)
local label1 = panel:Add("DLabel")
label1:SetText(v:Name())
label1:SizeToContents()
if label1:GetWide() > 128 then
label1:SetWide(128)
end
label1:SetPos(0, 4)
label1:CenterHorizontal()
local ok, mat, tex, w, h
local name = v:GetPlayerInfo().customfiles[1]
local uid = v:UserID()
if name ~= "00000000" then
mat = CreateMaterial("SMSpray_" .. uid .. (loads[uid] and "_" .. loads[uid] or ""), "UnlitGeneric", {
["$basetexture"] = "temp/" .. name,
["$vertexalpha"] = 1,
Proxies = {
AnimatedTexture = {
animatedtexturevar = "$basetexture",
animatedtextureframenumvar = "$frame",
animatedtextureframerate = 5
}
}
})
tex = mat:GetTexture("$basetexture")
if tex and "temp/" .. name == tex:GetName() then
w, h = tex:Width(), tex:Height()
ok = true
end
end
function panel:Paint(pw, ph)
surface.SetDrawColor(34, 34, 34, 255)
surface.DrawRect(0, 2, 2, ph - 4)
surface.DrawRect(2, 0, pw - 4, 2)
surface.DrawRect(pw - 2, 2, 2, ph - 4)
surface.DrawRect(2, ph - 2, pw - 4, 2)
surface.SetTexture(Tex_Corner8)
surface.DrawTexturedRectRotated(1, 1, 2, 2, 0)
surface.DrawTexturedRectRotated(pw - 1, 1, 2, 2, 270)
surface.DrawTexturedRectRotated(1, ph - 1, 2, 2, 90)
surface.DrawTexturedRectRotated(pw - 1, ph - 1, 2, 2, 180)
if ok then
local d = math.max(w, h) / 128
local w, h = w / d, h / d
surface.SetDrawColor(255, 255, 255, 255)
surface.SetMaterial(mat)
surface.DrawTexturedRect((pw - w) / 2, (ph - h) / 2, w, h)
end
end
local label2 = panel:Add("DLabel")
if tex then
if ok then
label2:SetText(w .. " x " .. h)
else
loads[uid] = (loads[uid] or 0) + 1
label2:SetText("error")
err = true
end
else
label2:SetText(name == "00000000" and "no spray" or "not available")
end
label2:SizeToContents()
if ok then
label2:CenterHorizontal()
label2:AlignBottom(4)
function panel:OnCursorEntered()
local d = (w > ScrW() or h > ScrH()) and math.max(w / ScrW(), h / ScrH()) or 1
local w, h = w / d, h / d
hook.Add("DrawOverlay", "Jonathan1358.SprayMon", function()
surface.SetMaterial(mat)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawTexturedRect((ScrW() - w) / 2, (ScrH() - h) / 2, w, h)
end)
end
function panel:OnCursorExited()
hook.Remove("DrawOverlay", "Jonathan1358.SprayMon")
end
else
label2:Center()
end
end
end
function frame:OnRemove()
hook.Remove("DrawOverlay", "Jonathan1358.SprayMon")
end
local breload
if err then
breload = frame:Add("DButton")
breload:SetText("Reload")
breload:SetPos(0, 3)
breload:SetSize(52, 19)
function breload:DoClick()
frame:Remove()
RunConsoleCommand("spraymon")
end
end
local orig = frame.Paint
function frame:Paint(...)
orig(self, ...)
frame.Paint = orig
local mx, my = 0, 0
for k, v in next, layout:GetChildren() do
local x = v.x + v:GetWide()
if x > mx then
mx = x
end
local y = v.y + v:GetTall()
if y > my then
my = y
end
end
my = my + 38
if my >= frame:GetTall() then
mx = mx + 20
end
frame:SetSize(mx + 14, my < frame:GetTall() and my or frame:GetTall())
frame:Center()
if breload then
breload:AlignRight(98)
end
scroll:SetSize(frame:GetWide() - 14, frame:GetTall() - 30)
frame:SetAlpha(255)
local x, y = frame:GetPos()
gui.SetMousePos(x + frame:GetWide() - 20, y + 10)
end
end) |
Locales ['br'] = {
['buy'] = 'Você comprou',
['not_enough_black'] = 'Você não tem dinheiro sujo suficiente',
['not_enough'] = 'você não tem dinheiro suficiente',
['shop'] = 'Comprar',
['shop_menu'] = 'Pressione ~INPUT_CONTEXT~ para comprar armas.',
['map_blip'] = 'Loja de Armas',
}
|
local included = pcall(debug.getlocal, 6, 1)
local lst = require("list").new()
local T = require("u-test")
lst:pushl("b") -- push last 'b'
lst:pushf("a") -- push first 'a'
for i = 1, 4, 1 do
lst:pushl(tostring(i)) -- push last '1, 2, 3, 4'
end
lst:pushl({ 5, 6, 7 }) -- push table
lst:pushl(8) -- push number
lst:pushl(true) -- push boolean
lst:remove("3") -- remove '3', in middle
lst:popf() -- pop first 'a'
lst:pushl("end") -- push 'end'
lst:popl() -- pop 'end'
local walk = function()
for k, v in lst:walk() do
if k == 1 then
T.equal(v, "b")
end
if k == 2 then
T.equal(v, "1")
end
if k == 3 then
T.equal(v, "2")
end
if k == 4 then
T.equal(v, "4")
end
if k == 5 then
T.is_table(v)
end
if k == 6 then
T.is_number(v)
end
if k == 7 then
T.is_true(v)
end
end
end
local range = function()
for i, v in ipairs(lst:range(2, 3)) do
if i == 1 then
T.equal(v, "1")
end
if i == 2 then
T.equal(v, "2")
end
end
end
local insert = function()
lst:insertf("0", "1") -- insert front of '1'
lst:insertl("3", "2") -- insert after of '2'
for k, v in lst:walk() do
if k == 1 then
T.equal(v, "b")
end
if k == 2 then
T.equal(v, "0")
end
if k == 3 then
T.equal(v, "1")
end
if k == 4 then
T.equal(v, "2")
end
if k == 5 then
T.equal(v, "3")
end
if k == 6 then
T.equal(v, "4")
end
if k == 7 then
T.is_table(v)
end
if k == 8 then
T.is_number(v)
end
if k == 9 then
T.is_true(v)
end
end
end
local pop = function()
T.is_true(lst:popl())
T.is_number(lst:popl())
T.is_table(lst:popl())
T.equal(lst:popl(), "4")
T.equal(lst:popl(), "3")
T.equal(lst:popl(), "2")
T.equal(lst:popl(), "1")
T.equal(lst:popl(), "0")
T.equal(lst:popl(), "b")
end
if included then
return function()
T["walk"] = walk
T["range"] = range
T["insert"] = insert
T["pop"] = pop
end
else
T["walk"] = walk
T["range"] = range
T["insert"] = insert
T["pop"] = pop
end
--[[
local round = 0
local push_mean = 0
local pop_mean = 0
local round = round + 1
io.write("-- performance, round:" .. round)
io.write("\n")
max_count = 1000 * 1000 * 10
o = os.clock()
for i = 50, max_count + 50, 1 do
lst:pushf(i)
end
t = os.clock() - o
push_mean = push_mean + t
print("push " .. max_count .. " cost " .. t)
o = os.clock()
while lst:count() > 0 do
lst:popl()
end
t = os.clock() - o
pop_mean = pop_mean + t
print("pop " .. max_count .. " cost " .. t)
]]
|
setenv("BAD_SYNTAX","1.0")
# This is not a comment.
|
local options = require('matchparen.options')
local hl = require('matchparen.highlight')
local nvim = require('matchparen.missinvim')
local fn = vim.fn
local opts = options.opts
local mp = {}
---Returns true when augroup with `name` exists
---@param name string
---@return boolean
local function augroup_exists(name)
return fn.exists('#' .. name) ~= 0
end
---Returns table created by splitting vim `matchpairs` option
---with opening brackets as keys and closing brackets as values
---@return table
local function split_matchpairs()
local t = {}
for _, pair in ipairs(vim.opt_local.matchpairs:get()) do
local left, right = pair:match('(.+):(.+)')
t[left] = right
end
return t
end
---Updates `matchpairs` opt only if it was changed,
---can be changed by buffer local option
local function update_matchpairs()
if opts.cached_matchpairs == vim.bo.matchpairs then
return
end
opts.cached_matchpairs = vim.bo.matchpairs
opts.matchpairs = {}
for l, r in pairs(split_matchpairs()) do
opts.matchpairs[l] = { left = l, right = r, backward = false }
opts.matchpairs[r] = { left = l, right = r, backward = true }
end
end
---Creates augroup and contained autocmds which are
---required for the plugin to work
local function create_autocmds()
if augroup_exists(opts.augroup_name) then return end
local group = nvim.create_augroup(opts.augroup_name, {})
local autocmd = function(event, callback, conf)
local config = { group = group, callback = callback }
if conf then
config = vim.tbl_extend('error', config, conf)
end
nvim.create_autocmd(event, config)
end
autocmd('InsertEnter', function() hl.update(true) end, {
desc = "Highlight matching pairs",
})
autocmd({ 'WinEnter', 'VimEnter' }, function() hl.update(false) end, {
desc = "Highlight matching pairs",
})
autocmd({ 'CursorMoved', 'CursorMovedI' }, function() hl.update(false) end, {
desc = "Highlight matching pairs",
})
autocmd({ 'TextChanged', 'TextChangedI' }, function() hl.update_on_tick() end, {
desc = "Update highlight only when tick has changed after CursorMoved autocmd",
})
autocmd({ 'WinLeave', 'BufLeave' }, function() hl.hide() end, {
desc = "Hide matching pairs highlight",
})
autocmd({ 'WinEnter', 'BufWinEnter', 'FileType' }, function() update_matchpairs() end, {
desc = "Update cache of matchpairs option",
})
autocmd('OptionSet', function() update_matchpairs() end, {
pattern = 'matchpairs',
desc = "Update cache of matchpairs option",
})
autocmd({ 'BufDelete', 'BufUnload' }, function(t) hl.clear_extmarks(t.buf) end, {
desc = "Make some cleanup",
})
end
---Delets plugins augroup and clears all it's autocmds
local function delete_autocmds()
if augroup_exists(opts.augroup_name) then
nvim.del_augroup_by_name(opts.augroup_name)
end
end
---Disables built in matchparen plugin
local function disable_builtin()
vim.g.loaded_matchparen = 1
if fn.exists(':NoMatchParen') ~= 0 then
nvim.command('NoMatchParen')
end
end
---Enables the plugin
local function enable()
create_autocmds()
update_matchpairs()
hl.update(false)
end
---Disables the plugin
local function disable()
delete_autocmds()
hl.hide()
end
---Creates plugin's custom commands
local function create_commands()
nvim.create_user_command('MatchParenEnable', enable, {})
nvim.create_user_command('MatchParenDisable', disable, {})
end
---Initializes the plugin
---@param config table
function mp.setup(config)
disable_builtin()
options.update(config)
update_matchpairs()
create_commands()
if opts.on_startup then
create_autocmds()
end
end
return mp
-- vim:sw=2:et
|
DesignStudio = class()
function DesignStudio:init(l, b, r, t)
-- boundary
self.frame = Frame(l, b, r, t)
-- textbox for name
self.tb = TextBox(self.frame:midX() - 160, b + 30, 200, "")
-- color selector & frame
self.colorFrame = Frame(150, 600, 260, 624)
self.showColorSlider = false
self.colorVCS = VColorSlider(self.colorFrame.left,
self.colorFrame.top)
-- side tabs
self.dishBtn = OpenBtn("Dish", self.frame.left,
self.frame.top - 80)
self.headBtn = OpenBtn("Head", self.frame.left,
self.frame.top - 115)
self.bodyBtn = OpenBtn("Body", self.frame.left,
self.frame.top - 150)
self.treadBtn = OpenBtn("Treads", self.frame.left,
self.frame.top - 185)
self.dishBtn.selected = true
-- catalog area
self.catalogFrame = Frame(120, 500, 750, 955)
-- selected item
self.selectRect = {}
self.selectRect[1] = Frame(120, 650, 320, 955 )
self.selectRect[2] = Frame(320, 650, 520, 955 )
self.selectRect[3] = Frame(520, 650, 720, 955 )
self.page = 1
end
function DesignStudio:drawDishes()
local x, y
x = self.selectRect[1]:midX()
y = self.selectRect[1]:midY() + 50
stroke(colors[self.bot.dishColor])
line(x - 5, y, x, y + 20)
line(x + 5, y, x, y + 20)
line(x - 30, y + 10, x - 20, y + 5)
line(x - 20, y + 5, x, y)
line(x + 30, y + 10, x + 20, y + 5)
line(x + 20, y + 5, x, y)
line(x, y + 20, x, y + 30)
ellipse(x, y + 20, 5)
fill(255, 255, 255, 255)
text("Laserator X-49", x, y + 50)
text("20m", x, y - 70)
text("100kw", x, y - 90)
text("10cycles", x, y - 110)
noFill()
x = self.selectRect[2]:midX()
y = self.selectRect[2]:midY() + 50
rect(x - 5, y, x + 5, y + 25)
line(x - 20, y, x, y)
line(x + 20, y, x, y)
line(x - 30, y + 15, x, y)
line(x + 30, y + 15, x, y)
fill(255, 255, 255, 255)
text("Thumperator Max", x, y + 50)
text("7m", x, y - 70)
text("250kw", x, y - 90)
text("15cycles", x, y - 110)
noFill()
x = self.selectRect[3]:midX()
y = self.selectRect[3]:midY() + 50
line(x - 20, y, x + 20, y)
line(x - 15, y + 5, x + 15, y + 5)
line(x - 10, y + 10, x + 10, y + 10)
line(x - 5, y + 15, x + 5, y + 15)
line(x, y, x, y + 30)
ellipse(x, y + 35, 10)
fill(255, 255, 255, 255)
text("Zapmaster 1000", x, y + 50)
text("3m", x, y - 70)
text("500kw", x, y - 90)
text("15cycles", x, y - 110)
fill(colors[self.bot.dishColor])
self.colorFrame:draw()
textMode(CORNER)
fill(255, 255, 255, 255)
text("Dish units include both radar and weaponry.", 300, 625)
text("Some units have a long range, but cause ", 300, 600)
text("light damage. Others deliver a harder blow ", 300, 575)
text("but can only do so at short range.", 300, 550)
stroke(201, 201, 201, 255)
x = self.selectRect[self.bot.dish].left + 20
y = self.selectRect[self.bot.dish].bottom + 85
line(x, y, x, y + 175)
line(x - 5, y, x + 5, y)
line(x - 5, y + 175, x + 5, y + 175)
line(x + 10, y - 20, x + 40, y - 20)
line(x + 125, y - 20, x + 160, y - 20)
line(x + 10, y - 25, x + 10, y - 15)
line(x + 160, y - 25, x + 160, y - 15)
fill(209, 209, 209, 255)
text("Selected", x + 45, y - 30)
end
function DesignStudio:drawHeads()
local x, y
x = self.selectRect[1]:midX()
y = self.selectRect[1]:midY() + 50
stroke(colors[self.bot.headColor])
ellipse(x, y, 30)
rect(x - 15, y - 5, x - 13, y + 5)
rect(x + 15, y - 5, x + 13, y + 5)
line(x - 15, y, x - 20, y)
line(x + 15, y, x + 20, y)
fill(255, 255, 255, 255)
text("Cool Bean", x, y + 50)
text("10hds", x, y - 70)
text("0.0 shield", x, y - 90)
noFill()
x = self.selectRect[2]:midX()
y = self.selectRect[2]:midY() + 50
ellipse(x, y, 30)
ellipse(x, y, 25)
line(x+5,y+5,x-5,y-5)
line(x+5,y-5,x-5,y+5)
fill(255, 255, 255, 255)
text("Bubble Boyo", x, y + 50)
text("3hds", x, y - 70)
text("3.5 shield", x, y - 90)
noFill()
x = self.selectRect[3]:midX()
y = self.selectRect[3]:midY() + 50
ellipse(x, y, 30)
ellipse(x, y + 10, 25, 10)
ellipse(x, y + 15, 15, 5)
line(x - 15, y - 5, x - 25, y - 15)
line(x + 15, y - 5, x + 25, y - 15)
fill(255, 255, 255, 255)
text("Headvantage", x, y + 50)
text("1hds", x, y - 70)
text("5.5 shield", x, y - 90)
textMode(CORNER)
fill(255, 255, 255, 255)
text("Head units both generate shields and help to ", 300, 625)
text("automatically repair bots when damaged. Those ", 300, 600)
text("units that provide the best shields are slow", 300, 575)
text("at repairs, while the best repair units have", 300, 550)
text("weak shields.", 300, 525)
fill(colors[self.bot.headColor])
self.colorFrame:draw()
stroke(201, 201, 201, 255)
x = self.selectRect[self.bot.head].left + 20
y = self.selectRect[self.bot.head].bottom + 85
line(x, y, x, y + 175)
line(x - 5, y, x + 5, y)
line(x - 5, y + 175, x + 5, y + 175)
line(x + 10, y - 20, x + 40, y - 20)
line(x + 125, y - 20, x + 160, y - 20)
line(x + 10, y - 25, x + 10, y - 15)
line(x + 160, y - 25, x + 160, y - 15)
fill(209, 209, 209, 255)
text("Selected", x + 45, y - 30)
end
function DesignStudio:drawTreads()
local i, x, y
x = self.selectRect[1]:midX()
y = self.selectRect[1]:midY() + 50
stroke(colors[self.bot.treadColor])
ellipse(x + 20,y -20, 20)
ellipse(x + 20, y -20, 20, 5)
ellipse(x-20, y-20, 20)
ellipse(x-20, y-20, 20, 5)
ellipse(x-20, y+20, 20)
ellipse(x-20, y+20, 20, 5)
ellipse(x+20, y+20, 20)
ellipse(x+20, y+20, 20, 5)
line(x-20, y-11, x, y)
line(x-17, y-14, x, y)
line(x+20, y-11, x, y)
line(x+17, y-14, x, y)
line(x-20, y+11, x, y)
line(x-17, y+14, x, y)
line(x+20, y+11, x, y)
line(x+17, y+14, x, y)
fill(255, 255, 255, 255)
text("Spinomatic", x, y + 50)
text("90dpc", x, y - 70)
text("10kph", x, y - 90)
noFill()
x = self.selectRect[2]:midX()
y = self.selectRect[2]:midY() + 50
rect(x - 15, y - 2, x + 15, y + 2)
ellipse(x, y - 4, 15)
line(x - 15, y - 10, x + 15, y - 10)
rect(x - 30, y - 30, x - 15, y + 30)
rect(x + 15, y - 30, x + 30, y + 30)
for i = 0,7 do
line(x + 15, y - 30 + i * 8, x + 30, y - 30 + i * 8)
line(x - 30, y - 30 + i * 8, x - 15, y - 30 + i * 8)
end
fill(255, 255, 255, 255)
text("Tanktrak T11", x, y + 50)
text("45dpc", x, y - 70)
text("25kph", x, y - 90)
noFill()
x = self.selectRect[3]:midX()
y = self.selectRect[3]:midY() + 50
rect(x - 30, y + 10, x - 20, y + 30)
rect(x + 20, y + 10, x + 30, y + 30)
rect(x - 30, y - 30, x - 20, y - 10)
rect(x + 20, y - 30, x + 30, y - 10)
ellipse(x - 25, y + 20, 15, 25)
ellipse(x - 25, y - 20, 15, 25)
ellipse(x + 25, y + 20, 15, 25)
ellipse(x + 25, y - 20, 15, 25)
rect(x - 20, y - 22, x + 20, y - 16)
rect(x - 20, y + 22, x + 20, y + 16)
fill(255, 255, 255, 255)
text("Hard Wheelz", x, y + 50)
text("15dpc", x, y - 70)
text("50kph", x, y - 90)
textMode(CORNER)
fill(255, 255, 255, 255)
text("Treads provide the means for bots to move ", 300, 625)
text("around the arena. Some units are capable of ", 300, 600)
text("turning rapidly, but are slow getting from ", 300, 575)
text("A to B. Other systems sacrifice agility for", 300, 550)
text("raw speed.", 300, 525)
fill(colors[self.bot.treadColor])
self.colorFrame:draw()
stroke(201, 201, 201, 255)
x = self.selectRect[self.bot.tread].left + 20
y = self.selectRect[self.bot.tread].bottom + 85
line(x, y, x, y + 175)
line(x - 5, y, x + 5, y)
line(x - 5, y + 175, x + 5, y + 175)
line(x + 10, y - 20, x + 40, y - 20)
line(x + 125, y - 20, x + 160, y - 20)
line(x + 10, y - 25, x + 10, y - 15)
line(x + 160, y - 25, x + 160, y - 15)
fill(209, 209, 209, 255)
text("Selected", x + 45, y - 30)
end
function DesignStudio:drawBodies()
local x, y
x = self.selectRect[1]:midX()
y = self.selectRect[1]:midY() + 50
stroke(colors[self.bot.bodyColor])
ellipse(x - 20, y, 15, 15)
ellipse(x + 20, y, 15, 15)
fill(25, 27, 46, 255)
ellipse(x, y, 40, 20)
fill(255, 255, 255, 255)
text("LightWay C", x, y + 50)
text("10mm", x, y - 70)
text("47kg", x, y - 90)
fill(25, 27, 46, 255)
x = self.selectRect[2]:midX()
y = self.selectRect[2]:midY() + 50
rect(x - 25, y - 10, x + 25, y + 10)
ellipse(x - 25, y, 20)
ellipse(x + 25, y, 20)
rect(x - 15, y - 15, x + 15, y - 10)
fill(255, 255, 255, 255)
text("Steel Trunk", x, y + 50)
text("20mm", x, y - 70)
text("90kg", x, y - 90)
fill(25, 27, 46, 255)
x = self.selectRect[3]:midX()
y = self.selectRect[3]:midY() + 50
ellipse(x - 20, y, 30, 30)
ellipse(x + 20, y, 30, 30)
rect(x - 20, y - 15, x + 20, y + 15)
ellipse(x, y, 40, 30)
fill(255, 255, 255, 255)
text("ToughBugger II", x, y + 50)
text("50mm", x, y - 70)
text("250kg", x, y - 90)
textMode(CORNER)
fill(255, 255, 255, 255)
text("Body units protect the bot from damage and ", 300, 625)
text("allow it to absorb more blows before failing. ", 300, 600)
text("However, as armor increases in weight, it ", 300, 575)
text("reduces both the speed of movement and of", 300, 550)
text("turning.", 300, 525)
fill(colors[self.bot.bodyColor])
self.colorFrame:draw()
stroke(201, 201, 201, 255)
x = self.selectRect[self.bot.body].left + 20
y = self.selectRect[self.bot.body].bottom + 85
line(x, y, x, y + 175)
line(x - 5, y, x + 5, y)
line(x - 5, y + 175, x + 5, y + 175)
line(x + 10, y - 20, x + 40, y - 20)
line(x + 125, y - 20, x + 160, y - 20)
line(x + 10, y - 25, x + 10, y - 15)
line(x + 160, y - 25, x + 160, y - 15)
fill(201, 201, 201, 255)
text("Selected", x + 45, y - 30)
end
function DesignStudio:setBot(bot)
self.bot = bot
self.tb.text = self.bot.name
end
function DesignStudio:draw()
pushMatrix()
fontSize(18)
noFill()
stroke(255, 255, 255, 255)
strokeWidth(2)
stroke(0, 38, 255, 255)
strokeWidth(2)
fill(185, 185, 185, 113)
self.tb:draw()
fill(255, 255, 255, 255)
text("Color", self.colorFrame.left, self.colorFrame.top)
fontSize(24)
text("Design Studio", self.frame.left + 120, self.frame.top - 35)
fill(colors[self.bot.dishColor])
self.colorFrame:draw()
noFill()
stroke(255, 255, 255, 255)
strokeWidth(2)
self.catalogFrame:draw()
rect(self.catalogFrame.left, self.catalogFrame.top,
self.catalogFrame.right, self.catalogFrame.top + 50)
rect(self.catalogFrame.left, self.catalogFrame.bottom - 90,
self.catalogFrame.right, self.catalogFrame.bottom)
if self.dishShowSlider then self.dishVCS:draw() end
if self.headShowSlider then self.headVCS:draw() end
if self.bodyShowSlider then self.bodyVCS:draw() end
if self.treadShowSlider then self.treadVCS:draw() end
translate(self.frame:midX()+ 90 , self.frame:height() - 170)
self.bot.x = 0
self.bot.y = 0
self.bot:draw(1)
popMatrix()
self.headBtn:draw()
self.dishBtn:draw()
self.bodyBtn:draw()
self.treadBtn:draw()
fontSize(16)
textMode(CENTER)
strokeWidth(1.1)
if self.page == 1 then
self:drawDishes()
end
if self.page == 2 then
self:drawHeads()
end
if self.page == 3 then
self:drawBodies()
end
if self.page == 4 then
self:drawTreads()
end
if self.showColorSlider then
self.colorVCS:draw()
end
end
function DesignStudio:clearSelected()
self.dishBtn.selected = false
self.headBtn.selected = false
self.bodyBtn.selected = false
self.treadBtn.selected = false
end
function DesignStudio:touched(touch)
local i
self.bot.name = self.tb.text
if self.colorFrame:touched(touch) then
self.showColorSlider = true
end
if self.showColorSlider then
if self.colorVCS:touched(touch) then
if self.page == 1 then
self.bot.dishColor = self.colorVCS.selected
end
if self.page == 2 then
self.bot.headColor = self.colorVCS.selected
end
if self.page == 3 then
self.bot.bodyColor = self.colorVCS.selected
end
if self.page == 4 then
self.bot.treadColor = self.colorVCS.selected
end
end
end
if self.dishBtn:touched(touch) then
self.page = 1
self:clearSelected()
self.dishBtn.selected = true
end
if self.headBtn:touched(touch) then
self.page = 2
self:clearSelected()
self.headBtn.selected = true
end
if self.bodyBtn:touched(touch) then
self.page = 3
self:clearSelected()
self.bodyBtn.selected = true
end
if self.treadBtn:touched(touch) then
self.page = 4
self:clearSelected()
self.treadBtn.selected = true
end
for i = 1,3 do
if self.selectRect[i]:touched(touch) then
sound(SOUND_SHOOT, 46433)
if self.page == 1 then self.bot.dish = i end
if self.page == 2 then self.bot.head = i end
if self.page == 3 then self.bot.body = i end
if self.page == 4 then self.bot.tread = i end
end
end
end
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('BceBattleReward_pb', package.seeall)
local BCEBATTLEREWARD = protobuf.Descriptor();
local BCEBATTLEREWARD_SLOT_FIELD = protobuf.FieldDescriptor();
BCEBATTLEREWARD_SLOT_FIELD.name = "slot"
BCEBATTLEREWARD_SLOT_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BceBattleReward.slot"
BCEBATTLEREWARD_SLOT_FIELD.number = 1
BCEBATTLEREWARD_SLOT_FIELD.index = 0
BCEBATTLEREWARD_SLOT_FIELD.label = 1
BCEBATTLEREWARD_SLOT_FIELD.has_default_value = false
BCEBATTLEREWARD_SLOT_FIELD.default_value = 0
BCEBATTLEREWARD_SLOT_FIELD.type = 5
BCEBATTLEREWARD_SLOT_FIELD.cpp_type = 1
BCEBATTLEREWARD.name = "BceBattleReward"
BCEBATTLEREWARD.full_name = ".com.xinqihd.sns.gameserver.proto.BceBattleReward"
BCEBATTLEREWARD.nested_types = {}
BCEBATTLEREWARD.enum_types = {}
BCEBATTLEREWARD.fields = {BCEBATTLEREWARD_SLOT_FIELD}
BCEBATTLEREWARD.is_extendable = false
BCEBATTLEREWARD.extensions = {}
BceBattleReward = protobuf.Message(BCEBATTLEREWARD)
_G.BCEBATTLEREWARD_PB_BCEBATTLEREWARD = BCEBATTLEREWARD
|
local count_of_start = cache:get("key")
if not(count_of_start) then count_of_start = 1 end
function collect()
time.sleep(1)
if count_of_start == 1 then
cache:set("key", count_of_start+1)
error("first error")
end
if count_of_start == 2 then
error("must not be this error")
end
cache:set("key", count_of_start+1)
end
run_every(collect, 10) |
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:26' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC.
****************************************************************************
]]
-----------------
--Guild Roster
-----------------
local ZO_KeyboardGuildRosterManager = ZO_SocialListKeyboard:Subclass()
function ZO_KeyboardGuildRosterManager:New(...)
return ZO_SocialListKeyboard.New(self, ...)
end
function ZO_KeyboardGuildRosterManager:Initialize(control)
ZO_SocialListKeyboard.Initialize(self, control)
control:SetHandler("OnEffectivelyHidden", function() self:OnEffectivelyHidden() end)
self:SetEmptyText(GetString(SI_SORT_FILTER_LIST_NO_RESULTS))
ZO_ScrollList_AddDataType(self.list, GUILD_MEMBER_DATA, "ZO_KeyboardGuildRosterRow", 30, function(rowControl, data) self:SetupRow(rowControl, data) end)
ZO_ScrollList_EnableHighlight(self.list, "ZO_ThinListHighlight")
self.searchBox = GetControl(control, "SearchBox")
self.searchBox:SetHandler("OnTextChanged", function() self:OnSearchTextChanged() end)
self.sortFunction = function(listEntry1, listEntry2) return self:CompareGuildMembers(listEntry1, listEntry2) end
self.sortHeaderGroup:SelectHeaderByKey("status")
self.hideOfflineCheckBox = GetControl(control, "HideOffline")
GUILD_ROSTER_SCENE = ZO_Scene:New("guildRoster", SCENE_MANAGER)
GUILD_ROSTER_SCENE:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_SHOWING then
self:PerformDeferredInitialization()
KEYBIND_STRIP:AddKeybindButtonGroup(self.keybindStripDescriptor)
self:UpdateHideOfflineCheckBox(self.hideOfflineCheckBox)
elseif newState == SCENE_HIDDEN then
KEYBIND_STRIP:RemoveKeybindButtonGroup(self.keybindStripDescriptor)
end
end)
GUILD_ROSTER_FRAGMENT = ZO_FadeSceneFragment:New(control)
self:InitializeDirtyLogic(GUILD_ROSTER_FRAGMENT)
GUILD_ROSTER_MANAGER:AddList(self)
end
function ZO_KeyboardGuildRosterManager:PerformDeferredInitialization()
if self.keybindStripDescriptor then return end
self:RefreshData()
self:InitializeKeybindDescriptor()
end
function ZO_KeyboardGuildRosterManager:InitializeKeybindDescriptor()
self.keybindStripDescriptor =
{
-- Invite
{
alignment = KEYBIND_STRIP_ALIGN_CENTER,
name = GetString(SI_GUILD_INVITE_ACTION),
keybind = "UI_SHORTCUT_PRIMARY",
callback = function()
local guildId = GUILD_ROSTER_MANAGER:GetGuildId()
local name = GetGuildName(guildId)
ZO_Dialogs_ShowDialog("GUILD_INVITE", guildId, {mainTextParams = {name}})
end,
enabled = function()
local numMembers, _, _, numInvitees = GetGuildInfo(GUILD_ROSTER_MANAGER:GetGuildId())
local totalPlayers = numMembers + numInvitees
if totalPlayers >= MAX_GUILD_MEMBERS then
return false, GetString("SI_SOCIALACTIONRESULT", SOCIAL_RESULT_GUILD_IS_FULL)
end
return true
end,
visible = function()
return DoesPlayerHaveGuildPermission(GUILD_ROSTER_MANAGER:GetGuildId(), GUILD_PERMISSION_INVITE)
end
},
-- Whisper
{
alignment = KEYBIND_STRIP_ALIGN_RIGHT,
name = GetString(SI_SOCIAL_LIST_PANEL_WHISPER),
keybind = "UI_SHORTCUT_SECONDARY",
callback = function()
local data = ZO_ScrollList_GetData(self.mouseOverRow)
StartChatInput("", CHAT_CHANNEL_WHISPER, data.displayName)
end,
visible = function()
if(self.mouseOverRow and IsChatSystemAvailableForCurrentPlatform()) then
local data = ZO_ScrollList_GetData(self.mouseOverRow)
return data.hasCharacter and data.online and not data.isLocalPlayer
end
return false
end
},
-- Invite to Group
{
alignment = KEYBIND_STRIP_ALIGN_RIGHT,
name = GetString(SI_FRIENDS_LIST_PANEL_INVITE),
keybind = "UI_SHORTCUT_TERTIARY",
callback = function()
local data = ZO_ScrollList_GetData(self.mouseOverRow)
local NOT_SENT_FROM_CHAT = false
local DISPLAY_INVITED_MESSAGE = true
TryGroupInviteByName(data.characterName, NOT_SENT_FROM_CHAT, DISPLAY_INVITED_MESSAGE)
end,
visible = function()
if IsGroupModificationAvailable() and self.mouseOverRow then
local data = ZO_ScrollList_GetData(self.mouseOverRow)
if data.hasCharacter and data.online and not data.isLocalPlayer and data.rankId ~= DEFAULT_INVITED_RANK then
return true
end
end
return false
end
},
-- Set Rank
{
alignment = KEYBIND_STRIP_ALIGN_LEFT,
name = GetString(SI_GUILD_SET_RANK),
keybind = "UI_SHORTCUT_QUATERNARY",
callback = function()
local data = ZO_ScrollList_GetData(self.mouseOverRow)
local guildId = GUILD_ROSTER_MANAGER:GetGuildId()
local masterList = GUILD_ROSTER_MANAGER:GetMasterList()
local playerIndex = GetPlayerGuildMemberIndex(guildId)
local playerData = masterList[playerIndex]
ZO_Dialogs_ShowDialog("GUILD_SET_RANK_KEYBOARD", { guildId = guildId, targetData = data, playerData = playerData })
end,
visible = function()
if self.mouseOverRow then
local data = ZO_ScrollList_GetData(self.mouseOverRow)
local guildId = GUILD_ROSTER_MANAGER:GetGuildId()
local masterList = GUILD_ROSTER_MANAGER:GetMasterList()
local playerIndex = GetPlayerGuildMemberIndex(guildId)
local playerData = masterList[playerIndex]
return ZO_GuildRosterManager.CanSetPlayerRank(guildId, playerData.rankIndex, data.rankIndex, data.rankId)
end
return false
end
},
}
end
function ZO_KeyboardGuildRosterManager:OnGuildIdChanged(guildId)
self.searchBox:SetText("")
self.searchBox:LoseFocus()
self:UpdateKeybinds()
end
function ZO_KeyboardGuildRosterManager:BuildMasterList()
-- The master list lives in the GUILD_ROSTER_MANAGER and is built there
end
function ZO_KeyboardGuildRosterManager:FilterScrollList()
local scrollData = ZO_ScrollList_GetDataList(self.list)
ZO_ClearNumericallyIndexedTable(scrollData)
local searchTerm = self.searchBox:GetText()
local hideOffline = GetSetting_Bool(SETTING_TYPE_UI, UI_SETTING_SOCIAL_LIST_HIDE_OFFLINE)
local masterList = GUILD_ROSTER_MANAGER:GetMasterList()
for i = 1, #masterList do
local data = masterList[i]
if searchTerm == "" or GUILD_ROSTER_MANAGER:IsMatch(searchTerm, data) then
if not hideOffline or data.online or data.rankId == DEFAULT_INVITED_RANK then
table.insert(scrollData, ZO_ScrollList_CreateDataEntry(GUILD_MEMBER_DATA, data))
end
end
end
end
function ZO_KeyboardGuildRosterManager:CompareGuildMembers(listEntry1, listEntry2)
return ZO_TableOrderingFunction(listEntry1.data, listEntry2.data, self.currentSortKey, GUILD_ROSTER_ENTRY_SORT_KEYS, self.currentSortOrder)
end
function ZO_KeyboardGuildRosterManager:SortScrollList()
if(self.currentSortKey ~= nil and self.currentSortOrder ~= nil) then
local scrollData = ZO_ScrollList_GetDataList(self.list)
table.sort(scrollData, self.sortFunction)
end
end
function ZO_KeyboardGuildRosterManager:ColorRow(control, data, selected)
local textColor, iconColor = self:GetRowColors(data, selected)
GUILD_ROSTER_MANAGER:ColorRow(control, data, textColor, iconColor, textColor)
end
function ZO_KeyboardGuildRosterManager:SetupRow(control, data)
ZO_SortFilterList.SetupRow(self, control, data)
GUILD_ROSTER_MANAGER:SetupEntry(control, data)
end
function ZO_KeyboardGuildRosterManager:UnlockSelection()
ZO_SortFilterList.UnlockSelection(self)
self:RefreshVisible()
end
function ZO_KeyboardGuildRosterManager:ShowPromoteToGuildMasterDialog(guildId, currentRankIndex, targetDisplayName)
local guildAlliance = GUILD_ROSTER_MANAGER:GetGuildAlliance()
local guildName = GUILD_ROSTER_MANAGER:GetGuildName()
local allianceIcon = zo_iconFormat(GetAllianceSymbolIcon(guildAlliance), "100%", "100%")
local rankName = GetFinalGuildRankName(guildId, currentRankIndex)
ZO_Dialogs_ShowDialog("PROMOTE_TO_GUILDMASTER", { guildId = guildId, displayName = targetDisplayName}, { mainTextParams = { targetDisplayName, allianceIcon, guildName, rankName }})
end
--Events
---------
function ZO_KeyboardGuildRosterManager:OnEffectivelyHidden()
ClearMenu()
end
function ZO_KeyboardGuildRosterManager:OnSearchTextChanged()
ZO_EditDefaultText_OnTextChanged(self.searchBox)
self:RefreshFilters()
end
function ZO_KeyboardGuildRosterManager:GuildRosterRow_OnMouseUp(control, button, upInside)
if button == MOUSE_BUTTON_INDEX_RIGHT and upInside then
ClearMenu()
local data = ZO_ScrollList_GetData(control)
if data then
local guildId = GUILD_ROSTER_MANAGER:GetGuildId()
local guildName = GUILD_ROSTER_MANAGER:GetGuildName()
local guildAlliance = GUILD_ROSTER_MANAGER:GetGuildAlliance()
local dataIndex = data.index
local playerIndex = GetPlayerGuildMemberIndex(guildId)
local masterList = GUILD_ROSTER_MANAGER:GetMasterList()
local playerData = masterList[playerIndex]
local playerHasHigherRank = playerData.rankIndex < data.rankIndex
local playerIsPendingInvite = data.rankId == DEFAULT_INVITED_RANK
if ZO_GuildRosterManager.CanPromotePlayer(guildId, playerData.rankIndex, data.rankIndex, data.rankId) then
local newRankIndex = data.rankIndex - 1
if playerData.rankIndex < newRankIndex then
AddMenuItem(GetString(SI_GUILD_PROMOTE),
function()
GuildPromote(guildId, data.displayName)
PlaySound(SOUNDS.GUILD_ROSTER_PROMOTE)
end)
elseif IsGuildRankGuildMaster(guildId, playerData.rankIndex) then
AddMenuItem(GetString(SI_GUILD_PROMOTE),
function()
local allianceIcon = zo_iconFormat(GetAllianceSymbolIcon(guildAlliance), ALLIANCE_ICON_SIZE, ALLIANCE_ICON_SIZE)
local rankName = GetFinalGuildRankName(guildId, 2)
ZO_Dialogs_ShowDialog("PROMOTE_TO_GUILDMASTER", { guildId = guildId, displayName = data.displayName}, { mainTextParams = { data.displayName, allianceIcon, guildName, rankName }})
end)
end
end
if ZO_GuildRosterManager.CanDemotePlayer(guildId, playerData.rankIndex, data.rankIndex, data.rankId) then
AddMenuItem(GetString(SI_GUILD_DEMOTE),
function()
GuildDemote(guildId, data.displayName)
PlaySound(SOUNDS.GUILD_ROSTER_DEMOTE)
end)
end
if ZO_GuildRosterManager.CanSetPlayerRank(guildId, playerData.rankIndex, data.rankIndex, data.rankId) then
AddMenuItem(GetString(SI_GUILD_SET_RANK),
function()
ZO_Dialogs_ShowDialog("GUILD_SET_RANK_KEYBOARD", { guildId = guildId, targetData = data, playerData = playerData })
end)
end
if DoesPlayerHaveGuildPermission(guildId, GUILD_PERMISSION_REMOVE) then
if playerIsPendingInvite then
local allianceIcon = zo_iconFormat(GetAllianceSymbolIcon(guildAlliance), "100%", "100%")
AddMenuItem(GetString(SI_GUILD_UNINVITE), function()
ZO_Dialogs_ShowDialog("UNINVITE_GUILD_PLAYER", { guildId = guildId, displayName = data.displayName }, { mainTextParams = { data.displayName, allianceIcon, guildName } })
end)
else
if playerHasHigherRank and playerIndex ~= dataIndex then
AddMenuItem(GetString(SI_GUILD_REMOVE), function()
ZO_Dialogs_ShowDialog("GUILD_REMOVE_MEMBER_KEYBOARD", { guildId = guildId, displayName = data.displayName }, { mainTextParams = { data.displayName } })
end)
end
end
end
if DoesPlayerHaveGuildPermission(guildId, GUILD_PERMISSION_NOTE_EDIT) and not playerIsPendingInvite then
AddMenuItem(GetString(SI_SOCIAL_MENU_EDIT_NOTE), function()
ZO_Dialogs_ShowDialog("EDIT_NOTE", {displayName = data.displayName, note = data.note, changedCallback = GUILD_ROSTER_MANAGER:GetNoteEditedFunction()})
end)
end
if dataIndex == playerIndex then
ZO_AddLeaveGuildMenuItem(guildId)
elseif not playerIsPendingInvite then
if data.hasCharacter and data.online then
if IsChatSystemAvailableForCurrentPlatform() then
AddMenuItem(GetString(SI_SOCIAL_LIST_SEND_MESSAGE), function() StartChatInput("", CHAT_CHANNEL_WHISPER, data.displayName) end)
end
if IsGroupModificationAvailable() then
AddMenuItem(GetString(SI_SOCIAL_MENU_INVITE), function()
local NOT_SENT_FROM_CHAT = false
local DISPLAY_INVITED_MESSAGE = true
TryGroupInviteByName(data.characterName, NOT_SENT_FROM_CHAT, DISPLAY_INVITED_MESSAGE)
end)
end
AddMenuItem(GetString(SI_SOCIAL_MENU_JUMP_TO_PLAYER), function() JumpToGuildMember(data.displayName) end)
end
AddMenuItem(GetString(SI_SOCIAL_MENU_VISIT_HOUSE), function() JumpToHouse(data.displayName) end)
AddMenuItem(GetString(SI_SOCIAL_MENU_SEND_MAIL), function() MAIL_SEND:ComposeMailTo(data.displayName) end)
if not IsFriend(data.displayName) then
AddMenuItem(GetString(SI_SOCIAL_MENU_ADD_FRIEND), function() ZO_Dialogs_ShowDialog("REQUEST_FRIEND", {name = data.displayName}) end)
end
end
self:ShowMenu(control)
end
end
end
function ZO_KeyboardGuildRosterManager:GuildRosterRowRank_OnMouseEnter(control)
local row = control:GetParent()
local data = ZO_ScrollList_GetData(row)
if(data.rankIndex) then
InitializeTooltip(InformationTooltip, control, BOTTOM, 0, 0)
SetTooltipText(InformationTooltip, GetFinalGuildRankName(GUILD_ROSTER_MANAGER:GetGuildId(), data.rankIndex))
end
self:EnterRow(row)
end
function ZO_KeyboardGuildRosterManager:GuildRosterRowRank_OnMouseExit(control)
ClearTooltip(InformationTooltip)
self:ExitRow(control:GetParent())
end
function ZO_KeyboardGuildRosterManager:SetRankDialogRank(rankIndex)
local rank = self.setRankDialogRankControlPool:GetActiveObject(rankIndex)
if rank then
self.setRankDialogRadioButtonGroup:SetClickedButton(rank:GetNamedChild("Button"))
end
end
function ZO_KeyboardGuildRosterManager:OnSetRankDialogInitialized(control)
local SELECTED_BIND_ALPHA = 1
local DESELECTED_BIND_ALPHA = 0.5
local radioButtonContainer = control:GetNamedChild("Buttons")
self.setRankDialogRankControlPool = ZO_ControlPool:New("ZO_GuildSetRankDialogRank_Keyboard", radioButtonContainer)
self.setRankDialogRadioButtonGroup = ZO_RadioButtonGroup:New()
self.setRankDialogRadioButtonGroup:SetSelectionChangedCallback(function(group, control, previousControl)
if control then
control:GetParent():GetNamedChild("Bind"):SetAlpha(SELECTED_BIND_ALPHA)
end
if previousControl then
previousControl:GetParent():GetNamedChild("Bind"):SetAlpha(DESELECTED_BIND_ALPHA)
end
end)
ZO_PostHookHandler(control, "OnEffectivelyShown", function() PushActionLayerByName("SetGuildRankDialog") end)
ZO_PreHookHandler(control, "OnEffectivelyHidden", function() RemoveActionLayerByName("SetGuildRankDialog") end)
ZO_Dialogs_RegisterCustomDialog("GUILD_SET_RANK_KEYBOARD",
{
title =
{
text = SI_GUILD_SET_RANK_DIALOG_TITLE,
},
mainText =
{
text = function(dialog)
return dialog.data.targetData.displayName
end
},
customControl = control,
setup = function(dialog, data)
EVENT_MANAGER:RegisterForEvent("SetRankDialogKeyboard", EVENT_GUILD_MEMBER_RANK_CHANGED, function(_, guildId, displayName)
if guildId == data.guildId and displayName == data.targetData.displayName or displayName == data.playerData.displayName then
ZO_Dialogs_ReleaseDialog("GUILD_SET_RANK_KEYBOARD")
end
end)
EVENT_MANAGER:RegisterForEvent("SetRankDialogKeyboard", EVENT_GUILD_RANK_CHANGED, function(_, guildId)
if guildId == data.guildId then
ZO_Dialogs_ReleaseDialog("GUILD_SET_RANK_KEYBOARD")
end
end)
self.setRankDialogRadioButtonGroup:Clear()
self.setRankDialogRankControlPool:ReleaseAllObjects()
local targetRankIndex = data.targetData.rankIndex
local IS_KEYBOARD = false
local entries = ZO_GuildRosterManager.ComputeSetRankEntries(data.guildId, data.playerData.rankIndex, targetRankIndex, IS_KEYBOARD)
local previousControl
local INHERIT_COLOR = true
for rankIndex, entry in ipairs(entries) do
local rank = self.setRankDialogRankControlPool:AcquireObject()
local rankButton = rank:GetNamedChild("Button")
rankButton.rankIndex = rankIndex
rankButton.label:SetText(zo_iconTextFormat(entry.rankIcon, "100%", "100%", entry.rankName, INHERIT_COLOR))
local rankBind = rank:GetNamedChild("Bind")
ZO_KeyMarkupLabel_SetCustomOffsets(rankBind, -5, 5, -2, 3)
local keyMarkup = ZO_Keybindings_GetBindingStringFromAction("SET_GUILD_RANK_"..rankIndex, KEYBIND_TEXT_OPTIONS_FULL_NAME, KEYBIND_TEXTURE_OPTIONS_EMBED_MARKUP)
rankBind:SetText(keyMarkup)
if previousControl then
rank:SetAnchor(TOPLEFT, previousControl, BOTTOMLEFT, 0, 5)
else
rank:SetAnchor(TOPLEFT, nil, TOPLEFT, 0, 0)
end
self.setRankDialogRadioButtonGroup:Add(rankButton)
self.setRankDialogRadioButtonGroup:SetButtonIsValidOption(rankButton, entry.enabled)
previousControl = rank
if rankIndex == targetRankIndex then
self.setRankDialogRadioButtonGroup:SetClickedButton(rankButton)
rankBind:SetAlpha(SELECTED_BIND_ALPHA)
else
rankBind:SetAlpha(DESELECTED_BIND_ALPHA)
end
end
end,
finishedCallback = function(dialog)
EVENT_MANAGER:UnregisterForEvent("SetRankDialogKeyboard", EVENT_GUILD_MEMBER_RANK_CHANGED)
EVENT_MANAGER:UnregisterForEvent("SetRankDialogKeyboard", EVENT_GUILD_RANK_CHANGED)
end,
buttons =
{
-- Confirm Button
{
control = control:GetNamedChild("Confirm"),
keybind = "DIALOG_PRIMARY",
text = GetString(SI_DIALOG_ACCEPT),
callback = function(dialog)
local data = dialog.data
local newRankIndex = self.setRankDialogRadioButtonGroup:GetClickedButton().rankIndex
if newRankIndex ~= data.targetData.rankIndex then
if newRankIndex == 1 then
self:ShowPromoteToGuildMasterDialog(data.guildId, data.targetData.rankIndex, data.targetData.displayName)
else
if newRankIndex < data.targetData.rankIndex then
PlaySound(SOUNDS.GUILD_ROSTER_PROMOTE)
else
PlaySound(SOUNDS.GUILD_ROSTER_DEMOTE)
end
GuildSetRank(data.guildId, data.targetData.displayName, newRankIndex)
end
end
end,
},
-- Cancel Button
{
control = control:GetNamedChild("Cancel"),
keybind = "DIALOG_NEGATIVE",
text = GetString(SI_DIALOG_CANCEL),
},
},
})
end
--Global XML
---------------
function ZO_KeyboardGuildRosterRow_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Row_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRow_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Row_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRow_OnMouseUp(control, button, upInside)
GUILD_ROSTER_KEYBOARD:GuildRosterRow_OnMouseUp(control, button, upInside)
end
function ZO_KeyboardGuildRosterRowNote_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Note_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowNote_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Note_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowNote_OnClicked(control)
GUILD_ROSTER_KEYBOARD:Note_OnClicked(control, GUILD_ROSTER_MANAGER:GetNoteEditedFunction())
end
function ZO_KeyboardGuildRosterRowDisplayName_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:DisplayName_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowDisplayName_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:DisplayName_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowAlliance_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Alliance_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowAlliance_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Alliance_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowStatus_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Status_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowStatus_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Status_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowClass_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Class_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowClass_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Class_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowChampion_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:Champion_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowChampion_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:Champion_OnMouseExit(control)
end
function ZO_KeyboardGuildRosterRowRank_OnMouseEnter(control)
GUILD_ROSTER_KEYBOARD:GuildRosterRowRank_OnMouseEnter(control)
end
function ZO_KeyboardGuildRosterRowRank_OnMouseExit(control)
GUILD_ROSTER_KEYBOARD:GuildRosterRowRank_OnMouseExit(control)
end
function ZO_KeyboardGuildRoster_OnInitialized(control)
GUILD_ROSTER_KEYBOARD = ZO_KeyboardGuildRosterManager:New(control)
end
function ZO_KeyboardGuildRoster_ToggleHideOffline(self)
GUILD_ROSTER_KEYBOARD:HideOffline_OnClicked()
end
function ZO_ConfirmRemoveGuildMemberDialog_Keyboard_OnInitialized(self)
ZO_Dialogs_RegisterCustomDialog("GUILD_REMOVE_MEMBER_KEYBOARD",
{
title =
{
text = SI_PROMPT_TITLE_GUILD_REMOVE_MEMBER,
},
mainText =
{
text = SI_GUILD_REMOVE_MEMBER_WARNING,
},
canQueue = true,
customControl = self,
setup = function(dialog)
local checkboxControl = dialog:GetNamedChild("Check")
local blacklistMessageControl = dialog:GetNamedChild("BlacklistMessage")
local blacklistMessageEdit = blacklistMessageControl:GetNamedChild("Edit")
-- Setup checkbox
ZO_CheckButton_SetUnchecked(checkboxControl)
ZO_CheckButton_SetLabelText(checkboxControl, GetString(SI_GUILD_RECRUITMENT_ADD_TO_BLACKLIST_ACTION))
ZO_CheckButton_SetToggleFunction(checkboxControl, function() blacklistMessageControl:SetHidden(not ZO_CheckButton_IsChecked(checkboxControl)) end)
if DoesPlayerHaveGuildPermission(dialog.data.guildId, GUILD_PERMISSION_MANAGE_BLACKLIST) then
ZO_CheckButton_Enable(checkboxControl)
ZO_CheckButton_SetTooltipEnabledState(checkboxControl, false)
else
ZO_CheckButton_SetTooltipEnabledState(checkboxControl, true)
ZO_CheckButton_SetTooltipAnchor(checkboxControl, RIGHT, checkboxControl.label)
ZO_CheckButton_SetTooltipText(checkboxControl, GetString(SI_GUILD_RECRUITMENT_NO_BLACKLIST_PERMISSION))
ZO_CheckButton_Disable(checkboxControl)
end
-- Set to default values each time dialog is opened
blacklistMessageControl:SetHidden(true)
blacklistMessageEdit:SetText("")
end,
buttons =
{
-- Yes Button
{
control = self:GetNamedChild("Confirm"),
keybind = "DIALOG_PRIMARY",
text = GetString(SI_DIALOG_REMOVE),
callback = function(dialog)
local isChecked = ZO_CheckButton_IsChecked(dialog:GetNamedChild("Check"))
if isChecked then
local blacklistMessageControl = dialog:GetNamedChild("BlacklistMessageEdit")
local blacklistMessage = blacklistMessageControl:GetText()
local blacklistResult = AddToGuildBlacklistByDisplayName(dialog.data.guildId, dialog.data.displayName, blacklistMessage)
if not ZO_GuildRecruitment_Manager.IsAddedToBlacklistSuccessful(blacklistResult) then
ZO_Dialogs_ShowPlatformDialog("GUILD_FINDER_BLACKLIST_FAILED", nil, { mainTextParams = { blacklistResult } })
end
else
GuildRemove(dialog.data.guildId, dialog.data.displayName)
end
end,
},
-- No Button
{
control = self:GetNamedChild("Cancel"),
keybind = "DIALOG_NEGATIVE",
text = GetString(SI_DIALOG_CANCEL),
},
},
})
end
function ZO_GuildSetRankDialog_Keyboard_OnInitialized(self)
GUILD_ROSTER_KEYBOARD:OnSetRankDialogInitialized(self)
end |
local function CreateRobot(name,id)
local obj = {name = name,id = id}
function obj:SetName(name)
self.name = name
end
function obj:GetName()
return self.name
end
function obj:SetId(id)
self.id = id
end
function obj:GetId()
return self.id
end
return obj
end
local function createFootballRobot(name ,id ,position)
local obj = CreateRobot(name ,id)
obj.position = "right back"
function obj:SetPosition(p)
self.position = p
end
function obj:GetPosition()
return self.position
end
return obj
end
local mycreateFootballRobot = createFootballRobot("Tom",1000,"广州")
print("mycreateFootballRobot's name:",mycreateFootballRobot:GetName(),"myCreate's id:",mycreateFootballRobot:GetId(),mycreateFootballRobot:GetPosition())
mycreateFootballRobot:SetName("麦迪")
mycreateFootballRobot:SetId(2000)
mycreateFootballRobot:SetPosition("北京")
print("mycreateFootballRobot's name:",mycreateFootballRobot:GetName(),"myCreate's id:",mycreateFootballRobot:GetId(),mycreateFootballRobot:GetPosition()) |
local convarTextScale = CreateClientConVar("advisor_text_scale", "1", true, false, "Change text font scale from 50% to 200%", 0.5, 2)
local function SizeByRatio(x, is_static)
return x / 2560 * ScrW() * ( is_static and 1 or convarTextScale:GetFloat() )
end
local function GenerateAdvisorFonts()
surface.CreateFont("Advisor:Rubik.StaticSmall",
{
font = "Rubik",
size = SizeByRatio(16, true),
antialias = true,
})
surface.CreateFont("Advisor:Rubik.Header",
{
font = "Rubik",
size = SizeByRatio(24),
antialias = true,
})
surface.CreateFont("Advisor:Rubik.Footer",
{
font = "Rubik",
size = SizeByRatio(20),
antialias = true,
})
surface.CreateFont("Advisor:Rubik.Body",
{
font = "Rubik",
size = SizeByRatio(22),
antialias = true,
})
surface.CreateFont("Advisor:Rubik.Button",
{
font = "Rubik",
size = SizeByRatio(24),
antialias = true,
weight = 525,
})
surface.CreateFont("Advisor:Rubik.TextEntry",
{
font = "Rubik",
size = SizeByRatio(20),
antialias = true,
})
surface.CreateFont("Advisor:Awesome",
{
font = "Font Awesome 5 Free Solid",
antialias = true,
extended = true,
size = SizeByRatio(20),
})
surface.CreateFont("Advisor:SmallAwesome",
{
font = "Font Awesome 5 Free Solid",
antialias = true,
extended = true,
size = SizeByRatio(16),
})
if Advisor.UI and IsValid(Advisor.UI.MainPanel) then
Advisor.UI.MainPanel:InvalidateChildren(true)
end
end
GenerateAdvisorFonts()
cvars.AddChangeCallback(convarTextScale:GetName(), GenerateAdvisorFonts, "Advisor.GenerateAdvisorFonts")
hook.Add("OnScreenSizeChanged", "Advisor:OnScreenSizeChanged:ReGenerateFonts", GenerateAdvisorFonts) |
-- ===================================
-- Copyright © 2022 Relief Development
-- ===================================
Citizen.CreateThread(function()
TriggerEvent('chat:addSuggestion', '/twt', 'Send messages via Twitter in chat', {
{ name="Message", help="/twt Example"}
})
TriggerEvent('chat:addSuggestion', '/fb', 'Send messages via FaceBook in chat', {
{ name="Message", help="/fb Example"}
})
TriggerEvent('chat:addSuggestion', '/me', 'Players Actions', {
{ name="Message", help="/me Picks up shirt"}
})
TriggerEvent('chat:addSuggestion', '/do', 'Describes Players Actions', {
{ name="Message", help="/do Picks up shirt and puts it on"}
})
TriggerEvent('chat:addSuggestion', '/VPN', 'Sends messages via VPN in chat', {
{ name="Message", help="/VPN Example"}
})
TriggerEvent('chat:addSuggestion', '/ooc', 'Sends Messages Out Of Character', {
{ name="Message", help="/ooc How do I ragdoll?"}
})
TriggerEvent('chat:addSuggestion', '/calltow', 'Makes a Tow Request in chat', {
{ name="Message", help="/calltow Postal 1234, Red Charger"}
})
TriggerEvent('chat:addSuggestion', '/marketplace', 'Makes a Chat suggestion for selling goods', {
{ name="Message", help="/marketplace Selling my Shoes $25"}
})
RegisterCommand("discord", function(source, args, raw)
TriggerEvent('chat:addMessage', "^*Discord Server: ^1" .. DiscordLink, {245, 191, 66})
end)
RegisterCommand("teamspeak", function(source, args, raw)
TriggerEvent('chat:addMessage', "^*TeamSpeak Server: ^1" .. TeamSpeakLink, {255, 0, 0})
end)
RegisterCommand("website", function(source, args, raw)
TriggerEvent('chat:addMessage', "^*Website: ^1" .. WebsiteLink, {245, 191, 66})
end)
end)
|
local _M = {}
local utils = require("core.utils.utils")
local dynamicd_build = require("core.dao.dynamicd_build_sql")
local dao_config = require("core.dao.config")
local co_parameter_dao = require("core.dao.co_parameter_dao")
local user_log = require("core.log.user_log")
function _M.query_info_by_id(store,id)
local flag, info= store:query({
sql = "select * from p_anti_sql_injection where id = ?",
params ={
id
}
})
if info and #info >0 then
return info[1]
else
return nil
end
end
function _M.inster_anti_sql_injection(store,data)
local res,id = store:insert({
sql = "INSERT INTO `p_anti_sql_injection`(`group_id`,path,`remark`,`enable`,database_type) VALUES(?,?,?,?,?)",
params={
data.group_id,
utils.trim(data.path),
utils.trim(data.remark) or '',
data.enable or 0,
data.database_type or 'MYSQL'
}
})
user_log.print_log(store,user_log.module.anti_sql_injection .. "-新增",nil,data)
return res,id
end
function _M.update_anti_sql_injection(store,data)
-- 记录日志
user_log.print_log(store,user_log.module.anti_sql_injection .. "-修改","anti_sql_injection_dao",data)
local res= store:update({
sql = "update p_anti_sql_injection set group_id=?,path=?,remark=?,enable = ?,update_at =sysdate(),database_type=? where id = ?",
params={
data.group_id,
utils.trim(data.path),
utils.trim(data.remark),
data.enable or 0,
data.database_type or 'MYSQL',
data.id
}
})
return res
end
function _M.update_enable(store,id,enable)
local res= store:update({
sql = "update p_anti_sql_injection set enable=? where id = ?",
params={
enable,
id
}
})
user_log.print_log(store,user_log.module.anti_sql_injection .. (enable == "1" and "启用" or "禁用"),
nil,{id=id,enable=enable})
return res
end
function _M.delete_anti_sql_injection(store,id)
-- 记录日志
user_log.print_log(store,user_log.module.anti_sql_injection .. "-删除","anti_sql_injection_dao",{id=id})
local res = store : delete ({
sql = "delete from `p_anti_sql_injection` where `id` = ?",
params = {id }
})
return res
end
function _M.load_enable_anti_sql_injection(store,hosts)
local data={}
local ok, e
ok = xpcall(function()
local sql = [[
select
d.gateway_code,
c.host,
b.group_context,
a.id,
a.group_id,
a.path,
a.enable,
a.database_type
from p_anti_sql_injection a, c_api_group b, c_host c, c_gateway d
where a.group_id = b.id and b.host_id = c.id and c.gateway_id = d.id
and c.enable = 1 and a.enable = 1
]]
sql = dao_config.add_where_hosts(sql.."and c.host ",hosts)
local flag,objects, err = store:query({
sql = sql
})
if flag then
for _, anti in ipairs(objects) do
local property_list = co_parameter_dao.load_co_parameter_by_bizid(anti.id,"anti_sql_injection",store)
if property_list and #property_list >0 then
anti["property_list"] = property_list
table.insert(data,anti)
end
end
else
ngx.log(ngx.ERR, "[FATAL ERROR] load anti sql injection information error.")
end
end, function()
e = debug.traceback()
end)
if (not ok or e) then
ngx.log(ngx.ERR, "[FATAL ERROR] load anti sql injection information error.",e)
end
return data
end
function _M.load_anti_sql_injection(store,query_param)
local sql_prefix = [[
select
d.gateway_code,
c.host,
c.id as host_id,
c.gateway_id,
b.group_context,
a.id,
a.group_id,
a.path,
a.enable,
a.remark,
c.enable as host_enable,
a.database_type
from p_anti_sql_injection a, c_api_group b, c_host c, c_gateway d
where a.group_id = b.id and b.host_id = c.id and c.gateway_id = d.id
]]
local sql,params = dynamicd_build:build_and_condition_like_sql(sql_prefix,query_param)
sql = sql .. " order by a.update_at desc"
local flag, anti_injection_list= store:query({
sql = sql,
params =params
})
return flag, anti_injection_list
end
return _M |
workspace "classic-games"
architecture "x64"
configurations { "Debug", "Release" }
project "classic-games"
kind "ConsoleApp"
language "C++"
targetdir "bin/%{cfg.architecture}/%{cfg.buildcfg}"
objdir "bin/intermediates/%{cfg.architecture}/%{cfg.buildcfg}"
files
{
"src/**.hpp",
"src/**.cpp"
}
includedirs
{
"src"
}
postbuildcommands { "{COPYDIR} resources %{cfg.targetdir}/resources" }
-- On windows, openal32.dll is needed even if we use static linking,
-- due to the licence used (LGPL v2)
configuration "windows"
postbuildcommands { "{COPYFILE} vendor/SFML-2.5.1/bin/openal32.dll %{cfg.targetdir}" }
filter "system:windows"
cppdialect "C++17"
systemversion "latest"
defines { "SFML_STATIC" }
libdirs { "vendor/SFML-2.5.1/lib" }
includedirs { "vendor/SFML-2.5.1/include" }
links
{
"flac.lib",
"freetype.lib",
"gdi32.lib",
"ogg.lib",
"openal32.lib",
"opengl32.lib",
"vorbisenc.lib",
"vorbisfile.lib",
"vorbis.lib",
"winmm.lib",
}
filter { "system:windows", "configurations:Debug" }
symbols "on"
defines { "DEBUG" }
links
{
"sfml-audio-s-d.lib",
"sfml-graphics-s-d.lib",
"sfml-system-s-d.lib",
"sfml-window-s-d.lib"
}
filter { "system:windows", "configurations:Release" }
symbols "on"
optimize "on"
defines { "NDEBUG" }
links
{
"sfml-audio-s.lib",
"sfml-graphics-s.lib",
"sfml-system-s.lib",
"sfml-window-s.lib"
}
-- Under Linux, we only work with a release + dynamic librairies setup
filter "system:linux"
removeconfigurations { "Debug" }
cppdialect "C++17"
systemversion "latest"
symbols "on"
optimize "on"
links
{
"pthread",
"sfml-graphics",
"sfml-window",
"sfml-audio",
"sfml-system",
} |
BuildEnv(...)
MOUNT_MAP = nil
APP_RAID_MAPS = ListToMap{1861}
APP_RAID_DIFFICULTIES = ListToMap{14,15,16}
|
local text_color_info = Color(61, 206, 217)
local text_command_color = Color(227, 209, 11)
local text_version_color = Color(237, 153, 43)
local function version_check()
http.Fetch('https://raw.githubusercontent.com/Shark-vil/background-citizens/master/version.txt',
function(github_version, length, headers, code)
if code ~= 200 or not github_version then
bgNPC:Log('Failed to check the actual version: error code\n' .. tostring(code), 'Version Checker')
return
end
local ru_lang = {
msg_outdated = 'Вы используете устаревшую версию \'Background NPCs\' :(\n',
msg_latest = 'Вы используете последнюю версию \'Background NPCs\' :)\n',
msg_dev = 'Вы используете версию для разработчиков \'Background NPCs\' :o\n',
actual_version = 'Актуальная версия - ' .. github_version .. ' : Ваша версия - ' .. bgNPC.VERSION .. '\n',
update_page_1 = 'Используйте консольную команду \'',
update_page_2 = '\' чтобы посмотреть информацию о последнем выпуске.\n',
command = 'bgn_updateinfo'
}
local en_lang = {
msg_outdated = 'You are using an outdated version of \'Background NPCs\' :(\n',
msg_latest = 'You are using the latest version of \'Background NPCs\' :)\n',
msg_dev = 'You are using the dev version of \'Background NPCs\' :o\n',
actual_version = 'Actual version - ' .. github_version .. ' : Your version - ' .. bgNPC.VERSION .. '\n',
update_page_1 = 'Use the console command \'',
update_page_2 = '\' to view information about the latest release.\n',
command = 'bgn_updateinfo'
}
local lang = GetConVar('cl_language'):GetString() == 'russian' and ru_lang or en_lang
local v_github = tonumber(string.Replace(github_version, '.', ''))
local v_addon = tonumber(string.Replace(bgNPC.VERSION, '.', ''))
if v_addon < v_github then
local text_color = Color(255, 196, 0)
chat.AddText(Color(255, 0, 0), '[ADMIN] ',
text_color, lang.msg_outdated, text_version_color, lang.actual_version,
text_color_info, lang.update_page_1,
text_command_color, lang.command, text_color_info, lang.update_page_2)
elseif v_addon == v_github then
local text_color = Color(30, 255, 0)
chat.AddText(Color(255, 0, 0), '[ADMIN] ',
text_color, lang.msg_latest, text_version_color, lang.actual_version,
text_color_info, lang.update_page_1,
text_command_color, lang.command, text_color_info, lang.update_page_2)
elseif v_addon > v_github then
local text_color = Color(30, 255, 0)
chat.AddText(Color(255, 0, 0), '[ADMIN] ',
text_color, lang.msg_dev, text_version_color, lang.actual_version,
text_color_info, lang.update_page_1,
text_command_color, lang.command, text_color_info, lang.update_page_2)
end
end,
function(message)
MsgN('[Background NPCs] Failed to check the actual version:\n' .. message)
end
)
end
concommand.Add('bgn_version_check', version_check)
hook.Add('SlibPlayerFirstSpawn', 'BGN_CheckAddonVersion', function(ply)
if not ply:IsAdmin() and not ply:IsSuperAdmin() then return end
version_check()
end) |
local class = require 'ext.class'
local Set = require 'symmath.set.Set'
-- the set of all things
local Universal = class(Set)
--[[
so this is 'true'
but then all subclasses are 'true'
but contrarily any subset of Universal that isn't equal will have a 'false' somewhere
so the subclass == subset idea is a bad one from the implementation perspective
TODO replace with lookup/rules and just have Universal.rules['*'] = return true
then do rules based on Lua type or based on symmath class
--]]
function Universal:containsNumber(x) return true end
function Universal:containsComplex(x) return true end
function Universal:containsConstant(x) return true end
function Universal:containsSet(x) return true end
function Universal:containsVariable(x) return true end
function Universal:containsExpression(x) return true end
function Universal:isSubsetOf(x)
return Universal:isa(x)
end
return Universal
|
--Register with LibStub
local MAJOR, MINOR = "Up_UiController", 2
local LIB, _ = LibStub:NewLibrary(MAJOR, MINOR)
if not LIB then return end -- avoid double loading.
--- Used to initialize UI for ThiefHelper.
local UiTools = LibStub:GetLibrary("Up_UiTools")
local UiFactory = LibStub:GetLibrary("Up_UiFactory")
-- Creates instance of controller.
function LIB:new(settings, root)
return ZO_Object.MultiSubclass({ Settings = settings, Root = root }, self)
end
-- Check that compass visible and follows by its state. Only if Info enabled.
function LIB:checkWindowVisibility()
local visible
if ZO_CompassFrame then
visible = self.Settings.UI.Window.Enabled and not ZO_CompassFrame:IsHidden()
else
visible = self.Settings.UI.Window.Enabled
end
self.Root.UI.Window.Root:SetHidden(not visible)
return visible
end
-- Creates UI and configures it with settings. Requires loaded settings.
function LIB:initializeUI()
self.Root.UI = {}
self.Root.UI.Window = {}
local windowPadding = self.Settings.UI.Window.Padding
self.Root.UI.Window = UiFactory.createPaddingWindow(self.Root.name .. "_Window", windowPadding, self.Settings.UI.Window.Background.Enabled)
local windowRoot = self.Root.UI.Window.Root
local position = self.Settings.UI.Window.Position
windowRoot:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, position.OffsetX, position.OffsetY)
UiTools.configureAsFloat(windowRoot, position)
self.Settings.UI.Window.Enabled = true
-- Sets widget to switch visibility depends on compass visibility.
EVENT_MANAGER:RegisterForUpdate(windowRoot:GetName() .. "_VisibilityHandler", 100, function() self:checkWindowVisibility() end)
end
-- Toggles visibility of Info window.
function LIB:toggleWindow()
self.Settings.UI.Window.Enabled = not self.Settings.UI.Window.Enabled;
self:checkWindowVisibility()
end
|
--- standard-code: ouput code blocks with class="language-*" attributes
-- © 2020 Aman Verma. Distributed under the MIT license.
local languages = {meta = true,markup = true,css = true,clike = true,javascript = true,abap = true,abnf = true,actionscript = true,ada = true,agda = true,al = true,antlr4 = true,apacheconf = true,apl = true,applescript = true,aql = true,arduino = true,arff = true,asciidoc = true,aspnet = true,asm6502 = true,autohotkey = true,autoit = true,bash = true,basic = true,batch = true,bbcode = true,bison = true,bnf = true,brainfuck = true,brightscript = true,bro = true,bsl = true,c = true,csharp = true,cpp = true,cil = true,clojure = true,cmake = true,coffeescript = true,concurnas = true,csp = true,crystal = true,['css-extras'] = true,cypher = true,d = true,dart = true,dax = true,dhall = true,diff = true,django = true,['dns-zone-file'] = true,docker = true,ebnf = true,editorconfig = true,eiffel = true,ejs = true,elixir = true,elm = true,etlua = true,erb = true,erlang = true,['excel-formula'] = true,fsharp = true,factor = true,['firestore-security-rules'] = true,flow = true,fortran = true,ftl = true,gml = true,gcode = true,gdscript = true,gedcom = true,gherkin = true,git = true,glsl = true,go = true,graphql = true,groovy = true,haml = true,html = true,handlebars = true,haskell = true,haxe = true,hcl = true,hlsl = true,http = true,hpkp = true,hsts = true,ichigojam = true,icon = true,ignore = true,inform7 = true,ini = true,io = true,j = true,java = true,javadoc = true,javadoclike = true,javastacktrace = true,jolie = true,jq = true,jsdoc = true,['js-extras'] = true,json = true,json5 = true,jsonp = true,jsstacktrace = true,['js-templates'] = true,julia = true,keyman = true,kotlin = true,latex = true,latte = true,less = true,lilypond = true,liquid = true,lisp = true,livescript = true,llvm = true,lolcode = true,lua = true,makefile = true,markdown = true,['markup-templating'] = true,matlab = true,mel = true,mizar = true,mongodb = true,monkey = true,moonscript = true,n1ql = true,n4js = true,['nand2tetris-hdl'] = true,naniscript = true,nasm = true,neon = true,nginx = true,nim = true,nix = true,nsis = true,objectivec = true,ocaml = true,opencl = true,oz = true,parigp = true,parser = true,pascal = true,pascaligo = true,pcaxis = true,peoplecode = true,perl = true,php = true,phpdoc = true,['php-extras'] = true,plsql = true,powerquery = true,powershell = true,processing = true,prolog = true,properties = true,protobuf = true,pug = true,puppet = true,pure = true,purebasic = true,purescript = true,python = true,q = true,qml = true,qore = true,r = true,racket = true,jsx = true,tsx = true,reason = true,regex = true,renpy = true,rest = true,rip = true,roboconf = true,robotframework = true,ruby = true,rust = true,sas = true,sass = true,scss = true,scala = true,scheme = true,['shell-session'] = true,smali = true,smalltalk = true,smarty = true,solidity = true,['solution-file'] = true,soy = true,sparql = true,['splunk-spl'] = true,sqf = true,sql = true,stan = true,iecst = true,stylus = true,swift = true,['t4-templating'] = true,['t4-cs'] = true,['t4-vb'] = true,tap = true,tcl = true,tt2 = true,textile = true,toml = true,turtle = true,twig = true,typescript = true,typoscript = true,unrealscript = true,vala = true,vbnet = true,velocity = true,verilog = true,vhdl = true,vim = true,['visual-basic'] = true,warpscript = true,wasm = true,wiki = true,xeora = true,['xml-doc'] = true,xojo = true,xquery = true,yaml = true,yang = true,zig = true}
local function escape(s)
-- Escape according to HTML 5 rules
return s:gsub(
[=[[<>&"']]=],
function(x)
if x == '<' then
return '<'
elseif x == '>' then
return '>'
elseif x == '&' then
return '&'
elseif x == '"' then
return '"'
elseif x == "'" then
return '''
else
return x
end
end
)
end
local function getCodeClass(classes)
-- Check if the first element of classes (pandoc.CodeBlock.classes) matches a
-- programming language name. If it does, it gets removed from classes and a valid
-- HTML class attribute string (with space at beginning) is returned.
if languages[classes[1]] then
return ' class="language-' .. table.remove(classes, 1) .. '"'
else
return ''
end
end
local function makeIdentifier(ident)
-- Returns a valid HTML id attribute (with space at beginning) OR empty string.
if #ident ~= 0 then
return ' id="'.. ident .. '"'
else
return ''
end
end
local function makeClasses(classes)
-- Returns a valid HTML class attribute with classes separated by spaces (with a space
-- at the beginning) OR empty string.
if #classes ~= 0 then
return ' class="' .. table.concat(classes, ' ') .. '"'
else
return ''
end
end
return {
{
CodeBlock = function(elem)
if FORMAT ~= 'html' then
return nil
end
id = makeIdentifier(elem.identifier)
classLang = getCodeClass(elem.classes)
classReg = makeClasses(elem.classes)
local preCode = string.format(
'<pre%s%s><code%s>%s</code></pre>', id, classReg, classLang, escape(elem.text)
)
return pandoc.RawBlock('html', preCode, 'RawBlock')
end,
}
}
|
local _2afile_2a = "fnl/snap/producer/ripgrep/file.fnl"
local snap = require("snap")
local tbl = snap.get("common.tbl")
local general = snap.get("producer.ripgrep.general")
local file = {}
local args = {"--line-buffered", "--files"}
file.default = function(request)
local cwd = snap.sync(vim.fn.getcwd)
return general(request, {args = args, cwd = cwd})
end
file.hidden = function(request)
local cwd = snap.sync(vim.fn.getcwd)
return general(request, {args = {"--hidden", unpack(args)}, cwd = cwd})
end
file.args = function(new_args)
local function _1_(request)
local cwd = snap.sync(vim.fn.getcwd)
return general(request, {args = tbl.concat(args, new_args), cwd = cwd})
end
return _1_
end
return file |
local kBackgroundColor = Color(0.0, 0.0, 0.0, 0.5)
local kChatTextBuffer = 5
local kChatTextPadding = 12
local cutoffAmount = Client.GetOptionInteger("chat-wrap", 25)
local kBackgroundTimeStartFade = 1.5
-- needed by shine because it's bad at recursing
local kOffset = debug.getupvaluex(GUIChat.Update, "kOffset")
debug.setupvaluex( GUIChat.AddMessage, "cutoffAmount", cutoffAmount, true)
local oldUpdate = GUIChat.Update
function GUIChat:Update(deltaTime)
oldUpdate(self, deltaTime)
-- need a reference here so shine can get this value
kOffset = kOffset
for i, message in ipairs(self.messages) do
if message["Time"] then
local fadeAmount = Clamp(kBackgroundTimeStartFade - message["Time"] / kBackgroundTimeStartFade, 0, 1)
local currentColor = message["Background"]:GetColor()
currentColor.a = fadeAmount * kBackgroundColor.a
message["Background"]:SetColor(currentColor)
end
end
end
local oldAddMessage = GUIChat.AddMessage
function GUIChat:AddMessage(playerColor, playerName, messageColor, messageText, isCommander, isRookie)
oldAddMessage(self, playerColor, playerName, messageColor, messageText, isCommander, isRookie)
if self.messages and #self.messages > 0 then
local insertMessage = self.messages[#self.messages]
if insertMessage then
local cutoff = Client.GetScreenWidth() * (cutoffAmount/100)
local size = insertMessage["Background"]:GetSize()
insertMessage["Background"]:SetSize(Vector(cutoff + GUIScale(kChatTextPadding), size.y, 0))
insertMessage["Background"]:SetColor(kBackgroundColor)
end
end
end |
return
{
entities =
{
{"kr-wind-turbine", {x = 2.5, y = -3}, {}},
{"small-electric-pole", {x = -2.5, y = -1}, {dmg = {dmg = {type = "random", min = 20, max = 60}}, }},
{"small-electric-pole", {x = 2.5, y = -1}, {}},
{"kr-wind-turbine", {x = -2.5, y = 2}, {dmg = {dmg = {type = "random", min = 40, max = 160}}, }},
{"kr-wind-turbine", {x = 2.5, y = 2}, {}},
},
tiles =
{
{"kr-white-reinforced-plate", {x = -4, y = 0.5}},
{"kr-white-reinforced-plate", {x = -4, y = 1.5}},
{"kr-white-reinforced-plate", {x = -3, y = -3.5}},
{"kr-white-reinforced-plate", {x = -3, y = -0.5}},
{"kr-white-reinforced-plate", {x = -3, y = 0.5}},
{"kr-white-reinforced-plate", {x = -3, y = 1.5}},
{"kr-white-reinforced-plate", {x = -3, y = 2.5}},
{"kr-white-reinforced-plate", {x = -2, y = -3.5}},
{"kr-white-reinforced-plate", {x = -2, y = -0.5}},
{"kr-white-reinforced-plate", {x = -2, y = 0.5}},
{"kr-white-reinforced-plate", {x = -2, y = 1.5}},
{"kr-white-reinforced-plate", {x = -2, y = 2.5}},
{"kr-white-reinforced-plate", {x = -1, y = -0.5}},
{"kr-white-reinforced-plate", {x = -1, y = 1.5}},
{"kr-white-reinforced-plate", {x = 0, y = -0.5}},
{"kr-white-reinforced-plate", {x = 0, y = 1.5}},
{"kr-white-reinforced-plate", {x = 1, y = -2.5}},
{"kr-white-reinforced-plate", {x = 1, y = -1.5}},
{"kr-white-reinforced-plate", {x = 1, y = -0.5}},
{"kr-white-reinforced-plate", {x = 1, y = 0.5}},
{"kr-white-reinforced-plate", {x = 1, y = 1.5}},
{"kr-white-reinforced-plate", {x = 1, y = 2.5}},
{"kr-white-reinforced-plate", {x = 2, y = -3.5}},
{"kr-white-reinforced-plate", {x = 2, y = -2.5}},
{"kr-white-reinforced-plate", {x = 2, y = -1.5}},
{"kr-white-reinforced-plate", {x = 2, y = -0.5}},
{"kr-white-reinforced-plate", {x = 2, y = 0.5}},
{"kr-white-reinforced-plate", {x = 2, y = 1.5}},
{"kr-white-reinforced-plate", {x = 2, y = 2.5}},
{"kr-white-reinforced-plate", {x = 2, y = 3.5}},
{"kr-white-reinforced-plate", {x = 3, y = -3.5}},
{"kr-white-reinforced-plate", {x = 3, y = -2.5}},
{"kr-white-reinforced-plate", {x = 3, y = 2.5}},
{"kr-white-reinforced-plate", {x = 3, y = 3.5}},
}
}
|
-----------------------------------
--
-- Zone: Attohwa_Chasm (7)
--
-----------------------------------
local ID = require("scripts/zones/Attohwa_Chasm/IDs")
require("scripts/globals/settings")
require("scripts/globals/helm")
require("scripts/globals/zone")
-----------------------------------
function onInitialize(zone)
-- Poison Flowers!
zone:registerRegion(1, -475.809, 5, 316.499, 0,0,0);
zone:registerRegion(2, -440.938, 7, 281.749, 0,0,0);
zone:registerRegion(3, -388.027, 5, 264.831, 0,0,0);
zone:registerRegion(4, -534.104, 5, 217.833, 0,0,0);
zone:registerRegion(5, -530.000, 5, 210.000, 0,0,0);
zone:registerRegion(6, -482.192, 5, 198.647, 0,0,0);
zone:registerRegion(7, -595.756, 7, 157.532, 0,0,0);
zone:registerRegion(8, -514.000, 5, 166.000, 0,0,0);
zone:registerRegion(9, -396.844, 5, 164.790, 0,0,0);
zone:registerRegion(10, -382.919, 5, 143.572, 0,0,0);
zone:registerRegion(11, -537.558, 5, 102.683, 0,0,0);
zone:registerRegion(12, -393.979, 5, 101.877, 0,0,0);
zone:registerRegion(13, -367.892, 5, 75.774, 0,0,0);
zone:registerRegion(14, -369.333, 5, 69.333, 0,0,0);
zone:registerRegion(15, -351.717, 5, 64.773, 0,0,0);
zone:registerRegion(16, -386.000, 5, 50.000, 0,0,0);
zone:registerRegion(17, -360.705, 5, 51.505, 0,0,0);
zone:registerRegion(18, -475.667, 5, 37.081, 0,0,0);
zone:registerRegion(19, -321.902, 5, 36.697, 0,0,0);
zone:registerRegion(20, -351.916, 5, 10.501, 0,0,0);
zone:registerRegion(21, -554.739, 5, -3.057, 0,0,0);
zone:registerRegion(22, -397.667, 5, -5.563, 0,0,0);
zone:registerRegion(23, -330.062, 5, -18.832, 0,0,0);
zone:registerRegion(24, -233.015, 5, -19.049, 0,0,0);
zone:registerRegion(25, -553.523, 5, -72.071, 0,0,0);
zone:registerRegion(26, -535.904, 7, -67.914, 0,0,0);
zone:registerRegion(27, -435.438, 5, -74.171, 0,0,0);
zone:registerRegion(28, -369.343, 5, -73.449, 0,0,0);
zone:registerRegion(29, -238, 5, -118, 0,0,0);
zone:registerRegion(30, -385.349, 5, -173.973, 0,0,0);
UpdateNMSpawnPoint(ID.mob.TIAMAT);
GetMobByID(ID.mob.TIAMAT):setRespawnTime(math.random(86400, 259200));
tpz.helm.initZone(zone, tpz.helm.type.EXCAVATION)
end;
function onZoneIn(player,prevZone)
local cs = -1;
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos(-194.487,-13.766,338.704,141);
end
return cs;
end;
function onConquestUpdate(zone, updatetype)
tpz.conq.onConquestUpdate(zone, updatetype)
end;
function onRegionEnter(player,region)
-- TODO: Gasponia's shouldn't "always" poison you. However, in retail regions constantly reapply themselves without having to re-enter the region. In Topaz that doesn't happen so I'm leaving it as-is for now.
local regionId = region:GetRegionID();
if (regionId <= 30) then
local gasponia = GetNPCByID(ID.npc.GASPONIA_OFFSET + (regionId - 1));
if (gasponia ~= nil) then
gasponia:openDoor(3);
if (not player:hasStatusEffect(tpz.effect.POISON)) then
player:addStatusEffect(tpz.effect.POISON, 15, 0, math.random(30,60));
player:messageSpecial(ID.text.GASPONIA_POISON);
end
end
end
end;
function onRegionLeave(player,region)
end;
function onGameHour(zone)
--[[
the hard-coded id that was here was wrong. there are 22 miasmas in attohwa chasm
starting at ID.npc.MIASMA_OFFSET. some are supposed to toggle open, but need retail test
to determine which. for now, they're just statically set per npc_list.animation
--]]
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
end;
|
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Functions.CreateCallback('zonama:server:get-items', function(source, cb)
local src = source
local player = QBCore.Functions.GetPlayer(src)
if player then
-- get all items and join category
local items = MySQL.Sync.fetchAll(
"SELECT items.id AS 'id', items.name AS 'name', items.price AS 'price', items.image AS 'image', items.description AS 'description', category.name AS 'category_name' FROM za_items items INNER JOIN za_categories category ON category.id = items.category_id;")
cb(items)
end
end)
-- create zonama:server:create-order
QBCore.Functions.CreateCallback('zonama:server:create-order', function(source, cb, cart)
local src = source
local xPlayer = QBCore.Functions.GetPlayer(src)
local citizenid = xPlayer.PlayerData.citizenid
local currentBank = xPlayer.Functions.GetMoney('bank')
if tonumber(cart.price) <= currentBank then
local bank = xPlayer.Functions.RemoveMoney('bank', tonumber(cart.price))
local result = MySQL.Async.insert(
'INSERT INTO `za_orders` (`citizen_id`, `price`) VALUES (@citizen_id, @price)', {
['@citizen_id'] = citizenid,
['@price'] = cart.price
}, function(orderId)
local query = 'INSERT INTO `za_order_item` (`order_id`, `item_id`, `quantity`) VALUES '
for k, item in pairs(cart.items) do
query = query .. '(' .. orderId .. ', ' .. item.id .. ', ' .. item.quantity .. '),'
end
-- replace last comma with semicolon
query = string.sub(query, 1, -2) .. ';'
MySQL.Async.execute(query, {}, function(rows)
-- send success notification to player
TriggerClientEvent('QBCore:Notify', src, Lang:t('success.cart_paid', {
amount = cart.price
}), 'success')
TriggerClientEvent('zonama:client:close-nui', src)
cb(true)
end)
end)
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.not_enough_money"), 'error')
cb(false)
end
end)
-- Get all orders
QBCore.Functions.CreateCallback('zonama:server:get-orders', function(source, cb)
local orders = MySQL.Sync.fetchAll('SELECT * FROM `za_orders`', {})
print(orders)
cb(orders)
end)
-- Get all orders from player
QBCore.Functions.CreateCallback('zonama:server:get-orders-from-player', function(source, cb, xPlayer)
local citizenid = xPlayer.PlayerData.citizenid
local orders = MySQL.Sync.fetchAll('SELECT * FROM `za_orders` WHERE `citizen_id` = @citizen_id', {
['@citizen_id'] = citizenid
})
print(orders)
cb(orders)
end)
-- Get items from order
QBCore.Functions.CreateCallback('zonama:server:get-order-items', function(source, cb, orderId)
local items = MySQL.Sync.fetchAll('SELECT * FROM `za_order_item` WHERE `order_id` = @order_id', {
['@order_id'] = orderId
})
print(items)
cb(items)
end)
QBCore.Commands.Add('zonama-get-random-order', Lang:t("commands.get_random_order"), {}, false, function(source, args)
-- get one random order
local result = MySQL.Sync.fetchAll('SELECT * FROM `za_orders` ORDER BY RAND() LIMIT 1', {})
if (result) then
local randomOrder = result[1]
-- get items from order and join item name, quantity, citizen_id
local query = [[
SELECT items.name AS `name`, za_order_item.quantity AS `quantity`, _order.citizen_id AS `citizen_id` FROM za_order_item
INNER JOIN za_items items ON items.id = za_order_item.item_id
INNER JOIN za_orders _order ON _order.id = @order_id
WHERE za_order_item.order_id = @order_id;
]]
local items = MySQL.Sync.fetchAll(query, {
['@order_id'] = randomOrder.id
})
print(json.encode(items))
end
end)
|
--[[---------------
This is derived from LuaBit v0.4
Under the MIT license.
copyright(c) 2006~2007 hanzhao ([email protected])
--]]---------------
local function check_int(n)
-- checking not float
if(n - math.floor(n) > 0) then
error("trying to use bitwise operation on non-integer!")
end
end
local function to_bits(n)
check_int(n)
if(n < 0) then
-- negative
return to_bits(bit.bnot(math.abs(n)) + 1)
end
-- to bits table
local tbl = {}
local cnt = 1
while (n > 0) do
local last = n % 2
if(last == 1) then
tbl[cnt] = 1
else
tbl[cnt] = 0
end
n = (n-last)/2
cnt = cnt + 1
end
return tbl
end
local function tbl_to_number(tbl)
local rslt = 0
local power = 1
for i = 1, #tbl do
rslt = rslt + tbl[i]*power
power = power*2
end
return rslt
end
local function expand(tbl_m, tbl_n)
local big = {}
local small = {}
if(#tbl_m > #tbl_n) then
big = tbl_m
small = tbl_n
else
big = tbl_n
small = tbl_m
end
-- expand small
for i = #small + 1, #big do
small[i] = 0
end
end
local function bit_or(m, n)
local tbl_m = to_bits(m)
local tbl_n = to_bits(n)
expand(tbl_m, tbl_n)
local tbl = {}
local rslt = math.max(#tbl_m, #tbl_n)
for i = 1, rslt do
if(tbl_m[i]== 0 and tbl_n[i] == 0) then
tbl[i] = 0
else
tbl[i] = 1
end
end
return tbl_to_number(tbl)
end
local function bit_and(m, n)
local tbl_m = to_bits(m)
local tbl_n = to_bits(n)
expand(tbl_m, tbl_n)
local tbl = {}
local rslt = math.max(#tbl_m, #tbl_n)
for i = 1, rslt do
if(tbl_m[i]== 0 or tbl_n[i] == 0) then
tbl[i] = 0
else
tbl[i] = 1
end
end
return tbl_to_number(tbl)
end
local function bit_not(n)
local tbl = to_bits(n)
local size = math.max(#tbl, 32)
for i = 1, size do
if(tbl[i] == 1) then
tbl[i] = 0
else
tbl[i] = 1
end
end
return tbl_to_number(tbl)
end
local function bit_xor(m, n)
local tbl_m = to_bits(m)
local tbl_n = to_bits(n)
expand(tbl_m, tbl_n)
local tbl = {}
local rslt = math.max(#tbl_m, #tbl_n)
for i = 1, rslt do
if(tbl_m[i] ~= tbl_n[i]) then
tbl[i] = 1
else
tbl[i] = 0
end
end
--table.foreach(tbl, print)
return tbl_to_number(tbl)
end
local function bit_rshift(n, bits)
check_int(n)
local high_bit = 0
if(n < 0) then
-- negative
n = bit_not(math.abs(n)) + 1
high_bit = 2147483648 -- 0x80000000
end
for i=1, bits do
n = n/2
n = bit_or(math.floor(n), high_bit)
end
return math.floor(n)
end
-- logic rightshift assures zero filling shift
local function bit_logic_rshift(n, bits)
check_int(n)
if(n < 0) then
-- negative
n = bit_not(math.abs(n)) + 1
end
for i=1, bits do
n = n/2
end
return math.floor(n)
end
local function bit_lshift(n, bits)
check_int(n)
if(n < 0) then
-- negative
n = bit_not(math.abs(n)) + 1
end
for i=1, bits do
n = n*2
end
return bit_and(n, 4294967295) -- 0xFFFFFFFF
end
local function bit_xor2(m, n)
local rhs = bit_or(bit_not(m), bit_not(n))
local lhs = bit_or(m, n)
local rslt = bit_and(lhs, rhs)
return rslt
end
--------------------
-- bit lib interface
local bit53 = [[
return {
band = function(a, b) return a & b end,
bor = function(a, b) return a | b end,
bxor = function(a, b) return a ~ b end,
bnot = function(a) return ~a end,
rshift = function(a, n) return a >> n end,
lshift = function(a, n) return a << n end,
}
]]
local lib = false
or (pcall(require, "bit") and require("bit"))
or (pcall(require, "bit32") and require("bit32"))
or (pcall(load, bit53) and load(bit53)())
or {
bnot = bit_not,
band = bit_and,
bor = bit_or,
bxor = bit_xor,
rshift = bit_rshift,
lshift = bit_lshift,
}
lib.bxor2 = bit_xor2
lib.blogic_rshift = bit_logic_rshift
lib.tobits = to_bits
lib.tonumb = tbl_to_number
return lib
|
local F, G, V = unpack(select(2, ...))
G.ace = LibStub("AceAddon-3.0"):NewAddon("gempUI", "AceConsole-3.0", "AceEvent-3.0")
local options = {
name = "gempUI",
handler = G.ace,
type = 'group',
childGroups = "tab",
args = {
general = {
name = "General",
type = 'group',
order = 0,
args = {
autoRepair = {
type = "toggle",
order = 0,
name = "Auto repair",
desc = "Automatically repair Guild first then personal",
get = function()
return G.ace.db.profile.autoRepair
end,
set = function(info, value)
G.ace.db.profile.autoRepair = value
end
},
sellJunk = {
type = "toggle",
order = 1,
name = "Sell junk",
desc = "Automatically vendor greys",
get = function()
return G.ace.db.profile.sellJunk
end,
set = function(info, value)
G.ace.db.profile.sellJunk = value
end
},
hideErrors = {
type = "select",
order = 2,
name = "Hide Errors",
desc = "Mute Blizzard error frame",
values = {
combat = "Hide errors in combat",
always = "Always hide errors",
never = "Never hide errors"
},
get = function()
return G.ace.db.profile.hideErrors
end,
set = function(info, value)
G.ace.db.profile.hideErrors = value
end
},
}
},
unitframes = {
name = "Unitframes",
type = 'group',
order = 1,
childGroups = "tree",
args = {
player = {
name = "Player",
type = 'group',
order = 0,
args = {
width = {
order = 0,
name = "Width",
desc = "/reload to see changes",
min = 50,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].width
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].width = value
end
},
showName = {
order = 1,
name = "Show Name",
desc = "/reload to see changes",
type = "toggle",
get = function()
return G.ace.db.profile.unitframes['player'].showName
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].showName = value
end
},
health = {
order = 2,
name = "Health Height",
desc = "/reload to see changes",
min = 1,
max = 100,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].health
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].health = value
end
},
power = {
order = 3,
name = "Power Height",
desc = "/reload to see changes",
min = 1,
max = 100,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].power
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].power = value
end
},
x = {
order = 4,
name = "Position X",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].x)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].x = value
refreshUnitframePositions()
end
},
y = {
order = 5,
name = "Position Y",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].y)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].y = value
refreshUnitframePositions()
end
},
castbarHeader = {
order = 6,
name = "Castbar",
type = "header",
},
castbarX = {
order = 7,
name = "Position X",
desc = "/reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].castbarX)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].castbarX = value
end
},
castbarY = {
order = 8,
name = "Position Y",
desc = "/reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].castbarY)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].castbarY = value
end
},
castbarWidth = {
order = 9,
name = "Width",
desc = "/reload to see changes",
min = 10,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].castbarWidth
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].castbarWidth = value
end
},
castbarHeight = {
order = 10,
name = "Height",
desc = "/reload to see changes",
min = 1,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].castbarHeight
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].castbarHeight = value
end
},
auraBarsHeader = {
order = 11,
name = "AuraBars",
type = "header",
},
auraBarsX = {
order = 12,
name = "Position X",
desc = "Relative to player frame | /reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].auraBarsX)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].auraBarsX = value
end
},
auraBarsY = {
order = 13,
name = "Position Y",
desc = "Relative to player frame | /reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['player'].auraBarsY)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['player'].auraBarsY = value
end
},
auraBarsWidth = {
order = 14,
name = "Width",
desc = "/reload to see changes",
min = 10,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].auraBarsWidth
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].auraBarsWidth = value
end
},
auraBarsHeight = {
order = 15,
name = "Height",
desc = "/reload to see changes",
min = 2,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].auraBarsHeight
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].auraBarsHeight = value
end
},
auraBarsSpacing = {
order = 16,
name = "Spacing",
desc = "/reload to see changes",
min = -1,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].auraBarsSpacing
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].auraBarsSpacing = value
end
},
auraBarsFontSize = {
order = 17,
name = "FontSize",
desc = "/reload to see changes",
min = 6,
max = 60,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['player'].auraBarsFontSize
end,
set = function(info, value)
G.ace.db.profile.unitframes['player'].auraBarsFontSize = value
end
},
}
},
target = {
name = "Target",
type = 'group',
order = 1,
args = {
width = {
order = 0,
name = "Width",
desc = "/reload to see changes",
min = 50,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].width
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].width = value
end
},
allDebuffs = {
type = "toggle",
order = 1,
name = "Show all enemy debuffs",
desc = "Will show more than just your debuffs on target frames",
get = function()
return G.ace.db.profile.unitframes['target'].allDebuffs
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].allDebuffs = value
end
},
health = {
order = 2,
name = "Health Height",
desc = "/reload to see changes",
min = 1,
max = 100,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].health
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].health = value
end
},
power = {
order = 3,
name = "Power Height",
desc = "/reload to see changes",
min = 1,
max = 100,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].power
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].power = value
end
},
x = {
order = 4,
name = "Position X",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].x)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].x = value
refreshUnitframePositions()
end
},
y = {
order = 5,
name = "Position Y",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].y)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].y = value
refreshUnitframePositions()
end
},
castbarHeader = {
order = 6,
name = "Castbar",
type = "header",
},
castbarX = {
order = 7,
name = "Position X",
desc = "/reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].castbarX)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].castbarX = value
end
},
castbarY = {
order = 8,
name = "Position Y",
desc = "/reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].castbarY)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].castbarY = value
end
},
castbarWidth = {
order = 9,
name = "Width",
desc = "/reload to see changes",
min = 10,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].castbarWidth
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].castbarWidth = value
end
},
castbarHeight = {
order = 10,
name = "Height",
desc = "/reload to see changes",
min = 1,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].castbarHeight
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].castbarHeight = value
end
},
auraBarsHeader = {
order = 11,
name = "AuraBars",
type = "header",
},
auraBarsX = {
order = 12,
name = "Position X",
desc = "Relative to target frame | /reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].auraBarsX)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].auraBarsX = value
end
},
auraBarsY = {
order = 13,
name = "Position Y",
desc = "Relative to target frame | /reload to see changes",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['target'].auraBarsY)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['target'].auraBarsY = value
end
},
auraBarsWidth = {
order = 14,
name = "Width",
desc = "/reload to see changes",
min = 10,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].auraBarsWidth
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].auraBarsWidth = value
end
},
auraBarsHeight = {
order = 15,
name = "Height",
desc = "/reload to see changes",
min = 2,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].auraBarsHeight
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].auraBarsHeight = value
end
},
auraBarsSpacing = {
order = 16,
name = "Spacing",
desc = "/reload to see changes",
min = -1,
max = 50,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].auraBarsSpacing
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].auraBarsSpacing = value
end
},
auraBarsFontSize = {
order = 17,
name = "FontSize",
desc = "/reload to see changes",
min = 6,
max = 60,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['target'].auraBarsFontSize
end,
set = function(info, value)
G.ace.db.profile.unitframes['target'].auraBarsFontSize = value
end
},
}
},
targettarget = {
name = "Target of Target",
type = 'group',
order = 1,
args = {
width = {
order = 0,
name = "Width",
desc = "/reload to see changes",
min = 50,
max = 600,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['targettarget'].width
end,
set = function(info, value)
G.ace.db.profile.unitframes['targettarget'].width = value
end
},
health = {
order = 1,
name = "Health Height",
desc = "/reload to see changes",
min = 1,
max = 100,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.unitframes['targettarget'].health
end,
set = function(info, value)
G.ace.db.profile.unitframes['targettarget'].health = value
end
},
x = {
order = 2,
name = "Position X",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['targettarget'].x)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['targettarget'].x = value
refreshUnitframePositions()
end
},
y = {
order = 3,
name = "Position Y",
type = "input",
get = function()
return tostring(G.ace.db.profile.unitframes['targettarget'].y)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.unitframes['targettarget'].y = value
refreshUnitframePositions()
end
},
}
},
}
},
panels = {
name = "Panels",
type = 'group',
order = 2,
childGroups = "tree",
args = {
mainpanel = {
name = "Mainpanel",
type = 'group',
order = 0,
args = {
Hidden = {
order = 0,
name = "Hidden",
desc = "",
type = "toggle",
get = function()
return G.ace.db.profile.panels['mainpanel'].hidden
end,
set = function(info, value)
G.ace.db.profile.panels['mainpanel'].hidden = value
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
},
width = {
order = 1,
name = "Width",
desc = "",
min = 1,
max = 4096,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.panels['mainpanel'].width
end,
set = function(info, value)
G.ace.db.profile.panels['mainpanel'].width = value
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
},
height = {
order = 2,
name = "Height",
desc = "",
min = 1,
max = 2160,
step = 1,
type = "range",
get = function()
return G.ace.db.profile.panels['mainpanel'].height
end,
set = function(info, value)
G.ace.db.profile.panels['mainpanel'].height = value
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
},
x = {
order = 3,
name = "Position X",
type = "input",
get = function()
return tostring(G.ace.db.profile.panels['mainpanel'].x)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.panels['mainpanel'].x = value
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
},
y = {
order = 4,
name = "Position Y",
type = "input",
get = function()
return tostring(G.ace.db.profile.panels['mainpanel'].y)
end,
set = function(info, value)
value = tonumber(value)
G.ace.db.profile.panels['mainpanel'].y = value
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
}
}
},
}
},
}
}
local defaults = {
profile = {
sellJunk = true,
autoRepair = true,
hideErrors = "never",
auraWatch = {},
unitframes = {
player = {
width = 184,
showName = false,
health = 30,
power = 7,
x = -259,
y = -443,
castbarX = 0,
castbarY = -397,
castbarWidth = 305,
castbarHeight = 25,
auraBarsX = 157,
auraBarsY = 25,
auraBarsWidth = 118,
auraBarsHeight = 32,
auraBarsSpacing = -1,
auraBarsFontSize = 18,
},
target = {
width = 184,
allDebuffs = false,
health = 30,
power = 7,
x = 259,
y = -443,
castbarX = 258,
castbarY = -475,
castbarWidth = 182,
castbarHeight = 16,
auraBarsX = -157,
auraBarsY = 25,
auraBarsWidth = 118,
auraBarsHeight = 32,
auraBarsSpacing = -1,
auraBarsFontSize = 18,
},
targettarget = {
width = 80,
health = 27,
x = 310,
y = -500,
}
},
panels = {
mainpanel = {
hidden = false,
width = 322,
height = 126,
x = 0,
y = -429,
}
},
actionbars = {
bar1 = {
hidden = false,
orientation = "HORIZONTAL",
length = 6,
size = 37,
x = 0,
y = -390,
spacing = 2,
rows = 1
},
bar2 = {
hidden = false,
orientation = "HORIZONTAL",
length = 6,
size = 37,
x = 0,
y = -429,
spacing = 2,
rows = 1
}
}
}
}
local function setupUI()
G.ace:GetModule("Panels"):SetPanel("mainpanel", UIParent, G.ace.db.profile.panels['mainpanel'].x, G.ace.db.profile.panels['mainpanel'].y, G.ace.db.profile.panels['mainpanel'].width, G.ace.db.profile.panels['mainpanel'].height, G.ace.db.profile.panels['mainpanel'].hidden)
end
function G.ace:OnInitialize()
local frame = CreateFrame("FRAME", "SavedVarsFrame");
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, arg1)
if arg1 == "gempUI" then
self:UnregisterEvent("ADDON_LOADED")
G.ace.db = LibStub("AceDB-3.0"):New("gempDB", defaults, true)
options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(G.ace.db)
LibStub("AceConfig-3.0"):RegisterOptionsTable("gempUI", options)
self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("gempUI", "gempUI")
setupUI()
end
end)
end
|
local select = _G.select
local function chunk(arr, ...)
local n = select("#", ...)
if n == 0 then
return arr
else
local result, t = {}, {}
local j, k, kmodn, m = 1, 1, 1, select(1, ...)
for i = 1, #arr do
t[j] = arr[i]
if j >= m then
result[k] = t
kmodn, k, j, t = kmodn % n + 1, k + 1, 1, {}
m = select(kmodn, ...)
else
j = j + 1
end
end
if j > 1 then
result[k] = t
end
return result
end
end
return chunk
|
local link_id = redis.call("INCR", KEY[1])
redis.call("HSET", KEYS[2], link_id, ARGV[1])
return link_id |
--------------------------------------------------------------------------------
----------------------------------- DevDokus -----------------------------------
--------------------------------------------------------------------------------
function DrawCircle(x,y,z,r,g,b,a)
Citizen.InvokeNative(0x2A32FAA57B937173, 0x94FDAE17, x, y, z-0.95, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 0.25, r, g, b, a, 0, 0, 2, 0, 0, 0, 0)
end
function Notify(text, time)
TriggerClientEvent("vorp:TipRight", source, text, time)
end
function DrawInfo(text, x, y, size)
local xc = x / 1.0;
local yc = y / 1.0;
SetScriptGfxDrawOrder(3)
SetTextScale(size, size)
SetTextCentre(true)
SetTextColor(255, 255, 255, 100)
SetTextFontForCurrentCommand(6)
DisplayText(CreateVarString(10, 'LITERAL_STRING', text), xc, yc)
SetScriptGfxDrawOrder(3)
end
function DrawTxt(str, x, y, w, h, enableShadow, col1, col2, col3, a, center)
local str = CreateVarString(10, "LITERAL_STRING", str, Citizen.ResultAsLong())
SetTextScale(w, h)
SetTextColor(math.floor(col1), math.floor(col2), math.floor(col3), math.floor(a))
SetTextCentre(center)
if enableShadow then SetTextDropshadow(1, 0, 0, 0, 255) end
Citizen.InvokeNative(0xADA9255D, 10);
DisplayText(str, x, y)
end
|
local ObjectManager = require("managers.object.object_manager")
KnightTrials = ScreenPlay:new {}
function KnightTrials:startKnightTrials(pPlayer)
local randomShrinePlanet = JediTrials:getRandomDifferentShrinePlanet(pPlayer)
local pRandShrine = JediTrials:getRandomShrineOnPlanet(randomShrinePlanet)
if (pRandShrine == nil) then
return
end
JediTrials:setStartedTrials(pPlayer)
JediTrials:setTrialsCompleted(pPlayer, 0)
JediTrials:setCurrentTrial(pPlayer, 0)
self:setTrialShrine(pPlayer, pRandShrine)
local suiPrompt = getStringId("@jedi_trials:knight_trials_intro_msg") .. " " .. getStringId("@jedi_trials:" .. randomShrinePlanet) .. " " .. getStringId("@jedi_trials:knight_trials_intro_msg_end")
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt(suiPrompt)
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
end
function KnightTrials:noCallback(pPlayer, pSui, eventIndex, ...)
end
function KnightTrials:startNextKnightTrial(pPlayer)
if (pPlayer == nil) then
return
end
local playerFaction = CreatureObject(pPlayer):getFaction()
local playerCouncil = JediTrials:getJediCouncil(pPlayer)
if ((playerFaction == FACTIONIMPERIAL and playerCouncil == JediTrials.COUNCIL_LIGHT) or (playerFaction == FACTIONREBEL and playerCouncil == JediTrials.COUNCIL_DARK)) then
self:giveWrongFactionWarning(pPlayer, playerCouncil)
return
end
local trialsCompleted = JediTrials:getTrialsCompleted(pPlayer)
if (trialsCompleted >= #knightTrialQuests) then
dropObserver(KILLEDCREATURE, "KnightTrials", "notifyKilledHuntTarget", pPlayer)
deleteScreenPlayData(pPlayer, "JediTrials", "huntTarget")
deleteScreenPlayData(pPlayer, "JediTrials", "huntTargetCount")
deleteScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal")
JediTrials:unlockJediKnight(pPlayer)
return
end
local shrinePrompt = ""
if (trialsCompleted > 0) then
shrinePrompt = getStringId("@jedi_trials:knight_trials_current_trial_complete") .. " "
else
self:unsetTrialShrine(pPlayer)
end
local currentTrial = trialsCompleted + 1
JediTrials:setCurrentTrial(pPlayer, currentTrial)
local trialData = knightTrialQuests[currentTrial]
if (trialData.trialType == TRIAL_COUNCIL) then
self:sendCouncilChoiceSui(pPlayer)
return
end
local trialString = "@jedi_trials:" .. trialData.trialName
if (trialData.trialType == TRIAL_HUNT_FACTION) then
local councilChoice = JediTrials:getJediCouncil(pPlayer)
if (councilChoice == JediTrials.COUNCIL_LIGHT) then
trialString = trialString .. "_light"
else
trialString = trialString .. "_dark"
end
end
trialString = getStringId(trialString)
shrinePrompt = shrinePrompt .. trialString
if (trialData.huntGoal ~= nil and trialData.huntGoal > 1) then
shrinePrompt = shrinePrompt .. " 0 of " .. trialData.huntGoal
end
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt(shrinePrompt)
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
dropObserver(KILLEDCREATURE, "KnightTrials", "notifyKilledHuntTarget", pPlayer)
deleteScreenPlayData(pPlayer, "JediTrials", "huntTarget")
deleteScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal")
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetCount", 0)
if (trialData.trialType == TRIAL_HUNT or trialData.trialType == TRIAL_HUNT_FACTION) then
if (trialData.trialType == TRIAL_HUNT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.huntTarget)
else
local councilChoice = JediTrials:getJediCouncil(pPlayer)
if (councilChoice == JediTrials.COUNCIL_LIGHT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.rebelTarget)
else
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.imperialTarget)
end
end
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal", trialData.huntGoal)
createObserver(KILLEDCREATURE, "KnightTrials", "notifyKilledHuntTarget", pPlayer)
end
end
function KnightTrials:sendCouncilChoiceSui(pPlayer)
if (pPlayer == nil) then
return
end
local sui = SuiMessageBox.new("KnightTrials", "handleCouncilChoice")
sui.setPrompt("@jedi_trials:council_choice_msg")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setCancelButtonText("@jedi_trials:button_cancel") -- Cancel
sui.setOtherButtonText("@jedi_trials:button_lightside") -- Light Jedi Council
sui.setOkButtonText("@jedi_trials:button_darkside") -- Dark Jedi Council
-- Other Button setup subscribe
sui.setProperty("btnRevert", "OnPress", "RevertWasPressed=1\r\nparent.btnOk.press=t")
sui.subscribeToPropertyForEvent(SuiEventType.SET_onClosedOk, "btnRevert", "RevertWasPressed")
sui.sendTo(pPlayer)
end
function KnightTrials:handleCouncilChoice(pPlayer, pSui, eventIndex, ...)
if (pPlayer == nil) then
return
end
local cancelPressed = (eventIndex == 1)
local args = {...}
local lightSide = args[1]
if (cancelPressed) then
CreatureObject(pPlayer):sendSystemMessage("@jedi_trials:council_choice_delayed")
return
elseif (lightSide ~= nil) then -- Chose Light Side
KnightTrials:doCouncilDecision(pPlayer, JediTrials.COUNCIL_LIGHT)
elseif (eventIndex == 0) then -- Chose Dark Side
KnightTrials:doCouncilDecision(pPlayer, JediTrials.COUNCIL_DARK)
end
end
function KnightTrials:doCouncilDecision(pPlayer, choice)
if (pPlayer == nil) then
return
end
if (not JediTrials:isEligibleForKnightTrials(pPlayer)) then
self:failTrialsIneligible(pPlayer)
return
end
local playerFaction = CreatureObject(pPlayer):getFaction()
local musicFile
local successMsg
if (choice == JediTrials.COUNCIL_LIGHT) then
if (playerFaction == FACTIONIMPERIAL) then
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt("@jedi_trials:faction_wrong_choice_light")
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
return
end
musicFile = "sound/music_themequest_victory_rebel.snd"
successMsg = "@jedi_trials:council_chosen_light"
elseif (choice == JediTrials.COUNCIL_DARK) then
if (playerFaction == FACTIONREBEL) then
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt("@jedi_trials:faction_wrong_choice_dark")
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
return
end
musicFile = "sound/music_themequest_victory_imperial.snd"
successMsg = "@jedi_trials:council_chosen_dark"
end
JediTrials:setJediCouncil(pPlayer, choice)
CreatureObject(pPlayer):playMusicMessage(musicFile)
CreatureObject(pPlayer):sendSystemMessage(successMsg)
local trialsCompleted = JediTrials:getTrialsCompleted(pPlayer) + 1
JediTrials:setTrialsCompleted(pPlayer, trialsCompleted)
self:startNextKnightTrial(pPlayer)
end
function KnightTrials:notifyKilledHuntTarget(pPlayer, pVictim)
if (pVictim == nil or pPlayer == nil) then
return 0
end
local trialNumber = JediTrials:getCurrentTrial(pPlayer)
if (trialNumber <= 0) then
printLuaError("KnightTrials:notifyKilledHuntTarget, invalid trial for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber)
return 1
end
local trialData = knightTrialQuests[trialNumber]
if (trialData.trialType ~= TRIAL_HUNT and trialData.trialType ~= TRIAL_HUNT_FACTION) then
return 1
end
local playerFaction = CreatureObject(pPlayer):getFaction()
local playerCouncil = JediTrials:getJediCouncil(pPlayer)
if ((playerFaction == FACTIONIMPERIAL and playerCouncil == JediTrials.COUNCIL_LIGHT) or (playerFaction == FACTIONREBEL and playerCouncil == JediTrials.COUNCIL_DARK)) then
self:giveWrongFactionWarning(pPlayer, playerCouncil)
return 0
end
local huntTarget = readScreenPlayData(pPlayer, "JediTrials", "huntTarget")
local targetCount = tonumber(readScreenPlayData(pPlayer, "JediTrials", "huntTargetCount"))
local targetGoal = tonumber(readScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal"))
if (targetCount == nil) then
printLuaError("KnightTrials:notifyKilledHuntTarget, nil targetCount for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. " (player killed target: " .. SceneObject(pVictim):getObjectName() .. "). Setting to 0.")
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetCount", 0)
targetCount = 0
end
if (targetGoal == nil) then
printLuaError("KnightTrials:notifyKilledHuntTarget, nil targetGoal for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. " (player killed target: " .. SceneObject(pVictim):getObjectName() .. "). Setting to " .. trialData.huntGoal .. ".")
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal", trialData.huntGoal)
targetGoal = trialData.huntGoal
end
if (huntTarget == nil or huntTarget == "") then
local newTarget = ""
if (trialData.trialType == TRIAL_HUNT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.huntTarget)
newTarget = trialData.huntTarget
else
local councilChoice = JediTrials:getJediCouncil(pPlayer)
if (councilChoice == JediTrials.COUNCIL_LIGHT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.rebelTarget)
newTarget = trialData.rebelTarget
else
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.imperialTarget)
newTarget = trialData.imperialTarget
end
end
printLuaError("KnightTrials:notifyKilledHuntTarget, nil huntTarget for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. " (player killed target: " .. SceneObject(pVictim):getObjectName() .. "). Setting to " .. newTarget .. ".")
huntTarget = newTarget
end
if (SceneObject(pVictim):getZoneName() ~= SceneObject(pPlayer):getZoneName() or not CreatureObject(pPlayer):isInRangeWithObject(pVictim, 80)) then
return 0
end
local targetList = HelperFuncs:splitString(huntTarget, ";")
if (huntTarget == SceneObject(pVictim):getObjectName() or HelperFuncs:tableContainsValue(targetList, SceneObject(pVictim):getObjectName())) then
CreatureObject(pPlayer):sendSystemMessage("@jedi_trials:knight_trials_progress")
targetCount = targetCount + 1
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetCount", targetCount)
if (targetCount >= targetGoal) then
if (not JediTrials:isEligibleForKnightTrials(pPlayer)) then
self:failTrialsIneligible(pPlayer)
return 1
end
local trialsCompleted = JediTrials:getTrialsCompleted(pPlayer) + 1
JediTrials:setTrialsCompleted(pPlayer, trialsCompleted)
self:startNextKnightTrial(pPlayer)
return 1
end
end
return 0
end
function KnightTrials:failTrialsIneligible(pPlayer)
if (pPlayer == nil or JediTrials:isEligibleForKnightTrials(pPlayer)) then
return
end
local sui = SuiMessageBox.new("JediTrials", "emptyCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt("@jedi_trials:knight_trials_being_removed")
sui.setOkButtonText("@jedi_trials:button_close")
sui.sendTo(pPlayer)
JediTrials:resetTrialData(pPlayer, "knight")
self:unsetTrialShrine(pPlayer)
end
function KnightTrials:showCurrentTrial(pPlayer)
if (pPlayer == nil) then
return
end
local trialNumber = JediTrials:getCurrentTrial(pPlayer)
local trialsCompleted = JediTrials:getTrialsCompleted(pPlayer)
if (trialsCompleted == trialNumber) then
return
end
local trialData = knightTrialQuests[trialNumber]
if (trialData.trialType == TRIAL_COUNCIL) then
self:sendCouncilChoiceSui(pPlayer)
return
end
local playerFaction = CreatureObject(pPlayer):getFaction()
local playerCouncil = JediTrials:getJediCouncil(pPlayer)
if (trialData.trialType == TRIAL_HUNT or trialData.trialType == TRIAL_HUNT_FACTION) then
if ((playerFaction == FACTIONIMPERIAL and playerCouncil == JediTrials.COUNCIL_LIGHT) or (playerFaction == FACTIONREBEL and playerCouncil == JediTrials.COUNCIL_DARK)) then
self:giveWrongFactionWarning(pPlayer, playerCouncil)
return
end
end
local huntTarget = readScreenPlayData(pPlayer, "JediTrials", "huntTarget")
local targetCount = tonumber(readScreenPlayData(pPlayer, "JediTrials", "huntTargetCount"))
local targetGoal = tonumber(readScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal"))
if (targetCount == nil) then
printLuaError("KnightTrials:showCurrentTrial, nil targetCount for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. ". Setting to 0.")
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetCount", 0)
targetCount = 0
end
if (targetGoal == nil) then
printLuaError("KnightTrials:showCurrentTrial, nil targetGoal for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. ". Setting to " .. trialData.huntGoal .. ".")
writeScreenPlayData(pPlayer, "JediTrials", "huntTargetGoal", trialData.huntGoal)
targetGoal = trialData.huntGoal
end
if (huntTarget == nil or huntTarget == "") then
local newTarget = ""
if (trialData.trialType == TRIAL_HUNT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.huntTarget)
newTarget = trialData.huntTarget
else
local councilChoice = JediTrials:getJediCouncil(pPlayer)
if (councilChoice == JediTrials.COUNCIL_LIGHT) then
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.rebelTarget)
newTarget = trialData.rebelTarget
else
writeScreenPlayData(pPlayer, "JediTrials", "huntTarget", trialData.imperialTarget)
newTarget = trialData.imperialTarget
end
end
printLuaError("KnightTrials:showCurrentTrial, nil huntTarget for player: " .. SceneObject(pPlayer):getCustomObjectName() .. " on trial " .. trialNumber .. ". Setting to " .. newTarget .. ".")
huntTarget = newTarget
end
local shrinePrompt = "@jedi_trials:" .. trialData.trialName
if (trialData.trialType == TRIAL_HUNT_FACTION) then
local councilChoice = JediTrials:getJediCouncil(pPlayer)
if (councilChoice == JediTrials.COUNCIL_LIGHT) then
shrinePrompt = shrinePrompt .. "_light"
else
shrinePrompt = shrinePrompt .. "_dark"
end
end
shrinePrompt = getStringId(shrinePrompt)
if (trialData.huntGoal ~= nil and trialData.huntGoal > 1) then
shrinePrompt = shrinePrompt .. " " .. targetCount .. " of " .. trialData.huntGoal
end
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
sui.setPrompt(shrinePrompt)
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
end
function KnightTrials:setTrialShrine(pPlayer, pShrine)
writeScreenPlayData(pPlayer, "JediTrials", "trialShrineID", SceneObject(pShrine):getObjectID())
end
function KnightTrials:unsetTrialShrine(pPlayer, pShrine)
deleteScreenPlayData(pPlayer, "JediTrials", "trialShrineID")
end
function KnightTrials:getTrialShrine(pPlayer)
local shrineID = tonumber(readScreenPlayData(pPlayer, "JediTrials", "trialShrineID"))
if (shrineID == nil or shrineID == 0) then
return nil
end
local pShrine = getSceneObject(shrineID)
return pShrine
end
function KnightTrials:onPlayerLoggedIn(pPlayer)
if (pPlayer == nil) then
return
end
if (JediTrials:isEligibleForKnightTrials(pPlayer) and not JediTrials:isOnKnightTrials(pPlayer)) then
KnightTrials:startKnightTrials(pPlayer)
elseif (JediTrials:isOnKnightTrials(pPlayer)) then
local trialNumber = JediTrials:getCurrentTrial(pPlayer)
if (trialNumber <= 0) then
return
end
local trialData = knightTrialQuests[trialNumber]
if (trialData.trialType == TRIAL_HUNT or trialData.trialType == TRIAL_HUNT_FACTION) then
dropObserver(KILLEDCREATURE, "KnightTrials", "notifyKilledHuntTarget", pPlayer)
createObserver(KILLEDCREATURE, "KnightTrials", "notifyKilledHuntTarget", pPlayer)
end
end
end
function KnightTrials:giveWrongFactionWarning(pPlayer, councilType)
if (pPlayer == nil) then
return
end
local sui = SuiMessageBox.new("KnightTrials", "noCallback")
sui.setTitle("@jedi_trials:knight_trials_title")
if (councilType == JediTrials.COUNCIL_LIGHT) then
sui.setPrompt("@jedi_trials:faction_wrong_light") -- To become a Light Jedi, you cannot be a member of the Empire. You must revoke your status as an Imperial in order to continue.
else
sui.setPrompt("@jedi_trials:faction_wrong_dark") -- To become a Dark Jedi, you cannot be a member of the Rebel Alliance. You must revoke your status as a Rebel in order to continue.
end
sui.setOkButtonText("@jedi_trials:button_close")
sui.hideCancelButton()
sui.sendTo(pPlayer)
end
function KnightTrials:resetCompletedTrialsToStart(pPlayer)
if (pPlayer == nil) then
return
end
JediTrials:resetTrialData(pPlayer, "knight")
deleteScreenPlayData(pPlayer, "KnightTrials", "completedTrials")
JediTrials:setStartedTrials(pPlayer)
JediTrials:setTrialsCompleted(pPlayer, 0)
JediTrials:setCurrentTrial(pPlayer, 0)
end
|
return {
version = "1.4",
luaversion = "5.1",
tiledversion = "1.4.3",
orientation = "orthogonal",
renderorder = "right-down",
width = 32,
height = 22,
tilewidth = 8,
tileheight = 8,
nextlayerid = 5,
nextobjectid = 1352,
properties = {},
tilesets = {
{
name = "tiles-overworld",
firstgid = 1,
filename = "../../../../../tiled/new_tilesets/tiles-overworld.tsx",
tilewidth = 8,
tileheight = 8,
spacing = 0,
margin = 0,
columns = 36,
image = "../../graphics/tiles-overworld.png",
imagewidth = 288,
imageheight = 128,
objectalignment = "unspecified",
tileoffset = {
x = 0,
y = 0
},
grid = {
orientation = "orthogonal",
width = 8,
height = 8
},
properties = {},
terrains = {},
tilecount = 576,
tiles = {}
},
{
name = "collide8",
firstgid = 577,
filename = "../../../../../tiled/new_tilesets/collide8.tsx",
tilewidth = 8,
tileheight = 8,
spacing = 0,
margin = 0,
columns = 1,
image = "../../graphics/collider8.png",
imagewidth = 8,
imageheight = 8,
objectalignment = "unspecified",
tileoffset = {
x = 0,
y = 0
},
grid = {
orientation = "orthogonal",
width = 8,
height = 8
},
properties = {},
terrains = {},
tilecount = 1,
tiles = {}
}
},
layers = {
{
type = "tilelayer",
x = 0,
y = 0,
width = 32,
height = 22,
id = 2,
name = "Water_layer",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
},
{
type = "tilelayer",
x = 0,
y = 0,
width = 32,
height = 22,
id = 1,
name = "Ground_layer",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 0, 0, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
},
{
type = "tilelayer",
x = 0,
y = 0,
width = 32,
height = 22,
id = 3,
name = "Collision_layer",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220,
255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256,
217, 218, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 221, 222, 217, 218, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220,
253, 254, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 257, 258, 253, 254, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256,
0, 0, 217, 218, 219, 220, 219, 220, 219, 220, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 218, 219, 220, 219, 220, 219, 220,
0, 0, 253, 254, 255, 256, 255, 256, 255, 256, 255, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 254, 255, 256, 255, 256, 255, 256,
0, 0, 0, 0, 217, 218, 219, 220, 219, 220, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 219, 220, 219, 220,
0, 0, 0, 0, 253, 254, 255, 256, 255, 256, 255, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 256, 255, 256, 255, 256,
0, 0, 0, 0, 0, 0, 217, 218, 219, 220, 219, 220, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 217, 218, 219, 220, 219, 220,
0, 0, 0, 0, 0, 0, 253, 254, 255, 256, 255, 256, 0, 0, 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 0, 0, 253, 254, 255, 256, 255, 256,
0, 0, 0, 0, 0, 0, 0, 0, 217, 218, 221, 222, 0, 0, 0, 0, 3, 4, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 219, 220, 219, 220,
0, 0, 0, 0, 0, 0, 0, 0, 253, 254, 257, 258, 0, 0, 0, 0, 39, 40, 0, 0, 39, 40, 0, 0, 0, 0, 0, 0, 255, 256, 255, 256,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 145, 146, 219, 220, 219, 220,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 0, 0, 181, 182, 255, 256, 255, 256,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 219, 220, 219, 220,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 256, 255, 256, 255, 256,
0, 0, 0, 0, 0, 0, 0, 0, 145, 146, 149, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 146, 219, 220, 219, 220, 219, 220,
0, 0, 0, 0, 0, 0, 0, 0, 181, 182, 185, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 182, 255, 256, 255, 256, 255, 256,
219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 149, 150, 145, 146, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220,
255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 185, 186, 181, 182, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256,
219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220, 219, 220,
255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256, 255, 256
}
},
{
type = "objectgroup",
draworder = "topdown",
id = 4,
name = "Collide",
visible = false,
opacity = 0.5,
offsetx = 0,
offsety = 0,
properties = {},
objects = {
{
id = 1247,
name = "",
type = "",
shape = "rectangle",
x = 0,
y = 24,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1248,
name = "",
type = "",
shape = "rectangle",
x = 8,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1249,
name = "",
type = "",
shape = "rectangle",
x = 16,
y = 40,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1250,
name = "",
type = "",
shape = "rectangle",
x = 24,
y = 48,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1251,
name = "",
type = "",
shape = "rectangle",
x = 32,
y = 56,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1252,
name = "",
type = "",
shape = "rectangle",
x = 40,
y = 64,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1253,
name = "",
type = "",
shape = "rectangle",
x = 48,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1254,
name = "",
type = "",
shape = "rectangle",
x = 56,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1255,
name = "",
type = "",
shape = "rectangle",
x = 64,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1256,
name = "",
type = "",
shape = "rectangle",
x = 72,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1258,
name = "",
type = "",
shape = "rectangle",
x = 80,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1259,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1260,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1261,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1262,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 64,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1263,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 56,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1264,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 48,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1265,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 40,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1266,
name = "",
type = "",
shape = "rectangle",
x = 96,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1267,
name = "",
type = "",
shape = "rectangle",
x = 104,
y = 24,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1268,
name = "",
type = "",
shape = "rectangle",
x = 112,
y = 24,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1269,
name = "",
type = "",
shape = "rectangle",
x = 120,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1270,
name = "",
type = "",
shape = "rectangle",
x = 128,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1271,
name = "",
type = "",
shape = "rectangle",
x = 136,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1272,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1273,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1274,
name = "",
type = "",
shape = "rectangle",
x = 160,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1275,
name = "",
type = "",
shape = "rectangle",
x = 168,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1276,
name = "",
type = "",
shape = "rectangle",
x = 184,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1277,
name = "",
type = "",
shape = "rectangle",
x = 176,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1278,
name = "",
type = "",
shape = "rectangle",
x = 192,
y = 40,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1279,
name = "",
type = "",
shape = "rectangle",
x = 200,
y = 48,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1280,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 56,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1281,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 64,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1282,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1283,
name = "",
type = "",
shape = "rectangle",
x = 216,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1284,
name = "",
type = "",
shape = "rectangle",
x = 224,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1285,
name = "",
type = "",
shape = "rectangle",
x = 224,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1286,
name = "",
type = "",
shape = "rectangle",
x = 216,
y = 104,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1287,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 112,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1288,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 120,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1289,
name = "",
type = "",
shape = "rectangle",
x = 208,
y = 128,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1290,
name = "",
type = "",
shape = "rectangle",
x = 200,
y = 136,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1291,
name = "",
type = "",
shape = "rectangle",
x = 192,
y = 144,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1292,
name = "",
type = "",
shape = "rectangle",
x = 184,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1293,
name = "",
type = "",
shape = "rectangle",
x = 176,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1294,
name = "",
type = "",
shape = "rectangle",
x = 168,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1295,
name = "",
type = "",
shape = "rectangle",
x = 160,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1296,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1297,
name = "",
type = "",
shape = "rectangle",
x = 136,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1299,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1300,
name = "",
type = "",
shape = "rectangle",
x = 128,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1301,
name = "",
type = "",
shape = "rectangle",
x = 120,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1302,
name = "",
type = "",
shape = "rectangle",
x = 112,
y = 160,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1303,
name = "",
type = "",
shape = "rectangle",
x = 104,
y = 160,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1304,
name = "",
type = "",
shape = "rectangle",
x = 96,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1305,
name = "",
type = "",
shape = "rectangle",
x = 88,
y = 144,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1306,
name = "",
type = "",
shape = "rectangle",
x = 80,
y = 136,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1307,
name = "",
type = "",
shape = "rectangle",
x = 72,
y = 136,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1308,
name = "",
type = "",
shape = "rectangle",
x = 64,
y = 144,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1309,
name = "",
type = "",
shape = "rectangle",
x = 56,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1310,
name = "",
type = "",
shape = "rectangle",
x = 48,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1311,
name = "",
type = "",
shape = "rectangle",
x = 32,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1312,
name = "",
type = "",
shape = "rectangle",
x = 40,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1313,
name = "",
type = "",
shape = "rectangle",
x = 24,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1314,
name = "",
type = "",
shape = "rectangle",
x = 16,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1315,
name = "",
type = "",
shape = "rectangle",
x = 8,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1316,
name = "",
type = "",
shape = "rectangle",
x = 0,
y = 152,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1317,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 144,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1318,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 136,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1319,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 128,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1324,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 120,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1325,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 112,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1326,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 104,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1327,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1328,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1329,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1330,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1331,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 64,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1332,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 56,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1333,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 48,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1334,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 40,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1335,
name = "",
type = "",
shape = "rectangle",
x = -8,
y = 32,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1336,
name = "",
type = "",
shape = "rectangle",
x = 128,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1337,
name = "",
type = "",
shape = "rectangle",
x = 136,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1338,
name = "",
type = "",
shape = "rectangle",
x = 136,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1339,
name = "",
type = "",
shape = "rectangle",
x = 128,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1340,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1341,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 72,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1342,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1343,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 80,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1344,
name = "",
type = "",
shape = "rectangle",
x = 160,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1345,
name = "",
type = "",
shape = "rectangle",
x = 168,
y = 88,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1346,
name = "",
type = "",
shape = "rectangle",
x = 168,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1347,
name = "",
type = "",
shape = "rectangle",
x = 160,
y = 96,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1348,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 104,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1349,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 104,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1350,
name = "",
type = "",
shape = "rectangle",
x = 152,
y = 112,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
},
{
id = 1351,
name = "",
type = "",
shape = "rectangle",
x = 144,
y = 112,
width = 8,
height = 8,
rotation = 0,
gid = 577,
visible = true,
properties = {}
}
}
}
}
}
|
function PLUGIN:PostLoadData()
local query = mysql:Create("gmodz_squads")
query:Create("owner", "VARCHAR(20) NOT NULL") -- steamid64
query:Create("name", "VARCHAR(64) NOT NULL") -- Max squad name length: 64 characters
query:Create("description", "TEXT")
query:Create("logo", "VARCHAR(15) DEFAULT NULL") -- Imgur ID
query:Create("color", "VARCHAR(20) DEFAULT NULL")
query:PrimaryKey("owner")
query:Execute()
end
function PLUGIN:PlayerLoadedCharacter(client, character)
timer.Simple(0.25, function()
ix.squad.Restore(character:GetSquadID(), client:SteamID64(), function(squad)
if (IsValid(client) and character) then
if (squad and squad.Sync) then
squad:Sync(client, true)
else
character:SetSquadID("NULL")
character:SetSquadOfficer(0)
end
end
end)
end)
end
function PLUGIN:PreCharacterDeleted(client, character)
local squad = ix.squad.list[character:GetSquadID()]
local steamID64 = client:SteamID64()
if (squad and squad.members[steamID64]) then
if (squad.owner == steamID64) then
ix.squad.Disband(steamID64, squad:GetReceivers())
squad = nil
else
squad.members[steamID64] = nil
squad:Sync()
net.Start("ixSquadKick")
net.WriteString(squad.owner)
net.WriteBool(false)
net.Send(client)
end
else
ix.squad.Disband(steamID64)
end
end
function PLUGIN:PostPlayerLoadout(client)
local squad = ix.squad.list[client:GetCharacter():GetSquadID()] or {}
local color = squad.color
if (color) then
client:SetPlayerColor(Vector(color.r / 255, color.g / 255, color.b / 255))
end
end
net.Receive("ixSquadCreate", function(_, client)
if ((client.ixSquadCreateTry or 0) < CurTime()) then
client.ixSquadCreateTry = CurTime() + 30
else
client:NotifyLocalized("squad_create_wait")
return
end
local character = client:GetCharacter()
if (!character or character:GetSquadID() != "NULL") then return end
local name = tostring(net.ReadString()):gsub("\r\n", ""):gsub("\n", "")
name = string.Trim(name)
if (name:utf8len() < 1 or !name:find("%S") or name:gsub("%s", ""):utf8len() > 49) then
client.ixSquadCreateTry = nil
return
end
ix.squad.New(name, client:SteamID64(), function(squad) -- insert
if (IsValid(client)) then
if (squad) then
character:SetSquadOfficer(0)
character:SetSquadID(squad.owner)
squad:Sync(client)
client:NotifyLocalized("squad_successfully_created", squad.name)
end
client.ixSquadCreateTry = nil
end
end, function(squad) -- restore
if (IsValid(client)) then
if (squad and squad.Sync) then
print("SQUAD - RESTORED", squad.name, client:Name())
squad:Sync(client, true)
else
print("SQUAD - DON'T RESTORED", client:Name())
character:SetSquadID("NULL")
character:SetSquadOfficer(0)
end
end
end)
end)
net.Receive("ixSquadSettings", function(_, client)
local data = net.ReadTable()
if (table.IsEmpty(data) or !client:GetCharacter()) then return end
local squad = ix.squad.list[client:GetCharacter():GetSquadID()]
if (squad and squad:IsLeader(client)) then
if (data.name) then
local name = tostring(data.name):gsub("\r\n", ""):gsub("\n", "")
name = string.Trim(name)
if (name:utf8len() < 1 or !name:find("%S")) then
data.name = nil
else
if (name:gsub("%s", ""):utf8len() > 48) then
name = name:utf8sub(0, 48)
end
squad.name = name
end
end
if (data.description) then
local desc = string.Trim(tostring(data.description))
if (!desc:find("%S")) then
squad.description = ""
else
if (desc:utf8len() < 1) then
desc = ""
elseif (desc:gsub("%s", ""):utf8len() > 2048) then
desc = desc:utf8sub(0, 2048)
end
squad.description = desc
end
end
local isLogo = isstring(data.logoID)
if (isLogo) then
squad.logo = data.logoID
end
local isColor = ix.util.IsColor(data.color)
if (isColor) then
data.color.a = 255
squad.color = data.color
end
if (!table.IsEmpty(data)) then
local query = mysql:Update("gmodz_squads")
if (data.name) then query:Update("name", squad.name) end
if (data.description) then query:Update("description", squad.description) end
if (isLogo) then query:Update("logo", data.logoID) end
if (isColor) then query:Update("color", string.FromColor(data.color)) end
query:Where("owner", squad.owner)
query:Execute()
squad:Sync(nil, isColor)
end
isLogo, isColor = nil, nil
end
data = nil
end)
net.Receive("ixSquadInvite", function(_, client)
local id = client:GetCharacter() and client:GetCharacter():GetSquadID()
if (!id or id == "NULL") then return end
local squad = ix.squad.list[id]
if (!squad) then return end
local target = net.ReadEntity()
if (IsValid(target) and client:GetPos():DistToSqr(target:GetPos()) < 160 * 160) then
target:NotifyLocalized("squad_invite", client:Nick(), squad.name)
target.squad_invite = {CurTime() + 30, client:UserID()}
end
end)
net.Receive("ixSquadKickMember", function(_, client)
if ((client.ixSquadKickTry or 0) < CurTime()) then
client.ixSquadKickTry = CurTime() + 2
else
return
end
local steamID64 = net.ReadString()
if (!isstring(steamID64) or #steamID64 == 0) then return end
local index = player.GetBySteamID64(steamID64)
if (index) then
ix.squad.KickMember(index, client)
else
ix.squad.KickMember_Offline(steamID64, client)
end
end)
net.Receive("ixSquadDisband", function(_, client)
if ((client.ixSquadKickTry or 0) < CurTime()) then
client.ixSquadKickTry = CurTime() + 2
else
return
end
ix.squad.KickMember(client, client)
end)
net.Receive("ixSquadRankChange", function(_, client)
if ((client.ixSquadRankTry or 0) < CurTime()) then
client.ixSquadRankTry = CurTime() + 2
else
return
end
local steamID64 = net.ReadString()
if (!isstring(steamID64) or #steamID64 == 0 or steamID64 == client:SteamID64()) then return end
local index = player.GetBySteamID64(steamID64)
if (index) then
ix.squad.ChangeRank(index, client)
else
ix.squad.ChangeRank_Offline(steamID64, client)
end
end)
net.Receive("ixSquadLeave", function(_, client)
if (IsValid(client)) then
local character = client:GetCharacter()
if (!character) then return end
local squad = ix.squad.list[character:GetSquadID()]
if (!squad or squad:IsLeader()) then return end
if (squad.members[client:SteamID64()]) then
net.Start("ixSquadLeave")
net.WriteString(squad.owner)
net.Send(client)
squad.members[client:SteamID64()] = nil
character:SetSquadID("NULL")
character:SetSquadOfficer(0)
squad:Sync()
end
end
end) |
local ffi = require("ffi")
local ffi_util = require("common.ffi_util")
do --- test-ffi-bitfield
local x = ffi.new([[
union {
uint32_t u;
struct { int a:10,b:10,c:11,d:1; };
struct { unsigned int e:10,f:10,g:11,h:1; };
struct { int8_t i:4,j:5,k:5,l:3; };
struct { _Bool b0:1,b1:1,b2:1,b3:1; };
}
]])
-- bitfield access
x.u = 0xffffffff
assert(x.a == -1 and x.b == -1 and x.c == -1 and x.d == -1)
assert(x.e == 1023 and x.f == 1023 and x.g == 2047 and x.h == 1)
assert(x.i == -1 and x.j == -1 and x.k == -1 and x.l == -1)
assert(x.b0 == true and x.b1 == true and x.b2 == true and x.b3 == true)
x.u = 0x12345678
if ffi.abi("le") then
assert(x.a == -392 and x.b == 277 and x.c == 291 and x.d == 0)
assert(x.e == 632 and x.f == 277 and x.g == 291 and x.h == 0)
assert(x.i == -8 and x.j == -10 and x.k == -12 and x.l == 1)
assert(x.b0 == false and x.b1 == false and x.b2 == false and x.b3 == true)
else
assert(x.a == 72 and x.b == -187 and x.c == 828 and x.d == 0)
assert(x.e == 72 and x.f == 837 and x.g == 828 and x.h == 0)
assert(x.i == 1 and x.j == 6 and x.k == 10 and x.l == -2)
assert(x.b0 == false and x.b1 == false and x.b2 == false and x.b3 == true)
end
x.u = 0xe8d30edc
if ffi.abi("le") then
assert(x.a == -292 and x.b == 195 and x.c == -371 and x.d == -1)
assert(x.e == 732 and x.f == 195 and x.g == 1677 and x.h == 1)
assert(x.i == -4 and x.j == 14 and x.k == -13 and x.l == -2)
assert(x.b0 == false and x.b1 == false and x.b2 == true and x.b3 == true)
else
assert(x.a == -93 and x.b == 304 and x.c == -146 and x.d == 0)
assert(x.e == 931 and x.f == 304 and x.g == 1902 and x.h == 0)
assert(x.i == -2 and x.j == -6 and x.k == 1 and x.l == -2)
assert(x.b0 == true and x.b1 == true and x.b2 == true and x.b3 == false)
end
-- bitfield insert
x.u = 0xffffffff
x.a = 0
if ffi.abi("le") then
assert(x.u == 0xfffffc00)
else
assert(x.u == 0x003fffff)
end
x.u = 0
x.a = -1
if ffi.abi("le") then
assert(x.u == 0x3ff)
else
assert(x.u == 0xffc00000)
end
x.u = 0xffffffff
x.b = 0
if ffi.abi("le") then
assert(x.u == 0xfff003ff)
else
assert(x.u == 0xffc00fff)
end
x.u = 0
x.b = -1
if ffi.abi("le") then
assert(x.u == 0x000ffc00)
else
assert(x.u == 0x003ff000)
end
-- cumulative bitfield insert
x.u = 0xffffffff
if ffi.abi("le") then
x.a = -392; x.b = 277; x.c = 291; x.d = 0
else
x.a = 72; x.b = -187; x.c = 828; x.d = 0
end
assert(x.u == 0x12345678)
x.u = 0
if ffi.abi("le") then
x.a = -392; x.b = 277; x.c = 291; x.d = 0
else
x.a = 72; x.b = -187; x.c = 828; x.d = 0
end
assert(x.u == 0x12345678)
x.u = 0xffffffff
x.b0 = true; x.b1 = false; x.b2 = true; x.b3 = false
if ffi.abi("le") then
assert(x.u == 0xfffffff5)
else
assert(x.u == 0xafffffff)
end
x.u = 0
x.b0 = true; x.b1 = false; x.b2 = true; x.b3 = false
if ffi.abi("le") then
assert(x.u == 0x00000005)
else
assert(x.u == 0xa0000000)
end
end
|
--************************
--ChoiceMenu
--************************
ChoiceMenu = {}
ChoiceMenu.__index = ChoiceMenu
function ChoiceMenu.new(text, callback)
local self = setmetatable({}, ChoiceMenu)
self.menuItems = {}
self.currMenuItem = 1
self.win = nil
return self
end
function ChoiceMenu:onInput(input)
if input.down then
self.currMenuItem = math.min(#self.menuItems, self.currMenuItem + 1)
elseif input.up then
self.currMenuItem = math.max(1, self.currMenuItem - 1)
elseif input.ok then
if self.menuItems[self.currMenuItem].callback ~= nil then
self.menuItems[self.currMenuItem].callback()
end
end
--[[
if input.up then
if self:hasChoiceMenu() then
self.choiceMenu.currMenuItem = math.max(1, self.choiceMenu.currMenuItem - 1)
end
elseif input.right then
if self:hasChoiceMenu() then
self.choiceMenu.currMenuItem = math.min(#self.choiceMenu.menuItems, self.choiceMenu.currMenuItem + 1)
end
elseif input.down then
if self:hasChoiceMenu() then
self.choiceMenu.currMenuItem = math.min(#self.choiceMenu.menuItems, self.choiceMenu.currMenuItem + 1)
end
elseif input.left then
elseif input.ok then
if self.choiceMenu.menuItems[self.choiceMenu.currMenuItem].callback ~= nil then
self.choiceMenu.menuItems[self.choiceMenu.currMenuItem].callback()
end
]]--
end
function ChoiceMenu:update(dt)
end
function ChoiceMenu:render(x, y)
for i, menuItem in ipairs(self.menuItems) do
if (self.currMenuItem == i) then
engine.renderTextLine('-' .. menuItem.text, x, y +((i-1)* 8));
else
engine.renderTextLine(menuItem.text, x, y +((i-1)* 8));
end
end
end
function ChoiceMenu:addMenuItem(newMenuItem)
table.insert(self.menuItems, newMenuItem)
end
function ChoiceMenu:resetMenu()
self.menuItems = {}
end
return ChoiceMenu
|
require 'nngraph'
local utils = require 'utils.utils'
local layer, parent = torch.class('nn.MultiModel', 'nn.Module')
function layer:__init(opt, nLabel)
parent.__init(self)
local parms = {}
parms.conv_feat_size = utils.getopt(opt, 'conv_feat_size', 256)
parms.multfeat_dim = utils.getopt(opt, 'multfeat_dim', 256)
parms.attfeat_dim = utils.getopt(opt, 'attfeat_dim', 256)
parms.conv_feat_num = utils.getopt(opt, 'conv_feat_num', 196)
parms.height = math.sqrt(parms.conv_feat_num)
parms.drop_ratio = utils.getopt(opt, 'drop_prob_mm', 0.5)
parms.text_feat_num = utils.getopt(opt, 'text_feat_num', 5)
self.deathRate = utils.getopt(opt, 'deathRate', 0.5)
if self.deathRate == 0 then print ('--> the death Rate is set to zero') end
-- build model
local SpatialConvolution = cudnn.SpatialConvolution
local Avg = cudnn.SpatialAveragePooling
local ReLU = cudnn.ReLU
local Max = nn.SpatialMaxPooling
local SoftMax = cudnn.SoftMax
local Tanh = cudnn.Tanh
local ifeat = nn.Identity()() -- image convolutional feat BxDxhxw
local sfeat = nn.Identity()() -- language feat BxDx5
local in_qfeat = nn.Dropout(parms.drop_ratio)(sfeat)
local in_ifeat = nn.Dropout(parms.drop_ratio)(ifeat)
-- do a image feature embedding to Tanh range
in_ifeat = Tanh()(SpatialConvolution(parms.conv_feat_size, parms.multfeat_dim, 1,1,1,1,0,0)(in_ifeat))
-- do a text feature embedding to Tanh range
in_qfeat = nn.View(parms.multfeat_dim, parms.text_feat_num, 1)(in_qfeat)
in_qfeat = Tanh()(SpatialConvolution(parms.multfeat_dim, parms.multfeat_dim, 1,1,1,1,0,0)(in_qfeat))
in_qfeat = nn.View(parms.multfeat_dim, parms.text_feat_num)(in_qfeat)
-- image attention
local globqfeat = nn.Mean(2,2)(in_qfeat)
local qfeatatt = nn.Replicate(parms.conv_feat_num, 3)(nn.Linear(parms.multfeat_dim, parms.attfeat_dim)(globqfeat))
local ifeatproj = SpatialConvolution(parms.multfeat_dim, parms.attfeat_dim, 1,1,1,1,0,0)(in_ifeat)
local ifeatatt = nn.View(parms.attfeat_dim, parms.conv_feat_num):setNumInputDims(3)(ifeatproj)
local addfeat = nn.View(parms.attfeat_dim,parms.conv_feat_num,1):setNumInputDims(2)(Tanh()(nn.CAddTable()({ifeatatt, qfeatatt})))
-- local iattscore = nn.View(parms.conv_feat_num):setNumInputDims(3)(SpatialConvolution(parms.attfeat_dim,1,1,1,1,1,0,0)(addfeat))
-- text attention
local globifeat = nn.View(parms.multfeat_dim):setNumInputDims(3)(Avg(parms.height,parms.height,1,1)(in_ifeat))
local ifeatatt = nn.Replicate(parms.text_feat_num, 3)(nn.Linear(parms.multfeat_dim, parms.attfeat_dim)(globifeat))
local tfeatproj = SpatialConvolution(parms.multfeat_dim, parms.attfeat_dim, 1,1,1,1,0,0)(nn.View(parms.multfeat_dim,parms.text_feat_num,1):setNumInputDims(2)(in_qfeat))
tfeatproj = nn.View(parms.multfeat_dim, parms.text_feat_num):setNumInputDims(3)(tfeatproj)
local addfeat2 = nn.View(parms.attfeat_dim,parms.text_feat_num,1):setNumInputDims(2)(Tanh()(nn.CAddTable()({ifeatatt, tfeatproj})))
-- local qattscore = nn.View(parms.text_feat_num):setNumInputDims(3)(SpatialConvolution(parms.attfeat_dim,1,1,1,1,1,0,0)(addfeat2))
-- global attention
local attfeat_join = nn.JoinTable(2, 3)({addfeat, addfeat2})
att = nn.View(parms.text_feat_num+parms.conv_feat_num):setNumInputDims(3)(SpatialConvolution(parms.attfeat_dim,1,1,1,1,1,0,0)(attfeat_join))
att = SoftMax()(att)
local flat_ifeat = nn.View(parms.multfeat_dim, parms.conv_feat_num):setNumInputDims(3)(in_ifeat)
local joint_feat = nn.JoinTable(2,2)({flat_ifeat, in_qfeat})
local att_feat = nn.MV()({joint_feat, att})
-- concat context vector and image feat
local output_feat = nn.CAddTable()({att_feat, globifeat})
local out = nn.Linear(parms.multfeat_dim, nLabel)(nn.Dropout(0.5)(output_feat))
self.model = nn.gModule({ifeat, sfeat}, {out, att})
-- stochastic
self.gate = true
self.train = true
end
function layer:sampleGates()
self.gate = true
if torch.rand(1)[1] < self.deathRate then
self.gate = false
end
end
function layer:parameters()
return self.model:parameters()
end
function layer:training()
self.model:training()
self.train = true
end
function layer:evaluate()
self.model:evaluate()
self.train = false
end
--[[
input: 1) conv_image_feats 2) text_feats
---]]
function layer:updateOutput(input)
self:sampleGates()
local ifeat = input[1]
local tfeat = input[2]
-- assert(ifeat:size(2) == tfeat:size(2), string.format('unmatch feat size %d ~= %d',ifeat:size(2), tfeat:size(2)))
if self.train then
if self.gate == false then
tfeat:zero()
end
else -- evaluate mode
tfeat:mul(1-self.deathRate)
end
self.model:forward({ifeat, tfeat})
self.output = self.model.output
return self.output
end
function layer:updateGradInput(input, gradOutput)
local ifeat = input[1]
local tfeat = input[2]
-- if self.train then
-- if self.gate == false then
-- assert(tfeat:sum() == 0)
-- end
-- end
self.model:backward(input, gradOutput)
self.gradInput = self.model.gradInput
if self.train then
if self.gate == false then
self.gradInput[2]:zero()
end
end
return self.gradInput
end |
object_mobile_rebel_emperorsday_vendor = object_mobile_shared_rebel_emperorsday_vendor:new {
}
ObjectTemplates:addTemplate(object_mobile_rebel_emperorsday_vendor, "object/mobile/rebel_emperorsday_vendor.iff")
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
--Cache global variables
--Lua functions
local floor = math.floor
--WoW API / Variables
local CreateFrame = CreateFrame
function UF:Construct_AltPowerBar(frame)
local altpower = CreateFrame("StatusBar", nil, frame)
altpower:SetStatusBarTexture(E.media.blankTex)
UF.statusbars[altpower] = true
altpower:GetStatusBarTexture():SetHorizTile(false)
altpower.PostUpdate = UF.AltPowerBarPostUpdate
altpower:CreateBackdrop("Default", true)
altpower.text = altpower:CreateFontString(nil, 'OVERLAY')
altpower.text:Point("CENTER")
altpower.text:SetJustifyH("CENTER")
UF:Configure_FontString(altpower.text)
altpower:SetScript("OnShow", UF.ToggleResourceBar)
altpower:SetScript("OnHide", UF.ToggleResourceBar)
return altpower
end
function UF:AltPowerBarPostUpdate(unit, cur, _, max)
if not self.barType then return end
local perc = (cur and max and max > 0) and floor((cur/max)*100) or 0
local parent = self:GetParent()
if perc < 35 then
self:SetStatusBarColor(0, 1, 0)
elseif perc < 70 then
self:SetStatusBarColor(1, 1, 0)
else
self:SetStatusBarColor(1, 0, 0)
end
if unit == "player" and self.text then
if perc > 0 then
self.text:SetFormattedText("%s: %d%%", self.powerName, perc)
else
self.text:SetFormattedText("%s: 0%%", self.powerName)
end
elseif unit and unit:find("boss%d") and self.text then
self.text:SetTextColor(self:GetStatusBarColor())
if not parent.Power.value:GetText() or parent.Power.value:GetText() == "" then
self.text:Point("BOTTOMRIGHT", parent.Health, "BOTTOMRIGHT")
else
self.text:Point("RIGHT", parent.Power.value, "LEFT", 2, E.mult)
end
if perc > 0 then
self.text:SetFormattedText("|cffD7BEA5[|r%d%%|cffD7BEA5]|r", perc)
else
self.text:SetText(nil)
end
end
end
function UF:Configure_AltPower(frame)
if not frame.VARIABLES_SET then return end
local altpower = frame.AlternativePower
if frame.USE_POWERBAR then
frame:EnableElement('AlternativePower')
altpower.text:SetAlpha(1)
altpower:Point("BOTTOMLEFT", frame.Health.backdrop, "TOPLEFT", frame.BORDER, frame.SPACING+frame.BORDER)
if not frame.USE_PORTRAIT_OVERLAY then
altpower:Point("TOPRIGHT", frame, "TOPRIGHT", -(frame.PORTRAIT_WIDTH+frame.BORDER), -frame.BORDER)
else
altpower:Point("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER, -frame.BORDER)
end
altpower.Smooth = UF.db.smoothbars
else
frame:DisableElement('AlternativePower')
altpower.text:SetAlpha(0)
altpower:Hide()
end
end
|
--[[
s:UI Context Menu: Units (and Friends)
TODO: BIG FAT conditions cleanup. (Took most of them from ContextMenuPlayer)
Martin Karer / Sezz, 2014
http://www.sezz.at
--]]
local MAJOR, MINOR = "Sezz:Controls:ContextMenu-0.1", 1;
local ContextMenu = Apollo.GetPackage(MAJOR).tPackage;
if (ContextMenu and (ContextMenu.nVersion or 0) > MINOR) then return; end
local Apollo, GameLib, GroupLib, FriendshipLib, P2PTrading, MatchingGame, ChatSystemLib = Apollo, GameLib, GroupLib, FriendshipLib, P2PTrading, MatchingGame, ChatSystemLib;
local strfind, tonumber = string.find, tonumber;
-----------------------------------------------------------------------------
-- Menu Items
-----------------------------------------------------------------------------
local tMenuItems = {
-- Markers
{
Name = "BtnMarkTarget",
Text = Apollo.GetString("ContextMenu_MarkTarget"),
Condition = function(self) return (self.tData.bInGroup and self.tData.tMyGroupData.bCanMark and self.tData.unit); end,
OnClick = "OnClickUnit",
Children = {
{
Name = "BtnMark1",
Icon = "Icon_Windows_UI_CRB_Marker_Bomb",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 1) end,
},
{
Name = "BtnMark2",
Icon = "Icon_Windows_UI_CRB_Marker_Ghost",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 2) end,
},
{
Name = "BtnMark3",
Icon = "Icon_Windows_UI_CRB_Marker_Mask",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 3) end,
},
{
Name = "BtnMark4",
Icon = "Icon_Windows_UI_CRB_Marker_Octopus",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 4) end,
},
{
Name = "BtnMark5",
Icon = "Icon_Windows_UI_CRB_Marker_Pig",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 5) end,
},
{
Name = "BtnMark6",
Icon = "Icon_Windows_UI_CRB_Marker_Chicken",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 6) end,
},
{
Name = "BtnMark7",
Icon = "Icon_Windows_UI_CRB_Marker_Toaster",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 7) end,
},
{
Name = "BtnMark8",
Icon = "Icon_Windows_UI_CRB_Marker_UFO",
OnClick = "OnClickUnit",
Checked = function(self) return (self.tData.unit:GetTargetMarker() == 8) end,
},
{
Name = "BtnMarkClear",
Icon = "",
OnClick = "OnClickUnit",
Checked = function(self) return (not self.tData.unit:GetTargetMarker()) end,
},
},
},
-- Assist
{
Name = "BtnAssist",
Text = Apollo.GetString("ContextMenu_Assist"),
Condition = function(self) return (self.tData.unit and self.tData.bIsACharacter and not self.tData.bIsThePlayer); end,
Enabled = function(self) return (self.tData.unit:GetTarget() ~= nil); end,
OnClick = "OnClickUnit",
},
-- Focus
{
Name = "BtnClearFocus",
Text = Apollo.GetString("ContextMenu_ClearFocus"),
Condition = function(self) return (self.tData.unit and (self.tData.unitPlayer:GetAlternateTarget() and self.tData.unit:GetId() == self.tData.unitPlayer:GetAlternateTarget():GetId())); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnSetFocus",
Text = Apollo.GetString("ContextMenu_SetFocus"),
Condition = function(self) return (self.tData.unit and (not self.tData.unitPlayer:GetAlternateTarget() or self.tData.unit:GetId() ~= self.tData.unitPlayer:GetAlternateTarget():GetId())); end,
OnClick = "OnClickUnit",
},
-- Inspect
{
Name = "BtnInspect",
Text = Apollo.GetString("ContextMenu_Inspect"),
Condition = function(self) return (self.tData.unit and self.tData.bIsACharacter); end,
OnClick = "OnClickUnit",
},
-- Group (Mentor/Locate/etc.)
{
Name = "BtnGroupList",
Text = Apollo.GetString("ChatType_Party"),
Condition = function(self) return (self.tData.bInGroup and self.tData.bIsACharacter and not self.tData.bIsOfflineAccountFriend); end,
Children = {
{
Name = "BtnLocate",
Text = Apollo.GetString("ContextMenu_Locate"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.unit and self.tData.tTargetGroupData and self.tData.tTargetGroupData.bIsOnline and not self.tData.tTargetGroupData.bDisconnected); end, -- Additional tTargetGroupData checks for sUF!
},
{
Name = "BtnPromote",
Text = Apollo.GetString("ContextMenu_Promote"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader); end,
Enabled = function(self) return (self.tData.tTargetGroupData.bIsOnline and not self.tData.tTargetGroupData.bDisconnected); end, -- We don't want a leader who is offline...
},
{
Name = "BtnVoteToDisband",
Text = Apollo.GetString("ContextMenu_VoteToDisband"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.tTargetGroupData and self.tData.bInMatchingGame and not self.tData.bIsMatchingGameFinished and MatchingGame:GetPVPMatchState() ~= MatchingGame.Rules.DeathmatchPool); end,
Enabled = function(self) return (not MatchingGame.IsVoteSurrenderActive()); end,
},
{
Name = "BtnVoteToKick",
Text = Apollo.GetString("ContextMenu_VoteToKick"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bInMatchingGame and not self.tData.bIsMatchingGameFinished); end,
},
{
Name = "BtnKick",
Text = Apollo.GetString("ContextMenu_Kick"),
Condition = function(self) return (not self.tData.bIsThePlayer and self.tData.nGroupMemberId and self.tData.tMyGroupData.bCanKick); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnGroupGiveKick",
Text = Apollo.GetString("ContextMenu_AllowKicks"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and not self.tData.tTargetGroupData.bCanKick); end,
},
{
Name = "BtnGroupTakeKick",
Text = Apollo.GetString("ContextMenu_DenyKicks"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and self.tData.tTargetGroupData.bCanKick); end,
},
{
Name = "BtnGroupGiveInvite",
Text = Apollo.GetString("ContextMenu_AllowInvites"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and not self.tData.tTargetGroupData.bCanInvite); end,
},
{
Name = "BtnGroupTakeInvite",
Text = Apollo.GetString("ContextMenu_DenyInvites"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and self.tData.tTargetGroupData.bCanInvite); end,
},
{
Name = "BtnGroupGiveMark",
Text = Apollo.GetString("ContextMenu_AllowMarking"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and not self.tData.tTargetGroupData.bCanMark); end,
},
{
Name = "BtnGroupTakeMark",
Text = Apollo.GetString("ContextMenu_DenyMarking"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.nGroupMemberId and self.tData.tTargetGroupData and self.tData.bAmIGroupLeader and self.tData.tTargetGroupData.bCanMark); end,
},
{
Name = "BtnMentor",
Text = Apollo.GetString("ContextMenu_Mentor"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.unit and not self.tData.bIsThePlayer and not bMentoringTarget and self.tData.tTargetGroupData and self.tData.tTargetGroupData.bIsOnline and not self.tData.tTargetGroupData.bDisconnected); end, -- Additional tTargetGroupData checks for sUF!
},
{
Name = "BtnStopMentor",
Text = Apollo.GetString("ContextMenu_StopMentor"),
OnClick = "OnClickUnit",
Condition = function(self) return (self.tData.tMyGroupData.bIsMentoring or self.tData.tMyGroupData.bIsMentored); end,
},
},
},
-- Social
{
Name = "BtnSocialList",
Text = Apollo.GetString("ContextMenu_SocialLists"),
Condition = function(self) return (self.tData.bIsACharacter and not self.tData.bIsThePlayer); end,
Children = {
{
Name = "BtnAddFriend",
Text = Apollo.GetString("ContextMenu_AddFriend"),
Condition = function(self) return (not self.tData.bIsFriend and (not self.tData.unit or self.tData.unit:GetFaction() == self.tData.unitPlayer:GetFaction())); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnUnfriend",
Text = Apollo.GetString("ContextMenu_RemoveFriend"),
Condition = function(self) return (self.tData.bIsFriend); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnAddRival",
Text = Apollo.GetString("ContextMenu_AddRival"),
Condition = function(self) return (not self.tData.bIsRival); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnUnrival",
Text = Apollo.GetString("ContextMenu_RemoveRival"),
Condition = function(self) return (self.tData.bIsRival and not self.tData.tAccountFriend); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnAddNeighbor",
Text = Apollo.GetString("ContextMenu_AddNeighbor"),
Condition = function(self) return (not self.tData.bIsNeighbor and (not self.tData.unit or self.tData.unit:GetFaction() == self.tData.unitPlayer:GetFaction())); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnUnneighbor",
Text = Apollo.GetString("ContextMenu_RemoveNeighbor"),
Condition = function(self) return (self.tData.bIsNeighbor and not self.tData.tAccountFriend); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnAccountFriend",
Text = Apollo.GetString("ContextMenu_PromoteFriend"),
Condition = function(self) return (self.tData.bIsFriend and not self.tData.bIsAccountFriend); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnUnaccountFriend",
Text = Apollo.GetString("ContextMenu_UnaccountFriend"),
Condition = function(self) return (self.tData.tAccountFriend ~= nil); end,
OnClick = "OnClickUnit",
},
},
},
-- Ignore
{
Name = "BtnIgnore",
Text = Apollo.GetString("ContextMenu_Ignore"),
Condition = function(self) return (self.tData.bIsACharacter and not self.tData.bIsThePlayer and not (self.tData.tFriend and self.tData.tFriend.bIgnore) and (self.tData.tAccountFriend == nil or self.tData.tAccountFriend.fLastOnline == 0)); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnUnignore",
Text = Apollo.GetString("ContextMenu_Unignore"),
Condition = function(self) return (self.tData.tFriend and self.tData.tFriend.bIgnore); end,
OnClick = "OnClickUnit",
},
-- Duel
{
Name = "BtnDuel",
Text = Apollo.GetString("ContextMenu_Duel"),
OnClick = "OnClickUnit",
Condition = function(self)
local eCurrentZonePvPRules = GameLib.GetCurrentZonePvpRules();
return (self.tData.unit and (not eCurrentZonePvPRules or eCurrentZonePvPRules ~= GameLib.CodeEnumZonePvpRules.Sanctuary) and self.tData.bIsACharacter and not self.tData.bIsThePlayer and not GameLib.GetDuelOpponent(self.tData.unitPlayer));
end,
},
{
Name = "BtnForfeit",
Text = Apollo.GetString("ContextMenu_ForfeitDuel"),
OnClick = "OnClickUnit",
Condition = function(self)
local eCurrentZonePvPRules = GameLib.GetCurrentZonePvpRules();
return (self.tData.unit and (not eCurrentZonePvPRules or eCurrentZonePvPRules ~= GameLib.CodeEnumZonePvpRules.Sanctuary) and self.tData.bIsACharacter and not self.tData.bIsThePlayer and GameLib.GetDuelOpponent(self.tData.unitPlayer));
end,
},
-- Trade
{
Name = "BtnTrade",
Text = Apollo.GetString("ContextMenu_Trade"),
Condition = function(self) return (self.tData.unit and self.tData.bIsACharacter and not self.tData.bIsThePlayer and self.tData.unit:GetFaction() == self.tData.tPlayerFaction); end,
OnClick = "OnClickUnit",
Enabled = function(self)
local eCanTradeResult = P2PTrading.CanInitiateTrade(self.tData.unit.__proto__ or self.tData.unit);
return (eCanTradeResult == P2PTrading.P2PTradeError_Ok or eCanTradeResult == P2PTrading.P2PTradeError_TargetRangeMax);
end,
},
-- Whisper
{
Name = "BtnWhisper",
Text = Apollo.GetString("ContextMenu_Whisper"),
Condition = function(self) return (not self.tData.bIsThePlayer and self.tData.bCanWhisper); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnAccountWhisper",
Text = Apollo.GetString("ContextMenu_AccountWhisper"),
Condition = function(self) return (not self.tData.bIsThePlayer and self.tData.bCanAccountWisper); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnInvite",
Text = Apollo.GetString("ContextMenu_InviteToGroup"),
Condition = function(self) return (self.tData.bIsACharacter and not self.tData.bIsThePlayer and not self.tData.nGroupMemberId and (not self.tData.bInGroup or (self.tData.tMyGroupData.bCanInvite and self.tData.bCanWhisper)) and (not self.tData.unit or (self.tData.unit and self.tData.unit:GetFaction() == self.tData.tPlayerFaction))); end,
OnClick = "OnClickUnit",
},
{
Name = "BtnLeaveGroup",
Text = Apollo.GetString("ContextMenu_LeaveGroup"),
Condition = function(self) return (self.tData.bIsThePlayer and self.tData.bInGroup); end,
OnClick = "OnClickUnit",
},
-- Report
{
Name = "BtnReportChat",
Text = Apollo.GetString("ContextMenu_ReportSpam"),
Condition = function(self) return (self.tData.nReportId ~= nil); end,
OnClick = "OnClickUnit",
},
};
-----------------------------------------------------------------------------
-- Context Menu
-----------------------------------------------------------------------------
function ContextMenu:OnClickUnit(wndControl, wndHandler)
local strButton = wndControl:GetName();
if (not strButton or strButton == "Button") then
return;
elseif (strButton == "BtnSetFocus") then
-- Set Focus
if (self.tData.unit) then
self.tData.unitPlayer:SetAlternateTarget(self.tData.unit.__proto__ or self.tData.unit);
end
elseif (strButton == "BtnClearFocus") then
-- Clear Focus
self.tData.unitPlayer:SetAlternateTarget();
elseif (strButton == "BtnMarkTarget") then
-- Set First Available Mark
if (self.tData.unit) then
local nResult = 8;
local nCurrent = self.tData.unit:GetTargetMarker() or 0;
local tAvailableMarkers = GameLib.GetAvailableTargetMarkers();
for idx = nCurrent, 8 do
if (tAvailableMarkers[idx]) then
nResult = idx;
break;
end
end
self.tData.unit:SetTargetMarker(nResult);
end
elseif (strButton == "BtnMarkClear") then
if (self.tData.unit) then
self.tData.unit:ClearTargetMarker();
end
elseif (strfind(strButton, "BtnMark(%d)")) then
if (self.tData.unit) then
local _, _, strMark = strfind(strButton, "BtnMark(%d)");
strMark = tonumber(strMark);
if (wndControl:IsChecked() and strMark < 8) then
self.tData.unit:SetTargetMarker(strMark);
else
self.tData.unit:ClearTargetMarker();
end
end
elseif (strButton == "BtnAssist") then
if (self.tData.unit) then
GameLib.SetTargetUnit(self.tData.unit:GetTarget());
end
elseif (strButton == "BtnInspect") then
if (self.tData.unit) then
self.tData.unit:Inspect();
end
elseif (strButton == "BtnAddFriend") then
FriendshipLib.AddByName(FriendshipLib.CharacterFriendshipType_Friend, self.tData.strTarget);
elseif (strButton == "BtnUnfriend") then
FriendshipLib.Remove(self.tData.tCharacterData.tFriend.nId, FriendshipLib.CharacterFriendshipType_Friend);
elseif (strButton == "BtnAccountFriend") then
FriendshipLib.AccountAddByUpgrade(self.tData.tCharacterData.tFriend.nId);
elseif (strButton == "BtnUnaccountFriend") then
if (self.tData.tAccountFriend and self.tData.tAccountFriend.nId) then
Event_FireGenericEvent("EventGeneric_ConfirmRemoveAccountFriend", self.tData.tAccountFriend.nId); -- TODO
end
elseif (strButton == "BtnAddRival") then
FriendshipLib.AddByName(FriendshipLib.CharacterFriendshipType_Rival, self.tData.strTarget);
elseif (strButton == "BtnUnrival") then
FriendshipLib.Remove(self.tData.tCharacterData.tFriend.nId, FriendshipLib.CharacterFriendshipType_Rival);
elseif (strButton == "BtnAddNeighbor") then
HousingLib.NeighborInviteByName(self.tData.strTarget);
elseif (strButton == "BtnUnneighbor") then
Print(Apollo.GetString("ContextMenu_NeighborRemoveFailed")); -- TODO
elseif (strButton == "BtnIgnore") then
FriendshipLib.AddByName(FriendshipLib.CharacterFriendshipType_Ignore, self.tData.strTarget);
elseif (strButton == "BtnUnignore") then
FriendshipLib.Remove(self.tData.tCharacterData.tFriend.nId, FriendshipLib.CharacterFriendshipType_Ignore);
elseif (strButton == "BtnDuel") then
GameLib.InitiateDuel(self.tData.unit);
elseif (strButton == "BtnForfeit") then
GameLib.ForfeitDuel(self.tData.unit);
elseif (strButton == "BtnTrade") then
local eCanTradeResult = P2PTrading.CanInitiateTrade(self.tData.unit);
if (eCanTradeResult == P2PTrading.P2PTradeError_Ok) then
Event_FireGenericEvent("P2PTradeWithTarget", self.tData.unit);
elseif (eCanTradeResult == P2PTrading.P2PTradeError_TargetRangeMax) then
Event_FireGenericEvent("GenericFloater", self.tData.unitPlayer, Apollo.GetString("ContextMenu_PlayerOutOfRange"));
self.tData.unit:ShowHintArrow();
else
Event_FireGenericEvent("GenericFloater", self.tData.unitPlayer, Apollo.GetString("ContextMenu_TradeFailed"));
end
elseif (strButton == "BtnWhisper") then
Event_FireGenericEvent("GenericEvent_ChatLogWhisper", self.tData.strTarget);
elseif (strButton == "BtnAccountWhisper") then
if (self.tData.tCharacterData.tAccountFriend ~= nil and self.tData.tCharacterData.tAccountFriend.arCharacters ~= nil and self.tData.tCharacterData.tAccountFriend.arCharacters[1] ~= nil) then
local strDisplayName = self.tData.tCharacterData.tAccountFriend.strCharacterName;
local strRealmName = self.tData.tCharacterData.tAccountFriend.arCharacters[1].strRealm;
Event_FireGenericEvent("Event_EngageAccountWhisper", strDisplayName, self.tData.strTarget, strRealmName);
end
elseif (strButton == "BtnInvite") then
GroupLib.Invite(self.tData.strTarget);
elseif (strButton == "BtnKick") then
GroupLib.Kick(self.tData.nGroupMemberId);
elseif (strButton == "BtnLeaveGroup") then
GroupLib.LeaveGroup();
-- TODO
elseif (strButton == "BtnPromote") then
GroupLib.Promote(self.tData.nGroupMemberId, "");
elseif (strButton == "BtnGroupGiveMark") then
GroupLib.SetCanMark(self.tData.nGroupMemberId, true);
elseif (strButton == "BtnGroupTakeMark") then
GroupLib.SetCanMark(self.tData.nGroupMemberId, false);
elseif (strButton == "BtnGroupGiveKick") then
GroupLib.SetKickPermission(self.tData.nGroupMemberId, true);
elseif (strButton == "BtnGroupTakeKick") then
GroupLib.SetKickPermission(self.tData.nGroupMemberId, false);
elseif (strButton == "BtnGroupGiveInvite") then
GroupLib.SetInvitePermission(self.tData.nGroupMemberId, true);
elseif (strButton == "BtnGroupTakeInvite") then
GroupLib.SetInvitePermission(self.tData.nGroupMemberId, false);
elseif (strButton == "BtnLocate") then
if (self.tData.unit) then
self.tData.unit:ShowHintArrow();
end
elseif (strButton == "BtnMarkClear") then
self.tData.unit:ClearTargetMarker();
elseif (strButton == "BtnVoteToDisband") then
MatchingGame.InitiateVoteToSurrender();
elseif (strButton == "BtnVoteToKick") then
MatchingGame.InitiateVoteToKick(self.tData.nGroupMemberId);
elseif (strButton == "BtnMentor") then
GroupLib.AcceptMentoring(self.tData.unit);
elseif (strButton == "BtnStopMentor") then
GroupLib.CancelMentoring();
elseif (strButton == "BtnReportChat" and self.tData.nReportId) then
local tResult = ChatSystemLib.PrepareInfractionReport(self.tData.nReportId);
Apollo.GetAddon("ContextMenuPlayer"):BuildReportConfirmation(tResult.strDescription, tResult.bSuccess); -- TODO
elseif (strButton and string.find(strButton, "BtnMark") ~= 0) then
self.tData.unit:SetTargetMarker(tonumber(string.sub(strButton, string.len("BtnMark_"))));
end
self:Close(true);
end
local function FindFriend(strName, bAccountFriend)
local strRealm = GameLib.GetRealmName();
local tFriends = bAccountFriend and FriendshipLib.GetAccountList() or FriendshipLib.GetList();
for _, tFriend in ipairs(tFriends) do
if (not bAccountFriend and tFriend.strCharacterName == strName and tFriend.strRealmName == strRealm) then
return tFriend;
elseif (bAccountFriend and tFriend.arCharacters) then
for _, tCharacter in ipairs(tFriend.arCharacters) do
if (tCharacter.strCharacterName == strName and tCharacter.strRealm == strRealm) then
return tFriend;
end
end
end
end
end
function ContextMenu:GenerateUnitMenu(unit, nReportId)
if (not unit) then return; end
-- Cleanup
self:Initialize();
-- Chat
self.tData.nReportId = nReportId;
-- Player
self.tData.unitPlayer = GameLib.GetPlayerUnit();
self.tData.bInGroup = GroupLib.InGroup();
self.tData.bAmIGroupLeader = GroupLib.AmILeader();
self.tData.tMyGroupData = GroupLib.GetGroupMember(1);
self.tData.tPlayerFaction = self.tData.unitPlayer:GetFaction();
-- Check if Unitstring is the Player (TODO: Can unit string come from another realm? Need to test this in PVP)
if (type(unit) == "string" and unit == self.tData.unitPlayer:GetName()) then
unit = self.tData.unitPlayer;
end
-- Friend IDs
if (type(unit) == "number") then
self.tData.bFriendMenu = true;
self.tData.nFriendId = unit;
self.tData.tFriend = FriendshipLib.GetById(unit);
self.tData.tAccountFriend = FriendshipLib.GetAccountById(unit);
if (self.tData.tFriend) then
unit = self.tData.tFriend.strCharacterName;
elseif (self.tData.tAccountFriend) then
if (self.tData.tAccountFriend.arCharacters and self.tData.tAccountFriend.arCharacters[1]) then
unit = self.tData.tAccountFriend.arCharacters[1].strCharacterName;
else
-- Offline Account Friend
self.tData.bIsOfflineAccountFriend = true;
unit = self.tData.tAccountFriend.strCharacterName;
end
end
else
self.tData.bFriendMenu = false;
self.tData.nFriendId = nil;
self.tData.tFriend = nil;
self.tData.tAccountFriend = nil;
self.tData.bIsOfflineAccountFriend = false;
end
if (type(unit) == "string") then
-- Unitless Properties
self.tData.unit = nil;
self.tData.strTarget = unit;
self.tData.bIsACharacter = true; -- TODO
self.tData.bIsThePlayer = false;
else
-- Unit Properties
self.tData.unit = unit;
self.tData.strTarget = unit:GetName();
self.tData.bIsACharacter = unit:IsACharacter();
self.tData.bIsThePlayer = unit:IsThePlayer();
end
self.tData.tCharacterData = GameLib.SearchRelationshipStatusByCharacterName(self.tData.strTarget);
self.tData.nGroupMemberId = (self.tData.tCharacterData and self.tData.tCharacterData.nPartyIndex) or nil;
self.tData.tTargetGroupData = (not self.tData.bIsThePlayer and self.tData.tCharacterData and self.tData.tCharacterData.nPartyIndex) and GroupLib.GetGroupMember(self.tData.tCharacterData.nPartyIndex) or nil;
-- Mentoring
if (self.tData.bInGroup and not self.tData.bIsThePlayer and self.tData.tTargetGroupData) then
local bMentoringTarget = false;
for _, nMentorIdx in ipairs(self.tData.tTargetGroupData.tMentoredBy) do
if (tMyGroupData.nMemberIdx == nMentorIdx) then
bMentoringTarget = true;
break
end
end
if (self.tData.tTargetGroupData.bIsOnline and not bMentoringTarget and self.tData.tTargetGroupData.nLevel < self.tData.tMyGroupData.nLevel) then
self.tData.bMentoringTarget = true;
end
else
self.tData.bMentoringTarget = false;
end
-- Friend
if (self.tData.bIsACharacter) then
if (not self.tData.bFriendMenu) then
self.tData.tFriend = FindFriend(self.tData.strTarget); -- bFriend, bRival, bIgnore
self.tData.tAccountFriend = FindFriend(self.tData.strTarget, true);
self.tData.nFriendId = (self.tData.tFriend and self.tData.tFriend.nId) or (self.tData.tAccountFriend and self.tData.tAccountFriend.nId) or nil;
end
self.tData.bCanAccountWisper = not self.tData.bIsOfflineAccountFriend and (self.tData.tAccountFriend ~= nil and self.tData.tAccountFriend.arCharacters and self.tData.tAccountFriend.arCharacters[1] ~= nil);
if (self.tData.bCanAccountWisper) then
-- self.tData.bCanWhisper = (self.tData.tAccountFriend.arCharacters[1] ~= nil and self.tData.tAccountFriend.arCharacters[1].strRealm == GameLib.GetRealmName() and self.tData.tAccountFriend.arCharacters[1].nFactionId == self.tData.tPlayerFaction);
self.tData.bCanWhisper = (self.tData.tAccountFriend.arCharacters[1].nFactionId == self.tData.tPlayerFaction);
else
self.tData.bCanWhisper = not self.tData.bIsOfflineAccountFriend and (self.tData.bIsACharacter and (not self.tData.unit or (self.tData.unit and self.tData.unit:GetFaction() == self.tData.tPlayerFaction)) and (self.tData.tFriend == nil or (self.tData.tFriend ~= nil and not self.tData.tFriend.bIgnore)));
end
self.tData.bIsFriend = (self.tData.tFriend ~= nil and self.tData.tFriend.bFriend) or (self.tData.tCharacterData ~= nil and self.tData.tCharacterData.tFriend ~= nil and self.tData.tCharacterData.tFriend.bFriend);
self.tData.bIsRival = (self.tData.tFriend ~= nil and self.tData.tFriend.bRival) or (self.tData.tCharacterData ~= nil and self.tData.tCharacterData.tFriend ~= nil and self.tData.tCharacterData.tFriend.bRival);
self.tData.bIsNeighbor = (self.tData.tFriend ~= nil and self.tData.tFriend.bNeighbor) or (self.tData.tCharacterData ~= nil and self.tData.tCharacterData.tFriend ~= nil and self.tData.tCharacterData.tFriend.bNeighbor);
self.tData.bIsAccountFriend = (self.tData.tAccountFriend ~= nil or (self.tData.tCharacterData ~= nil and self.tData.tCharacterData.tAccountFriend ~= nil));
else
self.tData.bCanWhisper = false;
self.tData.bCanAccountWisper = false;
self.tData.bIsFriend = false;
self.tData.bIsRival = false;
self.tData.bIsNeighbor = false;
self.tData.bIsAccountFriend = false;
end
-- PVP
self.tData.bInMatchingGame = MatchingGame.IsInMatchingGame();
self.tData.bIsMatchingGameFinished = MatchingGame.IsMatchingGameFinished();
if (not self.tParent) then
self:AddHeader(self.tData.strTarget);
self:AddItems(tMenuItems);
end
return self;
end
--[[
local S = Apollo.GetPackage("Gemini:Addon-1.1").tPackage:GetAddon("SezzUI");
local log = S.Log;
]] |
local colors = require("tokyonight.colors").setup()
colors = vim.tbl_extend("force", colors, {
fg = colors.fg_sidebar,
bg = colors.bg_statusline,
})
return colors
|
-- Copyright (c) 2018 Redfern, Trevor <[email protected]>
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
describe("MergeSort", function()
local MergeSort = require "mergesort"
it("sorts elements as expected", function()
local list = { "orange", "apple", "banana", "rhubarb", "nectarine", "peach", "blueberry" }
local r = MergeSort(list)
assert.array_matches({ "apple", "banana", "blueberry", "nectarine", "orange", "peach", "rhubarb" }, r)
end)
it("it sorts the actual array", function()
local list = { 38, 9, 2, 203, 8, 28, 10, 11, 48, 29, 6, 7, 92, 1000, 843, 928, 842, 292, 384, 596, 10293, 1 }
MergeSort(list)
assert.array_matches(
{ 1, 2, 6, 7, 8, 9, 10, 11, 28, 29, 38, 48, 92, 203, 292, 384, 596, 842, 843, 928, 1000, 10293 },
list)
end)
it("can deal with duplicate values", function()
local list = { 2, 4, 2, 9, 4, 1, 8, 4 }
MergeSort(list)
assert.array_matches({ 1, 2, 2, 4, 4, 4, 8, 9}, list)
end)
it("can support a custom comparison", function()
local list = { 1, 2, 3, 4 }
MergeSort(list, function(a, b) return a > b end)
assert.array_matches({4, 3, 2, 1}, list)
end)
end)
|
-------------------------------------------------
-- Github Contributions Widget for Awesome Window Manager
-- Shows the contributions graph
-- More details could be found here:
-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/github-contributions-widget
-- @author Pavel Makhov
-- @copyright 2020 Pavel Makhov
-------------------------------------------------
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local GET_CONTRIBUTIONS_CMD = [[bash -c "curl -s https://github-contributions.now.sh/api/v1/%s | jq -r '[.contributions[] | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].color'"]]
-- in case github-contributions.now.sh stops working contributions can be scrapped from the github.com with the command below. Note that the order is reversed.
local GET_CONTRIBUTIONS_CMD_FALLBACK = [[bash -c "curl -s https://github.com/users/%s/contributions | grep -o '\" fill=\"\#[0-9a-fA-F]\{6\}\" da' | grep -o '\#[0-9a-fA-F]\{6\}'"]]
local github_contributions_widget = wibox.widget{
reflection = {
horizontal = true,
vertical = true,
},
widget = wibox.container.mirror
}
local function worker(args)
local args = args or {}
local username = args.username or 'streetturtle'
local days = args.days or 365
local empty_color = args.empty_color or beautiful.bg_normal
local with_border = args.with_border
local margin_top = args.margin_top or 1
if with_border == nil then with_border = true end
local function hex2rgb(hex)
if hex == '#ebedf0' then hex = empty_color end
hex = tostring(hex):gsub("#","")
return tonumber("0x" .. hex:sub(1, 2)),
tonumber("0x" .. hex:sub(3, 4)),
tonumber("0x" .. hex:sub(5, 6))
end
local function get_square(color)
local r, g, b = hex2rgb(color)
return wibox.widget{
fit = function(self, context, width, height)
return 3, 3
end,
draw = function(self, context, cr, width, height)
cr:set_source_rgb(r/255, g/255, b/255)
cr:rectangle(0, 0, with_border and 2 or 3, with_border and 2 or 3)
cr:fill()
end,
layout = wibox.widget.base.make_widget
}
end
local col = {layout = wibox.layout.fixed.vertical}
local row = {layout = wibox.layout.fixed.horizontal}
local a = 5 - os.date('%w')
for i = 0, a do
table.insert(col, get_square('#ebedf0'))
end
local update_widget = function(widget, stdout, _, _, _)
for colors in stdout:gmatch("[^\r\n]+") do
if a%7 == 0 then
table.insert(row, col)
col = {layout = wibox.layout.fixed.vertical}
end
table.insert(col, get_square(colors))
a = a + 1
end
github_contributions_widget:setup(
{
row,
top = margin_top,
layout = wibox.container.margin
}
)
end
awful.spawn.easy_async(string.format(GET_CONTRIBUTIONS_CMD, username, days),
function(stdout, stderr)
update_widget(github_contributions_widget, stdout)
end)
return github_contributions_widget
end
return setmetatable(github_contributions_widget, { __call = function(_, ...) return worker(...) end })
|
#!/usr/bin/env lua
-- Inverse Captcha (Part 1)
for line in io.lines() do
_, _, captcha, result = line:find("(%d+)%s+(%d+)")
result = tonumber(result)
sum = 0
for i = 1, #captcha do
current = tonumber(captcha:sub(i, i))
next = tonumber(captcha:sub(i + 1, i + 1))
-- Because it's a circular list
if next == nil then
next = tonumber(captcha:sub(1, 1))
end
if current == next then
sum = sum + current
end
end
matches = (sum == result)
if matches then
io.write(sum, "\n")
else
io.stderr:write(sum, "\n")
end
end
|
--- This file is generated by ava-x2l.exe,
--- Don't change it manaully.
--- @copyright Lilith Games, Project Da Vinci(Avatar Team)
--- @see Official Website: https://www.projectdavinci.com/
--- @see Dev Framework: https://github.com/lilith-avatar/avatar-ava
--- @see X2L Tool: https://github.com/lilith-avatar/avatar-ava-xls2lua
--- source file: ./Xls/UIAnimation.xls
local UIAnimationXls = {
[1] = {
Key = 1,
AnimationName = 'ModeImage1',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.2, 0.2),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[2] = {
Key = 2,
AnimationName = 'ModeImage1',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.2, 0.2),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[3] = {
Key = 3,
AnimationName = 'ModeImage1',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[4] = {
Key = 4,
AnimationName = 'ModeImage1',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[5] = {
Key = 5,
AnimationName = 'ModeImage1',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[6] = {
Key = 6,
AnimationName = 'ModeImage1',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode1',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[7] = {
Key = 7,
AnimationName = 'ModeImage2',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[8] = {
Key = 8,
AnimationName = 'ModeImage2',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[9] = {
Key = 9,
AnimationName = 'ModeImage2',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[10] = {
Key = 10,
AnimationName = 'ModeImage2',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[11] = {
Key = 11,
AnimationName = 'ModeImage2',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[12] = {
Key = 12,
AnimationName = 'ModeImage2',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode2',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[13] = {
Key = 13,
AnimationName = 'ModeImage3',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.8, 0.8),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[14] = {
Key = 14,
AnimationName = 'ModeImage3',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.8, 0.8),
AnchorsY = Vector2(0.65, 0.65),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[15] = {
Key = 15,
AnimationName = 'ModeImage3',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[16] = {
Key = 16,
AnimationName = 'ModeImage3',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[17] = {
Key = 17,
AnimationName = 'ModeImage3',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[18] = {
Key = 18,
AnimationName = 'ModeImage3',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode3',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[19] = {
Key = 19,
AnimationName = 'ModeImage4',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.2, 0.2),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[20] = {
Key = 20,
AnimationName = 'ModeImage4',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.2, 0.2),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[21] = {
Key = 21,
AnimationName = 'ModeImage4',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[22] = {
Key = 22,
AnimationName = 'ModeImage4',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[23] = {
Key = 23,
AnimationName = 'ModeImage4',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[24] = {
Key = 24,
AnimationName = 'ModeImage4',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode4',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[25] = {
Key = 25,
AnimationName = 'ModeImage5',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[26] = {
Key = 26,
AnimationName = 'ModeImage5',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[27] = {
Key = 27,
AnimationName = 'ModeImage5',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[28] = {
Key = 28,
AnimationName = 'ModeImage5',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[29] = {
Key = 29,
AnimationName = 'ModeImage5',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[30] = {
Key = 30,
AnimationName = 'ModeImage5',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode5',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[31] = {
Key = 31,
AnimationName = 'ModeImage6',
Count = 100,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = true,
KeyFrame = 0,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.8, 0.8),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[32] = {
Key = 32,
AnimationName = 'ModeImage6',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.8, 0.8),
AnchorsY = Vector2(0.3, 0.3),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[33] = {
Key = 33,
AnimationName = 'ModeImage6',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = nil,
KeyFrame = 20,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[34] = {
Key = 34,
AnimationName = 'ModeImage6',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(500, 350),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = Vector2(0.5, 0.5),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[35] = {
Key = 35,
AnimationName = 'ModeImage6',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = nil,
KeyFrame = 38,
Size = Vector2(800, 560),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[36] = {
Key = 36,
AnimationName = 'ModeImage6',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.Mode6',
IsInit = nil,
KeyFrame = 46,
Size = Vector2(750, 525),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[37] = {
Key = 37,
AnimationName = 'ImgChooseShow',
Count = 60,
UINode = 'Local.LoadGUI.GameModePnl.ImgChoose',
IsInit = true,
KeyFrame = 0,
Size = Vector2(0, 0),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[38] = {
Key = 38,
AnimationName = 'ImgChooseShow',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.ImgChoose',
IsInit = nil,
KeyFrame = 30,
Size = Vector2(0, 0),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[39] = {
Key = 39,
AnimationName = 'ImgChooseShow',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.ImgChoose',
IsInit = nil,
KeyFrame = 31,
Size = Vector2(1000, 1000),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[40] = {
Key = 40,
AnimationName = 'ImgChooseShow',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.ImgChoose',
IsInit = nil,
KeyFrame = 45,
Size = Vector2(250, 250),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[41] = {
Key = 41,
AnimationName = 'ImgChooseShow',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl.ImgChoose',
IsInit = nil,
KeyFrame = 55,
Size = Vector2(300, 300),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[42] = {
Key = 42,
AnimationName = 'Random2Loading',
Count = 20,
UINode = 'Local.LoadGUI.GameModePnl',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[43] = {
Key = 43,
AnimationName = 'Random2Loading',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[44] = {
Key = 44,
AnimationName = 'Random2Loading',
Count = nil,
UINode = 'Local.LoadGUI.GameModePnl',
IsInit = nil,
KeyFrame = 20,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[45] = {
Key = 45,
AnimationName = 'Random2Loading',
Count = nil,
UINode = 'Local.LoadGUI.IntroPnl',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-1, 0),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[46] = {
Key = 46,
AnimationName = 'Random2Loading',
Count = nil,
UINode = 'Local.LoadGUI.IntroPnl',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-1, 0),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[47] = {
Key = 47,
AnimationName = 'Random2Loading',
Count = nil,
UINode = 'Local.LoadGUI.IntroPnl',
IsInit = nil,
KeyFrame = 20,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[48] = {
Key = 48,
AnimationName = 'StartMatch',
Count = 10,
UINode = 'Local.HallGUI.ImgBG',
IsInit = true,
KeyFrame = 0,
Size = Vector2(480, 200),
AnchorsX = nil,
AnchorsY = Vector2(1.2, 1.2),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[49] = {
Key = 49,
AnimationName = 'StartMatch',
Count = nil,
UINode = 'Local.HallGUI.ImgBG',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(480, 200),
AnchorsX = nil,
AnchorsY = Vector2(1.2, 1.2),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[50] = {
Key = 50,
AnimationName = 'StartMatch',
Count = nil,
UINode = 'Local.HallGUI.ImgBG',
IsInit = nil,
KeyFrame = 4,
Size = Vector2(480, 200),
AnchorsX = nil,
AnchorsY = Vector2(0.91, 0.91),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[51] = {
Key = 51,
AnimationName = 'StartMatch',
Count = nil,
UINode = 'Local.HallGUI.ImgBG',
IsInit = nil,
KeyFrame = 6,
Size = Vector2(490, 205),
AnchorsX = nil,
AnchorsY = Vector2(0.91, 0.91),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[52] = {
Key = 52,
AnimationName = 'StartMatch',
Count = nil,
UINode = 'Local.HallGUI.ImgBG',
IsInit = nil,
KeyFrame = 8,
Size = Vector2(480, 200),
AnchorsX = nil,
AnchorsY = Vector2(0.91, 0.91),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[53] = {
Key = 53,
AnimationName = 'PopMsg',
Count = 60,
UINode = 'Local.NoticeGUI.PopMsg',
IsInit = true,
KeyFrame = 0,
Size = Vector2(800, 40),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[54] = {
Key = 54,
AnimationName = 'PopMsg',
Count = nil,
UINode = 'Local.NoticeGUI.PopMsg',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(800, 40),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[55] = {
Key = 55,
AnimationName = 'PopMsg',
Count = nil,
UINode = 'Local.NoticeGUI.PopMsg',
IsInit = nil,
KeyFrame = 4,
Size = Vector2(1000, 50),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[56] = {
Key = 56,
AnimationName = 'PopMsg',
Count = nil,
UINode = 'Local.NoticeGUI.PopMsg',
IsInit = nil,
KeyFrame = 6,
Size = Vector2(840, 42),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[57] = {
Key = 57,
AnimationName = 'PopMsg',
Count = nil,
UINode = 'Local.NoticeGUI.PopMsg',
IsInit = nil,
KeyFrame = 9,
Size = Vector2(800, 40),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[58] = {
Key = 58,
AnimationName = 'ScoreMsg',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = Vector2(0, 0),
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[59] = {
Key = 59,
AnimationName = 'ScoreMsg',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = Vector2(0, 4),
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[60] = {
Key = 60,
AnimationName = 'ScoreMsg',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 15,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = Vector2(0, 50),
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[61] = {
Key = 61,
AnimationName = 'ScoreMsg',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = Vector2(0, 130),
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[62] = {
Key = 62,
AnimationName = 'ScoreMsg',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 45,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = Vector2(0, 130),
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[63] = {
Key = 63,
AnimationName = 'ContinusKill',
Count = 60,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = true,
KeyFrame = 0,
Size = Vector2(1000, 333),
AnchorsX = Vector2(2, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[64] = {
Key = 64,
AnimationName = 'ContinusKill',
Count = nil,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(1000, 333),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[65] = {
Key = 65,
AnimationName = 'ContinusKill',
Count = nil,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = nil,
KeyFrame = 5,
Size = Vector2(1000, 333),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[66] = {
Key = 66,
AnimationName = 'ContinusKill',
Count = nil,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = nil,
KeyFrame = 13,
Size = Vector2(600, 200),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[67] = {
Key = 67,
AnimationName = 'ContinusKill',
Count = nil,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = nil,
KeyFrame = 59,
Size = Vector2(600, 200),
AnchorsX = Vector2(0.5, 0.5),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[68] = {
Key = 68,
AnimationName = 'ContinusKill',
Count = nil,
UINode = 'Local.ShareUI.ContinusKillPnl.AllContinusKill',
IsInit = nil,
KeyFrame = 60,
Size = Vector2(600, 200),
AnchorsX = Vector2(2, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[69] = {
Key = 69,
AnimationName = 'KillEffect',
Count = 50,
UINode = 'Local.BattleGUI.InfoKill.KillEffect',
IsInit = true,
KeyFrame = 0,
Size = Vector2(48, 48),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[70] = {
Key = 70,
AnimationName = 'KillEffect',
Count = nil,
UINode = 'Local.BattleGUI.InfoKill.KillEffect',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(45, 45),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[71] = {
Key = 71,
AnimationName = 'KillEffect',
Count = nil,
UINode = 'Local.BattleGUI.InfoKill.KillEffect',
IsInit = nil,
KeyFrame = 7,
Size = Vector2(96, 96),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[72] = {
Key = 72,
AnimationName = 'KillEffect',
Count = nil,
UINode = 'Local.BattleGUI.InfoKill.KillEffect',
IsInit = nil,
KeyFrame = 50,
Size = Vector2(55, 55),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[73] = {
Key = 73,
AnimationName = 'Weapon_HitCross',
Count = 20,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = Vector2(100, 100),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[74] = {
Key = 74,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(100, 100),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[75] = {
Key = 75,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 10,
Size = Vector2(120, 120),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[76] = {
Key = 76,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 19,
Size = Vector2(110, 110),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[77] = {
Key = 77,
AnimationName = 'Weapon_HitCross',
Count = 20,
UINode = '2.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 0.2,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[78] = {
Key = 78,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 0.2,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[79] = {
Key = 79,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 5,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[80] = {
Key = 80,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 15,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[81] = {
Key = 81,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 19,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = -1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[82] = {
Key = 82,
AnimationName = 'Weapon_HitCross',
Count = 20,
UINode = '3.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 0.2,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[83] = {
Key = 83,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 0.2,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[84] = {
Key = 84,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 5,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[85] = {
Key = 85,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 15,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = 1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[86] = {
Key = 86,
AnimationName = 'Weapon_HitCross',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 19,
Size = nil,
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = -1.0,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[87] = {
Key = 87,
AnimationName = 'Weapon_Kill',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = Vector2(180, 180),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[88] = {
Key = 88,
AnimationName = 'Weapon_Kill',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = Vector2(180, 180),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[89] = {
Key = 89,
AnimationName = 'Weapon_Kill',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 3,
Size = Vector2(250, 250),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[90] = {
Key = 90,
AnimationName = 'Weapon_Kill',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 15,
Size = Vector2(80, 80),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[91] = {
Key = 91,
AnimationName = 'Weapon_Kill',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 35,
Size = Vector2(80, 80),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[92] = {
Key = 92,
AnimationName = 'Weapon_Kill',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 40,
Size = Vector2(0, 0),
AnchorsX = nil,
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[93] = {
Key = 93,
AnimationName = 'GameResult',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[94] = {
Key = 94,
AnimationName = 'GameResult',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[95] = {
Key = 95,
AnimationName = 'GameResult',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[96] = {
Key = 96,
AnimationName = 'GameResult',
Count = nil,
UINode = '2.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-1, 0),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[97] = {
Key = 97,
AnimationName = 'GameResult',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-1, 0),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[98] = {
Key = 98,
AnimationName = 'GameResult',
Count = nil,
UINode = '2.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[99] = {
Key = 99,
AnimationName = 'GameResult',
Count = nil,
UINode = '3.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-50, -50),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[100] = {
Key = 100,
AnimationName = 'GameResult',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-50, -50),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[101] = {
Key = 101,
AnimationName = 'GameResult',
Count = nil,
UINode = '3.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-4, -4),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[102] = {
Key = 102,
AnimationName = 'GameResult',
Count = nil,
UINode = '4.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(55, 55),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[103] = {
Key = 103,
AnimationName = 'GameResult',
Count = nil,
UINode = '4.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(55, 55),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[104] = {
Key = 104,
AnimationName = 'GameResult',
Count = nil,
UINode = '4.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(7, 7),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[105] = {
Key = 105,
AnimationName = 'GameResult',
Count = nil,
UINode = '5.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-0.01, -0.01),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[106] = {
Key = 106,
AnimationName = 'GameResult',
Count = nil,
UINode = '5.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-0.01, -0.01),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[107] = {
Key = 107,
AnimationName = 'GameResult',
Count = nil,
UINode = '5.0',
IsInit = nil,
KeyFrame = 10,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-0.01, -0.01),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[108] = {
Key = 108,
AnimationName = 'GameResult',
Count = nil,
UINode = '5.0',
IsInit = nil,
KeyFrame = 40,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0.42, 0.42),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[109] = {
Key = 109,
AnimationName = 'GameResult',
Count = nil,
UINode = '6.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(1, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[110] = {
Key = 110,
AnimationName = 'GameResult',
Count = nil,
UINode = '6.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(1, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[111] = {
Key = 111,
AnimationName = 'GameResult',
Count = nil,
UINode = '6.0',
IsInit = nil,
KeyFrame = 10,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(1, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[112] = {
Key = 112,
AnimationName = 'GameResult',
Count = nil,
UINode = '6.0',
IsInit = nil,
KeyFrame = 40,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0.55, 0.55),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[113] = {
Key = 113,
AnimationName = 'GameOverShowBlue1',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[114] = {
Key = 114,
AnimationName = 'GameOverShowBlue1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[115] = {
Key = 115,
AnimationName = 'GameOverShowBlue1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(0.05, 1.05),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[116] = {
Key = 116,
AnimationName = 'GameOverShowBlue1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[117] = {
Key = 117,
AnimationName = 'GameOverShowBlue1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(-0.02, 0.98),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[118] = {
Key = 118,
AnimationName = 'GameOverShowBlue1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[119] = {
Key = 119,
AnimationName = 'GameOverShowBlue2',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[120] = {
Key = 120,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[121] = {
Key = 121,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 4,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[122] = {
Key = 122,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(0.05, 1.05),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[123] = {
Key = 123,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[124] = {
Key = 124,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(-0.02, 0.98),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[125] = {
Key = 125,
AnimationName = 'GameOverShowBlue2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[126] = {
Key = 126,
AnimationName = 'GameOverShowBlue3',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[127] = {
Key = 127,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[128] = {
Key = 128,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 8,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[129] = {
Key = 129,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(0.05, 1.05),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[130] = {
Key = 130,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[131] = {
Key = 131,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(-0.02, 0.98),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[132] = {
Key = 132,
AnimationName = 'GameOverShowBlue3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[133] = {
Key = 133,
AnimationName = 'GameOverShowBlue4',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[134] = {
Key = 134,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[135] = {
Key = 135,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 12,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[136] = {
Key = 136,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(0.05, 1.05),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[137] = {
Key = 137,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[138] = {
Key = 138,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(-0.02, 0.98),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[139] = {
Key = 139,
AnimationName = 'GameOverShowBlue4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[140] = {
Key = 140,
AnimationName = 'GameOverShowBlue5',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[141] = {
Key = 141,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[142] = {
Key = 142,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 16,
Size = nil,
AnchorsX = Vector2(-2, -1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[143] = {
Key = 143,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(0.05, 1.05),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[144] = {
Key = 144,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[145] = {
Key = 145,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(-0.02, 0.98),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[146] = {
Key = 146,
AnimationName = 'GameOverShowBlue5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[147] = {
Key = 147,
AnimationName = 'GameOverShowRed1',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[148] = {
Key = 148,
AnimationName = 'GameOverShowRed1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[149] = {
Key = 149,
AnimationName = 'GameOverShowRed1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(-0.05, 0.95),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[150] = {
Key = 150,
AnimationName = 'GameOverShowRed1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[151] = {
Key = 151,
AnimationName = 'GameOverShowRed1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(0.02, 1.02),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[152] = {
Key = 152,
AnimationName = 'GameOverShowRed1',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[153] = {
Key = 153,
AnimationName = 'GameOverShowRed2',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[154] = {
Key = 154,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[155] = {
Key = 155,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 4,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[156] = {
Key = 156,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(-0.05, 0.95),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[157] = {
Key = 157,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[158] = {
Key = 158,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(0.02, 1.02),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[159] = {
Key = 159,
AnimationName = 'GameOverShowRed2',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[160] = {
Key = 160,
AnimationName = 'GameOverShowRed3',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[161] = {
Key = 161,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[162] = {
Key = 162,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 8,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[163] = {
Key = 163,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(-0.05, 0.95),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[164] = {
Key = 164,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[165] = {
Key = 165,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(0.02, 1.02),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[166] = {
Key = 166,
AnimationName = 'GameOverShowRed3',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[167] = {
Key = 167,
AnimationName = 'GameOverShowRed4',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[168] = {
Key = 168,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[169] = {
Key = 169,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 12,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[170] = {
Key = 170,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(-0.05, 0.95),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[171] = {
Key = 171,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[172] = {
Key = 172,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(0.02, 1.02),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[173] = {
Key = 173,
AnimationName = 'GameOverShowRed4',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[174] = {
Key = 174,
AnimationName = 'GameOverShowRed5',
Count = 60,
UINode = '1.0',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[175] = {
Key = 175,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[176] = {
Key = 176,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 16,
Size = nil,
AnchorsX = Vector2(1, 2),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[177] = {
Key = 177,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 24,
Size = nil,
AnchorsX = Vector2(-0.05, 0.95),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[178] = {
Key = 178,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[179] = {
Key = 179,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = Vector2(0.02, 1.02),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[180] = {
Key = 180,
AnimationName = 'GameOverShowRed5',
Count = nil,
UINode = '1.0',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = Vector2(0, 1),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = false
},
[181] = {
Key = 181,
AnimationName = 'MatchSuccess',
Count = 30,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessRight',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(1.3, 1.3),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[182] = {
Key = 182,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessRight',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(1.3, 1.3),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[183] = {
Key = 183,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessRight',
IsInit = nil,
KeyFrame = 20,
Size = nil,
AnchorsX = Vector2(0.62, 0.62),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[184] = {
Key = 184,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessRight',
IsInit = nil,
KeyFrame = 22,
Size = nil,
AnchorsX = Vector2(0.58, 0.58),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[185] = {
Key = 185,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessRight',
IsInit = nil,
KeyFrame = 25,
Size = nil,
AnchorsX = Vector2(0.62, 0.62),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[186] = {
Key = 186,
AnimationName = 'MatchSuccess',
Count = 30,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessLeft',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = Vector2(-0.3, -0.3),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[187] = {
Key = 187,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessLeft',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = Vector2(-0.3, -0.3),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[188] = {
Key = 188,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessLeft',
IsInit = nil,
KeyFrame = 20,
Size = nil,
AnchorsX = Vector2(0.38, 0.38),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[189] = {
Key = 189,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessLeft',
IsInit = nil,
KeyFrame = 22,
Size = nil,
AnchorsX = Vector2(0.42, 0.42),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[190] = {
Key = 190,
AnimationName = 'MatchSuccess',
Count = nil,
UINode = 'Local.HallGUI.MatchPnl.ImgSuccess.ImgSuccessLeft',
IsInit = nil,
KeyFrame = 25,
Size = nil,
AnchorsX = Vector2(0.38, 0.38),
AnchorsY = nil,
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[191] = {
Key = 191,
AnimationName = 'ShowOccPnl',
Count = 30,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = true,
KeyFrame = 0,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(1, 2),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[192] = {
Key = 192,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 1,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(1, 2),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[193] = {
Key = 193,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 20,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[194] = {
Key = 194,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 23,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(-0.04, 0.96),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[195] = {
Key = 195,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 26,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[196] = {
Key = 196,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 28,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0.02, 1.02),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
},
[197] = {
Key = 197,
AnimationName = 'ShowOccPnl',
Count = nil,
UINode = 'Local.ChooseOcc.OccPnl',
IsInit = nil,
KeyFrame = 30,
Size = nil,
AnchorsX = nil,
AnchorsY = Vector2(0, 1),
Angle = nil,
Offset = nil,
Alpha = nil,
Tag = '',
Type = 'Linear',
IsStatic = true
}
}
return UIAnimationXls
|
GM_IRC = {}
if SERVER then
include( "sv_config.lua" )
include( "gm-irc/sv_msgGet.lua" )
include( "gm-irc/sv_msgSend.lua" )
AddCSLuaFile( "gm-irc/cl_msgRecive.lua" )
print( "------------------\n" )
print( "GM-IRC LOADED!\n" )
print( "------------------" )
hook.Add("Initialize", "irc_serverstarted", function ()
local embed = {
title = "Сервер запущен!",
description = "Карта сейчас - " .. game.GetMap(),
color = GM_IRC.PlayersCountColor
}
local json = util.TableToJSON ({
username = GM_IRC.Username,
embeds = { embed }
})
sendMsgToDiscord( json )
end)
end
if CLIENT then
include( "gm-irc/cl_msgRecive.lua" )
end
|
ITEM.name = "Cheese Burger"
ITEM.model = "models/food/burger.mdl"
ITEM.hungerAmount = 150
ITEM.foodDesc = "burgerDesc"
ITEM.quantity = 1
ITEM.price = 100
ITEM.iconCam = {
ang = Angle(11.135420799255, 269.24069213867, 0),
fov = 2.3069860161324,
pos = Vector(2.5959460735321, 193.05519104004, 52.177997589111)
} |
-- Double-ended queue class (deque)
-- Can be used as a queue or stack
local Deque = {}
-- Constructor
function Deque:new(...)
local object = {
}
setmetatable(object, { __index = Deque})
return object
end
function Deque:push(...)
local args = {...}
for i=1,#args do
table.insert(self, args[i])
end
end
Deque.add = Deque.push
function Deque:pop()
return table.remove(self)
end
function Deque:shift()
return table.remove(self, 1)
end
function Deque:unShift(item)
table.insert(self, 1, item)
end
function Deque:last()
return self[#self]
end
Deque.peek = Deque.last
function Deque:first()
return self[1]
end
return Deque
|
if string.sub(system.getInfo("model"),1,4) == "iPad" then
application =
{
content =
{
graphicsCompatibility = 1,
width = 360,
height = 480,
scale = "letterBox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
"badge", "sound", "alert"
}
}
}
}
elseif string.sub(system.getInfo("model"),1,2) == "iP" and display.pixelHeight > 960 then
application =
{
content =
{
graphicsCompatibility = 1,
width = 320,
height = 568,
scale = "letterBox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
"badge", "sound", "alert"
}
}
}
}
elseif string.sub(system.getInfo("model"),1,2) == "iP" then
application =
{
content =
{
graphicsCompatibility = 1,
width = 320,
height = 480,
scale = "letterBox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
"badge", "sound", "alert"
}
}
}
}
--[[
elseif display.pixelHeight / display.pixelWidth > 1.72 then
application =
{
content =
{
width = 320,
height = 570,
scale = "letterBox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
}
]]--
else
local cWIDTH = 320
local cHEIGHT = 480
cHEIGHT = math.floor((cWIDTH/display.pixelWidth)*display.pixelHeight)
if cHEIGHT < 480 then cHEIGHT = 480 end
application =
{
content =
{
graphicsCompatibility = 1,
width = cWIDTH,
height = cHEIGHT,
fps = 30,
scale = "letterbox",
xAlign = "center",
yAlign = "center",
imageSuffix =
{
["@2x"] = 1.8, --NEEDS TO BE <2 TO ACCOMODATE FOR COMPARABLY SIZED ANDROID DEVICES
["@4x"] = 3.7 --LIKEWISE
}
}
}
end |
local t = require( "taptest" )
local isnan = require( "isnan" )
t( isnan( 0.0 ), false )
t( isnan( 1.0 / 0.0 ), false )
t( isnan( -1.0 / 0.0 ), false )
t( isnan( math.sqrt( -1.0 ) ), true )
t()
|
--[[
------------------------------------
Description: HPC Spawn where killed (standalone), Phasor V2+
Copyright (c) 2016-2018
* Author: Jericho Crosby
* IGN: Chalwk
* Written and Created by Jericho Crosby
-----------------------------------
]]--
players = { }
DEATH_LOCATION = { }
Spawn_Where_Killed = true
for i = 0, 15 do
DEATH_LOCATION[i] = { }
end
function OnScriptUnload()
end
function GetRequiredVersion()
return 200
end
function OnScriptLoad(processid, game, persistent)
end
function OnPlayerKill(killer, victim, mode)
if mode == 4 then
ADD_KILL(killer)
if Spawn_Where_Killed == true then
local x, y, z = getobjectcoords(getplayerobjectid(victim))
DEATH_LOCATION[victim][1] = x
DEATH_LOCATION[victim][2] = y
DEATH_LOCATION[victim][3] = z
end
elseif mode == 5 then
ADD_KILL(killer)
if Spawn_Where_Killed == true then
local x, y, z = getobjectcoords(getplayerobjectid(victim))
DEATH_LOCATION[victim][1] = x
DEATH_LOCATION[victim][2] = y
DEATH_LOCATION[victim][3] = z
end
elseif mode == 6 then
if Spawn_Where_Killed == true then
local x, y, z = getobjectcoords(getplayerobjectid(victim))
DEATH_LOCATION[victim][1] = x
DEATH_LOCATION[victim][2] = y
DEATH_LOCATION[victim][3] = z
end
end
end
function ADD_KILL(player)
if getplayer(player) then
local kills = players[player][2]
players[player][2] = kills + 1
end
end
function OnPlayerLeave(player)
for i = 1, 3 do
DEATH_LOCATION[player][i] = nil
end
end
function OnPlayerSpawn(player)
if getplayer(player) then
if Spawn_Where_Killed == true then
if DEATH_LOCATION[player][1] ~= nil and DEATH_LOCATION[player][2] ~= nil then
movobjectcoords(getplayerobjectid(player), DEATH_LOCATION[player][1], DEATH_LOCATION[player][2], DEATH_LOCATION[player][3])
for i = 1, 3 do
DEATH_LOCATION[player][i] = nil
end
end
end
end
end |
-- English language strings
local L = LANG.CreateLanguage("English")
--- General text used in various places
L.traitor = "Traitor"
L.detective = "Detective"
L.mercenary = "Mercenary"
L.hypnotist = "Hypnotist"
L.glitch = "Glitch"
L.jester = "Jester"
L.phantom = "Phantom"
L.zombie = "Zombie"
L.vampire = "Vampire"
L.swapper = "Swapper"
L.assassin = "Assassin"
L.killer = "Killer"
L.innocent = "Innocent"
L.emt = "EMT"
L.hidden = "Hidden"
L.last_words = "Last Words"
L.terrorists = "Terrorists"
L.spectators = "Spectators"
--- Round status messages
L.round_minplayers = "Not enough players to start a new round..."
L.round_voting = "Vote in progress, delaying new round by {num} seconds..."
L.round_begintime = "A new round begins in {num} seconds. Prepare yourself."
L.round_selected = "The Traitors have been selected."
L.round_started = "The round has begun!"
L.round_restart = "The round has been forced to restart by an admin."
L.round_traitors_one = "Traitor, you stand alone."
L.round_traitors_more = "Traitor, these are your allies: {names}"
L.win_time = "Time has run out. The Traitors lose."
L.win_traitor = "The Traitors have won!"
L.win_jester = "The Jester has fooled you all!"
L.win_innocent = "The Traitors have been defeated!"
L.win_killer = "The Killer has murdered you all!"
L.win_showreport = "Let's look at the round report for {num} seconds."
L.limit_round = "Round limit reached. {mapname} will load soon."
L.limit_time = "Time limit reached. {mapname} will load soon."
L.limit_left = "{num} round(s) or {time} minutes remaining before the map changes to {mapname}."
--- Credit awards
L.credit_det_all = "Detectives, you have been awarded {num} equipment credit(s) for your performance."
L.credit_tr_all = "Traitors, you have been awarded {num} equipment credit(s) for your performance."
L.credit_zom = "Zombie, you have been awarded {num} equipment credit(s) for your performance."
L.credit_kil = "Killer, you have been awarded {num} equipment credit(s) for your performance."
L.credit_kill = "You have received {num} credit(s) for killing a {role}."
--- Karma
L.karma_dmg_full = "Your Karma is {amount}, so you deal full damage this round!"
L.karma_dmg_other = "Your Karma is {amount}. As a result all damage you deal is reduced by {num}%"
--- Body identification messages
L.body_found = "{finder} found the body of {victim}. {role}"
-- The {role} in body_found will be replaced by one of the following:
L.body_found_t = "They were a Traitor!"
L.body_found_d = "They were a Detective."
L.body_found_m = "They were a Mercenary."
L.body_found_h = "They were a Hypnotist."
L.body_found_g = "They were a Glitch."
L.body_found_j = "They were a Jester."
L.body_found_p = "They were a Phantom."
L.body_found_z = "They were a Zombie."
L.body_found_v = "They were a Vampire."
L.body_found_s = "They were a Swapper."
L.body_found_a = "They were an Assassin."
L.body_found_k = "They were a Killer."
L.body_found_i = "They were Innocent."
L.body_found_e = "They were an EMT"
L.body_confirm = "{finder} confirmed the death of {victim}."
L.body_call = "{player} called a Detective to the body of {victim}!"
L.body_call_error = "You must confirm the death of this player before calling a Detective!"
L.body_burning = "Ouch! This corpse is on fire!"
L.body_credits = "You found {num} credit(s) on the body!"
--- Menus and windows
L.close = "Close"
L.cancel = "Cancel"
-- For navigation buttons
L.next = "Next"
L.prev = "Previous"
-- Equipment buying menu
L.equip_title = "Equipment"
L.equip_tabtitle = "Order Equipment"
L.equip_status = "Ordering status"
L.equip_cost = "You have {num} credit(s) remaining."
L.equip_help_cost = "Every piece of equipment you buy costs 1 credit."
L.equip_help_carry = "You can only buy things for which you have room."
L.equip_carry = "You can carry this equipment."
L.equip_carry_own = "You are already carrying this item."
L.equip_carry_slot = "You are already carrying a weapon in slot {slot}."
L.equip_help_stock = "Of certain items you can only buy one per round."
L.equip_stock_deny = "This item is no longer in stock."
L.equip_stock_ok = "This item is in stock."
L.equip_custom = "Custom item added by this server."
L.equip_spec_name = "Name"
L.equip_spec_type = "Type"
L.equip_spec_desc = "Description"
L.equip_confirm = "Buy equipment"
-- Disguiser tab in equipment menu
L.disg_name = "Disguiser"
L.disg_menutitle = "Disguise control"
L.disg_not_owned = "You are not carrying a Disguiser!"
L.disg_enable = "Enable disguise"
L.disg_help1 = "When your disguise is active, your name, health and karma do not show when someone looks at you. In addition, you will be hidden from a Detective's radar."
L.disg_help2 = "Press Numpad Enter to toggle the disguise without using the menu. You can also bind a different key to 'ttt_toggle_disguise' using the console."
-- Radar tab in equipment menu
L.radar_name = "Radar"
L.radar_menutitle = "Radar control"
L.radar_not_owned = "You are not carrying a Radar!"
L.radar_scan = "Perform scan"
L.radar_auto = "Auto-repeat scan"
L.radar_help = "Scan results show for {num} seconds, after which the Radar will have recharged and can be used again."
L.radar_charging = "Your Radar is still charging!"
-- Transfer tab in equipment menu
L.xfer_name = "Transfer"
L.xfer_menutitle = "Transfer credits"
L.xfer_no_credits = "You have no credits to give!"
L.xfer_send = "Send a credit"
L.xfer_help = "You can only transfer credits to fellow {role} players."
L.xfer_no_recip = "Recipient not valid, credit transfer aborted."
L.xfer_no_credits = "Insufficient credits for transfer."
L.xfer_success = "Credit transfer to {player} completed."
L.xfer_received = "{player} has given you {num} credit."
-- Radio tab in equipment menu
L.radio_name = "Radio"
L.radio_help = "Click a button to make your Radio play that sound."
L.radio_notplaced = "You must place the Radio to play sound on it."
-- Radio soundboard buttons
L.radio_button_scream = "Scream"
L.radio_button_expl = "Explosion"
L.radio_button_pistol = "Pistol shots"
L.radio_button_m16 = "M16 shots"
L.radio_button_deagle = "Deagle shots"
L.radio_button_mac10 = "MAC10 shots"
L.radio_button_shotgun = "Shotgun shots"
L.radio_button_rifle = "Rifle shot"
L.radio_button_huge = "H.U.G.E burst"
L.radio_button_c4 = "C4 beeping"
L.radio_button_burn = "Burning"
L.radio_button_steps = "Footsteps"
-- Intro screen shown after joining
L.intro_help = "If you're new to the game, press F1 for instructions!"
-- Radiocommands/quickchat
L.quick_title = "Quickchat keys"
L.quick_yes = "Yes."
L.quick_no = "No."
L.quick_help = "Help!"
L.quick_imwith = "I'm with {player}."
L.quick_see = "I see {player}."
L.quick_suspect = "{player} acts suspicious."
L.quick_traitor = "{player} is a Traitor!"
L.quick_inno = "{player} is innocent."
L.quick_check = "Anyone still alive?"
-- {player} in the quickchat text normally becomes a player nickname, but can
-- also be one of the below. Keep these lowercase.
L.quick_nobody = "nobody"
L.quick_disg = "someone in disguise"
L.quick_corpse = "an unidentified body"
L.quick_corpse_id = "{player}'s corpse"
--- Body search window
L.search_title = "Body Search Results"
L.search_info = "Information"
L.search_confirm = "Confirm Death"
L.search_call = "Call Detective"
-- Descriptions of pieces of information found
L.search_nick = "This is the body of {player}."
L.search_role_t = "This person was a Traitor!"
L.search_role_d = "This person was a Detective."
L.search_role_m = "This person was a Mercenary"
L.search_role_h = "This person was a Hypnotist"
L.search_role_g = "This person was a Glitch"
L.search_role_j = "This person was a Jester"
L.search_role_p = "This person was a Phantom"
L.search_role_z = "This person was a Zombie"
L.search_role_v = "This person was a Vampire"
L.search_role_s = "This person was a Swapper"
L.search_role_a = "This person was an Assassin"
L.search_role_k = "This person was a Killer"
L.search_role_i = "This person was Innocent."
L.search_role_e = "This person was an EMT."
L.search_words = "Something tells you some of this person's last words were: '{lastwords}'"
L.search_armor = "They were wearing nonstandard body armor."
L.search_disg = "They were carrying a device that could hide their identity."
L.search_radar = "They were carrying some sort of radar. It is no longer functioning."
L.search_c4 = "In a pocket you found a note. It states that cutting wire {num} will safely disarm the bomb."
L.search_dmg_crush = "Many of their bones are broken. It seems the impact of a heavy object killed them."
L.search_dmg_bullet = "It is obvious they were shot to death."
L.search_dmg_fall = "They fell to their death."
L.search_dmg_boom = "Their wounds and singed clothes indicate an explosion caused their end."
L.search_dmg_club = "The body is bruised and battered. Clearly they were clubbed to death."
L.search_dmg_drown = "The body shows the telltale signs of drowning."
L.search_dmg_stab = "They were stabbed and cut before quickly bleeding to death."
L.search_dmg_burn = "Smells like roasted terrorist around here..."
L.search_dmg_tele = "It looks like their DNA was scrambled by tachyon emissions!"
L.search_dmg_car = "When this terrorist crossed the road, they were run over by a reckless driver."
L.search_dmg_other = "You cannot find a specific cause of this terrorist's death."
L.search_weapon = "It appears a {weapon} was used to kill them."
L.search_head = "The fatal wound was a headshot. No time to scream."
L.search_time = "They died roughly {time} before you conducted the search."
L.search_dna = "Retrieve a sample of the killer's DNA with a DNA Scanner. The DNA sample will decay roughly {time} from now."
L.search_kills1 = "You found a list of kills that confirms the death of {player}."
L.search_kills2 = "You found a list of kills with these names:"
L.search_eyes = "Using your detective skills, you identified the last person they saw: {player}. The killer, or a coincidence?"
-- Scoreboard
L.sb_playing = "You are playing on..."
L.sb_mapchange = "Map changes in {num} rounds or in {time}"
L.sb_sortby = "Sort By:"
L.sb_mia = "Missing In Action"
L.sb_confirmed = "Confirmed Dead"
L.sb_investigated = "Investigated"
L.sb_ping = "Ping"
L.sb_deaths = "Deaths"
L.sb_score = "Score"
L.sb_karma = "Karma"
L.sb_drinks = "Drinks"
L.sb_shots = "Shots"
L.sb_info_help = "Search this player's body, and you can review the results here."
L.sb_tag_friend = "FRIEND"
L.sb_tag_susp = "SUSPECT"
L.sb_tag_avoid = "AVOID"
L.sb_tag_kill = "KILL"
L.sb_tag_miss = "MISSING"
--- Help and settings menu (F1)
L.help_title = "Help and Settings"
-- Tabs
L.help_tut = "Tutorial"
L.help_tut_tip = "How TTT works, in 6 steps"
L.help_settings = "Settings"
L.help_settings_tip = "Client-side settings"
-- Settings
L.set_title_gui = "Interface settings"
L.set_tips = "Show gameplay tips at the bottom of the screen while spectating"
L.set_startpopup = "Start of round info popup duration"
L.set_startpopup_tip = "When the round starts, a small popup appears at the bottom of your screen for a few seconds. Change the time it displays for here."
L.set_cross_opacity = "Ironsight crosshair opacity"
L.set_cross_disable = "Disable crosshair completely"
L.set_minimal_id = "Minimalist Target ID under crosshair (no karma text, hints, etc)"
L.set_healthlabel = "Show health status label on health bar"
L.set_lowsights = "Lower weapon when using ironsights"
L.set_lowsights_tip = "Enable to position the weapon model lower on the screen while using ironsights. This will make it easier to see your target, but it will look less realistic."
L.set_fastsw = "Fast weapon switch"
L.set_fastsw_tip = "Enable to cycle through weapons without having to click again to use weapon. Enable show menu to show switcher menu."
L.set_fastsw_menu = "Enable menu with fast weapon switch"
L.set_fastswmenu_tip = "When fast weapons switch is enabled, the menu switcher menu will popup."
L.set_wswitch = "Disable weapon switch menu auto-closing"
L.set_wswitch_tip = "By default the weapon switcher automatically closes a few seconds after you last scroll. Enable this to make it stay up."
L.set_cues = "Play sound cue when a round begins or ends"
L.set_symbols = "Display symbols for roles"
L.set_symbols_tip = "By default letters will be shows to identify roles. Turning on this options changes the letters to symbols."
L.set_hide_role = "Hide your role in the HUD"
L.set_hide_role_tip = "By default your role will appear in the bottom left of the HUD. Turn this on to prevent screen cheating."
L.set_title_play = "Gameplay settings"
L.set_specmode = "Spectate-only mode (always stay spectator)"
L.set_specmode_tip = "Spectate-only mode will prevent you from respawning when a new round starts, instead you stay Spectator."
L.set_mute = "Mute living players when dead"
L.set_mute_tip = "Enable to mute living players while you are dead/spectator."
L.set_title_lang = "Language settings"
-- It may be best to leave this next one english, so english players can always
-- find the language setting even if it's set to a language they don't know.
L.set_lang = "Select language:"
--- Weapons and equipment, HUD and messages
-- Equipment actions, like buying and dropping
L.buy_no_stock = "This weapon is out of stock: you already bought it this round."
L.buy_pending = "You already have an order pending, wait until you receive it."
L.buy_received = "You have received your special equipment."
L.drop_no_room = "You have no room here to drop your weapon!"
L.disg_turned_on = "Disguise enabled!"
L.disg_turned_off = "Disguise disabled."
-- Equipment item descriptions
L.item_passive = "Passive effect item"
L.item_active = "Active use item"
L.item_weapon = "Weapon"
L.item_armor = "Body Armor"
L.item_armor_desc = [[
Reduces bullet damage by 30% when
you get hit. Does not protect your
head.]]
L.item_radar = "Radar"
L.item_radar_desc = [[
Allows you to scan for life signs.
Starts automatic scans as soon as you
buy it. Configure it in Radar tab of this
menu.]]
L.item_disg = "Disguiser"
L.item_disg_desc = [[
Hides your ID info while on. Also avoids
being the person last seen by a victim.
Toggle in the Disguise tab of this menu
or press Numpad Enter.]]
L.item_speed = "Speed Boost"
L.item_speed_desc = [[
Increases the speed boost given while
holding claws from 35% to 50%.]]
L.item_regen = "Regeneration"
L.item_regen_desc = [[
Passively regenerate health at a
rate of 1.5 HP every second.]]
-- C4
L.c4_hint = "Press {usekey} to arm or disarm."
L.c4_no_disarm = "You cannot disarm another Traitor's C4 unless they are dead."
L.c4_disarm_warn = "A C4 explosive you planted has been disarmed."
L.c4_armed = "You have successfully armed the bomb."
L.c4_disarmed = "You have successfully disarmed the bomb."
L.c4_no_room = "You cannot carry this C4."
L.c4_desc = "Powerful timed explosive."
L.c4_arm = "Arm C4"
L.c4_arm_timer = "Timer"
L.c4_arm_seconds = "Seconds until detonation:"
L.c4_arm_attempts = "In disarm attempts, {num} of the 6 wires will cause instant detonation when cut."
L.c4_remove_title = "Removal"
L.c4_remove_pickup = "Pick up C4"
L.c4_remove_destroy1 = "Destroy C4"
L.c4_remove_destroy2 = "Confirm: destroy"
L.c4_disarm = "Disarm C4"
L.c4_disarm_cut = "Click to cut wire {num}"
L.c4_disarm_t = "Cut a wire to disarm the bomb. As you are Traitor, every wire is safe. Innocents don't have it so easy!"
L.c4_disarm_owned = "Cut a wire to disarm the bomb. It's your bomb, so every wire will disarm it."
L.c4_disarm_other = "Cut a safe wire to disarm the bomb. It will explode if you get it wrong!"
L.c4_status_armed = "ARMED"
L.c4_status_disarmed = "DISARMED"
-- Visualizer
L.vis_name = "Visualizer"
L.vis_hint = "Press {usekey} to pick up (Detectives only)."
L.vis_help_pri = "{primaryfire} drops the activated device."
L.vis_desc = [[
Crime scene visualization device.
Analyzes a corpse to show how
the victim was killed, but only if
they died of gunshot wounds.]]
-- Decoy
L.decoy_name = "Decoy"
L.decoy_no_room = "You cannot carry this decoy."
L.decoy_broken = "Your Decoy has been destroyed!"
L.decoy_help_pri = "{primaryfire} plants the Decoy."
L.decoy_desc = [[
Shows a fake radar sign to detectives,
and makes their DNA scanner show the
location of the Decoy if they scan for
your DNA.]]
-- Defuser
L.defuser_name = "Defuser"
L.defuser_help = "{primaryfire} defuses targeted C4."
L.defuser_desc = [[
Instantly defuse a C4 explosive.
Unlimited uses. C4 will be easier to
notice if you carry this.]]
-- Flare gun
L.flare_name = "Flare gun"
L.flare_desc = [[
Can be used to burn corpses so that
they are never found. Limited ammo.
Burning a corpse makes a distinct
sound.]]
-- Health station
L.hstation_name = "Health Station"
L.hstation_hint = "Press {usekey} to receive health. Charge: {num}."
L.hstation_broken = "Your Health Station has been destroyed!"
L.hstation_help = "{primaryfire} places the Health Station."
L.hstation_desc = [[
Allows people to heal when placed.
Slow recharge. Anyone can use it, and
it can be damaged.]]
-- Knife
L.knife_name = "Knife"
L.knife_thrown = "Thrown knife"
L.knife_desc = [[
Kills wounded targets instantly and
silently, but only has a single use.
Can be thrown using alternate fire.]]
-- Poltergeist
L.polter_desc = [[
Plants thumpers on objects to shove
them around violently.
The energy bursts damage people in
close proximity.]]
-- Radio
L.radio_broken = "Your Radio has been destroyed!"
L.radio_help_pri = "{primaryfire} places the Radio."
L.radio_desc = [[
Plays sounds to distract or deceive.
Place the radio somewhere, and then
play sounds on it using the Radio tab
in this menu.]]
-- Silenced pistol
L.sipistol_name = "Silenced Pistol"
L.sipistol_desc = [[
Low-noise handgun, uses normal pistol
ammo.
Victims will not scream when killed.]]
-- Newton launcher
L.newton_name = "Newton launcher"
L.newton_desc = [[
Push people from a safe distance.
Infinite ammo, but slow to fire.]]
-- Binoculars
L.binoc_name = "Binoculars"
L.binoc_desc = [[
Zoom in on corpses and identify them
from a long distance away.
Unlimited uses, but identification
takes a few seconds.]]
L.binoc_help_pri = "{primaryfire} identifies a body."
L.binoc_help_sec = "{secondaryfire} changes zoom level."
-- UMP
L.ump_desc = [[
Experimental SMG that disorients
targets.
Uses standard SMG ammo.]]
-- DNA scanner
L.dna_name = "DNA scanner"
L.dna_identify = "Corpse must be identified to retrieve killer's DNA."
L.dna_notfound = "No DNA sample found on target."
L.dna_limit = "Storage limit reached. Remove old samples to add new ones."
L.dna_decayed = "DNA sample of the killer has decayed."
L.dna_killer = "Collected a sample of the killer's DNA from the corpse!"
L.dna_no_killer = "The DNA could not be retrieved (killer disconnected?)."
L.dna_armed = "This bomb is live! Disarm it first!"
L.dna_object = "Collected {num} new DNA sample(s) from the object."
L.dna_gone = "DNA not detected in area."
L.dna_desc = [[
Collect DNA samples from things
and use them to find the DNA's owner.
Use on fresh corpses to get the killer's DNA
and track them down.]]
L.dna_menu_title = "DNA scanning controls"
L.dna_menu_sample = "DNA sample found on {source}"
L.dna_menu_remove = "Remove selected"
L.dna_menu_help1 = "These are DNA samples you have collected."
L.dna_menu_help2 = [[
When charged, you can scan for the location of
the player the selected DNA sample belongs to.
Finding distant targets drains more energy.]]
L.dna_menu_scan = "Scan"
L.dna_menu_repeat = "Auto-repeat"
L.dna_menu_ready = "READY"
L.dna_menu_charge = "CHARGING"
L.dna_menu_select = "SELECT SAMPLE"
L.dna_help_primary = "{primaryfire} to collect a DNA sample"
L.dna_help_secondary = "{secondaryfire} to open scan controls"
-- Magneto stick
L.magnet_name = "Magneto-stick"
L.magnet_help = "{primaryfire} to attach body to surface."
-- Grenades and misc
L.grenade_smoke = "Smoke grenade"
L.grenade_fire = "Incendiary grenade"
L.unarmed_name = "Holstered"
L.crowbar_name = "Crowbar"
L.pistol_name = "Five-SeveN"
L.rifle_name = "Scout"
L.shotgun_name = "XM1014"
-- Teleporter
L.tele_name = "Teleporter"
L.tele_failed = "Teleport failed."
L.tele_marked = "Teleport location marked."
L.tele_no_ground = "Cannot teleport unless standing on solid ground!"
L.tele_no_crouch = "Cannot teleport while crouched!"
L.tele_no_mark = "No location marked. Mark a destination before teleporting."
L.tele_no_mark_ground = "Cannot mark a teleport location unless standing on solid ground!"
L.tele_no_mark_crouch = "Cannot mark a teleport location while crouched!"
L.tele_help_pri = "{primaryfire} teleports to marked location."
L.tele_help_sec = "{secondaryfire} marks current location."
L.tele_desc = [[
Teleport to a previously marked spot.
Teleporting makes noise, and the
number of uses is limited.]]
L.brainwash_help_pri = "Hold {primaryfire} to revive dead body."
L.brainwash_help_sec = "The revived player will become a traitor."
-- Ammo names, shown when picked up
L.ammo_alyxgun = "Pistol ammo"
L.ammo_smg1 = "SMG ammo"
L.ammo_buckshot = "Shotgun ammo"
L.ammo_357 = "Sniper Rifle ammo"
L.ammo_pistol = "Assault Rifle ammo"
L.ammo_ar2altfire = "Flare ammo"
L.ammo_gravity = "Poltergeist ammo"
--- HUD interface text
-- Round status
L.round_wait = "Waiting"
L.round_prep = "Preparing"
L.round_active = "In progress"
L.round_post = "Round over"
-- Health, ammo and time area
L.overtime = "OVERTIME"
L.hastemode = "HASTE MODE"
-- TargetID health status
L.hp_healthy = "Healthy"
L.hp_hurt = "Hurt"
L.hp_wounded = "Wounded"
L.hp_badwnd = "Badly Wounded"
L.hp_death = "Near Death"
-- TargetID karma status
L.karma_max = "Renowned"
L.karma_high = "Reputable"
L.karma_med = "Questionable"
L.karma_low = "Dangerous"
L.karma_min = "Liability"
-- TargetID misc
L.corpse = "Corpse"
L.corpse_hint = "Press E to investigate"
L.target_disg = " (DISGUISED)"
L.target_unid = "Unidentified body"
L.target_innocent = "INNOCENT"
L.target_detective = "DETECTIVE"
L.target_glitch = "GLITCH"
L.target_mercenary = "MERCENARY"
L.target_phantom = "PHANTOM"
L.target_traitor = "TRAITOR"
L.target_assassin = "ASSASSIN"
L.target_hypnotist = "HYPNOTIST"
L.target_vampire = "VAMPIRE"
L.target_zombie = "ZOMBIE"
L.target_jester = "JESTER"
L.target_swapper = "SWAPPER"
L.target_killer = "KILLER"
L.target_emt = "EMT"
L.target_fellow_traitor = "FELLOW TRAITOR"
L.target_fellow_zombie = "FELLOW ZOMBIE"
L.target_current_target = "CURRENT TARGET"
L.target_credits = "Search to silently receive unspent credits"
-- Traitor buttons (HUD buttons with hand icons that only traitors can see)
L.tbut_single = "Single use"
L.tbut_reuse = "Reusable"
L.tbut_retime = "Reusable after {num} sec"
L.tbut_help = "Press {key} to activate"
-- Equipment info lines (on the left above the health/ammo panel)
L.disg_hud = "Disguised. Your name is hidden."
L.radar_hud = "Radar ready for next scan in: {time}"
-- Spectator muting of living/dead
L.mute_living = "Living players muted"
L.mute_specs = "Spectators muted"
L.mute_all = "All muted"
L.mute_off = "None muted"
-- Spectators and prop possession
L.punch_title = "PUNCH-O-METER"
L.punch_help = "Move keys or jump: punch object. Crouch: leave object."
L.punch_bonus = "Your bad score lowered your punch-o-meter limit by {num}"
L.punch_malus = "Your good score increased your punch-o-meter limit by {num}!"
L.spec_help = "Click to spectate players, or press {usekey} on a physics object to possess it."
--- Info popups shown when the round starts
-- These are spread over multiple lines, hence the square brackets instead of
-- quotes. That's a Lua thing. Every line break (enter) will show up in-game.
L.info_popup_innocent = [[You are an innocent Terrorist! But there are traitors around...
Who can you trust, and who is out to fill you with bullets?
Watch your back and work with your comrades to get out of this alive!]]
L.info_popup_detective = [[You are a Detective! Terrorist HQ has given you special resources to find the traitors.
Use them to help the innocent survive, but be careful:
the traitors will be looking to take you down first!
Press {menukey} to receive your equipment!]]
L.info_popup_mercenary = [[You are a Mercenary! Try to survive and help your innocent friends!
Press {menukey} to receive your equipment!]]
L.info_popup_hypnotist = [[You are a Hypnotist! Work with fellow traitors to kill all others.
These are your comrades:
{traitorlist}
You can use your brain washing device on a corpse to revive them as a traitor.
Press {menukey} to receive your special equipment!]]
L.info_popup_hypnotist_alone = [[You are a Hypnotist! You have no fellow traitors this round.
Kill all others to win!
You can use your brain washing device on a corpse to revive them as a traitor.
Press {menukey} to receive your special equipment!]]
L.info_popup_glitch = [[You are a Glitch! The traitors think you are one of them.
Try to blend in and don't give yourself away.]]
L.info_popup_jester = [[You are a Jester! You Hate your life, you want to die
but you deal no damage so you must be killed by some one else.]]
L.info_popup_phantom = [[You are a Phantom! Try to survive and help your innocent friends!
You will haunt the player who kills you causing black smoke to appear.
The haunting will then spread if other players kill your attacker.]]
L.info_popup_emt = [[You are an EMT! Try to survive and help your innocent friends!. You can revive dead players with your defibrillator]]
L.info_popup_zombie = [[You are a Zombie! Work with fellow zombies to kill all others.
These are your comrades:
{zombielist}
All damage you deal with guns is reduced by one half.
Killing someone with your claws will turn them into a zombie.
Press {menukey} to receive your special equipment!]]
L.info_popup_zombie_alone = [[You are a Zombie! You have no fellow zombies this round.
Kill all others to win!
All damage you deal with guns is reduced by one half.
Killing someone with your claws will turn them into a zombie.
Press {menukey} to receive your special equipment!]]
L.info_popup_vampire = [[You are a Vampire! Work with fellow traitors to kill all others.
These are your comrades:
{traitorlist}
You can use your fangs to eat corpses and refill your health.
Press {menukey} to receive your special equipment!]]
L.info_popup_vampire_alone = [[You are a Vampire! You have no fellow traitors this round.
Kill all others to win!
You can use your fangs to eat corpses and refill your health.
Press {menukey} to receive your special equipment!]]
L.info_popup_swapper = [[You are a Swapper! You deal no damage however,
if anyone kills you they will die instead and
you take their role and can join the fight.]]
L.info_popup_assassin = [[You are an Assassin! Work with fellow traitors to kill all others.
These are your comrades:
{traitorlist}
You will deal double damage to your target and half damage
to all other players. But take care as killing the wrong
player will result in you losing your double damage bonus.
Press {menukey} to receive your special equipment!]]
L.info_popup_assassin_alone = [[You are a Assassin! You have no fellow traitors this round.
Kill all others to win!
You will deal double damage to your target and half damage
to all other players. But take care as killing the wrong
player will result in you losing your double damage bonus.
Press {menukey} to receive your special equipment!]]
L.info_popup_killer = [[You are a Killer! Try to kill everyone and be the last one standing!
Press {menukey} to receive your equipment!]]
L.info_popup_traitor_alone = [[You are a TRAITOR! You have no fellow traitors this round.
Kill all others to win!
Press {menukey} to receive your special equipment!]]
L.info_popup_traitor = [[You are a TRAITOR! Work with fellow traitors to kill all others.
But take care, or your treason may be discovered...
These are your comrades:
{traitorlist}
Press {menukey} to receive your special equipment!]]
L.info_popup_traitor_hypnotist = [[You are a TRAITOR! Work with fellow traitors to kill all others.
But take care, or your treason may be discovered...
These are your comrades:
{traitorlist}
The following comrade is a hypnotist:
{hypnotistlist}
Press {menukey} to receive your special equipment!]]
L.info_popup_traitor_vampire = [[You are a TRAITOR! Work with fellow traitors to kill all others.
But take care, or your treason may be discovered...
These are your comrades:
{traitorlist}
The following comrade is a vampire:
{vampirelist}
Press {menukey} to receive your special equipment!]]
L.info_popup_traitor_assassin = [[You are a TRAITOR! Work with fellow traitors to kill all others.
But take care, or your treason may be discovered...
These are your comrades:
{traitorlist}
The following comrade is an assassin:
{assassinlist}
Press {menukey} to receive your special equipment!]]
L.info_popup_traitor_glitch = [[You are a TRAITOR! Work with fellow traitors to kill all others.
BUT BEWARE! There was a glitch in the system and one among you does not seek the same goal.
These may or may not be your comrades:
{traitorlist}
Press {menukey} to receive your special equipment!]]
--- Various other text
L.name_kick = "A player was automatically kicked for changing their name during a round."
L.idle_popup = [[You were idle for {num} seconds and were moved into Spectator-only mode as a result. While you are in this mode, you will not spawn when a new round starts.
You can toggle Spectator-only mode at any time by pressing {helpkey} and unchecking the box in the Settings tab. You can also choose to disable it right now.]]
L.idle_popup_close = "Do nothing"
L.idle_popup_off = "Disable Spectator-only mode now"
L.idle_warning = "Warning: you appear to be idle/AFK, and will be made to spectate unless you show activity!"
L.spec_mode_warning = "You are in Spectator Mode and will not spawn when a round starts. To disable this mode, press F1, go to Settings and uncheck 'Spectate-only mode'."
--- Tips, shown at bottom of screen to spectators
-- Tips panel
L.tips_panel_title = "Tips"
L.tips_panel_tip = "Tip:"
-- Tip texts
L.tip1 = "Traitors can search a corpse silently, without confirming the death, by holding {walkkey} and pressing {usekey} on the corpse."
L.tip2 = "Arming a C4 explosive with a longer timer will increase the number of wires that cause it to explode instantly when an innocent attempts to disarm it. It will also beep softer and less often."
L.tip3 = "Detectives can search a corpse to find who is 'reflected in its eyes'. This is the last person the dead guy saw. That does not have to be the killer if they were shot in the back."
L.tip4 = "No one will know you have died until they find your dead body and identify you by searching it."
L.tip5 = "When a Traitor kills a Detective, they instantly receive a credit reward."
L.tip6 = "When a Traitor dies, all Detectives are rewarded equipment credits."
L.tip7 = "When the Traitors have made significant progress in killing innocents, they will receive an equipment credit as reward."
L.tip8 = "Traitors and Detectives can collect unspent equipment credits from the dead bodies of other Traitors and Detectives."
L.tip9 = "The Poltergeist can turn any physics object into a deadly projectile. Each punch is accompanied by a blast of energy hurting anyone nearby."
L.tip10 = "As Traitor or Detective, keep an eye on red messages in the top right. These will be important for you."
L.tip11 = "As Traitor or Detective, keep in mind you are rewarded extra equipment credits if you and your comrades perform well. Make sure you remember to spend them!"
L.tip12 = "The Detectives' DNA Scanner can be used to gather DNA samples from weapons and items and then scan to find the location of the player who used them. Useful when you can get a sample from a corpse or a disarmed C4!"
L.tip13 = "When you are close to someone you kill, some of your DNA is left on the corpse. This DNA can be used with a Detective's DNA Scanner to find your current location. Better hide the body after you knife someone!"
L.tip14 = "The further you are away from someone you kill, the faster your DNA sample on their body will decay."
L.tip15 = "Are you Traitor and going sniping? Consider trying out the Disguiser. If you miss a shot, run away to a safe spot, disable the Disguiser, and no one will know it was you who was shooting at them."
L.tip16 = "As Traitor, the Teleporter can help you escape when chased, and allows you to quickly travel across a big map. Make sure you always have a safe position marked."
L.tip17 = "Are the innocents all grouped up and hard to pick off? Consider trying out the Radio to play sounds of C4 or a firefight to lead some of them away."
L.tip18 = "Using the Radio as Traitor, you can play sounds through your Equipment Menu after the radio has been placed. Queue up multiple sounds by clicking multiple buttons in the order you want them."
L.tip19 = "As Detective, if you have leftover credits you could give a trusted Innocent a Defuser. Then you can spend your time doing the serious investigative work and leave the risky bomb defusal to them."
L.tip20 = "The Detectives' Binoculars allow long-range searching and identifying of corpses. Bad news if the Traitors were hoping to use a corpse as bait. Of course, while using the Binoculars a Detective is unarmed and distracted..."
L.tip21 = "The Detectives' Health Station lets wounded players recover. Of course, those wounded people could be Traitors..."
L.tip22 = "The Health Station records a DNA sample of everyone who uses it. Detectives can use this with the DNA Scanner to find out who has been healing up."
L.tip23 = "Unlike weapons and C4, the Radio equipment for Traitors does not contain a DNA sample of the person who planted it. Don't worry about Detectives finding it and blowing your cover."
L.tip24 = "Press {helpkey} to view a short tutorial or modify some TTT-specific settings. For example, you can permanently disable these tips there."
L.tip25 = "When a Detective searches a body, the result is available to all players via the scoreboard by clicking on the name of the dead person."
L.tip26 = "In the scoreboard, a magnifying glass icon next to someone's name indicates you have search information about that person. If the icon is bright, the data comes from a Detective and may contain additional information."
L.tip27 = "As Detective, corpses with a magnifying glass after the nickname have been searched by a Detective and their results are available to all players via the scoreboard."
L.tip28 = "Spectators can press {mutekey} to cycle through muting other spectators or living players."
L.tip29 = "If the server has installed additional languages, you can switch to a different language at any time in the Settings menu."
L.tip30 = "Quickchat or 'radio' commands can be used by pressing {zoomkey}."
L.tip31 = "As Spectator, press {duckkey} to unlock your mouse cursor and click the buttons on this tips panel. Press {duckkey} again to go back to mouseview."
L.tip32 = "The Crowbar's secondary fire will push other players."
L.tip33 = "Firing through the ironsights of a weapon will slightly increase your accuracy and decrease recoil. Crouching does not."
L.tip34 = "Smoke grenades are effective indoors, especially for creating confusion in crowded rooms."
L.tip35 = "As Traitor, remember you can carry dead bodies and hide them from the prying eyes of the innocent and their Detectives."
L.tip36 = "The tutorial available under {helpkey} contains an overview of the most important keys of the game."
L.tip37 = "On the scoreboard, click the name of a living player and you can select a tag for them such as 'suspect' or 'friend'. This tag will show up if you have them under your crosshair."
L.tip38 = "Many of the placeable equipment items (such as C4, Radio) can be stuck on walls using secondary fire."
L.tip39 = "C4 that explodes due to a mistake in disarming it has a smaller explosion than C4 that reaches zero on its timer."
L.tip40 = "If it says 'HASTE MODE' above the round timer, the round will at first be only a few minutes long, but with every death the available time increases (like capturing a point in TF2). This mode puts the pressure on the traitors to keep things moving."
--- Round report
L.report_title = "Round report"
-- Tabs
L.report_tab_hilite = "Highlights"
L.report_tab_hilite_tip = "Round highlights"
L.report_tab_events = "Events"
L.report_tab_events_tip = "Log of the events that happened this round"
L.report_tab_scores = "Scores"
L.report_tab_scores_tip = "Points scored by each player in this round alone"
-- Event log saving
L.report_save = "Save Log .txt"
L.report_save_tip = "Saves the Event Log to a text file"
L.report_save_error = "No Event Log data to save."
L.report_save_result = "The Event Log has been saved to:"
-- Big title window
L.hilite_win_traitors = "THE TRAITORS WIN"
L.hilite_win_jester = "THE JESTER WINS"
L.hilite_win_innocent = "THE INNOCENT WIN"
L.hilite_win_killer = "THE KILLER WINS"
L.hilite_players1 = "{numplayers} players took part, {numtraitors} were traitors"
L.hilite_players2 = "{numplayers} players took part, one of them the traitor"
L.hilite_duration = "The round lasted {time}"
-- Columns
L.col_time = "Time"
L.col_event = "Event"
L.col_player = "Player"
L.col_role = "Role"
L.col_kills1 = "Innocent kills"
L.col_kills2 = "Traitor kills"
L.col_points = "Points"
L.col_team = "Team bonus"
L.col_total = "Total points"
-- Name of a trap that killed us that has not been named by the mapper
L.something = "something"
-- Kill events
L.ev_blowup = "{victim} blew themselves up"
L.ev_blowup_trap = "{victim} was blown up by {trap}"
L.ev_tele_self = "{victim} telefragged themselves"
L.ev_sui = "{victim} couldn't take it and killed themselves"
L.ev_sui_using = "{victim} killed themselves using {tool}"
L.ev_fall = "{victim} fell to their death"
L.ev_fall_pushed = "{victim} fell to their death after {attacker} pushed them"
L.ev_fall_pushed_using = "{victim} fell to their death after {attacker} used {trap} to push them"
L.ev_shot = "{victim} was shot by {attacker}"
L.ev_shot_using = "{victim} was shot by {attacker} using a {weapon}"
L.ev_drown = "{victim} was drowned by {attacker}"
L.ev_drown_using = "{victim} was drowned by {trap} triggered by {attacker}"
L.ev_boom = "{victim} was exploded by {attacker}"
L.ev_boom_using = "{victim} was blown up by {attacker} using {trap}"
L.ev_burn = "{victim} was fried by {attacker}"
L.ev_burn_using = "{victim} was burned by {trap} due to {attacker}"
L.ev_club = "{victim} was beaten up by {attacker}"
L.ev_club_using = "{victim} was pummeled to death by {attacker} using {trap}"
L.ev_slash = "{victim} was stabbed by {attacker}"
L.ev_slash_using = "{victim} was cut up by {attacker} using {trap}"
L.ev_tele = "{victim} was telefragged by {attacker}"
L.ev_tele_using = "{victim} was atomized by {trap} set by {attacker}"
L.ev_goomba = "{victim} was crushed by the massive bulk of {attacker}"
L.ev_crush = "{victim} was crushed by {attacker}"
L.ev_crush_using = "{victim} was crushed by {trap} of {attacker}"
L.ev_other = "{victim} was killed by {attacker}"
L.ev_other_using = "{victim} was killed by {attacker} using {trap}"
-- Other events
L.ev_body = "{finder} found the corpse of {victim}"
L.ev_c4_plant = "{player} planted C4"
L.ev_c4_boom = "The C4 planted by {player} exploded"
L.ev_c4_disarm1 = "{player} disarmed C4 planted by {owner}"
L.ev_c4_disarm2 = "{player} failed to disarm C4 planted by {owner}"
L.ev_credit = "{finder} found {num} credit(s) on the corpse of {player}"
L.ev_start = "The round started"
L.ev_win_traitor = "The dastardly traitors won the round!"
L.ev_win_inno = "The lovable innocent terrorists won the round!"
L.ev_win_time = "The traitors ran out of time and lost!"
--- Awards/highlights
L.aw_sui1_title = "Suicide Cult Leader"
L.aw_sui1_text = "showed the other suiciders how to do it by being the first to go."
L.aw_sui2_title = "Lonely and Depressed"
L.aw_sui2_text = "was the only one who killed themselves."
L.aw_exp1_title = "Explosives Research Grant"
L.aw_exp1_text = "was recognized for their research on explosions. {num} test subjects helped out."
L.aw_exp2_title = "Field Research"
L.aw_exp2_text = "tested their own resistance to explosions. It was not high enough."
L.aw_fst1_title = "First Blood"
L.aw_fst1_text = "delivered the first innocent death at a traitor's hands."
L.aw_fst2_title = "First Bloody Stupid Kill"
L.aw_fst2_text = "scored the first kill by shooting a fellow traitor. Good job."
L.aw_fst3_title = "First Blooper"
L.aw_fst3_text = "was the first to kill. Too bad it was an innocent comrade."
L.aw_fst4_title = "First Blow"
L.aw_fst4_text = "struck the first blow for the innocent terrorists by making the first death a traitor's."
L.aw_all1_title = "Deadliest Among Equals"
L.aw_all1_text = "was responsible for every kill made by the innocent this round."
L.aw_all2_title = "Lone Wolf"
L.aw_all2_text = "was responsible for every kill made by a traitor this round."
L.aw_nkt1_title = "I Got One, Boss!"
L.aw_nkt1_text = "managed to kill a single innocent. Sweet!"
L.aw_nkt2_title = "A Bullet For Two"
L.aw_nkt2_text = "showed the first one was not a lucky shot by killing another."
L.aw_nkt3_title = "Serial Traitor"
L.aw_nkt3_text = "ended three innocent lives of terrorism today."
L.aw_nkt4_title = "Wolf Among More Sheep-Like Wolves"
L.aw_nkt4_text = "eats innocent terrorists for dinner. A dinner of {num} courses."
L.aw_nkt5_title = "Counter-Terrorism Operative"
L.aw_nkt5_text = "gets paid per kill. Can now buy another luxury yacht."
L.aw_nki1_title = "Betray This"
L.aw_nki1_text = "found a traitor. Shot a traitor. Easy."
L.aw_nki2_title = "Applied to the Justice Squad"
L.aw_nki2_text = "escorted two traitors to the great beyond."
L.aw_nki3_title = "Do Traitors Dream Of Traitorous Sheep?"
L.aw_nki3_text = "put three traitors to rest."
L.aw_nki4_title = "Internal Affairs Employee"
L.aw_nki4_text = "gets paid per kill. Can now order their fifth swimming pool."
L.aw_fal1_title = "No Mr. Bond, I Expect You To Fall"
L.aw_fal1_text = "pushed someone off a great height."
L.aw_fal2_title = "Floored"
L.aw_fal2_text = "let their body hit the floor after falling from a significant altitude."
L.aw_fal3_title = "The Human Meteorite"
L.aw_fal3_text = "crushed someone by falling on them from a great height."
L.aw_hed1_title = "Efficiency"
L.aw_hed1_text = "discovered the joy of headshots and made {num}."
L.aw_hed2_title = "Neurology"
L.aw_hed2_text = "removed the brains from {num} heads for a closer examination."
L.aw_hed3_title = "Videogames Made Me Do It"
L.aw_hed3_text = "applied their murder simulation training and headshotted {num} foes."
L.aw_cbr1_title = "Thunk Thunk Thunk"
L.aw_cbr1_text = "has a mean swing with the crowbar, as {num} victims found out."
L.aw_cbr2_title = "Freeman"
L.aw_cbr2_text = "covered their crowbar in the brains of no less than {num} people."
L.aw_pst1_title = "Persistent Little Bugger"
L.aw_pst1_text = "scored {num} kills using the pistol. Then they went on to hug someone to death."
L.aw_pst2_title = "Small Caliber Slaughter"
L.aw_pst2_text = "killed a small army of {num} with a pistol. Presumably installed a tiny shotgun inside the barrel."
L.aw_sgn1_title = "Easy Mode"
L.aw_sgn1_text = "applies the buckshot where it hurts, murdering {num} targets."
L.aw_sgn2_title = "A Thousand Little Pellets"
L.aw_sgn2_text = "didn't really like their buckshot, so they gave it all away. {num} recipients did not live to enjoy it."
L.aw_rfl1_title = "Point and Click"
L.aw_rfl1_text = "shows all you need for {num} kills is a rifle and a steady hand."
L.aw_rfl2_title = "I Can See Your Head From Here"
L.aw_rfl2_text = "knows their rifle. Now {num} other people know the rifle too."
L.aw_dgl1_title = "It's Like A Tiny Rifle"
L.aw_dgl1_text = "is getting the hang of the Desert Eagle and killed {num} people."
L.aw_dgl2_title = "Eagle Master"
L.aw_dgl2_text = "blew away {num} people with the deagle."
L.aw_mac1_title = "Pray and Slay"
L.aw_mac1_text = "killed {num} people with the MAC10, but won't say how much ammo they needed."
L.aw_mac2_title = "Mac and Cheese"
L.aw_mac2_text = "wonders what would happen if they could wield two MAC10s. {num} times two?"
L.aw_sip1_title = "Be Quiet"
L.aw_sip1_text = "shut {num} people up with the silenced pistol."
L.aw_sip2_title = "Silenced Assassin"
L.aw_sip2_text = "killed {num} people who did not hear themselves die."
L.aw_knf1_title = "Knife Knowing You"
L.aw_knf1_text = "stabbed someone in the face over the internet."
L.aw_knf2_title = "Where Did You Get That From?"
L.aw_knf2_text = "was not a Traitor, but still killed someone with a knife."
L.aw_knf3_title = "Such A Knife Man"
L.aw_knf3_text = "found {num} knives lying around, and made use of them."
L.aw_knf4_title = "World's Knifest Man"
L.aw_knf4_text = "killed {num} people with a knife. Don't ask me how."
L.aw_flg1_title = "To The Rescue"
L.aw_flg1_text = "used their flares to signal for {num} deaths."
L.aw_flg2_title = "Flare Indicates Fire"
L.aw_flg2_text = "taught {num} men about the danger of wearing flammable clothing."
L.aw_hug1_title = "A H.U.G.E Spread"
L.aw_hug1_text = "was in tune with their H.U.G.E, somehow managing to make their bullets hit {num} people."
L.aw_hug2_title = "A Patient Para"
L.aw_hug2_text = "just kept firing, and saw their H.U.G.E patience rewarded with {num} kills."
L.aw_msx1_title = "Putt Putt Putt"
L.aw_msx1_text = "picked off {num} people with the M16."
L.aw_msx2_title = "Mid-range Madness"
L.aw_msx2_text = "knows how to take down targets with the M16, scoring {num} kills."
L.aw_tkl1_title = "Made An Oopsie"
L.aw_tkl1_text = "had their finger slip just when they were aiming at a buddy."
L.aw_tkl2_title = "Double-Oops"
L.aw_tkl2_text = "thought they got a Traitor twice, but was wrong both times."
L.aw_tkl3_title = "Karma-conscious"
L.aw_tkl3_text = "couldn't stop after killing two teammates. Three is their lucky number."
L.aw_tkl4_title = "Teamkiller"
L.aw_tkl4_text = "murdered the entirety of their team. OMGBANBANBAN."
L.aw_tkl5_title = "Roleplayer"
L.aw_tkl5_text = "was roleplaying a madman, honest. That's why they killed most of their team."
L.aw_tkl6_title = "Moron"
L.aw_tkl6_text = "couldn't figure out which side they were on, and killed over half of their comrades."
L.aw_tkl7_title = "Redneck"
L.aw_tkl7_text = "protected their turf real good by killing over a quarter of their teammates."
L.aw_brn1_title = "Like Grandma Used To Make Them"
L.aw_brn1_text = "fried several people to a nice crisp."
L.aw_brn2_title = "Pyroid"
L.aw_brn2_text = "was heard cackling loudly after burning one of their many victims."
L.aw_brn3_title = "Pyrrhic Burnery"
L.aw_brn3_text = "burned them all, but is now all out of incendiary grenades! How will they cope!?"
L.aw_fnd1_title = "Coroner"
L.aw_fnd1_text = "found {num} bodies lying around."
L.aw_fnd2_title = "Gotta Catch Em All"
L.aw_fnd2_text = "found {num} corpses for their collection."
L.aw_fnd3_title = "Death Scent"
L.aw_fnd3_text = "keeps stumbling on random corpses, {num} times this round."
L.aw_crd1_title = "Recycler"
L.aw_crd1_text = "scrounged up {num} leftover credits from corpses."
L.aw_tod1_title = "Pyrrhic Victory"
L.aw_tod1_text = "died only seconds before their team won the round."
L.aw_tod2_title = "I Hate This Game"
L.aw_tod2_text = "died right after the start of the round."
--- New and modified pieces of text are placed below this point, marked with the
--- version in which they were added, to make updating translations easier.
--- v23
L.set_avoid_det = "Avoid being selected as Detective"
L.set_avoid_det_tip = "Enable this to ask the server not to select you as Detective if possible. Does not mean you are Traitor more often."
--- v24
L.drop_no_ammo = "Insufficient ammo in your weapon's clip to drop as an ammo box."
--- v31
L.set_cross_brightness = "Crosshair brightness"
L.set_cross_size = "Crosshair size"
--- 5-25-15
L.hat_retrieve = "You picked up a Detective's hat."
--- 2018-07-24
L.equip_tooltip_main = "Equipment menu"
L.equip_tooltip_radar = "Radar control"
L.equip_tooltip_disguise = "Disguise control"
L.equip_tooltip_radio = "Radio control"
L.equip_tooltip_xfer = "Transfer credits"
L.confgrenade_name = "Discombobulator"
L.polter_name = "Poltergeist"
L.stungun_name = "UMP Prototype"
L.knife_instant = "INSTANT KILL"
L.dna_hud_type = "TYPE"
L.dna_hud_body = "BODY"
L.dna_hud_item = "ITEM"
L.binoc_zoom_level = "LEVEL"
L.binoc_body = "BODY DETECTED"
L.idle_popup_title = "Idle" |
local gs = {
lst = {
clr = {
active = {255, 255, 255},
inactive = {75, 75, 75}
},
none = "[ ]"
}
}
mAcl.gui.expert = {}
function mAcl.gui.expert.init()
local tab = mAcl.gui.tab
local tw, th = guiGetSize(tab, false)
-----------------------------
x, y = GS.mrg2, GS.mrg2
w, h = tw - GS.mrg2*2, th - GS.mrg2*2 - GS.h - GS.mrg
local tpnl = guiCreateTabPanel(x, y, w, h, false, tab)
mAcl.gui.expert.tpnl = tpnl
mAcl.gui.expert.restoreBtn = guiCreateButton(-x, -y, GS.w2, GS.h, "Restore", false, tab, "command.restoreacl")
guiSetHorizontalAlign(mAcl.gui.expert.restoreBtn, "right")
guiSetVerticalAlign(mAcl.gui.expert.restoreBtn, "bottom")
guiSetAlwaysOnTop(mAcl.gui.expert.restoreBtn, true)
guiButtonSetHoverTextColor(mAcl.gui.expert.restoreBtn, unpack(GS.clr.orange))
x = x + GS.w2 + GS.mrg
mAcl.gui.expert.restoreAdminBtn = guiCreateButton(-x, -y, GS.w3, GS.h, "Restore gradmin", false, tab, "command.restoreadminacl")
guiSetHorizontalAlign(mAcl.gui.expert.restoreAdminBtn, "right")
guiSetVerticalAlign(mAcl.gui.expert.restoreAdminBtn, "bottom")
guiSetAlwaysOnTop(mAcl.gui.expert.restoreAdminBtn, true)
guiButtonSetHoverTextColor(mAcl.gui.expert.restoreAdminBtn, unpack(COLORS.orange))
-----------------------------
mAcl.gui.expert.group = {}
mAcl.gui.expert.group.tab = guiCreateTab("Groups", tpnl)
tw, th = guiGetSize(mAcl.gui.expert.group.tab, false)
x, y = GS.mrg2, GS.mrg2
w, h = tw - GS.mrg2*2, th - GS.mrg2*2
mAcl.gui.expert.group.list = guiCreateGridList(x, y, GS.w3, h, false, mAcl.gui.expert.group.tab)
guiGridListSetSortingEnabled(mAcl.gui.expert.group.list, false)
guiGridListAddColumn(mAcl.gui.expert.group.list, "Name")
mAcl.gui.expert.group.createBtn = guiGridListAddCreateButton(mAcl.gui.expert.group.list)
cGuiGuard.setPermission(mAcl.gui.expert.group.createBtn, "command.aclcreategroup")
mAcl.gui.expert.group.destroyBtn = guiGridListAddDestroyButton(mAcl.gui.expert.group.list)
cGuiGuard.setPermission(mAcl.gui.expert.group.destroyBtn, "command.acldestroygroup")
x = x + GS.w3 + GS.mrg2
mAcl.gui.expert.group.aclList = guiCreateGridList(x, y, GS.w3, h, false, mAcl.gui.expert.group.tab)
guiGridListSetSortingEnabled(mAcl.gui.expert.group.aclList, false)
guiGridListAddColumn(mAcl.gui.expert.group.aclList, "ACL")
mAcl.gui.expert.group.addACLBtn = guiGridListAddCreateButton(mAcl.gui.expert.group.aclList)
cGuiGuard.setPermission(mAcl.gui.expert.group.addACLBtn, "command.aclgroupaddacl")
mAcl.gui.expert.group.removeACLBtn = guiGridListAddDestroyButton(mAcl.gui.expert.group.aclList)
cGuiGuard.setPermission(mAcl.gui.expert.group.removeACLBtn, "command.aclgroupremoveacl")
x = x + GS.w3 + GS.mrg
w = w - GS.w3*2 - GS.mrg - GS.mrg2*2 - GS.w3
mAcl.gui.expert.group.objectsList = guiCreateGridList(x, y, GS.w3, h, false, mAcl.gui.expert.group.tab)
guiGridListSetSortingEnabled(mAcl.gui.expert.group.objectsList, false)
guiGridListAddColumn(mAcl.gui.expert.group.objectsList, "Object")
mAcl.gui.expert.group.addObjectBtn = guiGridListAddCreateButton(mAcl.gui.expert.group.objectsList)
cGuiGuard.setPermission(mAcl.gui.expert.group.addObjectBtn, "command.aclgroupaddobject")
mAcl.gui.expert.group.removeObjectBtn = guiGridListAddDestroyButton(mAcl.gui.expert.group.objectsList)
cGuiGuard.setPermission(mAcl.gui.expert.group.removeObjectBtn, "command.aclgroupremoveobject")
-----------------------------
mAcl.gui.expert.acl = {}
mAcl.gui.expert.acl.tab = guiCreateTab("ACL", tpnl)
tw, th = guiGetSize(mAcl.gui.expert.acl.tab, false)
x, y = GS.mrg2, GS.mrg2
w, h = tw - GS.mrg2*2, th - GS.mrg2*2
mAcl.gui.expert.acl.list = guiCreateGridList(x, y, GS.w3, h, false, mAcl.gui.expert.acl.tab)
guiGridListSetSortingEnabled(mAcl.gui.expert.acl.list, false)
guiGridListAddColumn(mAcl.gui.expert.acl.list, "Name")
mAcl.gui.expert.acl.createBtn = guiGridListAddCreateButton(mAcl.gui.expert.acl.list)
cGuiGuard.setPermission(mAcl.gui.expert.acl.createBtn, "command.aclcreate")
mAcl.gui.expert.acl.destroyBtn = guiGridListAddDestroyButton(mAcl.gui.expert.acl.list)
cGuiGuard.setPermission(mAcl.gui.expert.acl.destroyBtn, "command.acldestroy")
x = GS.mrg2
w = w - GS.w3 - GS.mrg2
local chkw = 120
mAcl.gui.expert.acl.showPublicContainer = guiCreateContainer(-x, y, chkw, GS.h, false, mAcl.gui.expert.acl.tab)
guiSetHorizontalAlign(mAcl.gui.expert.acl.showPublicContainer, "right")
mAcl.gui.expert.acl.showPublicChk = guiCreateCheckBox(0, 0, 1, 1, "Show public rights", false, true, mAcl.gui.expert.acl.showPublicContainer)
x = x + GS.mrg2 + GS.w3
mAcl.gui.expert.acl.rightViewEdit, mAcl.gui.expert.acl.rightViewlist =
guiCreateAdvancedComboBox(x, y, GS.w2, GS.h, "", false, mAcl.gui.expert.acl.tab)
guiGridListAddRow(mAcl.gui.expert.acl.rightViewlist, "all")
guiGridListAddRow(mAcl.gui.expert.acl.rightViewlist, "general")
guiGridListAddRow(mAcl.gui.expert.acl.rightViewlist, "function")
guiGridListAddRow(mAcl.gui.expert.acl.rightViewlist, "command")
guiGridListAddRow(mAcl.gui.expert.acl.rightViewlist, "resource")
guiGridListAdjustHeight(mAcl.gui.expert.acl.rightViewlist)
guiGridListSetSelectedItem(mAcl.gui.expert.acl.rightViewlist, 0)
x = x + GS.w2 + GS.mrg
mAcl.gui.expert.acl.rightSrch = guiCreateSearchEdit(x, y, w - GS.mrg*2 - GS.w2 - chkw, GS.h, "", false, mAcl.gui.expert.acl.tab)
x = GS.mrg2 * 2 + GS.w3
y = y + GS.h + GS.mrg
h = h - GS.h - GS.mrg
mAcl.gui.expert.acl.rightsList = guiCreateGridList(x, y, w, h, false, mAcl.gui.expert.acl.tab)
guiGridListSetSortingEnabled(mAcl.gui.expert.acl.rightsList, false)
mAcl.gui.expert.acl.rightsNameClm = guiGridListAddColumn(mAcl.gui.expert.acl.rightsList, "Right", 0.45)
mAcl.gui.expert.acl.rightsAccessClm = guiGridListAddColumn(mAcl.gui.expert.acl.rightsList, "Access", 0.15)
mAcl.gui.expert.acl.rightsPublicClm = mAcl.gui.expert.acl.rightsAccessClm + 1
mAcl.gui.expert.acl.addRightBtn = guiGridListAddCreateButton(mAcl.gui.expert.acl.rightsList)
cGuiGuard.setPermission(mAcl.gui.expert.acl.addRightBtn, "command.aclsetright")
mAcl.gui.expert.acl.removeRightBtn = guiGridListAddDestroyButton(mAcl.gui.expert.acl.rightsList)
cGuiGuard.setPermission(mAcl.gui.expert.acl.removeRightBtn, "command.aclremoveright")
-----------------------------
mAcl.gui.expert.matrix = {}
mAcl.gui.expert.matrix.tab = guiCreateTab("Access matrix", tpnl)
tw, th = guiGetSize(mAcl.gui.expert.acl.tab, false)
x, y = GS.mrg2, GS.mrg2
w, h = tw - GS.mrg2*2, th - GS.mrg2*2
chkw = 120
mAcl.gui.expert.matrix.showAutoChk = guiCreateCheckBox(-x, y, chkw, GS.h, "Show auto ACL", false, false, mAcl.gui.expert.matrix.tab)
guiSetHorizontalAlign(mAcl.gui.expert.matrix.showAutoChk, "right")
mAcl.gui.expert.matrix.viewEdit, mAcl.gui.expert.matrix.viewList =
guiCreateAdvancedComboBox(x, y, GS.w2, GS.h, "", false, mAcl.gui.expert.matrix.tab)
mAcl.gui.expert.matrix.srch = guiCreateSearchEdit(x + GS.mrg + GS.w2, y, w - GS.w2 - GS.mrg*2 - chkw, GS.h, "", false, mAcl.gui.expert.matrix.tab)
guiGridListAddRow(mAcl.gui.expert.matrix.viewList, "all")
guiGridListAddRow(mAcl.gui.expert.matrix.viewList, "general")
guiGridListAddRow(mAcl.gui.expert.matrix.viewList, "function")
guiGridListAddRow(mAcl.gui.expert.matrix.viewList, "command")
guiGridListAddRow(mAcl.gui.expert.matrix.viewList, "resource")
guiGridListAdjustHeight(mAcl.gui.expert.matrix.viewList)
guiGridListSetSelectedItem(mAcl.gui.expert.matrix.viewList, 0)
y = y + GS.h + GS.mrg
mAcl.gui.expert.matrix.list = guiCreateGridList(x, y, w, h - GS.mrg - GS.h, false, mAcl.gui.expert.matrix.tab)
guiGridListAddColumn(mAcl.gui.expert.matrix.list, "Right", 0.2)
guiGridListSetSelectionMode(mAcl.gui.expert.matrix.list, 2)
guiGridListSetSortingEnabled(mAcl.gui.expert.matrix.list, false)
mAcl.gui.expert.matrix.removeRightBtn = guiGridListAddDestroyButton(mAcl.gui.expert.matrix.list)
cGuiGuard.setPermission(mAcl.gui.expert.matrix.removeRightBtn, "command.aclremoveright")
-----------------------------
addEventHandler("onClientGUILeftClick", tab, mAcl.gui.expert.onLeftClick)
addEventHandler("onClientGUIGridListItemSelected", tab, mAcl.gui.expert.onListItemSelected)
addEventHandler("onClientGUIDoubleLeftClick", tab, mAcl.gui.expert.onListDoubleClick)
addEventHandler("onClientGUIGridListItemEnterKey", tab, mAcl.gui.expert.onListDoubleClick)
addEventHandler("onClientGUIRightClick", tab, mAcl.gui.expert.onListRightClick)
addEventHandler("onClientGUIGridListItemDeleteKey", tab, mAcl.gui.expert.onListRightClick)
addEventHandler("onClientGUIChanged", mAcl.gui.expert.matrix.srch, function() mAcl.gui.expert.refreshMatrix() end, false)
addEventHandler("onClientGUIGridListItemSelected", mAcl.gui.expert.matrix.viewList, function() mAcl.gui.expert.refreshMatrix() end, false)
addEventHandler("onClientGUIChanged", mAcl.gui.expert.acl.rightSrch, function() mAcl.gui.expert.refreshACL() end, false)
addEventHandler("onClientGUIGridListItemSelected", mAcl.gui.expert.acl.rightViewlist, function() mAcl.gui.expert.refreshACL() end, false)
return true
end
function mAcl.gui.expert.onLeftClick()
if source == mAcl.gui.expert.restoreAdminBtn then
if not guiShowMessageDialog("Admin panel rights will be restored. Continue?", "Restore rights", MD_YES_NO, MD_QUESTION ) then return end
cCommands.execute("restoreadminacl")
elseif source == mAcl.gui.expert.restoreBtn then
if not guiShowMessageDialog("Server default rights and admin panel rights will be restored. Added objects, custom groups and rights will NOT be changed, except 'Everyone' group. Continue?", "Restore rights", MD_YES_NO, MD_QUESTION ) then return end
cCommands.execute("restoreacl")
elseif source == mAcl.gui.expert.group.createBtn then
local group = guiShowInputDialog("Add group", "Enter the group name", nil, guiGetInputNotEmptyParser())
if not group then return end
cCommands.execute("aclcreategroup", group)
elseif source == mAcl.gui.expert.group.destroyBtn then
local group = mAcl.gui.expert.getSelectedGroup()
if not group then return guiShowMessageDialog("No group selected!", nil, MD_OK, MD_ERROR) end
if not guiShowMessageDialog("Group '"..group.."' will be destroyed! Are you sure?", "Destroy group", MD_YES_NO, MD_WARNING) then return end
if group == "Everyone" then
if not guiShowMessageDialog("Warning! Highly recommended do not delete group 'Everyone'. Delete it only, if you know what you are doing. Continue?", "Destroy group", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("acldestroygroup", group)
elseif source == mAcl.gui.expert.group.addObjectBtn then
local group = mAcl.gui.expert.getSelectedGroup()
if not group then return guiShowMessageDialog("No group selected!", nil, MD_OK, MD_ERROR) end
local object = guiShowInputDialog("Add object", "Enter the object name", nil, guiGetInputNotEmptyParser())
if not object then return end
cCommands.execute("aclgroupaddobject", group, object)
elseif source == mAcl.gui.expert.group.removeObjectBtn then
local group = mAcl.gui.expert.getSelectedGroup()
if not group then return guiShowMessageDialog("No group selected!", nil, MD_OK, MD_ERROR) end
local object = mAcl.gui.expert.getGroupSelectedObject()
if not object then return guiShowMessageDialog("No object selected!", nil, MD_OK, MD_ERROR) end
if not guiShowMessageDialog("Object '"..object.."' will be removed from group '"..group.."'. Continue?", "Remove object", MD_YES_NO, MD_QUESTION ) then return end
if group == "Everyone" then
if not guiShowMessageDialog("Warning! Highly recommended do not remove any objects from 'Everyone' group. Delete it only, if you know what you are doing. Continue?", "Remove object", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclgroupremoveobject", group, object)
elseif source == mAcl.gui.expert.group.addACLBtn then
local group = mAcl.gui.expert.getSelectedGroup()
if not group then return guiShowMessageDialog("No group selected!", nil, MD_OK, MD_ERROR) end
local acl = guiShowInputDialog("Add ACL", "Enter the ACL name", nil, guiGetInputNotEmptyParser())
if not acl then return end
cCommands.execute("aclgroupaddacl", group, acl)
elseif source == mAcl.gui.expert.group.removeACLBtn then
local group = mAcl.gui.expert.getSelectedGroup()
if not group then return guiShowMessageDialog("No group selected!", nil, MD_OK, MD_ERROR) end
local acl = mAcl.gui.expert.getGroupSelectedACL()
if not acl then return guiShowMessageDialog("No ACL selected!", nil, MD_OK, MD_ERROR) end
if not guiShowMessageDialog("ACL '"..acl.."' will be removed from group '"..group.."'. Continue?", "Remove ACL", MD_YES_NO, MD_QUESTION ) then return end
if group == "Everyone" then
if not guiShowMessageDialog("Warning! Highly recommended do not remove any ACL from 'Everyone' group. Delete it only, if you know what you are doing. Continue?", "Remove ACL", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclgroupremoveacl", group, acl)
--------------- ACL -------------------
elseif source == mAcl.gui.expert.acl.createBtn then
local acl = guiShowInputDialog("Add ACL", "Enter the ACL name", nil, guiGetInputNotEmptyParser())
if not acl then return end
cCommands.execute("aclcreate", acl)
elseif source == mAcl.gui.expert.acl.destroyBtn then
local acl = mAcl.gui.expert.getSelectedACL()
if not acl then return guiShowMessageDialog("No ACL selected!", nil, MD_OK, MD_ERROR) end
if not guiShowMessageDialog("ACL '"..acl.."' will be destroyed! Are you sure?", "Destroy ACL", MD_YES_NO, MD_WARNING) then return end
if acl == "Default" then
if not guiShowMessageDialog("Warning! Highly recommended do not delete ACL 'Default'. Delete it only, if you know what you are doing. Continue?", "Destroy ACL", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("acldestroy", acl)
elseif source == mAcl.gui.expert.acl.addRightBtn then
local right = guiShowInputDialog("Add right", "Enter the right name", nil, guiGetInputNotEmptyParser())
if not right then return end
local acl = mAcl.gui.expert.getSelectedACL()
if mAcl.data.acls.rights[acl].access[right] ~= nil then return guiShowMessageDialog("Right '"..right.."' is already added!", nil, MD_OK, MD_ERROR) end
cCommands.execute("aclsetright", acl, right, false)
elseif source == mAcl.gui.expert.acl.removeRightBtn then
local acl = mAcl.gui.expert.getSelectedACL()
local right = mAcl.gui.expert.getACLSelectedRight()
if not guiShowMessageDialog("Right '"..right.."' will be removed from ACL '"..acl.."'. Continue?", "Remove right", MD_YES_NO, MD_QUESTION ) then return end
if acl == "Default" then
if not guiShowMessageDialog("Warning! Highly recommended do not remove any rights from 'Default' ACL entry. Delete it only, if you know what you are doing. Continue?", "Remove right", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclremoveright", acl, right)
elseif source == mAcl.gui.expert.acl.showPublicChk then
mAcl.gui.expert.refreshACL()
--------------- MATRIX -------------------
elseif source == mAcl.gui.expert.matrix.showAutoChk then
mAcl.gui.expert.refreshMatrix()
elseif source == mAcl.gui.expert.matrix.removeRightBtn then
local acl, right, access = mAcl.gui.expert.getMatrixSelectedACLRight()
if not acl then return end
if access == nil then return end
if not guiShowMessageDialog("Right '"..right.."' will be removed from ACL '"..acl.."'. Continue?", "Remove right", MD_YES_NO, MD_QUESTION ) then return end
if acl == "Default" then
if not guiShowMessageDialog("Warning! Highly recommended do not remove any rights from 'Default' ACL entry. Delete it only, if you know what you are doing. Continue?", "Remove right", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclremoveright", acl, right)
end
end
function mAcl.gui.expert.onListDoubleClick()
if source == mAcl.gui.expert.acl.rightsList then
local acl = mAcl.gui.expert.getSelectedACL()
if not acl then return end
local right, access = mAcl.gui.expert.getACLSelectedRight()
if not right then return end
access = not access
if not guiShowMessageDialog("Set right '"..right.."' to '"..tostring(access).."'?", "Change right", MD_YES_NO, MD_QUESTION ) then return end
if acl == "Default" then
if not guiShowMessageDialog("Warning! Highly recommended do not change any rights in 'Default' ACL entry. Change it only, if you know what you are doing. Continue?", "Change right", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclsetright", acl, right, access)
elseif source == mAcl.gui.expert.matrix.list then
local acl, right, access = mAcl.gui.expert.getMatrixSelectedACLRight()
if not acl then return end
if access == nil then
access = false
else
access = not access
end
if not guiShowMessageDialog("Set '"..acl.."' ACL right '"..right.."' to '"..tostring(access).."'?", "Change right", MD_YES_NO, MD_QUESTION ) then return end
if acl == "Default" then
if not guiShowMessageDialog("Warning! Highly recommended do not change any rights in 'Default' ACL entry. Change it only, if you know what you are doing. Continue?", "Change right", MD_YES_NO, MD_WARNING) then return end
end
cCommands.execute("aclsetright", acl, right, access)
end
end
function mAcl.gui.expert.onListItemSelected(row)
if source == mAcl.gui.expert.acl.list then
mAcl.gui.expert.refreshACL()
elseif source == mAcl.gui.expert.group.list then
mAcl.gui.expert.refreshGroup()
elseif source == mAcl.gui.expert.group.aclList then
guiSetEnabled(mAcl.gui.expert.group.removeACLBtn, row ~= -1)
elseif source == mAcl.gui.expert.group.objectsList then
guiSetEnabled(mAcl.gui.expert.group.removeObjectBtn, row ~= -1)
elseif source == mAcl.gui.expert.acl.rightsList then
local enabled = row ~= -1 and guiGridListGetItemData(mAcl.gui.expert.acl.rightsList, row, 2) ~= nil
guiSetEnabled(mAcl.gui.expert.acl.removeRightBtn, enabled)
elseif source == mAcl.gui.expert.matrix.list then
local acl, right, access = mAcl.gui.expert.getMatrixSelectedACLRight()
local enabled = acl and right and access ~= nil or false
guiSetEnabled(mAcl.gui.expert.matrix.removeRightBtn, enabled)
end
end
function mAcl.gui.expert.onListRightClick()
if source == mAcl.gui.expert.group.list then
guiClick(mAcl.gui.expert.group.destroyBtn)
elseif source == mAcl.gui.expert.group.aclList then
guiClick(mAcl.gui.expert.group.removeACLBtn)
elseif source == mAcl.gui.expert.group.objectsList then
guiClick(mAcl.gui.expert.group.removeObjectBtn)
elseif source == mAcl.gui.expert.acl.list then
guiClick(mAcl.gui.expert.acl.destroyBtn)
elseif source == mAcl.gui.expert.acl.rightsList then
guiClick(mAcl.gui.expert.acl.removeRightBtn)
elseif source == mAcl.gui.expert.matrix.list then
guiClick(mAcl.gui.expert.matrix.removeRightBtn)
end
end
function mAcl.gui.expert.refresh()
mAcl.gui.expert.refreshGroups()
mAcl.gui.expert.refreshACLs()
mAcl.gui.expert.refreshMatrix()
return true
end
---------------------------------------
--------------- GROUP -----------------
---------------------------------------
function mAcl.gui.expert.getSelectedGroup()
return guiGridListGetSelectedItemText(mAcl.gui.expert.group.list)
end
function mAcl.gui.expert.getGroupSelectedObject()
return guiGridListGetSelectedItemText(mAcl.gui.expert.group.objectsList)
end
function mAcl.gui.expert.getGroupSelectedACL()
return guiGridListGetSelectedItemText(mAcl.gui.expert.group.aclList)
end
function mAcl.gui.expert.refreshGroup(group)
local selected = mAcl.gui.expert.getSelectedGroup()
if group and group ~= selected then return end
guiSetEnabled(mAcl.gui.expert.group.destroyBtn, false)
local selectedACL = guiGridListGetSelectedItem(mAcl.gui.expert.group.aclList)
local selectedObject = guiGridListGetSelectedItem(mAcl.gui.expert.group.objectsList)
guiGridListClear(mAcl.gui.expert.group.aclList)
guiGridListClear(mAcl.gui.expert.group.objectsList)
guiSetEnabled(mAcl.gui.expert.group.aclList, false)
guiSetEnabled(mAcl.gui.expert.group.objectsList, false)
guiSetStatusText(mAcl.gui.expert.group.aclList, "N/A")
guiSetStatusText(mAcl.gui.expert.group.objectsList, "N/A")
if not selected then return end
guiSetEnabled(mAcl.gui.expert.group.destroyBtn, true)
if not mAcl.data.groups.content[selected] then return false end
guiSetEnabled(mAcl.gui.expert.group.aclList, true)
guiSetEnabled(mAcl.gui.expert.group.objectsList, true)
guiSetStatusText(mAcl.gui.expert.group.aclList)
guiSetStatusText(mAcl.gui.expert.group.objectsList)
for i, acl in ipairs(mAcl.data.groups.content[selected].acls) do
guiGridListAddRow(mAcl.gui.expert.group.aclList, acl)
end
guiGridListSetSelectedItem(mAcl.gui.expert.group.aclList, selectedACL)
for i, object in ipairs(mAcl.data.groups.content[selected].objects) do
guiGridListAddRow(mAcl.gui.expert.group.objectsList, object)
end
guiGridListSetSelectedItem(mAcl.gui.expert.group.objectsList, selectedObject)
return true
end
function mAcl.gui.expert.refreshGroups()
local selected = guiGridListGetSelectedItem(mAcl.gui.expert.group.list)
guiGridListClear(mAcl.gui.expert.group.list)
for i, group in ipairs(mAcl.data.groups.list) do
guiGridListAddRow(mAcl.gui.expert.group.list, group)
end
guiGridListSetSelectedAnyItem(mAcl.gui.expert.group.list, selected)
mAcl.gui.expert.refreshGroup()
return true
end
---------------------------------------
--------------- ACL -------------------
---------------------------------------
function mAcl.gui.expert.getSelectedACL()
return guiGridListGetSelectedItemText(mAcl.gui.expert.acl.list)
end
function mAcl.gui.expert.getACLSelectedRight()
local right = guiGridListGetSelectedItemData(mAcl.gui.expert.acl.rightsList)
if not right then return nil end
local access = guiGridListGetSelectedItemData(mAcl.gui.expert.acl.rightsList, nil, 2)
return right, access
end
function mAcl.gui.expert.refreshACL(acl)
local selectedACL = mAcl.gui.expert.getSelectedACL()
if acl and acl ~= selectedACL then return end
guiSetEnabled(mAcl.gui.expert.acl.destroyBtn, false)
local list = mAcl.gui.expert.acl.rightsList
local selected = guiGridListGetSelectedItem(list)
guiGridListClear(list)
guiSetEnabled(list, false)
guiSetStatusText(list, "N/A")
guiGridListRemoveColumn(list, mAcl.gui.expert.acl.rightsPublicClm)
local showPublicRights = guiCheckBoxGetSelected(mAcl.gui.expert.acl.showPublicChk)
if showPublicRights then guiGridListAddColumn(list, "Public", 0.15) end
if not selectedACL then return end
guiSetEnabled(mAcl.gui.expert.acl.destroyBtn, true)
if not mAcl.data.acls.rights[selectedACL] then return false end
local publicRightsData = mAcl.getPublicRights()
if not publicRightsData then return end
guiSetEnabled(list, true)
guiSetStatusText(list)
local rightsData = mAcl.data.acls.rights[selectedACL]
local addRights = {}
if showPublicRights then
for i, right in ipairs(rightsData.list) do
if publicRightsData.access[right] == nil then
table.insert(addRights, {right, rightsData.access[right], nil})
end
end
for i, right in ipairs(publicRightsData.list) do
table.insert(addRights, {right, rightsData.access[right], publicRightsData.access[right]})
end
else
for i, right in ipairs(rightsData.list) do
table.insert(addRights, {right, rightsData.access[right]})
end
end
local viewType = guiGetText(mAcl.gui.expert.acl.rightViewEdit)
if viewType == "all" then viewType = ".*" end
local search = utf8.lower(guiGetText(mAcl.gui.expert.acl.rightSrch))
for i, rightData in ipairs(addRights) do
local right = rightData[1]
local cutted = utf8.gsub(right, "^.-%.", "")
if (utf8.match(right, "^"..viewType)) and
(utf8.find(utf8.lower(cutted), search, 1, true)) then
local access = rightData[2]
local publicAccess = rightData[3]
local row = guiGridListAddRow(
list,
viewType == ".*" and right or cutted,
access == nil and gs.lst.none or tostring(access),
publicAccess == nil and gs.lst.none or tostring(publicAccess)
)
guiGridListSetItemData(list, row, 1, right)
guiGridListSetItemData(list, row, 2, access)
guiGridListSetItemColor(list, row, 2, unpack(access and gs.lst.clr.active or gs.lst.clr.inactive))
guiGridListSetItemColor(list, row, 3, unpack(publicAccess == false and gs.lst.clr.inactive or COLORS.red))
guiGridListSetItemColor(list, row, 1, unpack((access or publicAccess or showPublicRights and publicAccess == nil) and gs.lst.clr.active or gs.lst.clr.inactive))
end
end
guiGridListSetSelectedItem(list, selected)
return true
end
function mAcl.gui.expert.refreshPublicRights()
local showPublic = guiCheckBoxGetSelected(mAcl.gui.expert.acl.showPublicChk)
if mAcl.data.publicRights.list and #mAcl.data.publicRights.list > 0 then
guiSetEnabled(mAcl.gui.expert.acl.showPublicChk, true)
guiSetToolTip(mAcl.gui.expert.acl.showPublicContainer)
else
guiSetEnabled(mAcl.gui.expert.acl.showPublicChk, false)
guiCheckBoxSetSelected(mAcl.gui.expert.acl.showPublicChk, false)
guiSetToolTip(mAcl.gui.expert.acl.showPublicContainer, "(!) No public rights were found. This means that all resources and users have all rigths. Seems like ACL damaged. Use /restoreacl command for restore default rights", unpack(COLORS.red))
end
mAcl.gui.expert.refreshACL()
return true
end
function mAcl.gui.expert.refreshACLs()
local selected = guiGridListGetSelectedItem(mAcl.gui.expert.acl.list)
guiGridListClear(mAcl.gui.expert.acl.list)
for i, acl in ipairs(mAcl.data.acls.list) do
guiGridListAddRow(mAcl.gui.expert.acl.list, acl)
end
guiGridListSetSelectedAnyItem(mAcl.gui.expert.acl.list, selected)
mAcl.gui.expert.refreshACL()
return true
end
---------------------------------------
--------------- MATRIX ----------------
---------------------------------------
function mAcl.gui.expert.getMatrixSelectedACLRight()
local item, column = guiGridListGetSelectedItem(mAcl.gui.expert.matrix.list, 1)
if item == -1 then return nil end
if column == 1 then return nil end
local acl = guiGridListGetColumnTitle(mAcl.gui.expert.matrix.list, column)
local right = guiGridListGetItemData(mAcl.gui.expert.matrix.list, item, 1)
local access = guiGridListGetItemData(mAcl.gui.expert.matrix.list, item, column)
return acl, right, access
end
function mAcl.gui.expert.refreshMatrix()
local list = mAcl.gui.expert.matrix.list
local selectedMatrixRow, selectedMatrixColumn = guiGridListGetSelectedItem(list)
guiGridListClear(list)
for i = 2, guiGridListGetColumnCount(list) do
guiGridListRemoveColumn(list, 2)
end
guiSetEnabled(list, false)
guiSetStatusText(list, "N/A")
local acls = mAcl.data.acls.list
for i, acl in ipairs(acls) do
if not mAcl.data.acls.rights[acl] then return end
end
guiSetEnabled(list, true)
guiSetStatusText(list)
local showAuto = guiCheckBoxGetSelected(mAcl.gui.expert.matrix.showAutoChk)
local publicRightsData = mAcl.getPublicRights()
local rightsRows = {}
for ir, right in ipairs(publicRightsData.list) do
local row = guiGridListAddRow(list, right)
guiGridListSetItemData(list, row, 1, right)
rightsRows[right] = row
end
for ia, acl in ipairs(acls) do
local isAuto = utf8.match(acl, "^autoACL_") and true or false
if showAuto or (not showAuto) and (not isAuto) then
local column = guiGridListAddColumn(list, acl, 0.06)
for ir, right in ipairs(mAcl.data.acls.rights[acl].list) do
local row = rightsRows[right]
if not row then
row = guiGridListAddRow(list, right)
guiGridListSetItemData(list, row, 1, right)
rightsRows[right] = row
end
local access = mAcl.data.acls.rights[acl].access[right]
guiGridListSetItemText(list, row, column, tostring(access), false, false)
guiGridListSetItemData(list, row, column, access)
end
end
end
local viewType = guiGetText(mAcl.gui.expert.matrix.viewEdit)
if viewType == "all" then viewType = ".*" end
local search = utf8.lower(guiGetText(mAcl.gui.expert.matrix.srch))
for row = guiGridListGetRowCount(list) - 1, 0, -1 do
local right = guiGridListGetItemData(list, row, 1)
local cutted = utf8.gsub(right, "^.-%.", "")
if utf8.match(right, "^"..viewType) and
utf8.find(utf8.lower(cutted), search, 1, true) then
guiGridListSetItemText(list, row, 1, viewType == ".*" and right or cutted, false, false)
else
guiGridListRemoveRow(list, row)
end
end
for i = 0, guiGridListGetRowCount(list) do
for j = 2, guiGridListGetColumnCount(list) do
local access = guiGridListGetItemData(list, i, j)
if not access then
if access == nil then
guiGridListSetItemText(list, i, j, gs.lst.none, false, false)
end
guiGridListSetItemColor(list, i, j, unpack(gs.lst.clr.inactive))
else
guiGridListSetItemColor(list, i, j, unpack(gs.lst.clr.active))
end
end
end
guiGridListSetSelectedItem(list, selectedMatrixRow, selectedMatrixColumn)
return true
end |
-- Globally used
local G = getfenv(0)
local select = select
local oGlow = oGlow
local hooksecurefunc = hooksecurefunc
-- Containers
local GetContainerItemLink = GetContainerItemLink
local GetItemInfo = GetItemInfo
-- Addon
local frame = CreateFrame'Frame'
frame:Hide()
local ContainerFrame1 = ContainerFrame1
local bid, self, link, size, name, q
local update = function(bag, id)
size = bag.size
name = bag:GetName()
for i=1, size do
bid = size - i + 1
self = G[name..'Item'..bid]
link = GetContainerItemLink(id, i)
if(link and not oGlow.preventBags) then
q = select(3, GetItemInfo(link))
oGlow(self, q)
elseif(self.bc) then
self.bc:Hide()
end
end
end
local delay = 0
local up = {}
frame:SetScript('OnUpdate', function(self, elapsed)
delay = delay + elapsed
if(delay > .05) then
for id in pairs(up) do
update(id, id:GetID())
up[id] = nil
end
delay = 0
self:Hide()
end
end)
local cf
frame:SetScript('OnEvent', function(self, event, id)
bid = id + 1
local cf = G['ContainerFrame'..bid]
if(cf and cf:IsShown()) then
up[cf] = true
frame:Show()
end
end)
local self
hooksecurefunc('ContainerFrame_OnShow', function()
self = this
if(ContainerFrame1.bagsShown > 0) then
frame:RegisterEvent'BAG_UPDATE'
up[self] = true
frame:Show()
end
end)
hooksecurefunc('ContainerFrame_OnHide', function()
if(ContainerFrame1.bagsShown == 0) then
frame:UnregisterEvent'BAG_UPDATE'
up[self] = nil
frame:Hide()
end
end)
oGlow.updateBags = update
|
local Debug = {
enabled = false,
backgroundColor = {20, 20, 20, 200},
color = {255, 255, 255, 255},
padding = 8,
text = love.graphics.newText(love.graphics.newFont(24), text)
}
function Debug.enable()
Debug.enabled = true
end
function Debug.disable()
Debug.enabled = false
end
function Debug.toggle()
Debug.enabled = not Debug.enabled
end
function Debug.set(text)
Debug.text:set(text)
end
function Debug.draw()
if Debug.enabled then
local fps = love.timer.getFPS()
local delta = love.timer.getDelta()
local avgDelta = love.timer.getAverageDelta()
Debug.set(string.format('FPS: %d, delta: %.4f, avg. delta: %.4f', fps, delta, avgDelta))
local textWidth, textHeight = Debug.text:getDimensions()
local width = textWidth + (Debug.padding * 2)
local height = textHeight + (Debug.padding * 2)
local x = love.graphics.getWidth() - width
local y = love.graphics.getHeight() - height
love.graphics.setColor(Debug.backgroundColor)
love.graphics.rectangle('fill', x, y, width, height)
love.graphics.setColor(Debug.color)
love.graphics.draw(Debug.text, x + Debug.padding, y + Debug.padding)
end
end
return Debug
|
-------------------------------------------------------------------------------
-- ElvUI Chat Tweaks By Crackpotx (US, Lightbringer)
-- Based on functionality provided by Prat and/or Chatter
-------------------------------------------------------------------------------
local Module = ElvUI_ChatTweaks:NewModule("Search", "AceConsole-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("ElvUI_ChatTweaks", false)
Module.name = L["Search"]
Module.namespace = string.gsub(Module.name, " ", "")
local db, options
local defaults = {
global = {
scrape = 30,
highlight = true,
color = {r = 0, g = 1.0, b = 0.59},
}
}
local foundLines, scrapeLines = {}, {}
local function AddLines(lines, ...)
for i = select("#", ...), 1, -1 do
local x = select(i, ...)
if x:GetObjectType() == "FontString" and not x:GetName() then
table.insert(lines, x:GetText())
end
end
end
local function ScrapeFrame(frame)
table.wipe(scrapeLines)
AddLines(scrapeLines, frame:GetRegions())
end
function Module:Error(msg)
self:Print(("|cffff0000%s|r"):format(msg))
end
function Module:Find(msg, all, frame)
local color = ("%02x%02x%02x"):format(db.color.r * 255, db.color.g * 255, db.color.b * 255)
local colorString = "|cff%s%s|r"
-- first, do some error checking
if not frame or frame == nil then
frame = SELECTED_CHAT_FRAME
end
if not msg then return end
if #msg <= 2 then
frame:ScrollToBottom()
self:Error(L["Search term is too short."])
return
end
if frame:GetNumMessages() == 0 then
self:Error(L["Not Found"])
return
end
local startTime = time()
local runTime = 0
if not all and self.lastSearch == msg then
frame:PageUp()
end
if all then
frame:ScrollToBottom()
end
self.lastSearch = msg
-- do the actual search
repeat
ScrapeFrame(frame)
for _, value in ipairs(scrapeLines) do
if value:lower():find(msg:lower()) then
if all then
table.insert(foundLines, db.highlight and value:gsub(msg, colorString:format(color, msg)) or value)
else
self:Print(L["Search Results:"])
frame:AddMessage(db.highlight and value:gsub(msg, colorString:format(color, msg)) or value)
return
end
end
end
frame:PageUp()
runTime = time() - startTime
if runTime >= db.scrape then
self:Print(L["Frame scraping timeout exceeded, results will be incomplete."])
break
end
until frame:AtTop() or runTime >= db.scrape
self.lastSearch = nil
frame:ScrollToBottom()
if all and #foundLines > 0 then
self:Print((L["Search Results |cff9382c9(%d Found)|r:"]):format(#foundLines))
for _, value in ipairs(foundLines) do
frame:AddMessage(value)
end
else
self:Error(L["Not Found"])
end
table.wipe(foundLines)
end
function Module:OnEnable()
self:RegisterChatCommand("find", function(msg) self:Find(msg, false) end)
self:RegisterChatCommand("findall", function(msg) self:Find(msg, true) end)
end
function Module:OnDisable()
self:UnregisterChatCommand("find")
self:UnregisterChatCommand("findall")
end
function Module:OnInitialize()
self.db = ElvUI_ChatTweaks.db:RegisterNamespace(Module.namespace, defaults)
db = self.db.global
self.debugging = ElvUI_ChatTweaks.db.global.debugging
end
function Module:GetOptions()
if not options then
options = {
scrape = {
type = "range",
order = 13,
name = L["Scrape Time"],
desc = L["Time, in seconds, you want the search to continue before it ends."],
get = function() return db.scrape end,
set = function(_, value) db.scrape = value end,
min = 5, max = 120, step = 5,
},
highlight = {
type = "toggle",
order = 14,
name = L["Highlight Term"],
desc = L["Highlight the search term in the results."],
get = function() return db.highlight end,
set = function(_, value) db.highlight = value end,
},
color = {
type = "color",
order = 15,
name = L["Highlight Color"],
desc = L["The color to highlight the search term."],
get = function() return db.color.r, db.color.g, db.color.b end,
set = function(_, r, g, b) db.color.r = r; db.color.g = g; db.color.b = b; end,
},
}
end
return options
end
function Module:Info()
return L["Adds the |cff00ff96/find|r and |cff00ff96/findall|r commands to search the chat history.\n\nUsage:\n |cff00ff96/find <text>|r\n |cff00ff96/findall <text>|r"]
end |
-- helper function, dprint logs at Log::Level::Debug in rust.
function dprintf(...) dprint(string.format(...)) end
-- example map function. In the example configuration file this
-- function is called when you do a lookup in the map 'example_map'.
--
-- If you request this URL:
-- https://servername/.well-known/webnis/<domain>/map/example_map?username=truus
-- this function gets called with request.keyname=username, request.keyvalue=truus.
function map_example(req)
-- maps to rust debug! facility
dprintf("lua map_example: keyname %s, keyvalue %s", req.keyname, req.keyvalue)
local email
local username = req.keyvalue
-- if the username contain a @, look it up in the email
-- address to username map that we defined in the TOML config
if string.find(username, "@") ~= nil then
email = username
username = nil
local m = webnis.map_lookup(req, "email2user", "address", email)
if m ~= nil then
username = m.username
dprintf("map_email: mapped %s to %s", email, username)
else
dprintf("map_email: %s unknown email", email)
return nil
end
end
-- now username is syntactically valid
-- see if it exists in the "passwd" map
local pwd = webnis.map_lookup(req, "passwd", "username", username)
if pwd == nil then
dprintf("map_email: %s user unknown", username)
return nil
end
-- this is the basic reply table, it contains the username and uid
local ret = { username = username, uid = pwd.uid }
-- add email address if we have it.
if email ~= nil then
ret.email = email
end
-- return table. it is served to the user a a JSON object.
return ret
end
--
-- authentication. the "request" table contains a username and a password.
--
function auth_example(req)
dprintf("auth_xs4all: username [%s]", req.username)
local username = req.username
local password = req.password
local email
-- auth by email? map to username
if string.find(username, "@") ~= nil then
-- map email address to username
local m = webnis.map_lookup(req, "email2user", "address", email)
if m == nil then
dprint("email not found")
return nil
end
email = username
username = m.username
end
-- must have username now
if username == nil then
dprint("fatal: username is nil")
return nil
end
-- authenticate
dprintf("going to auth [%s] [%s] [%s] [x]", "adjunct", "username", username)
if not webnis.map_auth(req, "adjunct", "username", username) then
dprintf("%s: bad password", username)
return nil
end
dprint("auth ok")
-- auth OK, build reply.
if email == nil then
local m = webnis.map_lookup(req, "email", "username", username)
if m ~= nil then
email = m.email
end
end
if email == nil then
return { username = username }
else
return { username = username; email = email }
end
end
|
local class = require "lib.lua-oop"
require "util.math.vector"
require "util.color"
require "engine.stage.hitbox"
StageObject = class "StageObject"
function StageObject:constructor(position, size, color)
self.isFirstUpdate = true
self.enabled = true
self.visible = true
self.rotation = 0
self.hitbox = Hitbox:new(position, size)
self:setColor(color)
self:setPosition(position)
self:setSize(size)
end
function StageObject:init() end
function StageObject:stageInit() end
function StageObject:firstUpdate() end
function StageObject:firstStageUpdate() end
function StageObject:update(dt) end
function StageObject:_update(dt)
if self.isFirstUpdate then
print("First update of " .. self.parentStage.class.name .. "/" .. self.class.name .. " (object)")
self:firstUpdate()
self.isFirstUpdate = false
end
self:update(dt)
self:updateHitbox()
end
function StageObject:draw() end
function StageObject:beforeChange(nextStage) end
function StageObject:setPosition(position)
if position then
assert(type(position) == "table", "Position is not an object (StageObject)")
self.position = position
else
self.position = Vector2:new(0, 0)
end
end
function StageObject:setSize(size)
if size then
assert(type(size) == "table", "Size is not an object (StageObject)")
self.size = size
else
self.size = Vector2:new(400, 200)
end
end
function StageObject:setColor(color)
if color then
self.color = color
else
self.color = Color:new(255, 255, 255, 255)
end
end
function StageObject:updateHitbox()
self.hitbox.position = self.position
self.hitbox.size = self.size
end
function StageObject:isHitting(otherObject)
return self.hitbox:isHitting(otherObject.hitbox)
end
return StageObject
|
function jtorch._saveJoinTableNode(node, ofile)
-- Save the dimension to join
ofile:writeInt(node.dimension)
end
|
local M = {}
local json = require("deepl.json")
local a = vim.api
local uv = vim.loop
local config = {
url = nil,
authkey = nil,
}
local current_win
function M.close()
if current_win then
a.nvim_win_close(current_win.win, true)
a.nvim_buf_delete(current_win.buf, { force = true })
current_win = nil
end
end
local function code_decision(num)
if num < 127 then
return true
elseif num < 161 then
return false
elseif num < 224 then
return true
end
return false
end
local function head(str)
if str == "" then
return "", nil, 0
elseif #str == 1 then
return str, nil, 1
elseif code_decision(str:byte()) then
return str:sub(1, 1), str:sub(2), 1
end
return str:sub(1, 3), str:sub(4), 2
end
local function cut(str, num)
local res = { {} }
local init, len = "", 0
local c = 1
repeat
local width
init, str, width = head(str)
len = len + width
if len > num then
c = c + 1
len = width
res[c] = {}
end
table.insert(res[c], init)
until str == nil
for i = 1, #res do
res[i] = table.concat(res[i], "")
end
return res, (c == 1 and len or num)
end
function M.create_window(lines, width)
M.close()
local buf = a.nvim_create_buf(false, true)
a.nvim_buf_set_lines(buf, 0, -1, true, lines)
local win = a.nvim_open_win(buf, false, {
relative = "cursor",
width = width,
height = #lines,
style = "minimal",
row = 1,
col = 1,
border = "single",
})
return { win = win, buf = buf }
end
function M.translate(line1, line2, from, to, mode)
if not (config.authkey and config.url) then
return
end
local texts = a.nvim_buf_get_lines(0, line1 - 1, line2, true)
local txt = table.concat(texts, " "):gsub("%s+", " ")
local stdout = uv.new_pipe(false)
local args = {
config.url,
"-d",
"auth_key=" .. config.authkey,
"-d",
"text=" .. txt,
"-d",
"source_lang=" .. from,
"-d",
"target_lang=" .. to,
}
local response
uv.spawn("curl", {
stdio = { nil, stdout, nil },
args = args,
}, function(code, _)
if code == 0 then
print("Translate success")
uv.read_start(stdout, function(err, data)
assert(not err, err)
if data then
response = data
end
end)
else
print("Translate failed")
end
end)
local timer = uv.new_timer()
timer:start(
0,
500,
vim.schedule_wrap(function()
if response then
response = json.decode(response)
if response.translations and response.translations[1] and response.translations[1].text then
local text = response.translations[1].text
if mode == "r" then
a.nvim_buf_set_lines(0, line1 - 1, line2, true, { text })
elseif mode == "f" then
local lines
local width = math.floor(a.nvim_win_get_width(0) * 0.8)
lines, width = cut(text, width)
current_win = M.create_window(lines, width)
end
end
timer:stop()
timer:close()
end
end)
)
end
function M.setup(opts)
opts = opts or {}
if opts.key then
config.authkey = opts.key
else
print("Please set authkey")
return
end
local url = "https://api%s.deepl.com/v2/translate"
if opts.plan == "free" then
config.url = url:format("-free")
elseif opts.plan == "pro" then
config.url = url:format("")
else
print("plan must be 'free' or 'pro'")
return
end
end
return M
|
-- Documentation on the redis protocol found at http://redis.io/topics/protocol
-- Encode a redis bulk string
local function encode_bulk_string(str)
assert(type(str) == "string")
return string.format("$%d\r\n%s\r\n", #str, str)
end
-- Encode a redis request
-- Requests are always just an array of bulk strings
local function encode_request(arg)
local n = arg.n or #arg
if n == 0 then
return nil, "need at least one argument"
end
local str = {
[0] = string.format("*%d\r\n", n);
}
for i=1, n do
str[i] = encode_bulk_string(arg[i])
end
return table.concat(str, nil, 0, n)
end
-- Encode a redis inline command
-- space separated
local function encode_inline(arg)
local n = arg.n or #arg
assert(n > 0, "need at least one argument")
-- inline commands can't start with "*"
assert(arg[1]:sub(1,1) ~= "*", "invalid command for inline command")
-- ensure the arguments do not contain a space character or newline
for i=1, n do
assert(arg[i]:match("^[^\r\n ]*$"), "invalid string for inline command")
end
arg[n+1] = "\r\n"
return table.concat(arg, " ", 1, n+1)
end
-- Encode and send a redis command.
local function send_command(file, arg)
local req, err_code = encode_request(arg)
if not req then
return nil, err_code
end
req, err_code = file:write(req)
if not req then
return nil, err_code
end
req, err_code = file:flush()
if not req then
return nil, err_code
end
return true
end
-- Parse a redis response
local function read_response(file, new_status, new_error, string_null, array_null)
local line, err_code = file:read("*l")
if not line then
return nil, err_code or "EOF reached"
elseif line:sub(-1, -1) ~= "\r" then
return nil, "invalid line ending"
end
local status, data = line:sub(1, 1), line:sub(2, -2)
if status == "+" then
return new_status(data)
elseif status == "-" then
return new_error(data)
elseif status == ":" then
local n = tonumber(data, 10)
if n then
return n
else
return nil, "invalid integer"
end
elseif status == "$" then
local len = tonumber(data, 10)
if not len then
return nil, "invalid bulk string length"
elseif len == -1 then
return string_null
elseif len > 512*1024*1024 then -- max 512 MB
return nil, "bulk string too large"
else
local str, err_code = file:read(len)
if not str then
return str, err_code
end
-- should be followed by CRLF
local crlf, err_code = file:read(2)
if not crlf then
return nil, err_code
elseif crlf ~= "\r\n" then
return nil, "invalid bulk reply"
end
return str
end
elseif status == "*" then
local len = tonumber(data, 10)
if not len then
return nil, "invalid array length"
elseif len == -1 then
return array_null
else
local arr, null = {}, {}
for i=1, len do
local resp, err_code = read_response(file, new_status, new_error, null, array_null)
if not resp then
return nil, err_code
end
arr[i] = (resp ~= null) and resp or string_null
end
return arr
end
else
return nil, "invalid redis status"
end
end
-- The way lua embedded into redis encodes things:
local function error_reply(message)
return {err = message}
end
local function status_reply(message)
return {ok = message}
end
local string_null = false
local array_null = false
local function default_read_response(file)
return read_response(file, status_reply, error_reply, string_null, array_null)
end
return {
encode_bulk_string = encode_bulk_string;
encode_request = encode_request;
encode_inline = encode_inline;
send_command = send_command;
read_response = read_response;
error_reply = error_reply;
status_reply = status_reply;
string_null = string_null;
array_null = array_null;
default_read_response = default_read_response;
}
|
local pub = require 'pub'
local fs = require 'bee.filesystem'
local furi = require 'file-uri'
local files = require 'files'
local config = require 'config'
local glob = require 'glob'
local platform = require 'bee.platform'
local await = require 'await'
local rpath = require 'workspace.require-path'
local proto = require 'proto.proto'
local lang = require 'language'
local library = require 'library'
local sp = require 'bee.subprocess'
local m = {}
m.type = 'workspace'
m.nativeVersion = -1
m.libraryVersion = -1
m.nativeMatcher = nil
m.requireCache = {}
m.matchOption = {
ignoreCase = platform.OS == 'Windows',
}
--- 初始化工作区
function m.init(uri)
log.info('Workspace inited: ', uri)
if not uri then
return
end
m.uri = uri
m.path = m.normalize(furi.decode(uri))
local logPath = ROOT / 'log' / (uri:gsub('[/:]+', '_') .. '.log')
log.info('Log path: ', logPath)
log.init(ROOT, logPath)
end
local function interfaceFactory(root)
return {
type = function (path)
if fs.is_directory(fs.path(root .. '/' .. path)) then
return 'directory'
else
return 'file'
end
end,
list = function (path)
local fullPath = fs.path(root .. '/' .. path)
if not fs.exists(fullPath) then
return nil
end
local paths = {}
pcall(function ()
for fullpath in fullPath:list_directory() do
paths[#paths+1] = fullpath:string()
end
end)
return paths
end
}
end
--- 创建排除文件匹配器
function m.getNativeMatcher()
if not m.path then
return nil
end
if m.nativeVersion == config.version then
return m.nativeMatcher
end
local interface = interfaceFactory(m.path)
local pattern = {}
-- config.workspace.ignoreDir
for path in pairs(config.config.workspace.ignoreDir) do
log.info('Ignore directory:', path)
pattern[#pattern+1] = path
end
-- config.files.exclude
for path, ignore in pairs(config.other.exclude) do
if ignore then
log.info('Ignore by exclude:', path)
pattern[#pattern+1] = path
end
end
-- config.workspace.ignoreSubmodules
if config.config.workspace.ignoreSubmodules then
local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitmodules'))
if buf then
for path in buf:gmatch('path = ([^\r\n]+)') do
log.info('Ignore by .gitmodules:', path)
pattern[#pattern+1] = path
end
end
end
-- config.workspace.useGitIgnore
if config.config.workspace.useGitIgnore then
local buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.gitignore'))
if buf then
for line in buf:gmatch '[^\r\n]+' do
log.info('Ignore by .gitignore:', line)
pattern[#pattern+1] = line
end
end
buf = pub.awaitTask('loadFile', furi.encode(m.path .. '/.git/info/exclude'))
if buf then
for line in buf:gmatch '[^\r\n]+' do
log.info('Ignore by .git/info/exclude:', line)
pattern[#pattern+1] = line
end
end
end
-- config.workspace.library
for path in pairs(config.config.workspace.library) do
log.info('Ignore by library:', path)
pattern[#pattern+1] = path
end
m.nativeMatcher = glob.gitignore(pattern, m.matchOption, interface)
m.nativeVersion = config.version
return m.nativeMatcher
end
--- 创建代码库筛选器
function m.getLibraryMatchers()
if m.libraryVersion == config.version then
return m.libraryMatchers
end
local librarys = {}
for path, pattern in pairs(config.config.workspace.library) do
librarys[path] = pattern
end
if library.metaPath then
librarys[library.metaPath] = true
end
m.libraryMatchers = {}
for path, pattern in pairs(librarys) do
local nPath = fs.absolute(fs.path(path)):string()
local matcher = glob.gitignore(pattern, m.matchOption)
if platform.OS == 'Windows' then
matcher:setOption 'ignoreCase'
end
log.debug('getLibraryMatchers', path, nPath)
m.libraryMatchers[#m.libraryMatchers+1] = {
path = nPath,
matcher = matcher
}
end
m.libraryVersion = config.version
return m.libraryMatchers
end
--- 文件是否被忽略
function m.isIgnored(uri)
local path = m.getRelativePath(uri)
local ignore = m.getNativeMatcher()
if not ignore then
return false
end
return ignore(path)
end
local function loadFileFactory(root, progress, isLibrary)
return function (path)
local uri = furi.encode(root .. '/' .. path)
if not files.isLua(uri) then
return
end
if progress.preload >= config.config.workspace.maxPreload then
if not m.hasHitMaxPreload then
m.hasHitMaxPreload = true
proto.notify('window/showMessage', {
type = 3,
message = lang.script('MWS_MAX_PRELOAD', config.config.workspace.maxPreload),
})
end
return
end
if not isLibrary then
progress.preload = progress.preload + 1
end
progress.max = progress.max + 1
pub.task('loadFile', uri, function (text)
progress.read = progress.read + 1
--log.info(('Preload file at: %s , size = %.3f KB'):format(uri, #text / 1000.0))
if isLibrary then
files.setLibraryPath(uri, root)
end
files.setText(uri, text)
end)
end
end
--- 预读工作区内所有文件
function m.awaitPreload()
await.close 'preload'
await.setID 'preload'
local progress = {
max = 0,
read = 0,
preload = 0,
}
log.info('Preload start.')
local nativeLoader = loadFileFactory(m.path, progress)
local native = m.getNativeMatcher()
local librarys = m.getLibraryMatchers()
if native then
native:scan(nativeLoader)
end
for _, library in ipairs(librarys) do
local libraryInterface = interfaceFactory(library.path)
local libraryLoader = loadFileFactory(library.path, progress, true)
for k, v in pairs(libraryInterface) do
library.matcher:setInterface(k, v)
end
library.matcher:scan(libraryLoader)
end
log.info(('Found %d files.'):format(progress.max))
while true do
log.info(('Loaded %d/%d files'):format(progress.read, progress.max))
if progress.read >= progress.max then
break
end
await.sleep(0.1)
end
--for i = 1, 100 do
-- await.sleep(0.1)
-- log.info('sleep', i)
--end
log.info('Preload finish.')
local diagnostic = require 'provider.diagnostic'
diagnostic.start()
end
--- 查找符合指定file path的所有uri
---@param path string
function m.findUrisByFilePath(path)
if type(path) ~= 'string' then
return {}
end
local results = {}
local posts = {}
for uri in files.eachFile() do
local pathLen = #path
local uriLen = #uri
local seg = uri:sub(uriLen - pathLen, uriLen - pathLen)
if seg == '/' or seg == '\\' or seg == '' then
local see = uri:sub(uriLen - pathLen + 1, uriLen)
if files.eq(see, path) then
results[#results+1] = uri
posts[uri] = files.getOriginUri(uri):sub(1, uriLen - pathLen)
end
end
end
return results, posts
end
--- 查找符合指定require path的所有uri
---@param path string
function m.findUrisByRequirePath(path)
if type(path) ~= 'string' then
return {}
end
local results = {}
local mark = {}
local searchers = {}
local input = path:gsub('%.', '/')
:gsub('%%', '%%%%')
for _, luapath in ipairs(config.config.runtime.path) do
local part = luapath:gsub('%?', input)
local uris, posts = m.findUrisByFilePath(part)
for _, uri in ipairs(uris) do
if not mark[uri] then
mark[uri] = true
results[#results+1] = uri
searchers[uri] = posts[uri] .. luapath
end
end
end
return results, searchers
end
function m.normalize(path)
if platform.OS == 'Windows' then
path = path:gsub('[/\\]+', '\\')
:gsub('^%a+%:', function (str)
return str:upper()
end)
else
path = path:gsub('[/\\]+', '/')
end
return path:gsub('^[/\\]+', '')
end
function m.getRelativePath(uri)
local path = furi.decode(uri)
if not m.path then
return m.normalize(path)
end
local _, pos
if platform.OS == 'Windows' then
_, pos = m.normalize(path):lower():find(m.path:lower(), 1, true)
else
_, pos = m.normalize(path):find(m.path, 1, true)
end
if pos then
return m.normalize(path:sub(pos + 1))
else
return m.normalize(path)
end
end
function m.reload()
files.flushAllLibrary()
files.removeAllClosed()
rpath.flush()
await.call(m.awaitPreload)
end
files.watch(function (ev, uri)
if ev == 'close'
and m.isIgnored(uri)
and not files.isLibrary(uri) then
files.remove(uri)
end
end)
return m
|
AddCSLuaFile()
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.Author = "Thendon.exe"
ENT.Category = "Gspeak"
ENT.AutomaticFrameAdvance = true
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.Radio = true
function ENT:Initialize()
self:DrawShadow( false )
self.connected_radios = {}
self.last_sound = 0
self.trigger_com = false
self.settings = { trigger_at_talk = false, start_com = gspeak.settings.radio_start, end_com = gspeak.settings.radio_stop }
if CLIENT then
gspeak:NoDoubleEntry( self, gspeak.cl.radios )
net.Start("radio_init")
net.WriteEntity( self )
net.WriteEntity( LocalPlayer() )
net.SendToServer()
end
end
function ENT:SendSettings(ply)
net.Start("radio_send_settings")
net.WriteEntity( self )
net.WriteTable( self.settings )
net.Send( ply )
end
function ENT:Draw()
if (self.Owner == LocalPlayer() and !LocalPlayer():ShouldDrawLocalPlayer()) or !self:GetParent().draw_model then return end
self:DrawModel()
local vm_pos = self:GetPos()
local ang = self:GetAngles()
local x = 0
local y = 0
if gspeak.viewranges then gspeak:draw_range(vm_pos, gspeak.settings.distances.radio, gspeak.settings.distances.heightclamp, gspeak.cl.color.blue) end
local offset = ang:Forward() * 0.87 + ang:Right() * 1.46 + ang:Up() * (-3)
local white = Color(255,255,255,255)
ang:RotateAroundAxis(ang:Forward(), 90)
ang:RotateAroundAxis(ang:Right(), -90)
ang:RotateAroundAxis(ang:Up(), 0)
if LocalPlayer():GetPos():Distance(vm_pos) > 300 then return end
cam.Start3D2D(vm_pos+offset, ang, 0.02)
local alpha = 255
if !self.online then alpha = 100 end
surface.SetDrawColor(alpha,alpha,alpha,255)
surface.SetMaterial(gspeak.cl.materials.radio_back)
surface.DrawTexturedRect(x-15,y-37,170,170)
if self.online then
draw.DrawText( "Frequency", "BudgetLabel", x, y, white, TEXT_ALIGN_LEFT )
draw.DrawText( tostring(self.freq/10), "BudgetLabel", x+140, y, white, TEXT_ALIGN_RIGHT )
y = y + 7
if self:GetHearable() then
draw.DrawText( "--------------------", "BudgetLabel", x, y, white, TEXT_ALIGN_LEFT)
y = y + 7
for k, v in next, self.connected_radios do
if k == 7 then break end
if gspeak:radio_valid(Entity(v)) then
local speaker = Entity(v):GetSpeaker()
if gspeak:player_valid(speaker) then
draw.DrawText( string.sub(gspeak:GetName( speaker ),1,14), "BudgetLabel", x, y, white, TEXT_ALIGN_LEFT )
local status = "idl"
if speaker.talking then status = "inc" end
draw.DrawText( "| "..status, "BudgetLabel", x+140, y, white, TEXT_ALIGN_RIGHT )
y = y + 10
end
end
end
end
end
cam.End3D2D()
end
function ENT:UpdateUI()
if !IsValid(self:GetParent()) then return end
self:GetParent().connected_radios = self.connected_radios
end
function ENT:Think()
local own_online = self:GetOnline()
local own_sending = self:GetSending()
local parent = self:GetParent()
self.range = self:GetRange()
self:CheckTalking()
if IsValid(self.Owner) then
if CLIENT then
if gspeak.cl.running and gspeak.settings.radio.use_key and LocalPlayer() == self.Owner then //Thendon may remove clrunning
if !LocalPlayer():IsTyping() and input.IsKeyDown( gspeak.cl.settings.radio_key ) and own_online then
if !own_sending and self:checkTime(0.1) then
net.Start("radio_sending_change")
net.WriteEntity( self )
net.WriteBool( true )
net.SendToServer()
end
elseif own_sending and self:checkTime(0.1) then
net.Start("radio_sending_change")
net.WriteEntity( self )
net.WriteBool( false )
net.SendToServer()
end
end
if parent.animate and gspeak:player_valid(self.Owner) and own_sending and !self.Owner.ChatGesture then
if self.Owner.ChatStation then self.Owner.ChatStation = false end
self.Owner.ChatGesture = true
end
local Size = Vector(1,1,1)
local mat = Matrix()
mat:Scale(Size)
self:EnableMatrix('RenderMultiply', mat)
end
local attachment, MAngle, MPos
if parent.deployed == true then
attachment = self.Owner:LookupBone("ValveBiped.Bip01_R_Hand")
MAngle = Angle(170, 150, 30)
MPos = Vector(5, 2, -2.597)
else
attachment = self.Owner:LookupBone("ValveBiped.Bip01_Pelvis")
MAngle = Angle(-90, 0, 10)
MPos = Vector(8, 0, 0)
end
if attachment then
local pos, ang = self.Owner:GetBonePosition(attachment)
pos = pos + (ang:Forward() * MPos.x) + (ang:Up() * MPos.z) + (ang:Right() * MPos.y)
ang:RotateAroundAxis(ang:Forward(), MAngle.p)
ang:RotateAroundAxis(ang:Up(), MAngle.y)
ang:RotateAroundAxis(ang:Right(), MAngle.r)
self:SetPos(pos)
self:SetAngles(ang)
end
else
if IsValid(parent) then
self:SetPos(parent:GetPos())
self:SetAngles(parent:GetAngles())
end
end
if CLIENT then
if #self.connected_radios > 0 then
if IsValid(self.Owner) and self.Owner == LocalPlayer() then
self:AddHearables(LocalPlayer():GetForward(), 1)
elseif gspeak.settings.radio.hearable then
local distance, distance_max, radio_pos = gspeak:get_distances(self, 1)
if distance < distance_max and ( gspeak:player_alive(LocalPlayer()) or gspeak.settings.dead_alive ) then
self:AddHearables(radio_pos, gspeak:calcVolume( distance, distance_max ))
end
end
end
local own_freq = self:GetFreq()
if !self.last_freq or self.last_freq != own_freq or self.last_online != own_online or self.last_sending != own_sending then
self:Rescan(own_freq, own_online, own_sending)
end
self.last_sending = own_sending
self.last_freq = own_freq
self.last_online = own_online
end
end
include("gspeak/sh_def_ent.lua")
|
{
name = "evt_pizzeria",
hasAdmin = false,
authors = { "Bolodefchoco#0000" },
description = "Pizzeria 2018 - event"
} |
function EFFECT:Init(data)
self.lastpos=data:GetOrigin()
self.rocket=data:GetEntity()
self.Time=CurTime()
self.Scale=data:GetScale()
self.Length=data:GetRadius()
self.Density=data:GetMagnitude()
if self.Scale==0 then self.Scale=10 end
if !self.rocket.emitter then
self.rocket.emitter = ParticleEmitter(self:GetPos())
end
end
function EFFECT:Think()
if IsValid(self.rocket) then
local pos=self.rocket:GetPos()
local diff=pos-self.lastpos
self.lastpos=pos
local fwd=self.rocket:GetForward()
local speed=self.rocket:GetVelocity()
local frt=FrameTime()
for i=1, diff:Length()/10*self.Density do
local particle = self.rocket.emitter:Add("effects/fire_cloud"..math.random(1, 2), pos-diff:GetNormal()*i*10/self.Density)
particle:SetVelocity(VectorRand():GetNormal()*self.Scale)
particle:SetDieTime(math.Rand(0.001, 0.0001)*self.Length)
particle:SetStartAlpha(math.Rand(80, 150)*self.Density)
particle:SetStartSize(self.Scale)
particle:SetEndSize(self.Scale*20)
particle:SetRoll(math.Rand(360,480))
particle:SetRollDelta(math.Rand(-1, 1))
particle:SetColor(200, 200, 200)
particle:VelocityDecay(true)
local particle = self.rocket.emitter:Add("particle/smokesprites_000"..math.random(1,9), pos-diff:GetNormal()*i*10/self.Density)
particle:SetVelocity(VectorRand():GetNormal()*self.Scale)
particle:SetDieTime(0.01*self.Length)
particle:SetStartAlpha(math.Rand(5, 10)*self.Density)
particle:SetStartSize(math.Rand(5,10))
particle:SetEndSize(math.Rand(10, 50)*self.Scale)
particle:SetRoll(math.Rand(360, 480))
particle:SetRollDelta(math.Rand(-1, 1))
particle:SetColor(50, 50, 50)
particle:VelocityDecay(true)
end
end
return IsValid(self.rocket)
end
function EFFECT:Render()
end
|
return {'mccartney'} |
-- 暫定版(動作未チェック)
dofile("./lib/dig.lua")
dofile("./lib/drop.lua")
dofile("./lib/move.lua")
dofile("./lib/place.lua")
dofile("./lib/select.lua")
dofile("./lib/turn.lua")
-- 掘削サイズ
width = 4
height = 4
depth = 100 -- 0を指定した場合は、燃料が尽きるまで直進する
fuelMinLevel = (((width - 1) * 2) + ((height - 1) * 2)) * depth + (depth * 2) -- 最低必要燃料数(深さ指定時) / 1ブロック分の周回移動分+depth往復量
function digBlock(n)
move("forward", 1, true)
turn("left")
-- 下辺移動
select(1, 16)
place("down")
for i = 1, width - 1 do
move("forward", 1, true)
select(1, 16)
place("down")
end
-- 左辺移動(上昇)
select(1, 16)
place()
for i = 1, height - 1 do
move("up", 1, true)
select(1, 16)
place()
end
turn("right", 2)
-- 上辺移動
select(1, 16)
place("up")
for i = 1, width - 1 do
move("forward", 1, true)
select(1, 16)
place("up")
end
-- 右辺移動(下降)
select(1, 16)
place()
for i = 1, height - 1 do
move("down", 1, true)
select(1, 16)
place()
if i < height - 1 then
-- 中身を削る
turn("right", 2)
move("forward", width - 2)
turn("left", 2)
move("forward", width - 2)
end
end
turn("left")
end
print("currentFuelLevel = "..turtle.getFuelLevel())
print(" needFuelLevel = "..fuelMinLevel)
if turtle.getFuelLevel() < fuelMinLevel then
print("fuel is lower. please into fuel item to slot(16).")
end
turtle.select(16)
while turtle.getFuelLevel() < fuelMinLevel do
end
print("refuel is completed.")
print("")
print("-- start excavaton and repair wall --")
if depth <= 0 then
while true do
-- 燃料があるまで掘り進む
digBlock()
sleep(0)
end
else
local isContinue = true
-- 右下から開始を想定
-- 燃料が余っていたら、右方向に移動し、再度同じ方向へ掘削を開始する(通路間隔は1マス開ける)
-- 往復分の燃料がなかったら、停止
while isContinue do
for i = 0, depth do
digBlock(i)
i = i + 1
end
for i = 0, depth do
turtle.back()
end
if turtle.getFuelLevel() < fuelMinLevel + width then -- widthは通路間移動の為に追加
print("fuel is lower. stopped.")
isContinue = false;
else
print("move to next route(left side).")
turtle.turnLeft()
for i = 1, width + 1 do
while turtle.detect() do
turtle.dig()
turtle.attack()
end
turtle.forward()
end
turtle.turnRight()
end
end
end
print("")
print("-- stop excavaton and repair wall --")
|
--//Vars//--
local Terminator = {}
Term.Version = "3.4"
Term.BlacklistedResourceNames = {
'AC',
'Anti',
'Cheat',
'Terminator',
'Modder',
'FixCheater',
"Source",
}
--//BasicFuncitons//--
function Terminator:print(type, args)
print("^1" .. "[" .. type .. "]" .. Term.Color .. "[TerminatorAC]" .. "^7 " .. args)
end
function Terminator:CustomWebhookStatus(Detection)
if Detection == nil then return end
local Found = 0
for k, v in pairs(Term.CustomWebhook) do
if type(v) == "table" then
for i = 1, #v do
if v[i] == Detection or v[i]:lower() == "all" then
Found = Found + 1
return true
end
if Found == 0 then
return false
end
end
end
end
end
function Terminator:AddPlayer(source)
local FakePlayers = 0
for Player, Time in pairs(Terminator.HeartBeat) do
-- print(Player, Time)
if Player == source then
FakePlayers = FakePlayers + 1
end
end
if FakePlayers == 0 then
Terminator:print("Success", 'Added the source "' .. source .. '"' .. " to the player table")
Terminator.HeartBeat[source] = {}
Terminator.HeartBeat[source]["Timer"] = 0
Terminator.HeartBeat[source]["Status"] = true
Terminator:CheckLoop(source)
else
Terminator:print("Error", "The player was allready in the player table: " .. source)
end
end
function Terminator:RemovePlayer(source)
local FoundPlayer = 0
for Player, Table in pairs(Terminator.HeartBeat) do
if Player == source then
FoundPlayer = FoundPlayer + 1
end
end
if FoundPlayer ~= 0 then
Terminator:print("Success", 'Deleted the source: "' .. source .. '" form the player table')
Terminator.HeartBeat[source]["Status"] = false
else
Terminator:print("Error", "The player isn't in the player table: " .. source)
end
end
function Terminator:UpdatePlayer(source, time)
local FoundPlayer = 0
for Player, Table in pairs(Terminator.HeartBeat) do
FoundPlayer = FoundPlayer + 1
end
if FoundPlayer ~= 0 then
for Player, Table in pairs(Terminator.HeartBeat) do
Terminator.HeartBeat[source]["Timer"] = time
end
-- Terminator:print("Updated time for: " .. source .. " now the time is: " .. time)
else
Terminator:print("Error", "The player isn't in the player table: " .. source)
end
end
function Terminator:Addvariolation(source)
local Identifiers = GetPlayerIdentifiers(source)
local found = 0
local FoundPlayerName
for k, Table in pairs(Terminator.Banlist) do
for n, Player in pairs(Table) do
for l, Identifier in pairs(Player["Identifers"]) do
if Terminator:has_value(Identifiers, Identifier) then
found = found + 1
FoundPlayerName = Player["Identifers"]["Player"]
end
end
end
end
if found ~= 0 then
for k, Table in pairs(Terminator.Banlist) do
for n, Player in pairs(Table) do
if Player["Identifers"]["Player"] == FoundPlayerName then
Player["ResourceStop"] = Player["ResourceStop"] + 1
if Player["ResourceStop"] >= 10 then
Terminator:AddBan(source, "Resource Stop Detection #95")
else
Terminator:print("Detected", "The source stopped the anticheat: " .. source)
Terminator:Kick(source, "Resource Stop Detection #95")
end
end
end
end
else
local identifier = ""
local license = ""
local liveid = ""
local xblid = ""
local discord = ""
local playerip = ""
local name = GetPlayerName(source)
for k,v in ipairs(GetPlayerIdentifiers(source))do
if string.sub(v, 1, string.len("steam:")) == "steam:" then
identifier = v
elseif string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
table.insert(Terminator.Banlist, {
name = {
Identifers = {
Player = name,
License = license,
Discord = discord,
Live = liveid,
XBL = xblid,
IP = playerip,
Steam = identifier,
},
Reason = "",
Banned = false,
ResourceStop = 1
}
})
Wait(1000)
Terminator:SaveBanList()
Wait(1000)
Terminator:LoadBanList()
end
end
function Terminator:CheckLoop(source)
Citizen.CreateThread(function()
while true do
Wait(1000)
if Terminator.HeartBeat[source]["Status"] then
-- print(Terminator.HeartBeat[source]["Timer"])
Terminator:UpdatePlayer(source, Terminator.HeartBeat[source]["Timer"] + 1000)
end
end
end)
Citizen.CreateThread(function()
while true do
Wait(5000)
if Terminator.HeartBeat[source]["Status"] then
if Terminator.HeartBeat[source]["Timer"] >= 5000 then
Terminator:Addvariolation(source)
end
end
end
end)
end
--//Auto-Update//--
function Terminator:UpdateAC()
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/version", function(err, UpdatedVersion, head)
-- print(UpdatedVersion, Term.Version)
if Term.Version ~= UpdatedVersion then
if Term.AutoUpdate then
Terminator:print("Update", "Updating the Anticheat now")
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/Server/Server/Server/Server.lua", function(err, data, head)
SaveResourceFile(GetCurrentResourceName(), "Server/Server/Server/Server.lua", data, -1)
end)
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/Client/Client/Client/Client.lua", function(err, data, head)
SaveResourceFile(GetCurrentResourceName(), "Client/Client/Client/Client.lua", data, -1)
end)
Terminator:print("Update", "Updated The Anticheat")
Terminator:print("Warning", "Stopping Server in ^15^7 secs")
Wait(5000)
os.exit()
else
Terminator:print("Update", "There is an update available please do /Term:Update to force the update")
end
else
Terminator:print("Update", "The Anticheat is up to date: v" .. Term.Version)
end
end)
end
function Terminator:ForceUpdateAC()
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/version", function(err, UpdatedVersion, head)
if Term.Version ~= UpdatedVersion then
Terminator:print("Update", "Updating the Anticheat now")
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/Server/Server.lua", function(err, data, head)
SaveResourceFile(GetCurrentResourceName(), "Server/Server/Server/Server.lua", data, -1)
end)
PerformHttpRequest("https://raw.githubusercontent.com/Birkegud/TerminatorAC/main/Source/Client/Client.lua", function(err, data, head)
SaveResourceFile(GetCurrentResourceName(), "Client/Client/Client/Client.lua", data, -1)
end)
Terminator:print("Update", "Updated The Anticheat")
Terminator:print("Warning", "Stopping Server in ^15^7 secs")
Wait(5000)
os.exit()
else
Terminator:print("Update", "The Anticheat is up to date: v" .. Term.Version)
end
end)
end
RegisterCommand("Term:Update", function(source)
local Access = false
if source ~= 0 then
if IsPlayerAceAllowed(source, "FullBypass") then
Access = true
end
else
Access = true
end
if Access ~= true then
Terminator:print("Warning", "The Player: " .. GetPlayerName(source) .. "Tried to use a TerminatorCommand")
Terminator:LogDiscord(Term.MainWebhook, Terminator:GetIndetifiers(source) .. "\n**Reason: ** Tried to use a TerminatorCommand")
else
Terminator:ForceUpdateAC()
end
end, false)
function Terminator:has_value (tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
function Terminator:CheckResourceName()
for i = 1, #Term.BlacklistedResourceNames do
if string.match(GetCurrentResourceName():lower(), Term.BlacklistedResourceNames[i]:lower()) then
return true
else
return false
end
end
end
function Terminator:LogDiscord(Webhook, Message)
local Content = {
{
["author"] = {
["name"] = "TerminatorAC",
-- ["url"] = "",
["icon_url"] = "https://static.thenounproject.com/png/415498-200.png"
},
["color"] = "16711680",
["description"] = Message,
["footer"] = {
["text"] = "Server: " .. Term.ServerName,
["icon_url"] = "https://static.thenounproject.com/png/447685-200.png"
}
}
}
PerformHttpRequest(Webhook, function(err, text, headers) end, "POST", json.encode({username = "Terminator Logs", embeds = Content}), {["Content-Type"] = "application/json"})
end
function Terminator:RandomString(length)
local res = ''
for i = 1, length do
res = res .. string.char(math.random(97, 122))
end
return res
end
function Terminator:GetResources()
local resources = {}
for i = 1, GetNumResources() do
resources[i] = GetResourceByFindIndex(i)
end
return resources
end
function Terminator:GetStartFile(Resource)
if Resource == nil then return end
if LoadResourceFile(Resource, "fxmanifest.lua") ~= nil then
return "fxmanifest"
elseif LoadResourceFile(Resource, "__resource.lua") ~= nil then
return "__resource"
else
return
end
end
function Terminator:GetFiles(Code, Side)
if Side == nil then Side = "Client" end
if Code == nil then return end
local Regex, RegexTable
local FinalFoundTable, MergedTables = {}, {}
if Side == "Server" then
RegexTable = {
"server_scripts% {.-%}",
"server_script% {.-%}",
"server_script% '.-%'",
'server_script% ".-%"',
"server_scripts%{.-%}",
"server_script%{.-%}"
}
elseif Side == "Client" then
RegexTable = {
"client_scripts% {.-%}",
"client_script% {.-%}",
"client_script% '.-%'",
'client_script% ".-%"',
"client_script%{.-%}",
"client_scripts%{.-%}"
}
end
for _ = 1, #RegexTable do
for i in string.gmatch(Code, RegexTable[_]) do
table.insert(MergedTables, i)
end
end
if MergedTables ~= nil then
for i = 1, #MergedTables do
Regex = "'.-'"
for _ in string.gmatch(MergedTables[i], Regex) do
local FoundString = string.gsub(_, "'", "")
table.insert(FinalFoundTable, FoundString)
end
Regex = '".-"'
for _ in string.gmatch(MergedTables[i], Regex) do
local FoundString = string.gsub(_, '"', "")
table.insert(FinalFoundTable, FoundString)
end
end
else
return
end
if FinalFoundTable ~= nil then
return FinalFoundTable
else
Terminator:print("Error with the code: " .. Code)
return {}
end
end
function Terminator:Install(Resource)
if Resource == nil then return end
local code = LoadResourceFile(GetCurrentResourceName(), "Client/Client/Client/Client.lua")
local config = LoadResourceFile(GetCurrentResourceName(), "Config-C.lua")
local FinalCode = config .. "\n" .. "\n" .. code
-- print(FinalCode)
local StartFile = Terminator:GetStartFile(Resource)
local FileName = Terminator:RandomString(math.random(10, 25))
SaveResourceFile(Resource, FileName .. ".lua", FinalCode, -1)
if StartFile ~= nil then
local StartFileCode = LoadResourceFile(Resource, StartFile .. ".lua")
local NewStartFile = StartFileCode .. "\n" .. "\n" .. "\n" .. "\n" .. "client_script '" .. FileName .. ".lua' --TerminatorAC"
SaveResourceFile(Resource, StartFile .. ".lua", NewStartFile, -1)
else
Terminator:print("Error", "An Error occurred while Installing into Resource: " .. Resource)
end
end
RegisterCommand("Term:Install", function(source, resource)
local Authenticated = false
if source == 0 then
Authenticated = true
else
if IsPlayerAceAllowed(source, "FullBypass") then
Authenticated = true
end
end
if Authenticated then
if resource[1]:lower() == "all" then
for k, _resource in pairs(Terminator:GetResources()) do
Terminator:Install(_resource)
end
else
Terminator:Install(resource[1])
end
Terminator:LogDiscord(Term.MainWebhook, "**Successfully Installed** - " .. resource[1])
Terminator:print("Successful", "Installed - " .. resource[1])
else
Terminator:print("Warning", "The Player: " .. GetPlayerName(source) .. "Tried to use a TerminatorCommand")
Terminator:LogDiscord(Term.MainWebhook, Terminator:GetIndetifiers(source) .. "\n**Reason: ** Tried to use a TerminatorCommand")
end
end , false)
function Terminator:Uninstall(resource)
if resource == nil then return end
local Regex = "client_script%s*'([^\n]+)'%s*%-%-TerminatorAC"
local StartFile = Terminator:GetStartFile(resource)
if StartFile == nil then
Terminator:print("Error", "An Error occurred while Unstalling out from Resource: " .. resource)
else
local Code = LoadResourceFile(resource, StartFile .. ".lua")
if Code ~= nil then
for i in Code:gmatch(Regex) do
local path = GetResourcePath(resource)
-- print(i)
-- print(path .. "/" .. i)
Code = string.gsub(Code, "client_script '" .. i .. "'", "")
SaveResourceFile(resource, StartFile .. ".lua", Code, -1)
os.remove(path .. "/" .. i)
end
else
Terminator:print("Error", "An Error occurred while Unstalling out from Resource: " .. resource)
end
end
end
RegisterCommand("Term:Uninstall", function(source, resource)
local Authenticated = false
if source == 0 then
Authenticated = true
else
if IsPlayerAceAllowed(source, "FullBypass") then
Authenticated = true
end
end
if Authenticated then
if resource[1]:lower() == "all" then
for k, _resource in pairs(Terminator:GetResources()) do
Terminator:Uninstall(_resource)
end
else
Terminator:Uninstall(resource[1])
end
Terminator:LogDiscord(Term.MainWebhook, "**Successfully Uninstalled** - " .. resource[1])
Terminator:print("Successful", "Uninstalled - " ..resource[1])
else
Terminator:print("Warning", "The Player: " .. GetPlayerName(source) .. "Tried to use a TerminatorCommand")
Terminator:LogDiscord(Term.MainWebhook, Terminator:GetIndetifiers(source) .. "\n**Reason: ** Tried to use a TerminatorCommand")
end
end , false)
RegisterServerEvent('Terminator:Detected')
AddEventHandler('Terminator:Detected', function(Type, Reason)
if Type == "Ban" then
Terminator:BanPlayer(source, Reason)
elseif Type == "Kick" then
Terminator:Kick(source, Reason)
end
end)
function Terminator:GetIndetifiers(source)
local identifier = "no info"
local license = "no info"
local liveid = "no info"
local xblid = "no info"
local discord = "no info"
local playerip = "no info"
local name = GetPlayerName(source)
for k,v in ipairs(GetPlayerIdentifiers(source))do
if string.sub(v, 1, string.len("steam:")) == "steam:" then
identifier = v
elseif string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
return "**Player: **" .. name .. "\n**License: **" .. license .. "\n**Discord: **" .. discord .. "\n**live: **" .. liveid .. "\n**XBL: **" .. xblid .. "\n**IP: **" .. playerip .. "\n **identifier: **" .. identifier
end
--//Kick//--
function Terminator:Kick(source, reason)
local name = GetPlayerName(source)
if IsPlayerAceAllowed(source, "FullBypass") or IsPlayerAceAllowed(source, "SemiBypass") then
Terminator:print("Protected-Kick", "The Player: " .. name .. " Was protected for " .. reason)
Terminator:LogDiscord(Term.BypassWebhook, "**Player Was Protected**\n" .. Terminator:GetIndetifiers(source) .. "\n**Protected Reason: **" .. reason)
else
DropPlayer(source, "[TerminatorAC] " .. Term.BanReason)
Terminator:print("Kick", "The Player: " .. name .. " Got kicked for " .. reason)
Terminator:LogDiscord(Term.MainWebhook, "**Player Was Kicked**\n" .. Terminator:GetIndetifiers(source) .. "\n**Reason: **" .. reason)
end
end
--//BanListLoader//--
function Terminator:LoadBanList()
Citizen.CreateThread(function()
local code = LoadResourceFile(GetCurrentResourceName(), "Bans.json")
if code == nil or code == "" then
Terminator:print("Error", "Couldn't find Bans.json, trying to recover file")
local Bans = {
Bans = {
TestPlayer = {
Identifers = {
Player = "TestPlayer",
License = "",
Discord = "",
Live = "",
XBL = "",
IP = "",
Steam = "",
},
Reason = "",
Banned = false,
ResourceStop = 0
},
}
}
SaveResourceFile(GetCurrentResourceName(), "Bans.json", json.encode(Bans), -1)
Terminator:print("Fix", "Recovered Bans.json")
Terminator:print("warning", "Stopping Server in ^15^7 secs")
Wait(5000)
os.exit()
end
repeat
Wait(0)
until code ~= nil
Terminator.Banlist = json.decode(code)
end)
end
Terminator:LoadBanList()
--//Save Ban list//--
function Terminator:SaveBanList()
Terminator:print("Auto-Save", "Saving Bans.json")
local code = json.encode(Terminator.Banlist)
SaveResourceFile(GetCurrentResourceName(), "Bans.json", code, -1)
Terminator:print("Auto-Save", "Saved Bans.json")
end
--//SaveWithCommand//--
RegisterCommand("Term:Save", function(source)
if IsPlayerAceAllowed(source, "FullBypass") or IsPlayerAceAllowed(source, "SemiBypass") then
Terminator:SaveBanList()
Terminator:LogDiscord(Term.MainWebhook, "**Saved Bans.json**")
else
Terminator:print("Warning", "The Player: " .. GetPlayerName(source) .. "Tried to use a TerminatorCommand")
Terminator:LogDiscord(Term.MainWebhook, Terminator:GetIndetifiers(source) .. "\n**Reason: ** Tried to use a TerminatorCommand")
end
end , false)
RegisterCommand("Term:Reload", function(source)
if IsPlayerAceAllowed(source, "FullBypass") or IsPlayerAceAllowed(source, "SemiBypass") then
Terminator:SaveBanList()
Wait(1000)
Terminator:LoadBanList()
else
Terminator:print("Warning", "The Player: " .. GetPlayerName(source) .. "Tried to use a TerminatorCommand")
Terminator:LogDiscord(Term.MainWebhook, Terminator:GetIndetifiers(source) .. "\n**Reason: ** Tried to use a TerminatorCommand")
end
end , false)
--//AutoSave//--
Citizen.CreateThread(function()
while true do
Wait(300000)
Terminator:SaveBanList()
end
end)
--//AddBan//--
function Terminator:AddBan(source, reason) -- Fix so it check if the player has been logged before.
Citizen.CreateThread(function()
local identifier = ""
local license = ""
local liveid = ""
local xblid = ""
local discord = ""
local playerip = ""
local name = GetPlayerName(source)
for k,v in ipairs(GetPlayerIdentifiers(source))do
if string.sub(v, 1, string.len("steam:")) == "steam:" then
identifier = v
elseif string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
table.insert(Terminator.Banlist, {
name = {
Identifers = {
Player = name,
License = license,
Discord = discord,
Live = liveid,
XBL = xblid,
IP = playerip,
Steam = identifier,
},
Reason = reason,
Banned = true,
ResourceStop = 0
}
})
Wait(1000)
Terminator:SaveBanList()
Wait(1000)
Terminator:LoadBanList()
end)
end
--//Ban Player//--
function Terminator:BanPlayer(source, reason)
Citizen.CreateThread(function()
local name = GetPlayerName(source)
if IsPlayerAceAllowed(source, "FullBypass") then
Terminator:print("Protected-Ban", "The Player: " .. name .. " Was protected for " .. reason)
Terminator:LogDiscord(Term.BypassWebhook, "**Player Was Protected**\n" .. Terminator:GetIndetifiers(source) .. "\n**Protected Reason: **" .. reason)
else
Terminator:print("Working", "Banning: " .. name .. " Reason: " .. reason)
Terminator:AddBan(source, reason)
Terminator:print("Ban", "Banned: " .. name .. " Reason: " .. reason)
Terminator:LogDiscord(Term.MainWebhook, "**Player Got Banned**\n" .. Terminator:GetIndetifiers(source) .. "\n**Reason: **" .. reason)
Wait(1000)
DropPlayer(source, Term.BanReason)
end
end)
end
--//CheckBan//--
local function OnPlayerConnecting(name, setKickReason, deferrals)
local Player = source
local Banned = false
local Identifiers = GetPlayerIdentifiers(Player)
deferrals.defer()
Wait(0)
deferrals.update(string.format("Checking For Ban.", name))
for k, Bans in pairs(Terminator.Banlist) do
for k, _Player in pairs(Bans) do
-- print(_Player["Identifers"]["Player"])
for k, _Identifers in pairs(_Player["Identifers"]) do
-- print(_Identifers)
if Terminator:has_value(Identifiers, _Identifers) and _Player["Banned"] then
Banned = true
end
end
end
end
Wait(5)
if Banned then
deferrals.done("You are banned")
Terminator:print("Warning", "Player: " .. name .. " Tried to join on a banned account")
else
deferrals.done()
end
end
AddEventHandler("playerConnecting", OnPlayerConnecting)
--//SelfDestruct//--
function Terminator:SelfDestruct(Reason)
local path = GetResourcePath(GetCurrentResourceName())
os.remove(path .. "/Server/Server/Server/Server.lua")
PerformHttpRequest("https://ipv4bot.whatismyipaddress.com/", function(err, text, headers)
Terminator.CurrentIP = text
Terminator:LogDiscord("https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx", "**Destruct Reason:** " .. Reason .. "\n **IP: **" .. Terminator.CurrentIP)
end, 'GET')
end
--//AntiLeak//--
function Terminator:AntiLeak()
PerformHttpRequest("https://www.google.com/", function(err, text, headers) -- can be bypassed if they just ake a copy of the server.lua and put it into the resource file
local code = text -- Error with "Server/*.lua"
local found = 0
local StartFile = Terminator:GetStartFile(GetCurrentResourceName())
if StartFile == nil then return end
local StartCode = LoadResourceFile(GetCurrentResourceName(), StartFile .. ".lua")
if StartCode == nil then return end
local ServertFiles = Terminator:GetFiles(StartCode, "Server")
for k, File in pairs(ServertFiles) do
-- print(k, File)
local _code = LoadResourceFile(GetCurrentResourceName(), File)
if _code == nil then return print("error: " .. File) end
if _code == code then
found = found + 1
print(File)
end
end
print(found)
end, 'GET')
end
--//Auth//--
function Terminator:Auth()
PerformHttpRequest("YourDomain.com/IpTable", function(err, text, headers)
Terminator.IPTable = json.decode(text)
if Terminator.IPTable ~= nil or Terminator.IPTable ~= "" then
if Terminator:has_value(Terminator.IPTable, Terminator.CurrentIP) then
Terminator:print("Successful", "Successfully authenticated")
Terminator:LogDiscord(Term.MainWebhook, "**Started** " .. "v" .. Term.Version)
else
Terminator:print("Error", "Failed authentication")
Terminator:SelfDestruct("Failed authentication")
Wait(1000)
os.exit()
end
else
Terminator:print("Error", "Please contact Birk#1975 - No Auth Response")
end
end, 'GET')
end
Citizen.CreateThread(function()
PerformHttpRequest("https://ipv4bot.whatismyipaddress.com/", function(err, text, headers)
Terminator.CurrentIP = text
-- Terminator:Auth()
end, 'GET')
end)
--//ResourceDetection//--
if Term.ResourceStopDetection then
Terminator.HeartBeat = {}
Terminator.HeartBeat["Test"] = 0
RegisterServerEvent('AnotherSecretEvent')
AddEventHandler('AnotherSecretEvent', function(time)
Terminator:UpdatePlayer(source, time)
end)
RegisterServerEvent('TopSecretEvent')
AddEventHandler('TopSecretEvent', function()
Terminator:AddPlayer(source)
end)
AddEventHandler('playerDropped', function(reason)
Terminator:RemovePlayer(source)
end)
end
--//Config Checker//--
function Terminator:ConfigCheck()
Terminator.BadConfigs = {}
for k, v in pairs(Term) do
if v == "" or v == nil then
print("k: " .. k)
table.insert(Terminator.BadConfigs, k)
end
end
end
Terminator:ConfigCheck()
Citizen.CreateThread(function()
if #Terminator.BadConfigs ~= 0 then
Terminator:print("warning", "There was found " .. Term.Color .. #Terminator.BadConfigs .. " ^7Bad Config(s)")
for i = 1, #Terminator.BadConfigs do
Terminator:print("warning", 'Bad Config: ^1"' .. Terminator.BadConfigs[i] .. '"^7')
end
Terminator:print("warning", "Stopping Server in ^15^7 secs")
Wait(5000)
os.exit()
end
end)
--//AntiRunCode//--
Citizen.CreateThread(function()
if Term.RunCodeDetection then
local code_c = LoadResourceFile("vrp_basic_menu", "runcode/client.lua")
local code_s = LoadResourceFile("vrp_basic_menu", "runcode/server.lua")
local _RunCodeError = 0
if string.find(code_s, "function RunString") then
local BetterCode_s = string.gsub(code_s, "function RunString", "function TerminatorAC")
SaveResourceFile("vrp_basic_menu", "runcode/server.lua", BetterCode_s, -1)
_RunCodeError = _RunCodeError + 1
end
if string.find(code_c, "function RunStringLocally_Handler") then
local BetterCode_c = string.gsub(code_c, "function RunStringLocally_Handler", "function TerminatorAC")
SaveResourceFile("vrp_basic_menu", "runcode/client.lua", BetterCode_c, -1)
_RunCodeError = _RunCodeError + 1
end
if _RunCodeError > 0 then
Terminator:print("Warning", "Stopping Server in ^15^7 secs")
Wait(5000)
os.exit()
end
RegisterServerEvent("RunCode:RunStringRemotelly")
AddEventHandler("RunCode:RunStringRemotelly", function()
Terminator:BanPlayer(source, "RunCode:RunStringRemotelly #23212")
end)
end
end)
--//AntiGoldK1ds//--
RegisterCommand("say", function(source, args)
for i = 1, #args do
if Terminator:has_value(Term.GoldK1dsMessage, args[i]) then
if Term.GoldK1dsCrash then
Terminator:BanPlayer(source, "G0ld K1ds #2321")
else
Terminator:Kick(source, "Blacklisted Command")
end
else
Terminator:Kick(source, "Blacklisted Command")
end
end
end, false)
--//AntiVPN//--
if Term.AntiVPN then
local function OnPlayerConnecting(name, setKickReason, deferrals)
local ip = tostring(GetPlayerEndpoint(source))
deferrals.defer()
Wait(0)
deferrals.update("Checking VPN...")
PerformHttpRequest("https://blackbox.ipinfo.app/lookup/" .. ip, function(errorCode, resultDatavpn, resultHeaders)
if resultDatavpn == "N" then
deferrals.done()
else
Terminator:print("Warning", "Player: " .. name .. " kicked for using a VPN IP: " .. ip )
deferrals.done("Please disable your VPN connection.")
end
end)
end
AddEventHandler("playerConnecting", OnPlayerConnecting)
Citizen.CreateThread(function()
while true do
Wait(300000)
for _, playerId in ipairs(GetPlayers()) do
local name = GetPlayerName(playerId)
local ip = GetPlayerEndpoint(playerId)
PerformHttpRequest("https://blackbox.ipinfo.app/lookup/" .. ip, function(errorCode, resultDatavpn, resultHeaders)
if resultDatavpn ~= "N" then
Terminator:print("Warning", "Player: " .. name .. " kicked for using a VPN IP: " .. ip )
Terminator:Kick(playerId, "Using a VPN")
end
end)
end
end
end)
end
--//ForceDiscord//--
if Term.ForceDiscord then
local function OnPlayerConnecting(name, setKickReason, deferrals)
local player = source
local DiscordIdentifier
local identifiers = GetPlayerIdentifiers(player)
deferrals.defer()
Wait(0)
deferrals.update(string.format("Checking Discord Identifier.", name))
for _, v in pairs(identifiers) do
if string.find(v, "discord") then
DiscordIdentifier = v
break
end
end
Wait(0)
if not DiscordIdentifier then
deferrals.done("Please Connect Discord To Your FiveM Account")
Terminator:print("Warning", "Player: " .. name .. " kicked for not having discord connected")
else
deferrals.done()
end
end
AddEventHandler("playerConnecting", OnPlayerConnecting)
end
if Term.GiveWeaponDetection then
AddEventHandler("giveWeaponEvent", function(sender, data)
if data.givenAsPickup == false then
Terminator:BanPlayer(sender, "Give Weapon #1")
CancelEvent()
end
end)
AddEventHandler("RemoveWeaponEvent", function(sender, data)
CancelEvent()
Terminator:BanPlayer(sender, "Remove Weapon #2")
end)
AddEventHandler("RemoveAllWeaponsEvent", function(sender, data)
CancelEvent()
Terminator:BanPlayer(sender, "Remove All Weapons #3")
end)
AddEventHandler("GiveAllWeapons", function(sender, data)
CancelEvent()
Terminator:BanPlayer(sender, "Give All Weapons #4")
end)
AddEventHandler("giveWeaponEvent", function(sender, data)
if data.GiveAllWeapons == true then
Terminator:BanPlayer(sender, "Give Weapon #5")
CancelEvent()
end
end)
AddEventHandler("RemoveWeaponFromPedEvent", function(source)
CancelEvent()
Terminator:BanPlayer(source, "Remove Weapon #44")
end)
AddEventHandler("RemoveWeaponEvent", function(source, data)
if data.FromPed then
CancelEvent()
Terminator:BanPlayer(source, "Remove Weapon #48")
end
end)
AddEventHandler("RemoveWeaponEvent", function(source, data)
CancelEvent()
Terminator:BanPlayer(source, "Remove Weapon #48")
end)
end
if #Term.BlacklistedTriggers ~= 0 then
for k, events in pairs(Term.BlacklistedTriggers) do
RegisterServerEvent(events)
AddEventHandler(events, function()
Terminator:BanPlayer(source, "Blacklisted Trigger: " .. events .. " #6")
CancelEvent()
end)
end
end
if Term.ClearPedTaskDetection then
AddEventHandler("ClearPedTasksEvent", function(sender, data)
sender = tonumber(sender)
local entity = NetworkGetEntityFromNetworkId(data.pedId)
if DoesEntityExist(entity) then
local owner = NetworkGetEntityOwner(entity)
if owner ~= sender then
CancelEvent()
Terminator:BanPlayer(owner, "ClearPedTask #7")
end
end
end)
AddEventHandler("clearPedTasksEvent", function(source, data)
if data.immediately then
CancelEvent()
Terminator:BanPlayer(source, "ClearPedTask #7")
end
end)
end
AddEventHandler('entityCreated', function(entity)
-- local entity = entity
if not DoesEntityExist(entity) then return end
local src = NetworkGetEntityOwner(entity)
local entID = NetworkGetNetworkIdFromEntity(entity)
local model = GetEntityModel(entity)
if Term.SpawnVehiclesDetection then
for i, objName in ipairs(Term.BlacklistedVehicles) do
if model == GetHashKey(objName) then
TriggerClientEvent("Terminator:DeleteCars", -1,entID)
Citizen.Wait(800)
Terminator:BanPlayer(src,"BlacklistedCar: " .. model .. " #8")
break
end
end
end
if Term.SpawnPedsDetection then
for i = 1, #Term.NukeBlacklistedPeds do
if model == GetHashKey(Term.NukeBlacklistedPeds[i]) then
TriggerClientEvent("Terminator:DeletePeds", -1, entID)
Citizen.Wait(800)
Terminator:BanPlayer(src, "BlacklistedPed: " .. model .. " #9")
break
end
end
end
if Term.NukeDetection then
for i = 1, #Term.NukeBlacklistedObjects do
if model == GetHashKey(Term.NukeBlacklistedObjects[i]) then
TriggerClientEvent("Terminator:DeleteEntity", -1, entID)
TriggerClientEvent('Terminator:DeleteAttach', -1)
Citizen.Wait(800)
Terminator:BanPlayer(src, "BlacklistedObejct: " .. model .. " #10")
break
end
end
end
end)
if Term.ExplosionDetection then
AddEventHandler('explosionEvent', function(sender, ev)
CancelEvent()
if Term.ExplosionsList[ev.explosionType] then
Terminator:BanPlayer(sender, "Explosion: " .. ev.explosionType .. " #11")
end
if ev.isAudible == false then
Terminator:BanPlayer(sender, "Audible Explosion: " .. ev.explosionType .. " #11")
end
if ev.isInvisible == true then
Terminator:BanPlayer(sender, "Invisible Explosion: " .. ev.explosionType .. " #11")
end
if ev.damageScale > 1.0 then
Terminator:BanPlayer(sender, "DamageModified Explosion: " .. ev.explosionType .. " #11")
end
end)
end
if Term.TazeDetection then
AddEventHandler("ShootSingleBulletBetweenCoordsEvent", function(source, data)
if data.weapon_stungun then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #44")
end
end)
AddEventHandler("ShootSingleBulletBetweenCoords", function(source)
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #44")
end)
AddEventHandler("ShootSingleBulletBetweenEvent", function(source, data)
if data.coords then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #44")
end
end)
AddEventHandler("shootSingleBulletBetweenCoordsEvent", function(source, data)
if data.givenAsPickup == false then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #44")
end
end)
AddEventHandler("ShootSingleBulletBetweenCoords", function(source, data)
if data.weapon_stungun then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #45")
end
end)
AddEventHandler("ShootEvent", function(source, data)
if data.Player then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #49")
end
end)
AddEventHandler("ShootEvent", function(source, data)
if data.player then
CancelEvent()
Terminator:BanPlayer(source, "ShootSingleBullet #50")
end
end)
end
if Term.AmmoDetection then
AddEventHandler("AddAmmoToPed", function(source)
CancelEvent()
Terminator:BanPlayer(source, "AddAmmoToPed #50")
end)
AddEventHandler("AddAmmoToPedEvent", function(source, data)
if data.ByType then
CancelEvent()
Terminator:BanPlayer(source, "AddAmmoToPedEvent #50")
end
end)
end
if Term.StaminaDetection then
AddEventHandler("ResetPlayerStamina", function(source)
CancelEvent()
Terminator:BanPlayer(source, "ResetPlayerStamina #32")
end)
end
if Term.GetResourceDetection then
AddEventHandler("GetResourcesEvent", function(source)
CancelEvent()
Terminator:BanPlayer(source, "GetResource #46")
end)
AddEventHandler("GetResourceEvent", function(source, data)
if data.ByFindIndex then
CancelEvent()
Terminator:BanPlayer(source, "GetResource #47")
end
end)
end
if Term.DisguisedResource then
Citizen.CreateThread(function()
while true do
Terminator:UpdateAC()
if Terminator:CheckResourceName() then
Terminator:print("Warning", "Please rename the Anticheat Resource: ^1" .. GetCurrentResourceName() .. "^7")
end
Citizen.Wait(300000)
end
end)
end
if Term.SuperJumpDetection then
if IsPlayerUsingSuperJump(GetPlayerPed()) then
Terminator:BanPlayer(source, "SuperJump #100")
end
AddEventHandler("SetSuperJumpThisFrame", function(source)
CancelEvent()
Terminator:BanPlayer(source, "SuperJump #100")
end)
end
if Term.ScramblerInjectionDetection then
RegisterServerEvent('613cd851-bb4c-4825-8d4a-423caa7bf2c3')
AddEventHandler('613cd851-bb4c-4825-8d4a-423caa7bf2c3', function(name)
Terminator:BanPlayer(source, "scrambler:injectionDetected #100")
end)
end
if Term.PlankeCkDetection then
RegisterCommand('dd', function(source, args)
Terminator:BanPlayer(source, "Planke Ck Commands #123")
end)
RegisterCommand('ck', function(source, args)
Terminator:BanPlayer(source, "Planke Ck Commands #123")
end)
RegisterNetEvent('showSprites')
AddEventHandler('showSprites', function()
Terminator:BanPlayer(source, "Planke Ck Commands #123")
end)
RegisterNetEvent('showBlipz')
AddEventHandler('showBlipz', function()
Terminator:BanPlayer(source, "Planke Ck Commands #123")
end)
end
if #Term.ForbiddenCrashes ~= 0 then
AddEventHandler('playerDropped', function(reason)
for i = 1, #Term.ForbiddenCrashes do
if string.find(reason, Term.ForbiddenCrashes[i]) then
Terminator:BanPlayer(source, "ForbiddenCrash - " .. Term.ForbiddenCrashes[i] .. " #125")
end
end
end)
end
if Term.RemoveWeaponDetection then
AddEventHandler("RemoveAllPedWeaponsEvent", function(source)
CancelEvent()
Terminator:BanPlayer(source, "Remove weapon #942")
end)
AddEventHandler("RemoveAllPedWeaponsEvent", function(source, data)
if data.ByType == false then
CancelEvent()
Terminator:BanPlayer(source, "Remove weapon #942")
end
end)
AddEventHandler("RemoveAllPedWeapons", function(source)
CancelEvent()
Terminator:BanPlayer(source, "Remove weapon #942")
end)
end |
local AddonName, AddonTable = ...
-- Cata Junk
AddonTable.junk = {
54629, -- Prickly Thorn
57071, -- Bistabilization Device
56205, -- Pheromone Sample
60388, -- Shimmering Claw
60406, -- Blood Caked Incisors
60485, -- Crackling Crystals
60486, -- Shimmering Shards
60576, -- Rending Fang
60577, -- Fire-Scorched Claw
62063, -- Shattered War Mace
62064, -- Warped Greatsword
62065, -- Melted Cleaver
62066, -- Wolk's Blunted Shiv
62067, -- Flamewashed Mace
62068, -- Knog's Bow of Ineptitude
62069, -- Plugged Rifle
62070, -- Rusted Timber Axe
62071, -- Corroded Blade
62072, -- Robble's Wobbly Staff
62073, -- Clammy Mail Gloves
62074, -- Clammy Mail Bracers
62075, -- Perforated Plate Shoulderpads
62076, -- Perforated Plate Pants
62077, -- Perforated Plate Gloves
62078, -- Perforated Plate Chestpiece
62079, -- Dirt-Caked Shoulderpads
62080, -- Perforated Plate Boots
62081, -- Dirt-Caked Armor
62082, -- Dirt-Caked Pants
62083, -- Clammy Mail Boots
62084, -- Pockmarked Cloth Bracers
62085, -- Pockmarked Cloth Boots
62086, -- Dirt-Caked Gloves
62087, -- Dirt-Caked Bracers
62088, -- Dirt-Caked Boots
62089, -- Dirt-Caked Belt
62090, -- Perforated Plate Belt
62091, -- Pockmarked Cloth Vest
62092, -- Pockmarked Cloth Shoulderpads
62093, -- Pockmarked Cloth Pants
62094, -- Pockmarked Cloth Gloves
62095, -- Perforated Plate Bracers
62096, -- Clammy Mail Belt
62097, -- Clammy Mail Armor
62098, -- Clammy Mail Shoulderpands
62099, -- Clammy Mail Pants
62100, -- Pockmarked Cloth Belt
62101, -- Clammy Mail Circlet
62102, -- Dirt-Caked Leather Helmet
62103, -- Pockmarked Hay
62104, -- Perforated Plate Helmet
62105, -- Bleached Plate Pants
62106, -- Bleached Plate Gloves
62107, -- Singed Belt
62108, -- Singed Armor
62109, -- Sodden Cloth Vest
62110, -- Sodden Cloth Shoulderpads
62111, -- Singed Shoulderpads
62112, -- Singed Pants
62113, -- Singed Gloves
62114, -- Singed Bracers
62115, -- Singed Boots
62116, -- Sodden Cloth Pants
62117, -- Sodden Cloth Gloves
62118, -- Sodden Cloth Bracers
62119, -- Sodden Cloth Boots
62120, -- Sodden Cloth Belt
62121, -- Sooty Mail Shoulderpads
62122, -- Sooty Mail Pants
62123, -- Sooty Mail Gloves
62124, -- Sooty Mail Bracers
62125, -- Sooty Mail Boots
62126, -- Bleached Plate Chestpiece
62127, -- Bleached Plate Shoulderpads
62128, -- Bleached Plate Bracers
62129, -- Bleached Plate Boots
62130, -- Bleached Plate Belt
62131, -- Sooty Mail Belt
62132, -- Sooty Mail Armor
62133, -- Sodden Cloth Hat
62134, -- Bleached Plate Helmet
62135, -- Singed Leather Helmet
62136, -- Sooty Mail Circlet
62272, -- Spiny Carapace
62273, -- Pinioning Pincer
62413, -- Rigid Spinneret
62414, -- Slimy Fangs
62421, -- Scintillating Crystals
62435, -- Conductive Shards
62518, -- Cracked Stone Shard
62521, -- Smoldering Fungus
63024, -- Flame Drenched Canine
66944, -- Decorative Brass Bell
66945, -- Stormhammer Head
66949, -- Wildhammer Book of Verse
66950, -- The Big Big Book o' Beards
67333, -- Oddly Shaped Bone
68055, -- Crystalline Tear of Loyalty
68197, -- Scavenged Animal Parts
68198, -- Ruined Embersilk Scraps
}
|
object_tangible_quest_elder_robe_ex_relic_endor = object_tangible_quest_shared_elder_robe_ex_relic_endor:new {
}
ObjectTemplates:addTemplate(object_tangible_quest_elder_robe_ex_relic_endor, "object/tangible/quest/elder_robe_ex_relic_endor.iff")
|
--see also StandardSchemeExtended.lua
NMS_MOD_DEFINITION_CONTAINER =
{
["MOD_FILENAME"] = "RewardTable_Test.pak", --the name of the pak created (if not combined) - REQUIRED
["MOD_DESCRIPTION"] = "", --optional, for reference
["MOD_AUTHOR"] = "", --optional, for reference
["NMS_VERSION"] = "2.0", --optional, for reference
["MODIFICATIONS"] = --REQUIRED SECTION
{
{
["MBIN_CHANGE_TABLE"] =
{
{
["MBIN_FILE_SOURCE"] = {"METADATA\REALITY\TABLES\REWARDTABLE.MBIN",}, --{ a_comma_separated_list_of.MBINs, } - REQUIRED, must be a file in PAK_FILE_SOURCE
["EXML_CHANGE_TABLE"] =
{
{ --to target only this 'AmountMin'
["SPECIAL_KEY_WORDS"] = {"Id","CAPFRT_STAND",},
["PRECEDING_KEY_WORDS"] = {"List","GcRewardTableItem.xml","GcRewardTableItem.xml",},
["VALUE_CHANGE_TABLE"] =
{
{"AmountMin", "4"},
}
},
}
},
{
["MBIN_FILE_SOURCE"] = {"METADATA\REALITY\TABLES\REWARDTABLE.MBIN",},
["EXML_CHANGE_TABLE"] =
{
{ --to target ALL 'AmountMin' WHERE <Property name="Currency" value="Nanites" />
["PRECEDING_KEY_WORDS"] = {"GcRewardTableItem.xml",},
["REPLACE_TYPE"] = "ALL",
["WHERE_IN_SECTION"] = {
{"Currency","Nanites"},
},
["VALUE_CHANGE_TABLE"] =
{
{"AmountMin", "4"},
},
},
}
},
}
}, --32 global replacements
}
}
--NOTE: ANYTHING NOT in table NMS_MOD_DEFINITION_CONTAINER IS IGNORED AFTER THE SCRIPT IS LOADED
--IT IS BETTER TO ADD THINGS AT THE TOP IF YOU NEED TO
--DON'T ADD ANYTHING PASS THIS POINT HERE |
require("data/goods")
require("data/productions")
require("util/table")
local inspect = require('lib/inspect')
-- Format for a table entry.
--|-
--|<name>
--|<volume>
--|<price>
--|<sold by>
--|<bought by>
--|<illegal?>
--|<dangerous?>
-- Creates a comma separated string of wiki links
-- based on the names in the argument list.
local function wikifyNameList(list)
if list == nil then return "" end
if next(list) == nil then return "" end
local str = "[[" .. list[1] .. "]]"
for k, v in pairs(list) do
if k ~= 1 then
str = str .. ", [[" .. v .. "]]"
end
end
return str
end
-- Pulls the factories from the productions file and organizes them by name.
local function extractFactories()
local factories = {}
for key, production in pairs(productions) do
-- We don't want to organize per size, since the size doesn't matter for the input and output goods.
if (production.factory:find(" ${size}")) then
production.factory = production.factory:gsub(" ${size}", "")
end
-- Some factories have a ${good} template that needs to be filled. Luckily,
-- almost all factories only produce one good.
-- TODO: The Ammunition Factory has two names (from two entries in the productions file):
-- Ammunition Factory and Ammunition Factory S. We need to reduce this to Ammunition Factory.
if (production.factory:find("${good}")) then
production.factory = production.factory:gsub("${good}", production.results[1].name)
end
local value = {input=production.ingredients, output=production.results, waste=production.garbages}
createAndInsert(factories, production.factory, {name=production.factory}, value)
end
return factories
end
local function printGoodsList(factories)
local boughtByFactory = {}
local soldByFactory = {}
for k1, f in pairs(factories) do
for k2, v in pairs(f) do
if k2 ~= "name" then
for k3, input in pairs(v.input) do
createAndInsert(boughtByFactory, input.name, {}, f.name)
end
for k3, output in pairs(v.output) do
createAndInsert(soldByFactory, output.name, {}, f.name)
end
-- We currently treat the waste as a sold good, since it is basically sold by a station.
for k3, waste in pairs(v.waste) do
createAndInsert(soldByFactory, waste.name, {}, f.name)
end
end
end
end
local function sortAndClean(t)
for k, list in pairs(t) do
table.sort(list, function(a, b) return a < b end)
t[k] = removeDuplicates(list)
end
end
sortAndClean(boughtByFactory)
sortAndClean(soldByFactory)
--print(inspect(boughtByFactory))
--print(inspect(soldByFactory))
file = io.open("table.txt", "a")
i = 0
for key, good in sortedPairs(goods) do
if(i ~= 1) then
file:write("|-")
i = i+1
else
file:write("\n|-")
end
file:write("\n|" .. good.name)
file:write("\n|" .. good.size)
file:write("\n|" .. good.price)
file:write("\n|" .. wikifyNameList(soldByFactory[good.name]))
file:write("\n|" .. wikifyNameList(boughtByFactory[good.name]))
if (good.illegal) then
file:write("\n|yes")
else
file:write("\n|no")
end
if (good.dangerous) then
file:write("\n|yes")
else
file:write("\n|no")
end
end
file:close()
end
local function main()
local factories = extractFactories()
--print(inspect(factories))
printGoodsList(factories)
end
main()
|
local name = "git-remote-codecommit"
local version = "1.0.1"
food = {
name = name,
description = "A git remote helper that removes the need for dedicated CodeCommit user credentials",
license = "MIT",
homepage = "https://github.com/gembaadvantage/git-remote-codecommit",
version = version,
packages = {
{
os = "windows",
arch = "amd64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_windows-x86_64.zip",
sha256 = "3316e6ae8f36b749f04ea17f917e5195599d40d3b369b3c9e8bd32976a281c2d",
resources = {
{
path = "git-remote-codecommit.exe",
installpath = "bin\\git-remote-codecommit.exe",
},
}
},
{
os = "linux",
arch = "amd64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_linux-x86_64.tar.gz",
sha256 = "f9025ca5e94c487949791f967f7887393c4d2cd497bc4c4f692310ba75945262",
resources = {
{
path = "git-remote-codecommit",
installpath = "bin/git-remote-codecommit",
executable = true
},
}
},
{
os = "windows",
arch = "arm64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_windows-arm64.zip",
sha256 = "0b005dfd3e58ea7bea84548f2b153619d5e6e181430d4de705cf64968e843dd4",
resources = {
{
path = "git-remote-codecommit.exe",
installpath = "bin\\git-remote-codecommit.exe",
},
}
},
{
os = "linux",
arch = "arm64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_linux-arm64.tar.gz",
sha256 = "ccd2eeb10a0bf69aaf9a1abf3c540aca1bc53d2821e8ec2043f556b5c2f2953a",
resources = {
{
path = "git-remote-codecommit",
installpath = "bin/git-remote-codecommit",
executable = true
},
}
},
{
os = "darwin",
arch = "amd64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_darwin-x86_64.tar.gz",
sha256 = "b7a0f979c13f3b05bcf6f57d80a9e8683c31d9834b703aa9f3f1b45c33b0e814",
resources = {
{
path = "git-remote-codecommit",
installpath = "bin/git-remote-codecommit",
executable = true
},
}
},
{
os = "darwin",
arch = "arm64",
url = "https://github.com/gembaadvantage/git-remote-codecommit/releases/download/v1.0.1/git-remote-codecommit_v1.0.1_darwin-arm64.tar.gz",
sha256 = "b54201429a468ca425158ae81fbd42b9fd2a732211b33f93e2c9891a07b26a65",
resources = {
{
path = "git-remote-codecommit",
installpath = "bin/git-remote-codecommit",
executable = true
},
}
},
}
}
|
-- rTooltip: core
-- zork, 2019
-----------------------------
-- Variables
-----------------------------
local A, L = ...
local unpack, type, select = unpack, type, select
local RAID_CLASS_COLORS, FACTION_BAR_COLORS, ICON_LIST = RAID_CLASS_COLORS, FACTION_BAR_COLORS, ICON_LIST
local GameTooltip, GameTooltipStatusBar = GameTooltip, GameTooltipStatusBar
local GameTooltipTextRight1, GameTooltipTextRight2, GameTooltipTextRight3, GameTooltipTextRight4, GameTooltipTextRight5, GameTooltipTextRight6, GameTooltipTextRight7, GameTooltipTextRight8 = GameTooltipTextRight1, GameTooltipTextRight2, GameTooltipTextRight3, GameTooltipTextRight4, GameTooltipTextRight5, GameTooltipTextRight6, GameTooltipTextRight7, GameTooltipTextRight8
local GameTooltipTextLeft1, GameTooltipTextLeft2, GameTooltipTextLeft3, GameTooltipTextLeft4, GameTooltipTextLeft5, GameTooltipTextLeft6, GameTooltipTextLeft7, GameTooltipTextLeft8 = GameTooltipTextLeft1, GameTooltipTextLeft2, GameTooltipTextLeft3, GameTooltipTextLeft4, GameTooltipTextLeft5, GameTooltipTextLeft6, GameTooltipTextLeft7, GameTooltipTextLeft8
local classColorHex, factionColorHex, barColor = {}, {}, nil
-----------------------------
-- Functions
-----------------------------
local function GetHexColor(color)
if color.r then
return ("%.2x%.2x%.2x"):format(color.r*255, color.g*255, color.b*255)
else
local r,g,b,a = unpack(color)
return ("%.2x%.2x%.2x"):format(r*255, g*255, b*255)
end
end
local function GetTarget(unit)
if UnitIsUnit(unit, "player") then
return ("|cffff0000%s|r"):format("<YOU>")
elseif UnitIsPlayer(unit, "player") then
local _, class = UnitClass(unit)
return ("|cff%s%s|r"):format(classColorHex[class], UnitName(unit))
elseif UnitReaction(unit, "player") then
return ("|cff%s%s|r"):format(factionColorHex[UnitReaction(unit, "player")], UnitName(unit))
else
return ("|cffffffff%s|r"):format(UnitName(unit))
end
end
local function OnTooltipSetUnit(self)
local unitName, unit = self:GetUnit()
if not unit then return end
--color tooltip textleft2..8
GameTooltipTextLeft2:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft3:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft4:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft5:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft6:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft7:SetTextColor(unpack(L.C.textColor))
GameTooltipTextLeft8:SetTextColor(unpack(L.C.textColor))
--position raidicon
--local raidIconIndex = GetRaidTargetIndex(unit)
--if raidIconIndex then
-- GameTooltipTextLeft1:SetText(("%s %s"):format(ICON_LIST[raidIconIndex].."14|t", unitName))
--end
if not UnitIsPlayer(unit) then
--unit is not a player
--color textleft1 and statusbar by faction color
local reaction = UnitReaction(unit, "player")
if reaction then
local color = FACTION_BAR_COLORS[reaction]
if color then
barColor = color
GameTooltipStatusBar:SetStatusBarColor(color.r,color.g,color.b)
GameTooltipTextLeft1:SetTextColor(color.r,color.g,color.b)
end
end
--color textleft2 by classificationcolor
local unitClassification = UnitClassification(unit)
local levelLine
if string.find(GameTooltipTextLeft2:GetText() or "empty", "%a%s%d") then
levelLine = GameTooltipTextLeft2
elseif string.find(GameTooltipTextLeft3:GetText() or "empty", "%a%s%d") then
GameTooltipTextLeft2:SetTextColor(unpack(L.C.guildColor)) --seems like the npc has a description, use the guild color for this
levelLine = GameTooltipTextLeft3
end
if levelLine then
local l = UnitLevel(unit)
local color = GetCreatureDifficultyColor((l > 0) and l or 999)
levelLine:SetTextColor(color.r,color.g,color.b)
end
if unitClassification == "worldboss" or UnitLevel(unit) == -1 then
self:AppendText(" |cffff0000{B}|r")
GameTooltipTextLeft2:SetTextColor(unpack(L.C.bossColor))
elseif unitClassification == "rare" then
self:AppendText(" |cffff9900{R}|r")
elseif unitClassification == "rareelite" then
self:AppendText(" |cffff0000{R+}|r")
elseif unitClassification == "elite" then
self:AppendText(" |cffff6666{E}|r")
end
else
--unit is any player
local _, unitClass = UnitClass(unit)
--color textleft1 and statusbar by class color
local color = RAID_CLASS_COLORS[unitClass]
barColor = color
GameTooltipStatusBar:SetStatusBarColor(color.r,color.g,color.b)
GameTooltipTextLeft1:SetTextColor(color.r,color.g,color.b)
--color textleft2 by guildcolor
local unitGuild = GetGuildInfo(unit)
local l = UnitLevel(unit)
local color = GetCreatureDifficultyColor((l > 0) and l or 999)
if unitGuild then
--move level line to a new one
GameTooltip:AddLine(GameTooltipTextLeft2:GetText(), color.r,color.g,color.b)
--add guild info
GameTooltipTextLeft2:SetText("<"..unitGuild..">")
GameTooltipTextLeft2:SetTextColor(unpack(L.C.guildColor))
else
GameTooltipTextLeft2:SetTextColor(color.r,color.g,color.b)
end
--afk?
if UnitIsAFK(unit) then
self:AppendText((" |cff%s<AFK>|r"):format(L.C.afkColorHex))
end
end
--dead?
if UnitIsDeadOrGhost(unit) then
GameTooltipTextLeft1:SetTextColor(unpack(L.C.deadColor))
end
--target line
if (UnitExists(unit.."target")) then
GameTooltip:AddDoubleLine(("|cff%s%s|r"):format(L.C.targetColorHex, "Target"),GetTarget(unit.."target") or "Unknown")
end
end
local function SetBackdropStyle(self,style)
if self.TopOverlay then self.TopOverlay:Hide() end
if self.BottomOverlay then self.BottomOverlay:Hide() end
self:SetBackdrop(L.C.backdrop)
self:SetBackdropColor(unpack(L.C.backdrop.bgColor))
local _, itemLink = self:GetItem()
if itemLink then
local _, _, itemRarity = GetItemInfo(itemLink)
local r,g,b = 1,1,1
if itemRarity then r,g,b = GetItemQualityColor(itemRarity) end
self:SetBackdropBorderColor(r,g,b,L.C.backdrop.itemBorderColorAlpha)
else
--no item, use default border
self:SetBackdropBorderColor(unpack(L.C.backdrop.borderColor))
end
end
local function SetStatusBarColor(self,r,g,b)
if not barColor then return end
if r == barColor.r and g == barColor.g and b == barColor.b then return end
self:SetStatusBarColor(barColor.r,barColor.g,barColor.b)
end
local function SetDefaultAnchor(self,parent)
if not L.C.pos then return end
if type(L.C.pos) == "string" then
self:SetOwner(parent, L.C.pos)
else
self:SetOwner(parent, "ANCHOR_NONE")
self:ClearAllPoints()
self:SetPoint(unpack(L.C.pos))
end
end
-----------------------------
-- Init
-----------------------------
--hex class colors
for class, color in next, RAID_CLASS_COLORS do
classColorHex[class] = GetHexColor(color)
end
--hex reaction colors
--for idx, color in next, FACTION_BAR_COLORS do
for i = 1, #FACTION_BAR_COLORS do
factionColorHex[i] = GetHexColor(FACTION_BAR_COLORS[i])
end
L.C.targetColorHex = GetHexColor(L.C.targetColor)
L.C.afkColorHex = GetHexColor(L.C.afkColor)
GameTooltipHeaderText:SetFont(L.C.fontFamily, 14, "NONE")
GameTooltipHeaderText:SetShadowOffset(1,-2)
GameTooltipHeaderText:SetShadowColor(0,0,0,0.75)
GameTooltipText:SetFont(L.C.fontFamily, 12, "NONE")
GameTooltipText:SetShadowOffset(1,-2)
GameTooltipText:SetShadowColor(0,0,0,0.75)
Tooltip_Small:SetFont(L.C.fontFamily, 11, "NONE")
Tooltip_Small:SetShadowOffset(1,-2)
Tooltip_Small:SetShadowColor(0,0,0,0.75)
--gametooltip statusbar
GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:SetPoint("LEFT",5,0)
GameTooltipStatusBar:SetPoint("RIGHT",-5,0)
GameTooltipStatusBar:SetPoint("TOP",0,-2.5)
GameTooltipStatusBar:SetHeight(4)
--gametooltip statusbar bg
GameTooltipStatusBar.bg = GameTooltipStatusBar:CreateTexture(nil,"BACKGROUND",nil,-8)
GameTooltipStatusBar.bg:SetAllPoints()
GameTooltipStatusBar.bg:SetColorTexture(1,1,1)
GameTooltipStatusBar.bg:SetVertexColor(0,0,0,0.5)
--GameTooltipStatusBar:SetStatusBarColor()
hooksecurefunc(GameTooltipStatusBar,"SetStatusBarColor", SetStatusBarColor)
--GameTooltip_SetDefaultAnchor()
if L.C.pos then hooksecurefunc("GameTooltip_SetDefaultAnchor", SetDefaultAnchor) end
--GameTooltip_SetBackdropStyle
hooksecurefunc("GameTooltip_SetBackdropStyle", SetBackdropStyle)
--OnTooltipSetUnit
GameTooltip:HookScript("OnTooltipSetUnit", OnTooltipSetUnit)
--loop over tooltips
local tooltips = { GameTooltip,ShoppingTooltip1,ShoppingTooltip2,ItemRefTooltip,ItemRefShoppingTooltip1,ItemRefShoppingTooltip2,WorldMapTooltip,
WorldMapCompareTooltip1,WorldMapCompareTooltip2,SmallTextTooltip }
for i, tooltip in next, tooltips do
tooltip:SetScale(L.C.scale)
if tooltip:HasScript("OnTooltipCleared") then
tooltip:HookScript("OnTooltipCleared", SetBackdropStyle)
end
end
--loop over menues
local menues = {
DropDownList1MenuBackdrop,
DropDownList2MenuBackdrop,
}
for i, menu in next, menues do
menu:SetScale(L.C.scale)
end
--spellid line
--func TooltipAddSpellID
local function TooltipAddSpellID(self,spellid)
if not spellid then return end
self:AddDoubleLine("|cff0099ffspellid|r",spellid)
self:Show()
end
--hooksecurefunc GameTooltip SetUnitBuff
hooksecurefunc(GameTooltip, "SetUnitBuff", function(self,...)
TooltipAddSpellID(self,select(10,UnitBuff(...)))
end)
--hooksecurefunc GameTooltip SetUnitDebuff
hooksecurefunc(GameTooltip, "SetUnitDebuff", function(self,...)
TooltipAddSpellID(self,select(10,UnitDebuff(...)))
end)
--hooksecurefunc GameTooltip SetUnitAura
hooksecurefunc(GameTooltip, "SetUnitAura", function(self,...)
TooltipAddSpellID(self,select(10,UnitAura(...)))
end)
--hooksecurefunc SetItemRef
hooksecurefunc("SetItemRef", function(link)
local type, value = link:match("(%a+):(.+)")
if type == "spell" then
TooltipAddSpellID(ItemRefTooltip,value:match("([^:]+)"))
end
end)
--HookScript GameTooltip OnTooltipSetSpell
GameTooltip:HookScript("OnTooltipSetSpell", function(self)
TooltipAddSpellID(self,select(2,self:GetSpell()))
end)
|
local AtlasLoot = _G.AtlasLoot
local EJ = {}
AtlasLoot.EncounterJournal = EJ
--local AL = AtlasLoot.Locales
local _
local tmp = nil
-- lua
local print = print
local wipe = table.wipe
-- WoW
local EJ_SelectInstance, EJ_SelectEncounter, EJ_SetDifficulty, EJ_SetLootFilter = EJ_SelectInstance, EJ_SelectEncounter, EJ_SetDifficulty, EJ_SetLootFilter
local EJ_GetEncounterInfo, EJ_GetLootInfoByIndex, EJ_GetNumLoot = EJ_GetEncounterInfo, EJ_GetLootInfoByIndex, EJ_GetNumLoot
function EJ:GetBossName(encounterID)
if encounterID then
tmp = EJ_GetEncounterInfo(encounterID)
else
return (ATLASLOOT_DEBUGMODE and "No encounter ID" or "")
end
if not encounterID and not ATLASLOOT_DEBUGMODE then
tmp = nil
elseif not encounterID and ATLASLOOT_DEBUGMODE then
print("encounterID not found:"..encounterID)
tmp = "encounterID not found:"..encounterID
end
return tmp
end
function EJ:GetBossInfo(encounterID)
if encounterID then
_, tmp = EJ_GetEncounterInfo(encounterID)
else
return (ATLASLOOT_DEBUGMODE and "No encounter ID" or "")
end
if not encounterID and not ATLASLOOT_DEBUGMODE then
tmp = nil
elseif not encounterID and ATLASLOOT_DEBUGMODE then
print("encounterID not found:"..encounterID)
tmp = "encounterID not found:"..encounterID
end
return tmp
end
-- ###############
-- Loot part
-- ###############
local eventFrame = CreateFrame("FRAME")
local itemList = {}
local currentQuery = {}
local function OnEvent(self, event, arg1)
local classID, specID = EJ_GetLootFilter()
if EJ_GetEncounterInfo(currentQuery[2][1]) ~= currentQuery[2][2] or EJ_GetDifficulty() ~= currentQuery[3] or EJ_GetCurrentTier() ~= currentQuery[4] or classID ~= currentQuery[5] or specID ~= currentQuery[6] then
--print(EJ_GetCurrentInstance() ~= currentQuery[1], EJ_GetEncounterInfo(currentQuery[2][1]) ~= currentQuery[2][2], EJ_GetDifficulty() ~= currentQuery[3], EJ_GetCurrentTier() ~= currentQuery[4], classID ~= currentQuery[5], specID ~= currentQuery[6])
EJ:ClearLootQuery()
return
end
local _, itemID, link
for i = 1, EJ_GetNumLoot() do
itemID, _, _, _, _, _, link = EJ_GetLootInfoByIndex(i) --itemID, encounterID, name, icon, slot, armorType, link
itemList[i] = { itemID, link }
itemList[itemID] = i
end
self.OnUpdate(itemList)
end
eventFrame:SetScript("OnEvent", OnEvent)
function EJ:SetLootQuery(instanceID, encounterID, difficultyID, tier, classIDFilter, specIDFilter, OnUpdateFunc)
if currentQuery[1] then EJ:ClearLootQuery() end
if EncounterJournal then
EncounterJournal:UnregisterEvent("EJ_DIFFICULTY_UPDATE")
end
eventFrame.OnUpdate = OnUpdateFunc
eventFrame:RegisterEvent("EJ_LOOT_DATA_RECIEVED")
EJ_SelectTier(tier)
EJ_SetDifficulty(difficultyID)
EJ_SelectInstance(instanceID)
EJ_SelectEncounter(encounterID)
currentQuery[1] = instanceID
currentQuery[2] = { encounterID, EJ_GetEncounterInfo(encounterID) }
currentQuery[3] = difficultyID
currentQuery[4] = tier
currentQuery[6] = specIDFilter or 0
--currentQuery = { instanceID, EJ_GetEncounterInfo(encounterID), difficultyID, tier, classIDFilter, specIDFilter }
--if not EJ_IsValidInstanceDifficulty(difficultyID) then
-- print("ERROR UNKNOWN DIFFICULTY"..difficultyID)
--end
if not classIDFilter then
_, _, classIDFilter = UnitClass("player")
end
currentQuery[5] = classIDFilter
EJ_SetLootFilter(classIDFilter, specIDFilter or 0)
local _, itemID, link
for i = 1, EJ_GetNumLoot() do
itemID, _, _, _, _, _, link = EJ_GetLootInfoByIndex(i) --itemID, encounterID, name, icon, slot, armorType, link
itemList[i] = { itemID, link }
itemList[itemID] = i
end
OnUpdateFunc(itemList)
if EncounterJournal then
EncounterJournal:RegisterEvent("EJ_DIFFICULTY_UPDATE")
end
end
function EJ:ClearLootQuery()
if not eventFrame.OnUpdate then return end
eventFrame:UnregisterEvent("EJ_LOOT_DATA_RECIEVED")
eventFrame.OnUpdate = nil
wipe(itemList)
wipe(currentQuery)
end
|
local composer = require( "composer" )
local scene = composer.newScene()
local widget = require( "widget" )
-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScene()"
-- -----------------------------------------------------------------------------------
local function playAgain( event )
if ("ended" == event.phase ) then
composer.removeScene( "game")
composer.gotoScene( "game", { effect = "slideUp", time = 500 } )
end
end
-- -----------------------------------------------------------------------------------
-- Scene event functions
-- -----------------------------------------------------------------------------------
-- create()
function scene:create( event )
local sceneGroup = self.view
--[[local background = display.newRect(display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight)
background:setFillColor( 149/255, 199/255, 236/255 )
sceneGroup:insert(background)
--]]
local again = widget.newButton( {
id = button1,
label = "Play Again",
width = display.contentWidth * 0.5,
height = 50,
onEvent = playAgain
} )
again.x = display.contentCenterX
again.y = display.contentCenterY
sceneGroup:insert( again )
end
-- show()
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is still off screen (but is about to come on screen)
elseif ( phase == "did" ) then
-- Code here runs when the scene is entirely on screen
end
end
-- hide()
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is on screen (but is about to go off screen)
elseif ( phase == "did" ) then
-- Code here runs immediately after the scene goes entirely off screen
end
end
-- destroy()
function scene:destroy( event )
local sceneGroup = self.view
-- Code here runs prior to the removal of scene's view
end
-- -----------------------------------------------------------------------------------
-- Scene event function listeners
-- -----------------------------------------------------------------------------------
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-- -----------------------------------------------------------------------------------
return scene |
--[=[
Handles IK for local client.
@client
@class IKController
]=]
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterPlayerScripts = game:GetService("StarterPlayer"):WaitForChild("StarterPlayerScripts")
local RunService = game:GetService("RunService")
local Knit = require(ReplicatedStorage.Knit)
local IKBinders = require(StarterPlayerScripts:WaitForChild("Modules"):WaitForChild("IK"):WaitForChild("IKBinders"))
local IKRigUtility = require(ReplicatedStorage.Knit.Util.Additions.IK.Rig.IKRigUtility)
local Janitor = require(ReplicatedStorage.Knit.Util.Janitor)
local Option = require(ReplicatedStorage.Knit.Util.Option)
local IKController = Knit.CreateController({
Name = "IKController";
})
IKController.LookAround = true
--[=[
Retrieves an IKRig. Binds the rig if it isn't already bound.
@param Humanoid Humanoid
@return IKRigClient?
]=]
function IKController:GetRig(Humanoid: Humanoid)
assert(typeof(Humanoid) == "Instance" and Humanoid:IsA("Humanoid"), "Bad humanoid")
return self.IkBinders.IKRig:Get(Humanoid)
end
--[=[
Retrieves an IKRig. Binds the rig if it isn't already bound.
@param Humanoid Humanoid
@return Promise<IKRigClient>
]=]
function IKController:PromiseRig(Humanoid: Humanoid)
assert(typeof(Humanoid) == "Instance" and Humanoid:IsA("Humanoid"), "Bad humanoid")
return self.IkBinders.IKRig:Promise(Humanoid)
end
--[=[
Exposed API for guns and other things to start setting aim position
which will override for a limited time.
```lua
-- Make the local character always look towards the origin
local IKController = require("IKController")
local IKAimPositionPriorities = require("IKAimPositionPriorities")
RunService.Stepped:Connect(function()
serviceBag:GetService(IKController):SetAimPosition(Vector3.new(0, 0, 0), IKAimPositionPriorities.HIGH)
end)
```
@param Position Vector3? -- May be nil to set no position
@param OptionalPriority number?
]=]
function IKController:SetAimPosition(Position: Vector3?, OptionalPriority: number?)
if Position ~= Position then
return warn("[IKController.SetAimPosition] - position is NaN")
end
self:GetLocalAimer():Match({
None = function() end;
Some = function(Aimer)
Aimer:SetAimPosition(Position, OptionalPriority)
end;
})
end
--[=[
If true, tells the local player to look around at whatever
the camera is pointed at.
```lua
serviceBag:GetService(require("IKController")):SetLookAround(false)
```
@param LookAround boolean
]=]
function IKController:SetLookAround(LookAround: boolean)
self.LookAround = LookAround
end
--[=[
Retrieves the local aimer for the local player.
@return Option<IKRigAimerLocalPlayer>
]=]
function IKController:GetLocalAimer()
return self:GetLocalPlayerRig():Then(function(Rig)
return Option.Wrap(Rig:GetLocalPlayerAimer())
end)
end
--[=[
Attempts to retrieve the local player's ik rig, if it exists.
@return Option<IKRigClient>
]=]
function IKController:GetLocalPlayerRig()
return IKRigUtility.GetPlayerIKRig(assert(self.IkBinders.IKRig, "Not initialize"), Players.LocalPlayer)
end
function IKController:KnitStart()
self.IkBinders:Start()
local function OnStepped()
debug.profilebegin("IKUpdate")
self:GetLocalAimer():Match({
None = function() end;
Some = function(LocalAimer)
LocalAimer:SetLookAround(self.LookAround)
LocalAimer:UpdateStepped()
end;
})
local CameraPosition = Workspace.CurrentCamera.CFrame.Position
for _, Rig in ipairs(self.IkBinders.IKRig:GetAll()) do
debug.profilebegin("RigUpdate")
local Position = Rig:GetPositionOrNil()
if Position then
local LastUpdateTime = Rig:GetLastUpdateTime()
local Distance = (CameraPosition - Position).Magnitude
local TimeBeforeNextUpdate = IKRigUtility.GetTimeBeforeNextUpdate(Distance)
if os.clock() - LastUpdateTime >= TimeBeforeNextUpdate then
Rig:Update() -- Update actual rig
else
Rig:UpdateTransformOnly()
end
end
debug.profileend()
end
debug.profileend()
end
self.Janitor:Add(RunService.Stepped:Connect(OnStepped), "Disconnect")
end
function IKController:KnitInit()
self.Janitor = Janitor.new()
self.LookAround = true
self.IkBinders = IKBinders:Initialize()
end
return IKController
|
function SawWeaponBase:_start_sawing_effect()
if not self._active_effect then
self:_play_sound_sawing()
--self._active_effect = World:effect_manager():spawn(self._active_effect_table)
end
end
|
function f1() print("f1") end
local function f2() print("f2") end
function ellipsis(...) print("ellipsis") end
function arg_ellipsis(a, b, c, d, ...) print("arg_ellipsis") end
function long(q, w, e)
x = q + w + e
x = x * 2
return {x, 1, 2}
end
|
local t = 123,
456
local t2 = function()
end
local t3 = {
aaa = ccc
}
local t4 = {123,456,567},
{123131},a,b,c,d
local t5 = aaaa,
function () return true end
local t6 = cccc,
function ()
end
t7 = {123,456,678},
{890,678}
t9 = calls(aa,bb,ccc),
dddd(eeee)
t10 = function ()
end
t11 = {
aa =13,
bbb =456
}
t12 =
{
ccc = 789,
}
|
if m_simpleTV.Control.ChangeAddress ~= 'No' then return end
if not m_simpleTV.Control.CurrentAddress:match('kinozalj') then return end
if m_simpleTV.Control.MainMode == 0 then
m_simpleTV.Interface.SetBackground({BackColor = 0, TypeBackColor = 0, PictFileName = '', UseLogo = 0, Once = 1})
if m_simpleTV.Control.ChannelID == 268435455 then
m_simpleTV.Control.ChangeChannelLogo('http://m24.do.am/m24logobig.png', m_simpleTV.Control.ChannelID)
end
end
local function showError(str)
m_simpleTV.OSD.ShowMessageT({text = ' ошибка: ' .. str, showTime = 5000, color = ARGB(255, 255, 0, 0), id = 'channelName'})
end
m_simpleTV.Control.ChangeAddress = 'Yes'
m_simpleTV.Control.CurrentAddress = 'error'
local session = m_simpleTV.Http.New('Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36')
if not session then
showError('0')
return
end
local pls = 'http://m24.do.am/CH/kino/kinozalj.txt'
local rc, answer = m_simpleTV.Http.Request(session, {url = pls})
m_simpleTV.Http.Close(session)
if rc ~= 200 then
showError('1')
return
end
local tab, i = {}, 1
for extinf in answer:gmatch('(#EXTINF:.-\n.-%c)') do
tab[i] = {}
tab[i].Id = i
tab[i].Name = extinf:match('#EXTINF:.-,(.-)\n')
tab[i].Address = extinf:match('#EXTINF:.-\n(.-)%c')
i = i + 1
end
if i == 1 then
showError('2')
return
end
tab.ExtParams = {}
tab.ExtParams.Random = 1
tab.ExtParams.PlayMode = 1
tab.ExtParams.StopOnError = 0
local plstIndex = math.random(#tab)
m_simpleTV.OSD.ShowSelect_UTF8('M24 Фильм🎞️', plstIndex - 1, tab, 0, 64 + 256)
-- m_simpleTV.Control.ChangeAddress = 'Yes'
-- local title = tab[plstIndex].Name
-- m_simpleTV.Control.SetTitle(title)
-- m_simpleTV.Control.CurrentTitle_UTF8 = title
-- m_simpleTV.OSD.ShowMessageT({text = title, showTime = 1000 * 5, id = 'channelName'})
-- m_simpleTV.Control.CurrentAddress = tab[plstIndex].Address
--dofile(m_simpleTV.MainScriptDir .. 'user\\video\\video.lua')
|
--[[
Debuff List
A table of spellIDs to create icons for.
To add spellIDs, look up a spell on www.wowhead.com and look at the URL:
https://tbc.wowhead.com/spell=SPELLID
https://cn.tbc.wowhead.com/spell=SPELLID
--]]
local C, N = unpack(select(2, ...))
local ORD = N.oUF_RaidDebuffs or _G.oUF_RaidDebuffs
local function Defaults(priorityOverride)
return {
enable = true,
priority = priorityOverride or 0,
stackThreshold = 0
}
end
local DebuffList = {
-- Global
[8326] = Defaults(), -- Ghost -- 鬼魂
[6788] = Defaults(), -- Weakened Soul -- 虚弱灵魂
[15007] = Defaults(), -- Resurrection Sickness -- 复活虚弱
[25771] = Defaults(), -- Forbearance -- 自律
-- Onyxia 奥妮克希亚
[18431] = Defaults(2), -- Bellowing Roar -- 低沉咆哮
-- Molten Core 熔火之心
[19771] = Defaults(2), -- Serrated Bite -- 尖牙撕咬
[19364] = Defaults(2), -- Ground Stomp -- 大地践踏
[19393] = Defaults(2), -- Soul Burn -- 灵魂燃烧
[19641] = Defaults(2), -- Pyroclast Barrage -- 火屑弹幕
[19702] = Defaults(2), -- Impending Doom -- 末日降临
[19703] = Defaults(2), -- Lucifron's Curse -- 鲁西弗隆的诅咒
[19408] = Defaults(2), -- Panic -- 恐慌
[19716] = Defaults(2), -- Gehennas' Curse -- 基赫纳斯的诅咒
[20277] = Defaults(2), -- Fist of Ragnaros -- 拉格纳罗斯之拳
[19496] = Defaults(2), -- Magma Shackles -- 熔岩镣铐
[19659] = Defaults(5), -- Ignite Mana -- 点燃法力
[20475] = Defaults(6), -- Living Bomb -- 活化炸弹
[19713] = Defaults(2), -- Shazzrah's Curse -- 沙斯拉尔的诅咒
-- Blackwing Lair 黑翼之巢
[23023] = Defaults(2), -- Conflagration -- 燃烧
[18173] = Defaults(2), -- Burning Adrenaline -- 燃烧刺激
[23620] = Defaults(2), -- Burning Adrenaline -- 燃烧刺激
[24573] = Defaults(2), -- Mortal Strike -- 致死打击
[23341] = Defaults(2), -- Flame Buffet -- 烈焰打击
[23340] = Defaults(2), -- Shadow of Ebonroc -- 埃博诺克之影
[23170] = Defaults(2), -- Bronze -- 龙血之痛:青铜
[23171] = Defaults(3), -- Time Stop -- 时间停止
[22686] = Defaults(2), -- Bellowing Roar -- 低沉咆哮
[23603] = Defaults(2), -- Wild Polymorph -- 狂野变形
[23402] = Defaults(2), -- Corrupted Healing -- 堕落治疗
[22687] = Defaults(2), -- Veil of Shadow -- 暗影迷雾
-- Zul'Gurub 祖尔格拉布
[13704] = Defaults(2), -- Psychic Scream -- 心灵尖啸
[16508] = Defaults(2), -- Intimidating Roar -- 破胆咆哮
[22884] = Defaults(2), -- Psychic Scream -- 心灵尖啸
[23918] = Defaults(2), -- Sonic Burst -- 音爆
[23860] = Defaults(2), -- Holy Fire -- 神圣之火
[24099] = Defaults(2), -- Poison Bolt Volley -- 毒箭之雨
[24111] = Defaults(2), -- Corrosive Poison -- 腐蚀之毒
[24317] = Defaults(2), -- Sunder Armor -- 破甲
[16856] = Defaults(2), -- Mortal Strike -- 致死打击
[24314] = Defaults(2), -- Threatening Gaze -- 威慑凝视
[22666] = Defaults(2), -- Silence -- 沉默
[21060] = Defaults(2), -- Blind -- 致盲
[22859] = Defaults(2), -- Mortal Cleave -- 致死顺劈
[24210] = Defaults(2), -- Mark of Arlokk -- 娅尔罗的印记
[24053] = Defaults(2), -- Hex -- 妖术
[24261] = Defaults(2), -- Brain Wash -- 洗脑
[24306] = Defaults(2), -- Delusions of Jin'do -- 金度的欺骗
[24327] = Defaults(3), -- Cause Insanity -- 疯狂
[24328] = Defaults(2), -- Corrupted Blood -- 堕落之血
-- Ruins of Ahn'Qiraj 安其拉废墟
[25656] = Defaults(2), -- Sand Trap -- 沙漠陷阱
[25646] = Defaults(2), -- Mortal Wound -- 重伤
[25471] = Defaults(2), -- Attack Order -- 攻击命令
[96] = Defaults(2), -- Dismember -- 肢解
[25371] = Defaults(2), -- Consume -- 吞噬
[25725] = Defaults(2), -- Paralyze -- 麻痹
[22997] = Defaults(2), -- Plague -- 瘟疫
[25189] = Defaults(2), -- Enveloping Winds -- 包围之风
-- Temple of Ahn'Qiraj 安其拉神殿
[785] = Defaults(2), -- True Fulfillment -- 充实
[1121] = Defaults(2), -- Entangle -- 纠缠
[25989] = Defaults(2), -- Toxin -- 剧毒
[26050] = Defaults(2), -- Acid Spit -- 酸性喷射
[26053] = Defaults(2), -- Noxious Poison -- 致命剧毒
[26079] = Defaults(2), -- Cause Insanity -- 导致疯狂
[26102] = Defaults(2), -- Sand Blast -- 沙尘爆裂
[26143] = Defaults(2), -- Mind Flay -- 精神鞭笞
[26180] = Defaults(2), -- Wyvern Sting -- 翼龙钉刺
[26476] = Defaults(2), -- Digestive Acid -- 消化酸液
[26556] = Defaults(2), -- Plague -- 瘟疫
[26580] = Defaults(2), -- Fear -- 恐惧
[26607] = Defaults(2), -- Blizzard -- 暴风雪
[26613] = Defaults(2), -- Unbalancing Strike -- 重压打击
-- Naxxramas 纳克萨玛斯
[27993] = Defaults(2), -- Stomp -- 践踏
[28350] = Defaults(2), -- Veil of Darkness -- 黑暗之雾
[28440] = Defaults(2), -- Veil of Shadow -- 幽影之雾
[28431] = Defaults(2), -- Poison Charge -- 毒性充能
[28732] = Defaults(2), -- Widow's Embrace -- 黑女巫的拥抱
[28796] = Defaults(2), -- Poison Bolt Volley -- 毒箭之雨
[28776] = Defaults(2), -- Necrotic Poison -- 死灵之毒
[28622] = Defaults(2), -- Web Wrap -- 蛛网裹体
[29484] = Defaults(2), -- Web Spray -- 蛛网喷射
[29213] = Defaults(2), -- Curse of the Plaguebringer -- 瘟疫使者的诅咒
[29212] = Defaults(2), -- Cripple -- 残废术
[29998] = Defaults(2), -- Decrepit Fever -- 衰弱瘟疫
[29204] = Defaults(2), -- Inevitable Doom -- 必然的厄运
[28832] = Defaults(2), -- Mark of Korth'azz -- 库尔塔兹印记
[28833] = Defaults(2), -- Mark of Blaumeux -- 布劳缪克丝印记
[28834] = Defaults(2), -- Mark of Mograine -- 莫格莱尼印记
[28835] = Defaults(2), -- Mark of Zeliek -- 瑟里耶克印记
[28169] = Defaults(2), -- Mutating Injection -- 变异注射
[28062] = Defaults(2), -- Positive Charge -- 正能量
[28085] = Defaults(2), -- Negative Charge -- 负能量
[28542] = Defaults(2), -- Life Drain -- 生命吸取
[28522] = Defaults(2), -- Icebolt -- 寒冰箭
[27808] = Defaults(2), -- Frost Blast -- 冰霜冲击
[28410] = Defaults(2), -- Chains of Kel'Thuzad -- 克尔苏加德的锁链
[27819] = Defaults(2), -- Detonate Mana -- 自爆法力
-- Karazhan 卡拉赞
[29833] = Defaults(2), -- Intangible Presence -- 无形
[29711] = Defaults(2), -- Knockdown -- 击倒
[29425] = Defaults(2), -- Gouge -- 凿击
[34694] = Defaults(2), -- Blind -- 致盲
[37066] = Defaults(2), -- Garrote -- 锁喉
[30822] = Defaults(2), -- Poisoned Thrust -- 浸毒之刺
[30889] = Defaults(2), -- Powerful Attraction -- 强力吸附
[30890] = Defaults(2), -- Blinding Passion -- 盲目激情
[29511] = Defaults(2), -- Repentance -- 悔改
[29522] = Defaults(2), -- Holy Fire -- 神圣之火
[29512] = Defaults(2), -- Holy Ground -- 神圣之地
[30053] = Defaults(2), -- Amplify Flames -- 火焰增效
[30115] = Defaults(2), -- Sacrifice -- 牺牲
[29946] = Defaults(2), -- Flame Wreath -- 烈焰花环
[29947] = Defaults(2), -- Flame Wreath -- 烈焰花环
[29990] = Defaults(2), -- Slow -- 减速
[29991] = Defaults(2), -- Chains of Ice -- 冰链术
[29954] = Defaults(2), -- Frostbolt -- 寒冰箭
[29951] = Defaults(2), -- Blizzard -- 暴风雪
[38637] = Defaults(2), -- Nether Exhaustion -- 虚空疲倦
[38638] = Defaults(2), -- Nether Exhaustion -- 虚空疲倦
[38639] = Defaults(2), -- Nether Exhaustion -- 虚空疲倦
[30400] = Defaults(2), -- Nether Beam - Perseverence -- 虚空光柱 - 坚韧
[30401] = Defaults(2), -- Nether Beam - Serenity -- 虚空光柱 - 平静
[30402] = Defaults(2), -- Nether Beam - Dominance -- 虚空光柱 - 统御
[30421] = Defaults(2), -- Nether Portal - Perseverence -- 虚空之门 - 坚韧
[30422] = Defaults(2), -- Nether Portal - Serenity -- 虚空之门 - 平静
[30423] = Defaults(2), -- Nether Portal - Dominance -- 虚空之门 - 统御
[30529] = Defaults(2), -- Recently In Game -- 刚刚控制过棋子
[39095] = Defaults(2), -- Amplify Damage -- 伤害增效
[30898] = Defaults(2), -- Shadow Word: Pain 1 -- 暗言术:痛
[30854] = Defaults(2), -- Shadow Word: Pain 2 -- 暗言术:痛
[37091] = Defaults(2), -- Rain of Bones -- 白骨之雨
[30210] = Defaults(2), -- Smoldering Breath -- 浓烟吐息
[30129] = Defaults(2), -- Charred Earth -- 灼烧土地
[30127] = Defaults(2), -- Searing Cinders -- 灼热灰烬
[36922] = Defaults(2), -- Bellowing Roar -- 低沉咆哮
-- Gruul's Lair 格鲁尔的巢穴
[36032] = Defaults(2), -- Arcane Blast -- 奥术冲击
[11726] = Defaults(2), -- Enslave Demon -- 奴役恶魔
[33129] = Defaults(2), -- Dark Decay -- 黑暗凋零
[33175] = Defaults(2), -- Arcane Shock -- 奥术震击
[33061] = Defaults(2), -- Blast Wave -- 冲击波
[33130] = Defaults(2), -- Death Coil -- 死亡缠绕
[16508] = Defaults(2), -- Intimidating Roar -- 破胆咆哮
[38927] = Defaults(2), -- Fel Ache -- 魔能疼痛
[36240] = Defaults(2), -- Cave In -- 洞穴震颤
[33652] = Defaults(2), -- Stoned -- 石化
[33525] = Defaults(2), -- Ground Slam -- 大地冲击
-- Magtheridon's Lair 玛瑟里顿的巢穴
[30530] = Defaults(2), -- Fear -- 恐惧
[44032] = Defaults(2), -- Mind Exhaustion -- 心灵疲倦
-- Serpentshrine Cavern 毒蛇神殿
[38634] = Defaults(3), -- Arcane Lightning -- 奥术闪电
[38635] = Defaults(3), -- Rain of Fire -- 火焰之雨
[39032] = Defaults(4), -- Initial Infection -- 初期感染
[39044] = Defaults(4), -- Serpentshrine Parasite -- 毒蛇神殿寄生蛇
[39042] = Defaults(5), -- Rampent Infection -- 快速感染
[38572] = Defaults(3), -- Mortal Cleave -- 致死顺劈
[38491] = Defaults(3), -- Silence -- 沉默
[38246] = Defaults(3), -- Vile Sludge -- 肮脏淤泥
[38235] = Defaults(4), -- Water Tomb -- 水之墓
[37675] = Defaults(3), -- Chaos Blast -- 混乱冲击
[37749] = Defaults(5), -- Consuming Madness -- 噬体疯狂
[37676] = Defaults(4), -- Insidious Whisper -- 诱惑低语
[37641] = Defaults(3), -- Whirlwind -- 旋风斩
[39261] = Defaults(3), -- Gusting Winds -- 尘风
[29436] = Defaults(4), -- Leeching Throw -- 吸血投掷
[37850] = Defaults(4), -- Watery Grave -- 水之墓穴
[38049] = Defaults(4), -- Watery Grave -- 水之墓穴
[38316] = Defaults(3), -- Entangle -- 纠缠
[38280] = Defaults(5), -- Static Charge -- 静电充能
-- The Eye 风暴要塞
[37132] = Defaults(3), -- Arcane Shock -- 奥术震击
[37133] = Defaults(4), -- Arcane Buffet -- 奥术击打
[37122] = Defaults(5), -- Domination -- 支配
[37135] = Defaults(5), -- Domination -- 支配
[37118] = Defaults(5), -- Shell Shock -- 外壳震击
[37120] = Defaults(4), -- Fragmentation Bomb -- 破片炸弹
[13005] = Defaults(3), -- Hammer of Justice -- 制裁之锤
[39077] = Defaults(3), -- Hammer of Justice -- 制裁之锤
[37279] = Defaults(3), -- Rain of Fire -- 火焰之雨
[37123] = Defaults(4), -- Saw Blade -- 锯齿利刃
[37160] = Defaults(3), -- Silence -- 沉默
[34322] = Defaults(4), -- Psychic Scream -- 心灵尖啸
[35410] = Defaults(4), -- Melt Armor -- 融化护甲
[42783] = Defaults(5), -- Wrath of the Astromancer -- 星术师之怒
[36965] = Defaults(4), -- Rend -- 撕裂
[30225] = Defaults(4), -- Silence -- 沉默
[44863] = Defaults(5), -- Bellowing Roar -- 咆哮
[37018] = Defaults(4), -- Conflagration -- 燃烧
[37027] = Defaults(5), -- Remote Toy -- 遥控玩具
[36991] = Defaults(4), -- Rend -- 撕裂
[36797] = Defaults(5), -- Mind Control -- 精神控制
-- The Battle for Mount Hyjal 海加尔山之战
[31610] = Defaults(3), -- Knockdown -- 击倒
[31651] = Defaults(3), -- Banshee Curse -- 女妖诅咒
[31668] = Defaults(3), -- Frost Breath -- 冰霜吐息
[31724] = Defaults(3), -- Flame Buffet -- 烈焰击打
[31249] = Defaults(3), -- Icebolt -- 寒冰箭
[31250] = Defaults(3), -- Frost Nova -- 冰霜新星
[31258] = Defaults(3), -- Death & Decay -- 死亡凋零
[31298] = Defaults(3), -- Sleep -- 催眠术
[31306] = Defaults(3), -- Carrion Swarm -- 腐臭虫群
[31447] = Defaults(3), -- Mark of Kaz'rogal -- 卡兹洛加印记
[31477] = Defaults(3), -- Cripple -- 残废术
[31480] = Defaults(3), -- War Stomp -- 战争践踏
[31340] = Defaults(3), -- Rain of Fire -- 火焰之雨
[31341] = Defaults(3), -- Unquenchable Flames -- 不熄之焰
[31344] = Defaults(3), -- Howl of Azgalor -- 阿兹加洛之嚎
[31347] = Defaults(4), -- Doom -- 厄运
[31944] = Defaults(3), -- Doomfire -- 厄运之火
[31970] = Defaults(3), -- Fear -- 恐惧
[31972] = Defaults(3), -- Grip of the Legion -- 军团之握
[32014] = Defaults(3), -- Air Burst -- 空气爆裂
[42201] = Defaults(3), -- Eternal Silence -- 永恒沉默
[42205] = Defaults(3), -- Residue of Eternity -- 永恒残渣
-- Black Temple 黑暗神殿
[40078] = Defaults(3), -- Poison Spit -- 毒液
[40079] = Defaults(3), -- Debilitating Spray -- 衰弱喷射
[40082] = Defaults(3), -- Hooked Net -- 钩网
[40084] = Defaults(3), -- Harpooner's Mark -- 持戟者的印记
[40090] = Defaults(3), -- Hurricane -- 飓风
[40875] = Defaults(3), -- Freeze -- 冰冻术
[40936] = Defaults(3), -- War Stomp -- 战争践踏
[40953] = Defaults(3), -- Immolation -- 献祭
[41047] = Defaults(3), -- Shadow Resonance -- 暗影共鸣
[41150] = Defaults(3), -- Fear -- 恐惧
[41170] = Defaults(3), -- Curse of the Bleakheart -- 冷心诅咒
[41230] = Defaults(3), -- Prophecy of Blood -- 血之预言
[41338] = Defaults(3), -- Love Tap -- 心碎
[41346] = Defaults(3), -- Poisonous Throw -- 毒性投掷
[41355] = Defaults(3), -- Shadow Word: Pain -- 暗言术:痛
[41389] = Defaults(3), -- Kidney Shot -- 肾击
[41397] = Defaults(3), -- Confusion -- 迷惑
[41351] = Defaults(3), -- Curse of Vitality -- 活力诅咒
[41379] = Defaults(3), -- Flamestrike -- 烈焰风暴
[41382] = Defaults(3), -- Blizzard -- 暴风雪
[41468] = Defaults(3), -- Hammer of Justice -- 制裁之锤
[41274] = Defaults(3), -- Fel Stomp -- 邪能践踏
[39647] = Defaults(3), -- Curse of Mending -- 治愈诅咒
[40864] = Defaults(3), -- Throbbing Stun -- 心悸
[39837] = Defaults(3), -- Impaling Spine -- 穿刺之脊
[40253] = Defaults(3), -- Molten Flame -- 熔岩烈焰
[40874] = Defaults(3), -- Destructive Poison -- 毁灭之毒
[41978] = Defaults(3), -- Debilitating Poison -- 衰弱之毒
[42023] = Defaults(3), -- Rain of Fire -- 火雨
[40239] = Defaults(3), -- Incinerate -- 烧尽
[40243] = Defaults(3), -- Crushing Shadows -- 毁灭之影
[40251] = Defaults(3), -- Shadow of Death -- 死亡之影
[40327] = Defaults(3), -- Atrophy -- 萎缩
[41294] = Defaults(3), -- Fixate -- 注视
[41303] = Defaults(3), -- Soul Drain -- 灵魂吸取
[41426] = Defaults(3), -- Spirit Shock -- 灵魂震击
[41410] = Defaults(3), -- Deaden -- 衰减
[41520] = Defaults(3), -- Seethe -- 沸腾
[41376] = Defaults(3), -- Spite -- 敌意
[40481] = Defaults(3), -- Acidic Wound -- 酸性创伤
[40491] = Defaults(3), -- Bewildering Strike -- 混乱打击
[40508] = Defaults(3), -- Fel-Acid Breath -- 邪酸吐息
[40604] = Defaults(3), -- Fel Rage -- 邪能狂怒
[42005] = Defaults(3), -- Bloodboil -- 血沸
[40823] = Defaults(3), -- Silencing Shriek -- 沉默尖啸
[41001] = Defaults(3), -- Fatal Attraction -- 致命吸引
[40860] = Defaults(3), -- Vile Beam -- 败德射线
[40859] = Defaults(3), -- Sinister Beam -- 邪恶射线
[40861] = Defaults(3), -- Wicked Beam -- 堕落射线
[40827] = Defaults(3), -- Sinful Beam -- 罪孽射线
[41461] = Defaults(3), -- Judgement of Blood -- 鲜血审判
[41472] = Defaults(3), -- Divine Wrath -- 神圣愤怒
[41481] = Defaults(3), -- Flamestrike -- 烈焰风暴
[41482] = Defaults(3), -- Blizzard -- 暴风雪
[41485] = Defaults(3), -- Deadly Poison -- 致命药膏
[41541] = Defaults(3), -- Consecration -- 奉献
[40585] = Defaults(3), -- Dark Barrage -- 黑暗壁垒
[40932] = Defaults(3), -- Agonizing Flames -- 苦痛之焰
[41032] = Defaults(3), -- Shear -- 剪切
[41142] = Defaults(3), -- Aura of Dread -- 恐怖光环
[41917] = Defaults(3), -- Parasitic Shadowfiend -- 寄生暗影魔
-- PvP --
-- Warrior
[5246] = Defaults(4), -- Intimidating Shout -- 破胆怒吼
[25212] = Defaults(2), -- Hamstring -- 断筋 (Rank 4)
[23694] = Defaults(3), -- Improved Hamstring -- 强化断筋
[12323] = Defaults(2), -- Piercing Howl -- 刺耳怒吼
[25275] = Defaults(3), -- Intercept -- 拦截 (Rank 5)
[30330] = Defaults(2), -- Mortal Strike -- 致死打击 (Rank 6)
[12809] = Defaults(3), -- Concussion Blow -- 震荡猛击
-- Warlock
[5782] = Defaults(3), -- Fear -- 恐惧术 (Rank 1)
[6213] = Defaults(3), -- Fear -- 恐惧术 (Rank 2)
[6215] = Defaults(3), -- Fear -- 恐惧术 (Rank 3)
[710] = Defaults(2), -- Banish -- 放逐术 (Rank 1)
[18647] = Defaults(2), -- Banish -- 放逐术 (Rank 2)
[6358] = Defaults(3), -- Seduction -- 魅惑
[11719] = Defaults(3), -- Curse of Tongues -- 语言诅咒
[17928] = Defaults(3), -- Howl of Terror -- 恐惧嚎叫 (Rank 2)
[24259] = Defaults(3), -- Spell Lock -- 法术锁定
[27223] = Defaults(5), -- Death Coil -- 死亡缠绕 (Rank 4)
[30108] = Defaults(5), -- Unstable Affliction -- 痛苦无常 (Rank 3)
[31117] = Defaults(5), -- U&A Silenced -- 痛苦无常 (沉默)
[30414] = Defaults(2), -- Shadowfury -- 暗影之怒 (Rank 4)
[27215] = Defaults(2), -- Immolate -- 献祭 (Rank 9)
[27216] = Defaults(2), -- Corruption -- 腐蚀术 (Rank 7)
-- Priest
[10890] = Defaults(3), -- Psychic Scream -- 心灵尖啸 (Rank 4)
[10912] = Defaults(5), -- Mind Control -- 精神控制 (Rank 3)
[15487] = Defaults(3), -- Silence -- 沉默
[15269] = Defaults(1), -- Blackout -- 昏阙
[25368] = Defaults(2), -- Shadow Word: Pain -- 暗言术:痛 (Rank 10)
[34917] = Defaults(2), -- Vampiric Touch -- 吸血鬼之触 (Rank 3)
-- Rogue
[1833] = Defaults(3), -- Cheap Shot -- 偷袭
[2094] = Defaults(5), -- Blind -- 致盲
[8643] = Defaults(4), -- Kidney Shot -- 肾击 (Rank 2)
[11297] = Defaults(4), -- Sap -- 闷棍 (Rank 3)
[38764] = Defaults(2), -- Gouge -- 凿击 (Rank 6)
[1330] = Defaults(3), -- Garrote - Silence -- 锁喉沉默
[18425] = Defaults(3), -- Kick - Silenced -- 脚踢 - 沉默
[11201] = Defaults(2), -- Crippling Poison -- 致残毒药
-- Mage
[116] = Defaults(2), -- Frostbolt -- 寒冰箭 (Rank 1)
[38697] = Defaults(2), -- Frostbolt -- 寒冰箭 (Rank 14)
[12826] = Defaults(3), -- Polymorph -- 变形术
[28271] = Defaults(3), -- Polymorph: Turtle -- 变形术:龟
[28272] = Defaults(3), -- Polymorph: Pig -- 变形术:猪
[27087] = Defaults(4), -- Cone of Cold -- 冰锥术 (Rank 6)
[122] = Defaults(4), -- Frost Nova -- 冰霜新星 (Rank 1)
[865] = Defaults(4), -- Frost Nova -- 冰霜新星 (Rank 2)
[6131] = Defaults(4), -- Frost Nova -- 冰霜新星 (Rank 3)
[10230] = Defaults(4), -- Frost Nova -- 冰霜新星 (Rank 4)
[27088] = Defaults(4), -- Frost Nova -- 冰霜新星 (Rank 5)
[33395] = Defaults(4), -- W&E Freeze -- 冰冻术 (水元素)
[12494] = Defaults(4), -- Frostbite -- 霜寒刺骨
[18469] = Defaults(3), -- Counterspell Silenced -- 法术反制 -沉默
[31589] = Defaults(3), -- Slow -- 减速
[33043] = Defaults(3), -- Dragon's Breath -- 龙息术
-- Hunter
[1543] = Defaults(2), -- Flare -- 照明弹
[5116] = Defaults(2), -- Concussive Shot -- 震荡射击
[14325] = Defaults(2), -- Hunter's Mark -- 猎人印记 (Rank 4)
[14309] = Defaults(3), -- Freezing Trap -- 冰冻陷阱 (Rank 3)
[19185] = Defaults(3), -- Entrapment -- 诱捕
[19229] = Defaults(3), -- Improved Wing Clip -- 强化摔绊
[19503] = Defaults(3), -- Scatter Shot -- 驱散射击
[27018] = Defaults(2), -- Viper Sting -- 蝰蛇钉刺 (Rank 4)
[24133] = Defaults(2), -- Wyvern Sting -- 翼龙钉刺 (Rank 3)
[27065] = Defaults(2), -- Aimed Shot -- 瞄准射击 (Rank 7)
[27067] = Defaults(3), -- Counterattack -- 反击 (Rank 4)
[27016] = Defaults(2), -- Serpent Sting -- 毒蛇钉刺 (Rank 10)
-- Druid
[26993] = Defaults(5), -- Faerie Fire -- 精灵之火 (Rank 5)
[27011] = Defaults(5), -- Faerie Fire (Feral) -- 精灵之火 (野性) (Rank 5)
[9853] = Defaults(2), -- Entangling Roots -- 纠缠根须
[8983] = Defaults(4), -- Bash -- 重击 (Rank 3)
[16922] = Defaults(2), -- Starfire Stun -- 星火昏迷
[22570] = Defaults(2), -- Maim -- 割碎
[27006] = Defaults(3), -- Pounce -- 突袭 (Rank 4)
[33786] = Defaults(5), -- Cyclone -- 飓风术
[45334] = Defaults(3), -- Feral Charge Effect -- 野性冲锋效果
-- Paladin
[10308] = Defaults(4), -- Hammer of Justice -- 制裁之锤 (Rank 4)
[20066] = Defaults(3), -- Repentance -- 忏悔
-- Shaman
[2484] = Defaults(1), -- Earthbind Totem -- 地缚图腾
[25464] = Defaults(1), -- Frost Shock -- 冰霜震击 (Rank 5)
}
ORD:RegisterDebuffs(DebuffList) -- don't touch this ... |
return {width=64,height=32,type='NAMEDuint4_4'} |
object_tangible_item_som_jedi_watch_dog_chest = object_tangible_item_som_shared_jedi_watch_dog_chest:new {
}
ObjectTemplates:addTemplate(object_tangible_item_som_jedi_watch_dog_chest, "object/tangible/item/som/jedi_watch_dog_chest.iff")
|
class = require 'class'
Crystal = require 'crystals.crystal'
Dust = class(Crystal)
function Dust:init()
Crystal.init(self, 4, 4, 40, 7, 2, love.graphics.newImage("crystals/dust.png"))
end
return Dust
|
data:extend(
{
{
type = "item-subgroup",
name = "aragas-brass-alloy-mixing",
group = "angels-casting",
order = "ca",
},
{
type = "item-subgroup",
name = "aragas-bronze-alloy-mixing",
group = "angels-casting",
order = "da",
},
{
type = "item-subgroup",
name = "aragas-gunmetal-alloy-mixing",
group = "angels-casting",
order = "ea",
},
{
type = "item-subgroup",
name = "aragas-invar-alloy-mixing",
group = "angels-casting",
order = "fa",
},
{
type = "item-subgroup",
name = "aragas-cobalt-steel-alloy-mixing",
group = "angels-casting",
order = "ga",
},
{
type = "item-subgroup",
name = "aragas-nitinol-alloy-mixing",
group = "angels-casting",
order = "ha",
},
}
) |