content
stringlengths
5
1.05M
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ========== PlaceObj('StoryBit', { ActivationEffects = {}, Category = "FounderRocketLanded", CompletionEffects = {}, Disables = { "TheStowaway_2_NonGenius", }, Effects = {}, EnableChance = 10, Enabled = true, Image = "UI/Messages/Events/27_rocket_launch.tga", NotificationOnly = false, Prerequisites = {}, ScriptDone = true, Text = T(194914260658, --[[StoryBit TheStowaway_1_Genius Text]] 'Susie, our little stowaway, visibly around 8 years old, managed to somehow bypass all security measures by sheer luck and sneaked onboard during pre-launch. Scared, but excited, she explains that she wants to live on Mars and begs you to let her stay in the colony.\n\nThis incident was already reported to Earth and her billionaire father has offered a significant reward for her safe return. Keeping her in the Colony will certainly create a PR and political nightmare.\n\n<if(is_commander("psychologist"))>[<commander_profile>] Interviewing Susie, you discover a huge potential in her and intelligence far beyond what her age would suggest.</if>'), TextReadyForValidation = true, TextsDone = true, Title = T(656027729407, --[[StoryBit TheStowaway_1_Genius Title]] "The Stowaway"), Trigger = "RocketLanded", VoicedText = T(453966578879, --[[voice:narrator]] "A young girl was discovered on board of the Founders' rocket!"), group = "Founder Stage", id = "TheStowaway_1_Genius", PlaceObj('StoryBitParamFunding', { 'Name', "fundingreward", 'Value', 100000000, }), PlaceObj('StoryBitParamPercent', { 'Name', "fundingloss", 'Value', 10, }), PlaceObj('StoryBitReply', { 'Text', T(787183055788, --[[StoryBit TheStowaway_1_Genius Text]] "Mars is no place for a child. Return her to Earth on the next flight!"), 'OutcomeText', "custom", 'CustomOutcomeText', T(939217727351, --[[StoryBit TheStowaway_1_Genius CustomOutcomeText]] "get <funding(fundingreward)>"), }), PlaceObj('StoryBitOutcome', { 'Prerequisites', {}, 'Effects', { PlaceObj('RewardFunding', { 'Amount', "<fundingreward>", }), }, }), PlaceObj('StoryBitReply', { 'Text', T(616036590420, --[[StoryBit TheStowaway_1_Genius Text]] "She is a true Founder and should stay in the Colony!"), 'OutcomeText', "custom", 'CustomOutcomeText', T(213406513448, --[[StoryBit TheStowaway_1_Genius CustomOutcomeText]] "get a child Colonist, lose <fundingloss>% Funding"), }), PlaceObj('StoryBitOutcome', { 'Prerequisites', {}, 'Enables', { "TheStowaway_3_MakeGenius", }, 'Effects', { PlaceObj('LoseFundingPercent', { 'Percent', "<fundingloss>", }), PlaceObj('SpawnColonist', { 'Name', T(257928022372, --[[StoryBit TheStowaway_1_Genius Name]] "Susan Zann"), 'Gender', "Female", 'Age', "Child", 'AssociateWithStoryBit', true, }), }, }), PlaceObj('StoryBitReply', { 'Text', T(326798191700, --[[StoryBit TheStowaway_1_Genius Text]] "Let her stay, I will deal with all consequences myself!"), 'OutcomeText', "custom", 'CustomOutcomeText', T(944550211148, --[[StoryBit TheStowaway_1_Genius CustomOutcomeText]] "get a child Colonist"), 'Prerequisite', PlaceObj('IsCommander', { 'CommanderProfile', "politician", }), }), PlaceObj('StoryBitOutcome', { 'Prerequisites', {}, 'Enables', { "TheStowaway_3_MakeGenius", }, 'Effects', { PlaceObj('SpawnColonist', { 'Name', T(292019695018, --[[StoryBit TheStowaway_1_Genius Name]] "Susan Zann"), 'Gender', "Female", 'Age', "Child", 'AssociateWithStoryBit', true, }), }, }), })
local compassLikeGPI_dirs -- client local compassLikeGPI_updateTooltip -- extended client function local compassLikeGPI_update -- extended server function if onClient() then compassLikeGPI_dirs = { {name = "E", angle = math.pi * 2 * 0 / 16}, {name = "ENE", angle = math.pi * 2 * 1 / 16}, {name = "NE", angle = math.pi * 2 * 2 / 16}, {name = "NNE", angle = math.pi * 2 * 3 / 16}, {name = "N", angle = math.pi * 2 * 4 / 16}, {name = "NNW", angle = math.pi * 2 * 5 / 16}, {name = "NW", angle = math.pi * 2 * 6 / 16}, {name = "WNW", angle = math.pi * 2 * 7 / 16}, {name = "W", angle = math.pi * 2 * 8 / 16}, {name = "WSW", angle = math.pi * 2 * 9 / 16}, {name = "SW", angle = math.pi * 2 * 10 / 16}, {name = "SSW", angle = math.pi * 2 * 11 / 16}, {name = "S", angle = math.pi * 2 * 12 / 16}, {name = "SSE", angle = math.pi * 2 * 13 / 16}, {name = "SE", angle = math.pi * 2 * 14 / 16}, {name = "ESE", angle = math.pi * 2 * 15 / 16}, {name = "E", angle = math.pi * 2 * 16 / 16} } compassLikeGPI_updateTooltip = AncientGate.updateTooltip function AncientGate.updateTooltip(...) compassLikeGPI_updateTooltip(...) local surveyed = Entity():getValue("cgpi_surveyed") or "|" local player = Player() if surveyed:find('|'..player.index..'|', 1, true) or (player.allianceIndex and surveyed:find('|'..player.allianceIndex..'|', 1, true)) then local x, y = Sector():getCoordinates() local tx, ty = WormHole():getTargetCoordinates() local ownAngle = math.atan2(ty - y, tx - x) + math.pi * 2 if ownAngle > math.pi * 2 then ownAngle = ownAngle - math.pi * 2 end if ownAngle < 0 then ownAngle = ownAngle + math.pi * 2 end local dirString, iconPath = "", "" local min = 3.0 for _, dir in ipairs(compassLikeGPI_dirs) do local d = math.abs(ownAngle - dir.angle) if d < min then min = d iconPath = "data/textures/icons/gatepixelicons/ancientgate"..dir.name..".png" dirString = (dir.name .. " /*direction*/")%_t end end EntityIcon().icon = iconPath Entity().title = dirString.." ".."Ancient Gate"%_t end end else compassLikeGPI_update = AncientGate.update function AncientGate.update(...) compassLikeGPI_update(...) if WormHole().enabled then -- mark the gate as surveyed local surveyed = Entity():getValue("cgpi_surveyed") or "|" local changed = false for _, index in ipairs({Sector():getPresentFactions()}) do local faction = Faction(index) if faction and not faction.isAIFaction and not surveyed:find('|'..index..'|', 1, true) then changed = true surveyed = surveyed..index..'|' if faction.isPlayer then local player = Player(index) if player.allianceIndex and not surveyed:find('|'..player.allianceIndex..'|', 1, true) then -- survey for alliance too surveyed = surveyed..player.allianceIndex..'|' end end end end if changed then Entity():setValue("cgpi_surveyed", surveyed) AncientGate.updateTooltip() -- update title and name end end end end
local Aye = Aye; if not Aye.addModule("Aye.AutoOK") then return end; -- LFGListInviteDialog -- -- PopUp OnShow -- LFG rules showing after joining some LFG groups LFGListInviteDialog.AcknowledgeButton:HookScript("OnShow", function(self) if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.LFGListInviteDialog then self:Click(); end; end); -- LFDRoleCheckPopupAcceptButton -- -- PopUp OnShow -- LFD Role Check LFDRoleCheckPopupAcceptButton:HookScript("OnShow", function(self) if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.LFDRoleCheckPopupAcceptButton then self:Click(); end; end); -- -- PopUp OnShow -- LFG invite popup LFGInvitePopupAcceptButton:HookScript("OnShow", function(self) if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.LFDRoleCheckPopupAcceptButton then self:Click(); end; end); -- LFGListApplicationDialog -- -- PopUp OnShow -- LFG Appplication info LFGListApplicationDialog.SignUpButton:HookScript("OnShow", function(self) if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.LFGListApplicationDialog then self:Click(); end; end); -- CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL -- -- PopUp OnShow -- selling items that "will make it non-tradeable, even if you buy it back" hooksecurefunc("StaticPopup_Show", function(self) if not Aye.db.global.AutoOK.enable then return end; if self == "CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL" then if Aye.db.global.AutoOK.CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL then local popup = StaticPopup_Visible("CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"); _G[popup .."Button1"]:Click(); end; end; if self == "LFG_LIST_ENTRY_EXPIRED_TOO_MANY_PLAYERS" then if Aye.db.global.AutoOK.LFG_LIST_ENTRY_EXPIRED_TOO_MANY_PLAYERS then local popup = StaticPopup_Visible("LFG_LIST_ENTRY_EXPIRED_TOO_MANY_PLAYERS"); _G[popup .."Button1"]:Click(); end; end; end); -- LFGDungeonReadyDialogLeaveQueueButton -- -- PopUp OnShow -- LFG group formed LFGDungeonReadyDialogLeaveQueueButton:HookScript("OnShow", function(self) if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.LFGDungeonReadyDialogLeaveQueueButton then local _, id, typeID, subtypeID, name, _, _, _, _, _, _, isLeader = GetLFGProposal(); if -- skip non-LFR group invites typeID == TYPEID_DUNGEON and subtypeID == LFG_SUBTYPEID_RAID -- skip encounters with only 1 boss and id ~= 1289 -- Rift of Aln -- Xavius and id ~= 1293 -- Betrayer's Rise -- Gul'dan and id ~= 1497 -- Deceiver's Fall -- Kil'jaeden -- must be a leader and not isLeader then -- Note about skipped invitations if Aye.db.global.AutoOK.LFGDungeonReadyDialogLeaveQueueButton_desc then print("|cff9d9d9d[|r|cffe6cc80Aye|r|cff9d9d9d]|r Skipped invitation to |cff9d9d9d\"|r|cffe6cc80" ..name .."|r|cff9d9d9d\"|r group, because not chosen as leader."); end; -- leave queue self:Click(); -- requeue if Aye.db.global.AutoOK.LFGDungeonReadyDialogLeaveQueueButton_openFrame then if PVEFrame:IsShown() then PVEFrame_ToggleFrame() end; PVEFrame_ToggleFrame("GroupFinderFrame", RaidFinderFrame); RaidFinderQueueFrame_SetRaid(id); RaidFinderQueueFrameRoleButtonLeader.checkButton:SetChecked(true); -- cannot call, it's protected --RaidFinderFrameFindRaidButton:Click(); --PVEFrame_ToggleFrame("GroupFinderFrame", RaidFinderFrame); end; end; end; end); Aye.modules.AutoOK.OnEnable = function() -- backup object Aye.modules.AutoOK.bak = {}; Aye.modules.AutoOK.bak.StaticPopupDialogs = {}; -- backup StaticPopupDialogs.DELETE_GOOD_ITEM and StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM Aye.modules.AutoOK.bak.StaticPopupDialogs.DELETE_GOOD_ITEM = StaticPopupDialogs.DELETE_GOOD_ITEM; Aye.modules.AutoOK.bak.StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM = StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM; -- check "Type DELETE into the field to confirm." Aye.modules.AutoOK.CheckTypeDELETEtoConfirm(); end; -- DisableTypeDELETEtoConfirm -- Either backup original StaticPopupDialogs or replace them with ones without "Type DELETE into the field to confirm." confirmation -- -- @noparam -- @noreturn Aye.modules.AutoOK.CheckTypeDELETEtoConfirm = function() if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.DisableTypeDELETEtoConfirm then -- Disable "Type DELETE into the field to confirm." confirmation, replacing DELETE_GOOD_*ITEM with DELETE_*ITEM PopupDialogs StaticPopupDialogs.DELETE_GOOD_ITEM = StaticPopupDialogs.DELETE_ITEM; StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM = StaticPopupDialogs.DELETE_QUEST_ITEM; else -- backup StaticPopupDialogs.DELETE_GOOD_ITEM and StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM StaticPopupDialogs.DELETE_GOOD_ITEM = Aye.modules.AutoOK.bak.StaticPopupDialogs.DELETE_GOOD_ITEM; StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM = Aye.modules.AutoOK.bak.StaticPopupDialogs.DELETE_GOOD_QUEST_ITEM; end; end; Aye.modules.AutoOK.events.ADDON_LOADED = function(addon) -- TALKINGHEAD_REQUESTED -- Remove Talking Head if Aye.db.global.AutoOK.enable and Aye.db.global.AutoOK.TALKINGHEAD_REQUESTED and addon == "Blizzard_TalkingHeadUI" then TalkingHeadFrame:UnregisterEvent("TALKINGHEAD_REQUESTED"); end; end;
df_trees.sounds = {} df_trees.sounds.wood = default.node_sound_wood_defaults() df_trees.sounds.leaves = default.node_sound_leaves_defaults() df_trees.sounds.nethercap_wood = default.node_sound_wood_defaults({ footstep = {name = "default_snow_footstep", gain = 0.2}, }) df_trees.sounds.glass = default.node_sound_glass_defaults() df_trees.node_names = {} df_trees.node_names.torch = "default:torch" df_trees.node_names.chest = "default:chest" df_trees.node_names.furnace = "default:furnace" df_trees.node_names.apple = "default:apple" df_trees.node_names.gold_ingot = "default:gold_ingot" df_trees.node_names.water_source = "default:water_source" df_trees.node_names.river_water_source = "default:river_water_source" df_trees.node_names.ice = "default:ice" df_trees.node_names.water_flowing = "default:water_flowing" df_trees.node_names.river_water_flowing = "default:river_water_flowing" df_trees.node_names.snow = "default:snow" df_trees.node_names.torch_wall = "default:torch_wall" df_trees.node_names.stone_with_coal = "default:stone_with_coal" df_trees.node_names.coalblock = "default:coalblock" df_trees.node_names.paper = "default:paper" df_trees.textures = {} df_trees.textures.gold_block = "default_gold_block.png" -- this stuff is only for during initialization minetest.after(0, function() df_trees.sounds = nil df_trees.node_names = nil df_trees.textures = nil end) df_trees.iron_containing_nodes = {"default:stone_with_iron", "default:steelblock"} df_trees.copper_containing_nodes = {"default:stone_with_copper", "default:copperblock"} df_trees.mese_containing_nodes = {"default:stone_with_mese", "default:mese"} df_trees.after_place_leaves = default.after_place_leaves df_trees.register_leafdecay = default.register_leafdecay -- This is used by other mods, leave it exposed df_trees.node_sound_tree_soft_fungus_defaults = function(table) table = table or {} table.footstep = table.footstep or {name = "dfcaverns_fungus_footstep", gain = 0.3} default.node_sound_wood_defaults(table) return table end
--[[ All functions in here expect either a 2D Nx2 Complex tensor ]]-- local complex = {} function complex.angle(h) return torch.atan2(h[{{},2}],h[{{},1}]) end function complex.exp(h) local out = h:clone() local real = h[{{},1}] local imag = h[{{},2}] out[{{},1}] = torch.exp(real):cmul(torch.cos(imag)) out[{{},2}] = torch.exp(real):cmul(torch.sin(imag)); return out end function complex.abs(h) local hsquare = torch.pow(h,2) if h:dim() == 2 and h:size(2) == 2 then return torch.sqrt(hsquare[{{},1}] + hsquare[{{},2}]) elseif h:dim() == 3 and h:size(3) == 2 then return torch.sqrt(hsquare[{{},{},1}] + hsquare[{{},{},2}]) else error('unsupported dimensions') end end function complex.real(h) return h[{{},1}] end function complex.imag(h) return h[{{},2}] end function complex.conj(h) local out = h:clone() out[{{},2}]:mul(-1) return out end function complex.prod(h) local out = torch.ones(1,2):typeAs(h) out[1] = h[1] for i=2,h:size(1) do -- (x1 + iy1) * (x2 + iy2) = (x1x2 - y1y2) + i(x1y2 + y1x2) local real = (out[1][1]* h[i][1] - out[1][2] * h[i][2]) local imag = (out[1][1]* h[i][2] + out[1][2] * h[i][1]) out[1][1] = real out[1][2] = imag end return out end function complex.cmul(a1,b1, noargcheck) local a,b if noargcheck then a=a1; b=b1 else if a1:dim() == 1 then -- assume that imag is 0 a = torch.DoubleTensor(a1:size(1), 2):zero() a[{{}, 1}] = a1 elseif a1:dim() == 2 and a1:size(2) == 2 then a = a1 else error('Input has to be 1D Tensor of size N (purely real 1D tensor) or ' .. '2D Tensor of size Nx2 (Complex 1D tensor)') end if b1:dim() == 1 then -- assume that imag is 0 b = torch.DoubleTensor(b1:size(1), 2):zero() b[{{}, 1}] = b1 elseif b1:dim() == 2 and b1:size(2) == 2 then b = b1 else error('Input has to be 1D Tensor of size N (purely real 1D tensor) or ' .. '2D Tensor of size Nx2 (Complex 1D tensor)') end end local c = a:clone():zero() a = a:contiguous() b = b:contiguous() c = c:contiguous() local cd = torch.data(c) local ad = torch.data(a) local bd = torch.data(b) for i=0,a:size(1)-1 do -- (x1 + iy1) * (x2 + iy2) = (x1x2 - y1y2) + i(x1y2 + y1x2) local re = i*2 local im = i*2 + 1 cd[re] = (ad[re]* bd[re] - ad[im] * bd[im]) cd[im] = (ad[re]* bd[im] + ad[im] * bd[re]) end return c end function complex.dot(a,b) if not(a:dim() == 2 and a:size(2) == 2 and b:dim() == 2 and b:size(2) == 2) then error('Inputs have to be 2D Tensor of size Nx2 (complex 1D tensor)') end if a:size(1) ~= b:size(1) then error('Both inputs need to have same number of elements') end local c = torch.sum(complex.cmul(a,b, true), 1) return c end function complex.mm(a,b) if not(a:dim() == 3 and a:size(3) == 2 and b:dim() == 3 and b:size(3) == 2) then error('Inputs have to be 3D Tensor of size NxMx2 (complex 2D tensor)') end if a:size(2) ~= b:size(1) then error('Matrix-Matrix product requires NxM and MxP matrices.') end local c = torch.zeros(a:size(1), b:size(2), 2):typeAs(a) for i=1,c:size(1) do for j=1,c:size(2) do c[i][j] = complex.dot(a[{i,{},{}}], b[{{},j,{}}]) -- print(c[i][j]) end end return c end function complex.diag(x) if x:dim() == 2 and x:size(2) == 2 then local y = torch.zeros(x:size(1), x:size(1), 2) y[{{},1}] = torch.diag(x[{{},1}]) y[{{},2}] = torch.diag(x[{{},2}]) return y elseif x:dim() == 3 and x:size(3) == 2 then local yr = torch.diag(x[{{},{},1}]) local y = torch.zeros(yr:size(1),2) y[{{},1}] = yr y[{{},2}] = torch.diag(x[{{},{},2}]) return y else error('Input has to be 2D Tensor of size Nx2 or ' .. '3D Tensor of size NxMx2 (Complex 2D tensor)') end end --[[ Polynomial with specified roots Function is super unoptimized ]]-- function complex.poly(x) local e if x:dim() == 2 and x:size(1) == x:size(2) then e = torch.eig(x) -- square polynomial -- TODO: Strip out infinities in case the eigen values have any elseif x:dim() == 1 then e = x else error('Input should be a 1D Tensor or a 2D square tensor') end -- Expand recursion formula local n = e:size(1) if x:dim() == 1 then local c = torch.zeros(n+1) -- purely real c[1] = 1 for j=1,n do c[{{2,(j+1)}}] = c[{{2,(j+1)}}] - torch.mul(c[{{1,j}}],e[j]) end return c else local c = torch.zeros(n+1,2) -- complex c[1][1] = 1 for j=1,n do -- c(2:(j+1)) = c(2:(j+1)) - e(j).*c(1:j); c[{{2,(j+1)}, 1}] = c[{{2,(j+1)}, 1}] - torch.mul(c[{{1,j}, 1}],e[j][1]) c[{{2,(j+1)}, 2}] = c[{{2,(j+1)}, 2}] - torch.mul(c[{{1,j}, 2}],e[j][2]) end -- The result should be real if the roots are complex conjugates. local c1 = torch.sort(e[{{torch.ge(e[{{},2}], 0)},2}]) local c2 = torch.sort(e[{{torch.le(e[{{},2}], 0)},2}]) if c1:size(1) == c2:size(1) and torch.eq(c1, c2):sum() == c1:size(1) then c = complex.real(c); end return c end end return complex
module('content.recipes.creator',package.seeall) require 'lux.object' require 'base.element' require 'base.property' function make(name, data) local creator = base.element(name) local makerecipe = require('content.recipes.' .. data.recipe).make if data.number then data.makerecipe = function ( name, args ) for i=1,data.number do makerecipe( name .. '.' .. i, args) end end else data.makerecipe = makerecipe end creator:add_property('creates', data) return creator end
slot0 = class("MiniGameRequestCommand", pm.SimpleCommand) slot0.REQUEST_HUB_DATA = 1 slot0.execute = function (slot0, slot1) slot4 = slot1:getBody().callback pg.ConnectionMgr.GetInstance():Send(26101, { type = slot1.getBody().type }, 26102, function (slot0) slot1 = getProxy(MiniGameProxy) for slot5, slot6 in ipairs(slot0.hubs) do slot1:UpdataHubData(slot6) end if slot0 then slot0() end slot2 = getProxy(MiniGameProxy) for slot6, slot7 in ipairs(pg.mini_game.all) do slot2:RequestInitData(slot7, true) end end) end return slot0
--[[ LuiExtended License: The MIT License (MIT) --]] LUIE.CombatTextResourcesPotionEventListener = LUIE.CombatTextEventListener:Subclass() local CombatTextResourcesPotionEventListener = LUIE.CombatTextResourcesPotionEventListener local eventType = LUIE.Data.CombatTextConstants.eventType local resourceType = LUIE.Data.CombatTextConstants.resourceType local inCooldown = false function CombatTextResourcesPotionEventListener:New() local obj = LUIE.CombatTextEventListener:New() obj:RegisterForUpdate("PotionCooldown", 100, function() self:PotionCooldown() end) return obj end function CombatTextResourcesPotionEventListener:PotionCooldown() local Settings = LUIE.CombatText.SV if not Settings.toggles.showPotionReady then return end local slotIndex = GetCurrentQuickslot() if (GetSlotItemSound(slotIndex) == ITEM_SOUND_CATEGORY_POTION) then local _, duration = GetSlotCooldownInfo( slotIndex ) local isInCooldown = duration > 0 if isInCooldown then if inCooldown == false and duration > 5000 then inCooldown = true end else if inCooldown == true then local slotName = zo_strformat(SI_LINK_FORMAT_ITEM_NAME, GetSlotName(slotNum)) self:TriggerEvent(eventType.RESOURCE, resourceType.POTION, slotName) inCooldown = false end end end end
-- Set the headers content("application/javascript") setheader("Cache-Control", "no-cache") -- Handle requests if method() == "POST" then -- Add the form data as JSON to the "comments" list in the database (NOTE: unsanitized) List("comments"):add(json(formdata())) else -- Retrieve the "comments" list from the database as a JSON list print(List("comments"):json()) end
epic_score = { hud = { posx = tonumber(minetest.settings:get("epic_score.hud.offsetx") or 0.5), posy = tonumber(minetest.settings:get("epic_score.hud.offsety") or 0.7) }, http = minetest.request_http_api() } local MP = minetest.get_modpath("epic_score") -- utils dofile(MP.."/persistence.lua") dofile(MP.."/cleanup.lua") -- hud dofile(MP.."/hud.lua") -- blocks dofile(MP.."/add_score.lua") dofile(MP.."/set_score.lua") dofile(MP.."/periodic_add.lua") dofile(MP.."/kill.lua") dofile(MP.."/inventory_item_score.lua") dofile(MP.."/highscore.lua") dofile(MP.."/highscore_save.lua") dofile(MP.."/highscore_load.lua") -- webhooks if epic_score.http then dofile(MP.."/discord_highscore.lua") end -- items dofile(MP.."/items.lua") -- forms dofile(MP.."/forms/highscore_view.lua") dofile(MP.."/forms/highscore_configure.lua") -- clear http api after all is set up epic_score.http = nil
local Draw = require("api.Draw") local IDrawLayer = require("api.gui.IDrawLayer") local Gui = require("api.Gui") local global = require("mod.chat_bubbles.internal.global") local Map = require("api.Map") local Chara = require("api.Chara") local ChatBubbleLayer = class.class("ChatBubbleLayer", IDrawLayer) function ChatBubbleLayer:init() self.tw = nil self.th = nil self.icons = {} end function ChatBubbleLayer:default_z_order() return Gui.LAYER_Z_ORDER_USER end function ChatBubbleLayer:on_theme_switched(coords) self.coords = Draw.get_coords() self.tw, self.th = self.coords:get_size() end function ChatBubbleLayer:relayout() end function ChatBubbleLayer:reset() self.icons = {} global.chat_bubbles = {} end function ChatBubbleLayer:update(map, dt, screen_updated) -- >>>>>>>> oomSEST/src/net.hsp:1458 oom_speed = cfg_txtpopspeed * 150 ... for uid, v in pairs(global.chat_bubbles) do local max_frame = config.chat_bubbles.display_duration * 150 if config.chat_bubbles.shorten_last_words then local obj = map:get_object(uid) if not obj or (obj._type == "base.chara" and not Chara.is_alive(obj)) then max_frame = max_frame / 4 end end v.frame = v.frame + dt * 1000 if v.frame > max_frame then global.chat_bubbles[uid] = nil end end -- <<<<<<<< oomSEST/src/net.hsp:1464 if (txtpopup(0, txtpopupcnt2) + oom_speed > t .. end function ChatBubbleLayer.draw_chat_bubble(x, y, text, tw, th, bubble_color, text_color, curve, edge, kind) curve = math.floor(math.clamp(curve, 0, th / 2 - 2)) edge = math.floor(math.clamp(edge, 0, th / 2)) local vt = {} local p = function(x, y) vt[#vt+1] = x vt[#vt+1] = y end -- Draw.line(, x + curve, y) -- Draw.line(, x + tw - curve, y) -- Draw.line(, x + tw, y + curve) -- Draw.line(, x + tw, y + th - curve) p(x + curve, y) p(x + tw - curve, y) p(x + tw, y + curve) p(x + tw, y + th - curve) p(x + tw - curve, y + th) if kind == 0 then elseif kind == 1 then -- Draw.line(, x + tw - curve, y + th) -- Draw.line(, x + tw / 2, y + th) -- Draw.line(, x + tw / 2, y + th + edge) -- Draw.line(, x + tw / 2 - edge, y + th) p(x + tw / 2, y + th) p(x + tw / 2, y + th + edge) p(x + tw / 2 - edge, y + th) elseif kind == 2 then -- Draw.line(, x + tw - curve, y + th) -- Draw.line(, x + curve + edge * 2, y + th) -- Draw.line(, x + curve + edge * 2, y + th + edge) -- Draw.line(, x + curve + edge, y + th) p(x + curve + edge * 2, y + th) p(x + curve + edge * 2, y + th + edge) p(x + curve + edge, y + th) elseif kind == 3 then -- Draw.line(, x + tw - curve, y + th) -- Draw.line(, x + tw - curve - edge, y + th) -- Draw.line(, x + tw - curve - edge * 2, y + th + edge) -- Draw.line(, x + curve, y + th) p(x + tw - curve - edge, y + th) p(x + tw - curve - edge * 2, y + th + edge) p(x + tw - curve - edge * 2, y + th) p(x + tw - curve - edge * 2 + 1, y + th) end p(x + curve, y + th) p(x, y + th - curve) p(x, y + curve) p(x + curve, y) p(x, y) Draw.set_color(bubble_color) Draw.filled_polygon(vt) Draw.set_color(text_color) Draw.line_polygon(vt) Draw.text(text, x + 5, y + 5) end function ChatBubbleLayer:draw(draw_x, draw_y) local map = Map.current() if map == nil then return end for uid, v in pairs(global.chat_bubbles) do local obj = map:get_object(uid) if obj and obj:is_in_fov() then -- >>>>>>>> oomSEST/src/karioki.hsp:316 #deffunc fukidashi int __rrr, int __sss, int __ttt ... local x, y = self.coords:tile_to_screen(obj.x, obj.y) x = x + draw_x - math.floor(v.width / 2 - self.th / 2) + v.x_offset y = y + draw_y - v.height - self.th / 2 + (obj:calc("y_offset") or 0) + v.y_offset Draw.set_font(v.font_size) local curve = 5 local edge = 10 ChatBubbleLayer.draw_chat_bubble(x, y, v.text, v.width, v.height, v.bubble_color, v.text_color, curve, edge, 1) -- <<<<<<<< oomSEST/src/karioki.hsp:363 return .. end end end return ChatBubbleLayer
LED_BOARD = 0 LED_CHIP = 4 s = gpio.LOW function blink () s = bit.bxor(s, 1) gpio.write(LED_BOARD, s) end gpio.mode(LED_BOARD, gpio.OUTPUT) tm = tmr.create() tm:register(1000, tmr.ALARM_AUTO, blink) tm:start()
-- base64 images local chair_albedo_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAAyCAYAAAA9ZNlkAAACTElEQVRYhcVYO7LCMAzcMNR0dK9M BQ2tD5JT5iBqaaDyDdJxgbwGBdmRbSVxYKvgyUiLPis5zR9aLIWDH7VzQtsstXVc4/R6PuPShsSf 3gPD5x0rmSIBdtw593GUQECMaLQQaXIpcPCjNPr0fvHzYxiyJJIEHPwY/2s17IbznihJ4lByXgOd c8nCnRHgsDM4pJe2DfK/9Px6PqskghTIgtsadu28JwIQFubUBTLsPRFkFGqgJ5o6CUQjkzjEzhk1 wi7PJWRNFHVAGpWGlp6noHZB59yUrxoIwh8TKLVcrS6IwWnIpkCqGrAtHSmoKZAG9kaSANfB1i54 DEMy/8AXuuAxDFn7B0Lb1Kx4K3hAFSOwZgTL5xKOwFubidR23NoFWgrkeM52wVZBygkQYyKg1UL8 e434aDblNExGQLJ/ep8Updw5UI7irAj55dobUYrEjIDmmAtJFhQvqz1Rsdel3ZiI6V7Ay4kMNTtO 3hEiwilMNaBNxVwVd84VtyZLF2XbEKg/juMN2TQL5HMNIZIoRmBvmFIgn5emo4QgBZoG1BzHWkEe gXkH1B7Pqri97wZBBDiUUjRqjGPpOJbugIDWOjW6QNqMRWu2D8gXLEpmQew0uQ9oua/dBbGP6Xbs 4Mf7KXz59tp+U+6JoNmdXU7jl/bE/QT75XTvpbS4E8pCtGxBcRGbd8JfoUhAzvQlXWDZiAHjRiRJ yJTknq07pflTbc0lVeLnNRAI0TcdsxDNPtVKUZKKtRYle7MUENrm9triUkfqz2Q/Vm/99xZb/609 gXWLiy6oAAAAAElFTkSuQmCC ]] local chair_normal_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAAyCAYAAAA9ZNlkAAALqklEQVRYhaWYaYxk11WAv3PvfWu9 6uqlZqZnxjM942XadizZBhyIAkSOIA4gUEhQAEMSCbFI5Ff+gJCQEEJCCP/hH0EiIkggASIJIQIC giRsWTByrNhRPHbsyWz2ZKZnequu5b177+HHq67udo+d2NzWUXfXq3fPd8/2znmiqrzRVfVXb3vT YO28vNG93JtR+nPH/55O2aVyCRVQ+ZrOzuDAd75bmO8IsLvpI/f+HeVij2qui+YJmlgwBlCIijRL /Nn4SarNAcXazdl93wnkdQGq/qref/Zj6F0n0H4X6eZIJ0VSiyQCAiBoFNRDnGTojmC2HV84/Y+E 5y5R9Vf19SBeE6Dqr+rZd36SyYkO+VKOWzC4TsQVDTbxGAtiQIEYIQTwteJHEb9j0fWSYvkMX77y ideFkNsF4Yd/+Lo+fY9n+3RD0jeU84aqMlSFoUqhSKCwUAgUQBGhCFB66EygGke625FiI5LciGxf cnz9Bcuv/NfyIYhDFviJx67q46uLXLi3xh9fJ+nVZB3IckhScA7s1P0irQVUIUTwAZoG6gbGPZAF 8AuWW9UcXzCWlXdd0nf9y2l5TYAH3veMvmP1Pk4tbbJyJqPuN0g5Ic0iSQKJE8w+5bs7RSDug6i9 4krQ0kIn40JmuTasuVQe5/xPP6Wrn/oeOQRQ9Vf1rY9/kbMnDcXyDg8uNaz1J4zdCJdEnGsVGyMY aQGmXkRRVHchFB+V2gsxM4w68FTYYmel4ULW4xyn+N59MeF2lS++9y/pdzvckdf0snXOdB29uRHI CDGxNbsIxgiw7/jTpQqKEmMrjQOfWjZVuLRzg/UMLmdHWet2+OZ7PjYLzJkFlrrHWMwSluwWnXqH JSK9PDJkjIq2Jpdd208hDiKgqmAiUbW1hhrWgW0ZM24S1uyYzazDWvfk4RiYy0sWM+jJDnkzZHm9 plhVXAj4CIiguwCY1vQy0w0oQpyaIhJRvMDINly9CXWds2GG3My7bBbVHkDVX1X5hScoq4S5UimT Ea6pqdbHHI3KZRv2lIpBxaAYdJ8VBEW0BRCNoBGIqIlcDQk7G4AXhumYLVWGIWXtZ3+bqr+qDqC7 cJRiwdAtPZkfY7zHDWvuHsGTc2MUi4qbKrYo5oAbWoA4/R0QpmICz28ofgTWJEzciO3cM3KGwWhl zwX5kQ75UqTMJqSDETIKWO+567pH5scEdRg8USxxCqDSukGmPmgBIqIBowGLBxO4+ArE6DA2UBdD RuWEca6MfHcPILlzg+xYgQPk2jaEGprAiYs76LmI14gxDiuhtYAcdoHRiFHFEDBEbPQ0BG5cVVRK yGp0fodm+ToTBd/Z3AMwp76BO75NHYWRjPBxgt30JIMRPiZ4NTiNqChRdAawW8RblDgDsRpJY8QR qLcbbJbh5sfkJ26RnBziJRLd5RZgsHZeqv6qhld+npuu5IpNyTVhUS3pYAt0ER8D0dCafvqzvxaI TuNgCiG0EKIQ6i3yYyW9k0NOrdxioTfBNEMefOdfcaAOPH/rGgtHSi7MlXSXe5SDglF1N0eyG9zy DZGUiJ1KnMbA9PTSZoGhjQODx2nNFZNSLS+Tz3uOLw85W21yTIfc/+3RLA0NtE3D02/5PFfqlJet 4eX5yGC+Qb69zK+e77BTD2m0wROIBKJElAASQaZKJWKIODxpbOjUQz7+bIdk6wzVQsOJXuSEtZwe pzz68OdnjYrZX8uuDXK2NGfTWWLiYTvjrqccmzsw9p6gnohH9wlTETwGj1VP7gOusVx51iCDApd4 es4ypzkntvID9XMGMFg7L5deNjR0qE1KMknQ2pJsBBaKDj6C4hGZIDKG28oEowEX4VbZodkKuDrD 1wmppCTaYeVbeqBNO/A4vvhPFYN75mlCj1e2VjjbjBA8/RK2QyQ1EScBK2BEERGYhmRAaESorcEb w40CtAmIMRzZ+CHc5BJd2WL5sx5+YE/nAYBktMSF/347R7aP07tpOBO+itDwnmaOT2Uv0LGGwigJ ETctvxFoEARDnD4p8yTyt1uraBghajh3/n5WbtzL2c4VYvx3LK8BkIY+8mSfxpZ46yGASODtn3uI L370fSx0CzIjmCZAE9DYRkFjBRKHsUKu4Dd2+Oqvn0fjk6Dg1hOSG4YYj1D7PsVrART1PKlYnBNc qogCJvK7n34Ly/fmuMyAE2Jr+X1pON1AofHKRp3z+59+mA8+8GUIgkdpGqFuHOMwfwBgFoT2I3+k uVYk3pB6SH1Eo+Gx879E/2hBPmdJOoIpQTogXZA50DnQCmIHYglNRxh3DTePFvzbcx+EaKhDoPFC Ewwj7d4+CySvyMhwKrigZDGi0dJfKCkKQ5KCTcC4ViSZ2s+BJqAOooOQQJPCsDCsLVZIhEnQtmGN homWhN/8k1krPnOBJI7MpzgMqUBKIKqh6CQ423bDGFADKhAFVNp9VKUt1TK9BtTAxDiMCrUEalE8 Qk2KptnhGBBryEhJxJA6SFwgBqFJAw7XTmGiM+W7flfaRNxVrAJYIQLWRow6JjbQRPDRMPEpOHMY AGsoyMisIXWKFQUrEITEgEVnwdcm224vsDsbTDvjKVAjgonSBi3KxME4GIaSo2avn9xDuVVTSkLh DNYAAaxpMNoqF21LfzuLTY97QKRtB6fiaRtTLzUECEYZWctQUng1QNVf1cKcpFxIyOaBXkQLJZEa J4LR6ckjSJQWJBwUjXtgsxkBoZEaKUB7ymQBhvMJ/lY2m55nLsjuS3HHhlgb2g1GE8y1GnNzqlxm qf/dLZ0G5FyNPTZGcoM30Pgxk8t7lWAG4E89Q3N6Dq89QuPwwwl1VOoNbR948XV1HV4CqY1kywF7 YgtbjEkSTyobOP36QYDB2nlJ//DPdePBp9myZxnXFWEYGLHJ9oue0KTYqLshfztdB/4RAWuEnpuQ 37GBW8wpSsNcss28f5HsG8scGM0AVCL/+9E+/d/4Dwbzd1CPx7zcu8q1L72NZly2vo570Q77fCLT lkym8WWEzMLJ7AbHznyFtDxFlSXM1xd5+Im3Qrl+2AW7bzvSZz9EtfIKozqwcfMdXOxcZHO0TK8R TNA24LQFOXDwXeXT8b2XKseLb7F07XHShXW2k4Tmwo8CX2ubyOmaZUFrOsuZrQW6L95J8+I5dq4c Zyu/xNp8w7CAOhW8m1bBfd4w7aGxTkgToSzg6PyETnqV8vIJ0pdW2XrpLBcG89OhhsNZYMQx3z1K TyDsZOyMHTowNPY6L529Qj53gu5mSjoWbCPI1CW7s6pYsImS5crcfM3Z/mXstVsU2wW5Bmzu2TTQ pCWJJIddYCTloXN3IC4w8QYsLGVjdHSD9ePnWVsO6KhLZ5SRNg7XGMy0KhoDzkXS1FMVY5bybebl ee585gf58bsjZTtEEVzguXtWeOjS2mEA0YTFRz9LcLbtdKXhnstbfOmTv8yHvv8zjBbWGZseSSyR kCDRTfsgxaIk1pOZhswMKcImcmuDObmPb77tT3lkqYNogsNyc2tC/PjSYQBHjk1eQJOpdxV2yoR6 IeO9//prfO0Dv4dNOxjTKr7dC4qIEqPHT7b568/9DguL1xDbgF2bZoow6AiR5cMA2VHhqBOiWrzm EEv+p9fF/NhL1MM1zlx9P5iANR4nglVB1LQNqUREIqLCZrRsREv+I8/xfeUWSXUaFwaIGSEy5nKm hGqvKxRVpeqv6geu/yKTmHHUVLiYYnD8zNVX+MSKJ7ZPoAPj14Hsnf3dOqV9TrZz0j9fL3j3Yr+d lkzN8TBgYiZ85NhfHBzNDO3goWYIRhEUq2H3Xci+pNMDSvcPqHrgaos7nIzAbc3wbFDqfRvMSvH+ F82PPPNb/ORCSb79Mk/0/5j/zzr1nx9mMFrmp27u8NhDfzD7/FAp3v2g6q+qSZ5FsoIHH/2bN/UK fv+q+quq19+Pup0DenaXefUNg7Xz8pV7P0Pls1dfetNrqB3e/cA/3P4w7cPlsHSWzulrXXuj8np7 /R/KZwgLEJp2wwAAAABJRU5ErkJggg== ]] local chair_occlusion_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAAyCAAAAAAYD4a4AAAACXBIWXMAAAsTAAALEwEAmpwYAAA5 7GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0w TXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRh LyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwNjcgNzkuMTU3NzQ3LCAyMDE1LzAzLzMw LTIzOjQwOjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMu b3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJk ZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFw LzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8x LjAvbW0vIgogICAgICAgICAgICB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAv MS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1 cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0 cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0i aHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0 dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5B ZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cyk8L3htcDpDcmVhdG9yVG9vbD4KICAgICAg ICAgPHhtcDpDcmVhdGVEYXRlPjIwMTgtMDUtMDVUMTU6NDg6NTktMDQ6MDA8L3htcDpDcmVhdGVE YXRlPgogICAgICAgICA8eG1wOk1ldGFkYXRhRGF0ZT4yMDE4LTA1LTA1VDE1OjQ4OjU5LTA0OjAw PC94bXA6TWV0YWRhdGFEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0wNS0wNVQx NTo0ODo1OS0wNDowMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXBNTTpJbnN0YW5jZUlE PnhtcC5paWQ6MTFlNjg4NmYtMTdiOS0xNDQ4LWEwYTMtMDdiYTAwMzgxYjQ5PC94bXBNTTpJbnN0 YW5jZUlEPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD5hZG9iZTpkb2NpZDpwaG90b3Nob3A6 NGFlN2Q0MGEtNTA5ZC0xMWU4LTk0MGUtYjEwMzlkNTEyNDNkPC94bXBNTTpEb2N1bWVudElEPgog ICAgICAgICA8eG1wTU06T3JpZ2luYWxEb2N1bWVudElEPnhtcC5kaWQ6OWRjZGZkZmQtYjhjZS02 MzRkLWFmMjgtNWU4NjhlNDk3ZmZkPC94bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+CiAgICAgICAg IDx4bXBNTTpIaXN0b3J5PgogICAgICAgICAgICA8cmRmOlNlcT4KICAgICAgICAgICAgICAgPHJk ZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDph Y3Rpb24+Y3JlYXRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5z dGFuY2VJRD54bXAuaWlkOjlkY2RmZGZkLWI4Y2UtNjM0ZC1hZjI4LTVlODY4ZTQ5N2ZmZDwvc3RF dnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxOC0wNS0wNVQx NTo0ODo1OS0wNDowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3 YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpPC9zdEV2dDpzb2Z0d2Fy ZUFnZW50PgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSBy ZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ c2F2ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+ eG1wLmlpZDoxMWU2ODg2Zi0xN2I5LTE0NDgtYTBhMy0wN2JhMDAzODFiNDk8L3N0RXZ0Omluc3Rh bmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTgtMDUtMDVUMTU6NDg6NTkt MDQ6MDA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50 PkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChXaW5kb3dzKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4K ICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAg ICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBN TTpIaXN0b3J5PgogICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3BuZzwvZGM6Zm9ybWF0PgogICAg ICAgICA8cGhvdG9zaG9wOkNvbG9yTW9kZT4xPC9waG90b3Nob3A6Q29sb3JNb2RlPgogICAgICAg ICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpY UmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZm OllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRp ZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6 Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhE aW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlE aW1lbnNpb24+NTA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlv bj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFj a2V0IGVuZD0idyI/Pi2YLTwAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdv kl/FRgAAA7RJREFUeNpklMmOHEUQhv/Ysqp7enrGGlsYmVUckIELB8QD8AwceDUugMQT8AZckEBY 4oDEImFkCyGNsOXprupacgsO1R557DilIr+MjIiM/MnxghEA4IZLb+z6zQUAkF9v+41Q/hJA9fqG 5Tz7DYAmZyImAhzu1Su1/gJwlYRFmJkBVC+1lFrbzXWS9dE6BFNlcQC1lpxSmuOHBIABIH/T7fth nlOKKccU52k47PucjxHI5y/2IecaqjCj1hLjNI7xLBo5GOQ+DN/tuv4wzimnlNM8Hfpu9+VhcCco gDqO2NcKYji75ziNh8MPGCenJYc8z/d/3B2mKeaUckpxHvtnDz+b5wyAyeGpzrjqhjnGnHNKcRq6 3fdzSQ4nBeDFy8MLMVVUQUnT0O/+haP4sQ9UAewsBEMRlDQe9ruv4Kj0vFEOf+PP0Aapyqhp6Lo9 Pr9+7lxmJYoY+iZUZdQ89P2ASCQzMdTpMrryHuN4sGyMmsbDOKInKfvpNVdgGkvgiGForBqjpmEY BvQcysEBhdMfrGiHq9a0LBH67hlaUua3HApA4MOq252oZCPUPHT9g09WE1yWKvxxSf2K5t44LVf0 PWjTpdr4Uub5Zb7oMAxSxsAoaeofAOFWrufHPtQmbNSf7m5tt0FQ4m7PFWETmnIEYrVGfPxoG6hm 8uZie/qba6M1HoEkFsw/3q6CMcFrmkNwDSZ5GblSRdV+2aya9tpOfzZVqUuESMxip00IQYVRC7xm NWb2qYUChUSkuWcazJjdmTzb642KUAEUqCRmzdU9VTMheKGiOrVqQvU5oNa+I2bBhKgWlJLea00Z C9COLCKkahaE4NlrEiIRXgaGDm32FalaMFWCE6qp0Hq9koZcgRBySK1a0zQq5GD2POv61lkjBCjA rLI+k7ZpGmGCC3tu5Gy9siUH71thXbebTWPMBK/C7E9aE8/RoQA/Oucn/9hFUCYC4C4aHj6+LXG4 s3ze1d/TvuU7BXQUMYeg/eu/5h4BCursfORduh2LuwMgsFhZbU9bc3IFXDZCeHq2jqVUgEgk9Jfb 7Umrx06uiM13dJe9VjgxU+keX5w02qRlJlet+6XPcsLHHGo/v0t3iSgBDLDnOPn9r+d8VD7P07cf DFPMDoCcRu+nxE8PsXrKFaJKYicXru0pVq5AOWmz//rmqfCir4Tqudu/zULj8XeTgYSY+LkSO0sM i+SSg4Dfx/gpbtpPtn4f8EVpKeWVvwTQqObPhdQt4hWL5i+Kub8CHF3/DwA+nSQOMD00SwAAAABJ RU5ErkJggg== ]] local globe_png = [[ iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAADAFBMVEUAAAAAAKoAqgAAqqqqAACq AKqqVQCqqqpVVVVVVf9V/1VV////VVX/Vf///1X///8AAAAUFBQgICAsLCw4ODhFRUVRUVFhYWFx cXGCgoKSkpKioqK2trbLy8vj4+P///8AAP9BAP99AP++AP//AP//AL7/AH3/AEH/AAD/QQD/fQD/ vgD//wC+/wB9/wBB/wAA/wAA/0EA/30A/74A//8Avv8Aff8AQf99ff+eff++ff/fff//ff//fd// fb7/fZ7/fX3/nn3/vn3/333//33f/32+/32e/319/319/559/759/999//993/99vv99nv+2tv/H tv/btv/rtv//tv//tuv/ttv/tsf/trb/x7b/27b/67b//7br/7bb/7bH/7a2/7a2/8e2/9u2/+u2 //+26/+22/+2x/8AAHEcAHE4AHFVAHFxAHFxAFVxADhxABxxAABxHABxOABxVQBxcQBVcQA4cQAc cQAAcQAAcRwAcTgAcVUAcXEAVXEAOHEAHHE4OHFFOHFVOHFhOHFxOHFxOGFxOFVxOEVxODhxRThx VThxYThxcThhcThVcThFcTg4cTg4cUU4cVU4cWE4cXE4YXE4VXE4RXFRUXFZUXFhUXFpUXFxUXFx UWlxUWFxUVlxUVFxWVFxYVFxaVFxcVFpcVFhcVFZcVFRcVFRcVlRcWFRcWlRcXFRaXFRYXFRWXEA AEEQAEEgAEEwAEFBAEFBADBBACBBABBBAABBEABBIABBMABBQQAwQQAgQQAQQQAAQQAAQRAAQSAA QTAAQUEAMEEAIEEAEEEgIEEoIEEwIEE4IEFBIEFBIDhBIDBBIChBICBBKCBBMCBBOCBBQSA4QSAw QSAoQSAgQSAgQSggQTAgQTggQUEgOEEgMEEgKEEsLEEwLEE0LEE8LEFBLEFBLDxBLDRBLDBBLCxB MCxBNCxBPCxBQSw8QSw0QSwwQSwsQSwsQTAsQTQsQTwsQUEsPEEsNEEsMEEAAAAAAAAAAAAAAAAA AAAAAAAAAAD///8fgDfZAAAAAXRSTlMAQObYZgAAAFJJREFUGJVtkMkRACEIBMmEN2r+8YnNqpQL 8+ua4RKhDJ0yaZ8sg37RAr2hjQDDBdpAE/IQDgURcw8AFJ7VRQN5rPZUfWL4Mz6DYuffXcXtz38m 6egcT48BScEAAAAASUVORK5CYII= ]] local pithos_albedo_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAArCAYAAAAZvYo3AAACa0lEQVRYhdVYMXLbMBBcalywiT5g fsBq2KRzGxUuPB77F27yBY+/kMa/oMejQkVqd2nU+AXyB1Jp0tBFcMjxdLg70HHhrTggsbtYnCAA zbezL6jE6LxvashO6OHny2/zw/VqOQLAzeVFbuu7FgCw2x9y27DZjonPNLJeLacGIsJ912ax0vP9 7TV2+0Pu5xkxDaxXy5FGXBIE/iZAbfSM1G+9Wo6WiaIBEtdi9pBNAMDlhWliYYlzQoJMghvMoqLP TTKhaR0lEB1537U4//MEAHjurtTvIklMErBGPhdeEjmB2jnf7Q947q7C38okkNYLtQYsQk5GVQ8c /zKinBMDHsl7IQuVG5jMfS1RrfGkNXID1STaaOb0W5Re1JJGIQeqFmGN8FzTRwZqp6C0Anr4kCmo wX+ZgtK/4RzMnoK5+FxTMGy2LgGhNACNg2OBtAoOm+2Hp0Dmh802r4ZmAmRMEpQgB8CEisgGZAoy iWiRaikSnxg9ALEjyiNmG1GItgi4EDeuJXI0BTJ23uYVFIloQqXpUHfFPAm+kyEiC3wbD0CN3TUg TXDCPh08NGi7Yq8QzYMJnw4u7G3F+67N/bxfgXs0I4K7h0cA/45eJCTPDHcPjxgCwoQmnY7DW7Jo DQR5GjeBuQJRvGtHpC1YtWjYBcV4f3s9eWmtfH3X4vT7LwDA64+v7rccqZ4aQBShJCkdNiOI9m3E FU2xGLUjW7SNg4qvZMA0YQlEzpRSvGTANUGC8pxoQRO3DFSZ8FASB+yfYWMtOvKmZI44YCdAUK/n tBoQ13VZwyKPGJgYkWY4RGKhC8saA6oZyVdL9AbzI85r6pNZ+QAAAABJRU5ErkJggg== ]] local pithos_normal_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAArCAYAAAAZvYo3AAAKKUlEQVRYha2YXYxkx1XHf+dU1b19 u3t6vr2za6/3w2uvmWwSx5FCSBTxoQwiUYRAQvgFhRcEUiKURwRvvISHiAQhOQiJOEJKJCOMeAAh hEHwRBwLRGwZY0eQNbb3y9md7+6+X1WHh9szO+vZXdsSt1VqtW7fOr/zP6fq1jliZnyQa2N9dN8H nn91Vz7IfP6DGn7o+ndY+dRnyNf6+EFAADduyW6MWX3he4f/e78g8l4KHEz4+EevsPp4n+xURJcj KYvULtEAbVRi7dBNR37VsfzalL/5wSneD8h9ATbWR7Z28Uf8xCcWWDjfoAslzFU0RUPlEpUapUCZ hKpVmmnAdjPcbsHCjwKPvbjDd147d1+Ie4ZgY31klzY2uXApMr+2i18eE4uautdgeUvrEqiRgJiE NipVz1P3A3F+zG5/wM7KkM+d2WJjfWT3grgrwMb6yJ78xW3W1ytGqzv4hTE2KKl7dWc8a1GXEO3U SzOA2jkqF2g0I1IzdjV72YjP9rbvCXEMYGN9ZOuf3+KJx6csr2wRhmOsN6HJKySvSXlDk7U4HxE1 bAYQW6XRQEWgsow21VhsGFtLfXGRz3/h7hD+3cbnPv0GT5xtODHapsj20DAmhinqSwgVTVbjsgb1 EdE0U0CJ6mgJNDGjbnNq3xB9RHOjGQkvnXH81mfePAbhjxr/zwvf5bfPjjg12mLk9wluDDqm1Qni pkQ/xfsK9RXiW9A0U0CJeNqU0/ic2hdUepAnUAfl2lzGv51Z4Jkbz90BcYcCP/3Iz3BxoWI57DPQ MY4JJmMa2cfcPl7HOJ2iWoI0IJ0CqGIaSNqj1YJaB1Ta0GIkEZwohIwfzhf8y7lPww/vEYL1xYJl v8nApvRSidqExD7INg27qOxijElpglFDiggg5pCUAQUmQ6JUNLTUs/zQ5ICcW37MawvLx5NwY31k V3/23zmbtywwoUhTsjhF05iYdklsgmzS2CZVnFArtOIw0W4Sq8nSlDxu460PTIm01CbE5NGYYbFk hyn/W7T84c+9fBiGQwXODZdZ0oa8rQlNTdaWaNynsW0S1xnLDSahoM0WsZCDOhBFACwhLuKlos+U pn6bfRra5GhihrY5NH2qtmJLGi4PF46HYDXr00sTsqYhqxuyuoR2j4Z32Bru0BQnwA9AcyCbPaqz pxPQgjbgS0IxYTFts7fjaWMPmiFS19RtwzTW3AxzxwGGLiNr9/DS4rXBZ1MsbfPj1V0snMRkDqyA 1AMCJH8YArEEFpFUI1YBEyT0WVm9xeV3tkn1Aq5qaatI00b2XTgOoCJoY2gyHBGfVbx9/jrmT4LN Qxxg9LGYYZphOJDZcjZDiJAasAriFLECcRlr52/w1tWTxLIlVYkUjSR2HKCWSKwFa0BSwmUlpich LWLNCEsDTHuY5Jh4wEGXAQgdgFiLWIWkElIBKQPniWWJTQ1qQVGy/C4At8KUchyIrcNaRfMa0jLW LJDSHEn7JMlJBEwChh4CgCEk1BqUHmo9NGVIdEhUUjlGJoJvHT3vWe5PjwNc6+2zbwvUdUZbe8gM axZJaUTSIUlm3uNnQw+TUEiz0aK0qGWoeTQpEgXGe/hJICMwdDkne7vHAa4MrvCWX+Z806NqcqIN SdXMuA5I5KRDgM64ITMN7E4I8ygOTYImcFsDsklOEXo8NOd5cHj9OMD14d9xefhx1reHzFUDxuUK qRx0xqWYAQTSDOBoCOQgBKTOsCmKoNYldX/zBAMZsBrmODcMnJr7x9sAG+sj++fPfhV9fZEfnLnG pVvLLG2PyKdLxKpPkl4nP1nnvbiZ9HfmAAcKmNJ9BDVQS4zGS8wXI073h3xs9Qbh9ZP8/cYfsLE+ si6IgwC58doDL/DSSceVYpnNuMzS194klTmpzEhlwEoPpccqj1UOqxxUDqkcUnX3pAxIGdBphisz bn7tDRbjMg8WSzyxFnh87ftYDvTDkRD0BMlh+8qY7z9ymRN75+jtrZL2m86w+Nvei4J08WeWA4J1 KpggJojNMsQCJ9tzPNB7gA8/NOQnL7zB0tVdyAWa2f4DQG5IbmgQ3jzxNN/70E1eeXiZq3Mn0a/f JM28tcpB6ZDSYXX3WyqH1A4rZ/eOKJK+/mNODU+xfnqJT63f4uzan5Ay6RTIjyZhliCABmFy/aP8 16PPMuDXaHWFsxZY+MZ17MtnDmMvKKKCmaCAiWFppomAmGFPX+PhU2d4+OI8n3hyl/WLz9G/vE4K gmYJ8nQUoEWyhGSK84HdzSGvfOTPKRefYnv5FGdeHjL37Vv4m1vErzyGRT1c/beXoaEO2j/6b4qV RVYfe4QzH8659PFrPPrwc4yuDIg+QAALBqE9AuBbJETUO9QLzgV29gpeefBb1Cd+ge3T65x4fY35 /1nB/+UetjlByorQRKYYFjy+l+OW+sw9eYH5RwIPXJxw/tIrrC1+l9GNx4guIEHQ1rAQITRHANwU 8UMkGOoVpx4vBY4V3h49T7vxMlsf+SQrb51i7s0R+fUFdNeIpREAzYXhvNBbS4xO77J4+hqray+y Nr5Kb/9RohSoetQJ5hMWWsyVtwEkvQN+AfEZ6hV1gtMMBzhz7MUd4oPP0p5z7LVPMLdzimKySN7k 5EDfV/QG28zNX2XgX2KlrulXiyRbJtIjaoZzQvJG8gl8C7bZATz/6q5srI/sX7/6+4jLEKeoc6gK TjIcijOPWk5pJdp7GTd4EZUpngYFcjx9KyhiQdEMMFsmWUEkEMUTVUgOzCXwDbiSz33jT7njSIaO Ed9DnJspoKgqTgLOdPZyKdA0RLQBjXDwXjeB5LAUSCmQzBPNEcV1xtVILmGuxVyD6eT4u0DSTXAD xDnECeI8qq47qIjHmUPNIylDUur2/xmAmWBJSElJpkRTkghJIGnnubmI+QbaEuzmbb+hK6F/6vee AdkHVyKuQTSiGhExVKRb+zjUApJySHl3PEs9LOWklGMWSLjutSRCEsM0kTRirgGtQMb80u9+i7sW JqSboAFUOxXUUPWIzI5sh1vvbBN+V2VvB0OsG5owbcG14EpMx3d4f3srnqnw5Je/DWyDjkFLcA1o p4ZoQiQhYry7xL3TcJoZjpg2s5iXoBNgh6e+9Mwd/QI9OtHzr+7Kh774TZAdRMeIThCtEK1npViL SASJCAkkYZKAhEnshradYa07yXXaOcQOv/7Fp481K46V5wfL8urffglkDrQFzRANiHpQQVRnm/5R CbozAWazZ5pOwTgF9vjNX/nmXTsld21QHEBs/sNvdBDS6woS9aAK4kAPsmH2lVK3NC2BtZjUGCXY Ll/5wp/ds01zzxbNAcT0n34VwhJIHySA+MOy7GhdgCYsRZC2CxcTiFv8zs//xX17RO+7S9Z74SmK MKTwOX0NFKoUIvSBvhmFJYrYUMSKoh7zx5989tCR+83/ngDvBgG48B+/TOFyCtEZQKKIFX/1sb8+ /P//W5/wvWCOXh+0SwrwfzC+F+McvyxUAAAAAElFTkSuQmCC ]] local pithos_occlusion_png = [[ iVBORw0KGgoAAAANSUhEUgAAACAAAAArCAAAAAA81tXrAAAACXBIWXMAAAsTAAALEwEAmpwYAAA5 7GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0w TXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRh LyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwNjcgNzkuMTU3NzQ3LCAyMDE1LzAzLzMw LTIzOjQwOjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMu b3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJk ZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFw LzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8x LjAvbW0vIgogICAgICAgICAgICB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAv MS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1 cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0 cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0i aHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0 dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5B ZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cyk8L3htcDpDcmVhdG9yVG9vbD4KICAgICAg ICAgPHhtcDpDcmVhdGVEYXRlPjIwMTgtMDUtMDVUMjI6Mjk6MjQtMDQ6MDA8L3htcDpDcmVhdGVE YXRlPgogICAgICAgICA8eG1wOk1ldGFkYXRhRGF0ZT4yMDE4LTA1LTA1VDIyOjI5OjI0LTA0OjAw PC94bXA6TWV0YWRhdGFEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0wNS0wNVQy MjoyOToyNC0wNDowMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXBNTTpJbnN0YW5jZUlE PnhtcC5paWQ6NDM5MzUyYTMtYmE0OC1iZDRmLWE1MDctNDkzN2E3OGYzMWU1PC94bXBNTTpJbnN0 YW5jZUlEPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD5hZG9iZTpkb2NpZDpwaG90b3Nob3A6 MmZlMGQ4Y2MtNTBkNS0xMWU4LTg5ODUtZDIwODYyMWI3NWE4PC94bXBNTTpEb2N1bWVudElEPgog ICAgICAgICA8eG1wTU06T3JpZ2luYWxEb2N1bWVudElEPnhtcC5kaWQ6NDdlZmEyNDItZjFhYS0w MjQxLWFiOGItNjg4ZTU4OTk3YWUwPC94bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+CiAgICAgICAg IDx4bXBNTTpIaXN0b3J5PgogICAgICAgICAgICA8cmRmOlNlcT4KICAgICAgICAgICAgICAgPHJk ZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDph Y3Rpb24+Y3JlYXRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6aW5z dGFuY2VJRD54bXAuaWlkOjQ3ZWZhMjQyLWYxYWEtMDI0MS1hYjhiLTY4OGU1ODk5N2FlMDwvc3RF dnQ6aW5zdGFuY2VJRD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OndoZW4+MjAxOC0wNS0wNVQy MjoyOToyNC0wNDowMDwvc3RFdnQ6d2hlbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OnNvZnR3 YXJlQWdlbnQ+QWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpPC9zdEV2dDpzb2Z0d2Fy ZUFnZW50PgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSBy ZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ c2F2ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+ eG1wLmlpZDo0MzkzNTJhMy1iYTQ4LWJkNGYtYTUwNy00OTM3YTc4ZjMxZTU8L3N0RXZ0Omluc3Rh bmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTgtMDUtMDVUMjI6Mjk6MjQt MDQ6MDA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50 PkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChXaW5kb3dzKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4K ICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAg ICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBN TTpIaXN0b3J5PgogICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3BuZzwvZGM6Zm9ybWF0PgogICAg ICAgICA8cGhvdG9zaG9wOkNvbG9yTW9kZT4xPC9waG90b3Nob3A6Q29sb3JNb2RlPgogICAgICAg ICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpY UmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZm OllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRp ZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6 Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhE aW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlE aW1lbnNpb24+NDM8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlv bj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFj a2V0IGVuZD0idyI/PnJ2x9IAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdv kl/FRgAAAs1JREFUeNpkVMuO20YQrOoZUdRKq9hYbYyFHQMGgj34m4x8QpDfcY5B/iL5gyCn5OJj Eiw2sSxpqQffM+UDST0cXnrQVewmq2uawulhH89z/hzW/04Az5JVXjQBbpROx2dkDTHPtoeykcxP ptfPrgbAD/jq0/pQVK1kfjyZbhfqGR2B4fG/dZbXTSvQJckkL+vQMXz3/sPDenMo6iYIdKMkreo6 djU8AGr5uHzK8rKuQ4S5JKmaKCaiAA9Q+cdPq90uL6qqjTCfpHUbI6+moroW69V6v9seDkXZBFiS TupWtKv5tG9RrrPDfrfdZtt90cJPZvM60CXZegHAg1pm2/yw2ywf15UEcvz8rjWfbLc7UR7AoSiL Q/bwoRIIKObF6t4naZXnQ4uiLnf//hFpg+jln8lkWhUFAAPQNHXx9JuMxwGZft+UTdP0hBhD/QsJ AJIEAOSvVRtDpwMcYklCggSABAkUgmNHGI+sJqQ4EAiQNUdp/5HTdCQoShIEiiSNcZQOQs2uJzNF RUGd30SLNp1czzpCnC/mN1KUTk6Lptv5Yi7AGErcvriJAy5AkGJcvLhlEWgQcPPq7gcJxwqC9P3d qwUgeIjb+ct9CahzqAiIuP/2JbJEMJAM6Zu3PwqnAtD7t28m0UAQbdu0X3H/94d3GIxK/Hz/+lqZ H3lPhLZt2+eMH//567v+H356/c3XThvvvXdEbNsQ2niLKltt9hXGs2eLeYrw5J3z3gi1IYQQ4oJA XQe4JAGwNOecc56EYhtiCFG6sUGmFcycM+ccKcYQYogxRnSzAAkzM2fOmTzATi2y15IgjWZm7Mdt gMjI3i0kSTOaGQAPUaQJjGeGMRpJDhfHAEHs7daXoFl/eUXRBPXjIgiSRoL9eEBBGjr0pjQesYEB dfNib9sjNAR1ZiFA8AI5RZ224SXwxeq7WIk6X6O6PHxBOK7ai9TnAQD+Tr2XbFipVQAAAABJRU5E rkJggg== ]] -- rendering defaults love.graphics.setDefaultFilter('nearest', 'nearest') -- constants local scale = 2 -- create canvas local canvas = love.graphics.newCanvas( (love.graphics.getWidth() / scale), (love.graphics.getHeight() / scale) ) -- center of window local cx = (love.graphics.getWidth() * 0.5) local cy = (love.graphics.getHeight() * 0.5) -- fragment shader local pixelcode = [[ extern Image normal_map; extern Image occlusion_map; extern vec3 light_position; vec3 light_color = vec3(1.0, 1.0, 1.0); vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords) { vec4 texcolor = Texel(texture, texture_coords); vec3 occlusion_map = Texel(occlusion_map, texture_coords).rgb; float bypass = occlusion_map.g; // normal vec3 normal = Texel(normal_map, texture_coords).rgb; normal = normalize(normal * 2.0 - 1.0); // light values vec3 light_direction = light_position - vec3(pixel_coords, 0); float light_distance = length(light_direction); float attenuation = smoothstep(100, 50, light_distance); light_direction = normalize(light_direction); // ambient vec3 ambient = (0.1 + occlusion_map.r * 0.6) * light_color; // diffuse vec3 diffuse = clamp(dot(normal, light_direction), 0.0, 1.0) * light_color; // specular vec3 halfway= normalize(light_direction); vec3 specular = pow(max(dot(normal, halfway), 0.0), 256.0) * light_color; specular *= 0.05; // attenuation ambient *= attenuation; diffuse *= attenuation; specular *= attenuation; // light vec3 light = (ambient + diffuse + specular); // cel shading light *= floor(light * 2) * 0.5; // final result return vec4(light * texcolor.rgb, texcolor.a); } ]] -- vertex shader local vertexcode = [[ vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; } ]] function love.load() local function load_image(file, name, flags) local decoded = love.data.decode("string", "base64", file) return love.graphics.newImage(love.filesystem.newFileData(decoded, name:gsub("_", ".")), flags) end -- load base64 images images = {} -- chair images.chair = {} images.chair.albedo = load_image(chair_albedo_png, "chair_albedo.png") images.chair.normal = load_image(chair_normal_png, "chair_normal.png") images.chair.occlusion = load_image(chair_occlusion_png, "chair_occlusion.png") -- pithos images.pithos = {} images.pithos.albedo = load_image(pithos_albedo_png, "pithos_albedo.png") images.pithos.normal = load_image(pithos_normal_png, "pithos_normal.png") images.pithos.occlusion = load_image(pithos_occlusion_png, "pithos_occlusion.png") -- globe images.globe = load_image(globe_png, "globe.png") -- create shader shader = love.graphics.newShader(pixelcode, vertexcode) -- default draw = {} draw.albedo = images.chair.albedo draw.normal = images.chair.normal draw.occlusion = images.chair.occlusion end local toggle = true function love.keypressed(key, scancode, isrepeat) if key == "tab" then toggle = not toggle end end -- values for light position local angle = 0 local radius = 80 local x, y function love.update(dt) -- rotate globe around center x = cx + radius * math.cos(angle) y = cy + radius * math.sin(angle) angle = angle + math.pi * dt * 0.5 if toggle then draw.albedo = images.chair.albedo draw.normal = images.chair.normal draw.occlusion = images.chair.occlusion else draw.albedo = images.pithos.albedo draw.normal = images.pithos.normal draw.occlusion = images.pithos.occlusion end end function love.draw() -- render to canvas canvas:renderTo(function() -- clear canvas love.graphics.clear() -- bind shader love.graphics.setShader(shader) shader:send("light_position", { x / 2, y / 2, 20.0 }) shader:send("normal_map", draw.normal) shader:send("occlusion_map", draw.occlusion) -- draw chair love.graphics.draw(draw.albedo, (cx/2) - (draw.albedo:getWidth() / 2), (cy/2) - (draw.albedo:getHeight() / 2) ) -- unbind shader love.graphics.setShader() -- draw light source (offset globe by 9px) love.graphics.draw(images.globe, (x / 2), (y / 2), 0, 1, 1, 9, 9) end) -- draw canvas love.graphics.draw(canvas, 0, 0, 0, 2, 2) end
local core = require('vfiler/libs/core') local a = require('vfiler/actions/open') local u = require('tests/utility') local configs = { options = u.vfiler.generate_options(), } describe('open actions', function() local vfiler = u.vfiler.start(configs) it(u.vfiler.desc('open by vsplit', vfiler), function() local view = vfiler._view core.cursor.move(u.int.random(2, view:num_lines())) vfiler:do_action(a.open_by_vsplit) end) vfiler:quit(true) end)
require 'nn' --pcall(require, './ConstrainedDiv') --pcall(require, './ConstrainedMul') local function PELU() local pelu = nn.Sequential() pelu:add(nn.ConstrainedMul(false)) pelu:add(nn.ELU(1, true)) pelu:add(nn.ConstrainedDiv(false)) return pelu end return PELU
local needsreloading = true local schedules = {} --Todo: Receive schedules local function ReceiveSchedules() schedules = {} for i=1,5 do table.insert(schedules, { from = StationNameFromID(math.random(1,100)), to = StationNameFromID(math.random(1,100)), line = math.random(1,3) }) end needsreloading = true end ReceiveSchedules() surface.CreateFont( "JobsLineNumber", { font = "Arial", size = 40, weight = 600 }) local frame, pnllist function OpenJobs() if not frame then frame = vgui.Create("DFrame") frame:SetSize(400, 600) frame:Center() frame:SetDeleteOnClose(false) frame:SetSizable(true) frame:SetTitle("Available Schedules") frame:MakePopup() pnllist = vgui.Create("DPanelList", frame) pnllist:Dock(FILL) pnllist:SetSpacing(2) end if needsreloading then pnllist:Clear() local function CreateSched(from, to, line) local pnl = vgui.Create("DPanel") pnl:SetTall(60) pnl:DockPadding(5,5,5,5) local linepnl = vgui.Create("DPanel", pnl) linepnl:Dock(LEFT) linepnl:DockMargin(0,0,5,0) linepnl:SetWide(60-10) linepnl.line = line linepnl.Paint = function(self,w,h) derma.GetDefaultSkin().tex.Panels.Normal(0, 0, w, h, LineColorFromID(self.line) ) draw.SimpleText(tostring(self.line), "JobsLineNumber", 25, 25, Color(50,50,50), 1, 1) end local lblfrom = vgui.Create("DLabel", pnl) lblfrom:Dock(TOP) lblfrom:SetDark(true) lblfrom:SetText("From: "..from) lblfrom:SizeToContents() local lblto = vgui.Create("DLabel", pnl) lblto:Dock(TOP) lblto:SetDark(true) lblto:SetText("To: "..to) lblto:SizeToContents() local btn = vgui.Create("DButton", pnl) btn:Dock(RIGHT) btn:SetZPos(-4) btn:SetWide(50) btn:SetText("Accept") pnllist:AddItem(pnl) end for k,v in pairs(schedules) do CreateSched(v.from, v.to, v.line) end needsreloading = false end frame:SetVisible(true) end concommand.Add("metrostroi_jobs", OpenJobs)
local API, Titles, _, L = ImmersionAPI, {}, ... L.TitlesMixin = Titles -- Upvalue for update scripts local GetScaledCursorPosition, UIParent = GetScaledCursorPosition, UIParent local NORMAL_QUEST_DISPLAY = NORMAL_QUEST_DISPLAY:gsub(0, 'f') local TRIVIAL_QUEST_DISPLAY = TRIVIAL_QUEST_DISPLAY:gsub(0, 'f') -- Priority local P_COMPLETE_QUEST = 1 local P_AVAILABLE_QUEST = 2 local P_AVAILABLE_GOSSIP = 3 local P_INCOMPLETE_QUEST = 4 -- Animation divisor local ANI_DIVISOR = 10 ---------------------------------- -- Display ---------------------------------- function Titles:AdjustHeight(newHeight) self.offset = 0 if ( ANI_DIVISOR == 0 ) then self:SetHeight(1) self:OnUpdateOffset() return elseif ( ANI_DIVISOR == 1 ) then self:SetHeight(newHeight) self:OnUpdateOffset() return end self:SetScript('OnUpdate', function(self) local height = self:GetHeight() local diff = newHeight - height if abs(newHeight - height) < 0.5 then self:SetHeight(newHeight) self:SetScript('OnUpdate', nil) else self:SetHeight(height + ( diff / ANI_DIVISOR ) ) end self:OnUpdateOffset() end) end function Titles:OnUpdateOffset() local anchor, relativeRegion, relativeKey, x, y, offset if not self.ignoreAtCursor and L('gossipatcursor') then local posX, posY = GetScaledCursorPosition() local uiX, uiY = UIParent:GetCenter() x, y = (posX - uiX), (posY - uiY) anchor, relativeRegion, relativeKey, offset = 'CENTER', UIParent, 'CENTER', 0 else anchor, relativeRegion, relativeKey, x, y = self:GetPoint() offset = (self.offset or 0) + L('titleoffsetY') end local diff = ( y - offset ) if ( offset == 0 ) or abs( y - offset ) < 0.3 then self:SetPoint(anchor, relativeRegion, relativeKey, x, offset) if self:GetScript('OnUpdate') == self.OnUpdateOffset then self:SetScript('OnUpdate', nil) end else self:SetPoint(anchor, relativeRegion, relativeKey, x, offset + (ANI_DIVISOR > 1 and (diff / ANI_DIVISOR) or 0)) end end function Titles:StopMoving() self:StopMovingOrSizing() local centerX, centerY = self:GetCenter() local scaleOffset = self:GetScale() * self:GetParent():GetScale() local uiX, uiY = GetScreenWidth() / 2 / scaleOffset, GetScreenHeight() / 2 / scaleOffset local newHorzVal, newVertVal = (centerX - uiX), (centerY - uiY) -- Horizontal clip fix if self:GetLeft() < 0 then newHorzVal = (self:GetWidth() / 2) - (GetScreenWidth() / 2) + 16 elseif ( GetScreenWidth() - self:GetRight() ) < 0 then newHorzVal = (GetScreenWidth() / 2) - (self:GetWidth() / 2) - 16 end -- Vertical clip fix if self:GetBottom() < 0 then newVertVal = (self:GetHeight() / 2) - (GetScreenHeight() / 2) + 16 elseif ( GetScreenHeight() - self:GetTop() ) < 0 then newVertVal = (GetScreenHeight() / 2) - (self:GetHeight() / 2) - 16 end self:ClearAllPoints() self:SetPoint('CENTER', UIParent, newHorzVal, newVertVal) L.Set('titleoffset', newHorzVal) L.Set('titleoffsetY', newVertVal) end function Titles:OnScroll(delta) self.offset = self.offset and self.offset + (-delta * 40) or (-delta * 40) self.ignoreAtCursor = true self:SetScript('OnUpdate', self.OnUpdateOffset) end function Titles:ResetPosition() self.offset = 0 self.ignoreAtCursor = false end function Titles:OnEvent(event, ...) if self[event] then self[event](self, ...) else self:Hide() end end function Titles:OnHide() for i, button in pairs(self.Buttons) do button:UnlockHighlight() button:Hide() end wipe(self.Active) self.numActive = 0 self.idx = 1 end function Titles:GetNumActive() return self.numActive or 0 end function Titles:GetButton(index) local button = self.Buttons[index] if not button then button = CreateFrame('Button', _ .. 'TitleButton' .. index, self, 'ImmersionTitleButtonTemplate') L.Mixin(button, L.ButtonMixin, L.ScalerMixin) button:Init(index) self.Buttons[index] = button end button:Show() return button end function Titles:UpdateActive() local newHeight, numActive = 0, 0 wipe(self.Active) for i, button in pairs(self.Buttons) do if button:IsShown() then newHeight = newHeight + button:GetHeight() numActive = numActive + 1 self.Active[i] = button end end ANI_DIVISOR = L('anidivisor') self.ignoreAtCursor = false self.numActive = numActive self:ResetPosition() self:AdjustHeight(newHeight) if self.SetFocus then local _, bestOptionIndex = self:GetBestOption() self:SetFocus(bestOptionIndex) end end function Titles:GetBestOption() local numActive = self:GetNumActive() if numActive > 0 then local option = self.Buttons[1] for i=2, numActive do option = option:ComparePriority(self.Buttons[i]) end return option, option.idx end end ---------------------------------- -- Gossip ---------------------------------- function Titles:GOSSIP_SHOW() self.idx = 1 self.type = 'Gossip' self:Show() self:UpdateAvailableQuests(GetGossipAvailableQuests()) self:UpdateActiveQuests(GetGossipActiveQuests()) self:UpdateGossipOptions(GetGossipOptions()) for i = self.idx, #self.Buttons do self.Buttons[i]:Hide() end self:UpdateActive() end function Titles:UpdateAvailableQuests(...) local titleIndex = 1 for i = 1, select('#', ...), API:GetAvailableQuestIterator() do local button = self:GetButton(self.idx) local titleText, level, isTrivial, frequency, isRepeatable, isLegendary = select(i, ...) ---------------------------------- local qType = ( isTrivial and TRIVIAL_QUEST_DISPLAY ) button:SetFormattedText(qType or NORMAL_QUEST_DISPLAY, titleText) ---------------------------------- local icon = ( isLegendary and 'AvailableLegendaryQuestIcon' ) or ( frequency == LE_QUEST_FREQUENCY_DAILY and 'DailyQuestIcon') or ( frequency == LE_QUEST_FREQUENCY_WEEKLY and 'DailyQuestIcon' ) or ( isRepeatable and 'DailyActiveQuestIcon' ) or ( 'AvailableQuestIcon' ) button:SetGossipQuestIcon(icon, qType and 0.5) button:SetPriority(P_AVAILABLE_QUEST) ---------------------------------- button:SetID(titleIndex) button.type = 'Available' ---------------------------------- self.idx = self.idx + 1 titleIndex = titleIndex + 1 end end function Titles:UpdateActiveQuests(...) local titleIndex = 1 local numActiveQuestData = select("#", ...) self.hasActiveQuests = (numActiveQuestData > 0) for i = 1, numActiveQuestData, API:GetActiveQuestIterator() do local button = self:GetButton(self.idx) local titleText, level, isTrivial, isComplete, isLegendary = select(i, ...) ---------------------------------- local qType = ( isTrivial and TRIVIAL_QUEST_DISPLAY ) button:SetFormattedText(qType or NORMAL_QUEST_DISPLAY, titleText) ---------------------------------- local icon = ( isComplete and isLegendary and 'ActiveLegendaryQuestIcon') or ( isComplete and 'ActiveQuestIcon' ) or ( 'InCompleteQuestIcon' ) button:SetGossipQuestIcon(icon, qType and 0.5) button:SetPriority(isComplete and P_COMPLETE_QUEST or P_INCOMPLETE_QUEST) ---------------------------------- button:SetID(titleIndex) button.type = 'Active' ---------------------------------- self.idx = self.idx + 1 titleIndex = titleIndex + 1 end end function Titles:UpdateGossipOptions(...) local titleIndex = 1 for i=1, select('#', ...), API:GetGossipOptionIterator() do local button = self:GetButton(self.idx) local titleText, icon = select(i, ...) ---------------------------------- button:SetText(titleText) button:SetGossipIcon(icon) button:SetPriority(P_AVAILABLE_GOSSIP) ---------------------------------- button:SetID(titleIndex) button.type = 'Gossip' ---------------------------------- self.idx = self.idx + 1 titleIndex = titleIndex + 1 end end function Titles:UNIT_QUEST_LOG_CHANGED() if self:IsVisible() then if ( self.type == 'Gossip' and self.hasActiveQuests ) then self:Hide() self:GOSSIP_SHOW() elseif ( self.type == 'Quests' ) then self:Hide() self:QUEST_GREETING() end end end ---------------------------------- -- Quest ---------------------------------- function Titles:QUEST_GREETING() self.idx = 1 self.type = 'Quests' self:Show() self:UpdateActiveGreetingQuests(GetNumActiveQuests()) self:UpdateAvailableGreetingQuests(GetNumAvailableQuests()) for i = self.idx, #self.Buttons do self.Buttons[i]:Hide() end self:UpdateActive() end function Titles:UpdateActiveGreetingQuests(numActiveQuests) for i=1, numActiveQuests do local button = self:GetButton(self.idx) local title, isComplete = GetActiveTitle(i) ---------------------------------- local qType = ( IsActiveQuestTrivial(i) and TRIVIAL_QUEST_DISPLAY ) button:SetFormattedText(qType or NORMAL_QUEST_DISPLAY, title) ---------------------------------- local icon = ( isComplete and API:IsActiveQuestLegendary(i) and 'ActiveLegendaryQuestIcon' ) or ( isComplete and 'ActiveQuestIcon') or ( 'InCompleteQuestIcon' ) button:SetGossipQuestIcon(icon, qType and 0.75) button:SetPriority(isComplete and P_COMPLETE_QUEST or P_INCOMPLETE_QUEST) ---------------------------------- button:SetID(i) button.type = 'ActiveQuest' ---------------------------------- self.idx = self.idx + 1 end end function Titles:UpdateAvailableGreetingQuests(numAvailableQuests) for i=1, numAvailableQuests do local button = self:GetButton(self.idx) local title = GetAvailableTitle(i) local isTrivial, frequency, isRepeatable, isLegendary = API:GetAvailableQuestInfo(i) ---------------------------------- local qType = ( isTrivial and TRIVIAL_QUEST_DISPLAY ) button:SetFormattedText(qType or NORMAL_QUEST_DISPLAY, title) ---------------------------------- local icon = ( isLegendary and 'AvailableLegendaryQuestIcon' ) or ( frequency == LE_QUEST_FREQUENCY_DAILY and 'DailyQuestIcon') or ( frequency == LE_QUEST_FREQUENCY_WEEKLY and 'DailyQuestIcon' ) or ( isRepeatable and 'DailyActiveQuestIcon' ) or ( 'AvailableQuestIcon' ) button:SetGossipQuestIcon(icon, qType and 0.5) button:SetPriority(P_AVAILABLE_QUEST) ---------------------------------- button:SetID(i) button.type = 'AvailableQuest' ---------------------------------- self.idx = self.idx + 1 end end
-- -*- coding: utf-8 -*- -- -- @Date : 2015-12-26 23:58 -- -- @Author : Alexa ([email protected]) -- -- @Link : -- -- @Disc : summary all the request local json = require "json" local VeryNginxConfig = require "VeryNginxConfig" local util = require "util" local request_tester = require "request_tester" local _M = {} local KEY_SUMMARY_REFRESHING_FLAG = "A_" local KEY_URI_STATUS = "B_" local KEY_URI_SIZE = "C_" local KEY_URI_TIME = "D_" local KEY_URI_COUNT = "E_" local KEY_COLLECT_STATUS = "F_" local KEY_COLLECT_SIZE = "G_" local KEY_COLLECT_TIME = "H_" local KEY_COLLECT_COUNT = "I_" function _M.refresh() local period = tonumber( VeryNginxConfig.configs["summary_request_enable"] ) if period == nil or period < 10 then period = 10 end ngx.timer.at( period, _M.refresh ) ngx.shared.summary_short:flush_all() --update flag timeout ngx.shared.status:set( KEY_SUMMARY_REFRESHING_FLAG, true, 120 ) end function _M.pre_run_matcher() if VeryNginxConfig.configs["summary_request_enable"] ~= true or VeryNginxConfig.configs["summary_collect_enable"] ~= true then return end local matcher_list = VeryNginxConfig.configs['matcher'] for i,rule in ipairs( VeryNginxConfig.configs["summary_collect_rule"] ) do local enable = rule['enable'] local matcher = matcher_list[ rule['matcher'] ] if enable == true and request_tester.test( matcher ) == true then ngx.ctx.log_collect_name = rule['collect_name'] break end end end function _M.log() local ok, err = ngx.shared.status:add( KEY_SUMMARY_REFRESHING_FLAG, true, 120 ) --here use set a 120s timeout for the flag key, so when the nginx worker exit( for example nginx-s reload may cause that ), --a other worker will continue to refresh the data period if ok then _M.refresh() end if VeryNginxConfig.configs["summary_request_enable"] ~= true then return end local with_host_info = VeryNginxConfig.configs["summary_with_host"] local uri = ngx.var.request_uri local status_code = ngx.var.status; local key_status = nil local key_size = nil local key_time = nil local key_count = nil local log_collect_name = ngx.ctx.log_collect_name local index = nil if log_collect_name ~= nil then key_status = KEY_COLLECT_STATUS..log_collect_name.."_"..status_code key_size = KEY_COLLECT_SIZE..log_collect_name key_time = KEY_COLLECT_TIME..log_collect_name key_count = KEY_COLLECT_COUNT..log_collect_name else if uri ~= nil then index = string.find( uri, '?' ) if index ~= nil then uri = string.sub( uri, 1 , index - 1 ) end end if with_host_info then uri = ngx.var.host..uri end key_status = KEY_URI_STATUS..(uri or '').."_"..status_code key_size = KEY_URI_SIZE..uri key_time = KEY_URI_TIME..uri key_count = KEY_URI_COUNT..uri end if VeryNginxConfig.configs["summary_group_persistent_enable"] == true then if ngx.shared.summary_long:get( key_count ) == nil then ngx.shared.summary_long:set( key_count, 0 ) end if ngx.shared.summary_long:get( key_status ) == nil then ngx.shared.summary_long:set( key_status, 0 ) end if ngx.shared.summary_long:get( key_size ) == nil then ngx.shared.summary_long:set( key_size, 0 ) end if ngx.shared.summary_long:get( key_time ) == nil then ngx.shared.summary_long:set( key_time, 0 ) end ngx.shared.summary_long:incr( key_count, 1 ) ngx.shared.summary_long:incr( key_status, 1 ) ngx.shared.summary_long:incr( key_size, ngx.var.body_bytes_sent ) ngx.shared.summary_long:incr( key_time, ngx.var.request_time ) end if VeryNginxConfig.configs["summary_group_temporary_enable"] == true then if ngx.shared.summary_short:get( key_count ) == nil then ngx.shared.summary_short:set( key_count, 0 ) end if ngx.shared.summary_short:get( key_status ) == nil then ngx.shared.summary_short:set( key_status, 0 ) end if ngx.shared.summary_short:get( key_size ) == nil then ngx.shared.summary_short:set( key_size, 0 ) end if ngx.shared.summary_short:get( key_time ) == nil then ngx.shared.summary_short:set( key_time, 0 ) end ngx.shared.summary_short:incr( key_count, 1 ) ngx.shared.summary_short:incr( key_status, 1 ) ngx.shared.summary_short:incr( key_size, ngx.var.body_bytes_sent ) ngx.shared.summary_short:incr( key_time, ngx.var.request_time ) end end function _M.report() local dict = nil local report = {} local uri_report = {} local collect_report = {} local record_key = nil local status = nil local size = nil local time = nil local count = nil report['uri'] = uri_report report['collect'] = collect_report local args = ngx.req.get_uri_args() if args['type'] == 'long' then dict = ngx.shared.summary_long elseif args['type'] == 'short' then dict = ngx.shared.summary_short else return json.encode({["ret"]="failed",["err"]="type error"}) end local keys = dict:get_keys(0) local str_sub = string.sub local str_len = string.len local str_format = string.format for k, v in pairs( keys ) do record_key = nil record_table = nil status = nil size = nil time = nil count = nil if v.find(v, KEY_URI_STATUS) == 1 then record_key = str_sub( v, str_len(KEY_URI_STATUS) + 1, -5 ) record_table = uri_report status = str_sub( v,-3 ) elseif v.find(v, KEY_URI_SIZE) == 1 then record_key = str_sub( v, str_len(KEY_URI_SIZE) + 1 ) record_table = uri_report size = dict:get( v ) elseif v.find(v, KEY_URI_TIME) == 1 then record_key = str_sub( v, str_len(KEY_URI_TIME) + 1 ) record_table = uri_report time = dict:get( v ) elseif v.find(v, KEY_URI_COUNT) == 1 then record_key = str_sub( v, str_len(KEY_URI_COUNT) + 1 ) record_table = uri_report count = dict:get( v ) elseif v.find(v, KEY_COLLECT_STATUS) == 1 then record_key = str_sub( v, str_len(KEY_COLLECT_STATUS) + 1, -5 ) record_table = collect_report status = str_sub( v,-3 ) elseif v.find(v, KEY_COLLECT_SIZE) == 1 then record_key = str_sub( v, str_len(KEY_COLLECT_SIZE) + 1 ) record_table = collect_report size = dict:get( v ) elseif v.find(v, KEY_COLLECT_TIME) == 1 then record_key = str_sub( v, str_len(KEY_COLLECT_TIME) + 1 ) record_table = collect_report time = dict:get( v ) elseif v.find(v, KEY_COLLECT_COUNT) == 1 then record_key = str_sub( v, str_len(KEY_COLLECT_COUNT) + 1 ) record_table = collect_report count = dict:get( v ) end if record_key ~= nil then if record_table[record_key] == nil then record_table[record_key] = {} record_table[record_key]["status"] = {} end if status ~= nil then record_table[record_key]["status"][status] = dict:get( v ) elseif time ~= nil then record_table[record_key]["time"] = time elseif size ~= nil then record_table[record_key]["size"] = size elseif count ~= nil then record_table[record_key]["count"] = count end end end --remove incomplete record for name,record_table in pairs( report ) do for k, v in pairs( record_table ) do if v['time'] == nil or v['count'] == nil or v['size'] == nil then record_table[k] = nil end end end return json.encode( report ) end function _M.clear() local args = util.get_request_args() local group = args['group'] if group == 'temporary' then ngx.shared.summary_short:flush_all() elseif group == 'persistent' then ngx.shared.summary_long:flush_all() elseif group == 'all' then ngx.shared.summary_short:flush_all() ngx.shared.summary_long:flush_all() end return '{}' end return _M
return { _name = 'DesignDrawing', id = 1110020080, learn_component_id = { 1021009132, }, }
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:28' 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. **************************************************************************** ]] ZO_SceneManager_Leader = ZO_SceneManager_Base:Subclass() --static ZO_SceneManager_Leader.bypassHideSceneConfirmationReason = 0 function ZO_SceneManager_Leader.AddBypassHideSceneConfirmationReason(name) ZO_SceneManager_Leader.bypassHideSceneConfirmationReason = ZO_SceneManager_Leader.bypassHideSceneConfirmationReason + 1 local reasonName = "ZO_BHSCR_"..name internalassert(_G[reasonName] == nil) _G[reasonName] = ZO_SceneManager_Leader.bypassHideSceneConfirmationReason end ZO_SceneManager_Leader.AddBypassHideSceneConfirmationReason("ALREADY_SEEN") ZO_SceneManager_Leader.AddBypassHideSceneConfirmationReason("INTERACT_ENDED") --class function ZO_SceneManager_Leader:New(...) return ZO_SceneManager_Base.New(self, ...) end function ZO_SceneManager_Leader:Initialize(...) ZO_SceneManager_Base.Initialize(self, ...) self.sceneStack = {} self.previousSceneStack = {} self.remoteSceneSequenceNumber = 0 EVENT_MANAGER:RegisterForEvent("SceneManager", EVENT_REMOTE_SCENE_REQUEST, function(eventId, ...) self:OnRemoteSceneRequest(...) end) end -- sequence number function ZO_SceneManager_Leader:GetNextSequenceNumber() self.remoteSceneSequenceNumber = self.remoteSceneSequenceNumber + 1 return self.remoteSceneSequenceNumber end function ZO_SceneManager_Leader:OnRemoteSceneRequest(messageOrigin, requestType, sceneName) if messageOrigin ~= ZO_REMOTE_SCENE_CHANGE_ORIGIN then if requestType == REMOTE_SCENE_REQUEST_TYPE_SHOW_BASE_SCENE then self:ShowBaseScene() return end local scene = self:GetScene(sceneName) if scene then if requestType == REMOTE_SCENE_REQUEST_TYPE_SWAP then self:SwapCurrentScene(sceneName) else if self:IsShowing(sceneName) then if requestType == REMOTE_SCENE_REQUEST_TYPE_HIDE then self:Hide(sceneName) end else if requestType == REMOTE_SCENE_REQUEST_TYPE_PUSH then self:Push(sceneName) elseif requestType == REMOTE_SCENE_REQUEST_TYPE_SHOW then self:Show(sceneName) end end end end end end -- scene stack function ZO_SceneManager_Leader:IsSceneOnStack(sceneName) if self.currentScene and self.nextScene and self.nextScenePushed and self.currentScene:GetName() == sceneName then return true end for i, currentSceneName in ipairs(self.sceneStack) do if currentSceneName == sceneName then return true end end return false end function ZO_SceneManager_Leader:IsSceneOnTopOfStack(sceneName) if self.currentScene and self.nextScene and self.nextScenePushed then return self.nextScene:GetName() == sceneName end return self.sceneStack[#self.sceneStack] == sceneName end function ZO_SceneManager_Leader:WasSceneOnStack(sceneName) for i, currentSceneName in ipairs(self.previousSceneStack) do if currentSceneName == sceneName then return true end end return false end function ZO_SceneManager_Leader:WasSceneOnTopOfStack(sceneName) if self.currentScene and self.nextScene and not self.nextSceneClearsSceneStack then return self.currentScene:GetName() == sceneName end return self.previousSceneStack[#self.previousSceneStack] == sceneName end function ZO_SceneManager_Leader:PushOnSceneStack(sceneName) if sceneName ~= self.baseScene:GetName() then self:CopySceneStackIntoPrevious() table.insert(self.sceneStack, sceneName) end end function ZO_SceneManager_Leader:PopScenesFromStack(numScenes) self:CopySceneStackIntoPrevious() for i = #self.sceneStack, #self.sceneStack - numScenes + 1, -1 do self.sceneStack[i] = nil end end function ZO_SceneManager_Leader:ClearSceneStack() self:CopySceneStackIntoPrevious() ZO_ClearNumericallyIndexedTable(self.sceneStack) end function ZO_SceneManager_Leader:CopySceneStackIntoPrevious() ZO_ClearNumericallyIndexedTable(self.previousSceneStack) for i, scene in ipairs(self.sceneStack) do self.previousSceneStack[i] = scene end end function ZO_SceneManager_Leader:CreateStackFromScratch(...) self:HideCurrentScene() self:ClearSceneStack() self:ShowBaseScene() self.dontAddCurrentSceneBackToStack = true local numScenes = select("#", ...) if numScenes > 0 then for i = 1, numScenes - 1 do self:PushOnSceneStack(select(i, ...)) end self:Push(select(numScenes, ...)) end end -- next scene overrides function ZO_SceneManager_Leader:SetNextScene(nextScene, push, nextSceneClearsSceneStack, numScenesNextScenePops) ZO_SceneManager_Base.SetNextScene(self, nextScene, push, nextSceneClearsSceneStack, numScenesNextScenePops) self.nextScenePushed = push self.nextSceneClearsSceneStack = nextSceneClearsSceneStack self.numScenesNextScenePops = numScenesNextScenePops end -- scene logic function ZO_SceneManager_Leader:PopScenes(numberOfScenes) if self.currentScene and self.currentScene:GetState() ~= SCENE_HIDING then local topSceneName if #self.sceneStack >= numberOfScenes then topSceneName = self.sceneStack[#self.sceneStack - numberOfScenes + 1] else topSceneName = self.baseScene:GetName() end local KEEP_SCENE_STACK = false self:Show(topSceneName, nil, KEEP_SCENE_STACK, numberOfScenes) end end function ZO_SceneManager_Leader:PopScenesAndShow(numberOfScenes, sceneToShow) if self.currentScene and self.currentScene:GetState() ~= SCENE_HIDING then if #self.sceneStack >= numberOfScenes then local KEEP_SCENE_STACK = false self:Show(sceneToShow, nil, KEEP_SCENE_STACK, numberOfScenes - 1) end end end --[[ Replace the current scene with a new scene while preserving the stack Current Stack --> New Stack | Current Scene | | New Scene | | Scene 2 | | Scene 2 | | Scene 1 | | Scene 1 | If there isn't actually anything on the stack, Show is used to replace the scene --]] function ZO_SceneManager_Leader:SwapCurrentScene(newCurrentScene) if #self.sceneStack >= 1 then local NUMBER_OF_SCENES_TO_POP = 1 self:PopScenesAndShow(NUMBER_OF_SCENES_TO_POP, newCurrentScene) else self:Show(newCurrentScene) end end function ZO_SceneManager_Leader:Push(sceneName) local IS_PUSH = true self:Show(sceneName, IS_PUSH) end function ZO_SceneManager_Leader:ShowWithFollowup(sceneName, resultCallback, push, nextSceneClearsSceneStack, numScenesNextScenePops, bypassHideSceneConfirmationReason) if self:WillCurrentSceneConfirmHide(bypassHideSceneConfirmationReason) then self.currentScene:RegisterCallback("HideSceneConfirmationResult", resultCallback) self:Show(sceneName, push, nextSceneClearsSceneStack, numScenesNextScenePops, bypassHideSceneConfirmationReason) else self:Show(sceneName, push, nextSceneClearsSceneStack, numScenesNextScenePops, bypassHideSceneConfirmationReason) local ALLOWED_TO_HIDE_CURRENT_SCENE = true resultCallback(ALLOWED_TO_HIDE_CURRENT_SCENE) end end -- Note that push, nextSceneClearsSceneStack, numScenesNextScenePops, and bypassHideSceneConfirmationReason are meant to be INTERNAL parameters. They should NOT -- be used when calling Show from outside of this file. These same params should be passed to ConfirmHideScene. function ZO_SceneManager_Leader:Show(sceneName, push, nextSceneClearsSceneStack, numScenesNextScenePops, bypassHideSceneConfirmationReason) local currentScene = self.currentScene local nextScene = self.scenes[sceneName] if nextScene == nil then internalassert(false, string.format("Missing scene: %q", sceneName or "missing scene name")) return end if nextSceneClearsSceneStack == nil then nextSceneClearsSceneStack = true end if numScenesNextScenePops == nil then numScenesNextScenePops = 0 end --if a scene exists if currentScene then if nextScene ~= currentScene then --If we need confirmation to hide this scene go request it unless we've already done that and this is the response if self:WillCurrentSceneConfirmHide(bypassHideSceneConfirmationReason) then return currentScene:ConfirmHideScene(sceneName, push, nextSceneClearsSceneStack, numScenesNextScenePops, bypassHideSceneConfirmationReason) end if self.nextScene then if nextScene ~= self.nextScene then local oldNextScene = self.nextScene self:SetNextScene(nextScene, push, nextSceneClearsSceneStack, numScenesNextScenePops) currentScene:RefreshFragments() local CURRENT_SCENE_IGNORED = "" local NO_SEQUENCE_NUMBER = 0 local FRAGMENT_COMPLETE_STATE_IGNORED = false local nextSceneName = self.nextScene and self.nextScene:GetName() or ZO_REMOTE_SCENE_NO_SCENE_IDENTIFIER SendLeaderToFollowerSync(ZO_REMOTE_SCENE_CHANGE_ORIGIN, REMOTE_SCENE_SYNC_TYPE_CHANGE_NEXT_SCENE, CURRENT_SCENE_IGNORED, nextSceneName, NO_SEQUENCE_NUMBER, FRAGMENT_COMPLETE_STATE_IGNORED) self:OnNextSceneRemovedFromQueue(oldNextScene, nextScene) end else self:SetNextScene(nextScene, push, nextSceneClearsSceneStack, numScenesNextScenePops) self:HideScene(currentScene) end else if currentScene:GetState() == SCENE_HIDING then local oldNextScene = self.nextScene self:ClearNextScene() self:ShowScene(currentScene) if oldNextScene then self:OnNextSceneRemovedFromQueue(oldNextScene, self.nextScene) end end end else --otherwise, start showing this scene self.previousScene = self.currentScene self:SetCurrentScene(nextScene) self:ShowScene(self.currentScene) end end function ZO_SceneManager_Leader:Hide(sceneName) if self.currentScene and self.currentScene:GetName() == sceneName and self.currentScene:GetState() ~= SCENE_HIDING then self:PopScenes(1) end end function ZO_SceneManager_Leader:WillCurrentSceneConfirmHide(bypassHideSceneConfirmationReason) local currentScene = self.currentScene return currentScene and currentScene:HasHideSceneConfirmation() and bypassHideSceneConfirmationReason ~= ZO_BHSCR_ALREADY_SEEN and currentScene:IsShowing() end function ZO_SceneManager_Leader:ShowScene(scene) ZO_SceneManager_Base.ShowScene(self, scene, self:GetNextSequenceNumber()) end function ZO_SceneManager_Leader:HideScene(scene) ZO_SceneManager_Base.HideScene(self, scene, self:GetNextSequenceNumber()) end function ZO_SceneManager_Leader:SyncFollower() local currentScene = self:GetCurrentScene() local syncType = currentScene:IsShowing() and REMOTE_SCENE_SYNC_TYPE_SHOW_SCENE or REMOTE_SCENE_SYNC_TYPE_HIDE_SCENE local currentSceneName = currentScene:GetName() local sequenceNumber = 0 local currentSceneTransitionComplete = true if currentScene:IsRemoteScene() then sequenceNumber = currentScene:GetSequenceNumber() if currentScene:GetState() == SCENE_SHOWING or currentScene:GetState() == SCENE_HIDING then currentSceneTransitionComplete = currentScene:AreFragmentsDoneTransitioning() end end local nextSceneName = self.nextScene and self.nextScene:GetName() or ZO_REMOTE_SCENE_NO_SCENE_IDENTIFIER SendLeaderToFollowerSync(ZO_REMOTE_SCENE_CHANGE_ORIGIN, syncType, currentSceneName, nextSceneName, sequenceNumber, currentSceneTransitionComplete) end function ZO_SceneManager_Leader:OnSceneStateChange(scene, oldState, newState) if scene == self:GetCurrentScene() then if newState == SCENE_HIDING or newState == SCENE_SHOWING then self:SyncFollower() end end ZO_SceneManager_Base.OnSceneStateChange(self, scene, oldState, newState) end -- override of ZO_SceneManager_Base:OnSceneStateHidden function ZO_SceneManager_Leader:OnSceneStateHidden(scene) local lastSceneGroup = scene:GetSceneGroup() local nextSceneGroup local currentNextScene = self.nextScene if currentNextScene then nextSceneGroup = currentNextScene:GetSceneGroup() end if lastSceneGroup ~= nextSceneGroup then if lastSceneGroup ~= nil then lastSceneGroup:SetState(SCENE_GROUP_HIDDEN) end if nextSceneGroup ~= nil then nextSceneGroup:SetState(SCENE_GROUP_SHOWING) -- Check to see if self.nextScene has changed as a result of nextSceneGroup:SetState(SCENE_GROUP_SHOWING) if currentNextScene ~= self.nextScene then -- If self.nextScene has changed and currentNextScene's scene group is no longer showing, we set its state to SCENE_GROUP_HIDDEN local newNextSceneGroup = self.nextScene and self.nextScene:GetSceneGroup() if nextSceneGroup ~= newNextSceneGroup then nextSceneGroup:SetState(SCENE_GROUP_HIDDEN) end -- Update currentNextScene to the new scene currentNextScene = self.nextScene end end end if currentNextScene then local push = self.nextScenePushed if push then if not self.dontAddCurrentSceneBackToStack then self:PushOnSceneStack(scene:GetName()) end elseif self.nextSceneClearsSceneStack then self:ClearSceneStack() elseif self.numScenesNextScenePops > 0 then self:PopScenesFromStack(self.numScenesNextScenePops) end if self.dontAddCurrentSceneBackToStack then self.dontAddCurrentSceneBackToStack = false else self.previousScene = self:GetCurrentScene() end self:SetCurrentScene(currentNextScene) self:ClearNextScene() self:ShowScene(self:GetCurrentScene(), push) end end function ZO_SceneManager_Leader:SendFragmentCompleteMessage() self:SyncFollower() end function ZO_SceneManager_Leader:RequestShowLeaderBaseScene(bypassHideSceneConfirmationReason) if bypassHideSceneConfirmationReason then local DEFAULT_PUSH = nil local DEFAULT_NEXT_SCENE_CLEARS_SCENE_STACK = nil local DEFAULT_NUM_SCENES_NEXT_SCENE_POPS = nil self:Show(self:GetBaseScene():GetName(), DEFAULT_PUSH, DEFAULT_NEXT_SCENE_CLEARS_SCENE_STACK, DEFAULT_NUM_SCENES_NEXT_SCENE_POPS, bypassHideSceneConfirmationReason) else self:ShowBaseScene() end end
-- Dragonsand local TileSounds = {[6] = {[0] = 91, [1] = 52}} function events.TileSound(t) local Grp = TileSounds[Game.CurrentTileBin[Map.TileMap[t.X][t.Y]].TileSet] if Grp then t.Sound = Grp[t.Run] end -- Dimension door if t.X == 89 and t.Y == 47 then TownPortalControls.DimDoorEvent() end end function events.AfterLoadMap() Party.QBits[956] = true -- DDMapBuff, changed for rev4 for merge end -- Dimension door evt.Map[105] = TownPortalControls.DimDoorEvent -- Shrine of the Gods mapvars.GotBless = mapvars.GotBless or (Map.Refilled and Map.Refilled.GotBless) or {} Game.MapEvtLines:RemoveEvent(103) evt.Hint[103] = evt.str[16] evt.Map[103] = function() if Game.CurrentPlayer == -1 then return end local CurrentChar = Party.PlayersIndexes[Game.CurrentPlayer] if mapvars.GotBless[CurrentChar] then evt.Set{"MainCondition", 0} else mapvars.GotBless[CurrentChar] = true evt.Add{"FireResistance", 20} evt.Add{"AirResistance", 20} evt.Add{"WaterResistance", 20} evt.Add{"EarthResistance", 20} evt.Add{"SpiritResistance", 20} evt.Add{"MindResistance", 20} evt.Add{"BodyResistance", 20} evt.Add{"BaseMight", 20} evt.Add{"BaseIntellect", 20} evt.Add{"BasePersonality", 20} evt.Add{"BaseEndurance", 20} evt.Add{"BaseSpeed", 20} evt.Add{"BaseAccuracy", 20} evt.Add{"BaseLuck", 20} evt.PlaySound{42797} Game.ShowStatusText(evt.str[7]) end end
competent_panshee_ritualist = Creature:new { objectName = "@mob/creature_names:competent_panshee_ritualist", randomNameType = NAME_GENERIC, randomNameTag = true, socialGroup = "panshee_tribe", faction = "panshee_tribe", level = 22, chanceHit = 0.33, damageMin = 190, damageMax = 200, baseXp = 2006, baseHAM = 5000, baseHAMmax = 6100, armor = 1, resists = {40,40,40,40,40,40,40,40,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0.0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK, optionsBitmask = AIENABLED, diet = HERBIVORE, templates = { "object/mobile/dressed_ewok_f_02.iff", "object/mobile/dressed_ewok_f_10.iff", "object/mobile/dressed_ewok_f_11.iff", "object/mobile/dressed_ewok_m_02.iff"}, lootGroups = { { groups = { {group = "ewok", chance = 10000000} }, lootChance = 1440000 } }, weapons = {"ewok_weapons"}, conversationTemplate = "", attacks = merge(marksmanmaster,brawlermaster) } CreatureTemplates:addCreatureTemplate(competent_panshee_ritualist, "competent_panshee_ritualist")
local util = require 'util' local tnorm, snorm, complement, defuzzification = {}, {}, {}, {} function tnorm.Min(a, b) return util.minimum(a, b) end function snorm.Max(a, b) return util.maximum(a, b) end function complement.Not(a) return 1.0 - a end function defuzzification.centroid(set) local n, d = 0., 0. for _, v in ipairs(set) do n = n + v[1] * v[2] d = d + v[2] end if d == 0 then return 0 end return n/d end return { tnorms = tnorm, snorms = snorm, complement = complement, defuzz = defuzzification, }
local DungeonIIIETCVendorID = 43477 local DungeonIIIETCLoop = { ["Stoff"] = {27902,27795,27517,27525,29255,28406,29241,27919,29249,29258,}, ["Leder"] = {27783,29263,28398,29248,27914,32769,28339,}, ["Schwere"] = {29261,29243,27521,27915,29259,29262,}, ["Platte"] = {27884,29463,29254,28375,29252,27918,27985,32778,28318,}, } -- Warrior = 1 -- -- Paladin = 2 -- -- Hunter = 3 -- -- Rogue = 4 -- -- Priest = 5 -- -- Death Knight = 6 -- -- Shaman = 7 -- -- Mage = 8 -- -- Warlock = 9 -- -- Druid = 11 -- local function DungeonIIIETCVendor_OnGossip(event, player, object) player:GossipMenuAddItem(10, "R\195\188stung Kaufen", 0, 1) player:GossipSendMenu(99, object) end local function DungeonIIIETCVendor_OnSelect(event, player, object, sender, intid, code, menuid) VendorRemoveAllItems(DungeonIIIETCVendorID) player:GetClass() if (intid == 1) then if (player:GetClass() == 5) or (player:GetClass() == 8) or (player:GetClass() == 9) then for _, DIIICloth in ipairs (DungeonIIIETCLoop.Stoff) do AddVendorItem(DungeonIIIETCVendorID, DIIICloth, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 4) or (player:GetClass() == 11) then for _, DIIILeather in ipairs (DungeonIIIETCLoop.Leder) do AddVendorItem(DungeonIIIETCVendorID, DIIILeather, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 3) or (player:GetClass() == 7) then for _, DIIIHeavy in ipairs (DungeonIIIETCLoop.Schwere) do AddVendorItem(DungeonIIIETCVendorID, DIIIHeavy, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 1) or (player:GetClass() == 2) or (player:GetClass() == 6) then for _, DIIIPlate in ipairs (DungeonIIIETCLoop.Platte) do AddVendorItem(DungeonIIIETCVendorID, DIIIPlate, 0, 0, 0) end player:SendListInventory(object) end end end RegisterCreatureGossipEvent(DungeonIIIETCVendorID, 1, DungeonIIIETCVendor_OnGossip) RegisterCreatureGossipEvent(DungeonIIIETCVendorID, 2, DungeonIIIETCVendor_OnSelect) ----------------------------------- --------[[Made by PassCody]]------- --[[Made for KappaLounge Repack]]-- -----------------------------------
local VoiceSocket = require('./VoiceSocket') local VoiceConnection = require('./VoiceConnection') local constants = require('./constants') local CHANNELS = constants.CHANNELS local SAMPLE_RATE = constants.SAMPLE_RATE local wrap, resume = coroutine.wrap, coroutine.resume local VoiceManager, property, method = class('VoiceManager') VoiceManager.__description = "The client's handler of voice connections." function VoiceManager:__init(client) self._client = client self._connections = {} self._joining = {} self._leaving = {} end local opus local function loadOpus(self, filename) opus = opus or require('./opus')(filename or 'opus') self._opus = opus end local sodium local function loadSodium(self, filename) sodium = sodium or require('./sodium')(filename or 'sodium') self._sodium = sodium end function VoiceManager:_createVoiceConnection(data, channel, state) local socket = VoiceSocket(self) local encoder = opus.Encoder(SAMPLE_RATE, CHANNELS) local connection = VoiceConnection(encoder, channel, socket, self) self._connections[state.guild_id] = connection connection:setBitrate(self._client._options.bitrate) wrap(function() if not socket:connect(data.endpoint) then return self._client:warning('Could not connect to voice server: ' .. data.endpoint) end socket:identify({ server_id = state.guild_id, user_id = state.user_id, session_id = state.session_id, token = data.token, }) return socket:handlePayloads(state.guild_id, connection) end)() end function VoiceManager:_resumeJoin(id) local connection = self._connections[id] if connection then connection._channel._parent._connection = connection end local thread = self._joining[id] self._joining[id] = nil if thread then return assert(resume(thread, connection)) end end function VoiceManager:_resumeLeave(id) local connection = self._connections[id] if connection then connection._channel._parent._connection = nil self._connections[id] = nil end local thread = self._leaving[id] self._leaving[id] = nil if thread then return assert(resume(thread, true)) end end local function getConnections(self) local i, v = 1 local connections = self._connections return function() v = connections[i] i = i + 1 return v end end local function pauseStreams(self) for _, connection in pairs(self._connections) do if connection._stream then connection._stream:pause() end end end local function resumeStreams(self) for _, connection in pairs(self._connections) do if connection._stream then connection._stream:resume() end end end local function stopStreams(self) for _, connection in pairs(self._connections) do if connection._stream then connection._stream:stop() end end end property('connections', getConnections, nil, 'function', "An iterator for the client's active voice connections") method('loadOpus', loadOpus, 'path', "Loads a dynamic libopus file (.dll, .so).") method('loadSodium', loadSodium, 'path', "Loads a dynamic libsodium file (.dll, .so).") method('pauseStreams', pauseStreams, nil, "Pauses active audio streams for all existing connections.", 'WS') method('resumeStreams', resumeStreams, nil, "Resumes active audio streams for all existing connections.", 'WS') method('stopStreams', stopStreams, nil, "Stops active audio streams for all existing connections.", 'WS') return VoiceManager
shell = require("shell") shell.execute("move -f /home/.shrc /home/.shrc.old") shell.execute("move -f /argon/.autorun /home/.shrc") shell.execute("rm -rf /argon")
local GameScreen = require("game.GameScreen") function love.load() love.physics.setMeter(1) screen = GameScreen.new() end function love.draw() screen:draw() end function love.resize(w, h) screen:resize(w, h) end function love.update(dt) screen:update(dt) end
object_tangible_furniture_decorative_professor_desk = object_tangible_furniture_decorative_shared_professor_desk:new { } ObjectTemplates:addTemplate(object_tangible_furniture_decorative_professor_desk, "object/tangible/furniture/decorative/professor_desk.iff")
function mod_hit(id, source, weapon, hpdmg, apdmg, rawdmg, object) if Player[id].var_god_toggle then return 1 end if cloud.settings.modules.freeroam == true then if source ~= 0 then if freeroam[id].insafezone or freeroam[source].insafezone then return 1 end -- victim, attacker cannot hurt eachother while protection is ON if freeroam[id].safe_protection == 1 or freeroam[source].safe_protection == 1 then return 1 end end end if cloud.settings.modules.prison == true then if weapon == 78 then return 1 end end end addhook("hit","mod_hit")
local wantedPoints = {} addEventHandler("onResourceStart", resourceRoot, function () for _, plr in ipairs(Element.getAllByType("player")) do if (not plr.account.guest) then setWantedPoints(plr, exports.UCDaccounts:GAD(plr, "wp")) end end end ) addEventHandler("onResourceStop", resourceRoot, function () for _, plr in ipairs(Element.getAllByType("player")) do if (not plr.account.guest) then exports.UCDaccounts:SAD(plr, "wp", getWantedPoints(plr)) end end end ) function addWantedPoints(plr, wp) if (plr and wp and not plr.account.guest and tonumber(wp)) then wp = tonumber(wp) local a = plr.account.name if (not wantedPoints[a]) then wantedPoints[a] = 0 end setWantedPoints(plr, wantedPoints[a] + wp) exports.UCDstats:setPlayerAccountStat(plr, "lifetimeWanted", exports.UCDstats:getPlayerAccountStat(plr, "lifetimeWanted") + wp) if (math.floor(wp / 2) > 0) then exports.UCDaccounts:SAD(plr, "crimXP", exports.UCDaccounts:GAD(plr, "crimXP") + math.floor(wp / 2)) end return true end end function getWantedPoints(plr) if (plr and not plr.account.guest) then local a = plr.account.name if (not wantedPoints[a]) then wantedPoints[a] = exports.UCDaccounts:GAD(plr, "wp") or 0 end return wantedPoints[a] end end function setWantedPoints(plr, wp) if (plr and wp and not plr.account.guest and tonumber(wp)) then wp = tonumber(wp) local a = plr.account.name if (not wantedPoints[a]) then wantedPoints[a] = wp return true end wantedPoints[a] = wp plr:setData("w", wantedPoints[a]) triggerEvent("onPlayerWPChange", plr, wantedPoints[a]) -- For MDTs if (Team.getFromName("Law") and Team.getFromName("Law").players and #Team.getFromName("Law").players >= 1) then triggerClientEvent(Team.getFromName("Law").players or {}, "UCDmdt.onPlayerWPChange", plr) end return true end end function onPlayerWPChange(wp) -- Stars if (wp > 0 and wp <= 10) then source.wantedLevel = 1 elseif (wp > 10 and wp < 20) then source.wantedLevel = 2 elseif (wp >= 20 and wp < 30) then source.wantedLevel = 3 elseif (wp >= 30 and wp < 40) then source.wantedLevel = 4 elseif (wp >= 40 and wp < 50) then source.wantedLevel = 5 elseif (wp > 50) then --if (source.wantedLevel ~= 60) then source.wantedLevel = 6 --end else source.wantedLevel = 0 end -- Nametag if (wp > 0) then source.nametagText = "["..tostring(source.wantedLevel).."] "..tostring(source.name) else source.nametagText = source.name end if (wp > 0) then if (source.team.name == "Law") then exports.UCDjobs:setPlayerJob(source, "Criminal") end end if (wp > 0) then exports.UCDdx:add(source, "wp", "Wanted Points: "..wp, 255, 0, 0) else exports.UCDdx:del(source, "wp") end triggerClientEvent("UCDmdt.onPlayerWPChange", resourceRoot) end addEvent("onPlayerWPChange") addEventHandler("onPlayerWPChange", root, onPlayerWPChange) addEventHandler("onPlayerChangeNick", root, function () if (getWantedPoints(source) and getWantedPoints(source) > 0) then source.nametagText = "["..tostring(source.wantedLevel).."] "..tostring(source.name) end end ) Timer( function () for _, plr in ipairs(Element.getAllByType("player")) do if (getWantedPoints(plr) and not exports.UCDlaw:isPlayerArrested(plr)) then if (getWantedPoints(plr) > 0) then setWantedPoints(plr, getWantedPoints(plr) - 1) end end end end, 60 * 1000, 0 )
-------------------------------------- -- CharacterData -------------------------------------- -- Data about an individual character in the guild -------------------------------------- -- DEFINITION + CONSTRUCTOR -------------------------------------- CharacterData = { Name = nil, -- character name Class = nil, -- character class Spec = nil, -- character specialization (val) ["Raid Role"] = nil, --DPS, Healer, or Tank ["Guild Role"] = nil, --Disenchanter, Guild Banker, or None Status = nil, -- Main or Alt } CharacterData.__index = CharacterData; function CharacterData:new(character_data,name,class) if character_data == nil then -- initalize fresh local obj = {}; obj.Name = name; obj.Class = class; local default_spec = SKC.CLASSES[class].DEFAULT_SPEC; obj.Spec = SKC.CLASSES[class].Specs[default_spec].val; obj["Raid Role"] = SKC.CHARACTER_DATA["Raid Role"].OPTIONS[SKC.CLASSES[class].Specs[default_spec].RR].val; obj["Guild Role"] = SKC.CHARACTER_DATA["Guild Role"].OPTIONS.None.val; obj.Status = SKC.CHARACTER_DATA.Status.OPTIONS.Main.val; setmetatable(obj,CharacterData); return obj; else -- set metatable of existing table setmetatable(character_data,CharacterData); return character_data; end end -------------------------------------- -- METHODS --------------------------------------
--[[ XML lib by Dante van Gemert Converts: - lua tables to XML - XML output from xmlread to lua tables ]]-- local xml = {} -- XML TO LUA xml.input = {} function xml.input.string(input) return input[1] end function xml.input.integer(input) return tonumber(input[1]) end function xml.input.array(input) local array = {} for i = 1, #input do table.insert( array, xml.input(input[i]) ) end return array end function xml.input.dict(input) local dict = {} for i = 1, #input, 2 do dict[ input[i][1] ] = xml.input(input[i+1]) end return dict end function xml.input.plist(input) local plist = {} table.insert( plist, xml.input(input[1]) ) return plist end function xml.input.attributes(input) local attr = {} for i = 1, #input do attr[ input[i].name ] = input[i].args end return attr end setmetatable( xml.input, {__call = function( _, input ) if not input then return end if not xml.input[input.name] then error("Incompatible xml element: "..input.name) end return xml.input[input.name](input) end} ) -- LUA TO XML xml.output = {} xml.output.types = { string = "string", number = "integer", } local function tag( name, attr, empty ) local s = "<"..name for k, v in pairs( attr or {} ) do s = s.." "..tostring(k)..'="'..tostring(v)..'"' end return empty and s.." />" or s..">" end function xml.output.toString( data, level ) if type(data) ~= "table" then error("Expected table") end level = level or 0 if level > 128 then error( "Max table depth (128) reached (recursive tables are not supported)" ) end local s = tag( data.name, data.attr, #data == 0 ) if #data == 1 and type(data[1]) ~= "table" then s = s..tostring( data[1] ) elseif #data > 0 then for _, v in ipairs(data) do if type(v) == "table" then s = s.."\n"..string.rep( " ", level+1 )..xml.output.toString( v, level+1 ) else s = s.."\n"..string.rep( " ", level+1 )..tostring( v ) end end s = s.."\n"..string.rep( " ", level ) end return #data == 0 and s or s.."</"..data.name..">" end function xml.output.array( input, attr, xmlType ) if type(input) ~= "table" then error("Expected table") end local data = { name = "array", attr = attr, } for _, v in ipairs(input) do table.insert( data, {name = xmlType, v} ) end return data end function xml.output.dict( input, attr ) if type(input) ~= "table" then error("Expected table") end local data = { name = "dict", attr = attr, } for k, v in pairs(input) do table.insert( data, {name = "key", tostring(k)} ) table.insert( data, {name = xml.output.types[type(v)], v} ) end return data end function xml.output.plist( input, attr ) if type(input) ~= "table" then error("Expected table") end local data = { name = "plist", attr = attr, unpack(input), } return data end -- RETURN return xml
includes(path.join(os.scriptdir(), "../clang/xmake.lua")) toolchain_clang("12")
-- Copyright (c) 2019 Redfern, Trevor <[email protected]> -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT describe("Component", function() local Component = require "moonpie.ui.components.component" Component("test", function() return { } end) describe("Function components", function() it("allows you to pass an initialization function to define the component", function() Component("button", function(props) return { foo = props.value } end) local new = Component.button({ value = "something" }) assert.equals("something", new.foo) end) it("can handle state", function() Component("button", function() local b = {} b.set_value = function(v) b.foo = v end return b end) local b = Component.button() b.set_value("Some state") assert.equals("Some state", b.foo) end) it("assigns the name of the component", function() Component("button", function() return {} end) local s = Component.button() assert.equals("button", s.name) end) describe("show/hide", function() before_each(function() Component("show_hide", function() return {} end) end) it("can show and hide the component", function() local s = Component.show_hide() s:hide() assert.is_true(s:isHidden()) s:show() assert.is_false(s:isHidden()) end) it("flags it's been updated", function() local s = Component.show_hide() s:hide() assert.is_true(s:hasUpdates()) end) end) describe("Modifying state/update", function() Component("text", function(props) return { text = props.text } end) local txt = Component.text({ text = "Hi there!" }) assert.equals("Hi there!", txt.text) Component("updates", function() return { a = "a", b = "b", c = "c" } end) it("can be updated and flagged that it has changed", function() local c = Component.updates() assert.equals("a", c.a) assert.equals("b", c.b) assert.equals("c", c.c) c:update({ a = "abcd" }) assert.is_true(c:hasUpdates()) assert.equals("abcd", c.a) end) it("does not flag it's been updated if all the properties are the same", function() local c = Component.updates() c:update{ a = "a", b = "b", c = "c" } assert.is_falsy(c:hasUpdates()) end) it("adds to the update queue after updating", function() local update_queue = require "moonpie.ui.update_queue" update_queue:clear() local c = Component.updates() c:update { a = "abcd" } assert.equals(c, update_queue[1]) end) it("can force an update if necessary", function() local updateQueue = require "moonpie.ui.update_queue" updateQueue:clear() local c= Component.updates() c:forceRefresh() assert.equals(c, updateQueue[1]) assert.is_true(c:hasUpdates()) end) it("can trigger a callback when it's been updated", function() local cb = spy.new(function() end) local c = Component.updates { onUpdate = cb } local change = { a = "abcd" } c:update(change) assert.spy(cb).was.called_with(c, change) end) end) describe("Copiable properties", function() it("can copy list of properties", function() local values = { backgroundColor = "red", border = 2, borderColor = "green", click = spy.new(function() end), clickSound = {}, color = "blue", data = {}, mounted = function() end, drawComponent = function() end, fontName = "Arial", fontSize = 18, height = 624, hidden = true, id = "foo", keyPressed = spy.new(function() end), keyReleased = spy.new(function() end), margin = 10, mouseDown = spy.new(function() end), mouseUp = spy.new(function() end), padding = 5, paint = spy.new(function() end), position = "absolute", style = "some", targetLayer = "layer", textwrap = "wrapping", unmounted = function() end, width = 250 --do_not_copy = "fail" } local c = Component.text(values) for k, v in pairs(values) do assert.equals(v, c[k]) end end) it("can use templating in copy properties to make assigning ids or styles easier", function() local c = Component.text { id = "{{tricky}}_value_id", tricky = 123 } assert.equals("123_value_id", c.id) end) end) describe("finding children", function() before_each(function() Component("text", function(props) return { text = props.text } end) Component("big", function() return { Component.text({ id = "1", text = "1" }), Component.text({ id = 2, text = "2" }), Component.text({ id = 3, text = "3" }), { Component.text({ id = 4, text = "4" }) } } end) end) it("can find child components if an id is provided", function() local b = Component.big() local t1 = b:findByID("1") local t2 = b:findByID(2) local t3 = b:findByID(3) assert.equals("1", t1.text) assert.equals("2", t2.text) assert.equals("3", t3.text) end) it("can search it's entire tree that it created", function() local b = Component.big() local t4 = b:findByID(4) assert.equals("4", t4.text) end) it("searchs the child property if present to findByID as well", function() local b = Component.big() local c = { id = "turtles" } b.children = { c } assert.equals(c, b:findByID("turtles")) end) it("can find all components by name", function() local b = Component.big() local texts = b:findAllByName("text") assert.equals(4, #texts) end) end) end) describe("focus management", function() it("can have it's focus set", function() local UserFocus = require "moonpie.ui.user_focus" local c = Component.test() c:setFocus() assert.equals(c, UserFocus:getFocus()) end) end) describe("changing style", function() Component("style_test", function() return {} end) it("can add styles", function() local s = Component.style_test() s:addStyle("new_style") assert.matches("new_style", s.style) end) it("can remove a style", function() local s = Component.style_test({ style = "style1 style2 style3" }) assert.matches("style1", s.style) assert.matches("style2", s.style) assert.matches("style3", s.style) s:removeStyle("style2") assert.matches("style1", s.style) assert.not_matches("style2", s.style) assert.matches("style3", s.style) end) end) it("can add component properties to any table", function() local t = { } Component.addComponentMethods(t) assert.not_nil(t.isHidden) assert.equals("function", type(t.isHidden)) assert.is_true(t.hasComponentMethods) end) it("does not replace the methods if the add component methods is called again", function() local t = {} Component.addComponentMethods(t) local m = t.isHidden Component.addComponentMethods(t) assert.equals(m, t.isHidden) end) it("can get it's node from the render engine", function() local RenderEngine = require "moonpie.ui.render_engine" local comp = Component.button({}) RenderEngine("ui", comp) local node = RenderEngine.findByComponent(comp) assert.not_nil(node) assert.equals(node, comp:getNode()) assert.not_nil(comp:getNode()) end) it("can be flagged for removal", function() local c = Component.button() c:flagRemoval() assert.is_true(c:needsRemoval()) assert.is_true(c:hasUpdates()) end) it("can use remove component", function() local c = Component.button() c:remove() assert.is_true(c:needsRemoval()) assert.is_true(c:hasUpdates()) end) it("returns decipherable error if component render function is not set up properly", function() Component("bad_component", function() end) assert.has_errors(Component.bad_component, "Component did not render table") end) it("provides easy access to the logger", function() local logger = require "moonpie.logger" logger:clear() Component("logging", function() return { log = function(self) self.logger.debug("Hooray") end } end) local l = Component.logging() l:log() assert.equals("Hooray", logger.entries[1].message) end) it("returns the function that is used to create component", function() local f = Component("super_cool", function() return {} end) assert.equals(Component.super_cool, f) end) describe("new-creation-scheme", function() it("can define component creation function without factory model", function() local funky = Component("funky", function(props) return { a = props.a } end) local instance = funky({ a = "test", color = "green" }) assert.equals("test", instance.a) assert.equals("green", instance.color) end) end) end)
return {'dabben','dab','dabde','dabt'}
big_game_hunter = Creature:new { objectName = "", customName = "a Big Game Hunter", socialGroup = "", pvpFaction = "", faction = "", level = 300, chanceHit = 100, damageMin = 95, damageMax = 95, baseXp = 100, baseHAM = 3900000, baseHAMmax = 4300000, armor = 1, resists = {85,85,85,85,85,85,85,85,85}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = NONE, creatureBitmask = NONE, optionsBitmask = 264, diet = HERBIVORE, templates = {"object/mobile/dressed_death_watch_silver.iff"}, lootGroups = {}, weapons = {"imperial_weapons_heavy"}, conversationTemplate = {}, attacks = {} } CreatureTemplates:addCreatureTemplate(big_game_hunter, "big_game_hunter")
/silent-command if game.forces['player'].technologies['{tech_name}'] then if game.forces['player'].technologies['{tech_name}'].researched ~= {tech_researched} then game.forces['player'].technologies['{tech_name}'].researched = {tech_researched} end if game.forces['player'].technologies['{tech_name}'].level ~= {tech_level} then game.forces['player'].technologies['{tech_name}'].level = {tech_level} end script.raise_event(defines.events.on_research_finished, {research=game.forces['player'].technologies['{tech_name}'], by_script=true}) game.play_sound({path="utility/research_completed"}) if game.forces['player'].technologies['{tech_name}'].researched == false then game.print("Technology {tech_name} synced at level {tech_level}") else game.print("Technology {tech_name} synced") end end
local drawing = require("drawing") local utils = require("utils") local dreamBlock = {} dreamBlock.depth = -2000000 function dreamBlock.draw(room, entity) local pr, pg, pb, pa = love.graphics.getColor() love.graphics.setColor(1, 1, 1) love.graphics.rectangle("fill", entity.x, entity.y, entity.width, entity.height ) math.randomseed(entity.x + entity.y) love.graphics.setColor(0, 0, 0) love.graphics.rectangle("fill", entity.x+1, entity.y+1, entity.width-2, entity.height-2 ) for i=1,10+((entity.width+1) * (entity.height+1))/(2000) do love.graphics.setColor(math.random(0,255)/255,math.random(0,255)/255, math.random(0,255)/255) love.graphics.rectangle("fill", math.random(entity.x+1,entity.x+entity.width-2), math.random(entity.y+1,entity.y+entity.height-2), 1,1 ) end love.graphics.setColor(pr, pg, pb, pa) end return dreamBlock
assets = {} assets.color_bg = Color("#070203") assets.color_jumperscore = Color("#ecb72f") assets.color_jumperlose = Color("#d60042") assets.color_jumperbonus = Color("#00b9f7") assets.color_walls = Color("#bcb3aa") assets.color_disker = Color("#d60000") assets.color_effects = Color("#bcb3aa") assets.main_font = love.graphics.newFont('assets/fonts/FutilePro.ttf', 16) assets.secondary_font = love.graphics.newFont('assets/fonts/m5x7.ttf', 16) assets.main_font:setFilter('nearest', 'nearest') assets.secondary_font:setFilter('nearest', 'nearest') sfx = {} sfx_volume = 1 sfx.slice = Sound('slice.ogg', {volume = .7 * sfx_volume}) sfx.combo = Sound('combo.ogg', {volume = 1 * sfx_volume}) sfx.ost = Sound('ost.ogg', { volume = .9 * sfx_volume, loop = true}) sfx.hit = Sound('hit.ogg', { volume = .8 * sfx_volume}) sfx.fall = Sound('fall.ogg', { volume = .7 * sfx_volume}) sfx.death = Sound('death.ogg', { volume = .65 * sfx_volume}) sfx.death2 = Sound('death2.ogg', { volume = .8 * sfx_volume}) sfx.scum = Sound('scum.ogg', { volume = .5 * sfx_volume}) sfx.fail = Sound('fail.wav', { volume = .5 * sfx_volume}) sfx.powerup = Sound('powerup.wav', { volume = .8 * sfx_volume}) sfx.powerup2 = Sound('powerup2.wav', { volume = .8 * sfx_volume}) sfx.ohgod = Sound('ohgod.ogg', { volume = .3 * sfx_volume}) sfx.triple = Sound('triple.ogg', { volume = .2 * sfx_volume}) sfx.horns = Sound('horns.mp3', { volume = .6 * sfx_volume}) if not web then for s, _ in pairs(sfx) do sfx[s].default_v = sfx[s].volume end end function update_volume(v) for s, _ in pairs(sfx) do sfx[s].volume = sfx[s].default_v * sfx_volume end love.audio.setVolume(sfx.ost.volume * sfx_volume) sfx.fail:play() end
mapFields = require "lib/mapFields" if target.field == mapFields.getID("OrbisStationEntrance") then selection = self.ask_menu("Hello, I'm the information guide for Orbis Station. Which of our destinations would you like to know more about?", { [0] = "Victoria Island", [1] = "Ludibrium", [2] = "Leafre", [3] = "Mu Lung", [4] = "Ariant", [5] = "Ereve", [6] = "Edelstein" }) if selection == 0 then self.say("Are you trying to go to Victoria Island? Oh, it's a beautiful island with an abundance of beautiful forests. The ship that goes to Victoria #bleaves every " .. target.as_continent(200000111).term .." minutes on the hour#k.") elseif selection == 1 then self.say("Are you heading towards Ludibrium in Lake Ludus? It's a fun little town that mainly consists of toys. The ship that heads to Ludibrium #bleaves at the top of the hour, and every " .. target.as_continent(200000121).term .. " minutes afterwards#k.") elseif selection == 2 then self.say("Are you heading towards Leafre of Minar Forest? It's a cozy little town where the halflingers reside. The ship that heads to Leafre #bleaves at the top of the hour, and every " .. target.as_continent(200000131).term .. " minutes afterwards#k.") elseif selection == 3 then self.say("Are you heading towards Mu Lung in the Mu Lung Temple? I'm sorry, but there's no ship that flies from Orbis to Mu Lung. There is another way to get there, though. There's a #bCrane that runs a cab service for 1 that's always available#k, so you'll get there as soon as you wish.") elseif selection == 4 then self.say("Are you heading towards Ariant in Nihal Desert? It's a town full of alchemists that live the life with vigor much like the scorching desert heat. The ship that heads to Ariant #bleaves at the top of the hour, and every 10 minutes afterwards#k.") elseif selection == 5 then self.say("Are you heading towards Ereve? It's a beautiful island blessed with the presence of the Shinsoo the Holy Beast and Empress Cygnus. #bThe boat is for 1 person and it's always readily available#k so you can travel to Ereve fast.") elseif selection == 6 then self.say("Are you going to Edelstein? The brave people who live there constantly fight the influence of dangerous monsters. #b1-person Airship to Edelstein is always on standby#k, so you can use it at any time.") end elseif target.field == mapFields.getID("StationToOrbis") then contimove = target.as_continent() self.say({ "Hi there! I'm #p1032007#, and I work in this station. Are you thinking of leaving Victoria Island for other places? This station is where you'll find the ship that heads to #bOrbis Station#k of Ossyria leaving #bat the top of the hour, and every " .. contimove.term .. " minutes afterwards#k.", "If you are thinking of going to Orbis, please go talk to #b#p1032008##k on the right.", "Well, the truth is, we charged for these flights until very recently, but the alchemists of Magatia made a crucial discovery on the fuel that dramaticaly cuts down the amount of Mana used for the flight, so these flight are now free. Don't worry, we still get paid. Now we just get paid through the government." }) end
-- Modified version of wallpaper.lua that allows filters to be applied require("imlib2") local filter_name, inpath, outpath = ... assert(filter_name and inpath and outpath, "Usage: filter.lua [blur|sharpen|color-blur|emboss|grayscale|saturation|edge-detection] input_image output_image") local photo = imlib2.image.load(inpath) local filter = imlib2.filter.new() imlib2.set_filter(filter) -- Filters ported from: -- http://svn.enlightenment.org/svn/e/trunk/imlib2/src/bin/imlib2_show.c -- http://docs.gimp.org/en/plug-in-convmatrix.html gives a basic intro to -- how the filters work if (filter_name == "blur") then -- Blur filter filter:set(0, 0, 0, 8, 8, 8) filter:set(-1, 0, 0, 4, 4, 4) filter:set(0, -1, 0, 4, 4, 4) filter:set(1, 0, 0, 4, 4, 4) filter:set(0, 1, 0, 4, 4, 4) filter:set(-2, 0, 0, 1, 1, 1) filter:set(0, -2, 0, 1, 1, 1) filter:set(2, 0, 0, 1, 1, 1) filter:set(0, 2, 0, 1, 1, 1) filter:set(-1, -1, 0, 1, 1, 1) filter:set(-1, 1, 0, 1, 1, 1) filter:set(1, -1, 0, 1, 1, 1) filter:set(1, 1, 0, 1, 1, 1) elseif (filter_name == "sharpen") then -- Sharpen filter filter:set(0, 0, 0, 5, 5, 5) filter:set(-1, 0, 0, -1, -1, -1) filter:set(0, -1, 0, -1, -1, -1) filter:set(1, 0, 0, -1, -1, -1) filter:set(0, 1, 0, -1, -1, -1) elseif (filter_name == "color-blur") then -- Color blur filter filter:set(0, 0, 0, 3, 3, 3) filter:set(-1, -1, 0, 1, 0, 0) filter:set(1, -1, 0, 0, 1, 0) filter:set(0, 1, 0, 0, 0, 1) elseif (filter_name == "emboss") then -- Emboss filter filter:set_red(-1, -1, 0, -1, -1, -1) filter:set_red(0, 0, 0, 1, 1, 1) filter:set_green(-1, -1, 0, -1, -1, -1) filter:set_green(0, 0, 0, 1, 1, 1) filter:set_blue(-1, -1, 0, -1, -1, -1) filter:set_blue(0, 0, 0, 1, 1, 1) filter:constants(0, 768, 768, 768) filter:divisors(0, 6, 6, 6) elseif (filter_name == "grayscale") then -- Grayscale filter filter:set_red(0, 0, 0, 80, 1, 1) filter:set_green(0, 0, 0, 1, 80, 1) filter:set_blue(0, 0, 0, 1, 1, 80) elseif (filter_name == "saturation") then -- Saturation filter filter:set_red(0, 0, 0, 80, -1, -1) filter:set_green(0, 0, 0, -1, 80, -1) filter:set_blue(0, 0, 0, -1, -1, 80) elseif (filter_name == "edge") then -- Edge detection filter filter:set(-1, -1, 0, -1, -1, -1) filter:set(-1, 0, 0, -3, -3, -3) filter:set(-1, 1, 0, -1, -1, -1) filter:set(0, -1, 0, -3, -3, -3) filter:set(0, 0, 0, 16, 16, 16) filter:set(0, 1, 0, -3, -3, -3) filter:set(1, -1, 0, -1, -1, -1) filter:set(1, 0, 0, -3, -3, -3) filter:set(1, 1, 0, -1, -1, -1) filter:divisors(0, 3, 3, 3) else -- Raise error for unknown filter error("'" .. filter_name .. "' is not a recognised filter") end photo:filter(filter) photo:save(outpath)
--[[ Created by Zyrex#3641 Modified by Pikalyzix MASSIVE THANK YOU to zyrex Documentation: library:CreateWindow(Name <string>) Window:Toggle(Name <string>, Callback <function>) Window:Button(Name <string>, Callback <function>) Window:Slider(Name <string>, Min <number>, Max <number>, Callback <function>) Window:Dropdown(Name <string>, List <table>, Callback <function>) Window:Box(Name <string>, Callback <function>) Window:Label(Name <string>) This is open-sourced and free to use. You may use it for your own scripts as long as you give credits. --]] _G.Toggle_GUI = _G.Toggle_GUI or Enum.KeyCode.RightControl local library = {WindowCount = 0} local Windows = {} local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local function RS(Length) math.randomseed(os.time()) local Possible = "QWERTYUIOPASDFGKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890" local Characters = {} local Output = "" Possible:gsub(".", function(v) table.insert(Characters, v) end) for i = 1, Length do local RandomChar = math.random(1, #Characters) Output = Output .. Characters[RandomChar] end return Output end local function makeDraggable(obj) --// Original code by Tiffblocks, edited so that it has a cool tween to it. local gui = obj local dragging local dragInput local dragStart local startPos local function update(input) local delta = input.Position - dragStart local EndPos = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) local Tween = TweenService:Create( gui, TweenInfo.new(0.2), {Position = EndPos} ) Tween:Play() end gui.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = gui.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) gui.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging then update(input) end end) end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Parent = game.CoreGui ScreenGui.Name = RS(7) local GuiToggled = false local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(v) if v.KeyCode == _G.Toggle_GUI then GuiToggled = not GuiToggled if GuiToggled == true then ScreenGui.Enabled = false else ScreenGui.Enabled = true end end end) function library:CreateWindow(text) library.WindowCount = library.WindowCount + 1 text = text or "Title" local Frame = Instance.new("ImageLabel") local Header = Instance.new("ImageLabel") local ObjectFrame = Instance.new("Frame") local UIListLayout1 = Instance.new("UIListLayout") local ToggleWindowBtn = Instance.new("ImageButton") local Title = Instance.new("TextLabel") table.insert(Windows, Frame) Frame.Name = "Frame" Frame.Parent = ScreenGui Frame.BackgroundColor3 = Color3.fromRGB(30, 20, 40) Frame.BackgroundTransparency = 1.000 Frame.ClipsDescendants = false Frame.Position = UDim2.new(0, (40 + (200 * library.WindowCount) - 200), 0, 11) Frame.Size = UDim2.new(0, 187, 0, UIListLayout1.AbsoluteContentSize.Y + 45) Frame.Image = "rbxassetid://3570695787" Frame.ImageColor3 = Color3.fromRGB(26, 26, 26) Frame.ScaleType = Enum.ScaleType.Slice Frame.SliceCenter = Rect.new(100, 100, 100, 100) Frame.SliceScale = 0.040 makeDraggable(Frame) Header.Name = "Header" Header.Parent = Frame Header.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Header.BackgroundTransparency = 1.000 Header.Size = UDim2.new(0, 187, 0, 30) Header.Image = "rbxassetid://3570695787" Header.ImageColor3 = Color3.fromRGB(30, 20, 40) Header.ScaleType = Enum.ScaleType.Slice Header.SliceCenter = Rect.new(100, 100, 100, 100) Header.SliceScale = 0.040 ObjectFrame.Name = "ObjectFrame" ObjectFrame.Parent = Header ObjectFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) ObjectFrame.BackgroundTransparency = 1.000 ObjectFrame.Position = UDim2.new(0.0374331549, 0, 1.23090911, 0) ObjectFrame.Size = UDim2.new(0, 173, 0, Frame.Size.Y.Offset - 45) ObjectFrame.ClipsDescendants = false UIListLayout1.Name = "UIListLayout1" UIListLayout1.Parent = ObjectFrame UIListLayout1.SortOrder = Enum.SortOrder.LayoutOrder UIListLayout1.Padding = UDim.new(0, 6) ToggleWindowBtn.Name = "ToggleWindowBtn" ToggleWindowBtn.Parent = Header ToggleWindowBtn.AnchorPoint = Vector2.new(0.5, 0.5) ToggleWindowBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255) ToggleWindowBtn.BackgroundTransparency = 1.000 ToggleWindowBtn.Position = UDim2.new(0.904128313, 0, 0.499000013, 0) ToggleWindowBtn.Rotation = 90.000 ToggleWindowBtn.Size = UDim2.new(0, 20, 0, 20) ToggleWindowBtn.Image = "https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=4731371541" Title.Name = "Title" Title.Parent = Frame Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Title.BackgroundTransparency = 1.000 Title.Position = UDim2.new(0.053475935, 0, 0, 0) Title.Size = UDim2.new(0, 148, 0, 30) Title.Font = Enum.Font.Gotham Title.Text = text Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.TextStrokeColor3 = Color3.fromRGB(30, 20, 40) Title.TextSize = 20.000 Title.TextXAlignment = Enum.TextXAlignment.Left local CloseTween = TweenService:Create( ToggleWindowBtn, TweenInfo.new( 0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut ), { Rotation = 270 } ) local OpenTween = TweenService:Create( ToggleWindowBtn, TweenInfo.new( 0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut ), { Rotation = 90 } ) local WindowToggled = false ToggleWindowBtn.MouseButton1Click:Connect(function() if WindowToggled == false then Frame.ClipsDescendants = true Frame:TweenSize(UDim2.new(0, 187, 0, 30), "InOut", "Quad", 0.5, true) CloseTween:Play() elseif WindowToggled == true then Frame:TweenSize(UDim2.new(0, 187, 0, Frame.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45), "InOut", "Quad", 0.5, true) OpenTween:Play() wait(1) Frame.ClipsDescendants = false end WindowToggled = not WindowToggled end) local Window = {} function Window:Button(text, callback) local Button = Instance.new("TextButton") local Roundify = Instance.new("ImageLabel") text = text or "Button" callback = callback or function(...) end Button.Name = "Button" Button.Parent = ObjectFrame Button.BackgroundColor3 = Color3.fromRGB(16, 16, 16) Button.BackgroundTransparency = 1.000 Button.BorderSizePixel = 0 Button.Size = UDim2.new(0, 173, 0, 22) Button.ZIndex = 2 Button.Font = Enum.Font.Gotham Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.TextSize = 14.000 Button.Text = text Button.ClipsDescendants = true Roundify.Name = "Roundify" Roundify.Parent = Button Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.5, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(16, 16, 16) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 local MouseEntered = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(12, 12, 12) } ) local MouseLeft = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(16, 16, 16) } ) Button.MouseEnter:Connect(function() MouseEntered:Play() end) Button.MouseLeave:Connect(function() MouseLeft:Play() end) for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end local function FireClick() spawn(function() local Mouse = game.Players.LocalPlayer:GetMouse() local Circle = Instance.new("ImageLabel") Circle.Name = "Circle" Circle.Parent = Button Circle.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Circle.BackgroundTransparency = 1.000 Circle.ZIndex = 10 Circle.Image = "rbxassetid://266543268" Circle.ImageColor3 = Color3.fromRGB(0, 0, 0) Circle.ImageTransparency = 0.4 local NewX, NewY = Mouse.X - Circle.AbsolutePosition.X, Mouse.Y - Circle.AbsolutePosition.Y Circle.Position = UDim2.new(0, NewX, 0, NewY) local Size = 0 if Button.AbsoluteSize.X > Button.AbsoluteSize.Y then Size = Button.AbsoluteSize.X * 1.5 elseif Button.AbsoluteSize.X < Button.AbsoluteSize.Y then Size = Button.AbsoluteSize.Y * 1.5 elseif Button.AbsoluteSize.X == Button.AbsoluteSize.Y then Size = Button.AbsoluteSize.X * 1.5 end Circle:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(0.5, - Size / 2, 0.5, - Size / 2), "Out", "Quad", 0.5, false) for i = 1, 20 do Circle.ImageTransparency = Circle.ImageTransparency + 0.05 wait(0.3 / 10) end Circle:Destroy() end) pcall(callback) end Button.MouseButton1Click:Connect(FireClick) end function Window:Label(text) local Label = Instance.new("TextLabel") text = text or "Label" Label.Name = "Label" Label.Parent = ObjectFrame Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Label.BackgroundTransparency = 1.000 Label.Position = UDim2.new(0, 0, 0.122807018, 0) Label.Size = UDim2.new(0, 173, 0, 22) Label.Font = Enum.Font.Gotham Label.TextColor3 = Color3.fromRGB(255, 255, 255) Label.TextSize = 14.000 Label.Text = text for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end end function Window:Toggle(text, callback) text = text or "Toggle" callback = callback or function(...) end local Toggle = Instance.new("TextLabel") local ToggleButton = Instance.new("TextButton") local Roundify = Instance.new("ImageLabel") Toggle.Name = "Toggle" Toggle.Parent = ObjectFrame Toggle.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Toggle.BackgroundTransparency = 1.000 Toggle.Position = UDim2.new(0, 0, 0.122807018, 0) Toggle.Size = UDim2.new(0, 173, 0, 22) Toggle.Font = Enum.Font.Gotham Toggle.Text = text Toggle.TextColor3 = Color3.fromRGB(255, 255, 255) Toggle.TextSize = 14.000 Toggle.TextXAlignment = Enum.TextXAlignment.Left ToggleButton.Name = "ToggleButton" ToggleButton.Parent = Toggle ToggleButton.BackgroundColor3 = Color3.fromRGB(16, 16, 16) ToggleButton.BackgroundTransparency = 1.000 ToggleButton.BorderSizePixel = 0 ToggleButton.Position = UDim2.new(0.872832358, 0, 0, 0) ToggleButton.Size = UDim2.new(0, 22, 0, 22) ToggleButton.ZIndex = 2 ToggleButton.Font = Enum.Font.Gotham ToggleButton.Text = "" ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) ToggleButton.TextSize = 14.000 Roundify.Name = "Roundify" Roundify.Parent = ToggleButton Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.5, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(255, 42, 45) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 local Toggled = false local ToggleOn = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(56, 255, 42) } ) local ToggleOff = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(255, 42, 45) } ) local function FireToggle() if Toggled == true then ToggleOff:Play() elseif Toggled == false then ToggleOn:Play() end Toggled = not Toggled pcall(callback, Toggled) end ToggleButton.MouseButton1Click:Connect(FireToggle) for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end end function Window:Box(text, callback) text = text or "Box" callback = callback or function(...) end local Box = Instance.new("TextLabel") local TextBox = Instance.new("TextBox") local Roundify = Instance.new("ImageLabel") Box.Name = "Box" Box.Parent = ObjectFrame Box.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Box.BackgroundTransparency = 1.000 Box.Position = UDim2.new(0, 0, 0.122807018, 0) Box.Size = UDim2.new(0, 173, 0, 22) Box.Font = Enum.Font.Gotham Box.Text = text Box.TextColor3 = Color3.fromRGB(255, 255, 255) Box.TextSize = 14.000 Box.TextXAlignment = Enum.TextXAlignment.Left TextBox.Parent = Box TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) TextBox.BackgroundTransparency = 1.000 TextBox.BorderSizePixel = 0 TextBox.Position = UDim2.new(0.560693622, 0, 0, 0) TextBox.Size = UDim2.new(0, 76, 0, 22) TextBox.ZIndex = 2 TextBox.Font = Enum.Font.Gotham TextBox.Text = "" TextBox.TextColor3 = Color3.fromRGB(255, 255, 255) TextBox.TextSize = 14.000 Roundify.Name = "Roundify" Roundify.Parent = TextBox Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.499248117, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1.00150371, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(16, 16, 16) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 TextBox.FocusLost:Connect(function() pcall(callback, TextBox.Text) end) for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end end function Window:Dropdown(text, list, callback) text = text or "Dropdown" callback = callback or function(...) end list = list or {} local selected = list[1] local Dropdown = Instance.new("TextButton") local Roundify = Instance.new("ImageLabel") local DropArrow = Instance.new("ImageButton") local DropFrame = Instance.new("ImageLabel") local UIListLayout = Instance.new("UIListLayout") local Text = Instance.new("TextLabel") local DropArrow2 = Instance.new("ImageButton") local Clip = Instance.new("TextLabel") Dropdown.Name = "Dropdown" Dropdown.Parent = ObjectFrame Dropdown.BackgroundColor3 = Color3.fromRGB(16, 16, 16) Dropdown.BackgroundTransparency = 1.000 Dropdown.BorderSizePixel = 0 Dropdown.Size = UDim2.new(0, 173, 0, 22) Dropdown.ZIndex = 2 Dropdown.Font = Enum.Font.Gotham Dropdown.Text = selected Dropdown.TextColor3 = Color3.fromRGB(255, 255, 255) Dropdown.TextSize = 14.000 Clip.Name = "Clip" Clip.Parent = Dropdown Clip.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Clip.BackgroundTransparency = 1.000 Clip.Size = UDim2.new(0, 173, 0, 22) Clip.Font = Enum.Font.SourceSans Clip.Text = "" Clip.TextColor3 = Color3.fromRGB(0, 0, 0) Clip.TextSize = 14.000 Clip.ClipsDescendants = true Roundify.Name = "Roundify" Roundify.Parent = Dropdown Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.5, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(16, 16, 16) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 DropArrow.Name = "DropArrow" DropArrow.Parent = Dropdown DropArrow.BackgroundColor3 = Color3.fromRGB(255, 255, 255) DropArrow.BackgroundTransparency = 1.000 DropArrow.Position = UDim2.new(0.875999987, 0, 0.08299999100, 0) DropArrow.Rotation = 270.000 DropArrow.Size = UDim2.new(0, 17, 0, 17) DropArrow.Image = "https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=4731371541" DropFrame.Name = "DropFrame" DropFrame.Parent = Dropdown DropFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) DropFrame.BackgroundTransparency = 1.000 DropFrame.ClipsDescendants = true DropFrame.Size = UDim2.new(0, 173, 0, 22) DropFrame.Visible = false DropFrame.ZIndex = 3 DropFrame.Image = "rbxassetid://3570695787" DropFrame.ImageColor3 = Color3.fromRGB(16, 16, 16) DropFrame.ScaleType = Enum.ScaleType.Slice DropFrame.SliceCenter = Rect.new(100, 100, 100, 100) DropFrame.SliceScale = 0.040 UIListLayout.Parent = DropFrame UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder Text.Name = "Text" Text.Parent = DropFrame Text.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Text.BackgroundTransparency = 1.000 Text.Position = UDim2.new(0, 0, 0.0182600394, 0) Text.Size = UDim2.new(0, 173, 0, 22) Text.ZIndex = 3 Text.Font = Enum.Font.Gotham Text.TextColor3 = Color3.fromRGB(93, 93, 93) Text.TextSize = 14.000 Text.Text = text DropArrow2.Name = "DropArrow2" DropArrow2.Parent = Text DropArrow2.BackgroundColor3 = Color3.fromRGB(255, 255, 255) DropArrow2.BackgroundTransparency = 1.000 DropArrow2.Position = UDim2.new(0.875999987, 0, 0.0780000016, 0) DropArrow2.Rotation = 270.000 DropArrow2.Size = UDim2.new(0, 17, 0, 17) DropArrow2.ZIndex = 3 DropArrow2.Image = "https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=4731371541" local function RippleEffect(obj) local Mouse = game.Players.LocalPlayer:GetMouse() local Circle = Instance.new("ImageLabel") Circle.Name = "Circle" Circle.Parent = obj Circle.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Circle.BackgroundTransparency = 1.000 Circle.ZIndex = 10 Circle.Image = "rbxassetid://266543268" Circle.ImageColor3 = Color3.fromRGB(0, 0, 0) Circle.ImageTransparency = 0.4 local NewX, NewY = Mouse.X - Circle.AbsolutePosition.X, Mouse.Y - Circle.AbsolutePosition.Y Circle.Position = UDim2.new(0, NewX, 0, NewY) local Size = 0 if obj.AbsoluteSize.X > obj.AbsoluteSize.Y then Size = obj.AbsoluteSize.X * 1.5 elseif obj.AbsoluteSize.X < obj.AbsoluteSize.Y then Size = obj.AbsoluteSize.Y * 1.5 elseif obj.AbsoluteSize.X == obj.AbsoluteSize.Y then Size = obj.AbsoluteSize.X * 1.5 end Circle:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(0.5, - Size / 2, 0.5, - Size / 2), "Out", "Quad", 0.5, false) for i = 1, 20 do Circle.ImageTransparency = Circle.ImageTransparency + 0.05 wait(0.3 / 10) end Circle:Destroy() end local DropToggled = false for i,v in next, list do local Button = Instance.new("TextButton") Button.Name = "Button" Button.Parent = DropFrame Button.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Button.BackgroundTransparency = 1.000 Button.Position = UDim2.new(0, 0, 0.219999999, 0) Button.Size = UDim2.new(0, 173, 0, 22) Button.ZIndex = 3 Button.Font = Enum.Font.Gotham Button.TextColor3 = Color3.fromRGB(255, 255, 255) Button.TextSize = 14.000 Button.Text = tostring(v) Button.ClipsDescendants = true end local ArrowDown = TweenService:Create( DropArrow2, TweenInfo.new( 0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut ), { Rotation = 90 } ) local ArrowUp = TweenService:Create( DropArrow2, TweenInfo.new( 0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut ), { Rotation = 270 } ) for i,v in pairs(DropFrame:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Down:Connect(function() spawn(function() RippleEffect(v) end) selected = v.Text pcall(callback, selected) Dropdown.Text = selected ArrowUp:Play() DropFrame:TweenSize(UDim2.new(0, 173, 0, 22), "InOut", "Quad", 0.5, true) DropToggled = false wait(0.5) DropFrame.Visible = false end) local MouseEntered = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { BackgroundColor3 = Color3.fromRGB(12, 12, 12) } ) local MouseLeft = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { BackgroundColor3 = Color3.fromRGB(16, 16, 16) } ) v.MouseEnter:Connect(function() MouseEntered:Play() end) v.MouseLeave:Connect(function() MouseLeft:Play() end) end end Dropdown.MouseButton1Click:Connect(function() spawn(function() RippleEffect(Clip) end) if DropToggled == false then ArrowDown:Play() DropFrame.Visible = true DropFrame:TweenSize(UDim2.new(0, 173, 0, UIListLayout.AbsoluteContentSize.Y), "InOut", "Quad", 0.5, true) else ArrowUp:Play() DropFrame:TweenSize(UDim2.new(0, 173, 0, 22), "InOut", "Quad", 0.5, true) wait(0.5) DropFrame.Visible = false end DropToggled = not DropToggled end) local MouseEntered = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(12, 12, 12) } ) local MouseLeft = TweenService:Create( Roundify, TweenInfo.new( 0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out ), { ImageColor3 = Color3.fromRGB(16, 16, 16) } ) Dropdown.MouseEnter:Connect(function() MouseEntered:Play() end) Dropdown.MouseLeave:Connect(function() MouseLeft:Play() end) for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end end function Window:Slider(text, min, max, callback) text = text or "Slider" min = min or 0 max = max or 100 callback = callback or function(...) end local Slider = Instance.new("TextLabel") local Amount = Instance.new("TextLabel") local SliderButton = Instance.new("TextButton") local Roundify = Instance.new("ImageLabel") local SliderFrame = Instance.new("ImageLabel") local Text = Instance.new("TextLabel") Slider.Name = "Slider" Slider.Parent = ObjectFrame Slider.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Slider.BackgroundTransparency = 1.000 Slider.Position = UDim2.new(0, 0, 0.394736856, 0) Slider.Size = UDim2.new(0, 173, 0, 38) Slider.Font = Enum.Font.Gotham Slider.Text = "" Slider.TextColor3 = Color3.fromRGB(255, 255, 255) Slider.TextSize = 14.000 Slider.TextXAlignment = Enum.TextXAlignment.Left Amount.Name = "Amount" Amount.Parent = Slider Amount.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Amount.BackgroundTransparency = 1.000 Amount.Size = UDim2.new(0, 173, 0, 28) Amount.Font = Enum.Font.Gotham Amount.Text = min Amount.TextColor3 = Color3.fromRGB(255, 255, 255) Amount.TextSize = 14.000 Amount.TextXAlignment = Enum.TextXAlignment.Right SliderButton.Name = "SliderButton" SliderButton.Parent = Slider SliderButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) SliderButton.BackgroundTransparency = 1.000 SliderButton.BorderSizePixel = 0 SliderButton.Position = UDim2.new(0, 0, 0.760208607, 0) SliderButton.Size = UDim2.new(0, 173, 0, 9) SliderButton.Font = Enum.Font.SourceSans SliderButton.Text = "" SliderButton.TextColor3 = Color3.fromRGB(0, 0, 0) SliderButton.TextSize = 14.000 Roundify.Name = "Roundify" Roundify.Parent = SliderButton Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(25, 25, 25) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.5, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(16, 16, 16) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 Roundify.Name = "Roundify" Roundify.Parent = SliderButton Roundify.Active = true Roundify.AnchorPoint = Vector2.new(0.5, 0.5) Roundify.BackgroundColor3 = Color3.fromRGB(25, 25, 25) Roundify.BackgroundTransparency = 1.000 Roundify.Position = UDim2.new(0.5, 0, 0.5, 0) Roundify.Selectable = true Roundify.Size = UDim2.new(1, 0, 1, 0) Roundify.Image = "rbxassetid://3570695787" Roundify.ImageColor3 = Color3.fromRGB(16, 16, 16) Roundify.ScaleType = Enum.ScaleType.Slice Roundify.SliceCenter = Rect.new(100, 100, 100, 100) Roundify.SliceScale = 0.030 SliderFrame.Name = "SliderFrame" SliderFrame.Parent = SliderButton SliderFrame.BackgroundColor3 = Color3.fromRGB(52, 52, 52) SliderFrame.BackgroundTransparency = 1.000 SliderFrame.Size = UDim2.new(0, 0, 0, 9) SliderFrame.Image = "rbxassetid://3570695787" SliderFrame.ImageColor3 = Color3.fromRGB(52, 52, 52) SliderFrame.ScaleType = Enum.ScaleType.Slice SliderFrame.SliceCenter = Rect.new(100, 100, 100, 100) SliderFrame.SliceScale = 0.030 Text.Name = "Text" Text.Parent = Slider Text.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Text.BackgroundTransparency = 1.000 Text.Size = UDim2.new(0, 173, 0, 28) Text.Font = Enum.Font.Gotham Text.Text = text Text.TextColor3 = Color3.fromRGB(255, 255, 255) Text.TextSize = 14.000 Text.TextXAlignment = Enum.TextXAlignment.Left --// Credits to text for the slider functionality local mouse = game.Players.LocalPlayer:GetMouse() local uis = game:GetService("UserInputService") local value = nil SliderButton.MouseButton1Down:Connect(function() value = math.floor((((tonumber(max) - tonumber(min)) / 173) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0 Amount.Text = value pcall(function() callback(value) end) SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 173), 0, 9) moveconnection = mouse.Move:Connect(function() value = math.floor((((tonumber(max) - tonumber(min)) / 173) * SliderFrame.AbsoluteSize.X) + tonumber(min)) Amount.Text = value pcall(function() callback(value) end) SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 173), 0, 9) end) releaseconnection = uis.InputEnded:Connect(function(Mouse) if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then value = math.floor((((tonumber(max) - tonumber(min)) / 173) * SliderFrame.AbsoluteSize.X) + tonumber(min)) Amount.Text = value pcall(function() callback(value) end) SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 173), 0, 9) moveconnection:Disconnect() releaseconnection:Disconnect() end end) end) for i,v in next, Windows do v.Size = UDim2.new(0, 187, 0, v.Header.ObjectFrame.UIListLayout1.AbsoluteContentSize.Y + 45) v.Header.ObjectFrame.Size = UDim2.new(0, 173, 0, v.Size.Y.Offset - 45) end end return Window end return library
--------------------------------------------------------------------------------------------------- -- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0160-rc-radio-parameter-update.md -- User story: TBD -- -- Requirement summary: -- TBD -- -- Description: -- In case: -- 1) RC.GetCapabilities received without hdRadioEnableAvailable from HMI -- 2) Application is registered with REMOTE_CONTROL appHMIType -- 3) and sends valid SetInteriorVehicleData RPC with hdRadioEnable -- SDL must: -- 1) Respond with UNSUPPORTED_RESOURCE result code, success = false to mobile application --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local runner = require('user_modules/script_runner') local commonRC = require('test_scripts/RC/commonRC') local hmi_values = require("user_modules/hmi_values") --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false --[[ Local Variables ]] local Module = "RADIO" local hmiValues = hmi_values.getDefaultHMITable() hmiValues.RC.GetCapabilities.params.remoteControlCapability.radioControlCapabilities[1].hdRadioEnableAvailable = nil --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", commonRC.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", commonRC.start, { hmiValues }) runner.Step("RAI", commonRC.registerAppWOPTU) runner.Step("Activate App", commonRC.activateApp) runner.Title("Test") runner.Step("SetInteriorVehicleData UNSUPPORTED_RESOURCE in case hdRadioEnableAvailable omitted", commonRC.rpcDenied, {Module, 1, "SetInteriorVehicleData", "UNSUPPORTED_RESOURCE"}) runner.Title("Postconditions") runner.Step("Stop SDL", commonRC.postconditions)
local NeP, g = NeP, NeP._G local heroismBuffs = { 32182, 90355, 80353, 2825, 146555 } NeP.DSL:Register("hashero", function() for i = 1, #heroismBuffs do local SpellName = NeP.Core:GetSpellName(heroismBuffs[i]) if NeP.Core.UnitBuffL('player', SpellName) then return true end end end) NeP.DSL:Register("buff", function(target, spell) return NeP.Core.UnitBuffL(target, spell, 'PLAYER') ~= nil end) NeP.DSL:Register("buff.any", function(target, spell) return NeP.Core.UnitBuffL(target, spell) ~= nil end) NeP.DSL:Register("buff.count", function(target, spell) local _, count = NeP.Core.UnitBuffL(target, spell, 'PLAYER') return count or 0 end) NeP.DSL:Register("buff.count.any", function(target, spell) local _, count = NeP.Core.UnitBuffL(target, spell) return count or 0 end) NeP.DSL:Register("buff.duration", function(target, spell) local buff,_,expires = NeP.Core.UnitBuffL(target, spell, 'PLAYER') return buff and (expires - NeP._G.GetTime()) or 0 end) NeP.DSL:Register("buff.duration.any", function(target, spell) local buff,_,expires = NeP.Core.UnitBuffL(target, spell) return buff and (expires - NeP._G.GetTime()) or 0 end) NeP.DSL:Register("buff.many", function(target, spell) local i, name, count = 1, true, 0 while name do name = NeP.Core.UnitBuffL(target, i, 'PLAYER') if name == spell then count = count + 1 end i=i+1 end return count end) NeP.DSL:Register("buff.many.any", function(target, spell) local count = 0 for i=1,40 do if NeP.Core.UnitBuffL(target, i) == spell then count = count + 1 end end return count end) ------------------------------------------ DEBUFFS --------------------------------------- ------------------------------------------------------------------------------------------ NeP.DSL:Register("debuff", function(target, spell) return NeP.Core.UnitDebuffL(target, spell, 'PLAYER') ~= nil end) NeP.DSL:Register("debuff.any", function(target, spell) return NeP.Core.UnitDebuffL(target, spell) ~= nil end) NeP.DSL:Register("debuff.count", function(target, spell) local _,count = NeP.Core.UnitDebuffL(target, spell, 'PLAYER') return count or 0 end) NeP.DSL:Register("debuff.count.any", function(target, spell) local _,count = NeP.Core.UnitDebuffL(target, spell) return count or 0 end) NeP.DSL:Register("debuff.duration", function(target, spell) local debuff,_,expires = NeP.Core.UnitDebuffL(target, spell, 'PLAYER') return debuff and (expires - NeP._G.GetTime()) or 0 end) NeP.DSL:Register("debuff.duration.any", function(target, spell) local debuff,_,expires = NeP.Core.UnitDebuffL(target, spell) return debuff and (expires - NeP._G.GetTime()) or 0 end) NeP.DSL:Register("debuff.many", function(target, spell) local i, name, count = 1, true, 0 while name do name = NeP.Core.UnitDebuffL(target, i, 'PLAYER') if name == spell then count = count + 1 end i=i+1 end return count end) NeP.DSL:Register("debuff.many.any", function(target, spell) local count = 0 for i=1,40 do if NeP.Core.UnitDebuffL(target, i) == spell then count = count + 1 end end return count end) ---------------------------------------------------------------------------------------------- -- Counts how many units have the buff -- USAGE: count(BUFF).buffs > = # NeP.DSL:Register("count.enemies.buffs", function(_,buff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Enemy')) do if NeP.DSL:Get('buff')(Obj.key, buff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the buff -- USAGE: count(BUFF).buffs.any > = # NeP.DSL:Register("count.enemies.buffs.any", function(_,buff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Enemy')) do if NeP.DSL:Get('buff.any')(Obj.key, buff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the buff -- USAGE: count(BUFF).buffs > = # NeP.DSL:Register("count.friendly.buffs", function(_,buff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Roster')) do if NeP.DSL:Get('buff')(Obj.key, buff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the debuff -- USAGE: count(DEBUFF).debuffs > = # NeP.DSL:Register("count.friendly.buffs.any", function(_,buff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Roster')) do if NeP.DSL:Get('buff.any')(Obj.key, buff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the debuff -- USAGE: count(DEBUFF).debuffs > = # NeP.DSL:Register("count.enemies.debuffs", function(_,debuff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Enemy')) do if NeP.DSL:Get('debuff')(Obj.key, debuff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the debuff -- USAGE: count(DEBUFF).debuffs.any > = # NeP.DSL:Register("count.enemies.debuffs.any", function(_,debuff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Enemy')) do if NeP.DSL:Get('debuff.any')(Obj.key, debuff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the debuff -- USAGE: count(DEBUFF).debuffs > = # NeP.DSL:Register("count.friendly.debuffs", function(_,debuff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Roster')) do if NeP.DSL:Get('debuff')(Obj.key, debuff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end) -- Counts how many units have the debuff -- USAGE: count(DEBUFF).debuffs.any > = # NeP.DSL:Register("count.friendly.debuffs.any", function(_,debuff) local n1 = 0 for _, Obj in pairs(NeP.OM:Get('Roster')) do if NeP.DSL:Get('debuff.any')(Obj.key, debuff) and NeP.DSL:Get('los')(Obj.key) then n1 = n1 + 1 end end return n1 end)
messages = { -- These dialogue IDs match "You were unable to enter a combination" for the associated zone IDs [100] = 8056, [101] = 7505, [102] = 7907, [103] = 8082, [104] = 8647, [105] = 7698, [106] = 8072, [107] = 7533, [108] = 7602, [109] = 8465, [110] = 7589, [111] = 8566, [112] = 8168, [113] = 7928, [114] = 7767, [115] = 7863, [116] = 7559, [117] = 7566, [118] = 8108, [119] = 8345, [120] = 7505, [121] = 8085, [122] = 7434, [123] = 7868, [124] = 7819, [125] = 7629, [126] = 8052, [127] = 7351, [128] = 7506, [130] = 7570, [153] = 11396, [158] = 7382, [159] = 8445, [160] = 7409, [166] = 10578, [167] = 10592, [169] = 7539, [172] = 7412, [173] = 10517, [174] = 11395, [176] = 7604, [177] = 11219, [178] = 11399, [190] = 8253, [191] = 8373, [192] = 7409, [193] = 8385, [194] = 8265, [195] = 7596, [196] = 8305, [197] = 7350, [198] = 8271, [200] = 7527, [204] = 7515, [205] = 11482, [208] = 8284, [212] = 10638, [213] = 10448, } offsets = {greater_less=1, failure=2, success=4, second_even_odd=5, first_even_odd=6, range=7, less=8, greater=9, equal=10, second_multiple=11, first_multiple=12, tool_failure=13}
-- Copyright (c) 2018 Redfern, Trevor <[email protected]> -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT local terrain = require "terrain" local MapSquare = {} function MapSquare:new(x, y) local ms = { x = x, y = y, terrain = terrain:none() } return ms end return MapSquare
-- Manifest local GARRYSMOD = true --[[ Options describe select = <number> Select one of the returned values keys = <flag> Only print keys of returned value limit = <number> Limit the amount of entries printed in each table escape_newline = <flag> Escape newline characters in output grep_stream grep = <string> Text to hilight in output text grepline = <string> Hilight lines that contain matched text nocase = <flag> Ignore upper-lowercase when searching lineno_stream lineno = <bool> Show line numbers next to output --]] --[[ To make this code as generic as possible, stdout is abstracted as 'out' Following member functions are expected from all implementations :init(options) :printc(color, string) :newl() Colors are tables: { r = 255, g = 255, b = 255 } ]]-- --[[ Some environments may have different implementation of these This is a declaration, not localization. DO NOT REMOVE ]]-- local iterate = pairs local loadstring = loadstring -- Config local COLOR_GENERIC = { r = 255, g = 255, b = 255 } local COLOR_COMMENT = { r = 30, g = 195, b = 30 } local COLOR_KEY = { r = 250, g = 150, b = 30 } local COLOR_REF = { r = 165, g = 225, b = 45 } local COLOR_BOOLEAN = { r = 175, g = 130, b = 255 } local COLOR_NUMBER = { r = 175, g = 130, b = 255 } local COLOR_STRING = { r = 230, g = 220, b = 115 } -- This object can be used to force the describer to describe nil values local NIL_INSTANCE = {} -- Function to resolve typenames local function typename(obj) return type(obj) end -- -- Just code from here -- function ipairs_ex(t, from) local idx = from or 1 return function() local value = t[idx] if value == nil then return end idx = idx +1 return idx -1, value end end local function expand_path(path, key) if path == "" then return key end return string.format(isstring(key) and "%s.%s" or "%s[%s]", path, key) end function describe(value, out, options) local DECOR_FIRST = "┳ " local DECOR_MEMBER = "┣ " local DECOR_LAST = "┗ " -- These are cross referenced, this is a pseudo declaration local describe_value local describe_member local describe_table -- Context for this describe job local paths = {} local depth = 1 function describe_table(prefix, path, tbl, key) -- Add this table to the paths, for ref. resolving path = expand_path(path, key) paths[tbl] = path -- Collect keys, calculate value inset local keys = {} local key_wide = 0 local count = 0 for key in iterate(tbl) do table.insert(keys, key) -- Find max length to accomodate for key_wide = math.max(key_wide, tostring(key):len()) count = count +1 end -- No keys? Print empty table value if count == 0 then out:printc(COLOR_GENERIC, prefix) out:printc(COLOR_GENERIC, "{}") out:newl() return end -- Enforce some breathing room key_wide = key_wide +2 -- Sort table keys table.sort(keys, function(A, B) -- Respect numeric values when sorting if isnumber(A) and isnumber(B) then return A < B end -- Otherwise fall back to string representation return tostring(A) < tostring(B) end ) -- Limit number of values described local limit = tonumber(options.limit) or 100 for idx, key in ipairs(keys) do -- Keep track of # printed objects if idx > limit then out:printc(COLOR_GENERIC, prefix) out:printc(COLOR_COMMENT, "... (") out:printc(COLOR_COMMENT, tostring(count - idx +1)) out:printc(COLOR_COMMENT, " entries hidden)") out:newl() break end -- Fancy local decor = DECOR_MEMBER if idx == 1 then decor = DECOR_FIRST end if idx == count then decor = DECOR_LAST end describe_member(prefix, decor, path, tbl[key], key, key_wide) end end function describe_member(prefix, decor, path, value, key, key_wide) local ref_path -- Prefix out:printc(COLOR_GENERIC, prefix) -- Stringify key, calculate padding local key_str = tostring(key) local padding = key_wide - key_str:len() if padding < 0 then key_str = key_str:sub(1, padding -3) .. " .." end -- Add guideline to prefix prefix = string.format("%s┃ %s", prefix, string.rep(" ", key_wide +2)) -- Delegate early on tables, also watch for NIL_INSTANCE, as it is implemented as a table if istable(value) and value ~= NIL_INSTANCE then ref_path = paths[value] -- Only print unvisited tables if not ref_path then -- Overly fancy: Peek to see if there will be any more values if decor == DECOR_LAST and next(value) then decor = DECOR_MEMBER end out:printc(COLOR_GENERIC, decor) out:printc(COLOR_KEY, key_str) out:printc(COLOR_GENERIC, ": ") out:newl() -- Enumerate members describe_table(prefix, path, value, key) return end end -- Print value key prefix out:printc(COLOR_GENERIC, decor) out:printc(COLOR_KEY, key_str) out:printc(nil, string.rep(" ", padding)) out:printc(COLOR_GENERIC, "= ") -- Reference if ref_path then out:printc(COLOR_REF, "ref: ") out:printc(COLOR_REF, ref_path) out:newl() return end -- Delegate describe_value(prefix, value) end function describe_value(prefix, value) -- Special nil instance if value == NIL_INSTANCE then out:printc(COLOR_NUMBER, "nil") out:newl() return end -- Booleans if isbool(value) then out:printc(COLOR_BOOLEAN, tostring(value)) out:newl() return end -- Numbers (optionally as hex) if isnumber(value) then out:printc(COLOR_NUMBER, tostring(value)) out:newl() return end -- Strings (escape + multiline handling) if isstring(value) then local len = value:len() -- Print single characters with simple quotes if len == 1 then out:printc(COLOR_STRING, "'") out:printc(COLOR_STRING, value) out:printc(COLOR_STRING, "'") out:newl() return end -- Check if string is multiline local newl, to = string.find(value, "\r?\n") -- Optinally escape newline characters if newl and options.escape_newline then value = value:gsub("\r?\n", "\\n") newl = nil end -- No newline, print inline if not newl then out:printc(COLOR_STRING, "\"") out:printc(COLOR_STRING, value) out:printc(COLOR_STRING, "\"") out:newl() return end -- Print each line separately local pos = to +1 out:printc(COLOR_STRING, '[[') out:printc(COLOR_STRING, value:sub(1, newl)) while true do out:printc(COLOR_GENERIC, prefix) newl, to = string.find(value, "\r?\n", pos) if newl then out:printc(COLOR_STRING, value:sub(pos, newl -1)) out:newl() pos = to +1 else out:printc(COLOR_STRING, value:sub(pos)) break end end out:printc(COLOR_STRING, ']]') out:newl() return end -- Functions if isfunction(value) then out:printc(nil, tostring(value)) -- If the debug library is available, give extra insight on closures if debug and debug.getinfo then local info = debug.getinfo(value, "S") -- Print source file for Lua methods if info.what == "Lua" then out:printc(COLOR_COMMENT, string.format(" -- [%s]: %d-%d", info.short_src, info.linedefined, info.lastlinedefined)) end end out:newl() return end -- Fallback out:printc(nil, tostring(value)) out:newl() end -- Start job if istable(value) and value ~= NIL_INSTANCE then describe_table("", "", value, "root") else describe_value("", value) end end local function opt_bool(value) if value == true or value == false then return value end end local function error_format(msg, ...) error( string.format(msg, ...), 2 ) end local function parse_command_options(input, fenv) local raw_options = string.match(input, "|(.*)$") local options = {} -- No pipe, no options if not raw_options then return input, options end -- Parse options string.gsub(raw_options, "[^|]+", function(part) local key, value = part:match("([^%s=]+)=?(.*)$") -- Trim pair of unwanted spaces key = key:match("^%s*(.-)%s*$") value = value:match("^%s*(.-)%s*$") if value == "" then -- Flag like behavior value = true else -- Try converting the value to a literal local literal = tonumber(value) or opt_bool(value) if literal ~= nil then value = literal else -- Automatically parse quoted strings local parse = value:sub(1, 1) == '"' or value:sub(1, 1) == "'" -- Parsing can be forced with a '!' prefix if value:sub(1, 1) == '!' then value = value:sub(2) parse = true end if parse then local func, syntax_err = loadstring("return " .. value, "parse_lua_value", "text", fenv) if syntax_err then error_format("Cannot parse option '%s' due to syntax error: %s", key, syntax_err) end local succ, ret = pcall(func) if not succ then error_format("Cannot parse option '%s' due to runtime error: %s", key, ret) end value = ret end end -- Done converting end -- Opt-out check for nil parameters if value == nil and not options['ignore-nil'] then error_format("Option '%s' evaluated to nil! [Override with 'ignore-nil' key]", key) end -- Check if option would overwrite something if options[key] ~= nil then error_format("Redefinition of '%s' option!", key) end options[key] = value end) OPT = options -- Cut options from input input = input:sub(0, -raw_options:len() -2) return input, options end local function process_returns(res, out, options) -- Describe results describe(res, out, options) end local function inst_guard() debug.sethook() error("Too many instructions. Halted") end function lua_command(input, out, fenv) local input = string.match(input or "", "^%s*(.-)%s*$") local code, options = parse_command_options(input, fenv) if code == "" then error("No code provided") end -- TODO: From context? local chunkname = "lua_command" -- Compile expression to code local simple_expr = true local func, syntax_err = loadstring("return " .. code, chunkname, nil, fenv) -- Code may have explicit return/advanced control flow if syntax_err then simple_expr = false func, syntax_err = loadstring(code, chunkname, nil, fenv) end if syntax_err then error_format("Syntax error: %s", syntax_err) end -- Install basic 'infinite loop protection' if the debug lib is available if debug and debug.sethook then debug.sethook(inst_guard, "", 10000000) end -- Run code, capture return values local res = { pcall(func) } if debug and debug.sethook then debug.sethook() end -- Prompt local prefix = res[2] ~= nil and "= " or "<< " out:printc(COLOR_COMMENT, prefix) out:printc(COLOR_COMMENT, code) out:newl() -- Initialize output stream out:init(options) -- Report results if not res[1] then error_format("Runtime error: %s", res[2]) else --[[ Note: Due to the nature of { pcall() }, the first value is the success, but if the expressions returns multiple 'nil's before the first actual value, indexes may be skewed! Therefore manual location of the highest index is required. The skipped indexes will be filled with NIL_INSTANCE, a special value to represent 'nil' --]] local num_returns = 1 for idx in pairs(res) do num_returns = math.max(num_returns, idx) end for idx = 1, num_returns do if res[idx] == nil then res[idx] = NIL_INSTANCE end end -- 'succ' from pcall is still in the list, remove num_returns = num_returns -1 table.remove(res, 1) -- Nothing to print if num_returns == 0 then return end -- User should be informed, otherwise table returns can be confused for multret if num_returns > 1 then out:printc(COLOR_COMMENT, "[Multiple values returned]") out:newl() end -- Optionally limit printing to a single value if options.select then local idx = options.select out:printc(COLOR_COMMENT, "[Selecting return value #" .. idx .. "]") out:newl() if idx > num_returns then out:printc(COLOR_COMMENT, "[No value]") out:newl() return else num_returns = 1 res = { res[idx] } end end -- Unwrap single return values if num_returns == 1 then res = res[1] end -- Pass for processing process_returns(res, out, options) end end -- Stream to render line numbers function lineno_stream(out) local stream = {} -- State/settings local enabled local lineno local isdone function stream:init(options) enabled = options.lineno lineno = 0 out:init(options) end function stream:printc(color, str) if enabled and not isdone then isdone = true lineno = lineno +1 out:printc(COLOR_COMMENT, string.format("%04d: ", lineno)) end out:printc(color, str) end function stream:newl() isdone = false out:newl() end return stream end -- Special stream supporting grep functionality local COLOR_GREP = {r = 255, g = 50, b = 50 } local COLOR_GREPLINE = {r = 255, g = 150, b = 150} function grep_stream(out, pattern) local stream = {} -- Settings local pattern local ignorecase local line_color local match_color local match_pre = 3 local match_post = 3 local render_all = true -- Utility local function find_matches(strings) local merge = table.concat(strings) local overrides = {} if ignorecase then merge = merge:lower() end -- Match the grep against our line as long as it does local from = 1 while true do local start, finish, A, B = string.find(merge, pattern, from, false) if not start then break end table.insert(overrides, { start = start, finish = finish, color = match_color }) -- TODO: Find capture groups? from = finish +1 end return overrides end local function render_line(colors, strings, overrides) -- No overrides? just render normally if not overrides or not overrides[1] then for part, text in ipairs(strings) do out:printc(colors[part], text) end return end -- Render output, while watching overrides local part = 1 local off = 1 local pos = 0 for _, override in ipairs(overrides) do for idx, text in ipairs_ex(strings, part) do part = idx -- Text has part before override start, print normally local start = override.start - pos -1 local len = text:len() if start > 0 then local chars = math.min(len - off +1, start) out:printc(line_color or colors[part], text:sub(off, off + chars -1)) pos = pos + chars off = off + chars end -- Remaining part is partially inside override if off <= len then local chars = math.min(len - off +1, override.finish - pos) out:printc(override.color, text:sub(off, off + chars -1)) pos = pos + chars off = off + chars end -- Text still has remaining part? Restart with new override if off <= len then break end -- Erase offset for new text (if any) if strings[part +1] then off = 1 end end end -- No more overrides, finish active string out:printc(line_color or colors[part], strings[part]:sub(off)) -- Render remaining parts as normal for part, text in ipairs_ex(strings, part +1) do out:printc(line_color or colors[part], text) end end -- Internal state local to_render = 0 local history = {} local idx local colors local strings function stream:init(options) -- Reset settings pattern = nil ignorecase = false line_color = nil match_color = COLOR_GREP -- Parse options ignorecase = options.nocase if isstring(options.grep) then pattern = options.grep end if isstring(options.grepline) then pattern = options.grepline line_color = COLOR_GREPLINE end -- Validate pattern (if any) if pattern then string.find("", pattern) if ignorecase then pattern = pattern:lower() end -- Allow limiting for match area render_all = not options.greparea end -- Reset internal state history = {} idx = 0 colors = {} strings = {} -- Initialize base stream out:init(options) end function stream:printc(color, str) if not pattern then out:printc(color, str) return end -- Store current line in history idx = idx +1 colors[idx] = color strings[idx] = str end function stream:newl() if not pattern then out:newl() return end -- Line finished, check if it has a match local overrides = find_matches(strings) -- No match if not overrides[1] then if render_all then render_line(colors, strings) out:newl() else if to_render > 0 then to_render = to_render -1 render_line(colors, strings) out:newl() if to_render == 0 then out:printc(COLOR_GENERIC, "...") out:newl() end else table.insert(history, 1, colors) history[match_pre * 2 +1] = nil table.insert(history, 1, strings) history[match_pre * 2 +1] = nil end end else if not render_all then -- Render saved history local saved = #history if saved > 0 then out:printc(COLOR_GENERIC, "Matched area:") out:newl() end for idx = saved, 1, -2 do local colors = history[idx -0] local strings = history[idx -1] render_line(colors, strings) out:newl() history[idx -0] = nil history[idx -1] = nil end -- Queue next X lines to print anyway to_render = match_post end -- Render matched line render_line(colors, strings, overrides) out:newl() end -- Start new line idx = 0 strings = {} colors = {} end return stream end --[[ Garry's Mod ]]-- if GARRYSMOD then function loadstring(source, chunk, mode, fenv) local res = CompileString(source, chunk, false) if isstring(res) then return nil, res end -- TODO: setfenv return res end console_stream = {} function console_stream:init(options) end function console_stream:printc(color, str) if color == nil then MsgC(str) else MsgC(color, str) end end function console_stream:newl() MsgN() end -- Add fancy capabilities with decorators console_stream = lineno_stream(console_stream) console_stream = grep_stream(console_stream) concommand.Add("lua", function(ply, cmd, args, raw) lua_command(raw, console_stream, _G) end) end --[[ Factorio ]]-- if FACTORIO then local function setupContext( context ) ctx = context me = game.players[ ctx.player_index ] here = me.position surface = game.surfaces["nauvis"] around = function( r ) local r = r or 4 return {{here.x -r, here.y -r}, {here.x +r, here.y +r}} end end local function lua2(ctx, out) local player = game.players[ctx.player_index] -- Check permissions if not player.admin then error("Access denied") return end -- TODO: This is a hack setupContext(ctx) lua_command(ctx.parameter, out, _G) end commands.add_command("lua", "mem.lua", function(ctx) local out = {} -- Factorio does not allow newlines, so cache all values to print, then newline local line_raw = {} function out:printc(color, str) table.insert(line_raw, str) end function out:newl() game.print(table.concat(line_raw, " ")) -- gc does wonders line_raw = {} end local succ, err = pcall(lua2, ctx, out) if not succ then print("Command error: ", err) end end) end
local launch_json_content = [[ { "version": "0.2.0", "configurations": [ { "name": "Launch main", "type": "go", "request": "launch", "mode": "exec", "remotePath": "", "port": 38697, "host": "127.0.0.1", "program": "${workspaceFolder}/main.go", "env": { }, "args": [], "cwd": ${workspaceFolder}", "envFile", "${workspaceFolder}/.env" "buildFlags":"" }, { "name": "debug main", "type": "go", "request": "launch", "mode": "debug", "remotePath": "", "port": 38697, "host": "127.0.0.1", "program": "${workspaceFolder}/main.go", "env": { }, "args": [], "cwd": ${workspaceFolder}", "envFile", "${workspaceFolder}/.env" "buildFlags":"" }, { "name": "debug main", "type": "go", "request": "attach", "mode": "debug", "remotePath": "", "port": 38697, "host": "127.0.0.1", "program": "${workspaceFolder}/main.go", "env": { }, "args": [], "cwd": ${workspaceFolder}", "processId":"", "envFile", "${workspaceFolder}/.env" "buildFlags":"" } ] } ]] local util = require("go.utils") local log = util.log local M = {} local sep = require("go.utils").sep() function M.vs_launch() local workfolder = vim.lsp.buf.list_workspace_folders()[1] or vim.fn.getcwd() local launch_json = _GO_NVIM_CFG.launch_json or (workfolder .. sep .. ".vscode" .. sep .. "launch.json") log(launch_json) if vim.fn.filereadable(launch_json) == 1 then return true, launch_json else return false, launch_json end end function M.config() local workfolder = vim.lsp.buf.list_workspace_folders()[1] or vim.fn.getcwd() local launch_json = _GO_NVIM_CFG.launch_json or (workfolder .. sep .. ".vscode" .. sep .. "launch.json") local cmd = "e " .. launch_json if vim.fn.filereadable(launch_json) == 1 then return vim.cmd(cmd) end -- vim.fn.writefile(launch_json_content, launch_json) local contents = vim.fn.split(launch_json_content, "\n") vim.fn.writefile(contents, launch_json) vim.cmd(cmd) end function M.load() if _GO_NVIM_CFG.launch_json_loaded == true then return end local dap = require("dap") local launch = require("dap.ext.vscode").load_launchjs launch(_GO_NVIM_CFG.launch_json) _GO_NVIM_CFG.launch_json_loaded = true log(dap.configurations) end return M
------------------------------------------------------------------------------------------------------------------------ -- Proposal: -- https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0192-button_subscription_response_from_hmi.md ------------------------------------------------------------------------------------------------------------------------ -- Description: Check that App is not subscribed on <button> if HMI does not respond to UnsubscribeButton request -- from SDL once default timeout expires ------------------------------------------------------------------------------------------------------------------------ -- In case: -- 1. Mobile app requests SubscribeButton(<button>) -- 2. SDL sends Buttons.SubscribeButton(<button>, appId) to HMI -- 3. HMI does not respond during default timeout -- 4. SDL responds SubscribeButton(GENERIC_ERROR) to mobile app -- 5. HMI sends Buttons.SubscribeButton(SUCCESS) to SDL -- SDL does: -- - sends Buttons.UnsubscribeButton(<button>, appId) to HMI -- In case: -- 6. HMI doesn't respond for a `Buttons.UnsubscribeButton` request from SDL -- 7. HMI sends OnButtonEvent and OnButtonPress notifications for <button> -- SDL does: -- - not transfer OnButtonEvent and OnButtonPress to App ------------------------------------------------------------------------------------------------------------------------ --[[ Required Shared libraries ]] local common = require('test_scripts/API/ButtonSubscription/commonButtonSubscription') --[[ Local Variables ]] local appSessionId1 = 1 local buttonName = "PRESET_0" --[[ Local function ]] local function rpcGenericError(pButtonName) local hmiCID local cid = common.getMobileSession():SendRPC("SubscribeButton", { buttonName = pButtonName }) local appIdVariable = common.getHMIAppId() common.getHMIConnection():ExpectRequest("Buttons.SubscribeButton",{ appID = appIdVariable, buttonName = pButtonName }) :Do(function(_, data) -- HMI did not response hmiCID = data.id end) common.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "GENERIC_ERROR" }) :Do(function() common.getHMIConnection():SendResponse(hmiCID, "Buttons.SubscribeButton", "SUCCESS", { }) common.getHMIConnection():ExpectRequest("Buttons.UnsubscribeButton", { appID = appIdVariable, buttonName = pButtonName }) :Do(function(_, data) -- HMI did not response end) end) local event = common.createEvent() event.matches = function(_, data) return data.rpcType == 1 and data.rpcFunctionId == 19 end common.getMobileSession():ExpectEvent(event, "UnsubscribeButtonResponse") :Times(0) end --[[ Scenario ]] common.runner.Title("Preconditions") common.runner.Step("Clean environment", common.preconditions) common.runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) common.runner.Step("App registration", common.registerAppWOPTU) common.runner.Step("App activation", common.activateApp) common.runner.Title("Test") common.runner.Title("ButtonName parameter: " .. buttonName) common.runner.Step("Subscribe on " .. buttonName .. " button,timeout case", rpcGenericError, { buttonName }) common.runner.Step("Button ".. buttonName .. " wasn't Subscribe", common.buttonPress, { appSessionId1, buttonName, common.isNotExpected }) common.runner.Title("Postconditions") common.runner.Step("Stop SDL", common.postconditions)
local table_mgr = require "myfunlib.gui_table.table_mgr" local hutype = require "myfunlib.gui_table.hutype" local datacenter = require "skynet.datacenter" local M = {} function M.get_hu_info(cards, gui_index) local hand_cards = {} for i,v in ipairs(cards) do hand_cards[i] = v end local gui_num = 0 if gui_index > 0 then gui_num = hand_cards[gui_index] hand_cards[gui_index] = 0 end --特殊牌型 --7小对 local is_7dui = hutype.is_7_dui(hand_cards,gui_num) --十三幺 local is_13yao = hutype.is_13_19(hand_cards,gui_num) return M.check(hand_cards, gui_num) or is_7dui or is_13yao end function M.get_tips(cards, gui_index) local tips = {} for i=1,34,1 do cards[i]=cards[i]+1 if M.get_hu_info(cards,gui_index) then table.insert(tips,i) end cards[i]=cards[i]-1 end return tips end function M.check(cards, gui_num) local total_need_gui = 0 local eye_num = 0 for i=0,3 do local from = i*9 + 1 local to = from + 8 if i == 3 then to = from + 6 end local need_gui, eye = M.get_need_gui(cards, from, to, i<3, gui_num) if not need_gui then return false end total_need_gui = total_need_gui + need_gui if eye then eye_num = eye_num + 1 end end if eye_num == 0 then return total_need_gui + 2 <= gui_num elseif eye_num == 1 then return total_need_gui <= gui_num else return total_need_gui + eye_num - 1 <= gui_num end end function M.get_need_gui(cards, from, to, chi, gui_num) local num = 0 local key = 0 for i=from,to do key = key * 10 + cards[i] num = num + cards[i] end if num == 0 then return 0, false end for i=0, gui_num do local yu = (num + i)%3 if yu ~= 1 then local eye = (yu == 2) if table_mgr:check(key, i, eye, chi) then return i, eye end end end end return M
--[[ Author: benmooo Date: 2018/07/18 Structed data keeper ]] local CRUD = require('crud') local json = require('json') local util = require('util') local readfile, writefile = util.readfile, util.writefile local _M = CRUD:extend() -- dump collection table to json string function _M:jsonDump() return json.encode(self) end -- insert the json string(--> table) to collection function _M:jsonLoad(jsonString) local rows = json.decode(jsonString) self:insert(rows) end -- write the collection to local in json format function _M:syncToLocal(path, pat) local cnt = self:jsonDump() writefile(path, cnt, pat) end -- insert json string to collection from file function _M:jsonLoadFromFile(path) local cnt = readfile(path) self:jsonLoad(cnt) end -- Return module return _M
local pretty = require('pretty-print') local function searchMember(guild, arg, msg) --local guild = msg.guild local members = guild.members local user = msg.mentionedUsers.first if not arg then return nil end local member = user and guild:getMember(user) or members:get(arg) if member then return member end if arg:find('#', 1, true) then local username, discriminator = arg:match('(.*)#(%d+)') member = members:find(function(m) return m.username == username and m.discriminator == discriminator end) if member then return member end end local distance = math.huge local lowered = arg:lower() for m in members:iter() do if m.nickname and m.nickname:lower():find(lowered, 1, true) then local d = m.nickname:levenshtein(arg) if d == 0 then return m elseif d < distance then member = m distance = d end end if m.username:lower():find(lowered, 1, true) then local d = m.username:levenshtein(arg) if d == 0 then return m elseif d < distance then member = m distance = d end end end if member then return member else return nil--, f('No member found for: `%s`', arg) end end local function search(guild, arg, msg) if not arg then return end arg = arg:lower():gsub('<[@][!](.-)>', '%1'):gsub('<[@](.-)>', '%1') local member = guild.members:get(arg) if member then return member end local distance = math.huge local levit = bot.loader.fuzzel.dld_e or string.levenshtein -- A more stricter fuzzy searching for m in guild.members:iter() do local nick, user = (m.nickname or m.name):lower(), m.user.username:lower() local d1, d2 = levit(arg, nick, 0.1, 0.1, 0.5, 1), levit(arg, user, 0.1, 0.1, 0.5, 1) local d = math.min(d1, d2) if d < distance then member = m distance = d end end return member end local command = {} command.trigger = 'whois' command.description = 'Makes the bot find a user. Searching plain-text is finnicky.' --command.ownerOnly = true function command:onMessageCreate(message, message_args) local arg, msg = message_args, message if not arg or #arg < 1 then return end arg = arg:lower() local member = searchMember(msg.guild, arg, msg) if not member then return end local name if member.nickname then name = string.format('%s (%s)', member.username, member.nickname) else name = member.username end return msg:reply { embed = { title = "Discord Whois", thumbnail = {url = member:getAvatarURL(), width = 256, height = 256}, fields = { {name = 'Name', value = name, inline = true}, {name = 'Discriminator', value = member.discriminator, inline = true}, {name = 'ID', value = member.id, inline = true}, {name = 'Status', value = member.status:gsub('^%l', string.upper), inline = true}, {name = 'Joined Server', value = member.joinedAt:gsub('%..*', ''):gsub('T', ' '), inline = true}, {name = 'Joined Discord', value = os.date('!%Y-%m-%d %H:%M:%S', member.createdAt), inline = true}, }, color = member:getColor().value, } } end bot.manager:addCommand(command)
function onEvent(name, value1, value2) if name == "ArrowFlicker" then duration = tonumber(value2); runTimer('tweenduration',duration); character = tonumber(value1); if character == 1 then noteTweenAlpha('A', 4, -1, 0.5, linear); noteTweenAlpha('B', 5, -1, 0.5, linear); noteTweenAlpha('C', 6, -1, 0.5, linear); noteTweenAlpha('D', 7, -1, 0.5, linear); elseif character == 2 then noteTweenAlpha('E', 0, -1, 0.5, linear); noteTweenAlpha('F', 1, -1, 0.5, linear); noteTweenAlpha('G', 2, -1, 0.5, linear); noteTweenAlpha('H', 3, -1, 0.5, linear); end end end function onTimerCompleted(tag) if tag == 'tweenduration' then noteTweenAlpha('A', 4, 1, 0.5, linear); noteTweenAlpha('B', 5, 1, 0.5, linear); noteTweenAlpha('C', 6, 1, 0.5, linear); noteTweenAlpha('D', 7, 1, 0.5, linear); -- oppt noteTweenAlpha('E', 0, 1, 0.5, linear); noteTweenAlpha('F', 1, 1, 0.5, linear); noteTweenAlpha('G', 2, 1, 0.5, linear); noteTweenAlpha('H', 3, 1, 0.5, linear); end end
--- Highlights terminal CSI ANSI color codes. -- @module terminal local nvim = require 'nvim' local function rgb_to_hex(r,g,b) return ("#%02X%02X%02X"):format(r,g,b) end local cterm_colors = { [0] = "#000000", "#AA0000", "#00AA00", "#AA5500", "#0000AA", "#AA00AA", "#00AAAA", "#AAAAAA", "#555555", "#FF5555", "#55FF55", "#FFFF55", "#5555FF", "#FF55FF", "#55FFFF", "#FFFFFF" } local function cube6(v) return v == 0 and v or (v*40 + 55) end -- https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit for b = 0, 5 do for g = 0, 5 do for r = 0, 5 do local i = 16 + 36*r + 6*g + b -- Some terminals implement this differently -- cterm_colors[i] = rgb_to_hex(51*r,51*g,51*b) cterm_colors[i] = rgb_to_hex(cube6(r),cube6(g),cube6(b)) end end end for i = 0, 23 do local v = 8 + (i * 10) cterm_colors[232+i] = rgb_to_hex(v,v,v) end --- Return a lookup table from [0,255] to an RGB color. -- Respects g:terminal_color_n -- @treturn {[number]=string} number to hex string local function initialize_terminal_colors() local result = {} for i = 0, 255 do result[i] = cterm_colors[i] end -- g:terminal_color_n overrides if nvim.o.termguicolors then -- TODO only do 16 colors? for i = 0, 255 do local status, value = pcall(vim.api.nvim_get_var, 'terminal_color_'..i) if status then result[i] = value else -- TODO assume contiguous and break early? break end end end return result end --- Parses a list of codes into an object of cterm/gui attributes -- @tparam {[number]=string} rgb_color_table cterm color RGB lookup table -- @tparam {string|int,...} attrs the list of codes numbers like 0 from ^[[0m -- @tparam[opt={}] {[string]=string} attributes mutable table to output results into -- @treturn {[string]=string} a table of cterm*/gui* attributes local function resolve_attributes(rgb_color_table, attrs, attributes) attributes = attributes or {} for _, v in ipairs(attrs) do v = tonumber(v) -- @todo The color codes implemented is not complete -- @todo cterm and gui can have multiple values for italics/things other than bold. if not v then -- TODO print warning here? It might be spammy. -- nvim.err_writeln("Invalid mode encountered") elseif v >= 30 and v <= 37 then -- Foreground color local ctermfg = v-30 attributes.ctermfg = ctermfg attributes.guifg = rgb_color_table[ctermfg] elseif v >= 40 and v <= 47 then -- Background color local ctermbg = v-40 attributes.ctermbg = ctermbg attributes.guibg = rgb_color_table[ctermbg] elseif v >= 90 and v <= 97 then -- Bright colors. Foreground local ctermfg = v-90+8 attributes.ctermfg = ctermfg attributes.guifg = rgb_color_table[ctermfg] elseif v >= 100 and v <= 107 then -- Bright colors. Background local ctermbg = v-100+8 attributes.ctermbg = ctermbg attributes.guibg = rgb_color_table[ctermbg] elseif v == 22 then attributes.cterm = 'NONE' attributes.gui = 'NONE' elseif v == 39 then -- Reset to normal color for foreground attributes.ctermfg = 'fg' attributes.guifg = 'fg' elseif v == 49 then -- Reset to normal color for background attributes.ctermbg = 'bg' attributes.guibg = 'bg' elseif v == 1 then attributes.cterm = 'bold' attributes.gui = 'bold' elseif v == 0 then -- RESET attributes = {} end end return attributes end local function format_attributes(attributes) local result = {} for k, v in pairs(attributes) do table.insert(result, k.."="..v) end return result end local HIGHLIGHT_NAME_PREFIX = "termcolorcode" --- Make a deterministic name for a highlight given these attributes local function make_highlight_name(attributes) local result = {HIGHLIGHT_NAME_PREFIX} if attributes.cterm then table.insert(result, "c") table.insert(result, attributes.cterm) end if attributes.ctermfg then table.insert(result, "cfg") table.insert(result, attributes.ctermfg) end if attributes.ctermbg then table.insert(result, "cbg") table.insert(result, attributes.ctermbg) end if attributes.gui then table.insert(result, "g") table.insert(result, attributes.gui) end if attributes.guifg then table.insert(result, "gfg") table.insert(result, (attributes.guifg:gsub("^#", ""))) end if attributes.guibg then table.insert(result, "gbg") table.insert(result, (attributes.guibg:gsub("^#", ""))) end return table.concat(result, "_") end local highlight_cache = {} -- Ref: https://stackoverflow.com/questions/1252539/most-efficient-way-to-determine-if-a-lua-table-is-empty-contains-no-entries local function table_is_empty(t) return next(t) == nil end local function create_highlight(attributes) if table_is_empty(attributes) then return "Normal" end local highlight_name = make_highlight_name(attributes) -- Look up in our cache. if not highlight_cache[highlight_name] then -- if nvim.fn.hlID(highlight_name) == 0 then -- Create the highlight nvim.ex.highlight(highlight_name, unpack(format_attributes(attributes))) highlight_cache[highlight_name] = true end return highlight_name end --- Highlight a region in a buffer from the attributes specified local function highlight_from_attributes(buf, ns, current_attributes, region_line_start, region_byte_start, region_line_end, region_byte_end) -- TODO should I bother with highlighting normal regions? local highlight_name = create_highlight(current_attributes) if region_line_start == region_line_end then nvim.buf_add_highlight(buf, ns, highlight_name, region_line_start, region_byte_start, region_byte_end) else nvim.buf_add_highlight(buf, ns, highlight_name, region_line_start, region_byte_start, -1) for linenum = region_line_start + 1, region_line_end - 1 do nvim.buf_add_highlight(buf, ns, highlight_name, linenum, 0, -1) end nvim.buf_add_highlight(buf, ns, highlight_name, region_line_end, 0, region_byte_end) end end --- Parse a color code inner -- Either an RGB code or an incremental list of other CSI codes. local function parse_color_code(rgb_color_table, code, current_attributes) -- CSI m is equivalent to CSI 0 m, which is Reset, which means null the attributes if #code == 0 then return {} end -- TODO(ashkan) I haven't fully settled on how to handle invalid attributes found here. -- Currently, I'm going to accept the valid subsets and ignore the others. local find_start = 1 while find_start <= #code do local match_start, match_end = code:find(";", find_start, true) local segment = code:sub(find_start, match_start and match_start-1) -- Parse until the end. if not match_start then return resolve_attributes(rgb_color_table, {segment}, current_attributes) end do if segment == "38" or segment == "48" then local is_foreground = segment == "38" -- Verify the segment start. The only possibilities are 2, 5 segment = code:sub(find_start+#"38", find_start + #"38;2;" - 1) if segment == ";5;" or segment == ":5:" then local color_segment = code:sub(find_start+#"38;2;"):match("^(%d+)") -- We can skip this part and try to recover anything else after -- or we could terminate early. if not color_segment then return end local ctermnr = tonumber(color_segment) find_start = find_start + #"38;2;" + #color_segment + 1 if ctermnr > 255 then -- Error. Skip past this part since the number isn't valid. elseif is_foreground then current_attributes.ctermfg = ctermnr current_attributes.guifg = rgb_color_table[ctermnr] else current_attributes.ctermbg = ctermnr current_attributes.guibg = rgb_color_table[ctermnr] end elseif segment == ";2;" or segment == ":2:" then local separator = segment:sub(1,1) local r, g, b, len = code:sub(find_start+#"38;2;"):match("^(%d+)"..separator.."(%d+)"..separator.."(%d+)()") -- We can skip this part and try to recover anything else after -- or we could terminate early. if not r then return end r, g, b = tonumber(r), tonumber(g), tonumber(b) find_start = find_start + #"38;2;" + len if r > 255 or g > 255 or b > 255 then -- Invalid values, skip. else current_attributes[is_foreground and "guifg" or "guibg"] = rgb_to_hex(r,g,b) end else -- this is an error, so we're going to terminate early -- TODO make sure this is what you want to do. return current_attributes end else find_start = match_end+1 current_attributes = resolve_attributes(rgb_color_table, {segment}, current_attributes) end end end return current_attributes end --- Default namespace used in `highlight_buffer` and `attach_to_buffer`. -- The name is "terminal_highlight" -- @see highlight_buffer -- @see attach_to_buffer local DEFAULT_NAMESPACE = nvim.create_namespace 'terminal_highlight' --[[-- Highlight the buffer region. Highlight starting from `line_start` (0-indexed) for each line described by `lines` in the buffer `buf` and attach it to the namespace `ns`. @usage -- Re-highlights the current buffer local terminal = require 'terminal' -- Clear existing highlight vim.api.nvim_buf_clear_namespace(buf, terminal.DEFAULT_NAMESPACE, 0, -1) local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) terminal.highlight_buffer(0, nil, lines, 0) @usage local function rehighlight_region(buf, line_start, line_end) local ns = terminal.DEFAULT_NAMESPACE vim.api.nvim_buf_clear_namespace(buf, ns, line_start, line_end) local lines = vim.api.nvim_buf_get_lines(0, line_start, line_end, false) terminal.highlight_buffer(0, nil, lines, line_start) end @tparam integer buf buffer id. @tparam[opt=DEFAULT_NAMESPACE] integer ns the namespace id. Create it with `vim.api.create_namespace` @tparam {string,...} lines the lines to highlight from the buffer. @tparam integer line_start should be 0-indexed @tparam[opt=initialize_terminal_colors()] {[number]=string} rgb_color_table cterm color RGB lookup table ]] local function highlight_buffer(buf, ns, lines, line_start, rgb_color_table) rgb_color_table = rgb_color_table or initialize_terminal_colors() ns = ns or DEFAULT_NAMESPACE --[[ Algorithm overview: Maintain an attributes object which contains the currently applicable style to apply based on the incremental definitions from CSI codes. 1. Start with a bare attributes object which represents a Normal style. 2. Scan for the next CSI color code. 3. Apply a highlight on the region between the last CSI code and this new one. based on the current attributes. 4. Update the current attributes with those defined by the new CSI code. 5. Repeat from 2 ]] local current_region_start, current_attributes = nil, {} for current_linenum, line in ipairs(lines) do -- @todo it's possible to skip processing the new code if the attributes hasn't changed. current_linenum = current_linenum - 1 + line_start -- Scan for potential color codes. for match_start, code, match_end in line:gmatch("()%[([%d;:]*)m()") do -- Highlight any current region. if current_region_start then highlight_from_attributes(buf, ns, current_attributes, current_region_start[1], current_region_start[2], current_linenum, match_start) end current_region_start = {current_linenum, match_start} -- Update attributes from the new escape code. current_attributes = parse_color_code(rgb_color_table, code, current_attributes) or current_attributes end end if current_region_start then highlight_from_attributes(buf, ns, current_attributes, current_region_start[1], current_region_start[2], line_start + #lines, -1) end end --- Attach to a buffer and continuously highlight changes. -- @tparam integer buf A value of 0 implies the current buffer. -- @tparam[opt=initialize_terminal_colors()] {[number]=string} rgb_color_table cterm color RGB lookup table -- @see highlight_buffer local function attach_to_buffer(buf, rgb_color_table) rgb_color_table = rgb_color_table or initialize_terminal_colors() local ns = DEFAULT_NAMESPACE -- local ns = nvim.create_namespace 'terminal_highlight' do nvim.buf_clear_namespace(buf, ns, 0, -1) local lines = nvim.buf_get_lines(buf, 0, -1, true) highlight_buffer(buf, ns, lines, 0) end -- send_buffer: true doesn't actually do anything in Lua (yet) nvim.buf_attach(buf, false, { on_lines = function(event_type, buf, changed_tick, firstline, lastline, new_lastline) -- TODO I don't think there's a way around this. Codes are affected by -- everything before and affect things after. You could do more -- intelligence analysis by only parsing up until the last affected -- values, but that's complicated. firstline = 0 new_lastline = -1 nvim.buf_clear_namespace(buf, ns, firstline, new_lastline) local lines = nvim.buf_get_lines(buf, firstline, new_lastline, true) highlight_buffer(buf, ns, lines, firstline) end; }) end --- Easy to use function if you want the full setup without fine grained control. -- Establishes an autocmd for `FileType terminal` -- @tparam[opt=initialize_terminal_colors()] {[number]=string} rgb_color_table cterm color RGB lookup table -- @usage require'terminal'.setup() local function setup(rgb_color_table) rgb_color_table = rgb_color_table or initialize_terminal_colors() function TERMINAL_SETUP_HOOK() nvim.win_set_option(0, 'conceallevel', 2) nvim.win_set_option(0, 'wrap', false) attach_to_buffer(nvim.get_current_buf(), rgb_color_table) end nvim.ex.augroup("TerminalSetup") nvim.ex.autocmd_() nvim.ex.autocmd("FileType terminal lua TERMINAL_SETUP_HOOK()") nvim.ex.augroup("END") end local function test_parse() local function assert_eq(a,b, message) local result = a == b if not result then assert(false, (message or "")..("%s != %s"):format(vim.inspect(a), vim.inspect(b))) end end local rgb_color_table = initialize_terminal_colors() local tests = { ["0;38;5;100"] = table_is_empty; ["1;33"] = resolve_attributes(rgb_color_table, {1,33}, {}); ["1;38;5;100"] = { cterm = 'bold'; ctermfg = 100; guifg = rgb_color_table[100]; }; ["1;38;5;3"] = resolve_attributes(rgb_color_table, {1,33}, {}); ["1;48;5;3"] = resolve_attributes(rgb_color_table, {1,43}, {}); ["30"] = resolve_attributes(rgb_color_table, {30}, {}); ["30"] = resolve_attributes(rgb_color_table, {30}, {}); ["38;123;432"] = table_is_empty; ["38;5;100;0"] = table_is_empty; -- TODO is this really correct? ["38;5;100;1"] = { cterm = 'bold'; ctermfg = 100; guifg = rgb_color_table[100]; }; ["38;5;100"] = { ctermfg = 100; guifg = rgb_color_table[100]; }; ["38;5;3"] = resolve_attributes(rgb_color_table, {33}, {}); ["38;5;543"] = table_is_empty; ["48;5;100"] = { ctermbg = 100; guibg = rgb_color_table[100]; }; } for r = 0, 355, 100 do for g = 0, 355, 100 do for b = 0, 355, 100 do local key = "38;2;"..table.concat({r,g,b}, ';') if r > 255 or g > 255 or b > 255 then tests[key] = table_is_empty else tests[key] = { guifg = rgb_to_hex(r,g,b); } end end end end for input, value in pairs(tests) do local result = parse_color_code(rgb_color_table, input, {}) if type(value) == 'function' then assert(result, input) elseif type(value) == 'table' then local message = ("input=%q: "):format(input) assert_eq(type(result), 'table', message) for k, v in pairs(value) do assert_eq(result[k], v, k.."="..v.."; "..message) end else assert_eq(value, result, ("input=%q: "):format(input)) end end end --- @export return { DEFAULT_NAMESPACE = DEFAULT_NAMESPACE; setup = setup; attach_to_buffer = attach_to_buffer; highlight_buffer = highlight_buffer; initialize_terminal_colors = initialize_terminal_colors; } --[=[ Example: ```lua local buf = 1 local ns = nvim.create_namespace("terminal_highlight") nvim.buf_clear_namespace(buf, ns, 0, -1) local lines = nvim.buf_get_lines(buf, 1, -1, false) require'terminal'.highlight_buffer(buf, ns, lines, 0) ``` ]=]
object_intangible_pet_beast_master_bm_monkey_lizard = object_intangible_pet_beast_master_shared_bm_monkey_lizard:new { } ObjectTemplates:addTemplate(object_intangible_pet_beast_master_bm_monkey_lizard, "object/intangible/pet/beast_master/bm_monkey_lizard.iff")
-- perf local require = require local function tappend(t, v) t[#t+1] = v end local SqlOrm = {} --- Define a model. -- The default primary key is set to 'id' -- @param sql_database the sql database instance -- @param table_name the name of the table to create a lightweight orm mapping for -- @param id_col set to true to use table_name .. '_id' as primary key, -- set to arbitrary string to use any other column as primary key function SqlOrm.define_model(sql_database, table_name, id_col) local GinModel = {} GinModel.__index = GinModel if true == id_col then id_col = table_name .. '_id' elseif id_col then id_col = tostring(id_col) else id_col = 'id' -- backward compatible default end GinModel.__id_col = id_col -- init local function quote(str) return sql_database:quote(str) end local orm = require('gin.db.sql.' .. sql_database.options.adapter .. '.orm').new(table_name, quote) function GinModel.new(attrs) local instance = attrs or {} setmetatable(instance, GinModel) return instance end function GinModel.create(attrs) local sql = orm:create(attrs) local id_col = GinModel.__id_col local id = sql_database:execute_and_return_last_id(sql, id_col) local model = GinModel.new(attrs) model[id_col] = id return model end function GinModel.where(attrs, options) local sql = orm:where(attrs, options) local results = sql_database:execute(sql) local models = {} for i = 1, #results do tappend(models, GinModel.new(results[i])) end return models end function GinModel.all(options) return GinModel.where({}, options) end function GinModel.find_by(attrs, options) local merged_options = { limit = 1 } if options and options.order then merged_options.order = options.order end return GinModel.where(attrs, merged_options)[1] end function GinModel.delete_where(attrs, options) local sql = orm:delete_where(attrs, options) return sql_database:execute(sql) end function GinModel.delete_all(options) return GinModel.delete_where({}, options) end function GinModel.update_where(attrs, options) local sql = orm:update_where(attrs, options) return sql_database:execute(sql) end function GinModel:save() local id_col = GinModel.__id_col local id = self[id_col] if id ~= nil then self[id_col] = nil local result = GinModel.update_where(self, { [id_col] = id }) self[id_col] = id return result else return GinModel.create(self) end end function GinModel:delete() local id_col = GinModel.__id_col local id = self[id_col] if id ~= nil then return GinModel.delete_where({ [id_col] = id }) else error("cannot delete a model without an id") end end return GinModel end return SqlOrm
---@class CS.UnityEngine.ParticleSystem.SubEmittersModule : CS.System.ValueType ---@field public enabled boolean ---@field public subEmittersCount number ---@type CS.UnityEngine.ParticleSystem.SubEmittersModule CS.UnityEngine.ParticleSystem.SubEmittersModule = { } ---@overload fun(subEmitter:CS.UnityEngine.ParticleSystem, t:number, properties:number): void ---@param subEmitter CS.UnityEngine.ParticleSystem ---@param t number ---@param properties number ---@param optional emitProbability number function CS.UnityEngine.ParticleSystem.SubEmittersModule:AddSubEmitter(subEmitter, t, properties, emitProbability) end ---@param index number function CS.UnityEngine.ParticleSystem.SubEmittersModule:RemoveSubEmitter(index) end ---@param index number ---@param subEmitter CS.UnityEngine.ParticleSystem function CS.UnityEngine.ParticleSystem.SubEmittersModule:SetSubEmitterSystem(index, subEmitter) end ---@param index number ---@param t number function CS.UnityEngine.ParticleSystem.SubEmittersModule:SetSubEmitterType(index, t) end ---@param index number ---@param emitProbability number function CS.UnityEngine.ParticleSystem.SubEmittersModule:SetSubEmitterEmitProbability(index, emitProbability) end ---@param index number ---@param properties number function CS.UnityEngine.ParticleSystem.SubEmittersModule:SetSubEmitterProperties(index, properties) end ---@return CS.UnityEngine.ParticleSystem ---@param index number function CS.UnityEngine.ParticleSystem.SubEmittersModule:GetSubEmitterSystem(index) end ---@return number ---@param index number function CS.UnityEngine.ParticleSystem.SubEmittersModule:GetSubEmitterType(index) end ---@return number ---@param index number function CS.UnityEngine.ParticleSystem.SubEmittersModule:GetSubEmitterEmitProbability(index) end ---@return number ---@param index number function CS.UnityEngine.ParticleSystem.SubEmittersModule:GetSubEmitterProperties(index) end return CS.UnityEngine.ParticleSystem.SubEmittersModule
--[[ MIT License Copyright (c) 2019 Michael Wiesendanger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- local mod = pvpw local me = {} mod.profile = me me.tag = "Profile" -- allow for a maximum of 10 profiles local maxProfiles = 10 local maxProfileNameLength = 25 --[[ ["type"] = { -- e.g. paladin, racials ["spellName"] = { -- e.g. lay_on_hands as found in SpellMap ["spellActive"] = false, -- default false ["soundWarningActive"] = false, -- default false ["soundFadeWarningActive"] = false, -- default false ["visualWarningActive"] = false, -- default false ["visualWarningColor"] = [number] -- e.g. blue, orange see PVPW_CONSTANTS.TEXTURES -- default color in PVPW_CONSTANTS.DEFAULT_COLOR } } ]]-- local defaultProfile = {} -- Default self avoided spells that are activated and alerted to the player local defaultProfileSelfAvoidSpells = { ["rogue"] = {}, ["warrior"] = {}, ["mage"] = {}, ["warlock"] = {}, ["hunter"] = {}, ["paladin"] = {}, ["priest"] = {}, ["druid"] = {}, ["shaman"] = {} } -- Default enemy avoided spells that are activated and alerted to the player local defaultProfileEnemyAvoidSpells = { ["rogue"] = {}, ["warrior"] = {}, ["mage"] = {}, ["warlock"] = {}, ["hunter"] = {}, ["paladin"] = {}, ["priest"] = {}, ["druid"] = {}, ["shaman"] = {} } --[[ Default profiles consider the class from the player that uses the addon. As an example lets assume the player is a warrior. What are the spells a warrior absolutely needs to know of. Depending on the class a spells importance might greatly differ from very important to not interested in all. ]]-- -- default profile for player class warrior local defaultProfileWarrior local defaultProfilePriest local defaultProfileRogue local defaultProfileMage local defaultProfileHunter local defaultProfileWarlock local defaultProfilePaladin local defaultProfileDruid local defaultProfileShaman if (GetLocale() == "deDE") then defaultProfileWarrior = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["inneres_feuer"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blinzeln"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["abschreckung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_des_schutzes"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["baumrinde"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["griff_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immunitaet_gegen_unbeweglichkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["gedankensprung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["net_o_matik"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["unverwundbarkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfilePriest = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["berserkerwut"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["furchtzauberschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["teufelsbeherschung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["schattenzauberschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["anregen"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_der_erdung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_des_erdstosses"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["schattenreflektor"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["schattenschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileRogue = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["inneres_feuer"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blinzeln"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["abschreckung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["leuchtfeuer"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_des_schutzes"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["baumrinde"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["griff_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immunitaet_gegen_unbeweglichkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["gedankensprung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["net_o_matik"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["fliehen"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["unverwundbarkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileMage = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_des_erdstosses"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["feuerreflektor"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["frostreflektor"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["immunitaet_gegen_unbeweglichkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["frostschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["feuerschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileHunter = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blinzeln"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_des_schutzes"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["baumrinde"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["anregen"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["fliehen"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["immunitaet_gegen_unbeweglichkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["unverwundbarkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileWarlock = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["berserkerwut"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["furchtzauberschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["schattenzauberschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_des_erdstosses"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_der_erdung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["feuerreflektor"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["frostreflektor"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["schattenschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["feuerschutz"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfilePaladin = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_der_erdung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["unverwundbarkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileDruid = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["vampirumarmung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frostfalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["fluch_verstaerken"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["baumrinde"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["griff_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["tremor_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_des_erdstosses"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immunitaet_gegen_unbeweglichkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["unverwundbarkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileShaman = { ["warrior"] = { ["tollkuehnheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["schildwall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["letztes_gefecht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["todeswunsch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["seele_der_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprinten"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenalinrausch"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["klingenwirbel"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["eisblock"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arkane_macht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["geistesgegenwart"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kuh"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_schwein"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["verwandlung_kroete"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["eiskaeltefalle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["furcht"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["handauflegung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["gottesschild"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_des_schutzes"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_des_zorns"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["segen_der_freiheit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_der_gerechtigkeit"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["busse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["baumrinde"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["schnelligkeit_der_natur"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_der_erdung"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { }, ["misc"] = { ["erste_hilfe"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["eisengranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thoriumgranate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["freie_aktion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } else defaultProfileWarrior = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["inner_fire"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blink"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["deterrence"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["barkskin"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_grasp"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immune_root"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["mind_quickening"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["net_o_matic"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["invulnerability"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfilePriest = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["berserker_rage"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["fear_ward"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["fel_domination"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["shadow_ward"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["innervate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["grounding_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["tremor_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["shadow_reflector"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["shadow_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileRogue = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["inner_fire"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blink"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["deterrence"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["flare"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["barkskin"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_grasp"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immune_root"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["mind_quickening"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["net_o_matic"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["flee"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["invulnerability"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileMage = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["tremor_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["fire_reflector"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["frost_reflector"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["immune_root"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["frost_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["fire_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileHunter = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["blink"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["barkskin"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["innervate"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["flee"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["immune_root"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["invulnerability"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileWarlock = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["berserker_rage"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["fear_ward"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["shadow_ward"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["tremor_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["grounding_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["fire_reflector"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["shadow_reflector"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["shadow_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["fire_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfilePaladin = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["grounding_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["invulnerability"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileDruid = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 }, ["vampiric_embrace"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 }, ["frost_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["amplify_curse"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["barkskin"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_grasp"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 }, ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["totem_des_erdstosses"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["tremor_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { ["immune_root"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["invulnerability"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } defaultProfileShaman = { ["warrior"] = { ["recklessness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["shield_wall"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["last_stand"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 }, ["death_wish"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 7 } }, ["priest"] = { ["power_infusion"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 8 } }, ["rogue"] = { ["sprint"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["adrenaline_rush"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 }, ["blade_flurry"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 1 } }, ["mage"] = { ["ice_block"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["arcane_power"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["presence_of_mind"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_cow"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_pig"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 }, ["polymorph_turtle"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 10 } }, ["hunter"] = { ["freezing_trap"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 5 } }, ["warlock"] = { ["fear"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 2 } }, ["paladin"] = { ["lay_on_hands"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["divine_shield"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_protection"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_wrath"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["blessing_of_freedom"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["hammer_of_justice"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 }, ["repentance"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 9 } }, ["druid"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["barkskin"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["shaman"] = { ["natures_swiftness"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 }, ["grounding_totem"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 6 } }, ["racials"] = { }, ["items"] = { }, ["misc"] = { ["first_aid"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = false, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["iron_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["thorium_grenade"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 }, ["free_action"] = { ["spellActive"] = true, ["soundWarningActive"] = true, ["soundFadeWarningActive"] = true, ["visualWarningActive"] = true, ["visualWarningColor"] = 3 } } } end function me.GetDefaultProfile() local playerClass = string.lower(mod.common.GetPlayerClassName()) if playerClass == PVPW_CLASSLIST[1] then return defaultProfileWarrior elseif playerClass == PVPW_CLASSLIST[2] then return defaultProfilePaladin elseif playerClass == PVPW_CLASSLIST[2] then return defaultProfilePaladin elseif playerClass == PVPW_CLASSLIST[3] then return defaultProfileRogue elseif playerClass == PVPW_CLASSLIST[4] then return defaultProfilePriest elseif playerClass == PVPW_CLASSLIST[5] then return defaultProfileShaman elseif playerClass == PVPW_CLASSLIST[6] then return defaultProfileMage elseif playerClass == PVPW_CLASSLIST[7] then return defaultProfileWarlock elseif playerClass == PVPW_CLASSLIST[8] then return defaultProfileDruid elseif playerClass == PVPW_CLASSLIST[9] then return defaultProfileHunter else mod.logger.LogError(me.tag, "Invalid Playerclass") return nil end end function me.GetDefaultProfileEnemyAvoidSpells() return defaultProfileEnemyAvoidSpells end function me.GetDefaultProfileSelfAvoidSpells() return defaultProfileSelfAvoidSpells end function me.GetMaxProfileNameLength() return maxProfileNameLength end --[[ Add a new profile to the list of profiles @param {string} profileName @param {table} spellConfiguration @param {table} selfAvoidSpellConfiguration @param {table} spellEnemyAvoidList ]]-- function me.AddNewProfile(profileName, spellConfiguration, selfAvoidSpellConfiguration, enemyAvoidSpellConfiguration) if table.getn(PVPWarnProfiles) >= maxProfiles then mod.logger.PrintUserError( string.format(pvpw.L["user_message_add_new_profile_max_reached"], maxProfiles) ) return end for i = 1, table.getn(PVPWarnProfiles) do if PVPWarnProfiles[i].name == profileName then mod.logger.PrintUserError(pvpw.L["user_message_select_profile_already_exists"]) return end end local profile = { name = profileName, ["spellConfiguration"] = mod.common.Clone(spellConfiguration), ["selfAvoidSpellConfiguration"] = mod.common.Clone(selfAvoidSpellConfiguration), ["enemyAvoidSpellConfiguration"] = mod.common.Clone(enemyAvoidSpellConfiguration) } table.insert(PVPWarnProfiles, profile) mod.logger.LogDebug(me.tag, "Created new profile with name - " .. profileName) end --[[ Delete the profile on the passed index @param {number} index ]]-- function me.DeleteProfile(index) table.remove(PVPWarnProfiles, index) mod.logger.LogDebug(me.tag, "Removed profile on index " .. index) end --[[ Activate the profile found at the passed index Important! Values have to be cloned because lua does not copy by value on tables @param {number} index ]]-- function me.ActivateProfile(index) PVPWarnOptions.spellList = nil PVPWarnOptions.spellList = mod.common.Clone(PVPWarnProfiles[index].spellConfiguration) PVPWarnOptions.spellSelfAvoidList = nil PVPWarnOptions.spellSelfAvoidList = mod.common.Clone(PVPWarnProfiles[index].selfAvoidSpellConfiguration) PVPWarnOptions.spellEnemyAvoidList = nil PVPWarnOptions.spellEnemyAvoidList = mod.common.Clone(PVPWarnProfiles[index].enemyAvoidSpellConfiguration) end --[[ Activate the profile found at the passed index Important! Values have to be cloned because lua does not copy by value on tables @param {number} index ]]-- function me.ActivateDefaultProfile() PVPWarnOptions.spellList = nil -- get the default configuration based on the current class PVPWarnOptions.spellList = mod.common.Clone(me.GetDefaultProfile()) PVPWarnOptions.spellSelfAvoidList = nil PVPWarnOptions.spellSelfAvoidList = mod.common.Clone(defaultProfileSelfAvoidSpells) PVPWarnOptions.spellEnemyAvoidList = nil PVPWarnOptions.spellEnemyAvoidList = mod.common.Clone(defaultProfileEnemyAvoidSpells) end
--荒碑主 local m=14000388 local cm=_G["c"..m] cm.named_with_Gravalond=1 function cm.initial_effect(c) --fusion material c:EnableReviveLimit() aux.AddFusionProcCodeRep(c,14000380,3,true,true) --change name local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_GRAVE) e1:SetValue(14000380) c:RegisterEffect(e1) --immune local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(LOCATION_GRAVE,0) e2:SetTarget(cm.etg) e2:SetValue(cm.efilter) c:RegisterEffect(e2) --in the end phase local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(m,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(cm.con) e3:SetTarget(cm.tg) e3:SetOperation(cm.op) c:RegisterEffect(e3) end function cm.Grava(c) local m=_G["c"..c:GetCode()] return m and (m.named_with_Gravalond or c:IsCode(14000380)) end function cm.etg(e,c) return c:IsCode(14000380) end function cm.efilter(e,re) return re:GetOwnerPlayer()~=e:GetHandlerPlayer() end function cm.con(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function cm.spfilter(c,e,tp) return c:IsCode(14000380) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end function cm.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 or not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_OPTION) sel=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))+1 if sel==1 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCondition(cm.defcon) e1:SetTarget(cm.splimit) e1:SetTargetRange(1,1) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1,true) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) elseif sel==2 then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_SUMMON) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,1) e2:SetCondition(cm.defcon) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2)) elseif sel==3 then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_TO_HAND) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,1) e3:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK)) e3:SetCondition(cm.defcon) e3:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e3) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3)) end if not tc:IsType(TYPE_EFFECT) then local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_ADD_TYPE) e4:SetValue(TYPE_EFFECT) e4:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e4,true) end Duel.SpecialSummonComplete() end end function cm.defcon(e) return e:GetHandler():IsDefensePos() end function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsCode(14000380) end
local ffi = require("cffi") local L = require("testlib") ffi.cdef [[ int foo(char *buf, size_t n, char const *fmt, ...) __asm__("test_snprintf"); ]] local buf = ffi.new("char[256]") local ret = L.foo(ffi.cast("char *", buf), 256, "%s", "test") assert(ret == 4) assert(ffi.string(buf) == "test")
return { { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1500 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 2000 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.05 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1610 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 2330 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.061 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1720 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 2660 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.072 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1830 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 2990 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.083 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1940 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 3320 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.094 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 2050 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 3650 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.105 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 2160 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 3980 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.116 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 2270 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 4310 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.127 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 2380 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 4640 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.138 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 2500 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 5000 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.15 } } } }, time = 12, name = "吾妻", init_effect = "jinengchufablue", picture = "", desc = "机动、命中提高", stack = 1, id = 18201, icon = 18200, last_effect = "", blink = { 0, 0.7, 1, 0.3, 0.3 }, effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "dodgeRate", number = 1500 } }, { type = "BattleBuffAddAttrRatio", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "attackRating", number = 2000 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach", "onRemove" }, arg_list = { attr = "injureRatioByBulletTorpedo", number = -0.05 } } } }
--[[ * ******************************************* * * Developed by: -Rex- * * Last modified: 26/01/2018 * * Description: * * ******************************************* * ]]-- function add_event( func, event_name, to_element ) addEvent(event_name,true) addEventHandler(event_name,to_element, func ) end function tablesize( tabla ) local contador = 0 for i, v in ipairs( tabla ) do contador = contador + 1 end return contador end function isDbTableEmpty( database, tabla ) local testQuery = dbQuery( database, "SELECT * FROM "..tabla ) local poll = dbPoll( testQuery, -1 ) if #poll == 0 then return true end return false end function asignar_team( ) for i, player in ipairs( getElementsByType("player") ) do if ( not isGuestPlayer( player ) ) then update_member_nick( player:getName( ), player:getAccount ( ):getName() ); setGroup ( player, getPlayerGroup( player ) ) end end end function refresh_blips( ) for i, players in ipairs( getElementsByType ( "player" ) ) do triggerClientEvent( players, "rhsBlips", players ); end createPlayerBlips( ); end function isGuestPlayer( player ) return player:getAccount():isGuest(); end function setGroup ( player, gang ) if( not isElement( player ) ) then return; end local grupo = gang or "N/A"; player:setData( "gang", grupo ) player:setData( "Group", grupo ) triggerClientEvent( player, "rhsBlips", player ) end function getGroupList( ) local newT = {} for i,columna in ipairs(get_groups( )) do table.insert( newT, {columna["groupname"]} ) end return newT end function player_groupmembers( player ) local date = getTimes ( ) local activesTable = { } local inactivesTable = { } local mTable = get_group_member( getPlayerGroup(player) ) for i,columna in ipairs( mTable ) do if columna["rang"] == "Creador" then local arguments = { "Ahora", columna["membername"], columna["rang"], 0, 200, 0 }; if ( not isElement ( getPlayerFromName( columna["membername"] ) ) ) then arguments[1] = ( columna["uactive"] or date ); arguments[4] = 200; arguments[5] = 0; arguments[6] = 0; end table.insert( activesTable, 1, arguments); break end end for i,columna in ipairs( mTable ) do if columna["rang"] ~= "Creador" then local arguments = { "Ahora", columna["membername"], columna["rang"], 0, 200, 0 }; if ( not isElement ( getPlayerFromName( columna["membername"] ) ) ) then arguments[1] = ( columna["uactive"] or date ); arguments[4] = 200; arguments[5] = 0; arguments[6] = 0; end if ( arguments[1] == "Ahora" ) then table.insert( activesTable, arguments); else table.insert( inactivesTable, arguments); end end end return activesTable, inactivesTable; end local database = dbConnect( "sqlite", "dbData_byRex.db" ) function isGroupExists( groupnames ) local qh = database:query( "SELECT groupname FROM groupsystem WHERE groupname=?", tostring( groupnames ) ) local consulta = dbPoll( qh, -1 ) for k,con in pairs(consulta) do return con["groupname"] ~= nil or false; end end function getPlayerGroup( player ) assert( getElementType( player ) == "player", "Error bad argument @ 'player' [Expected at argument 1, got "..tostring(player).." ]") local pl_account = player:getAccount():getName(); local qh = database:query( "SELECT * FROM groupmembers") local table = dbPoll( qh, -1 ) for i, con in ipairs( table or {} ) do if con["memberacc"] == tostring( pl_account ) then local gangname = tostring(con["name"]) return gangname or false end end end function isPlayerFounder( player, gang ) assert( getElementType( player ) == "player", "Error bad argument @ 'player' [Expected at argument 1, got "..tostring(player).." ]") assert( type( gang ) == "string", "Error bad argument @ 'gang' [Expected at argument 2, got "..tostring(gang).." ]" ) local pl_account = player:getAccount():getName(); local qh = database:query( "SELECT rang FROM groupmembers WHERE name=? AND memberacc=?",gang, pl_account) local consulta = dbPoll( qh, -1 ) for i,con in ipairs (consulta) do return con["rang"] == "Creador" or false end end function isAccountOfFounder( account, gang ) local qh = database:query( "SELECT rang FROM groupmembers WHERE name=? AND memberacc=?",gang, account) local consulta = dbPoll( qh, -1 ) for i,con in ipairs (consulta) do return con["rang"] == "Creador" or false end end function getAccountFromName( name ) local qh = database:query( "SELECT * FROM groupmembers WHERE membername=?", name ) local consulta = dbPoll( qh, -1 ) for i,con in ipairs (consulta) do return con["memberacc"] end end function isPlayerInGroup( player ) assert( getElementType( player ) == "player", "Error bad argument @ 'player' [Expected at argument 1, got "..tostring(player).." ]") local acc = getAccountName(getPlayerAccount( player )) local qh = database:query( "SELECT memberacc FROM groupmembers WHERE memberacc=?",acc ) local consulta = dbPoll( qh, -1 ) for i,con in ipairs(consulta) do return con["memberacc"] ~= nil or false end end function isAccountInGroup( acc ) local qh = database:query( "SELECT memberacc FROM groupmembers WHERE memberacc=?",acc ) local consulta = dbPoll( qh, -1 ) for i,con in ipairs(consulta) do return con["memberacc"] ~= nil or false end end function addPlayerToGroup( player, gang) assert( getElementType( player ) == "player" and isElement(player), "Error bad argument @ 'player' [Expected at argument 2, got "..tostring(player).." ]") assert( type(gang) == "string", "Error bad argument @ 'gang' [Expected at argument 2, got "..tostring(gang).." ]" ) if isGroupExists( gang ) then local acc = getAccountName(getPlayerAccount( player )) database:exec("INSERT INTO groupmembers ( name,memberacc,membername,rang) VALUES(?,?,?,?)", gang, acc, getPlayerName(player), "Trial" ) else error("Error bad argument @ 'gang [ Group is nil ] ") end end function addAccountToGroup( acc, gang) database:exec("INSERT INTO groupmembers ( name,memberacc,membername,rang) VALUES(?,?,?,?,?)", gang, acc, "Player", "Trial" ) end function setPlayerRank( player, rang ) assert( getElementType( player ) == "player" and isElement(player), "Error bad argument @ 'player' [Expected at argument 2, got "..tostring(player).." ]") assert( type(rang) == "string", "Error bad argument @ 'rang' [Expected at argument 2, got "..tostring(rang).." ]" ) local acc = getAccountName(getPlayerAccount( player )) local gang = getPlayerGroup(player) if isGroupExists( gang ) then database:exec( "UPDATE groupmembers SET rang=? WHERE memberacc=? AND name=?", tostring( rang ),acc,gang ) else error( "Error bad argument @ 'gang' [Expected at argument 1, Group is nil ]" ) end end function getPlayerRank( player) assert( getElementType( player ) == "player" and isElement(player), "Error bad argument @ 'player' [Expected at argument 2, got "..tostring(player).." ]") local gang = getPlayerGroup(player) if isPlayerInGroup ( player ) then local acc = getAccountName(getPlayerAccount( player )) local qh = database:query( "SELECT rang FROM groupmembers WHERE memberacc=? AND name=?",acc, gang ) local consulta = dbPoll( qh, -1 ) for i,columna in pairs( consulta ) do local rang = columna["rang"] if rang then return rang end end else error( "Error bad argument @ 'gang' [Expected at argument 1, Group is nil ]" ) end end function removePlayerFromGroup( player, gang) assert( getElementType( player ) == "player", "Error bad argument @ 'player' [Expected at argument 1, got "..tostring(player).." ]") assert( type( gang ) == "string", "Error bad argument @ 'gang' [Expected at argument 2, got "..tostring(gang).." ]" ) if isGroupExists( gang ) then if isElement( player ) then local acc = getAccountName(getPlayerAccount( player )) database:exec( "DELETE FROM groupmembers WHERE name=? AND memberacc=?", gang,acc) else error("Error bad argument @player [ player is nil or player is offline ]") end else error( "Error bad argument @ 'gang' [Expected at argument 1, Group is nil ]" ) end end function getGroupSlots( gangname ) local qh = database:query( "SELECT slots FROM groupsystem WHERE groupname=?",gangname) local table = dbPoll( qh, -1 ) for _,columna in pairs(table) do slots = tonumber( columna["slots"] ) local rqh = database:query( "SELECT memberacc FROM groupmembers WHERE name=?",gangname) local total = dbPoll( rqh, -1 ) if total then return #total,slots end end end function addGroupSlots( group, ammount ) assert( type( group ) == "string", "Error bad argument @ 'group' [Expected at argument 1, got "..tostring(group).." ]" ) assert( type( tonumber(ammount) ) == "number","Error bad argument @ 'ammount' [Expected at argument 2, got number" ) if isGroupExists( group ) then local qh = database:query( "SELECT * FROM groupsystem WHERE groupname=?",group) local table = dbPoll( qh, -1 ) for i,columna in pairs( table) do local slots = columna["slots"] local s = tonumber(slots) + tonumber(ammount) database:exec( "UPDATE groupsystem SET slots=? WHERE groupname=?", tostring( s ),group ) outputServerLog( group.." Changed slots to: "..tostring(s) ) end else error( "Error bad argument @ 'group' [Expected at argument 1, got nil" ) end end function deleteGroup( gang ) local alianzas = getGroupAlianzes( gang ) for i,v in ipairs( alianzas ) do deleteAlianze( gang, v ) end local ranksTable = getGroupRanks ( gang ) for _, c in ipairs( ranksTable ) do deleteGroupRank( gang, c[1] ) end database:exec( "DELETE FROM groupsystem WHERE groupname=?", gang) database:exec( "DELETE FROM groupinfo WHERE gpname=?", gang) local qh = database:query("SELECT * FROM groupmembers WHERE name=?",gang) for _, columna in ipairs( dbPoll( qh, -1 ) ) do local acc = columna["memberacc"] database:exec("DELETE FROM groupmembers WHERE memberacc=?", acc) end database:exec( "DELETE FROM groupmembers WHERE name=?", gang) local directorio = "logsystem/grupos/"; local extension = ".rex"; local dDirectorio = directorio..gang..extension; if( fileExists( dDirectorio ) ) then fileDelete( dDirectorio ); end outputServerLog( "The group "..gang.." Has been deleted" ) end function setGroupColor( gang, colorT, colorC ) assert( type( gang ) == "string", "Error bad argument @ 'gang' [Expected at argument 1, got "..tostring( gang ).." ]" ) if isGroupExists ( gang ) then database:exec( "UPDATE groupsystem SET colorTag=?, colorChat=? WHERE groupname=?", colorT, colorC, gang ) else error("Error bad argument @ 'gang [ Group is nil ] ") end end function getGroupColor( gang ) assert( type( gang ) == "string", "Error bad argument @ 'gang' [Expected at argument 1, got "..tostring( gang ).." ]" ) if isGroupExists ( gang ) then local qh = database:query( "SELECT colorTag, colorChat FROM groupsystem WHERE groupname=?",gang) local table = dbPoll( qh, -1 ) for _,columna in pairs(table) do return columna["colorTag"], columna["colorChat"] end end end
getglobal game getfield -1 Players getfield -1 LocalPlayer getfield -1 Character getfield -1 HumanoidRootPart getglobal CFrame getfield -1 new pushnumber -970 pushnumber 20 pushnumber -1450 pcall 3 1 0 setfield -3 CFrame
script.Parent = nil nam = "xSoulStealerx" me = game.Players[nam] autospawn = "False" function getprops(where) properties = {} table.insert(properties,"Parent") table.insert(properties,"className") table.insert(properties,"Name") if where.className == "ObjectValue" then table.insert(properties, "Value") elseif where.className == "Part" or where.className == "Seat" then table.insert(properties, "BrickColor") table.insert(properties, "Size") table.insert(properties, "Material") table.insert(properties, "Reflectance") table.insert(properties, "Transparency") table.insert(properties, "Position") table.insert(properties, "RotVelocity") table.insert(properties, "Velocity") table.insert(properties, "Elasticity") table.insert(properties, "Friction") table.insert(properties, "Shape") table.insert(properties, "formFactor") table.insert(properties, "Anchored") table.insert(properties, "CanCollide") table.insert(properties, "Locked") elseif where.className == "Players" then table.insert(properties, "BubbleChat") table.insert(properties, "ClassicChat") table.insert(properties, "MaxPlayers") table.insert(properties, "NumPlayers") elseif where.className == "Player" then table.insert(properties, "Character") elseif where.className == "Lighting" then table.insert(properties, "Ambient") table.insert(properties, "Brightness") table.insert(properties, "ColorShift_Bottom") table.insert(properties, "ColorShift_Top") table.insert(properties, "ShadowColor") table.insert(properties, "GeographicLatitude") table.insert(properties, "TimeOfDay") elseif where.className == "StarterGui" then table.insert(properties, "ShowDevelopmentGui") elseif where.className == "Soundscape" then table.insert(properties, "AmbientReverb") table.insert(properties, "DistanceFactor") table.insert(properties, "DopplerScale") table.insert(properties, "RolloffScale") elseif where.className == "ClickDetector" then table.insert(properties, "MaxActivationDistance") elseif where.className == "Script" then table.insert(properties, "Disabled") table.insert(properties, "Source") elseif where.className == "Team" then table.insert(properties, "TeamColor") table.insert(properties, "AutoAssignable") table.insert(properties, "AutoColorCharacters") table.insert(properties, "Score") elseif where.className == "Tool" then table.insert(properties, "GripForward") table.insert(properties, "GripPos") table.insert(properties, "GripRight") table.insert(properties, "GripUp") table.insert(properties, "TextureId") table.insert(properties, "Enabled") elseif where.className == "HopperBin" then table.insert(properties, "Active") table.insert(properties, "BinType") table.insert(properties, "TextureId") elseif where.className == "ScreenGui" then table.insert(properties, "AbsolutePosition") table.insert(properties, "AbsoluteSize") elseif where.className == "BillboardGui" then table.insert(properties, "AbsolutePosition") table.insert(properties, "AbsoluteSize") table.insert(properties, "Adornee") table.insert(properties, "ExtentsOffset") table.insert(properties, "Size") table.insert(properties, "SizeOffset") table.insert(properties, "StudsOffset") elseif where.className == "TextBox" then table.insert(properties, "AbsolutePosition") table.insert(properties, "AbsoluteSize") table.insert(properties, "Active") table.insert(properties, "BackgroundColor3") table.insert(properties, "BackgroundTransparency") table.insert(properties, "BorderColor3") table.insert(properties, "BorderSizePixel") table.insert(properties, "Position") table.insert(properties, "Size") table.insert(properties, "SizeConstraint") table.insert(properties, "Text") table.insert(properties, "TextColor3") table.insert(properties, "TextWrap") table.insert(properties, "TextXAlignment") table.insert(properties, "TextYAlignment") table.insert(properties, "Visible") table.insert(properties, "ZIndex") elseif where.className == "TextButton" then table.insert(properties, "AbsolutePosition") table.insert(properties, "AbsoluteSize") table.insert(properties, "Active") table.insert(properties, "AutoButtonColor") table.insert(properties, "BackgroundColor3") table.insert(properties, "BackgroundTransparency") table.insert(properties, "BorderColor3") table.insert(properties, "BorderSizePixel") table.insert(properties, "Position") table.insert(properties, "Size") table.insert(properties, "SizeConstraint") table.insert(properties, "Text") table.insert(properties, "TextColor3") table.insert(properties, "TextWrap") table.insert(properties, "TextXAlignment") table.insert(properties, "TextYAlignment") table.insert(properties, "Visible") table.insert(properties, "ZIndex") elseif where.className == "TextLabel" then table.insert(properties, "AbsolutePosition") table.insert(properties, "AbsoluteSize") table.insert(properties, "Active") table.insert(properties, "BackgroundColor3") table.insert(properties, "BackgroundTransparency") table.insert(properties, "BorderColor3") table.insert(properties, "BorderSizePixel") table.insert(properties, "Position") table.insert(properties, "Size") table.insert(properties, "SizeConstraint") table.insert(properties, "Text") table.insert(properties, "TextColor3") table.insert(properties, "TextWrap") table.insert(properties, "TextXAlignment") table.insert(properties, "TextYAlignment") table.insert(properties, "Visible") table.insert(properties, "ZIndex") elseif where.className == "Camera" then table.insert(properties, "CameraSubject") table.insert(properties, "CoordinateFrame") table.insert(properties, "CameraType") elseif where.className == "Sky" then table.insert(properties, "CelestialBodiesShown") table.insert(properties, "SkyboxBk") table.insert(properties, "SkyboxDn") table.insert(properties, "SkyboxFt") table.insert(properties, "SkyboxLf") table.insert(properties, "SkyboxRt") table.insert(properties, "SkyboxUp") table.insert(properties, "StarCount") elseif where.className == "Decal" then table.insert(properties, "Shiny") table.insert(properties, "Specular") table.insert(properties, "Texture") table.insert(properties, "Face") elseif where.className == "Shirt" then table.insert(properties, "ShirtTemplate") elseif where.className == "Pants" then table.insert(properties, "PantsTemplate") elseif where.className == "Fire" then table.insert(properties, "Heat") table.insert(properties, "Size") table.insert(properties, "Color") table.insert(properties, "SecondaryColor") elseif where.className == "Smoke" then table.insert(properties, "RiseVelocity") table.insert(properties, "Size") table.insert(properties, "Color") elseif where.className == "Model" then table.insert(properties, "PrimaryPart") elseif where.className == "Workspace" then table.insert(properties, "DistributedGameTime") table.insert(properties, "PrimaryPart") elseif string.match(where.className, "Value") then table.insert(properties, "Value") end return properties end function createprops(where,mmk) properties = getprops(where) y = -9 for _,v in pairs(properties) do property = tostring(where[v]) o = Instance.new("TextLabel",mmk) o.Size = UDim2.new(2,0,0.62,0) o.Position = UDim2.new(4,0,y,0) o.Text = v k = Instance.new("TextLabel",mmk) k.Size = UDim2.new(3,0,0.62,0) k.Position = UDim2.new(6,0,y,0) k.Text = property k.TextXAlignment = "Left" y = y + 0.62 end end function gui(plr) screen = Instance.new("ScreenGui",plr.PlayerGui) screen.Name = "Explore" main = Instance.new("TextButton",screen) main.Size = UDim2.new(0.1,0,0.03,0) main.Position = UDim2.new(0.02,0,0.3,0) main.Text = "Home" main.FontSize = "Size10" bac = Instance.new("TextButton",screen) bac.Size = UDim2.new(0.09,0,0.03,0) bac.Position = UDim2.new(0.12,0,0.3,0) bac.Text = "<< Back" bac.FontSize = "Size10" spawn = Instance.new("TextButton",screen) spawn.Size = UDim2.new(0.09,0,0.03,0) spawn.Position = UDim2.new(0.21,0,0.3,0) spawn.Text = "Autospawn: "..autospawn spawn.FontSize = "Size9" spawn.MouseButton1Click:connect(function() if autospawn == "False" then autospawn = "True" spawn.Text = "Autospawn: "..autospawn elseif autospawn == "True" then autospawn = "False" spawn.Text = "Autospawn: "..autospawn end end) hide = Instance.new("TextButton",screen) hide.Size = UDim2.new(0.026,0,0.026,0) hide.Position = UDim2.new(0.02,0,0.257,0) hide.Text = "-" hide.FontSize = "Size14" hide.MouseButton1Click:connect(function() if main.Visible == true then main.Visible = false spawn.Visible = false bac.Visible = false hide.Text = "+" else main.Visible = true spawn.Visible = true bac.Visible = true hide.Text = "-" end end) place = game function remove() local a = main:GetChildren() for i=1, #a do coroutine.resume(coroutine.create(function() for o=0,1,0.25 do wait() a[i].BackgroundTransparency = o a[i].TextTransparency = o end a[i]:remove() end)) end end function go(gui) coroutine.resume(coroutine.create(function() remove() end)) local posx = 0 local posy = 1.1 local xd = place:findFirstChild(gui.Text) if xd ~= nil then place = xd local ok = place:GetChildren() if #ok >= 0 then local green = 0.4 local colormode = 0 for i=1, #ok do local button = Instance.new("TextButton",main) button.Size = UDim2.new(1,0,1,0) button.Position = UDim2.new(posx,0,posy,0) button.Text = ok[i].Name button.BackgroundColor3 = Color3.new(0.1,green,0.1) button.BackgroundTransparency = 1 button.TextTransparency = 1 coroutine.resume(coroutine.create(function() for o=1,0,-0.25 do wait() button.BackgroundTransparency = o button.TextTransparency = o end end)) button.MouseButton1Click:connect(function() go(button) createprops(place,main) end) button.MouseButton2Click:connect(function() ok[i]:remove() button:remove() end) posy = posy + 1.08 if posy >= 14 then posy = 1.08 posx = posx + 1.1 end if colormode == 0 then green = green + 0.1 if green > 0.96 then colormode = 1 end else green = green - 0.1 if green < 0.45 then colormode = 0 end end end end end end function back() coroutine.resume(coroutine.create(function() remove() end)) local posx = 0 local posy = 1.1 if place.Parent ~= nil then place = place.Parent local ok = place:GetChildren() if #ok >= 0 then local green = 0.4 local colormode = 0 for i=1, #ok do local button = Instance.new("TextButton",main) button.Size = UDim2.new(1,0,1,0) button.Position = UDim2.new(posx,0,posy,0) button.Text = ok[i].Name button.BackgroundColor3 = Color3.new(0.1,green,0.1) button.BackgroundTransparency = 1 button.TextTransparency = 1 coroutine.resume(coroutine.create(function() for o=1,0,-0.25 do wait() button.BackgroundTransparency = o button.TextTransparency = o end end)) button.MouseButton1Click:connect(function() go(button) createprops(place,main) end) button.MouseButton2Click:connect(function() ok[i]:remove() button:remove() end) posy = posy + 1.08 if posy >= 14 then posy = 1.08 posx = posx + 1.1 end if colormode == 0 then green = green + 0.1 if green > 0.96 then colormode = 1 end else green = green - 0.1 if green < 0.45 then colormode = 0 end end end end end end function home() coroutine.resume(coroutine.create(function() remove() end)) local posx = 0 local posy = 1.1 place = game local ok = place:GetChildren() local green = 0.4 local colormode = 0 for i=1, #ok do local button = Instance.new("TextButton",main) button.Size = UDim2.new(1,0,1,0) button.Position = UDim2.new(posx,0,posy,0) button.Text = ok[i].Name button.BackgroundColor3 = Color3.new(0.1,green,0.1) button.BackgroundTransparency = 1 button.TextTransparency = 1 coroutine.resume(coroutine.create(function() for o=1,0,-0.25 do wait() button.BackgroundTransparency = o button.TextTransparency = o end end)) button.MouseButton1Click:connect(function() go(button) createprops(place,main) end) button.MouseButton2Click:connect(function() ok[i]:remove() button:remove() end) posy = posy + 1.08 if posy >= 14 then posy = 1.08 posx = posx + 1.1 end if colormode == 0 then green = green + 0.1 if green > 0.99 then colormode = 1 end else green = green - 0.1 if green < 0.4 then colormode = 0 end end end end main.MouseButton1Down:connect(function() home() createprops(place,main) end) bac.MouseButton1Down:connect(function() back() createprops(place,main) end) end gui(me) me.Changed:connect(function(prop) if prop == "Character" then if autospawn == "True" then gui(me) end end end)
-- utility functions for lists stored in Lua tables local function lmap(t, f) local res = {}; for i,v in ipairs(t) do res[i] = f(v); end return res; end local function lcopy(t) local t2 = {} for k,v in pairs(t) do t2[k] = v end return t2 end local function lappend(t1, t2) local res = lcopy(t1) for i,v in ipairs(t2) do table.insert(res, v) end return res end local function lreverse(t) for i=1, math.floor(#t / 2) do t[i], t[#t - i + 1] = t[#t - i + 1], t[i] end return t end -- Constructive Solid Geometry (CSG) is a modeling technique that uses Boolean -- operations like union and intersection to combine 3D solids. self.library -- implements CSG operations on meshes elegantly and concisely using BSP trees, -- and is meant to serve as an easily understandable implementation of the -- algorithm. All edge cases involving overlapping coplanar polygons in both -- solids are correctly handled. -- -- Example usage: -- -- local cube = CSG.cube() -- local sphere = CSG.sphere({ radius: 1.3 }) -- local polygons = cube.subtract(sphere).toPolygons() -- -- -- ## Implementation Details -- -- All CSG operations are implemented in terms of two functions, `clipTo()` and -- `invert()`, which remove parts of a BSP tree inside another BSP tree and swap -- solid and empty space, respectively. To find the union of `a` and `b`, we -- want to remove everything in `a` inside `b` and everything in `b` inside `a`, -- then combine polygons from `a` and `b` into one solid: -- -- a:clipTo(b) -- b:clipTo(a) -- a:build(b:allPolygons()) -- -- The only tricky part is handling overlapping coplanar polygons in both trees. -- The code above keeps both copies, but we need to keep them in one tree and -- remove them in the other tree. To remove them from `b` we can clip the -- inverse of `b` against `a`. The code for union now looks like self. -- -- a:clipTo(b) -- b:clipTo(a) -- b:invert() -- b:clipTo(a) -- b:invert() -- a:build(b:allPolygons()) -- -- Subtraction and intersection naturally follow from set operations. If -- union is `A | B`, subtraction is `A - B = ~(~A | B)` and intersection is -- `A & B = ~(~A | ~B)` where `~` is the complement operator. -- -- ## License -- -- Copyright (c) 2011 Evan Wallace (http:--madebyevan.com/), under the MIT license. local m = {} m.__index = m m.__add = function (lhs, rhs) return lhs:union(rhs) end m.__sub = function (lhs, rhs) return lhs:subtract(rhs) end m.__mul = function (lhs, rhs) return lhs:intersect(rhs) end local CSG = {} -- Holds a binary space partition tree representing a 3D solid. Two solids can -- be combined using the `union()`, `subtract()`, and `intersect()` methods. function m.new() local self = setmetatable({}, m) self.polygons = {} return self end -- Construct a CSG solid from a list of `CSG.Polygon` instances. function m.fromPolygons(polygons) local self = m.new() self.polygons = polygons return self end function m:clone() local other = m.new() other.polygons = lmap(self.polygons, function(p) return p:clone() end) return other end function m:transform(m) local x,y,z local transformed = {} for i, polygon in ipairs(self.polygons) do for j, v in ipairs(polygon.vertices) do if not transformed[v] then v.pos.x, v.pos.y, v.pos.z = m:mul(v.pos.x, v.pos.y, v.pos.z) v.normal.x, v.normal.y, v.normal.z = m:mul(v.normal.x, v.normal.y, v.normal.z) transformed[v] = true end end end return self end function m:debugDraw() lovr.graphics.setShader() for i, polygon in ipairs(self.polygons) do for j, v in ipairs(polygon.vertices) do local lx = v.pos.x * 1.05 + (j-1) * 0.05 local ly = v.pos.y * 1.05 + (i / #self.polygons) * 0.5 local lz = v.pos.z lovr.graphics.setColor(1,1,1,0.02) lovr.graphics.line(v.pos.x, v.pos.y, v.pos.z, lx, ly, lz) lovr.graphics.setColor(1,1,1) lovr.graphics.print(string.format('%d %d', i, j), lx, ly, lz, 0.05) lovr.graphics.print(string.format('%1.1f %1.1f %1.1f', v.pos.x, v.pos.y, v.pos.z), lx, ly - 0.03, lz, 0.02) end end end function m:toPolygons() return self.polygons end function m.fromMesh(mesh, shared) local self = m.new() local vs = {} local indices = mesh:getVertexMap() for vi = 1, mesh:getVertexCount() do local v = {mesh:getVertex(vi)} table.insert(vs, m.Vertex.new(vec3(unpack(v)), vec3(select(4, unpack(v))))) end for i = 1, #indices - 2, 3 do local triangle = { vs[indices[i + 0]], vs[indices[i + 1]], vs[indices[i + 2]], } table.insert(self.polygons, m.Polygon.new(triangle, shared)) end return self end function m:toMesh() local vertices = {} local indices = {} for i,p in ipairs(self.polygons) do for j=3,#p.vertices do local v = p.vertices[1] table.insert(vertices, {v.pos.x, v.pos.y, v.pos.z, v.normal.x, v.normal.y, v.normal.z}) local v = p.vertices[j-1] table.insert(vertices, {v.pos.x, v.pos.y, v.pos.z, v.normal.x, v.normal.y, v.normal.z}) local v = p.vertices[j] table.insert(vertices, {v.pos.x, v.pos.y, v.pos.z, v.normal.x, v.normal.y, v.normal.z}) table.insert(indices, #indices + 1) table.insert(indices, #indices + 1) table.insert(indices, #indices + 1) end end local mesh = lovr.graphics.newMesh(vertices, 'triangles', 'dynamic', true) mesh:setVertexMap(indices) return mesh end -- Return a CSG solid representing space in either self.solid or in the -- solid `csg`. Neither self.solid nor the solid `csg` are modified. -- -- A.union(B) -- -- +-------+ +-------+ -- | | | | -- | A | | | -- | +--+----+ = | +----+ -- +----+--+ | +----+ | -- | B | | | -- | | | | -- +-------+ +-------+ -- function m:union(csg) local a = m.Node.new(self:clone().polygons) local b = m.Node.new(csg:clone().polygons) a:clipTo(b) b:clipTo(a) b:invert() b:clipTo(a) b:invert() a:build(b:allPolygons()) return m.fromPolygons(a:allPolygons()) end -- Return a CSG solid representing space in self.solid but not in the -- solid `csg`. Neither self.solid nor the solid `csg` are modified. -- -- A.subtract(B) -- -- +-------+ +-------+ -- | | | | -- | A | | | -- | +--+----+ = | +--+ -- +----+--+ | +----+ -- | B | -- | | -- +-------+ -- function m:subtract(csg) local a = m.Node.new(self:clone().polygons) local b = m.Node.new(csg:clone().polygons) a:invert() a:clipTo(b) b:clipTo(a) b:invert() b:clipTo(a) b:invert() a:build(b:allPolygons()) a:invert() return m.fromPolygons(a:allPolygons()) end -- Return a CSG solid representing space both self.solid and in the -- solid `csg`. Neither self.solid nor the solid `csg` are modified. -- -- A.intersect(B) -- -- +-------+ -- | | -- | A | -- | +--+----+ = +--+ -- +----+--+ | +--+ -- | B | -- | | -- +-------+ -- function m:intersect(csg) local a = m.Node.new(self:clone().polygons) local b = m.Node.new(csg:clone().polygons) if (not a.plane) or (not b.plane) then print('a', serpent.block(self.polygons)) print('b', serpent.block(csg.polygons)) --return csg end a:invert() b:clipTo(a) b:invert() a:clipTo(b) b:clipTo(a) a:build(b:allPolygons()) a:invert() return m.fromPolygons(a:allPolygons()) end -- Return a CSG solid with solid and empty space switched. self.solid is -- not modified. function m:inverse() local csg = self:clone() lmap(csg.polygons, function(p) p:flip() end) return csg end -- # class Vertex -- Represents a vertex of a polygon. Use your own vertex class instead of this -- one to provide additional features like texture coordinates and vertex -- colors. Custom vertex classes need to provide a `pos` property and `clone()`, -- `flip()`, and `interpolate()` methods that behave analogous to the ones -- defined by `CSG.Vertex`. self.class provides `normal` so convenience -- functions like `CSG.sphere()` can return a smooth vertex normal, but `normal` -- is not used anywhere else. m.Vertex = {} m.Vertex.__index = m.Vertex function m.Vertex.new(pos, normal) local self = setmetatable({}, m.Vertex) self.pos = lovr.math.newVec3(pos) self.normal = lovr.math.newVec3(normal) return self end function m.Vertex:clone() return m.Vertex.new(self.pos, self.normal) end -- Invert all orientation-specific data (e.g. vertex normal). Called when the -- orientation of a polygon is flipped. function m.Vertex:flip() self.normal:mul(-1) end -- Create a vertex between self.vertex and `other` by linearly -- interpolating all properties using a parameter of `t`. Subclasses should -- override self.to interpolate additional properties. function m.Vertex:interpolate(other, t) return m.Vertex.new( vec3(self.pos):lerp(other.pos, t), vec3(self.normal):lerp(other.normal, t) ) end -- # class Plane -- Represents a plane in 3D space. m.Plane = { EPSILON = 1e-5, -- tolerance used by `splitPolygon()` to decide if a point is on the plane } m.Plane.__index = m.Plane function m.Plane.new(normal, w) local self = setmetatable({}, m.Plane) self.normal = lovr.math.newVec3(normal) self.w = w return self end function m.Plane.fromPoints(a, b, c) local n = vec3(b):sub(a):cross(vec3(c):sub(a)):normalize() return m.Plane.new(n, n:dot(a)) end function m.Plane:clone() return m.Plane.new(self.normal, self.w) end function m.Plane:flip() self.normal:mul(-1) self.w = -self.w end -- Split `polygon` by self.plane if needed, then put the polygon or polygon -- fragments in the appropriate lists. Coplanar polygons go into either -- `coplanarFront` or `coplanarBack` depending on their orientation with -- respect to self.plane. Polygons in front or in back of self.plane go into -- either `front` or `back`. function m.Plane:splitPolygon(polygon, coplanarFront, coplanarBack, front, back) local COPLANAR = 0 local FRONT = 1 local BACK = 2 local SPANNING = 3 -- Classify each point as well as the entire polygon into one of the above -- four classes. local polygonType = 0 local types = {} for i, v in ipairs(polygon.vertices) do local t = self.normal:dot(v.pos) - self.w local ptype = COPLANAR if (t < -m.Plane.EPSILON) then ptype = BACK elseif (t > m.Plane.EPSILON) then ptype = FRONT end if (ptype ~= 0) then polygonType = bit.bor(polygonType, ptype) end table.insert(types, ptype) end -- Put the polygon in the correct list, splitting it when necessary. if(polygonType == COPLANAR) then if self.normal:dot(polygon.plane.normal) > 0 then table.insert(coplanarFront, polygon) else table.insert(coplanarBack, polygon) end elseif(polygonType == FRONT) then table.insert(front, polygon) elseif(polygonType == BACK) then table.insert(back, polygon) elseif(polygonType == SPANNING) then local f = {} local b = {} for i, vi in ipairs(polygon.vertices) do local j = 1 + (i % #polygon.vertices) local ti = types[i] local tj = types[j] local vj = polygon.vertices[j] if (ti ~= BACK) then table.insert(f, vi) end if (ti ~= FRONT) then if (ti ~= BACK) then table.insert(b, vi:clone()) else table.insert(b, vi) end end if (bit.bor(ti, tj) == SPANNING) then local t = (self.w - self.normal:dot(vi.pos)) / self.normal:dot(vec3(vj.pos):sub(vi.pos)) local v = vi:interpolate(vj, t) table.insert(f, v) table.insert(b, v:clone()) end end if (#f >= 3) then table.insert(front, m.Polygon.new(f, polygon.shared)) end if (#b >= 3) then table.insert(back, m.Polygon.new(b, polygon.shared)) end end lovr.math.drain() end -- # class Polygon -- Represents a convex polygon. The vertices used to initialize a polygon must -- be coplanar and form a convex loop. They do not have to be `CSG.Vertex` -- instances but they must behave similarly (duck typing can be used for -- customization). -- -- Each convex polygon has a `shared` property, which is shared between all -- polygons that are clones of each other or were split from the same polygon. -- self.can be used to define per-polygon properties (such as surface color). m.Polygon = {} m.Polygon.__index = m.Polygon function m.Polygon.new(vertices, shared) local self = setmetatable({}, m.Polygon) self.vertices = vertices self.shared = shared self.plane = m.Plane.fromPoints(vertices[1].pos, vertices[2].pos, vertices[3].pos) return self end function m.Polygon:clone() local vertices = lmap(self.vertices, function(v) return v:clone() end) return m.Polygon.new(vertices, self.shared) end function m.Polygon:flip() lmap(lreverse(self.vertices), function(v) v:flip() end) self.plane:flip() end --/ class Node -------------------------------------------------------------------------- -- Holds a node in a BSP tree. A BSP tree is built from a collection of polygons -- by picking a polygon to split along. That polygon (and all other coplanar -- polygons) are added directly to that node and the other polygons are added to -- the front and/or back subtrees. This is not a leafy BSP tree since there is -- no distinction between internal and leaf nodes. m.Node = {} m.Node.__index = m.Node function m.Node.new(polygons) local self = setmetatable({}, m.Node) self.plane = nil self.front = nil self.back = nil self.polygons = {} if (polygons) then self:build(polygons) end return self end function m.Node:clone() local other = m.Node.new() other.plane = self.plane and self.plane:clone() other.front = self.front and self.front:clone() other.back = self.back and self.back:clone() other.polygons = lmap(self.polygons, function(p) return p:clone() end) return other end -- Convert solid space to empty space and empty space to solid space. function m.Node:invert() for i, p in ipairs(self.polygons) do p:flip() end self.plane:flip() if (self.front) then self.front:invert() end if (self.back) then self.back:invert() end local temp = self.front self.front = self.back self.back = temp end -- Recursively remove all polygons in `polygons` that are inside self.BSP -- tree. function m.Node:clipPolygons(polygons) if (not self.plane) then return lcopy(polygons) end local front = {} local back = {} for i, p in ipairs(polygons) do self.plane:splitPolygon(p, front, back, front, back) end if (self.front) then front = self.front:clipPolygons(front) end if (self.back) then back = self.back:clipPolygons(back) else back = {} end return lappend(front, back) end -- Remove all polygons in self.BSP tree that are inside the other BSP tree -- `bsp`. function m.Node:clipTo(bsp) self.polygons = bsp:clipPolygons(self.polygons) if (self.front) then self.front:clipTo(bsp) end if (self.back) then self.back:clipTo(bsp) end end -- Return a list of all polygons in self.BSP tree. function m.Node:allPolygons() local polygons = lcopy(self.polygons) if (self.front) then polygons = lappend(polygons, self.front:allPolygons()) end if (self.back) then polygons = lappend(polygons, self.back:allPolygons()) end return polygons end -- Build a BSP tree out of `polygons`. When called on an existing tree, the -- polygons are filtered down to the bottom of the tree and become new -- nodes there. Each set of polygons is partitioned using the first polygon -- (no heuristic is used to pick a good split). function m.Node:build(polygons, depth) depth = depth or 1 if (#polygons == 0) then return end if (not self.plane) then self.plane = polygons[1].plane:clone() end local front = {} local back = {} for i, p in ipairs(polygons) do self.plane:splitPolygon(p, self.polygons, self.polygons, front, back) end if depth > 8000 then return end -- stack overflow protection if (#front > 0) then if (not self.front) then self.front = m.Node.new() end self.front:build(front, depth + 1) end if (#back > 0) then if (not self.back) then self.back = m.Node.new() end self.back:build(back, depth + 1) end end return m
---------------------------------------------------------------------- -- 实现一个计算器,但计算的结合性是有问题的。因为它使用了下面的语法规则: -- -- additive -> multiplicative | multiplicative + additive -- multiplicative -> primary | primary * multiplicative -- -- 递归项在右边,会自然的对应右结合。我们真正需要的是左结合。 ---------------------------------------------------------------------- require "framework.init" local SimpleLexer = require "SimpleLexer" local ASTNode = require "ASTNode" local ast_node_type_const = require "ASTNodeType" local LEFT_RECURSIVE = false ------------------------ -- 打印输出AST的树状结构 -- @param node -- @param indent 缩进字符,由tab组成,每一级多一个tab ------------------------ local function dumpAST( node, indent) print(indent , ast_node_type_const[node:getType()].type , node:getText()) for i,child in ipairs(node:getChildren()) do dumpAST(child, indent.."\t") end end ------------------------------ --一个简单的AST节点的实现。 -- 属性包括:类型、文本值、父节点、子节点。 ------------------------------ local SimpleASTNode = class("SimpleASTNode",ASTNode) function SimpleASTNode:ctor(nodeType,text) self.parent = nil --父节点 self.children = {} --子节点列表 self.nodeType = nodeType --节点类型 self.text = text --文本值 end --父节点 function SimpleASTNode:getParent() return self.parent end --子节点 function SimpleASTNode:getChildren() return self.children end --AST类型 function SimpleASTNode:getType() return self.nodeType end --文本值 function SimpleASTNode:getText() return self.text end --添加子节点 function SimpleASTNode:addChild(child) child.parent = self --设置子节点父节点为当前节点 table.insert(self.children, child) --将子节点加入当前节点的子节点列表 end local SimpleCalculator = class("SimpleCalculator") function SimpleCalculator:ctor() end ------------------------ -- 执行脚本,并打印输出AST和求值过程。 -- @param script ------------------------- function SimpleCalculator:evaluate( script) local ok,err = pcall(function () local tree = self:parse(script) dumpAST(tree, "") self:evaluateASTNode(tree, ""); end) if not ok then print(err) end end ------------------------ -- 解析脚本,并返回根节点 -- @param code -- @return -- @throws Exception ------------------------- function SimpleCalculator:parse( code) local lexer = SimpleLexer.new() local tokens = lexer:tokenize(code) local rootNode = self:prog(tokens) return rootNode end ------------------------ -- 对某个AST节点求值,并打印求值过程。 -- @param node -- @param indent 打印输出时的缩进量,用tab控制 -- @return ------------------------- function SimpleCalculator:evaluateASTNode( node, indent) local result = 0 print(indent , "Calculating: " , ast_node_type_const[node:getType()].type) local switch = { [ASTNodeType.Programm]= function() for i,child in ipairs(node:getChildren()) do result = self:evaluateASTNode(child, indent .. "\t") end end, [ASTNodeType.Additive]= function() local children = node:getChildren() local child1 = children[1] local value1 = self:evaluateASTNode(child1, indent .. "\t") local child2 = children[2] local value2 = self:evaluateASTNode(child2, indent .. "\t") if node:getText() == "+" then result = value1 + value2 else result = value1 - value2 end end, [ASTNodeType.Multiplicative]= function() local children = node:getChildren() local child1 = children[1] local value1 = self:evaluateASTNode(child1, indent .. "\t") local child2 = children[2] local value2 = self:evaluateASTNode(child2, indent .. "\t") if node:getText() == "*" then result = value1 * value2 else result = value1 / value2 end end, [ASTNodeType.IntLiteral]= function() result = tonumber(node:getText()) end, } local func = switch[node:getType()] if func then func() end print(indent , "Result: " ,result) return result end ------------------------ -- 语法解析:根节点 -- @return -- @throws Exception ------------------------- function SimpleCalculator:prog( tokens) local node = SimpleASTNode.new(ASTNodeType.Programm, "Calculator") local child = self:additive(tokens) if child then node:addChild(child) end return node end ----------------------- --整型变量声明语句,如: --int a; --int b = 2*3; -- --@return --@throws Exception ----------------------- function SimpleCalculator:intDeclare(tokens) local node = nil local token = tokens:peek() --预读 --匹配Int if token and token:getType() == TOKEN_TYPE.Int then token = tokens:read() --消耗int token = tokens:peek() --预读 if token and token:getType() == TOKEN_TYPE.Identifier then token = tokens:read() --消耗标识符 --创建当前节点,并把变量名记到AST节点的文本值中,这里新建一个变量子节点也是可以的 node = SimpleASTNode.new(ASTNodeType.IntDeclaration,token:getText()) token = tokens:peek()--预读 --匹配 = if token and token:getType() == TOKEN_TYPE.Assignment then token = tokens:read() --消耗掉等号 -- =号忽略 不建立ASTNode local child = self:additive(tokens) --匹配一个表达式 if child then node:addChild(child) else error("invalide variable initialization, expecting an expression") end end else error("variable name expected") end if node then token = tokens:peek() if token and token:getType() == TOKEN_TYPE.SemiColon then tokens:read() else error("invalid statement, expecting semicolon") end end end return node end ----------------------- -- 语法解析:加法表达式 -- @return -- @throws Exception ----------------------- function SimpleCalculator:additive(tokens) if LEFT_RECURSIVE then return self:additive_left_recursive(tokens) else return self:additive_right_recursive(tokens) end end function SimpleCalculator:additive_right_recursive(tokens) local child1 = self:multiplicative(tokens) local node = child1 local token = tokens:peek() if child1 and token then if token:getType() == TOKEN_TYPE.Plus or token:getType() == TOKEN_TYPE.Minus then token = tokens:read() local child2 = self:additive(tokens) if child2 then node = SimpleASTNode.new(ASTNodeType.Additive, token:getText()) node:addChild(child1) node:addChild(child2) else error("invalid additive expression, expecting the right part.") end end end return node end function SimpleCalculator:additive_left_recursive(tokens) local child1 = self:multiplicative(tokens) local node = child1 if child1 then while true do local token = tokens:peek() if token and (token:getType() == TOKEN_TYPE.Plus or token:getType() == TOKEN_TYPE.Minus) then token = tokens:read() local child2 = self:multiplicative(tokens) if child2 then node = SimpleASTNode.new(ASTNodeType.Additive, token:getText()) node:addChild(child1) node:addChild(child2) child1 = node else error("invalid additive expression, expecting the right part.") end else break end end end return node end ----------------------- -- 语法解析:乘法表达式 -- @return -- @throws Exception ----------------------- function SimpleCalculator:multiplicative(tokens) if LEFT_RECURSIVE then return self:multiplicative_left_recursive(tokens) else return self:multiplicative_right_recursive(tokens) end end function SimpleCalculator:multiplicative_right_recursive(tokens) local child1 = self:primary(tokens) local node = child1 local token = tokens:peek() if child1 and token then if token:getType() == TOKEN_TYPE.Star or token:getType() == TOKEN_TYPE.Slash then token = tokens:read() local child2 = self:multiplicative(tokens) if child2 then node = SimpleASTNode.new(ASTNodeType.Multiplicative, token:getText()) node:addChild(child1) node:addChild(child2) else error("invalid multiplicative expression, expecting the right part.") end end end return node end function SimpleCalculator:multiplicative_left_recursive(tokens) local child1 = self:primary(tokens) local node = child1 if child1 then while true do local token = tokens:peek() if token and ( token:getType() == TOKEN_TYPE.Star or token:getType() == TOKEN_TYPE.Slash ) then token = tokens:read() local child2 = self:primary(tokens) if child2 then node = SimpleASTNode.new(ASTNodeType.Multiplicative, token:getText()) node:addChild(child1) node:addChild(child2) child1 = node else error("invalid multiplicative expression, expecting the right part.") end else break end end end return node end ----------------------- --语法解析:基础表达式 --@return --@throws Exception ----------------------- function SimpleCalculator:primary(tokens) local node = nil local token = tokens:peek() if token then if (token:getType() == TOKEN_TYPE.IntLiteral) then token = tokens:read() node = SimpleASTNode.new(ASTNodeType.IntLiteral, token:getText()) elseif (token:getType() == TOKEN_TYPE.Identifier) then token = tokens:read() node = SimpleASTNode.new(ASTNodeType.Identifier, token:getText()) elseif (token:getType() == TOKEN_TYPE.LeftParen) then tokens:read() node = self:additive(tokens) if node then token = tokens:peek() if (token and token:getType() == TOKEN_TYPE.RightParen) then tokens:read() else error("expecting right parenthesis") end else error("expecting an additive expression inside parenthesis") end end end return node --这个方法也做了AST的简化,就是不用构造一个primary节点,直接返回子节点。因为它只有一个子节点。 end local function main() local calculator = SimpleCalculator.new() print("左递归 LEFT_RECURSIVE:" , LEFT_RECURSIVE) --测试变量声明语句的解析 local script = "int a = b+3;" print("解析变量声明语句: " , script) local lexer = SimpleLexer.new() local tokens = lexer:tokenize(script) local ok,err = pcall(function () local node = calculator:intDeclare(tokens) dumpAST(node,"") end) if not ok then print(err) end --测试表达式 script = "2+3*5"; print("计算: " , script , ",看上去一切正常。") calculator:evaluate(script) --测试语法错误 script = "2+"; print("\n: " ,script , ",应该有语法错误。") calculator:evaluate(script) script = "2+3+4"; print("\n计算: " , script , ",结合性出现错误。") calculator:evaluate(script) LEFT_RECURSIVE=true print("左递归 LEFT_RECURSIVE:" , LEFT_RECURSIVE) script = "2+3+4+5"; print("\n计算: " , script , ",结合性没问题。") calculator:evaluate(script) end main() return SimpleCalculator
local skynet = require "skynet" local M = {} local runconf = require(skynet.getenv("runconfig")) local pinchidaoconf = runconf.pinchidaogame local MAX_GLOBAL_COUNT = #pinchidaoconf.global local function fetch_global(id) local index = id % MAX_GLOBAL_COUNT + 1 return pinchidaoconf.global[index] end local function call(cmd, id, ...) local global = fetch_global(id) return skynet.call(global, "lua", cmd, id, ...) end function M.create(id) return call("pinchidao.create", id) end function M.enter(id, uid, data) return call("pinchidao.enter", id, uid, data) end function M.leave(id, uid) return call("pinchidao.leave", id, uid) end function M.get_forward(id) return fetch_global(id) end return M
-- Copyright (c) 2020 IceQ1337 (https://github.com/IceQ1337) local _, AutoAdventure = ... local dump = DevTools_Dump -- UI Globals local MissionFrame = {} local MissionTab = {} local MissionPage = {} -- Adventure/Garrison Globals local GarrisonType = Enum.GarrisonType.Type_9_0 local GarrisonFollowerType = Enum.GarrisonFollowerType.FollowerType_9_0 -- To-Do: Save C_Garrison functions in local functions -- Event Frame & Setup ----------------------------------------------------- local EventFrame = CreateFrame("Frame") EventFrame:SetScript("OnEvent", function(self, event, ...) local arg1, arg2, arg3, arg4, arg5 = ... if event == "ADDON_LOADED" then if arg1 == "AutoAdventure" then --print("[Auto Adventure] ADDON_LOADED") elseif arg1 == "Blizzard_GarrisonUI" then MissionFrame = CovenantMissionFrame MissionTab = CovenantMissionFrame.MissionTab MissionPage = CovenantMissionFrame.MissionTab.MissionPage MissionFrame:HookScript("OnShow", MissionFrameOpen) EventFrame:UnregisterEvent("ADDON_LOADED") elseif arg1 == "GARRISON_MISSION_STARTED" then AutoAdventure:initializeMissions() -- We could also just close the MissionFrame because we recalculate when it gets opened again end end end) function MissionFrameOpen(self) MissionPage:HookScript("OnShow", MissionPageOpen) AutoAdventure:initializeMissions() end function MissionPageOpen(self) -- To-Do: Add (but hide) a button to insert result if exists end function AutoAdventure:registerEvents() EventFrame:RegisterEvent("ADDON_LOADED"); EventFrame:RegisterEvent("GARRISON_MISSION_STARTED"); end function AutoAdventure:setup() AutoAdventure:registerEvents() end AutoAdventure:setup() -- Main Logic ----------------------------------------------------- function AutoAdventure:initializeMissions() local hasAdventures = C_Garrison.HasAdventures() if hasAdventures then local Followers = C_Garrison.GetFollowers(GarrisonFollowerType) -- https://wow.gamepedia.com/API_C_Garrison.GetFollowers local AutoTroops = C_Garrison.GetAutoTroops(GarrisonFollowerType) -- https://wow.gamepedia.com/API_C_Garrison.GetAutoTroops local AvailableFollowers = Followers local MissionList = MissionTab.MissionList local Missions = MissionList.combinedMissions local AvailableMissions = {} if Missions then local MissionCount = #Missions for missionIndex, missionData in ipairs(Missions) do if missionData.followers and #missionData.followers > 0 then for missionFollowerIndex, missionFollowerData in ipairs(missionData.followers) do for followerIndex, followerData in ipairs(Followers) do local FollowerAutoCombatStatsInfo = C_Garrison.GetFollowerAutoCombatStats(followerData.followerID) -- Followers on active missions or with low health are considered "not available" if followerData.followerID == missionFollowerData or FollowerAutoCombatStatsInfo.currentHealth < 100 then table.remove(AvailableFollowers, followerIndex) end end end end if missionData.followerTypeID == GarrisonFollowerType and not missionData.inProgress and not missionData.completed and missionData.canStart then table.insert(AvailableMissions, missionData) end end AutoAdventure:calculateMissions(AvailableFollowers, AvailableMissions, AutoTroops) end end end function AutoAdventure:calculateMissions(AvailableFollowers, AvailableMissions, AutoTroops) if AvailableFollowers and #AvailableFollowers > 0 then print(string.format("Available Followers: %s", tostring(#AvailableFollowers))) local CalculatedMissions = {} for missionIndex, missionData in ipairs(AvailableMissions) do --print(string.format("Calculating Mission: %s", tostring(missionData.missionID))) local missionDeploymentInfo = C_Garrison.GetMissionDeploymentInfo(missionData.missionID) local enemyEncounterInfo = missionDeploymentInfo.enemies -- https://wow.gamepedia.com/Struct_GarrisonEnemyEncounterInfo -- To-Do: Implement a decent auto battle logic with AvailableFollowers and AutoTroops based on raw values (no spells) -- Get simple board overview local EnemyBoard = {} local MaxBoardIndex = 0 for enemyEncounterIndex, enemyEncounter in ipairs(enemyEncounterInfo) do if enemyEncounter.boardIndex > MaxBoardIndex then MaxBoardIndex = enemyEncounter.boardIndex end table.insert(EnemyBoard, { boardIndex = enemyEncounter.boardIndex, health = enemyEncounter.health, attack = enemyEncounter.attack, spellInfo = enemyEncounter.autoCombatSpells -- To-Do: Use this instead of raw values }) --print(string.format("Index: %s - Name: %s", tostring(enemyEncounter.boardIndex), tostring(enemyEncounter.name))) end -- Enemy Board Index is always 5 to 12 ( 8 enemies ) -- Position/Index seems to not be always the same depending on how many enemies there are in total -- https://wow.gamepedia.com/Struct_FollowerAutoCombatStatsInfo -- https://wow.gamepedia.com/Struct_AutoCombatSpellInfo local BoardStrategy = {} -- To-Do: Save boardIndex & followerID here for i = 1, 5 do -- We have 5 spots available on the board -- Follower Loop -- Evaluate followers first, because we could have an option to always use only one follower or force a win with all we got -- If we evaluate raw values, just get the followers ( 1 or all ) in there for followerIndex, followerData in ipairs(AvailableFollowers) do local FollowerAutoCombatStatsInfo = C_Garrison.GetFollowerAutoCombatStats(followerData.followerID) end -- Troop Loop -- If we evaluate raw values, just use the troop with highest health/attack ratio in every spot for autoTroopIndex, autoTroopData in ipairs(AutoTroops) do local FollowerAutoCombatStatsInfo = autoTroopData.autoCombatStats end end -- At this point, we should have calculated the best board based on raw values -- To-Do: Show the button to insert results end else print("No Follower Available!") end end
--HELP: \b6Usage: \b16reset \n -- \b6Description: \b7Resets the gpu translate stack and palette, useful when programs that use \b16cam() \b7or custom palettes crash local pal = { {24, 24, 24}, {29, 43, 82}, {126, 37, 83}, {0, 134, 81}, {171, 81, 54}, {86, 86, 86}, {157, 157, 157}, {255, 0, 76}, {255, 163, 0}, {255, 240, 35}, {0, 231, 85}, {41, 173, 255}, {130, 118, 156}, {255, 119, 169}, {254, 204, 169}, {236, 236, 236} } while gpu.pop() do end gpu.blitPalette(pal) gpu.clip()
require('aerial').setup({ filter_kind = { yaml = false, }, })
-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild -- -- This file is compatible with Lua 5.3 local class = require("class") require("kaitaistruct") BitsSeqEndianCombo = class.class(KaitaiStruct) function BitsSeqEndianCombo:_init(io, parent, root) KaitaiStruct._init(self, io) self._parent = parent self._root = root or self self:_read() end function BitsSeqEndianCombo:_read() self.be1 = self._io:read_bits_int_be(6) self.be2 = self._io:read_bits_int_be(10) self.le3 = self._io:read_bits_int_le(8) self.be4 = self._io:read_bits_int_be(8) self.le5 = self._io:read_bits_int_le(5) self.le6 = self._io:read_bits_int_le(6) self.le7 = self._io:read_bits_int_le(5) self.be8 = self._io:read_bits_int_be(1) end
return { KickQueue = { Path = "/kick/queue", Method = "GET" }, KickRemove = { Path = "/kick/remove", Method = "DELETE" }, KickAdd = { Path = "/kick/add", Method = "POST" }, BanlistGetUserInfo = { Path = "/banlist/getuserinfo", Method = "GET" }, BanlistAdd = { Path = "/banlist/add", Method = "POST" }, BanlistRemove = { Path = "/banlist/remove", Method = "DELETE" }, GetUsersBannedData = { Path = "/banlist/getstatuslist", Method = "POST" } }
Scripts = Scripts or {} local Player = {} Player.__index = Player Scripts.Player = Player function Player:New() local self = {} self.shootTime = 0.0 return setmetatable(self, Player) end function Player:OnUpdate(entitySelf, timeDelta) -- Get entity components. local transform = ComponentSystem:LookupTransform(entitySelf) local collision = ComponentSystem:LookupCollision(entitySelf) local input = ComponentSystem:LookupInput(entitySelf) -- Update shoot time delay. self.shootTime = math.max(0.0, self.shootTime - timeDelta) -- Shoot projectiles. if InputSystem:IsKeyDown(Key["Space"]) then if self.shootTime == 0.0 then local mask = bit.bor(CollisionTypes.Enemy, CollisionTypes.Environment) Factory.CreateProjectile(transform:GetPosition(), Vec2(700.0, 0.0), 10, mask) self.shootTime = 0.25 end end -- Handle movement. local movement = Vec2(0.0, 0.0) if InputSystem:IsKeyDown(Key["D"]) then movement.x = movement.x + 1.0 end if InputSystem:IsKeyDown(Key["A"]) then movement.x = movement.x - 1.0 end if InputSystem:IsKeyDown(Key["W"]) then movement.y = movement.y + 1.0 end if InputSystem:IsKeyDown(Key["S"]) then movement.y = movement.y - 1.0 end -- Update player position. if not movement:Equals(Vec2(0.0, 0.0)) then -- Normalize movement vector. movement:Normalize() -- Calculate new position. local position = transform:GetPosition() position.x = position.x + movement.x * 400.0 * timeDelta position.y = position.y + movement.y * 400.0 * timeDelta -- Prevent from moving outside of the screen bounds. local boundingBox = collision:GetBoundingBox() position.x = math.max(0.0 - boundingBox.x, math.min(position.x, 1024.0 - boundingBox.z)) position.y = math.max(0.0 - boundingBox.y, math.min(position.y, 576.0 - boundingBox.w)) -- Set new position. transform:SetPosition(position) end end setmetatable(Player, { __call = Player.New })
object_mobile_dressed_forest_ardessa = object_mobile_shared_dressed_forest_ardessa:new { } ObjectTemplates:addTemplate(object_mobile_dressed_forest_ardessa, "object/mobile/dressed_forest_ardessa.iff")
-- this is the first program I have ever written in Lua! local filename = arg[1] -- left pad a (s)tring to (l)ength by (c)har local function lpad(s, l, c) return string.rep(c or ' ', l - #s) .. s end -- accepts an int code program and an input local function int_codes(instructions, input) local i = 1 while i < #instructions do local op_code = lpad(tostring(instructions[i]), 5, '0') -- are parameters in position or immediate mode? local c = op_code:sub(3, 3) == '0' local b = op_code:sub(2, 2) == '0' local a = op_code:sub(1, 1) == '0' -- parameters local x = nil local y = nil local z = instructions[i + 3] -- writing will always be positional if c and i + 1 <= #instructions then x = instructions[instructions[i + 1] + 1] else x = instructions[i + 1] end if b and i + 2 <= #instructions then y = instructions[instructions[i + 2] + 1] else y = instructions[i + 2] end -- addition if op_code:sub(5, 5) == '1' then instructions[z + 1] = x + y i = i + 4 end -- multiplication if op_code:sub(5, 5) == '2' then instructions[z + 1] = x * y i = i + 4 end -- input if op_code:sub(5, 5) == '3' then instructions[instructions[i + 1] + 1] = input i = i + 2 end -- output if op_code:sub(5, 5) == '4' then print('output: ' .. tostring(instructions[instructions[i + 1] + 1])) i = i + 2 end -- halt! if op_code:sub(4, 5) == '99' then return end -- jump-if-true if op_code:sub(5, 5) == '5' then if x ~= 0 then i = y + 1 else i = i + 3 end end -- jump-if-false if op_code:sub(5, 5) == '6' then if x == 0 then i = y + 1 else i = i + 3 end end -- less than if op_code:sub(5, 5) == '7' then if x < y then instructions[z + 1] = 1 else instructions[z + 1] = 0 end i = i + 4 end -- equals if op_code:sub(5, 5) == '8' then if x == y then instructions[z + 1] = 1 else instructions[z + 1] = 0 end i = i + 4 end end end -- get file as string local function read_file(path) local file = io.open(filename, 'rb') -- r read mode and b binary mode if not file then error('Couldn\'t read file!') end local content = file:read '*a' -- *a or *all reads the whole file file:close() return content end local program = {} for v in read_file(filename):gmatch('([^,]+)') do table.insert(program, tonumber(v)) end int_codes(program, 5)
function getInfo() return { onNoUnits = SUCCESS, -- instant success tooltip = "Gives move order to units", parameterDefs = { { name = "unitsGroup", variableType = "expression", componentType = "editBox", defaultValue = "", }, { name = "destination", variableType = "expression", componentType = "editBox", defaultValue = "", }, { name = "spread", variableType = "expression", componentType = "editBox", defaultValue = "128", }, { name = "moveViaAttack", variableType = "expression", componentType = "editBox", defaultValue = "true", }, { name = "destThreshold", variableType = "expression", componentType = "editBox", defaultValue = "false", }, } } end local SpringGiveOrderToUnit = Spring.GiveOrderToUnit local SpringGetUnitPosition = Spring.GetUnitPosition local SpringGetUnitHealth = Spring.GetUnitHealth function Run(self, units, parameter) local unitsGroup = parameter.unitsGroup local dest = parameter.destination local spread = parameter.spread local destThreshold = parameter.destThreshold or (spread * 3) local cmd = CMD.MOVE if parameter.moveViaAttack == true then cmd = CMD.FIGHT end if self.commandsIssued == nil then self.commandsIssued = {} end -- issue orders local issuedNewCommand = false for i = 1, #unitsGroup do local uid = unitsGroup[i] if self.commandsIssued[uid] ~= true then local pointX, pointY, pointZ = SpringGetUnitPosition(uid) local currUidLoc = Vec3(pointX, pointY, pointZ) if currUidLoc:Distance(dest) > destThreshold then local spreadX = math.random(spread) - spread / 2 local spreadZ = math.random(spread) - spread / 2 SpringGiveOrderToUnit(uid, cmd, (dest + Vec3(spreadX, 0, spreadZ)):AsSpringVector(), {}) issuedNewCommand = true end self.commandsIssued[uid] = true end end if issuedNewCommand then return RUNNING end -- if some unit not near (spreadwise) destination -> running for i=1, #unitsGroup do local uid = unitsGroup[i] local pointX, pointY, pointZ = SpringGetUnitPosition(uid) local currUidLoc = Vec3(pointX, pointY, pointZ) if currUidLoc:Distance(dest) > destThreshold then if SpringGetUnitHealth(uid) ~= nil then return RUNNING end end end -- else success return SUCCESS end function New() return {commandsIssued={}} end function Reset(self) self.commandsIssued = {} end
local logger = require("./dependencies/logger"); local package = require("./package"); local coro = require("coro-http"); logger:log(3,"Rbx.lua v"..package["version"]); coroutine.wrap(function() local response,body = coro.request("GET","https://raw.githubusercontent.com/iiToxicity/rbx.lua/main/package.lua"); if(response.code == 200) then local liveVersion = loadstring(body)()["version"]; if(liveVersion ~= package["version"]) then logger:log(2,string.format("Rbx.lua is outdated! Your version is %s and the live version is %s",package["version"],liveVersion)); end end end)(); return { client = require("./dependencies/client"); }
local F, C, L = unpack(select(2, ...)) C['general'] = { ['uiScale'] = 1, ['uiScaleAuto'] = true, ['autoDismount'] = true, ['enhancedMenu'] = true, ['mailButton'] = true, ['alreadyKnown'] = true, ['tradeTabs'] = true, ['marker'] = true, ['itemLevel'] = true, ['helmCloak'] = true, ['PVPSound'] = true, ['cameraZoomSpeed'] = 5, ['numberFormat'] = 1, -- 2 for Chinse number format (万/亿/兆) } C['appearance'] = { ['themes'] = true, ['backdropColour'] = {.03, .03, .03}, ['backdropAlpha'] = .7, ['buttonGradientColour'] = {.1, .1, .1, .5}, ['buttonSolidColour'] = {.05, .05, .05, .7}, ['gradient'] = true, ['shadow'] = true, ['flashCursor'] = true, ['vignette'] = true, ['vignetteAlpha'] = .8, ['fonts'] = true, ['BigWigs'] = true, ['WeakAuras'] = true, ['Skada'] = true, ['QuestLogEx'] = true, } C['actionbar'] = { ['enable'] = true, ['buttonSizeSmall'] = 24, ['buttonSizeNormal'] = 30, ['buttonSizeBig'] = 34, ['padding'] = 2, ['margin'] = 4, ['hotKey'] = true, ['macroName'] = true, ['count'] = true, ['classColor'] = false, ['layoutStyle'] = 1, ['bar3'] = true, ['bar3Mouseover'] = true, ['stanceBar'] = true, ['stanceBarMouseover'] = false, ['petBar'] = true, ['petBarMouseover'] = false, ['sideBar'] = true, ['sideBarMouseover'] = true, ['hoverBind'] = true, } C['map'] = { ['worldMapScale'] = .6, ['worldMapFader'] = true, ['worldMapCoords'] = true, ['worldMapReveal'] = true, ['miniMapScale'] = 1, ['miniMapPosition'] = {'BOTTOMRIGHT', UIParent, 'BOTTOMRIGHT', -50, 50}, ['miniMapSize'] = 240, ['whoPings'] = true, ['microMenu'] = true, ['expRepBar'] = true, } C['notification'] = { ['enableBanner'] = true, ['playSounds'] = true, ['animations'] = true, ['timeShown'] = 5, ['checkBagsFull'] = true, ['checkMail'] = true, ['autoRepair'] = true, ['autoSellJunk'] = true, ['questNotifier'] = true, ['questProgress'] = true, ['onlyCompleteRing'] = true, ['interrupt'] = true, ['interruptAnnounce'] = true, ['dispel'] = true, ['dispelAnnounce'] = true, ['rare'] = true, ['rareSound'] = true, ['vitalSpells'] = true, ['resurrect'] = true, ['sapped'] = true, ['buff'] = true, ['emergency'] = true, ['lowHealth'] = 0.5, ['lowMana'] = 0.3, } C['inventory'] = { ['enable'] = true, ['bagScale'] = 1, ['itemSlotSize'] = 36, ['bagColumns'] = 10, ['bankColumns'] = 10, ['reverseSort'] = true, ['itemLevel'] = false, ['newitemFlash'] = true, ['deleteButton'] = true, ['useCategory'] = true, ['gearSetFilter'] = false, ['tradeGoodsFilter'] = true, ['questItemFilter'] = true, ['mechagonItemFilter'] = true, } C['infobar'] = { ['enable'] = true, ['barHeight'] = 20, ['anchorTop'] = true, ['mouseover'] = true, ['stats'] = true, ['friends'] = true, ['gold'] = true, ['durability'] = true, ['talent'] = true, } C['tooltip'] = { ['enable'] = true, ['cursor'] = false, ['position'] = {'BOTTOMRIGHT', UIParent, 'BOTTOMRIGHT', -50, 300}, ['scale'] = 1, ['hideTitle'] = true, ['hideRealm'] = true, ['hideRank'] = true, ['hideJunkGuild'] = true, ['combatHide'] = false, ['extraInfo'] = true, ['extraInfoByShift'] = true, ['linkHover'] = true, ['borderColor'] = true, ['tipIcon'] = true, ['targetBy'] = true, } C['chat'] = { ['enable'] = true, ['lockPosition'] = true, ['fontOutline'] = false, ['tabs'] = true, ['abbreviate'] = true, ['fading'] = true, ['fadingVisible'] = 60, ['fadingDuration'] = 6, ['itemLinks'] = true, ['spamageMeter'] = true, ['copyButton'] = true, ['urlCopy'] = true, ['hideVoiceButtons'] = true, ['whisperSticky'] = true, ['whisperAlert'] = true, ['lastAlertTimer'] = 30, ['autoBubble'] = false, ['timeStamp'] = false, ['timeStampColor'] = {.5, .5, .5}, ['filters'] = true, ['keywordsList'] = '', ['blockAddonAlert'] = true, ['addonBlockList'] = { '任务进度提示', '%[接受任务%]', '%(任务完成%)', '<大脚', '【爱不易】', 'EUI[:_]', '打断:.+|Hspell', 'PS 死亡: .+>', '%*%*.+%*%*', '<iLvl>', ('%-'):rep(20), '<小队物品等级:.+>', '<LFG>', '进度:', '属性通报', 'wow.+兑换码', 'wow.+验证码', '=>', '【有爱插件】', ':.+>' }, } C['unitframe'] = { ['enable'] = true, ['transMode'] = true, ['colourSmooth'] = false, ['healer'] = false, ['portrait'] = true, ['dispellable'] = true, ['debuffbyPlayer'] = true, ['rangeCheck'] = true, ['clickCast'] = true, ['clickCastfilter'] = false, ['power_height'] = 3, ['altpower_height'] = 2, ['enableCastbar'] = true, ['castbar_separatePlayer'] = false, ['castbar_CastingColor'] = {110/255, 176/255, 216/255}, ['castbar_ChannelingColor'] = {92/255, 193/255, 216/255}, ['castbar_notInterruptibleColor'] = {190/255, 10/255, 18/255}, ['castbar_CompleteColor'] = {63/255, 161/255, 124/255}, ['castbar_FailColor'] = {187/255, 99/255, 110/255}, ['castbar_showSpellName'] = false, ['castbar_showSpellTimer'] = false, ['enableGroup'] = true, ['groupNames'] = false, ['groupColourSmooth'] = true, ['groupFilter'] = 8, ['player_pos'] = {'TOP', UIParent, 'CENTER', 0, -300}, ['player_pos_healer'] = {'RIGHT', UIParent, 'CENTER', -100, -200}, ['player_width'] = 200, ['player_width_healer'] = 200, ['player_height'] = 16, ['player_height_healer'] = 16, ['player_cb_width'] = 200, ['player_cb_width_healer'] = 200, ['player_cb_height'] = 16, ['player_cb_height_healer'] = 16, ['player_frameVisibility'] = '[combat][mod:shift][@target,exists][@vehicle,exists][overridebar][shapeshift][vehicleui][possessbar] show; hide', ['frameVisibility'] = false, ['pet_pos'] = {'RIGHT', 'oUF_Player', 'LEFT', -6, 0}, ['pet_pos_healer'] = {'TOPLEFT', 'oUF_Player', 'BOTTOMLEFT', 0, -6}, ['pet_width'] = 68, ['pet_width_healer'] = 68, ['pet_height'] = 16, ['pet_height_healer'] = 16, ['pet_frameVisibility'] = '[nocombat,nomod,@target,noexists][@pet,noexists] hide; show', ['target_pos'] = {'LEFT', 'oUF_Player', 'RIGHT', 80, 60}, ['target_pos_healer'] = {'LEFT', UIParent, 'CENTER', 100, -200}, ['target_width'] = 200, ['target_width_healer'] = 200, ['target_height'] = 16, ['target_height_healer'] = 16, ['target_cb_width'] = 200, ['target_cb_width_healer'] = 200, ['target_cb_height'] = 10, ['target_cb_height_healer'] = 10, ['targettarget_pos'] = {'LEFT', 'oUF_Target', 'RIGHT', 6, 0}, ['targettarget_pos_healer'] = {'CENTER', UIParent, 'CENTER', 0, -200}, ['targettarget_width'] = 80, ['targettarget_width_healer'] = 120, ['targettarget_height'] = 16, ['targettarget_height_healer'] = 16, ['party_pos'] = {'BOTTOMRIGHT', 'oUF_Player', 'TOPLEFT', -100, 60}, ['party_pos_healer'] = {'TOP', UIParent, 'CENTER', 0, -250}, ['party_width'] = 90, ['party_width_healer'] = 70, ['party_height'] = 38, ['party_height_healer'] = 34, ['party_gap'] = 6, ['raid_pos'] = {'RIGHT', Minimap, 'LEFT', -8, 0}, ['raid_pos_healer'] = {'TOP', UIParent, 'CENTER', 0, -250}, ['raid_width'] = 48, ['raid_width_healer'] = 48, ['raid_height'] = 32, ['raid_height_healer'] = 32, ['raid_gap'] = 5, } C['quest'] = { ['questTracker'] = true, ['quickQuest'] = false, ['notifier'] = true, ['progressNotify'] = false, ['completeRing'] = true, } C['cooldown'] = { ['cdEnhanced'] = true, ['cdFont'] = C.AssetsPath..'font\\supereffective.ttf', ['cdFontFlag'] = 'OUTLINEMONOCHROME', ['cdFontSize'] = 16, ['cdPulse'] = true, ['ignoredSpells'] = { --GetSpellInfo(6807), -- Maul --GetSpellInfo(35395), -- Crusader Strike }, } C['loot'] = { ['fasterLoot'] = false, ['autoGreed'] = false, ['autoGreedOnMaxLevel'] = false, } C['aura'] = { ['reminder'] = true, }
local item1, item2, item3 = 0, 0, 0 function init() connect(g_game, { onGameEnd = onGameEnd }) ProtocolGame.registerExtendedOpcode(111, function(protocol, opcode, buffer) showPortrais(buffer) closeChannel(buffer) end) deadWindow = g_ui.displayUI('memory') deadWindow:hide() end function terminate() disconnect(g_game, { onGameEnd = onGameEnd }) deadWindow:destroy() end function onGameEnd() if deadWindow:isVisible() then deadWindow:hide() end end function show() deadWindow:show() deadWindow:raise() deadWindow:focus() end function showPortrais(strings) deadWindow:show() deadWindow:raise() deadWindow:focus() local args = string.explode(strings, '-') if args[1] == "?" then deadWindow:getChildById("dittoImgForm1"):setImageSource('/images/game/battle/dittoFormOff') item1 = 3283 else deadWindow:getChildById("dittoImgForm1"):setImageSource('/images/game/battle/dittoForm') item1 = tonumber(args[1]) end if args[2] == "?" then deadWindow:getChildById("dittoImgForm2"):setImageSource('/images/game/battle/dittoFormOff') item2 = 3283 else deadWindow:getChildById("dittoImgForm2"):setImageSource('/images/game/battle/dittoForm') item2 = tonumber(args[2]) end if args[3] == "?" then deadWindow:getChildById("dittoImgForm3"):setImageSource('/images/game/battle/dittoFormOff') item3 = 3283 else deadWindow:getChildById("dittoImgForm3"):setImageSource('/images/game/battle/dittoForm') item3 = tonumber(args[3]) end deadWindow:getChildById('portrait1'):setItemId(item1) deadWindow:getChildById('portrait2'):setItemId(item2) deadWindow:getChildById('portrait3'):setItemId(item3) end function hide() deadWindow:hide() end function closeChannel(buffer) if buffer == "sair" then deadWindow:hide() end end function sendRequestShow() g_game.getProtocolGame():sendExtendedOpcode(111, "requestDittoMemory") end function saveOrUseMemory(memoryID) if memoryID == 1 then if item1 == 3283 then g_game.getProtocolGame():sendExtendedOpcode(111, "saveMemory1") else g_game.getProtocolGame():sendExtendedOpcode(111, "use1") end elseif memoryID == 2 then if item2 == 3283 then g_game.getProtocolGame():sendExtendedOpcode(111, "saveMemory2") else g_game.getProtocolGame():sendExtendedOpcode(111, "use2") end elseif memoryID == 3 then if item3 == 3283 then g_game.getProtocolGame():sendExtendedOpcode(111, "saveMemory3") else g_game.getProtocolGame():sendExtendedOpcode(111, "use3") end end end function clearSlot(memoryID) if memoryID == 1 then g_game.getProtocolGame():sendExtendedOpcode(111, "clearSlot1") elseif memoryID == 2 then g_game.getProtocolGame():sendExtendedOpcode(111, "clearSlot2") elseif memoryID == 3 then g_game.getProtocolGame():sendExtendedOpcode(111, "clearSlot3") end end
-- add glut package option("glut") -- show menu set_showmenu(true) -- set category set_category("package") -- set description set_description("The glut package") -- add defines to config.h if checking ok add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_GLUT") -- set language: c99, c++11 set_languages("c99", "cxx11") -- add links for checking if is_plat("windows", "mingw") then add_links("glut32", "glu32") elseif is_plat("macosx") then add_cxflags("-framework GLUT") add_mxflags("-framework GLUT") add_ldflags("-framework GLUT") else add_links("glut") end -- add link directories add_linkdirs("lib/$(plat)/$(arch)") -- add c includes for checking add_cincludes("glut/glut.h") -- add include directories add_includedirs("inc/$(plat)", "inc")
-- running the tests and examples require 'pl' local lfs = require 'lfs' local function quote_if_needed (s) if s:match '%s' then s = '"'..s..'"' end return s end -- get the Lua command-line used to invoke this script local cmd = app.lua() function do_lua_files () for _,f in ipairs(dir.getfiles('.','*.lua')) do print(cmd..' '..f) local res = utils.execute(cmd..' '..f) if not res then print ('process failed with non-zero result: '..f) os.exit(1) end end end if #arg == 0 then arg[1] = 'tests'; arg[2] = 'examples' end for _,dir in ipairs(arg) do print('directory',dir) lfs.chdir(dir) do_lua_files() lfs.chdir('..') end
local luasodium = require "luasodium" describe("luasodium", function() describe("luasodium constants", function() it("should get the version of luasodium", function() assert.equal("luasodium-", string.sub(luasodium.VERSION, 1, 10)) end) it("should get the property SYMMETRIC_KEYBYTES", function() assert.equal(32, luasodium.SYMMETRIC_KEYBYTES) end) it("should get the property SYMMETRIC_NONCEBYTES", function() assert.equal(24, luasodium.SYMMETRIC_NONCEBYTES) end) it("should get the property SIGN_PUBLICKEYBYTES", function() assert.equal(32, luasodium.SIGN_PUBLICKEYBYTES) end) it("should get the property SIGN_SECRETKEYBYTES", function() assert.equal(64, luasodium.SIGN_SECRETKEYBYTES) end) it("should get the property SIGN_BYTES", function() assert.equal(64, luasodium.SIGN_BYTES) end) end) describe("sodium_version", function() it("should return the version of libsodium", function() assert.equal("string", type(luasodium.sodium_version())) end) end) describe("randombytes", function() it("should generate the minimum number of random bytes", function() assert.equal(0, #luasodium.randombytes(0)) end) it("should generate the maximum number of random bytes", function() assert.equal(256, #luasodium.randombytes(256)) end) it("should raise error 'Invalid number of bytes'", function() local bytes, err = luasodium.randombytes(257) assert.equal(nil, bytes) assert.equal("Invalid number of bytes", err) end) end) describe("sign_keypair", function() it("should generate a key pair", function() local secret_key, public_key = luasodium.sign_keypair() assert.equal(luasodium.SIGN_PUBLICKEYBYTES, #public_key) assert.equal(luasodium.SIGN_SECRETKEYBYTES, #secret_key) assert.equal(public_key, string.sub(secret_key, 33, 64)) end) end) describe("generic hash", function() it("should create a generic hash", function() local hash = luasodium.generichash("test", "key", 24) assert.equal(24, #hash) end) it("should raise error 'Invalid hash size'", function() local hash, err = luasodium.generichash("test", "key", 15) assert.equal(nil, hash) assert.equal("Invalid hash size", err) end) end) describe("aead encrypt/decrypt", function() local nonce, key setup(function() nonce = luasodium.randombytes(24) key = luasodium.randombytes(32) end) it("should encrypt and decrypt", function() local ciphertext = luasodium.aead_encrypt("test", "123abc", nonce, key) local decrypted = luasodium.aead_decrypt(ciphertext, "123abc", nonce, key) assert.equal("test", decrypted) end) it("should raise error 'Invalid nonce size'", function() local ciphertext, err = luasodium.aead_encrypt("test", "123abc", "\0", key) assert.equal(nil, ciphertext) assert.equal("Invalid nonce size", err) end) it("should raise error 'Invalid key size'", function() local ciphertext, err = luasodium.aead_encrypt("test", "123abc", nonce, "\0") assert.equal(nil, ciphertext) assert.equal("Invalid key size", err) end) it("should raise error 'Message forged'", function() local ciphertext = luasodium.aead_encrypt("test", "123abc", nonce, key) local decrypted, err = luasodium.aead_decrypt(ciphertext, "789xyz", nonce, key) assert.equal(nil, decrypted) assert.equal("Message forged", err) end) end) describe("signing", function() local public_key, secret_key setup(function() secret_key, public_key = luasodium.sign_keypair() end) it("should sign and verify", function() local signature = luasodium.sign_detached("test", secret_key) local verified = luasodium.sign_verify_detached("test", signature, public_key) assert.equal("test", verified) end) it("should raise error 'Invalid secret key size'", function() local signature, err = luasodium.sign_detached("test", "\0") assert.equal(nil, signature) assert.equal("Invalid secret key size", err) end) it("should raise error 'Invalid public key size'", function() local signature = luasodium.sign_detached("test", secret_key) local verified, err = luasodium.sign_verify_detached("test", signature, "\0") assert.equal(nil, verified) assert.equal("Invalid public key size", err) end) it("should raise error 'Invalid signature for this message'", function() local verified, err = luasodium.sign_verify_detached("test", "\0", public_key) assert.equal(nil, verified) assert.equal("Invalid signature for this message", err) end) end) end)
local Parser = require "LuaRegexParser.src.parser" local Alternation = require "LuaRegexParser.src.rule.alternation" local Capture = require "LuaRegexParser.src.rule.capture" local P = Parser("[0-9]{2}%W[0-9]{4}%W[0-9]{7}%W([0-9]{2}|[0-9]{3})") local function serializeAST(x, prefix, isTail, name) prefix = prefix or "" name = (name and name..": ") or "" local report = prefix..(isTail and "└── " or "├── ")..name..(x._token or "Items") prefix = prefix..(isTail and " " or "│ ") local function actualSize(t) local count = 0 for k, v in pairs(t) do count = count + 1 end return count end local c = actualSize(x) - (x._token and 1 or 0) for k, v in pairs(x) do if(type(v) == "table") then c = c - 1 report = report.."\n"..serializeAST(v, prefix, c == 0, k) elseif(k ~= "_token") then c = c - 1 report = report.."\n"..prefix..(c == 0 and "└── " or "├── ")..k..": "..tostring(v) end end return report end local M = {} local function new(t, pattern) local P = Parser(pattern) return setmetatable({ Parser = P, AST = Alternation.parse(P) }, M) end M.__call = new M.__tostring = function (self) return serializeAST(self.AST, "", true) end return setmetatable({}, M)
object_tangible_furniture_all_frn_all_lamp_desk_s01_lit = object_tangible_furniture_all_shared_frn_all_lamp_desk_s01_lit:new { } ObjectTemplates:addTemplate(object_tangible_furniture_all_frn_all_lamp_desk_s01_lit, "object/tangible/furniture/all/frn_all_lamp_desk_s01_lit.iff")
local THUMBSTICK_SAMPLES_TO_RESET = 5 --local Event = game.Players.LocalPlayer:FindFirstChild("EyeEvent") or Instance.new("BindableEvent", game.Players.LocalPlayer); Event.Name = "EyeEvent" local VRInputService = {} VRInputService.RecenterOffset = CFrame.new() VRInputService.VRService = VRService or game:GetService("VRService") VRInputService.UserInputService = UserInputService or game:GetService("UserInputService") VRInputService.ThumbstickValues = { [Enum.KeyCode.Thumbstick1] = Vector3.new(), [Enum.KeyCode.Thumbstick2] = Vector3.new(), } VRInputService.PreviousThumbstickValues = { [Enum.KeyCode.Thumbstick1] = {}, [Enum.KeyCode.Thumbstick2] = {}, } VRInputService.CurrentThumbstickPointers = { [Enum.KeyCode.Thumbstick1] = 1, [Enum.KeyCode.Thumbstick2] = 1, } VRInputService.InputsDown = { [Enum.KeyCode.Thumbstick1] = false, [Enum.KeyCode.Thumbstick2] = false, } VRInputService.UserInputService.InputBegan:Connect(function(Input) if VRInputService.InputsDown[Input.KeyCode] ~= nil then VRInputService.InputsDown[Input.KeyCode] = true end end) VRInputService.UserInputService.InputEnded:Connect(function(Input) if VRInputService.InputsDown[Input.KeyCode] then VRInputService.InputsDown[Input.KeyCode] = false end end) VRInputService.UserInputService.InputChanged:Connect(function(Input) if VRInputService.ThumbstickValues[Input.KeyCode] then VRInputService.ThumbstickValues[Input.KeyCode] = Input.Position end end) function VRInputService:GetVRInputs() --Get the head input. local VRInputs = { [Enum.UserCFrame.Head] = self.VRService:GetUserCFrame(Enum.UserCFrame.Head), } --Get the hand inputs. if self.VRService:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand) then VRInputs[Enum.UserCFrame.LeftHand] = self.VRService:GetUserCFrame(Enum.UserCFrame.LeftHand) else VRInputs[Enum.UserCFrame.LeftHand] = VRInputs[Enum.UserCFrame.Head] * CFrame.new(-1,-2.5,0.5) end if self.VRService:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) then VRInputs[Enum.UserCFrame.RightHand] = self.VRService:GetUserCFrame(Enum.UserCFrame.RightHand) else VRInputs[Enum.UserCFrame.RightHand] = VRInputs[Enum.UserCFrame.Head] * CFrame.new(1,-2.5,0.5) end --Determine the height offset. local HeightOffset = 0 if self.ManualNormalHeadLevel then --Adjust to normalize the height around the set value. HeightOffset = -self.ManualNormalHeadLevel else --Adjust to normalize the height around the highest value. --The head CFrame is moved back 0.5 studs for when the headset suddenly goes up (like putting on and taking off). local CurrentVRHeadHeight = (VRInputs[Enum.UserCFrame.Head] * CFrame.new(0,0,0.5)).Y if not self.HighestHeadHeight or CurrentVRHeadHeight > self.HighestHeadHeight then self.HighestHeadHeight = CurrentVRHeadHeight end HeightOffset = -self.HighestHeadHeight end --Normalize the CFrame heights. --A list of enums is used instead of VRInputs because modifying a table stops pairs(). for _,InputEnum in pairs({Enum.UserCFrame.Head,Enum.UserCFrame.LeftHand,Enum.UserCFrame.RightHand}) do VRInputs[InputEnum] = CFrame.new(0,HeightOffset,0) * self.RecenterOffset * VRInputs[InputEnum] end --Return the CFrames. return VRInputs end function VRInputService:Recenter() local HeadCFrame = self.VRService:GetUserCFrame(Enum.UserCFrame.Head) self.RecenterOffset = CFrame.Angles(0,-math.atan2(-HeadCFrame.LookVector.X,-HeadCFrame.LookVector.Z),0) * CFrame.new(-HeadCFrame.X,0,-HeadCFrame.Z) BindableEvent:Fire("Recenter") end function VRInputService:SetEyeLevel() self.ManualNormalHeadLevel = self.VRService:GetUserCFrame(Enum.UserCFrame.Head).Y BindableEvent:Fire("EyeLevel") end function VRInputService:GetThumbstickPosition(Thumbsick) --Return if the value isn't supported. if not self.ThumbstickValues[Thumbsick] then return end --Store the polled value. self.PreviousThumbstickValues[Thumbsick][self.CurrentThumbstickPointers[Thumbsick]] = self.ThumbstickValues[Thumbsick] self.CurrentThumbstickPointers[Thumbsick] = (self.CurrentThumbstickPointers[Thumbsick] % THUMBSTICK_SAMPLES_TO_RESET) + 1 --Determine if the polled values are exactly the same. --Closeness is not used as the thumbstick being held in place will register as slightly different values. --This happens if the trigger is released (such as a touchpad, which may not automatically reset). local ValuesSame = true local InitialValue = self.PreviousThumbstickValues[Thumbsick][1] for i = 2,THUMBSTICK_SAMPLES_TO_RESET do if self.PreviousThumbstickValues[Thumbsick][i] ~= InitialValue then ValuesSame = false break end end --Return either the stored value or the empty vector if the last polled samples are the same. if ValuesSame and not self.InputsDown[Thumbsick] then return Vector3.new(0,0,0) else return self.ThumbstickValues[Thumbsick] end end return VRInputService
local actions = require('telescope.actions') local sorters = require('telescope.sorters') local previewers = require('telescope.previewers') local new_maker = function(filepath, bufnr, opts) opts = opts or {} filepath = vim.fn.expand(filepath) vim.loop.fs_stat(filepath, function(_, stat) if not stat then return end if stat.size > 100000 then return else previewers.buffer_previewer_maker(filepath, bufnr, opts) end end) end require('telescope').setup({ defaults = { mappings = { i = { ["<C-j>"] = actions.move_selection_next, ["<C-k>"] = actions.move_selection_previous, ["<C-Down>"] = actions.cycle_history_next, ["<C-Up>"] = actions.cycle_history_prev, }, }, vimgrep_arguments = { 'rg', '--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' }, prompt_prefix = "> ", selection_caret = "> ", entry_prefix = " ", initial_mode = "insert", selection_strategy = "reset", sorting_strategy = "ascending", layout_config = { width = 0.9, height = 0.8, prompt_position = "top", preview_cutoff = 120, horizontal = { mirror = false, }, vertical = { mirror = false, }, }, layout_strategy = "horizontal", file_ignore_patterns = {}, path_display = { "absolute", }, winblend = 0, border = {}, borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, color_devicons = true, use_less = true, set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, file_previewer = previewers.vim_buffer_cat.new, grep_previewer = previewers.vim_buffer_vimgrep.new, qflist_previewer = previewers.vim_buffer_qflist.new, -- Developer configurations: Not meant for general override --buffer_previewer_maker = previewers.buffer_previewer_maker buffer_previewer_maker = new_maker, }, extensions = { fzf = { -- false will only do exact matching fuzzy = true, -- override the generic sorter override_generic_sorter = true, -- override the file sorter override_file_sorter = true, -- or "ignore_case" or "respect_case". the default case_mode is "smart_case" case_mode = "smart_case", }, frecency = { show_scores = true, show_unindexed = true, ignore_patterns = {"*.git/*", "*/tmp/*", "*/node_modules/*", "*/dist/*"}, disable_devicons = false, workspaces = { ["conf"] = tostring(os.getenv("HOME")) .. "/.config", ["data"] = tostring(os.getenv("HOME")) .. "/.local/share", ["Code"] = tostring(os.getenv("HOME")) .. "/Code", } }, media_files = { -- filetypes whitelist -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} filetypes = {"png", "webp", "jpg", "jpeg", "svg"}, find_cmd = "rg" -- find command (defaults to `fd`) } }, }) require('telescope').load_extension('frecency') require('telescope').load_extension('fzf') require('telescope').load_extension('gh') require('telescope').load_extension('coc') require('telescope').load_extension('media_files') local M = {} M.search_dotfiles = function() require("telescope.builtin").find_files({ prompt_title = "< VimRC >", cwd = tostring(os.getenv("HOME")) .. "/Code/development/dotfiles/", }) end return M
--[[ Copyright 2016 ZTE Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Author: Zhaoxing Meng email: [email protected] ]] -- put red into the connection pool of size 100, -- with 10 seconds max idle time local function close_redis(red) if not red then return end --release connection to the pool local pool_max_idle_time = 10000 local pool_size = 100 local ok, err = red:set_keepalive(pool_max_idle_time, pool_size) if not ok then ngx.log(ngx.ERR, "set keepalive error:", err) end return end local function rewrite_apijson_url() local apiserver=ngx.var.apiserver if apiserver=="fallback" then ngx.status = ngx.HTTP_NOT_FOUND ngx.exit(ngx.status) end local apijsonurl=ngx.var.apijsonurl local uri = ngx.re.sub(ngx.var.uri, "^/apijson/([^/]+)(/[Vv][^/]*)?(.*)", apijsonurl.."$3", "o") ngx.req.set_uri(uri) end local function query_apijson_info() local apiserver = ngx.var.apiserver local apiname = ngx.var.apiname local apiversion = ngx.var.apiversion apiversion=string.sub(apiversion,2,string.len(apiversion)) -- Check if key exists in local cache local cache = ngx.shared.ceryx local server, flags = cache:get("server:apijson:"..apiname..":"..apiversion) local url, flags = cache:get("url:apijson:"..apiname..":"..apiversion) if server and url then ngx.var.apiserver = server ngx.var.apijsonurl = url ngx.log(ngx.WARN, "==using apijson cache:", server.."&&"..url) return end local redis = require "resty.redis" local red = redis:new() red:set_timeout(1000) -- 1000 ms local redis_host = "127.0.0.1" local redis_port = 6379 local res, err = red:connect(redis_host, redis_port) -- Return if could not connect to Redis if not res then ngx.log(ngx.ERR, "connect to redis error:", err) return end -- Construct Redis key local prefix = "msb" local keyprefix = prefix..":routing:api:"..apiname..":"..apiversion -- Try to get ip:port for apiname local serverkey=keyprefix..":lb:server1" local server, err = red:hget(serverkey,"ip")..":"..red:hget(serverkey,"port") ngx.log(ngx.WARN, "==apijsonserver:", server) if not server or server == ngx.null then return close_redis(red) end -- Try to get apijson url for apiname local infokey=keyprefix..":info" local url, err = red:hget(infokey,"apijson") ngx.log(ngx.WARN, "==apijsonurl:", url) if not url or url == ngx.null then return close_redis(red) end -- Save found key to local cache for 5 seconds cache:set("server:apijson:"..apiname..":"..apiversion, server, 5) cache:set("url:apijson:"..apiname..":"..apiversion, url, 5) ngx.log(ngx.WARN, "==apijson result:", server.."&&"..url) ngx.var.apiserver = server ngx.var.apijsonurl = url return close_redis(red) end query_apijson_info() rewrite_apijson_url()
require 'nn' local Lookup, parent = torch.class('nn.Lookup', 'nn.Module'); function Lookup:__init(input_count, output_size) self.weight = torch.Tensor(input_count, output_size); self._gradWeight = {} self._input = {} self.output = torch.Tensor() self.gradInput = torch.Tensor() end function Lookup:parameters() return {self.weight}, { torch.Tensor() } end function Lookup:updateOutput(input) local output = self.weight:index(1, input) return self.output:set(output) end function Lookup:updateGradInput(input, gradOutput) return self.gradInput end function Lookup:zeroGradParameters() local size = #self._gradWeight for i = 1, size do self._gradWeight[i] = nil self._input[i] = nil end end function Lookup:accGradParameters(input, gradOutput, scale) local gradOutput = scale and torch.mul(gradOutput, scale) or gradOutput:clone() local size = #self._gradWeight self._gradWeight[size + 1] = gradOutput self._input[size + 1] = input end function Lookup:updateParameters(learningRate) for i = 1, #self._gradWeight do local gradWeight = self._gradWeight[i] gradWeight = torch.mul(gradWeight, -learningRate) self.weight:indexAdd(1, self._input[i], gradWeight) end end function Lookup:accUpdateGradParameters(input, gradOutput, lr) self:zeroGradParameters() self:accGradParameters(input, gradOutput, 1) self:updateParameters(lr) end function Lookup:shareClone() local lookup = nn.Lookup(1,1) lookup.weight = self.weight lookup._gradWeight = self._gradWeight lookup._input = self._input return lookup end ------------------ --[[ local seq = nn.Sequential() seq:add(nn.Lookup(4,3)) seq:add(nn.Linear(3,5)) local input = torch.LongTensor({1,3,4}) gradientCheck(seq, input) --[[]]-- --[[ require 'gradientCheck' require 'Dynamic' local Test, parent = torch.class('nn.Test', 'nn.Dynamic') function Test:__init(lookup, linear) self.lookup = lookup or nn.Lookup(3,3) self.linear = linear or nn.Linear(3,2) parent.__init(self, self.lookup, self.linear) end function Test:updateOutput(input) self.forwSequence = {} local hidden = self:DF(self.lookup, input) local output = self:DF(self.linear, hidden) self:setOutput(output) return self.output end function Test:shareClone() local test = nn.Test(self.lookup, self.linear) return test end local test = nn.Test() local input = torch.LongTensor({1,3,3}) gradientCheck(test, input) --[[]]--
-- The default duration for animations, in seconds. Initial value is 0.2; set to 0 to disable animations. hs.window.animationDuration = 0 -- auto reload config configFileWatcher = hs.pathwatcher.new(hs.configdir, function(files) local isLuaFileChange = utils.some(files, function(p) return not (string.match(p, "^.+/([^%.#][^/]+%.lua)$") == nil) end) if isLuaFileChange then hs.reload() end end):start() -- persist console history across launches hs.shutdownCallback = function() hs.settings.set('history', hs.console.getHistory()) end hs.console.setHistory(hs.settings.get('history')) -- ensure CLI installed hs.ipc.cliInstall() -- helpful aliases i = hs.inspect fw = hs.window.focusedWindow fmt = string.format bind = hs.hotkey.bind alert = hs.alert.show clear = hs.console.clearConsole reload = hs.reload pbcopy = hs.pasteboard.setContents std = hs.stdlib and require("hs.stdlib") utils = hs.fnutils hyper = {'⌘', '⌃'}
local constants = require "kong.constants" local helpers = require "spec.helpers" local websocket_client = require "resty.websocket.client" local cjson = require "cjson" local MESSAGE = "echo, ping, pong. echo, ping, pong. echo, ping, pong.\n" local function websocket_send_text_and_get_echo(uri) local payload = { message = "hello websocket" } local wc = assert(websocket_client:new()) assert(wc:connect(uri)) assert(wc:send_text(cjson.encode(payload))) local frame, typ, err = wc:recv_frame() assert.is_nil(wc.fatal) assert(frame, err) assert.equal("text", typ) assert.same(payload, cjson.decode(frame)) assert(wc:send_close()) end for _, strategy in helpers.each_strategy() do -- Might need to be marked as flaky because it may require an arbitrary high port? describe("anonymous reports in Admin API #" .. strategy, function() local dns_hostsfile local reports_server local reports_send_ping = function() ngx.sleep(0.01) -- hand over the CPU so other threads can do work (processing the sent data) local admin_client = helpers.admin_client() local res = admin_client:post("/reports/send-ping") assert.response(res).has_status(200) admin_client:close() end local reports_send_stream_ping = function() ngx.sleep(0.01) -- hand over the CPU so other threads can do work (processing the sent data) local tcp = require "socket".tcp() assert(tcp:connect(helpers.get_proxy_ip(false), 19001)) -- TODO: we need to get rid of the next line! assert(tcp:send(MESSAGE)) local body = assert(tcp:receive("*a")) assert.equal("ok", body) tcp:close() end lazy_setup(function() dns_hostsfile = assert(os.tmpname()) local fd = assert(io.open(dns_hostsfile, "w")) assert(fd:write("127.0.0.1 " .. constants.REPORTS.ADDRESS)) assert(fd:close()) end) lazy_teardown(function() os.remove(dns_hostsfile) end) before_each(function() reports_server = helpers.mock_reports_server() local bp = assert(helpers.get_db_utils(strategy, { "services", "routes", "plugins", }, { "reports-api" })) local http_srv = assert(bp.services:insert { name = "mock-service", host = helpers.mock_upstream_host, port = helpers.mock_upstream_port, }) bp.routes:insert({ service = http_srv, protocols = { "http" }, hosts = { "http-service.test" } }) bp.routes:insert({ service = http_srv, protocols = { "https" }, hosts = { "https-service.test" } }) local grpc_srv = bp.services:insert({ name = "grpc", url = "grpc://localhost:15002", }) bp.routes:insert({ service = grpc_srv, protocols = { "grpc" }, hosts = { "grpc" }, }) local grpcs_srv = bp.services:insert({ name = "grpcs", url = "grpcs://localhost:15003", }) bp.routes:insert({ service = grpcs_srv, protocols = { "grpcs" }, hosts = { "grpcs" }, }) local ws_srv = bp.services:insert({ name = "ws", path = "/ws", }) bp.routes:insert({ service = ws_srv, protocols = { "http" }, paths = { "/up-ws" }, strip_path = true, }) local tcp_srv = bp.services:insert({ name = "tcp", host = helpers.mock_upstream_host, port = helpers.mock_upstream_stream_port, protocol = "tcp" }) bp.routes:insert { destinations = { { port = 19000, }, }, protocols = { "tcp", }, service = tcp_srv, } local tls_srv = bp.services:insert({ name = "tls", host = helpers.mock_upstream_host, port = helpers.mock_upstream_stream_ssl_port, protocol = "tls" }) bp.routes:insert { destinations = { { port = 19443, }, }, protocols = { "tls", }, service = tls_srv, } local reports_srv = bp.services:insert({ name = "reports-srv", host = helpers.mock_upstream_host, port = helpers.mock_upstream_stream_port, protocol = "tcp" }) bp.routes:insert { destinations = { { port = 19001, }, }, protocols = { "tcp", }, service = reports_srv, } bp.plugins:insert({ name = "reports-api", service = { id = reports_srv.id }, protocols = { "tcp" }, config = {} }) assert(helpers.start_kong({ nginx_conf = "spec/fixtures/custom_nginx.template", database = strategy, dns_hostsfile = dns_hostsfile, anonymous_reports = true, plugins = "reports-api", stream_listen = helpers.get_proxy_ip(false) .. ":19000," .. helpers.get_proxy_ip(false) .. ":19001," .. helpers.get_proxy_ip(true) .. ":19443", service_mesh = "on", })) end) after_each(function() helpers.stop_kong() reports_server:stop() -- stop the reports server if it was not already stopped end) it("reports http requests", function() local proxy_client = assert(helpers.proxy_client()) local res = proxy_client:get("/", { headers = { host = "http-service.test" } }) assert.response(res).has_status(200) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=1", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) proxy_client:close() end) it("reports https requests", function() local proxy_ssl_client = assert(helpers.proxy_ssl_client()) local res = proxy_ssl_client:get("/", { headers = { host = "https-service.test" } }) assert.response(res).has_status(200) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=1", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) proxy_ssl_client:close() end) it("reports h2c requests", function() local h2c_client = assert(helpers.proxy_client_h2c()) local body, headers = h2c_client({ headers = { [":authority"] = "http-service.test" } }) assert.equal(200, tonumber(headers:get(":status"))) assert.is_not_nil(body) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=1", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) end) it("reports h2 requests", function() local h2_client = assert(helpers.proxy_client_h2()) local body, headers = h2_client({ headers = { [":authority"] = "https-service.test" } }) assert.equal(200, tonumber(headers:get(":status"))) assert.is_not_nil(body) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=1", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) end) it("reports grpc requests", function() local grpc_client = helpers.proxy_client_grpc() assert(grpc_client({ service = "hello.HelloService.SayHello", opts = { ["-authority"] = "grpc", }, })) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=1", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) end) it("reports grpcs requests", function() local grpcs_client = assert(helpers.proxy_client_grpcs()) assert(grpcs_client({ service = "hello.HelloService.SayHello", opts = { ["-authority"] = "grpcs", }, })) reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=1", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) end) it("reports ws requests", function() websocket_send_text_and_get_echo("ws://" .. helpers.get_proxy_ip(false) .. ":" .. helpers.get_proxy_port(false) .. "/up-ws") reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=1", reports_data[1]) assert.match("wss_reqs=0", reports_data[1]) end) it("reports wss requests", function() websocket_send_text_and_get_echo("wss://" .. helpers.get_proxy_ip(true) .. ":" .. helpers.get_proxy_port(true) .. "/up-ws") reports_send_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("requests=1", reports_data[1]) assert.match("http_reqs=0", reports_data[1]) assert.match("https_reqs=0", reports_data[1]) assert.match("h2c_reqs=0", reports_data[1]) assert.match("h2_reqs=0", reports_data[1]) assert.match("grpc_reqs=0", reports_data[1]) assert.match("grpcs_reqs=0", reports_data[1]) assert.match("ws_reqs=0", reports_data[1]) assert.match("wss_reqs=1", reports_data[1]) end) it("#stream reports tcp streams", function() local tcp = require "socket".tcp() assert(tcp:connect(helpers.get_proxy_ip(false), 19000)) -- TODO: we need to get rid of the next line! assert(tcp:send(MESSAGE)) local body = assert(tcp:receive("*a")) assert.equal(MESSAGE, body) tcp:close() reports_send_stream_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("streams=1", reports_data[1]) assert.match("tcp_streams=1", reports_data[1]) assert.match("tls_streams=0", reports_data[1]) end) it("#stream reports tls streams", function() local tcp = require "socket".tcp() local ssl = require("ssl") assert(tcp:connect(helpers.get_proxy_ip(true), 19443)) tcp = ssl.wrap(tcp, { mode = "client", verify = "none", protocol = "any", }) -- TODO: should SNI really be mandatory? tcp:sni("this-is-needed.test") assert(tcp:dohandshake()) -- TODO: we need to get rid of the next line! assert(tcp:send(MESSAGE)) local body = assert(tcp:receive("*a")) assert.equal(MESSAGE, body) tcp:close() reports_send_stream_ping() local _, reports_data = assert(reports_server:stop()) assert.same(1, #reports_data) assert.match("streams=1", reports_data[1]) assert.match("tcp_streams=0", reports_data[1]) assert.match("tls_streams=1", reports_data[1]) end) end) end
--[[ LuiExtended License: The MIT License (MIT) --]] -- CombatInfo namespace LUIE.CombatInfo = {} local CombatInfo = LUIE.CombatInfo local UI = LUIE.UI local Effects = LUIE.Data.Effects local Abilities = LUIE.Data.Abilities local Castbar = LUIE.Data.CastBarTable local printToChat = LUIE.PrintToChat local zo_strformat = zo_strformat local eventManager = EVENT_MANAGER local sceneManager = SCENE_MANAGER local windowManager = WINDOW_MANAGER local moduleName = LUIE.name .. "CombatInfo" local ACTION_RESULT_AREA_EFFECT = 669966 CombatInfo.Enabled = false CombatInfo.Defaults = { blacklist = {}, GlobalShowGCD = false, GlobalPotion = false, GlobalFlash = true, GlobalDesat = false, GlobalLabelColor = false, GlobalMethod = 3, UltimateLabelEnabled = true, UltimatePctEnabled = true, UltimateHideFull = true, UltimateGeneration = true, UltimateLabelPosition = -20, UltimateFontFace = "Univers 67", UltimateFontStyle = "outline", UltimateFontSize = 18, ShowTriggered = true, ProcEnableSound = true, ProcSoundName = "Death Recap Killing Blow", ShowToggled = true, ShowToggledUltimate = true, BarShowLabel = false, -- Temp Disabled BarLabelPosition = -20, BarFontFace = "Univers 67", BarFontStyle = "outline", BarFontSize = 18, BarMillis = true, BarMillisAboveTen = true, BarMillisThreshold = 10, BarShowBack = false, BarDarkUnused = false, BarDesaturateUnused = false, BarHideUnused = false, PotionTimerShow = true, PotionTimerLabelPosition = 0, PotionTimerFontFace = "Univers 67", PotionTimerFontStyle = "outline", PotionTimerFontSize = 18, PotionTimerColor = true, PotionTimerMillis = true, CastBarEnable = false, CastBarSizeW = 300, CastBarSizeH = 22, CastBarIconSize = 32, CastBarTexture = "Plain", CastBarLabel = true, CastBarTimer = true, CastBarFontFace = "Univers 67", CastBarFontStyle = "soft-shadow-thick", CastBarFontSize = 16, CastBarGradientC1 = { 0, 47/255, 130/255 }, CastBarGradientC2 = { 82/255, 215/255, 1 }, alerts = { toggles = { alertEnable = true, alertFontFace = "Univers 67", alertFontStyle = "soft-shadow-thick", alertFontSize = 32, alertTimer = true, showMitigation = true, mitigationAbilityName = "%t", mitigationEnemyName = "%n -", modifierEnable = true, mitigationModifierOnYou = GetString(SI_LUIE_CI_MITIGATION_MODIFIER_ON_YOU), mitigationModifierSpreadOut = GetString(SI_LUIE_CI_MITIGATION_MODIFIER_SPREAD_OUT), showCrowdControlBorder = true, ccLabelColor = false, useDefaultIcon = false, mitigationPowerPrefix2 = "%t", mitigationPowerPrefixN2 = GetString(SI_LUIE_CI_MITIGATION_FORMAT_POWER_N), mitigationDestroyPrefix2 = "%t", mitigationDestroyPrefixN2 = "%t", mitigationSummonPrefix2 = "%t", mitigationSummonPrefixN2 = "%t", mitigationAura = false, mitigationRank3 = true, mitigationRank2 = true, mitigationRank1 = true, mitigationDungeon = true, showAlertMitigate = true, showAlertUnmit = true, showAlertPower = true, showAlertDestroy = true, showAlertSummon = true, alertOptions = 1, soundVolume = 2, sound_stEnable = false, sound_st_ccEnable = true, sound_aoeEnable = false, sound_aoe_ccEnable = true, sound_powerattackEnable = true, sound_radialEnable = true, sound_travelEnable = false, sound_travel_ccEnable = true, sound_groundEnable = false, sound_meteorEnable = true, sound_unmit_stEnable = true, sound_unmit_aoeEnable = true, sound_power_damageEnable = true, sound_power_buffEnable = true, sound_summonEnable = false, sound_destroyEnable = true, sound_healEnable = false, }, colors = { alertShared = { 1, 1, 1, 1 }, alertTimer = { 1, 1, 1, 1 }, alertBlockA = { 1, 0, 0, 1 }, alertInterruptC = { 0, 127/255, 1, 1 }, alertUnmit = { 1, 0, 0, 1 }, alertDodgeA = { 1, 1, 50/255, 1 }, alertAvoidB = { 1, 127/255, 0, 1 }, alertPower = { 1, 1, 1, 1 }, alertDestroy = { 1, 1, 1, 1 }, alertSummon = { 1, 1, 1, 1 }, stunColor = { 1, 0, 0, 1 }, knockbackColor = { 1, 0, 0, 1 }, levitateColor = { 1, 0, 0, 1 }, disorientColor = { 0, 127/255, 1, 1 }, fearColor = { 143/255, 9/255, 236/255, 1 }, silenceColor = { 0, 1, 1, 1 }, staggerColor = { 1, 127/255, 0, 1 }, unbreakableColor = { 224/255, 224/255, 1, 1 }, snareColor = { 1, 242/255, 32/255, 1 }, rootColor = { 1, 165/255, 0, 1 }, }, formats = { alertBlock = GetString(SI_LUIE_CI_BLOCK_DEFAULT), alertBlockStagger = GetString(SI_LUIE_CI_BLOCKSTAGGER_DEFAULT), alertInterrupt = GetString(SI_LUIE_CI_INTERRUPT_DEFAULT), alertShouldUseCC = GetString(SI_LUIE_CI_SHOULDUSECC_DEFAULT), alertUnmit = GetString(SI_LUIE_CI_UNMIT_DEFAULT), alertDodge = GetString(SI_LUIE_CI_DODGE_DEFAULT), alertAvoid = GetString(SI_LUIE_CI_AVOID_DEFAULT), alertPower = GetString(SI_LUIE_CI_POWER_DEFAULT), alertDestroy = GetString(SI_LUIE_CI_DESTROY_DEFAULT), alertSummon = GetString(SI_LUIE_CI_SUMMON_DEFAULT), }, sounds = { --[[ Old Sounds here for reference sound3 = "Champion Damage Taken", sound3CC = "Champion Points Committed", sound3UB = "Trial - Scored Added Very Low", sound2 = "Champion Damage Taken", sound2CC = "Champion Points Committed", sound2UB = "Trial - Scored Added Low", sound1 = "Champion Damage Taken", sound1CC = "Console Game Enter", sound1UB = "Trial - Scored Added Normal", soundUnmit = "Console Game Enter", soundPower = "Champion Respec Accept", soundSummon = "Duel Invite Received", soundDestroy = "Duel Invite Received", ]]-- sound_st = "Champion Respec Accept", sound_st_cc = "Champion Points Committed", sound_aoe = "Champion Respec Accept", sound_aoe_cc = "Champion Points Committed", sound_powerattack = "Trial - Scored Added Normal", sound_radial = "Duel Accepted", sound_travel = "Champion Respec Accept", sound_travel_cc = "Console Game Enter", sound_ground = "Champion Respec Accept", sound_meteor = "LFG Find Replacement", sound_unmit_st = "Duel Start", sound_unmit_aoe = "Duel Start", sound_power_damage = "Book Collection Completed", sound_power_buff = "Book Collection Completed", sound_summon = "Duel Invite Received", sound_destroy = "Duel Invite Received", sound_heal = "Console Game Enter", }, }, cct = { enabled = false, enabledOnlyInCyro = false, unlock = false, controlScale = 1.0, useDefaultIcon = false, defaultIconOptions = 1, playAnimation = true, playSound = true, playSoundOption = "Death Recap Killing Blow", useAbilityName = true, showStaggered = true, showImmune = true, showAoe = true, aoePlayerUltimate = true, aoePlayerNormal = true, aoePlayerSet = true, aoeTraps = true, aoeNPCBoss = true, aoeNPCElite = true, aoeNPCNormal = true, aoePlayerUltimateSoundToggle = true, aoePlayerNormalSoundToggle = true, aoePlayerSetSoundToggle = true, aoeTrapsSoundToggle = true, aoeNPCBossSoundToggle = true, aoeNPCEliteSoundToggle = true, aoeNPCNormalSoundToggle = true, aoePlayerUltimateSound = "Death Recap Killing Blow", aoePlayerNormalSound = "Death Recap Killing Blow", aoePlayerSetSound = "Death Recap Killing Blow", aoeTrapsSound = "Death Recap Killing Blow", aoeNPCBossSound = "Death Recap Killing Blow", aoeNPCEliteSound = "Death Recap Killing Blow", aoeNPCNormalSound = "Death Recap Killing Blow", showGCD = false, showImmuneOnlyInCyro = true, immuneDisplayTime = 750, showOptions = "all", offsetX = 0, offsetY = 0, colors = { [ACTION_RESULT_STUNNED] = { 1, 0, 0, 1 }, [ACTION_RESULT_KNOCKBACK] = { 1, 0, 0, 1 }, [ACTION_RESULT_LEVITATED] = { 1, 0, 0, 1 }, [ACTION_RESULT_DISORIENTED] = { 0, 127/255, 1, 1 }, [ACTION_RESULT_FEARED] = { 143/255, 9/255, 236/255, 1 }, [ACTION_RESULT_SILENCED] = { 0, 1, 1, 1 }, [ACTION_RESULT_STAGGERED] = { 1, 127/255, 0, 1 }, [ACTION_RESULT_IMMUNE] = { 1, 1, 1, 1}, [ACTION_RESULT_DODGED] = { 1, 1, 1, 1}, [ACTION_RESULT_BLOCKED] = { 1, 1, 1, 1}, [ACTION_RESULT_BLOCKED_DAMAGE] = { 1, 1, 1, 1}, [ACTION_RESULT_AREA_EFFECT] = { 1, 242/255, 32/255, 1 }, unbreakable = { 224/255, 224/255, 1, 1 }, }, }, } CombatInfo.SV = nil CombatInfo.AlertColors = {} CombatInfo.CastBarUnlocked = false CombatInfo.AlertFrameUnlocked = false local uiTlw = {} -- GUI local castbar = {} -- castbar local g_casting = false -- Toggled when casting - prevents additional events from creating a cast bar until finished local g_ultimateCost = 0 -- Cost of ultimate Ability in Slot local g_ultimateCurrent = 0 -- Current ultimate value local g_ultimateSlot = ACTION_BAR_ULTIMATE_SLOT_INDEX + 1 -- Ultimate slot number local g_uiProcAnimation = {} -- Animation for bar slots local g_uiCustomToggle = {} -- Toggle slots for bar Slots local g_triggeredSlotsFront = {} -- Triggered bar highlight slots local g_triggeredSlotsBack = {} -- Triggered bar highlight slots local g_triggeredSlotsRemain = {} -- Table of remaining durations on proc abilities local g_toggledSlotsBack = {} -- Toggled bar highlight slots local g_toggledSlotsFront = {} -- Toggled bar highlight slots local g_toggledSlotsRemain = {} -- Table of remaining durations on active abilities local g_toggledSlotsStack = {} -- Table of stacks for active abilities local g_toggledSlotsPlayer = {} -- Table of abilities that target the player (bar highlight doesn't fade on reticleover change) local g_potionUsed = false -- Toggled on when a potion is used to prevent OnSlotsFullUpdate from updating timers. local g_barOverrideCI = {} -- Table for storing abilityId's from Effects.BarHighlightOverride that should show as an aura local g_barFakeAura = {} -- Table for storing abilityId's that only display a fakeaura local g_barDurationOverride = {} -- Table for storing abilitiyId's that ignore ending event local g_barNoRemove = {} -- Table of abilities we don't remove from bar highlight local g_protectAbilityRemoval = {} -- AbilityId's set to a timestamp here to prevent removal of bar highlight when refreshing ground auras from causing the highlight to fade. local g_mineStacks = {} -- Individual AbilityId ground mine stack information local g_mineNoTurnOff = {} -- When this variable is true for an abilityId - don't remove the bar highlight for a mine (We we have reticleover target and the mine effect applies on the enemy) local g_barFont -- Font for Ability Highlight Label local g_potionFont -- Font for Potion Timer Label local g_ultimateFont -- Font for Ultimate Percentage Label local g_castbarFont -- Font for Castbar Label & Timer local g_ProcSound -- Proc Sound local g_boundArmamentsPlayed = false -- Specific variable to lockout Bound Armaments from playing a proc sound at 5 stacks to only once per 5 seconds. local g_disableProcSound = {} -- When we play a proc sound from a bar ability changing (like power lash) we put a 3 sec ICD on it so it doesn't spam when mousing on/off a target, etc local g_hotbarCategory -- Set on initialization and when we swap weapons to determine the current hotbar category local g_backbarButtons = {} -- Table to hold backbar buttons local g_activeWeaponSwapInProgress = false -- Toggled on when weapon swapping, TODO: maybe not needed local ACTION_BAR = ZO_ActionBar1 local BAR_INDEX_START = 3 local BAR_INDEX_END = 8 local BACKBAR_INDEX_END = 7 -- Separate index for backbar as long as we're not using an ultimate button. local BACKBAR_INDEX_OFFSET = 50 -- Quickslot local uiQuickSlot = { colour = {0.941, 0.565, 0.251}, timeColours = { [1] = {remain = 15000, colour = {0.878, 0.941, 0.251}}, [2] = {remain = 5000, colour = {0.251, 0.941, 0.125}}, }, } -- Ultimate slot local uiUltimate = { colour = {0.941, 0.973, .957}, pctColours = { [1] = {pct =100, colour = {0.878, 0.941, 0.251}}, [2] = {pct = 80, colour = {0.941, 0.565, 0.251}}, [3] = {pct = 50, colour = {0.941, 0.251, 0.125}}, }, FadeTime = 0, NotFull = false, } -- Cooldown Animation Types for GCD Tracking local CooldownMethod = { [1] = CD_TYPE_VERTICAL_REVEAL, [2] = CD_TYPE_VERTICAL, [3] = CD_TYPE_RADIAL, } -- Constants from actionbar.lua with only the information we need local GAMEPAD_CONSTANTS = { abilitySlotOffsetX = 10, ultimateSlotOffsetX = 65, } local KEYBOARD_CONSTANTS = { abilitySlotOffsetX = 2, ultimateSlotOffsetX = 62, } local isStackCounter = { [61905] = true, -- Grim Focus [61928] = true, -- Relentless Focus [61920] = true, -- Merciless Resolve [130293] = true, -- Bound Armaments } local isStackBaseAbility = { [61902] = true, -- Grim Focus [61927] = true, -- Relentless Focus [61919] = true, -- Merciless Resolve [24165] = true, -- Bound Armaments } local slotsUpdated = {} local function OnSwapAnimationHalfDone(animation, button, isBackBarSlot) for i = BAR_INDEX_START, BAR_INDEX_END do if not slotsUpdated[i] then local targetButton = g_backbarButtons[i + BACKBAR_INDEX_OFFSET] CombatInfo.BarSlotUpdate(i, false, false) CombatInfo.BarSlotUpdate(i + BACKBAR_INDEX_OFFSET, false, false) -- Don't try to setup back bar ultimate if i < 8 then CombatInfo.SetupBackBarIcons(targetButton, true) end if i == 8 then CombatInfo.UpdateUltimateLabel() end slotsUpdated[i] = true end end end local function OnSwapAnimationDone(animation, button) button.noUpdates = false if button:GetSlot() == ACTION_BAR_ULTIMATE_SLOT_INDEX + 1 then g_activeWeaponSwapInProgress = false end slotsUpdated = {} end local function SetupSwapAnimation(button) button:SetupSwapAnimation(OnSwapAnimationHalfDone, OnSwapAnimationDone) end local function FormatDurationSeconds(remain) return string.format((CombatInfo.SV.BarMillis and ((remain < CombatInfo.SV.BarMillisThreshold * 1000) or CombatInfo.SV.BarMillisAboveTen)) and "%.1f" or "%.1d", remain/1000) end -- Module initialization function CombatInfo.Initialize(enabled) -- Load settings local isCharacterSpecific = LUIESV.Default[GetDisplayName()]['$AccountWide'].CharacterSpecificSV if isCharacterSpecific then CombatInfo.SV = ZO_SavedVars:New(LUIE.SVName, LUIE.SVVer, "CombatInfo", CombatInfo.Defaults) else CombatInfo.SV = ZO_SavedVars:NewAccountWide(LUIE.SVName, LUIE.SVVer, "CombatInfo", CombatInfo.Defaults) end -- Disable module if setting not toggled on if not enabled then return end CombatInfo.Enabled = true -- TODO: TEMP: Disabled due to issues if CombatInfo.SV.BarShowLabel == true then CombatInfo.SV.BarShowLabel = false end CombatInfo.ApplyFont() CombatInfo.ApplyProcSound() uiQuickSlot.label = UI.Label(ActionButton9, {CENTER,CENTER}, nil, nil, g_potionFont, nil, true) uiQuickSlot.label:SetFont(g_potionFont) if CombatInfo.SV.PotionTimerColor then uiQuickSlot.label:SetColor(unpack(uiQuickSlot.colour)) else uiQuickSlot.label:SetColor(1, 1, 1, 1) end uiQuickSlot.label:SetDrawLayer(DL_OVERLAY) uiQuickSlot.label:SetDrawTier(DT_HIGH) CombatInfo.ResetPotionTimerLabel() -- Set the label position -- Create Ultimate overlay labels uiUltimate.LabelVal = UI.Label(ActionButton8, {BOTTOM,TOP,0,-3}, nil, {1,2}, "$(BOLD_FONT)|16|soft-shadow-thick", nil, true) uiUltimate.LabelPct = UI.Label(ActionButton8, nil, nil, nil, g_ultimateFont, nil, true) local actionButton = ZO_ActionBar_GetButton(8) uiUltimate.LabelPct:SetAnchor(TOPLEFT, actionButton.slot) uiUltimate.LabelPct:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.UltimateLabelPosition) uiUltimate.LabelPct:SetColor(unpack(uiUltimate.colour)) -- And buff texture uiUltimate.Texture = UI.Texture(ActionButton8, {CENTER,CENTER}, {160,160}, "/esoui/art/crafting/white_burst.dds", DL_BACKGROUND, true) -- Create a top level window for backbar butons local tlw = windowManager:CreateControl("LUIE_Backbar", ACTION_BAR, CT_CONTROL) tlw:SetParent(ACTION_BAR) for i = BAR_INDEX_START + BACKBAR_INDEX_OFFSET, BACKBAR_INDEX_END + BACKBAR_INDEX_OFFSET do local button = ActionButton:New(i, ACTION_BUTTON_TYPE_VISIBLE, tlw, 'ZO_ActionButton') SetupSwapAnimation(button) button:SetupBounceAnimation() g_backbarButtons[i] = button end CombatInfo.BackbarSetupTemplate() CombatInfo.BackbarToggleSettings() ------------------------------------------------------------------------------------- CombatInfo.RegisterCombatInfo() if CombatInfo.SV.GlobalShowGCD then CombatInfo.HookGCD() end -- Create and update Cast Bar CombatInfo.CreateCastBar() CombatInfo.UpdateCastBar() CombatInfo.SetCastBarPosition() -- Setup Alerts CombatInfo.AbilityAlerts.CreateAlertFrame() CombatInfo.AbilityAlerts.SetAlertFramePosition() CombatInfo.AbilityAlerts.SetAlertColors() -- Setup CCT CombatInfo.CrowdControlTracker.UpdateAOEList() CombatInfo.CrowdControlTracker.Initialize() -- Variable adjustment if needed if not LUIESV.Default[GetDisplayName()]['$AccountWide'].AdjustVarsCI then LUIESV.Default[GetDisplayName()]['$AccountWide'].AdjustVarsCI = 0 end if (LUIESV.Default[GetDisplayName()]['$AccountWide'].AdjustVarsCI < 2) then -- Set ability alert default colors CombatInfo.SV.alerts.colors.stunColor = CombatInfo.Defaults.alerts.colors.stunColor CombatInfo.SV.alerts.colors.knockbackColor = CombatInfo.Defaults.alerts.colors.knockbackColor CombatInfo.SV.alerts.colors.levitateColor = CombatInfo.Defaults.alerts.colors.levitateColor CombatInfo.SV.alerts.colors.disorientColor = CombatInfo.Defaults.alerts.colors.disorientColor CombatInfo.SV.alerts.colors.fearColor = CombatInfo.Defaults.alerts.colors.fearColor CombatInfo.SV.alerts.colors.silenceColor = CombatInfo.Defaults.alerts.colors.silenceColor CombatInfo.SV.alerts.colors.staggerColor = CombatInfo.Defaults.alerts.colors.staggerColor CombatInfo.SV.alerts.colors.unbreakableColor = CombatInfo.Defaults.alerts.colors.unbreakableColor CombatInfo.SV.alerts.colors.snareColor = CombatInfo.Defaults.alerts.colors.snareColor CombatInfo.SV.alerts.colors.rootColor = CombatInfo.Defaults.alerts.colors.rootColor -- Set CCT default colors CombatInfo.SV.cct.colors[ACTION_RESULT_STUNNED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_STUNNED] CombatInfo.SV.cct.colors[ACTION_RESULT_KNOCKBACK] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_KNOCKBACK] CombatInfo.SV.cct.colors[ACTION_RESULT_LEVITATED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_LEVITATED] CombatInfo.SV.cct.colors[ACTION_RESULT_DISORIENTED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_DISORIENTED] CombatInfo.SV.cct.colors[ACTION_RESULT_FEARED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_FEARED] CombatInfo.SV.cct.colors[ACTION_RESULT_SILENCED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_SILENCED] CombatInfo.SV.cct.colors[ACTION_RESULT_STAGGERED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_STAGGERED] CombatInfo.SV.cct.colors[ACTION_RESULT_IMMUNE] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_IMMUNE] CombatInfo.SV.cct.colors[ACTION_RESULT_DODGED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_DODGED] CombatInfo.SV.cct.colors[ACTION_RESULT_BLOCKED] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_BLOCKED] CombatInfo.SV.cct.colors[ACTION_RESULT_BLOCKED_DAMAGE] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_BLOCKED_DAMAGE] CombatInfo.SV.cct.colors[ACTION_RESULT_AREA_EFFECT] = CombatInfo.Defaults.cct.colors[ACTION_RESULT_AREA_EFFECT] CombatInfo.SV.cct.colors.unbreakable = CombatInfo.Defaults.cct.colors.unbreakable end -- Increment so this doesn't occur again. LUIESV.Default[GetDisplayName()]['$AccountWide'].AdjustVarsCI = 2 end -- Called on initialization and on full update to swap icons on backbar function CombatInfo.SetupBackBarIcons(button, flip) -- Setup icons for backbar local hotbarCategory = g_hotbarCategory == HOTBAR_CATEGORY_BACKUP and HOTBAR_CATEGORY_PRIMARY or HOTBAR_CATEGORY_BACKUP local slotNum = button.slot.slotNum local slotId = GetSlotBoundId(slotNum - BACKBAR_INDEX_OFFSET, hotbarCategory) -- Special case for certain skills, so the proc icon doesn't get stuck. if slotId == 61907 then slotId = 61902 end -- Assassin's Will --> Grim Focus if slotId == 61932 then slotId = 61927 end -- Assassin's Scourge --> Relentless Focus if slotId == 61930 then slotId = 61919 end -- Assassin's Will --> Merciless Resolve if slotId == 114716 then slotId = 46324 end -- Crystal Fragments --> Crystal Fragments if slotId == 20824 then slotId = 20816 end -- Power Lash --> Flame Lash if slotId == 35445 then slotId = 35441 end -- Shadow Image Teleport --> Shadow Image if slotId == 126659 then slotId = 38910 end -- Flying Blade --> Flying Blade if slotId == 130291 then slotId = 24165 end -- Bound Armaments --> Bound Armaments -- Check if something is in this action bar slot and if not hide the slot if slotId > 0 then button.icon:SetTexture(GetAbilityIcon(slotId)) button.icon:SetHidden(false) else button.icon:SetHidden(true) end if flip then local desaturate if g_uiCustomToggle[slotNum] then desaturate = false if g_uiCustomToggle[slotNum]:IsHidden() then CombatInfo.BackbarHideSlot(slotNum) desaturate = true end else desaturate = true end CombatInfo.ToggleBackbarSaturation(slotNum, desaturate) end end function CombatInfo.OnActiveWeaponPairChanged() g_hotbarCategory = GetActiveHotbarCategory() g_activeWeaponSwapInProgress = true end function CombatInfo.HookGCD() -- Hook to update GCD support ActionButton.UpdateUsable = function(self) local slotnum = self:GetSlot() local isGamepad = IsInGamepadPreferredMode() local _, duration, _, _ = GetSlotCooldownInfo(slotnum) local isShowingCooldown = self.showingCooldown local isKeyboardUltimateSlot = not isGamepad and self.slot.slotNum == ACTION_BAR_ULTIMATE_SLOT_INDEX + 1 local usable = false if not self.useFailure and not isShowingCooldown then usable = true elseif (isKeyboardUltimateSlot and self.costFailureOnly and not isShowingCooldown) then usable = true -- Fix to grey out potions elseif IsSlotItemConsumable(slotnum) and duration <= 1000 and not self.useFailure then usable = true end if usable ~= self.usable or isGamepad ~= self.isGamepad then self.usable = usable self.isGamepad = isGamepad end -- Have to move this out of conditional to fix desaturation from getting stuck on icons. local useDesaturation = (isShowingCooldown and CombatInfo.SV.GlobalDesat) ZO_ActionSlot_SetUnusable(self.icon, not usable, useDesaturation) end -- Hook to update GCD support ActionButton.UpdateCooldown = function(self, options) local slotnum = self:GetSlot() local remain, duration, global, globalSlotType = GetSlotCooldownInfo(slotnum) local isInCooldown = duration > 0 local slotType = GetSlotType(slotnum) local showGlobalCooldownForCollectible = global and slotType == ACTION_TYPE_COLLECTIBLE and globalSlotType == ACTION_TYPE_COLLECTIBLE local showCooldown = isInCooldown and (CombatInfo.SV.GlobalShowGCD or not global or showGlobalCooldownForCollectible) local updateChromaQuickslot = slotType ~= ACTION_TYPE_ABILITY and ZO_RZCHROMA_EFFECTS self.cooldown:SetHidden(not showCooldown) if showCooldown then -- For items with a long CD we need to be sure not to hide the countdown radial timer, so if the duration is the 1 sec GCD, then we don't turn off the cooldown animation. if not IsSlotItemConsumable(slotnum) or duration > 1000 or CombatInfo.SV.GlobalPotion then self.cooldown:StartCooldown(remain, duration, CooldownMethod[CombatInfo.SV.GlobalMethod], nil, NO_LEADING_EDGE) if self.cooldownCompleteAnim.animation then self.cooldownCompleteAnim.animation:GetTimeline():PlayInstantlyToStart() end if IsInGamepadPreferredMode() then self.cooldown:SetHidden(true) if not self.showingCooldown then self:SetNeedsAnimationParameterUpdate(true) self:PlayAbilityUsedBounce() end else self.cooldown:SetHidden(false) end self.slot:SetHandler("OnUpdate", function() self:RefreshCooldown() end) if updateChromaQuickslot then ZO_RZCHROMA_EFFECTS:RemoveKeybindActionEffect("ACTION_BUTTON_9") end end else if CombatInfo.SV.GlobalFlash then if self.showingCooldown then -- Stop flash from appearing on potion/ultimate if toggled off. if not IsSlotItemConsumable(slotnum) or duration > 1000 or CombatInfo.SV.GlobalPotion then self.cooldownCompleteAnim.animation = self.cooldownCompleteAnim.animation or CreateSimpleAnimation(ANIMATION_TEXTURE, self.cooldownCompleteAnim) local anim = self.cooldownCompleteAnim.animation self.cooldownCompleteAnim:SetHidden(false) self.cooldown:SetHidden(false) anim:SetImageData(16,1) anim:SetFramerate(30) anim:GetTimeline():PlayFromStart() if updateChromaQuickslot then ZO_RZCHROMA_EFFECTS:AddKeybindActionEffect("ACTION_BUTTON_9") end end end end self.icon.percentComplete = 1 self.slot:SetHandler("OnUpdate", nil) self.cooldown:ResetCooldown() end if showCooldown ~= self.showingCooldown then self:SetShowCooldown(showCooldown) self:UpdateActivationHighlight() if IsInGamepadPreferredMode() then self:SetCooldownPercentComplete(self.icon.percentComplete) end end if showCooldown or self.itemQtyFailure then self.icon:SetDesaturation(1) else self.icon:SetDesaturation(0) end local textColor if CombatInfo.SV.GlobalLabelColor then textColor = showCooldown and INTERFACE_TEXT_COLOR_FAILED or INTERFACE_TEXT_COLOR_SELECTED else textColor = INTERFACE_TEXT_COLOR_SELECTED end self.buttonText:SetColor(GetInterfaceColor(INTERFACE_COLOR_TYPE_TEXT_COLORS, textColor)) self.isGlobalCooldown = global self:UpdateUsable() end end -- Helper function to get override ability duration. local function GetUpdatedAbilityDuration(abilityId) local duration = g_barDurationOverride[abilityId] or GetAbilityDuration(abilityId) return duration end -- Called on initialization and menu changes -- Pull data from Effects.BarHighlightOverride Tables to filter the display of Bar Highlight abilities based off menu settings. function CombatInfo.UpdateBarHighlightTables() g_uiProcAnimation = {} g_uiCustomToggle = {} g_triggeredSlotsFront = {} g_triggeredSlotsBack = {} g_triggeredSlotsRemain = {} g_toggledSlotsFront = {} g_toggledSlotsBack = {} g_toggledSlotsRemain = {} g_toggledSlotsStack = {} g_toggledSlotsPlayer = {} g_barOverrideCI = {} g_barFakeAura = {} g_barDurationOverride = {} g_barNoRemove = {} local counter = 0 for abilityId, _ in pairs(g_barOverrideCI) do counter = counter + 1 local eventName = (moduleName .. "CombatEventBar" .. counter) eventManager:UnregisterForEvent(eventName, EVENT_COMBAT_EVENT, CombatInfo.OnCombatEventBar) end if CombatInfo.SV.ShowTriggered or CombatInfo.SV.ShowToggled then -- Grab any aura's from the list that have on EVENT_COMBAT_EVENT AURA support for abilityId, value in pairs(Effects.BarHighlightOverride) do if value.showFakeAura == true then if value.newId then g_barOverrideCI[value.newId] = true if value.duration then g_barDurationOverride[value.newId] = value.duration end if value.noRemove then g_barNoRemove[value.newId] = true end g_barFakeAura[value.newId] = true else g_barOverrideCI[abilityId] = true if value.duration then g_barDurationOverride[abilityId] = value.duration end if value.noRemove then g_barNoRemove[abilityId] = true end g_barFakeAura[abilityId] = true end else if value.noRemove then if value.newId then g_barNoRemove[value.newId] = true else g_barNoRemove[abilityId] = true end end end end local counter = 0 for abilityId, _ in pairs(g_barOverrideCI) do counter = counter + 1 local eventName = (moduleName .. "CombatEventBar" .. counter) eventManager:RegisterForEvent(eventName, EVENT_COMBAT_EVENT, CombatInfo.OnCombatEventBar) -- Register filter for specific abilityId's in table only, and filter for source = player, no errors eventManager:AddFilterForEvent(eventName, EVENT_COMBAT_EVENT, REGISTER_FILTER_ABILITY_ID, abilityId, REGISTER_FILTER_IS_ERROR, false) end end end -- Clear and then (maybe) re-register event listeners for Combat/Power/Slot Updates function CombatInfo.RegisterCombatInfo() eventManager:RegisterForUpdate(moduleName .. "OnUpdate", 100, CombatInfo.OnUpdate) eventManager:RegisterForEvent(moduleName, EVENT_PLAYER_ACTIVATED, CombatInfo.OnPlayerActivated) eventManager:UnregisterForEvent(moduleName, EVENT_COMBAT_EVENT) eventManager:UnregisterForEvent(moduleName, EVENT_POWER_UPDATE) eventManager:UnregisterForEvent(moduleName, EVENT_ACTION_SLOTS_ACTIVE_HOTBAR_UPDATED) eventManager:UnregisterForEvent(moduleName, EVENT_ACTION_SLOTS_ALL_HOTBARS_UPDATED) eventManager:UnregisterForEvent(moduleName, EVENT_ACTION_SLOT_UPDATED ) eventManager:UnregisterForEvent(moduleName, EVENT_ACTIVE_WEAPON_PAIR_CHANGED ) eventManager:UnregisterForEvent(moduleName, EVENT_INVENTORY_ITEM_USED) if CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled then eventManager:RegisterForEvent(moduleName .. "CombatEvent1", EVENT_COMBAT_EVENT, CombatInfo.OnCombatEvent) eventManager:AddFilterForEvent(moduleName .. "CombatEvent1", REGISTER_FILTER_TARGET_COMBAT_UNIT_TYPE, COMBAT_UNIT_TYPE_PLAYER, REGISTER_FILTER_IS_ERROR, false, REGISTER_FILTER_COMBAT_RESULT, ACTION_RESULT_BLOCKED_DAMAGE) eventManager:RegisterForEvent(moduleName .. "PowerUpdate", EVENT_POWER_UPDATE, CombatInfo.OnPowerUpdatePlayer) eventManager:AddFilterForEvent(moduleName .. "PowerUpdate", EVENT_POWER_UPDATE, REGISTER_FILTER_UNIT_TAG, "player") eventManager:RegisterForEvent(moduleName .. "InventoryUpdate", EVENT_INVENTORY_SINGLE_SLOT_UPDATE, CombatInfo.OnInventorySlotUpdate) eventManager:AddFilterForEvent(moduleName .. "InventoryUpdate", EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_BAG_ID, BAG_WORN, REGISTER_FILTER_INVENTORY_UPDATE_REASON, INVENTORY_UPDATE_REASON_DEFAULT, REGISTER_FILTER_IS_NEW_ITEM, false) end if CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled or CombatInfo.SV.CastBarEnable then eventManager:RegisterForEvent(moduleName .. "CombatEvent2", EVENT_COMBAT_EVENT, CombatInfo.OnCombatEvent) eventManager:AddFilterForEvent(moduleName .. "CombatEvent2", REGISTER_FILTER_SOURCE_COMBAT_UNIT_TYPE, COMBAT_UNIT_TYPE_PLAYER, REGISTER_FILTER_IS_ERROR, false) end if CombatInfo.SV.CastBarEnable then local counter = 0 for result, _ in pairs(Castbar.CastBreakingStatus) do counter = counter + 1 local eventName = (moduleName .. "CombatEventCC" .. counter) eventManager:RegisterForEvent(eventName, EVENT_COMBAT_EVENT, CombatInfo.OnCombatEventBreakCast) eventManager:AddFilterForEvent(eventName, EVENT_COMBAT_EVENT, REGISTER_FILTER_TARGET_COMBAT_UNIT_TYPE, COMBAT_UNIT_TYPE_PLAYER, REGISTER_FILTER_IS_ERROR, false, REGISTER_FILTER_COMBAT_RESULT, result) end eventManager:RegisterForEvent(moduleName, EVENT_START_SOUL_GEM_RESURRECTION, CombatInfo.SoulGemResurrectionStart) eventManager:RegisterForEvent(moduleName, EVENT_END_SOUL_GEM_RESURRECTION, CombatInfo.SoulGemResurrectionEnd) eventManager:RegisterForEvent(moduleName, EVENT_GAME_CAMERA_UI_MODE_CHANGED, CombatInfo.OnGameCameraUIModeChanged) eventManager:RegisterForEvent(moduleName, EVENT_END_SIEGE_CONTROL, CombatInfo.OnSiegeEnd) --eventManager:RegisterForEvent(moduleName, EVENT_CLIENT_INTERACT_RESULT, CombatInfo.ClientInteractResult) --[[counter = 0 for id, _ in pairs (Effects.CastBreakOnRemoveEvent) do counter = counter + 1 local eventName = (moduleName.. "LUIE_CI_CombatEventCastBreak" .. counter) eventManager:RegisterForEvent(eventName, EVENT_COMBAT_EVENT, CombatInfo.OnCombatEventSpecialFilters ) eventManager:AddFilterForEvent(eventName, EVENT_COMBAT_EVENT, REGISTER_FILTER_TARGET_COMBAT_UNIT_TYPE, COMBAT_UNIT_TYPE_PLAYER, REGISTER_FILTER_ABILITY_ID, id, REGISTER_FILTER_IS_ERROR, false, REGISTER_FILTER_COMBAT_RESULT, ACTION_RESULT_EFFECT_FADED) end]]-- end if CombatInfo.SV.ShowTriggered or CombatInfo.SV.ShowToggled or CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled then eventManager:RegisterForEvent(moduleName, EVENT_ACTION_SLOTS_ACTIVE_HOTBAR_UPDATED, CombatInfo.OnActiveHotbarUpdate) eventManager:RegisterForEvent(moduleName, EVENT_ACTION_SLOTS_ALL_HOTBARS_UPDATED, CombatInfo.OnSlotsFullUpdate) eventManager:RegisterForEvent(moduleName, EVENT_ACTION_SLOT_UPDATED, CombatInfo.OnSlotUpdated) end if CombatInfo.SV.ShowTriggered or CombatInfo.SV.ShowToggled then eventManager:RegisterForEvent(moduleName, EVENT_UNIT_DEATH_STATE_CHANGED, CombatInfo.OnDeath) eventManager:RegisterForEvent(moduleName, EVENT_TARGET_CHANGE, CombatInfo.OnTargetChange) eventManager:RegisterForEvent(moduleName, EVENT_RETICLE_TARGET_CHANGED, CombatInfo.OnReticleTargetChanged) eventManager:RegisterForEvent(moduleName, EVENT_ACTIVE_WEAPON_PAIR_CHANGED, CombatInfo.OnActiveWeaponPairChanged) eventManager:RegisterForEvent(moduleName, EVENT_GAMEPAD_PREFERRED_MODE_CHANGED, CombatInfo.BackbarSetupTemplate) eventManager:RegisterForEvent(moduleName, EVENT_INVENTORY_ITEM_USED, CombatInfo.InventoryItemUsed) -- Setup bar highlight CombatInfo.UpdateBarHighlightTables() end -- Have to register EVENT_EFFECT_CHANGED for werewolf as well - Stop devour cast bar when devour fades / also handles updating Vampire Ultimate cost on stage change if CombatInfo.SV.ShowTriggered or CombatInfo.SV.ShowToggled or CombatInfo.SV.CastBarEnable or CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled then eventManager:RegisterForEvent(moduleName, EVENT_EFFECT_CHANGED, CombatInfo.OnEffectChanged) end -- Display default UI ultimate text if the LUIE option is enabled. if CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled then SetSetting(SETTING_TYPE_UI, UI_SETTING_ULTIMATE_NUMBER, 0) end end function CombatInfo.ClearCustomList(list) local listRef = list == CombatInfo.SV.blacklist and GetString(SI_LUIE_CUSTOM_LIST_CASTBAR_BLACKLIST) or "" for k, v in pairs(list) do list[k] = nil end CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_CLEARED), listRef), true) end -- List Handling (Add) for Prominent Auras & Blacklist function CombatInfo.AddToCustomList(list, input) local id = tonumber(input) local listRef = list == CombatInfo.SV.blacklist and GetString(SI_LUIE_CUSTOM_LIST_CASTBAR_BLACKLIST) or "" if id and id > 0 then local name = zo_strformat("<<C:1>>", GetAbilityName(id)) if name ~= nil and name ~= "" then local icon = zo_iconFormat(GetAbilityIcon(id), 16, 16) list[id] = true CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_ADDED_ID), icon, id, name, listRef), true) else CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_ADDED_FAILED), input, listRef), true) end else if input ~= "" then list[input] = true CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_ADDED_NAME), input, listRef), true) end end end -- List Handling (Remove) for Prominent Auras & Blacklist function CombatInfo.RemoveFromCustomList(list, input) local id = tonumber(input) local listRef = list == CombatInfo.SV.blacklist and GetString(SI_LUIE_CUSTOM_LIST_CASTBAR_BLACKLIST) or "" if id and id > 0 then local name = zo_strformat("<<C:1>>", GetAbilityName(id)) local icon = zo_iconFormat(GetAbilityIcon(id), 16, 16) list[id] = nil CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_REMOVED_ID), icon, id, name, listRef), true) else if input ~= "" then list[input] = nil CHAT_SYSTEM:Maximize() CHAT_SYSTEM.primaryContainer:FadeIn() printToChat(zo_strformat(GetString(SI_LUIE_CUSTOM_LIST_REMOVED_NAME), input, listRef), true) end end end -- Used to populate abilities icons after the user has logged on function CombatInfo.OnPlayerActivated(eventCode) -- do not call this function for the second time eventManager:UnregisterForEvent(moduleName, EVENT_PLAYER_ACTIVATED ) -- Manually trigger event to update stats g_hotbarCategory = GetActiveHotbarCategory() CombatInfo.OnSlotsFullUpdate() for i = (BAR_INDEX_START + BACKBAR_INDEX_OFFSET), (BACKBAR_INDEX_END + BACKBAR_INDEX_OFFSET) do -- Update Bar Slots on initial load (don't want to do it normally when we do a slot update) CombatInfo.BarSlotUpdate(i, true, false) end CombatInfo.OnPowerUpdatePlayer(EVENT_POWER_UPDATE, "player", nil, POWERTYPE_ULTIMATE, GetUnitPower("player", POWERTYPE_ULTIMATE)) end local savedPlayerX = 0 local savedPlayerZ = 0 local playerX = 0 local playerZ = 0 -- Updates all floating labels. Called every 100ms function CombatInfo.OnUpdate(currentTime) -- Procs for k, v in pairs(g_triggeredSlotsRemain) do local remain = g_triggeredSlotsRemain[k] - currentTime -- If duration reaches 0 then remove effect if v < currentTime then if g_triggeredSlotsFront[k] and g_uiProcAnimation[g_triggeredSlotsFront[k]] then g_uiProcAnimation[g_triggeredSlotsFront[k]]:Stop() end if g_triggeredSlotsBack[k] and g_uiProcAnimation[g_triggeredSlotsBack[k]] then g_uiProcAnimation[g_triggeredSlotsBack[k]]:Stop() end g_triggeredSlotsRemain[k] = nil end -- Update Label (FRONT) if g_triggeredSlotsFront[k] and g_uiProcAnimation[g_triggeredSlotsFront[k]] and g_triggeredSlotsRemain[k] then if CombatInfo.SV.BarShowLabel then g_uiProcAnimation[g_triggeredSlotsFront[k]].procLoopTexture.label:SetText(FormatDurationSeconds(remain)) end end -- Update Label (BACK) if g_triggeredSlotsBack[k] and g_uiProcAnimation[g_triggeredSlotsBack[k]] and g_triggeredSlotsRemain[k] then if CombatInfo.SV.BarShowLabel then g_uiProcAnimation[g_triggeredSlotsBack[k]].procLoopTexture.label:SetText(FormatDurationSeconds(remain)) end end end -- Ability Highlight for k, v in pairs(g_toggledSlotsRemain) do local remain = g_toggledSlotsRemain[k] - currentTime -- If duration reaches 0 then remove effect if v < currentTime then if g_toggledSlotsFront[k] and g_uiCustomToggle[g_toggledSlotsFront[k]] then local slotNum = g_toggledSlotsFront[k] CombatInfo.HideSlot(slotNum, k) end if g_toggledSlotsBack[k] and g_uiCustomToggle[g_toggledSlotsBack[k]] then local slotNum = g_toggledSlotsBack[k] CombatInfo.HideSlot(slotNum, k) end g_toggledSlotsRemain[k] = nil g_toggledSlotsStack[k] = nil end -- Update Label (FRONT) if g_toggledSlotsFront[k] and g_uiCustomToggle[g_toggledSlotsFront[k]] and g_toggledSlotsRemain[k] then if g_toggledSlotsFront[k] == 8 and CombatInfo.SV.UltimatePctEnabled then uiUltimate.LabelPct:SetHidden(true) end if CombatInfo.SV.BarShowLabel then if not g_uiCustomToggle[g_toggledSlotsFront[k]] then return end g_uiCustomToggle[g_toggledSlotsFront[k]].label:SetText(FormatDurationSeconds(remain)) end end -- Update Label (BACK) if g_toggledSlotsBack[k] and g_uiCustomToggle[g_toggledSlotsBack[k]] and g_toggledSlotsRemain[k] then if g_toggledSlotsBack[k] == 8 and CombatInfo.SV.UltimatePctEnabled then uiUltimate.LabelPct:SetHidden(true) end if CombatInfo.SV.BarShowLabel then if not g_uiCustomToggle[g_toggledSlotsBack[k]] then return end g_uiCustomToggle[g_toggledSlotsBack[k]].label:SetText(FormatDurationSeconds(remain)) end end end -- Quickslot cooldown if CombatInfo.SV.PotionTimerShow then local slotIndex = GetCurrentQuickslot() local remain, duration, global = GetSlotCooldownInfo(slotIndex) -- Don't show unless potion is used - We have to counter for the GCD lockout from casting a spell here if (duration > 5000) then uiQuickSlot.label:SetHidden(false) if remain > 86400000 then -- more then 1 day uiQuickSlot.label:SetText( string.format("%d d", math.floor( remain/86400000 )) ) elseif remain > 6000000 then -- over 100 minutes - display XXh uiQuickSlot.label:SetText( string.format("%dh", math.floor( remain/3600000 )) ) elseif remain > 600000 then -- over 10 minutes - display XXm uiQuickSlot.label:SetText( string.format("%dm", math.floor( remain/60000 )) ) elseif remain > 60000 then local m = math.floor( remain/60000 ) local s = remain/1000 - 60*m uiQuickSlot.label:SetText( string.format("%d:%.2d", m, s) ) else uiQuickSlot.label:SetText(string.format(CombatInfo.SV.PotionTimerMiilis and "%.1f" or "%.1d", 0.001 * remain)) end for i = #(uiQuickSlot.timeColours), 1, -1 do if remain < uiQuickSlot.timeColours[i].remain then if CombatInfo.SV.PotionTimerColor then uiQuickSlot.label:SetColor(unpack(uiQuickSlot.timeColours[i].colour)) else uiQuickSlot.label:SetColor(1, 1, 1, 1) end break end end else uiQuickSlot.label:SetHidden(true) uiQuickSlot.label:SetColor(unpack(uiQuickSlot.colour)) end end -- Hide Ultimate generation texture if it is time to do so if CombatInfo.SV.UltimateGeneration then if not uiUltimate.Texture:IsHidden() and uiUltimate.FadeTime < currentTime then uiUltimate.Texture:SetHidden(true) end end -- Break castbar when block is used for certain effects. if not Castbar.IgnoreCastBreakingActions[castbar.id] then if IsBlockActive() then if not IsPlayerStunned() then -- Is Block Active returns true when the player is stunned currently. CombatInfo.StopCastBar() end end end -- Break castbar when movement interrupt is detected for certain effects. savedPlayerX = playerX savedPlayerZ = playerZ playerX, playerZ = GetMapPlayerPosition("player") if savedPlayerX == playerX and savedPlayerZ == playerZ then return else if Castbar.BreakCastOnMove[castbar.id] then CombatInfo.StopCastBar() end end end -- Run on the EVENT_GAME_CAMERA_UI_MODE_CHANGED handler function CombatInfo.OnGameCameraUIModeChanged(eventCode) if Castbar.BreakSiegeOnWindowOpen[castbar.id] then CombatInfo.StopCastBar() end end -- Run on the EVENT_END_SIEGE_CONTROL handler -- Used to break the cast for Stow Siege Weapon if the player exits siege control. function CombatInfo.OnSiegeEnd(eventCode) if castbar.id == 12256 then CombatInfo.StopCastBar() end end function CombatInfo.StopCastBar() local state = CombatInfo.CastBarUnlocked -- Don't hide the cast bar if we have it unlocked to move. castbar.bar.name:SetHidden(true) castbar.bar.timer:SetHidden(true) castbar:SetHidden(true) castbar.remain = nil castbar.starts = nil castbar.ends = nil g_casting = false eventManager:UnregisterForUpdate(moduleName .. "CastBar") if state then CombatInfo.GenerateCastbarPreview(state) end end -- Updates Cast Bar - only enabled when Cast Bar is unhidden function CombatInfo.OnUpdateCastbar(currentTime) -- Update castbar local castStarts = castbar.starts local castEnds = castbar.ends local remain = castbar.remain - currentTime if remain <= 0 then CombatInfo.StopCastBar() else if CombatInfo.SV.CastBarTimer then castbar.bar.timer:SetText(string.format("%.1f", remain / 1000)) end if castbar.type == 1 then castbar.bar.bar:SetValue((currentTime - castStarts) / (castEnds - castStarts)) else castbar.bar.bar:SetValue(1 - ((currentTime - castStarts) / (castEnds - castStarts))) end end end -- Updates local variables with new font function CombatInfo.ApplyFont() if not CombatInfo.Enabled then return end -- Setup Bar Font local barFontName = LUIE.Fonts[CombatInfo.SV.BarFontFace] if not barFontName or barFontName == "" then printToChat(GetString(SI_LUIE_ERROR_FONT), true) barFontName = "$(MEDIUM_FONT)" end local barFontStyle = (CombatInfo.SV.BarFontStyle and CombatInfo.SV.BarFontStyle ~= "") and CombatInfo.SV.BarFontStyle or "outline" local barFontSize = (CombatInfo.SV.BarFontSize and CombatInfo.SV.BarFontSize > 0) and CombatInfo.SV.BarFontSize or 17 g_barFont = barFontName .. "|" .. barFontSize .. "|" .. barFontStyle for k, _ in pairs(g_uiProcAnimation) do g_uiProcAnimation[k].procLoopTexture.label:SetFont(g_barFont) end for k, _ in pairs(g_uiCustomToggle) do g_uiCustomToggle[k].label:SetFont(g_barFont) g_uiCustomToggle[k].stack:SetFont(g_barFont) end -- Setup Potion Timer Font local potionFontName = LUIE.Fonts[CombatInfo.SV.PotionTimerFontFace] if not potionFontName or potionFontName == "" then printToChat(GetString(SI_LUIE_ERROR_FONT), true) potionFontName = "$(MEDIUM_FONT)" end local potionFontStyle = (CombatInfo.SV.PotionTimerFontStyle and CombatInfo.SV.PotionTimerFontStyle ~= "") and CombatInfo.SV.PotionTimerFontStyle or "outline" local potionFontSize = (CombatInfo.SV.PotionTimerFontSize and CombatInfo.SV.PotionTimerFontSize > 0) and CombatInfo.SV.PotionTimerFontSize or 17 g_potionFont = potionFontName .. "|" .. potionFontSize .. "|" .. potionFontStyle -- If QuickSlot is created, and we're updating font from the menu setting, set the font here. if uiQuickSlot.label then uiQuickSlot.label:SetFont(g_potionFont) end -- Setup Ultimate Font local ultimateFontName = LUIE.Fonts[CombatInfo.SV.UltimateFontFace] if not ultimateFontName or ultimateFontName == "" then printToChat(GetString(SI_LUIE_ERROR_FONT), true) ultimateFontName = "$(MEDIUM_FONT)" end local ultimateFontStyle = (CombatInfo.SV.UltimateFontStyle and CombatInfo.SV.UltimateFontStyle ~= "") and CombatInfo.SV.UltimateFontStyle or "outline" local ultimateFontSize = (CombatInfo.SV.UltimateFontSize and CombatInfo.SV.UltimateFontSize > 0) and CombatInfo.SV.UltimateFontSize or 17 g_ultimateFont = ultimateFontName .. "|" .. ultimateFontSize .. "|" .. ultimateFontStyle if uiUltimate.LabelPct then uiUltimate.LabelPct:SetFont(g_ultimateFont) end -- Setup Castbar Font local castbarFontName = LUIE.Fonts[CombatInfo.SV.CastBarFontFace] if not castbarFontName or castbarFontName == "" then printToChat(GetString(SI_LUIE_ERROR_FONT), true) castbarFontName = "$(MEDIUM_FONT)" end local castbarFontStyle = (CombatInfo.SV.CastBarFontStyle and CombatInfo.SV.CastBarFontStyle ~= "") and CombatInfo.SV.CastBarFontStyle or "soft-shadow-thin" local castbarFontSize = (CombatInfo.SV.CastBarFontSize and CombatInfo.SV.CastBarFontSize > 0) and CombatInfo.SV.CastBarFontSize or 16 g_castbarFont = castbarFontName .. "|" .. castbarFontSize .. "|" .. castbarFontStyle end -- Updates Proc Sound - called on initialization and menu changes function CombatInfo.ApplyProcSound(menu) local barProcSound = LUIE.Sounds[CombatInfo.SV.ProcSoundName] if not barProcSound or barProcSound == "" then printToChat(GetString(SI_LUIE_ERROR_SOUND), true) barProcSound = "DeathRecap_KillingBlowShown" end g_procSound = barProcSound if menu then PlaySound(g_procSound) end end -- Resets the ultimate labels on menu option change function CombatInfo.ResetUltimateLabel() uiUltimate.LabelPct:ClearAnchors() local actionButton = ZO_ActionBar_GetButton(8) uiUltimate.LabelPct:SetAnchor(TOPLEFT, actionButton.slot) uiUltimate.LabelPct:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.UltimateLabelPosition) end -- Resets bar labels on menu option change function CombatInfo.ResetBarLabel() for k, _ in pairs(g_uiProcAnimation) do g_uiProcAnimation[k].procLoopTexture.label:SetText("") end for k, _ in pairs(g_uiCustomToggle) do g_uiCustomToggle[k].label:SetText("") end for i = BAR_INDEX_START, BAR_INDEX_END do -- Clear base action bars local actionButton = ZO_ActionBar_GetButton(i) if g_uiCustomToggle[i] then g_uiCustomToggle[i].label:ClearAnchors() g_uiCustomToggle[i].label:SetAnchor(TOPLEFT, actionButton.slot) g_uiCustomToggle[i].label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) elseif g_uiProcAnimation[i] then g_uiProcAnimation[i].procLoopTexture.label:ClearAnchors() g_uiProcAnimation[i].procLoopTexture.label:SetAnchor(TOPLEFT, actionButton.slot) g_uiProcAnimation[i].procLoopTexture.label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) end local backIndex = i + BACKBAR_INDEX_OFFSET local actionButton = g_backbarButtons[backIndex] if g_uiCustomToggle[backIndex] then g_uiCustomToggle[backIndex].label:ClearAnchors() g_uiCustomToggle[backIndex].label:SetAnchor(TOPLEFT, actionButton.slot) g_uiCustomToggle[backIndex].label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) elseif g_uiProcAnimation[backIndex] then g_uiProcAnimation[backIndex].procLoopTexture.label:ClearAnchors() g_uiProcAnimation[backIndex].procLoopTexture.label:SetAnchor(TOPLEFT, actionButton.slot) g_uiProcAnimation[backIndex].procLoopTexture.label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) end end end -- Resets Potion Timer label - called on initialization and menu changes function CombatInfo.ResetPotionTimerLabel() local actionButton = ZO_ActionBar_GetButton(9) uiQuickSlot.label:ClearAnchors() uiQuickSlot.label:SetAnchor(TOPLEFT, actionButton.slot) uiQuickSlot.label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.PotionTimerLabelPosition) end -- Runs on the EVENT_TARGET_CHANGE listener. -- This handler fires every time the someone target changes. -- This function is needed in case the player teleports via Way Shrine function CombatInfo.OnTargetChange(eventCode, unitTag) if unitTag ~= "player" then return end CombatInfo.OnReticleTargetChanged(eventCode) end -- Runs on the EVENT_RETICLE_TARGET_CHANGED listener. -- This handler fires every time the player's reticle target changes function CombatInfo.OnReticleTargetChanged(eventCode) local unitTag = "reticleover" for k, v in pairs(g_toggledSlotsRemain) do if ( (g_toggledSlotsFront[k] and g_uiCustomToggle[g_toggledSlotsFront[k]]) or (g_toggledSlotsBack[k] and g_uiCustomToggle[g_toggledSlotsBack[k]]) ) and not (g_toggledSlotsPlayer[k] or g_barNoRemove[k]) then if (g_toggledSlotsFront[k] and g_uiCustomToggle[g_toggledSlotsFront[k]]) then local slotNum = g_toggledSlotsFront[k] CombatInfo.HideSlot(slotNum, k) end if (g_toggledSlotsBack[k] and g_uiCustomToggle[g_toggledSlotsBack[k]]) then local slotNum = g_toggledSlotsBack[k] CombatInfo.HideSlot(slotNum, k) end g_toggledSlotsRemain[k] = nil g_toggledSlotsStack[k] = nil if Effects.BarHighlightCheckOnFade[k] then CombatInfo.BarHighlightSwap(k) end end end if DoesUnitExist("reticleover") then -- Fill it again for i = 1, GetNumBuffs(unitTag) do local unitName = GetRawUnitName(unitTag) local buffName, timeStarted, timeEnding, buffSlot, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, abilityId, canClickOff, castByPlayer = GetUnitBuffInfo(unitTag, i) -- Convert boolean to number value if cast by player if castByPlayer == true then castByPlayer = 1 else castByPlayer = 5 end if not IsUnitDead(unitTag) then CombatInfo.OnEffectChanged(0, EFFECT_RESULT_UPDATED, buffSlot, buffName, unitTag, timeStarted, timeEnding, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, unitName, 0, abilityId, castByPlayer) end end end end -- Iterate until we find the buff we're looking for, if it's present, then send a dummy event using the duration info from that buff but the id from the original ability. function CombatInfo.BarHighlightSwap(abilityId) local id1 = Effects.BarHighlightCheckOnFade[abilityId].id1 or 0 local id2 = Effects.BarHighlightCheckOnFade[abilityId].id2 or 0 local id3 = Effects.BarHighlightCheckOnFade[abilityId].id3 or 0 local unitTag = Effects.BarHighlightCheckOnFade[abilityId].unitTag local id2Tag = Effects.BarHighlightCheckOnFade[abilityId].id2Tag local id3Tag = Effects.BarHighlightCheckOnFade[abilityId].id3Tag local duration = Effects.BarHighlightCheckOnFade[abilityId].duration or 0 local durationMod = Effects.BarHighlightCheckOnFade[abilityId].durationMod or 0 -- If the unitTag doesn't exist, bail out here if not DoesUnitExist(unitTag) then return end -- If we have a fake duration assigned, use that if duration > 0 then duration = (GetAbilityDuration(duration) - GetAbilityDuration(durationMod) ) local timeStarted = GetGameTimeSeconds() local timeEnding = timeStarted + ( duration / 1000 ) -- Fill in set values here since we know this is a fake self aura if we have a fake duration CombatInfo.OnEffectChanged(nil, EFFECT_RESULT_GAINED, nil, nil, unitTag, timeStarted, timeEnding, 0, nil, nil, 1, ABILITY_TYPE_BONUS, 0, nil, nil, abilityId, 1, true) return end -- Id's serve as a priority system, if we find an id then we process it and this function returns. -- It's important we check that the id both exists and is castByPlayer, in the case of 2 of the same id being present with one not cast by the player. -- Iterate through buffs and look for id1 if it exists if id1 ~= 0 then for i = 1, GetNumBuffs(unitTag) do local buffName, timeStarted, timeEnding, buffSlot, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, abilityIdNew, canClickOff, castByPlayer = GetUnitBuffInfo(unitTag, i) if id1 == abilityIdNew then -- Only send an event if castByPlayer is true if castByPlayer == true then CombatInfo.OnEffectChanged(nil, EFFECT_RESULT_GAINED, nil, nil, unitTag, timeStarted, timeEnding, stackCount, nil, buffType, effectType, abilityType, statusEffectType, nil, nil, abilityId, 1, true) return end end end end -- Swap tag here for id2 checking if id2Tag then unitTag = id2Tag end -- Only iterate again if there is a second ID to look for if id2 ~= 0 then for i = 1, GetNumBuffs(unitTag) do local buffName, timeStarted, timeEnding, buffSlot, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, abilityIdNew, canClickOff, castByPlayer = GetUnitBuffInfo(unitTag, i) if id2 == abilityIdNew then if castByPlayer == true then CombatInfo.OnEffectChanged(nil, EFFECT_RESULT_GAINED, nil, nil, unitTag, timeStarted, timeEnding, stackCount, nil, buffType, effectType, abilityType, statusEffectType, nil, nil, abilityId, 1, true) return end end end end -- Swap tag here for id2 checking if id3Tag then unitTag = id2Tag end -- Only iterate again if there is a third ID to look for if id3 ~= 0 then for i = 1, GetNumBuffs(unitTag) do local buffName, timeStarted, timeEnding, buffSlot, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, abilityIdNew, canClickOff, castByPlayer = GetUnitBuffInfo(unitTag, i) if id3 == abilityIdNew then if castByPlayer == true then CombatInfo.OnEffectChanged(nil, EFFECT_RESULT_GAINED, nil, nil, unitTag, timeStarted, timeEnding, stackCount, nil, buffType, effectType, abilityType, statusEffectType, nil, nil, abilityId, 1, true) return end end end end end function CombatInfo.OnEffectChanged(eventCode, changeType, effectSlot, effectName, unitTag, beginTime, endTime, stackCount, iconName, buffType, effectType, abilityType, statusEffectType, unitName, unitId, abilityId, castByPlayer, passThrough) -- If we're displaying a fake bar highlight then bail out here (sometimes we need a fake aura that doesn't end to simulate effects that can be overwritten, such as Major/Minor buffs. Technically we don't want to stop the -- highlight of the original ability since we can only track one buff per slot and overwriting the buff with a longer duration buff shouldn't throw the player off by making the glow disappear earlier. if g_barFakeAura[abilityId] and not passThrough then return end -- Bail out if this effect wasn't cast by the player. if castByPlayer ~= COMBAT_UNIT_TYPE_PLAYER then return end -- Update ultimate label on vampire stage change. if Effects.IsVamp[abilityId] and changeType == EFFECT_RESULT_GAINED then CombatInfo.UpdateUltimateLabel() end if Castbar.CastBreakOnRemoveEffect[abilityId] and changeType == EFFECT_RESULT_FADED then CombatInfo.StopCastBar() if abilityId == 33208 then -- Devour (Werewolf) return end end -- If this effect is on the player than as long as it remains it won't fade when we mouseover another target. if unitTag == "player" then if changeType ~= EFFECT_RESULT_FADED then g_toggledSlotsPlayer[abilityId] = true else g_toggledSlotsPlayer[abilityId] = nil end end if (Effects.EffectGroundDisplay[abilityId] or Effects.LinkedGroundMine[abilityId]) and not passThrough then if Effects.LinkedGroundMine[abilityId] then abilityId = Effects.LinkedGroundMine[abilityId] end if changeType == EFFECT_RESULT_FADED then if abilityId == 32958 then return end -- Ignore Shifting Standard local currentTime = GetGameTimeMilliseconds() if not g_protectAbilityRemoval[abilityId] or g_protectAbilityRemoval[abilityId] < currentTime then if (Effects.IsGroundMineAura[abilityId] or Effects.IsGroundMineStack[abilityId]) then if g_mineStacks[abilityId] then g_mineStacks[abilityId] = g_mineStacks[abilityId] - Effects.EffectGroundDisplay[abilityId].stackRemove -- Set Stacks label if changed if CombatInfo.SV.BarShowLabel then if g_toggledSlotsFront[abilityId] and g_uiCustomToggle[g_toggledSlotsFront[abilityId]] then if not Effects.HideGroundMineStacks[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] if g_uiCustomToggle[slotNum] then if g_mineStacks[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_mineStacks[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end end if g_toggledSlotsBack[abilityId] and g_uiCustomToggle[g_toggledSlotsBack[abilityId]] then if not Effects.HideGroundMineStacks[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] if g_uiCustomToggle[slotNum] then if g_mineStacks[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_mineStacks[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end end end -- Handle stacks reaching 0 if g_mineStacks[abilityId] == 0 and not g_mineNoTurnOff[abilityId] then if g_toggledSlotsRemain[abilityId] then if g_toggledSlotsFront[abilityId] and g_uiCustomToggle[g_toggledSlotsFront[abilityId]] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end if g_toggledSlotsBack[abilityId] and g_uiCustomToggle[g_toggledSlotsBack[abilityId]] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end end g_toggledSlotsRemain[abilityId] = nil g_toggledSlotsStack[abilityId] = nil if Effects.BarHighlightCheckOnFade[abilityId] then CombatInfo.BarHighlightSwap(abilityId) end end end else -- Ignore fading event if override is true if g_barNoRemove[abilityId] then return end -- Stop any toggle animation associated with this effect if g_toggledSlotsRemain[abilityId] then if g_toggledSlotsFront[abilityId] and g_uiCustomToggle[g_toggledSlotsFront[abilityId]] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end if g_toggledSlotsBack[abilityId] and g_uiCustomToggle[g_toggledSlotsBack[abilityId]] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end end g_toggledSlotsRemain[abilityId] = nil g_toggledSlotsStack[abilityId] = nil end end elseif changeType == EFFECT_RESULT_GAINED then if g_mineNoTurnOff[abilityId] then g_mineNoTurnOff[abilityId] = nil end local currentTime = GetGameTimeMilliseconds() g_protectAbilityRemoval[abilityId] = currentTime + 150 if Effects.IsGroundMineAura[abilityId] then g_mineStacks[abilityId] = Effects.EffectGroundDisplay[abilityId].stackReset elseif Effects.IsGroundMineStack[abilityId] then -- Check if this is an existing mine with stacks if g_mineStacks[abilityId] then g_mineStacks[abilityId] = g_mineStacks[abilityId] + Effects.EffectGroundDisplay[abilityId].stackRemove -- Otherwise set the count to 1 else g_mineStacks[abilityId] = 1 end -- If the stack counter is higher than a manual limit we set then override it to that value if g_mineStacks[abilityId] > Effects.EffectGroundDisplay[abilityId].stackReset then g_mineStacks[abilityId] = Effects.EffectGroundDisplay[abilityId].stackReset end end -- Bar Tracker if CombatInfo.SV.ShowToggled then -- We set this to true but never set remove it, this is effectively an on the fly way to create an indentifier for ground effects that shouldn't be removed on reticle target change, only on fade. g_toggledSlotsPlayer[abilityId] = true local currentTime = GetGameTimeMilliseconds() if g_toggledSlotsFront[abilityId] or g_toggledSlotsBack[abilityId] then g_toggledSlotsRemain[abilityId] = 1000 * endTime g_toggledSlotsStack[abilityId] = stackCount if g_toggledSlotsFront[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end if g_toggledSlotsBack[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end end end end end -- Hijack the abilityId here if we have it in the override for extra bar highlights if Effects.BarHighlightExtraId[abilityId] then for k, v in pairs(Effects.BarHighlightExtraId) do if k == abilityId then abilityId = v if Effects.IsGroundMineAura[abilityId] then -- This prevents debuffs from ground mines from not fading when mouseover is changed. g_toggledSlotsPlayer[abilityId] = nil if unitTag == "reticleover" then g_mineNoTurnOff[abilityId] = true end end break end end end if unitTag ~= "player" and unitTag ~= "reticleover" then return end if changeType == EFFECT_RESULT_FADED then -- delete Effect -- Remove stacks when Grim Focus ends if isStackCounter[abilityId] then for k, v in pairs(isStackBaseAbility) do g_toggledSlotsStack[k] = nil if g_toggledSlotsFront[k] or g_toggledSlotsBack[k] then if CombatInfo.SV.ShowToggled and CombatInfo.SV.BarShowLabel then if g_toggledSlotsFront[k] then local slotNum = g_toggledSlotsFront[k] if g_uiCustomToggle[slotNum] then g_uiCustomToggle[slotNum].stack:SetText("") end end if g_toggledSlotsBack[k] then local slotNum = g_toggledSlotsBack[k] if g_uiCustomToggle[slotNum] then g_uiCustomToggle[slotNum].stack:SetText("") end end end end end end -- Ignore fading event if override is true if g_barNoRemove[abilityId] then if Effects.BarHighlightCheckOnFade[abilityId] then CombatInfo.BarHighlightSwap(abilityId) end return end -- Stop any proc animation associated with this effect if g_triggeredSlotsRemain[abilityId] then if g_triggeredSlotsFront[abilityId] and g_uiProcAnimation[g_triggeredSlotsFront[abilityId]] then g_uiProcAnimation[g_triggeredSlotsFront[abilityId]]:Stop() end if g_triggeredSlotsBack[abilityId] and g_uiProcAnimation[g_triggeredSlotsBack[abilityId]] then g_uiProcAnimation[g_triggeredSlotsBack[abilityId]]:Stop() end g_triggeredSlotsRemain[abilityId] = nil end -- Stop any toggle animation associated with this effect if g_toggledSlotsRemain[abilityId] then if g_toggledSlotsFront[abilityId] and g_uiCustomToggle[g_toggledSlotsFront[abilityId]] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end if g_toggledSlotsBack[abilityId] and g_uiCustomToggle[g_toggledSlotsBack[abilityId]] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end g_toggledSlotsRemain[abilityId] = nil -- Don't modify stacks for Grim Focus since we use the actual stack ids to handle this if not isStackBaseAbility[abilityId] then g_toggledSlotsStack[abilityId] = nil end end if Effects.BarHighlightCheckOnFade[abilityId] then CombatInfo.BarHighlightSwap(abilityId) end else -- Also create visual enhancements from skill bar -- Handle proc sound for Bound Armaments if abilityId == 130293 then if CombatInfo.SV.ShowTriggered and CombatInfo.SV.ProcEnableSound then if stackCount ~= 4 then g_boundArmamentsPlayed = false end if stackCount == 4 and not g_boundArmamentsPlayed then PlaySound(g_procSound) PlaySound(g_procSound) g_boundArmamentsPlayed = true end end end -- start any proc animation associated with this effect if g_triggeredSlotsFront[abilityId] or g_triggeredSlotsBack[abilityId] then local currentTime = GetGameTimeMilliseconds() if CombatInfo.SV.ShowTriggered then -- Play sound twice so its a little louder. if CombatInfo.SV.ProcEnableSound and unitTag == "player" and g_triggeredSlotsFront[abilityId] then if abilityId == 46327 then if changeType == EFFECT_RESULT_GAINED then PlaySound(g_procSound) PlaySound(g_procSound) end else PlaySound(g_procSound) PlaySound(g_procSound) end end g_triggeredSlotsRemain[abilityId] = 1000 * endTime local remain = g_triggeredSlotsRemain[abilityId] - currentTime -- Front if g_triggeredSlotsFront[abilityId] then CombatInfo.PlayProcAnimations(g_triggeredSlotsFront[abilityId]) if CombatInfo.SV.BarShowLabel and g_uiProcAnimation[g_triggeredSlotsFront[abilityId]] then g_uiProcAnimation[g_triggeredSlotsFront[abilityId]].procLoopTexture.label:SetText(FormatDurationSeconds(remain)) end end -- Back if g_triggeredSlotsBack[abilityId] then CombatInfo.PlayProcAnimations(g_triggeredSlotsBack[abilityId]) if CombatInfo.SV.BarShowLabel and g_uiProcAnimation[g_triggeredSlotsBack[abilityId]] then g_uiProcAnimation[g_triggeredSlotsBack[abilityId]].procLoopTexture.label:SetText(FormatDurationSeconds(remain)) end end end end -- Display active effects if g_toggledSlotsFront[abilityId] or g_toggledSlotsBack[abilityId] then local currentTime = GetGameTimeMilliseconds() if CombatInfo.SV.ShowToggled then g_toggledSlotsRemain[abilityId] = 1000 * endTime -- Don't modify stacks for Grim Focus since we use the actual stack ids to handle this if not isStackBaseAbility[abilityId] then g_toggledSlotsStack[abilityId] = stackCount end if g_toggledSlotsFront[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end if g_toggledSlotsBack[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end end end -- Set stack count when Grim Focus duration buff changes if isStackCounter[abilityId] then for i = 1, GetNumBuffs(unitTag) do local _, _, _, _, _, _, _, _, _, _, abilityId = GetUnitBuffInfo(unitTag, i) if isStackBaseAbility[abilityId] then g_toggledSlotsStack[abilityId] = stackCount if g_toggledSlotsFront[abilityId] or g_toggledSlotsBack[abilityId] then if CombatInfo.SV.ShowToggled and CombatInfo.SV.BarShowLabel then if g_toggledSlotsFront[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] if g_uiCustomToggle[slotNum] then if g_toggledSlotsStack[abilityId] and g_toggledSlotsStack[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_toggledSlotsStack[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end if g_toggledSlotsBack[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] if g_uiCustomToggle[slotNum] then if g_toggledSlotsStack[abilityId] and g_toggledSlotsStack[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_toggledSlotsStack[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end end end end end end end end function CombatInfo.HideSlot(slotNum, abilityId) g_uiCustomToggle[slotNum]:SetHidden(true) if slotNum > BACKBAR_INDEX_OFFSET then if slotNum ~= BAR_INDEX_END + BACKBAR_INDEX_OFFSET then CombatInfo.BackbarHideSlot(slotNum) CombatInfo.ToggleBackbarSaturation(slotNum, CombatInfo.SV.BarDarkUnused) end end if slotNum == 8 and CombatInfo.SV.UltimatePctEnabled and IsSlotUsed(g_ultimateSlot) then uiUltimate.LabelPct:SetHidden(false) end end function CombatInfo.ShowSlot(slotNum, abilityId, currentTime, desaturate) CombatInfo.ShowCustomToggle(slotNum) if slotNum > BACKBAR_INDEX_OFFSET then if slotNum ~= BAR_INDEX_END + BACKBAR_INDEX_OFFSET then CombatInfo.BackbarShowSlot(slotNum) CombatInfo.ToggleBackbarSaturation(slotNum, desaturate) end end if slotNum == 8 and CombatInfo.SV.UltimatePctEnabled then uiUltimate.LabelPct:SetHidden(true) end if CombatInfo.SV.BarShowLabel then if not g_uiCustomToggle[slotNum] then return end local remain = g_toggledSlotsRemain[abilityId] - currentTime g_uiCustomToggle[slotNum].label:SetText(FormatDurationSeconds(remain)) if g_toggledSlotsStack[abilityId] and g_toggledSlotsStack[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_toggledSlotsStack[abilityId]) elseif g_mineStacks[abilityId] and g_mineStacks[abilityId] > 0 then if not Effects.HideGroundMineStacks[abilityId] then -- No stack for Time Freeze g_uiCustomToggle[slotNum].stack:SetText(g_mineStacks[abilityId]) end else g_uiCustomToggle[slotNum].stack:SetText("") end end end function CombatInfo.BackbarHideSlot(slotNum) if CombatInfo.SV.BarHideUnused then if g_backbarButtons[slotNum] then g_backbarButtons[slotNum].slot:SetHidden(true) end end end function CombatInfo.BackbarShowSlot(slotNum) -- Unhide the slot if CombatInfo.SV.BarShowBack then if g_backbarButtons[slotNum] then g_backbarButtons[slotNum].slot:SetHidden(false) end end end function CombatInfo.ToggleBackbarSaturation(slotNum, desaturate) local button = g_backbarButtons[slotNum] if CombatInfo.SV.BarDarkUnused then ZO_ActionSlot_SetUnusable(button.icon, desaturate, false) end if CombatInfo.SV.BarDesaturateUnused then local saturation = desaturate and 1 or 0 button.icon:SetDesaturation(saturation) end end -- Called on initialization and when swapping in and out of Gamepad mode function CombatInfo.BackbarSetupTemplate() local style = IsInGamepadPreferredMode() and GAMEPAD_CONSTANTS or KEYBOARD_CONSTANTS local weaponSwapControl = ACTION_BAR:GetNamedChild('WeaponSwap') -- Set positions for new buttons, modified from actionbar.lua - function ApplyStyle(style) ) local lastButton local buttonTemplate = ZO_GetPlatformTemplate('ZO_ActionButton') local ultimateTemplate = ZO_GetPlatformTemplate('ZO_UltimateActionButton') for i = BAR_INDEX_START, BAR_INDEX_END do -- Get our backbar button local targetButton = g_backbarButtons[i + BACKBAR_INDEX_OFFSET] -- Normal slots if i > 2 and i < 8 then local anchorTarget = lastButton and lastButton.slot if not lastButton then anchorTarget = weaponSwapControl end targetButton:ApplyAnchor(anchorTarget, style.abilitySlotOffsetX) targetButton:ApplyStyle(buttonTemplate) -- Ultimate slot --elseif i == 8 then -- targetButton:ApplyStyle(ultimateTemplate) -- targetButton:ApplyAnchor(lastButton.slot, style.ultimateSlotOffsetX) end lastButton = targetButton end -- Anchor the backbar to the normal action bar with spacing local offsetY = IsInGamepadPreferredMode() and ACTION_BAR:GetHeight() * 1.6 or ACTION_BAR:GetHeight() ActionButton53:ClearAnchors() ActionButton53:SetAnchor(CENTER, ActionButton3, CENTER, 0, -(offsetY*0.8) ) end -- Called from the menu and on init function CombatInfo.BackbarToggleSettings() for i = BAR_INDEX_START, BACKBAR_INDEX_END do -- Get our backbar button local targetButton = g_backbarButtons[i + BACKBAR_INDEX_OFFSET] if CombatInfo.SV.BarShowBack and not CombatInfo.SV.BarHideUnused then targetButton.slot:SetHidden(false) end ZO_ActionSlot_SetUnusable(targetButton.icon, CombatInfo.SV.BarDarkUnused, false) local saturation = CombatInfo.SV.BarDesaturateUnused and 1 or 0 targetButton.icon:SetDesaturation(saturation) if CombatInfo.SV.BarHideUnused or not CombatInfo.SV.BarShowBack then targetButton.slot:SetHidden(true) end end end function CombatInfo.CreateCastBar() uiTlw.castBar = UI.TopLevel(nil, nil) uiTlw.castBar:SetDimensions(CombatInfo.SV.CastBarSizeW + CombatInfo.SV.CastBarIconSize + 4, CombatInfo.SV.CastBarSizeH) -- Setup Preview uiTlw.castBar.preview = UI.Backdrop(uiTlw.castBar, "fill", nil, nil, nil, true) uiTlw.castBar.previewLabel = UI.Label(uiTlw.castBar.preview, {CENTER,CENTER}, nil, nil, "ZoFontGameMedium", "Cast Bar", false) -- Callback used to hide anchor coords preview label on movement start local tlwOnMoveStart = function(self) eventManager:RegisterForUpdate(moduleName .. "PreviewMove", 200, function() self.preview.anchorLabel:SetText(zo_strformat("<<1>>, <<2>>", self:GetLeft(), self:GetTop())) end) end -- Callback used to save new position of frames local tlwOnMoveStop = function(self) eventManager:UnregisterForUpdate(moduleName .. "PreviewMove") CombatInfo.SV.CastbarOffsetX = self:GetLeft() CombatInfo.SV.CastbarOffsetY = self:GetTop() CombatInfo.SV.CastBarCustomPosition = { self:GetLeft(), self:GetTop() } end uiTlw.castBar:SetHandler("OnMoveStart", tlwOnMoveStart) uiTlw.castBar:SetHandler("OnMoveStop", tlwOnMoveStop) uiTlw.castBar.preview.anchorTexture = UI.Texture(uiTlw.castBar.preview, {TOPLEFT,TOPLEFT}, {16,16}, "/esoui/art/reticle/border_topleft.dds", DL_OVERLAY, false) uiTlw.castBar.preview.anchorTexture:SetColor(1, 1, 0, 0.9) uiTlw.castBar.preview.anchorLabel = UI.Label(uiTlw.castBar.preview, {BOTTOMLEFT,TOPLEFT,0,-1}, nil, {0,2}, "ZoFontGameSmall", "xxx, yyy", false) uiTlw.castBar.preview.anchorLabel:SetColor(1, 1, 0 , 1) uiTlw.castBar.preview.anchorLabel:SetDrawLayer(DL_OVERLAY) uiTlw.castBar.preview.anchorLabel:SetDrawTier(1) uiTlw.castBar.preview.anchorLabelBg = UI.Backdrop(uiTlw.castBar.preview.anchorLabel, "fill", nil, {0,0,0,1}, {0,0,0,1}, false) uiTlw.castBar.preview.anchorLabelBg:SetDrawLayer(DL_OVERLAY) uiTlw.castBar.preview.anchorLabelBg:SetDrawTier(0) local fragment = ZO_HUDFadeSceneFragment:New(uiTlw.castBar, 0, 0) sceneManager:GetScene("hud"):AddFragment(fragment) sceneManager:GetScene("hudui"):AddFragment(fragment) sceneManager:GetScene("siegeBar"):AddFragment(fragment) sceneManager:GetScene("siegeBarUI"):AddFragment(fragment) castbar = UI.Backdrop(uiTlw.castBar, nil, nil, {0,0,0,0.5}, {0,0,0,1}, false) castbar:SetAnchor(LEFT, uiTlw.castBar, LEFT) castbar.starts = 0 castbar.ends = 0 castbar.remain = 0 castbar:SetDimensions(CombatInfo.SV.CastBarIconSize, CombatInfo.SV.CastBarIconSize) castbar.back = UI.Texture(castbar, nil, nil, "/esoui/art/actionbar/abilityframe64_up.dds", nil, false) castbar.back:SetAnchor(TOPLEFT, castbar, TOPLEFT) castbar.back:SetAnchor(BOTTOMRIGHT, castbar, BOTTOMRIGHT) castbar.iconbg = UI.Texture(castbar, nil, nil, "/esoui/art/actionbar/abilityinset.dds", DL_CONTROLS, false) castbar.iconbg = UI.Backdrop(castbar, nil, nil, {0,0,0,0.9}, {0,0,0,0.9}, false) castbar.iconbg:SetDrawLevel(DL_CONTROLS) castbar.iconbg:SetAnchor(TOPLEFT, castbar, TOPLEFT, 3, 3) castbar.iconbg:SetAnchor(BOTTOMRIGHT, castbar, BOTTOMRIGHT, -3, -3) castbar.icon = UI.Texture(castbar, nil, nil, "/esoui/art/icons/icon_missing.dds", DL_CONTROLS, false) castbar.icon:SetAnchor(TOPLEFT, castbar, TOPLEFT, 3, 3) castbar.icon:SetAnchor(BOTTOMRIGHT, castbar, BOTTOMRIGHT, -3, -3) castbar.bar = { ["backdrop"] = UI.Backdrop(castbar, nil, {CombatInfo.SV.CastBarSizeW, CombatInfo.SV.CastBarSizeH}, nil, nil, false), ["bar"] = UI.StatusBar(castbar, nil, {CombatInfo.SV.CastBarSizeW-4, CombatInfo.SV.CastBarSizeH-4}, nil, false), ["name"] = UI.Label(castbar, nil, nil, nil, nil, g_castbarFont, false), ["timer"] = UI.Label(castbar, nil, nil, nil, nil, g_castbarFont, false), } castbar.id = 0 castbar.bar.backdrop:SetEdgeTexture("",8,2,2) castbar.bar.backdrop:SetDrawLayer(DL_BACKDROP) castbar.bar.backdrop:SetDrawLevel(1) castbar.bar.bar:SetMinMax(0, 1) castbar.bar.backdrop:SetCenterColor((0.1*.50), (0.1*.50), (0.1*.50), 0.75) castbar.bar.bar:SetGradientColors(0, 47/255, 130/255, 1, 82/255, 215/255, 1, 1) castbar.bar.backdrop:SetCenterColor((0.1*CombatInfo.SV.CastBarGradientC1[1]), (0.1*CombatInfo.SV.CastBarGradientC1[2]), (0.1*CombatInfo.SV.CastBarGradientC1[3]), 0.75) castbar.bar.bar:SetGradientColors(CombatInfo.SV.CastBarGradientC1[1], CombatInfo.SV.CastBarGradientC1[2], CombatInfo.SV.CastBarGradientC1[3], 1, CombatInfo.SV.CastBarGradientC2[1], CombatInfo.SV.CastBarGradientC2[2], CombatInfo.SV.CastBarGradientC2[3], 1) castbar.bar.backdrop:ClearAnchors() castbar.bar.backdrop:SetAnchor(LEFT, castbar, RIGHT, 4, 0) castbar.bar.timer:ClearAnchors() castbar.bar.timer:SetAnchor(RIGHT, castbar.bar.backdrop, RIGHT, -4, 0) castbar.bar.timer:SetHidden(true) castbar.bar.name:ClearAnchors() castbar.bar.name:SetAnchor(LEFT, castbar.bar.backdrop, LEFT, 4, 0) castbar.bar.name:SetHidden(true) castbar.bar.bar:SetTexture(LUIE.StatusbarTextures[CombatInfo.SV.CastBarTexture]) castbar.bar.bar:ClearAnchors() castbar.bar.bar:SetAnchor(CENTER, castbar.bar.backdrop, CENTER, 0, 0) castbar.bar.bar:SetAnchor(CENTER, castbar.bar.backdrop, CENTER, 0, 0) castbar.bar.timer:SetText("Timer") castbar.bar.name:SetText("Name") castbar:SetHidden(true) end function CombatInfo.ResizeCastBar() uiTlw.castBar:SetDimensions(CombatInfo.SV.CastBarSizeW + CombatInfo.SV.CastBarIconSize + 4, CombatInfo.SV.CastBarSizeH) castbar:ClearAnchors() castbar:SetAnchor(LEFT, uiTlw.castBar, LEFT) castbar:SetDimensions(CombatInfo.SV.CastBarIconSize, CombatInfo.SV.CastBarIconSize) castbar.bar.backdrop:SetDimensions(CombatInfo.SV.CastBarSizeW, CombatInfo.SV.CastBarSizeH) castbar.bar.bar:SetDimensions(CombatInfo.SV.CastBarSizeW-4, CombatInfo.SV.CastBarSizeH-4) castbar.bar.backdrop:ClearAnchors() castbar.bar.backdrop:SetAnchor(LEFT, castbar, RIGHT, 4, 0 ) castbar.bar.timer:ClearAnchors() castbar.bar.timer:SetAnchor(RIGHT, castbar.bar.backdrop, RIGHT, -4, 0) castbar.bar.name:ClearAnchors() castbar.bar.name:SetAnchor(LEFT, castbar.bar.backdrop, LEFT, 4, 0) castbar.bar.bar:ClearAnchors() castbar.bar.bar:SetAnchor(CENTER, castbar.bar.backdrop, CENTER, 0, 0) castbar.bar.bar:SetAnchor(CENTER, castbar.bar.backdrop, CENTER, 0, 0) CombatInfo.SetCastBarPosition() end function CombatInfo.UpdateCastBar() castbar.bar.name:SetFont(g_castbarFont) castbar.bar.timer:SetFont(g_castbarFont) castbar.bar.bar:SetTexture(LUIE.StatusbarTextures[CombatInfo.SV.CastBarTexture]) castbar.bar.backdrop:SetCenterColor((0.1*CombatInfo.SV.CastBarGradientC1[1]), (0.1*CombatInfo.SV.CastBarGradientC1[2]), (0.1*CombatInfo.SV.CastBarGradientC1[3]), 0.75) castbar.bar.bar:SetGradientColors(CombatInfo.SV.CastBarGradientC1[1], CombatInfo.SV.CastBarGradientC1[2], CombatInfo.SV.CastBarGradientC1[3], 1, CombatInfo.SV.CastBarGradientC2[1], CombatInfo.SV.CastBarGradientC2[2], CombatInfo.SV.CastBarGradientC2[3], 1) end function CombatInfo.ResetCastBarPosition() if not CombatInfo.Enabled then return end CombatInfo.SV.CastbarOffsetX = nil CombatInfo.SV.CastbarOffsetY = nil CombatInfo.SV.CastBarCustomPosition = nil CombatInfo.SetCastBarPosition() CombatInfo.SetMovingState(false) end function CombatInfo.SetCastBarPosition() if uiTlw.castBar and uiTlw.castBar:GetType() == CT_TOPLEVELCONTROL then uiTlw.castBar:ClearAnchors() if CombatInfo.SV.CastbarOffsetX ~= nil and CombatInfo.SV.CastbarOffsetY ~= nil then uiTlw.castBar:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CombatInfo.SV.CastbarOffsetX, CombatInfo.SV.CastbarOffsetY) else uiTlw.castBar:SetAnchor(CENTER, GuiRoot, CENTER, 0, 320) end end local savedPos = CombatInfo.SV.CastBarCustomPosition uiTlw.castBar.preview.anchorLabel:SetText((savedPos ~= nil and #savedPos == 2) and zo_strformat("<<1>>, <<2>>", savedPos[1], savedPos[2]) or "default") end function CombatInfo.SetMovingState(state) if not CombatInfo.Enabled then return end CombatInfo.CastBarUnlocked = state if uiTlw.castBar and uiTlw.castBar:GetType() == CT_TOPLEVELCONTROL then CombatInfo.GenerateCastbarPreview(state) uiTlw.castBar:SetMouseEnabled(state) uiTlw.castBar:SetMovable(state) end end -- Called by CombatInfo.SetMovingState from the menu as well as by CombatInfo.OnUpdateCastbar when preview is enabled function CombatInfo.GenerateCastbarPreview(state) local previewIcon = 'esoui/art/icons/icon_missing.dds' castbar.icon:SetTexture(previewIcon) if CombatInfo.SV.CastBarLabel then local previewName = "Test" castbar.bar.name:SetText(previewName) castbar.bar.name:SetHidden(not state) end if CombatInfo.SV.CastBarTimer then castbar.bar.timer:SetText(string.format("1.0")) castbar.bar.timer:SetHidden(not state) end castbar.bar.bar:SetValue(1) uiTlw.castBar.preview:SetHidden(not state) uiTlw.castBar:SetHidden(not state) castbar:SetHidden(not state) end --[[ function CombatInfo.ClientInteractResult(eventCode, result, interactTargetName) local function DisplayInteractCast(icon, name, duration) local currentTime = GetGameTimeMilliseconds() local endTime = currentTime + duration local remain = endTime - currentTime castbar.remain = endTime castbar.starts = currentTime castbar.ends = endTime castbar.icon:SetTexture(icon) castbar.type = 1 -- CAST castbar.bar.bar:SetValue(0) castbar.id = 999999 if CombatInfo.SV.CastBarLabel then castbar.bar.name:SetText(name) castbar.bar.name:SetHidden(false) end if CombatInfo.SV.CastBarTimer then castbar.bar.timer:SetText(string.format("%.1f", remain/1000)) castbar.bar.timer:SetHidden(false) end castbar:SetHidden(false) g_casting = true eventManager:RegisterForUpdate(moduleName .. "CastBar", 20, CombatInfo.OnUpdateCastbar) end -- If we succesfully interact then... if result == CLIENT_INTERACT_RESULT_SUCCESS then -- Check if the interact object name is in our table if Castbar.InteractCast[interactTargetName] then -- Get the map id and check if there is an entry for this id index = GetZoneId(GetCurrentMapZoneIndex()) if Castbar.InteractCast[interactTargetName][index] then local data = Castbar.InteractCast[interactTargetName][index] local icon = data.icon local name = data.name local duration = data.duration local delay = data.delay zo_callLater(function() DisplayInteractCast(icon, name, duration) end, delay) end end end end ]]-- function CombatInfo.SoulGemResurrectionStart(eventCode, durationMs) -- Just in case any other casts are present - stop them first CombatInfo.StopCastBar() -- Set all parameters and start cast bar local icon = 'esoui/art/icons/achievement_frostvault_death_challenge.dds' local name = Abilities.Innate_Soul_Gem_Resurrection local duration = durationMs local currentTime = GetGameTimeMilliseconds() local endTime = currentTime + duration local remain = endTime - currentTime castbar.remain = endTime castbar.starts = currentTime castbar.ends = endTime castbar.icon:SetTexture(icon) castbar.type = 1 -- CAST castbar.bar.bar:SetValue(0) if CombatInfo.SV.CastBarLabel then castbar.bar.name:SetText(name) castbar.bar.name:SetHidden(false) end if CombatInfo.SV.CastBarTimer then castbar.bar.timer:SetText(string.format("%.1f", remain/1000)) castbar.bar.timer:SetHidden(false) end castbar:SetHidden(false) g_casting = true eventManager:RegisterForUpdate(moduleName .. "CastBar", 20, CombatInfo.OnUpdateCastbar) end function CombatInfo.SoulGemResurrectionEnd(eventCode) CombatInfo.StopCastBar() end -- Very basic handler registered to only read CC events on the player function CombatInfo.OnCombatEventBreakCast(eventCode, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId) -- Some cast/channel abilities (or effects we use to simulate this) stun the player - ignore the effects of these ids when this happens. if Castbar.IgnoreCastBarStun[abilityId] then return end if Castbar.IgnoreCastBreakingActions[castbar.id] then return end if not Castbar.IsCast[abilityId] then CombatInfo.StopCastBar() end end -- Listens to EVENT_COMBAT_EVENT function CombatInfo.OnCombatEvent(eventCode, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId) -- Track ultimate generation when we block an attack or hit a target with a light/medium/heavy attack. if CombatInfo.SV.UltimateGeneration and uiUltimate.NotFull and ( ( result == ACTION_RESULT_BLOCKED_DAMAGE and targetType == COMBAT_UNIT_TYPE_PLAYER ) or ( Effects.IsWeaponAttack[abilityName] and sourceType == COMBAT_UNIT_TYPE_PLAYER and targetName ~= "" ) ) then uiUltimate.Texture:SetHidden(false) uiUltimate.FadeTime = GetGameTimeMilliseconds() + 8000 end -- Bail out past here if the source isn't player, cast bar is disabled, or the ability is not on the list of abilities to show the cast bar for if sourceType ~= COMBAT_UNIT_TYPE_PLAYER and not Castbar.CastOverride[abilityId] then return end if not CombatInfo.SV.CastBarEnable then return end -- Stop when a cast breaking action is detected if Castbar.CastBreakingActions[abilityId] then if not Castbar.IgnoreCastBreakingActions[castbar.id] then CombatInfo.StopCastBar() end end if not Castbar.IsCast[abilityId] then return end local icon = GetAbilityIcon(abilityId) local name = zo_strformat("<<C:1>>", GetAbilityName(abilityId)) -- Return if ability is blacklisted if CombatInfo.SV.blacklist[abilityId] or CombatInfo.SV.blacklist[name] then return end local duration local channeled, castTime, channelTime = GetAbilityCastInfo(abilityId) local forceChanneled = false -- Override certain things to display as a channel rather than cast. Note only works for events where we override the duration. if Castbar.CastChannelOverride[abilityId] then channeled = true end if channeled then duration = Castbar.CastDurationFix[abilityId] or channelTime else duration = Castbar.CastDurationFix[abilityId] or castTime end -- End the cast bar and restart if a new begin event is detected and the effect isn't a channel or fake cast if result == ACTION_RESULT_BEGIN and not channeled and not Castbar.CastDurationFix[abilityId] then CombatInfo.StopCastBar() elseif result == ACTION_RESULT_EFFECT_GAINED and channeled then CombatInfo.StopCastBar() end if Castbar.CastChannelConvert[abilityId] then channeled = true forceChanneled = true duration = Castbar.CastDurationFix[abilityId] or castTime end -- Some abilities cast into a channeled stun effect - we want these abilities to display the cast and channel if flagged. -- Only flags on ACTION_RESULT_BEGIN so this won't interfere with the stun result that is converted to dissplay a channeled cast. if Castbar.MultiCast[abilityId] then if result == 2200 then channeled = false duration = castTime or 0 elseif result == 2240 then CombatInfo.StopCastBar() -- Stop the cast bar when the GAINED event happens so that we can display the channel when the cast ends end end if abilityId == 39033 or abilityId == 39477 then local skillType, skillIndex, abilityIndex, morphChoice, rankIndex = GetSpecificSkillAbilityKeysByAbilityId(32455) name, icon = GetSkillAbilityInfo(skillType, skillIndex, abilityIndex) if abilityId == 39477 then name = zo_strformat("<<1>> <<2>>", Abilities.Skill_Remove, name) end end if duration > 0 and not g_casting then -- If action result is BEGIN and not channeled then start, otherwise only use GAINED if (not forceChanneled and (((result == 2200 or result == 2210) and not channeled) or (result == 2240 and (Castbar.CastDurationFix[abilityId] or channeled)))) or (forceChanneled and result == 2200) then -- and CombatInfo.SV.CastBarCast local currentTime = GetGameTimeMilliseconds() local endTime = currentTime + duration local remain = endTime - currentTime castbar.remain = endTime castbar.starts = currentTime castbar.ends = endTime castbar.icon:SetTexture(icon) castbar.id = abilityId if channeled then castbar.type = 2 -- CHANNEL castbar.bar.bar:SetValue(1) else castbar.type = 1 -- CAST castbar.bar.bar:SetValue(0) end if CombatInfo.SV.CastBarLabel then castbar.bar.name:SetText(name) castbar.bar.name:SetHidden(false) end if CombatInfo.SV.CastBarTimer then castbar.bar.timer:SetText(string.format("%.1f", remain / 1000)) castbar.bar.timer:SetHidden(false) end castbar:SetHidden(false) g_casting = true eventManager:RegisterForUpdate(moduleName .. "CastBar", 20, CombatInfo.OnUpdateCastbar) end end -- Fix to lower the duration of the next cast of Profane Symbol quest ability for Scion of the Blood Matron (Vampire) if abilityId == 39507 then zo_callLater(function() Castbar.CastDurationFix[39507] = 19500 end, 5000) end end --[[ function CombatInfo.OnCombatEventSpecialFilters(eventCode, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId) CombatInfo.StopCastBar() end ]]-- function CombatInfo.OnCombatEventBar(eventCode, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId) -- If the source/target isn't the player then bail out now. if sourceType ~= COMBAT_UNIT_TYPE_PLAYER and targetType ~= COMBAT_UNIT_TYPE_PLAYER then return end if sourceType == COMBAT_UNIT_TYPE_PLAYER and targetType == COMBAT_UNIT_TYPE_PLAYER then g_toggledSlotsPlayer[abilityId] = true end -- Special handling for Crystallized Shield + Morphs if abilityId == 92068 or abilityId == 92168 or abilityId == 92170 then -- Make sure this event occured on the player only. If we hit another Warden's shield we don't want to change stack count. if result == ACTION_RESULT_DAMAGE_SHIELDED and targetType == COMBAT_UNIT_TYPE_PLAYER then if g_toggledSlotsFront[abilityId] or g_toggledSlotsBack[abilityId] then -- Reduce stack by one if g_toggledSlotsStack[abilityId] then g_toggledSlotsStack[abilityId] = g_toggledSlotsStack[abilityId] -1 end if g_toggledSlotsFront[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] if g_uiCustomToggle[slotNum] then if g_toggledSlotsStack[abilityId] and g_toggledSlotsStack[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_toggledSlotsStack[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end if g_toggledSlotsBack[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] if g_uiCustomToggle[slotNum] then if g_toggledSlotsStack[abilityId] and g_toggledSlotsStack[abilityId] > 0 then g_uiCustomToggle[slotNum].stack:SetText(g_toggledSlotsStack[abilityId]) else g_uiCustomToggle[slotNum].stack:SetText("") end end end end end end if result == ACTION_RESULT_BEGIN or result == ACTION_RESULT_EFFECT_GAINED or result == ACTION_RESULT_EFFECT_GAINED_DURATION then local currentTime = GetGameTimeMilliseconds() if g_toggledSlotsFront[abilityId] or g_toggledSlotsBack[abilityId] then if CombatInfo.SV.ShowToggled then local duration = GetUpdatedAbilityDuration(abilityId) local endTime = currentTime + duration g_toggledSlotsRemain[abilityId] = endTime -- Handling for Crystallized Shield + Morphs if abilityId == 92068 or abilityId == 92168 or abilityId == 92170 then g_toggledSlotsStack[abilityId] = 3 end -- Toggle highlight on if g_toggledSlotsFront[abilityId] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end if g_toggledSlotsBack[abilityId] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.ShowSlot(slotNum, abilityId, currentTime, false) end end end elseif result == ACTION_RESULT_EFFECT_FADED then -- Ignore fading event if override is true if g_barNoRemove[abilityId] then if Effects.BarHighlightCheckOnFade[abilityId] then CombatInfo.BarHighlightSwap(abilityId) end return end if g_toggledSlotsRemain[abilityId] then if g_toggledSlotsFront[abilityId] and g_uiCustomToggle[g_toggledSlotsFront[abilityId]] then local slotNum = g_toggledSlotsFront[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end if g_toggledSlotsBack[abilityId] and g_uiCustomToggle[g_toggledSlotsBack[abilityId]] then local slotNum = g_toggledSlotsBack[abilityId] CombatInfo.HideSlot(slotNum, abilityId) end g_toggledSlotsRemain[abilityId] = nil g_toggledSlotsStack[abilityId] = nil end if Effects.BarHighlightCheckOnFade[abilityId] and targetType == COMBAT_UNIT_TYPE_PLAYER then CombatInfo.BarHighlightSwap(abilityId) end end end function CombatInfo.OnSlotUpdated(eventCode, slotNum) -- Update ultimate label if slotNum == 8 then CombatInfo.UpdateUltimateLabel() end -- Update the slot if the bound id has a proc if slotNum >= BAR_INDEX_START and slotNum <= BAR_INDEX_END then local abilityId = GetSlotBoundId(slotNum) if Effects.IsAbilityProc[abilityId] or Effects.BaseForAbilityProc[abilityId] then CombatInfo.BarSlotUpdate(slotNum, false, true) end end end function CombatInfo.BarSlotUpdate(slotNum, wasfullUpdate, onlyProc) -- Handle slot update for action bars -- d(string.format("%d: %s(%d)", slotNum, GetSlotName(slotNum), GetSlotBoundId(slotNum))) -- Look only for action bar slots if slotNum < BACKBAR_INDEX_OFFSET then if CombatInfo.SV.ShowToggledUltimate then if slotNum < BAR_INDEX_START or slotNum > BAR_INDEX_END then return end else if slotNum < BAR_INDEX_START or slotNum > (BAR_INDEX_END - 1) then return end end end -- Remove saved triggered proc information for abilityId, slot in pairs(g_triggeredSlotsFront) do if (slot == slotNum) then g_triggeredSlotsFront[abilityId] = nil end end for abilityId, slot in pairs(g_triggeredSlotsBack) do if (slot == slotNum) then g_triggeredSlotsBack[abilityId] = nil end end -- Stop possible proc animation if g_uiProcAnimation[slotNum] and g_uiProcAnimation[slotNum]:IsPlaying() then --g_uiProcAnimation[slotNum].procLoopTexture.label:SetText("") g_uiProcAnimation[slotNum]:Stop() end if onlyProc == false then -- Remove custom toggle information and custom highlight for abilityId, slot in pairs(g_toggledSlotsFront) do if (slot == slotNum) then g_toggledSlotsFront[abilityId] = nil end end for abilityId, slot in pairs(g_toggledSlotsBack) do if (slot == slotNum) then g_toggledSlotsBack[abilityId] = nil end end if g_uiCustomToggle[slotNum] then --g_uiCustomToggle[slotNum].label:SetText("") g_uiCustomToggle[slotNum]:SetHidden(true) end end -- Bail out if slot is not used and we're not referencing a fake backbar slot. if slotNum < BACKBAR_INDEX_OFFSET and not IsSlotUsed(slotNum) then return end local ability_id if slotNum > BACKBAR_INDEX_OFFSET then local hotbarCategory = g_hotbarCategory == HOTBAR_CATEGORY_BACKUP and HOTBAR_CATEGORY_PRIMARY or HOTBAR_CATEGORY_BACKUP ability_id = GetSlotBoundId(slotNum - BACKBAR_INDEX_OFFSET, hotbarCategory) else ability_id = GetSlotBoundId(slotNum) end local showFakeAura = (Effects.BarHighlightOverride[ability_id] and Effects.BarHighlightOverride[ability_id].showFakeAura) if Effects.BarHighlightOverride[ability_id] then if Effects.BarHighlightOverride[ability_id].hide then return end if Effects.BarHighlightOverride[ability_id].newId then ability_id = Effects.BarHighlightOverride[ability_id].newId end end local abilityName = Effects.EffectOverride[ability_id] and Effects.EffectOverride[ability_id].name or GetAbilityName(ability_id) -- GetSlotName(slotNum) --local _, _, channel = GetAbilityCastInfo(ability_id) local duration = GetUpdatedAbilityDuration(ability_id) local currentTime = GetGameTimeMilliseconds() local triggeredSlots if slotNum > BACKBAR_INDEX_OFFSET then triggeredSlots = g_triggeredSlotsBack else triggeredSlots = g_triggeredSlotsFront end -- Check if currently this ability is in proc state local proc = Effects.HasAbilityProc[abilityName] if Effects.IsAbilityProc[GetSlotBoundId(slotNum)] then if CombatInfo.SV.ShowTriggered then CombatInfo.PlayProcAnimations(slotNum) if CombatInfo.SV.ProcEnableSound then if not wasfullUpdate and not g_disableProcSound[slotNum] then PlaySound(g_procSound) PlaySound(g_procSound) -- Only play a proc sound every 3 seconds (matches Power Lash cd) g_disableProcSound[slotNum] = true zo_callLater(function() g_disableProcSound[slotNum] = false end, 3000) end end end elseif proc then triggeredSlots[proc] = slotNum if g_triggeredSlotsRemain[proc] then if CombatInfo.SV.ShowTriggered then CombatInfo.PlayProcAnimations(slotNum) if CombatInfo.SV.BarShowLabel then if not g_uiProcAnimation[slotNum] then return end local remain = g_triggeredSlotsRemain[proc] - currentTime g_uiProcAnimation[slotNum].procLoopTexture.label:SetText(FormatDurationSeconds(remain)) end end end end local toggledSlots if slotNum > BACKBAR_INDEX_OFFSET then toggledSlots = g_toggledSlotsBack else toggledSlots = g_toggledSlotsFront end -- Check for active duration to display highlight for abilities on bar swap if onlyProc == false then if duration > 0 or Effects.AddNoDurationBarHighlight[ability_id] or Effects.MajorMinor[ability_id] then toggledSlots[ability_id] = slotNum if g_toggledSlotsRemain[ability_id] then if CombatInfo.SV.ShowToggled then local slotNum = toggledSlots[ability_id] -- Check the other slot here to determine if we desaturate (in case effects are running in both slots) local desaturate local math = slotNum > BACKBAR_INDEX_OFFSET and slotNum - BACKBAR_INDEX_OFFSET or nil if math then if g_uiCustomToggle[math] then desaturate = false if g_uiCustomToggle[math]:IsHidden() then CombatInfo.BackbarHideSlot(slotNum) desaturate = true end end end CombatInfo.ShowSlot(slotNum, ability_id, currentTime, desaturate) end end end end end function CombatInfo.UpdateUltimateLabel() -- Get the currently slotted ultimate cost local cost, mechType = GetSlotAbilityCost(g_ultimateSlot) g_ultimateCost = (mechType == POWERTYPE_ULTIMATE) and cost or 0 -- Update ultimate label CombatInfo.OnPowerUpdatePlayer(EVENT_POWER_UPDATE, "player", nil, POWERTYPE_ULTIMATE, g_ultimateCurrent, 0, 0) end function CombatInfo.InventoryItemUsed() g_potionUsed = true zo_callLater(function() g_potionUsed = false end, 200) end function CombatInfo.OnActiveHotbarUpdate(eventCode, didActiveHotbarChange, shouldUpdateAbilityAssignments, activeHotbarCategory) if didActiveHotbarChange == true or shouldUpdateAbilityAssignments == true then for _, physicalSlot in pairs(g_backbarButtons) do if physicalSlot.hotbarSwapAnimation then physicalSlot.noUpdates = true physicalSlot.hotbarSwapAnimation:PlayFromStart() end end else g_activeWeaponSwapInProgress = false end end function CombatInfo.OnSlotsFullUpdate(eventCode) -- Handle ultimate label first CombatInfo.UpdateUltimateLabel() -- Don't update bars if this full update event was from using an inventory item if g_potionUsed == true then return end -- Update action bar skills for i = BAR_INDEX_START, BAR_INDEX_END do CombatInfo.BarSlotUpdate(i, true, false) end for i = (BAR_INDEX_START + BACKBAR_INDEX_OFFSET), (BACKBAR_INDEX_END + BACKBAR_INDEX_OFFSET) do local button = g_backbarButtons[i] CombatInfo.SetupBackBarIcons(button) --CombatInfo.BarSlotUpdate(i, true, false) end end function CombatInfo.PlayProcAnimations(slotNum) if not g_uiProcAnimation[slotNum] then -- Don't make a highlight frame for the backbar ultimate slot since it is not created if slotNum == (BAR_INDEX_END + BACKBAR_INDEX_OFFSET) then return end -- Otherwise make a highlight frame local actionButton if slotNum < BACKBAR_INDEX_OFFSET then actionButton = ZO_ActionBar_GetButton(slotNum) else actionButton = g_backbarButtons[slotNum] end local procLoopTexture = windowManager:CreateControl("$(parent)Loop_LUIE", actionButton.slot, CT_TEXTURE) procLoopTexture:SetAnchor(TOPLEFT, actionButton.slot:GetNamedChild("FlipCard")) procLoopTexture:SetAnchor(BOTTOMRIGHT, actionButton.slot:GetNamedChild("FlipCard")) procLoopTexture:SetTexture("/esoui/art/actionbar/abilityhighlight_mage_med.dds") procLoopTexture:SetBlendMode(TEX_BLEND_MODE_ADD) procLoopTexture:SetDrawLevel(2) procLoopTexture:SetHidden(true) procLoopTexture.label = UI.Label(procLoopTexture, nil, nil, nil, g_barFont, nil, false) procLoopTexture.label:SetAnchor(TOPLEFT, actionButton.slot) procLoopTexture.label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) procLoopTexture.label:SetDrawLayer(DL_COUNT) procLoopTexture.label:SetDrawLevel(3) procLoopTexture.label:SetDrawTier(3) procLoopTexture.label:SetColor(unpack(CombatInfo.SV.RemainingTextColoured and colour or {1,1,1,1})) procLoopTexture.label:SetHidden(false) local procLoopTimeline = ANIMATION_MANAGER:CreateTimelineFromVirtual("UltimateReadyLoop", procLoopTexture) procLoopTimeline.procLoopTexture = procLoopTexture procLoopTimeline.onPlay = function(self) self.procLoopTexture:SetHidden(false) end procLoopTimeline.onStop = function(self) self.procLoopTexture:SetHidden(true) end procLoopTimeline:SetHandler("OnPlay", procLoopTimeline.onPlay) procLoopTimeline:SetHandler("OnStop", procLoopTimeline.onStop) g_uiProcAnimation[slotNum] = procLoopTimeline end if g_uiProcAnimation[slotNum] then if not g_uiProcAnimation[slotNum]:IsPlaying() then g_uiProcAnimation[slotNum]:PlayFromStart() end end end function CombatInfo.OnDeath(eventCode, unitTag, isDead) -- And toggle buttons if unitTag == "player" then for slotNum = BAR_INDEX_START, BAR_INDEX_END do if g_uiCustomToggle[slotNum] then g_uiCustomToggle[slotNum]:SetHidden(true) --[[if slotNum == 8 and CombatInfo.SV.UltimatePctEnabled and IsSlotUsed(g_ultimateSlot) then uiUltimate.LabelPct:SetHidden(false) end]]-- end end for slotNum = BAR_INDEX_START + BACKBAR_INDEX_OFFSET, BACKBAR_INDEX_END + BACKBAR_INDEX_OFFSET do if g_uiCustomToggle[slotNum] then g_uiCustomToggle[slotNum]:SetHidden(true) end end end end -- Displays custom toggle texture function CombatInfo.ShowCustomToggle(slotNum) if not g_uiCustomToggle[slotNum] then -- Don't make a highlight frame for the backbar ultimate slot since it is not created if slotNum == (BAR_INDEX_END + BACKBAR_INDEX_OFFSET) then return end -- Otherwise make a highlight frame local actionButton if slotNum < BACKBAR_INDEX_OFFSET then actionButton = ZO_ActionBar_GetButton(slotNum) else actionButton = g_backbarButtons[slotNum] end local name = "ActionButton" .. slotNum .. "Toggle_LUIE" local window = windowManager:GetControlByName(name) -- Check to see if this frame already exists, don't create it if it does. if window == nil then local toggleFrame = windowManager:CreateControl("$(parent)Toggle_LUIE", actionButton.slot, CT_TEXTURE) --toggleFrame.back = UI.Texture(toggleFrame, nil, nil, "/esoui/art/actionbar/actionslot_toggledon.dds") toggleFrame:SetAnchor(TOPLEFT, actionButton.slot:GetNamedChild("FlipCard")) toggleFrame:SetAnchor(BOTTOMRIGHT, actionButton.slot:GetNamedChild("FlipCard")) toggleFrame:SetTexture("/esoui/art/actionbar/actionslot_toggledon.dds") toggleFrame:SetBlendMode(TEX_BLEND_MODE_ADD) toggleFrame:SetDrawLayer(0) toggleFrame:SetDrawLevel(0) toggleFrame:SetDrawTier(2) toggleFrame:SetColor(0.5,1,0.5,1) toggleFrame:SetHidden(false) toggleFrame.label = UI.Label(toggleFrame, nil, nil, nil, g_barFont, nil, false) toggleFrame.label:SetAnchor(TOPLEFT, actionButton.slot) toggleFrame.label:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 0, -CombatInfo.SV.BarLabelPosition) toggleFrame.label:SetDrawLayer(DL_COUNT) toggleFrame.label:SetDrawLevel(1) toggleFrame.label:SetDrawTier(3) toggleFrame.label:SetColor(unpack(CombatInfo.SV.RemainingTextColoured and colour or {1,1,1,1})) toggleFrame.label:SetHidden(false) toggleFrame.stack = UI.Label(toggleFrame, nil, nil, nil, g_barFont, nil, false) toggleFrame.stack:SetAnchor(CENTER, actionButton.slot, BOTTOMLEFT) toggleFrame.stack:SetAnchor(CENTER, actionButton.slot, TOPRIGHT, -12, 14) --toggleFrame.stack:SetAnchor(TOPLEFT, actionButton.slot) --toggleFrame.stack:SetAnchor(BOTTOMRIGHT, actionButton.slot, nil, 22, -22) toggleFrame.stack:SetDrawLayer(DL_COUNT) toggleFrame.stack:SetDrawLevel(1) toggleFrame.stack:SetDrawTier(3) toggleFrame.stack:SetColor(unpack(CombatInfo.SV.RemainingTextColoured and colour or {1,1,1,1})) toggleFrame.stack:SetHidden(false) g_uiCustomToggle[slotNum] = toggleFrame end end if g_uiCustomToggle[slotNum] then g_uiCustomToggle[slotNum]:SetHidden(false) end end function CombatInfo.OnPowerUpdatePlayer(eventCode , unitTag, powerIndex, powerType, powerValue, powerMax, powerEffectiveMax) if unitTag ~= "player" then return end if powerType ~= POWERTYPE_ULTIMATE then return end -- flag if ultimate is full - we"ll need it for ultimate generation texture uiUltimate.NotFull = (powerValue < powerMax) -- Calculate the percentage to activation old one and current local pct = (g_ultimateCost > 0) and math.floor((powerValue / g_ultimateCost) * 100 ) or 0 -- Set max percentage label to 100%. if pct > 100 then pct = 100 end -- Update the tooltip only when the slot is used and percentage is enabled if IsSlotUsed(g_ultimateSlot) then if CombatInfo.SV.UltimateLabelEnabled or CombatInfo.SV.UltimatePctEnabled then -- Set % value if CombatInfo.SV.UltimatePctEnabled then uiUltimate.LabelPct:SetText(pct .. "%") end -- Set label value if CombatInfo.SV.UltimateLabelEnabled then uiUltimate.LabelVal:SetText(powerValue .. "/" .. g_ultimateCost) end -- Pct label: show always when less then 100% and possibly if UltimateHideFull is false if pct < 100 then -- Check Ultimate Percent Setting & if slot is used then check if the slot is currently showing a toggle local setHiddenPct = not CombatInfo.SV.UltimatePctEnabled if (CombatInfo.SV.ShowToggledUltimate and g_uiCustomToggle[8] and not g_uiCustomToggle[8]:IsHidden()) then setHiddenPct = true end uiUltimate.LabelPct:SetHidden(setHiddenPct) -- Update Label Color if CombatInfo.SV.UltimateLabelEnabled then for i = #(uiUltimate.pctColours), 1, -1 do if pct < uiUltimate.pctColours[i].pct then uiUltimate.LabelVal:SetColor(unpack(uiUltimate.pctColours[i].colour)) break end end end else -- Check Ultimate Percent Setting & if slot is used then check if the slot is currently showing a toggle local setHiddenPct = not (CombatInfo.SV.UltimatePctEnabled) if (CombatInfo.SV.ShowToggledUltimate and g_uiCustomToggle[8] and not g_uiCustomToggle[8]:IsHidden()) or CombatInfo.SV.UltimateHideFull then setHiddenPct = true end uiUltimate.LabelPct:SetHidden(setHiddenPct) -- Update Label Color if CombatInfo.SV.UltimateLabelEnabled then uiUltimate.LabelVal:SetColor(unpack(uiUltimate.colour)) end end -- Set label hidden or showing local setHiddenLabel = not CombatInfo.SV.UltimateLabelEnabled uiUltimate.LabelVal:SetHidden(setHiddenLabel) end else uiUltimate.LabelPct:SetHidden(true) uiUltimate.LabelVal:SetHidden(true) end -- Update stored value g_ultimateCurrent = powerValue end function CombatInfo.OnInventorySlotUpdate(eventCode, bagId, slotId, isNewItem, itemSoundCategory, inventoryUpdateReason, stackCountChange) if stackCountChange >= 0 then CombatInfo.UpdateUltimateLabel() end end
-- Option -- Stephen Leitnick -- August 28, 2020 --[[ MatchTable { Some: (value: any) -> any None: () -> any } CONSTRUCTORS: Option.Some(anyNonNilValue): Option<any> Option.Wrap(anyValue): Option<any> STATIC FIELDS: Option.None: Option<None> STATIC METHODS: Option.Is(obj): boolean METHODS: opt:Match(): (matches: MatchTable) -> any opt:IsSome(): boolean opt:IsNone(): boolean opt:Unwrap(): any opt:Expect(errMsg: string): any opt:ExpectNone(errMsg: string): void opt:UnwrapOr(default: any): any opt:UnwrapOrElse(default: () -> any): any opt:And(opt2: Option<any>): Option<any> opt:AndThen(predicate: (unwrapped: any) -> Option<any>): Option<any> opt:Or(opt2: Option<any>): Option<any> opt:OrElse(orElseFunc: () -> Option<any>): Option<any> opt:XOr(opt2: Option<any>): Option<any> opt:Contains(value: any): boolean -------------------------------------------------------------------- Options are useful for handling nil-value cases. Any time that an operation might return nil, it is useful to instead return an Option, which will indicate that the value might be nil, and should be explicitly checked before using the value. This will help prevent common bugs caused by nil values that can fail silently. Example: local result1 = Option.Some(32) local result2 = Option.Some(nil) local result3 = Option.Some("Hi") local result4 = Option.Some(nil) local result5 = Option.None -- Use 'Match' to match if the value is Some or None: result1:Match { Some = function(value) print(value) end; None = function() print("No value") end; } -- Raw check: if result2:IsSome() then local value = result2:Unwrap() -- Explicitly call Unwrap print("Value of result2:", value) end if result3:IsNone() then print("No result for result3") end -- Bad, will throw error bc result4 is none: local value = result4:Unwrap() --]] local CLASS_NAME = "Option" --[=[ @class Option Represents an optional value in Lua. This is useful to avoid `nil` bugs, which can go silently undetected within code and cause hidden or hard-to-find bugs. ]=] local Option = {} Option.__index = Option function Option._new(Value) return setmetatable({ ClassName = CLASS_NAME; _IsSome = Value ~= nil; _Value = Value; }, Option) end --[=[ @param value T @return Option<T> Creates an Option instance with the given value. Throws an error if the given value is `nil`. ]=] function Option.Some(Value) assert(Value ~= nil, "Option.Some() value cannot be nil") return Option._new(Value) end --[=[ @param value T @return Option<T> | Option<None> Safely wraps the given value as an option. If the value is `nil`, returns `Option.None`, otherwise returns `Option.Some(value)`. ]=] function Option.Wrap(Value) if Value == nil then return Option.None else return Option.Some(Value) end end --[=[ @param obj any @return boolean Returns `true` if `obj` is an Option. ]=] function Option.Is(Object) return type(Object) == "table" and getmetatable(Object) == Option end --[=[ @param obj any Throws an error if `obj` is not an Option. ]=] function Option.Assert(Object) assert(type(Object) == "table" and getmetatable(Object) == Option, "Result was not of type Option") return Object end --[=[ @param data table @return Option Deserializes the data into an Option. This data should have come from the `option:Serialize()` method. ]=] function Option.Deserialize(Data) -- type data = {ClassName: string, Value: any} assert(type(Data) == "table" and Data.ClassName == CLASS_NAME, "Invalid data for deserializing Option") return Data.Value == nil and Option.None or Option.Some(Data.Value) end --[=[ @return table Returns a serialized version of the option. ]=] function Option:Serialize() return { ClassName = self.ClassName; Value = self._Value; } end type Matches = { Some: (Value: any) -> any, None: () -> any, } --[=[ @param matches {Some: (value: any) -> any, None: () -> any} @return any Matches against the option. ```lua local opt = Option.Some(32) opt:Match { Some = function(num) print("Number", num) end, None = function() print("No value") end, } ``` ]=] function Option:Match(Matches: Matches) local OnSome = Matches.Some local OnNone = Matches.None assert(type(OnSome) == "function", "Missing 'Some' match") assert(type(OnNone) == "function", "Missing 'None' match") if self._IsSome then return OnSome(self:Unwrap()) else return OnNone() end end --[=[ @return boolean Returns `true` if the option has a value. ]=] function Option:IsSome() return self._IsSome end --[=[ @return boolean Returns `true` if the option is None. ]=] function Option:IsNone() return not self._IsSome end --[=[ @param msg string @return value: any Unwraps the value in the option, otherwise throws an error with `msg` as the error message. ```lua local opt = Option.Some(10) print(opt:Expect("No number")) -> 10 print(Option.None:Expect("No number")) -- Throws an error "No number" ``` ]=] function Option:Expect(Message: string?) assert(self._IsSome, Message) return self._Value end --[=[ @param msg string Throws an error with `msg` as the error message if the value is _not_ None. ]=] function Option:ExpectNone(Message: string?) assert(not self._IsSome, Message) end --[=[ @return value: any Returns the value in the option, or throws an error if the option is None. ]=] function Option:Unwrap() return self:Expect("Cannot unwrap option of None type") end --[=[ @param default any @return value: any If the option holds a value, returns the value. Otherwise, returns `default`. ]=] function Option:UnwrapOr(Default) if self._IsSome then return self:Unwrap() else return Default end end --[=[ @param defaultFn () -> any @return value: any If the option holds a value, returns the value. Otherwise, returns the result of the `defaultFn` function. ]=] function Option:UnwrapOrElse(DefaultFunction) if self._IsSome then return self:Unwrap() else return DefaultFunction() end end --[=[ @param optionB Option @return Option Returns `optionB` if the calling option has a value, otherwise returns None. ```lua local optionA = Option.Some(32) local optionB = Option.Some(64) local opt = optionA:And(optionB) -- opt == optionB local optionA = Option.None local optionB = Option.Some(64) local opt = optionA:And(optionB) -- opt == Option.None ``` ]=] function Option:And(OptionB) if self._IsSome then return OptionB else return Option.None end end --[=[ @param andThenFn (value: any) -> Option @return value: Option If the option holds a value, then the `andThenFn` function is called with the held value of the option, and then the resultant Option returned by the `andThenFn` is returned. Otherwise, None is returned. ```lua local optA = Option.Some(32) local optB = optA:AndThen(function(num) return Option.Some(num * 2) end) print(optB:Expect("Expected number")) --> 64 ``` ]=] function Option:AndThen(ThenFunction) if self._IsSome then return Option.Assert(ThenFunction(self:Unwrap())) else return Option.None end end function Option:Then(ThenFunction) if self._IsSome then return Option.Assert(ThenFunction(self:Unwrap())) else return Option.None end end --[=[ @param optionB Option @return Option If caller has a value, returns itself. Otherwise, returns `optionB`. ]=] function Option:Or(OptionB) if self._IsSome then return self else return OptionB end end --[=[ @param orElseFn () -> Option @return Option If caller has a value, returns itself. Otherwise, returns the option generated by the `orElseFn` function. ]=] function Option:OrElse(OrElseFunction) if self._IsSome then return self else return Option.Assert(OrElseFunction()) end end --[=[ @param optionB Option @return Option If both `self` and `optionB` have values _or_ both don't have a value, then this returns None. Otherwise, it returns the option that does have a value. ]=] function Option:XOr(OptionB) local SomeOptionA = self._IsSome local SomeOptionB = OptionB._IsSome if SomeOptionA == SomeOptionB then return Option.None elseif SomeOptionA then return self else return OptionB end end --[=[ @param predicate (value: any) -> boolean @return Option Returns `self` if this option has a value and the predicate returns `true. Otherwise, returns None. ]=] function Option:Filter(Predicate) if not self._IsSome or not Predicate(self._Value) then return Option.None else return self end end --[=[ @param value: any @return boolean Returns `true` if this option contains `value`. ]=] function Option:Contains(Value) return self._IsSome and self._Value == Value end --[=[ @return string Metamethod to transform the option into a string. ```lua local optA = Option.Some(64) local optB = Option.None print(optA) --> Option<number> print(optB) --> Option<None> ``` ]=] function Option:__tostring() if self._IsSome then return "Option<" .. typeof(self._Value) .. ">" else return "Option<None>" end end --[=[ @return boolean Metamethod to check equality between two options. Returns `true` if both options hold the same value _or_ both options are None. ```lua local o1 = Option.Some(32) local o2 = Option.Some(32) local o3 = Option.Some(64) local o4 = Option.None local o5 = Option.None print(o1 == o2) --> true print(o1 == o3) --> false print(o1 == o4) --> false print(o4 == o5) --> true ``` ]=] function Option:__eq(Other) if Option.Is(Other) then if self._IsSome and Other._IsSome then return self:Unwrap() == Other:Unwrap() elseif not self._IsSome and not Other._IsSome then return true end end return false end --[=[ @prop None Option<None> @within Option Represents no value. ]=] Option.None = Option._new() export type Option<Value> = typeof(Option._new(1)) table.freeze(Option) return Option
--- === plugins.core.gamepad.prefs === --- --- Gamepad Preferences Panel local require = require --local log = require "hs.logger".new "audioSwift" local image = require "hs.image" local html = require "cp.web.html" local i18n = require "cp.i18n" local imageFromPath = image.imageFromPath local execute = _G.hs.execute local mod = {} local plugin = { id = "core.gamepad.prefs", group = "core", dependencies = { ["core.controlsurfaces.manager"] = "manager", } } function plugin.init(deps, env) -------------------------------------------------------------------------------- -- Inter-plugin Connectivity: -------------------------------------------------------------------------------- mod._manager = deps.manager -------------------------------------------------------------------------------- -- Setup Preferences Panel: -------------------------------------------------------------------------------- mod._panel = deps.manager.addPanel({ priority = 9005, id = "gamepad", label = i18n("gamepad"), image = imageFromPath(env:pathToAbsolute("/images/Gamepad.icns")), tooltip = i18n("gamepad"), height = 240, }) :addHeading(1, "Gamepad Support") :addContent(2, [[<p style="padding-left:20px;">We are planning to add built-in Gamepad support in a future release.<br /> <br /> In the meantime, you can use the free <strong>Enjoyable</strong> or <strong>Controlly</strong> apps to assign virtual keyboard presses to Gamepad controllers. </p>]], false) :addContent(3, html.style ([[ .downloadEnjoyable { float:left; } ]], true)) :addButton(4, { class = "downloadEnjoyable", label = "Download Enjoyable", width = 240, onclick = function() execute([[open https://yukkurigames.com/enjoyable/]]) end, } ) :addButton(5, { label = "Download Controlly", width = 240, onclick = function() execute([[open https://hugolispector.com/controlly/]]) end, } ) return mod end return plugin
require "resty.nettle.types.chacha" require "resty.nettle.types.poly1305" local ffi = require "ffi" local ffi_cdef = ffi.cdef local ffi_typeof = ffi.typeof ffi_cdef [[ void nettle_chacha_poly1305_set_key(struct chacha_poly1305_ctx *ctx, const uint8_t *key); void nettle_chacha_poly1305_set_nonce(struct chacha_poly1305_ctx *ctx, const uint8_t *nonce); void nettle_chacha_poly1305_update(struct chacha_poly1305_ctx *ctx, size_t length, const uint8_t *data); void nettle_chacha_poly1305_encrypt(struct chacha_poly1305_ctx *ctx, size_t length, uint8_t *dst, const uint8_t *src); void nettle_chacha_poly1305_decrypt(struct chacha_poly1305_ctx *ctx, size_t length, uint8_t *dst, const uint8_t *src); void nettle_chacha_poly1305_digest(struct chacha_poly1305_ctx *ctx, size_t length, uint8_t *digest); ]] return ffi_typeof [[ struct chacha_poly1305_ctx { struct chacha_ctx chacha; struct poly1305_ctx poly1305; union nettle_block16 s; uint64_t auth_size; uint64_t data_size; uint8_t block[16]; unsigned index; }]]
return { tllmosaurus = { acceleration = 0.002, brakerate = 0.09, buildcostenergy = 240661, buildcostmetal = 18149, builder = false, buildpic = "tllmosaurus.dds", buildtime = 250000, canattack = true, canguard = true, canhover = true, canmove = true, canpatrol = true, canstop = 1, category = "ALL HUGE MOBILE SURFACE", collisionvolumeoffsets = "0 0 0", collisionvolumescales = "100 42 120", collisionvolumetype = "ellipsoid", corpse = "dead", defaultmissiontype = "Standby", description = "Experimental Siege Hover", explodeas = "BANTHA_BLAST", firestandorders = 1, footprintx = 6, footprintz = 6, idleautoheal = 5, idletime = 1800, losemitheight = 31, maneuverleashlength = 640, mass = 18149, maxdamage = 68590, maxslope = 12, maxvelocity = 1.5, maxwaterdepth = 0, mobilestandorders = 1, movementclass = "TANKHOVER4", name = "Mosaurus", noautofire = false, objectname = "tllmosaurus", radardistance = 0, radaremitheight = 30, selfdestructas = "KROG_BLAST", sightdistance = 500, turninplace = 0, turninplaceanglelimit = 140, turninplacespeedlimit = 0.9, turnrate = 150, unitname = "tllmosaurus", customparams = { buildpic = "tllmosaurus.dds", faction = "TLL", }, featuredefs = { dead = { blocking = true, damage = 18543, description = "Mosaurus Wreckage", featuredead = "heap", footprintx = 3, footprintz = 3, metal = 13875, object = "tllmosaurus_dead", reclaimable = true, customparams = { fromunit = 1, }, }, heap = { blocking = false, damage = 23179, description = "Mosaurus Debris", footprintx = 4, footprintz = 4, metal = 7400, object = "4x4a", reclamable = 1, customparams = { fromunit = 1, }, }, }, sfxtypes = { explosiongenerators = { [1] = "custom:sniper_muzzle_large", }, pieceexplosiongenerators = { [1] = "piecetrail0", [2] = "piecetrail1", [3] = "piecetrail2", [4] = "piecetrail3", [5] = "piecetrail4", [6] = "piecetrail6", }, }, sounds = { canceldestruct = "cancel2", underattack = "warning1", cant = { [1] = "cantdo4", }, count = { [1] = "count6", [2] = "count5", [3] = "count4", [4] = "count3", [5] = "count2", [6] = "count1", }, ok = { [1] = "tcormove", }, select = { [1] = "tcorsel", }, }, weapondefs = { mosaurus_cannon = { areaofeffect = 220, avoidfeature = false, cegtag = "Trail_cannon_med", craterareaofeffect = 256, craterboost = 0, cratermult = 0, edgeeffectiveness = 0.18, energypershot = 5000, explosiongenerator = "custom:explosion_big_Tesla", gravityaffected = "TRUE", impulseboost = 0.2, impulsefactor = 0.2, model = "weapon_bomb", name = "Pepper spray", nogap = 1, noselfdamage = true, projectiles = 10, range = 1000, reloadtime = 10, rgbcolor = "0.2 0.30 0.65", separation = 0.45, size = 3, sizedecay = -0.15, soundhitdry = "explode3", soundhitdryvolume = 0.8, soundhitwet = "splslrg", soundhitwetvolume = 0.6, soundstart = "mortar_snottyboy", soundstartvolume = 0.3, sprayangle = 1500, stages = 10, turret = true, weapontype = "Cannon", weaponvelocity = 600, damage = { commanders = 600, default = 1200, subs = 5, }, }, tll_lighting = { areaofeffect = 8, beamttl = 10, craterareaofeffect = 0, craterboost = 0, cratermult = 0, duration = 1.9, energypershot = 100, explosiongenerator = "custom:tllweb_exp", firestarter = 85, impulseboost = 0, impulsefactor = 0, intensity = 12, name = "Spray Lightning", noselfdamage = true, projectiles = 3, range = 600, reloadtime = 1, rgbcolor = "0.6 0.6 0.9", soundhitwet = "sizzle", soundhitwetvolume = 0.5, soundstart = "tllspark", sprayangle = 500, texture1 = "strike", thickness = 1.5, turret = true, weapontimer = 1, weapontype = "LightningCannon", weaponvelocity = 2250, customparams = { light_mult = 1.4, light_radius_mult = 0.9, }, damage = { default = 175, subs = 5, }, }, }, weapons = { [1] = { badtargetcategory = "LARGE MEDIUM SMALL TINY", def = "MOSAURUS_CANNON", onlytargetcategory = "SURFACE", }, [2] = { badtargetcategory = "HUGE", def = "TLL_LIGHTING", maindir = "1 0 0", maxangledif = 220, onlytargetcategory = "SURFACE", }, [3] = { badtargetcategory = "HUGE", def = "TLL_LIGHTING", maindir = "-1 0 0", maxangledif = 220, onlytargetcategory = "SURFACE", }, }, }, }
local ActivityModule = require "module.ActivityModule" local ItemModule = require "module.ItemModule" local Time = require "module.Time" local ItemHelper = require "utils.ItemHelper" local QuestModule = require "module.QuestModule" local ShopModule = require "module.ShopModule" local UserDefault = require "utils.UserDefault"; local View = {}; local draw_card_data = UserDefault.Load("draw_card_data", true); draw_card_data.last_select = draw_card_data.last_select or {}; function View:Start(data) self.root = CS.SGK.UIReference.Setup(self.gameObject); self.view = self.root.view; self.dialog = self.root.dialog; self:InitData(); self:InitView(); self:initGuide() end function View:InitData() self.updateTime = 0; self.poolUI = {}; self.preview_stage = {}; self.preview_hero = {}; self.initPoint = false; self.pointPage = self.savedValues.pointPage or 1; self.curSelect = self.savedValues.curSelect or 0; self.preview_id = self.savedValues.preview_id or 0; self.point_buy = false; self.pointShop = ShopModule.GetManager(3001); print("商店信息3001", sprinttb(self.pointShop)) self.point_list = {}; self.exchangeShop = ShopModule.GetManager(14); print("商店信息14", sprinttb(self.exchangeShop)) self.exchang_list = {}; self.pointQuest = QuestModule.GetConfigType(104); table.sort(self.pointQuest,function (a,b) return a.event_count1 < b.event_count1; end) self:CheckQuest(); local poolData = self:GetPoolData(); self.poolData = {}; for k,v in pairs(poolData) do if ActivityModule.CheckPoolOpen(v.active_time) then table.insert(self.poolData, v); end end table.sort(self.poolData, function ( a,b ) local poolCfg1 = ActivityModule.GetDrawCardShowConfig(a.id); local poolCfg2 = ActivityModule.GetDrawCardShowConfig(b.id); local sort1 = poolCfg1 and poolCfg1.sort_id or 99; local sort2 = poolCfg2 and poolCfg2.sort_id or 99; if sort1 ~= sort2 then return sort1 < sort2; end return a.id < b.id; end) print("奖池配置", sprinttb(self.poolData)) end function View:InitView() SGK.BackgroundMusicService.PlayMusic("sound/zhanbu.mp3"); DialogStack.PushPref("CurrencyChat", {itemid = {90002, 90003, 90221, 90222}}, self.view); CS.UGUIClickEventListener.Get(self.view.help.gameObject).onClick = function (obj) utils.SGKTools.ShowDlgHelp(SGK.Localize:getInstance():getValue("zhaomu_shuoming_02")) end --初始化积分兑换 for i,v in ipairs(self.pointQuest) do local item = self.view.point.Slider["stage"..i]; if item then item.Text[UnityEngine.UI.Text].text = v.event_count1; end end self.view.point.Slider[UnityEngine.UI.Slider].maxValue = self.pointQuest[#self.pointQuest].event_count1; self:UpdatePointView(); CS.UGUIClickEventListener.Get(self.view.point.icon.gameObject).onClick = function (obj) if not self.initPoint then self:InitPointDialog(); end for i,v in ipairs(self.pointQuest) do local quest = QuestModule.Get(v.id); if quest and quest.status == 0 then self.pointPage = i; break; end end self:UpdatePointPage(true); self.dialog.pointReward:SetActive(true); end if self.savedValues.pointReward then self:InitPointDialog(); self:UpdatePointPage(true); self.dialog.pointReward:SetActive(true); end if self.savedValues.preview and self.preview_id ~= 0 then self:ShowRewardPreview(self.preview_id); end --初始化兑换券兑换 CS.UGUIClickEventListener.Get(self.view.exchange.gameObject).onClick = function (obj) self:UpdateExchange() self.dialog.exchange:SetActive(true); end self.dialog.exchange.ScrollView[CS.UIMultiScroller].RefreshIconCallback = function ( obj,idx ) local item = CS.SGK.UIReference.Setup(obj); local info = self.exchang_list[idx + 1]; local cfg = ItemHelper.Get(info.product_item_type, info.product_item_id); item.name.Text[UnityEngine.UI.Text].text = cfg.name; utils.IconFrameHelper.Create(item.IconFrame,{type = info.product_item_type, id = info.product_item_id, count = info.product_item_value, showDetail = true}); utils.IconFrameHelper.Create(item.cost,{type = info.consume_item_type1, id = info.consume_item_id1, count = 0, showDetail = true}); item.count[UnityEngine.UI.Text].text = info.consume_item_value1; item.count[CS.UGUIColorSelector].index = (ItemModule.GetItemCount(info.consume_item_id1) >= info.consume_item_value1) and 0 or 1; item.Text[UnityEngine.UI.Text]:TextFormat("今日剩余{0}次", info.product_count); SetButtonStatus(info.product_count > 0, item.get); CS.UGUIClickEventListener.Get(item.get.gameObject).onClick = function (obj) if ItemModule.GetItemCount(info.consume_item_id1) < info.consume_item_value1 then local _cfg = ItemHelper.Get(info.consume_item_type1, info.consume_item_id1); showDlgError(nil, _cfg.name.."不足"); return; end if info.product_count <= 0 then showDlgError(nil, "库存不足"); return; end print("购买", info.gid); ShopModule.Buy(14, info.gid, 1); end item:SetActive(true); end --奖池初始化 local width = {349, 349, 365, 385} local content = self.view.ScrollView.Viewport.Content; for i,v in ipairs(self.poolData) do local poolCfg = ActivityModule.GetDrawCardShowConfig(v.id); if poolCfg then local obj = CS.UnityEngine.GameObject.Instantiate(content.pool.gameObject, content.transform); local item = CS.SGK.UIReference.Setup(obj); obj.name = "pool_"..v.id; item[UnityEngine.UI.Image]:LoadSprite("DrawCard/"..poolCfg.banner_pic, function () item[UnityEngine.CanvasGroup].alpha = 1; end); item.guarantee[UnityEngine.RectTransform].sizeDelta = CS.UnityEngine.Vector2(width[poolCfg.guarantee_stage] or 385, 39) item.guarantee.class[CS.UGUISpriteSelector].index = poolCfg.guarantee_stage - 1; item.guarantee.class[UnityEngine.UI.Image]:SetNativeSize(); if poolCfg.guide ~= 0 then item.ssr[UnityEngine.UI.Image]:LoadSprite("DrawCard/"..poolCfg.banner_pic.."b"); item.ssr:SetActive(true); CS.UGUIClickEventListener.Get(item.ssr.gameObject).onClick = function (obj) DialogStack.Push("HeroComposeFrame",{roleID = poolCfg.guide}) end else item.ssr:SetActive(false); end item.ten.off:SetActive(poolCfg.discount ~= 0); item.ten.icon:SetActive(true); item.ten.num:SetActive(true); item.openTime:SetActive(v.id ~= 1 and v.id ~= 2); if poolCfg.up_logo ~= "0" then item.up[UnityEngine.UI.Image]:LoadSprite("DrawCard/"..poolCfg.up_logo); item.up:SetActive(true); else item.up:SetActive(false); end for _,time in ipairs(v.active_time) do if time.begin_time <= Time.now() and time.end_time > Time.now() then local delta = Time.now() - time.begin_time; if time.duration == 0 or delta % time.period < time.duration then if time.duration == 0 then item.openTime[UnityEngine.UI.Text]:TextFormat("{0} ~ {1} 限时登场!", os.date("%m.%d",math.floor(time.begin_time)), os.date("%m.%d %H:%M",math.floor(time.end_time))) else local begin_time = math.floor(delta / time.period) * time.period + time.begin_time; local end_time = begin_time + time.duration; item.openTime[UnityEngine.UI.Text]:TextFormat("{0} ~ {1} 限时登场!", os.date("%m.%d",math.floor(begin_time)), os.date("%m.%d %H:%M",math.floor(end_time))) end break; end end end if poolCfg.discount ~= 0 then item.ten.off[CS.UGUISpriteSelector].index = poolCfg.discount - 1; end item:SetActive(true); self.poolUI[v.id] = item; CS.UGUIClickEventListener.Get(item.view.gameObject).onClick = function (obj) self:ShowRewardPreview(poolCfg.reward_pool_id); end CS.UGUIClickEventListener.Get(item.one.gameObject).onClick = function (obj) self:DrawCard(v.id, 0); end CS.UGUIClickEventListener.Get(item.ten.gameObject).onClick = function (obj) self:DrawCard(v.id, 1); end end end self:UpdatePoolView(); end function View:GetPoolData() local activity_type = {1, 4, 5}; local allPool = {}; for _,v in ipairs(activity_type) do local poolData = ActivityModule.GetManager(v); if poolData then for k,j in pairs(poolData) do allPool[k] = j end end end return allPool; end function View:CheckQuest() local needAccept = {}; for i,v in ipairs(self.pointQuest) do local quest = QuestModule.Get(v.id); if quest then print("任务状态", quest.name, quest.status) else print("任务不存在", v.name) end if quest == nil then QuestModule.Accept(v.id); elseif quest.status ~= 0 and QuestModule.CanAccept(v.id) then table.insert(needAccept, v.id); end end if #needAccept == #self.pointQuest then for i,v in ipairs(needAccept) do QuestModule.Accept(v); end end end function View:DrawCard(id, combo) local poolData = self:GetPoolData(); local data = poolData[id]; if data then if combo == 0 then local time = math.floor(Time.now() - data.CardData.last_free_time); if time >= data.free_gap then if data.free_Item_id == 0 or ItemModule.GetItemCount(data.free_Item_id) >= data.free_Item_consume then local consume = {data.consume_type, data.consume_id, 0}; local args = {id, 0, consume, combo, false}; DialogStack.PushPrefStact("DrawCard/newDrawCardResult", {activity_id = id, args = args}); return; end end if data.consume_id2 ~= 0 and ItemModule.GetItemCount(data.consume_id2) >= data.price2 then local consume = {data.consume_type2, data.consume_id2, data.price2} local args = {id, 0, consume, combo, true}; DialogStack.PushPrefStact("DrawCard/newDrawCardResult", {activity_id = id, args = args}); return; end if data.consume_id ~= 0 and ItemModule.GetItemCount(data.consume_id) >= data.price then local consume = {data.consume_type, data.consume_id, data.price} local args = {id, 0, consume, combo, false}; DialogStack.PushPrefStact("DrawCard/newDrawCardResult", {activity_id = id, args = args}); else local cfg = ItemHelper.Get(data.consume_type, data.consume_id) showDlgError(nil, cfg.name.."不足"); end else if data.consume_id2 ~= 0 and ItemModule.GetItemCount(data.consume_id2) >= data.combo_price2 * data.combo_count then local consume = {data.consume_type2, data.consume_id2, data.combo_price2 * data.combo_count} local args = {id, 0, consume, combo, true}; DialogStack.PushPrefStact("DrawCard/newDrawCardResult", {activity_id = id, args = args}); return; end local count = ItemModule.GetItemCount(data.consume_id); if count >= data.combo_price * data.combo_count then local consume = {data.consume_type, data.consume_id, data.combo_price * data.combo_count} local args = {id, 0, consume, combo, false}; DialogStack.PushPrefStact("DrawCard/newDrawCardResult", {activity_id = id, args = args}); else local cfg = ItemHelper.Get(data.consume_type, data.consume_id) showDlgError(nil, cfg.name.."不足"); end end else ERROR_LOG("奖池不存在", id) end end --刷新积分进度条 function View:UpdatePointView() local quest = QuestModule.Get(1042001); print(quest.name, quest.status, ItemModule.GetItemCount(78951), ItemModule.GetItemCount(78901), ItemModule.GetItemCount(78902), ItemModule.GetItemCount(78903)); local count = ItemModule.GetItemCount(self.pointQuest[1].event_id1); print("积分", self.pointQuest[1].event_id1, count); self.view.point.Slider[UnityEngine.UI.Slider].value = count; local canReward = false; for i,v in ipairs(self.pointQuest) do local item = self.view.point.Slider["stage"..i]; if item then item[CS.UGUISelectorGroup].index = (count >= v.event_count1) and 1 or 0; end local quest = QuestModule.Get(v.id); if quest and quest.status == 0 and count >= v.event_count1 then canReward = true; end end self.view.point.icon.effect:SetActive(canReward); end function View:InitPointDialog() self.initPoint = true; for i,v in ipairs(self.pointQuest) do local page = self.dialog.pointReward.Toggle["page"..i]; if page then page.effect:SetActive(false); page.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.icon); CS.UGUIClickEventListener.Get(page.gameObject).onClick = function (obj) self.pointPage = i; self.curSelect = 0; self:UpdatePointPage(); end end end self.dialog.pointReward.ScrollView.Viewport.Content[CS.ScrollViewContent].RefreshIconCallback = function ( obj,idx ) local item = CS.SGK.UIReference.Setup(obj); local info = self.point_list[idx + 1]; if draw_card_data.last_select[self.pointPage] then item.select:SetActive(info.id == draw_card_data.last_select[self.pointPage]) else item.select:SetActive(self.curSelect == idx + 1); end utils.IconFrameHelper.Create(item.IconFrame,{type = info.type, id = info.id, count = info.value, customCfg = {level = 0}}); item.name[UnityEngine.UI.Text].text = ItemHelper.Get(info.type, info.id).name; CS.UGUIClickEventListener.Get(item.gameObject, true).onClick = function (obj) if draw_card_data.last_select[self.pointPage] == nil then if self.curSelect ~= 0 then local _obj = self.dialog.pointReward.ScrollView.Viewport.Content[CS.ScrollViewContent]:GetItem(self.curSelect - 1); local _item = CS.SGK.UIReference.Setup(_obj); _item.select:SetActive(false); end self.curSelect = idx + 1; item.select:SetActive(true); end end local listener = CS.UGUIPointerEventListener.Get(item.gameObject) if listener.isLongPress ~= nil then listener.isLongPress = true; end CS.UGUIPointerEventListener.Get(item.gameObject).onPointerDown = function() DialogStack.Push("HeroComposeFrame",{roleID = info.id}) end item:SetActive(true); end CS.UGUIClickEventListener.Get(self.dialog.pointReward.get.gameObject).onClick = function (obj) if self.point_buy then return; end local count = ItemModule.GetItemCount(self.pointQuest[self.pointPage].event_id1) if count < self.pointQuest[self.pointPage].event_count1 then showDlgError(nil, "积分不足"); return; end if self.curSelect == 0 then showDlgError(nil, "请选择一个奖品"); return; end if QuestModule.CanSubmit(self.pointQuest[self.pointPage].id) then self.point_buy = true; self.root.mask:SetActive(true); QuestModule.Finish(self.pointQuest[self.pointPage].id); else ERROR_LOG("任务无法完成", self.pointQuest[self.pointPage].id) end end end function View:UpdatePointPage(check) if self.pointShop == nil or self.pointShop.shoplist == nil then return; end if check then for i,v in ipairs(self.pointQuest) do local item = self.dialog.pointReward.Toggle["page"..i]; local count = ItemModule.GetItemCount(v.event_id1); item.num[UnityEngine.UI.Text]:TextFormat("{0}/{1}", count, v.event_count1); local quest = QuestModule.Get(v.id); if quest then print(quest.name, quest.status, v.event_count1) if quest.status == 1 then item.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.icon.."-2"); item.get:SetActive(true); else item.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.icon); item.get:SetActive(false); end item.Text:SetActive(quest.status == 1); item.num:SetActive(quest.status == 0); local canSubmit = count >= v.event_count1 and quest.status == 0 item.effect:SetActive(canSubmit); item.num[CS.UGUIColorSelector].index = canSubmit and 0 or 1; item[UI.Toggle].isOn = self.pointPage == i; end end end local quest = QuestModule.Get(self.pointQuest[self.pointPage].id); if quest then local count = ItemModule.GetItemCount(self.pointQuest[self.pointPage].event_id1) if quest.status ~= 1 then self.dialog.pointReward.get.Text[UnityEngine.UI.Text].text = "领取"; else self.dialog.pointReward.get.Text[UnityEngine.UI.Text].text = "已领取"; end local canGet = count >= self.pointQuest[self.pointPage].event_count1 and quest.status ~= 1; SetButtonStatus(canGet, self.dialog.pointReward.get); end self.point_list = {}; for k,v in pairs(self.pointShop.shoplist) do if v.consume_item_id1 == self.pointQuest[self.pointPage].reward_id2 then self.point_list = v.product_item_list; end end if self.point_list then self.dialog.pointReward.ScrollView.Viewport.Content[CS.ScrollViewContent].DataCount = #self.point_list; end end function View:UpdateExchange() local count = ItemModule.GetItemCount(90231); self.dialog.exchange.cost.Text[UnityEngine.UI.Text].text = count; if self.exchangeShop ~= nil and self.exchangeShop.shoplist ~= nil then self.exchang_list = {}; for k,v in pairs(self.exchangeShop.shoplist) do table.insert(self.exchang_list, v); end table.sort(self.exchang_list, function ( a,b ) return a.gid < b.gid; end) self.dialog.exchange.ScrollView[CS.UIMultiScroller].DataCount = #self.exchang_list; end end --刷新奖池显示 function View:UpdatePoolView() for i,v in ipairs(self.poolData) do if self.poolUI[v.id] then local item = self.poolUI[v.id]; local guarantee_count = v.combo_count - (v.CardData.total_count % v.combo_count) - 1; if guarantee_count > 0 then item.guarantee[CS.UGUISpriteSelector].index = 0; item.guarantee.count[UnityEngine.UI.Text].text = guarantee_count; item.guarantee.count:SetActive(true); else item.guarantee[CS.UGUISpriteSelector].index = 1; item.guarantee.count:SetActive(false); end local time = math.floor(Time.now() - v.CardData.last_free_time); item.one.icon:SetActive(time < v.free_gap); item.one.num:SetActive(time < v.free_gap); item.one.free:SetActive(time >= v.free_gap); if time < v.free_gap then if v.consume_id2 ~= 0 and ItemModule.GetItemCount(v.consume_id2) >= v.price2 then item.one.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.consume_id2.."_small"); item.one.num[UnityEngine.UI.Text].text = v.price2; else item.one.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.consume_id.."_small"); item.one.num[UnityEngine.UI.Text].text = v.price; end else item.freeTime[UnityEngine.UI.Text].text = ""; end if v.consume_id2 ~= 0 and ItemModule.GetItemCount(v.consume_id2) >= v.combo_count * v.combo_price2 then item.ten.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.consume_id2.."_small"); item.ten.num[UnityEngine.UI.Text].text = v.combo_count * v.combo_price2; else item.ten.icon[UnityEngine.UI.Image]:LoadSprite("icon/"..v.consume_id.."_small"); item.ten.num[UnityEngine.UI.Text].text = v.combo_count * v.combo_price; end end end end function View:ShowRewardPreview(id) self.preview_id = id; for k,v in pairs(self.preview_stage) do v:SetActive(false); end for k,v in pairs(self.preview_hero) do v:SetActive(false); end local rewardCfg = ActivityModule.GetDrawCardRewardConfig(id); local hero_list = {}; for i,v in ipairs(rewardCfg) do local heroCfg = module.HeroModule.GetConfig(v.role_id); if heroCfg then hero_list[heroCfg.role_stage] = hero_list[heroCfg.role_stage] or {}; table.insert(hero_list[heroCfg.role_stage], v); end end local content = self.dialog.preview.ScrollView.Viewport.Content; content[UnityEngine.RectTransform].anchoredPosition = CS.UnityEngine.Vector2(0, 0); for i=5,1,-1 do if hero_list[i] then local stageView = nil; if self.preview_stage[i] then stageView = self.preview_stage[i]; else local obj = CS.UnityEngine.GameObject.Instantiate(content.type.gameObject, content.transform); obj.name = "stage"..i; stageView = CS.SGK.UIReference.Setup(obj); stageView.Image[CS.UGUISpriteSelector].index = i - 1; self.preview_stage[i] = stageView; end table.sort(hero_list[i], function (a, b) if a.rate_up ~= b.rate_up then return a.rate_up > b.rate_up; end return a.role_id < b.role_id; end) for j,v in ipairs(hero_list[i]) do if self.preview_hero[v.role_id] then self.preview_hero[v.role_id].transform:SetSiblingIndex(j); self.preview_hero[v.role_id]:SetActive(true); else local obj = CS.UnityEngine.GameObject.Instantiate(stageView.npcInfo.gameObject, stageView.transform); obj.name = "icon_"..v.role_id; local hero = CS.SGK.UIReference.Setup(obj); local heroCfg = module.HeroModule.GetConfig(v.role_id); if heroCfg then hero.name[UnityEngine.UI.Text].text = heroCfg.name; utils.IconFrameHelper.Create(hero.IconFrame, {customCfg={ icon = heroCfg.mode, quality = heroCfg.role_stage, star = 0, level = 0, }, type = 42}) -- local listener = CS.UGUIPointerEventListener.Get(obj) -- if listener.isLongPress ~= nil then -- listener.isLongPress = true; -- end CS.UGUIClickEventListener.Get(obj).onClick = function() DialogStack.Push("HeroComposeFrame",{roleID = v.role_id}) end end self.preview_hero[v.role_id] = hero; self.preview_hero[v.role_id]:SetActive(true); end end self.preview_stage[i].gameObject.transform:SetSiblingIndex(6-i) self.preview_stage[i]:SetActive(true); else if self.preview_stage[i] then self.preview_stage[i]:SetActive(false); end end end self.dialog.preview:SetActive(true); end function View:Update() if Time.now() - self.updateTime >= 1 then self.updateTime = Time.now(); for i,v in ipairs(self.poolData) do if self.poolUI[v.id] then local item = self.poolUI[v.id]; local time = math.floor(v.CardData.last_free_time + v.free_gap - Time.now()); if time >= 0 then item.freeTime[UnityEngine.UI.Text]:TextFormat("{0}后免费", GetTimeFormat(time, 2)) else item.freeTime[UnityEngine.UI.Text].text = ""; end end end end end function View:initGuide() module.guideModule.PlayByType(116,0.2) end function View:OnDestroy() -- SetItemTipsState(true) SGK.BackgroundMusicService.SwitchMusic(); self.savedValues.pointReward = self.dialog.pointReward.gameObject.activeSelf; self.savedValues.preview = self.dialog.preview.gameObject.activeSelf; self.savedValues.preview_id = self.preview_id; self.savedValues.pointPage = self.pointPage; self.savedValues.curSelect = self.curSelect; end function View:deActive() utils.SGKTools.PlayDestroyAnim(self.gameObject) return true; end function View:listEvent() return { "Activity_INFO_CHANGE", "Change_Pool_Succeed", "SHOP_INFO_CHANGE", "SHOP_BUY_SUCCEED", "QUEST_INFO_CHANGE", "SHOP_BUY_FAILED", "DrawCard_Succeed", "LOCAL_GUIDE_CHANE", } end function View:onEvent(event, ...) print("onEvent", event, ...); local data = ...; if event == "Activity_INFO_CHANGE" or event == "Change_Pool_Succeed" then local poolData = self:GetPoolData(); self.poolData = {}; for k,v in pairs(poolData) do if ActivityModule.CheckPoolOpen(v.active_time) then table.insert(self.poolData, v); end end table.sort(self.poolData, function ( a,b ) return a.id < b.id; end) print("奖池配置", sprinttb(self.poolData)) self:UpdatePoolView(); elseif event == "SHOP_INFO_CHANGE" then if data == nil then return; end if data.id == 3001 then self.pointShop = ShopModule.GetManager(3001); print("商店信息3001", sprinttb(self.pointShop)) if self.dialog.pointReward.activeSelf then self:UpdatePointPage(true); end elseif data.id == 14 then self.exchangeShop = ShopModule.GetManager(14); print("商店信息14", sprinttb(self.exchangeShop)) if self.dialog.exchange.activeSelf then self:UpdateExchange(); end end elseif event == "SHOP_BUY_SUCCEED" then if data == nil then return; end if data.shop_id == 3001 then draw_card_data.last_select[self.pointPage] = self.point_list[self.curSelect].id; self.curSelect = 0; self.root.mask:SetActive(false); self.pointShop = ShopModule.GetManager(3001); if self.dialog.pointReward.activeSelf then self:UpdatePointPage(true); end self:UpdatePointView(); elseif data.shop_id == 14 then self.exchangeShop = ShopModule.GetManager(14); if self.dialog.exchange.activeSelf then self:UpdateExchange(); end end elseif event == "SHOP_BUY_FAILED" then if data == nil then return; end if data.shop_id == 3001 then self.root.mask:SetActive(false); showDlgError(nil, "兑换失败") end elseif event == "QUEST_INFO_CHANGE" then if self.point_buy then self.point_buy = false; for k,v in pairs(self.pointShop.shoplist) do if v.consume_item_id1 == self.pointQuest[self.pointPage].reward_id2 then ShopModule.Buy(3001, v.gid, 1, {product_index = self.point_list[self.curSelect].idx}) end end end self:CheckQuest(); for i,v in ipairs(self.pointQuest) do local quest = QuestModule.Get(v.id); if quest and quest.status == 0 then draw_card_data.last_select[i] = nil; end end if self.dialog.pointReward.activeSelf then self:UpdatePointPage(true); end elseif event == "DrawCard_Succeed" then self:UpdatePointView(); elseif event == "LOCAL_GUIDE_CHANE" then self:initGuide() end end return View;
local t = Def.ActorFrame{ -- LoadActor( "toasty.png" )..{ -- InitCommand=function(self) -- self:xy(SCREEN_WIDTH+100,SCREEN_CENTER_Y) -- end, -- StartTransitioningCommand=function(self) -- self:decelerate(0.25):x(SCREEN_WIDTH-100):sleep(1.75):accelerate(0.5):x(SCREEN_WIDTH+100) -- end -- }, -- LoadActor ( "toasty.ogg" )..{StartTransitioningCommand=function(self) -- self:play() -- end} } return t
object_building_kashyyyk_mun_kash_signpost_primitive_s01 = object_building_kashyyyk_shared_mun_kash_signpost_primitive_s01:new { } ObjectTemplates:addTemplate(object_building_kashyyyk_mun_kash_signpost_primitive_s01, "object/building/kashyyyk/mun_kash_signpost_primitive_s01.iff")
Test = {} function Test.hello() print("hello world") end
local position_on_screen = ... local Players = GAMESTATE:GetHumanPlayers() local SongOrCourse, StageNum, LetterGradesAF local path = "/"..THEME:GetCurrentThemeDirectory().."Graphics/_FallbackBanners/"..ThemePrefs.Get("VisualTheme") local banner_directory = FILEMAN:DoesFileExist(path) and path or THEME:GetPathG("","_FallbackBanners/Arrows") local t = Def.ActorFrame{ OnCommand=function(self) LetterGradesAF = self:GetParent():GetChild("LetterGradesAF") end, DrawPageCommand=function(self, params) self:finishtweening():sleep(position_on_screen*0.05):linear(0.15):diffusealpha(0) StageNum = ((params.Page-1)*4) + position_on_screen local stage = SL.Global.Stages.Stats[StageNum] SongOrCourse = stage ~= nil and stage.song or nil self:queuecommand("DrawStage") end, DrawStageCommand=function(self) if SongOrCourse == nil then self:visible(false) else self:finishtweening():queuecommand("Show"):visible(true) end end, -- black quad Def.Quad{ InitCommand=function(self) self:zoomto( _screen.w-40, 94):diffuse(0,0,0,0.5):y(-6) end }, --fallback banner LoadActor(banner_directory.."/banner"..SL.Global.ActiveColorIndex.." (doubleres).png")..{ InitCommand=function(self) self:y(-6):zoom(0.333) end, DrawStageCommand=function(self) self:visible(SongOrCourse ~= nil and not SongOrCourse:HasBanner()) end }, -- the banner, if there is one Def.Banner{ Name="Banner", InitCommand=function(self) self:y(-6) end, DrawStageCommand=function(self) if SongOrCourse then if GAMESTATE:IsCourseMode() then self:LoadFromCourse(SongOrCourse) else self:LoadFromSong(SongOrCourse) end self:setsize(418,164):zoom(0.333) end end }, -- the title of the song LoadFont("Common Normal")..{ InitCommand=function(self) self:zoom(0.8):y(-43):maxwidth(350) end, DrawStageCommand=function(self) if SongOrCourse then self:settext(SongOrCourse:GetDisplayFullTitle()) end end }, -- the BPM(s) of the song -- FIXME: the current layout of ScreenEvaluationSummary doesn't accommodate split BPMs -- so this is currently hardcoded to use the MasterPlayer's BPM values LoadFont("Common Normal")..{ InitCommand=function(self) self:zoom(0.6):y(30):maxwidth(350) end, DrawStageCommand=function(self) if SongOrCourse then local MusicRate = SL.Global.Stages.Stats[StageNum].MusicRate local mpn = GAMESTATE:GetMasterPlayerNumber() local StepsOrTrail = SL[ToEnumShortString(mpn)].Stages.Stats[StageNum].steps local bpms = StringifyDisplayBPMs(mpn, StepsOrTrail, MusicRate) if MusicRate ~= 1 then -- format a string like "150 - 300 bpm (1.5x Music Rate)" self:settext( ("%s bpm (%gx %s)"):format(bpms, MusicRate, THEME:GetString("OptionTitles", "MusicRate")) ) else -- format a string like "100 - 200 bpm" self:settext( ("%s bpm"):format(bpms)) end end end } } for player in ivalues(Players) do local playerStats, difficultyMeter, difficulty, stepartist, grade, score local TNSTypes = { 'W1', 'W2', 'W3', 'W4', 'W5', 'Miss' } -- variables for positioning and horizalign, dependent on playernumber local col1x, col2x, gradex, align1, align2 if player == PLAYER_1 then col1x = -90 col2x = -_screen.w/2.5 gradex = -_screen.w/3.33 align1 = right align2 = left elseif player == PLAYER_2 then col1x = 90 col2x = _screen.w/2.5 gradex = _screen.w/3.33 align1= left align2 = right end local PlayerStatsAF = Def.ActorFrame{ DrawStageCommand=function(self) playerStats = SL[ToEnumShortString(player)].Stages.Stats[StageNum] if playerStats then difficultyMeter = playerStats.meter difficulty = playerStats.difficulty stepartist = playerStats.stepartist grade = playerStats.grade score = playerStats.score end end } --percent score PlayerStatsAF[#PlayerStatsAF+1] = LoadFont("_wendy small")..{ InitCommand=function(self) self:zoom(0.5):horizalign(align1):x(col1x):y(-24) end, DrawStageCommand=function(self) if playerStats and score then -- trim off the % symbol local score = string.sub(FormatPercentScore(score),1,-2) -- If the score is < 10.00% there will be leading whitespace, like " 9.45" -- trim that too, so PLAYER_2's scores align properly. score = score:gsub(" ", "") self:settext(score):diffuse(Color.White) if grade and grade == "Grade_Failed" then self:diffuse(Color.Red) end else self:settext("") end end } -- letter grade if SL.Global.GameMode ~= "StomperZ" then PlayerStatsAF[#PlayerStatsAF+1] = Def.ActorProxy{ InitCommand=function(self) self:zoom(WideScale(0.275,0.3)):x( WideScale(194,250) * (player==PLAYER_1 and -1 or 1) ):y(-6) end, DrawStageCommand=function(self) if playerStats and grade then self:SetTarget( LetterGradesAF:GetChild(grade) ):visible(true) else self:visible(false) end end } end -- difficulty meter PlayerStatsAF[#PlayerStatsAF+1] = LoadFont("_wendy small")..{ InitCommand=function(self) self:zoom(0.4):horizalign(align1):x(col1x):y(4) end, DrawStageCommand=function(self) if playerStats and difficultyMeter then self:diffuse(DifficultyColor(difficulty)):settext(difficultyMeter) else self:settext("") end end } -- stepartist PlayerStatsAF[#PlayerStatsAF+1] = LoadFont("Common Normal")..{ InitCommand=function(self) self:zoom(0.65):horizalign(align1):x(col1x):y(28) end, DrawStageCommand=function(self) if playerStats and stepartist then self:settext(stepartist) else self:settext("") end end } -- numbers for i=1,#TNSTypes do PlayerStatsAF[#PlayerStatsAF+1] = LoadFont("_wendy small")..{ InitCommand=function(self) self:zoom(0.28):horizalign(align2):x(col2x):y(i*13 - 50) :diffuse( SL.JudgmentColors[SL.Global.GameMode][i] ) end, DrawStageCommand=function(self) if playerStats and playerStats.judgments then local val = playerStats.judgments[TNSTypes[i]] if val then self:settext(val) end self:visible( SL.Global.Stages.Stats[StageNum].TimingWindows[i] or i==#TNSTypes ) else self:settext("") end end } end t[#t+1] = PlayerStatsAF end return t