content stringlengths 5 1.05M |
|---|
local MJ_CARDS_TYPE = {
[1] = "🀇",
[2] = "🀈",
[3] = "🀉",
[4] = "🀊",
[5] = "🀋",
[6] = "🀌",
[7] = "🀍",
[8] = "🀎",
[9] = "🀏",
[11] = "🀐",
[12] = "🀑",
[13] = "🀒",
[14] = "🀓",
[15] = "🀔",
[16] = "🀕",
[17] = "🀖",
[18] = "🀗",
[19] = "🀘",
[21] = "🀙",
[22] = "🀚",
[23] = "🀛",
[24] = "🀜",
[25] = "🀝",
[26] = "🀞",
[27] = "🀟",
[28] = "🀠",
[29] = "🀡",
[31] = "🀁",
[32] = "🀂",
[33] = "🀃",
[34] = "🀅",
[35] = "🀄",
[36] = "🀆"
}
local card_list = {}
for i=1,30 do
if i % 10 ~= 0 then
card_list[i] = 4
end
end
card_list[35] = 4
local handle1 = {4,5,6,7,8,9,23,24,25,26,27,29,29}
local handle2 = {1,2,3,11,12,13,14,15,16,17,18,28,28}
for i,v in ipairs(handle2) do
table.insert(handle1,v)
end
local pool = handle1
table.insert(pool,28) -- 第一个人摸了个 28
-->第一个人出28
--第二个人碰 并且出牌18
table.insert(pool,27) -- 第一个人又摸了个27 --》 出牌27
table.insert(pool,28) -- 第二个人摸了个28 这个时候第二个人可以碰杠
--第二个人碰杠
--这个时候第一个人可以抢杠胡
for _,value in ipairs(pool) do
local num = card_list[value]
card_list[value] = num - 1
end
math.randomseed(tostring(os.time()):reverse():sub(1, 6))
local temp_list = {}
for k,v in pairs(card_list) do
if v ~= 0 then
for i=1,v do
table.insert(temp_list,k)
end
end
end
for i=1,#temp_list do
local idx = math.random(1,#temp_list)
local value = table.remove(temp_list,idx)
table.insert(pool,value)
end
for i,v in ipairs(pool) do
print(i,v)
end
return {pool=pool,zpos = 1} |
do
local _ = {
['steel-furnace'] = {
icon = '__base__/graphics/icons/steel-furnace.png',
close_sound = 0,
crafting_categories = {'smelting'},
working_visualisations = {
{
fadeout = true,
effect = 'flicker',
animation = {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-fire.png',
line_length = 8,
priority = 'high',
frame_count = 48,
width = 29,
hr_version = {
filename = '__base__/graphics/entity/steel-furnace/hr-steel-furnace-fire.png',
line_length = 8,
priority = 'high',
frame_count = 48,
width = 57,
direction_count = 1,
scale = 0.5,
height = 81,
shift = {-0.0234375, 0.1796875}
},
direction_count = 1,
height = 40,
shift = {-0.015625, 0.1875}
},
draw_as_light = true
}, {
fadeout = true,
effect = 'flicker',
animation = {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-glow.png',
blend_mode = 'additive',
frame_count = 1,
height = 43,
width = 60,
shift = {0.03125, 0.640625},
priority = 'high'
},
draw_as_light = true
}, {
fadeout = true,
effect = 'flicker',
animation = {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-working.png',
line_length = 1,
blend_mode = 'additive',
frame_count = 1,
width = 64,
hr_version = {
filename = '__base__/graphics/entity/steel-furnace/hr-steel-furnace-working.png',
line_length = 1,
blend_mode = 'additive',
frame_count = 1,
width = 128,
direction_count = 1,
scale = 0.5,
height = 150,
shift = {0, -0.15625},
priority = 'high'
},
direction_count = 1,
height = 74,
shift = {0, -0.125},
priority = 'high'
},
draw_as_light = true
}, {
draw_as_sprite = false,
fadeout = true,
effect = 'flicker',
animation = {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-ground-light.png',
line_length = 1,
blend_mode = 'additive',
draw_as_sprite = false,
width = 78,
hr_version = {
filename = '__base__/graphics/entity/steel-furnace/hr-steel-furnace-ground-light.png',
line_length = 1,
blend_mode = 'additive',
draw_as_sprite = false,
width = 152,
direction_count = 1,
scale = 0.5,
height = 126,
shift = {0.03125, 1.5},
priority = 'high',
frame_count = 1
},
direction_count = 1,
height = 64,
shift = {0, 1.5},
priority = 'high',
frame_count = 1
},
draw_as_light = true
}
},
name = 'steel-furnace',
water_reflection = {
rotate = false,
pictures = {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-reflection.png',
priority = 'extra-high',
scale = 5,
height = 24,
variation_count = 1,
width = 20,
shift = {0, 1.40625}
},
orientation_to_variation = false
},
vehicle_impact_sound = 0,
fast_replaceable_group = 'furnace',
energy_usage = '90kW',
collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
corpse = 'steel-furnace-remnants',
resistances = {{percent = 100, type = 'fire'}},
source_inventory_size = 1,
dying_explosion = 'steel-furnace-explosion',
icon_mipmaps = 4,
selection_box = {{-0.8, -1}, {0.8, 1}},
icon_size = 64,
type = 'furnace',
animation = {
layers = {
{
filename = '__base__/graphics/entity/steel-furnace/steel-furnace.png',
priority = 'high',
frame_count = 1,
height = 87,
width = 85,
shift = {-0.046875, 0.046875},
hr_version = {
filename = '__base__/graphics/entity/steel-furnace/hr-steel-furnace.png',
priority = 'high',
frame_count = 1,
height = 174,
width = 171,
shift = {-0.0390625, 0.0625},
scale = 0.5
}
}, {
filename = '__base__/graphics/entity/steel-furnace/steel-furnace-shadow.png',
draw_as_shadow = true,
priority = 'high',
frame_count = 1,
height = 43,
width = 139,
shift = {1.234375, 0.359375},
hr_version = {
filename = '__base__/graphics/entity/steel-furnace/hr-steel-furnace-shadow.png',
draw_as_shadow = true,
priority = 'high',
frame_count = 1,
height = 85,
width = 277,
shift = {1.2265625, 0.3515625},
scale = 0.5
}
}
}
},
open_sound = 0,
flags = {'placeable-neutral', 'placeable-player', 'player-creation'},
working_sound = {
audible_distance_modifier = 0.37,
fade_out_ticks = 20,
max_sounds_per_type = 4,
fade_in_ticks = 4,
sound = {{filename = '__base__/sound/steel-furnace.ogg', volume = 0.46}}
},
crafting_speed = 2,
max_health = 300,
result_inventory_size = 1,
energy_source = {
type = 'burner',
emissions_per_minute = 4,
effectivity = 1,
smoke = {
{
starting_frame_deviation = 60,
name = 'smoke',
frequency = 10,
starting_vertical_speed = 0.08,
position = {0.7, -1.2}
}
},
fuel_inventory_size = 1,
light_flicker = {minimum_intensity = 0.6, color = {0, 0, 0}, maximum_intensity = 0.95},
fuel_category = 'chemical'
},
damaged_trigger_effect = {
damage_type_filters = 'fire',
entity_name = 'spark-explosion',
type = 'create-entity',
offsets = {{0, 1}},
offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}}
},
minable = {mining_time = 0.2, result = 'steel-furnace'}
},
['stone-furnace'] = {
icon = '__base__/graphics/icons/stone-furnace.png',
working_visualisations = {
{
fadeout = true,
effect = 'flicker',
animation = {
layers = {
{
filename = '__base__/graphics/entity/stone-furnace/stone-furnace-fire.png',
line_length = 8,
priority = 'extra-high',
frame_count = 48,
width = 20,
axially_symmetrical = false,
direction_count = 1,
height = 49,
shift = {-0.015625, 0.171875},
hr_version = {
filename = '__base__/graphics/entity/stone-furnace/hr-stone-furnace-fire.png',
line_length = 8,
priority = 'extra-high',
frame_count = 48,
width = 41,
axially_symmetrical = false,
direction_count = 1,
scale = 0.5,
height = 100,
shift = {-0.0234375, 0.171875}
}
}, {
filename = '__base__/graphics/entity/stone-furnace/stone-furnace-light.png',
blend_mode = 'additive',
width = 54,
height = 74,
shift = {0, 0.125},
repeat_count = 48,
hr_version = {
filename = '__base__/graphics/entity/stone-furnace/hr-stone-furnace-light.png',
blend_mode = 'additive',
scale = 0.5,
height = 144,
width = 106,
repeat_count = 48,
shift = {0, 0.15625}
}
}
}
},
draw_as_light = true
}, {
draw_as_sprite = false,
fadeout = true,
effect = 'flicker',
animation = {
filename = '__base__/graphics/entity/stone-furnace/stone-furnace-ground-light.png',
width = 56,
blend_mode = 'additive',
draw_as_sprite = false,
height = 56,
shift = {0, 1.375},
repeat_count = 48,
hr_version = {
filename = '__base__/graphics/entity/stone-furnace/hr-stone-furnace-ground-light.png',
width = 116,
blend_mode = 'additive',
draw_as_sprite = false,
height = 110,
shift = {-0.03125, 1.375},
repeat_count = 48,
scale = 0.5
}
},
draw_as_light = true
}
},
max_health = 200,
water_reflection = {
rotate = false,
pictures = {
filename = '__base__/graphics/entity/stone-furnace/stone-furnace-reflection.png',
priority = 'extra-high',
scale = 5,
height = 16,
variation_count = 1,
width = 16,
shift = {0, 1.09375}
},
orientation_to_variation = false
},
close_sound = 0,
crafting_categories = {'smelting'},
next_upgrade = 'steel-furnace',
vehicle_impact_sound = 0,
open_sound = 0,
source_inventory_size = 1,
fast_replaceable_group = 'furnace',
energy_usage = '90kW',
collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
corpse = 'stone-furnace-remnants',
selection_box = {{-0.8, -1}, {0.8, 1}},
icon_size = 64,
dying_explosion = 'stone-furnace-explosion',
icon_mipmaps = 4,
resistances = {
{percent = 90, type = 'fire'}, {percent = 30, type = 'explosion'}, {percent = 30, type = 'impact'}
},
crafting_speed = 1,
type = 'furnace',
animation = {
layers = {
{
filename = '__base__/graphics/entity/stone-furnace/stone-furnace.png',
priority = 'extra-high',
frame_count = 1,
height = 64,
width = 81,
shift = {0.453125, 0.0625},
hr_version = {
filename = '__base__/graphics/entity/stone-furnace/hr-stone-furnace.png',
priority = 'extra-high',
frame_count = 1,
height = 146,
width = 151,
shift = {-0.0078125, 0.1875},
scale = 0.5
}
}, {
filename = '__base__/graphics/entity/stone-furnace/stone-furnace-shadow.png',
draw_as_shadow = true,
priority = 'extra-high',
frame_count = 1,
height = 64,
width = 81,
shift = {0.453125, 0.0625},
hr_version = {
filename = '__base__/graphics/entity/stone-furnace/hr-stone-furnace-shadow.png',
draw_as_shadow = true,
priority = 'extra-high',
frame_count = 1,
height = 74,
width = 164,
shift = {0.453125, 0.40625},
scale = 0.5
}
}
}
},
name = 'stone-furnace',
flags = {'placeable-neutral', 'placeable-player', 'player-creation'},
working_sound = {
fade_in_ticks = 4,
audible_distance_modifier = 0.4,
fade_out_ticks = 20,
sound = {{filename = '__base__/sound/furnace.ogg', volume = 0.6}}
},
repair_sound = {
{filename = '__base__/sound/manual-repair-simple-1.ogg', volume = 0.5},
{filename = '__base__/sound/manual-repair-simple-2.ogg', volume = 0.5},
{filename = '__base__/sound/manual-repair-simple-3.ogg', volume = 0.5},
{filename = '__base__/sound/manual-repair-simple-4.ogg', volume = 0.5},
{filename = '__base__/sound/manual-repair-simple-5.ogg', volume = 0.4}
},
mined_sound = {filename = '__base__/sound/deconstruct-bricks.ogg', volume = 0.8},
result_inventory_size = 1,
energy_source = {
type = 'burner',
emissions_per_minute = 2,
effectivity = 1,
smoke = {
{
deviation = {0.1, 0.1},
name = 'smoke',
frequency = 5,
starting_vertical_speed = 0.08,
starting_frame_deviation = 60,
position = {0, -0.8}
}
},
fuel_inventory_size = 1,
light_flicker = {minimum_intensity = 0.6, color = {0, 0, 0}, maximum_intensity = 0.95},
fuel_category = 'chemical'
},
damaged_trigger_effect = {
damage_type_filters = 'fire',
entity_name = 'rock-damaged-explosion',
type = 'create-entity',
offsets = {{0, 1}},
offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}}
},
minable = {mining_time = 0.2, result = 'stone-furnace'}
},
['electric-furnace'] = {
icon = '__base__/graphics/icons/electric-furnace.png',
working_visualisations = {
{
fadeout = true,
animation = {
layers = {
{
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-heater.png',
width = 25,
animation_speed = 0.5,
frame_count = 12,
height = 15,
shift = {0.015625, 0.890625},
priority = 'high',
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-heater.png',
width = 60,
animation_speed = 0.5,
frame_count = 12,
height = 56,
shift = {0.0546875, 1.0234375},
scale = 0.5,
priority = 'high'
}
}, {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-light.png',
blend_mode = 'additive',
width = 104,
height = 102,
shift = {0, 0},
repeat_count = 12,
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-light.png',
blend_mode = 'additive',
scale = 0.5,
height = 202,
width = 202,
repeat_count = 12,
shift = {0.03125, 0}
}
}
}
},
draw_as_light = true
}, {
fadeout = true,
draw_as_sprite = false,
animation = {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-ground-light.png',
blend_mode = 'additive',
height = 64,
width = 82,
shift = {0.125, 2.125},
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-ground-light.png',
blend_mode = 'additive',
scale = 0.5,
height = 124,
width = 166,
shift = {0.09375, 2.15625}
}
},
draw_as_light = true
}, {
animation = {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-propeller-1.png',
width = 19,
animation_speed = 0.5,
frame_count = 4,
height = 13,
shift = {-0.671875, -0.640625},
priority = 'high',
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-propeller-1.png',
width = 37,
animation_speed = 0.5,
frame_count = 4,
height = 25,
shift = {-0.640625, -0.578125},
scale = 0.5,
priority = 'high'
}
}
}, {
animation = {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-propeller-2.png',
width = 12,
animation_speed = 0.5,
frame_count = 4,
height = 9,
shift = {0.0625, -1.234375},
priority = 'high',
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-propeller-2.png',
width = 23,
animation_speed = 0.5,
frame_count = 4,
height = 15,
shift = {0.109375, -1.1875},
scale = 0.5,
priority = 'high'
}
}
}
},
animation = {
layers = {
{
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-base.png',
priority = 'high',
frame_count = 1,
height = 100,
width = 129,
shift = {0.421875, 0},
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace.png',
priority = 'high',
frame_count = 1,
height = 219,
width = 239,
shift = {0.0234375, 0.1796875},
scale = 0.5
}
}, {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-shadow.png',
draw_as_shadow = true,
priority = 'high',
frame_count = 1,
height = 100,
width = 129,
shift = {0.421875, 0},
hr_version = {
filename = '__base__/graphics/entity/electric-furnace/hr-electric-furnace-shadow.png',
draw_as_shadow = true,
priority = 'high',
frame_count = 1,
height = 171,
width = 227,
shift = {0.3515625, 0.2421875},
scale = 0.5
}
}
}
},
close_sound = 0,
crafting_categories = {'smelting'},
water_reflection = {
rotate = false,
pictures = {
filename = '__base__/graphics/entity/electric-furnace/electric-furnace-reflection.png',
priority = 'extra-high',
scale = 5,
height = 24,
variation_count = 1,
width = 24,
shift = {0.15625, 1.25}
},
orientation_to_variation = false
},
vehicle_impact_sound = 0,
name = 'electric-furnace',
source_inventory_size = 1,
fast_replaceable_group = 'furnace',
energy_usage = '180kW',
collision_box = {{-1.2, -1.2}, {1.2, 1.2}},
corpse = 'electric-furnace-remnants',
selection_box = {{-1.5, -1.5}, {1.5, 1.5}},
damaged_trigger_effect = {
damage_type_filters = 'fire',
entity_name = 'spark-explosion',
type = 'create-entity',
offsets = {{0, 1}},
offset_deviation = {{-0.5, -0.5}, {0.5, 0.5}}
},
dying_explosion = 'electric-furnace-explosion',
icon_mipmaps = 4,
resistances = {{percent = 80, type = 'fire'}},
open_sound = 0,
type = 'furnace',
allowed_effects = {'consumption', 'speed', 'productivity', 'pollution'},
module_specification = {module_info_icon_shift = {0, 0.8}, module_slots = 2},
flags = {'placeable-neutral', 'placeable-player', 'player-creation'},
working_sound = {
fade_in_ticks = 4,
audible_distance_modifier = 0.6,
fade_out_ticks = 20,
sound = {filename = '__base__/sound/electric-furnace.ogg', volume = 0.6}
},
max_health = 350,
icon_size = 64,
result_inventory_size = 1,
energy_source = {type = 'electric', emissions_per_minute = 1, usage_priority = 'secondary-input'},
crafting_speed = 2,
minable = {mining_time = 0.2, result = 'electric-furnace'}
}
};
return _;
end
|
-- WinSetting
-- author by Liu Hao
-- 2017/06/18
local Lplus = require "Lplus"
local UserData = require "UserData"
local RenderManager = require "RenderManager"
local WinSetting = Lplus.Class("WinSetting")
local def = WinSetting.define
def.field("number").m_width = 0
def.field("number").m_height = 0
def.field("boolean").m_bFullScreen = false
def.field("number").m_scale = 0
local instance = nil
def.static("=>",WinSetting).Instance = function ()
if instance == nil then
instance = WinSetting()
end
return instance
end
def.method().Init = function(self)
self.m_width = UserData.Instance():GetSystemCfg("Width")
self.m_height = UserData.Instance():GetSystemCfg("Height")
self.m_scale = UserData.Instance():GetSystemCfg("Scale")
end
def.method("number","number","number").onSizeChanged = function(self,width,height,scale)
self.m_width = width
self.m_height = height
self.m_scale = scale
UserData.Instance():SetSystemCfg("Width",self.m_width)
UserData.Instance():SetSystemCfg("Height",self.m_height)
UserData.Instance():SetSystemCfg("Scale",self.m_scale)
RenderManager.Instance():OnWindowResize(scale)
end
WinSetting.Commit()
return WinSetting |
package.path = package.path .. ";"..app.dir.."/Lib/lua/?.lua"
--package.path = package.path .. ";"..app.datadir.."/Lib/lua/?.lua"
package.cpath = package.cpath .. ";"..app.dir.."/Lib/clibs/?.dll"
ctk = require "Catalunya"
require "Underscript"
usrun = require "Underscript.Runner"
usrun.options.redirectio = true
require "Forge"
require "luaonlua.preloaded"
local reqbuildermenu = {}
reqbuildermenu.msgnotext = 'No text selected.'
reqbuildermenu.msgnourl = 'Not a valid URL.'
reqbuildermenu.warnedualimit = false
function reqbuildermenu:openinbrowser()
local text = reqbuilder.edit.gettext()
if ctk.string.beginswith(string.lower(text),'http') then
browser.newtab(text)
else
app.showmessage(reqbuildermenu.msgnourl)
end
end
function reqbuildermenu:run(func)
local sel = reqbuilder.edit.getsel()
if sel ~= '' then
local res = func(sel)
reqbuilder.edit.replacesel(res)
else
app.showmessage(reqbuildermenu.msgnotext)
end
end
function reqbuildermenu:spliturl()
local text = reqbuilder.edit.gettext()
if text ~= '' then
text = ctk.string.replace(text,'?','?'..string.char(10))
text = ctk.string.replace(text,'&',string.char(10)..'&')
reqbuilder.edit.settext(text)
end
end
reqbuilder.edit = activecodeedit
reqbuilder.menu = reqbuildermenu
Sandcat = {}
Sandcat.reqbuildermenu = reqbuildermenu |
----Events-----
function Ignis_OnCombat(pUnit, Event)
pUnit:SendChatMessage(14, 0, "Insolent whelps! Your blood will temper the weapons used to reclaim this world!")
end
function Ignis_OnDied(pUnit, Event)
pUnit:SendChatMessage(14, 0, "I. Have. Failed.")
end
function Ignis_OnKilledPlayer(pUnit, Event)
pUnit:SendChatMessage(14, 0, "More scraps for the scrapheap!")
pUnit:SendChatMessage(14, 0, "Your bones will serve as kindling!")
end
----Phases-----
function Phase_1(pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("FlameJets", 2700, 0)
pUnit:RegisterEvent("Scorch", 15000, 0)
pUnit:RegisterEvent("SlagPot", 6000, 0)
pUnit:RegisterEvent("Phase_2", 1000, 0)
end
function Phase_2(pUnit, Event)
if pUnit:GetHealthPct() <= 40 then
pUnit:RegisterEvent("IronConstruct", 60000, 0)
end
end
----Spells----
function FlameJets(pUnit, Event)
pUnit:CastSpellOnTarget(62680, pUnit:GetRandomPlayer(0))
end
function Scorch(pUnit, Event)
pUnit:FullCastSpellOnTarget(62546, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "Let the inferno consume you!")
pUnit:SendChatMessage(14, 0, "BURN! Burn in the makers fire!")
end
function SlagPot(pUnit, Event)
pUnit:FullCastSpellOnTarget(62717, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "I will burn away your impurities!")
end
function IronConstruct(pUnit, Event)
pUnit:SendChatMessage(14, 0, "Arise, soldiers of the Iron Crucible! The Makers' will be done!")
pUnit:GetX()
pUnit:GetY()
pUnit:GetZ()
pUnit:GetO()
pUnit:SpawnCreature(33121, x, y, z, o, 14, 0)
end
RegisterUnitEvent(33118, 1, "Ignis_OnCombat")
RegisterUnitEvent(33118, 3, "Ignis_OnKilledPlayer")
RegisterUnitEvent(33118, 4, "Ignis_OnDied")
RegisterUnitEvent(33816, 1, "Defender_OnCombat") |
Factory = {}
Operation = {}
function Factory:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function Operation:new(o)
o = o or {}
setmetatable(o,self)
self.__index = self
return o
end
OperationAdd = Operation:new()
function OperationAdd:GetResult()
if self.numberA and self.numberB then
return self.numberA + self.numberB
else
return "error"
end
end
FactoryAdd = Factory:new()
function FactoryAdd:CreateOperation()
return OperationAdd:new()
end
OperationSub = Operation:new()
function OperationSub:GetResult()
if self.numberA and self.numberB then
return self.numberA - self.numberB
else
return "error"
end
end
FactorySub = Factory:new()
function FactorySub:CreateOperation()
return OperationSub:new()
end
OperationMul = Operation:new()
function OperationMul:GetResult()
if self.numberA and self.numberB then
return self.numberA * self.numberB
else
return "error"
end
end
FactoryMul = Factory:new()
function FactoryMul:CreateOperation()
return OperationMul:new()
end
OperationDiv = Operation:new()
function OperationDiv:GetResult()
if self.numberA and self.numberB then
return self.numberA / self.numberB
else
return "error"
end
end
FactoryDiv = Factory:new()
function FactoryDiv:CreateOperation()
return OperationDiv:new()
end
operAddFactory = FactoryAdd:new()
operAdd = operAddFactory:CreateOperation()
operAdd.numberA = 10
operAdd.numberB = 5
print(operAdd:GetResult())
operSubFactory = FactorySub:new()
operSub = operSubFactory:CreateOperation()
operSub.numberA = 10
operSub.numberB = 5
print(operSub:GetResult())
operMulFactory = FactoryMul:new()
operMul = operMulFactory:CreateOperation()
operMul.numberA = 10
operMul.numberB = 5
print(operMul:GetResult())
operDivFactory = FactoryDiv:new()
operDiv = operDivFactory:CreateOperation()
operDiv.numberA = 10
operDiv.numberB = 5
print(operDiv:GetResult())
|
-- Copyright 2020 Wirepath Home Systems, LLC. All rights reserved.
COMMON_LIB_VER = 26
JSON = require ('drivers-common-public.module.json')
pcall (require, 'drivers-common-internal.global.production')
do -- set AES and SHA defaults
AES_DEC_DEFAULTS = {
return_encoding = 'NONE',
key_encoding = 'NONE',
iv_encoding = 'NONE',
data_encoding = 'BASE64',
padding = true,
}
AES_ENC_DEFAULTS = {
return_encoding = 'BASE64',
key_encoding = 'NONE',
iv_encoding = 'NONE',
data_encoding = 'NONE',
padding = true,
}
SHA_ENC_DEFAULTS = {
return_encoding = 'NONE',
data_encoding = 'NONE',
}
end
do -- Set common var IDs
ROOM_VARS = {
['CURRENT_SELECTED_DEVICE'] = 1000,
['CURRENT_AUDIO_DEVICE'] = 1001,
['CURRENT_VIDEO_DEVICE'] = 1002,
['AUDIO_VOLUME_DEVICE'] = 1003,
['VIDEO_VOLUME_DEVICE'] = 1004,
['CURRENT_MEDIA'] = 1005,
['CURRENT_AUDIO_PATH'] = 1007,
['CURRENT_VIDEO_PATH'] = 1008,
['CURRENT_VIDEO_AUDIO_PATH'] = 1009,
['POWER_STATE'] = 1010,
['CURRENT_VOLUME'] = 1011,
['TEMPERATURE_ID'] = 1012,
['TEMPERATURE_CONTROL_ID'] = 1013,
['SECURITY_SYSTEM_ID'] = 1014,
['CURRENT_VOLUME_DEVICE_ID'] = 1015,
['HAS_DISCRETE_VOLUME'] = 1016,
['HAS_DISCRETE_MUTE'] = 1017,
['IS_MUTED'] = 1018,
['IN_NAVIGATION '] = 1019,
['USE_DEFAULT_VOLUMES'] = 1020,
['DEFAULT_AUDIO_VOLUME'] = 1021,
['VOLUME_IS_LINKED'] = 1023,
['DEFAULT_VIDEO_VOLUME'] = 1022,
['LINKED_ROOM_LIST'] = 1024,
['MUTE_IS_LINKED'] = 1025,
['ROOMOFF_IS_LINKED'] = 1026,
['SELECTIONS_LINKED'] = 1027,
['CURRENT_LINKED_MEDIA_SCENE'] = 1028,
['ROOM_HIDDEN'] = 1029,
['MEDIA_SCENE_ACTIVE'] = 1030,
['CURRENT MEDIA INFO'] = 1031,
['LAST_DEVICE_GROUP'] = 1032,
['AVAILABLE_CAMERAS'] = 1033,
['POOLS'] = 1034,
['SCENE_IS_DISCRETE_VOLUME'] = 1035,
['PLAYING_AUDIO_DEVICE'] = 1036,
['ANNOUNCEMENT_DISABLED'] = 1037,
}
DIGITAL_AUDIO_VARS = {
['ROOM_HISTORY'] = 1002,
['ROOM_QUEUE_SETTINGS'] = 1003,
['QUEUE_STATUS'] = 1004,
['QUEUE_INFO'] = 1005,
['QUEUE_STATUS_V2'] = 1006,
['QUEUE_INFO_V2'] = 1007,
['PLAY_PREFERENCE'] = 1008,
['ROOM_MAP_INFO'] = 1009,
['AUDIO LATENCY PROFILE'] = 1010,
['MAX_AUDIO_QUALITY'] = 1011,
['AUDIO_MODE_VER'] = 1012,
['AUDIO_FORCED_ADV'] = 2000,
}
PROJECT_VARS = {
['ZIPCODE'] = 1000,
['LATITUDE'] = 1001,
['LONGITUDE'] = 1002,
}
end
do -- LOCALE FIXING FOR tostring AND tonumber
if (not tostring_native) then
tostring_native = tostring
end
if (not tonumber_native) then
tonumber_native = tonumber
end
LOCALE_USES_COMMA_DECIMAL_SEPARATORS = (tonumber ('0.5') == nil)
function tostring_return_comma (v)
local ret = tostring_native (v)
if (type (v) == 'number') then
ret = string.gsub (ret, '%.', '%,')
end
return (ret)
end
function tostring_return_period (v)
local ret = tostring_native (v)
if (type (v) == 'number') then
ret = string.gsub (ret, '%,', '%.')
end
return (ret)
end
function tonumber_expect_comma (e, base)
local ret = tonumber_native (e, base)
if (ret == nil) then
if (type (e) == 'string') then
e = string.gsub (e, '%.', '%,')
ret = tonumber_native (e, base)
end
end
return (ret)
end
function tonumber_expect_period (e, base)
local ret = tonumber_native (e, base)
if (ret == nil) then
if (type (e) == 'string') then
e = string.gsub (e, '%,', '%.')
ret = tonumber_native (e, base)
end
end
return (ret)
end
if (LOCALE_USES_COMMA_DECIMAL_SEPARATORS) then
tonumber = tonumber_expect_comma
end
end
function dbg (strDebugText, ...)
if (DEBUGPRINT) then
print (os.date ('%x %X : ') .. (strDebugText or ''), ...)
C4:DebugLog (strDebugText)
end
end
function dbgdump (strDebugText, ...)
if (DEBUGPRINT) then hexdump (strDebugText or '') print (...) end
end
function gettext (text)
return (text)
end
function Print (data)
if (type (data) == 'table') then
for k, v in pairs (data) do print (k, v) end
elseif (type (data) ~= 'nil') then
print (type (data), data)
else
print ('nil value')
end
end
function CopyTable (t, shallowCopy)
if (type (t) ~= 'table') then
return
end
local seenTables = {}
local r = {}
for k, v in pairs (t) do
if (type (v) == 'number' or type (v) == 'string' or type (v) == 'boolean') then
r [k] = v
elseif (type (v) == 'table') then
if (shallowCopy ~= true) then
if (seenTables [v]) then
r [k] = seenTables [v]
else
r [k] = CopyTable (v)
seenTables [v] = r [k]
end
end
end
end
return (r)
end
function VersionCheck (requires_version)
local curver = {}
curver [1], curver [2], curver [3], curver [4] = string.match (C4:GetVersionInfo ().version, '^(%d*)%.?(%d*)%.?(%d*)%.?(%d*)')
local reqver = {}
reqver [1], reqver [2], reqver [3], reqver [4] = string.match (requires_version, '^(%d*)%.?(%d*)%.?(%d*)%.?(%d*)')
for i = 1, 4 do
local cur = tonumber (curver [i]) or 0
local req = tonumber (reqver [i]) or 0
if (cur > req) then
return true
end
if (cur < req) then
return false
end
end
return true
end
function GetLocationInfo ()
local proj = XMLDecode (C4:GetProjectItems ('LOCATIONS', 'LIMIT_DEVICE_DATA', 'NO_ROOT_TAGS'))
local lat = string.match (proj, '<latitude>(.-)</latitude>')
local long = string.match (proj, '<longitude>(.-)</longitude>')
local cc = string.match (proj, '<country_code>(.-)</country_code>')
local zip = string.match (proj, '<zipcode>(.-)</zipcode>')
local city = string.match (proj, '<city_name>(.-)</city_name>')
if (lat == '') then lat = nil end
if (long == '') then long = nil end
if (cc == '') then cc = nil end
if (zip == '') then zip = nil end
if (city == '') then city = nil end
return lat, long, cc, zip, city
end
function ConvertTime (data, incHours)
-- Converts a string of [HH:]MM:SS to an integer representing the number of seconds
-- Converts an integer number of seconds to a string of [HH:]MM:SS. If HH is zero, it is omitted unless incHours is true
if (data == nil) then
return (0)
elseif (type (data) == 'number') then
local strTime = ''
local strHours, strMinutes, strSeconds
local seconds = data % 60
local minutes = math.floor (data / 60) % 60
local hours = math.floor (data / 3600)
strHours = string.format('%d', hours)
if (hours ~= 0 or incHours) then
strTime = strHours .. ':'
strMinutes = string.format('%02d', minutes)
else
strMinutes = string.format('%d', minutes)
end
strSeconds = string.format('%02d', seconds)
strTime = strTime .. strMinutes .. ':' .. strSeconds
return strTime
elseif (type (data) == 'string') then
local hours, minutes, seconds = string.match (data, '^(%d-):(%d-):?(%d-)$')
if (hours == '') then hours = nil end
if (minutes == '') then minutes = nil end
if (seconds == '') then seconds = nil end
if (hours and not minutes) then minutes = hours hours = 0
elseif (minutes and not hours ) then hours = 0
elseif (not minutes and not hours) then minutes = 0 hours = 0 seconds = seconds or 0
end
hours, minutes, seconds = tonumber (hours), tonumber (minutes), tonumber (seconds)
return ((hours * 3600) + (minutes * 60) + seconds)
end
end
function XMLDecode (s)
if (type (s) ~= 'string') then
return (s)
end
s = string.gsub (s, '%<%!%[CDATA%[(.-)%]%]%>', function (a) return (a) end)
s = string.gsub (s, '"' , '"')
s = string.gsub (s, '<' , '<')
s = string.gsub (s, '>' , '>')
s = string.gsub (s, ''' , '\'')
s = string.gsub (s, '&#x(.-);', function (a) return string.char (tonumber (a, 16) % 256) end )
s = string.gsub (s, '&#(.-);', function (a) return string.char (tonumber (a) % 256) end )
s = string.gsub (s, '&' , '&')
return s
end
function XMLEncode (s)
if (type (s) ~= 'string') then
return (s)
end
s = string.gsub (s, '&', '&')
s = string.gsub (s, '"', '"')
s = string.gsub (s, '<', '<')
s = string.gsub (s, '>', '>')
s = string.gsub (s, '\'', ''')
return s
end
function XMLTag (strName, tParams, tagSubTables, xmlEncodeElements, tAttribs)
local retXML = {}
local addTag = function (tagName, closeTag)
if (tagName == nil) then return end
if (closeTag) then
tagName = string.match (tostring (tagName), '^(%S+)')
end
if (tagName and tagName ~= '') then
table.insert (retXML, '<')
if (closeTag) then
table.insert (retXML, '/')
end
table.insert (retXML, tostring (tagName))
table.insert (retXML, '>')
end
end
if (type (strName) == 'table' and tParams == nil) then
tParams = strName
strName = nil
end
if (strName and tAttribs and type (tAttribs) == 'table') then
local attribs = {
strName
}
for k, v in pairs (tAttribs) do
local a = {
tostring (k),
'=',
'"',
XMLEncode (tostring (v)),
'"',
}
a = table.concat (a)
table.insert (attribs, a)
end
strName = table.concat (attribs, ' ')
end
addTag (strName)
if (type (tParams) == 'table') then
local arraySize = #tParams
local tableSize = 0
for _, _ in pairs (tParams) do
tableSize = tableSize + 1
end
if (arraySize == tableSize) then
for _, subItem in ipairs (tParams) do
table.insert (retXML, XMLTag (nil, subItem, tagSubTables, xmlEncodeElements))
end
else
for k, v in pairs (tParams) do
if (v == nil) then v = '' end
if (type (v) == 'table') then
if (k == 'image_list') then
for _, image_list in pairs (v) do
table.insert (retXML, image_list)
end
elseif (tagSubTables == true) then
table.insert (retXML, XMLTag (k, v, tagSubTables, xmlEncodeElements))
end
else
if (v == nil) then v = '' end
addTag (k)
if (xmlEncodeElements ~= false) then
table.insert (retXML, XMLEncode (tostring (v)))
else
table.insert (retXML, tostring (v))
end
addTag (k, true)
end
end
end
elseif (tParams) then
if (xmlEncodeElements ~= false) then
table.insert (retXML, XMLEncode (tostring (tParams)))
else
table.insert (retXML, tostring (tParams))
end
end
addTag (strName,true)
return (table.concat (retXML))
end
--[[
-- tests on tag = tag
local t1 = '<a>b</a><tag>test string</tag><a>b</a>' -- 'test string', nil
local t2 = '<a>b</a><tag testattrib="testval" testattrib2="test val">test</tag><a>b</a>' -- test, {testattrib = 'testval', testattrib2 = 'test val'}
local t3 = '<a>b</a><ta g>test string</tag><a>b</a>' -- nil, nil
local t4 = '<a>b</a><tagattrib>asdf</tagattrib>' -- nil, nil
local t5 = '<a>b</a><tag/><a>b</a>' -- '', nil
local t6 = '<a>b</a><tag /><a>b</a>' -- '', nil
local t7 = '<a>b</a><tag testattrib="testval" testattrib2="test val"/><a>b</a>' -- '', , {testattrib = 'testval', testattrib2 = 'test val'}
local t8 = '<a>b</a><tag testattrib="testval" testattrib2="test val" /><a>b</a>' -- '', , {testattrib = 'testval', testattrib2 = 'test val'}
--]]
function XMLCapture (xmlString, tag)
-- plain tag
local tagContents = string.match (xmlString, '<' .. tag .. '>(.-)</' .. tag .. '>')
if (tagContents) then
return tagContents, nil
end
-- tag with attributes
local attributes, tagContents = string.match (xmlString, '<' .. tag .. '%s+(%S.-)>(.-)</' .. tag .. '>')
if (attributes and tagContents) then
return tagContents, attributes
end
-- self closing tag
local selfClosed = string.match (xmlString, '<' .. tag .. '%s-/>')
if (selfClosed) then
return '', nil
end
-- self closing tag with attributes
local attributes = string.match (xmlString, '<' .. tag .. '%s+(%S.-)%s-/>')
if (attributes) then
return '', attributes
end
end
function RefreshNavs ()
local cli = C4:CreateTCPClient ()
:OnConnect (function (client)
client:Write ('<c4soap name="PIP" async="1"></c4soap>\0'):Close ()
end)
:OnError (function (client)
client:Close ()
end)
cli:Connect ('127.0.0.1', 5020)
end
function HideProxyInAllRooms (idBinding)
idBinding = idBinding or 0
if (idBinding == 0) then return end -- silently fail if no binding passed in.
-- Get Bound Proxy's Device ID / Name.
local id, name = next(C4:GetBoundConsumerDevices(C4:GetDeviceID(), idBinding))
-- Send hide command to all rooms, for 'ALL' Navigator groups.
for roomid, roomname in pairs(C4:GetDevicesByC4iName('roomdevice.c4i') or {}) do
dbg ('Hiding device:"' .. name .. '" in room "' .. roomname .. '"')
C4:SendToDevice(roomid, 'SET_DEVICE_HIDDEN_STATE', {PROXY_GROUP = 'ALL', DEVICE_ID = id, IS_HIDDEN = true})
end
end
function GetFileName (deviceId)
if (deviceId == nil) then
deviceId = C4:GetDeviceID ()
end
local info = C4:GetDevices ({DeviceIds = tostring (deviceId)})
if (info and info [deviceId]) then
local driverFileName = info [deviceId].driverFileName
return driverFileName
end
end
function F2C (f)
if (type (f) ~= 'number') then
return
end
local c = (f - 32) * (5 / 9)
c = math.floor ((c * 2) + 0.5) / 2
return (c)
end
function C2F (c)
if (type (c) ~= 'number') then
return
end
local f = (c * (9 / 5)) + 32
f = math.floor (f + 0.5)
return (f)
end
function Serialize (d)
if (type (d) == 'table') then
local j = JSON:encode (d)
if (j) then
local b64 = C4:Base64Encode (j)
if (b64) then
return (b64)
end
end
end
return (d)
end
function Deserialize (b64)
if (type (b64) == 'string') then
local j = C4:Base64Decode (b64)
if (j) then
local d = JSON:decode (j)
if (d) then
return (d)
end
end
end
return (b64)
end
function SaltedEncrypt (key, plaintext)
local cipher = 'AES-256-CBC'
local options = AES_ENC_DEFAULTS
local prepend_random = {}
for i = 1, 16 do
local randomChar = string.char (math.random (0, 255))
table.insert (prepend_random, randomChar)
end
prepend_random = table.concat (prepend_random)
local data = prepend_random .. plaintext
if (string.len (key) ~= 32) then
key = C4:Hash ('SHA256', key, SHA_ENC_DEFAULTS)
end
local result, errString = C4:Encrypt (cipher, key, nil, data, options)
return result, errString
end
function SaltedDecrypt (key, ciphertext)
local cipher = 'AES-256-CBC'
local options = AES_DEC_DEFAULTS
local data = ciphertext
if (string.len (key) ~= 32) then
key = C4:Hash ('SHA256', key, SHA_ENC_DEFAULTS)
end
local result, error = C4:Decrypt (cipher, key, nil, data, options)
if (result) then
result = string.sub (result, 17, -1)
end
return result, error
end
function EscapeForLuaPattern (s)
if (type (s) ~= 'string') then
return
end
local matches = {
['%'] = '%%',
['^'] = '%^',
['$'] = '%$',
['('] = '%(',
[')'] = '%)',
['.'] = '%.',
['['] = '%[',
[']'] = '%]',
['*'] = '%*',
['+'] = '%+',
['-'] = '%-',
['?'] = '%?',
}
return string.gsub (s, '.', matches)
end
function ShowPopupEverywhere (message, ok, delay, imgUrl)
local params = {
VAR_DEVICE_ID = 0,
SIZE = 100,
MESSAGE = (message or ''),
SHOWOK = (ok and 'True') or 'False',
DELAY = (delay or 0),
IMGURL = (imgUrl or ''),
VAR_VARIABLE_ID = 0,
}
local uiDevices = C4:GetProxyDevicesByName ('uidevice')
for deviceId, _ in pairs (uiDevices or {}) do
C4:SendToDevice (deviceId, 'SHOW_POPUP', params, true)
end
end
function HideCurrentPopupEverywhere ()
local uiDevices = C4:GetProxyDevicesByName ('uidevice')
for deviceId, _ in pairs (uiDevices or {}) do
C4:SendToDevice (deviceId, 'HIDE_POPUP', {}, true)
end
end
function GetProject ()
local h = C4:GetProjectItems ('DEVICES', 'PROXIES', 'LOCATIONS', 'NO_ROOT_TAGS', 'LIMIT_DEVICE_DATA')
h = string.gsub (h, '<state>.-</state>', '')
h = string.gsub (h, '<itemdata>.-</itemdata>', '')
h = string.gsub (h, '<created_datetime>.-</created_datetime>', '')
h = string.gsub (h, '<%w+/>', '')
h = string.gsub (h, '>%s+<', '><')
h = string.gsub (h, '><', '>\r\n<')
h = h .. '\r\n'
local p = {'{"project" : '}
local c
local item = 0
local subitem = 0
for line in string.gmatch (h, '(.-)\r\n') do
if (string.find (line, '^<item')) then
table.insert (p, '{')
item = item + 1
elseif (string.find (line, '^</item>')) then
table.insert (p, '},')
item = item - 1
elseif (string.find (line, '^<subitems>')) then
table.insert (p, '"subItems" : [')
subitem = subitem + 1
elseif (string.find (line, '^</subitems>')) then
table.insert (p, '],')
subitem = subitem - 1
elseif (string.find (line, '^<id>')) then
local id = string.match (line, '<id>(.-)</id>')
if (id) then
table.insert (p, '"id" : ' .. id .. ',')
end
elseif (string.find (line, '^<c4i>')) then
local c4i = string.match (line, '<c4i>(.-)</c4i>')
if (c4i) then
table.insert (p, '"c4i" : "' .. c4i .. '",')
end
elseif (string.find (line, '^<type>')) then
local deviceType = string.match (line, '<type>(.-)</type>')
if (deviceType) then
table.insert (p, '"deviceType" : ' .. deviceType .. ',')
end
--[[
1 = ROOT
2 = SITE
3 = BUILDING
4 = FLOOR
5 = ROOM
6 = DEVICE
7 = PROXY
8 = ROOM_DEVICE
9 = AGENT
]]
elseif (string.find (line, '^<name>')) then
local name = string.match (line, '<name>(.-)</name>')
if (name) then
table.insert (p, '"name" : ' .. JSON:encode (name) .. ',')
end
end
end
table.insert (p, '}')
p = table.concat (p, '\r\n')
p = string.gsub (p, ',%s+%]', '\r\n%]')
p = string.gsub (p, ',%s+%}', '\r\n%}')
local j
local f = function ()
j = JSON:decode (p)
end
success, err = pcall (f)
return (j)
end
function GetPathToDevice (deviceId, project)
if (type (project ~= 'table')) then
project = GetProject ()
end
if (project and project.project) then
project = project.project
else
return
end
deviceId = tonumber (deviceId)
if (deviceId == nil) then
return
end
local path = {}
local drill
drill = function (item)
local id = item.id
local thisItem = {
id = item.id,
name = item.name,
c4i = item.c4i,
deviceType = item.deviceType,
}
if (id == deviceId) then
table.insert (path, thisItem)
return (true)
elseif (item.subItems) then
for _, subItemTable in ipairs (item.subItems) do
local found = drill (subItemTable)
if (found) then
table.insert (path, thisItem)
return (true)
end
end
end
end
drill (project)
return (path)
end
function GetLocals (depth)
local vars = {}
local i = 1
depth = depth or 2
while (true) do
local name, value = debug.getlocal (depth, i)
if (name ~= nil) then
vars [name] = value
else
break
end
i = i + 1
end
return vars
end
function GetRandomString (len)
local s = {}
local allowed = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
while (#s < (len or 10)) do
local random = math.random (1, string.len (allowed))
local char = string.sub (allowed, random, random)
table.insert (s, char)
end
s = table.concat (s)
return s
end
function FileRead (filename)
local content = ''
if (C4:FileExists (filename)) then
local file = C4:FileOpen (filename)
local length = C4:FileGetSize (file)
C4:FileSetPos (file, 0)
content = C4:FileRead (file, length)
C4:FileClose (file)
end
return (content)
end
function FileWrite (filename, content, overwrite)
content = tostring (content) or ''
local pos = 0
if (overwrite and C4:FileExists (filename)) then
C4:FileDelete (filename)
end
local file = C4:FileOpen (filename)
if (not overwrite) then
pos = C4:FileGetSize (file)
end
C4:FileSetPos (file, pos)
local result = C4:FileWrite (file, content:len (), content)
C4:FileClose (file)
end
function PersistSetValue (key, value, encrypted)
if (encrypted == nil) then
encrypted = false
end
if (C4.PersistSetValue) then
C4:PersistSetValue (key, value, encrypted)
else
PersistData = PersistData or {}
PersistData.LibValueStore = PersistData.LibValueStore or {}
PersistData.LibValueStore [key] = value
end
end
function PersistGetValue (key, encrypted)
if (encrypted == nil) then
encrypted = false
end
local value
if (C4.PersistGetValue) then
value = C4:PersistGetValue (key, encrypted)
if (value == nil and encrypted == true) then
value = C4:PersistGetValue (key, false)
if (value ~= nil) then
PersistSetValue (key, value, encrypted)
end
end
if (value == nil) then
if (PersistData and PersistData.LibValueStore and PersistData.LibValueStore [key]) then
value = PersistData.LibValueStore [key]
PersistSetValue (key, value, encrypted)
PersistData.LibValueStore [key] = nil
if (next (PersistData.LibValueStore) == nil) then
PersistData.LibValueStore = nil
end
end
end
elseif (PersistData and PersistData.LibValueStore and PersistData.LibValueStore [key]) then
value = PersistData.LibValueStore [key]
end
return value
end
function PersistDeleteValue (key)
if (C4.PersistDeleteValue) then
C4:PersistDeleteValue (key)
else
if (PersistData and PersistData.LibValueStore) then
PersistData.LibValueStore [key] = nil
if (next (PersistData.LibValueStore) == nil) then
PersistData.LibValueStore = nil
end
end
end
end
function Select (data, ...)
if (type (data) ~= 'table') then
return nil
end
local tablePack = function (...)
return {
n = select ('#', ...), ...
}
end
local args = tablePack (...)
local ret = data
for i = 1, args.n do
local index = args [i]
if (index == nil or ret [index] == nil) then
return nil
end
if (ret [index] ~= nil) then
ret = ret [index]
end
end
return ret
end
function GetConnections ()
local connectionsXML = C4:GetDriverConfigInfo ('connections')
local connections = {}
for connection in string.gmatch (connectionsXML, '<connection>(.-)</connection>') do
local id = tonumber (XMLCapture (connection, 'id'))
if (id) then
local classesXML = XMLCapture (connection, 'classes') or ''
local classes = {}
for class in string.gmatch (classesXML, '<class>(.-)</class>') do
table.insert (classes, {
classname = XMLCapture (class, 'classname'),
autobind = (XMLCapture (class, 'autobind') == 'True'),
})
end
connections [id] = {
id = id,
type = tonumber (XMLCapture (connection, 'type')),
connectionname = XMLCapture (connection, 'name'),
consumer = (XMLCapture (connection, 'consumer') == 'True'),
linelevel = (XMLCapture (connection, 'linelevel') == 'True'),
idautobind = XMLCapture (connection, 'idautobind'),
classes = classes,
}
end
end
return connections
end |
-----------------------------------
-- Area: Apollyon SW
-- Mob: Ice Elemental
-----------------------------------
require("scripts/globals/limbus")
local ID = require("scripts/zones/Apollyon/IDs")
function onMobEngaged(mob, target)
GetMobByID(ID.mob.APOLLYON_SW_MOB[4]+4):updateEnmity(target)
GetMobByID(ID.mob.APOLLYON_SW_MOB[4]+12):updateEnmity(target)
GetMobByID(ID.mob.APOLLYON_SW_MOB[4]+20):updateEnmity(target)
end
function onMobDeath(mob, player, isKiller, noKiller)
if isKiller or noKiller then
if tpz.limbus.elementalsDead() then
GetNPCByID(ID.npc.APOLLYON_SW_CRATE[4]):setStatus(tpz.status.NORMAL)
end
end
end
|
-----------------------------------------------------------------------------------------------------------------------
-- Desktop widgets config --
-----------------------------------------------------------------------------------------------------------------------
-- Grab environment
local beautiful = require("beautiful")
--local awful = require("awful")
local redflat = require("redflat")
-- Initialize tables and vars for module
-----------------------------------------------------------------------------------------------------------------------
local desktop = {}
-- desktop aliases
local wgeometry = redflat.util.desktop.wgeometry
local workarea = screen[mouse.screen].workarea
local system = redflat.system
-- Desktop widgets
-----------------------------------------------------------------------------------------------------------------------
function desktop:init(args)
if not beautiful.desktop then return end
args = args or {}
local env = args.env or {}
local autohide = env.desktop_autohide or false
-- placement
local grid = beautiful.desktop.grid
local places = beautiful.desktop.places
-- Network speed
--------------------------------------------------------------------------------
local netspeed = { geometry = wgeometry(grid, places.netspeed, workarea) }
netspeed.args = {
interface = "wlp60s0",
maxspeed = { up = 6*1024^2, down = 6*1024^2 },
crit = { up = 6*1024^2, down = 6*1024^2 },
timeout = 2,
autoscale = true
}
netspeed.style = {}
-- SSD speed
--------------------------------------------------------------------------------
local ssdspeed = { geometry = wgeometry(grid, places.ssdspeed, workarea) }
ssdspeed.args = {
interface = "nvme0n1",
meter_function = system.disk_speed,
timeout = 2,
label = "SOLID DRIVE"
}
ssdspeed.style = beautiful.individual.desktop.speedmeter.drive
-- HDD speed
--------------------------------------------------------------------------------
local hddspeed = { geometry = wgeometry(grid, places.hddspeed, workarea) }
hddspeed.args = {
interface = "sda",
meter_function = system.disk_speed,
timeout = 2,
label = "HARD DRIVE"
}
hddspeed.style = beautiful.individual.desktop.speedmeter.drive
-- CPU and memory usage
--------------------------------------------------------------------------------
local cpu_storage = { cpu_total = {}, cpu_active = {} }
local cpumem = { geometry = wgeometry(grid, places.cpumem, workarea) }
cpumem.args = {
topbars = { num = 8, maxm = 100, crit = 90 },
lines = { { maxm = 100, crit = 80 }, { maxm = 100, crit = 80 } },
meter = { args = cpu_storage, func = system.dformatted.cpumem },
timeout = 2
}
cpumem.style = beautiful.individual.desktop.multimeter.cpumem
-- Transmission info
--------------------------------------------------------------------------------
local transm = { geometry = wgeometry(grid, places.transm, workarea) }
transm.args = {
topbars = { num = 8, maxm = 100 },
lines = { { maxm = 6*1024 }, { maxm = 6*1024 } },
meter = { async = system.transmission.info, args = { speed_only = true } },
timeout = 5,
}
transm.style = beautiful.individual.desktop.multimeter.transmission
-- Disks
--------------------------------------------------------------------------------
local disks = { geometry = wgeometry(grid, places.disks, workarea) }
disks.args = {
sensors = {
{ meter_function = system.fs_info, maxm = 100, crit = 80, name = "root", args = "/" },
{ meter_function = system.fs_info, maxm = 100, crit = 80, name = "home", args = "/home" },
{ meter_function = system.fs_info, maxm = 100, crit = 80, name = "misc", args = "/mnt/storage" },
{ meter_function = system.fs_info, maxm = 100, crit = 80, name = "data", args = "/mnt/media" },
},
timeout = 300
}
disks.style = beautiful.individual.desktop.multiline.disks
-- Sensors parser setup
--------------------------------------------------------------------------------
local sensors_base_timeout = 10
system.lmsensors.delay = 2
system.lmsensors.patterns = {
core1 = { match = "Core%s0:%s+%+(%d+)%.%d°[CF]" },
core2 = { match = "Core%s1:%s+%+(%d+)%.%d°[CF]" },
core3 = { match = "Core%s2:%s+%+(%d+)%.%d°[CF]" },
core4 = { match = "Core%s3:%s+%+(%d+)%.%d°[CF]" },
}
-- start auto async lmsensors check
system.lmsensors:soft_start(sensors_base_timeout)
-- Temperature indicator
--------------------------------------------------------------------------------
-- cpu cores
local thermalc = { geometry = wgeometry(grid, places.thermalc, workarea) }
thermalc.args = {
sensors = {
{ meter_function = system.lmsensors.get, args = "core1", maxm = 100, crit = 75, name = "core1" },
{ meter_function = system.lmsensors.get, args = "core2", maxm = 100, crit = 75, name = "core2" },
{ meter_function = system.lmsensors.get, args = "core3", maxm = 100, crit = 75, name = "core3" },
{ meter_function = system.lmsensors.get, args = "core4", maxm = 100, crit = 75, name = "core4" },
},
timeout = sensors_base_timeout,
}
thermalc.style = beautiful.individual.desktop.multiline.thermal
-- hdd
local thermald = { geometry = wgeometry(grid, places.thermald, workarea) }
local hdd_smart_check = system.simple_async("smartctl --attributes /dev/sda", "194.+%s(%d+)%s%(.+%)\r?\n")
thermald.args = {
sensors = { { async_function = hdd_smart_check, maxm = 60, crit = 45, name = "hdd" } },
timeout = 10,
}
thermald.style = beautiful.individual.desktop.multiline.thermal_second
-- gpu
local thermalg = { geometry = wgeometry(grid, places.thermalg, workarea) }
thermalg.args = {
sensors = { { async_function = system.thermal.nvoptimus, maxm = 105, crit = 80, name = "gpu" } },
timeout = 10,
}
thermalg.style = beautiful.individual.desktop.multiline.thermal_second
-- Initialize all desktop widgets
--------------------------------------------------------------------------------
netspeed.body = redflat.desktop.speedmeter.normal(netspeed.args, netspeed.style)
ssdspeed.body = redflat.desktop.speedmeter.normal(ssdspeed.args, ssdspeed.style)
hddspeed.body = redflat.desktop.speedmeter.normal(hddspeed.args, hddspeed.style)
cpumem.body = redflat.desktop.multimeter(cpumem.args, cpumem.style)
transm.body = redflat.desktop.multimeter(transm.args, transm.style)
disks.body = redflat.desktop.multiline(disks.args, disks.style)
thermalc.body = redflat.desktop.multiline(thermalc.args, thermalc.style)
thermald.body = redflat.desktop.multiline(thermald.args, thermald.style)
thermalg.body = redflat.desktop.multiline(thermalg.args, thermalg.style)
-- Desktop setup
--------------------------------------------------------------------------------
local desktop_objects = { netspeed, hddspeed, ssdspeed, transm, cpumem, disks, thermalc, thermald, thermalg }
if not autohide then
redflat.util.desktop.build.static(desktop_objects)
else
redflat.util.desktop.build.dynamic(desktop_objects, nil, beautiful.desktopbg, args.buttons)
end
end
-- End
-----------------------------------------------------------------------------------------------------------------------
return desktop
|
local _, L = ...
local UI, Control, Data = ConsolePortUI:GetEssentials()
local KEY = Data.KEY
local LootButton = {}
L.LootButtonMixin = LootButton
local tooltipBackdrop
local tipR, tipG, tipB
function LootButton:OnDragStart()
self:GetParent():StartMoving()
end
function LootButton:OnDragStop()
self:GetParent():StopMovingOrSizing()
end
function LootButton:OnClick()
LootSlot(self:GetID())
end
function LootButton:OnEnter()
local slot = self:GetID()
local slotType = GetLootSlotType(slot)
if ( slotType == LOOT_SLOT_ITEM ) then
GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT', 0, 50)
GameTooltip:SetLootItem(slot)
CursorUpdate(self)
end
if ( slotType == LOOT_SLOT_CURRENCY ) then
GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT', 0, 50)
GameTooltip:SetLootCurrency(slot)
CursorUpdate(self)
end
if GameTooltip:IsOwned(self) then
local backdrop = GameTooltip:GetBackdrop()
if backdrop then
tipR, tipG, tipB = GameTooltip:GetBackdropColor()
tooltipBackdrop = backdrop
end
GameTooltip:SetBackdrop(nil)
local width, height = (GameTooltip:GetWidth() or 330) + 50, (GameTooltip:GetHeight() or 50)
self.NameFrame:SetSize(width < 330 and 330 or width, height < 50 and 50 or height)
self.Text:SetAlpha(0)
self.hasTooltipFocus = true
end
self:LockHighlight()
self.QuestTexture:SetDrawLayer('HIGHLIGHT', 7)
end
function LootButton:OnUpdate()
if self.hasTooltipFocus and not GameTooltip:IsOwned(self) then
self:OnLeave()
end
end
function LootButton:OnLeave()
GameTooltip:Hide()
if tooltipBackdrop then
GameTooltip:SetBackdrop(tooltipBackdrop)
GameTooltip:SetBackdropColor(tipR, tipG, tipB)
end
ResetCursor()
self.hasTooltipFocus = false
self.NameFrame:SetSize(300, 50)
self.Text:SetAlpha(1)
self:UnlockHighlight()
self.QuestTexture:SetDrawLayer('OVERLAY')
end
function LootButton:SetQuality(itemQuality)
local colors = ITEM_QUALITY_COLORS[itemQuality]
if colors then
self.Text:SetTextColor(colors.r, colors.g, colors.b)
else
self.Text:SetTextColor(1, 1, 1)
end
end
function LootButton:SetText(text)
self.Text:SetText(text)
end
function LootButton:SetQuestItem(isQuestItem)
self.QuestTexture:SetShown(isQuestItem)
end
function LootButton:Update()
local texture, item, quantity, quality, locked, isQuestItem, questId, isActive = GetLootSlotInfo(self:GetID())
self:SetIcon(texture)
self:SetCount(quantity)
self:SetQuality(quality)
self:SetText(item)
self:SetQuestItem(isQuestItem)
end |
local varm_util = require("modules/varm_util")
local node_reqs = {}
-- ('Set Variable' Node)
function node_reqs.ensure_support_methods(node, proj_state)
-- Only primitive types, so no required includes to check.
return true
end
-- ('Set Variable' Node)
function node_reqs.append_node(node, node_graph, proj_state)
local node_text = ' // ("Set Variable" node)\n'
node_text = node_text .. ' NODE_' .. node.node_ind .. ':\n'
-- (The actual variable setting.)
local var_c_val = tostring(node.options.var_val)
if var_c_val == 'false' then
var_c_val = '0';
elseif var_c_val == 'true' then
var_c_val = '1';
elseif not tonumber(var_c_val) then
-- If it doesn't translate to a number, assume it's a char.
-- (Since we don't support strings yet.)
var_c_val = "'" .. var_c_val .. "'"
end
node_text = node_text .. ' ' .. node.options.var_name .. ' = ' .. var_c_val .. ';\n'
-- (Done.)
if node.output and node.output.single then
node_text = node_text .. ' goto NODE_' .. node.output.single .. ';\n'
else
return nil
end
node_text = node_text .. ' // (End "Set Variable" node)\n\n'
if not varm_util.code_node_lode(node, node_text, proj_state) then
return nil
end
return true
end
return node_reqs
|
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
title 'Auto Announcements'
author 'Rage_YouTube'
client_scripts {
'config.lua',
'client.lua'
} |
local valueSemantic = {}
valueSemantic.__index = valueSemantic
function valueSemantic.new()
local self = setmetatable({}, valueSemantic)
self._default = nil -- any
self._implicit = nil -- any
self._name = "ARG"
self._notifier = function (_) end
self._appender = function (_, val) return val end
self._merger = function (_, val) return val end
self._noArgs = false
self._parser = function (str) return str end
self._formatter = tostring
return self
end
function valueSemantic.isInstance(obj)
checkArg(1, obj, "table")
local meta = getmetatable(obj)
if meta == valueSemantic then
return true
elseif meta and type(meta.__index) == "table" then
return valueSemantic.isInstance(meta.__index)
else
return false
end
end
function valueSemantic:default(...)
local args = table.pack(...)
if args.n > 0 then
self._default = args[1]
return self
else
return self._default
end
end
function valueSemantic:implicit(...)
local args = table.pack(...)
if args.n > 0 then
self._implicit = args[1]
return self
else
return self._implicit
end
end
-- Name of the value used in help messages, i.e. ARG in --opt=ARG.
function valueSemantic:name(...)
local args = table.pack(...)
if args.n > 0 then
checkArg(1, args[1], "string")
self._name = args[1]
return self
else
assert(not self._noArgs)
assert(self._name)
return self._name
end
end
function valueSemantic:notifier(f)
checkArg(1, f, "function")
self._notifier = f
return self
end
function valueSemantic:appender(f)
checkArg(1, f, "function")
self._appender = f
return self
end
function valueSemantic:merger(f)
checkArg(1, f, "function")
self._merger = f
return self
end
-- State that the option cannot take any arguments.
function valueSemantic:noArgs()
self._noArgs = true
return self
end
function valueSemantic:isNoArgs()
return self._noArgs
end
function valueSemantic:parser(f)
checkArg(1, f, "function")
self._parser = f
return self
end
function valueSemantic:formatter(f)
checkArg(1, f, "function")
self._formatter = f
return self
end
function valueSemantic:notify(value)
self._notifier(value)
return self
end
function valueSemantic:append(oldValue, newValue)
return self._appender(oldValue, newValue)
end
function valueSemantic:merge(oldValue, newValue)
return self._merger(oldValue, newValue)
end
function valueSemantic:parse(strVal)
checkArg(1, strVal, "string")
assert(not self._noArgs)
return self._parser(strVal)
end
function valueSemantic:format(value)
return self._formatter(value)
end
return valueSemantic
|
return {
-- Air
i12007 = {
desc = '气态分析仪工作状态',
format = 'N2',
},
i12008 = {
desc = '气态分析仪报警状态',
format = 'N2',
},
i12009 = {
desc = '气态分析仪报警详情',
format = 'N2',
},
--- Water
i12101 = {
desc = '工作状态',
format = 'N2'
},
i12102 = {
desc = '报警状态',
format = 'N2',
},
i12103 = {
desc = '报警详情',
format = 'N2',
},
--- Air
i13001 = {
desc = '零点校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13002 = {
desc = '零点校准系数',
},
i13003 = {
desc = '零点校准浓度',
unit = 'mg/m3'
},
i13004 = {
desc = '零点校准原始值',
},
i13005 = {
desc = '零点校准漂移',
format = 'N2.1',
unit = '%',
},
i13006 = {
desc = '量程校准系数',
},
i13007 = {
desc = '量程校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13008 = {
desc = '量程校准浓度',
},
i13009 = {
desc = '量程校准原始值',
},
i13010 = {
desc = '量程校准漂移',
format = 'N2.1',
unit = '%',
},
i13011 = {
desc = '测量原始值',
},
i13012 = {
desc = '稀释比',
},
i13013 = {
desc = '量程',
unit = 'mg/m3',
},
i13014 = {
desc = '污染度(浊度法)',
},
i13015 = {
desc = '平滑时间',
unit = '分钟',
},
i13016 = {
desc = '空白粒子数(贝它射线法)'
},
i13017 = {
desc = '采样后粒子数(贝它射线法)'
},
i13018 = {
desc = '采样总流量(贝它射线法)'
},
i13019 = {
desc = '质量比(贝它射线法)'
},
i13020 = {
desc = '采样流量(贝它射线法)'
},
i13021 = {
desc = 'SO2分析仪零点校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13022 = {
desc = 'SO2分析仪零点校准系数',
},
i13023 = {
desc = 'SO2分析仪零点校准浓度',
unit = 'mg/m3'
},
i13024 = {
desc = 'SO2分析仪零点校准原始值',
},
i13025 = {
desc = 'SO2分析仪零点校准漂移',
format = 'N2.1',
unit = '%',
},
i13026 = {
desc = 'SO2分析仪量程校准系数',
},
i13027 = {
desc = 'SO2分析仪量程校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13028 = {
desc = 'SO2分析仪量程校准浓度',
},
i13029 = {
desc = 'SO2分析仪量程校准原始值',
},
i13030 = {
desc = 'SO2分析仪量程校准漂移',
format = 'N2.1',
unit = '%',
},
i13031 = {
desc = 'SO2分析仪测量原始值',
},
i13032 = {
desc = 'SO2分析仪稀释比',
},
i13033 = {
desc = 'SO2分析仪量程',
unit = 'mg/m3',
},
i13034 = {
desc = 'SO2分析仪污染度(浊度法)',
},
i13035 = {
desc = 'SO2分析仪平滑时间',
unit = '分钟',
},
i13036 = {
desc = 'SO2分析仪空白粒子数(贝它射线法)'
},
i13037 = {
desc = 'SO2分析仪采样后粒子数(贝它射线法)'
},
i13038 = {
desc = 'SO2分析仪采样总流量(贝它射线法)'
},
i13039 = {
desc = 'SO2分析仪质量比(贝它射线法)'
},
i13040 = {
desc = 'SO2分析仪采样流量(贝它射线法)'
},
-- Water
i13101 = {
desc = '零点校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13102 = {
desc = '截距',
unit = 'L',
},
i13103 = {
desc = '截距1',
unit = 'L',
},
i13104 = {
desc = '零点校准浓度',
},
i13105 = {
desc = '零点校准原始值',
},
i13106 = {
desc = '零点校准漂移',
format = 'N2.1',
unit = '%',
},
i13107 = {
desc = '量程校准时间',
format = 'YYYYMMDDHHMMSS',
},
i13108 = {
desc = '量程校准浓度',
},
i13109 = {
desc = '量程校准浓度1',
},
i13110 = {
desc = '量程校准原始值',
},
i13111 = {
desc = '量程校准原始值1',
},
i13112 = {
desc = '量程校准漂移',
format = 'N2.1',
unit = '%',
},
i13113 = {
desc = '量程校准漂移1',
format = 'N2.1',
unit = '%',
},
i13114 = {
desc = '测量间隔',
unit = '分钟',
},
i13115 = {
desc = '测量原始值',
},
i13116 = {
desc = '当前量程',
},
i13117 = {
desc = '斜率',
},
i13118 = {
desc = '斜率1',
},
i13119 = {
desc = '校正因子(修正斜率)'
},
i13120 = {
desc = '修正因子(修正截距)'
},
i13121 = {
desc = '消解时常',
unit = '分钟'
},
i13122 = {
desc = '消解温度',
unit = 'C',
},
i13123 = {
desc = '冷却时长',
unit = 'min',
},
i13124 = {
desc = '硫酸亚铁铵标定时间',
unit = 'min',
},
i13125 = {
desc = '硫酸亚铁铵浓度',
unit = 'g/L',
},
i13126 = {
desc = '空白硫酸亚铁铵标准溶液体积',
unit = 'L',
},
i13127 = {
desc = '重铬酸钾浓度',
unit = 'g/L',
},
i13128 = {
desc = '标样核查时间',
format = 'YYYYMMDDHHMMSS'
},
i13129 = {
desc = '标样核查偏差百分比',
format = 'N2.1',
unit = '%',
},
i13130 = {
desc = '标样核查标液浓度',
unit = 'mg/L',
},
-- STATE
i22001 = {
desc = '工作状态',
format = 'N2',
},
i22002 = {
desc = '通讯状态',
format = 'N2',
},
i22003 = {
desc = '报警详情',
format = 'N2',
},
i22004 = {
desc = '通讯状态',
format = 'N2',
},
i22005 = {
desc = '报警详情',
format = 'N2',
},
i52001 = {
desc = '视频报警',
format = 'N2',
},
-- INFO
i23002 = {
desc = '基准氧含量',
format = 'N2.2',
},
i23003 = {
desc = '速度场系数',
format = 'N2.4',
},
i23004 = {
desc = '皮托管系数',
format = 'N2.2',
},
i23005 = {
desc = '烟气湿度量程',
format = 'N5.2',
unit = '%',
},
i23006 = {
desc = '烟气温度量程上限',
format = 'N5.2',
unit = 'C'
},
i23007 = {
desc = '烟气温度量程下限',
format = 'N5.2',
unit = 'C'
},
i23008 = {
desc = '烟气压力量程上限',
format = 'N5.2',
unit = 'KP',
},
i23009 = {
desc = '烟气压力量程下限',
format = 'N5.2',
unit = 'KP',
},
i23010 = {
desc = '烟气流速量程',
format = 'N5.2',
unit = 'm/s',
},
i23011 = {
desc = '本地大气压(河北)',
format = 'N5.2',
unit = 'Pa'
},
--
i3310A = {
desc = '门禁编码',
format = 'C30'
},
i3310B = {
desc = '开门方式',
format = 'N2'
},
i3310C = {
desc = '开门类型',
format = 'N2'
},
i3310D = {
desc = '开门编码',
format = 'C30'
},
i3310E = {
desc = '开门时间',
format = 'YYYYMMDDHHMMSS'
},
i3310F = {
desc = '门状态',
format = 'N2'
},
i3310G = {
desc = 'IC卡卡号',
format = 'C32'
},
i3310H = {
desc = '人员图像编号',
format = 'C12'
},
i3310I = {
desc = '人员图像地址',
format = 'C100'
},
i3310J = {
desc = '人员姓名',
format = 'C10'
},
-- Door history
i41001 = {
desc = '开关门记录',
format = 'C890',
},
i41002 = {
desc = '断电记录',
format = 'C890',
},
-- Sample
i42001 = {
desc = '设备状态',
format = 'N2',
},
i42002 = {
desc = '系统时间',
format = 'YYYYMMDDHHMMSS',
},
i42003 = {
desc = '门禁状态',
format = 'N2',
},
i42004 = {
desc = '混匀桶A桶工作状态',
format = 'N2',
},
i42005 = {
desc = '混匀桶B桶工作状态',
format = 'N2',
},
i42006 = {
desc = '异常状态',
format = 'N2',
},
-- Water Sample
i43001 = {
desc = '采样模式',
format = 'N2',
},
i43002 = {
desc = '留样模式',
format = 'N2',
},
i43003 = {
desc = '采样量',
format = 'N4',
unit = 'mL',
},
i43004 = {
desc = '采样间隔',
format = 'N4',
unit = 'min',
},
i43005 = {
desc = '留样量',
format = 'N4',
unit = 'mL',
},
i43006 = {
desc = '留样瓶编号',
format = 'N2',
},
}
|
-----------------------------
--这是一个模板,可直接拷贝到app根目录下
--
---------------------------------------
----beans 是一个记录所有类的工厂
--@field #table id 记录了每个类的id,key值是自己给定的,value关联 @field bean所对应的key。 用于获取类、实例化,继承所用(仅限于自己编写的类,app目录下的所有类)
--@field #table bean 记录每个类的的名字,key值是类名,value关联 @field package[1]所对应的key用于需找上级目录(所在包)
--@field #table package 记录每一级的包名,package[1]的key值是包名,value关联 @field package[2]所对应的key用于需找上级目录(所在包),package[1]为最里层包,以此类推package[#package]为最外层包,
--[[
local beans={
id={
["playDuelController"]=1,
["hero"]=2,
["heroView"]=3,
},
bean={
[1]={"PlayDuelController",1,1},
[2]={"Hero",1,2},
[3]={"HeroView",1,3}
},
package={
[1]={
[1]={"controllers",2,1},
[2]={"models",2,1},
[3]={"view",2,1}
},
[2]={[1]={"app"}}
}
}
--]]
--------------------------------------
--以下这种也是可行的,但请不要混合使用。
--bean={[id]=class}
---[[
local beans={
["playDuelController"]="app.controllers.PlayDuelController",
["hero"]="app.models.Hero",
["heroView"]="app.view.HeroView"
}
--]]
return beans |
g_ItemPrecache = {
"item_blood_sword",
"item_bubble_orb_1",
"item_butterfly_oaa",
"item_dagger_of_moriah",
"item_dagon_oaa",
"item_demon_stone",
"item_devastator_3",
"item_dispel_orb_1",
--"item_dragon_scale_oaa",
"item_elixier_burst",
"item_elixier_hybrid",
"item_elixier_sustain",
"item_enrage_crystal_1",
--"item_eternal_shroud_oaa",
"item_far_sight",
"item_giant_form",
"item_greater_phase_boots",
"item_greater_tranquil_boots",
"item_heart_oaa",
"item_heart_transplant",
"item_lucience",
"item_martyrs_mail_4",
--"item_meteor_hammer_1",
"item_pull_staff",
"item_reflection_shard_1",
--"item_reflex_core",
"item_regen_crystal_1",
--"item_rune_breaker_oaa",
"item_sacred_skull",
--"item_satanic_core",
"item_shield_staff",
"item_siege_mode",
--"item_silver_staff",
"item_sonic",
"item_stoneskin",
"item_trumps_fists",
--"item_travel_boots_oaa",
"item_vampire",
}
g_UnitPrecache = {
"npc_dota_monkey_clone_oaa",
"npc_dota_visage_familiar",
"npc_dota_hero_sohei",
"npc_dota_hero_electrician",
"dota_fountain",
--"npc_azazel_tower_watch",
"npc_dota_boss_simple_1",
"npc_dota_boss_simple_2",
--"npc_dota_boss_simple_3",
"npc_dota_boss_simple_5",
--"npc_dota_boss_simple_6",
--"npc_dota_boss_simple_7",
"npc_dota_boss_twin",
"npc_dota_boss_twin_dumb",
"npc_dota_boss_shielder",
"npc_dota_boss_charger",
"npc_dota_boss_charger_pillar",
"npc_dota_boss_stopfightingyourself",
"npc_dota_creature_ogre_tank_boss",
"npc_dota_creature_ogre_seer",
"npc_dota_creature_lycan_boss",
"npc_dota_creature_dire_hound",
"npc_dota_creature_dire_hound_boss",
"npc_dota_creature_werewolf",
"npc_dota_hero_bloodseeker", -- For Lycan Boss Wolf transformation
"npc_dota_creature_temple_guardian",
"npc_dota_creature_temple_guardian_spawner",
--"npc_dota_creature_small_lycosidae",
--"npc_dota_creature_spider_boss",
"npc_dota_boss_spiders",
"npc_dota_boss_swiper",
"npc_dota_boss_wanderer_1",
"npc_dota_boss_wanderer_2",
"npc_dota_boss_wanderer_3",
}
g_ModelPrecache = {
"models/items/upgrade_1.vmdl",
"models/items/upgrade_2.vmdl",
"models/items/upgrade_3.vmdl",
"models/items/upgrade_4.vmdl",
}
g_ParticlePrecache = {
"particles/items/upgrade_1.vpcf",
"particles/items/upgrade_2.vpcf",
"particles/items/upgrade_3.vpcf",
"particles/items/upgrade_4.vpcf",
"particles/items/phase_splinter_impact_model.vpcf", -- Cleave Spark particle
"particles/units/heroes/hero_treant/treant_leech_seed_damage_glow.vpcf", -- Midas Spark particle
-- Carapace Boss
"particles/econ/items/antimage/antimage_ti7_golden/antimage_blink_start_ti7_golden_smoke.vpcf",
"particles/econ/items/pudge/pudge_ti6_immortal/pudge_meathook_witness_impact_ti6.vpcf",
"particles/units/heroes/hero_stormspirit/stormspirit_ball_lightning_sphere.vpcf",
"particles/units/heroes/hero_skeletonking/skeletonking_hellfireblast_explosion.vpcf",
"particles/units/heroes/hero_pugna/pugna_ward_sphereinner.vpcf",
"particles/units/heroes/hero_crystalmaiden/maiden_base_attack_trail_c.vpcf",
"particles/units/heroes/hero_crystalmaiden/maiden_base_attack_trail.vpcf",
"particles/econ/items/crystal_maiden/crystal_maiden_cowl_of_ice/maiden_crystal_nova_cowlofice.vpcf",
}
g_ParticleFolderPrecache = {
"particles/capture_point_ring",
--"particles/econ/items", -- Precache all hero cosmetics
"particles/items",
"particles/items/dagger_of_moriah",
"particles/items/devastator",
"particles/items/dispel_orb",
"particles/items/elixiers",
"particles/items/enrage_crystal",
"particles/items/heart_transplant",
"particles/items/reflection_shard",
"particles/items/regen_crystal",
"particles/items/sacred_skull",
"particles/items/trumps_fists",
"particles/items/vampire",
"particles/hero/electrician",
}
g_SoundPrecache = {
"soundevents/game_sounds_heroes/game_sounds_phantom_assassin.vsndevts", -- For Ogre Boss kill sound
"soundevents/game_sounds_heroes/game_sounds_treant.vsndevts", -- Midas Spark sounds
-- Ambient sounds
"soundevents/ambient/doors.vsndevts",
"soundevents/music/music.vsndevts",
"soundevents/game_sounds_creeps.vsndevts",
"soundevents/bosses/game_sounds_dungeon_enemies.vsndevts",
"soundevents/game_sounds_items.vsndevts",
}
|
ModUtil.RegisterMod("EllosRerollEverythingMod")
local config = {
NumStartingRerolls = nil,
BaseRerollCosts = { -- Cost of first reroll, set to -1 to disable reroll
Hammer = 1, -- Hammers
Chaos = 1, -- Chaos
Hermes = 1, -- Hermes
Boon = 1, -- Boons
Pom = 1, -- Poms
Shop = 1, -- Wells of Charon
SellTrait = 1, -- Purging Pools
Door = 1, -- Exit Doors
},
RerollIncrements = { -- Amount the reroll cost increases after each reroll
Hammer = 1,
Chaos = 1,
Hermes = 1,
Boon = 1,
Pom = 1,
Shop = 1,
SellTrait = 1,
Door = 0,
}
}
EllosRerollEverythingMod.config = config
EllosRerollEverythingMod.LootNameToRerollType = {
WeaponUpgrade = "Hammer",
StackUpgrade = "Pom",
HermesUpgrade = "Hermes",
TrialUpgrade = "Chaos",
ZeusUpgrade = "Boon",
PoseidonUpgrade = "Boon",
AthenaUpgrade = "Boon",
AphroditeUpgrade = "Boon",
AresUpgrade = "Boon",
ArtemisUpgrade = "Boon",
DionysusUpgrade = "Boon",
DemeterUpgrade = "Boon",
HermesUpgrade = "Boon",
Store = "Shop",
SellTraitScript = "SellTrait",
}
-- Helper to force update of the reroll costs
function updateRerollCostsFromConfig()
ModUtil.MapSetTable(RerollCosts, EllosRerollEverythingMod.config.BaseRerollCosts)
CurrentRun.CurrentRoom.SpentRerolls = {}
--RerollCosts = DeepCopyTable(EllosRerollEverythingMod.config.BaseRerollCosts)
end
-- On first load, update the reroll costs
ModUtil.LoadOnce( function()
updateRerollCostsFromConfig()
end)
-- If custom reroll increments are enabled, update the relevant code
ModUtil.BaseOverride("AttemptPanelReroll", function(screen, button)
local cost = button.Cost
if CurrentRun.NumRerolls < cost or cost < 0 then
CannotRerollPanelPresentation( button )
return
end
AddInputBlock({ Name = "AttemptPanelReroll" })
HideTopMenuScreenTooltips({ Id = button.Id })
CurrentRun.NumRerolls = CurrentRun.NumRerolls - cost
CurrentRun.CurrentRoom.SpentRerolls = CurrentRun.CurrentRoom.SpentRerolls or {}
----------------------------------------------------------------------------
-- EllosRerollEverythingMod edits start here
----------------------------------------------------------------------------
local rerollType = "Boon"
local lootName = button.RerollId
if LootObjects[button.RerollId] ~= nil then
lootName = LootObjects[button.RerollId].Name
end
rerollType = EllosRerollEverythingMod.LootNameToRerollType[lootName]
IncrementTableValue( CurrentRun.CurrentRoom.SpentRerolls, button.RerollId, config.RerollIncrements[rerollType] )
UpdateRerollUI( CurrentRun.NumRerolls )
--RandomSynchronize( CurrentRun.NumRerolls )
RandomSynchronize( math.random(100) ) -- TODO: Make this count up regardless of spent rerolls (in case cost = 0)
InvalidateCheckpoint()
----------------------------------------------------------------------------
-- EllosRerollEverythingMod edits end here
----------------------------------------------------------------------------
if button.RerollFunctionName and _G[button.RerollFunctionName] then
RerollPanelPresentation( screen, button )
_G[button.RerollFunctionName]( )
end
RemoveInputBlock({ Name = "AttemptPanelReroll" })
end, EllosRerollEverythingMod)
-- BaseOverride is not ideal here, but it allows us to further break out
-- reroll types and fix an SGG bug that prevents 0 cost rerolls
ModUtil.BaseOverride("CreateBoonLootButtons", function(lootData, reroll)
local components = ScreenAnchors.ChoiceScreen.Components
local upgradeName = lootData.Name
local upgradeChoiceData = LootData[upgradeName]
local upgradeOptions = lootData.UpgradeOptions
if upgradeOptions == nil then
SetTraitsOnLoot( lootData )
upgradeOptions = lootData.UpgradeOptions
end
if not lootData.StackNum then
lootData.StackNum = 1
end
if not reroll then
lootData.StackNum = lootData.StackNum + GetTotalHeroTraitValue("PomLevelBonus")
end
local tooltipData = {}
local itemLocationY = 370
local itemLocationX = ScreenCenterX - 355
local firstOption = true
local buttonOffsetX = 350
if IsEmpty( upgradeOptions ) then
table.insert(upgradeOptions, { ItemName = "FallbackMoneyDrop", Type = "Consumable", Rarity = "Common" })
end
local blockedIndexes = {}
for i = 1, TableLength(upgradeOptions) do
table.insert( blockedIndexes, i )
end
for i = 1, CalcNumLootChoices() do
RemoveRandomValue( blockedIndexes )
end
-- Sort traits in the following order: Melee, Secondary, Rush, Range
table.sort(upgradeOptions, function (x, y)
local slotToInt = function( slot )
if slot ~= nil then
local slotType = slot.Slot
if slotType == "Melee" then
return 0
elseif slotType == "Secondary" then
return 1
elseif slotType == "Ranged" then
return 2
elseif slotType == "Rush" then
return 3
elseif slotType == "Shout" then
return 4
end
end
return 99
end
return slotToInt(TraitData[x.ItemName]) < slotToInt(TraitData[y.ItemName])
end)
if TableLength( upgradeOptions ) > 1 then
-- Only create the "Choose One" textbox if there's something to choose
CreateTextBox({ Id = components.ShopBackground.Id, Text = "UpgradeChoiceMenu_SubTitle",
FontSize = 30,
OffsetX = -435, OffsetY = -318,
Color = Color.White,
Font = "AlegreyaSansSCRegular",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left"
})
end
for itemIndex, itemData in ipairs( upgradeOptions ) do
local itemBackingKey = "Backing"..itemIndex
components[itemBackingKey] = CreateScreenComponent({ Name = "TraitBacking", Group = "Combat_Menu", X = ScreenCenterX, Y = itemLocationY })
SetScaleY({ Id = components[itemBackingKey].Id, Fraction = 1.25 })
local upgradeData = nil
local upgradeTitle = nil
local upgradeDescription = nil
if itemData.Type == "Trait" then
upgradeData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = itemData.ItemName, Rarity = itemData.Rarity })
local traitNum = GetTraitCount(CurrentRun.Hero, upgradeData)
if HeroHasTrait(itemData.ItemName) then
upgradeTitle = "TraitLevel_Upgrade"
upgradeData.Title = upgradeData.Name
else
upgradeTitle = GetTraitTooltipTitle( TraitData[itemData.ItemName] )
upgradeData.Title = GetTraitTooltipTitle( TraitData[itemData.ItemName] ) .."_Initial"
if not HasDisplayName({ Text = upgradeData.Title }) then
upgradeData.Title = GetTraitTooltipTitle( TraitData[itemData.ItemName] )
end
end
if itemData.TraitToReplace ~= nil then
upgradeData.TraitToReplace = itemData.TraitToReplace
upgradeData.OldRarity = itemData.OldRarity
local existingNum = GetTraitNameCount( CurrentRun.Hero, upgradeData.TraitToReplace )
tooltipData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = itemData.ItemName, FakeStackNum = existingNum, RarityMultiplier = upgradeData.RarityMultiplier})
if existingNum > 1 then
upgradeTitle = "TraitLevel_Exchange"
tooltipData.Title = GetTraitTooltipTitle( TraitData[upgradeData.Name])
tooltipData.Level = existingNum
end
elseif lootData.StackOnly then
tooltipData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = itemData.ItemName, FakeStackNum = lootData.StackNum, RarityMultiplier = upgradeData.RarityMultiplier})
tooltipData.OldLevel = traitNum;
tooltipData.NewLevel = traitNum + lootData.StackNum;
tooltipData.Title = GetTraitTooltipTitle( TraitData[itemData.ItemName] )
upgradeData.Title = tooltipData.Title
else
if upgradeData.Rarity == "Legendary" then
if TraitData[upgradeData.Name].IsDuoBoon then
CreateAnimation({ Name = "BoonEntranceDuo", DestinationId = components[itemBackingKey].Id })
else
CreateAnimation({ Name = "BoonEntranceLegendary", DestinationId = components[itemBackingKey].Id })
end
end
tooltipData = upgradeData
end
SetTraitTextData( tooltipData )
upgradeDescription = GetTraitTooltip( tooltipData , { Default = upgradeData.Title })
elseif itemData.Type == "Consumable" then
-- TODO(Dexter) Determinism
upgradeData = GetRampedConsumableData(ConsumableData[itemData.ItemName], itemData.Rarity)
upgradeTitle = upgradeData.Name
upgradeDescription = GetTraitTooltip(upgradeData)
if upgradeData.UseFunctionArgs ~= nil then
if upgradeData.UseFunctionName ~= nil and upgradeData.UseFunctionArgs.TraitName ~= nil then
local traitData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = upgradeData.UseFunctionArgs.TraitName, Rarity = itemData.Rarity })
SetTraitTextData( traitData )
upgradeData.UseFunctionArgs.TraitName = nil
upgradeData.UseFunctionArgs.TraitData = traitData
tooltipData = MergeTables( tooltipData, traitData )
elseif upgradeData.UseFunctionNames ~= nil then
local hasTraits = false
for i, args in pairs(upgradeData.UseFunctionArgs) do
if args.TraitName ~= nil then
hasTraits = true
local processedTraitData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = args.TraitName, Rarity = itemData.Rarity })
SetTraitTextData( processedTraitData )
tooltipData = MergeTables( tooltipData, processedTraitData )
upgradeData.UseFunctionArgs[i].TraitName = nil
upgradeData.UseFunctionArgs[i].TraitData = processedTraitData
end
end
if not hasTraits then
tooltipData = upgradeData
end
end
else
tooltipData = upgradeData
end
elseif itemData.Type == "TransformingTrait" then
local blessingData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = itemData.ItemName, Rarity = itemData.Rarity })
local curseData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = itemData.SecondaryItemName, Rarity = itemData.Rarity })
curseData.OnExpire =
{
TraitData = blessingData
}
upgradeTitle = "ChaosCombo_"..curseData.Name.."_"..blessingData.Name
blessingData.Title = "ChaosBlessingFormat"
SetTraitTextData( blessingData )
SetTraitTextData( curseData )
blessingData.TrayName = blessingData.Name.."_Tray"
tooltipData = MergeTables( tooltipData, blessingData )
tooltipData = MergeTables( tooltipData, curseData )
tooltipData.Blessing = itemData.ItemName
tooltipData.Curse = itemData.SecondaryItemName
upgradeDescription = blessingData.Title
upgradeData = DeepCopyTable( curseData )
upgradeData.Icon = blessingData.Icon
local extractedData = GetExtractData( blessingData )
for i, value in pairs(extractedData) do
local key = value.ExtractAs
if key then
upgradeData[key] = blessingData[key]
end
end
end
-- Setting button graphic based on boon type
local purchaseButtonKey = "PurchaseButton"..itemIndex
local iconOffsetX = -338
local iconOffsetY = -2
local exchangeIconPrefix = nil
local overlayLayer = "Combat_Menu_Overlay_Backing"
components[purchaseButtonKey] = CreateScreenComponent({ Name = "BoonSlot"..itemIndex, Group = "Combat_Menu", Scale = 1, X = itemLocationX + buttonOffsetX, Y = itemLocationY })
if upgradeData.CustomRarityColor then
components[purchaseButtonKey.."Patch"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = iconOffsetX + itemLocationX + buttonOffsetX + 38, Y = iconOffsetY + itemLocationY })
SetAnimation({ DestinationId = components[purchaseButtonKey.."Patch"].Id, Name = "BoonRarityPatch"})
SetColor({ Id = components[purchaseButtonKey.."Patch"].Id, Color = upgradeData.CustomRarityColor })
elseif itemData.Rarity ~= "Common" then
components[purchaseButtonKey.."Patch"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = iconOffsetX + itemLocationX + buttonOffsetX + 38, Y = iconOffsetY + itemLocationY })
SetAnimation({ DestinationId = components[purchaseButtonKey.."Patch"].Id, Name = "BoonRarityPatch"})
SetColor({ Id = components[purchaseButtonKey.."Patch"].Id, Color = Color["BoonPatch" .. itemData.Rarity] })
end
if Contains( blockedIndexes, itemIndex ) then
itemData.Blocked = true
overlayLayer = "Combat_Menu"
UseableOff({ Id = components[purchaseButtonKey].Id })
ModifyTextBox({ Ids = components[purchaseButtonKey].Id, BlockTooltip = true })
CreateTextBox({ Id = components[purchaseButtonKey].Id,
Text = "ReducedLootChoicesKeyword",
OffsetX = textOffset, OffsetY = -30,
Color = Color.Transparent,
Width = 675,
})
thread( TraitLockedPresentation, { Components = components, Id = purchaseButtonKey, OffsetX = itemLocationX + buttonOffsetX, OffsetY = iconOffsetY + itemLocationY } )
end
if upgradeData.Icon ~= nil then
components[purchaseButtonKey.."Icon"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = iconOffsetX + itemLocationX + buttonOffsetX, Y = iconOffsetY + itemLocationY })
SetAnimation({ DestinationId = components[purchaseButtonKey.."Icon"].Id, Name = upgradeData.Icon .. "_Large" })
SetScale({ Id = components[purchaseButtonKey.."Icon"].Id, Fraction = 0.85 })
end
if upgradeData.TraitToReplace ~= nil then
local yOffset = 70
local xOffset = 700
local blockedIconOffset = 0
local textOffset = xOffset * -1 + 110
if Contains( blockedIndexes, itemIndex ) then
blockedIconOffset = -20
end
components[purchaseButtonKey.."ExchangeIcon"] = CreateScreenComponent({ Name = "BlankObstacle", Group = overlayLayer, X = iconOffsetX + itemLocationX + buttonOffsetX + xOffset, Y = iconOffsetY + itemLocationY + yOffset + blockedIconOffset})
SetAnimation({ DestinationId = components[purchaseButtonKey.."ExchangeIcon"].Id, Name = TraitData[upgradeData.TraitToReplace].Icon .. "_Small" })
components[purchaseButtonKey.."ExchangeIconFrame"] = CreateScreenComponent({ Name = "BlankObstacle", Group = overlayLayer, X = iconOffsetX + itemLocationX + buttonOffsetX + xOffset, Y = iconOffsetY + itemLocationY + yOffset + blockedIconOffset})
SetAnimation({ DestinationId = components[purchaseButtonKey.."ExchangeIconFrame"].Id, Name = "BoonIcon_Frame_".. itemData.OldRarity})
exchangeIconPrefix = "{!Icons.TraitExchange} "
CreateTextBox(MergeTables({
Id = components[purchaseButtonKey.."ExchangeIcon"].Id,
Text = "ReplaceTraitPrefix",
OffsetX = textOffset,
OffsetY = -12 - blockedIconOffset + (LocalizationData.UpgradeChoice.ExchangeText.LangOffsetY[GetLanguage({})] or 0),
FontSize = 20,
Color = {160, 160, 160, 255},
Width = 675,
Font = "AlegreyaSansSCRegular",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left",
VerticalJustification = "Top",
}, LocalizationData.UpgradeChoice.ExchangeText))
CreateTextBox(MergeTables({
Id = components[purchaseButtonKey.."ExchangeIcon"].Id,
Text = GetTraitTooltipTitle( TraitData[itemData.TraitToReplace ]),
OffsetX = textOffset + 150,
OffsetY = -12 - blockedIconOffset + (LocalizationData.UpgradeChoice.ExchangeText.LangOffsetY[GetLanguage({})] or 0),
FontSize = 20,
Color = Color["BoonPatch" .. itemData.OldRarity],
Width = 675,
Font = "AlegreyaSansSCRegular",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left",
VerticalJustification = "Top",
}, LocalizationData.UpgradeChoice.ExchangeText))
end
components[purchaseButtonKey.."Frame"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = iconOffsetX + itemLocationX + buttonOffsetX, Y = iconOffsetY + itemLocationY })
if upgradeData.Frame then
SetAnimation({ DestinationId = components[purchaseButtonKey.."Frame"].Id, Name = "Frame_Boon_Menu_".. upgradeData.Frame})
SetScale({ Id = components[purchaseButtonKey.."Frame"].Id, Fraction = 0.85 })
else
SetAnimation({ DestinationId = components[purchaseButtonKey.."Frame"].Id, Name = "Frame_Boon_Menu_".. itemData.Rarity})
SetScale({ Id = components[purchaseButtonKey.."Frame"].Id, Fraction = 0.85 })
end
-- Button data setup
components[purchaseButtonKey].OnPressedFunctionName = "HandleUpgradeChoiceSelection"
components[purchaseButtonKey].Data = upgradeData
components[purchaseButtonKey].UpgradeName = upgradeName
components[purchaseButtonKey].Type = itemData.Type
components[purchaseButtonKey].LootData = lootData
components[purchaseButtonKey].LootColor = upgradeChoiceData.LootColor
components[purchaseButtonKey].BoonGetColor = upgradeChoiceData.BoonGetColor
components[components[purchaseButtonKey].Id] = purchaseButtonKey
-- Creates upgrade slot text
SetInteractProperty({ DestinationId = components[purchaseButtonKey].Id, Property = "TooltipOffsetX", Value = 675 })
local selectionString = "UpgradeChoiceMenu_PermanentItem"
local selectionStringColor = Color.Black
if itemData.Type == "Trait" then
local traitData = TraitData[itemData.ItemName]
if traitData.Slot ~= nil then
selectionString = "UpgradeChoiceMenu_"..traitData.Slot
end
elseif itemData.Type == "Consumable" then
selectionString = upgradeData.UpgradeChoiceText or "UpgradeChoiceMenu_PermanentItem"
end
local textOffset = 115 - buttonOffsetX
local exchangeIconOffset = 0
local lineSpacing = 8
local text = "Boon_"..tostring(itemData.Rarity)
local overlayLayer = ""
if upgradeData.CustomRarityName then
text = upgradeData.CustomRarityName
end
local color = Color["BoonPatch" .. itemData.Rarity ]
if upgradeData.CustomRarityColor then
color = upgradeData.CustomRarityColor
end
CreateTextBox({ Id = components[purchaseButtonKey].Id, Text = text ,
FontSize = 27,
OffsetX = textOffset + 630, OffsetY = -60,
Width = 720,
Color = color,
Font = "AlegreyaSansSCLight",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Right"
})
if exchangeIconPrefix then
CreateTextBox({ Id = components[purchaseButtonKey].Id,
Text = exchangeIconPrefix ,
FontSize = 27,
OffsetX = textOffset, OffsetY = -55,
Color = color,
Font = "AlegreyaSansSCLight",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left",
LuaKey = "TooltipData", LuaValue = tooltipData,
})
exchangeIconOffset = 40
if upgradeData.Slot == "Shout" then
lineSpacing = 4
end
end
CreateTextBox({ Id = components[purchaseButtonKey].Id,
Text = upgradeTitle,
FontSize = 27,
OffsetX = textOffset + exchangeIconOffset, OffsetY = -55,
Color = color,
Font = "AlegreyaSansSCLight",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left",
LuaKey = "TooltipData", LuaValue = tooltipData,
})
-- Chaos curse/blessing traits need VariableAutoFormat disabled
local autoFormat = "BoldFormatGraft"
if upgradeDescription == "ChaosBlessingFormat" or itemData.Type == "TransformingTrait" then
autoFormat = nil
end
CreateTextBoxWithFormat(MergeTables({ Id = components[purchaseButtonKey].Id,
Text = upgradeDescription,
OffsetX = textOffset, OffsetY = -30,
Width = 675,
Justification = "Left",
VerticalJustification = "Top",
LineSpacingBottom = lineSpacing,
UseDescription = true,
LuaKey = "TooltipData", LuaValue = tooltipData,
Format = "BaseFormat",
VariableAutoFormat = autoFormat,
TextSymbolScale = 0.8,
}, LocalizationData.UpgradeChoice.BoonLootButton))
local needsQuestIcon = false
if not GameState.TraitsTaken[upgradeData.Name] and HasActiveQuestForTrait( upgradeData.Name ) then
needsQuestIcon = true
elseif itemData.ItemName ~= nil and not GameState.TraitsTaken[itemData.ItemName] and HasActiveQuestForTrait( itemData.ItemName ) then
needsQuestIcon = true
end
if needsQuestIcon then
components[purchaseButtonKey.."QuestIcon"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = itemLocationX + 92, Y = itemLocationY - 55 })
SetAnimation({ DestinationId = components[purchaseButtonKey.."QuestIcon"].Id, Name = "QuestItemFound" })
-- Silent toolip
CreateTextBox({ Id = components[purchaseButtonKey].Id, TextSymbolScale = 0, Text = "TraitQuestItem", Color = Color.Transparent, LuaKey = "TooltipData", LuaValue = tooltipData, })
end
if upgradeData.LimitedTime then
-- Silent toolip
CreateTextBox({ Id = components[purchaseButtonKey].Id, TextSymbolScale = 0, Text = "SeasonalItem", Color = Color.Transparent, LuaKey = "TooltipData", LuaValue = tooltipData, })
end
if firstOption then
TeleportCursor({ OffsetX = itemLocationX + buttonOffsetX, OffsetY = itemLocationY, ForceUseCheck = true, })
firstOption = false
end
itemLocationY = itemLocationY + 220
end
if IsMetaUpgradeSelected( "RerollPanelMetaUpgrade" ) then
local cost = -1
----------------------------------------------------------------------------
-- EllosRerollEverythingMod edits start here
----------------------------------------------------------------------------
if lootData.BlockReroll == true then
cost = -1
else
local rerollType = EllosRerollEverythingMod.LootNameToRerollType[lootData.Name] or "Boon"
cost = RerollCosts[rerollType]
end
local baseCost = cost
local name = "RerollPanelMetaUpgrade_ShortTotal"
local tooltip = "MetaUpgradeRerollHint"
if cost >= 0 then
local increment = 0
if CurrentRun.CurrentRoom.SpentRerolls then
increment = CurrentRun.CurrentRoom.SpentRerolls[lootData.ObjectId] or 0
end
cost = cost + increment
else
name = "RerollPanel_Blocked"
tooltip = "MetaUpgradeRerollBlockedHint"
end
local color = Color.White
if CurrentRun.NumRerolls < cost or cost < 0 then
color = Color.CostUnaffordable
end
if baseCost >= 0 then
components["RerollPanel"] = CreateScreenComponent({ Name = "ShopRerollButton", Scale = 1.0, Group = "Combat_Menu" })
Attach({ Id = components["RerollPanel"].Id, DestinationId = components.ShopBackground.Id, OffsetX = 0, OffsetY = 410 })
components["RerollPanel"].OnPressedFunctionName = "AttemptPanelReroll"
components["RerollPanel"].RerollFunctionName = "RerollBoonLoot"
components["RerollPanel"].RerollColor = lootData.LootColor
components["RerollPanel"].RerollId = lootData.ObjectId
components["RerollPanel"].Cost = cost
CreateTextBox({ Id = components["RerollPanel"].Id, Text = name, OffsetX = 28, OffsetY = -5,
ShadowColor = {0,0,0,1}, ShadowOffset={0,3}, OutlineThickness = 3, OutlineColor = {0,0,0,1},
FontSize = 28, Color = color, Font = "AlegreyaSansSCExtraBold", LuaKey = "TempTextData", LuaValue = { Amount = cost }})
SetInteractProperty({ DestinationId = components["RerollPanel"].Id, Property = "TooltipOffsetX", Value = 350 })
CreateTextBox({ Id = components["RerollPanel"].Id, Text = tooltip, FontSize = 1, Color = Color.Transparent, Font = "AlegreyaSansSCExtraBold", LuaKey = "TempTextData", LuaValue = { Amount = cost }})
end
end
----------------------------------------------------------------------------
-- EllosRerollEverythingMod edits end here
----------------------------------------------------------------------------
end, EllosRerollEverythingMod)
-- Door Reroll check
ModUtil.BaseOverride("AttemptReroll", function(run, target)
if target == nil or not target.CanBeRerolled then
return
end
local rerollFunction = _G[target.RerollFunctionName]
if rerollFunction == nil then
return
end
local cost = RerollCosts.Door
CurrentRun.CurrentRoom.SpentRerolls = CurrentRun.CurrentRoom.SpentRerolls or {}
local increment = 0
if CurrentRun.CurrentRoom.SpentRerolls then
increment = CurrentRun.CurrentRoom.SpentRerolls["DoorSpentRerolls"] or 0
end
cost = cost + increment
-- TODO: Handle the not enough rerolls case customly
if run.NumRerolls < cost or cost < 0 then
return
end
run.NumRerolls = run.NumRerolls - cost
IncrementTableValue( CurrentRun.CurrentRoom.SpentRerolls, "DoorSpentRerolls", config.RerollIncrements.Door )
UpdateRerollUI( run.NumRerolls )
-- RandomSynchronize( run.NumRerolls )
RandomSynchronize( math.random(100) )
AddInputBlock({ Name = "AttemptReroll" })
PreRerollPresentation( run, target )
rerollFunction( run, target )
PostRerollPresentation( run, target )
InvalidateCheckpoint()
RemoveInputBlock({ Name = "AttemptReroll" })
end, EllosRerollEverythingMod)
-- Wells of Charon
ModUtil.BaseOverride("CreateStoreButtons", function()
local itemLocationStartY = ShopUI.ShopItemStartY
local itemLocationYSpacer = ShopUI.ShopItemSpacerY
local itemLocationMaxY = itemLocationStartY + 4 * itemLocationYSpacer
local itemLocationStartX = ShopUI.ShopItemStartX
local itemLocationXSpacer = ShopUI.ShopItemSpacerX
local itemLocationMaxX = itemLocationStartX + 1 * itemLocationXSpacer
local itemLocationTextBoxOffset = 380
local itemLocationX = itemLocationStartX
local itemLocationY = itemLocationStartY
local components = CurrentRun.CurrentRoom.Store.Screen.Components
local numButtons = StoreData.WorldShop.MaxOffers
if numButtons == nil then
numButtons = 0
for i, groupData in pairs( StoreData.WorldShop.GroupsOf ) do
numButtons = numButtons + groupData.Offers
end
end
local firstUseable = false
for itemIndex = 1, numButtons do
local upgradeData = CurrentRun.CurrentRoom.Store.StoreOptions[itemIndex]
local itemBackingSoldOutKey = "ItemBackingSoldOut"..itemIndex
components[itemBackingSoldOutKey] = CreateScreenComponent({ Name = "BoonSlotInactive"..itemIndex, Group = "Combat_Menu", Scale = 1, X = itemLocationX, Y = itemLocationY })
if upgradeData ~= nil then
if not upgradeData.Processed then
if upgradeData.Type == "Trait" then
upgradeData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = upgradeData.Name })
if upgradeData.CostIncreasePerStack ~= nil then
upgradeData.Cost = upgradeData.Cost + GetTraitCount(CurrentRun.Hero, upgradeData) * upgradeData.CostIncreasePerStack
end
upgradeData.Type = "Trait"
SetTraitTextData( upgradeData )
elseif upgradeData.Type == "Consumable" then
upgradeData = GetRampedConsumableData( ConsumableData[upgradeData.Name] )
upgradeData.Type = "Consumable"
elseif upgradeData.Type == "Cosmetic" then
upgradeData = DeepCopyTable( ConditionalItemData[upgradeData.Name] )
upgradeData.Type = "Cosmetic"
end
local costMultiplier = 1 + ( GetNumMetaUpgrades( "ShopPricesShrineUpgrade" ) * ( MetaUpgradeData.ShopPricesShrineUpgrade.ChangeValue - 1 ) )
costMultiplier = costMultiplier * GetTotalHeroTraitValue("StoreCostMultiplier", {IsMultiplier = true})
if costMultiplier ~= 1 then
upgradeData.Cost = round( upgradeData.Cost * costMultiplier )
end
upgradeData.Processed = true
elseif upgradeData.Type == "Trait" then
RecalculateStoreTraitDurations( upgradeData )
end
CurrentRun.CurrentRoom.Store.StoreOptions[itemIndex] = upgradeData
local tooltipData = upgradeData
local purchaseButtonKey = "PurchaseButton"..itemIndex
components[purchaseButtonKey] = CreateScreenComponent({ Name = "BoonSlot"..itemIndex, Group = "Combat_Menu", Scale = 1, X = itemLocationX, Y = itemLocationY })
SetInteractProperty({ DestinationId = components[purchaseButtonKey].Id, Property = "TooltipOffsetX", Value = 665 })
SetInteractProperty({ DestinationId = components[purchaseButtonKey].Id, Property = "FreeFormSelectOffsetX", Value = -200 })
if upgradeData.Icon ~= nil then
local iconKey = "Icon"..itemIndex
components[iconKey] = CreateScreenComponent({ Name = "BlankObstacle", X = itemLocationX - 343, Y = itemLocationY, Group = "Combat_Menu" })
SetAnimation({ DestinationId = components[iconKey].Id , Name = upgradeData.Icon.."_Large" })
end
local itemBackingKey = "Backing"..itemIndex
components[itemBackingKey] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = itemLocationX + itemLocationTextBoxOffset, Y = itemLocationY })
local purchaseButtonTitleKey = "PurchaseButtonTitle"..itemIndex
components[purchaseButtonTitleKey] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", Scale = 1, X = itemLocationX, Y = itemLocationY })
CreateTextBoxWithFormat(MergeTables({ Id = components[purchaseButtonKey].Id,
Text = GetTraitTooltip( upgradeData ),
OffsetX = -245,
OffsetY = -23,
Format = "BaseFormat",
UseDescription = true,
VariableAutoFormat = "BoldFormatGraft",
LuaKey = "TooltipData",
LuaValue = tooltipData,
Justification = "Left",
VerticalJustification = "Top",
LineSpacingBottom = 8,
Width = "665" },LocalizationData.SellTraitScripts.ShopButton))
local costString = "@GUI\\Icons\\Currency_Small"
costString = upgradeData.Cost .. " " .. costString
local costColor = Color.CostAffordableShop
if CurrentRun.Money ~= nil and CurrentRun.Money < upgradeData.Cost then
costColor = Color.CostUnaffordable
end
if upgradeData.HealthCost then
costString = upgradeData.HealthCost .. " @GUI\\Icons\\Life_Small"
if CurrentRun.Hero.Health > upgradeData.HealthCost then
costColor = Color.CostAffordableShop
else
costColor = Color.CostUnaffordable
end
end
local needsQuestIcon = false
if upgradeData.Type == "Trait" then
if not GameState.TraitsTaken[upgradeData.Name] and HasActiveQuestForTrait( upgradeData.Name ) then
needsQuestIcon = true
end
elseif upgradeData.Type == "Consumable" then
if not GameState.ItemInteractions[upgradeData.Name] and HasActiveQuestForItem( upgradeData.Name ) then
needsQuestIcon = true
end
end
if needsQuestIcon then
components[purchaseButtonKey.."QuestIcon"] = CreateScreenComponent({ Name = "BlankObstacle", Group = "Combat_Menu", X = itemLocationX + 112, Y = itemLocationY - 55 })
SetAnimation({ DestinationId = components[purchaseButtonKey.."QuestIcon"].Id, Name = "QuestItemFound" })
-- Silent toolip
CreateTextBox({ Id = components[purchaseButtonKey].Id, TextSymbolScale = 0, Text = "TraitQuestItem", Color = Color.Transparent, LuaKey = "TooltipData", LuaValue = tooltipData, })
end
components[purchaseButtonKey].OnPressedFunctionName = "HandleStorePurchase"
if not firstUseable then
TeleportCursor({ OffsetX = itemLocationX, OffsetY = itemLocationY, ForceUseCheck = true })
firstUseable = true
end
CreateTextBox(MergeTables({ Id = components[purchaseButtonTitleKey].Id, Text = costString, OffsetX = 410, OffsetY = -50, FontSize = 28, Color = costColor, Font = "AlegreyaSansSCRegular", Justification = "Right" },LocalizationData.SellTraitScripts.ShopButton))
CreateTextBox(MergeTables({ Id = components[purchaseButtonTitleKey].Id, Text = upgradeData.Name,
FontSize = 25,
OffsetX = -245, OffsetY = -50,
Width = 720,
Color = costColor,
Font = "AlegreyaSansSCBold",
ShadowBlur = 0, ShadowColor = {0,0,0,1}, ShadowOffset={0, 2},
Justification = "Left",
},LocalizationData.SellTraitScripts.ShopButton))
components[purchaseButtonKey].Data = upgradeData
components[purchaseButtonKey].WeaponName = currentWeapon
components[purchaseButtonKey].Index = itemIndex
components[purchaseButtonKey].TitleId = components[purchaseButtonTitleKey].Id
if CurrentRun.CurrentRoom.Store.Buttons == nil then
CurrentRun.CurrentRoom.Store.Buttons = {}
end
table.insert(CurrentRun.CurrentRoom.Store.Buttons, components[purchaseButtonKey])
end
itemLocationX = itemLocationX + itemLocationXSpacer
if itemLocationX >= itemLocationMaxX then
itemLocationX = itemLocationStartX
itemLocationY = itemLocationY + itemLocationYSpacer
end
end
if IsMetaUpgradeSelected("RerollPanelMetaUpgrade") then
local increment = 0
local cost = RerollCosts.Shop
if CurrentRun.CurrentRoom.SpentRerolls then
increment = CurrentRun.CurrentRoom.SpentRerolls[CurrentRun.CurrentRoom.Store.Screen.Name] or 0
end
cost = cost + increment
local color = Color.White
if CurrentRun.NumRerolls < cost or cost < 0 then
color = Color.CostUnaffordable
end
if cost >= 0 then
components["RerollPanel"] = CreateScreenComponent({ Name = "ShopRerollButton", Scale = 1.0, Group = "Combat_Menu" })
Attach({ Id = components["RerollPanel"].Id, DestinationId = components.ShopBackground.Id, OffsetX = -200, OffsetY = 440 })
components["RerollPanel"].OnPressedFunctionName = "AttemptPanelReroll"
components["RerollPanel"].RerollFunctionName = "RerollStore"
components["RerollPanel"].Cost = cost
components["RerollPanel"].RerollColor = {48, 25, 83, 255}
components["RerollPanel"].RerollId = CurrentRun.CurrentRoom.Store.Screen.Name
CreateTextBox({ Id = components["RerollPanel"].Id, Text = "RerollPanelMetaUpgrade_ShortTotal", OffsetX = 28, OffsetY = -5,
ShadowColor = {0,0,0,1}, ShadowOffset={0,3}, OutlineThickness = 3, OutlineColor = {0,0,0,1},
FontSize = 28, Color = color, Font = "AlegreyaSansSCExtraBold", LuaKey = "TempTextData", LuaValue = { Amount = cost }})
SetInteractProperty({ DestinationId = components["RerollPanel"].Id, Property = "TooltipOffsetX", Value = 850 })
CreateTextBox({ Id = components["RerollPanel"].Id, Text = "MetaUpgradeRerollHint", FontSize = 1, Color = Color.Transparent, Font = "AlegreyaSansSCExtraBold", LuaKey = "TempTextData", LuaValue = { Amount = cost }})
end
end
end, EllosRerollEverythingMod)
-- Add our special use data to all use text data. Only door rerolls will actually use it
ModUtil.WrapBaseFunction("GetUseData", function ( baseFunc, useTarget )
local useData = baseFunc(useTarget)
local cost = (RerollCosts.Door or 0) + (ModUtil.PathGet("CurrentRun.CurrentRoom.SpentRerolls.DoorSpentRerolls") or 0)
useData = MergeTables(useData, {EllosRerollEverythingModDoorRerollCost = tostring(cost)})
return useData
end, EllosRerollEverythingMod)
-- Set starting number of rerolls if it has been specified
ModUtil.WrapBaseFunction("StartNewRun", function ( baseFunc, currentRun )
local run = baseFunc(currentRun)
if config.NumStartingRerolls then
run.NumRerolls = config.NumStartingRerolls
end
return run
end, EllosRerollEverythingMod)
-- Enable both fated persuation and authority
ModUtil.WrapBaseFunction("IsMetaUpgradeSelected", function ( baseFunc, metaUpgrade )
if metaUpgrade == "RerollMetaUpgrade" or metaUpgrade == "RerollPanelMetaUpgrade" then
return true
end
return baseFunc(metaUpgrade)
end, EllosRerollEverythingMod)
|
local registerAsserts = require 'registerAsserts'
local KMeans = require 'stuart-ml.clustering.KMeans'
registerAsserts(assert)
describe('clustering.KMeans', function()
it('default parameters', function()
local kmeans = KMeans:new()
assert.equal(2, kmeans:getK())
assert.equal(20, kmeans:getMaxIterations())
assert.equal(KMeans.K_MEANS_PARALLEL, kmeans:getInitializationMode())
assert.equal(2, kmeans:getInitializationSteps())
end)
it('set parameters', function()
local kmeans = KMeans:new()
:setK(9)
:setMaxIterations(33)
:setInitializationMode(KMeans.RANDOM)
:setInitializationSteps(3)
:setSeed(123)
assert.equal(9, kmeans:getK())
assert.equal(33, kmeans:getMaxIterations())
assert.equal(KMeans.RANDOM, kmeans:getInitializationMode())
assert.equal(3, kmeans:getInitializationSteps())
assert.equal(123, kmeans:getSeed())
end)
it('parameters validation', function()
assert.has_error(function()
KMeans:new():setK(0)
end)
assert.has_error(function()
KMeans:new():setInitializationMode('no_such_a_mode')
end)
assert.has_error(function()
KMeans:new():setInitializationSteps(0)
end)
end)
end)
|
local modname = "pizza"
local modpath = minetest.get_modpath(modname)
local mg_name = minetest.get_mapgen_setting("mg_name")
local S = minetest.get_translator(minetest.get_current_modname())
-- Additional material for pizzas
minetest.register_craftitem("pizza:cheddar", {
description = S("Cheddar"),
inventory_image = "Cheddar.png",
on_use = minetest.item_eat(4),
groups = {food_cheese = 1, flammable = 2},
})
minetest.register_craft({
output = "pizza:cheddar",
recipe = {
{"wool:white","mobs:bucket_milk",""},
{"farming:pot","farming:salt",""},
{"","",""},
},
replacements = {
{"wool:white","wool:white"},
{"mobs:bucket_milk","bucket:bucket_empty"},
},
})
minetest.register_craftitem("pizza:mozarella", {
description = S("Mozarella Ball"),
inventory_image = "Mozarella.png",
on_use = minetest.item_eat(4),
groups = {food_cheese = 1, flammable = 2},
})
minetest.register_craft({
output = "pizza:mozarella 3",
recipe = {
{"mobs:bucket_milk","mobs:bucket_milk",""},
{"bucket:bucket_river_water","farming:salt",""},
{"","",""},
},
replacements = {
{"bucket:bucket_river_water", "bucket:bucket_empty"},
{"mobs:bucket_milk","bucket:bucket_empty"},
},
})
minetest.register_node("pizza:marinara", {
description = S("Marinara Jar"),
drawtype = "plantlike",
tiles = {"Marinara.png"},
inventory_image = "Marinara.png",
wield_image = "Marinara.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16},
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1},
on_use = minetest.item_eat(2, "vessels:glass_bottle"),
sounds = default.node_sound_glass_defaults()
})
minetest.register_craft({
output = "pizza:marinara",
recipe = {
{"group:food_tomato","group:food_garlic_clove",""},
{"farming:salt","farming:onion",""},
{"vessels:glass_bottle","",""},
},
})
minetest.register_craftitem("pizza:pepperoni", {
description = S("Pepperoni"),
inventory_image = "Pepperonimeat.png",
on_use = minetest.item_eat(2),
groups = {food_meat_raw = 1, flammable = 2},
})
minetest.register_craft({
output = "pizza:pepperoni 3",
recipe = {
{"farming:salt","mobs:meat_raw",""},
{"","",""},
{"","",""},
},
})
-- Pizzas Finally
minetest.register_node("pizza:margherita", {
description = S("Margharita Pizza"),
tiles = {"Margherite.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0.3125},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0.3125, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1},
on_use = minetest.item_eat(8),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:margherita_6"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_craft({
output = "pizza:margherita",
recipe = {
{"group:food_flour","group:food_tomato",""},
{"pizza:marinara","pizza:mozarella",""},
{"","",""},
},
replacements = {
{"pizza:marinara","vessels:glass_bottle"},
},
})
minetest.register_node("pizza:pepperonipizza", {
description = S("Pepperoni Pizza"),
tiles = {"Pepperoni.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0.3125},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0.3125, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1},
on_use = minetest.item_eat(8),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:pepperonipizza_6"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_craft({
output = "pizza:pepperonipizza",
recipe = {
{"group:food_flour","group:food_cheese",""},
{"pizza:marinara","pizza:pepperoni",""},
{"","",""},
},
replacements = {
{"pizza:marinara","vessels:glass_bottle"},
},
})
minetest.register_node("pizza:hawaiian", {
description = S("Pineapple Pizza"),
tiles = {"Hawaiian.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0.3125},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0.3125, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1},
on_use = minetest.item_eat(8),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:hawaiian_6"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_craft({
output = "pizza:hawaiian",
recipe = {
{"group:food_flour","farming:pineapple_ring",""},
{"mobs:meat","group:food_cheese",""},
{"","",""},
},
replacements = {
{"pizza:marinara","vessels:glass_bottle"},
},
})
minetest.register_node("pizza:cheese_pizza", {
description = S("Cheese Pizza"),
tiles = {"CheesePizza.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0.3125},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0.3125, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1},
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:cheese_pizza_6"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_craft({
output = "pizza:cheese_pizza",
recipe = {
{"group:food_flour","pizza:mozarella",""},
{"mobs:cheese","pizza:cheddar",""},
{"","",""},
},
replacements = {
{"pizza:marinara","vessels:glass_bottle"},
},
})
-- pizza slices
minetest.register_craftitem("pizza:margherita_slice", {
description = S("Margharita Pizza Slice"),
inventory_image = "Marghariteslice.png",
on_use = minetest.item_eat(1),
groups = {food_pizza = 1, flammable = 2},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:margherita_slice 8",
recipe = {
"pizza:margherita",
"farming:cutting_board"
},
replacements = {
{"farming:cutting_board","farming:cutting_board"},
},
})
minetest.register_craftitem("pizza:pepperoni_slice", {
description = S("Pepperoni Pizza Slice"),
inventory_image = "Pepperonislice.png",
on_use = minetest.item_eat(1),
groups = {food_pizza = 1, flammable = 2},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:pepperoni_slice 8",
recipe = {
"pizza:pepperonipizza",
"farming:cutting_board"
},
replacements = {
{"farming:cutting_board","farming:cutting_board"},
},
})
minetest.register_craftitem("pizza:hawaiian_slice", {
description = S("Pineapple Pizza Slice"),
inventory_image = "Hawaiianslice.png",
on_use = minetest.item_eat(1),
groups = {food_pizza = 1, flammable = 2},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:hawaiian_slice 8",
recipe = {
"pizza:hawaiian",
"farming:cutting_board"
},
replacements = {
{"farming:cutting_board","farming:cutting_board"},
},
})
minetest.register_craftitem("pizza:cheesepizza_slice", {
description = S("Cheese Pizza Slice"),
inventory_image = "Cheesepizzaslice.png",
on_use = minetest.item_eat(1),
groups = {food_pizza = 1, flammable = 2},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:cheesepizza_slice 8",
recipe = {
"pizza:cheese_pizza",
"farming:cutting_board"
},
replacements = {
{"farming:cutting_board","farming:cutting_board"},
},
})
-- Packing pizza slices
minetest.register_craft({
type = "shapeless",
output = "pizza:margherita",
recipe = {
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
"pizza:margherita_slice",
},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:pepperonipizza",
recipe = {
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
"pizza:pepperoni_slice",
},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:hawaiian",
recipe = {
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
"pizza:hawaiian_slice",
},
})
minetest.register_craft({
type = "shapeless",
output = "pizza:cheese_pizza",
recipe = {
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
"pizza:cheesepizza_slice",
},
})
-- Ate pizza
minetest.register_node("pizza:cheese_pizza_6", {
description = S("Cheese Pizza"),
tiles = {"CheesePizza.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{0.3125, -0.56, -0, 0, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(6),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:cheese_pizza_4"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:cheese_pizza_4", {
description = S("Cheese Pizza"),
tiles = {"CheesePizza.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(4),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:cheese_pizza_2"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:cheese_pizza_2", {
description = S("Cheese Pizza"),
tiles = {"CheesePizza.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(2),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "air"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:hawaiian_6", {
description = S("Pineapple Pizza"),
tiles = {"Hawaiian.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{0.3125, -0.56, -0, 0, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(6),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:hawaiian_4"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:hawaiian_4", {
description = S("Pineapple 4"),
tiles = {"Hawaiian.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(4),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:hawaiian_2"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:hawaiian_2", {
description = S("Pineapple Pizza"),
tiles = {"Hawaiian.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(2),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "air"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:pepperonipizza_6", {
description = S("Pepperoni Pizza"),
tiles = {"Pepperoni.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{0.3125, -0.56, -0, 0, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(6),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:pepperonipizza_4"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:pepperonipizza_4", {
description = S("Pepperoni Pizza"),
tiles = {"Pepperoni.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(4),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:pepperonipizza_2"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:pepperonipizza_2", {
description = S("Pepperoni Pizza"),
tiles = {"Pepperoni.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(2),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "air"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:margherita_6", {
description = S("Margharita Pizza"),
tiles = {"Margherite.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{0.3125, -0.56, -0, 0, -0.375, 0.3125},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0.3125, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
{-0, -0.56, 0.5, 0.3125, -0.25, 0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(6),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:margherita_4"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:margherita_4", {
description = S("Margharita Pizza"),
tiles = {"Margherite.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0.3125, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0.3125, -0.56, 0, 0.5, -0.25, -0.3125},
{0.3125, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(4),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "pizza:margherita_2"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
})
minetest.register_node("pizza:margherita_2", {
description = S("Margharita Pizza"),
tiles = {"Margherite.png", "pizzabottom.png", "pizzabottom.png"},
walkable = true,
drawtype = "nodebox",
paramtype = "light",
buildable = false,
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.56, -0.3125, 0, -0.375, 0},
{-0.3125, -0.56, -0.3125, -0.5, -0.25, 0},
{0, -0.56, -0.5, -0.3125, -0.25, -0.3125},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.45, -0.5, -0.45, 0.45, -0.225, 0.45},
},
},
groups = {snappy = 3, food_pizza = 1, not_in_creative_inventory = 1},
on_use = minetest.item_eat(2),
visual_scale = 0.9,
on_punch = function(pos, node, puncher, pointed_thing)
node.name = "air"
minetest.swap_node(pos,node)
if minetest.get_modpath("stamina") ~= nil then
stamina.change(puncher, 2)
minetest.sound_play("stamina_eat", {
pos = pos, gain = 0.7, max_hear_distance = 5})
end
end
}) |
local Class = require("facto.class")
local ContainerType = require("facto.gui.containertype")
local EmptyWidget = Class.extend({}, ContainerType)
EmptyWidget.type = "empty-widget"
EmptyWidget.RuleSupports = {
"height", "width", "hstretch","nat-height","max-height","min-width"
}
function EmptyWidget:getProps(props)
props.type = "empty-widget"
-- props.horizontally_stretchable = true -- self.options.horizontally_stretchable
return props
end
function EmptyWidget:onattached(gui)
EmptyWidget.super.onattached(self, gui)
end
-- @export
return EmptyWidget |
SaunanTaakseQuotes = LibStub("AceAddon-3.0"):NewAddon("SaunanTaakseQuotes1")
local SaunanTaakseQuotes = LibStub("AceAddon-3.0"):GetAddon("SaunanTaakseQuotes1")
SLASH_SAUNANTAAKSEQUOTES1 = "/teho"
SlashCmdList["SAUNANTAAKSEQUOTES"]=function(msg)
print(getTeho())
end |
Config = {}
Config.OpenKeyMenu = 0x26E9DC00
Config.Language = {
['menuHorsesTitle'] = "Shop Horses",
['menuComplementsTitle'] = "Accessories",
['menuComplementsSubTitle'] = "Mount Accessories",
['subMenuComplementsHorsesTitle'] = "Horses",
['subMenuComplementsHorsesSubTitle'] = "Horse Accessories",
['menuMountsTitle'] = "Mounts",
['menuMountsSubTitle'] = "Your Mounts",
['menuMountsHorsesTitle'] = "Horses",
['menuMountsHorsesSubTitle'] = "Your horse options",
['optionSelectYourHorseAccessories'] = "Select Your Horse Accesories",
['optionSelectYourHorse'] = "Select Your Horse",
['optionSendHorseToStableDesc'] = "Flee your Horse",
['optionSendHorseToStable'] = "Flee Horse",
['optionTameHorseDesc'] = "Tame a wild horse",
['optionTameHorse'] = "Tame Horse",
['optionDeleteHorseDesc'] = "Release your horse",
['optionDeleteHorse'] = "Release Horse",
['putAccessoriesOnHorse'] = "Put a ",
['notifNeedBeMount'] = "You need to be mount on a wild horse",
['notifHasOwner'] = "This horse has owner",
['callHorseName'] = "Call ",
['SubTitleOptionsText'] = "Options",
}
Config.Menu = {
{
['Text'] = "Saddle",
['SubText'] = "",
['Desc'] = "Saddle for horses",
['Param'] = {
['Tipo'] = 1
}
},
{
['Text'] = "Blanket",
['SubText'] = "",
['Desc'] = "Blanket for horses",
['Param'] = {
['Tipo'] = 2
}
},
{
['Text'] = "Mane",
['SubText'] = "",
['Desc'] = "Mane for horses",
['Param'] = {
['Tipo'] = 3
}
},
{
['Text'] = "Tail",
['SubText'] = "",
['Desc'] = "Tail for horses",
['Param'] = {
['Tipo'] = 4
}
},
{
['Text'] = "Bag",
['SubText'] = "",
['Desc'] = "Bag for horses",
['Param'] = {
['Tipo'] = 5
}
},
{
['Text'] = "Bedroll",
['SubText'] = "",
['Desc'] = "Bedroll for horses",
['Param'] = {
['Tipo'] = 6
}
},
{
['Text'] = "Stirups",
['SubText'] = "",
['Desc'] = "Stirups for horses",
['Param'] = {
['Tipo'] = 7
}
}
}
--Horses buy Menu from mrlupo
Config.Horses = {
{
['Text'] = "$20 - Tennesseewalker Chestnut",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~0",
['Param'] = {
['Price'] = 20,
['Model'] = GetHashKey("A_C_HORSE_TENNESSEEWALKER_CHESTNUT"),
['Level'] = 0
}
},
{
['Text'] = "$35 - SHIRE RAVENBLACK",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~3",
['Param'] = {
['Price'] = 35,
['Model'] = GetHashKey("A_C_HORSE_SHIRE_RAVENBLACK"),
['Level'] = 0
}
},
{
['Text'] = "$45 - APPALOOSA LEOPARD",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~6",
['Param'] = {
['Price'] = 35,
['Model'] = GetHashKey("A_C_HORSE_APPALOOSA_LEOPARD"),
['Level'] = 6
}
},
{
['Text'] = "$60 - Mr Bill W",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~9",
['Param'] = {
['Price'] = 60,
['Model'] = GetHashKey("A_C_HORSE_GANG_BILL"),
['Level'] = 9
}
},
{
['Text'] = "$70 - Kentuckysaddle Black",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~13",
['Param'] = {
['Price'] = 70,
['Model'] = GetHashKey("A_C_HORSE_KENTUCKYSADDLE_BLACK"),
['Level'] = 13
},
},
{
['Text'] = "$150 - THOROUGHBRED BRINDLE",
['SubText'] = "",
['Desc'] = "Level Require : ~pa~16",
['Param'] = {
['Price'] = 150,
['Model'] = GetHashKey("A_C_HORSE_THOROUGHBRED_BRINDLE"),
['Level'] = 16
}
}
}
--Sillas complementos
Config.MenuSillas = {
{
['Text'] = "Saddle #1",
['SubText'] = "",
['Desc'] = "Saddle 1 for horses",
['Param'] = {
['Hash'] = 0x106961A8,
['Precio'] = 10
}
},
{
['Text'] = "Saddle #2",
['SubText'] = "",
['Desc'] = "Saddle 2 for horses",
['Param'] = {
['Hash'] = 0x14168240,
['Precio'] = 10
}
},
{
['Text'] = "Saddle #3",
['SubText'] = "",
['Desc'] = "Saddle 3 for horses",
['Param'] = {
['Hash'] = 0x150D0DAA,
['Precio'] = 10
}
},
{
['Text'] = "Saddle #4",
['SubText'] = "",
['Desc'] = "Saddle 4 for horses",
['Param'] = {
['Hash'] = 0x15FB6791,
['Precio'] = 10
}
},
{
['Text'] = "Saddle #5",
['SubText'] = "",
['Desc'] = "Saddle 5 for horses",
['Param'] = {
['Hash'] = 0x17153A45,
['Precio'] = 10
}
}
}
--Mantas complementos
Config.MenuMantas = {
{
['Text'] = "Blanket #1",
['SubText'] = "",
['Desc'] = "Blanket 1 for horses",
['Param'] = {
['Hash'] = 0x127E0412,
['Precio'] = 10
}
},
{
['Text'] = "Blanket #2",
['SubText'] = "",
['Desc'] = "Blanket 2 for horses",
['Param'] = {
['Hash'] = 0x19C5E80C,
['Precio'] = 10
}
},
{
['Text'] = "Blanket #3",
['SubText'] = "",
['Desc'] = "Blanket 3 for horses",
['Param'] = {
['Hash'] = 0x20D4A0BF,
['Precio'] = 10
}
},
{
['Text'] = "Blanket #4",
['SubText'] = "",
['Desc'] = "Blanket 4 for horses",
['Param'] = {
['Hash'] = 0x2286EE30,
['Precio'] = 10
}
},
{
['Text'] = "Blanket #5",
['SubText'] = "",
['Desc'] = "Blanket 5 for horses",
['Param'] = {
['Hash'] = 0x269583CA,
['Precio'] = 10
}
}
}
--Crin Complementos
Config.MenuCrines = {
{
['Text'] = "Mane #1",
['SubText'] = "",
['Desc'] = "Mane 1 for horses",
['Param'] = {
['Hash'] = 0x130E341A,
['Precio'] = 10
}
},
{
['Text'] = "Mane #2",
['SubText'] = "",
['Desc'] = "Mane 2 for horses",
['Param'] = {
['Hash'] = 0x14098229,
['Precio'] = 10
}
},
{
['Text'] = "Mane #3",
['SubText'] = "",
['Desc'] = "Mane 3 for horses",
['Param'] = {
['Hash'] = 0x16923E26,
['Precio'] = 10
}
},
{
['Text'] = "Mane #4",
['SubText'] = "",
['Desc'] = "Mane 4 for horses",
['Param'] = {
['Hash'] = 0x18199F48,
['Precio'] = 10
}
},
{
['Text'] = "Mane #5",
['SubText'] = "",
['Desc'] = "Mane 5 for horses",
['Param'] = {
['Hash'] = 0x1A5A45B6,
['Precio'] = 10
}
}
}
--Colas complementos
Config.MenuColas = {
{
['Text'] = "Tail #1",
['SubText'] = "",
['Desc'] = "Tail 1 for horses",
['Param'] = {
['Hash'] = 0x12DBBBAF,
['Precio'] = 10
}
},
{
['Text'] = "Tail #2",
['SubText'] = "",
['Desc'] = "Tail 2 for horses",
['Param'] = {
['Hash'] = 0x17EB79D3,
['Precio'] = 10
}
},
{
['Text'] = "Tail #3",
['SubText'] = "",
['Desc'] = "Tail 3 for horses",
['Param'] = {
['Hash'] = 0x1A3B721B,
['Precio'] = 10
}
},
{
['Text'] = "Tail #4",
['SubText'] = "",
['Desc'] = "Tail 4 for horses",
['Param'] = {
['Hash'] = 0x1BB5EAA1,
['Precio'] = 10
}
},
{
['Text'] = "Tail #5",
['SubText'] = "",
['Desc'] = "Tail 5 for horses",
['Param'] = {
['Hash'] = 0x1E9A18C2,
['Precio'] = 10
}
}
}
--Alforjas complementos
Config.MenuAlforjas = {
{
['Text'] = "Bedroll #1",
['SubText'] = "",
['Desc'] = "Bedroll 1 for horses",
['Param'] = {
['Hash'] = 0x1D4EDB88,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #2",
['SubText'] = "",
['Desc'] = "Bedroll 2 for horses",
['Param'] = {
['Hash'] = 0x20AA8620,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #3",
['SubText'] = "",
['Desc'] = "Bedroll 3 for horses",
['Param'] = {
['Hash'] = 0x293E17B3,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #4",
['SubText'] = "",
['Desc'] = "Bedroll 4 for horses",
['Param'] = {
['Hash'] = 0x2AEFF6CA,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #5",
['SubText'] = "",
['Desc'] = "Bedroll 5 for horses",
['Param'] = {
['Hash'] = 0x5277E9BA,
['Precio'] = 10
}
}
}
--Petates Complementos
Config.MenuPetates = {
{
['Text'] = "Bedroll #1",
['SubText'] = "",
['Desc'] = "Bedroll 1 for horses",
['Param'] = {
['Hash'] = 0x12F0DF9F,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #2",
['SubText'] = "",
['Desc'] = "Bedroll 2 for horses",
['Param'] = {
['Hash'] = 0x18BB6B30,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #3",
['SubText'] = "",
['Desc'] = "Bedroll 3 for horses",
['Param'] = {
['Hash'] = 0x1B43F045,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #4",
['SubText'] = "",
['Desc'] = "Bedroll 4 for horses",
['Param'] = {
['Hash'] = 0x27543EBB,
['Precio'] = 10
}
},
{
['Text'] = "Bedroll #5",
['SubText'] = "",
['Desc'] = "Bedroll 5 for horses",
['Param'] = {
['Hash'] = 0x36BEDD90,
['Precio'] = 10
}
}
}
--Estribos Complementos
Config.MenuEstribos = {
{
['Text'] = "Stirups #1",
['SubText'] = "",
['Desc'] = "Stirups 1 for horses",
['Param'] = {
['Hash'] = 0x3B3AB08,
['Precio'] = 10
}
},
{
['Text'] = "Stirups #2",
['SubText'] = "",
['Desc'] = "Stirups 2 for horses",
['Param'] = {
['Hash'] = 0x587DD49F,
['Precio'] = 10
}
},
{
['Text'] = "Stirups #3",
['SubText'] = "",
['Desc'] = "Stirups 3 for horses",
['Param'] = {
['Hash'] = 0x67AF7302,
['Precio'] = 10
}
},
{
['Text'] = "Stirups #4",
['SubText'] = "",
['Desc'] = "Stirups 4 for horses",
['Param'] = {
['Hash'] = 0x75178DD2,
['Precio'] = 10
}
},
{
['Text'] = "Stirups #5",
['SubText'] = "",
['Desc'] = "Stirups 5 for horses",
['Param'] = {
['Hash'] = 0x8246282F,
['Precio'] = 10
}
}
}
Config.Texto = "Press [ENTER] to open stable"
Config.Coords = {
{name="Establo", x = -366.08, y = 787.01, z = 116.17},
{name="Establo", x = -874.02, y = -1364.78, z = 43.53},
{name="Establo", x = -1777.02, y = -440.15, z = 154.96},
{name="Establo", x = 2502.5, y = -1455.33, z = 46.31},
{name="Establo", x = 2970.73, y = 1427.97, z = 44.71}
}
Config.SpawnHorse = {
vector4( -373.302, 786.904, 116.169, 273.18 ),
vector4( -863.746, -1366.289, 43.549, 88.17 ),
vector4( -1773.523, -441.351, 155.046, 72.45 ),
vector4( 2508.778, -1450.003, 46.404, 79.792 ),
vector4( 2967.735, 1431.232, 44.753, 215.782 ),
}
Citizen.CreateThread(function()
for _, st in pairs(Config.Coords) do
print(st.x)
print(st.name)
local blip = N_0x554d9d53f696d002(1664425300, st.x, st.y, st.z)
SetBlipSprite(blip, 469827317, 1)
SetBlipScale(blip, 0.2)
Citizen.InvokeNative(0x9CB1A1623062F402, blip, st.name)
end
end) |
return {'hugenoot','hugo','hughes','hugen','huggers','hugenoten','hugos'} |
local getAliveHumanoidFromModel = require(script.Parent.getAliveHumanoidFromModel)
local function getAliveHumanoidFromDescendant(descendant: Instance)
local model = descendant:FindFirstAncestorWhichIsA("Model")
return if model then getAliveHumanoidFromModel(model) else nil
end
return getAliveHumanoidFromDescendant
|
CMD.name = 'FreezeBots'
CMD.description = 'command.freezebots.description'
CMD.permission = 'moderator'
CMD.category = 'permission.categories.server_management'
CMD.aliases = { 'botfreeze', 'freezebot', 'bot_freeze', 'bot_zombie' }
function CMD:on_run(player)
self:notify_staff('command.freezebots.message', {
player = get_player_name(player)
})
RunConsoleCommand('bot_zombie', 1)
end
|
--[[
Namespace: Helpers
All helper modules.
]]
local Namespace = {}
Namespace.Class = require("Helpers.Class")
Namespace.Common = require("Helpers.Common")
return Namespace
|
return {
[1] = {product=1, price = 10.00, card = 10 + 1,},
[2] = {product=2, price = 20.00, card = 20 + 4,},
[3] = {product=3, price = 50.00, card = 50 + 15},
[4] = {product=4, price = 100.00, card = 100 + 35},
-- 抽奖商品
[6] = {product=6, price = 2.00, random_tbl={[3]=1}, show_tbl={ 5, 6, 7, 8, 9, 10, 11, 12}},
[7] = {product=7, price = 5.00, random_tbl={[6]=1, [ 7]=1}, show_tbl={ 5, 8, 12, 14, 15, 16, 18, 20}},
[8] = {product=8, price = 10.00, random_tbl={[12]=1, [13]=1}, show_tbl={10, 15, 20, 26, 36, 40, 46, 50}},
[9] = {product=9, price = 18.00, random_tbl={[24]=1, [23]=1, [22]=1}, show_tbl={20, 30, 42, 48, 56, 66, 78, 90}},
[10]= {product=10,price = 30.00, random_tbl={[40]=1, [39]=1, [38]=1}, show_tbl={32, 35, 58, 78, 98, 116, 138, 150}},
[11]= {product=11,price = 50.00, random_tbl={[68]=1, [67]=1, [66]=1}, show_tbl={55, 58, 98, 138, 166, 198, 226, 248}},
-- 代理
[12]={product=12, price = 300.00, proxy_card=300 + 100}
}
|
-- Generated by LairTool
rori_shallow_torton_lair_neutral_medium = Lair:new {
mobiles = {{"shallow_torton", 1}},
spawnLimit = 12,
buildingsVeryEasy = {"object/tangible/lair/base/poi_all_lair_dead_log_large_evil_fire_small.iff"},
buildingsEasy = {"object/tangible/lair/base/poi_all_lair_dead_log_large_evil_fire_small.iff"},
buildingsMedium = {"object/tangible/lair/base/poi_all_lair_dead_log_large_evil_fire_small.iff"},
buildingsHard = {"object/tangible/lair/base/poi_all_lair_dead_log_large_evil_fire_small.iff"},
buildingsVeryHard = {"object/tangible/lair/base/poi_all_lair_dead_log_large_evil_fire_small.iff"}
}
addLairTemplate("rori_shallow_torton_lair_neutral_medium", rori_shallow_torton_lair_neutral_medium)
|
--[[
Manager module that allows to keep the state of multiple gamepads
at a given frame of the game.
Each input registered in each gamepad input's table can only have 3 states :
- true: input has been pressed THIS frame of the game
- false: input has been released THIS frame of the game
- nil: input hasn't changed state
]]
local GamepadManager = Class:derive("GamepadManager")
local abs = math.abs
-- Function solely used to hook the manager to the relevant love events
-- Note we could upgrade this by also taking into account the raw buttons (love.joystickpressed/released)
local function HookLoveEvents(self)
function love.joystickadded(p_joystick)
local id = p_joystick:getID()
assert(self.connectedSticks[id] == nil, "Joystick with ID "..id.." is already connected! This should never happen!")
self.connectedSticks[id] = p_joystick
self.stickButtons[id] = {}
end
function love.joystickremoved(p_joystick)
local id = p_joystick:getID()
self.connectedSticks[id] = nil
self.stickButtons[id] = nil
end
function love.gamepadpressed(p_joystick, p_button)
local id = p_joystick:getID()
self.stickButtons[id][p_button] = true
end
function love.gamepadreleased(p_joystick, p_button)
local id = p_joystick:getID()
self.stickButtons[id][p_button] = false
end
end
function GamepadManager:new(p_fileMappings)
HookLoveEvents(self)
love.joystick.loadGamepadMappings(p_fileMappings)
self.connectedSticks = {}
self.stickButtons = {}
self.deadZone = 0.1 -- This would be edited through options
end
function GamepadManager:update()
-- O(n²) but it's ok since we shouldn't have that much joystick connected anyway
for id = 1, #self.connectedSticks do
for btn, _ in pairs(self.stickButtons[id]) do
self.stickButtons[id][btn] = nil
end
end
end
function GamepadManager:button(p_button, p_joyID)
p_joyID = p_joyID or 1
local stick = self.connectedSticks[p_joyID]
if stick == nil then return false end
return stick:isGamepadDown(p_button)
end
function GamepadManager:buttonDown(p_button, p_joyID)
p_joyID = p_joyID or 1
local stick = self.stickButtons[p_joyID]
if stick == nil then return false end
return stick[p_button]
end
function GamepadManager:buttonUp(p_button, p_joyID)
p_joyID = p_joyID or 1
local stick = self.stickButtons[p_joyID]
if stick == nil then return false end
return stick[p_button] == false
end
function GamepadManager:axis(p_axis, p_joyID)
p_joyID = p_joyID or 1
local stick = self.connectedSticks[p_joyID]
if stick == nil then return 0 end
local axis = stick:getGamepadAxis(p_axis)
if abs(axis) > self.deadZone then return axis end
return 0
end
return GamepadManager |
require('prototypes.recipe.fluid-recipe')
require('prototypes.recipe.recipe')
|
local EventManager = require('ge_tts.EventManager')
local Notebook = require("sebaestschjin-tts.Notebook")
local StringUtil = require("sebaestschjin-tts.StringUtil")
local TableUtil = require("sebaestschjin-tts.TableUtil")
local Component = require("gloomhaven-campaign-manager.Component")
local EventType = require("gloomhaven-campaign-manager.EventType")
local Player = {}
local IgnoredNotebooks = { "Options", "Previous Options", "Quick Start Guide", "Mod Version", "Savefile", "New Savefile", "Scenario Tree" }
---@param notes tts__Notes_GetParameter
---@return boolean
local function hasContent(notes)
return StringUtil.isNotEmpty(notes.body)
end
---@param notes tts__Notes_GetParameter
---@return boolean
local function isGlobalNotebook(notes)
return not TableUtil.contains(IgnoredNotebooks, notes.title) and notes.color == "Grey"
end
---@param savefile gh_Savefile
function Player.setup(savefile)
EventManager.addHandler(EventType.Loaded.Start, function() Player.loadAll(savefile) end)
end
---@param savefile gh_Savefile
function Player.loadAll(savefile)
Player.loadPlayers(savefile)
Player.loadNotes(savefile)
end
---@param savefile gh_Savefile
function Player.loadPlayers(savefile)
for player, content in pairs(savefile.players) do
local playerNotes = StringUtil.decodeBase64(content.notes)
Notebook.setContent(player, playerNotes, --[[---@type tts__PlayerColor]] player)
end
end
---@param savefile gh_Savefile
function Player.loadNotes(savefile)
for _, note in ipairs(savefile.notes) do
Notebook.addContent(note.name, note.content)
end
end
---@param savefile gh_Savefile
function Player.saveAll(savefile)
Player.savePlayers(savefile)
Player.saveNotes(savefile)
end
---@param savefile gh_Savefile
function Player.savePlayers(savefile)
for _, notes in ipairs(Notebook.getAll()) do
if hasContent(notes) and TableUtil.contains(Component.PlayerColors, notes.title) then
local playerNotes = StringUtil.encodeBase64(notes.body)
savefile.players[--[[---@type tts__PlayerColor]] notes.title] = { notes = playerNotes }
end
end
end
---@param savefile gh_Savefile
function Player.saveNotes(savefile)
for _, notes in ipairs(Notebook.getAll()) do
if hasContent(notes) and isGlobalNotebook(notes) then
table.insert(savefile.notes, { name = notes.title, content = notes.body })
end
end
end
return Player
|
function onLoad()
self.interactable = false
end
|
minetest.register_alias("watershed:appleleaf", "default:leaves")
minetest.register_alias("watershed:appling", "default:sapling")
minetest.register_alias("watershed:acaciatree", "moretrees:acacia_trunk")
minetest.register_alias("watershed:acacialeaf", "moretrees:acacia_leaves")
minetest.register_alias("watershed:acacialing", "moretrees:acacia_sapling")
minetest.register_alias("watershed:pinetree", "default:pine_tree")
minetest.register_alias("watershed:needles", "default:pine_needles")
minetest.register_alias("watershed:pineling", "default:pine_sapling")
minetest.register_alias("watershed:jungleleaf", "default:jungleleaves")
minetest.register_alias("watershed:jungling", "default:junglesapling")
minetest.register_alias("watershed:dirt", "default:dirt")
minetest.register_alias("watershed:icydirt", "default:dirt_with_grass")
minetest.register_alias("watershed:grass", "default:dirt_with_grass")
minetest.register_alias("watershed:redstone", "default:desert_stone")
minetest.register_alias("watershed:redcobble", "default:desert_cobble")
minetest.register_alias("watershed:stone", "default:stone")
minetest.register_alias("watershed:cactus", "default:cactus")
minetest.register_alias("watershed:goldengrass", "default:dry_shrub")
minetest.register_alias("watershed:drygrass", "default:dirt_with_dry_grass")
minetest.register_alias("watershed:permafrost", "default:dirt")
minetest.register_alias("watershed:freshice", "default:ice")
minetest.register_alias("watershed:cloud", "default:cloud")
minetest.register_alias("watershed:luxore", "default:stone")
minetest.register_alias("watershed:light", "lantern:lamp")
minetest.register_alias("watershed:acaciawood", "moretrees:acacia_wood")
minetest.register_alias("watershed:pinewood", "default:pinewood")
minetest.register_alias("watershed:freshwater", "default:river_water_source")
minetest.register_alias("watershed:freshwaterflow", "default:river_water_flowing")
minetest.register_alias("watershed:lava", "default:lava_source")
minetest.register_alias("watershed:lavaflow", "default:lava_flowing")
-- Items
minetest.register_alias("watershed:luxcrystal", "default:cobble")
|
-- Resource Metadata
fx_version 'cerulean'
games { 'gta5' }
author 'uyuyorum'
description 'UM - Hacker Phone'
version '1.0.0'
ui_page 'nui/ui.html'
files {
'nui/ui.html',
'nui/assets/img/*.png',
'nui/assets/css/*.css',
'nui/assets/js/*.js',
}
client_script {'client/client.lua'}
server_script {'server/server.lua'} |
local S = ethereal.intllib
-- Banana (Heals one heart when eaten)
minetest.register_node("ethereal:banana", {
description = S("Banana"),
drawtype = "torchlike",
tiles = {"ethereal_banana_single.png"},
inventory_image = "ethereal_banana_single.png",
wield_image = "ethereal_banana_single.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
},
groups = {
food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 1, leafdecay_drop = 1
},
drop = "ethereal:banana",
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:banana", param2 = 1})
end
end
})
-- Banana Bunch
minetest.register_node("ethereal:banana_bunch", {
description = S("Banana Bunch"),
drawtype = "torchlike",
tiles = {"ethereal_banana_bunch.png"},
inventory_image = "ethereal_banana_bunch.png",
wield_image = "ethereal_banana_bunch.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
},
groups = {
fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 1, leafdecay_drop = 1
},
drop = "ethereal:banana_bunch",
on_use = minetest.item_eat(6),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:banana_bunch", param2 = 1})
end
end
})
-- Bunch to Single
minetest.register_craft({
type = "shapeless",
output = "ethereal:banana 3",
recipe = {"ethereal:banana_bunch"}
})
minetest.register_craft({
type = "shapeless",
output = "ethereal:banana_bunch",
recipe = {"ethereal:banana", "ethereal:banana", "ethereal:banana"}
})
-- Banana Dough
minetest.register_craftitem("ethereal:banana_dough", {
description = S("Banana Dough"),
inventory_image = "ethereal_banana_dough.png"
})
minetest.register_craft({
type = "shapeless",
output = "ethereal:banana_dough",
recipe = {"group:food_flour", "group:food_banana"}
})
minetest.register_craft({
type = "cooking",
cooktime = 14,
output = "ethereal:banana_bread",
recipe = "ethereal:banana_dough"
})
-- Orange (Heals 2 hearts when eaten)
minetest.register_node("ethereal:orange", {
description = S("Orange"),
drawtype = "plantlike",
tiles = {"farming_orange.png"},
inventory_image = "farming_orange.png",
wield_image = "farming_orange.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
},
groups = {
food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:orange",
on_use = minetest.item_eat(4),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:orange", param2 = 1})
end
end,
})
-- Pine Nuts (Heals 1/2 heart when eaten)
minetest.register_craftitem("ethereal:pine_nuts", {
description = S("Pine Nuts"),
inventory_image = "ethereal_pine_nuts.png",
wield_image = "ethereal_pine_nuts.png",
groups = {food_pine_nuts = 1, flammable = 2},
on_use = minetest.item_eat(1)
})
-- Banana Loaf (Heals 3 hearts when eaten)
minetest.register_craftitem("ethereal:banana_bread", {
description = S("Banana Loaf"),
inventory_image = "ethereal_banana_bread.png",
wield_image = "ethereal_banana_bread.png",
groups = {food_bread = 1, flammable = 3},
on_use = minetest.item_eat(6)
})
-- Coconut (Gives 4 coconut slices, each heal 1/2 heart)
minetest.register_node("ethereal:coconut", {
description = S("Coconut"),
drawtype = "plantlike",
walkable = false,
paramtype = "light",
sunlight_propagates = true,
tiles = {"moretrees_coconut.png"},
inventory_image = "moretrees_coconut.png",
wield_image = "moretrees_coconut.png",
selection_box = {
type = "fixed",
fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
},
groups = {
food_coconut = 1, snappy = 1, oddly_breakable_by_hand = 1, cracky = 1,
choppy = 1, flammable = 1, leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:coconut_slice 4",
sounds = default.node_sound_wood_defaults()
})
-- Coconut Slice (Heals half heart when eaten)
minetest.register_craftitem("ethereal:coconut_slice", {
description = S("Coconut Slice"),
inventory_image = "moretrees_coconut_slice.png",
wield_image = "moretrees_coconut_slice.png",
groups = {food_coconut_slice = 1, flammable = 1},
on_use = minetest.item_eat(1)
})
minetest.register_craft({
output = "ethereal:coconut",
recipe = {
{"ethereal:coconut_slice", "ethereal:coconut_slice"},
{"ethereal:coconut_slice", "ethereal:coconut_slice"}
}
})
-- Golden Apple (Found on Healing Tree, heals all 10 hearts)
minetest.register_node("ethereal:golden_apple", {
description = S("Golden Apple"),
drawtype = "plantlike",
tiles = {"default_apple_gold.png"},
inventory_image = "default_apple_gold.png",
wield_image = "default_apple_gold.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
},
groups = {
fleshy = 3, dig_immediate = 3,
leafdecay = 3,leafdecay_drop = 1
},
drop = "ethereal:golden_apple",
-- on_use = minetest.item_eat(20),
on_use = function(itemstack, user, pointed_thing)
if user then
user:set_hp(20)
return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
end
end,
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:golden_apple", param2 = 1})
end
end
})
-- Hearty Stew (Heals 5 hearts - thanks to ZonerDarkRevention for his DokuCraft DeviantArt bowl texture)
minetest.register_craftitem("ethereal:hearty_stew", {
description = S("Hearty Stew"),
inventory_image = "ethereal_hearty_stew.png",
wield_image = "ethereal_hearty_stew.png",
on_use = minetest.item_eat(10, "ethereal:bowl")
})
minetest.register_craft({
output = "ethereal:hearty_stew",
recipe = {
{"group:food_onion","flowers:mushroom_brown", "group:food_tuber"},
{"","flowers:mushroom_brown", ""},
{"","group:food_bowl", ""}
}
})
-- Extra recipe for hearty stew
if farming and farming.mod and farming.mod == "redo" then
minetest.register_craft({
output = "ethereal:hearty_stew",
recipe = {
{"group:food_onion","flowers:mushroom_brown", "group:food_beans"},
{"","flowers:mushroom_brown", ""},
{"","group:food_bowl", ""}
}
})
end
-- Bucket of Cactus Pulp
minetest.register_craftitem("ethereal:bucket_cactus", {
description = S("Bucket of Cactus Pulp"),
inventory_image = "bucket_cactus.png",
wield_image = "bucket_cactus.png",
stack_max = 1,
groups = {vessel = 1, drink = 1},
on_use = minetest.item_eat(2, "bucket:bucket_empty"),
})
minetest.register_craft({
output = "ethereal:bucket_cactus",
recipe = {
{"bucket:bucket_empty","default:cactus"},
}
})
-- firethorn jelly
minetest.register_craftitem("ethereal:firethorn_jelly", {
description = S("Firethorn Jelly"),
inventory_image = "ethereal_firethorn_jelly.png",
wield_image = "ethereal_firethorn_jelly.png",
on_use = minetest.item_eat(2, "vessels:glass_bottle"),
groups = {vessel = 1}
})
if minetest.registered_items["farming:bowl"] then
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:firethorn_jelly",
recipe = {
{"farming:mortar_pestle","vessels:glass_bottle", ""},
{"ethereal:firethorn", "ethereal:firethorn", "ethereal:firethorn"},
{"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"}
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty 3"},
{"farming:mortar_pestle", "farming:mortar_pestle"}
}
})
end
-- Lemon
minetest.register_node("ethereal:lemon", {
description = S("Lemon"),
drawtype = "plantlike",
tiles = {"ethereal_lemon.png"},
inventory_image = "ethereal_lemon_fruit.png",
wield_image = "ethereal_lemon_fruit.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
},
groups = {
food_lemon = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:lemon",
on_use = minetest.item_eat(3),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:lemon", param2 = 1})
end
end
})
-- Candied Lemon
minetest.register_craftitem("ethereal:candied_lemon", {
description = S("Candied Lemon"),
inventory_image = "ethereal_candied_lemon.png",
wield_image = "ethereal_candied_lemon.png",
groups = {food_candied_lemon = 1},
on_use = minetest.item_eat(5)
})
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:candied_lemon",
recipe = {
{"farming:baking_tray", "ethereal:lemon", "group:food_sugar"}
},
replacements = {
{"farming:baking_tray", "farming:baking_tray"}
}
})
-- Lemonade
minetest.register_node("ethereal:lemonade", {
description = S("Lemonade"),
drawtype = "plantlike",
tiles = {"ethereal_lemonade.png"},
inventory_image = "ethereal_lemonade.png",
wield_image = "ethereal_lemonade.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
},
groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
on_use = minetest.item_eat(5, "vessels:drinking_glass"),
sounds = default.node_sound_glass_defaults()
})
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:lemonade",
recipe = {
{"ethereal:lemon", "group:food_sugar", "group:food_sugar"},
{"vessels:drinking_glass", "group:water_bucket", ""}
},
replacements = {
{"group:water_bucket", "bucket:bucket_empty"},
}
})
-- Olive
minetest.register_node("ethereal:olive", {
description = S("Olive"),
drawtype = "plantlike",
tiles = {"ethereal_olive.png"},
inventory_image = "ethereal_olive_fruit.png",
wield_image = "ethereal_olive_fruit.png",
visual_scale = 0.2,
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.1, -0.5, -0.1, 0.1, -0.3, 0.1}
},
groups = {
fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:olive",
on_use = minetest.item_eat(1),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:olive", param2 = 1})
end
end
})
-- Olive Oil
minetest.register_craftitem("ethereal:olive_oil", {
description = S("Olive Oil"),
inventory_image = "ethereal_olive_oil.png",
wield_image = "ethereal_olive_oil.png",
groups = {food_oil = 1, food_olive_oil = 1, vessel = 1}
})
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:olive_oil",
recipe = {
{"ethereal:olive", "ethereal:olive", "ethereal:olive"},
{"ethereal:olive", "ethereal:olive", "ethereal:olive"},
{"farming:juicer", "vessels:glass_bottle", ""}
},
replacements = {
{"farming:juicer", "farming:juicer"}
}
})
-- Kappa Maki (sushi with cucumber)
minetest.register_craftitem("ethereal:sushi_kappamaki", {
description = S("Kappa Maki Sushi"),
inventory_image = "ethereal_sushi_kappa_maki.png",
on_use = minetest.item_eat(3)
})
minetest.register_craft({
output = "ethereal:sushi_kappamaki 2",
recipe = {
{"group:food_seaweed", "group:food_cucumber", "group:food_rice"}
}
})
-- Nigiri (sushi with raw fish)
minetest.register_craftitem("ethereal:sushi_nigiri", {
description = S("Nigiri Sushi"),
inventory_image = "ethereal_sushi_nigiri.png",
on_use = minetest.item_eat(2)
})
minetest.register_craft({
output = "ethereal:sushi_nigiri 2",
recipe = {
{"group:food_rice", "group:food_fish_raw", ""}
}
})
-- Tamago (sushi with sweet egg)
minetest.register_craftitem("ethereal:sushi_tamago", {
description = S("Tamago Sushi"),
inventory_image = "ethereal_sushi_tamago.png",
on_use = minetest.item_eat(2)
})
minetest.register_craft({
output = "ethereal:sushi_tamago 2",
recipe = {
{"group:food_seaweed", "group:food_egg", "group:food_rice"}
}
})
-- Fugu (prepared pufferfish)
minetest.register_craftitem("ethereal:fugu", {
description = S("Fugusashi"),
inventory_image = "ethereal_fugu.png",
on_use = function(itemstack, user, pointed_thing)
if user then
if math.random(12) == 1 then
return minetest.do_item_eat(-16, nil, itemstack, user, pointed_thing)
else
return minetest.do_item_eat(4, nil, itemstack, user, pointed_thing)
end
end
end
})
minetest.register_craft({
output = "ethereal:fugu",
-- type = "shapeless",
recipe = {
{"group:food_cutting_board", "ethereal:fish_pufferfish", "group:food_soy_sauce"}
},
replacements = {
{"group:food_cutting_board", "farming:cutting_board"},
{"group:food_soy_sauce", "vessels:glass_bottle"}
}
})
-- Teriyaki Chicken
minetest.register_craftitem("ethereal:teriyaki_chicken", {
description = S("Teriyaki Chicken"),
inventory_image = "ethereal_teriyaki_chicken.png",
on_use = minetest.item_eat(4)
})
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:teriyaki_chicken 2",
recipe = {
{"group:food_chicken_raw", "group:food_sugar", "group:food_soy_sauce"},
{"group:food_garlic_clove", "group:food_saucepan", "group:food_gelatin"}
},
replacements = {
{"group:food_soy_sauce", "vessels:glass_bottle"},
{"group:food_saucepan", "farming:saucepan"}
}
})
-- Teriyaki Beef
minetest.register_craftitem("ethereal:teriyaki_beef", {
description = S("Teriyaki Beef"),
inventory_image = "ethereal_teriyaki_beef.png",
on_use = minetest.item_eat(12, "ethereal:bowl")
})
minetest.register_craft({
-- type = "shapeless",
output = "ethereal:teriyaki_beef",
recipe = {
{"group:food_meat_raw", "group:food_sugar", "group:food_soy_sauce"},
{"group:food_garlic_clove", "group:food_saucepan", "group:food_gelatin"},
{"group:food_cabbage", "group:food_rice", "group:food_bowl"}
},
replacements = {
{"group:food_soy_sauce", "vessels:glass_bottle"},
{"group:food_saucepan", "farming:saucepan"}
}
})
|
AddCSLuaFile()
ENT.Base = "gballoon_tower_base"
ENT.Type = "anim"
ENT.PrintName = "Gatling Gun Knight"
ENT.Category = "#rotgb.category.tower"
ENT.Author = "Piengineer12"
ENT.Contact = "http://steamcommunity.com/id/Piengineer12/"
ENT.Purpose = "#rotgb.tower.gballoon_tower_04.purpose"
ENT.Instructions = ""
ENT.Spawnable = false
ENT.AdminOnly = false
ENT.RenderGroup = RENDERGROUP_BOTH
ENT.Model = Model("models/props_phx/games/chess/black_knight.mdl")
ENT.FireRate = 10
ENT.Cost = 550
ENT.DetectionRadius = 256
ENT.UseLOS = true
ENT.LOSOffset = Vector(0,0,40)
ENT.UserTargeting = true
ENT.AttackDamage = 10
ENT.IsChessPiece = true
ENT.rotgb_Spread = 60
ENT.rotgb_Shots = 1
ENT.rotgb_LaserDamageMul = 50
ENT.UpgradeReference = {
{
Names = {"Stabilized Barrel","Consistent Barrel Spinner","Computerized Targeting","Laser Shooter","Ray of Doom","G.R.E.E.N. Beams"},
Descs = {
"Slightly reduces bullet spread.",
"Considerably reduces bullet spread.",
"Deals considerably increased damage versus gBlimps. Also enables the tower to see hidden gBalloons.",
"Fires a continuous, perfectly accurate focused laser that shreds gBalloons. However, the tower no longer pops Purple gBalloons.",
"Fires an even bigger beam that obliterates all gBalloons in its path, regardless of immunities.",
"BLARGGGH!!!"
},
Prices = {250,750,5000,50000,400000,25e6},
Funcs = {
function(self)
self.rotgb_Spread = self.rotgb_Spread / 1.5
end,
function(self)
self.rotgb_Spread = self.rotgb_Spread / 2
end,
function(self)
self.rotgb_ExtraVsCeramic = true
self.SeeCamo = true
end,
function(self)
self.FireRate = self.FireRate * 3
self.rotgb_UseLaser = 1
end,
function(self)
self.rotgb_LaserDamageMul = self.rotgb_LaserDamageMul / 2
self.rotgb_UseLaser = 2
end,
function(self)
self.UserTargeting = false
self.rotgb_LaserDamageMul = self.rotgb_LaserDamageMul * 10
end
}
},
{
Names = {"Higher Torque","Bigger Bullets","TripShot","Super High Torque","DodecaShot","A Million Rounds Per Minute"},
Descs = {
"Slightly increases fire rate.",
"Slightly increases range and considerably increases damage dealt by each bullet.",
"Fires three bullets per shot.",
"Considerably increases fire rate.",
"Slightly increases bullet spread, but twelve bullets are fired per shot!",
"Considerably increases bullet spread, but tremendously increases damage dealt by each bullet and sixty bullets are fired per shot!"
},
Prices = {250,1250,4000,6000,17500,175000},
Funcs = {
function(self)
self.FireRate = self.FireRate * 1.5
end,
function(self)
self.DetectionRadius = self.DetectionRadius * 1.5
self.AttackDamage = self.AttackDamage + 10
end,
function(self)
self.rotgb_Shots = self.rotgb_Shots * 3
end,
function(self)
self.FireRate = self.FireRate * 2
end,
function(self)
self.rotgb_Spread = self.rotgb_Spread * 1.5
self.rotgb_Shots = self.rotgb_Shots * 4
end,
function(self)
self.rotgb_Spread = self.rotgb_Spread * 2
self.rotgb_Shots = self.rotgb_Shots * 5
self.AttackDamage = self.AttackDamage + 40
end
}
}
}
ENT.UpgradeLimits = {6,2}
function ENT:ROTGB_ApplyPerks()
self.rotgb_Spread = self.rotgb_Spread * (1+hook.Run("GetSkillAmount", "gatlingGunKnightSpread")/100)
end
local function SnipeEntity()
while true do
local self,ent = coroutine.yield()
local startPos = self:GetShootPos()
--uDir:Normalize()
if self.rotgb_UseLaser then
local laser = ents.Create(self.rotgb_UseLaser==1 and "env_laser" or "env_beam")
local startEnt = self.rotgb_UseLaser==2 and ents.Create("info_target") or NULL
--local endEnt = ents.Create("info_target")
laser:SetPos(startPos)
--[[if IsValid(endEnt) then
endEnt:SetName("ROTGB04_"..endEnt:GetCreationID())
endEnt:SetPos(ent:GetPos()+ent.loco:GetVelocity()*0.1+ent:OBBCenter())
end]]
local oldEntName = ent:GetName()
local entityName = ent:GetName() ~= "" and ent:GetName() or "ROTGB04_2_"..self:GetCreationID()
ent:SetName(entityName)
if IsValid(startEnt) then
startEnt:SetName("ROTGB04_"..self:GetCreationID())
startEnt:SetPos(startPos)
startEnt:Spawn()
end
laser:SetKeyValue("LaserTarget",entityName)
laser:SetKeyValue("renderamt","255")
laser:SetKeyValue("rendercolor",self.rotgb_UseLaser==1 and "0 255 127" or self.rotgb_LaserDamageMul > 200 and "0 255 0" or "255 0 0")
laser:SetKeyValue("width","3")
laser:SetKeyValue("BoltWidth",math.sqrt(self.rotgb_LaserDamageMul))
laser:SetKeyValue("NoiseAmplitude","0")
laser:SetKeyValue("texture","sprites/laserbeam.spr")
laser:SetKeyValue("TextureScroll","35")
laser:SetKeyValue("damage",self.AttackDamage*self.rotgb_LaserDamageMul*self.rotgb_Shots)
laser:SetKeyValue("LightningStart","ROTGB04_"..self:GetCreationID())
laser:SetKeyValue("LightningEnd",entityName)
laser:SetKeyValue("HDRColorScale","1")
laser:SetKeyValue("spawnflags","33")
laser:SetKeyValue("life",0.2)
laser:Spawn()
laser:Activate()
laser.rotgb_Owner = self
laser.rotgb_UseLaser = self.rotgb_UseLaser
laser:Fire("TurnOn")
timer.Simple(0.2,function()
if IsValid(laser) then
laser:Remove()
end
if (IsValid(ent) and entityName == ent:GetName()) then
ent:SetName(oldEntName)
end
if IsValid(startEnt) then
startEnt:Remove()
end
--[[if IsValid(endEnt) then
endEnt:Remove()
end]]
end)
else
local uDir = ent:LocalToWorld(ent:OBBCenter())-startPos
local bullet = {
Attacker = self:GetTowerOwner(),
Callback = function(attacker,tracer,dmginfo)
dmginfo:SetDamageType(self.rotgb_CanPopGray and DMG_SNIPER or DMG_BULLET)
end,
Damage = self.rotgb_ExtraVsCeramic and ent:GetBalloonProperty("BalloonBlimp") and self.AttackDamage*2 or self.AttackDamage,
Distance = self.DetectionRadius*1.5,
HullSize = 1,
Num = self.rotgb_Shots,
Tracer = math.floor(2*math.sqrt(self.rotgb_Shots)),
AmmoType = "SniperRound",
TracerName = "Tracer",
Dir = uDir,
Spread = Vector(self.rotgb_Spread,self.rotgb_Spread,0),
Src = startPos
}
self:FireBullets(bullet)
end
end
end
ENT.thread = coroutine.create(SnipeEntity)
coroutine.resume(ENT.thread)
function ENT:FireFunction(gBalloons)
if self.UserTargeting then
local perf,str = coroutine.resume(self.thread,self,gBalloons[1])
if not perf then error(str) end
else
--local i = 1
for k,v in pairs(gBalloons) do
local perf,str = coroutine.resume(self.thread,self,v)
if not perf then error(str) end
--i = i + 1
--if i > 10 then break end
end
end
end |
local vim = vim
local M = {}
function M.set_lines(bufnr, s, e, lines)
vim.bo[bufnr].modifiable = true
vim.api.nvim_buf_set_lines(bufnr, s, e, false, lines)
vim.bo[bufnr].modifiable = false
end
return M
|
-- uespLogCharData.lua -- by Dave Humphrey, dave@uesp.net
--
--
-- Only save action bars at most every X seconds
uespLog.SAVEACTIONBAR_MINDELTATIME = 5
uespLog.LastSavedActionBar_TimeStamp = 0
uespLog.LastSavedActionBar_WeaponPair = 0
uespLog.LastBankingBag = 0
uespLog.CHARDATA_STATS = {
[1] = "AttackPower",
[2] = "WeaponPower",
[3] = "ArmorRating",
[4] = "Magicka",
[5] = "MagickaRegenCombat",
[6] = "MagickaRegenIdle",
[7] = "Health",
[8] = "HealthRegenCombat",
[9] = "HealthRegenIdle",
[10] = "HealingTaken",
[11] = "Dodge",
[12] = "Parry",
[13] = "SpellResist",
[14] = "Block",
[16] = "CriticalStrike",
[20] = "Mitigation",
[22] = "PhysicalResist",
[23] = "SpellCritical",
[24] = "CriticalResistance",
[25] = "SpellPower",
[26] = "SpellMitigation",
[29] = "Stamina",
[30] = "StaminaRegenCombat",
[31] = "StaminaRegenIdle",
[32] = "Miss",
[33] = "PhysicalPenetration",
[34] = "SpellPenetration",
[35] = "Power",
[36] = "DamageResistStart",
[37] = "DamageResistGeneric",
[38] = "DamageResistPhysical",
[39] = "DamageResistFire",
[40] = "DamageResistShock",
[41] = "DamageResistOblivion",
[42] = "DamageResistCold",
[43] = "DamageResistEarth",
[44] = "DamageResistMagic",
[45] = "DamageResistDrown",
[46] = "DamageResistDisease",
[47] = "DamageResistPoison",
[48] = "MountStaminaMax",
[49] = "MountStaminaRegenCombat",
[50] = "MountStaminaRegenMoving",
}
uespLog.CHARDATA_POWER = {
[-2] = "Health",
[0] = "Magicka",
--[1] = "Werewolf", --Intereferes with "iswerewolf" stat
[2] = "Fervor",
[3] = "Combo",
--[4] = "Power", --Interferes with "power" stat
[5] = "Charges",
[7] = "Momentum",
[6] = "Stamina",
[8] = "Adrenaline",
[9] = "Finesse",
[10] = "Ultimate",
[11] = "MountStamina",
[12] = "HealthBonus",
}
uespLog.charData_ActionBarData = {
[1] = { },
[2] = { },
[3] = { }, -- Overload
[4] = { }, -- Werewolf
}
uespLog.charData_SkillsData = {
[1] = { },
[2] = { },
[3] = { }, -- Overload
[4] = { }, -- Werewolf
}
uespLog.charData_StatsData = {
[1] = { },
[2] = { },
[3] = { }, -- Overload
[4] = { }, -- Werewolf
}
uespLog.charDataLastScreenShot = ""
uespLog.charDataLastScreenShotTimestamp = 0
uespLog.charDataLastScreenShotTaken = false
uespLog.charDataLastScreenShotCaption = ""
uespLog.guiHiddenBefore = false
uespLog.isTakingCharDataScreenshot = false
uespLog.charDataLastFoodEaten = {
['itemLink'] = '',
['type'] = '',
['desc'] = '',
['reqLevel'] = '',
['reqCP'] = '',
}
-- Active and passive skills where the first level is given free (does not count towards character's total skill points)
uespLog.FREE_SKILLS = {
[33293] = 1, -- Craftsman (Orc)
[35965] = 1, -- Highborn (High Elf)
[36008] = 1, -- Acrobat (Wood Elf)
[36063] = 1, -- Cutpurse (Khajiit)
[36247] = 1, -- Opportunist (Breton)
[36312] = 1, -- Diplomat (Imperial)
[36582] = 1, -- Amphibian (Argonian)
[36588] = 1, -- Ashlander (Dark Elf)
[36626] = 1, -- Reveler (Nord)
[84680] = 1, -- Wayfarer (Redguard)
[74580] = 1, -- Finders Keepers
[78219] = 1, -- Blade of Woe
[26768] = 1, -- Soul Trap 1
[43050] = 1, -- Soul Trap 2
[43053] = 1, -- Soul Trap 3
[43056] = 1, -- Soul Trap 4
[40328] = 1, -- Soul Splitting Trap 1
[43059] = 1, -- Soul Splitting Trap 2
[43063] = 1, -- Soul Splitting Trap 3
[43067] = 1, -- Soul Splitting Trap 4
[40317] = 1, -- Consuming Trap 1
[43071] = 1, -- Consuming Trap 2
[43077] = 1, -- Consuming Trap 3
[43083] = 1, -- Consuming Trap 4
[44590] = 1, -- Recipe Improvement 1
[44595] = 1, -- Recipe Improvement 2
[44597] = 1, -- Recipe Improvement 3
[44598] = 1, -- Recipe Improvement 4
[44599] = 1, -- Recipe Improvement 5
[44650] = 1, -- Recipe Improvement 6
[44625] = 1, -- Recipe Quality 1
[44630] = 1, -- Recipe Quality 2
[44631] = 1, -- Recipe Quality 3
[69953] = 1, -- Recipe Quality 4
[45542] = 1, -- Solvent Proficiency 1
[45547] = 1, -- Solvent Proficiency 2
[45550] = 1, -- Solvent Proficiency 3
[45551] = 1, -- Solvent Proficiency 4
[45552] = 1, -- Solvent Proficiency 5
[49163] = 1, -- Solvent Proficiency 6
[70042] = 1, -- Solvent Proficiency 7
[70043] = 1, -- Solvent Proficiency 8
[46727] = 1, -- Potency Improvement 1
[46729] = 1, -- Potency Improvement 2
[46731] = 1, -- Potency Improvement 3
[46735] = 1, -- Potency Improvement 4
[46736] = 1, -- Potency Improvement 5
[46740] = 1, -- Potency Improvement 6
[49112] = 1, -- Potency Improvement 7
[49113] = 1, -- Potency Improvement 8
[49114] = 1, -- Potency Improvement 9
[70045] = 1, -- Potency Improvement 10
[46758] = 1, -- Aspect Improvement 1
[46759] = 1, -- Aspect Improvement 2
[46760] = 1, -- Aspect Improvement 3
[46763] = 1, -- Aspect Improvement 4
[47276] = 1, -- Metalworking 1
[47277] = 1, -- Metalworking 2
[47278] = 1, -- Metalworking 3
[47279] = 1, -- Metalworking 4
[47280] = 1, -- Metalworking 5
[47281] = 1, -- Metalworking 6
[48157] = 1, -- Metalworking 7
[48158] = 1, -- Metalworking 8
[48159] = 1, -- Metalworking 9
[70041] = 1, -- Metalworking 10
[47282] = 1, -- Woodworking 1
[47283] = 1, -- Woodworking 2
[47284] = 1, -- Woodworking 3
[47285] = 1, -- Woodworking 4
[47286] = 1, -- Woodworking 5
[47287] = 1, -- Woodworking 6
[48172] = 1, -- Woodworking 7
[48173] = 1, -- Woodworking 8
[48174] = 1, -- Woodworking 9
[70046] = 1, -- Woodworking 10
[47288] = 1, -- Tailoring 1
[47289] = 1, -- Tailoring 2
[47290] = 1, -- Tailoring 3
[47291] = 1, -- Tailoring 4
[47292] = 1, -- Tailoring 5
[47293] = 1, -- Tailoring 6
[48187] = 1, -- Tailoring 7
[48188] = 1, -- Tailoring 8
[48189] = 1, -- Tailoring 9
[70044] = 1, -- Tailoring 10
[103632] = 1, -- Jewelycrafting 1
[103633] = 1, -- Jewelycrafting 2
[103634] = 1, -- Jewelycrafting 3
[103635] = 1, -- Jewelycrafting 4
[103636] = 1, -- Jewelycrafting 5
[103793] = 1, -- Psijic Order 1
--[32624] = 1, -- Bat Swarm 1
--[41918] = 1, -- Bat Swarm 2
--[41919] = 1, -- Bat Swarm 3
--[41920] = 1, -- Bat Swarm 4
--[38932] = 1, -- Clouding Swarm 1
--[41924] = 1, -- Clouding Swarm 2
--[41925] = 1, -- Clouding Swarm 3
--[41926] = 1, -- Clouding Swarm 4
--[38931] = 1, -- Devouring Swarm 1
--[41933] = 1, -- Devouring Swarm 2
--[41936] = 1, -- Devouring Swarm 3
--[41937] = 1, -- Devouring Swarm 4
[32455] = 1, -- Werewolf Transformation 1
[42356] = 1, -- Werewolf Transformation 2
[42357] = 1, -- Werewolf Transformation 3
[42358] = 1, -- Werewolf Transformation 4
[39075] = 1, -- Pack Leader 1
[42365] = 1, -- Pack Leader 2
[42366] = 1, -- Pack Leader 3
[42367] = 1, -- Pack Leader 4
[39076] = 1, -- Werewolf Berserker 1
[42377] = 1, -- Werewolf Berserker 2
[42378] = 1, -- Werewolf Berserker 3
[42379] = 1, -- Werewolf Berserker 4
[32634] = 1, -- Werewolf Devour (Update 20)
[152778] = 1, -- Armor bonuses/penalties (Update 29)
[150185] = 1,
[150181] = 1,
[152780] = 1,
[150184] = 1,
}
uespLog.CHARDATA_MINTIMESTAMP_DIFF = 60
uespLog.charDataLastSaveTimestamp = 0
uespLog.charDataLogoutSave = false
function uespLog.InitCharData()
uespLog.SaveActionBarForCharData()
uespLog.SaveStatsForCharData()
--uespLog.SaveSkillsForCharData()
end
function uespLog.SaveCharData (note)
local charData = uespLog.CreateCharData(note)
if (charData == nil) then
return false
end
uespLog.savedVars.charData.data = charData
uespLog.savedVars.bankData.data = uespLog.CreateBankData()
uespLog.savedVars.craftBagData.data = uespLog.CreateCraftBagData()
uespLog.DebugMsg("UESP: Saved character data...")
uespLog.charDataLastSaveTimestamp = GetTimeStamp()
return true
end
function uespLog.OnLogoutAutoSaveCharData()
if (uespLog.GetAutoSaveCharData() and not uespLog.charDataLogoutSave) then
uespLog.SaveCharData()
uespLog.charDataLogoutSave = true
end
end
function uespLog.OnPlayerDeactivated (eventCode)
--uespLog.DebugMsg("OnPlayerDeactivated")
uespLog.ClearTargetHealthData()
end
function uespLog.OnLogoutDisallowed (eventCode, quitRequested)
uespLog.DebugExtraMsg("OnLogoutDisallowed")
end
function uespLog.CreateCharData (note)
local charData = uespLog.CreateBuildData(note, true, true)
charData.Password = uespLog.GetCharDataPassword()
charData.OldPassword = uespLog.GetCharDataOldPassword()
charData.Guilds = uespLog.CreateGuildsCharData()
charData.Inventory = uespLog.CreateInventoryData()
charData.Research = uespLog.GetCharDataResearchInfo()
if (uespLog.GetSaveExtendedCharData()) then
charData.ExtendedData = 1
charData.Recipes = uespLog.CreateCharDataRecipes()
charData.Achievements = uespLog.CreateCharDataAchievements()
charData.Books = uespLog.CreateCharDataBooks()
charData.Collectibles = uespLog.CreateCharDataCollectibles()
charData.Journal = uespLog.CreateJournalCharData()
charData.CompletedQuests = uespLog.CreateCompletedQuestCharData()
else
charData.ExtendedData = 0
end
-- Only save house storage if it has been accessed on this character
if (uespLog.savedVars.houseStorage and uespLog.savedVars.houseStorage.data) then
charData.HouseStorage = uespLog.savedVars.houseStorage.data
end
return charData
end
function uespLog.CreateInventoryData ()
-- BAG_BACKPACK == 1
-- GetMaxBags()
-- GetItemTotalCount(BAG_BACKPACK, i)
local inventory = { }
local i
inventory.Size = GetBagSize(BAG_BACKPACK)
inventory.TimeStamp = GetTimeStamp()
inventory.Gold = GetCurrentMoney()
inventory.Telvar = GetCarriedCurrencyAmount(CURT_TELVAR_STONES)
inventory.WritVoucher = GetCarriedCurrencyAmount(CURT_WRIT_VOUCHERS)
for i = 0, inventory.Size do
inventory[#inventory + 1] = uespLog.CreateInventorySlotData(BAG_BACKPACK, i)
end
return inventory
end
function uespLog.GetCharDataHouseStorageInfo()
local storage = { }
local i, j
if (GetCollectibleForHouseBankBag == nil or BAG_HOUSE_BANK_ONE == nil) then
return nil
end
storage.TimeStamp = GetTimeStamp()
storage.TotalSize = 0
storage.TotalUsedSize = 0
for i = BAG_HOUSE_BANK_ONE, BAG_HOUSE_BANK_TEN do
local box = { }
box.CollectId = GetCollectibleForHouseBankBag(i)
box.Size = GetBagSize(i)
box.UsedSize = GetNumBagUsedSlots(i)
if (box.CollectId > 0 and not IsCollectibleUnlocked(box.CollectId)) then
box.Size = 0
end
storage.TotalSize = storage.TotalSize + box.Size
storage.TotalUsedSize = storage.TotalUsedSize + box.UsedSize
for j = 0, box.Size do
box[#box + 1] = uespLog.CreateInventorySlotData(i, j)
end
storage[i] = box
end
return storage
end
function uespLog.OnBankOpened(event)
if (GetBankingBag) then
uespLog.LastBankingBag = GetBankingBag()
if (IsHouseBankBag(uespLog.LastBankingBag)) then
uespLog.savedVars.houseStorage.data = uespLog.GetCharDataHouseStorageInfo()
end
end
end
function uespLog.OnBankClosed(event)
if (IsHouseBankBag == nil or not IsHouseBankBag(uespLog.LastBankingBag)) then
return
end
uespLog.savedVars.houseStorage.data = uespLog.GetCharDataHouseStorageInfo()
end
function uespLog.CreateBankData ()
--BAG_BANK == 2
local bankData = { }
local i
local bankSize = GetBagUseableSize(BAG_BANK)
bankData.IsBank = 1
bankData.Size = bankSize + GetBagUseableSize(BAG_SUBSCRIBER_BANK)
bankData.UsedSize = GetNumBagUsedSlots(BAG_BANK) + GetNumBagUsedSlots(BAG_SUBSCRIBER_BANK)
bankData.TimeStamp = GetTimeStamp()
bankData.Gold = GetBankedMoney()
bankData.Telvar = GetBankedCurrencyAmount(CURT_TELVAR_STONES)
bankData.AP = GetBankedCurrencyAmount(CURT_ALLIANCE_POINTS)
bankData.WritVouchers = GetBankedCurrencyAmount(CURT_WRIT_VOUCHERS)
bankData.UniqueAccountName = uespLog.GetUniqueAccountName()
bankData.Inventory = {}
for i = 0, bankSize do
bankData.Inventory[#bankData.Inventory + 1] = uespLog.CreateInventorySlotData(BAG_BANK, i)
end
for i = 0, bankSize do
bankData.Inventory[#bankData.Inventory + 1] = uespLog.CreateInventorySlotData(BAG_SUBSCRIBER_BANK, i)
end
return bankData
end
function uespLog.CreateCraftBagData ()
--BAG_VIRTUAL == 5
local craftBagData = { }
local i
craftBagData.IsCraftBag = 1
craftBagData.UsedSize = GetNumBagUsedSlots(BAG_VIRTUAL)
craftBagData.TimeStamp = GetTimeStamp()
craftBagData.UniqueAccountName = uespLog.GetUniqueAccountName()
craftBagData.Inventory = {}
local slotIndex = GetNextVirtualBagSlotId(nil)
while (slotIndex ~= nil) do
craftBagData.Inventory[#craftBagData.Inventory + 1] = uespLog.CreateInventorySlotData(BAG_VIRTUAL, slotIndex)
slotIndex = GetNextVirtualBagSlotId(slotIndex)
end
return craftBagData
end
function uespLog.CreateInventorySlotData (bagId, slotIndex)
local count = GetSlotStackSize(bagId, slotIndex)
local itemLink = GetItemLink(bagId, slotIndex)
local niceLink = uespLog.MakeNiceLink(itemLink)
local isJunk = IsItemJunk(bagId, slotIndex)
local isConsumable = IsItemLinkConsumable(itemLink)
local extraData = ""
if (count == 0 or itemLink == "") then
return nil
end
if (isJunk) then
extraData = extraData .. "Junk "
end
if (isConsumable) then
extraData = extraData .. "Cons "
end
return tostring(count) .. " " .. niceLink .. " " .. extraData
end
uespLog.PLATFORM_STRINGS = {
[0] = "XBox",
[1] = "PS4",
[2] = "PC",
}
function uespLog.GetUIPlatformString (platform)
local value = tonumber(platform)
if (platform == nil) then
value = tonumber(GetUIPlatform())
end
if (value < 0 or value > 2) then
return tostring(value)
end
return uespLog.PLATFORM_STRINGS[value]
end
function uespLog.GetUniqueAccountName()
local serverName = GetUniqueNameForCharacter()
local accountName = GetDisplayName()
local platformName = uespLog.GetUIPlatformString()
return tostring(serverName) .. platformName .. tostring(accountName)
end
function uespLog.SaveBuildData (note, forceSave)
forceSave = forceSave or false
local charData = uespLog.CreateBuildData(note, forceSave, false)
if (charData == nil) then
uespLog.MsgColor(uespLog.errorColor, "UESP: Did *not* save current character!")
return false
end
local arraySize = #uespLog.savedVars.buildData.data
uespLog.savedVars.buildData.data[arraySize + 1] = charData
uespLog.Msg("UESP: Saved current character data ("..tostring(#uespLog.savedVars.buildData.data).." characters in log).")
return true
end
function uespLog.AddBuildDataBarStat (charData, barIndex, name, value)
charData["Bar" .. tostring(barIndex) .. ":" .. tostring(name)] = value
end
function uespLog.GetBuildDataActiveBarIndex()
local barIndex = GetActiveWeaponPairInfo()
if (uespLog.IsInOverloadState()) then
barIndex = 3
elseif (IsWerewolf()) then
barIndex = 4
end
return barIndex
end
function uespLog.CreateBuildData (note, forceSave, suppressMsg)
local charData = { }
suppressMsg = suppressMsg or true
if (not uespLog.HasBothActionBarsForCharData()) then
if (not forceSave) then
uespLog.MsgColor(uespLog.errorColor, "ERROR: Unused weapon action bar skills not saved!")
uespLog.MsgColor(uespLog.errorColor, ". Try weapon swapping and save character again.")
return nil
elseif (not suppressMsg) then
uespLog.MsgColor(uespLog.errorColor, "Warning: Unused weapon action bar skills not available!")
end
end
charData.Note = note or ""
charData.TimeStamp = GetTimeStamp()
charData.TimeStamp64 = Id64ToString(charData.TimeStamp)
charData.Date = GetDateStringFromTimestamp(charData.Timestamp)
charData.APIVersion = GetAPIVersion()
charData.CharIndex, charData.CharId, charData.LocationId = uespLog.FindCharIndex()
charData.CharName = GetUnitName("player")
charData.AccountName = GetDisplayName()
charData.UniqueAccountName = uespLog.GetUniqueAccountName()
charData.UniqueName = GetUniqueNameForCharacter(charData.CharName)
charData.Title = GetUnitTitle("player")
charData.Race = GetUnitRace("player")
charData.Class = GetUnitClass("player")
charData.Gender = GetUnitGender("player")
charData.Level = GetUnitLevel("player")
charData.EffectiveLevel = GetUnitEffectiveLevel("player")
charData.Zone = GetUnitZone("player")
charData.ChampionPointsEarned = GetPlayerChampionPointsEarned()
charData.BattleLevel = GetUnitBattleLevel("player")
charData.BuildType = uespLog.GetCharDataBuildType()
charData.SecondsPlayed = GetSecondsPlayed()
charData.Latency = GetLatency()
charData.ActiveWeaponBar = uespLog.GetBuildDataActiveBarIndex()
charData.ActiveAbilityBar = charData.ActiveWeaponBar
charData.OverloadState = 0
if (uespLog.IsInOverloadState()) then
charData.OverloadState = 1
end
charData.LightArmorCount = uespLog.CountEquippedArmor(ARMORTYPE_LIGHT)
charData.MediumArmorCount = uespLog.CountEquippedArmor(ARMORTYPE_MEDIUM)
charData.HeavyArmorCount = uespLog.CountEquippedArmor(ARMORTYPE_HEAVY)
charData.ArmorTypeCount = uespLog.CountEquippedArmorTypes()
charData.DaggerWeaponCount = uespLog.CountEquippedWeapons(WEAPONTYPE_DAGGER)
charData.SwordWeaponCount = uespLog.CountEquippedWeapons(WEAPONTYPE_SWORD)
charData.MaceWeaponCount = uespLog.CountEquippedWeapons(WEAPONTYPE_HAMMER)
charData.AxeWeaponCount = uespLog.CountEquippedWeapons(WEAPONTYPE_AXE)
uespLog.AddBuildDataBarStat(charData, charData.ActiveWeaponBar, "DaggerWeaponCount", charData.DaggerWeaponCount)
uespLog.AddBuildDataBarStat(charData, charData.ActiveWeaponBar, "SwordWeaponCount", charData.SwordWeaponCount)
uespLog.AddBuildDataBarStat(charData, charData.ActiveWeaponBar, "MaceWeaponCount", charData.MaceWeaponCount)
uespLog.AddBuildDataBarStat(charData, charData.ActiveWeaponBar, "AxeWeaponCount", charData.AxeWeaponCount)
charData.Alliance = GetAllianceName(GetUnitAlliance("player"))
charData.AllianceRank = GetUnitAvARank("player")
charData.AlliancePoints = GetCarriedCurrencyAmount(CURT_ALLIANCE_POINTS) --GetAlliancePoints()
charData.AllianceCampaign = GetCampaignName(GetAssignedCampaignId())
charData.AllianceGuestCampaign = GetCampaignName(GetGuestCampaignId())
-- TODO: Crowns, Crown Gems?
charData.Money = GetCurrentMoney()
charData.BankedMoney = GetBankedMoney()
charData.TelvarStones = GetCarriedCurrencyAmount(CURT_TELVAR_STONES)
charData.WritVoucher = GetCarriedCurrencyAmount(CURT_WRIT_VOUCHERS)
if (GetCurrencyAmount ~= nil) then
charData.TransmuteCrystals = GetCurrencyAmount(CURT_CHAOTIC_CREATIA, CURRENCY_LOCATION_ACCOUNT)
end
charData.BankedTelvarStones = GetBankedTelvarStones()
charData.BankedAP = GetBankedCurrencyAmount(CURT_ALLIANCE_POINTS)
charData.BankedWritVouchers = GetBankedCurrencyAmount(CURT_WRIT_VOUCHERS)
charData.InventorySize = GetBagSize(BAG_BACKPACK)
charData.InventoryUsedSize = GetNumBagUsedSlots(BAG_BACKPACK)
charData.BankSize = GetBagUseableSize(BAG_BANK) + GetBagUseableSize(BAG_SUBSCRIBER_BANK)
charData.BankUsedSize = GetNumBagUsedSlots(BAG_BANK) + GetNumBagUsedSlots(BAG_SUBSCRIBER_BANK)
charData.Bounty = GetBounty()
charData.AttributesUnspent = GetAttributeUnspentPoints()
charData.AttributesHealth = GetAttributeSpentPoints(ATTRIBUTE_HEALTH)
charData.AttributesMagicka = GetAttributeSpentPoints(ATTRIBUTE_MAGICKA)
charData.AttributesStamina = GetAttributeSpentPoints(ATTRIBUTE_STAMINA)
charData.AttributesTotal = charData.AttributesUnspent + charData.AttributesHealth + charData.AttributesMagicka + charData.AttributesStamina
charData.SkillPointsUnused = GetAvailableSkillPoints()
charData.SkyShards = GetNumSkyShards()
charData.SkyshardsFound, charData.SkyshardsTotal = uespLog.GetSkyshardsFound()
local inventoryBonus, maxInventoryBonus, staminaBonus, maxStaminaBonus, speedBonus, maxSpeedBonus = GetRidingStats()
charData.RidingInventory = inventoryBonus
charData.RidingStamina = staminaBonus
charData.RidingSpeed = speedBonus
charData.RidingTrainingDone = 0
local timeUntilTrained = GetTimeUntilCanBeTrained()
if (timeUntilTrained > 0) then
charData.RidingTrainingDone = GetTimeStamp() + math.floor(timeUntilTrained/1000)
end
charData.Stealth = GetUnitStealthState("player")
if (type(uespLog.charDataLastFoodEaten) == "string") then
uespLog.charDataLastFoodEaten = {}
end
charData.LastFoodEatenName = uespLog.charDataLastFoodEaten.name
charData.LastFoodEatenLink = uespLog.charDataLastFoodEaten.itemLink
charData.LastFoodEatenType = uespLog.charDataLastFoodEaten.type
charData.LastFoodEatenDesc = uespLog.charDataLastFoodEaten.desc
charData.LastFoodEatenLevel = uespLog.charDataLastFoodEaten.reqLevel
charData.LastFoodEatenCP = uespLog.charDataLastFoodEaten.reqCP
charData.Stats = uespLog.CreateCharDataStats(false)
charData.Power = uespLog.CreateCharDataPower(false)
charData.NonCombat = uespLog.CreateCharDataNonCombat()
charData.Buffs, charData.Vampire, charData.Werewolf = uespLog.CreateCharDataBuffs()
charData.ActionBar = uespLog.CreateCharDataActionBar()
charData.EquipSlots = uespLog.CreateCharDataEquipSlots()
charData.ChampionPoints = uespLog.CreateCharDataChampionPoints()
charData.ChampionPoints2 = uespLog.CreateCharDataChampionPoints2()
charData.Crafting = uespLog.CreateCharDataCrafting()
charData.AdvancedStats = uespLog.CreateCharDataAdvancedStats()
-- Note: This function only works if the character is actually in Werewolf form at the time
if (IsWerewolf()) then
charData.Werewolf = 2
end
charData.Skills = uespLog.CreateCharDataSkills()
charData.SkillPointsUsed = uespLog.GetSkillPointsUsed(showDebug)
charData.SkillPointsTotal = charData.SkillPointsUsed + charData.SkillPointsUnused
blackSkill = charData.Skills["Craft:Blacksmithing:Miner Hireling"] or { rank = 0 }
clothSkill = charData.Skills["Craft:Clothing:Outfitter Hireling"] or { rank = 0 }
enchantSkill = charData.Skills["Craft:Enchanting:Hireling"] or { rank = 0 }
provSkill = charData.Skills["Craft:Provisioning:Hireling"] or { rank = 0 }
woodSkill = charData.Skills["Craft:Woodworking:Lumberjack Hireling"] or { rank = 0 }
charData['HirelingSkill:Provisioning'] = blackSkill.rank
charData['HirelingSkill:Woodworking'] = clothSkill.rank
charData['HirelingSkill:Blacksmithing'] = enchantSkill.rank
charData['HirelingSkill:Enchanting'] = provSkill.rank
charData['HirelingSkill:Clothier'] = woodSkill.rank
if (uespLog.savedVars.charInfo.data.hirelingMailTime ~= nil) then
if (blackSkill.rank > 0) then
charData['HirelingMailTime:Blacksmithing'] = uespLog.savedVars.charInfo.data.hirelingMailTime[CRAFTING_TYPE_BLACKSMITHING]
else
charData['HirelingMailTime:Blacksmithing'] = -1
end
if (clothSkill.rank > 0) then
charData['HirelingMailTime:Clothier'] = uespLog.savedVars.charInfo.data.hirelingMailTime[CRAFTING_TYPE_CLOTHIER]
else
charData['HirelingMailTime:Clothier'] = -1
end
if (enchantSkill.rank > 0) then
charData['HirelingMailTime:Enchanting'] = uespLog.savedVars.charInfo.data.hirelingMailTime[CRAFTING_TYPE_ENCHANTING]
else
charData['HirelingMailTime:Enchanting'] = -1
end
if (provSkill.rank > 0) then
charData['HirelingMailTime:Provisioning'] = uespLog.savedVars.charInfo.data.hirelingMailTime[CRAFTING_TYPE_PROVISIONING]
else
charData['HirelingMailTime:Provisioning'] = -1
end
if (woodSkill.rank > 0) then
charData['HirelingMailTime:Woodworking'] = uespLog.savedVars.charInfo.data.hirelingMailTime[CRAFTING_TYPE_WOODWORKING]
else
charData['HirelingMailTime:Woodworking'] = -1
end
end
local screenShotDeltaTime = GetTimeStamp() - uespLog.charDataLastScreenShotTimestamp
if (uespLog.charDataLastScreenShotTaken or (screenShotDeltaTime >= 0 and screenShotDeltaTime <= 200)) then
charData.ScreenShot = uespLog.charDataLastScreenShot
charData.ScreenShotCaption = uespLog.charDataLastScreenShotCaption
uespLog.charDataLastScreenShotTaken = false
uespLog.charDataLastScreenShotCaption = ""
uespLog.charDataLastScreenShotTimestamp = 0
else
charData.ScreenShot = ""
charData.ScreenShotCaption = ""
end
uespLog.MergeBuildDataStats(charData)
-- uespLog.MergeBuildDataSkills(charData)
return charData
end
function uespLog.FindCharIndex()
local numChars = GetNumCharacters()
local charName = GetUnitName("player"):gsub("%^.*", "")
for charIndex = 1, numChars do
local name, gender, level, classId, raceId, alliance, charId, locationId = GetCharacterInfo(charIndex)
name = name:gsub("%^.*", "")
if (name == charName) then
return charIndex, charId, locationId
end
end
return -1, -1, -1
end
function uespLog.MergeBuildDataStats(charData)
local barIndex = uespLog.GetBuildDataActiveBarIndex()
for i = 1, 4 do
if (i ~= barIndex) then
for name, value in pairs(uespLog.charData_StatsData[i]) do
charData.Stats[name] = value
end
end
end
end
function uespLog.MergeBuildDataSkills(charData)
local barIndex = uespLog.GetBuildDataActiveBarIndex()
for i = 1, 4 do
if (i ~= barIndex) then
for name, skillData in pairs(uespLog.charData_SkillsData[i]) do
local key
key = "desc" .. tostring(barIndex)
--charData.Skills[name][key] = skillData[key]
key = "cost" .. tostring(barIndex)
--charData.Skills[name][key] = skillData[key]
end
end
end
end
function uespLog.CreateCharDataCrafting()
local crafting = {}
local maxStyle = GetHighestItemStyleId()
for k = 1, maxStyle do
local styleName = GetItemStyleName(k) or ""
local known = uespLog.GetStyleKnown(styleName)
if (styleName == "") then
-- Do nothing
elseif (type(known) == "table") then
crafting[styleName] = {}
for k, v in ipairs(known) do
if (v) then
crafting[styleName][k] = 1
else
crafting[styleName][k] = 0
end
end
elseif (known) then
crafting[styleName] = 1
else
crafting[styleName] = 0
end
end
return crafting
end
function uespLog.CreateCharDataRecipes()
local recipes = {}
local numRecipeLists = GetNumRecipeLists()
local recipeCount = 0
local knownCount = 0
for recipeListIndex = 1, numRecipeLists do
local listName, numRecipes = GetRecipeListInfo(recipeListIndex)
for recipeIndex = 1, numRecipes do
local known, name = GetRecipeInfo(recipeListIndex, recipeIndex)
if (known and name ~= "") then
local resultLink = GetRecipeResultItemLink(recipeListIndex, recipeIndex)
local resultId = uespLog.ParseLinkItemId(resultLink)
knownCount = knownCount + 1
if (resultId > 0) then
recipes["Recipe:"..tostring(resultId)] = name
else
recipes["Recipe"] = name
end
end
recipeCount = recipeCount + 1
end
end
recipes.RecipeTotalCount = recipeCount
recipes.RecipeKnownCount = knownCount
return recipes
end
function uespLog.ParseAchievementLinkId(link)
if (link == nil or link == "") then
return -1, 0, 0
end
local linkType, itemText, achId, achData, achTimestamp = link:match("|H(.-):(.-):(.-):(.-):(.-)|h|h")
if (achId == nil or achData == nil or achTimestamp == nil) then
return -1, 0, 0
end
return achId, tonumber(achData), tonumber(achTimestamp)
end
function uespLog.CreateCharDataAchievements()
local achievements = {}
local numTopLevelCategories = GetNumAchievementCategories()
for topLevelIndex = 1, numTopLevelCategories do
local cateName, numCategories, numCateAchievements, earnedPoints, totalPoints, hidesPoints = GetAchievementCategoryInfo(topLevelIndex)
achievements["AchievementPoints:"..tostring(topLevelIndex)] = "" .. tostring(earnedPoints) .. ", " .. tostring(totalPoints)
for categoryIndex = 1, numCategories do
local subcategoryName, numAchievements, earnedSubSubPoints, totalSubSubPoints, hidesSubSubPoints = GetAchievementSubCategoryInfo(topLevelIndex, categoryIndex)
achievements["AchievementPoints:"..tostring(topLevelIndex)..":"..tostring(categoryIndex)] = "" .. tostring(earnedSubSubPoints) .. ", " .. tostring(totalSubSubPoints)
earnedPoints = earnedPoints - earnedSubSubPoints
totalPoints = totalPoints - totalSubSubPoints
for achievementIndex = 1, numAchievements do
local achId = GetAchievementId(topLevelIndex, categoryIndex, achievementIndex)
local currentId = GetFirstAchievementInLine(achId)
if (currentId == 0) then currentId = achId end
while (currentId ~= nil and currentId > 0) do
local achLink = GetAchievementLink(currentId)
local _, progress, timestamp = uespLog.ParseAchievementLinkId(achLink)
if (progress ~= 0 or timestamp ~= 0) then
achievements["Achievement:"..tostring(currentId)] = "" .. tostring(progress) .. ", " .. tostring(timestamp)
end
currentId = GetNextAchievementInLine(currentId)
end
end
end
achievements["AchievementPoints:"..tostring(topLevelIndex) .. ":0"] = "" .. tostring(earnedPoints) .. ", " .. tostring(totalPoints)
for achievementIndex = 1, numCateAchievements do
local achId = GetAchievementId(topLevelIndex, nil, achievementIndex)
local currentId = GetFirstAchievementInLine(achId)
if (currentId == 0) then currentId = achId end
while (currentId ~= nil and currentId > 0) do
local achLink = GetAchievementLink(currentId)
local _, progress, timestamp = uespLog.ParseAchievementLinkId(achLink)
if (progress ~= 0 or timestamp ~= 0) then
achievements["Achievement:"..tostring(currentId)] = "" .. tostring(progress) .. ", " .. tostring(timestamp)
end
currentId = GetNextAchievementInLine(currentId)
end
end
end
achievements.AchievementEarnedPoints = GetEarnedAchievementPoints()
achievements.AchievementTotalPoints = GetTotalAchievementPoints()
return achievements
end
function uespLog.CreateCharDataBooks()
local books = {}
local numCategories = GetNumLoreCategories()
local categoryIndex
local collectionIndex
local bookIndex
local totalBooks = 0
local knownBooks = 0
for categoryIndex = 1, numCategories do
local catName, numCollections, categoryId = GetLoreCategoryInfo(categoryIndex)
for collectionIndex = 1, numCollections do
local colName, colDesc, numKnownBooks, numBooks, hidden = GetLoreCollectionInfo(categoryIndex, collectionIndex)
-- Fix for issue with Lorebooks addon
if (numBooks == nil) then
numBooks = 0
end
totalBooks = totalBooks + numBooks
for bookIndex = 1, numBooks do
local title, icon, known, bookId = GetLoreBookInfo(categoryIndex, collectionIndex, bookIndex)
if (known) then
known = 1
knownBooks = knownBooks + 1
else
known = 0
end
if (known ~= 0) then
books["Book:"..tostring(bookId)] = known
end
end
end
end
books['TotalBooks'] = totalBooks
books['KnownBooks'] = knownBooks
return books
end
function uespLog.CreateCharDataCollectibles()
local collect = {}
local numCategories = GetNumCollectibleCategories()
local categoryIndex
local subCategoryIndex
local collectibleIndex
local collectibleId
local maxCollectibleId = 0
local numCollectibles = 0
local knownCollectibles = 0
for categoryIndex = 1, numCategories do
local catName, numSubCategories, numCollectibles = GetCollectibleCategoryInfo(categoryIndex)
for collectibleIndex = 1, numCollectibles do
collectibleId = GetCollectibleId(categoryIndex, nil, collectibleIndex)
local name, desc, icon, lockedIcon, purchased = GetCollectibleInfo(collectibleId)
if (purchased) then
purchased = 1
knownCollectibles = knownCollectibles + 1
else
purchased = 0
end
if (maxCollectibleId < collectibleId) then
maxCollectibleId = collectibleId
end
if (purchased ~= 0) then
collect["Collectible:"..tostring(collectibleId)] = purchased
end
numCollectibles = numCollectibles + 1
end
for subCategoryIndex = 1, numSubCategories do
local subCatName, numCollectibles = GetCollectibleSubCategoryInfo(categoryIndex, subCategoryIndex)
for collectibleIndex = 1, numCollectibles do
collectibleId = GetCollectibleId(categoryIndex, subCategoryIndex, collectibleIndex)
local name, desc, icon, lockedIcon, purchased = GetCollectibleInfo(collectibleId)
if (purchased) then
purchased = 1
knownCollectibles = knownCollectibles + 1
else
purchased = 0
end
if (maxCollectibleId < collectibleId) then
maxCollectibleId = collectibleId
end
if (purchased ~= 0) then
collect["Collectible:"..tostring(collectibleId)] = purchased
end
numCollectibles = numCollectibles + 1
end
end
end
collect['KnownCollectibles'] = knownCollectibles
collect['NumCollectibles'] = numCollectibles
collect['MaxCollectibleId'] = maxCollectibleId
return collect
end
function uespLog.OnZoneChanged(eventCode, zoneName, subZoneName, newSubzone, zoneId, subZoneId)
uespLog.DebugExtraMsg("OnZoneChanged: "..tostring(newSubzone))
--uespLog.DebugMsg("UESP: OnZoneChanged "..tostring(zoneName)..", "..tostring(subZoneName)..", "..tostring(newSubzone)..", "..tostring(zoneId)..", "..tostring(subZoneId))
local diffTime = GetTimeStamp() - uespLog.charDataLastSaveTimestamp
if (uespLog.GetAutoSaveCharData() and uespLog.GetAutoSaveZoneCharData() and diffTime > uespLog.CHARDATA_MINTIMESTAMP_DIFF) then
uespLog.SaveCharData()
end
zo_callLater(uespLog.LogLocationData, 500)
end
function uespLog.OnEatDrinkItem(itemLink)
local itemName = GetItemLinkName(itemLink)
local itemTypeString = "unknown"
local hasAbility, abilityHeader, abilityDescription, cooldown, hasScaling, minLevel, maxLevel = GetItemLinkOnUseAbilityInfo(itemLink)
local reqLevel = GetItemLinkRequiredLevel(itemLink)
local reqCP = GetItemLinkRequiredChampionPoints(itemLink)
local itemType = GetItemLinkItemType(itemLink)
if (itemName == "" or itemLink == "") then
return
end
if (itemType == 4) then
itemTypeString = "Food"
elseif (itemType == 12) then
itemTypeString = "Drink"
else
return
end
if (type(uespLog.charDataLastFoodEaten) == "string") then
uespLog.charDataLastFoodEaten = {}
end
uespLog.charDataLastFoodEaten.itemLink = itemLink
uespLog.charDataLastFoodEaten.type = itemTypeString
uespLog.charDataLastFoodEaten.desc = abilityDescription
uespLog.charDataLastFoodEaten.reqLevel = reqLevel
uespLog.charDataLastFoodEaten.reqCP = reqCP
uespLog.savedVars.charInfo.data.lastFoodEaten = uespLog.charDataLastFoodEaten
uespLog.DebugMsg("UESP: You ate/drank "..tostring(itemLink) )
end
function uespLog.OnScreenShotSaved(eventCode, directory, filename)
uespLog.charDataLastScreenShot = tostring(directory)..""..tostring(filename)
uespLog.charDataLastScreenShotTimestamp = GetTimeStamp()
uespLog.charDataLastScreenShotTaken = uespLog.isTakingCharDataScreenshot
uespLog.DebugMsg("Screenshot Saved: "..uespLog.charDataLastScreenShot)
end
function uespLog.SaveStatsForCharData()
local barIndex = uespLog.GetBuildDataActiveBarIndex()
local statsData = uespLog.CreateCharDataStats(true)
--local powerData = uespLog.CreateCharDataPower(true)
statsData["Bar" .. tostring(barIndex) .. ":ActiveWeaponBar"] = GetActiveWeaponPairInfo()
uespLog.charData_StatsData[barIndex] = statsData
uespLog.savedVars.charInfo.data.stats = uespLog.charData_StatsData
end
function uespLog.CreateCharDataStats(onlyBar)
local stats = {}
local i
local barIndex = uespLog.GetBuildDataActiveBarIndex()
for i = -10, 100 do
if (uespLog.CHARDATA_STATS[i] ~= nil) then
local value = GetPlayerStat(i, STAT_BONUS_OPTION_APPLY_BONUS, STAT_SOFT_CAP_OPTION_APPLY_SOFT_CAP)
local name = uespLog.CHARDATA_STATS[i]
if (value ~= nil) then
if (not onlyBar) then
stats[name] = value
end
stats["Bar" .. tostring(barIndex) .. ":" .. tostring(name)] = value
end
end
end
local effSpellPower = uespLog.GetEffectiveSpellPower()
local effWeaponPower = uespLog.GetEffectiveWeaponPower()
local spellCritDmg = uespLog.GetPlayerSpellCriticalDamage()
local weaponCritDmg = uespLog.GetPlayerWeaponCriticalDamage()
if (not onlyBar) then
stats["Computed:EffectiveSpellPower"] = effSpellPower
stats["Computed:EffectiveWeaponPower"] = effWeaponPower
stats["Computed:SpellCritDamage"] = spellCritDmg
stats["Computed:WeaponCritDamage"] = weaponCritDmg
end
stats["Computed:Bar" .. tostring(barIndex) .. ":EffectiveSpellPower"] = effSpellPower
stats["Computed:Bar" .. tostring(barIndex) .. ":EffectiveWeaponPower"] = effWeaponPower
stats["Computed:Bar" .. tostring(barIndex) .. ":SpellCritDamage"] = spellCritDmg
stats["Computed:Bar" .. tostring(barIndex) .. ":WeaponCritDamage"] = weaponCritDmg
return stats
end
function uespLog.CreateCharDataPower(onlyBar)
local power = {}
local i
local barIndex = uespLog.GetBuildDataActiveBarIndex()
for i = -10, 50 do
if (uespLog.CHARDATA_POWER[i] ~= nil) then
local current, currentMax, effectiveMax = GetUnitPower("player", i)
local name = uespLog.CHARDATA_POWER[i]
if (currentMax ~= nil) then
if (not onlyBar) then
power[name] = currentMax
end
power["Bar" .. tostring(barIndex) .. ":" .. tostring(name)] = currentMax
end
end
end
return power
end
uespLog.NONCOMBAT_BONUS_NAMES = {
[0] = 'Invalid',
[1] = 'EnchantingLevel',
[2] = 'AlchemyLevel',
[3] = 'ProvisioningLevel',
[4] = 'ProvisioningRarityLevel',
[5] = 'ProvisioningCreateExtraFood',
[6] = 'ProvisioningCreateExtraDrink',
[7] = 'ProvisioningFoodDuration',
[8] = 'ProvisioningDrinkDuration',
[9] = 'ProvisioningHirelingLevel',
[10] = 'AlchemyThirdSlot',
[11] = 'AlchemyCreateExtra',
[12] = 'EnchantingRarityLevel',
[13] = 'AlchemyCreatePercentDiscount',
[14] = 'AlchemyPotionDuration',
[15] = 'EnchantingDeconstructionUpgrade',
[16] = 'EnchantingHirelingLevel',
[17] = 'EnchantingCraftPercentDiscount',
[18] = 'BlacksmithingLevel',
[19] = 'BlacksmithingShowNodes',
[20] = 'BlacksmithingBoosterBonus',
[21] = 'BlacksmithingExtractLevel',
[22] = 'BlacksmithingCraftPercentDiscount',
[23] = 'BlacksmithingResearchLevel',
[24] = 'BlacksmithingHirelingLevel',
[25] = 'WoodworkingLevel',
[26] = 'WoodworkingShowNodes',
[27] = 'WoodworkingBoosterBonus',
[28] = 'WoodworkingExtractLevel',
[29] = 'WoodworkingCraftPercentDiscount',
[30] = 'WoodworkingResearchLevel',
[31] = 'WoodworkingHirelingLevel',
[32] = 'ClothierLevel',
[33] = 'ClothierShowNodes',
[34] = 'ClothierBoosterBonus',
[35] = 'ClothierExtractLevel',
[36] = 'ClothierCraftPercentDiscount',
[37] = 'ClothierResearchLevel',
[38] = 'ClothierHirelingLevel',
[39] = 'EnchantingSlotImprovement',
[40] = 'EnchantingShowNodes',
[41] = 'AlchemyShowNodes',
[42] = 'ProvisioningShowNodes',
[43] = 'AlchemyNegativeDuration',
[44] = 'SpellcraftingAbilitiesLearned',
[45] = 'SpellcraftingTabletCreationTime',
[46] = 'SpellcraftingTabletQuality',
[47] = 'SpellcraftingFocusUltimate',
[48] = 'SpellcraftingFocusCastTime',
[49] = 'SpellcraftingFocusDuration',
[50] = 'SpellcraftingFocusCheaper',
[51] = 'SpellcraftingFocusArea',
[52] = 'FortuneSeeker',
[53] = 'MasterGatherer',
[54] = 'ArmorKnowledge',
[55] = 'TraitIdentifier',
[56] = 'Impatience',
[57] = 'Groom',
[58] = 'Enlightened',
[59] = 'Unused',
[60] = 'Extraction',
[61] = 'PickpocketChance',
[62] = 'FenceSalesman',
[63] = 'Sly',
[64] = 'BountyDecay',
[65] = 'HeatDecay',
[66] = 'Haggling',
[67] = 'WitnessRangeReduction',
[68] = 'SecondaryWitnessRangeReduction',
[69] = 'GuardPursuitDistanceReduction',
[70] = 'Clemency',
[71] = 'TimelyEscape',
[72] = 'ClemencyArrestImmunity',
[73] = 'MurderBountyReduction',
[74] = 'AssaultBountyReduction',
[75] = 'GuardKill',
[76] = 'TelvarMultiplier',
[77] = 'MountedAggroRadiusReduction',
[78] = 'AvoidBladeOfWoeWitnessChance',
[79] = 'ShadowyConnections',
}
function uespLog.CreateCharDataNonCombat()
local nonCombat = {}
for i = 1, NON_COMBAT_BONUS_MAX_VALUE do
local name = uespLog.NONCOMBAT_BONUS_NAMES[i] or tostring(i)
nonCombat["NonCombat:"..name] = GetNonCombatBonus(i)
end
return nonCombat
end
function uespLog.CreateCharDataBuffs()
local buffs = {}
local numBuffs = GetNumBuffs("player")
local i
local isVampire = false
local werewolfStage = 0
for i = 1, numBuffs do
local buffName, timeStarted, timeEnding, buffSlot, stackCount, iconFilename, buffType, effectType, abilityType, statusEffectType, abilityId, canClickOff = GetUnitBuffInfo("player", i)
if (abilityId > 0) then
local desc = GetAbilityDescription(abilityId)
buffs[#buffs + 1] = { ["name"] = buffName, ["id"] = abilityId, ["icon"] = iconFilename, ["desc"] = desc }
end
if (string.find(buffName, "Vampirism") ~= nil) then
isVampire = true
elseif (string.find(buffName, "Vampire Stage") ~= nil) then
isVampire = true
elseif (buffName == "Lycanthropy") then
werewolfStage = 1
end
end
return buffs, isVampire, werewolfStage
end
function uespLog.CreateCharDataEquipSlots()
local wornSlots = GetBagSize(BAG_WORN)
local i
local equipSlots = { }
for i = 0, wornSlots do
if (HasItemInSlot(BAG_WORN, i)) then
local itemLink = GetItemLink(BAG_WORN, i)
local itemName = GetItemName(BAG_WORN, i)
local condition = GetItemCondition(BAG_WORN, i)
local charges, maxCharges = GetChargeInfoForItem(BAG_WORN, i)
local icon = GetItemLinkInfo(itemLink)
local hasSet, setName, numBonuses, setCount, maxEquipped = GetItemLinkSetInfo(itemLink)
if (not hasSet) then
setCount = 0
end
if (maxCharges > 0) then
condition = math.floor(charges*100/maxCharges + 0.5)
end
equipSlots[i] = { ["name"] = itemName, ["link"] = itemLink, ["condition"] = condition, ["icon"] = icon, ["setcount"] = setCount }
end
end
return equipSlots
end
function uespLog.SaveSkillsForCharData()
local barIndex = uespLog.GetBuildDataActiveBarIndex()
local skillsData = uespLog.CreateCharDataSkills()
uespLog.charData_SkillsData[barIndex] = skillsData
uespLog.savedVars.charInfo.data.skills = uespLog.charData_SkillsData
end
function uespLog.CreateCharDataSkills()
local skills = {}
local numSkillTypes = GetNumSkillTypes()
local skillType
local skillIndex
local abilityIndex
local barIndex = uespLog.GetBuildDataActiveBarIndex()
for skillType = 1, numSkillTypes do
local numSkillLines = GetNumSkillLines(skillType)
local skillTypeName = uespLog.GetSkillTypeName(skillType)
for skillIndex = 1, numSkillLines do
local numSkillAbilities = GetNumSkillAbilities(skillType, skillIndex)
local skillLineName, skillLineRank = GetSkillLineInfo(skillType, skillIndex)
skills[tostring(skillTypeName)..":"..tostring(skillLineName)] = skillLineRank
for abilityIndex = 1, numSkillAbilities do
local name, texture, rank, passive, ultimate, purchase, progressionIndex = GetSkillAbilityInfo(skillType, skillIndex, abilityIndex)
local skillName = tostring(skillTypeName)..":"..tostring(skillLineName)..":"..tostring(name)
local abilityId = GetSkillAbilityId(skillType, skillIndex, abilityIndex, false)
local description = GetAbilityDescription(abilityId)
local descHeader = tostring(GetAbilityDescriptionHeader(abilityId))
local currentUpgradeLevel, maxUpgradeLevel = GetSkillAbilityUpgradeInfo(skillType, skillIndex, abilityIndex)
local skillType = "skill"
if (descHeader ~= "") then
description = "|cffffff" .. descHeader .. "|r\n" .. description
end
if (ultimate) then
skillType = "ultimate"
end
progressionIndex = progressionIndex or 0
currentUpgradeLevel = currentUpgradeLevel or 0
if (purchase and abilityId > 0) then
if (passive and currentUpgradeLevel > 0) then
rank = currentUpgradeLevel
skillType = "passive"
elseif (passive and currentUpgradeLevel == 0) then
rank = 1
skillType = "passive"
elseif (progressionIndex > 0) then
local progName, morph, skillRank = GetAbilityProgressionInfo(progressionIndex)
rank = skillRank + morph * 4
else
rank = 0
end
local channeled, castTime, channelTime = GetAbilityCastInfo(abilityId)
local minRange, maxRange = GetAbilityRange(abilityId)
local radius = GetAbilityRadius(abilityId)
local angleDistance = GetAbilityAngleDistance(abilityId)
local duration = GetAbilityDuration(abilityId)
local cost, mechanic = GetAbilityCost(abilityId)
local targetDesc = GetAbilityTargetDescription(abilityId) or ''
local costStr = tostring(cost) .. ' ' .. uespLog.GetCombatMechanicText(mechanic)
local rangeStr = ""
local areaStr = ""
if (not channeled) then
channelTime = 0
end
if (minRange > 0 and maxRange > 0) then
rangeStr = tostring(minRange/100) .. " - " .. tostring(maxRange/100) .. " meters"
elseif (minRange <= 0 and maxRange > 0) then
rangeStr = tostring(maxRange/100) .. " meters"
elseif (minRange > 0 and maxRange <= 0) then
rangeStr = "Under " .. tostring(minRange/100) .. " meters"
end
if (angleDistance > 0) then
areaStr = tostring(radius/100) .. " x " .. tostring(angleDistance/50) .. " meters"
end
skills[skillName] = {
["rank"] = rank,
["id"] = abilityId,
["icon"] = texture,
["desc"] = description,
--["desc" .. tostring(barIndex)] = description,
["type"] = skillType,
["index"] = abilityIndex,
["name"] = name,
["area"] = areaStr,
["cost"] = costStr,
--["cost" .. tostring(barIndex)] = costStr,
["range"] = rangeStr,
["radius"] = radius,
["castTime"] = castTime,
["channelTime"] = channelTime,
["duration"] = duration,
["target"] = targetDesc,
}
end
end
end
end
return skills
end
function uespLog.CreateCharDataAdvancedStats()
if (GetNumAdvancedStatCategories == nil) then
return {}
end
local numCategories = GetNumAdvancedStatCategories()
local categoryIndex
local statIndex
local stats = {}
for categoryIndex = 1, numCategories do
local categoryId = GetAdvancedStatsCategoryId(categoryIndex)
local categoryName, numStats = GetAdvancedStatCategoryInfo(categoryId)
for statIndex = 1, numStats do
local statId, statDisplayName, description, flatValueDescription, percentValueDescription = GetAdvancedStatInfo(categoryId, statIndex)
local statFormatType, flatValue, percentValue = GetAdvancedStatValue(statId)
stats[statDisplayName] = {}
stats[statDisplayName]['statId'] = statId
stats[statDisplayName]['category'] = categoryName
stats[statDisplayName]['flatValue'] = flatValue
stats[statDisplayName]['percentValue'] = percentValue
stats[statDisplayName]['formatType'] = statFormatType
end
end
return stats
end
function uespLog.CreateCharDataChampionPoints2()
local championPoints = {}
local numDisc = GetNumChampionDisciplines()
local discIndex
local skillIndex
local totalSpent = 0
local totalUnspent = 0
local skillsSlotted = {}
if (GetChampionDisciplineType == nil) then
return championPoints, 0, 0
end
local startSlotIndex, endSlotIndex = GetAssignableChampionBarStartAndEndSlots()
local slotIndex
local slotData = {}
for slotIndex = startSlotIndex, endSlotIndex do
local skillId = GetSlotBoundId(slotIndex, HOTBAR_CATEGORY_CHAMPION)
slotData[slotIndex] = skillId
if (skillId > 0) then
skillsSlotted[skillId] = slotIndex
end
end
championPoints["Slots"] = slotData
for discIndex = 1, numDisc do
local disciplineId = GetChampionDisciplineId(discIndex)
local discType = GetChampionDisciplineType(disciplineId)
local discName = tostring(GetChampionDisciplineName(disciplineId))
local numSkills = GetNumChampionDisciplineSkills(discIndex)
local discPoints = GetNumSpentChampionPoints(disciplineId)
local unspentPoints = GetNumUnspentChampionPoints(disciplineId)
totalSpent = totalSpent + discPoints
totalUnspent = totalUnspent + unspentPoints
championPoints[discName .. ":Points"] = discPoints
championPoints[discName .. ":Unspent"] = unspentPoints
for skillIndex = 1, numSkills do
local skillId = GetChampionSkillId(discIndex, skillIndex)
local skillName = GetChampionSkillName(skillId)
local abilityId = GetChampionAbilityId(skillId)
local name = discName .. ":" .. tostring(skillName)
local spentPoints = GetNumPointsSpentOnChampionSkill(skillId)
local description = GetChampionSkillDescription(skillId, spentPoints)
local bonusText = GetChampionSkillCurrentBonusText(skillId, spentPoints)
local isUnlocked = WouldChampionSkillNodeBeUnlocked(skillId, spentPoints)
local slotIndex = skillsSlotted[skillId]
if (slotIndex == nil) then
slotIndex = -1
end
if (spentPoints == 0 and not isUnlocked) then
spentPoints = -1
end
if (spentPoints > 0) then
championPoints[name] = { ["points"] = spentPoints, ["desc"] = description, ["id"] = abilityId, ["skillId"] = skillId, ["slot"] = slotIndex }
end
end
end
championPoints["Total:Unspent"] = totalUnspent
championPoints["Total:Spent"] = totalSpent
return championPoints, championPoints["Total:Spent"] , championPoints["Total:Unspent"]
end
function uespLog.CreateCharDataChampionPoints()
local championPoints = {}
local numDisc = GetNumChampionDisciplines()
local discIndex
local skillIndex
if (GetNumPointsSpentInChampionDiscipline == nil or GetChampionAbilityDescription == nil) then
return championPoints, 0, 0
end
for discIndex = 1, numDisc do
local discName = tostring(GetChampionDisciplineName(discIndex))
local numSkills = GetNumChampionDisciplineSkills(discIndex)
local discPoints = GetNumPointsSpentInChampionDiscipline(discIndex)
championPoints[discName .. ":Points"] = discPoints
for skillIndex = 1, numSkills do
local skillName = GetChampionSkillName(discIndex, skillIndex)
local unlockLevel = GetChampionSkillUnlockLevel(discIndex, skillIndex)
local abilityId = GetChampionAbilityId(discIndex, skillIndex)
local spentPoints = GetNumPointsSpentOnChampionSkill(discIndex, skillIndex)
local description = GetChampionAbilityDescription(abilityId, 0)
local name = discName .. ":" .. tostring(skillName)
unlockLevel = unlockLevel or 100000
if (spentPoints == 0 and unlockLevel <= discPoints) then
spentPoints = -1
end
if (spentPoints ~= 0) then
championPoints[name] = { ["points"] = spentPoints, ["desc"] = description, ["id"] = abilityId }
end
end
end
championPoints["Health:Unspent"] = GetNumUnspentChampionPoints(ATTRIBUTE_HEALTH)
championPoints["Magicka:Unspent"] = GetNumUnspentChampionPoints(ATTRIBUTE_MAGICKA)
championPoints["Stamina:Unspent"] = GetNumUnspentChampionPoints(ATTRIBUTE_STAMINA)
championPoints["Health:Spent"] = GetNumSpentChampionPoints(ATTRIBUTE_HEALTH)
championPoints["Magicka:Spent"] = GetNumSpentChampionPoints(ATTRIBUTE_MAGICKA)
championPoints["Stamina:Spent"] = GetNumSpentChampionPoints(ATTRIBUTE_STAMINA)
championPoints["MaxSpendablePerAttribute"] = GetMaxSpendableChampionPointsInAttribute()
championPoints["Total:Unspent"] = championPoints["Health:Unspent"] + championPoints["Magicka:Unspent"] + championPoints["Stamina:Unspent"]
championPoints["Total:Spent"] = championPoints["Health:Spent"] + championPoints["Magicka:Spent"] + championPoints["Stamina:Spent"]
return championPoints, championPoints["Total:Spent"] , championPoints["Total:Unspent"]
end
function uespLog.CreateCharDataActionBar()
local slots = {}
local i
local j
uespLog.SaveActionBarForCharData()
for j = 1, 4 do
if (uespLog.charData_ActionBarData[j] ~= nil) then
for i = 3, 8 do
slots[i + (j-1)*100] = uespLog.charData_ActionBarData[j][i]
end
end
end
return slots
end
function uespLog.GetCombatMechanicText(id)
local textId = _G['SI_COMBATMECHANICTYPE' .. tostring(id)]
if (textId == nil) then
return tostring(id)
end
local text = GetString(textId)
if (text == nil or text == "") then
return tostring(id)
end
return text
end
function uespLog.SaveActionBarForCharData()
local weaponPairIndex = 1
local timestamp = GetTimeStamp()
weaponPairIndex = uespLog.GetBuildDataActiveBarIndex()
if (weaponPairIndex < 1 or weaponPairIndex > 4) then
return false
end
if (uespLog.LastSavedActionBar_WeaponPair == weaponPairIndex and timestamp - uespLog.LastSavedActionBar_TimeStamp >= uespLog.SAVEACTIONBAR_MINDELTATIME) then
return false
end
uespLog.LastSavedActionBar_WeaponPair = weaponPairIndex
uespLog.LastSavedActionBar_TimeStamp = timestamp
uespLog.charData_ActionBarData[weaponPairIndex] = { }
for i = 3, 8 do
local texture = GetSlotTexture(i)
local id = GetSlotBoundId(i)
local name = GetSlotName(i)
local description = GetAbilityDescription(id)
local descHeader = tostring(GetAbilityDescriptionHeader(id))
local channeled, castTime, channelTime = GetAbilityCastInfo(id)
local minRange, maxRange = GetAbilityRange(id)
local radius = GetAbilityRadius(id)
local angleDistance = GetAbilityAngleDistance(id)
local duration = GetAbilityDuration(id)
local cost, mechanic = GetAbilityCost(id)
local targetDesc = GetAbilityTargetDescription(id) or ''
local costStr = tostring(cost) .. ' ' .. uespLog.GetCombatMechanicText(mechanic)
local rangeStr = ""
local areaStr = ""
if (descHeader ~= "") then
description = descHeader .. "\n" .. description
end
if (not channeled) then
channelTime = 0
end
if (minRange > 0 and maxRange > 0) then
rangeStr = tostring(minRange/100) .. " - " .. tostring(maxRange/100) .. " meters"
elseif (minRange <= 0 and maxRange > 0) then
rangeStr = tostring(maxRange/100) .. " meters"
elseif (minRange > 0 and maxRange <= 0) then
rangeStr = "Under " .. tostring(minRange/100) .. " meters"
end
if (angleDistance > 0) then
areaStr = tostring(radius/100) .. " x " .. tostring(angleDistance/50) .. " meters"
end
uespLog.charData_ActionBarData[weaponPairIndex][i] = {
["name"] = name,
["id"] = id,
["icon"] = texture,
["desc"] = description,
["area"] = areaStr,
["cost"] = costStr,
["range"] = rangeStr,
["radius"] = radius,
["castTime"] = castTime,
["channelTime"] = channelTime,
["duration"] = duration,
["target"] = targetDesc,
}
end
uespLog.savedVars.charInfo.data.actionBar = uespLog.charData_ActionBarData
uespLog.DebugExtraMsg("UESP: ***Current action bar saved*** barIndex "..weaponPairIndex)
end
function uespLog.HasBothActionBarsForCharData()
if (uespLog.charData_ActionBarData[1][3] ~= nil and uespLog.charData_ActionBarData[2][3] ~= nil) then
return true
end
return false
end
function uespLog.GetCharDataBuildType()
local AttributesHealth = GetAttributeSpentPoints(ATTRIBUTE_HEALTH)
local AttributesMagicka = GetAttributeSpentPoints(ATTRIBUTE_MAGICKA)
local AttributesStamina = GetAttributeSpentPoints(ATTRIBUTE_STAMINA)
if (AttributesMagicka >= 20 and AttributesMagicka * 0.75 > AttributesStamina) then
return "Magicka"
elseif (AttributesStamina >= 20 and AttributesStamina * 0.75 > AttributesMagicka) then
return "Stamina"
elseif (AttributesHealth >= 30) then
return "Health"
end
return "Other"
end
function uespLog.OnActionSlotsFullUpdate (eventCode, isHotbarSwap)
--uespLog.DebugMsg("OnActionSlotsFullUpdate "..tostring(isHotbarSwap))
if (isHotbarSwap) then
--uespLog.SaveActionBarForCharData()
end
end
function uespLog.OnActionSlotAbilitySlotted (eventCode, newAbilitySlotted)
--uespLog.DebugMsg("OnActionSlotAbilitySlotted "..tostring(newAbilitySlotted))
zo_callLater(uespLog.SaveActionBarForCharData, 200)
zo_callLater(uespLog.SaveStatsForCharData, 300)
end
uespLog.lastActionSlotUpdatedCall = 0
uespLog.lastActionSlotUpdatedCount = 0
-- Note: This gets called **alot** (40-50 times) when a mob is killed with a Destruction Staff wielded
function uespLog.OnActionSlotUpdated (eventCode, slotNum)
if (GetGameTimeMilliseconds() - uespLog.lastActionSlotUpdatedCall > 2) then
uespLog.lastActionSlotUpdatedCount = 0
end
uespLog.lastActionSlotUpdatedCount = uespLog.lastActionSlotUpdatedCount + 1
uespLog.lastActionSlotUpdatedCall = GetGameTimeMilliseconds()
uespLog.DebugExtraMsg(tostring(uespLog.lastActionSlotUpdatedCount)..": OnActionSlotUpdated "..tostring(slotNum)..":"..tostring(GetGameTimeMilliseconds()))
--local data = uespLog.savedVars.tempData.data
--local timestamp = GetGameTimeMilliseconds()
--data[#data+1] = "EVENT_ACTION_SLOT_UPDATED "..tostring(slotNum).." "..tostring(timestamp)
--uespLog.SaveActionBarForCharData()
end
function uespLog.OnActiveQuickSlotChanged (eventCode, slotId)
--uespLog.DebugMsg("OnActiveQuickSlotChanged "..tostring(slotId))
zo_callLater(uespLog.SaveActionBarForCharData, 200)
zo_callLater(uespLog.SaveStatsForCharData, 300)
end
function uespLog.OnActiveWeaponPairChanged (eventCode, activeWeaponPair, locked)
uespLog.DebugExtraMsg("OnActiveWeaponPairChanged "..tostring(activeWeaponPair))
zo_callLater(uespLog.SaveActionBarForCharData, 400)
zo_callLater(uespLog.SaveStatsForCharData, 500)
-- Far too slow
--uespLog.SaveSkillsForCharData()
end
function uespLog.ClearCharData()
uespLog.savedVars.charData.data = { }
uespLog.savedVars.bankData.data = { }
uespLog.savedVars.craftBagData.data = { }
uespLog.Msg("Cleared all character data.")
end
function uespLog.ClearBuildData()
uespLog.savedVars.buildData.data = { }
uespLog.Msg("Cleared logged character build data.")
end
function uespLog.Command_SaveBuildData (cmd)
cmdWords = {}
for word in cmd:gmatch("%S+") do table.insert(cmdWords, word) end
firstCmd = string.lower(cmdWords[1]) or ""
if (firstCmd == "help" or cmd == "" or (firstCmd == "forcesave" and #cmdWords <= 1)) then
uespLog.Msg("Saves current character build data to the log file (or '/usb').")
uespLog.Msg(". /usb help Shows basic command format")
uespLog.Msg(". /usb reset Clears character log")
uespLog.Msg(". /usb status Shows current character log status")
uespLog.Msg(". /usb [buildName] Saves current character with given build name")
uespLog.Msg(". /usb forcesave [name] Saves character ignoring any errors")
uespLog.Msg(". /usb screenshot [caption] Takes a 'nice' screenshot of your character")
elseif (firstCmd == "status") then
uespLog.Msg("Currently there are "..tostring(#uespLog.savedVars.buildData.data).." character builds saved in log.")
elseif (firstCmd == "reset" or firstCmd == "clear") then
uespLog.ClearBuildData()
elseif (firstCmd == "forcesave") then
cmdWords[1] = nil
buildName = table.concat(cmdWords, ' ')
uespLog.SaveBuildData(buildName, true)
elseif (firstCmd == "ss" or firstCmd == "screenshot") then
local caption = uespLog.trim(cmd:sub(12))
if (firstCmd == "ss") then
caption = uespLog.trim(cmd:sub(4))
end
uespLog.TakeCharDataScreenshot(caption)
else
uespLog.SaveBuildData(cmd, false)
end
end
function uespLog.TakeCharDataScreenshot(caption)
caption = caption or ""
if (uespLog.isTakingCharDataScreenshot) then
return false
end
uespLog.Msg("UESP:Taking character screenshot in 1 sec...don't touch anything!")
uespLog.isTakingCharDataScreenshot = true
uespLog.charDataLastScreenShotCaption = caption
SetFrameLocalPlayerInGameCamera(true)
SetFrameLocalPlayerTarget(0.5, 0.65)
SetFullscreenEffect(FULLSCREEN_EFFECT_CHARACTER_FRAMING_BLUR, 0.5, 0.65)
uespLog.guiHiddenBefore = GetGuiHidden("ingame")
if (not uespLog.guiHiddenBefore) then
ToggleShowIngameGui()
end
zo_callLater(uespLog.QueuedCharDataScreenshot, 1000)
end
function uespLog.QueuedCharDataScreenshot()
TakeScreenshot()
zo_callLater(uespLog.EndQueuedCharDataScreenshot, 500)
end
function uespLog.EndQueuedCharDataScreenshot()
SetFrameLocalPlayerInGameCamera(false)
SetFullscreenEffect(FULLSCREEN_EFFECT_NONE)
if (not uespLog.guiHiddenBefore and GetGuiHidden("ingame")) then
ToggleShowIngameGui()
end
uespLog.isTakingCharDataScreenshot = false
end
function uespLog.GetSkillPointsUsed(showDebug)
local numSkillTypes = GetNumSkillTypes()
local skillType
local skillIndex
local abilityIndex
local totalSkillPoints = 0
for skillType = 1, numSkillTypes do
local numSkillLines = GetNumSkillLines(skillType)
for skillIndex = 1, numSkillLines do
local numSkillAbilities = GetNumSkillAbilities(skillType, skillIndex)
local skillLineName, skillLineRank, discovered = GetSkillLineInfo(skillType, skillIndex)
if (discovered) then
for abilityIndex = 1, numSkillAbilities do
local name, texture, rank, passive, ultimate, purchase, progressionIndex, rankIndex = GetSkillAbilityInfo(skillType, skillIndex, abilityIndex)
local abilityId = GetSkillAbilityId(skillType, skillIndex, abilityIndex, false)
local currentUpgradeLevel, maxUpgradeLevel = GetSkillAbilityUpgradeInfo(skillType, skillIndex, abilityIndex)
local isFree = uespLog.FREE_SKILLS[abilityId] ~= nil
--uespLog.DebugMsg(name..": "..abilityId..", "..skillType..":"..skillIndex..":"..abilityIndex)
progressionIndex = progressionIndex or 0
currentUpgradeLevel = currentUpgradeLevel or 0
if (purchase and abilityId > 0) then
if (passive and currentUpgradeLevel > 0) then
totalSkillPoints = totalSkillPoints + currentUpgradeLevel
if (showDebug) then
uespLog.DebugMsg(name..": "..currentUpgradeLevel.." skill points from passive")
end
if (isFree) then
totalSkillPoints = totalSkillPoints - 1
if (showDebug) then
uespLog.DebugMsg(name.." Ignoring first passive skill point!")
end
end
elseif (passive and currentUpgradeLevel == 0) then
totalSkillPoints = totalSkillPoints + 1
if (showDebug) then
uespLog.DebugMsg(name..": 1 skill point from passive")
end
if (isFree) then
totalSkillPoints = totalSkillPoints - 1
if (showDebug) then
uespLog.DebugMsg(name..": Ignoring first passive skill point!")
end
end
elseif (progressionIndex > 0) then
local name, morph, skillRank = GetAbilityProgressionInfo(progressionIndex)
local points = 1 + math.ceil(morph/2)
totalSkillPoints = totalSkillPoints + points
if (showDebug) then
uespLog.DebugMsg(name..": "..points.." skill points from active")
end
if (isFree) then
totalSkillPoints = totalSkillPoints - 1
if (showDebug) then
uespLog.DebugMsg(name..": Ignoring first active skill point!")
end
end
end
end
end
end
end
end
return totalSkillPoints
end
function uespLog.MergeTables(table1, table2)
for k,v in pairs(table2) do
table1[k] = v
end
return table1
end
function uespLog.GetCharDataResearchInfo()
local researchData = {}
local researchData1 = uespLog.GetCharDataResearchInfoCraftType(CRAFTING_TYPE_CLOTHIER)
local researchData2 = uespLog.GetCharDataResearchInfoCraftType(CRAFTING_TYPE_BLACKSMITHING)
local researchData3 = uespLog.GetCharDataResearchInfoCraftType(CRAFTING_TYPE_WOODWORKING)
local researchData4 = uespLog.GetCharDataResearchInfoCraftType(CRAFTING_TYPE_JEWELRYCRAFTING)
local researchTrait1 = uespLog.GetCharDataResearchTraits(CRAFTING_TYPE_CLOTHIER)
local researchTrait2 = uespLog.GetCharDataResearchTraits(CRAFTING_TYPE_BLACKSMITHING)
local researchTrait3 = uespLog.GetCharDataResearchTraits(CRAFTING_TYPE_WOODWORKING)
local researchTrait4 = uespLog.GetCharDataResearchTraits(CRAFTING_TYPE_JEWELRYCRAFTING)
uespLog.MergeTables(researchData, researchData1)
uespLog.MergeTables(researchData, researchData2)
uespLog.MergeTables(researchData, researchData3)
uespLog.MergeTables(researchData, researchData4)
uespLog.MergeTables(researchData, researchTrait1)
uespLog.MergeTables(researchData, researchTrait2)
uespLog.MergeTables(researchData, researchTrait3)
uespLog.MergeTables(researchData, researchTrait4)
researchData["Timestamp"] = GetTimeStamp()
return researchData
end
function uespLog.GetCharDataResearchTraits(craftingType)
local TradeskillName = uespLog.GetCraftingName(craftingType)
local numLines = GetNumSmithingResearchLines(craftingType)
local totalAllTraits = 0
local totalKnownTraits = 0
local researchData = {}
local varName = ""
if (numLines == 0) then
return researchData
end
for researchLineIndex = 1, numLines do
local slotName, _, numTraits, _ = GetSmithingResearchLineInfo(craftingType, researchLineIndex)
local knownTraits = {}
local unknownTraits = {}
local totalTraits = 0
local knownTraitCount = 0
local unknownTraitCount = 0
local researchTrait = ""
for traitIndex = 1, numTraits do
local duration, timeRemainingSecs = GetSmithingResearchLineTraitTimes(craftingType, researchLineIndex, traitIndex)
local traitType, _, known = GetSmithingResearchLineTraitInfo(craftingType, researchLineIndex, traitIndex)
local traitName = uespLog.GetItemTraitName(traitType)
totalTraits = totalTraits + 1
if (known) then
knownTraits[traitIndex] = traitName
knownTraitCount = knownTraitCount + 1
elseif (duration ~= nil ) then -- Being researched
researchTrait = "["..traitName.."]"
knownTraits[traitIndex] = "["..traitName.."]"
unknownTraitCount = unknownTraitCount + 1
else
unknownTraits[traitIndex] = traitName
unknownTraitCount = unknownTraitCount + 1
end
end
totalAllTraits = totalAllTraits + totalTraits
totalKnownTraits = totalKnownTraits + knownTraitCount
varName = TradeskillName..":Trait:"..tostring(slotName)
if (unknownTraitCount == 0) then
researchData[varName] = "All traits known"
elseif (knownTraitCount == 0) then
researchData[varName] = "No traits known"
else
local knownString = uespLog.implode(knownTraits, ", ")
local unknownString = uespLog.implode(unknownTraits, ", ") .. " " .. researchTrait
researchData[varName] = knownString .. " ("..tostring(knownTraitCount).."/"..tostring(totalTraits)..")"
researchData[varName..":Unknown"] = unknownString .. " ("..tostring(unknownTraitCount).."/"..tostring(totalTraits)..")"
end
researchData[varName..":Known"] = knownTraitCount
researchData[varName..":Total"] = totalTraits
end
varName = TradeskillName..":Trait"
researchData[varName..":Known"] = totalKnownTraits
researchData[varName..":Total"] = totalAllTraits
return researchData
end
function uespLog.GetCharDataResearchInfoCraftType(craftingType)
local TradeskillName = uespLog.GetCraftingName(craftingType)
local numLines = GetNumSmithingResearchLines(craftingType)
local maxSimultaneousResearch = GetMaxSimultaneousSmithingResearch(craftingType)
local researchCount = 0
local researchData = {}
if (numLines == 0 or maxSimultaneousResearch == 0) then
return researchData
end
for researchLineIndex = 1, numLines do
local slotName, icon, numTraits, timeRequiredForNextResearchSecs = GetSmithingResearchLineInfo(craftingType, researchLineIndex)
for traitIndex = 1, numTraits do
local duration, timeRemainingSecs = GetSmithingResearchLineTraitTimes(craftingType, researchLineIndex, traitIndex)
local traitType, traitDescription, known = GetSmithingResearchLineTraitInfo(craftingType, researchLineIndex, traitIndex)
local traitName = uespLog.GetItemTraitName(traitType)
if (duration ~= nil) then
researchCount = researchCount + 1
researchData[TradeskillName .. ":Trait" .. tostring(researchCount)] = traitName
researchData[TradeskillName .. ":Item" .. tostring(researchCount)] = slotName
researchData[TradeskillName .. ":Time" .. tostring(researchCount)] = timeRemainingSecs
end
end
end
if (researchCount < maxSimultaneousResearch) then
local slotsOpen = maxSimultaneousResearch - researchCount
researchData[TradeskillName .. ":Open"] = slotsOpen
else
researchData[TradeskillName .. ":Open"] = 0
end
return researchData
end
SLASH_COMMANDS["/uespsavebuild"] = uespLog.Command_SaveBuildData
SLASH_COMMANDS["/uespbuild"] = uespLog.Command_SaveBuildData
SLASH_COMMANDS["/uespskillpoints"] = function (cmd)
local skillPointsUsed = uespLog.GetSkillPointsUsed(cmd == "debug")
local skillPointsUnused = GetAvailableSkillPoints()
local totalPoints = skillPointsUsed + skillPointsUnused
local skyShards = GetNumSkyShards()
local foundSkyshards, totalSkyshards = uespLog.GetSkyshardsFound()
uespLog.Msg("You have used "..tostring(skillPointsUsed).." skill points, "..tostring(skillPointsUnused).." unused skill points ("..totalPoints.." total) and "..tostring(skyShards).." skyshards.")
uespLog.Msg("You found a total of "..tostring(foundSkyshards).." out of "..tostring(totalSkyshards).." skyshards!")
end
function uespLog.UpdateCharDataPassword(password1, password2)
password1 = uespLog.trim(password1)
password2 = uespLog.trim(password2)
if (password1 == nil or password1 == "") then
uespLog.ShowCharDataPassword()
return
elseif (password1:lower() == "clear") then
uespLog.SetCharDataPassword("")
else
uespLog.SetCharDataPassword(password1)
end
uespLog.ShowCharDataPassword()
end
function uespLog.ShowCharDataPassword()
local currentPassword = uespLog.GetCharDataPassword()
if (currentPassword == "") then
uespLog.Msg("You have no char data password!")
else
uespLog.Msg("Current char data password is '"..tostring(uespLog.GetCharDataPassword()).."'.")
end
end
function uespLog.IsInOverloadState()
local playerClass = GetUnitClass('player')
local numBuffs = GetNumBuffs("player")
local i
if (playerClass ~= "Sorcerer") then
return false
end
for i = 1, numBuffs do
local buffName = GetUnitBuffInfo("player", i)
if (buffName == "Power Overload" or buffName == "Overload" or buffName == "Energy Overload") then
return true
end
end
return false
end
function uespLog.LogCompletedQuestData()
local data = uespLog.savedVars.tempData.data
local questId = GetNextCompletedQuestId(nil)
while (questId ~= nil) do
local name, questType = GetCompletedQuestInfo(questId)
local zoneName, objectiveName, zoneIndex, poiIndex = GetCompletedQuestLocationInfo(questId)
data[#data + 1] = ""..questId..",'" .. name .. "',"..questType..",'"..zoneName.."','"..objectiveName.."'"
questId = GetNextCompletedQuestId(questId)
end
end
function uespLog.CreateJournalCharData()
local journalData = {}
local numQuests = GetNumJournalQuests()
local journalIndex
local conditionIndex
journalData["NumJournalQuests"] = numQuests
for journalIndex = 1, numQuests do
journalData["Journal:"..journalIndex..":Name"] = GetJournalQuestName(journalIndex)
journalData["Journal:"..journalIndex..":Type"] = GetJournalQuestType(journalIndex)
journalData["Journal:"..journalIndex..":Repeat"] = GetJournalQuestRepeatType(journalIndex)
journalData["Journal:"..journalIndex..":Zone"] = GetJournalQuestLocationInfo(journalIndex)
journalData["Journal:"..journalIndex..":Tasks"] = ""
local questName, backgroundText, activeStepText, activeStepType, overrideText = GetJournalQuestInfo(journalIndex)
journalData["Journal:"..journalIndex..":Text"] = backgroundText
journalData["Journal:"..journalIndex..":ActiveText"] = activeStepText
journalData["Journal:"..journalIndex..":ActiveType"] = activeStepType
local numSteps = GetJournalQuestNumSteps(journalIndex)
if (overrideText ~= "") then
journalData["Journal:"..journalIndex..":Tasks"] = tostring(overrideText)
elseif (numSteps >= 1) then
local numConditions = GetJournalQuestNumConditions(journalIndex, 1)
local taskText = ""
for conditionIndex = 1, numConditions do
local text, current, maxCount, isFail, isComplete, isCreditShared, isVisible = GetJournalQuestConditionInfo(journalIndex, stepIndex, conditionIndex)
if (isVisible) then
if (taskText ~= "") then
taskText = taskText .. "|"
end
taskText = taskText .. text
end
end
taskText = taskText:gsub("•", "~*")
journalData["Journal:"..journalIndex..":Tasks"] = taskText
end
end
return journalData
end
function uespLog.CreateCompletedQuestCharData()
local questData = {}
local questId = GetNextCompletedQuestId(nil)
local questCount = 0
while (questId ~= nil) do
local name, questType = GetCompletedQuestInfo(questId)
local zoneName, objectiveName, zoneIndex, poiIndex = GetCompletedQuestLocationInfo(questId)
questCount = questCount + 1
questData["Quest:"..questCount] = tostring(questId).."|"..tostring(name).."|"..tostring(questType).."|"..tostring(zoneName).."|"..tostring(objectiveName)
questId = GetNextCompletedQuestId(questId)
end
questData["NumCompletedQuests"] = questCount
return questData
end
function uespLog.CreateGuildsCharData()
local guildData = {}
local numGuilds = GetNumGuilds()
local guildIndex
guildData["NumGuilds"] = numGuilds
for guildIndex = 1, numGuilds do
local name = GetGuildName(guildIndex)
local memberIndex = GetPlayerGuildMemberIndex(guildIndex)
local _, _, rankIndex, playerStatus = GetGuildMemberInfo(guildIndex, memberIndex)
guildData["Guild:"..tostring(guildIndex)] = name
guildData["Guild:"..tostring(guildIndex)..":Members"] = GetNumGuildMembers(guildIndex)
guildData["Guild:"..tostring(guildIndex)..":Rank"] = GetGuildRankCustomName(guildIndex, rankIndex)
guildData["Guild:"..tostring(guildIndex)..":Founded"] = GetGuildFoundedDate(guildIndex)
end
return guildData
end |
local _={}
_.draw=function()
end
return _ |
print("LabJack Lua Waveform Generator Example. Version 1.0")
-- This script will output a waveform on DAC0
-- User memory is used to set the scan frequency,
-- wave frequency, wave shape, amplitude and offset.
-- Once the script is running switch to the "Register Matrix" tab and add
-- registers 46000, 46002, 46004, 46006, and 46008. See below for which register
-- affects which attribute. Updating those values will update the output wave.
local mbWrite=MB.W --create local functions for faster processing
local mbRead=MB.R
local OStreamBuffSize = 1024 -- number of bytes to allocate to the buffer
local streamScanFreq = 10000 -- How often the DACs value will be updated
local waveFreq = 100 -- Frequency of the sine wave.
local waveShape = 0 -- 0=sine, 1=square, 2=triangle
local waveAmp = 1.0 -- Wave amplitude
local waveOff = 1.0 -- Wave offset
local last_SSF = 0
local last_WF = 0
local last_WS = 0
local last_WA = 0
local last_WO = 0
-- Initialize IO memeory
mbWrite(46000, 3, streamScanFreq)
mbWrite(46002, 3, waveFreq)
mbWrite(46004, 3, waveShape)
mbWrite(46006, 3, waveAmp)
mbWrite(46008, 3, waveOff)
mbWrite(4090, 1, 0) -- Stream out off
mbWrite(4040, 1, 1000) -- Set Stream-Out target to DAC0
mbWrite(4050, 1, OStreamBuffSize) -- Set the buffer size
mbWrite(4090, 1, 1) -- Stream out on
LJ.IntervalConfig(0, 1000) -- Check for new values once per second
LJ.IntervalConfig(1, 50) -- Used to limit debugging output rates
local checkInterval=LJ.CheckInterval
while true do
if checkInterval(0) then
-- Read IO memory
streamScanFreq = mbRead(46000, 3)
waveFreq = mbRead(46002, 3)
waveShape = mbRead(46004, 3)
waveAmp = mbRead(46006, 3)
waveOff = mbRead(46008, 3)
if streamScanFreq ~= last_SSF then -- If updating streamScanFreq
if mbRead(4990, 1) ~= 0 then -- If stream is on
mbWrite(4990, 1, 0) -- Disable stream
print("Updating scan rate")
end -- Always disabling stream is an option, but will throw an error.
end
if waveFreq ~= last_WF or -- If new waveform has been specified.
waveShape ~= last_WS or
waveAmp ~= last_WA or
waveOff ~= last_WO then
print("Updating wave")
print(waveFreq, waveShape, waveAmp, waveOff)
-- Compute new wave
local nPoints = streamScanFreq / waveFreq
if nPoints > (OStreamBuffSize / 2) then
print("Too many points for the buffer specified.")
end
local dataSet = {}
local i = 1
for i=1, nPoints, 1 do
if waveShape == 0 then -- Sine wave
dataSet[i] = math.sin(6.283185 * i / nPoints)
elseif waveShape == 1 then -- Square wave
if i < (nPoints / 2) then
dataSet[i] = -1
else
dataSet[i] = 1
end
elseif waveShape == 2 then -- Triangle wave
local step = 4 / nPoints
if i < (nPoints / 2) then
dataSet[i] = step*i - 1
else
dataSet[i] = 1 - step * (i - nPoints / 2)
end
end
dataSet[i] = dataSet[i] * waveAmp
dataSet[i] = dataSet[i] + waveOff
-- print(i, dataSet[i]) -- Print out the dataset
-- while LJ.CheckInterval(1) == nil do -- limit the rate that the debug buffer is filled
-- end
end
-- Load the new wave form
for i=1, nPoints, 1 do -- load all the data... one at a time
mbWrite(4400, 3, dataSet[i]) -- This could imporved to load more quickly
end -- but the benefit will be smaller than when using C-R.
mbWrite(4060, 1, nPoints) -- Set the number of points to loop
mbWrite(4070, 1, 1) -- Begin using the recently loaded data set.
end
if mbRead(4990, 1, 0) == 0 then -- If stream is off because this is the first run or changing scanFreq
mbWrite(4002, 3, streamScanFreq) -- Set scan rate
mbWrite(4004, 1, 1) -- 1 Chn per scan
mbWrite(4008, 3, 0) -- Automatic Settling
mbWrite(4010, 1, 0) -- Automatic Resolution
mbWrite(4012, 1, 256) -- Use a real small buffer, because we do not care about any data.
mbWrite(4014, 1, 0) -- No advanced clocking options
mbWrite(4016, 1, 0) -- No advanced targets
mbWrite(4020, 1, 0) -- Continuous operation; disable burst.
mbWrite(4100, 1, 4800) -- Add channel 4800 (StreamOut 0)
mbWrite(4990, 1, 1) -- Start stream
end
last_SSF = streamScanFreq
last_WF = waveFreq
last_WS = waveShape
last_WA = waveAmp
last_WO = waveOff
end
end |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
local CrossingHard, parent = torch.class('CrossingHard', 'Traffic')
function CrossingHard:__init(opts, vocab)
assert(opts.map_height == 18)
assert(opts.map_height == opts.map_width)
parent.__init(self, opts, vocab)
end
function CrossingHard:build_roads_part(transform)
local yy, xx
for y = 1, 4 do
yy, xx = transform(y, 4)
self:place_item({type = 'block', _invisible = true}, yy, xx)
end
for y = 7, 12 do
yy, xx = transform(y, 4)
self:place_item({type = 'block', _invisible = true}, yy, xx)
end
for x = 1, 3 do
yy, xx = transform(4, x)
self:place_item({type = 'block', _invisible = true}, yy, xx)
yy, xx = transform(7, x)
self:place_item({type = 'block', _invisible = true}, yy, xx)
yy, xx = transform(12, x)
self:place_item({type = 'block', _invisible = true}, yy, xx)
end
for y = 7, 11 do
yy, xx = transform(y, 7)
self:place_item({type = 'block', _invisible = true}, yy, xx)
end
local r
yy, xx = transform(5, 1)
table.insert(self.dest_locs, {y = yy, x = xx})
yy, xx = transform(6, 1)
table.insert(self.source_locs, {y = yy, x = xx, no_dest = #self.dest_locs, routes = {}})
-- 1st left
r = {}
for x = 1, 6 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 5, 1, -1 do
yy, xx = transform(y, 6)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 2nd left
r = {}
for x = 1, 14 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 5, 1, -1 do
yy, xx = transform(y, 14)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- go straight
r = {}
for x = 1, 18 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st right, then left
r = {}
for x = 1, 5 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 7, 14 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 6, 18 do
yy, xx = transform(14, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 2nd right, then straight
r = {}
for x = 1, 13 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 7, 18 do
yy, xx = transform(y, 13)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st right, then straight
r = {}
for x = 1, 5 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 7, 18 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st right, then right
r = {}
for x = 1, 5 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 7, 13 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 4, 1, -1 do
yy, xx = transform(13, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
yy, xx = transform(1, 6)
table.insert(self.dest_locs, {y = yy, x = xx})
yy, xx = transform(1, 5)
table.insert(self.source_locs, {y = yy, x = xx, no_dest = #self.dest_locs, routes = {}})
-- 1st right
r = {}
for y = 1, 5 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 4, 1, -1 do
yy, xx = transform(5, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 2nd right
r = {}
for y = 1, 13 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 4, 1, -1 do
yy, xx = transform(13, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- go straight
r = {}
for y = 1, 18 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st left, then right
r = {}
for y = 1, 6 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 6, 13 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 7, 18 do
yy, xx = transform(y, 13)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 2nd left, then straight
r = {}
for y = 1, 14 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 6, 18 do
yy, xx = transform(14, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st left, then straight
r = {}
for y = 1, 6 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 6, 18 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
-- 1st left, then left
r = {}
for y = 1, 6 do
yy, xx = transform(y, 5)
table.insert(r, {y = yy, x = xx})
end
for x = 6, 14 do
yy, xx = transform(6, x)
table.insert(r, {y = yy, x = xx})
end
for y = 5, 1, -1 do
yy, xx = transform(y, 14)
table.insert(r, {y = yy, x = xx})
end
table.insert(self.routes, r)
table.insert(self.source_locs[#self.source_locs].routes, #self.routes)
end
function CrossingHard:build_roads()
-- build
self:build_roads_part(function(y, x)
return y, x
end)
self:build_roads_part(function(y, x)
return x, self.map.height + 1 - y
end)
self:build_roads_part(function(y, x)
return self.map.width + 1 - x, y
end)
self:build_roads_part(function(y, x)
return self.map.height + 1 - y, self.map.width + 1 - x
end)
end
|
--- The Roblox test runner script.
-- This script can run within Roblox to perform automated tests.
--
-- @module TestRunner
-- @version 0.1.1, 2020-11-03
-- @since 0.1
--
-- @throws when the tests fail
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Tests = require(ReplicatedStorage:WaitForChild("Tests")
:WaitForChild("Tests"))
--- The locations containing tests.
local Roots = {ReplicatedStorage.Tests}
local completed, result = Tests(Roots)
if completed then
if not result then
error("Tests have failed.", 0)
end
else
error(result, 0)
end
|
-- enumerations in pure Luau
-- @docs https://roblox.github.io/enumerate/
local t = require(script.t)
local ALREADY_USED_NAME_ERROR = "Already used %q as a value name in enum %q."
local ALREADY_USED_VALUE_ERROR = "Already used %q as a value in enum %q."
local INVALID_MEMBER_ERROR = "%q (%s) is not a valid member of %s"
local enumeratorTuple = t.tuple(
t.string,
t.union(
t.array(t.string),
t.keys(t.string)
)
)
local function lockTable(tab, name)
local function protectedFunction(_, key)
error(string.format(
INVALID_MEMBER_ERROR,
tostring(key),
typeof(key),
name
))
end
return setmetatable(tab, {
__index = protectedFunction,
__newindex = protectedFunction,
})
end
--[[**
Creates a new enumeration.
@param [t:string] enumName The unique name of the enumeration.
@param [t:union(t:array<t:string>, t:keys<t:string>)] enumValues The values of the enumeration.
@returns [t:userdata] a new enumeration
**--]]
local function enumerator(enumName, enumValues)
assert(enumeratorTuple(enumName, enumValues))
local internal = {}
local rawValues = {}
function internal.fromRawValue(rawValue)
return rawValues[rawValue]
end
function internal.isEnumValue(value)
if typeof(value) ~= "userdata" then
return false
end
for _, enumValue in pairs(internal) do
if enumValue == value then
return true
end
end
return false
end
if enumValues[1] then
for _, valueName in ipairs(enumValues) do
assert(valueName ~= "fromRawValue", "Cannot use 'fromRawValue' as a value")
assert(valueName ~= "isEnumValue", "Cannot use 'isEnumValue' as a value")
assert(internal[valueName] == nil, string.format(ALREADY_USED_NAME_ERROR, valueName, enumName))
assert(rawValues[valueName] == nil, string.format(ALREADY_USED_VALUE_ERROR, valueName, enumName))
local value = newproxy(true)
local metatable = getmetatable(value)
local valueString = string.format("%s.%s", enumName, valueName)
function metatable.__tostring()
return valueString
end
metatable.__index = lockTable({
value = valueName,
rawValue = function()
return valueName
end,
})
internal[valueName] = value
rawValues[valueName] = value
end
else
for valueName, rawValue in pairs(enumValues) do
assert(valueName ~= "fromRawValue", "Cannot use 'fromRawValue' as a value")
assert(valueName ~= "isEnumValue", "Cannot use 'isEnumValue' as a value")
assert(internal[valueName] == nil, string.format(ALREADY_USED_NAME_ERROR, valueName, enumName))
assert(rawValues[valueName] == nil, string.format(ALREADY_USED_VALUE_ERROR, valueName, enumName))
local value = newproxy(true)
local metatable = getmetatable(value)
local valueString = string.format("%s.%s", enumName, valueName)
function metatable.__tostring()
return valueString
end
metatable.__index = lockTable({
value = rawValue,
rawValue = function()
return rawValue
end,
})
internal[valueName] = value
rawValues[rawValue] = value
end
end
local enum = newproxy(true)
local metatable = getmetatable(enum)
metatable.__index = lockTable(internal, enumName)
function metatable.__tostring()
return enumName
end
return enum
end
return enumerator |
--[[
LibQuestData
by Sharlikran
https://sharlikran.github.io/
^(\d{1,4}), "(.*)"
\[\1] = "\2",
(.*) = "(.*)" = "(.*), ",
"\2", = \{\3\,},
^"(.*)", = \{(.*)\},
\["\1"] = \{\2 },
--]]
local lib = _G["LibQuestData"]
lib.quest_names["ru"] = {
[465] = "Щит, обрызганный кровью",
[467] = "Судьба сэра Хью",
[499] = "По следам Осколка",
[521] = "Помощь Азуры",
[523] = "Проклятый город",
[575] = "Уловка Вермины",
[614] = "Взгляни в зеркало",
[657] = "Свобода Фадила",
[728] = "Починка маяка в Кеглине",
[736] = "Пламя разногласия",
[737] = "Возврат крепости Пламенного Меча",
[974] = "Герцог в изгнании",
[1294] = "Книга чародея",
[1339] = "Сердце хищника",
[1341] = "Зубы огров",
[1346] = "Конец угрозе огров",
[1383] = "Безупречные похороны",
[1384] = "Старые искатели приключений",
[1437] = "Приказы генерала Годруна",
[1485] = "Его утащили прочь",
[1489] = "Подстереженный торговец вином",
[1527] = "Что посеешь, то и пожнешь",
[1529] = "Хранитель Азуры",
[1536] = "Пожар в полях",
[1541] = "Во власти сна",
[1554] = "Кровная месть",
[1568] = "Средство для достижения цели",
[1591] = "Раненые Духовные Хранители",
[1615] = "Ближайшие родственники",
[1633] = "Возвращение Осколка Грез",
[1637] = "Отвлечь и освободить",
[1639] = "Очередной Предвестник",
[1678] = "Спящий фермер",
[1687] = "Фальшивые рыцари",
[1709] = "Сон Розенн",
[1735] = "Вопросы без ответов",
[1799] = "Город в черном",
[1802] = "Владычица озера",
[1804] = "Утонувшее знание",
[1834] = "Сердце зла",
[1835] = "Последний спригган",
[2016] = "Бремя Халлина",
[2017] = "Львиное логово",
[2018] = "Жажда революции",
[2046] = "От грез к кошмарам",
[2047] = "Ворота в Трясину",
[2068] = "Угроза дреугов",
[2130] = "Поднявшиеся мертвецы",
[2146] = "Неприступное хранилище",
[2161] = "Обезьянья магия",
[2184] = "Дыхание Ту'вакки",
[2187] = "Почитаемые предки",
[2192] = "Рассчитаться с Увафой",
[2193] = "Ученый из Бергамы",
[2222] = "Замысел Алазана",
[2240] = "Исследование Шири",
[2251] = "Пропавшие без вести",
[2255] = "Ползающий хаос",
[2344] = "Змеи в пустыне",
[2356] = "Марш Ра Гада",
[2364] = "Пернатые чудовища",
[2403] = "В поисках Шири",
[2404] = "Вторжение имперцев",
[2408] = "В поисках эш'аба",
[2436] = "Последняя игра",
[2450] = "Пострадавшая женщина",
[2451] = "Выкуп за Миранду",
[2481] = "Долги сборщика долгов",
[2488] = "Банда головорезов",
[2494] = "Не могу уйти без нее",
[2495] = "Перстень-печатка",
[2496] = "Свидетельства против Адимы",
[2497] = "Спасение Хосни",
[2504] = "Реликвии Азуры",
[2536] = "От плуга к мечу",
[2537] = "Меч короля Афрена",
[2538] = "Подарок от поклонника",
[2549] = "Скверна из загробного мира",
[2550] = "Проклятие черепов",
[2552] = "Войско у ворот",
[2556] = "Ложные обвинения",
[2558] = "Работорговцы",
[2561] = "Семейное дело",
[2564] = "Две стороны одной медали",
[2566] = "Жизнь герцогини",
[2567] = "Безопасность королевства",
[2569] = "Возвращение Троицы",
[2576] = "По следам сэра Хью",
[2578] = "Нашествие скампов",
[2599] = "Спасение из пепла",
[2608] = "Древний свиток Гартока",
[2609] = "Древний свиток Чима",
[2610] = "Древний свиток Алтадуна",
[2611] = "Древний свиток Мнема",
[2612] = "Древний свиток Ни-Мока",
[2613] = "Древний свиток Алма-Румы",
[2673] = "Scout Fort Rayles",
[2674] = "Scout Fort Glademist",
[2675] = "Scout Fort Ash",
[2676] = "Scout Fort Aleswell",
[2677] = "Scout Fort Dragonclaw",
[2678] = "Scout Chalman Keep",
[2679] = "Scout Arrius Keep",
[2684] = "Scout Drakelowe Keep",
[2685] = "Scout Castle Alessia",
[2686] = "Scout Castle Faregyl",
[2689] = "Scout Castle Black Boot",
[2692] = "Scout Rayles Mine",
[2693] = "Scout Glademist Mine",
[2694] = "Scout Ash Mine",
[2697] = "Scout Aleswell Mine",
[2698] = "Scout Dragonclaw Mine",
[2699] = "Scout Chalman Mine",
[2700] = "Scout Arrius Mine",
[2701] = "Scout Kingscrest Mine",
[2702] = "Scout Farragut Mine",
[2706] = "Scout Faregyl Mine",
[2708] = "Scout Brindle Mine",
[2709] = "Scout Black Boot Mine",
[2710] = "Scout Bloodmayne Mine",
[2722] = "Scout Rayles Farm",
[2723] = "Scout Glademist Farm",
[2728] = "Scout Chalman Farm",
[2729] = "Scout Arrius Farm",
[2730] = "Scout Kingscrest Farm",
[2731] = "Scout Farragut Farm",
[2736] = "Scout Faregyl Farm",
[2738] = "Scout Brindle Farm",
[2739] = "Scout Black Boot Farm",
[2740] = "Scout Bloodmayne Farm",
[2741] = "Scout Warden Lumbermill",
[2742] = "Scout Rayles Lumbermill",
[2743] = "Scout Glademist Lumbermill",
[2744] = "Scout Ash Lumbermill",
[2745] = "Scout Aleswell Lumbermill",
[2747] = "Scout Chalman Lumbermill",
[2749] = "Scout Kingscrest Lumbermill",
[2750] = "Scout Farragut Lumbermill",
[2752] = "Scout Drakelowe Lumbermill",
[2755] = "Scout Roebeck Lumbermill",
[2756] = "Scout Brindle Lumbermill",
[2757] = "Scout Black Boot Lumbermill",
[2758] = "Scout Bloodmayne Lumbermill",
[2759] = "Убить вражеских игроков",
[2915] = "Capture Fort Warden",
[2917] = "Capture Fort Glademist",
[2918] = "Capture Fort Ash",
[2919] = "Захват форта Эльсвел",
[2920] = "Захват форта Коготь Дракона",
[2921] = "Захват крепости Чалман",
[2922] = "Захват крепости Арриус",
[2923] = "Захват крепости Гребень Королей",
[2924] = "Захват крепости Фаррагут",
[2925] = "Capture Blue Road Keep",
[2926] = "Capture Drakelowe Keep",
[2927] = "Capture Castle Alessia",
[2928] = "Capture Castle Faregyl",
[2929] = "Capture Castle Roebeck",
[2930] = "Capture Castle Brindle",
[2931] = "Capture Castle Black Boot",
[2932] = "Capture Castle Bloodmayne",
[2937] = "Capture Aleswell Mine",
[2939] = "Capture Chalman Mine",
[2944] = "Capture Drakelowe Mine",
[2946] = "Capture Faregyl Mine",
[2947] = "Capture Roebeck Mine",
[2951] = "Capture Black Boot Mine",
[2952] = "Capture Bloodmayne Mine",
[2954] = "Capture Rayles Farm",
[2956] = "Capture Ash Farm",
[2956] = "Capture Ash Farm",
[2958] = "Capture Dragonclaw Farm",
[2961] = "Capture Kingscrest Farm",
[2966] = "Capture Faregyl Farm",
[2970] = "Capture Bloodmayne Farm",
[2972] = "Capture Warden Lumbermill",
[2980] = "Capture Kingscrest Lumbermill",
[2981] = "Capture Farragut Lumbermill",
[2986] = "Capture Roebeck Lumbermill",
[2997] = "Отсечение Руки",
[2998] = "Возвращение Хранителей ансеев",
[3000] = "Кровь и полумесяц",
[3001] = "Замысел Фарливер",
[3003] = "Неудавшееся преступление",
[3004] = "Шкатулка леди Элоизы",
[3006] = "Убийцы Кровавого шипа",
[3009] = "Рассердившиеся деревья",
[3011] = "Похититель свиней",
[3013] = "Волки в овечьей шкуре",
[3016] = "Корни Древа вещуний",
[3017] = "Убийства в темных переулках",
[3018] = "Потомки с когтями и клыками",
[3019] = "Призраки Весттри",
[3020] = "Помни о смерти",
[3023] = "Ужасный обмен",
[3026] = "Сестры-вещуньи",
[3027] = "Волновой эффект",
[3029] = "Сокровища храма",
[3035] = "Вещуньи и ковен",
[3039] = "Крокодилья награда",
[3040] = "Жизненно важное наследство",
[3047] = "Шаг в прошлое",
[3049] = "Безымянный воин",
[3050] = "Проклятые сокровища",
[3059] = "Слуги древних королей",
[3060] = "В поисках хранителей",
[3063] = "Защитник хранителей",
[3064] = "Сплочение сил",
[3082] = "Застава Львиной гвардии",
[3172] = "Покинутая у алтаря",
[3174] = "Надежда умирает последней",
[3183] = "К Древу вещуний",
[3184] = "Гленумбрийские верески",
[3187] = "Лови момент",
[3189] = "Сокрытое в пламени",
[3190] = "Возрождение эш'аба",
[3191] = "Спасение стихий",
[3192] = "Забытое родство",
[3235] = "Очищение Древа вещуний",
[3267] = "The Fall of Faolchu",
[3267] = "Падение Фалчу",
[3277] = "Работа над талисманом",
[3280] = "Проникновение имперцев",
[3281] = "Вперед, к заставе",
[3283] = "Вервольфы на севере",
[3285] = "Драгоценная корона Антона",
[3286] = "В осаде",
[3296] = "Испытания героя",
[3302] = "Жалобы шахтеров",
[3303] = "Помешать Альдмерскому Доминиону",
[3305] = "Самый старый орк",
[3314] = "Полчище мертвецов",
[3315] = "Таинственное сокровище",
[3317] = "Языки камня",
[3322] = "Каталог Дресан",
[3330] = "Освобождение Камлорна",
[3333] = "Поднявшиеся из глубин",
[3335] = "Натиск Эвермора",
[3337] = "Законные интересы",
[3338] = "Ядовитый туман",
[3343] = "Отвоевание Кроссвича",
[3344] = "Сатак был первым Змеем",
[3345] = "Конец вымогательствам",
[3353] = "Природа судьбы",
[3357] = "Лабиринт",
[3367] = "Природа судьбы: часть вторая",
[3379] = "Ангоф Могильный Певец",
[3381] = "Победитель для Онвина",
[3383] = "Шахта Грязной воды",
[3385] = "Неумирающая верность",
[3412] = "Опасный сон",
[3414] = "Наследие утеса Бельборн",
[3416] = "Сообщения Доминиона",
[3436] = "Бесчестные деяния в глубинах",
[3437] = "Загадочная древность",
[3438] = "Прошлое в руинах",
[3440] = "Заблудившиеся разведчики",
[3482] = "В ловушке утесов",
[3496] = "Поиски для Скарабея",
[3509] = "Лозы и лиходеи",
[3520] = "Окно в прошлое",
[3530] = "Уничтожение Темных Свидетелей",
[3533] = "Пробуждающаяся тьма",
[3566] = "Королевство в трауре",
[3581] = "Очищение прошлого",
[3583] = "Подозрительная тишина",
[3584] = "Коралловое Сердце",
[3585] = "Наследие предков",
[3587] = "Задержка даггерфольцев",
[3588] = "Город в осаде",
[3589] = "Приглушение колокола",
[3590] = "Разгребание последствий",
[3591] = "Яд Акнары",
[3592] = "Завоевание доверия",
[3593] = "Незваные гости в Дешаане",
[3594] = "Рабы и после смерти",
[3595] = "Своенравный сын",
[3598] = "Жертва во благо",
[3600] = "Нарушитель клятвы",
[3602] = "Сногшибательное скотоводство",
[3604] = "Против течения",
[3605] = "Ритуал страдания",
[3608] = "Медальоны святого Велота",
[3610] = "Ради собственной защиты",
[3611] = "Пылающая ярость",
[3612] = "Голый норд",
[3615] = "Пробуждение мертвеца",
[3616] = "Разделение пламени",
[3617] = "Успокоение сердца",
[3618] = "К Пепельной горе",
[3620] = "Разоренная деревня",
[3621] = "Опасные бассейны",
[3622] = "Рождение Братьев",
[3624] = "Спасение Тихой Топи",
[3626] = "Оборона зала",
[3627] = "Кровная месть",
[3631] = "Возвращение гуаров",
[3632] = "Осада форта Вирак",
[3633] = "Уравнивание шансов",
[3634] = "Гибель генерала",
[3635] = "Город на Шпиле",
[3637] = "Сон Годруна",
[3639] = "Наведение порядка",
[3642] = "Проклятие крепости Хеймлин",
[3643] = "Что было сделано, то нужно обратить",
[3645] = "Молодое деревце",
[3646] = "Непрошенный двойник",
[3647] = "Разбитое зеркало",
[3648] = "По следам истории",
[3650] = "Хладнокровное отмщение",
[3651] = "Испытание Призрачного Змея",
[3652] = "Ответный удар",
[3653] = "Напустим на них крыс",
[3656] = "Поиск и спасение",
[3657] = "Сбор молочка",
[3658] = "Cвоевременный вопрос",
[3659] = "Нежеланные гости",
[3660] = "Спрятаться на видном месте",
[3661] = "Механическое убийство",
[3662] = "Небольшая разминка",
[3663] = "То, что важнее всего",
[3666] = "Правила и нормы",
[3667] = "Ночь души",
[3670] = "Отчаявшиеся души",
[3671] = "В форт Вирак",
[3673] = "Смертельная ловушка",
[3674] = "Теплый прием",
[3675] = "Последний привал",
[3676] = "Пиратские переговоры",
[3678] = "Испытания Полированной Чешуи",
[3679] = "Сны Хиста",
[3680] = "Сомнительная ценность",
[3681] = "Роковое паломничество",
[3683] = "То, что спрятано внизу",
[3684] = "Плохие солдаты",
[3685] = "Кожа да кости",
[3686] = "Три нежных души",
[3687] = "В поисках правды",
[3688] = "Незваные гости",
[3690] = "Очищение болот",
[3695] = "Агрессивные переговоры",
[3696] = "Спасение сына",
[3697] = "Сбор гуаров",
[3698] = "К Измученному шпилю",
[3699] = "Из пустоши",
[3702] = "Алиби солдата",
[3703] = "Дело чести",
[3705] = "Расплата",
[3709] = "Завершение сделки",
[3712] = "Души в неволе",
[3715] = "Странные сторожевые твари",
[3717] = "Король праха",
[3718] = "Внутрь храма",
[3719] = "Отпечаток времени",
[3721] = "Негармоничные сигналы",
[3724] = "Потерянный в Трясине",
[3728] = "Память о Рисе",
[3729] = "Незваный незнакомец",
[3730] = "Шепот дымков",
[3731] = "Разбитое сердце",
[3732] = "Набег",
[3734] = "Возвращение стражей",
[3735] = "Смерть Балрета",
[3736] = "Скампам место в пещерах",
[3737] = "Плывя по течению",
[3749] = "В пасть безумия",
[3751] = "Охота на захватчиков",
[3752] = "Утихшая буря",
[3783] = "Потерявшиеся Львы",
[3784] = "Починка клетки",
[3787] = "Месть угнетенных",
[3788] = "Месть за Дом Дрес",
[3789] = "Настоящая классика",
[3791] = "Внешнее вмешательство",
[3794] = "Милость богов",
[3795] = "Глубокое беспокойство",
[3796] = "Нечего терять",
[3797] = "Разносчик чумы",
[3799] = "Чешуя возмездия",
[3802] = "Что случилось в Мрачноводье",
[3804] = "Пропавшие на болоте",
[3806] = "Подкоп",
[3809] = "Культурный обмен",
[3810] = "Мотив для ереси",
[3815] = "Взгляд под скорлупу",
[3817] = "Печать Трех",
[3818] = "Святой по частям",
[3819] = "Исцеляющие сердца",
[3820] = "Неупокоенные духи",
[3822] = "Раскол",
[3824] = "Последнее напоминание",
[3826] = "Вверх по Шпилю",
[3827] = "Судьба древохранителя",
[3828] = "Хладнокровная месть",
[3831] = "Правосудие Велота",
[3837] = "Открытие портала",
[3838] = "Раны на теле мира",
[3840] = "Спасение реликвий",
[3841] = "Тайна Разака",
[3845] = "От тюрьмы не зарекайся",
[3846] = "Ключевой камень",
[3847] = "Те, кто остался позади",
[3849] = "Долгожданное освобождение",
[3850] = "Агент Ковенанта",
[3852] = "Спасение и возмездие",
[3854] = "Страсть гоблина",
[3855] = "Тайна Отрениса",
[3856] = "Якоря из Гавани",
[3858] = "Опасное прошлое",
[3860] = "Изысканные слезы",
[3863] = "Захват «Башни»",
[3864] = "Исследователи подземелий",
[3865] = "Твари Стоунфолза",
[3868] = "Окончательная победа над Садалом",
[3874] = "Фантастический свет",
[3880] = "Удар по ордену",
[3885] = "Призматическое ядро",
[3888] = "Захоронения прошлого",
[3889] = "Клыки Ситиса",
[3890] = "Последний клык",
[3893] = "Только по приглашениям",
[3898] = "Расследование произошедшего",
[3900] = "Вглубь Трясины",
[3902] = "Обещание сына",
[3903] = "Внеклассные занятия",
[3904] = "Сбор медикаментов",
[3905] = "Ясность",
[3908] = "Навстречу видениям",
[3909] = "Алхимик из Доминиона",
[3910] = "Сон Хиста",
[3911] = "Объятия болот",
[3912] = "Конец бдения",
[3914] = "Пропавший сын",
[3915] = "Указ двора",
[3916] = "Давно утерянные знания",
[3917] = "В просвещении нужна изюминка",
[3918] = "Цирк Задорной резни",
[3919] = "Под камнем",
[3920] = "Из-под земли",
[3921] = "Оставшиеся шахтеры",
[3923] = "Защитник фермеров",
[3924] = "Песнь пробуждения",
[3925] = "Охрана знаний",
[3927] = "По его следам",
[3928] = "Опасный союз",
[3953] = "Шато Голодных грызунов",
[3955] = "Отслеживание чумы",
[3956] = "Весть для Морнхолда",
[3957] = "Подарок Червя",
[3958] = "Чума Ллодос",
[3959] = "Дым на горизонте",
[3961] = "Поднять флаг",
[3963] = "Вернувшийся",
[3964] = "Тайны Забытого города",
[3966] = "Преследование магистра",
[3968] = "Сквозь завесу",
[3970] = "Неудавшаяся авантюра",
[3973] = "Воля совета",
[3974] = "Штурм зала",
[3977] = "В Вернимский лес",
[3978] = "Гробница под горой",
[3980] = "Объект исследования",
[3981] = "В Таренграв",
[3982] = "Связь с болотом",
[3985] = "Выслеживая дичь",
[3986] = "Под ногами",
[3987] = "Каприз Хоззина",
[3988] = "Опасные сети",
[3990] = "Начало на Бликроке",
[3991] = "Побег с Бликрока",
[3992] = "Что выжидает внизу",
[3993] = "Короли грота",
[3995] = "Замерзший Человек",
[3996] = "В морозном краю",
[3997] = "Сделка Безумного бога",
[3999] = "Потерявшиеся на Бликроке",
[4002] = "Зажигая пламя",
[4016] = "Заблудшие Бликрока",
[4018] = "Большие проблемы",
[4022] = "Соль земли",
[4023] = "А если по морю?",
[4024] = "В поисках родни",
[4026] = "Зерен в опасности",
[4028] = "Разрезая волну",
[4030] = "Святилище порчи",
[4034] = "Друг по меду",
[4037] = "Месть брата",
[4038] = "Нетрадиционная тактика",
[4041] = "Перекресток",
[4043] = "Сборщик шкур",
[4048] = "The Direct Approach",
[4051] = "Предупреждение Дозора Давона",
[4052] = "Death to the Crone",
[4054] = "Смертоносный шепот",
[4055] = "Лекарство для Дроя",
[4056] = "Во славу Кин",
[4058] = "Тени над Виндхельмом",
[4059] = "Конунлейкар",
[4060] = "Чемпион Виндхельма",
[4061] = "Один победитель, один король",
[4062] = "Исподтишка",
[4065] = "An Evil Presence",
[4066] = "Bear Essentials",
[4067] = "Бард гончих",
[4068] = "Mementos",
[4069] = "Возмещение ущерба",
[4070] = "Обеспечение безопасности",
[4071] = "Сон для мертвых",
[4072] = "Rock Bone Diplomacy",
[4073] = "Украденное знамя",
[4074] = "For a Friend",
[4075] = "Право на жизнь",
[4078] = "Совет танов",
[4079] = "Essence of Flame",
[4080] = "Пора собирать урожай",
[4081] = "Серебряные чешуйки",
[4085] = "Вечная история",
[4086] = "Необычные союзники",
[4087] = "Украдкой на вершину",
[4088] = "Нам не по пути",
[4089] = "The Hound's Men",
[4091] = "Fulfilling One's Fate",
[4092] = "Back to Rest",
[4095] = "Осада Седловины",
[4096] = "Веселье и тайна",
[4099] = "Предсмертное желание",
[4101] = "Payment In Kind",
[4103] = "З'ен и Малох",
[4104] = "В поисках Кирет Ванос",
[4105] = "Потрясающий план Кирет",
[4106] = "Лучшее из двух зол",
[4107] = "Изгнание изгнанника",
[4108] = "История Зеленой леди",
[4111] = "Шоу должно продолжаться",
[4112] = "Поднять занавес",
[4115] = "Вечный сон",
[4116] = "Снег и пламя",
[4117] = "Песни Совнгарда",
[4118] = "Темные деяния",
[4119] = "Вызов шторма",
[4123] = "Боги, храните короля",
[4124] = "Пленник Джатсогура",
[4126] = "Трудовой конфликт",
[4128] = "Таинственный металл",
[4129] = "Потерпевшие кораблекрушение моряки",
[4130] = "Честь капитана",
[4131] = "Суда маормеров",
[4133] = "Урожай душ",
[4134] = "Something Rotten",
[4135] = "Опасности глубин",
[4137] = "For Everything a Season",
[4138] = "Алхимический анализ",
[4139] = "Разбитые надежды",
[4140] = "Павшие солдаты",
[4141] = "Убить гонца",
[4142] = "Пробуждение",
[4143] = "Восстановление Сильвенара",
[4144] = "The Misfortunate Minstrels",
[4145] = "Моя шахта — моя крепость",
[4146] = "Разделенная семья",
[4147] = "Скованный страж",
[4149] = "Организация гуляний",
[4150] = "Сон на работе",
[4151] = "Горькая пилюля",
[4152] = "Из болот в сугробы",
[4153] = "Спрятанное оружие",
[4155] = "Arithiel",
[4156] = "Ловушка для души",
[4158] = "Гордость принца",
[4160] = "Приближающийся гром",
[4161] = "A Novel Idea",
[4163] = "Вперед, в Шедоуфен",
[4164] = "Великан в пиках Морозной Дымки",
[4165] = "Темная ночь души",
[4166] = "Военный совет",
[4167] = "Деловое предложение",
[4169] = "Советы и короли",
[4171] = "Повышение мудрой Свари",
[4173] = "Раскаты грома",
[4174] = "Разведка шахты",
[4176] = "Конец ковена",
[4177] = "Победа в Морвунскаре",
[4178] = "Пропавшие соратники",
[4184] = "К пещерам Сосновый Пик",
[4185] = "К башне Хонрик",
[4186] = "Обеспечение прохода",
[4188] = "Падение Синмура",
[4189] = "Имена павших",
[4193] = "House and Home",
[4194] = "One Fell Swoop",
[4195] = "The Unkindest Cut",
[4196] = "Враг моего врага",
[4197] = "Звуки тревоги",
[4199] = "Запутанная сеть",
[4201] = "Прогулка над облаками",
[4202] = "Силы природы",
[4203] = "Дорога жизни",
[4204] = "Банный день",
[4205] = "Наш бедный город",
[4206] = "Гармония природы",
[4208] = "Спасение Силсейлена",
[4209] = "Конец Телдура",
[4210] = "Настоящие морские пехотинцы",
[4211] = "В Танзелвил",
[4212] = "Разделенные",
[4217] = "Именем королевы",
[4218] = "Лучший из лучших",
[4219] = "Маяк змея",
[4220] = "Маллари-Мора",
[4221] = "Доброе дело",
[4222] = "Ритуалы королевы",
[4223] = "Камни осквернения",
[4224] = "Мерзости",
[4225] = "В Нималтен",
[4226] = "Смерть Черным Кинжалам!",
[4228] = "Claw of Akatosh",
[4229] = "Sacred Prey, Hunt Profane",
[4237] = "Душа вечеринки",
[4238] = "Просроченные припасы",
[4242] = "Лич",
[4244] = "Припасы Черных Кинжалов",
[4246] = "Обман во тьме",
[4247] = "Guard Work is Never Done",
[4248] = "Хранитель Гейрмунда",
[4249] = "Испытание Тела",
[4250] = "Испытание Разума",
[4251] = "Испытание Духа",
[4252] = "Береги голос",
[4253] = "Клятва Гейрмунда",
[4254] = "Те, кого она пожирает",
[4255] = "Обеспечение безопасности",
[4256] = "Опасная ситуация",
[4257] = "Пропавшие члены команды",
[4259] = "Иностранный винтаж",
[4260] = "Уничтожение барьера",
[4261] = "Сожжение всех мостов",
[4263] = "Огненное поле",
[4264] = "Чума в Фаэре",
[4265] = "Ложь обходится дорого",
[4266] = "Первый пациент",
[4267] = "Все по-честному",
[4270] = "The Cache",
[4272] = "Глубины безумия",
[4273] = "К королю",
[4276] = "Устраняющий проблемы",
[4277] = "Безмолвная деревня",
[4278] = "Пробуждение деревни",
[4283] = "Река имен",
[4285] = "Отцовское обещание",
[4286] = "Пещеры Сосновый Пик",
[4287] = "Ритуал на драконьем святилище",
[4288] = "Blind Man's Bluff",
[4289] = "Кровь на земле",
[4291] = "Летняя стоянка",
[4292] = "Ритуал в пиках Морозной Дымки",
[4293] = "Складывание мозаики",
[4294] = "Раскрытие",
[4295] = "Своевольный даггерфолец",
[4296] = "Душелишенный в Хладной Гавани",
[4300] = "Благословения Восьми",
[4301] = "Спасение реликвий",
[4302] = "Призывательница из культа Червя",
[4303] = "Разгоняя тени",
[4304] = "Редгард в бегах",
[4306] = "Поиск молота Зимы",
[4307] = "Возвращение Укуса зимы",
[4309] = "Глаз-шпион",
[4311] = "Ритуал в Рваных холмах",
[4316] = "На слабо",
[4317] = "Где растет морозное сердце",
[4318] = "На ту сторону",
[4320] = "Лютые твари Айварстеда",
[4321] = "Проблемы в прибыль",
[4322] = "Пропавшая корона",
[4326] = "Скрытый выбор",
[4327] = "Предупредительная мера",
[4329] = "Жестокий урок",
[4330] = "Поднятие завесы",
[4331] = "Под завесу",
[4332] = "Дилемма пленников",
[4333] = "Отвлекающий маневр",
[4335] = "Гордость Львиной гвардии",
[4336] = "Древние Останки",
[4337] = "Buyer Beware",
[4338] = "Глаз древних",
[4339] = "Если бы мертвые могли говорить",
[4340] = "Белая маска Мерьена",
[4341] = "Уничтожить источник",
[4344] = "Мотыльки летят на огонек",
[4345] = "Падение завесы",
[4346] = "Покой благородных",
[4347] = "Особая смесь",
[4348] = "Кладбище кораблей",
[4351] = "Сквозь даэдрические линзы",
[4352] = "Сумеречная библиотека",
[4354] = "Бесконечная война",
[4355] = "Сквозь пепел",
[4357] = "В Фестхолд",
[4358] = "Между кровью и костями",
[4361] = "Законное наследство",
[4362] = "Шутка шута",
[4364] = "Заноза в боку",
[4365] = "В Данбрейк",
[4366] = "В Матисен",
[4368] = "В Скайвотч",
[4369] = "Воля Червя",
[4370] = "Сделка с тенями",
[4371] = "Мудрость веков",
[4372] = "Гоблин Марк",
[4373] = "Экспортные дела",
[4374] = "Старые кости",
[4378] = "Военно-морская разведка",
[4379] = "Мучения возлюбленной",
[4380] = "Прошлой ночью",
[4381] = "Сборка сферы",
[4382] = "Момент истины",
[4385] = "Поглощенные наукой",
[4386] = "Суть вопроса",
[4387] = "Запретная любовь",
[4388] = "Жизнь с привилегиями",
[4390] = "Упущенное богатство",
[4391] = "Охота на молнию",
[4392] = "Правда, ложь и пленники",
[4395] = "Враг у ворот",
[4396] = "Опасная гавань",
[4397] = "Враг внутри",
[4398] = "A Chief Concern",
[4399] = "Чем дальше в лес...",
[4401] = "Планы нападения на маяк",
[4403] = "Пленные члены экипажа",
[4404] = "Потерянные сокровища",
[4405] = "Небольшая подработка",
[4406] = "Forgotten Soul",
[4408] = "Унесенные призраками",
[4409] = "Участников бегов",
[4410] = "Помощь для помощницы",
[4411] = "Завершающие удары",
[4417] = "Bloodied Waters",
[4420] = "Keepsake",
[4421] = "Thorns in Our Side",
[4422] = "Spice",
[4424] = "A Debt Come Due",
[4425] = "Пленники войны",
[4426] = "Увеличивая шансы",
[4430] = "Сгоревшее поместье",
[4431] = "Подземные тайны",
[4432] = "Кровь и песок",
[4433] = "Сокровище айлейдов",
[4434] = "For Piety's Sake",
[4435] = "Попросту не там, где нужно",
[4436] = "Удача «Альбатроса»",
[4440] = "Baan Dar's Boast",
[4441] = "Затея зубодробителей",
[4443] = "В замок Алькаир",
[4445] = "Связанные навечно",
[4446] = "Помощь Сигуну",
[4447] = "Ингрел Кровавый",
[4448] = "Прощание Калодара",
[4449] = "Гибель Карзога",
[4450] = "Хорошо вооруженные дикари",
[4452] = "Что посеешь, то и пожнешь",
[4453] = "Ответная услуга",
[4454] = "Невинный пройдоха",
[4455] = "Торговые переговоры",
[4456] = "The Hound's Plan",
[4457] = "Ящик загадок",
[4458] = "Друблог из Дра'була",
[4459] = "Подземелья Морнхолда",
[4460] = "Мрачная обстановка",
[4461] = "Мрачно и еще мрачнее",
[4462] = "The Dead King",
[4463] = "Меретическая коллекция",
[4464] = "Nature's Best Friend",
[4466] = "Сломанное острие",
[4468] = "Поднятое из могилы прошлое",
[4469] = "Огни битвы",
[4471] = "Сокровище Изада",
[4472] = "Крыса в ловушке",
[4473] = "Месть Раме",
[4474] = "Дочь великанов",
[4475] = "Shock to the System",
[4476] = "Кончик острия",
[4477] = "A Wedding to Attend",
[4478] = "В Холмы",
[4479] = "Motes in the Moonlight",
[4480] = "Клятва вырезания",
[4481] = "Проблемы маленького городка",
[4482] = "Проблемы с крысами",
[4483] = "Ezzag's Bandits",
[4484] = "Haunting of Kalari",
[4485] = "Loose Ends",
[4486] = "Вниз по злокрысьей норе",
[4487] = "The Arbordawn Cult",
[4488] = "Деликатный садовник",
[4492] = "Desecrated Ground",
[4493] = "Предупреждение",
[4494] = "Не разбив яйца...",
[4495] = "Услуга для мертвеца",
[4497] = "Пропавшая дочь",
[4499] = "Удар Баан Дара",
[4500] = "Норд в беде",
[4501] = "Огненные врата",
[4503] = "Братья и бандиты",
[4505] = "Семена надежды",
[4506] = "Свергнуть короля",
[4507] = "Подношение Зенитару",
[4508] = "Выброшенный на берег",
[4509] = "Время урожая",
[4510] = "Капитан «Острия»",
[4511] = "Браслет мертвеца",
[4512] = "The Dead of Culotte",
[4514] = "Команда «Острия»",
[4515] = "The Ties that Bind",
[4516] = "Украденный прах",
[4517] = "Crown Point",
[4519] = "Весть от мертвеца",
[4520] = "Bloody Hand Spies!",
[4522] = "Поместье Хедоран",
[4523] = "Заговор Кровавых шипов",
[4524] = "Покаяние сына",
[4525] = "Страдающие души",
[4526] = "Проигранное пари",
[4527] = "Забота о знаниях",
[4528] = "Наряды от Одея",
[4529] = "Припасы Красных Грачей",
[4530] = "Goblin's Delight",
[4531] = "На волоске от смерти",
[4532] = "Отведи меня домой",
[4533] = "Не было бы счастья, да несчастье помогло",
[4535] = "Лезвие кинжала",
[4536] = "Золотой коготь",
[4537] = "An Offering",
[4538] = "Око бури",
[4540] = "Timberscar Troubles",
[4541] = "Выжившие души",
[4543] = "Прорехи в мире",
[4544] = "Темный Грива",
[4546] = "Retaking the Pass",
[4547] = "Докажи свою доблесть",
[4548] = "Предвидение",
[4549] = "Возвращение в Скайвотч",
[4550] = "Огни Дюны",
[4551] = "Отравленное сердце",
[4552] = "Chasing Shadows",
[4552] = "В погоне за тенями",
[4553] = "Тройная глупость",
[4554] = "Шедоуфенский пир",
[4555] = "Кровное родство",
[4556] = "Отцовская сила",
[4557] = "Воля сломленного",
[4558] = "Дать бой врагу",
[4559] = "Дочь Морской скалы",
[4560] = "Несметные богатства",
[4561] = "Dangerously Low",
[4563] = "Шляпки Замкового Камня",
[4564] = "Потерявшиеся и одинокие",
[4565] = "Делай, как я говорю!",
[4566] = "В Гленумбру",
[4568] = "Стоячие камни",
[4569] = "Enemy Reinforcements",
[4570] = "Know thy Enemy",
[4571] = "Fang Collector",
[4572] = "Просьбы о помощи",
[4573] = "Frighten the Fearsome",
[4574] = "Veil of Illusion",
[4575] = "Затопленная роща",
[4578] = "На краю",
[4579] = "Bring Down the Magister",
[4580] = "Double Jeopardy",
[4581] = "Невидимое",
[4583] = "Дорогие кузены",
[4584] = "Украденная урна",
[4585] = "Семейные заботы",
[4586] = "Ведьма из Силатара",
[4587] = "По следам похитителей облика",
[4588] = "Земельный спор",
[4589] = "Дезертировать с корабля",
[4590] = "Логово похитителей облика",
[4591] = "Timely Intervention",
[4593] = "Audience with the Wilderking",
[4596] = "Handmade Guardian",
[4597] = "План",
[4598] = "Into the Vice Den",
[4599] = "На пороге",
[4601] = "Право на воровство",
[4602] = "Свет из тьмы",
[4605] = "Пустынный город",
[4606] = "Хранители скорлупы",
[4607] = "Замок Червя",
[4608] = "Погибель босмеров",
[4610] = "Войско Меридии",
[4611] = "Mist and Shadow",
[4615] = "Lost in the Mist",
[4620] = "Потерпевшие крушение",
[4621] = "Высвобожденная буря",
[4622] = "Поиски окончены",
[4623] = "Две души в одном маге",
[4624] = "Дипломатические риски",
[4625] = "Слезы Двух Лун",
[4626] = "Освобождение Вануса",
[4628] = "Припасы для Эпплвотча",
[4629] = "Secrets Revealed",
[4630] = "Regret",
[4631] = "Просроченный долг",
[4632] = "Специальная доставка",
[4635] = "Heirloom",
[4636] = "Moonhenge's Tear",
[4637] = "The Message",
[4638] = "Настоящий змей",
[4639] = "Лучше поздно, чем никогда",
[4640] = "Пески Сентинеля",
[4641] = "Что было утрачено",
[4642] = "Зал Правосудия",
[4646] = "Мнемоническое яйцо",
[4647] = "A Foot in the Door",
[4648] = "The Summoner Division",
[4649] = "The Sorcerer Division",
[4650] = "The Swordmaster Division",
[4651] = "The Champion Division",
[4652] = "Коловианская оккупация",
[4653] = "Козни Каменного огня",
[4654] = "Необычные обстоятельства",
[4655] = "Падение Хадрана",
[4656] = "Тропа Тарайи",
[4657] = "Рассказ прядильщика",
[4658] = "Misplaced Knowledge",
[4659] = "Благосклонность леди Лоран",
[4660] = "Зло, что ты знаешь",
[4662] = "Articles of Faith",
[4663] = "На прогулку",
[4664] = "Лекарство из лунного сахара",
[4665] = "Судьба Эзребы",
[4666] = "Серебряная флейта",
[4667] = "Темное знание",
[4668] = "Гонки ящериц",
[4669] = "Spikeball",
[4670] = "Troll Arena",
[4671] = "Дальние родственники",
[4672] = "Проклятие Морвы",
[4673] = "Корень проблемы",
[4674] = "Spoils of War",
[4675] = "Всепоглощающая тьма",
[4676] = "An Affront to Mara",
[4678] = "Улов дня",
[4679] = "Объятия тени",
[4680] = "Шторм на горизонте",
[4681] = "The Serpent Lord",
[4682] = "The Doctor's Bag",
[4683] = "Лекарственные травы",
[4684] = "Поздравления!",
[4686] = "Посвящение",
[4687] = "A Traitor's Luck",
[4689] = "Дверь в лунный свет",
[4690] = "Striking at the Heart",
[4691] = "Cause and Effect",
[4692] = "Щепотка сахара",
[4693] = "Семейное дело",
[4694] = "Весточка с трона",
[4695] = "Домой",
[4696] = "The High Cost of Travel",
[4697] = "В Рол'ху",
[4699] = "Увядающее дерево",
[4701] = "Перейти через Провал",
[4704] = "Добро пожаловать в Сиродил",
[4705] = "Осадная война",
[4706] = "Начало службы",
[4707] = "Best Left Unknown",
[4709] = "Дорога к Лунному холму",
[4710] = "Благословленного в Арентию",
[4711] = "В Дюну",
[4712] = "Первый шаг",
[4714] = "The Changing Kind",
[4715] = "Сердце Урожая",
[4716] = "The Shurgak Job",
[4717] = "Prisoners of the Sphinx",
[4719] = "The Moonlit Path",
[4720] = "Логово Лорхаджа",
[4721] = "Дань уважения обесчещенным",
[4722] = "Добро пожаловать в Сиродил",
[4723] = "Осадная война",
[4724] = "Начало службы",
[4725] = "Добро пожаловать в Сиродил",
[4726] = "Осадная война",
[4727] = "Начало службы",
[4730] = "Сломать Скрепу",
[4731] = "Враждебное ополчение",
[4732] = "Память о павших",
[4733] = "Полученные знания",
[4735] = "Посох Магнуса",
[4737] = "Бродячий мечтатель",
[4738] = "Песня прядильщика",
[4739] = "Шторм у берегов",
[4740] = "Сомнительный контракт",
[4743] = "Потерянная лютня",
[4744] = "Before the Storm",
[4746] = "Потерянная подвеска",
[4747] = "Камень страданий",
[4748] = "Спасение Стиббонса",
[4749] = "Как осталась горстка",
[4750] = "Трон Дикого короля",
[4751] = "Чертежи военных кораблей",
[4754] = "Мастер Клинка Леки",
[4757] = "Сердцу не прикажешь",
[4758] = "Последний штурм",
[4759] = "Благословленного в Рол'ху",
[4760] = "Чья свадьба?",
[4761] = "Беда в Благословении Тавы",
[4764] = "Тарн говорит",
[4765] = "Pelidil's End",
[4766] = "Оковы свободы",
[4767] = "Один из Неустрашимых",
[4768] = "Шрамы никогда не зарастут",
[4770] = "Forthor's Cursed Axe",
[4771] = "Beasts of Falinesti",
[4773] = "Собиратель костей",
[4774] = "Цитадель должна пасть",
[4775] = "A Night to Forget",
[4777] = "The List",
[4778] = "Острие Бритвы",
[4779] = "The Amronal of Valenwood",
[4780] = "Сообщения через весь Тамриэль",
[4783] = "Вес трех корон",
[4784] = "Быстрое правосудие",
[4785] = "Сенчи",
[4786] = "Дочь трактирщика",
[4787] = "Mourning the Lost",
[4788] = "The Falinesti Faithful",
[4790] = "Breaking the Ward",
[4791] = "Ремесленник",
[4792] = "Запутанный узел",
[4793] = "Долг Мантира",
[4794] = "In the Belly of the Sea Hawk",
[4795] = "Чешуйчатые захватчики",
[4798] = "Eye on Arenthia",
[4799] = "To Saifa in Rawl'kha",
[4802] = "К Лунному холму",
[4808] = "Испытание веры",
[4809] = "Вино из корня Нирна",
[4812] = "Песнь истории",
[4813] = "Второго шанса не будет",
[4814] = "Вести о погибшей родне",
[4815] = "Заступник Пакта",
[4817] = "По следам Руки",
[4818] = "На Ауридон",
[4821] = "Доклад в Марбрук",
[4822] = "Дух безумия",
[4824] = "Проказники",
[4826] = "Охота на мамонта",
[4827] = "Охота на тролля",
[4828] = "Охота на осу",
[4831] = "Убежище",
[4832] = "Совет Пяти соратников",
[4833] = "Bosmer Insight",
[4834] = "Память о прошлом",
[4836] = "Залы мучений",
[4837] = "Долина клинков",
[4839] = "Утраченная любовь",
[4840] = "Древнее могущество",
[4841] = "Неприятности ловцов дождя",
[4842] = "The Unquiet Dead",
[4843] = "Рассказ предателя",
[4844] = "Цена долголетия",
[4846] = "Злоупотребление знанием",
[4847] = "Бог интриг",
[4848] = "Deadly Ambition",
[4849] = "Невыполненный приказ",
[4850] = "Shades of Green",
[4852] = "Гордость и слава",
[4853] = "Вудхарт",
[4854] = "Глаза Азуры",
[4857] = "Таинственная завеса",
[4858] = "Утраченная надежда",
[4863] = "Лакомство для тролля",
[4864] = "Любезность между королями",
[4867] = "Тень Санкр Тора",
[4868] = "В объятиях безумия",
[4869] = "Bounty: Black Daggers",
[4870] = "Bounty: Gray Vipers",
[4871] = "Bounty: Shadowed Path",
[4872] = "Bounty: Goblins",
[4873] = "Bounty: Black Daggers",
[4874] = "Bounty: Gray Vipers",
[4875] = "Bounty: Shadowed Path",
[4876] = "Bounty: Goblins",
[4877] = "Bounty: Black Daggers",
[4878] = "Bounty: Gray Vipers",
[4879] = "Bounty: Shadowed Path",
[4880] = "Bounty: Goblins",
[4881] = "Воля леса",
[4882] = "Странствующий менестрель",
[4884] = "Темный осколок",
[4885] = "Долгая зима",
[4887] = "Обратить время вспять",
[4888] = "Изумрудная чаша",
[4891] = "Переговоры",
[4893] = "Flipping the Coin",
[4894] = "Письмо в Дешаан",
[4895] = "Phantom Guilt",
[4896] = "Великое Древо",
[4898] = "Восстание в Дыхании Онси",
[4899] = "Важнее чувства долга",
[4900] = "Мародеры на Переправе",
[4901] = "Дорога в Ривенспайр",
[4902] = "Раздробленный Шорнхельм",
[4903] = "Вхождение во тьму",
[4908] = "Импорт редкостей",
[4911] = "Подарок на память",
[4912] = "Штурм гарнизона",
[4914] = "The Wakening Dark",
[4915] = "Кровавая охота",
[4916] = "Пропавший гуар",
[4917] = "Разборка с Черноживицей",
[4918] = "Зыбучие пески судьбы",
[4920] = "Наследство леди",
[4922] = "Обсерватория Элден-Рута",
[4923] = "Древние реликвии",
[4924] = "Босоногий бретонец",
[4925] = "Плач Уренении",
[4926] = "Охота на убийцу",
[4927] = "Список убийцы",
[4928] = "Под угрозой смерти",
[4929] = "Нож в сердце",
[4930] = "Расставание с прошлым",
[4931] = "Напуганный народ",
[4934] = "В западне",
[4936] = "Корона Шорнхельма",
[4937] = "Священный огонь",
[4938] = "Сердце зверя",
[4939] = "Пока смерть не разлучит",
[4942] = "Паучий кокон",
[4943] = "Честь королевы",
[4944] = "Друг троллей",
[4945] = "Шпион в Шорнхельме",
[4946] = "Шелковый наряд",
[4949] = "Услуга для королевы",
[4950] = "Storgh's Bow",
[4951] = "Fit to Rule",
[4952] = "Безвременно усопшие",
[4953] = "Trouble at the Tree",
[4954] = "Свет во тьме",
[4955] = "Счастливый случай",
[4956] = "Последние слова",
[4958] = "Нортпойнт в опасности",
[4959] = "Испытания и беды",
[4960] = "Вперед, на Дальние Берега",
[4961] = "Дар Хирсина",
[4963] = "Проход запрещен",
[4964] = "Отпрыск Кровавой Матроны",
[4965] = "Дети Йокуды",
[4966] = "Разыскивается: Сголаг",
[4968] = "Забота о квама",
[4969] = "Слияние в руинах",
[4970] = "Помочь врагу",
[4971] = "Дар архимага",
[4972] = "Освобождение Нортпойнта",
[4974] = "Brackenleaf's Briars",
[4975] = "The Wounded Wood",
[4976] = "Карнавал: организационные тяготы",
[4977] = "Старинные камни, старинные слова",
[4978] = "Ответный удар",
[4979] = "Опубликуй или умри",
[4980] = "Серьезное дело",
[4981] = "Противоречивые чувства",
[4982] = "Мы живем в страхе",
[4984] = "Выгодная схема",
[4986] = "Знаковый трофей",
[4988] = "Встреча у прохода",
[4989] = "Горстка украденных надежд",
[4991] = "Темные крылья",
[4992] = "Поиски ищущих",
[4997] = "Один из Неустрашимых",
[4998] = "Серебро Кадвела",
[5000] = "Золото Кадвела",
[5005] = "Пить, пить и веселиться",
[5006] = "В бухту Велин",
[5007] = "Курган Погребальный Огонь",
[5008] = "Алмаз в корнях",
[5011] = "Под землей",
[5012] = "Проржавевшие кинжалы",
[5014] = "Грехи прошлого",
[5018] = "Правосудие Павшего",
[5020] = "Своенравный сын",
[5021] = "Влюбленный",
[5022] = "Разбойница",
[5024] = "Загадка прохода",
[5025] = "Оскверненный камень",
[5027] = "Перемены в судьбе",
[5033] = "Звездочеты",
[5034] = "Замогильная ситуация",
[5035] = "Вызов Хакры",
[5036] = "Башня Хонрик",
[5037] = "Против течения",
[5038] = "Правда о пауках",
[5039] = "Зелья Темной долины",
[5040] = "Меры предосторожности",
[5043] = "Высший приоритет",
[5044] = "На гору",
[5045] = "Судьба друга",
[5050] = "В ожидании известий",
[5051] = "Оставшиеся в живых",
[5052] = "Подношение Азуре",
[5055] = "Послание королеве",
[5057] = "Вредное лекарство",
[5058] = "Весь этот переполох",
[5063] = "Холод от камней",
[5067] = "Закрытая формула",
[5068] = "Поиск лекарства",
[5069] = "Зов Воина",
[5071] = "Приглашение Куринура",
[5072] = "Aid for Bramblebreach",
[5073] = "Приглашение Айсессара",
[5074] = "Приглашение Рудрасы",
[5075] = "Приглашение Хилена",
[5076] = "Приглашение Немарк",
[5077] = "Приглашение Базиля",
[5079] = "Архив искателя",
[5080] = "Цветок юности",
[5081] = "Павший город Шады",
[5085] = "Испытания Рахни'За",
[5087] = "Assaulting the Citadel",
[5088] = "Возвращение Неймона",
[5091] = "Hallowed To Grimwatch",
[5092] = "The Champions at Rawl'kha",
[5093] = "Луны над Гримвотчем",
[5102] = "Башня мага",
[5103] = "Проблемы рынка Морнхолда",
[5104] = "Обломки Вутрад",
[5106] = "Испорченная вода",
[5107] = "Высшая сила",
[5108] = "Критическая масса",
[5110] = "Gem of the Stars",
[5111] = "Strange Lexicon",
[5112] = "Message Unknown",
[5113] = "На краю тьмы",
[5115] = "Пропавший хранитель",
[5116] = "Стихийная армия",
[5118] = "Причина, по которой мы сражаемся",
[5120] = "Назад к пеплу",
[5130] = "Разбитые и потерянные",
[5136] = "Summary Execution",
[5151] = "Настоящие клыки",
[5171] = "The Oldest Ghost",
[5174] = "Живые пленники",
[5175] = "Железо и чешуя",
[5186] = "Кровь Нирна",
[5194] = "Скользкий выводок",
[5203] = "The Serpent's Fang",
[5220] = "Ликвидация вражеских храмовников",
[5226] = "Ликвидация вражеских рыцарей-драконов",
[5229] = "Ликвидация вражеских клинков ночи",
[5236] = "Souls of the Betrayed",
[5239] = "Dawn of the Exalted Viper",
[5240] = "Uncaged",
[5244] = "Banished Cells Pledge",
[5245] = "Holding Court",
[5246] = "Veteran Banished Cells Pledge",
[5247] = "Fungal Grotto Pledge",
[5248] = "Veteran Fungal Grotto Pledge",
[5249] = "Сертификация кузнеца",
[5258] = "Потерянный во времени воин",
[5259] = "Сертификация в ремесле",
[5260] = "Spindleclutch Pledge",
[5273] = "Veteran Spindleclutch Pledge",
[5274] = "Darkshade Caverns Pledge",
[5275] = "Veteran Darkshade Pledge",
[5276] = "Elden Hollow Pledge",
[5277] = "Veteran Elden Hollow Pledge",
[5278] = "Wayrest Sewers Pledge",
[5282] = "Veteran Wayrest Sewers Pledge",
[5283] = "Crypt of Hearts Pledge",
[5284] = "Veteran Crypt of Hearts Pledge",
[5288] = "Arx Corinium Pledge",
[5289] = "Сертификация снабженца",
[5290] = "City of Ash Pledge",
[5291] = "Direfrost Keep Pledge",
[5301] = "Tempest Island Pledge",
[5302] = "Сертификация столяра",
[5303] = "Volenfell Pledge",
[5305] = "Blackheart Haven Pledge",
[5306] = "Blessed Crucible Pledge",
[5307] = "Selene's Web Pledge",
[5309] = "Vaults of Madness Pledge",
[5310] = "Сертификация портного",
[5312] = "Взятие обета Неустрашимых",
[5313] = "Серый проход",
[5314] = "Сертификация зачарователя",
[5315] = "Сертификация алхимика",
[5316] = "An Unexpected Fall",
[5317] = "Нарушенные обещания",
[5318] = "Тайная жатва",
[5319] = "Проклятие Птичьей Песни",
[5320] = "Свисток дурзогов",
[5321] = "Латунное сердце",
[5326] = "Загадка каменоломни",
[5328] = "Hidden History",
[5329] = "For King and Glory",
[5335] = "Луч солнца среди туч",
[5337] = "Вопрос о престолонаследии",
[5340] = "Blood and the Sacred Words",
[5342] = "Обратное Слияние миров",
[5348] = "Спасение вождя",
[5349] = "Уловка короля",
[5352] = "Прямо в пасть",
[5368] = "Заказ кузнецу",
[5374] = "Заказ портному",
[5381] = "Veteran City of Ash Pledge",
[5382] = "Imperial City Prison Pledge",
[5394] = "Заказ столяру",
[5400] = "Заказ зачарователю",
[5409] = "Заказ снабженцу",
[5415] = "Заказ алхимику",
[5416] = "Заказ алхимику",
[5431] = "White-Gold Tower Pledge",
[5439] = "Проблемы с драуграми",
[5441] = "Рука Моркул",
[5442] = "Культурная привязанность",
[5443] = "Thukhozod the Eternal",
[5444] = "Поцелуй Скорби",
[5445] = "Бездомное сокровище",
[5446] = "Пределы лояльности",
[5447] = "Большие королевские заботы ",
[5448] = "Вихревая арена",
[5449] = "Месть рикра",
[5450] = "Приглашение в Орсиниум",
[5452] = "Каирн Кограка",
[5453] = "Сказание каджита",
[5454] = "Родственные души",
[5458] = "Во имя короля",
[5462] = "Прах наших отцов",
[5464] = "Принуждение к вере",
[5466] = "Tinker Trouble",
[5468] = "Королевский гнев",
[5469] = "Цена крови",
[5470] = "Здоровый выбор",
[5471] = "Гуще, чем вода",
[5472] = "Этот пир запомнится",
[5474] = "Противная рожа",
[5476] = "Пробуждение прошлого",
[5479] = "Холодный ветер с гор",
[5481] = "Кровь на руках короля",
[5484] = "Дорого как память",
[5485] = "Those Truly Favored",
[5494] = "Да здравствует король!",
[5497] = "Нетипичное искусство",
[5499] = "Вдребезги",
[5504] = "Торговля кожей",
[5505] = "Пожар во владении",
[5506] = "Разведка в Мемориальном районе",
[5507] = "Завтрак чудака",
[5508] = "Разведка в Дендрарии",
[5509] = "Части целого",
[5510] = "Разведка в районе Арены",
[5511] = "Разведка в Эльфийских садах",
[5512] = "Разведка в районе Знати",
[5513] = "Разведка в Храмовом районе",
[5514] = "До отвала",
[5515] = "Свободные духи",
[5518] = "Мясо в массы",
[5519] = "Спасение во имя знаний",
[5520] = "Пламя кузницы и падшие",
[5521] = "Щедрость природы",
[5522] = "Ересь невежества",
[5523] = "Снег и пар",
[5524] = "Запах нечестной игры",
[5529] = "Таинство: пещера торговцев",
[5531] = "Соучастники преступления",
[5532] = "Долгая игра",
[5534] = "Уборка дома",
[5535] = "Двойная жизнь",
[5536] = "Ограбление: залы Мертвой лощины",
[5537] = "Его величайшее сокровище",
[5538] = "Голоса во тьме",
[5540] = "Подписано кровью",
[5541] = "Благочестивое вмешательство",
[5542] = "Добро пожаловать домой",
[5543] = "Игра в панцири",
[5544] = "Прибыльное предприятие",
[5545] = "Побег из тюрьмы",
[5546] = "Честная работа",
[5547] = "Жертва вампира",
[5548] = "Долги войны",
[5549] = "Или молчите до конца своих дней",
[5552] = "Акульи Зубы",
[5553] = "Тот, кто удрал",
[5554] = "Пасть Темной луны",
[5556] = "Безупречный план",
[5565] = "Постыдный секрет",
[5566] = "Увядший цветок",
[5567] = "Темные откровения",
[5570] = "У каждого есть цена",
[5572] = "Ограбление: укрытие",
[5573] = "Ограбление: подземная усыпальница",
[5575] = "Ограбление: Сверкающий грот",
[5577] = "Ограбление: Потайные коллекторы",
[5581] = "То, что было утрачено",
[5582] = "Мастер грабежа",
[5584] = "The Covetous Countess",
[5586] = "Потерянные жемчужины",
[5587] = "Бухта рабов",
[5588] = "Воспоминания о молодости",
[5589] = "Трубка моряка",
[5595] = "Урок в тишине",
[5596] = "Особый заказ",
[5599] = "Вопросы веры",
[5603] = "Захороненное зло",
[5604] = "Всеобщее благо",
[5605] = "Надвигающиеся тени",
[5606] = "Рев толпы",
[5609] = "Plucking Fingers",
[5630] = "Контракт: Бангкорай",
[5634] = "Литания крови",
[5638] = "Всецело у нас в руках",
[5639] = "Руки без дела",
[5645] = "Серия преступлений",
[5654] = "Контракт: Ауридон",
[5659] = "Контракт: Гратвуд",
[5668] = "Искусство карманника",
[5673] = "Контракт: Гриншейд",
[5685] = "Контракт: Стоунфолз",
[5693] = "Контракт на серию убийств: пустыня Алик'р",
[5708] = "Контракт: Кватч",
[5710] = "Контракт на серию убийств: Стормхейвен",
[5718] = "Таинство: логово контрабандистов",
[5719] = "Таинство: логово контрабандистов",
[5724] = "Таинство: жилая канализация",
[5725] = "Таинство: жилая канализация",
[5726] = "Таинство: жилая канализация",
[5733] = "Старинный арсенал в Бангкорае",
[5734] = "Ловушки для духов в Малабал-Торе",
[5735] = "Обереги предков в Дешаане",
[5737] = "Двемерские реликвии Стоунфолза",
[5738] = "Айлейдские безделушки в Гратвуде",
[5739] = "Грабеж Красных Грачей в Гленумбре",
[5742] = "Сделка с ведьмой-матерью",
[5744] = "Кража талисмана в Марке Смерти",
[5747] = "The Star-Gazers",
[5748] = "The Warrior's Call",
[5751] = "Испытания Рахни'за",
[5755] = "Высшая сила",
[5756] = "Критическая масса",
[5760] = "The Missing Guardian",
[5761] = "Elemental Army",
[5765] = "Taken Alive",
[5766] = "Iron and Scales",
[5768] = "Ползущий выводок",
[5769] = "Клык Змея",
[5770] = "Души преданных",
[5771] = "Пробуждение Величественной Гадюки",
[5772] = "Выпущенные из клеток",
[5774] = "Лист на ветру",
[5776] = "The Time-Lost Warrior",
[5780] = "Обет: Колыбель Теней",
[5784] = "Темные якоря в Стормхейвене",
[5785] = "Темные якоря в Ривенспайре",
[5786] = "Темные якоря в пустыне Алик'р",
[5787] = "Темные якоря в Бангкорае",
[5789] = "Темные якоря в Дешаане",
[5790] = "Темные якоря в Тенетопи",
[5793] = "Темные якоря на Ауридоне",
[5797] = "Темные якоря в Марке Смерти",
[5798] = "Скрытая тьма на Ауридоне",
[5799] = "Наемница дома Телванни",
[5800] = "Проклятые побрякушки Стормхейвена",
[5803] = "Божественная загадка",
[5814] = "Безумие в пустыне Алик'р",
[5816] = "Безумие на Ауридоне",
[5818] = "Безумие в Бангкорае",
[5819] = "Безумие в Дешаане",
[5820] = "Безумие в Истмарке",
[5827] = "Безумие в Ривенспайре",
[5828] = "Безумие в Тенетопи",
[5830] = "Безумие в Стормхейвене",
[5831] = "Безумие в Рифте",
[5832] = "Словно кровь из камня",
[5835] = "Если заклинание подходит",
[5836] = "Связаны любовью",
[5840] = "Возвращение Воса",
[5841] = "Любой ценой",
[5857] = "Последнее пристанище контрабандиста",
[5859] = "Повышение до служителя",
[5862] = "Алый Судья",
[5863] = "Земли с привидениями",
[5864] = "Не кот начхал",
[5865] = "Прополка колонии",
[5866] = "Волам здесь не место",
[5869] = "Друг в беде",
[5872] = "Мелодическая ошибка",
[5876] = "Опасная порода",
[5877] = "Долг стража",
[5880] = "Божественное расследование",
[5881] = "Спрятанный урожай",
[5882] = "Родовые напасти",
[5883] = "Яичный план",
[5885] = "Связь с предками",
[5886] = "Желание сердца",
[5887] = "Бегство от прошлого",
[5888] = "Божественные заблуждения",
[5889] = "Кровь за кровь",
[5891] = "Падение Фолкрита",
[5893] = "Божественное вмешательство",
[5894] = "Создавая будущее",
[5900] = "Отголоски павшего дома",
[5901] = "Возражения и препятствия",
[5902] = "Божественная катастрофа",
[5903] = "Камень памяти",
[5904] = "Проклятье Салотан",
[5905] = "Божественное восстановление",
[5906] = "Песня сирены",
[5911] = "Охота на Пеплоеда",
[5912] = "Охота на Старого Топотуна",
[5913] = "Охота на Острого Клыка",
[5914] = "Ход магистра",
[5915] = "Проблемы племени",
[5916] = "Обеспокоенная ученица",
[5918] = "Алчущий в засаде",
[5919] = "О семье и вере",
[5920] = "Сквозь туман",
[5921] = "Весенний аромат",
[5922] = "Сердце Телванни",
[5923] = "Затерянная библиотека",
[5928] = "Реликвии из Эбернанита",
[5929] = "Реликвии из Душарирана",
[5930] = "Реликвии из Ашалмавии",
[5931] = "Благородный гость",
[5933] = "Важное поручение",
[5934] = "Налоговый вычет",
[5935] = "Недостающее пророчество",
[5936] = "Сладость на радость",
[5937] = "Королевские гулянья",
[5941] = "Праздник шута",
[5948] = "Воссоединение семьи",
[5949] = "Во славу",
[5950] = "Родовые гробницы",
[5952] = "К победе",
[5953] = "Да начнутся игры",
[5954] = "Испытание характера",
[5956] = "Даэдрический срыв",
[5958] = "Беспокойный синдикат",
[5961] = "Подложная истина",
[5962] = "Задачка с квама",
[5964] = "Паутина неприятностей",
[5972] = "Мастерское оружие",
[5973] = "Мастерский глиф",
[5977] = "Мастерский пир",
[5978] = "Мастерское шитье",
[5984] = "Мастерский отвар",
[5990] = "Мастерский отвар",
[6000] = "В Тель-Фир",
[6001] = "Друг в беде",
[6003] = "Божественные благословения",
[6004] = "Задержка поставки",
[6007] = "Призыв о помощи",
[6008] = "Эшлендерские отношения",
[6014] = "Переполох Середины года",
[6016] = "Мастерское оружие",
[6017] = "Мастерский глиф",
[6018] = "Мастерские доспехи",
[6019] = "Мастерское оружие",
[6021] = "Мастерское шитье",
[6022] = "Мастерская кожаная одежда",
[6023] = "О ножах и длинных тенях",
[6025] = "Сгущающиеся тени",
[6036] = "Самая сложная машина",
[6037] = "Масло в огонь",
[6038] = "Ежедневная молотилка",
[6039] = "Нити для пряжи",
[6040] = "Липкое решение",
[6041] = "Сбор зачарований",
[6042] = "Горькая правда",
[6045] = "Оазис в металлической пустыне",
[6046] = "Во тьму",
[6047] = "Там, где обитают тени",
[6048] = "Светоч Знания",
[6049] = "Тенистая расщелина",
[6050] = "В Заводной город",
[6052] = "Затерянные в тени",
[6054] = "Обет: владение Фолкрит",
[6056] = "Ученица Астронома",
[6057] = "В поисках поручителя",
[6058] = "Залы Регулировки",
[6059] = "Тусклые трюфели",
[6060] = "Вкусная глазурь",
[6061] = "Все дело в нежности",
[6063] = "Странности Сета",
[6064] = "Брошенные кости",
[6065] = "Планы эпидемии",
[6066] = "Прототип",
[6073] = "Пропавшая тень",
[6074] = "Шестерни судьбы",
[6075] = "Колеблющийся сын",
[6076] = "Пробуждение Несовершенства",
[6077] = "Враг в роскошном оперении",
[6078] = "Семейные дрязги",
[6079] = "Снова в тень",
[6080] = "Сумрачная неисправность",
[6081] = "Смазывание вентиляторов",
[6082] = "Болезнь моря",
[6083] = "Укрощение дикой природы",
[6084] = "Глубинный алхимик",
[6085] = "Птицы одного пера",
[6086] = "Вечная память",
[6088] = "Замена фильтров",
[6089] = "Замена преобразователей",
[6090] = "Милосердие святых",
[6092] = "Наследие торговки",
[6093] = "Собака мага",
[6094] = "Сломанный бронзилиск",
[6095] = "Просьба регистратора",
[6096] = "Указ королевы",
[6097] = "Сквозь мрачную завесу",
[6098] = "Заказ для алхимиков",
[6099] = "Заказ для алхимиков",
[6100] = "Заказ для алхимиков",
[6101] = "Заказ для алхимиков",
[6102] = "Заказ для алхимиков",
[6103] = "Заказ для алхимиков",
[6104] = "Заказ для алхимиков",
[6105] = "Заказ для алхимиков",
[6109] = "Пещера Грез",
[6111] = "Убийство в Лилландриле",
[6112] = "Бесценная жемчужина",
[6113] = "Трудности перевода",
[6114] = "Театр масок",
[6115] = "Иллюзия величия",
[6116] = "Повесть о двух матерях",
[6117] = "Вкус страха",
[6118] = "Плач Лауриэль",
[6119] = "Черное святилище",
[6121] = "Неукротимые и свободные",
[6125] = "Вынужденный союз",
[6126] = "Кристальная башня",
[6127] = "Частичное понимание",
[6129] = "Искусство требует жертв",
[6130] = "Съемная комната",
[6131] = "Штурм стен",
[6132] = "Погребенные воспоминания",
[6135] = "Старые раны",
[6137] = "Похищение света",
[6138] = "Жестокие истины",
[6140] = "Сделка с разбойниками",
[6141] = "Культурные разногласия",
[6142] = "Стражи башни",
[6144] = "Жемчуг перед предателями",
[6145] = "История беглянки",
[6146] = "Увядание",
[6149] = "Потерявшийся в море",
[6150] = "Расколотый Санхолд",
[6151] = "Дилемма дуэлянта",
[6152] = "Завершение паломничества",
[6153] = "Новый союз",
[6156] = "Тушение пламени",
[6157] = "Красота розы",
[6158] = "Волокита с реликвиями",
[6159] = "Сокращение популяции змей",
[6160] = "Вычеркнуть из памяти",
[6162] = "Неожиданное предательство",
[6165] = "Глубинный совет",
[6170] = "Божественный помощник",
[6171] = "Сертификация ювелира",
[6172] = "Зов Псиджиков",
[6174] = "Шепот из глубин",
[6176] = "Его последний подарок",
[6177] = "Наследие Гьядил",
[6178] = "Лесной вандал",
[6179] = "Грифонья обида",
[6180] = "Последствия непослушания",
[6181] = "Бреши залива",
[6185] = "Бреши льда и пламени",
[6188] = "Великая охота",
[6189] = "Обет: Путь Жертвоприношений",
[6190] = "Время грязи и грибов",
[6192] = "Горе велкинаров",
[6194] = "Брешь среди деревьев",
[6195] = "Время в тени скалы Гибели",
[6196] = "Брешь среди скал",
[6197] = "Разбитый посох",
[6198] = "Остатки башен",
[6199] = "Падение башен",
[6202] = "Затопление Саммерсета",
[6218] = "Заказ ювелиру",
[6226] = "Безжалостная конкуренция",
[6227] = "Заказ ювелиру",
[6228] = "Заказ ювелиру",
[6233] = "Замогильные обстоятельства",
[6234] = "Старые заросли",
[6235] = "Старые безделушки",
[6236] = "Замогильные ожидания",
[6238] = "Старые враги",
[6239] = "Та, что пожирает свет",
[6240] = "Пропавший легион",
[6241] = "Шепот в лесу",
[6242] = "Проклятый череп",
[6243] = "Болото и змея",
[6244] = "Реликт Аргона",
[6245] = "Рекой и корнем",
[6246] = "Затонувшее сокровище",
[6247] = "Вес слов",
[6248] = "Старые свитки",
[6249] = "Замок и камень-ключ",
[6253] = "Старинная броня",
[6254] = "Смерть среди мертвой-воды",
[6258] = "Пустое гнездо",
[6259] = "Смерть и сон",
[6264] = "Священные свечи",
[6265] = "Звуки дома",
[6266] = "Пропавшие в Мрачных Трясинах",
[6267] = "Инструменты для кровопускания",
[6268] = "Образцы смерти",
[6270] = "Монумент изменения",
[6271] = "Ритуал изменения",
[6275] = "Возвращение тотема лягушки",
[6276] = "Потерянные в Мрачных Трясинах",
[6277] = "Суд убийцы",
[6278] = "Обожженная ветвь",
[6279] = "Похититель Шкур",
[6280] = "Искусство ниссво",
[6281] = "Соната болотных медуз",
[6282] = "Вся жизнь в резьбе",
[6284] = "Немного о Стиббонсе",
[6286] = "Целительное алоэ",
[6287] = "Питательные грибы",
[6288] = "Пропавшие посланники",
[6289] = "Спрятанные подношения",
[6290] = "Защитная кожа",
[6293] = "Неуловимые избранники",
[6295] = "Смертельная охота",
[6296] = "Битва за Риверхолд",
[6297] = "Последний приказ",
[6299] = "Демоническое оружие",
[6300] = "Железо в крови",
[6301] = "Охрана Угодий",
[6302] = "Шрамы прошлого",
[6303] = "В болезни и в здравии",
[6304] = "Две королевы",
[6305] = "Кэдвелл Предатель",
[6306] = "Залы Колосса",
[6307] = "Потомок потентата",
[6308] = "Благородные воры",
[6310] = "Безумие Двух Лун",
[6311] = "Похищение в Риверхолде",
[6312] = "Странные послания",
[6313] = "Охота на охотников",
[6314] = "У страха глаза велики",
[6315] = "Сердце Джоуда",
[6316] = "Кровь и слезы",
[6317] = "Оковы луны",
[6318] = "Темные души, мощное оружие",
[6319] = "Песнь королевств",
[6321] = "Ведьма Азурры",
[6322] = "Путь Скрытой Луны",
[6323] = "Клинок Лунного Света",
[6324] = "Яркие луны, теплые пески",
[6325] = "В гостях хорошо, а дома слаще",
[6326] = "Мрачная обитель зверя",
[6328] = "Наследница Анеквины",
[6336] = "Драконья рать",
[6338] = "Королева-узурпатор",
[6343] = "Обучение бою с шатунами",
[6344] = "Обучение бою с ламиями",
[6345] = "Знания о драконах: крипта Штормовых Утесов",
[6348] = "Защита Эльсвейра",
[6353] = "Возвращение Алкоша",
[6354] = "Призыв Солнечного Шпиля",
[6355] = "Праотцы и дети",
[6356] = "Даэдрическое пламя должно погаснуть",
[6357] = "Охота на драконов",
[6358] = "Нездоровая озабоченность",
[6360] = "Рыщущие в руинах",
[6361] = "Благосклонность Голодного Кота",
[6363] = "Хитросплетение чайных листьев",
[6364] = "Сладкий ротмет",
[6365] = "Самоцвет Баан-Дара",
[6366] = "Остерегайся Мурчащего Лжеца",
[6370] = "Сладость на радость",
[6371] = "Культурные недопонимания",
[6373] = "Магия хаоса",
[6374] = "Любовь и гуар",
[6375] = "Ценитель",
[6376] = "Отверженный Кровавого клыка",
[6377] = "Меч Змеи",
[6378] = "Ужас для торговцев",
[6379] = "Ходячий кошмар",
[6382] = "Сенч и разложение",
[6384] = "Охота на драконов",
[6389] = "Поход к Красным Клыкам",
[6393] = "Темная Вечность",
[6394] = "Непростые союзы",
[6395] = "Наследие Драконьей стражи",
[6396] = "Светотень на перекрестке",
[6397] = "Восход Новой Луны",
[6398] = "Рог Джа'дарри",
[6399] = "Орден Новой Луны",
[6400] = "Детство в пламени",
[6401] = "Логово дракона",
[6402] = "Гордость Эльсвейра",
[6403] = "Прайд Алкоша",
[6404] = "Драконья стража",
[6405] = "Поднять их на бивни",
[6407] = "Шедевр по кусочкам",
[6408] = "Смертоносная добыча",
[6409] = "Реорганизация",
[6412] = "Последствия скумы",
[6413] = "Еще одна история каджита",
[6418] = "Сны о Забытых",
[6419] = "Книги цаэски",
[6420] = "На защите Пеллитина",
[6421] = "Помощь целителям",
[6425] = "За стрелами",
[6428] = "Палки и кости",
[6431] = "Зачарованные мечи",
[6434] = "Добыча Драконьей стражи",
[6435] = "Добыча Драконьей стражи",
[6438] = "Ответы — в крови",
[6441] = "Песни песчаных китов",
[6444] = "Рассвет Драконьей стражи",
[6447] = "Вдали от Мрачных Трясин",
[6448] = "Товар травника",
[6449] = "Неси свою ношу",
[6454] = "Заговор ковена",
[6459] = "Долгая дорога домой",
[6460] = "Лед и смерть",
[6461] = "Гончие Хирсина",
[6463] = "Загадка ковена",
[6465] = "Сияние Меридии",
[6467] = "Надвигающаяся буря",
[6468] = "Кровь Старого Карта",
[6469] = "Оркестровка",
[6471] = "Докопаться до беды",
[6472] = "Кровавая леди",
[6473] = "Кризис в Драконьем Мосту",
[6474] = "Рокочущая гора",
[6475] = "Узник прошлого",
[6480] = "Последнее приключение",
[6484] = "Расколотый клан",
[6491] = "Отравленное жало",
[6492] = "Солдаты удачи и славы",
[6494] = "И след простыл",
[6496] = "Оставшаяся во льдах",
[6498] = "Зачарованная",
[6501] = "Хлопотное перемирие",
[6504] = "Подкрепления для Эгиды Кин",
[6509] = "Заблудший мореход",
[6510] = "Загадка Мельмота",
[6512] = "Борьба с мрачными бурями",
[6513] = "Бледный Гигант",
[6514] = "Круг собирателей древностей",
[6515] = "Искусство собирателя",
[6516] = "Начинающая исследовательница",
[6517] = "Похищение при лунном свете",
[6519] = "Мать Тьмы",
[6520] = "Ценная кора",
[6524] = "Духовное освобождение",
[6527] = "Растущая проблема",
[6533] = "Образцы породы Кельбарна",
[6534] = "Образцы породы Ингайи",
[6535] = "Образцы породы Ри-Ла",
[6536] = "Образцы породы Гамборза",
[6537] = "Сильный яд",
[6538] = "Образцы породы Аданзды",
}
|
local em = GetEventManager()
local wm = GetWindowManager()
local dx = GuiRoot:GetWidth()/tonumber(GetCVar("WindowedWidth"))
COMBAT_METRICS_LINE_SIZE = tostring(dx)
local fontsize = 14
local currentFight
local abilitystats
local abilitystatsversion = 2
local fightData, selectionData
local currentCLPage
local selections, lastSelections
local savedFights
local SVHandler
local ToggleFeedback
local barKeyOffset = 1
local enlargedGraph = false
local maxXYPlots = 5
local maxBarPlots = 8
local skillpage = 0
local CMX = CMX
if CMX == nil then CMX = {} end
local _
local db
function CMX.GetAbilityStats()
return abilitystats, abilitystatsversion
end
local LC = LibCombat
if LC == nil then return end
local LibFeedback = LibStub:GetLibrary('LibFeedback')
local GetFormattedAbilityName = LC.GetFormattedAbilityName
local GetFormattedAbilityIcon = LC.GetFormattedAbilityIcon
local function searchtable(t, field, value)
if value == nil then return false end
for k, v in pairs(t) do
if type(v) == "table" and field and v[field] == value then
return true, k
elseif v == value then
return true, k
end
end
return false, nil
end
local function storeOrigLayout(self)
self.sizes = {self:GetDimensions()}
self.anchors = {}
--self.anchors = {{self:GetAnchor(0)}, {self:GetAnchor(1)}}
local anchors = self.anchors
for i = 1, 2 do
local valid, point, relativeTo, relativePoint, x, y, constrains = self:GetAnchor(i-1)
if valid then anchors[i] = {point, relativeTo, relativePoint, x, y, constrains} end
end
for i = 1, self:GetNumChildren() do
local child = self:GetChild(i)
if child then storeOrigLayout(child) end
end
end
local function toggleFightList(panel, show)
panel = panel or CombatMetrics_Report_FightList
show = show or panel:IsHidden()
panel:SetHidden(not show)
if show then panel:Update() end
end
function CMX.EditTitleStart(control)
local label = control:GetNamedChild("Name")
local editbox = control:GetNamedChild("Edit")
label:SetHidden(true)
editbox:SetHidden(false)
editbox:SetText( label:GetText() )
editbox:SelectAll()
editbox:TakeFocus()
end
function CMX.EditTitleEnd(editbox)
local control = editbox:GetParent()
local label = control:GetNamedChild("Name")
editbox:SetHidden(true)
label:SetHidden(false)
local newtext = editbox:GetText()
label:SetText( newtext )
if fightData then fightData.fightlabel = newtext end
end
local NavButtonFunctions = {}
function NavButtonFunctions.previous(control)
if control:GetState() == BSTATE_DISABLED then
return
else
CombatMetrics_Report:Update(currentFight-1)
end
end
function NavButtonFunctions.next(control)
if control:GetState() == BSTATE_DISABLED then
return
else
CombatMetrics_Report:Update(currentFight+1)
end
end
function NavButtonFunctions.last(control)
if control:GetState() == BSTATE_DISABLED then
return
else
CombatMetrics_Report:Update(#CMX.lastfights)
end
end
function NavButtonFunctions.load(control)
if control:GetState() == BSTATE_DISABLED then
return
else
toggleFightList()
end
end
local function checkSaveLimit(fight)
local size = SVHandler.Check(fight) -- if no table is passed it will check size of the SV
if fight == nil then
CMX.Print("save", "SV Size: %.3f MB, %.1f%%", size, size*100/db.maxSVsize)
end
local isvalid = (size < db.maxSVsize)
return isvalid, size
end
function NavButtonFunctions.save(control, _, _, _, _, shiftkey )
if control:GetState() == BSTATE_DISABLED then
return
else
local lastsaved = savedFights[#savedFights]
if lastsaved ~= nil and lastsaved.date == fightData.date then return end --bail out if fight is already saved
SVHandler.Save(fightData, shiftkey)
local isvalid, size = checkSaveLimit()
if isvalid then
db.SVsize = size
CombatMetrics_Report:Update()
else
local removed = table.remove(savedFights)
local _, removedSize = checkSaveLimit(removed)
local errorstring = zo_strformat(SI_COMBAT_METRICS_STORAGE_FULL, removedSize)
assert(false, errorstring)
CombatMetrics_Report:Update()
end
end
end
local function ClearSelections()
local category = db.FightReport.category or "damageOut"
selections["ability"][category] = nil
selections["unit"][category] = nil
selections["buff"]["buff"] = nil
selections["resource"]["resource"] = nil
end
function NavButtonFunctions.delete(control)
if control:GetState() == BSTATE_DISABLED then
return
else
table.remove(CMX.lastfights, currentFight)
ClearSelections()
local _, size = checkSaveLimit()
db.SVsize = size
if #CMX.lastfights == 0 then CombatMetrics_Report:Update() else CombatMetrics_Report:Update(math.min(currentFight, #CMX.lastfights)) end
end
end
function CMX.InitNavButtons(rowControl)
for i=1, rowControl:GetNumChildren() do
local child = rowControl:GetChild(i)
if child then child:SetHandler( "OnMouseUp", NavButtonFunctions[child.func]) end
end
end
local function selectCategory(button)
local control = button:GetParent()
for i=1, 4 do
local child = control:GetChild(i)
local r, g, b, _ = child:GetColor()
local a = child == button and 1 or .2
child:SetColor(r, g, b, a)
end
db.FightReport.category = button.category
if CMX and CMX.init then CombatMetrics_Report:Update(currentFight) end
end
local function selectMainPanel(button)
local selectControl = button:GetParent()
local category = button.category
for i = 5, 8 do
local child = selectControl:GetChild(i)
local a = child == button and 1 or .2
child:SetColor(1, 1, 1, a)
end
local mainPanel = CombatMetrics_Report_MainPanel
local rightPanel = CombatMetrics_Report_RightPanel
local unitPanel = CombatMetrics_Report_UnitPanel
local abilityPanel = CombatMetrics_Report_AbilityPanel
local infoPanel = CombatMetrics_Report_InfoPanel
local graphPanel = CombatMetrics_Report_MainPanelGraph
local isInfo = category == "Info"
mainPanel:SetHidden(isInfo)
rightPanel:SetHidden(isInfo)
unitPanel:SetHidden(isInfo)
abilityPanel:SetHidden(isInfo)
infoPanel:SetHidden(not isInfo)
local isGraph = category == "Graph"
graphPanel:SetHidden(not isGraph)
if not isInfo then
local selected = mainPanel:GetNamedChild(category) -- Panel Content to show
mainPanel.active = selected
for i = 2, mainPanel:GetNumChildren() do
local child = mainPanel:GetChild(i)
child:SetHidden(child ~= selected) -- Hide all other panels except the selected panel
end
selected:Update()
else
infoPanel:Update()
end
end
local function toggleInfoPanel(button)
local selectControl = button:GetParent()
for i=5, 8 do
local child = selectControl:GetChild(i)
local a = child == button and 1 or .2
child:SetColor(1, 1, 1, a)
end
local mainpanel = CombatMetrics_Report_MainPanel
local rightpanel = CombatMetrics_Report_RightPanel
local infopanel = CombatMetrics_Report_InfoPanel
mainpanel:SetHidden(true)
rightpanel:SetHidden(true)
infopanel:SetHidden(false)
end
local function initSelectorButtons(selectorButtons)
for i = 1, 8 do
local child = selectorButtons:GetChild(i)
if child and i <= 4 then
child:SetHandler( "OnMouseUp", selectCategory)
if child.category == db.FightReport.category then selectCategory(child) end
elseif child and i>4 then
child:SetHandler( "OnMouseUp", selectMainPanel)
selectMainPanel(selectorButtons:GetNamedChild("FightStatsButton"))
end
end
end
function CMX.InitializeCPRows(panel)
for i = 1, 9 do
local discipline = (7-i)%9+1 -- start with apprentice and then clockwise (seriously, how did they come up with those ids?)
local color = GetString(SI_COMBAT_METRICS_MAGICKA_COLOR)
if i > 6 then
color = GetString(SI_COMBAT_METRICS_STAMINA_COLOR)
elseif i > 3 then
color = GetString(SI_COMBAT_METRICS_HEALTH_COLOR)
end
local signcontrol = panel:GetNamedChild("StarSign"..i)
local title = signcontrol:GetNamedChild("Title")
title:SetText(zo_strformat(SI_CHAMPION_CONSTELLATION_NAME_FORMAT, GetChampionDisciplineName(discipline)))
local width = title:GetTextWidth() + 4
local height = title:GetHeight()
title:SetDimensions(width, height)
CMX.SetLabelColor(signcontrol, color)
for i = 1, 4 do
local row = signcontrol:GetNamedChild("Row"..i)
local label = row:GetNamedChild("Name")
label:SetText(zo_strformat(SI_CHAMPION_CONSTELLATION_NAME_FORMAT, GetChampionSkillName(discipline, i)))
row.discipline = discipline
row.skillId = i
row.points = 0
local passive = signcontrol:GetNamedChild("Passive"..i)
passive.discipline = discipline
passive.skillId = i + 4
passive.points = 0
end
end
end
function CMX.InitializeSkillStats(panel)
local block = panel:GetNamedChild("AbilityBlock1")
local title = block:GetNamedChild("Title")
title:SetText(GetString(SI_COMBAT_METRICS_BAR) .. 1)
local statPanel = block:GetNamedChild("Stats2")
local label = statPanel:GetNamedChild("Label")
local label2 = statPanel:GetNamedChild("Label2")
label.tooltip = {SI_COMBAT_METRICS_SKILLAVG_TT}
label:SetText(string.format("%s -", GetString(SI_COMBAT_METRICS_AVERAGEC)))
label2.tooltip = {SI_COMBAT_METRICS_SKILLTOTAL_TT}
label2:SetText(string.format("%s -", GetString(SI_COMBAT_METRICS_TOTALC)))
local block2 = panel:GetNamedChild("AbilityBlock2")
local title2 = block2:GetNamedChild("Title")
title2:SetText(GetString(SI_COMBAT_METRICS_BAR) .. 2)
local statPanel2 = block2:GetNamedChild("Stats2")
local label3 = statPanel2:GetNamedChild("Label")
local label4 = statPanel2:GetNamedChild("Label2")
label3:SetText(string.format("%s -", GetString(SI_COMBAT_METRICS_TOTALWA)))
label3.tooltip = {SI_COMBAT_METRICS_TOTALWA_TT}
label4:SetText(string.format("%s -", GetString(SI_COMBAT_METRICS_TOTALSKILLS)))
label4.tooltip = {SI_COMBAT_METRICS_TOTALSKILLS_TT}
end
local function CLNavButtonFunction(self)
currentCLPage = tonumber(self.value or (currentCLPage + self.func))
self:GetParent():GetParent():GetParent():Update()
end
function CMX.InitCLNavButtonRow(rowControl)
for i=1, rowControl:GetNumChildren() do
local button = rowControl:GetChild(i)
if button.texture then button:GetNamedChild("Icon"):SetTexture(button.texture) end
local value = button.value
if value then
button:GetNamedChild("Label"):SetText(value)
button.tooltip = {zo_strformat(SI_COMBAT_METRICS_PAGE, value)}
end
button:SetHandler( "OnMouseUp", CLNavButtonFunction )
end
end
local function CLFilterButtonFunction(self)
local overlay = self:GetNamedChild("Overlay")
local func = self.func
db.FightReport.CLSelection[func] = not db.FightReport.CLSelection[func] -- Update Filter Selection
overlay:SetCenterColor( 0 , 0 , 0 , db.FightReport.CLSelection[func] and 0 or 0.8 ) -- Switch Button overlay (active = button darkened)
overlay:SetEdgeColor( 1 , 1 , 1 , db.FightReport.CLSelection[func] and 1 or .4 )
self:GetParent():GetParent():GetParent():Update()
end
local function initCLButtonRow(rowControl)
for i=1, rowControl:GetNumChildren() do
local button = rowControl:GetChild(i)
if button.texture then button:GetNamedChild("Icon"):SetTexture(button.texture) end
if button.label then button:GetNamedChild("Label"):SetText(button.label) end
button:SetHandler( "OnMouseUp", CLFilterButtonFunction )
local selected = db.FightReport.CLSelection[button.func]
local overlay = button:GetNamedChild("Overlay")
overlay:SetCenterColor( 0 , 0 , 0 , selected and 0 or 0.8 )
overlay:SetEdgeColor( 1 , 1 , 1 , selected and 1 or .5 )
end
end
local function adjustSlider(self)
local buffer = self:GetNamedChild("Buffer")
local slider = self:GetNamedChild("Slider")
local numHistoryLines = buffer:GetNumHistoryLines()
local numVisHistoryLines = math.floor((buffer:GetNumVisibleLines()+1)/dx) --it seems numVisHistoryLines is getting screwed by UI Scale
local bufferScrollPos = buffer:GetScrollPosition()
local sliderMin, sliderMax = slider:GetMinMax()
local sliderValue = slider:GetValue()
slider:SetMinMax(numVisHistoryLines, numHistoryLines)
if sliderValue == sliderMax then -- If the sliders at the bottom, stay at the bottom to show new text
slider:SetValue(numHistoryLines)
elseif numHistoryLines == self:GetNamedChild("Buffer"):GetMaxHistoryLines() then -- If the buffer is full start moving the slider up
slider:SetValue(sliderValue-1)
end -- Else the slider does not move
if numHistoryLines > numVisHistoryLines then -- If there are more history lines than visible lines show the slider
slider:SetHidden(false)
slider:SetThumbTextureHeight(math.max(20, math.floor(numVisHistoryLines/numHistoryLines*self:GetNamedChild("Slider"):GetHeight())))
else -- else hide the slider
slider:SetHidden(true)
end
end
local function addColoredText(control, text, color)
if not text or #color~=3 then return end
local red = color[1] or 1
local green = color[2] or 1
local blue = color[3] or 1
control:GetNamedChild("Buffer"):AddMessage(text, red, green, blue) -- Add message first
if control:GetNamedChild("Slider") then adjustSlider(control) end -- Set new slider value & check visibility
end
function CMX.InitCombatLog(control)
control.AddColoredText = addColoredText
local buffer = control:GetNamedChild("Buffer")
local slider = control:GetNamedChild("Slider")
buffer:SetHandler("OnMouseWheel", function(self, delta, ctrl, alt, shift)
local offset = delta
local slider = buffer:GetParent():GetNamedChild("Slider")
if shift then
offset = offset * math.floor((buffer:GetNumVisibleLines())/dx) -- correct for ui scale
elseif ctrl then
offset = offset * buffer:GetNumHistoryLines()
end
buffer:SetScrollPosition(math.min(buffer:GetScrollPosition() + offset, math.floor(buffer:GetNumHistoryLines()-(buffer:GetNumVisibleLines())/dx))) -- correct for ui scale
slider:SetValue(slider:GetValue() - offset)
end)
slider:SetHandler("OnValueChanged", function(self, value, eventReason)
local numHistoryLines = buffer:GetNumHistoryLines()
local sliderValue = math.max(slider:GetValue(), math.floor((buffer:GetNumVisibleLines()+1)/dx)) -- correct for ui scale
if eventReason == EVENT_REASON_HARDWARE then
buffer:SetScrollPosition(numHistoryLines-sliderValue)
end
end)
-- Assign Button Functions
local scrollUp = slider:GetNamedChild("ScrollUp")
local scrollDown = slider:GetNamedChild("ScrollDown")
local scrollEnd = slider:GetNamedChild("ScrollEnd")
scrollUp:SetHandler("OnMouseDown", function(...)
buffer:SetScrollPosition(math.min(buffer:GetScrollPosition()+1, math.floor(buffer:GetNumHistoryLines()-(buffer:GetNumVisibleLines())/dx))) -- correct for ui scale
slider:SetValue(slider:GetValue()-1)
end)
scrollDown:SetHandler("OnMouseDown", function(...)
buffer:SetScrollPosition(buffer:GetScrollPosition()-1)
slider:SetValue(slider:GetValue()+1)
end)
scrollEnd:SetHandler("OnMouseDown", function(...)
buffer:SetScrollPosition(0)
slider:SetValue(buffer:GetNumHistoryLines())
end)
end
local function AddTooltipLine(control, tooltipControl, tooltip)
local tooltipTextType = type(tooltip)
if tooltipTextType == "string" then
if tooltip == "" then ZO_Options_OnMouseExit(control) return end
elseif tooltipTextType == "number" then tooltip = GetString(tooltip)
elseif tooltipTextType == "function" then tooltip = tooltip()
else ZO_Options_OnMouseExit(control) return end
SetTooltipText(tooltipControl, tooltip)
end
function CMX.OnMouseEnter(control) --copy from ZO_Options_OnMouseEnter but modified to support multiple tooltip lines
local tooltipText = control.tooltip
if tooltipText ~= nil and #tooltipText>0 then
InitializeTooltip(InformationTooltip, control, BOTTOMLEFT, 0, -2, TOPLEFT)
if type(tooltipText) == "table" then
for i=1, #tooltipText do
AddTooltipLine(control, InformationTooltip, tooltipText[i])
end
else
AddTooltipLine(control, InformationTooltip, tooltipText)
end
end
end
function CMX.SetLabelColor(control, setcolor) -- setcolor can be hex or rgba, ZO_ColorDef takes care of this
for i=1, control:GetNumChildren(control) do
local child = control:GetChild(i)
local color = ZO_ColorDef:New(setcolor)
if child:GetType() == CT_LABEL and child.nocolor ~= true then
child:SetColor(color.r, color.g, color.b, color.a)
elseif child:GetType() == CT_CONTROL and child.nocolor ~= true then
CMX.SetLabelColor(child, setcolor)
end
end
end
function CMX.UpdateAttackStatsSelector(control)
local selector = control:GetParent()
for _, powerType in pairs{"Magicka", "Stamina", "Health"} do
local control = selector:GetNamedChild(powerType)
control:GetNamedChild("Line"):SetColor(0.53, 0.53, 0.53, 1)
control:GetNamedChild("Icon"):SetAlpha(0.5)
end
local line = control:GetNamedChild("Line")
local color = line.color
line:SetColor(color.r, color.g, color.b, color.a)
control:GetNamedChild("Icon"):SetAlpha(1)
local mainPanelRight = selector:GetParent()
local labels = mainPanelRight:GetNamedChild("AttackStats")
CMX.SetLabelColor(labels, color)
db.FightReport.fightstatspanel = control.powerType
mainPanelRight:Update()
end
function CMX.SelectRightPanel(control)
local rightpanel = control.menukey
db.FightReport.rightpanel = rightpanel
local menubar = control:GetParent()
for i=1, menubar:GetNumChildren() do
local child = menubar:GetChild(i)
if child:GetType() == CT_CONTROL then
child:GetNamedChild("Overlay"):SetHidden(child == control)
end
end
local isbuffpanel = rightpanel == "buffs" or rightpanel == "buffsout"
local panel = menubar:GetParent()
local buffList = panel:GetNamedChild("BuffList")
buffList:SetHidden(not isbuffpanel)
local resourceList = panel:GetNamedChild("ResourceList")
resourceList:SetHidden(isbuffpanel)
panel.active = isbuffpanel and buffList or resourceList
panel:Update()
CombatMetrics_Report_MainPanelGraph:Update()
end
function CMX.SavePosition(control)
local x, y = control:GetCenter()
-- Save the Position
db[control:GetName()] = { ["x"] = x, ["y"] = y}
end
function CMX.LoadItem(listitem)
local issaved = listitem.issaved
local id = listitem.id
local lastfights = CMX.lastfights
local isLoaded, loadId
if issaved and savedFights[id] then
isLoaded, loadId = searchtable(lastfights, "date", savedFights[id]["date"]) -- returns false if nothing is found else it returns the id
if isLoaded then isLoaded = lastfights[loadId]["time"] == savedFights[id]["time"] end -- ensures old fights load correctly
end
if issaved and isLoaded == false then
local loadedfight = SVHandler.Load(id)
if loadedfight.log then CMX.AddFightCalculationFunctions(loadedfight) end
table.insert(lastfights, loadedfight)
CombatMetrics_Report:Update(#CMX.lastfights)
else
CombatMetrics_Report:Update((issaved and loadId or id))
end
local category = db.FightReport.category
ClearSelections()
toggleFightList()
end
function CMX.DeleteItem(control)
local row = control:GetParent():GetParent()
local issaved = row.issaved
local id = row.id
if issaved then
table.remove(savedFights, id)
else
table.remove(CMX.lastfights, id)
if #CMX.lastfights == 0 then CombatMetrics_Report:Update() else CombatMetrics_Report:Update(math.min(currentFight, #CMX.lastfights)) end
end
toggleFightList(nil, true)
end
function CMX.DeleteItemLog(control)
local row = control:GetParent():GetParent()
local issaved = row.issaved
local id = row.id
if issaved then
savedFights[id]["stringlog"]={}
else
CMX.lastfights[id]["log"]={}
end
toggleFightList(nil, true)
end
--Slash Commands
CMX_POSTTOCHAT_MODE_NONE = 0
CMX_POSTTOCHAT_MODE_SINGLE = 1
CMX_POSTTOCHAT_MODE_MULTI = 2
CMX_POSTTOCHAT_MODE_SINGLEANDMULTI = 3
CMX_POSTTOCHAT_MODE_SMART = 4
CMX_POSTTOCHAT_MODE_HEALING = 5
CMX_POSTTOCHAT_MODE_SELECTION = 6
CMX_POSTTOCHAT_MODE_SELECTION_HEALING = 7
CMX_POSTTOCHAT_MODE_SELECTED_UNIT = 8
CMX_POSTTOCHAT_MODE_SELECTED_UNITNAME = 9
local function slashCommandFunction(extra)
if extra == "reset" then CMX.ResetFight()
elseif extra == "dps" then CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SMART)
elseif extra == "totdps" then CMX.PosttoChat(CMX_POSTTOCHAT_MODE_MULTI)
elseif extra == "alldps" then CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SINGLEANDMULTI)
elseif extra == "hps" then CMX.PosttoChat(CMX_POSTTOCHAT_MODE_HEALING)
else CombatMetrics_Report:Toggle()
end
end
SLASH_COMMANDS["/cmx"] = slashCommandFunction
do -- Handling Buffs Context Menu
local favs
local buffname
local unitType
local function addFavouriteBuff()
if buffname then favs[buffname] = true end
CombatMetrics_Report:Update()
end
local function removeFavouriteBuff()
if buffname then favs[buffname] = nil end
CombatMetrics_Report:Update()
end
local function postBuffUptime()
if buffname then CMX.PostBuffUptime(currentFight, buffname) end
end
local function postSelectionBuffUptime()
if buffname then CMX.PostBuffUptime(currentFight, buffname, unitType) end
end
function CMX.BuffContextMenu( bufflistitem, upInside )
if not upInside then return end
buffname = bufflistitem.dataId
favs = db.FightReport.FavouriteBuffs
local func, text
if favs[buffname] == nil then
func = addFavouriteBuff
text = GetString(SI_COMBAT_METRICS_FAVOURITE_ADD)
else
func = removeFavouriteBuff
text = GetString(SI_COMBAT_METRICS_FAVOURITE_REMOVE)
end
ClearMenu()
AddCustomMenuItem(text, func)
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTBUFF), postBuffUptime)
local category = db.FightReport.category
if (category == "damageOut" or category == "damageIn") and db.FightReport.rightpanel == "buffsout" then
unitType = "boss"
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTBUFF_BOSS), postSelectionBuffUptime)
elseif (category == "healingOut" or category == "healingIn") and db.FightReport.rightpanel == "buffsout" then
unitType = "group"
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTBUFF_GROUP), postSelectionBuffUptime)
end
ShowMenu(bufflistitem)
end
end
do -- Handling Unit Context Menu
local UnitContextMenuUnitId
local function postUnitDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTED_UNIT, currentFight, UnitContextMenuUnitId)
end
local function postUnitNameDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTED_UNITNAME, currentFight, UnitContextMenuUnitId)
end
local function postSelectionDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTION, currentFight)
end
local function postSelectionHPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTION_HEALING, currentFight)
end
function CMX.UnitContextMenu( unitItem, upInside )
local category = db.FightReport.category
if not (upInside or category == "damageOut" or category == "healingOut") then return end
local dataId = unitItem.dataId
ClearMenu()
if category == "damageOut" then
UnitContextMenuUnitId = dataId
local unitName = fightData.units[dataId].name
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTUNITDPS), postUnitDPS)
AddCustomMenuItem(zo_strformat(GetString(SI_COMBAT_METRICS_POSTUNITNAMEDPS), unitName), postUnitNameDPS)
if selections.unit[category] then AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTSELECTIONDPS), postSelectionDPS) end
elseif category == "healingOut" and selections.unit[category] then
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_POSTSELECTIONHPS), postSelectionHPS)
end
ShowMenu(unitItem)
end
end
do
local function toggleShowIds()
db.debuginfo.ids = not db.debuginfo.ids
CombatMetrics_Report:Update()
end
local function toggleOverhealMode()
CMX.showOverHeal = not CMX.showOverHeal
CombatMetrics_Report:Update()
end
local function postSingleDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SINGLE, currentFight)
end
local function postSmartDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SMART, currentFight)
end
local function postMultiDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_MULTI, currentFight)
end
local function postAllDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SINGLEANDMULTI, currentFight)
end
local function postSelectionDPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTION, currentFight)
end
local function postHPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_HEALING, currentFight)
end
local function postSelectionHPS()
CMX.PosttoChat(CMX_POSTTOCHAT_MODE_SELECTION_HEALING, currentFight)
end
function CMX.SettingsContextMenu( settingsbutton, upInside )
if not upInside then return end
local showIdString = db.debuginfo.ids and SI_COMBAT_METRICS_HIDEIDS or SI_COMBAT_METRICS_SHOWIDS
local showOverhealString = CMX.showOverHeal and SI_COMBAT_METRICS_HIDEOVERHEAL or SI_COMBAT_METRICS_SHOWOVERHEAL
local postoptions = {}
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTSINGLEDPS), callback = postSingleDPS})
local fight = CMX.lastfights[currentFight]
if fight and fight.bossfight == true then
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTSMARTDPS), callback = postSmartDPS})
end
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTMULTIDPS), callback = postMultiDPS})
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTALLDPS), callback = postAllDPS})
local category = db.FightReport.category
if category == "damageOut" and selections.unit[category] then
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTSELECTIONDPS), callback = postSelectionDPS})
end
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTHPS), callback = postHPS})
if category == "healingOut" and selections.unit[category] then
table.insert(postoptions, {label = GetString(SI_COMBAT_METRICS_POSTSELECTIONHPS), callback = postSelectionHPS})
end
ClearMenu()
AddCustomMenuItem(GetString(showIdString), toggleShowIds)
AddCustomMenuItem(GetString(showOverhealString), toggleOverhealMode)
AddCustomSubMenuItem(GetString(SI_COMBAT_METRICS_POSTDPS), postoptions)
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_SETTINGS), CMX.OpenSettings)
if fight and fight.CalculateFight and (fight.svversion == nil or fight.svversion > 2) then
local function calculate()
fight:CalculateFight()
CombatMetrics_Report:Update(currentFight)
end
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_RECALCULATE), calculate)
end
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_FEEDBACK), ToggleFeedback)
ShowMenu(settingsbutton)
AnchorMenu(settingsbutton)
end
end
--function CMX.AddSelection( selecttype, id, dataId, shiftkey, controlkey, button ) -- IsShiftKeyDown() IsControlKeyDown() IsCommandKeyDown()
function CMX.AddSelection( self, button, upInside, ctrlkey, alt, shiftkey )
local id = self.id
local dataId = self.dataId
local selecttype = self.type
if button ~= MOUSE_BUTTON_INDEX_LEFT and button ~= MOUSE_BUTTON_INDEX_MIDDLE then return end
local category = selecttype == "buff" and "buff" or selecttype == "resource" and "resource" or db.FightReport.category
local sel = selections[selecttype][category] -- can be nil so this is not always a reference
local lastsel = lastSelections[selecttype][category]
local bars = self.panel.bars
if button == MOUSE_BUTTON_INDEX_MIDDLE then
selections[selecttype][category] = nil
lastSelections[selecttype][category] = nil
CombatMetrics_Report:Update(currentFight)
return
end
if sel == nil then -- if nothing is selected yet, just select this, disregarding all modifiers.
sel = {[dataId] = id}
lastsel = id
elseif shiftkey and not ctrlkey and lastsel ~= nil then -- select everything between this and the previous sel if shiftkey is pressed
local istart = math.min(lastsel, id)
local iend = math.max(lastsel, id)
sel = {} -- forget/disregard other selections
for i=istart, iend do
local irowcontrol = bars[i]
sel[irowcontrol.dataId] = i
end
elseif ctrlkey and not shiftkey then -- toggle additional sel if ctrlkey is pressed
if sel[dataId] ~= nil then
lastsel = nil
sel[dataId] = nil
else
lastsel = id
sel[dataId] = id
end
elseif shiftkey and ctrlkey and lastsel ~= nil then -- additionally select everything between this and the previous sel if ctrlkey + shift key is pressed
local istart = math.min(lastsel, id)
local iend = math.max(lastsel, id)
for i=istart, iend do
local irowcontrol = bars[i]
sel[irowcontrol.dataId] = i
end
elseif not shiftkey and not ctrlkey then -- normal LMB click
if lastsel == id and sel[dataId] ~= nil then -- remove sel if this was pressed just before
lastsel = nil
sel = nil
else
lastsel = id
sel = {[dataId] = id}
end
end
lastSelections[selecttype][category] = lastsel
selections[selecttype][category] = sel
CombatMetrics_Report:Update(currentFight)
end
local function UpdateReport2()
CombatMetrics_Report:Update()
end
local function updateTitlePanel(panel)
CMX.Print("dev", "Updating TitlePanel")
-- update character info
local charInfo = panel:GetNamedChild("CharacterInfo")
local charData = {}
local fightlabel
if fightData == nil then
charData.name = GetUnitName("player")
charData.raceId = GetUnitRaceId("player")
charData.gender = GetUnitGender("player")
charData.classId = GetUnitClassId("player")
charData.level = GetUnitLevel("player")
charData.CPtotal = GetUnitChampionPoints("player")
fightlabel = "Combat Metrics"
elseif (fightData.charData == nil or fightData.charData.classId == nil) and fightData.char == GetUnitName("player") then -- legacy
charData.name = fightData.char
charData.raceId = GetUnitRaceId("player")
charData.gender = GetUnitGender("player")
charData.classId = GetUnitClassId("player")
charData.level = 0
charData.CPtotal = 0
fightData.charData = charData
fightlabel = string.gsub(fightData.fightlabel, ".+%:%d%d %- ([A-Z])", "%1") or ""
else
charData = fightData.charData or {}
charData.name = charData.name or fightData.char
fightlabel = string.gsub(fightData.fightlabel, ".+%:%d%d %- ([A-Z])", "%1") or ""
end
-- RaceIcon
local racetextures = {
"esoui/art/icons/heraldrycrests_race_breton_01.dds",
"esoui/art/icons/heraldrycrests_race_redguard_01.dds",
"esoui/art/icons/heraldrycrests_race_orc_01.dds",
"esoui/art/icons/heraldrycrests_race_dunmer_01.dds",
"esoui/art/icons/heraldrycrests_race_nord_01.dds",
"esoui/art/icons/heraldrycrests_race_argonian_01.dds",
"esoui/art/icons/heraldrycrests_race_altmer_01.dds",
"esoui/art/icons/heraldrycrests_race_bosmer_01.dds",
"esoui/art/icons/heraldrycrests_race_khajiit_01.dds",
"esoui/art/icons/heraldrycrests_race_imperial_01.dds",
}
local raceIcon = charInfo:GetNamedChild("RaceIcon")
local raceId = charData.raceId
local gender = charData.gender
raceIcon:SetHidden(raceId == nil)
raceIcon:SetTexture(racetextures[raceId])
local race = GetRaceName(gender, raceId)
raceIcon.tooltip = race
-- ClassIcon
local classIcon = charInfo:GetNamedChild("ClassIcon")
local classId = charData.classId
for i=1, GetNumClasses() do
local id, _, _, _, _, _, texture = GetClassInfo(i)
if id == classId then
local class = GetClassName(gender, id)
classIcon:SetTexture(texture)
classIcon.tooltip = {class}
classIcon:SetHidden(false)
break
end
classIcon:SetHidden(true)
end
-- charName
local charName = charInfo:GetNamedChild("Charname")
local name = charData.name
charName:SetText(name)
-- CPValue
local CPIcon = charInfo:GetNamedChild("CPIcon")
local CPValue = charInfo:GetNamedChild("CPValue")
local level = charData.level
local CP = charData.CPtotal
if level == nil or level == 0 then
CPIcon:SetHidden(true)
CPValue:SetHidden(true)
elseif level < 50 then
CPIcon:SetHidden(true)
CPValue:SetHidden(false)
CPValue:SetText(level)
else
CPIcon:SetHidden(false)
CPValue:SetHidden(false)
CPValue:SetText(CP)
end
-- Fight Title
local fightTitle = panel:GetNamedChild("FightTitle"):GetNamedChild("Name")
fightTitle:SetText(fightlabel)
-- Nav Buttons
local NavButtons = panel:GetNamedChild("NavigationRow")
local fightId = currentFight or 0
local ButtonStates = {
["previous"] = CMX.lastfights[fightId - 1] ~= nil,
["next"] = CMX.lastfights[fightId + 1] ~= nil,
["last"] = CMX.lastfights[fightId + 1] ~= nil,
["load"] = savedFights ~= nil and #savedFights > 0,
["save"] = CMX.lastfights[fightId] ~= nil and not searchtable(savedFights, "date", fightData.date),
["delete"] = CMX.lastfights[fightId] ~= nil and #CMX.lastfights>0 ~= nil
}
for i = 1, NavButtons:GetNumChildren() do
local child = NavButtons:GetChild(i)
local state = ButtonStates[child.func]
child:SetState(state and BSTATE_NORMAL or BSTATE_DISABLED, not state)
end
end
local DPSstrings = {
["damageOut"] = "DPSOut",
["damageIn"] = "DPSIn",
["healingOut"] = "HPSOut",
["healingIn"] = "HPSIn",
}
local CountStrings = {
["damageOut"] = "hitsOut",
["damageIn"] = "hitsIn",
["healingOut"] = "healsOut",
["healingIn"] = "healsIn",
}
local function updateFightStatsPanelLeft(panel)
CMX.Print("dev", "Updating FightStatsPanelLeft")
local data = fightData and fightData.calculated or {}
local category = db.FightReport.category
local selectedabilities = selections["ability"][category]
local selectedunits = selections["unit"][category]
local noselection = selectedunits == nil and selectedabilities == nil
local header2 = panel:GetNamedChild("StatHeaderLabel2")
local headerstring = noselection and SI_COMBAT_METRICS_GROUP or SI_COMBAT_METRICS_SELECTION
header2:SetText(GetString(headerstring))
local label1, label2, label3, rowList, labelList
local activetime
local showOverHeal = category == "healingOut" and CMX.showOverHeal
if category == "healingOut" or category == "healingIn" then
label1 = GetString(showOverHeal and SI_COMBAT_METRICS_HPSA or SI_COMBAT_METRICS_HPS)
label2 = GetString(SI_COMBAT_METRICS_HEALING)
label3 = GetString(SI_COMBAT_METRICS_HEALS)
rowList = {"Total", "Normal", "Critical", "Overflow", "Absolute"}
labelList = {SI_COMBAT_METRICS_TOTALC, SI_COMBAT_METRICS_NORMAL, SI_COMBAT_METRICS_CRITICAL, SI_COMBAT_METRICS_OVERHEAL, SI_COMBAT_METRICS_ABSOLUTEC}
activetime = fightData and fightData.hpstime or 1
else
label1 = GetString(SI_COMBAT_METRICS_DPS)
label2 = GetString(SI_COMBAT_METRICS_DAMAGE)
label3 = GetString(SI_COMBAT_METRICS_HIT)
rowList = {"Total", "Normal", "Critical", "Blocked", "Shielded"}
labelList = {SI_COMBAT_METRICS_TOTALC, SI_COMBAT_METRICS_NORMAL, SI_COMBAT_METRICS_CRITICAL, SI_COMBAT_METRICS_BLOCKED, SI_COMBAT_METRICS_SHIELDED}
activetime = fightData and fightData.dpstime or 1
end
activetime = zo_roundToNearest(activetime, 0.01)
local activetimestring = string.format("%d:%05.2f", activetime/60, activetime%60)
local dpsRow = panel:GetNamedChild("StatRowAPS")
dpsRow:GetNamedChild("Label"):SetText(label1) -- DPS or HPS
panel:GetNamedChild("StatTitleAmount"):GetNamedChild("Label"):SetText(label2) -- Damage or Healing
panel:GetNamedChild("StatTitleCount"):GetNamedChild("Label"):SetText(label3) -- Hits or Heals
local combattime = zo_roundToNearest(fightData and fightData.combattime or 1, 0.01)
local combattimestring = string.format("%d:%05.2f", combattime/60, combattime%60)
panel:GetNamedChild("ActiveTimeValue"):SetText(activetimestring)
panel:GetNamedChild("CombatTimeValue"):SetText(combattimestring)
local key = showOverHeal and "HPSAOut" or DPSstrings[category]
local aps1 = data[key] or 0
local aps2, apsratio
if not noselection or showOverHeal then
aps2 = selectionData and selectionData[key] or 0
apsratio = (aps1 == 0 and 0) or aps2/aps1*100
else
local groupkey = zo_strformat("group<<C:1>>", key)
aps2 = data[groupkey] or 0
apsratio = (aps2 == 0 and 0) or aps1/aps2*100
end
dpsRow:GetNamedChild("Value"):SetText(string.format("%.0f", aps1))
dpsRow:GetNamedChild("Value2"):SetText(string.format("%.0f", aps2))
dpsRow:GetNamedChild("Value3"):SetText(string.format("%.1f%%", apsratio))
for k, v in ipairs(rowList) do
local rowcontrol1 = panel:GetNamedChild("StatRowAmount"..k)
local rowcontrol2 = panel:GetNamedChild("StatRowCount"..k)
local amountlabel = rowcontrol1:GetNamedChild("Label")
amountlabel:SetText(GetString(labelList[k]))
local amountcontrol1 = rowcontrol1:GetNamedChild("Value")
local amountcontrol2 = rowcontrol1:GetNamedChild("Value2")
local amountcontrol3 = rowcontrol1:GetNamedChild("Value3")
local countlabel = rowcontrol2:GetNamedChild("Label")
countlabel:SetText(GetString(labelList[k]))
local countcontrol1 = rowcontrol2:GetNamedChild("Value")
local countcontrol2 = rowcontrol2:GetNamedChild("Value2")
local countcontrol3 = rowcontrol2:GetNamedChild("Value3")
local hide2 = false
local hide3 = false
local hide4 = false
if v then
local amountkey = category..v
local countkey = CountStrings[category]..v
if v == "Overflow" or v == "Absolute" then basekey = "Absolute" else basekey = rowList[1] end
local amount1 = data[amountkey] or 0
local amount2 = 0
local amount3 = data[category..basekey] or 0
local amountratio = 0
local count1 = data[countkey] or 0
local count2 = 0
local count3 = data[CountStrings[category]..basekey] or 0
local countratio = 0
local groupAmountKey = zo_strformat("group<<C:1>>", category)
if k == 1 and noselection then
amount2 = data[groupAmountKey] or 0 -- first letter of category needs to be Capitalized
amountratio = (amount2 == 0 and 0) or amount1/amount2*100
hide2 = true
elseif noselection and v == "Absolute" then
amount2 = data[groupAmountKey] or 0 -- first letter of category needs to be Capitalized
amountratio = (amount2 == 0 and 0) or amount1/amount2*100
hide4 = true
elseif noselection then
hide3 = true
amountratio = (amount3 == 0 and 0) or amount1/amount3*100
countratio = (count3 == 0 and 0) or count1/count3*100
elseif noselection == false then
if (k ~= 1 and v ~= "Absolute") then
amount3 = selectionData[category..basekey] or 0
count3 = selectionData[CountStrings[category]..basekey] or 0
end
amount2 = selectionData[amountkey] or 0
amountratio = (amount3 == 0 and 0) or amount2/amount3*100
count2 = selectionData[countkey] or 0
countratio = (count3 == 0 and 0) or count2/count3*100
end
amountcontrol1:SetText(string.format("%.0f", amount1))
amountcontrol2:SetText(string.format("%.0f", amount2))
amountcontrol3:SetText(string.format("%.1f%%", amountratio))
countcontrol1:SetText(string.format("%.0f", count1))
countcontrol2:SetText(string.format("%.0f", count2))
countcontrol3:SetText(string.format("%.1f%%", countratio))
end
--amountlabel:SetHidden(hide)
--amountcontrol1:SetHidden(hide)
amountcontrol2:SetHidden(hide3 or hide4)
amountcontrol3:SetHidden(hide4)
--countlabel:SetHidden(hide)
--countcontrol1:SetHidden(hide)
countcontrol2:SetHidden(hide3 or hide2)
countcontrol3:SetHidden(hide2)
end
end
local powerTypeLabels = {
[POWERTYPE_MAGICKA] = "_MAGICKA",
[POWERTYPE_STAMINA] = "_STAMINA",
[POWERTYPE_HEALTH] = "_HEALTH",
}
local attackStatsKeys = { -- {label, format, convert}
[POWERTYPE_MAGICKA] = {
[1] = {"maxmagicka", "%d"},
[2] = {"spellpower", "%d"},
[3] = {"spellcrit", "%.1f%%", true},
[4] = {"spellcritbonus", "%.1f%%"},
[5] = {"spellpen", "%d"},
},
[POWERTYPE_STAMINA] = {
[1] = {"maxstamina", "%d"},
[2] = {"weaponpower", "%d"},
[3] = {"weaponcrit", "%.1f%%", true},
[4] = {"weaponcritbonus", "%.1f%%"},
[5] = {"weaponpen", "%d"},
},
[POWERTYPE_HEALTH] = {
[1] = {"maxhealth", "%d"},
[2] = {"physres", "%d"},
[3] = {"spellres", "%d"},
[4] = {"critres", "%d", "%.1f%%"},
},
}
local function updateFightStatsPanelRight(panel)
CMX.Print("dev", "Updating FightStatsPanelRight")
local data = fightData or {}
local powerType = db.FightReport.fightstatspanel
local category = db.FightReport.category
category = category == "healingIn" and "healingOut" or category
local calculated = data.calculated or {}
local calcstats = calculated.stats or {}
local stats = data.stats or {}
local isdamage = category == "damageOut" or category == "damageIn"
local avgvalues = (powerType == POWERTYPE_HEALTH and calcstats.dmginavg) or (isdamage and calcstats.dmgavg) or calcstats.healavg or {}
local totalvalue = powerType == POWERTYPE_HEALTH and calculated.damageInTotal or calculated[category.."Total"]
local countvalue = calculated[CountStrings[category].."Total"]
local resources = calculated.resources or {}
local magicka = resources[POWERTYPE_MAGICKA] or {}
local stamina = resources[POWERTYPE_STAMINA] or {}
local ultimate = resources[POWERTYPE_ULTIMATE] or {}
local magickacontrol = panel:GetNamedChild("ResourceMagicka")
magickacontrol:GetNamedChild("Value"):SetText(string.format("%.0f", magicka.gainRate or 0))
magickacontrol:GetNamedChild("Value2"):SetText(string.format("%.0f", magicka.drainRate or 0))
local staminacontrol = panel:GetNamedChild("ResourceStamina")
staminacontrol:GetNamedChild("Value"):SetText(string.format("%.0f", stamina.gainRate or 0))
staminacontrol:GetNamedChild("Value2"):SetText(string.format("%.0f", stamina.drainRate or 0))
local ultimatecontrol = panel:GetNamedChild("ResourceUltimate")
ultimatecontrol:GetNamedChild("Value"):SetText(string.format("%.2f", ultimate.gainRate or 0))
ultimatecontrol:GetNamedChild("Value2"):SetText(string.format("%.2f", ultimate.drainRate or 0))
local stringKey = "SI_COMBAT_METRICS_STATS" .. powerTypeLabels[powerType]
local statWindowControl = panel:GetNamedChild("AttackStats")
local keys = attackStatsKeys[powerType]
for i = 1, 4 do
local text = ZO_CachedStrFormat("<<1>>:", GetString(stringKey, i))
local rowcontrol = statWindowControl:GetNamedChild("Row"..i)
local dataKey, displayformat, convert = unpack(keys[i] or {})
if text ~= nil and text ~= "" and dataKey ~= nil then
local maxvalue = stats["max"..dataKey] or 0
if convert == true then maxvalue = GetCriticalStrikeChance(maxvalue) end
if dataKey == POWERTYPE_HEALTH and i == 4 then maxvalue = maxvalue / 68 end -- untested, but good agreement from multiple sources
if displayformat then maxvalue = string.format(displayformat, maxvalue) end
local avgvalue = avgvalues["avg"..dataKey] or calcstats["avg"..dataKey]
if avgvalue == nil then
local legacyvalue = avgvalues["sum"..dataKey]
avgvalue = (legacyvalue and legacyvalue / math.max(convert and countvalue or totalvalue or 1, 1)) or maxvalue
end
if type(avgvalue) == "number" then -- legacy
if convert then avgvalue = GetCriticalStrikeChance(avgvalue) end
if displayformat then avgvalue = string.format(displayformat, avgvalue) end
end
rowcontrol:GetNamedChild("Label"):SetText(text)
rowcontrol:GetNamedChild("Value"):SetText(avgvalue)
rowcontrol:GetNamedChild("Value2"):SetText(maxvalue)
rowcontrol:SetHidden(false)
else
rowcontrol:SetHidden(true)
end
end
local row5 = statWindowControl:GetNamedChild("Row5")
local row6 = statWindowControl:GetNamedChild("Row6")
local resdata = selections.unit[category] and selectionData or calculated or {}
if category == "damageOut" and (powerType == POWERTYPE_MAGICKA or powerType == POWERTYPE_STAMINA) then
local resistvalues = powerType == POWERTYPE_MAGICKA and resdata.spellResistance or powerType == POWERTYPE_STAMINA and resdata.physicalResistance or {}
local dataKey = keys[5][1]
local sum = 0
local totaldamage = 0
local maxvalue = stats["max"..dataKey] or 0
local overpen = 0
for penetration, damage in pairs(resistvalues) do
sum = sum + penetration * damage
maxvalue = math.max(maxvalue, penetration)
totaldamage = totaldamage + damage
if penetration - db.unitresistance > 0 then overpen = overpen + damage end
end
totaldamage = math.max(totaldamage, 1)
local tooltiplines = {GetString(SI_COMBAT_METRICS_PENETRATION_TT)}
for penetration, damage in CMX.spairs(resistvalues) do
local newline = string.format("%d: %.1f%%", penetration, 100 * damage/totaldamage)
table.insert(tooltiplines, newline)
end
local averagePenetration = string.format("%d", math.max(zo_round(sum / totaldamage), avgvalues["avg"..dataKey] or 0))
local overPenetrationRatio = string.format("%.1f%%", 100 * overpen / totaldamage)
row5:SetHidden(false)
row6:SetHidden(false)
local text5 = GetString(stringKey, 5)
row5:GetNamedChild("Label"):SetText(text5)
row5:GetNamedChild("Value"):SetText(averagePenetration)
row5:GetNamedChild("Value2"):SetText(maxvalue)
local text6 = GetString(stringKey, 6)
row6:GetNamedChild("Label"):SetText(text6)
row6:GetNamedChild("Value"):SetText(overPenetrationRatio)
row6.tooltip = #tooltiplines>1 and tooltiplines or nil
else
row5:SetHidden(true)
row6:SetHidden(true)
row6.tooltip = nil
end
end
local function updateFightStatsPanel(panel)
CMX.Print("dev", "Updating FightStatsPanel")
panel:GetNamedChild("Left"):Update(fightData, selectionData)
panel:GetNamedChild("Right"):Update(fightData)
end
local function updateMainPanel(mainpanel)
CMX.Print("dev", "Updating MainPanel")
mainpanel.active:Update()
end
local function adjustRowSize(row, header) -- this function resizes the row elements to match the size of the header elements of a scrolllist.
-- It's important to maintain the naming and structure of the header elements to match those of the row elements.
if row == nil or row.scale == db.FightReport.scale then return end -- if sizes are good already, bail out.
row.scale = db.FightReport.scale
for i=1, header:GetNumChildren() do
local child = header:GetChild(i)
local childname = string.gsub(child:GetName(), header:GetName(), "")
local template = header:GetNamedChild(childname)
local rowchild = row:GetNamedChild(childname)
if template and rowchild then
local x, y = template:GetDimensions()
rowchild:SetDimensions(x, y)
local valid1, _, _, _, x, y, _ = template:GetAnchor(0)
local valid2, point, relativeTo, relativePoint, _, _, _ = rowchild:GetAnchor(0)
if valid1 and valid2 then
rowchild:ClearAnchors()
rowchild:SetAnchor(point, relativeTo, relativePoint, x, y)
end
if rowchild:GetType() == CT_LABEL then rowchild:SetFont(string.format("%s|%s|%s", GetString(SI_COMBAT_METRICS_STD_FONT), tonumber(GetString(SI_COMBAT_METRICS_FONT_SIZE)) * row.scale, "soft-shadow-thin")) end
end
end
end
local function ResetBars(panel)
if panel.bars == nil then panel.bars = {} end
if #panel.bars == 0 then return end
for i=1, #panel.bars do
panel.bars[i]:SetHidden(true)
panel.bars[i] = nil
end
end
local function buffSortFunction(data, a, b)
local ishigher = false
local favs = db.FightReport.FavouriteBuffs
local isFavA = favs[a]
local isFavB = favs[b]
if isFavA and not isFavB then
ishigher = true
elseif isFavA == isFavB then
ishigher = data[a]["groupUptime"] > data[b]["groupUptime"]
end
return ishigher
end
local function GetBuffData()
local buffData
local rightpanel = db.FightReport.rightpanel
if rightpanel == "buffsout" then
buffData = selectionData
elseif rightpanel == "buffs" then
buffData = fightData.calculated
end
return buffData
end
local function GetUnitsByType(unitType)
if not unitType then return end
local units = {}
for unitId, unit in pairs(fightData.units) do
if (unitType == "boss" and unit.bossId) or (unitType == "group" and (unit.unitType == COMBAT_UNIT_TYPE_GROUP or unit.unitType == COMBAT_UNIT_TYPE_PLAYER)) then
units[unitId] = true
end
end
return units
end
local function GetBuffDataAndUnits(unitType)
local buffData
local rightpanel = db.FightReport.rightpanel
local units = 0
local unitName = ""
if rightpanel == "buffsout" then
local category = db.FightReport.category
local tempSelections = {}
ZO_DeepTableCopy(selections, tempSelections)
if unitType then tempSelections.unit[category] = GetUnitsByType(unitType) end
buffData = CMX.GenerateSelectionStats(fightData, category, tempSelections) -- yeah, yeah I'm lazy.
for unitId, _ in pairs(tempSelections.unit[category] or fightData.units) do
local unit = fightData.calculated.units[unitId]
local unitData = fightData.units[unitId]
local unitTotalValue = unit[category.."Total"]
local isNotEmpty = unitTotalValue > 0 or NonContiguousCount(unit.buffs) > 0
local isEnemy = unitData.unitType ~= COMBAT_UNIT_TYPE_GROUP and unitData.unitType ~= COMBAT_UNIT_TYPE_PLAYER_PET and unitData.unitType ~= COMBAT_UNIT_TYPE_PLAYER
local isDamageCategory = category == "damageIn" or category == "damageOut"
if isNotEmpty and (isEnemy == isDamageCategory) then
units = units + 1
unitName = unitData.name
end
end
elseif rightpanel == "buffs" then
buffData = fightData.calculated
end
if units == 1 then units = unitName end
return buffData, units
end
local function updateBuffPanel(panel)
CMX.Print("dev", "Updating BuffPanel")
ResetBars(panel)
if fightData == nil then return end
local buffData = GetBuffData()
if buffData == nil then return end
local scrollchild = GetControl(panel, "PanelScrollChild")
local selectedbuffs = selections["buff"]["buff"]
local currentanchor = {TOPLEFT, scrollchild, TOPLEFT, 0, 1}
local maxtime = math.max(fightData.activetime or 0, fightData.dpstime or 0, fightData.hpstime or 0)
local totalUnitTime = buffData.totalUnitTime or maxtime * 1000
local showids = db.debuginfo.ids
local favs = db.FightReport.FavouriteBuffs
for buffName, buff in CMX.spairs(buffData["buffs"], buffSortFunction) do
if buff.groupUptime > 0 then
-- prepare contents
local color = (buff.effectType == BUFF_EFFECT_TYPE_BUFF and {0, 0.6, 0, 0.6}) or (buff.effectType == BUFF_EFFECT_TYPE_DEBUFF and {0.75, 0, 0.6, 0.6}) or {0.6, 0.6, 0.6, 0.6}
local groupColor = (buff.effectType == BUFF_EFFECT_TYPE_BUFF and {0, 0.6, 0, 0.3}) or (buff.effectType == BUFF_EFFECT_TYPE_DEBUFF and {0.75, 0, 0.6, 0.3}) or {0.6, 0.6, 0.6, 0.3}
local highlight = false
if selectedbuffs ~= nil then highlight = (selectedbuffs[buffName] ~= nil) end
local icon = GetFormattedAbilityIcon(buff.icon)
local dbug = (showids and type(buff.icon) == "number") and string.format("(%d) ", buff.icon) or ""
local name = dbug .. buffName
local uptimeRatio = buff.uptime / totalUnitTime
local groupUptimeRatio = buff.groupUptime / totalUnitTime
local count = buff.count
local groupCount = buff.groupCount
local hideGroupValues = count == groupCount and uptimeRatio == groupUptimeRatio
local countFormat = hideGroupValues and "%d" or "%d/%d"
local uptimeFormat = hideGroupValues and "%.0f%%" or "%.0f%%/%.0f%%"
local rowId = #panel.bars + 1
local rowName = scrollchild:GetName() .. "Row" .. rowId
local row = _G[rowName] or CreateControlFromVirtual(rowName, scrollchild, "CombatMetrics_BuffRowTemplate")
row:SetAnchor(unpack(currentanchor))
row:SetHidden(false)
local header = panel:GetNamedChild("Header")
adjustRowSize(row, header)
local textcolor = favs[buffName] and {1, .8, .3, 1} or {1, 1, 1, 1} -- show favs in different color
-- update controls with contents
local highlightControl = row:GetNamedChild("HighLight")
highlightControl:SetHidden(not highlight)
local iconControl = row:GetNamedChild("Icon")
iconControl:SetTexture(icon)
local nameControl = row:GetNamedChild("Name")
nameControl:SetText(name)
nameControl:SetColor(unpack(textcolor))
local maxwidth = nameControl:GetWidth()
local groupBarControl = row:GetNamedChild("GroupBar")
groupBarControl:SetWidth(maxwidth * groupUptimeRatio)
groupBarControl:SetCenterColor(unpack(groupColor))
local playerBarControl = row:GetNamedChild("PlayerBar")
playerBarControl:SetWidth(maxwidth * uptimeRatio)
playerBarControl:SetCenterColor(unpack(color))
local countControl = row:GetNamedChild("Count")
countControl:SetText(string.format(countFormat, count, groupCount))
local uptimeControl = row:GetNamedChild("Uptime")
uptimeControl:SetText(string.format(uptimeFormat, uptimeRatio * 100, groupUptimeRatio * 100))
currentanchor = {TOPLEFT, row, BOTTOMLEFT, 0, dx}
panel.bars[rowId] = row
row.dataId = buffName
row.type = "buff"
row.id = rowId
row.panel = panel
end
end
end
local function updateResourceBars(panel, currentanchor, data, totalRate, selectedresources, color)
local scrollchild = GetControl(panel, "PanelScrollChild")
local showids = db.debuginfo.ids
for abilityId, ability in CMX.spairs(data, function(t, a, b) return t[a].value>t[b].value end) do
if (ability.ticks or 0) > 0 then
local label = GetFormattedAbilityName(abilityId)
local highlight = false
if selectedresources ~= nil then highlight = selectedresources[abilityId] ~= nil end
local dbug = showids and string.format("(%d) ", abilityId) or ""
local name = dbug..label
local count = ability.ticks
local rate = ability.rate
local ratio = rate/totalRate
local rowId = #panel.bars + 1
local rowName = scrollchild:GetName() .. "Row" .. rowId
local row = _G[rowName] or CreateControlFromVirtual(rowName, scrollchild, "CombatMetrics_ResourceRowTemplate")
row:SetAnchor(unpack(currentanchor))
row:SetHidden(false)
local header = panel:GetNamedChild("Header")
adjustRowSize(row, header)
local highlightControl = row:GetNamedChild("HighLight")
highlightControl:SetHidden(not highlight)
local nameControl = row:GetNamedChild("Name")
nameControl:SetText(name)
local maxwidth = nameControl:GetWidth()
local barControl = row:GetNamedChild("Bar")
barControl:SetWidth(maxwidth * ratio)
barControl:SetCenterColor(unpack(color))
local countControl = row:GetNamedChild("Count")
countControl:SetText(count)
local rateControl = row:GetNamedChild("Rate")
rateControl:SetText(string.format("%.0f", rate))
currentanchor = {TOPLEFT, row, BOTTOMLEFT, 0, dx}
panel.bars[rowId] = row
row.dataId = abilityId
row.type = "resource"
row.id = rowId
row.panel = panel
end
end
return currentanchor
end
local function updateResourcePanel(panel)
CMX.Print("dev", "Updating ResourcePanel")
local subpanel1 = panel:GetNamedChild("Gains")
local subpanel2 = panel:GetNamedChild("Drains")
ResetBars(subpanel1)
ResetBars(subpanel2)
if fightData == nil then return end
local key, color1, color2
local rightpanel = db.FightReport.rightpanel
if rightpanel == "magicka" then
key = POWERTYPE_MAGICKA
color1 = {0.3, 0.4, 0.6, 1}
color2 = {0.4, 0.3, 0.6, 1}
elseif rightpanel == "stamina" then
key = POWERTYPE_STAMINA
color1 = {0.4, 0.6, 0.3, 1}
color2 = {0.4, 0.45, 0.05, 1}
else return end
local data = fightData.calculated.resources[key]
local selectedresources = selections["resource"]["resource"]
local scrollchild = GetControl(subpanel1, "PanelScrollChild")
local currentanchor = {TOPLEFT, scrollchild, TOPLEFT, 0, 1}
updateResourceBars(subpanel1, currentanchor, data.gains, data.gainRate, selectedresources, color1) -- generate bars for resource gains
local scrollchild = GetControl(subpanel2, "PanelScrollChild")
local currentanchor = {TOPLEFT, scrollchild, TOPLEFT, 0, 1}
updateResourceBars(subpanel2, currentanchor, data.drains, data.drainRate, selectedresources, color2) -- generate bars for resource drains
end
local function updateRightPanel(rightPanel)
CMX.Print("dev", "Updating RightPanel")
rightPanel.active:Update()
end
local function GetShortFormattedNumber(number)
local exponent = math.floor(math.log(number)/math.log(10))
local loweredNumber = zo_roundToNearest(number, math.pow(10, exponent-2))
local shortNumber = ZO_AbbreviateNumber(loweredNumber, 2, exponent>=6)
return shortNumber
end
local function updateUnitPanel(panel)
CMX.Print("dev", "Updating UnitPanel")
ResetBars(panel)
-- Update header labels
local category = db.FightReport.category
local isdamage = (category == "damageOut" or category == "damageIn")
local label1 = ((category == "damageOut" or category == "healingOut") and GetString(SI_COMBAT_METRICS_TARGET)) or GetString(SI_COMBAT_METRICS_SOURCE)
local label2 = (isdamage and GetString(SI_COMBAT_METRICS_DPS)) or GetString(SI_COMBAT_METRICS_HPS)
local label3 = (isdamage and GetString(SI_COMBAT_METRICS_DAMAGE)) or GetString(SI_COMBAT_METRICS_HEALING)
local header = panel:GetNamedChild("Header")
header:GetNamedChild("Name"):SetText(label1)
header:GetNamedChild("PerSecond"):SetText(label2)
header:GetNamedChild("Total"):SetText(label3)
-- prepare data
if fightData == nil then return end
local data = fightData.calculated
local selectedunits = selections["unit"][db.FightReport.category]
local totalAmountKey = category.."Total"
local totalAmount = data[totalAmountKey] -- i.e. damageOutTotal
local APSKey = DPSstrings[category]
local scrollchild = GetControl(panel, "PanelScrollChild")
local currentanchor = {TOPLEFT, scrollchild, TOPLEFT, 0, 1}
local rightpanel = db.FightReport.rightpanel
local showids = db.debuginfo.ids
for unitId, unit in CMX.spairs(data.units, function(t, a, b) return t[a][totalAmountKey]>t[b][totalAmountKey] end) do -- i.e. for damageOut sort by damageOutTotal
local totalUnitAmount = unit[totalAmountKey]
local unitData = fightData.units[unitId]
if (totalUnitAmount > 0 or (rightpanel == "buffsout" and NonContiguousCount(unit.buffs) > 0 and (fightData.units[unitId].isFriendly == false and isdamage) or (unitData.isFriendly and not isdamage))) then
local highlight = false
if selectedunits ~= nil then highlight = selectedunits[unitId] ~= nil end
local dbug = showids and string.format("(%d) ", unitId) or ""
local name = dbug .. unitData.name
local isboss = unitData.bossId
local namecolor = (isboss and {1, .8, .3, 1}) or {1, 1, 1, 1}
local unitTime = unitData.dpsend and unitData.dpsstart and math.max((unitData.dpsend - unitData.dpsstart) / 1000, 1) or 1
local dps = unitTime and totalUnitAmount / unitTime or unit[APSKey]
local damage = totalUnitAmount
local ratio = damage / totalAmount
local rowId = #panel.bars + 1
local rowName = scrollchild:GetName() .. "Row" .. rowId
local row = _G[rowName] or CreateControlFromVirtual(rowName, scrollchild, "CombatMetrics_UnitRowTemplate")
row:SetAnchor(unpack(currentanchor))
row:SetHidden(false)
local header = panel:GetNamedChild("Header")
adjustRowSize(row, header)
local highlightControl = row:GetNamedChild("HighLight")
highlightControl:SetHidden(not highlight)
local nameControl = row:GetNamedChild("Name")
nameControl:SetText(name)
--nameControl:SetFont(font)
nameControl:SetColor(unpack(namecolor))
local maxwidth = nameControl:GetWidth()
local barControl = row:GetNamedChild("Bar")
barControl:SetWidth(maxwidth * ratio)
local rateControl = row:GetNamedChild("PerSecond")
rateControl:SetText(string.format("%.0f", dps))
local amountControl = row:GetNamedChild("Total")
amountControl:SetText(GetShortFormattedNumber(damage))
local fractionControl = row:GetNamedChild("Fraction")
fractionControl:SetText(string.format("%.1f%%", 100 * ratio))
currentanchor = {TOPLEFT, row, BOTTOMLEFT, 0, dx}
panel.bars[rowId] = row
row.dataId = unitId
row.type = "unit"
row.id = rowId
row.panel = panel
end
end
end
local hitCritLayoutTable = {
[1] = {"Critical", "Total", GetString(SI_COMBAT_METRICS_CRITS), GetString(SI_COMBAT_METRICS_HITS)},
[2] = {"Total", "Critical", GetString(SI_COMBAT_METRICS_HITS), GetString(SI_COMBAT_METRICS_CRITS)},
[3] = {"Normal", "Critical", GetString(SI_COMBAT_METRICS_NORM), GetString(SI_COMBAT_METRICS_CRITS)},
}
do -- Context Menu for hit/crit column on ability panel
local function selectHitCritOption1()
db.FightReport.hitCritLayout = 1
CombatMetrics_Report_AbilityPanel:Update()
end
local function selectHitCritOption2()
db.FightReport.hitCritLayout = 2
CombatMetrics_Report_AbilityPanel:Update()
end
local function selectHitCritOption3()
db.FightReport.hitCritLayout = 3
CombatMetrics_Report_AbilityPanel:Update()
end
local text1 = string.format("%s/%s", GetString(SI_COMBAT_METRICS_CRITS), GetString(SI_COMBAT_METRICS_HITS))
local text2 = string.format("%s/%s", GetString(SI_COMBAT_METRICS_HITS), GetString(SI_COMBAT_METRICS_CRITS))
local text3 = string.format("%s/%s", GetString(SI_COMBAT_METRICS_NORM), GetString(SI_COMBAT_METRICS_CRITS))
function CMX.HitCritContextMenu(control, button)
ClearMenu()
AddCustomMenuItem(text1, selectHitCritOption1)
AddCustomMenuItem(text2, selectHitCritOption2)
AddCustomMenuItem(text3, selectHitCritOption3)
ShowMenu(control)
end
end
local averageLayoutTable = {
[1] = {"Total", GetString(SI_COMBAT_METRICS_AVE)},
[2] = {"Normal", GetString(SI_COMBAT_METRICS_AVE_N)},
[3] = {"Critical", GetString(SI_COMBAT_METRICS_AVE_C)},
}
do -- Context Menu for average column on ability panel
local function selectAverageOption1()
db.FightReport.averageLayout = 1
CombatMetrics_Report_AbilityPanel:Update()
end
local function selectAverageOption2()
db.FightReport.averageLayout = 2
CombatMetrics_Report_AbilityPanel:Update()
end
local function selectAverageOption3()
db.FightReport.averageLayout = 3
CombatMetrics_Report_AbilityPanel:Update()
end
local text1 = string.format("%s %s", GetString(SI_COMBAT_METRICS_AVERAGE), GetString(SI_COMBAT_METRICS_HITS))
local text2 = string.format("%s %s", GetString(SI_COMBAT_METRICS_AVERAGE), GetString(SI_COMBAT_METRICS_NORMAL_HITS))
local text3 = string.format("%s %s", GetString(SI_COMBAT_METRICS_AVERAGE), GetString(SI_COMBAT_METRICS_CRITS))
function CMX.AverageContextMenu(control, button)
ClearMenu()
AddCustomMenuItem(text1, selectAverageOption1)
AddCustomMenuItem(text2, selectAverageOption2)
AddCustomMenuItem(text3, selectAverageOption3)
ShowMenu(control)
end
end
do -- Context Menu for Min/Max column on ability panel
local function selectMinMaxOption1()
db.FightReport.maxValue = true
CombatMetrics_Report_AbilityPanel:Update()
end
local function selectMinMaxOption2()
db.FightReport.maxValue = false
CombatMetrics_Report_AbilityPanel:Update()
end
local text1 = string.format("%s", GetString(SI_COMBAT_METRICS_MAX))
local text2 = string.format("%s", GetString(SI_COMBAT_METRICS_MIN))
function CMX.MinMaxContextMenu(control, button)
ClearMenu()
AddCustomMenuItem(text1, selectMinMaxOption1)
AddCustomMenuItem(text2, selectMinMaxOption2)
ShowMenu(control)
end
end
local function updateAbilityPanel(panel)
CMX.Print("dev", "Updating AbilityPanel")
ResetBars(panel)
local settings = db.FightReport
local category = settings.category
local hitCritLayout = hitCritLayoutTable[settings.hitCritLayout]
local averageLayout = averageLayoutTable[settings.averageLayout]
local minmax = settings.maxValue
local isDamage = category == "damageIn" or category == "damageOut"
local showOverHeal = CMX.showOverHeal and category == "healingOut"
local valueColumnLabel = isDamage and GetString(SI_COMBAT_METRICS_DAMAGE) or GetString(SI_COMBAT_METRICS_HEALING)
if showOverHeal then valueColumnLabel = valueColumnLabel .. "*" end
local header = panel:GetNamedChild("Header")
header:GetNamedChild("Total"):SetText(valueColumnLabel)
local headerCritString = showOverHeal and GetString(SI_COMBAT_METRICS_OH) or category == "damageIn" and GetString(SI_COMBAT_METRICS_BLOCKS) or hitCritLayout[3]
local headerHitString = showOverHeal and GetString(SI_COMBAT_METRICS_HEALS) or category == "damageIn" and GetString(SI_COMBAT_METRICS_HITS) or hitCritLayout[4]
local headerCritRatioString = showOverHeal and GetString(SI_COMBAT_METRICS_OH) or category == "damageIn" and GetString(SI_COMBAT_METRICS_BLOCKS) or GetString(SI_COMBAT_METRICS_CRITS)
header:GetNamedChild("Crits"):SetText(headerCritString)
header:GetNamedChild("Hits"):SetText("/" .. headerHitString)
header:GetNamedChild("CritRatio"):SetText(headerCritRatioString.. "%")
local headerAvg = header:GetNamedChild("Average")
headerAvg:SetText(averageLayout[2])
local headerMinMax = header:GetNamedChild("MinMax")
headerMinMax:SetText(GetString(minmax and SI_COMBAT_METRICS_MAX or SI_COMBAT_METRICS_MIN))
if fightData == nil then return end
local data
local totaldmg
local selectedabilities = selections["ability"][category]
local selectedunits = selections["unit"][category]
local totalkey = "Total"
local totalAmountKey = showOverHeal and "healingOutAbsolute" or category..totalkey
local countString = CountStrings[category]
if selectedunits ~= nil then
data = selectionData
totaldmg = selectionData.totalValueSum
else
data = fightData.calculated
totaldmg = data[totalAmountKey]
end
local scrollchild = GetControl(panel, "PanelScrollChild")
local currentanchor = {TOPLEFT, scrollchild, TOPLEFT, 0, 1}
local totalHitKey = showOverHeal and "healsOutAbsolute" or countString..totalkey
local critKey = showOverHeal and "healsOutOverflow" or countString.."Critical"
local ratioKey1 = showOverHeal and "healsOutOverflow" or category == "damageIn" and countString.."Blocked" or countString..hitCritLayout[1] -- first value of the crits/hits column display
local ratioKey2 = showOverHeal and "healsOutAbsolute" or category == "damageIn" and totalHitKey or countString..hitCritLayout[2] -- second value of the crits/hits column display
local avgKey1 = showOverHeal and "healingOutAbsolute" or category..averageLayout[1] -- damage value of the avg column display
local avgKey2 = showOverHeal and "healsOutAbsolute" or countString..averageLayout[1] -- hits value of the avg column display
local DPSKey = showOverHeal and "HPSAOut" or DPSstrings[category]
local showids = db.debuginfo.ids
for abilityId, ability in CMX.spairs(data[category], function(t, a, b) return t[a][totalAmountKey]>t[b][totalAmountKey] end) do
if ability[totalAmountKey]>0 then
local highlight = false
if selectedabilities ~= nil then
highlight = selectedabilities[abilityId] ~= nil
end
local icon = GetFormattedAbilityIcon(abilityId)
local dot = (GetAbilityDuration(abilityId)>0 or (IsAbilityPassive(abilityId) and isDamage)) and "*" or ""
local pet = ability.pet and " (pet)" or ""
local dbug = showids and string.format("(%d) ", abilityId) or ""
local color = ability.damageType and CMX.GetDamageColor(ability.damageType) or ""
local name = dbug..color..(ability.name or GetFormattedAbilityName(abilityId))..dot..pet.."|r"
local dps = ability[DPSKey]
local total = ability[totalAmountKey]
local ratio = total and totaldmg and totaldmg > 0 and (total / totaldmg)
local crits = ability[critKey]
local hits = ability[totalHitKey]
local critratio = crits and hits and hits > 0 and (100 * crits / hits)
local ratio1 = ability[ratioKey1]
local ratio2 = ability[ratioKey2]
local avg1 = ability[avgKey1]
local avg2 = ability[avgKey2] or 0
local avg = avg2 ~= 0 and (avg1 / avg2)
local minmaxValue = (showOverHeal and "-") or (minmax and ability.max) or (ability.min or 0)
local rowId = #panel.bars + 1
local rowName = scrollchild:GetName() .. "Row" .. rowId
local row = _G[rowName] or CreateControlFromVirtual(rowName, scrollchild, "CombatMetrics_AbilityRowTemplate")
row:SetAnchor(unpack(currentanchor))
row:SetHidden(false)
adjustRowSize(row, header)
local highlightControl = row:GetNamedChild("HighLight")
highlightControl:SetHidden(not highlight)
local iconControl = row:GetNamedChild("Icon")
iconControl:SetTexture(icon)
local nameControl = row:GetNamedChild("Name")
nameControl:SetText(name)
local maxwidth = nameControl:GetWidth()
local barControl = row:GetNamedChild("Bar")
barControl:SetWidth(maxwidth * ratio)
local fractionControl = row:GetNamedChild("Fraction")
fractionControl:SetText(ratio and string.format("%.1f%%", 100 * ratio) or "-")
local rateControl = row:GetNamedChild("PerSecond")
rateControl:SetText(dps and string.format("%.0f", dps) or "-")
local amountControl = row:GetNamedChild("Total")
amountControl:SetText(total or "-")
local critControl = row:GetNamedChild("Crits")
critControl:SetText(ratio1 or "-")
local hitsControl = row:GetNamedChild("Hits")
hitsControl:SetText(string.format("/%d", ratio2 or "-"))
local critFractionControl = row:GetNamedChild("CritRatio")
critFractionControl:SetText(critratio and string.format("%.0f%%", critratio) or "-")
local avgControl = row:GetNamedChild("Average")
avgControl:SetText(avg and string.format("%.0f", avg) or "-")
local maxControl = row:GetNamedChild("MinMax")
maxControl:SetText(minmaxValue)
currentanchor = {TOPLEFT, row, BOTTOMLEFT, 0, dx}
panel.bars[rowId] = row
row.dataId = abilityId
row.type = "ability"
row.id = rowId
row.panel = panel
end
end
end
local logtypeCategories = {
[LIBCOMBAT_EVENT_DAMAGE_OUT] = "damageOut",
[LIBCOMBAT_EVENT_DAMAGE_IN] = "damageIn",
[LIBCOMBAT_EVENT_DAMAGE_SELF] = "damageSelf",
[LIBCOMBAT_EVENT_HEAL_OUT] = "healingOut",
[LIBCOMBAT_EVENT_HEAL_IN] = "healingIn",
[LIBCOMBAT_EVENT_HEAL_SELF] = "healSelf",
[LIBCOMBAT_EVENT_EFFECTS_IN] = "buff",
[LIBCOMBAT_EVENT_EFFECTS_OUT] = "buff",
[LIBCOMBAT_EVENT_GROUPEFFECTS_IN] = "buff",
[LIBCOMBAT_EVENT_GROUPEFFECTS_OUT] = "buff",
[LIBCOMBAT_EVENT_PLAYERSTATS] = "stats",
[LIBCOMBAT_EVENT_RESOURCES] = "resource",
[LIBCOMBAT_EVENT_MESSAGES] = "message",
}
local function updateCLPageButtons(buttonrow, page, maxpage)
local first = math.max(page-2, 1)
local last = first + 4
buttonrow:GetNamedChild("PageLeft"):SetHidden(page == 1)
buttonrow:GetNamedChild("PageRight"):SetHidden(page >= maxpage)
for i = first, last do
local key = "Page" .. (i - first + 1)
local button = buttonrow:GetNamedChild(key)
button.tooltip = {zo_strformat(SI_COMBAT_METRICS_PAGE, i)}
button.value = i
button:SetHidden(i > maxpage)
buttonrow:GetNamedChild(key .. "Label"):SetText(i)
local bg = buttonrow:GetNamedChild(key.."Overlay")
bg:SetCenterColor( 0 , 0 , 0 , page == i and 0 or 0.8 )
bg:SetEdgeColor( 1 , 1 , 1 , page == i and 1 or .4 )
end
end
local function updateCombatLog(panel)
if fightData == nil or panel:IsHidden() then return end
CMX.Print("dev", "Updating CombatLog")
local CLSelection = db.FightReport.CLSelection
local window = panel:GetNamedChild("Window")
local buffer = window:GetNamedChild("Buffer")
local slider = window:GetNamedChild("Slider")
local logdata = fightData.log or {}
local loglength = #logdata
buffer:Clear()
if loglength == 0 then return end
buffer:SetMaxHistoryLines(math.min(loglength, 1000))
buffer:SetFont(string.format("%s|%s|%s", GetString(SI_COMBAT_METRICS_STD_FONT), tonumber(GetString(SI_COMBAT_METRICS_FONT_SIZE)) * db.FightReport.scale, ""))
local maxpage = math.ceil(loglength/1000)
local page = (currentCLPage or 1) <= maxpage and currentCLPage or 1
local writtenlines = 0
local unitSelection = selections.unit
local abilitySelection = selections.ability
local buffSelection = selections.buff.buff
local resourceSelection = selections.resource.resource
local unitSelectionAll = {}
local unitsSelected = false
for _, category in pairs({"healingIn", "healingOut", "damageIn", "damageOut"}) do
local subcategory = unitSelection[category]
if subcategory ~= nil then
for unitId, bool in pairs(subcategory) do
unitSelectionAll[unitId] = bool
unitsSelected = true
end
end
end
for k, logline in ipairs(logdata) do
local condition1, condition2 = false, false
local logtype = logline[1]
local condition1 =
CLSelection[logtype]
or (logtype == LIBCOMBAT_EVENT_DAMAGE_SELF and (CLSelection[LIBCOMBAT_EVENT_DAMAGE_IN] or CLSelection[LIBCOMBAT_EVENT_DAMAGE_OUT]))
or (logtype == LIBCOMBAT_EVENT_HEAL_SELF and (CLSelection[LIBCOMBAT_EVENT_HEAL_IN] or CLSelection[LIBCOMBAT_EVENT_HEAL_OUT]))
or (logtype == LIBCOMBAT_EVENT_BOSSHP and (CLSelection[LIBCOMBAT_EVENT_MESSAGES]))
if condition1 == true then
local category = logtypeCategories[logtype]
local unitSelCat = unitSelection[category]
if logtype == LIBCOMBAT_EVENT_DAMAGE_IN or logtype == LIBCOMBAT_EVENT_DAMAGE_OUT or logtype == LIBCOMBAT_EVENT_HEAL_IN or logtype == LIBCOMBAT_EVENT_HEAL_OUT then
local sourceUnitId = logline[4]
local targetUnitId = logline[5]
local abilityId = logline[6]
condition2 = (
unitSelCat == nil
or (unitSelCat[targetUnitId]~= nil and (logtype == LIBCOMBAT_EVENT_HEAL_OUT or logtype == LIBCOMBAT_EVENT_DAMAGE_OUT))
or (unitSelCat[sourceUnitId]~= nil and (logtype == LIBCOMBAT_EVENT_HEAL_IN or logtype == LIBCOMBAT_EVENT_DAMAGE_IN))
) and (
abilitySelection[category] == nil
or abilitySelection[category][abilityId] ~= nil
)
elseif logtype == LIBCOMBAT_EVENT_HEAL_SELF then
local sourceUnitId = logline[4]
local targetUnitId = logline[5]
local abilityId = logline[6]
condition2 = (
(unitSelection.healingIn == nil and CLSelection[LIBCOMBAT_EVENT_HEAL_IN])
or (unitSelection.healingIn ~= nil and unitSelection.healingIn[sourceUnitId] ~= nil)
or (unitSelection.healingOut == nil and CLSelection[LIBCOMBAT_EVENT_HEAL_OUT])
or (unitSelection.healingOut ~= nil and unitSelection.healingOut[targetUnitId] ~= nil)
) and (
(abilitySelection.healingIn == nil and CLSelection[LIBCOMBAT_EVENT_HEAL_IN])
or (abilitySelection.healingIn ~= nil and abilitySelection.healingIn[abilityId] ~= nil)
or (abilitySelection.healingOut == nil and CLSelection[LIBCOMBAT_EVENT_HEAL_OUT])
or (abilitySelection.healingOut ~= nil and abilitySelection.healingOut[abilityId] ~= nil)
)
elseif logtype == LIBCOMBAT_EVENT_EFFECTS_IN or logtype == LIBCOMBAT_EVENT_EFFECTS_OUT or logtype == LIBCOMBAT_EVENT_GROUPEFFECTS_IN or logtype == LIBCOMBAT_EVENT_GROUPEFFECTS_OUT then
local unitId = logline[3]
local abilityId = logline[4]
local ability = GetFormattedAbilityName(abilityId)
condition2 = (
buffSelection == nil and unitsSelected==false)
or (buffSelection ~= nil and buffSelection[ability]~= nil and unitsSelected == false)
or (buffSelection == nil and unitSelectionAll[unitId]~= nil)
or (buffSelection ~= nil and buffSelection[ability] ~= nil and unitsSelected == true and unitSelectionAll[unitId] ~= nil
)
elseif logtype == LIBCOMBAT_EVENT_RESOURCES then
local abilityId = logline[3]
local powerType = logline[5]
condition2 = powerType ~= POWERTYPE_HEALTH and (resourceSelection == nil or resourceSelection[abilityId or 0] ~= nil)
elseif logtype == LIBCOMBAT_EVENT_PLAYERSTATS or logtype == LIBCOMBAT_EVENT_MESSAGES or logtype == LIBCOMBAT_EVENT_SKILL_TIMINGS or logtype == LIBCOMBAT_EVENT_BOSSHP then
condition2 = true
end
if condition2 == true then
writtenlines = writtenlines + 1
if writtenlines >= (page-1)*1000 and writtenlines < page*1000 then
local text, color = CMX.GetCombatLogString(fightData, logline, fontsize)
window:AddColoredText(text, color)
end
end
end
end
maxpage = math.max(math.ceil(writtenlines/1000), 1)
local buttonrow = GetControl(panel, "HeaderPageButtonRow")
buttonrow:Update(page, maxpage)
local offset = buffer:GetNumHistoryLines()
buffer:SetScrollPosition(math.min(buffer:GetScrollPosition() + offset, math.floor(buffer:GetNumHistoryLines()-(buffer:GetNumVisibleLines())/dx))) -- correct for ui scale
slider:SetValue(slider:GetValue() - offset)
end
local CMX_PLOT_DIMENSION_X = 1
local CMX_PLOT_DIMENSION_Y = 2
local function MapValue(plotWindow, dimension, value, norm)
local minRange, maxRange
if norm then
minRange = 0
maxRange = 1
else
local range = dimension == CMX_PLOT_DIMENSION_X and plotWindow.RangesX or plotWindow.RangesY
minRange, maxRange = unpack(range)
end
local controlSize = dimension == CMX_PLOT_DIMENSION_X and plotWindow:GetWidth() or plotWindow:GetHeight()
local IsInRange = (value < maxRange) and (value > minRange)
local offset = controlSize * ((value - minRange)/(maxRange - minRange))
return offset, IsInRange
end
local function MapValueXY(plotWindow, x, y, normX, normY)
local XOffset, IsInRangeX = plotWindow:MapValue(CMX_PLOT_DIMENSION_X, x, normX)
local YOffset, IsInRangeY = plotWindow:MapValue(CMX_PLOT_DIMENSION_Y, y, normY)
local IsInRange = IsInRangeX and IsInRangeY
return XOffset, YOffset, IsInRange
end
local function MapUIPos(plotWindow, dimension, value)
local range = dimension == CMX_PLOT_DIMENSION_X and plotWindow.RangesX or plotWindow.RangesY
local minRange, maxRange = unpack(range)
local minCoord = dimension == CMX_PLOT_DIMENSION_X and plotWindow:GetLeft() or plotWindow:GetTop()
local maxCoord = dimension == CMX_PLOT_DIMENSION_X and plotWindow:GetRight() or plotWindow:GetBottom()
local IsInRange = (value < maxCoord) and (value > minCoord)
local relpos = (value - minCoord) / (maxCoord - minCoord)
if dimension == CMX_PLOT_DIMENSION_Y then relpos = 1 - relpos end -- since coords start at topleft but a plot from bottom left
local value = relpos * (maxRange - minRange) + minRange
return value, IsInRange
end
local function MapUIPosXY(plotWindow, x, y)
local t, IsInRangeX = plotWindow:MapUIPos(CMX_PLOT_DIMENSION_X, x)
local v, IsInRangeY = plotWindow:MapUIPos(CMX_PLOT_DIMENSION_Y, y)
local IsInRange = IsInRangeX and IsInRangeY
return t, v, IsInRange
end
local function DrawLine(plot, coords, id)
local plotid = plot.id
local lineControls = plot.lineControls
if lineControls[id] == nil then
lineControls[id] = CreateControlFromVirtual("$(parent)Line", plot, "CombatMetrics_PlotLine", id)
end
local line = lineControls[id]
local PlotColors = db.FightReport.PlotColors
line:SetThickness(dx * 2)
line:SetColor(unpack(db.FightReport.PlotColors[plotid]))
line:ClearAnchors()
local x1, y1, x2, y2, inRange1, inRange2 = unpack(coords)
local minX = 0
local minY = 0
local maxX, maxY = plot:GetDimensions()
local outOfRange =
( x1 < minX and x2 < minX ) or
( x1 > maxX and x2 > maxX ) or
( y1 < minY and y2 < minY ) or
( y1 > maxY and y2 > maxY )
if outOfRange then -- line is completely out of drawing area
line:SetHidden(false)
return
elseif not (inRange1 and inRange2) then -- line is partially out of drawing area
local m = (y2 - y1) / (x2 - x1)
local n = y1 - (m * x1)
if y1 > maxY then
x1 = m == 0 and x1 or (maxY - n) / m
y1 = maxY
elseif y1 < minY then
x1 = m == 0 and x1 or (minY - n) / m
y1 = minY
end
if y2 > maxY then
x2 = m == 0 and x2 or (maxY - n) / m
y2 = maxY
elseif y2 < minY then
x2 = m == 0 and x2 or (minY - n) / m
y2 = minY
end
if x1 < minX then
x1 = minX
y1 = m * minX + n
end
if x2 > maxX then
x2 = maxX
y2 = m * maxX + n
end
end
-- in the end it is still possible that y values are out of range, in this case, the line doesn't touch the window.
local inRange = y1 >= minY and y1 <= maxY and y2 >= minY and y2 <= maxY and x2 >= minX and x1 <= maxX
if not inRange then
line:SetHidden(false)
return
end
local side1 = BOTTOMLEFT
local side2 = TOPRIGHT
if y1 > y2 then
side1 = TOPLEFT
side2 = BOTTOMRIGHT
end
line:SetAnchor(side1, plot, BOTTOMLEFT, x1, -y1)
line:SetAnchor(side2, plot, BOTTOMLEFT, x2, -y2)
line:SetHidden(false)
end
local function DrawBar(plot, x1, x2, id)
local plotid = plot.id
local barControls = plot.barControls
if barControls[id] == nil then
barControls[id] = CreateControlFromVirtual("$(parent)Bar", plot, "CombatMetrics_PlotBar", id)
end
local bar = barControls[id]
bar:ClearAnchors()
local minX = 0
local xoffset = plot.xoffset
local maxX, _ = plot:GetDimensions() - xoffset
local outOfRange = ( x2 < minX ) or ( x1 > maxX )
if outOfRange then -- bar is completely out of drawing area
bar:SetHidden(false)
return
end
local left = math.max(x1, minX) + xoffset
local right = math.min(x2, maxX) + xoffset
local PlotColors = db.FightReport.PlotColors
local color = plot.effectType == BUFF_EFFECT_TYPE_BUFF and PlotColors[6] or PlotColors[7]
bar:SetAnchor(TOPLEFT, plot, TOPLEFT, left, 0)
bar:SetAnchor(BOTTOMRIGHT, plot, BOTTOMLEFT, right, 0)
bar:SetCenterColor(unpack(color))
bar:SetHidden(false)
end
local COMBAT_METRICS_YAXIS_LEFT = 1
local COMBAT_METRICS_YAXIS_RIGHT = 2
local function DrawXYPlot(plot)
local plotWindow = plot:GetParent()
local XYData = plot.XYData
if XYData == nil then return end
local coordinates = {}
plot.coordinates = coordinates
for id, line in ipairs(plot.lineControls) do -- hide previous Plot
line:SetHidden(true)
end
local x0
local y0
local inRange0
local normY = plot.YAxisSide == COMBAT_METRICS_YAXIS_RIGHT
for i, dataPair in ipairs(XYData) do
local t, v = unpack(dataPair)
local x, y, inRange = plotWindow:MapValueXY(t, v, false, normY)
coordinates[i] = {x, y, inRange}
if i > 1 then
local lineCoords = {x0, y0, x, y, inRange0, inRange}
local id = i - 1
DrawLine(plot, lineCoords, id)
end
x0 = x
y0 = y
inRange0 = inRange
end
end
local function DrawBarPlot(plot)
local plotWindow = plot:GetParent()
local bardata = plot.bardata
if bardata == nil then return end
for id, bar in ipairs(plot.barControls) do -- hide previous Plot
bar:SetHidden(true)
end
for id, times in ipairs(bardata) do
local t1, t2 = unpack(times)
local x1, inRange1 = plotWindow:MapValue(CMX_PLOT_DIMENSION_X, t1, false)
local x2, inRange2 = plotWindow:MapValue(CMX_PLOT_DIMENSION_X, t2, false)
DrawBar(plot, x1, x2, id)
end
end
local CMX_PLOT_TYPE_XY = 1
local CMX_PLOT_TYPE_BAR = 2
local plotTypeTemplates = {
[CMX_PLOT_TYPE_XY] = "CombatMetrics_PlotControlXY",
[CMX_PLOT_TYPE_BAR] = "CombatMetrics_PlotControlBar",
}
local function Smooth(category)
if fightData == nil then return end
local calcData = fightData.calculated
local category = category or db.FightReport.category
local data = calcData.graph and calcData.graph[category] or nil -- DPS data, one value per second
if data == nil then return end
local totaltime = fightData.combattime
local smoothWindow = db.FightReport.SmoothWindow
local XYData = {}
local t2 = math.ceil(totaltime) - smoothWindow
for t = 0, t2 do
local sum = 0
for i = 0, smoothWindow - 1 do
sum = sum + (data[t + i] or 0)
end
local x = t + smoothWindow / 2
local y = sum / smoothWindow
if t == 0 then table.insert(XYData, {0, y}) end
table.insert(XYData, {x, y})
if t == t2 then table.insert(XYData, {totaltime, y}) end
end
return XYData, COMBAT_METRICS_YAXIS_LEFT, 1
end
local function Total(category)
if fightData == nil then return end
local calcData = fightData.calculated
local category = category or db.FightReport.category
local data = calcData.graph and calcData.graph[category] or nil -- DPS data, one value per second
if data == nil then return end
local totaltime = fightData.combattime
local XYData = {}
local t2 = math.ceil(totaltime)
local sum = 0
local t0
local tmax
local combatstart = fightData.combatstart
if category == "healingOut" or category == "healingIn" then
t0 = (fightData.hpsstart - combatstart) / 1000 or 0
tmax = (fightData.hpsend - combatstart) / 1000 or 1
else
t0 = (fightData.dpsstart - combatstart) / 1000 or 0
tmax = (fightData.dpsend - combatstart) / 1000 or 1
end
local startpoint = math.max(db.FightReport.SmoothWindow / 2, t0)
for t = 0, t2 do
sum = sum + (data[t] or 0)
if t >= startpoint and t <= math.ceil(tmax) then
local x = t
local y = sum / (math.min(tmax, t) - t0)
table.insert(XYData, {x, y})
end
end
return XYData, COMBAT_METRICS_YAXIS_LEFT, 1
end
local function Absolute(category)
if fightData == nil then return end
local calcData = fightData.calculated
local category = category or db.FightReport.category
local data = calcData.graph and calcData.graph[category] or nil -- DPS data, one value per second
if data == nil then return end
local totaltime = fightData.combattime
local XYData = {}
local t2 = math.ceil(totaltime)
local sum = 0
for t = 0, t2 do
sum = sum + (data[t] or 0)
table.insert(XYData, {t, sum})
end
for i, xyData in ipairs(XYData) do
xyData[2] = xyData[2]/sum
end
return XYData, COMBAT_METRICS_YAXIS_RIGHT, sum
end
local powerTypeKeyTable = {
[POWERTYPE_HEALTH] = "maxmaxhealth",
[POWERTYPE_MAGICKA] = "maxmaxmagicka",
[POWERTYPE_STAMINA] = "maxmaxstamina",
}
local oldX, oldY
local function updateXYData(XYData, x, y)
if #XYData == 0 then
oldX = -1
oldY = y
end
if x - 1 > oldX and oldY and oldY ~= y then
table.insert(XYData, {oldX + 1, oldY})
end
if x - 2 > oldX and oldY then
table.insert(XYData, {x - 1, oldY})
end
if x > oldX then
table.insert(XYData, {x, y})
oldX = x
end
oldY = y
end
local function ResourceAbsolute(powerType)
if powerType == nil or fightData == nil or fightData.log == nil then return end
local logData = fightData.log
local combatstart = fightData.combatstart/1000
local XYData = {}
local value
for line, lineData in ipairs(logData) do
if lineData[1] == LIBCOMBAT_EVENT_RESOURCES and lineData[5] == powerType and lineData[6] then
local deltatime = math.floor(lineData[2]/1000 - combatstart)
value = lineData[6] or 0
updateXYData(XYData, deltatime, value)
end
end
if value then updateXYData(XYData, fightData.combattime, value) end
local key = powerTypeKeyTable[powerType]
local maxValue = powerType == POWERTYPE_ULTIMATE and 500 or fightData.stats[key]
for i, xyData in ipairs(XYData) do
xyData[2] = xyData[2]/maxValue
end
return XYData, COMBAT_METRICS_YAXIS_RIGHT, maxValue
end
local function BossHPAbsolute()
if fightData == nil or fightData.log == nil then return end
local logData = fightData.log
local combatstart = fightData.combatstart/1000
local XYData = {}
local x = -1
local y
local maxhp = 0
for line, lineData in ipairs(logData) do
if lineData[1] == LIBCOMBAT_EVENT_BOSSHP then
local deltatime = math.floor(lineData[2]/1000 - combatstart)
maxhp = math.max(lineData[5], maxhp)
if deltatime > x then
x = deltatime
y = lineData[4]
table.insert(XYData, {x, y})
end
end
end
for i, xyData in ipairs(XYData) do
xyData[2] = xyData[2]/maxhp
end
return XYData, COMBAT_METRICS_YAXIS_RIGHT, maxhp
end
local function StatAbsolute(statId)
if fightData == nil or fightData.log == nil then return end
local logData = fightData.log
local combatstart = fightData.combatstart/1000
local XYData = {}
local maxvalue = 0
local value
for line, lineData in ipairs(logData) do
if lineData[1] == LIBCOMBAT_EVENT_PLAYERSTATS and lineData[5] == statId then
value = lineData[4]
maxvalue = math.max(value, maxvalue)
local deltatime = math.floor(lineData[2]/1000 - combatstart)
updateXYData(XYData, deltatime, value)
end
end
updateXYData(XYData, fightData.combattime, value)
for i, xyData in ipairs(XYData) do
xyData[2] = xyData[2]/maxvalue
end
return XYData, COMBAT_METRICS_YAXIS_RIGHT, maxvalue
end
local function AcquireBuffData(buffName)
if fightData == nil or fightData.log == nil then return end
local rightpanel = db.FightReport.rightpanel
local category = db.FightReport.category
local unitselections = rightpanel == "buffs" and {[fightData.playerid] = 1} or selections.unit[category]
local logData = fightData.log
if logData == nil then return end
local combatstart = fightData.combatstart/1000
local combattime = fightData.combattime
local timeData = {}
local first = true
local lastSlot
local lastUnit
local slots = {}
local showGroupBuffs = db.FightReport.ShowGroupBuffsInPlots
for line, lineData in ipairs(logData) do
local result, timems, unitId, abilityId, changeType = unpack(lineData) -- unpack only runs until it encounters nil
local effectSlot = lineData[9] -- so effectSlot has to be taken separately
local isResult = result == LIBCOMBAT_EVENT_EFFECTS_IN or result == LIBCOMBAT_EVENT_EFFECTS_OUT
local isGroupResult = showGroupBuffs and (result == LIBCOMBAT_EVENT_GROUPEFFECTS_IN or result == LIBCOMBAT_EVENT_GROUPEFFECTS_OUT)
if (isResult or isGroupResult) and GetFormattedAbilityName(abilityId) == buffName and ((unitselections and unitselections[unitId]) or (unitselections == nil)) then
local deltatime = timems/1000 - combatstart
if changeType == EFFECT_RESULT_GAINED and deltatime < combattime then
slots[effectSlot] = deltatime
first = false
lastSlot = effectSlot
lastUnit = unitId
elseif changeType == EFFECT_RESULT_FADED then
local starttime = first and 0 or slots[effectSlot] or nil
if starttime and deltatime > starttime and deltatime > 0 then
local previoustimes = timeData[#timeData]
local prevend = previoustimes and previoustimes[2] or nil
local prevunit = previoustimes and previoustimes[3] or nil
if prevend and (math.abs(starttime - prevend)) < 0.02 and prevunit == unitId then -- to avoid drawing too many controls: if a buff is renewed within 20 ms, consider it continious
previoustimes[2] = deltatime
else
table.insert(timeData, {starttime, deltatime, unitId})
end
end
lastSlot = nil
end
end
end
if lastSlot then
local unittime = fightData.calculated.units[lastUnit].endtime
local endtime = unittime and (unittime/1000 - combatstart) or fightData.combattime
if slots[lastSlot] < endtime then table.insert(timeData, {slots[lastSlot], endtime}) end
end
return timeData
end
local function GetScale(x1, x2) -- e.g. 34596 and 42693
local distance = math.max(x2 - x1, 1) -- 8097
local power = math.pow(10, math.floor(math.log10(distance/2))) -- math.pow(10, math.floor(3.61) = math.pow(10, 3) = 1000
local high = math.ceil(x2 / power) * power -- 43000
local low = math.floor(x1 / power) * power -- 34000
local size = (high - low) / power -- 9000 / 1000 = 9
local rangesizes = {1, 2, 4, 6, 8, 10, 12, 16, 20}
local cleansize
for i, value in ipairs(rangesizes) do
if size <= value then
cleansize = value -- 10
break
end
end
local delta = cleansize - size -- 1
local cleanLow = low - math.floor(delta / 2) * power -- 34000 - math.floor(0.5) * 1000 = 34000
local cleanHigh = high + math.ceil(delta / 2) * power -- 34000 - math.ceil(0.5) * 1000 = 44000
if cleanLow < 0 then
cleanHigh = cleanHigh - cleanLow
cleanLow = 0
end
local cleanDist = cleanHigh - cleanLow
return cleanLow, cleanHigh
end
local function GetTickValues(low, high)
local tickValues = {low, 0, 0, 0, high}
for i = 2,4 do
tickValues[i] = math.floor(low + (high - low) * (i - 1) / 4)
end
return tickValues
end
local function UpdateScales(plotWindow, ranges, exact)
local xMin, xMax, yMin, yMax = unpack(ranges)
if not exact then
xMin, xMax = GetScale(xMin, xMax)
yMin, yMax = GetScale(yMin, yMax)
end
local ticksX = GetTickValues(xMin, xMax)
local ticksY = GetTickValues(yMin, yMax)
plotWindow.RangesX = {xMin, xMax, ticksX}
plotWindow.RangesY = {yMin, yMax, ticksY}
for i = 1,5 do
local ticklabelX = GetControl(plotWindow:GetName(), "XTick" .. i .. "Label")
local ticklabelY = GetControl(plotWindow:GetName(), "YTick" .. i .. "Label")
ticklabelX:SetText(tostring(ticksX[i]))
ticklabelY:SetText(tostring(ticksY[i]))
end
end
local function AcquireRange(XYData)
local minX = 0
local maxX = 0
local minY = 0
local maxY = 0
for i, coords in ipairs(XYData) do
local x, y = unpack(coords)
minX = math.min(minX, x)
maxX = math.max(maxX, x)
minY = math.max(minY, y)
maxY = math.max(maxY, y)
end
local range = {minX, maxX, minY, maxY}
return range
end
local function GetRequiredRange(plotWindow, newRange, startZero)
local oldRangeX = plotWindow.RangesX
local oldRangeY = plotWindow.RangesY
local minXOld = oldRangeX[1]
local maxXOld = oldRangeX[2]
local minYOld = oldRangeY[1]
local maxYOld = oldRangeY[2]
local minX, maxX, minY, maxY = unpack(newRange)
local minXNew = startZero and 0 or math.min(minXOld, minX)
local maxXNew = math.max(maxXOld, maxX)
local minYNew = startZero and 0 or math.min(minYOld, minY)
local maxYNew = math.max(maxYOld, maxY)
local isChanged = minXOld ~= minXNew or maxXOld ~= maxXNew or minYOld ~= minYNew or maxYOld ~= maxYNew
return {minXNew, maxXNew, minYNew, maxYNew}, isChanged
end
local function UpdateXYPlot(plot)
local func = plot.func
local XYData, YAxisSide
if func then
XYData, YAxisSide, plot.AbsoluteYRange = func()
end
if XYData == nil then
plot:SetHidden(true)
return
end
plot:SetHidden(false)
local range = AcquireRange(XYData)
if YAxisSide == COMBAT_METRICS_YAXIS_RIGHT then
range[3] = 0
range[4] = 1
end
local plotWindow = plot:GetParent()
if plot.autoRange then
local newRange, isChanged = plotWindow:GetRequiredRange(range, true)
if isChanged then plotWindow:UpdateScales(newRange) end
end
plot.range = range
plot.XYData = XYData
plot.YAxisSide = YAxisSide
end
local PlotBuffSelection = {}
local function UpdatePlotBuffSelection()
PlotBuffSelection = {}
local selectedbuffs = selections["buff"]["buff"]
local buffData = GetBuffData()
if buffData == nil or buffData.buffs == nil then return end
for buffName, buff in CMX.spairs(buffData.buffs, buffSortFunction) do
if selectedbuffs and selectedbuffs[buffName] ~= nil then PlotBuffSelection[#PlotBuffSelection + 1] = buffName end
if #PlotBuffSelection >= maxBarPlots then return end
end
end
local function UpdateBarPlot(plot)
local barId = plot.barId or 0
local buffName = PlotBuffSelection[barId]
local buffData = GetBuffData()
local data = buffName and buffData and buffData.buffs[buffName] or nil
if buffName == nil then
plot:SetHidden(true)
return
end
local bardata = AcquireBuffData(buffName)
plot:SetHidden(false)
local plotWindow = plot:GetParent()
local plotheight = plotWindow:GetHeight()
local totalSlots = #PlotBuffSelection > 4 and 8 or 4
local position = plotheight * (barId - 0.5)/totalSlots
local scale = db.FightReport.scale
local xoffset = scale * 24
plot:SetAnchor(LEFT, plotWindow, TOPLEFT, -xoffset, position)
plot:SetAnchor(RIGHT, plotWindow, TOPRIGHT, 0, position)
plot:SetHeight(scale * 20)
local icon = plot:GetNamedChild("Icon")
icon:SetTexture(GetFormattedAbilityIcon(data.icon))
icon.tooltip = {buffName}
plot.bardata = bardata
plot.xoffset = xoffset
plot.effectType = data.effectType
plot:DrawPlot()
end
local function updateGraphPanel(panel)
if panel:IsHidden() then return end
if enlargedGraph == true then
panel:SetParent(CombatMetrics_Report)
panel:SetAnchor(BOTTOMRIGHT, CombatMetrics_Report_InfoPanel, BOTTOMRIGHT, 0, 0)
else
panel:SetParent(CombatMetrics_Report_MainPanel)
panel:SetAnchor(BOTTOMRIGHT, CombatMetrics_Report_MainPanel, BOTTOMRIGHT, 0, 0)
end
CombatMetrics_Report:GetNamedChild("_AbilityPanel"):SetHidden(enlargedGraph)
CombatMetrics_Report:GetNamedChild("_UnitPanel"):SetHidden(enlargedGraph)
CombatMetrics_Report:GetNamedChild("_RightPanel"):SetHidden(enlargedGraph)
CombatMetrics_Report:GetNamedChild("_MainPanel"):SetHidden(enlargedGraph)
local plotWindow = panel:GetNamedChild("PlotWindow")
local toolbar = panel:GetNamedChild("Toolbar")
local smoothSlider = toolbar:GetNamedChild("SmoothControl"):GetNamedChild("Slider")
local SmoothWindow = db.FightReport.SmoothWindow
smoothSlider:SetValue(SmoothWindow)
local groupSelector = toolbar:GetNamedChild("BuffSelector1"):GetNamedChild("GroupSelector")
groupSelector:SetHidden(db.FightReport.rightpanel ~= "buffsout")
if fightData == nil then plotWindow:SetHidden(true) return end
plotWindow:SetHidden(false)
plotWindow.RangesX = {0, 0, {}}
plotWindow.RangesY = {0, 0, {}}
UpdatePlotBuffSelection()
for id, plot in ipairs(plotWindow.plots) do
plot:Update()
end
for id, plot in pairs(plotWindow.plots) do
if plot.DrawPlot then
plot:DrawPlot()
end
end
end
function CMX.SetSliderValue(self, value)
local labelControl = self:GetParent():GetNamedChild("Label")
labelControl:SetText(string.format(GetString(SI_COMBAT_METRICS_SMOOTH_LABEL), value))
db.FightReport.SmoothWindow = value
local graphPanel = self:GetParent():GetParent():GetParent()
graphPanel:Update()
end
local function limit(value, minValue, maxValue)
local coercedValue = math.min(math.max(value, minValue), maxValue)
return coercedValue
end
do
local startX, startY, plotWindow
local function UpdateZoomControl()
local zoomcontrol = plotWindow:GetNamedChild("Zoom")
local x2, y2 = GetUIMousePosition()
local minX, minY, maxX, maxY = plotWindow:GetScreenRect()
limit(x2, minX, maxX)
limit(y2, minY, maxY)
local width = math.abs(x2 - startX)
local height = math.abs(y2 - startY)
zoomcontrol:SetAnchor(TOPLEFT, GuiRoot , TOPLEFT, math.min(startX, x2), math.min(startY, y2))
zoomcontrol:SetDimensions(width, height)
end
local oldx, oldy
function updatePlotCursor()
local x, y = GetUIMousePosition()
if x == oldx and y == oldy then return end
oldx, oldy = x, y
local cursorTime, cursorValue = plotWindow:MapUIPosXY(x, y)
dataAtCursorTime = {}
for _, plot in pairs(plotWindow.plots) do
if plot.plotType == CMX_PLOT_TYPE_XY and plot.XYData then
local coords = {0, 0, 0}
for i, data in pairs(plot.XYData) do
local t, v = unpack(data)
if t > cursorTime then
dataAtCursorTime[plot.id] = coords
break
end
local percentV
if plot.YAxisSide == COMBAT_METRICS_YAXIS_RIGHT then
percentV = v * 100
v = v * plot.AbsoluteYRange
end
coords = {v, percentV}
end
end
end
InitializeTooltip(InformationTooltip, GuiRoot, TOPLEFT, x + 30, y + 30, TOPLEFT)
local tooltipText = string.format("|cddddddTime: %d:%02d", cursorTime/60, math.floor(cursorTime%60))
AddTooltipLine(plotWindow, InformationTooltip, tooltipText)
for plotId, data in CMX.spairs(dataAtCursorTime) do
local r,g,b = unpack(db.FightReport.PlotColors[plotId])
local formatter = data[2] and "|c%.2x%.2x%.2x%s: %d (%.1f%%)|r" or "|c%.2x%.2x%.2x%s: %d|r"
local label = plotWindow.plots[plotId].label
tooltipText = string.format(formatter, math.floor(r * 255), math.floor(g * 255), math.floor(b * 255), label, unpack(data))
AddTooltipLine(plotWindow, InformationTooltip, tooltipText)
end
local cursor = plotWindow:GetNamedChild("Cursor")
cursor:ClearAnchors()
cursor:SetAnchor(TOPLEFT, plotWindow, TOPLEFT, x - plotWindow:GetLeft(), 0)
cursor:SetAnchor(BOTTOMLEFT, plotWindow, BOTTOMLEFT, x - plotWindow:GetLeft(), 0)
end
function CMX.onPlotMouseDown(plotWindowControl, button)
if button ~= MOUSE_BUTTON_INDEX_LEFT then return end
CMX.onPlotMouseExit(plotWindowControl)
local zoomcontrol = plotWindow:GetNamedChild("Zoom")
local x, y = GetUIMousePosition()
zoomcontrol:SetAnchor(TOPLEFT, GuiRoot , TOPLEFT, x, y)
zoomcontrol:SetDimensions(0, 0)
zoomcontrol:SetHidden(false)
startX = x
startY = y
plotWindow = plotWindowControl
em:RegisterForUpdate("CMX_Report_Zoom_Control", 40, UpdateZoomControl)
end
function CMX.onPlotMouseUp(plotWindow, button, upInside)
if button == MOUSE_BUTTON_INDEX_LEFT then
local x, y = GetUIMousePosition()
em:UnregisterForUpdate("CMX_Report_Zoom_Control")
local zoomcontrol = plotWindow:GetNamedChild("Zoom")
zoomcontrol:SetHidden(true)
if x == startX and y == startY then
CMX.onPlotMouseEnter(plotWindow)
return
end
local t1, v1 = plotWindow:MapUIPosXY(startX, startY)
local t2, v2 = plotWindow:MapUIPosXY(x, y)
local minT, maxT = unpack(plotWindow.RangesX)
local minV, maxV = unpack(plotWindow.RangesY)
t2 = limit(t2, minT, maxT)
v2 = limit(v2, minV, maxV)
local tMin = math.min(t1, t2)
local tMax = math.max(t1, t2)
local vMin = math.min(v1, v2)
local vMax = math.max(v1, v2)
plotWindow:UpdateScales({tMin, tMax, vMin, vMax})
for id, plot in pairs(plotWindow.plots) do
if plot.DrawPlot then
plot:DrawPlot()
end
end
elseif button == MOUSE_BUTTON_INDEX_RIGHT then
plotWindow.RangesX = {0, 0, {}}
plotWindow.RangesY = {0, 0, {}}
for id, plot in pairs(plotWindow.plots) do
if plot.XYData and plot.autoRange and plot:IsHidden() == false then
local newRange = plotWindow:GetRequiredRange(plot.range, true)
plotWindow:UpdateScales(newRange)
end
end
for id, plot in pairs(plotWindow.plots) do
if plot.DrawPlot then
plot:DrawPlot()
end
end
end
if upInside then CMX.onPlotMouseEnter(plotWindow) end
end
function CMX.onPlotMouseEnter(plotWindowControl)
plotWindow = plotWindowControl
if db.FightReport.Cursor then
local cursor = plotWindow:GetNamedChild("Cursor")
cursor:SetHidden(false)
em:RegisterForUpdate("CMX_Report_Cursor_Control", 40, updatePlotCursor)
end
end
function CMX.onPlotMouseExit(plotWindowControl)
em:UnregisterForUpdate("CMX_Report_Cursor_Control")
ZO_Options_OnMouseExit(plotWindowControl)
local cursor = plotWindow:GetNamedChild("Cursor")
cursor:SetHidden(true)
end
function CMX.EditLabelStart(label)
local editbox = label:GetParent():GetNamedChild("Edit")
label:SetHidden(true)
editbox:SetHidden(false)
editbox:SetText( label:GetText() )
editbox:SelectAll()
editbox:TakeFocus()
end
function CMX.EditLabelEnd(editbox)
local tickControl = editbox:GetParent()
local plotWindow = tickControl:GetParent()
local label = tickControl:GetNamedChild("Label")
editbox:SetHidden(true)
label:SetHidden(false)
local newtext = tonumber(editbox:GetText())
label:SetText(newtext)
local t1 = tonumber(plotWindow:GetNamedChild("XTick1"):GetNamedChild("Label"):GetText())
local t2 = tonumber(plotWindow:GetNamedChild("XTick5"):GetNamedChild("Label"):GetText())
local v1 = tonumber(plotWindow:GetNamedChild("YTick1"):GetNamedChild("Label"):GetText())
local v2 = tonumber(plotWindow:GetNamedChild("YTick5"):GetNamedChild("Label"):GetText())
local tMin = math.min(t1, t2)
local tMax = math.max(t1, t2)
local vMin = math.min(v1, v2)
local vMax = math.max(v1, v2)
plotWindow:UpdateScales({tMin, tMax, vMin, vMax}, true)
for id, plot in pairs(plotWindow.plots) do
if plot.DrawPlot then
plot:DrawPlot()
end
end
end
end
local PlotFunctions = {}
local MainCategoryFunctions = {
[1] = {label = SI_COMBAT_METRICS_SMOOTHED, func = Smooth},
[2] = {label = SI_COMBAT_METRICS_TOTAL, func = Total},
[3] = {label = SI_COMBAT_METRICS_ABSOLUTE, func = Absolute},
}
local CategoryStrings = {
[1] = {label = SI_COMBAT_METRICS_DPS, category = "damageOut"},
[2] = {label = SI_COMBAT_METRICS_HPS, category = "healingOut"},
[3] = {label = SI_COMBAT_METRICS_INCOMING_DPS, category = "damageIn"},
[4] = {label = SI_COMBAT_METRICS_INCOMING_HPS, category = "healingIn"},
}
--[[local ResourceFunctions = {
[1] = {label = SI_COMBAT_METRICS_ABSOLUTE, func = ResourceAbsolute},
}--]]
local ResourceStrings = {
[1] = {label = SI_COMBAT_METRICS_HEALTH, powerType = POWERTYPE_HEALTH},
[2] = {label = SI_COMBAT_METRICS_MAGICKA, powerType = POWERTYPE_MAGICKA},
[3] = {label = SI_COMBAT_METRICS_STAMINA, powerType = POWERTYPE_STAMINA},
[4] = {label = SI_COMBAT_METRICS_ULTIMATE, powerType = POWERTYPE_ULTIMATE},
}
local StatStrings = {
[1] = {label = SI_COMBAT_METRICS_STATS_MAGICKA1, statId = LIBCOMBAT_STAT_MAXMAGICKA},
[2] = {label = SI_COMBAT_METRICS_STATS_MAGICKA2, statId = LIBCOMBAT_STAT_SPELLPOWER},
[3] = {label = SI_COMBAT_METRICS_STATS_MAGICKA3, statId = LIBCOMBAT_STAT_SPELLCRIT},
[4] = {label = SI_COMBAT_METRICS_STATS_MAGICKA4, statId = LIBCOMBAT_STAT_SPELLCRITBONUS},
[5] = {label = SI_COMBAT_METRICS_STATS_MAGICKA5, statId = LIBCOMBAT_STAT_SPELLPENETRATION},
[6] = {label = SI_COMBAT_METRICS_STATS_STAMINA1, statId = LIBCOMBAT_STAT_MAXSTAMINA},
[7] = {label = SI_COMBAT_METRICS_STATS_STAMINA2, statId = LIBCOMBAT_STAT_WEAPONPOWER},
[8] = {label = SI_COMBAT_METRICS_STATS_STAMINA3, statId = LIBCOMBAT_STAT_WEAPONCRIT},
[9] = {label = SI_COMBAT_METRICS_STATS_STAMINA4, statId = LIBCOMBAT_STAT_WEAPONCRITBONUS},
[10] = {label = SI_COMBAT_METRICS_STATS_STAMINA5, statId = LIBCOMBAT_STAT_WEAPONPENETRATION},
[11] = {label = SI_COMBAT_METRICS_STATS_HEALTH1, statId = LIBCOMBAT_STAT_MAXHEALTH},
[12] = {label = SI_COMBAT_METRICS_STATS_HEALTH2, statId = LIBCOMBAT_STAT_PHYSICALRESISTANCE},
[13] = {label = SI_COMBAT_METRICS_STATS_HEALTH3, statId = LIBCOMBAT_STAT_SPELLRESISTANCE},
[14] = {label = SI_COMBAT_METRICS_STATS_HEALTH4, statId = LIBCOMBAT_STAT_CRITICALRESISTANCE},
}
local lastPlotSelector
local function RemovePlotSelection()
local selector = lastPlotSelector
local control = selector:GetParent()
local id = control.id
local label = control:GetNamedChild("Label")
label:SetText("-")
local plotwindow = control:GetParent():GetParent():GetNamedChild("PlotWindow")
local plot = plotwindow.plots[id]
plot.func = nil
plot:Update()
end
function CMX.PlotSelectionMenu(selector)
ClearMenu()
lastPlotSelector = selector
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_NONE), RemovePlotSelection)
local funcId = 1
for id, data in ipairs(CategoryStrings) do
local submenu = {}
for id2, data2 in ipairs(MainCategoryFunctions) do
local stringid2 = data2.label
table.insert(submenu, {label = GetString(stringid2), callback = PlotFunctions[funcId]})
funcId = funcId + 1
end
local stringid = data.label
AddCustomSubMenuItem(GetString(stringid), submenu)
end
AddCustomMenuItem(GetString(SI_COMBAT_METRICS_BOSS_HP), PlotFunctions[funcId])
funcId = funcId + 1
local submenu2 = {}
for id, data in ipairs(ResourceStrings) do
table.insert(submenu2, {label = GetString(data.label).." %", callback = PlotFunctions[funcId]})
funcId = funcId + 1
end
AddCustomSubMenuItem(GetString(SI_COMBAT_METRICS_RESOURCES), submenu2)
local submenu3 = {}
for id, data in ipairs(StatStrings) do
table.insert(submenu3, {label = GetString(data.label).." %", callback = PlotFunctions[funcId]})
funcId = funcId + 1
if id == 5 or id == 10 then table.insert(submenu3, {label = "-"}) end
end
AddCustomSubMenuItem(GetString(SI_COMBAT_METRICS_STATS), submenu3)
ShowMenu(selector)
AnchorMenu(selector)
end
local plotDefaultFunction = {
[1] = Smooth,
[2] = Total,
}
local function InitBarPlot(plotWindow, id)
local plots = plotWindow.plots
local newPlot = plots[id]
if newPlot == nil then
newPlot = CreateControlFromVirtual("CombatMetrics_Report_MainPanelGraphPlot", plotWindow, plotTypeTemplates[CMX_PLOT_TYPE_BAR], id)
newPlot.plotType = CMX_PLOT_TYPE_BAR
newPlot.barControls = {}
newPlot.DrawPlot = DrawBarPlot
newPlot.Update = UpdateBarPlot
newPlot.id = id
newPlot.barId = id - maxXYPlots
plots[id] = newPlot
end
return newPlot
end
local function InitXYPlot(plotWindow, id)
local plots = plotWindow.plots
local newPlot = plots[id]
if newPlot == nil then
newPlot = CreateControlFromVirtual("CombatMetrics_Report_MainPanelGraphPlot", plotWindow, plotTypeTemplates[CMX_PLOT_TYPE_XY], id)
newPlot.plotType = CMX_PLOT_TYPE_XY
newPlot.lineControls = {}
newPlot.DrawPlot = DrawXYPlot
newPlot.Update = UpdateXYPlot
newPlot.autoRange = true
newPlot.id = id
local category = db.FightReport.category
local catId = 1
while CategoryStrings[catId].category ~= category do
catId = catId + 1
end
if id <= 2 then
local selectorLabel = plotWindow:GetParent():GetNamedChild("Toolbar"):GetNamedChild("DataSelector" .. id):GetNamedChild("Label")
local labelString = zo_strformat("<<1>> - <<2>>", GetString(CategoryStrings[catId].label), GetString(MainCategoryFunctions[id].label))
selectorLabel:SetText(labelString)
newPlot.func = function() return plotDefaultFunction[id](category) end
newPlot.label = labelString
end
plots[id] = newPlot
end
return newPlot
end
local function getCustomMenuFunction(basefunc, parameter, labelString)
local function newFunc()
local selector = lastPlotSelector
local control = selector:GetParent()
local id = control.id
local label = control:GetNamedChild("Label")
label:SetText(labelString)
local plotwindow = control:GetParent():GetParent():GetNamedChild("PlotWindow")
local plot = plotwindow.plots[id]
plot.func = function() return basefunc(parameter) end
plot.label = labelString:gsub(" %%", "")
plot:Update()
local plotWindow = plot:GetParent()
for id, plot in pairs(plotWindow.plots) do
if plot.DrawPlot then
plot:DrawPlot()
end
end
end
return newFunc
end
local function initPlotWindow(plotWindow)
plotWindow.MapValue = MapValue
plotWindow.MapValueXY = MapValueXY
plotWindow.MapUIPos = MapUIPos
plotWindow.MapUIPosXY = MapUIPosXY
plotWindow.InitXYPlot = InitXYPlot
plotWindow.InitBarPlot = InitBarPlot
plotWindow.UpdateScales = UpdateScales
plotWindow.GetRequiredRange = GetRequiredRange
plotWindow.plots = {}
for i = 1, 5 do
local labelR = plotWindow:GetNamedChild("YTick" .. i):GetNamedChild("LabelR")
local text = string.format("%d%%", (i - 1) * 25)
labelR:SetText(text)
end
local editableControls = {"XTick1", "XTick5", "YTick1", "YTick5"}
for i = 1, 4 do
local name = editableControls[i]
local control = plotWindow:GetNamedChild(name)
local label = control:GetNamedChild("Label")
local editControlName = control:GetName() .. "Edit"
local editControl = CreateControlFromVirtual(editControlName, control, "CombatMetrics_GraphTickLabel_Edit")
editControl:SetAnchorFill(label)
local font, size, style = unpack(editControl:GetNamedChild("Font").font) -- Need to manually scale font since it's created late
if size then size = tonumber(size) * (db.FightReport.scale + 0.2)/1.2 end
editControl:SetFont(string.format("%s|%s|%s", font, size, style))
label:SetHandler("OnMouseDoubleClick", CMX.EditLabelStart)
end
local funcId = 1
for id, data in ipairs(CategoryStrings) do
for id2, data2 in ipairs(MainCategoryFunctions) do
local categoryString = data.label
local category = data.category
local labelString = zo_strformat("<<1>> - <<2>>", GetString(categoryString), GetString(data2.label))
local basefunc = data2.func
PlotFunctions[funcId] = getCustomMenuFunction(basefunc, category, labelString)
funcId = funcId + 1
end
end
PlotFunctions[funcId] = getCustomMenuFunction(BossHPAbsolute, nil, GetString(SI_COMBAT_METRICS_BOSS_HP))
funcId = funcId + 1
for id, data in ipairs(ResourceStrings) do
local resourceString = data.label
local powerType = data.powerType
local labelString = GetString(resourceString) .. " %"
PlotFunctions[funcId] = getCustomMenuFunction(ResourceAbsolute, powerType, labelString)
funcId = funcId + 1
end
for id, data in ipairs(StatStrings) do
local statString = data.label
local statId = data.statId
local labelString = GetString(statString) .. " %"
PlotFunctions[funcId] = getCustomMenuFunction(StatAbsolute, statId, labelString)
funcId = funcId + 1
end
for id = 1, maxXYPlots do
plotWindow:InitXYPlot(id)
end
for id = maxXYPlots + 1, maxXYPlots + maxBarPlots do
plotWindow:InitBarPlot(id)
end
end
local function initPlotToolbar(toolbar)
local PlotColors = db.FightReport.PlotColors
local cursorToggle = toolbar:GetNamedChild("ToggleCursor")
cursorToggle:SetAlpha(db.FightReport.Cursor and 1 or 0.3)
for i = 1,5 do
local selector = toolbar:GetNamedChild("DataSelector" .. i)
selector.id = i
local colorbox = selector:GetNamedChild("ColorBox")
local color = PlotColors[i]
colorbox:SetCenterColor(unpack(color))
selector.color = color
local function updateColor(r, g, b, a)
colorbox:SetCenterColor(r, g, b, a)
selector.color = {r, g, b, a}
PlotColors[i] = {r, g, b, a}
toolbar:GetParent():Update()
end
colorbox:SetHandler("OnMouseUp", function(self, button, upInside)
if upInside then
local r, g, b, a = unpack(selector.color)
COLOR_PICKER:Show(updateColor, r, g, b, a)
end
end
)
end
local labeltexts = {GetString(SI_COMBAT_METRICS_BUFFS), GetString(SI_COMBAT_METRICS_DEBUFFS)}
local showGroupBuffs = db.FightReport.ShowGroupBuffsInPlots
for i = 1,2 do
local selector = toolbar:GetNamedChild("BuffSelector" .. i)
selector.id = i
local label = selector:GetNamedChild("Label")
label:SetText(labeltexts[i])
local colorbox = selector:GetNamedChild("ColorBox")
local color = PlotColors[i + 5]
colorbox:SetCenterColor(unpack(color))
selector.color = color
local function updateColor(r, g, b, a)
colorbox:SetCenterColor(r, g, b, a)
selector.color = {r, g, b, a}
PlotColors[i + 5] = {r, g, b, a}
toolbar:GetParent():Update()
end
colorbox:SetHandler("OnMouseUp", function(self, button, upInside)
if upInside then
local r, g, b, a = unpack(selector.color)
COLOR_PICKER:Show(updateColor, r, g, b, a)
end
end
)
local groupSelector = selector:GetNamedChild("GroupSelector")
groupSelector:SetAlpha(showGroupBuffs and 1 or 0.2)
if i == 1 then
groupSelector:SetHidden(db.FightReport.rightpanel ~= "buffsout")
groupSelector.tooltip = {SI_COMBAT_METRICS_GRAPH_BUFF_GROUP_SELECTOR}
groupSelector:SetHandler("OnMouseUp", function(self, button, upInside)
if upInside then
showGroupBuffs = not showGroupBuffs
db.FightReport.ShowGroupBuffsInPlots = showGroupBuffs
groupSelector:SetAlpha(showGroupBuffs and 1 or 0.2)
toolbar:GetParent():Update()
end
end
)
else
groupSelector:SetHidden(true)
end
end
end
function CMX.ToggleGraphSize(self)
enlargedGraph = not enlargedGraph
local labelText = enlargedGraph and GetString(SI_COMBAT_METRICS_SHRINK) or GetString(SI_COMBAT_METRICS_ENLARGE)
self:GetNamedChild("Label"):SetText(labelText)
local graphPanel = self:GetParent():GetParent()
graphPanel:Update()
end
function CMX.ToggleCursorDisplay(self)
local enable = not db.FightReport.Cursor
self:SetAlpha(enable and 1 or 0.3)
db.FightReport.Cursor = enable
end
function CMX.SkillTooltip_OnMouseEnter(control)
InitializeTooltip(SkillTooltip, control, TOPLEFT, 0, 5, BOTTOMLEFT)
local id = control:GetParent().id
local font = string.format("%s|%s|%s", GetString(SI_COMBAT_METRICS_STD_FONT), 16, "soft-shadow-thin")
SkillTooltip:SetAbilityId(id)
SkillTooltip:AddVerticalPadding(15)
SkillTooltip:AddLine(string.format("ID: %d", id), font, .7, .7, .8 , TOP, MODIFY_TEXT_TYPE_NONE, TEXT_ALIGN_CENTER)
end
function CMX.SkillTooltip_OnMouseExit(control)
ClearTooltip(SkillTooltip)
end
function CMX.CPTooltip_OnMouseEnter(control)
InitializeTooltip(SkillTooltip, control, TOPLEFT, 0, 5, BOTTOMLEFT)
SkillTooltip:SetChampionSkillAbility(control.discipline, control.skillId, control.points)
end
function CMX.CPTooltip_OnMouseExit(control)
ClearTooltip(SkillTooltip)
end
function CMX.ItemTooltip_OnMouseEnter(control)
local itemLink = control.itemLink
if itemLink == "" or itemLink == nil then return end
InitializeTooltip(ItemTooltip, control:GetParent(), TOPLEFT, 5, 0, TOPRIGHT)
ItemTooltip:SetLink(itemLink)
end
function CMX.ItemTooltip_OnMouseExit(control)
ClearTooltip(ItemTooltip)
end
local equipslots = {
EQUIP_SLOT_MAIN_HAND,
EQUIP_SLOT_OFF_HAND,
EQUIP_SLOT_BACKUP_MAIN,
EQUIP_SLOT_BACKUP_OFF,
EQUIP_SLOT_HEAD,
EQUIP_SLOT_SHOULDERS,
EQUIP_SLOT_CHEST,
EQUIP_SLOT_HAND,
EQUIP_SLOT_WAIST,
EQUIP_SLOT_LEGS,
EQUIP_SLOT_FEET,
EQUIP_SLOT_NECK,
EQUIP_SLOT_RING1,
EQUIP_SLOT_RING2,
}
local equipicons = {
"EsoUI/Art/CharacterWindow/gearslot_mainhand.dds",
"EsoUI/Art/CharacterWindow/gearslot_offhand.dds",
"EsoUI/Art/CharacterWindow/gearslot_mainhand.dds",
"EsoUI/Art/CharacterWindow/gearslot_offhand.dds",
"EsoUI/Art/CharacterWindow/gearslot_head.dds",
"EsoUI/Art/CharacterWindow/gearslot_shoulders.dds",
"EsoUI/Art/CharacterWindow/gearslot_chest.dds",
"EsoUI/Art/CharacterWindow/gearslot_hands.dds",
"EsoUI/Art/CharacterWindow/gearslot_belt.dds",
"EsoUI/Art/CharacterWindow/gearslot_legs.dds",
"EsoUI/Art/CharacterWindow/gearslot_feet.dds",
"EsoUI/Art/CharacterWindow/gearslot_neck.dds",
"EsoUI/Art/CharacterWindow/gearslot_ring.dds",
"EsoUI/Art/CharacterWindow/gearslot_ring.dds",
}
local armorcolors = {
[ARMORTYPE_NONE] = {1, 1, 1, 1},
[ARMORTYPE_HEAVY] = {1, 0.3, 0.3, 1},
[ARMORTYPE_MEDIUM] = {0.3, 1, 0.3, 1},
[ARMORTYPE_LIGHT] = {0.3, 0.3, 1, 1},
}
local skillkeys = { "count", "weaponAttackBeforeAvg", "skillBeforeAvg", "weaponAttackNextAvg", "skillNextAvg", "difftimesAvg"}
local function updateLeftInfoPanel(panel)
if fightData == nil then return end
local charData = fightData.charData
if charData == nil then return end
local skillBars = charData.skillBars
local data = fightData.calculated
if data == nil then return end
local skilldata = data.skills
local barStatData = data.barStats
local barkeys = {}
for bar, data in CMX.spairs(skillBars or {}) do
table.insert(barkeys, bar)
end
local category = db.FightReport.category
for i = 0, 1 do
local row = panel:GetNamedChild("AbilityBlock" .. i+1)
local barkey = barkeys and barkeys[i + barKeyOffset] or i
local bardata = skillBars and skillBars[barkey] or nil
local barStats = barStatData and barStatData[barkey] or nil
local skilltimingbefore = db.FightReport.skilltimingbefore
local dpsratio, timeratio
if barStats and type(barStats[category]) == "number" then
dpsratio = (barStats[category] or 0) / data[category.."Total"]
local totalTime = (category == "healingIn" or category == "healingOut") and fightData.hpstime or fightData.dpstime or 1
timeratio = (barStats.totalTime or 0) / totalTime
end
local statControl = row:GetNamedChild("Stats")
local ratioControl = statControl:GetNamedChild("Value1")
local timeControl = statControl:GetNamedChild("Value2")
ratioControl:SetText(string.format("%.1f%%", (timeratio or 0) * 100))
timeControl:SetText(string.format("%.1f%%", (dpsratio or 0) * 100))
for j = 5, row:GetNumChildren() - 2 do
local strings = {"-", "-", "-", "-", "-", "-"}
local control = row:GetChild(j)
local icon = control:GetNamedChild("Icon"):GetNamedChild("Texture")
local name = control:GetNamedChild("Label")
local abilityId = bardata and bardata[j-4] or nil
control.id = abilityId
local texture = abilityId and abilityId > 0 and GetFormattedAbilityIcon(abilityId) or "EsoUI/Art/crafting/gamepad/crafting_alchemy_trait_unknown.dds"
icon:SetTexture(texture)
local abilityName = abilityId and abilityId > 0 and GetFormattedAbilityName(abilityId) or ""
name:SetText(abilityName)
local reducedslot = (barkey - 1) * 10 + j - 4
local slotdata = skilldata and skilldata[reducedslot] or nil
if slotdata then
strings[1] = string.format("%d", slotdata[skillkeys[1]])
for k = 2, #skillkeys do
local value = slotdata[skillkeys[k]]
if type(value) == "number" and k > 1 then
strings[k] = string.format("%.2f", value / 1000)
end
end
end
local keymod = skilltimingbefore and 0 or 2
local valuestring = string.format("%s/%s", strings[2+keymod], strings[3+keymod])
control:GetNamedChild("Value1"):SetText(strings[1])
control:GetNamedChild("Value2"):SetText(valuestring)
control:GetNamedChild("Value3"):SetText(strings[6])
end
local header3 = row:GetNamedChild("Header"):GetNamedChild("3")
local HeaderStringKey = skilltimingbefore and 2 or 3
header3:SetText(GetString("SI_COMBAT_METRICS_SKILLTIME_LABEL", HeaderStringKey))
header3.tooltip = GetString("SI_COMBAT_METRICS_SKILLTIME_TT", HeaderStringKey)
end
local statrow = panel:GetNamedChild("AbilityBlock1"):GetNamedChild("Stats2")
local statrow2 = panel:GetNamedChild("AbilityBlock2"):GetNamedChild("Stats2")
local totalSkills = data.totalSkills
local totalTime = data.totalSkillTime
local totalWeaponAttacks = data.totalWeaponAttacks
local totalSkillsFired = data.totalSkillsFired
local value1string = " -"
local value2string = " -"
if totalSkills and totalSkills > 0 and totalTime then
value1string = (totalTime and totalSkills) and string.format("%.3f s", totalTime / (1000 * totalSkills)) or "-"
value2string = totalTime and string.format("%.3f s", totalTime / 1000) or "-"
end
local value3string = totalWeaponAttacks or " -"
local value4string = totalSkillsFired or " -"
statrow:GetNamedChild("Label"):SetText(string.format("%s %s", GetString(SI_COMBAT_METRICS_AVERAGEC), value1string))
statrow:GetNamedChild("Label2"):SetText(string.format("%s %s", GetString(SI_COMBAT_METRICS_TOTALC), value2string))
statrow2:GetNamedChild("Label"):SetText(string.format("%s %s", GetString(SI_COMBAT_METRICS_TOTALWA), value3string))
statrow2:GetNamedChild("Label2"):SetText(string.format("%s %s", GetString(SI_COMBAT_METRICS_TOTALSKILLS), value4string))
end
function CMX.ToggleSkillTimingData(control)
db.FightReport.skilltimingbefore = not db.FightReport.skilltimingbefore
updateLeftInfoPanel(CombatMetrics_Report_InfoPanelLeft)
end
local passiveRequirements = {10, 30, 75, 120}
local function updateRightInfoPanel(panel)
if fightData == nil then return end
local CPData = fightData.CP
if CPData == nil then return end
for i = 1, 9 do
local discipline = (7-i)%9+1 -- start with apprentice and then clockwise (seriously, how did they come up with those ids?)
local signcontrol = panel:GetNamedChild("StarSign"..i)
local sum = 0
for id = 1, 4 do
local cpvalue = CPData[discipline][id]
local row = signcontrol:GetNamedChild("Row" .. id)
row.points = cpvalue - GetNumPointsSpentOnChampionSkill(discipline, id)
local value = row:GetNamedChild("Value")
sum = sum + cpvalue
value:SetText(tostring(cpvalue))
end
for k = 1, 4 do
local passiveControl = signcontrol:GetNamedChild("Passive" .. k)
local show = sum >= passiveRequirements[k]
local texture = show and "esoui/art/mainmenu/menubar_champion_down.dds" or "esoui/art/mainmenu/menubar_champion_up.dds"
local alpha = show and 1 or 0.4
passiveControl:SetTexture(texture)
passiveControl:SetAlpha(alpha)
end
end
end
local function updateBottomInfoPanel(panel)
if fightData == nil then return end
local charData = fightData.charData
if charData == nil then return end
local equipdata = charData and charData.equip or {}
local poison1 = equipdata[EQUIP_SLOT_POISON]
local poison2 = equipdata[EQUIP_SLOT_BACKUP_POISON]
for i = 1, 14 do
local equipline = panel:GetNamedChild("EquipLine" .. i)
local label = equipline:GetNamedChild("ItemLink")
local icon = equipline:GetNamedChild("Icon")
local icon2 = equipline:GetNamedChild("Icon2") -- textures are added twice since icons are so low in contrast
local trait = equipline:GetNamedChild("Trait")
local enchant = equipline:GetNamedChild("Enchant")
local slot = equipslots[i]
local item = equipdata[slot] or ""
local texture = equipicons[i]
local armortype = GetItemLinkArmorType(item)
local color = item:len() > 0 and armorcolors[armortype] or {0, 0, 0, 1}
local color2 = item:len() > 0 and {1, 1, 1, 1} or {0.5, 0.5, 0.5, 1}
label:SetText(item)
label.itemLink = item == "" and nil or item
icon:SetTexture(texture)
icon:SetColor(unpack(color))
icon:SetBlendMode(TEX_BLEND_MODE_ADD)
icon2:SetTexture(texture)
icon2:SetColor(unpack(color2))
icon2:SetBlendMode(TEX_BLEND_MODE_ADD)
local traitType, _ = GetItemLinkTraitInfo(item)
local traitName = traitType > 0 and GetString("SI_ITEMTRAITTYPE", traitType) or ""
trait:SetText(traitName)
local enchantstring
if (slot == EQUIP_SLOT_MAIN_HAND or slot == EQUIP_SLOT_OFF_HAND) and poison1:len() > 0 then
enchantstring = poison1
enchant.itemLink = poison1
elseif (slot == EQUIP_SLOT_BACKUP_MAIN or slot == EQUIP_SLOT_BACKUP_OFF) and poison2:len() > 0 then
enchantstring = poison2
enchant.itemLink = poison2
else
_, enchantstring = GetItemLinkEnchantInfo(item)
enchantstring = enchantstring:gsub(GetString(SI_COMBAT_METRICS_ENCHANTMENT_TRIM), "")
enchant.itemLink = ""
end
enchant:SetText(enchantstring)
end
end
local function updateInfoPanel(panel)
if panel:IsHidden() then return end
updateLeftInfoPanel(panel:GetNamedChild("Left"))
updateRightInfoPanel(panel:GetNamedChild("Right"))
updateBottomInfoPanel(panel:GetNamedChild("Bottom"))
end
local function updateInfoRowPanel(panel)
CMX.Print("dev", "Updating InfoRow")
local datetimecontrol = panel:GetNamedChild("DateTime")
local versioncontrol = panel:GetNamedChild("ESOVersion")
local barcontrol = panel:GetNamedChild("Bar")
local barlabelcontrol = barcontrol:GetNamedChild("Label")
local data = fightData or {
["date"] = GetTimeStamp(),
["time"] = GetTimeString(),
["ESOversion"] = GetESOVersionString(),
["account"] = GetDisplayName()
}
local date = data.date
local account = data.account
local accountstring = account and string.format("%s, ", account) or ""
local datestring = type(date) == "number" and GetDateStringFromTimestamp(date) or date
local timestring = string.format("%s%s, %s", accountstring, datestring, data.time)
local versionstring = string.format("%s / CMX %s", data.ESOversion or "<= 3.2" , CMX.version)
datetimecontrol:SetText(timestring)
versioncontrol:SetText(versionstring)
local usedSpace = db.SVsize/db.maxSVsize
barcontrol:SetValue(usedSpace)
barlabelcontrol:SetText(string.format("%s: %.1f MB / %d MB (%.1f%%)", GetString(SI_COMBAT_METRICS_SAVED_DATA), db.SVsize, db.maxSVsize, usedSpace * 100))
end
local function updateFightReport(control, fightId)
CMX.Print("dev", "Updating FightReport")
em:UnregisterForUpdate("CMX_Report_Update_Delay")
local category = db.FightReport.category or "damageOut"
-- clear selections of abilities, buffs or units when selecting a different fight to display --
if fightId == nil or fightId ~= currentFight then
ClearSelections()
end
-- determine which fight to show
fightId = fightId or currentFight -- if no fightId was given, use the previous one (this will also select the next fight if one is deleted)
if fightId == nil or fightId < 0 or CMX.lastfights[fightId] == nil then -- if no valid fight is selected, fall back to the most recent one, if it exists.
if #CMX.lastfights == 0 then
fightId = -1 -- there is no fight saved in pos. -1, it will be nil.
else
fightId = #CMX.lastfights
end
end
currentFight = fightId
fightData = CMX.lastfights[fightId] -- this is the fight of interest, can be nil
if fightData and fightData.calculated == nil and fightData.CalculateFight then -- if it wasn't calculated yet, do so now
fightData:CalculateFight()
UpdateReport2()
return
elseif fightData and fightData.calculating == true then -- if it is still calculating wait for it to finish
em:RegisterForUpdate("CMX_Report_Update_Delay", 500, UpdateReport2)
return
end
-- Generate Filtered Dataset
selectionData = fightData and CMX.GenerateSelectionStats(fightData, category, selections) or nil
abilitystats = {fightData, selections.unit.damageOut ~= nil and selectionData or nil}
-- Update Panels
for i = 2, control:GetNumChildren() do
local child = control:GetChild(i)
if child.Update then child:Update() end
end
end
local function updateFightListPanel(panel, data, issaved)
local scrolllist = GetControl(panel, "PanelScrollChild")
local currentanchor = {TOPLEFT, scrolllist, TOPLEFT, 0, 1}
if #data>0 then
for id, fight in ipairs(data) do
local label = string.gsub(fight.fightlabel or "", ".+%:%d%d %- ([A-Z])", "%1")
local charname = fight.charData and fight.charData.name or fight.char or ""
local zone = fight.zone or ""
local subzone = fight.subzone or ""
local zonestring = subzone ~= "" and string.format("%s, %s", subzone, zone) or nil
local datestring = type(fight.date) == "number" and GetDateStringFromTimestamp(fight.date) or fight.date
local timestring = string.format("%s, %s", datestring, fight.time)
local fightlog = issaved and fight.stringlog or fight.log
local logState = fightlog and #fightlog>0
local activetime = 1
local category = db.FightReport.category
if category == "healingOut" or category == "healingIn" then
activetime = zo_roundToNearest(fight.hpstime or 1, 0.1)
else
activetime = zo_roundToNearest(fight.dpstime or 1, 0.1)
end
local durationstring = string.format("%d:%04.1f", activetime/60, activetime%60)
local DPSKey = DPSstrings[db.FightReport.category]
local dps = fight[DPSKey] or 0
local rowName = scrolllist:GetName() .. "Row" .. id
local row = _G[rowName] or CreateControlFromVirtual(rowName, scrolllist, "CombatMetrics_FightlistRowTemplate")
row:SetAnchor(unpack(currentanchor))
row:SetHidden(false)
local header = panel:GetNamedChild("Header")
adjustRowSize(row, header)
local nameControl = row:GetNamedChild("Name")
nameControl:SetText(label)
local charControl = row:GetNamedChild("Char")
charControl:SetText(charname)
local zoneControl = row:GetNamedChild("Zone")
zoneControl:SetText(zone)
zoneControl.tooltip = zonestring
local timeControl = row:GetNamedChild("Time")
timeControl:SetText(timestring)
local durationControl = row:GetNamedChild("Duration")
durationControl:SetText(durationstring)
local dpsControl = row:GetNamedChild("DPS")
dpsControl:SetText(dps)
local buttonControl = row:GetNamedChild("Buttons")
local deleteLogControl = buttonControl:GetNamedChild("DeleteLog")
deleteLogControl:SetState( logState and BSTATE_NORMAL or BSTATE_DISABLED )
currentanchor = {TOPLEFT, row, BOTTOMLEFT, 0, dx}
panel.bars[id] = row
row.id = id
row.issaved = issaved
end
end
end
local function updateFightList(panel)
CMX.Print("dev", "Updating FightListPanel")
if panel:IsHidden() then return end
local recentPanel = panel:GetNamedChild("Recent")
local savedPanel = panel:GetNamedChild("Saved")
ResetBars(recentPanel)
ResetBars(savedPanel)
local label
if category == "healingOut" or category == "healingIn" then
label = GetString(SI_COMBAT_METRICS_HPS)
else
label = GetString(SI_COMBAT_METRICS_DPS)
end
GetControl(recentPanel, "HeaderDPS"):SetText(label)
GetControl(savedPanel, "HeaderDPS"):SetText(label)
updateFightListPanel(recentPanel, CMX.lastfights, false)
updateFightListPanel(savedPanel, savedFights, true)
end
local function GetCurrentData()
local data = CMX.currentdata
if data.units == nil then
if #CMX.lastfights == 0 then return end
data = CMX.lastfights[#CMX.lastfights]
end
return data
end
local function GetSingleTargetDamage(data) -- Gets highest Single Target Damage and counts enemy units.
local damage, groupDamage, units, unittime, name = 0, 0, 0, 0, ""
for unitId, unit in pairs(data.units) do
local totalUnitDamage = unit.damageOutTotal
if totalUnitDamage > 0 and unit.isFriendly == false then
if totalUnitDamage > damage then
name = unit.name
damage = totalUnitDamage
groupDamage = unit.groupDamageOut
unittime = (unit.dpsend or 0) - (unit.dpsstart or 0)
end
end
end
unittime = unittime > 0 and unittime/1000 or data.dpstime
return damage, groupDamage, name, unittime
end
local function GetBossTargetDamage(data) -- Gets Damage done to bosses and counts enemy boss units.
if not data.bossfight then return 0, 0, nil, 0 end
local totalBossDamage, bossDamage, bossUnits = 0, 0, 0
local bossName
local starttime
local endtime
for unitId, unit in pairs(data.units) do
local totalUnitDamage = unit.damageOutTotal
if (unit.bossId ~= nil and totalUnitDamage>0) then
totalBossDamage = totalBossDamage + totalUnitDamage
bossUnits = bossUnits + 1
starttime = math.min(starttime or unit.dpsstart or 0, unit.dpsstart or 0)
endtime = math.max(endtime or unit.dpsend or 0, unit.dpsend or 0)
if totalUnitDamage > bossDamage then
bossName = unit.name
bossDamage = totalUnitDamage
end
end
end
if bossUnits == 0 then return 0, 0, nil, 0 end
local bossTime = (endtime - starttime)/1000
bossTime = bossTime > 0 and bossTime or data.dpstime
return bossUnits, totalBossDamage, bossName, bossTime
end
local function GetSelectionDamage(data, selection) -- Gets highest Single Target Damage and counts enemy units.
local units = 0
local damage = 0
local starttime
local endtime
local bossDamage = 0
local bossName = ""
local unitdata = data.units
selection = selection or unitdata
for unitId, _ in pairs(selection) do
local unit = unitdata[unitId]
local totalUnitDamage = unit.damageOutTotal
if totalUnitDamage > 0 and unit.isFriendly == false then
units = units + 1
damage = damage + totalUnitDamage
starttime = math.min(starttime or unit.dpsstart or 0, unit.dpsstart or 0)
endtime = math.max(endtime or unit.dpsend or 0, unit.dpsend or 0)
if totalUnitDamage > bossDamage then
bossName = unit.name
bossDamage = totalUnitDamage
end
end
end
local damageTime = (endtime - starttime)/1000
damageTime = damageTime > 0 and damageTime or data.dpstime
return units, damage, bossName, damageTime
end
local function GetSelectionHeal(data, selection) -- Gets highest Single Target Damage and counts enemy units.
local units = 0
local healing = 0
local starttime
local endtime
local unitdata = data.units
selection = selection or unitdata
local calcdata = data.calculated.units
if not calcdata then return end
for unitId, _ in pairs(selection) do
local unit = unitdata[unitId]
local totalUnitHeal = calcdata[unitId].healingOutTotal
if totalUnitHeal and unit.isFriendly == true then
units = units + 1
healing = healing + totalUnitHeal
starttime = math.min(starttime or unit.hpsstart or 0, unit.hpsstart or 0)
endtime = math.max(endtime or unit.hpsend or 0, unit.hpsend or 0)
end
end
local healTime = (endtime - starttime)/1000
healTime = healTime > 0 and healTime or data.dpstime
return units, healing, healTime
end
local function GetUnitsByName(data, unitId) -- Gets all units that share the name with the one provided by unitId
local selectedUnits = {}
local unitName = data.units[unitId].name
for unitId, unit in pairs(data.units) do
if unit.name == unitName then
selectedUnits[unitId] = true
end
end
return selectedUnits
end
function CMX.PostBuffUptime(fight, buffname, unitType)
local data = fight and CMX.lastfights[fight]
local category = db.FightReport.category or "damageOut"
if not data then return end
local timedata = ""
if data ~= GetCurrentData() then
local date = data.date
local datestring = type(date) == "number" and GetDateStringFromTimestamp(date) or date
timedata = string.format("[%s, %s] ", datestring, data.time)
end
local buffDataTable, units = GetBuffDataAndUnits(unitType) -- TODO provide the single unit if units is 1
local buffData = buffDataTable.buffs[buffname]
local totalUnitTime = buffDataTable.totalUnitTime
if totalUnitTime then totalUnitTime = totalUnitTime / 1000 end
local activetime = totalUnitTime or data.dpstime
if category == "healingOut" or category == "healingIn" then activetime = totalUnitTime or data.hpstime end
local uptime = buffData.uptime / 1000
local groupUptime = buffData.groupUptime / 1000
local relativeUptimeString = string.format("%.1f%%", uptime / activetime * 100)
local uptimeString = string.format("%d:%02d", uptime/60, uptime%60)
local output
if groupUptime > uptime then
local relativeGroupUptimeString = string.format("%.1f%%", groupUptime / activetime * 100)
local groupUptimeString = string.format("%d:%02d", groupUptime/60, groupUptime%60)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTBUFF_FORMAT_GROUP), buffname, relativeUptimeString, uptimeString, units, relativeGroupUptimeString, groupUptimeString)
else
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTBUFF_FORMAT), buffname, relativeUptimeString, uptimeString, units)
end
-- Determine appropriate channel
local channel = db.autoselectchatchannel == false and "" or IsUnitGrouped('player') and "/p " or "/say "
-- Print output to chat
local outputtext = string.format("%s%s", timedata, output)
CHAT_SYSTEM.textEntry:SetText( channel .. outputtext )
CHAT_SYSTEM:Maximize()
CHAT_SYSTEM.textEntry:Open()
CHAT_SYSTEM.textEntry:FadeIn()
end
function CMX.PosttoChat(mode, fight, UnitContextMenuUnitId)
local data = fight and CMX.lastfights[fight] or GetCurrentData()
if data == nil then return end
local timedata = ""
if data ~= GetCurrentData() then
local date = data.date
local datestring = type(date) == "number" and GetDateStringFromTimestamp(date) or date
timedata = string.format("[%s, %s] ", datestring, data.time)
end
local output = ""
local unitSelection = mode == CMX_POSTTOCHAT_MODE_SELECTION and selections.unit["damageOut"]
or mode == CMX_POSTTOCHAT_MODE_SELECTED_UNIT and {[UnitContextMenuUnitId] = true}
or mode == CMX_POSTTOCHAT_MODE_SELECTED_UNITNAME and GetUnitsByName(data, UnitContextMenuUnitId)
local units, damage, name, dpstime = GetSelectionDamage(data, unitSelection)
local bossUnits, bossDamage, bossName, bossTime = GetBossTargetDamage(data)
local singleDamage, _, _, singleTime = GetSingleTargetDamage(data)
dpstime = zo_roundToNearest(dpstime, 0.1)
singleTime = zo_roundToNearest(singleTime, 0.1)
name = zo_strformat(SI_UNIT_NAME, (not unitSelection) and bossName or name)
local bossDamage = data.bossfight and bossDamage or singleDamage
local bossTime = zo_roundToNearest(data.bossfight and bossTime or singleTime, 0.1)
local totalDPSString = ZO_CommaDelimitNumber(math.floor(data.DPSOut))
local totalDamageString = ZO_CommaDelimitNumber(damage)
if mode == CMX_POSTTOCHAT_MODE_HEALING then
local hpstime = zo_roundToNearest(data.hpstime, 0.01)
local timeString = string.format("%d:%04.1f", hpstime/60, hpstime%60)
local totalHPSString = ZO_CommaDelimitNumber(data.HPSOut)
local totalHealingString = ZO_CommaDelimitNumber(data.healingOutTotal)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTHPS_FORMAT), name, totalHPSString, totalHealingString, timeString)
elseif mode == CMX_POSTTOCHAT_MODE_SELECTION_HEALING then
local units, healing, healTime = GetSelectionHeal(data, selections.unit["healingOut"])
healTime = zo_roundToNearest(healTime, 0.1)
local timeString = string.format("%d:%04.1f", healTime/60, healTime%60)
local totalHealingString = ZO_CommaDelimitNumber(healing)
local totalHPSString = ZO_CommaDelimitNumber(math.floor(healing / healTime))
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTSELECTIONHPS_FORMAT), name, units, totalHPSString, totalHealingString, timeString)
elseif units == 1 or mode == CMX_POSTTOCHAT_MODE_SINGLE then
local damage = mode == CMX_POSTTOCHAT_MODE_SELECTED_UNIT and damage or singleDamage
local damageTime = mode == CMX_POSTTOCHAT_MODE_SELECTED_UNIT and dpstime or singleTime
local singleDPSString = ZO_CommaDelimitNumber(math.floor(damage / damageTime))
local singleDamageString = ZO_CommaDelimitNumber(damage)
local timeString = string.format("%d:%04.1f", damageTime/60, damageTime%60)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTDPS_FORMAT), name, singleDPSString, singleDamageString, timeString)
elseif bossUnits > 0 and mode == CMX_POSTTOCHAT_MODE_SMART then
local bosses = bossUnits > 1 and string.format(" (+%d)", (bossUnits-1) ) or ""
local bossTimeString = string.format("%d:%04.1f", bossTime/60, bossTime%60)
local bossDPSString = ZO_CommaDelimitNumber(math.floor(bossDamage / bossTime))
local bossDamageString = ZO_CommaDelimitNumber(bossDamage)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTSMARTDPS_FORMAT), name, bosses, bossDPSString, bossDamageString, bossTimeString)
elseif units > 1 and (mode == CMX_POSTTOCHAT_MODE_MULTI or mode == CMX_POSTTOCHAT_MODE_SMART) then
local timeString = string.format("%d:%04.1f", dpstime/60, dpstime%60)
local totalDPSString = ZO_CommaDelimitNumber(math.floor(data.DPSOut))
local totalDamageString = ZO_CommaDelimitNumber(damage)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTMULTIDPS_FORMAT), name, units-1, totalDPSString, totalDamageString, timeString)
elseif mode == CMX_POSTTOCHAT_MODE_SINGLEANDMULTI then
local bossString = bossUnits > 1 and string.format("%s (+%d)", GetString(SI_COMBAT_METRICS_BOSS_DPS), bossUnits-1) or bossUnits == 1 and GetString(SI_COMBAT_METRICS_BOSS_DPS) or GetString(SI_COMBAT_METRICS_DPS)
local timeString = string.format("%d:%04.1f", dpstime/60, dpstime%60)
local bossTimeString = string.format("%d:%04.1f", bossTime/60, bossTime%60)
local bossDPSString = ZO_CommaDelimitNumber(math.floor(bossDamage / bossTime))
local bossDamageString = ZO_CommaDelimitNumber(bossDamage)
local totalDPSString = ZO_CommaDelimitNumber(math.floor(data.DPSOut))
local totalDamageString = ZO_CommaDelimitNumber(damage)
local stringA = zo_strformat(GetString(SI_COMBAT_METRICS_POSTALLDPS_FORMAT_A), name, units-1, totalDPSString, totalDamageString, timeString)
local stringB = zo_strformat(GetString(SI_COMBAT_METRICS_POSTALLDPS_FORMAT_B), bossString, bossDPSString, bossDamageString, bossTimeString)
output = string.format("%s, %s", stringA, stringB)
elseif mode == CMX_POSTTOCHAT_MODE_SELECTION or mode == CMX_POSTTOCHAT_MODE_SELECTED_UNITNAME then
if not unitSelection then return end
local extraUnits = units > 1 and mode == CMX_POSTTOCHAT_MODE_SELECTED_UNITNAME and string.format(" (x%d)", units )
or units > 1 and string.format(" (+%d)", (units-1) )
or ""
local DPSString = ZO_CommaDelimitNumber(math.floor(damage / dpstime))
local DamageString = ZO_CommaDelimitNumber(damage)
local timeString = string.format("%d:%04.1f", dpstime/60, dpstime%60)
output = zo_strformat(GetString(SI_COMBAT_METRICS_POSTSELECTIONDPS_FORMAT), name, extraUnits, DPSString, DamageString, timeString)
end
-- Determine appropriate channel
local channel = db.autoselectchatchannel == false and "" or IsUnitGrouped('player') and "/p " or "/say "
-- Print output to chat
local outputtext = string.format("%s%s", timedata, output)
CHAT_SYSTEM.textEntry:SetText( channel .. outputtext )
CHAT_SYSTEM:Maximize()
CHAT_SYSTEM.textEntry:Open()
CHAT_SYSTEM.textEntry:FadeIn()
end
local function maxStat()
local _, magicka = GetUnitPower("player", POWERTYPE_MAGICKA )
local _, stamina = GetUnitPower("player", POWERTYPE_STAMINA )
local _, health = GetUnitPower("player", POWERTYPE_HEALTH )
local maxPower = "Magicka"
if stamina > magicka then maxPower = "Stamina" end
if health > magicka and health > stamina then maxPower = "Health" end
return maxPower
end
-- Update the mini DPS meter
local function updateLiveReport(self, data)
local livereport = self
local DPSOut = data.DPSOut
local DPSIn = data.DPSIn
local HPSOut = data.HPSOut
local HPSAOut = data.HPSAOut
local HPSIn = data.HPSIn
local dpstime = data.dpstime
local hpstime = data.hpstime
local groupDPSOut = data.groupDPSOut
local groupDPSIn = data.groupDPSIn
local groupHPSOut = data.groupHPSOut
-- Bail out if there is no damage to report
if (DPSOut == 0 and HPSOut == 0 and DPSIn == 0) or livereport:IsHidden() then return end
local SDPS = 0
local groupSDPS = 0
if db.liveReport.damageOutSingle then
local singleTargetDamage, singleTargetDamageGroup, _, damageTime = GetSingleTargetDamage(data)
SDPS = zo_round(singleTargetDamage / damageTime)
groupSDPS = zo_round(singleTargetDamageGroup / damageTime)
end
local DPSString
local HPSString
local DPSInString
local SDPSString
local maxtime = zo_roundToNearest(math.max(dpstime, hpstime), 0.1)
local timeString = string.format("%d:%04.1f", maxtime/60, maxtime%60)
-- maybe add data from group
if db.recordgrp == true and (groupDPSOut > 0 or groupDPSIn > 0 or groupHPSOut > 0) then
local dpsratio, hpsratio, idpsratio, sdpsratio = 0, 0, 0, 0
if groupDPSOut > 0 then dpsratio = (math.floor(DPSOut / groupDPSOut * 1000) / 10) end
if groupDPSIn > 0 then idpsratio = (math.floor(DPSIn / groupDPSIn * 1000) / 10) end
if groupSDPS > 0 then sdpsratio = (math.floor(SDPS / groupSDPS * 1000) / 10) end
if groupHPSOut > 0 then hpsratio = (math.floor(HPSOut / groupHPSOut * 1000) / 10) end
DPSString = zo_strformat(GetString(SI_COMBAT_METRICS_SHOW_XPS), DPSOut, groupDPSOut, dpsratio)
DPSInString = zo_strformat(GetString(SI_COMBAT_METRICS_SHOW_XPS), DPSIn, groupDPSIn, idpsratio)
HPSString = zo_strformat(GetString(SI_COMBAT_METRICS_SHOW_XPS), HPSOut, groupHPSOut, hpsratio)
SDPSString = zo_strformat(GetString(SI_COMBAT_METRICS_SHOW_XPS), SDPS, groupSDPS, sdpsratio)
else
DPSString = DPSOut
DPSInString = DPSIn
HPSString = HPSOut
SDPSString = SDPS
end
-- Update the values
livereport:GetNamedChild("DamageOutSingle"):GetNamedChild("Label"):SetText( SDPSString )
livereport:GetNamedChild("DamageOut"):GetNamedChild("Label"):SetText( DPSString )
livereport:GetNamedChild("HealOut"):GetNamedChild("Label"):SetText( HPSString )
livereport:GetNamedChild("HealOutAbsolute"):GetNamedChild("Label"):SetText( HPSAOut )
livereport:GetNamedChild("DamageIn"):GetNamedChild("Label"):SetText( DPSInString )
livereport:GetNamedChild("HealIn"):GetNamedChild("Label"):SetText( HPSIn )
livereport:GetNamedChild("Time"):GetNamedChild("Label"):SetText( timeString )
end
local function toggleFightReport()
if not SCENE_MANAGER:IsShowing("CMX_REPORT_SCENE") then
SCENE_MANAGER:Toggle("CMX_REPORT_SCENE")
CombatMetrics_Report:Update(#CMX.lastfights>0 and #CMX.lastfights or nil)
SCENE_MANAGER:SetInUIMode(true)
if #CMX.lastfights>0 and not CMX.inCombat and db.autoscreenshot and (db.autoscreenshotmintime ==0 or CMX.lastfights[#CMX.lastfights]["combattime"]>db.autoscreenshotmintime) then zo_callLater(TakeScreenshot, 400) end
else
SCENE_MANAGER:Toggle("CMX_REPORT_SCENE")
end
end
function CMX.GetCMXData(dataType) -- for external access to fightData
local data = {}
if dataType == "selectionData" then
ZO_DeepTableCopy(selectionData, data)
elseif dataType == "fightData" then
ZO_DeepTableCopy(fightData, data)
else
data = nil
end
return data
end
local scene = ZO_Scene:New("CMX_REPORT_SCENE", SCENE_MANAGER)
local function initFightReport()
local fightReport = CombatMetrics_Report
storeOrigLayout(fightReport)
local pos = db[fightReport:GetName()]
fightReport:ClearAnchors()
fightReport:SetAnchor(CENTER, nil , TOPLEFT, pos.x, pos.y)
local fragment = ZO_HUDFadeSceneFragment:New(fightReport)
scene:AddFragment(fragment)
local function resize(control, scale)
if control.sizes == nil and control.anchors == nil then return end
local width, height = unpack(control.sizes)
if width then control:SetWidth(width*scale) end
if height then control:SetHeight(height*scale) end
local anchors = {}
local oldanchors = control.anchors
if oldanchors then ZO_DeepTableCopy(control.anchors, anchors) end
local anchor1 = anchors[1]
local anchor2 = anchors[2]
if anchor1 or anchor2 then control:ClearAnchors() end
if anchor1 ~= nil then
anchor1[4] = anchor1[4] * scale
anchor1[5] = anchor1[5] * scale
control:SetAnchor(unpack(anchor1))
end
if anchor2 ~= nil then
anchor2[4] = anchor2[4] * scale
anchor2[5] = anchor2[5] * scale
control:SetAnchor(unpack(anchor2))
end
local fontcontrol = control:GetNamedChild("Font")
if fontcontrol ~= nil then
local font, size, style = unpack(fontcontrol.font)
if size then size = tonumber(size) * (scale + 0.2)/1.2 end -- Don't Scale fonts as much
control:SetFont(string.format("%s|%s|%s", font, size, style))
end
for i = 1, control:GetNumChildren() do
local child = control:GetChild(i)
if child then resize(child, scale) end
end
end
fightReport.Resize = resize
-- assign update functions for panels
fightReport.Update = updateFightReport
fightReport.Toggle = toggleFightReport
local titlePanel = fightReport:GetNamedChild("_Title")
titlePanel.Update = updateTitlePanel
local mainPanel = fightReport:GetNamedChild("_MainPanel")
mainPanel.Update = updateMainPanel
local fightStatsPanel = mainPanel:GetNamedChild("FightStats")
fightStatsPanel.Update = updateFightStatsPanel
mainPanel.active = fightStatsPanel
local fightStatsPanelLeft = fightStatsPanel:GetNamedChild("Left")
fightStatsPanelLeft.Update = updateFightStatsPanelLeft
local fightStatsPanelRight = fightStatsPanel:GetNamedChild("Right")
fightStatsPanelRight.Update = updateFightStatsPanelRight
local fightStatsButton = fightStatsPanelRight:GetNamedChild("SelectRow"):GetNamedChild(maxStat())
CMX.UpdateAttackStatsSelector(fightStatsButton)
local combatLogPanel = mainPanel:GetNamedChild("CombatLog")
combatLogPanel.Update = updateCombatLog
local combatLogPageButtonRow = GetControl(combatLogPanel, "HeaderPageButtonRow")
combatLogPageButtonRow.Update = updateCLPageButtons
local combatLogFilterButtonRow = GetControl(combatLogPanel, "HeaderFilterButtonRow")
initCLButtonRow(combatLogFilterButtonRow)
local graphPanel = mainPanel:GetNamedChild("Graph")
graphPanel.Update = updateGraphPanel
local plotToolBar = graphPanel:GetNamedChild("Toolbar")
initPlotToolbar(plotToolBar)
local plotWindow = graphPanel:GetNamedChild("PlotWindow")
initPlotWindow(plotWindow)
local infoPanel = fightReport:GetNamedChild("_InfoPanel")
infoPanel.Update = updateInfoPanel
local rightPanel = fightReport:GetNamedChild("_RightPanel")
rightPanel.Update = updateRightPanel
local buffPanel = rightPanel:GetNamedChild("BuffList")
buffPanel.Update = updateBuffPanel
local buffbutton = rightPanel:GetNamedChild("Selector"):GetNamedChild("BuffsIn")
CMX.SelectRightPanel(buffbutton)
local resourcePanel = rightPanel:GetNamedChild("ResourceList")
resourcePanel.Update = updateResourcePanel
local unitPanel = fightReport:GetNamedChild("_UnitPanel")
unitPanel.Update = updateUnitPanel
local abilityPanel = fightReport:GetNamedChild("_AbilityPanel")
abilityPanel.Update = updateAbilityPanel
local infoRowPanel = fightReport:GetNamedChild("_InfoRow")
infoRowPanel.Update = updateInfoRowPanel
local fightListPanel = fightReport:GetNamedChild("_FightList")
fightListPanel.Update = updateFightList
-- setup buttons:
local selectorButtons = fightReport:GetNamedChild("_SelectorRow")
initSelectorButtons(selectorButtons)
fightReport:Resize(db.FightReport.scale)
local left = selectorButtons:GetLeft()
if left < 0 then
fightReport:ClearAnchors()
fightReport:SetAnchor(CENTER, nil , TOPLEFT, pos.x - left, pos.y)
end
end
local function initLiveReport()
local liveReport = CombatMetrics_LiveReport
storeOrigLayout(liveReport)
local pos = db[liveReport:GetName()]
liveReport:ClearAnchors()
liveReport:SetAnchor(CENTER, nil , TOPLEFT, pos.x, pos.y)
local fragment = ZO_HUDFadeSceneFragment:New(liveReport)
function liveReport.Toggle(liveReport, value)
if value == nil then value = liveReport:IsHidden() end
liveReport:SetHidden(not value)
if value == true then
SCENE_MANAGER:GetScene("hud"):AddFragment( fragment )
SCENE_MANAGER:GetScene("hudui"):AddFragment( fragment )
SCENE_MANAGER:GetScene("siegeBar"):AddFragment( fragment )
else
SCENE_MANAGER:GetScene("hud"):RemoveFragment( fragment )
SCENE_MANAGER:GetScene("hudui"):RemoveFragment( fragment )
SCENE_MANAGER:GetScene("siegeBar"):RemoveFragment( fragment )
end
end
local setLR = db.liveReport
local bg = liveReport:GetNamedChild("BG")
function liveReport.Refresh(liveReport)
local anchors = (setLR.layout == "Horizontal" and {
{TOPLEFT, TOPLEFT, 0, 0, liveReport},
{LEFT, RIGHT, 0, 0},
{LEFT, RIGHT, 0, 0}
}) or (setLR.layout == "Vertical" and {
{TOPLEFT, TOPLEFT, 0, 0, liveReport},
{TOPLEFT, BOTTOMLEFT, 0, 0},
{LEFT, RIGHT, 0, 0}
}) or { -- layout = compact
{TOPLEFT, TOPLEFT, 0, 0, liveReport},
{LEFT, RIGHT, 0, 0},
{TOPLEFT, BOTTOMLEFT, 0, 0},
}
local liveReport = liveReport
local scale = setLR.scale
local last = liveReport
liveReport:SetDimensions(1, 1)
local totalBlocks = 0
for i = 2, liveReport:GetNumChildren() do
local child = liveReport:GetChild(i)
local name = string.gsub(string.gsub(child:GetName(), liveReport:GetName(), ""), "^%u", string.lower) -- difference in names is the child name e.g. "DamageOut". Outer gsub changes first letter to lowercase to match the settings, e.g. "damageOut".
local shown = setLR[name]
if shown == true then
local addspace = child.blocksize
totalBlocks = totalBlocks + addspace
end
end
local halfway = (setLR.layout == "Compact" and (math.ceil(totalBlocks / 2) + 1)) or nil
local blocks = 0
local firstBlock = nil -- to anchor 2nd row to
for i = 2, liveReport:GetNumChildren() do
local child = liveReport:GetChild(i)
local name = string.gsub(string.gsub(child:GetName(), liveReport:GetName(), ""), "^%u", string.lower) -- difference in names is the child name e.g. "DamageOut". Outer gsub changes first letter to lowercase to match the settings, e.g. "damageOut".
local shown = setLR[name]
child:SetHidden(not shown)
if shown then
local addspace = child.blocksize
local isnotfull = ( math.ceil(blocks) - math.ceil(blocks + addspace)) == 0
blocks = blocks + addspace
local is
if firstBlock == nil then firstBlock = child end
local anchorIndex = (blocks == 1 and 1) or ((blocks == halfway or (isnotfull and setLR.layout ~= "Compact")) and 3) or 2
local anchor = anchors[anchorIndex]
anchor[5] = (not isnotfull) and anchorIndex == 3 and firstBlock or last
child:ClearAnchors()
local width, height = unpack(child.sizes)
child:SetDimensions(width*scale, height*scale)
child:SetAnchor(anchor[1], anchor[5], anchor[2], anchor[3]*scale, anchor[4]*scale)
last = child
-- set label alignments
local label = child:GetNamedChild("Label")
local alignment = setLR.alignmentleft and TEXT_ALIGN_LEFT or TEXT_ALIGN_RIGHT
label:SetHorizontalAlignment(alignment)
end
end
zo_callLater(function() bg:SetDimensions(liveReport:GetWidth(), liveReport:GetHeight()) end, 1)
end
local function resize(control, scale)
local width, height = unpack(control.sizes)
if width then control:SetWidth(width*scale) end
if height then control:SetHeight(height*scale) end
local fontcontrol = control:GetNamedChild("Font")
if fontcontrol ~= nil then
local font, size, style = unpack(fontcontrol.font)
if size then size = tonumber(size) * (scale + 0.1)/1.2 end -- Don't Scale fonts as much
control:SetFont(string.format("%s|%s|%s", font, size, style))
end
for i = 1, control:GetNumChildren() do
local child = control:GetChild(i)
if child then resize(child, scale) end
end
end
function liveReport.Resize(liveReport, scale)
resize(liveReport, scale)
liveReport:Refresh()
end
liveReport.Update = updateLiveReport
liveReport:Toggle(setLR.enabled)
liveReport:Resize(setLR.scale)
liveReport:SetMovable(not setLR.locked)
bg:SetAlpha(setLR.bgalpha/100)
end
function CMX.InitializeUI()
db = CMX.db
SVHandler = CombatMetricsFightData
savedFights = SVHandler.GetFights()
if type(db.FightReport.hitCritLayout) ~= "number" then db.FightReport.hitCritLayout = 1 end -- TODO: only for beta users, remove
if type(db.FightReport.averageLayout) ~= "number" then db.FightReport.averageLayout = 1 end -- TODO: only for beta users, remove
local _, size = checkSaveLimit()
db.SVsize = size
selections = {
["ability"] = {},
["unit"] = {},
["buff"] = {},
["resource"] = {},
}
lastSelections = {
["ability"] = {},
["unit"] = {},
["buff"] = {},
["resource"] = {},
}
currentFight = nil
currentCLPage = 1
initFightReport()
initLiveReport()
local settingsbutton = CombatMetrics_Report_SelectorRowSettingsButton
local data = CMX.GetFeedBackData(settingsbutton)
local button, feedbackWindow = LibFeedback:initializeFeedbackWindow(unpack(data))
button:SetHidden(true)
function ToggleFeedback()
feedbackWindow:ToggleHidden()
end
end |
local music = nil;
local ambientMusic = "";
local doors = {};
local guns2 = {};
isAmbient = false;
bg = {};
function startMusic(name, crossfade)
local newMusic = audio:createStream(name);
newMusic.loop = true;
newMusic.isMusic = true;
if crossfade then
audio:crossfade(music, newMusic, 0.5, 0.5, 0.3);
else
if music ~= nil then
music:stop();
end
newMusic:play();
end
music = newMusic;
isAmbient = false;
end
function stopMusic(crossfade)
if music ~= nil then
if crossfade then
audio:crossfade(music, nil, 0.5, 0.5, 0.3);
else
music:stop();
end
end
music = nil;
end
function setAmbientMusic(name)
if ambientMusic ~= name then
ambientMusic = name;
isAmbient = false;
end
end
function startAmbientMusic(crossfade)
if not isAmbient then
startMusic(ambientMusic, crossfade);
isAmbient = true;
end
end
function openJacket(name)
local stream = audio:createSound("servo_move.ogg");
stream:play();
addTimeoutOnce(1.25, function()
stream:stop();
end);
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "jacket1_joint");
j.motorSpeed = -j.motorSpeed;
end
function openStone(joint)
local j = scene:getJoints(joint)[1];
j.motorSpeed = -j.motorSpeed;
scene.camera:findCameraComponent():tremorStart(0.3);
local s = audio:createSound("stone_moving.ogg");
s:play();
addTimeout0(function(cookie, dt)
if j:getJointTranslation() <= j.lowerLimit then
cancelTimeout(cookie);
addTimeoutOnce(0.2, function()
scene.camera:findCameraComponent():tremor(false);
s:stop();
end);
end
end);
end
function closeStone(joint)
local j = scene:getJoints(joint)[1];
j.motorSpeed = -j.motorSpeed;
scene.camera:findCameraComponent():tremorStart(0.3);
local s = audio:createSound("stone_moving.ogg");
s:play();
addTimeout0(function(cookie, dt)
if j:getJointTranslation() >= j.upperLimit then
cancelTimeout(cookie);
addTimeoutOnce(0.2, function()
scene.camera:findCameraComponent():tremor(false);
s:stop();
end);
end
end);
end
function makeFlickerLamps(name)
local function flickerTimeout2(self)
if self.t <= 0 then
for _, light in pairs(self.lights) do
light.visible = self.defaultOn;
end
return;
end
for _, light in pairs(self.lights) do
light.visible = not light.visible;
end
local t = 0.005 + math.random() * 0.015;
self.t = self.t - t;
addTimeoutOnce(t, flickerTimeout2, self);
end
local function flickerTimeout(self)
self.t = 0.01 + math.random() * 0.25;
flickerTimeout2(self);
addTimeoutOnce(1.0 + math.random() * 2.0, flickerTimeout, self);
end
local insts = scene:getInstances(name);
for _, inst in pairs(insts) do
local lights = findObject(inst.objects, "lamp"):findLightComponent():getLights();
addTimeoutOnce(1.0 + math.random() * 2.0, flickerTimeout, { lights = lights, t = 0, defaultOn = lights[1].visible });
end
end
local scl = 5.0;
function setupBgAir()
if bg[1] ~= nil then
bg[1]:removeFromParent();
end
if bg[2] ~= nil then
bg[2]:removeFromParent();
end
if bg[3] ~= nil then
bg[3]:removeFromParent();
end
bg[1] = factory:createBackground("ground1.png", 10, 10, vec2(0.2, 0.2), const.zOrderBackground);
bg[1]:findRenderBackgroundComponent().color = {0.6, 0.6, 0.6, 1.0};
scene:addObject(bg[1]);
bg[2] = factory:createBackground("fog.png", 544 / scl / 2, 416 / scl / 2, vec2(10.0, 1.0), const.zOrderBackground + 1)
bg[2]:findRenderBackgroundComponent().unbound = true;
bg[2]:findRenderBackgroundComponent().color = {1.0, 1.0, 1.0, 0.6};
scene:addObject(bg[2]);
bg[3] = factory:createBackground("fog.png", 544 / scl / 1.5, 416 / scl / 1.5, vec2(15.0, 1.0), const.zOrderBackground + 2)
bg[3]:findRenderBackgroundComponent().unbound = true;
bg[3]:findRenderBackgroundComponent().color = {1.0, 1.0, 1.0, 0.7};
bg[3]:findRenderBackgroundComponent().offset = vec2(0, 416 / scl / 1.5 / 2);
scene:addObject(bg[3]);
end
function setupBgMetal()
if bg[1] ~= nil then
bg[1]:removeFromParent();
end
if bg[2] ~= nil then
bg[2]:removeFromParent();
bg[2] = nil;
end
if bg[3] ~= nil then
bg[3]:removeFromParent();
bg[3] = nil;
end
bg[1] = factory:createBackground("metal1.png", 24.0, 24.0, vec2(0.8, 0.8), const.zOrderBackground);
scene:addObject(bg[1]);
end
function moveDoor(open, name, quiet)
local snd = nil;
if doors[name] ~= nil then
snd = doors[name].snd;
cancelTimeout(doors[name].cookie);
doors[name] = nil;
end
local inst = scene:getInstances(name)[1];
local j = findJoint(inst.joints, "door1_bar_joint");
if (open and j:getJointTranslation() >= j.upperLimit) or
(not open and j:getJointTranslation() <= j.lowerLimit) then
if snd ~= nil then
snd:stop();
end
return;
end
doors[name] = {};
if (snd == nil) and not quiet then
doors[name].snd = audio:createSound("door_move.ogg");
doors[name].snd.loop = true;
doors[name].snd:play();
else
doors[name].snd = snd;
end
if open then
j.motorSpeed = math.abs(j.motorSpeed);
else
j.motorSpeed = -math.abs(j.motorSpeed);
end
doors[name].cookie = addTimeout0(function(cookie, dt)
if (open and j:getJointTranslation() >= j.upperLimit) or
(not open and j:getJointTranslation() <= j.lowerLimit) then
if not quiet then
doors[name].snd:stop();
end
doors[name] = nil;
cancelTimeout(cookie);
end
end);
end
function makeDoor(name, opened)
local inst = scene:getInstances(name)[1];
scene:addGearJoint(findObject(inst.objects, "door1_bar"),
findObject(inst.objects, "door1_wheel"),
findJoint(inst.joints, "door1_bar_joint"),
findJoint(inst.joints, "door1_wheel_joint"),
1, false);
if opened then
moveDoor(true, name, true);
end
end
function fixedSpawn(name)
local spawn = scene:getObjects(name.."_tetrobot2");
for _, obj in pairs(spawn) do
local e = factory:createTetrobot2();
addSpawnedEnemyFreezable(e, obj);
e:findPhysicsBodyComponent():setFilterGroupIndex(-300);
end
end
function makeGun2(inst, dieCb, ...)
inst.myObj = findObject(inst.objects, "gun2_root");
inst.myTrunk = findObject(inst.objects, "gun2_trunk");
inst.myFire = findObjects(inst.objects, "gun2_fire1");
inst.myObj.type = const.SceneObjectTypeEnemyBuilding;
inst.myObj.maxLife = settings.heater1.life;
inst.myObj.life = settings.heater1.life;
local hb = RenderHealthbarComponent(vec2(0.0, 4.0), 0, 6.0, 1.2, const.zOrderMarker + 1);
hb.color = { 1.0, 1.0, 1.0, 0.6 };
inst.myObj:addComponent(hb);
local dummy = inst.myTrunk:findDummyComponent("missile");
inst.weapon = WeaponHeaterComponent(const.SceneObjectTypeEnemyMissile);
inst.weapon.pos = dummy.pos;
inst.weapon.angle = dummy.angle;
inst.weapon.damage = 60.0;
inst.weapon.length = 140.0;
inst.weapon.impulse = 50.0;
inst.weapon.duration = 0.8;
inst.weapon.interval = 0.0;
inst.weapon.minWidth = 0.8;
inst.weapon.maxWidth = 1.8;
inst.weapon.haveSound = false;
inst.myTrunk:addComponent(inst.weapon);
inst.weapon:trigger(true);
inst.myDieCb = dieCb;
inst.myArgs = pack2(...);
local light = inst.myObj:findLightComponent():getLights()[1];
light.myColor = light.color[4];
local tweening = SequentialTweening(true);
tweening:addTweening(SingleTweening(0.4, const.EaseOutQuad, light.color[4], 1.0, false));
tweening:addTweening(SingleTweening(0.4, const.EaseInQuad, 1.0, light.color[4], false));
inst.myTimer = addTimeout0(function(cookie, dt, self)
local c = light.color;
c[4] = tweening:getValue(self.t);
light.color = c;
self.t = self.t + dt;
end, { t = 0 });
guns2[inst.myObj.cookie] = inst;
end
addTimeout0(function(cookie, dt)
for _, inst in pairs(guns2) do
if inst.myObj:dead() then
guns2[inst.myObj.cookie] = nil;
cancelTimeout(inst.myTimer);
inst.myObj:findRenderHealthbarComponent():removeFromParent();
inst.myObj:findLightComponent():removeFromParent();
inst.weapon:trigger(false);
for i = 1, #inst.myFire, 1 do
addTimeoutOnce(0.5 * (i - 1), function()
local obj = factory:createExplosion1(106);
obj.pos = inst.myFire[i].pos;
scene:addObject(obj);
inst.myFire[i].angle = 0;
inst.myFire[i].visible = true;
end);
end
inst.myDieCb(unpack2(inst.myArgs));
end
end
end);
function makeKeyDoor(doorName, phName, fn, ...)
local doorObj = scene:getObjects(doorName)[1];
local phObj = scene:getObjects(phName)[1];
local phC = phObj:findPlaceholderComponent();
phC.listener = createSensorEnterListener(false, function(other, fn, args)
if not scene.player:findPlayerComponent().inventory:have(phC.item) then
return;
end
scene.player:findPlayerComponent().inventory:take(phC.item);
phObj:removeFromParent();
doorObj:findRenderQuadComponents("key")[1].visible = true;
audio:playSound("key.ogg");
fn(unpack2(args));
end, fn, pack2(...));
end
-- main
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeBlaster);
scene.camera:findCameraComponent():zoomTo(35, const.EaseLinear, 0);
scene.lighting.ambientLight = {0.3, 0.3, 0.3, 1.0};
math.randomseed(os.time());
setupBgAir();
bg[4] = factory:createBackground("fog.png", 544 / scl, 416 / scl, vec2(30.0, 1.0), 110)
bg[4]:findRenderBackgroundComponent().unbound = true;
bg[4]:findRenderBackgroundComponent().color = {1.0, 1.0, 1.0, 0.8};
scene:addObject(bg[4]);
setAmbientMusic("ambient2.ogg");
startAmbientMusic(false);
require("e1m2_part0");
require("e1m2_part1");
require("e1m2_part2");
require("e1m2_part3");
require("e1m2_part4");
require("e1m2_part5");
if settings.developer >= 1 then
scene.respawnPoint = scene:getObjects("player_"..settings.developer)[1]:getTransform();
scene.player:setTransform(scene.respawnPoint);
bg[4]:removeFromParent();
bg[4] = nil;
end
if settings.developer == 1 then
showMoveFireInputHint();
end
if settings.developer >= 6 then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeGG);
end
if settings.developer == 6 then
for i = 1, 7, 1 do
scene:getJoints("rock"..i.."_joint")[1]:remove();
end
end
if settings.developer >= 7 then
setupBgMetal();
end
if (settings.developer >= 8) and (settings.developer <= 12) then
setupTrain(2);
end
if settings.developer >= 9 then
scene.player:findPlayerComponent():giveWeapon(const.WeaponTypeSuperShotgun);
scene.player:findPlayerComponent():changeAmmo(const.WeaponTypeShotgun, 20);
end
if settings.developer == 12 then
hallway1Comeback();
end
if (settings.developer >= 13) and (settings.developer <= 18) then
setupTrain(3);
end
if (settings.developer >= 14) and (settings.developer <= 16) then
startMusic("action4.ogg", false);
end
if (settings.developer >= 15) and (settings.developer <= 16) then
setupBgAir();
end
if settings.developer == 17 then
scene:getObjects("terrain0")[1]:findLightComponent():getLights("door6_light1")[1].visible = false;
scene:getObjects("terrain0")[1]:findLightComponent():getLights("door6_light2")[1].visible = false;
scene:getJoints("door9_joint")[1].motorSpeed = -scene:getJoints("door9_joint")[1].motorSpeed;
end
if settings.developer == 18 then
moveDoor(true, "door6", true);
end
if settings.developer == 19 then
scene.player:findPlayerComponent().inventory:give(const.InventoryItemRedKey);
end
|
-- AFK Detector script
-- Made by Dr.CrazY
-- CONSTANTS (Settings)
local UPDATE_DELAY = 1000
-- Time before warning
local MAX_WARNING_TIME = 20 -- In seconds
-- Time before killing/kicking
local MAX_AFK_TIME = 30 -- In seconds
local MAX_AFK_ROUNDS = 3
--
local localPlayer = getLocalPlayer()
local rootElement = getRootElement()
--
local stayCount = 0
local killedCount = 0
--
local screenWidth, screenHeight = guiGetScreenSize()
local showWarning = false
--
local autoKillEnabled = false
local killed = false
--
local usedTip = false
function checkMoving()
local accelerateState = getPedControlState ( localPlayer, "accelerate" )
local brakeState = getPedControlState ( localPlayer, "brake_reverse" )
local leftState = getPedControlState ( localPlayer, "vehicle_left" )
local rightState = getPedControlState ( localPlayer, "vehicle_right" )
local state = true
if((accelerateState == false) and (brakeState == false) and (leftState == false) and (rightState == false)) then
state = false
end
return state
end
-- AFK checking function
function updateMyState()
if(getElementData(localPlayer,"state") ~= "alive") then
showWarning = false
stayCount = 0
killed = false
return
end
-- If player frozen or not in a car, we wont detect his AFK state
if ( not(getPedOccupiedVehicle( localPlayer )) ) then
showWarning = false
stayCount = 0
killed = false
return
else
if ( isVehicleFrozen ( getPedOccupiedVehicle( localPlayer ) ) ) then
showWarning = false
stayCount = 0
killed = false
return
end
end
if(killed)then
return
end
local state = checkMoving()
if ( state == false) then
stayCount = stayCount + 1
else
showWarning = false
stayCount = 0
end
if (autoKillEnabled == true) then
killedCount = killedCount + 1
setElementHealth ( localPlayer, 0 )
killed = true
triggerServerEvent ( "onAutoKilled", localPlayer, killedCount )
return
end
if (stayCount >= MAX_WARNING_TIME) then
showWarning = true
if (stayCount >= MAX_AFK_TIME) then
killedCount = killedCount + 1
if (killedCount >= MAX_AFK_ROUNDS) then
triggerServerEvent ( "onKickedForAFK", localPlayer, MAX_AFK_ROUNDS)
return
end
if (setElementHealth (localPlayer, 0)) then
showWarning = false
triggerServerEvent ( "onKilledForAFK", localPlayer, killedCount, MAX_AFK_ROUNDS )
killed = true
stayCount = 0
end
end
else
showWarning = false
end
end
-- AFK checking timer
setTimer ( updateMyState, UPDATE_DELAY, 0 )
function updateScreen()
if (showWarning) then
dxDrawText( "* You're AFK *", 0, screenHeight-500, screenWidth, screenHeight, tocolor ( 255, 255, 255, 200 ), 6, "arial", "center", "center" )
if (killedCount < MAX_AFK_ROUNDS - 1) then
dxDrawText( "You will get killed after "..(MAX_AFK_TIME - stayCount).." sec.", 0, screenHeight-400, screenWidth, screenHeight, tocolor ( 27,161,226, 200 ), 2, "arial", "center", "center" )
else
dxDrawText( "You will get kicked after "..(MAX_AFK_TIME - stayCount).." sec.", 0, screenHeight-400, screenWidth, screenHeight, tocolor ( 27,161,226, 200 ), 2, "arial", "center", "center" )
end
local state = checkMoving()
if ( state == true) then
stayCount = 0
showWarning = false
end
elseif(autoKillEnabled)then
--screenWidth, screenHeight
dxDrawText( "* AFK *", 0, screenHeight-500, screenWidth, screenHeight, tocolor ( 255, 255, 255, 160 ), 6, "arial", "center", "center" )
dxDrawText( "Auto-kill enabled", 0, screenHeight-400, screenWidth, screenHeight, tocolor ( 15,192,252, 255 ), 2, "arial", "center", "center" )
end
end
addEventHandler ( "onClientRender", rootElement, updateScreen)
function toggleAFKStats()
autoKillEnabled = not autoKillEnabled
if(autoKillEnabled)then
outputChatBox ("#FF0000*#FFFFFF AFK auto-kill is now #939EABenabled" , 255, 255, 255, true )
else
outputChatBox ("#FF0000*#FFFFFF AFK auto-kill is now #939EABdisabled" , 255, 255, 255, true )
killedCount = 0
end
end
addCommandHandler ( "afk", toggleAFKStats, false )
function outputTip()
outputChatBox ("#FF0000*#FFFFFF Use the #939EAB/afk #FFFFFFcommand to enable/disable AFK auto-kill" , 255, 255, 255, true )
usedTip = false
end
setTimer(outputTip, 600000, 0)
addEvent( "onTipTriggered", true )
addEventHandler( "onTipTriggered", getRootElement(), function()
if(not usedTip)then
outputChatBox("#FF0000*#FFFFFF Use the #939EAB/afk #FFFFFFcommand to enable/disabled AFK auto-kill", 255, 255, 255, true)
usedTip = true
end
end) |
----------------------------------------------------------
-- Load RayUI Environment
----------------------------------------------------------
RayUI:LoadEnv()
local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)
obj:SetFont(font, size, style)
if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
if sox and soy then obj:SetShadowOffset(sox, soy) end
if r and g and b then obj:SetTextColor(r, g, b)
elseif r then obj:SetAlpha(r) end
end
function R:UpdateBlizzardFonts()
local NORMAL = self["media"].font
local COMBAT = self["media"].dmgfont
local NUMBER = self["media"].font
local _, editBoxFontSize, _, _, _, _, _, _, _, _ = GetChatWindowInfo(1)
CHAT_FONT_HEIGHTS = {12, 13, 14, 15, 16, 17, 18, 19, 20}
UNIT_NAME_FONT = NORMAL
-- NAMEPLATE_FONT = NORMAL
DAMAGE_TEXT_FONT = COMBAT
STANDARD_TEXT_FONT = NORMAL
-- Base fonts
SetFont(GameTooltipHeader, NORMAL, self.global.media.fontsize)
SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER, self.global.media.fontsize, "OUTLINE")
SetFont(SystemFont_Shadow_Large_Outline, NUMBER, 20, "OUTLINE")
SetFont(NumberFont_Outline_Huge, NUMBER, 28, "THICKOUTLINE")
SetFont(NumberFont_Outline_Large, NUMBER, 15, "OUTLINE")
SetFont(NumberFont_Outline_Med, NUMBER, self.global.media.fontsize*1.1, "OUTLINE")
SetFont(NumberFont_Shadow_Med, NORMAL, self.global.media.fontsize) --chat editbox uses this
SetFont(NumberFont_Shadow_Small, NORMAL, self.global.media.fontsize)
SetFont(QuestFont, NORMAL, self.global.media.fontsize)
SetFont(QuestFont_Large, NORMAL, 14)
SetFont(SystemFont_Large, NORMAL, 15)
SetFont(GameFontNormalMed3, NORMAL, 15)
SetFont(GameFontHighlightMedium, NORMAL, 15)
SetFont(SystemFont_Shadow_Huge1, NORMAL, 20, "THINOUTLINE") -- Raid Warning, Boss emote frame too
SetFont(SystemFont_Med1, NORMAL, self.global.media.fontsize)
SetFont(SystemFont_Med3, NORMAL, self.global.media.fontsize*1.1)
SetFont(SystemFont_OutlineThick_Huge2, NORMAL, 20, "THICKOUTLINE")
SetFont(SystemFont_Outline_Small, NUMBER, self.global.media.fontsize, "OUTLINE")
SetFont(SystemFont_Shadow_Large, NORMAL, 15)
SetFont(SystemFont_Shadow_Med1, NORMAL, self.global.media.fontsize)
SetFont(SystemFont_Shadow_Med3, NORMAL, self.global.media.fontsize*1.1)
SetFont(SystemFont_Shadow_Outline_Huge2, NORMAL, 20, "OUTLINE")
SetFont(SystemFont_Shadow_Small, NORMAL, self.global.media.fontsize*0.9)
SetFont(SystemFont_Small, NORMAL, self.global.media.fontsize)
SetFont(SystemFont_Tiny, NORMAL, self.global.media.fontsize)
SetFont(Tooltip_Med, NORMAL, self.global.media.fontsize)
SetFont(Tooltip_Small, NORMAL, self.global.media.fontsize)
SetFont(ZoneTextString, NORMAL, 32, "OUTLINE")
SetFont(SubZoneTextString, NORMAL, 25, "OUTLINE")
SetFont(PVPInfoTextString, NORMAL, 22, "THINOUTLINE")
SetFont(PVPArenaTextString, NORMAL, 22, "THINOUTLINE")
SetFont(CombatTextFont, COMBAT, 200, "THINOUTLINE") -- number here just increase the font quality.
SetFont(FriendsFont_Normal, NORMAL, self.global.media.fontsize)
SetFont(FriendsFont_Small, NORMAL, self.global.media.fontsize)
SetFont(FriendsFont_Large, NORMAL, self.global.media.fontsize)
SetFont(FriendsFont_UserText, NORMAL, self.global.media.fontsize)
end
|
local vim = vim
local api = vim.api
local lsp = vim.lsp
local tag_formatting = require "lsp_smag.tags.formatting"
local list_utils = require "lsp_smag.utils.lists"
local lsp_methods = require "lsp_smag.lsp.methods"
local lsp_server_capabilities = require "lsp_smag.lsp.server_capabilities"
local tag_kinds = require "lsp_smag.tags.kinds"
local function get_word_under_cursor()
return api.nvim_call_function("expand", {"<cword>"})
end
local function client_response_is_error(client_response)
return client_response["error"] ~= nil
end
local function get_locations_from_client(client, method, parameter, buffer_number)
if not client.supports_method(method) then
return {}
end
local response = client.request_sync(method, parameter, nil, buffer_number)
if response == nil or client_response_is_error(response) then
return {}
end
return response.result
end
local function get_locations_from_all_clients(method)
local buffer_number = api.nvim_get_current_buf()
local parameter = lsp.util.make_position_params()
local buffer_clients = lsp.buf_get_clients(buffer_number)
local all_locations = {}
for _, client in ipairs(buffer_clients) do
local locations = get_locations_from_client(client, method, parameter, buffer_number)
list_utils.extend(all_locations, locations)
end
return all_locations
end
local function convert_locations_to_tags(locations, tag_kind)
local tags = {}
local tag_name = get_word_under_cursor()
for _, location in ipairs(locations) do
table.insert(tags, tag_formatting.lsp_location_to_tag(tag_name, tag_kind, location))
end
return tags
end
local function get_tags_of_provider(provider_name)
local lsp_method = lsp_methods[provider_name]
local tag_kind = tag_kinds[provider_name]
local locations = get_locations_from_all_clients(lsp_method)
return convert_locations_to_tags(locations, tag_kind)
end
return {
get_tags_of_provider = get_tags_of_provider
}
|
--[[
Copyright (C) 2019 Blue Mountains GmbH
This program is free software: you can redistribute it and/or modify it under the terms of the Onset
Open Source License as published by Blue Mountains GmbH.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the Onset Open Source License for more details.
You should have received a copy of the Onset Open Source License along with this program. If not,
see https://bluemountains.io/Onset_OpenSourceSoftware_License.txt
]]--
Reports = {}
function cmd_pm(player, otherplayer, ...)
local message = table.concat({...}, " ")
if (otherplayer == nil or #{...} == 0) then
return AddPlayerChat(player, "Usage: /pm <player> <message>")
end
otherplayer = tonumber(otherplayer)
if (not IsValidPlayer(otherplayer)) then
return AddPlayerChat(player, "Unknown player")
end
if (player == otherplayer) then
return AddPlayerChat(player, "Cannot do this command on yourself")
end
AddPlayerChat(otherplayer, "***[PM] from Player("..player.."): "..message)
AddPlayerChat(player, ">>>[PM] to Player("..otherplayer.."): "..message)
end
AddCommand("pm", cmd_pm)
function cmd_s(player)
local vehicle = GetPlayerVehicle(player)
local x, y, z, h
if (vehicle ~= 0) then
x, y, z = GetVehicleLocation(vehicle)
h = GetVehicleHeading(vehicle)
else
x, y, z = GetPlayerLocation(player)
h = GetPlayerHeading(player)
end
PlayerData[player].sX = x
PlayerData[player].sY = y
PlayerData[player].sZ = z
PlayerData[player].sH = h
AddPlayerChat(player, "Location saved, use /l to load it.")
AddPlayerChat(player, "XYZ: "..x..", "..y..", "..z..", "..h)
print("XYZ: "..x..", "..y..", "..z..", "..h)
end
AddCommand("s", cmd_s)
AddCommand("spos", cmd_s)
function cmd_l(player)
if (PlayerData[player].sX == nil) then
return AddPlayerChat(player, "You must save your location first! (/s)")
end
local vehicle = GetPlayerVehicle(player)
if (vehicle ~= 0) then
SetVehicleLocation(vehicle, PlayerData[player].sX, PlayerData[player].sY, PlayerData[player].sZ)
SetVehicleHeading(vehicle, PlayerData[player].sH)
else
SetPlayerLocation(player, PlayerData[player].sX, PlayerData[player].sY, PlayerData[player].sZ)
SetPlayerHeading(player, PlayerData[player].sH)
end
ResetPlayerCamera(player)
AddPlayerChat(player, "Location loaded!")
end
AddCommand("l", cmd_l)
AddCommand("lpos", cmd_l)
function cmd_loc(player, x, y, z)
if (x == nil or y == nil or z == nil) then
return AddPlayerChat(player, "Usage: /loc <x> <y> <z>")
end
TeleportTo(player, x, y, z)
--SetPlayerLocation(player, x, y, z)
AddPlayerChat(player, "Location set!")
end
AddCommand("loc", cmd_loc)
function cmd_getloc(player)
local x, y, z = GetPlayerLocation(player)
local h = GetPlayerHeading(player)
AddPlayerChat(player, "XYZH: "..x..", "..y..", "..z..", "..h)
end
AddCommand("getloc", cmd_getloc)
function cmd_w(player, weapon, slot, ammo)
if (weapon == nil or slot == nil or ammo == nil) then
return AddPlayerChat(player, "Usage: /w <weapon> <slot> <ammo>")
end
SetPlayerWeapon(player, weapon, ammo, true, slot)
end
AddCommand("w", cmd_w)
AddCommand("weapon", cmd_w)
function cmd_mywep(player)
for i=1,4 do
local weapon, ammo = GetPlayerWeapon(player, i)
AddPlayerChat(player, "Slot "..i..": "..weapon..", "..ammo)
end
end
AddCommand("mywep", cmd_mywep)
function cmd_model(player, model)
if (model == nil) then
return AddPlayerChat(player, "Usage: /model <model number>")
end
model = tonumber(model)
--[[if (model == nil or model < 1 or model > 26) then
return AddPlayerChat(player, "Invalid model id")
end]]--
SetPlayerPropertyValue(player, "_modelPreset", model)
AddPlayerChat(player, "Model set (ID: "..model..")")
end
AddCommand("model", cmd_model)
function cmd_v(player, model)
-- If the player did not pass any command parameter tell them how to use this chat command
if (model == nil) then
return AddPlayerChat(player, "Usage: /v <model number>")
end
model = tonumber(model)
-- Check for valid vehicle model.
--[[if (model == nil or model < 1 or model > 23) then
return AddPlayerChat(player, "Vehicle model "..model.." does not exist.")
end]]--
-- Destroy any old vehicle the player has spawned already.
if (PlayerData[player].vehicle ~= 0) then
DestroyVehicle(PlayerData[player].vehicle)
PlayerData[player].vehicle = 0
end
-- Get the current player location, used to spawn the vehicle.
local x, y, z = GetPlayerLocation(player)
local h = GetPlayerHeading(player)
-- Spawn the vehicle.
local vehicle = CreateVehicle(model, x, y, z, h)
if (vehicle == false) then
return AddPlayerChat(player, "Failed to spawn your vehicle")
end
-- Save the vehicle identifier in the global player table
PlayerData[player].vehicle = vehicle
-- Do not change color of the taxi or police car
if (model ~= 2 and model ~= 3) then
local color = RGB(math.random(1, 220), math.random(1, 220), math.random(1, 220))
SetVehicleColor(vehicle, NiceColors[ math.random( #NiceColors ) ])
end
-- Set the vehicle license plate and attach nitro
SetVehicleLicensePlate(vehicle, "O N S E T")
AttachVehicleNitro(vehicle, true)
-- Never respawn player vehicles if it is left unoccupied
SetVehicleRespawnParams(vehicle, false)
if (model == 8) then
-- Ambulance
SetVehicleColor(vehicle, RGB(0.0, 60.0, 240.0))
SetVehicleLicensePlate(vehicle, "EMS-02")
end
-- Finally set the player on the vehicles driver seat
SetPlayerInVehicle(player, vehicle)
AddPlayerChat(player, "Vehicle spawned! (New ID: "..vehicle..")")
end
AddCommand("v", cmd_v)
function cmd_time(player, player_time)
if (player_time == nil) then
return AddPlayerChat(player, "Usage: /time <time 0-24>")
end
player_time = tonumber(player_time)
if (player_time == nil or player_time < 0 or player_time > 24) then
return AddPlayerChat(player, "Parameter \"time\" 0-24")
end
CallRemoteEvent(player, "ClientSetTime", player_time)
end
AddCommand("time", cmd_time)
function cmd_fog(player, fog)
fog = tonumber(fog)
if (fog == nil) then
return AddPlayerChat(player, "Usage: /fog <level 0-5 (default: 0.4)>")
end
CallRemoteEvent(player, "ClientSetFog", fog)
end
AddCommand("fog", cmd_fog)
function cmd_weather(player, player_weather)
if (player_weather == nil) then
return AddPlayerChat(player, "Usage: /weather <1-10>")
end
player_weather = tonumber(player_weather)
if (player_weather == nil or player_weather < 0 or player_weather > 10) then
return AddPlayerChat(player, "Parameter \"weather\" 1-10")
end
CallRemoteEvent(player, "ClientSetWeather", player_weather)
end
AddCommand("weather", cmd_weather)
function cmd_avgping(player)
local AvgPing = 0
local PlayerCount = GetPlayerCount()
for _, v in pairs(GetAllPlayers()) do
AvgPing = AvgPing + GetPlayerPing(v)
end
AvgPing = AvgPing / PlayerCount
AddPlayerChat(player, "Average ping of "..PlayerCount.." players: "..AvgPing)
end
AddCommand("avgping", cmd_avgping)
function cmd_report(player, otherplayer, ...)
if (GetTimeSeconds() - PlayerData[player].report_cooldown < 30.0) then
return AddPlayerChat(player, "Slow down reporting")
end
local reason = table.concat({...}, " ")
if (otherplayer == nil or #{...} == 0) then
return AddPlayerChat(player, "Usage: /report <player> <reason>")
end
if (#reason < 6 or #reason > 80) then
return AddPlayerChat(player, "Parameter \"reason\" invalid length 6-80")
end
otherplayer = tonumber(otherplayer)
if (not IsValidPlayer(otherplayer)) then
return AddPlayerChat(player, "Selected player does not exist")
end
if (otherplayer == player) then
return AddPlayerChat(player, "Cannot report yourself")
end
PlayerData[player].report_cooldown = GetTimeSeconds()
if (#Reports >= 10) then
table.remove(Reports, 1)
end
local ReportStr = "Report ("..GetTimeFormat().."): "..GetPlayerName(player).."("..player..") reports "..GetPlayerName(otherplayer).."("..otherplayer..") for "..reason
table.insert(Reports, ReportStr)
AddAdminChat("New report by "..GetPlayerName(player))
local query = mariadb_prepare(sql, "INSERT INTO log_reports VALUES (?, ?, UNIX_TIMESTAMP(), '?');",
PlayerData[otherplayer].accountid,
PlayerData[player].accountid,
reason)
mariadb_async_query(sql, query)
end
AddCommand("report", cmd_report)
function cmd_headsize(player, size)
if (size == nil) then
return AddPlayerChat(player, "Usage: /headsize <size 0.0-6.0>")
end
size = tonumber(size)
if (size == nil or size < 0.0 or size > 6.0) then
return AddPlayerChat(player, "Parameter \"size\" 0.0-6.0")
end
SetPlayerHeadSize(player, size)
end
AddCommand("headsize", cmd_headsize)
function cmd_color(player)
SetPlayerRandomColor(player)
AddPlayerChat(player, 'Your new player color: <span color="'..GetPlayerColorHEX(player)..'">'..GetPlayerName(player)..'('..player..')</>')
end
AddCommand("color", cmd_color)
function cmd_richlist(player)
local arr = {}
for _, v in pairs(GetAllPlayers()) do
table.insert(arr, { PlayerData[v].cash, v })
end
table.sort(arr, function(a, b)
return a[1] > b[1]
end)
for k, v in pairs(arr) do
AddPlayerChat(player, '<span color="'..GetPlayerColorHEX(v[2])..'">$'..v[1]..' '..GetPlayerName(v[2])..'('..v[2]..')</>')
end
end
AddCommand("richlist", cmd_richlist)
function cmd_toptime(player)
local arr = {}
for _, v in pairs(GetAllPlayers()) do
table.insert(arr, { PlayerData[v].time, v })
end
table.sort(arr, function(a, b)
return a[1] > b[1]
end)
for k, v in pairs(arr) do
AddPlayerChat(player, v[1].."sec "..GetPlayerName(v[2]))
end
end
AddCommand("toptime", cmd_toptime)
function cmd_stats(player, otherplayer)
local p = otherplayer or player
p = tonumber(p)
if (not IsValidPlayer(p)) then
return AddPlayerChat(player, "Selected player does not exist")
end
webgui.ShowMessageBox(player, "<span style=\"color:"..GetPlayerColorHEX(p)..";\">"..GetPlayerName(p).."("..p..")</span><br><br>\
Cash: "..GetPlayerCashFormat(p).."<br>\
Bank: "..FormatMoney(PlayerData[p].bank_balance).."<br>\
Kills: "..PlayerData[p].kills.."<br>\
Deaths: "..PlayerData[p].deaths.."<br>\
K/D: "..GetPlayerKD(p).."<br>\
Bounty: "..FormatMoney(PlayerData[p].bounty).."<br>\
Login Count: "..PlayerData[p].count_login.."<br>\
Kick Count: "..PlayerData[p].count_kick.."<br>\
Last Login: "..FormatUnixTime(PlayerData[p].last_login_time).."<br>\
Playing Time: "..FormatPlayTime(GetPlayerTime(p)).."<br>\
Registration: "..FormatUnixTime(PlayerData[p].registration_time).."<br>\
<img src=\"http://game/objects/1\">")
end
AddCommand("stats", cmd_stats)
function cmd_para(player)
AttachPlayerParachute(player, true)
AddPlayerChat(player, "Have fun with your parachute!")
end
AddCommand("para", cmd_para)
function cmd_drunk(player)
CallRemoteEvent(player, "ToggleDrunkEffect")
end
AddCommand("drunk", cmd_drunk)
function cmd_vcolor(player, r, g, b)
if (r == nil or g == nil or b == nil) then
return AddPlayerChat(player, "Usage: /vcolor <r> <g> <b>")
end
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
SetVehicleColor(vehicle, RGB(r, g, b))
AddPlayerChat(player, "New vehicle color set (HEX: "..GetVehicleColor(vehicle)..")")
end
AddCommand("vcolor", cmd_vcolor)
function cmd_repair(player)
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
for i=1,8 do
SetVehicleDamage(vehicle, i, 0.0)
end
AddPlayerChat(player, "Vehicle repaired")
end
AddCommand("repair", cmd_repair)
function cmd_vcolorfun(player)
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
CreateTimer(function(vehicle)
if not IsValidVehicle(vehicle) then
return
end
local r = Random(100, 255)
local g = Random(100, 255)
local b = Random(100, 255)
SetVehicleColor(vehicle, RGB(r, g, b))
end, 200, vehicle)
end
AddCommand("vcolorfun", cmd_vcolorfun)
function cmd_hood(player, ratio)
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
if (ratio == nil) then
if (GetVehicleHoodRatio(vehicle) > 0.0) then
SetVehicleHoodRatio(vehicle, 0.0)
else
SetVehicleHoodRatio(vehicle, 60.0)
end
else
ratio = tonumber(ratio)
if (ratio > 90.0) then
ratio = 90.0
elseif (ratio < 0.0) then
ratio = 0.0
end
SetVehicleHoodRatio(vehicle, ratio)
end
end
AddCommand("hood", cmd_hood)
function cmd_trunk(player, ratio)
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
if (ratio == nil) then
if (GetVehicleTrunkRatio(vehicle) > 0.0) then
SetVehicleTrunkRatio(vehicle, 0.0)
else
SetVehicleTrunkRatio(vehicle, 60.0)
end
else
ratio = tonumber(ratio)
if (ratio > 90.0) then
ratio = 90.0
elseif (ratio < 0.0) then
ratio = 0.0
end
SetVehicleTrunkRatio(vehicle, ratio)
end
end
AddCommand("trunk", cmd_trunk)
function cmd_lp(player, ...)
local message = table.concat({...}, " ")
if (#{...} == 0) then
return AddPlayerChat(player, "Usage: /lp <new license plate text>")
end
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, '<span color="#ff0000ee">You must be in a vehicle!</>')
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
SetVehicleLicensePlate(vehicle, message)
end
AddCommand("lp", cmd_lp)
function cmd_anim(player, animname)
if (animname == nil) then
return AddPlayerChat(player, "Usage: /anim <name of animation>")
end
SetPlayerAnimation(player, animname)
end
AddCommand("anim", cmd_anim)
function cmd_spec(player, disable)
local _disable = false
if disable ~= nil then
_disable = true
end
_disable = not _disable
SetPlayerSpectate(player, _disable)
end
AddCommand("spec", cmd_spec)
function cmd_hat(player, hatobject)
if (PlayerData[player].hat ~= 0) then
DestroyObject(PlayerData[player].hat)
PlayerData[player].hat = 0
end
local hatModel = 0
if hatobject == nil then
local startHats = 398
local endHats = 477
hatModel = Random(startHats, endHats)
else
hatModel = math.tointeger(hatobject)
end
local x, y, z = GetPlayerLocation(player)
PlayerData[player].hat = CreateObject(hatModel, x, y, z)
SetObjectAttached(PlayerData[player].hat, ATTACH_PLAYER, player, 14.0, 0.0, 0.0, 0.0, 90.0, -90.0, "head")
SetObjectAttached(PlayerData[player].hat, ATTACH_PLAYER, player, 14.0, 0.0, 0.0, 0.0, 90.0, -90.0, "head")
AddPlayerChat(player, "Attached object model id as hat: "..hatModel)
end
AddCommand("hat", cmd_hat)
function cmd_objtest(player)
local x, y, z = 64151.0234375, 48423.33984375, 4516.530273
for c=1,50 do
for r=1,50 do
CreateObject(592, x + (c * 350.0), y + (r * 350.0), z)
end
end
end
AddCommand("objtest", cmd_objtest) |
local gtsrb = {}
gtsrb.dataset = require 'dataset'
gtsrb.networks = require 'networks'
gtsrb.trainer = require 'trainer'
return gtsrb
|
return require('jls.lang.loader').requireOne('jls.net.dns-luv', 'jls.net.dns-socket')
|
-- Neuron is a World of Warcraft® user interface addon.
-- Copyright (c) 2017-2021 Britt W. Yazel
-- Copyright (c) 2006-2014 Connor H. Chenoweth
-- This code is licensed under the MIT license (see LICENSE for details)
---@class PETBTN : BUTTON @define class PETBTN inherits from class BUTTON
local PETBTN = setmetatable({}, { __index = Neuron.BUTTON })
Neuron.PETBTN = PETBTN
local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
LibStub("AceEvent-3.0"):Embed(PETBTN)
LibStub("AceTimer-3.0"):Embed(PETBTN)
---Constructor: Create a new Neuron BUTTON object (this is the base object for all Neuron button types)
---@param bar BAR @Bar Object this button will be a child of
---@param buttonID number @Button ID that this button will be assigned
---@param defaults table @Default options table to be loaded onto the given button
---@return PETBTN @ A newly created PETBTN object
function PETBTN.new(bar, buttonID, defaults)
--call the parent object constructor with the provided information specific to this button type
local newButton = Neuron.BUTTON.new(bar, buttonID, PETBTN, "PetBar", "PetButton", "NeuronActionButtonTemplate")
if defaults then
newButton:SetDefaults(defaults)
end
return newButton
end
function PETBTN:SetType()
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("UNIT_PET")
self:RegisterEvent("PET_BAR_UPDATE", "UpdateData")
self:RegisterEvent("PET_BAR_UPDATE_COOLDOWN", "UpdateCooldown")
self:RegisterEvent("PET_DISMISS_START", "PLAYER_ENTERING_WORLD")
self:RegisterEvent("PLAYER_CONTROL_LOST", "UpdateData")
self:RegisterEvent("PLAYER_CONTROL_GAINED", "UpdateData")
self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", "UpdateData")
if not Neuron.isWoWClassic and not Neuron.isWoWClassic_TBC then
self:RegisterEvent("PET_SPECIALIZATION_CHANGED", "PLAYER_ENTERING_WORLD")
end
self.actionID = self.id
self:SetAttribute("type1", "pet")
self:SetAttribute("type2", "macro")
self:SetAttribute("*action1", self.actionID)
self:SetScript("PostClick", function(self) self:UpdateData() self:UpdateStatus() end)
self:SetScript("OnDragStart", function(self) self:OnDragStart() end)
self:SetScript("OnReceiveDrag", function(self) self:OnReceiveDrag() end)
self:SetScript("OnEnter", function(self,...) self:UpdateTooltip() end)
self:SetScript("OnLeave", function() GameTooltip:Hide() end)
self:SetScript("OnAttributeChanged", nil)
self:SetSkinned()
end
function PETBTN:UpdateIcon()
local _, texture, isToken = GetPetActionInfo(self.actionID)
self.Name:SetText("")
self.Count:SetText("")
if texture then
if isToken then
self.Icon:SetTexture(_G[texture])
else
self.Icon:SetTexture(texture)
end
self.Icon:Show()
else
self.Icon:SetTexture("")
self.Icon:Hide()
end
end
function PETBTN:UpdateStatus()
local _, _, _, isActive, allowed, enabled = GetPetActionInfo(self.actionID)
if isActive then
if IsPetAttackAction(self.actionID) then
self:GetCheckedTexture():SetAlpha(0.5)
else
self:GetCheckedTexture():SetAlpha(1.0)
end
self:SetChecked(true)
else
self:GetCheckedTexture():SetAlpha(1.0)
self:SetChecked(false)
end
if allowed then
self.AutoCastable:Show()
else
self.AutoCastable:Hide()
end
if enabled then
self.Shine:Show()
AutoCastShine_AutoCastStart(self.Shine)
self.AutoCastable:Hide()
else
self.Shine:Hide()
AutoCastShine_AutoCastStop(self.Shine)
if allowed then
self.AutoCastable:Show()
end
end
self:UpdateUsable()
end
function PETBTN:UpdateCooldown()
if self.actionID and GetPetActionInfo(self.actionID) then
local start, duration, enable, modrate = GetPetActionCooldown(self.actionID)
self:SetCooldownTimer(start, duration, enable, self.cdText, modrate, self.cdcolor1, self.cdcolor2, self.cdAlpha)
end
end
function PETBTN:UpdateNormalTexture()
if not self:GetSkinned() then
if GetPetActionInfo(self.actionID) then
self:SetNormalTexture(self.hasAction or "")
self:GetNormalTexture():SetVertexColor(1,1,1,1)
else
self:SetNormalTexture(self.noAction or "")
self:GetNormalTexture():SetVertexColor(1,1,1,0.5)
end
end
end
function PETBTN:UpdateData()
local spell = GetPetActionInfo(self.actionID)
self.spell = spell
self:UpdateNormalTexture()
self:UpdateIcon()
self:UpdateCooldown()
if not InCombatLockdown() then
if spell then
self:SetAttribute("*macrotext2", "/petautocasttoggle "..spell)
end
end
self:UpdateStatus()
end
function PETBTN:UpdateUsable()
if self.editmode then
self.Icon:SetVertexColor(0.2, 0.2, 0.2)
elseif self.actionID and GetPetActionSlotUsable(self.actionID) then
self.Icon:SetVertexColor(1.0, 1.0, 1.0)
else
self.Icon:SetVertexColor(0.4, 0.4, 0.4)
end
end
function PETBTN:PLAYER_ENTERING_WORLD()
self:UpdateData()
self:UpdateUsable()
self:UpdateIcon()
self:UpdateStatus()
self:UpdateNormalTexture()
self:UpdateObjectVisibility(true) --have to set true at login or the buttons on the bar don't show
self.Binder:ApplyBindings()
--This part is so that the grid get's set properly on login
self:ScheduleTimer(function() self:UpdateObjectVisibility() end, 2)
end
function PETBTN:UNIT_PET(event, unit)
if unit == "player" then
self:UpdateData()
end
end
function PETBTN:OnDragStart()
if InCombatLockdown() then
return
end
if not self.barLock then
self.drag = true
elseif self.barLockAlt and IsAltKeyDown() then
self.drag = true
elseif self.barLockCtrl and IsControlKeyDown() then
self.drag = true
elseif self.barLockShift and IsShiftKeyDown() then
self.drag = true
end
if self.drag then
self:SetChecked(false)
PickupPetAction(self.actionID)
self:UpdateData()
end
for i,bar in pairs(Neuron.BARIndex) do
if bar.class == "pet" then
bar:UpdateBarObjectVisibility(true)
end
end
end
function PETBTN:OnReceiveDrag()
if InCombatLockdown() then
return
end
local cursorType = GetCursorInfo()
if cursorType == "petaction" then
self:SetChecked(false)
PickupPetAction(self.actionID)
self:UpdateData()
end
end
function PETBTN:UpdateTooltip()
if self.bar then
if self.tooltipsCombat and InCombatLockdown() then
return
end
if self.tooltips then
if self.tooltipsEnhanced then
self.UberTooltips = true
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
else
self.UberTooltips = false
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
end
if GetPetActionInfo(self.actionID) then
if self.UberTooltips then
GameTooltip:SetPetAction(self.actionID)
else
GameTooltip:SetText(self.spell)
end
end
GameTooltip:Show()
end
end
end
function PETBTN:UpdateObjectVisibility(show)
if show or self.showGrid or GetPetActionInfo(self.actionID) then
self.isShown = true
else
self.isShown = false
end
Neuron.BUTTON.UpdateObjectVisibility(self) --call parent function
end |
add_rules("mode.debug", "mode.release")
rule("vs2015_x86")
before_load(function (target)
target:set("arch", "x86")
target:set("toolchains", "msvc", {vs = "2015"})
end)
target("testvs_vs2015_x86")
set_kind("binary")
add_files("src/*.cpp", "src/*.rc")
add_rules("vs2015_x86")
target("testvs")
set_kind("binary")
add_files("src/*.cpp", "src/*.rc")
|
--[[
▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀
▀▄ ▄▀ ▀▄ ▄▀
▀▄ ▄▀ BY OmarRea; ▀▄ ▄▀
▀▄ ▄▀ BY OmarReal (Omar_Real7) ▀▄ ▄▀
▀▄ ▄▀ JUST WRITED BY OmarReal ▀▄ ▄▀
▀▄ ▄▀ ▀▄ ▄▀
▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀
--]]
do
function run(msg, matches)
local reply_id = msg['id']
local info = ' - Name : '..msg.from.first_name..'\n'
..'◼️ - Id : '..msg.from.id..'\n'
..'◼️ - Username : @'..msg.from.username..'\n'
..'◼️ - Group ID : '..msg.to.id..'\n'
..'◼️ - Number of members : 5.k\n - Group Name : '..msg.to.title
reply_msg(reply_id, info, ok_cb, false)
end
return {
patterns = {
"^/info"
},
run = run
}
--Coded By Omar Aliraqe >> @Omar_Real7
end
|
local nvim_lsp = require("lspconfig")
local lsp = require("lsp.config")
nvim_lsp.metals.setup({
on_attach = lsp.on_attach,
})
|
local Cache = require('./Cache')
local OrderedCache, property, method = class('OrderedCache', Cache)
OrderedCache.__description = "Extention of Cache that maintains object order using a linked list. If the ordered cache is full, adding a new object will discard the oldest object."
function OrderedCache:__init(array, constructor, key, limit, parent)
Cache.__init(self, array, constructor, key, parent)
self._limit = limit
self._next = {}
self._prev = {}
end
function OrderedCache:_add(obj)
local key = self._key
if self._count == 0 then
self._first = obj
self._last = obj
else
self._next[self._last[key]] = obj
self._prev[obj[key]] = self._last
self._last = obj
end
if self._count == self._limit then self:remove(self._first) end
self._objects[obj[key]] = obj
self._count = self._count + 1
end
function OrderedCache:_remove(obj)
local key = self._key
if self._count == 1 then
self._first = nil
self._last = nil
else
local prev = self._prev[obj[key]]
local next = self._next[obj[key]]
if obj == self._last then
self._last = prev
self._next[prev[key]] = nil
elseif obj == self._first then
self._first = next
self._prev[next[key]] = nil
else
self._next[prev[key]] = next
self._prev[next[key]] = prev
end
end
self._objects[obj[key]] = nil
self._count = self._count - 1
end
local function iterLastToFirst(self)
local obj = self._last
local key = self._key
return function()
local ret = obj
obj = obj and self._prev[obj[key]] or nil
return ret
end
end
local function iterFirstToLast(self)
local obj = self._first
local key = self._key
return function()
local ret = obj
obj = obj and self._next[obj[key]] or nil
return ret
end
end
local function iter(self, reverse)
return reverse and self:iterLastToFirst() or self:iterFirstToLast()
end
property('limit', '_limit', nil, 'number', "The maximum amount of objects that can be cached before the cache starts to empty")
property('first', '_first', nil, '*', "The first, or oldest, object in the cache")
property('last', '_last', nil, '*', "The last, or newest, object in the cache")
method('iterLastToFirst', iterLastToFirst, nil, "Returns an iterator for the objects in order of last (newest) to first (oldest).")
method('iterFirstToLast', iterFirstToLast, nil, "Returns an iterator for the objects in order of first (oldest) to last (newest).")
method('iter', iter, '[reverse]', "Equivalent to `iterFirstToLast` (or `iterLastToFirst` if reverse is `true`).")
return OrderedCache
|
local _M = {}
_M.__index = _M
function _M.new(scenario_results)
return setmetatable({
_scenario_results = scenario_results
}, _M)
end
function _M.timethese(self)
print("\nScore:\n")
for i, r in ipairs(self._scenario_results) do
print(r.title .. ": " .. r.score:format())
end
return self
end
function _M.cmpthese(self)
print("\nComparison chart:\n")
local rows = self:create_comparision_table()
print(self:render_table(rows))
return self
end
function _M.create_comparision_table(self)
local rows = {}
local header_row = {}
local header_row_cursor = 1
header_row[header_row_cursor] = ""
header_row_cursor = header_row_cursor + 1
header_row[header_row_cursor] = "Rate"
header_row_cursor = header_row_cursor + 1
for i, result in ipairs(self._scenario_results) do
header_row[header_row_cursor] = result.title
header_row_cursor = header_row_cursor + 1
end
local rows_cursor = 1
rows[rows_cursor] = header_row
rows_cursor = rows_cursor + 1
for i, result in ipairs(self._scenario_results) do
local row = {}
local row_cursor = 1
row[row_cursor] = result.title
row_cursor = row_cursor + 1
row[row_cursor] = result.score:format_rate()
row_cursor = row_cursor + 1
for j, col in ipairs(self._scenario_results) do
if col:equals(result) then
row[row_cursor] = "--"
else
row[row_cursor] = string.format("%.0f%%", 100 * result.score:rate() / col.score:rate() - 100)
end
row_cursor = row_cursor + 1
end
rows[rows_cursor] = row
rows_cursor = rows_cursor + 1
end
return rows
end
function _M.render_table(self, rows)
local buff = ""
local col_sizes = {}
for x=1,#rows[1] do
col_sizes[x] = 1
for y=1,#rows do
local row = rows[y]
local col = row[x]
col_sizes[x] = math.max(col_sizes[x], #col)
end
end
for y=1,#rows do
local row = rows[y]
for x=1,#row do
buff = buff .. string.format(" %" .. col_sizes[x] .. "s", row[x])
end
buff = buff .. "\n"
end
return buff
end
return _M
|
print("Hello BLua!") |
dofile("init.lua")
recipies = JSON:decode(file_get_contents(config["cookbooks"] .. "/recipies.json"))
log("Execute recipes", LOG_LEVEL_DEBUG)
ChefClient.run(recipies, config["cookbooks"])
local attributes = readAttributes()
attributes['automatic'] = ChefClient.ohai.get()
attributes['attributes'] = nil
ChefClient.api.saveNode(attributes)
|
return PlaceObj("ModDef", {
"title", "All Animals As Pets",
"version", 2,
"version_major", 0,
"version_minor", 2,
"image", "Preview.png",
"id", "ChoGGi_AllAnimalsAsPets",
"steam_id", "1747548861",
"pops_any_uuid", "eea5d130-fe84-4a33-8dae-73ebaac1f12b",
"author", "ChoGGi",
"lua_revision", 1007000, -- Picard
"code", {
"Code/Script.lua",
},
"description", [[Add all the pasture animals as pets.
Also removes sponsor limit for Platypus.]],
})
|
basexx = require( "basexx" )
describe( "should handle ZeroMQ base85 strings", function()
it( "should fulfill spec test case", function()
-- http://rfc.zeromq.org/spec:32
local data = string.char( 0x86, 0x4f, 0xd2, 0x6f, 0xb5, 0x59, 0xf7, 0x5b )
local z85 = "HelloWorld"
assert.is.same( z85, basexx.to_z85( data ) )
assert.is.same( data, basexx.from_z85( z85 ) )
end)
it( "should encode a numeric string correctly", function()
-- https://github.com/msealand/z85.node/blob/master/test/encode.test.js
assert.is.same( "f!$Kw", basexx.to_z85( "1234" ) )
assert.is.same( "1234", basexx.from_z85( "f!$Kw" ) )
end)
it( "should allow to ignore characters in a base85 string", function()
assert.is.same( "1234", basexx.from_z85( "'f!$Kw'\n", "'\n" ) )
end)
it( "should handle wrong input lenght without a crash", function()
local res, err = basexx.from_z85( "abcdefghi" )
assert.is.falsy( res )
assert.is.same( err, "invalid length: 9 - must be a multiple of 5" )
res, err = basexx.to_z85( "abcdefghi" )
assert.is.falsy( res )
assert.is.same( err, "invalid length: 9 - must be a multiple of 4" )
end)
it( "should handle wrong characters without a crash", function()
local c = string.char( 140 )
local res, err = basexx.from_z85( "f"..c.."$Kw" )
assert.is.falsy( res )
local msg = string.format( "unexpected character at position 2: '%s'", c )
assert.is.same( err, msg )
end)
end)
|
return require 'Q/UTILS/lua/code_gen' {
declaration = [[
#include "hmap_common.h"
#include "_hmap_types.h"
extern int
${fn} ( // $hmap_getn
hmap_t *ptr_hmap,
int nT,
${ckeytype} *keys, // INPUT [nkeys]
uint32_t *locs, // INPUT [nkeys]
val_t *vals, // OUTPUT [nkeys]
uint32_t nkeys, // INPUT
uint8_t *fnds // OUTPUT: whether key found or not. TODO Move to bit
);
]],
definition = [[
#include "_${fn}.h"
int
${fn}(
hmap_t *ptr_hmap,
int nT,
${ckeytype} *keys, // INPUT [nkeys]
uint32_t *locs, // INPUT [nkeys]
val_t *vals, // OUTPUT [nkeys]
uint32_t nkeys, // INPUT
uint8_t *fnds // OUTPUT: whether key found or not. TODO Move to bit
)
{
int status = 0;
register uint32_t size = ptr_hmap->size;
int block_size = nkeys / nT;
#pragma omp parallel for schedule(static, 1)
for ( int tid = 0; tid < nT; tid++ ) {
uint32_t lb = block_size * tid;
uint32_t ub = lb + block_size;
if ( tid == 0 ) { lb = 0; }
if ( tid == nT-1 ) { ub = nkeys; }
register bkt_t *bkts = ptr_hmap->bkts;
printf("%d: %lu: %lu \n", tid, lb, ub);
for ( uint32_t j = lb; j < ub; j++ ) {
register uint32_t num_probes = 0;
register uint32_t probe_loc = locs[j];
memset(&(vals[j]), '\0', sizeof(val_t));
fnds[j] = false;
register ${ckeytype} key = keys[j];
for ( ; ; ) {
if ( bkts[probe_loc].key == key ) {
vals[j] = bkts[probe_loc].val;
fnds[j] = true;
break; // found
}
if ( ( bkts[probe_loc].key == 0 ) ||
( num_probes > bkts[probe_loc].psl ) ) {
printf("not found \n");
break; // not found
}
num_probes++;
probe_loc++; if ( probe_loc == size ) { probe_loc = 0; }
}
}
}
return status;
}
]],
}
|
local libc = require("libc")
local bit = require("bit")
local lshift, rshift = bit.lshift, bit.rshift;
local bor, band = bit.bor, bit.band;
-- async I/O
local function libusb_control_transfer_get_data(transfer)
return transfer.buffer + LIBUSB_CONTROL_SETUP_SIZE;
end
local function libusb_control_transfer_get_setup(transfer)
return (struct libusb_control_setup *)(void *) transfer.buffer;
end
local function libusb_fill_control_setup(buffer,
uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
uint16_t wLength)
struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;
setup.bmRequestType = bmRequestType;
setup.bRequest = bRequest;
setup.wValue = libusb_cpu_to_le16(wValue);
setup.wIndex = libusb_cpu_to_le16(wIndex);
setup.wLength = libusb_cpu_to_le16(wLength);
end
local function libusb_fill_control_transfer(
transfer, dev_handle,
buffer, libusb_transfer_cb_fn callback, user_data,
timeout)
struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;
transfer.dev_handle = dev_handle;
transfer.endpoint = 0;
transfer.type = LIBUSB_TRANSFER_TYPE_CONTROL;
transfer.timeout = timeout;
transfer.buffer = buffer;
if (setup) then
transfer.length = (int) (LIBUSB_CONTROL_SETUP_SIZE
+ libusb_le16_to_cpu(setup.wLength));
end
transfer.user_data = user_data;
transfer.callback = callback;
end
local function libusb_fill_bulk_transfer(transfer,
dev_handle, unsigned char endpoint,
unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
void *user_data, unsigned int timeout)
transfer.dev_handle = dev_handle;
transfer.endpoint = endpoint;
transfer.type = LIBUSB_TRANSFER_TYPE_BULK;
transfer.timeout = timeout;
transfer.buffer = buffer;
transfer.length = length;
transfer.user_data = user_data;
transfer.callback = callback;
end
local function libusb_fill_bulk_stream_transfer(
struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
unsigned char endpoint, uint32_t stream_id,
unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
void *user_data, unsigned int timeout)
libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer,
length, callback, user_data, timeout);
transfer.type = LIBUSB_TRANSFER_TYPE_BULK_STREAM;
libusb_transfer_set_stream_id(transfer, stream_id);
end
local function libusb_fill_interrupt_transfer(transfer, libusb_device_handle *dev_handle,
unsigned char endpoint, unsigned char *buffer, int length,
libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
transfer.dev_handle = dev_handle;
transfer.endpoint = endpoint;
transfer.type = LIBUSB_TRANSFER_TYPE_INTERRUPT;
transfer.timeout = timeout;
transfer.buffer = buffer;
transfer.length = length;
transfer.user_data = user_data;
transfer.callback = callback;
end
local function libusb_fill_iso_transfer(transfer,
libusb_device_handle *dev_handle, unsigned char endpoint,
unsigned char *buffer, int length, int num_iso_packets,
libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
transfer.dev_handle = dev_handle;
transfer.endpoint = endpoint;
transfer.type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;
transfer.timeout = timeout;
transfer.buffer = buffer;
transfer.length = length;
transfer.num_iso_packets = num_iso_packets;
transfer.user_data = user_data;
transfer.callback = callback;
end
local function libusb_set_iso_packet_lengths(transfer, length)
int i;
for (i = 0; i < transfer.num_iso_packets; i++)
transfer.iso_packet_desc[i].length = length;
end
local function libusb_get_iso_packet_buffer(transfer, packet)
int i;
size_t offset = 0;
int _packet;
--[[ oops..slight bug in the API. packet is an unsigned int, but we use
* signed integers almost everywhere else. range-check and convert to
* signed to avoid compiler warnings. FIXME for libusb-2. --]]
if (packet > INT_MAX) then
return nil;
end
_packet = (int) packet;
if (_packet >= transfer.num_iso_packets) then
return nil;
end
for (i = 0; i < _packet; i++)
offset += transfer.iso_packet_desc[i].length;
return transfer.buffer + offset;
end
local function libusb_get_iso_packet_buffer_simple(transfer, packet)
--[[ oops..slight bug in the API. packet is an unsigned int, but we use
* signed integers almost everywhere else. range-check and convert to
* signed to avoid compiler warnings. FIXME for libusb-2. --]]
if (packet > INT_MAX) then
return nil;
end
local _packet = packet;
if (_packet >= transfer.num_iso_packets) then
return nil;
end
return transfer.buffer + ((int) transfer.iso_packet_desc[0].length * _packet);
end
local function libusb_get_descriptor(dev,
uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) (lshift(desc_type, 8) | desc_index),
0, data, (uint16_t) length, 1000);
end
local function int libusb_get_string_descriptor(dev,
uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)(lshift(LIBUSB_DT_STRING, 8) | desc_index),
langid, data, (uint16_t) length, 1000);
end
|
-- Entrypoint for my Neovim configuration!
-- We simply bootstrap packer and Aniseed here.
-- It's then up to Aniseed to compile and load fnl/config/init.fnl
local execute = vim.api.nvim_command
local fn = vim.fn
local pack_path = fn.stdpath("data") .. "/site/pack"
local fmt = string.format
function ensure (user, repo)
-- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory.
local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo)
if fn.empty(fn.glob(install_path)) > 0 then
execute(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path))
execute(fmt("packadd %s", repo))
end
end
-- Bootstrap essential plugins required for installing and loading the rest.
ensure("wbthomason", "packer.nvim")
ensure("Olical", "aniseed")
vim.cmd[[colorscheme tokyonight]]
-- Enable Aniseed's automatic compilation and loading of Fennel source code.
vim.g["aniseed#env"] = {
module = "config.init",
compile = true
}
|
----------------------------------------------------------------------------------------------------
-- localized Spanish (custom module) strings
--
--get the add-on engine
local AddOnName = ...;
--Spanish or Latin America Spanish
local L = LibStub("AceLocale-3.0"):NewLocale(AddOnName, "esES")
if not L then
L = LibStub("AceLocale-3.0"):NewLocale(AddOnName, "esMX");
if not L then
return;
end
end
L["CUSTOM_NAME"] = "Personalizado"
L["CUSTOM_DEFAULT_NAME"] = "Personalizado %d"
L["CUSTOM_TEXT_HELP"] = "Cambia el texto de personalizado %d"
L["CUSTOM_ENABLE"] = "Activar Personalizado %d"
L["CUSTOM_ENABLE_HELP"] = "Activar/Desactivar mostrar personalizado %d"
|
local localized, CHILDS, CONTENTS = ...
local M = {}
local json = require "json"
local initTimer
local timer_running = false
-- Timer and title variables, set dynamically via config.json
local timer = 3000
local timerStr
local timerX
local timerSize = 400 -- 400
local title
local titleX, titleSize
local font = resource.load_font(localized "robotob.ttf")
local bouchblkb = resource.load_font(localized "bouchblkb.ttf")
-- Images
local bgImageName = "no image"
local bgImage = resource.load_image(localized "redwedding.jpg")
local endImage = resource.load_image(localized "endofround.png")
-- Textures/overlays
local stdTexture = resource.create_colored_texture(0, 0, 0, 0.8)
local yTexture = resource.create_colored_texture(1, 1, 0, 0.6)
print "sub module init"
function M.unload()
print "sub module is unloaded"
end
-- Load and reload config.json
function M.content_update(name)
print("sub module content update", name)
if name == 'config.json' then
json_file = resource.load_file(localized(name))
config = json.decode(json_file)
-- Load background image, replace if new
if config.bgimage.asset_name ~= bgImageName then
bgImageName = config.bgimage.asset_name
bgImage = resource.load_image(localized(bgImageName))
end
-- Set initTimer on first load
local configTimer = config.timer * 60
if (not timer) or (configTimer ~= initTimer) then
initTimer = configTimer
halfTime = configTimer / 2
timer = configTimer
timerStr = string.format("%02d:00", config.timer)
end
-- Setup timer
if timer > 5999 then
timerApprox = "000:00"
else
timerApprox = "00:00"
end
timerSize = config.timersize
local timerWidth = font:width(timerApprox, timerSize)
timerX, timerY = NATIVE_WIDTH / 2 - timerWidth / 2, 400
-- Setup title
title = config.title
titleSize = config.titlesize
local titleWidth = bouchblkb:width(title, titleSize)
titleX, titleY = NATIVE_WIDTH / 2 - titleWidth / 2, timerY - titleSize - 60
end
end
function M.content_remove(name)
print("sub module content delete", name)
end
node.event('data', function(data, suffix)
if suffix == 'toggle' then
timer_running = data == 'on'
end
if suffix == 'reset' then
timer = initTimer
end
end)
-- Timer
util.set_interval(1, function()
local minutes = math.floor(timer / 60)
local seconds = timer - (minutes * 60)
if timer < 6000 then
local timerWidth = font:width("00:00", timerSize)
timerX = NATIVE_WIDTH / 2 - timerWidth / 2
end
if timer == 0 then
timerStr = "00:00"
else
timerStr = string.format("%02d:%02d", minutes, seconds)
end
if timer_running then
timer = timer - 1
end
end)
-- Render function, draws endImage if timer has run out
function M.draw()
-- font:write(100, 100, timer, timerSize, 1,1,1,1)
bgImage:draw(0, 0, NATIVE_WIDTH, NATIVE_HEIGHT)
if timer < 0 then
endImage:draw(0, 0, NATIVE_WIDTH, NATIVE_HEIGHT)
elseif timer < 180 then
yTexture:draw(0, 0, NATIVE_WIDTH, NATIVE_HEIGHT)
bouchblkb:write(titleX, titleY, title, titleSize, 0, 0, 0, 1)
font:write(timerX, timerY, timerStr, timerSize, 0, 0, 0, 1)
else
stdTexture:draw(0, 0, NATIVE_WIDTH, NATIVE_HEIGHT)
bouchblkb:write(titleX, titleY, title, titleSize, 1, 1, 1, 1)
font:write(timerX, timerY, timerStr, timerSize, 1, 1, 1, 1)
end
end
return M |
local ITEM = {}
ITEM.Rarity = 100
ITEM.Name = "Kashyyyk Hilt"
ITEM.Description = "Lightsaber Hilt"
ITEM.Type = WOSTYPE.HILT
--Add user groups that are allowed to use this tree. If anyone is allowed, set this to FALSE ( TREE.UserGroups = false )
ITEM.UserGroups = false
--Does this item disappear from the inventory after it's been applied?
ITEM.BurnOnUse = false
ITEM.Model = "models/starwars/cwa/lightsabers/kashyyyk.mdl"
--The chance for the item to appear randomly. 0 = will not spawn, 100 = incredibly high chance
ITEM.Rarity = 20
ITEM.OnEquip = function( wep )
wep.UseHilt = "models/starwars/cwa/lightsabers/kashyyyk.mdl"
end
wOS:RegisterItem( ITEM ) |
-- 卸载所有src/下的模块
for k, v in pairs(package.loaded) do
if(string.find(k, "^src/")) then
package.loaded[k] = nil
end
end
require "Cocos2d"
require "Cocos2dConstants"
-- cclog
cclog = function(...)
print(string.format(...))
end
-- for CCLuaEngine traceback
function __G__TRACKBACK__(msg)
cclog("----------------------------------------")
cclog("LUA ERROR: " .. tostring(msg) .. "\n")
cclog(debug.traceback())
cclog("----------------------------------------")
return msg
end
local function main()
collectgarbage("collect")
-- avoid memory leak
collectgarbage("setpause", 100)
collectgarbage("setstepmul", 5000)
cc.Director:getInstance():getOpenGLView():setDesignResolutionSize(1136, 640, 0)
cc.FileUtils:getInstance():addSearchResolutionsOrder("src");
cc.FileUtils:getInstance():addSearchResolutionsOrder("bytecode");
cc.FileUtils:getInstance():addSearchResolutionsOrder("res");
--support debug
local targetPlatform = cc.Application:getInstance():getTargetPlatform()
if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or
(cc.PLATFORM_OS_ANDROID == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or
(cc.PLATFORM_OS_MAC == targetPlatform) then
--require('debugger')()
end
require("G").init()
cclog("Game Start")
if cc.Director:getInstance():getRunningScene() then
cc.Director:getInstance():replaceScene(require("MapSelectScene").scene())
else
cc.Director:getInstance():runWithScene(require("MapSelectScene").scene())
end
end
local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
error(msg)
end
|
-- if the MenuTimer is enabled, we should reset SSM's MenuTimer now that we've reached Gameplay
if PREFSMAN:GetPreference("MenuTimer") then
SL.Global.MenuTimer.ScreenSelectMusic = ThemePrefs.Get("ScreenSelectMusicMenuTimer")
end
local Players = GAMESTATE:GetHumanPlayers()
local t = Def.ActorFrame{ Name="GameplayUnderlay" }
for player in ivalues(Players) do
-- StepStatistics takes up the full screenwidth and thus needs to draw under everything else
t[#t+1] = LoadActor("./PerPlayer/StepStatistics/default.lua", player)
-- actual underlays
t[#t+1] = LoadActor("./PerPlayer/Danger.lua", player)
t[#t+1] = LoadActor("./PerPlayer/BackgroundFilter.lua", player)
t[#t+1] = LoadActor("./PerPlayer/nice.lua", player)
end
-- shared UI elements for both players
t[#t+1] = LoadActor("./Shared/Header.lua")
t[#t+1] = LoadActor("./Shared/SongInfoBar.lua") -- title and progress bar
-- per-player UI elements
for player in ivalues(Players) do
t[#t+1] = LoadActor("./PerPlayer/UpperNPSGraph.lua", player)
t[#t+1] = LoadActor("./PerPlayer/Score.lua", player)
t[#t+1] = LoadActor("./PerPlayer/DifficultyMeter.lua", player)
t[#t+1] = LoadActor("./PerPlayer/LifeMeter/default.lua", player)
t[#t+1] = LoadActor("./PerPlayer/ColumnFlashOnMiss.lua", player)
t[#t+1] = LoadActor("./PerPlayer/MeasureCounter.lua", player)
t[#t+1] = LoadActor("./PerPlayer/TargetScore/default.lua", player)
t[#t+1] = LoadActor("./PerPlayer/SubtractiveScoring.lua", player)
end
-- gets overlapped by StepStatistics otherwise...?
t[#t+1] = LoadActor("./Shared/BPMDisplay.lua")
if GAMESTATE:IsPlayerEnabled(PLAYER_1) and GAMESTATE:IsPlayerEnabled(PLAYER_2) then
t[#t+1] = LoadActor("./Shared/WhoIsCurrentlyWinning.lua")
end
t[#t+1] = LoadActor("./Shared/SyncStartScores.lua")
return t
|
local upload = require 'resty.upload'
local next = next
local type = type
local setmetatable = setmetatable
local string_find = string.find
local string_lower = string.lower
local table_concat = table.concat
local get_headers = ngx.req.get_headers
local ngx_req = ngx.req
local ngx_req_init_body = ngx_req.init_body
local ngx_req_append_body = ngx_req.append_body
local file_pattern =
[[[; \t]filename\s*=\s*(?:"((?:\\.|[^\\"])*)"|'((?:\\'|[^\\'])*)'|([^; \t]+))]]
local name_pattern =
[[[; \t]name\s*=\s*(?:"((?:\\.|[^\\"])*)"|'((?:\\'|[^\\'])*)'|([^; \t]+))]]
local _M = {
_VERSION = '0.01',
}
local mt = { __index = _M }
function _M.new(self, opt)
if type(opt) ~= 'table' then
return nil
end
return setmetatable({
timeout = opt.timeout or 6000,
}, mt)
end
function _M.is_formdata()
local header = get_headers()['content-type']
if not header then
return false
end
if type(header) == 'table' then
header = header[1]
end
if string_find(header, 'multipart/form-data', 1, true) == 1 then
return true
end
return false
end
local function extract_match(str, pattern, tb)
local iter, err = ngx.re.gmatch(str, pattern, 'ijo')
while true do
local m, err = iter()
if err then
ngx.log(ngx.ERR, err)
return nil
end
if m then
local key = m[1] or m[2] or m[3] or nil
tb[#tb + 1] = key
else
break
end
end
end
function _M.get_args(self)
local form, err = upload:new()
if not form then
return nil, err
end
ngx_req_init_body()
form:set_timeout(self.timeout)
ngx_req_append_body('--' .. form.boundary)
local lasttyp
local disposition, tb_filename = {}, {}
while true do
local typ, res, err = form:read()
if not typ then
return nil, err
end
if typ == 'header' then
if type(res) == 'table' then
ngx_req_append_body('\r\n' .. res[3])
if string_lower(res[1]) == 'content-disposition' then
disposition[#disposition + 1] = res[3]
end
else
ngx_req_append_body('\r\n' .. res)
if next(disposition) then
disposition[#disposition + 1] = res
end
end
elseif typ == 'body' then
if lasttyp == 'header' then
ngx_req_append_body('\r\n\r\n')
end
ngx_req_append_body(res)
if next(disposition) then
extract_match(table_concat(disposition, ''),
file_pattern, tb_filename)
disposition = {}
end
elseif typ == 'part_end' then
ngx_req_append_body("\r\n--" .. form.boundary)
elseif typ == 'eof' then
ngx_req_append_body("--\r\n")
break
end
lasttyp = typ
end
return tb_filename
end
return _M
|
vim.g.mkdp_browser = 'firefox'
|
--[[
Doctor Tools
SCRIPT BY DrPhoenix
Changelog :
1.01 : First release
1.02 : - Change each champion skin
- Cleanse support
- Potion support
1.03 : Mastery Emote on Kill is back !
1.04 : CS information
1.05 : - Zhonya supported
- Last Hit helper
- Bug fixing
1.06 : Smite Herald, Dragon, Nashor
1.07 : Update the updater !
1.08 : Fix the zonia :)
1.10 : Fix a bug with QSS
More Soon !
]]--
version = 1.10
assert(load(Base64Decode("G0x1YVIAAQQEBAgAGZMNChoKAAAAAAAAAAAAAQQfAAAAAwAAAEQAAACGAEAA5QAAAJ1AAAGGQEAA5UAAAJ1AAAGlgAAACIAAgaXAAAAIgICBhgBBAOUAAQCdQAABhkBBAMGAAQCdQAABhoBBAOVAAQCKwICDhoBBAOWAAQCKwACEhoBBAOXAAQCKwICEhoBBAOUAAgCKwACFHwCAAAsAAAAEEgAAAEFkZFVubG9hZENhbGxiYWNrAAQUAAAAQWRkQnVnc3BsYXRDYWxsYmFjawAEDAAAAFRyYWNrZXJMb2FkAAQNAAAAQm9sVG9vbHNUaW1lAAQQAAAAQWRkVGlja0NhbGxiYWNrAAQGAAAAY2xhc3MABA4AAABTY3JpcHRUcmFja2VyAAQHAAAAX19pbml0AAQSAAAAU2VuZFZhbHVlVG9TZXJ2ZXIABAoAAABzZW5kRGF0YXMABAsAAABHZXRXZWJQYWdlAAkAAAACAAAAAwAAAAAAAwkAAAAFAAAAGABAABcAAIAfAIAABQAAAAxAQACBgAAAHUCAAR8AgAADAAAAAAQSAAAAU2VuZFZhbHVlVG9TZXJ2ZXIABAcAAAB1bmxvYWQAAAAAAAEAAAABAQAAAAAAAAAAAAAAAAAAAAAEAAAABQAAAAAAAwkAAAAFAAAAGABAABcAAIAfAIAABQAAAAxAQACBgAAAHUCAAR8AgAADAAAAAAQSAAAAU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QAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAA="), nil, "bt", _ENV))()
TrackerLoad("NpnWbxiqjE5ZQBof")
SAVE_PATH = LIB_PATH.."\\Saves\\"
kills = 0
assists = 0
farmcolor = ARGB(255,3,229,0)
jungleMinions = minionManager(MINION_JUNGLE, 560, myHero, MINION_SORT_MINHEALTH_DEC)
PotionsItemsList = {
HPT = { id = 2003, slot = nil }, -- Health Potion
RPT = { id = 2031, slot = nil }, -- Refillable Potion
HPT = { id = 2032, slot = nil }, -- Hunter's Potion
CPT = { id = 2033, slot = nil }, -- Corrupting Potion
BR1 = { id = 2009, slot = nil }, -- Total Biscuit of Rejuvenation 1
BR2 = { id = 2010, slot = nil }, -- Total Biscuit of Rejuvenation 2
}
DefensiveItemsList = {
QSS = { id = 3140, slot = nil }, -- Quicksilver Sash
MCS = { id = 3139, slot = nil }, -- Mercurial Scimitar
}
local Game = {}
for i = 1, objManager.maxObjects do
local object = objManager:getObject(i)
if object and object.valid and object.type == "obj_HQ" then
if object.name:find("1") then
Game[myHero.team == 100 and "MyNexus" or "TheirNexus"] = object
elseif object.name:find("2") then
Game[myHero.team == 200 and "MyNexus" or "TheirNexus"] = object
end
end
end
function OnLoad()
if myHero:GetSpellData(SUMMONER_1).name:find("Smite") then SmitePos = SUMMONER_1 elseif myHero:GetSpellData(SUMMONER_2).name:find("Smite") then SmitePos = SUMMONER_2 end
if myHero:GetSpellData(SUMMONER_1).name:find("SummonerBoost") then CleansePos = SUMMONER_1 elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerBoost") then CleansePos = SUMMONER_2 end
Update()
AddMenu()
SetSkin(myHero, Menu.SkinChanger.SkinChangerAlly.HeroSkin)
if file_exists(SAVE_PATH.."DoctorTools_TotalFarm.txt") then
SaveFile = io.open(SAVE_PATH.."DoctorTools_TotalFarm.txt", "r")
totalfarm = SaveFile:read()
SaveFile:close()
else
totalfarm = 0
end
if MinionsKilled() == 0 or totalfarm == "0" then
farm = 100
else
farm = math.round(MinionsKilled() / totalfarm * 100)
end
PrintMsg("Loaded !")
end
function AddMenu()
Menu = scriptConfig("Doctor Tools", "Menu")
Menu:addParam("EmoteON", "Emote on kill", SCRIPT_PARAM_ONOFF, true)
Menu:addSubMenu("Last Hit Helper", "LastHit")
Menu.LastHit:addParam("LastHitON", "Activate", SCRIPT_PARAM_ONOFF, true)
Menu:addSubMenu("Farm Informations", "FarmInfo")
Menu.FarmInfo:addParam("FarmInfoON", "Activate", SCRIPT_PARAM_ONOFF, true)
Menu.FarmInfo:addParam("FarmInfoMode", "Draw Mode", SCRIPT_PARAM_LIST, 1, {"Full", "Percent only", "Farm only", "Missed CS"})
Menu.FarmInfo:addParam("FarmInfoSize", "Text Size", SCRIPT_PARAM_SLICE, 12, 0, 50, 0)
Menu.FarmInfo:addParam("FarmInfoY", "Vertical Position", SCRIPT_PARAM_SLICE, 50, 0, WINDOW_H - 50, 0)
Menu.FarmInfo:addParam("FarmInfoX", "Horizontal Position", SCRIPT_PARAM_SLICE, 50, 0, WINDOW_W - 100, 0)
Menu:addSubMenu("Jungle settings", "Jungle")
Menu.Jungle:addParam("SmiteON", "Use smite", SCRIPT_PARAM_ONOFF, true)
Menu.Jungle:addParam("DrawSmiteON", "Draw smite range", SCRIPT_PARAM_ONOFF, true)
Menu:addSubMenu("Skin Changer", "SkinChanger")
Menu.SkinChanger:addSubMenu("My team skins", "SkinChangerAlly")
Menu.SkinChanger.SkinChangerAlly:addParam("HeroSkin", "Change "..myHero.charName.." Skin", SCRIPT_PARAM_SLICE, 0, 0, 20, 0)
Menu.SkinChanger.SkinChangerAlly:setCallback("HeroSkin", function(Val) SetSkin(myHero, Val - 1) end)
for i, hero in pairs(GetAllyHeroes()) do
Menu.SkinChanger.SkinChangerAlly:addParam("Ally"..i.."Skin", "Change "..hero.charName.." Skin", SCRIPT_PARAM_SLICE, 0, 0, 20, 0)
Menu.SkinChanger.SkinChangerAlly:setCallback("Ally"..i.."Skin", function(Val) SetSkin(hero, Val - 1) end)
end
Menu.SkinChanger:addSubMenu("Enemy team skins", "SkinChangerEnemy")
for i, hero in pairs(GetEnemyHeroes()) do
Menu.SkinChanger.SkinChangerEnemy:addParam("Enemy"..i.."Skin", "Change "..hero.charName.." Skin", SCRIPT_PARAM_SLICE, 0, 0, 20, 0)
Menu.SkinChanger.SkinChangerEnemy:setCallback("Enemy"..i.."Skin", function(Val) SetSkin(hero, Val - 1) end)
end
Menu:addSubMenu("Potions", "Potions")
Menu.Potions:addParam("PotionsON", "Use potions", SCRIPT_PARAM_ONOFF, true)
Menu.Potions:addParam("PotionsHealth", "Use potions at %", SCRIPT_PARAM_SLICE, 25, 0, 100, 0)
Menu:addSubMenu("Zhonya", "Zhonya")
Menu.Zhonya:addParam("ZhonyaON", "Use Zhonya", SCRIPT_PARAM_ONOFF, true)
Menu.Zhonya:addParam("ZhonyaHealth", "Use Zhonya at %", SCRIPT_PARAM_SLICE, 10, 0, 100, 0)
Menu:addSubMenu("QSS", "QSS")
Menu.QSS:addParam("","", 5, "")
Menu.QSS:addParam("Cleanse", "Use Cleanse", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("","", 5, "")
Menu.QSS:addParam("Stun", "Remove stun", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Silence", "Remove silence", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Taunt", "Remove taunt", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Root", "Remove root", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Fear", "Remove fear", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Charm", "Remove charm", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Suppression", "Remove suppression", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Blind", "Remove blind", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("KnockUp", "Remove knock up", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addParam("Exhaust", "Remove exhaust", SCRIPT_PARAM_ONOFF, true)
Menu.QSS:addSubMenu("Humanizer", "QSSHumanizer")
Menu.QSS.QSSHumanizer:addParam("QSSHumanizerON", "Use humanizer", SCRIPT_PARAM_ONOFF, true)
Menu.QSS.QSSHumanizer:addParam("QSSHumanizerMinValue", "Min Value", SCRIPT_PARAM_SLICE, 100, 0, 1000, 0)
Menu.QSS.QSSHumanizer:addParam("QSSHumanizerMaxValue", "Max Value", SCRIPT_PARAM_SLICE, 200, 0, 1000, 0)
Menu.QSS.QSSHumanizer:setCallback("QSSHumanizerMinValue", function (value) if value < Menu.QSS.QSSHumanizer.QSSHumanizerMinValue then Menu.QSS.QSSHumanizer.QSSHumanizerMaxValue = Menu.QSS.QSSHumanizer.QSSHumanizerMinValue end end)
Menu.QSS.QSSHumanizer:setCallback("QSSHumanizerMaxValue", function (value) if value > Menu.QSS.QSSHumanizer.QSSHumanizerMaxValue then Menu.QSS.QSSHumanizer.QSSHumanizerMinValue = Menu.QSS.QSSHumanizer.QSSHumanizerMaxValue end end)
end
function PrintMsg(msg)
PrintChat("<font color=\"#6eed00\"><b>[</b></font><font color=\"#a2ed00\"><b>Doctor Tools</b></font><font color=\"#6eed00\"><b>]</b></font> <font color=\"#fce700\">"..msg.."</font>")
end
function OnTick()
if Menu.Potions.PotionsON and myHero.health / myHero.maxHealth * 100 < Menu.Potions.PotionsHealth then
for _, item in pairs(PotionsItemsList) do
item.slot = GetInventorySlotItem(item.id)
if item.slot ~= nil then
CastSpell(item.slot)
end
end
end
if Menu.Zhonya.ZhonyaON and myHero.health / myHero.maxHealth * 100 < Menu.Zhonya.ZhonyaHealth then
if GetInventorySlotItem(3157) ~= nil then
CastSpell(GetInventorySlotItem(3157))
end
end
jungleMinions:update()
CheckJungle()
end
function OnDraw()
if SmitePos ~= nil and Menu.Jungle.DrawSmiteON and myHero:CanUseSpell(SmitePos) and not myHero.dead then
DrawCircle3D(myHero.x, myHero.y, myHero.z, 560, 1, RGB(255,130,0), 50)
end
if Menu.FarmInfo.FarmInfoON then
if Menu.FarmInfo.FarmInfoMode == 1 then
DrawText(farm.." % ("..MinionsKilled().."/"..totalfarm..")", Menu.FarmInfo.FarmInfoSize, Menu.FarmInfo.FarmInfoX, Menu.FarmInfo.FarmInfoY, farmcolor)
elseif Menu.FarmInfo.FarmMode == 2 then
DrawText(farm.." %", Menu.FarmInfo.FarmInfoSize, Menu.FarmInfo.FarmInfoX, Menu.FarmInfo.FarmInfoY, farmcolor)
elseif Menu.FarmInfo.FarmMode == 3 then
DrawText(MinionsKilled().."/"..totalfarm, Menu.FarmInfo.FarmInfoSize, Menu.FarmInfo.FarmInfoX, Menu.FarmInfo.FarmInfoY, farmcolor)
elseif Menu.FarmInfo.FarmMode == 4 then
DrawText(farmmissed, Menu.FarmInfo.FarmInfoSize, Menu.FarmInfo.FarmInfoX, Menu.FarmInfo.FarmInfoY, farmcolor)
end
end
if Menu.LastHit.LastHitON then
for _, minion in pairs(minionManager(MINION_ENEMY, 1000, myHero, MINION_SORT_MINHEALTH_DEC).objects) do
if minion.health < myHero.totalDamage then
DrawCircle3D(minion.x, minion.y, minion.z, 43, 3, ARGB(255,3,229,0), 100)
DrawCircle3D(minion.x, minion.y, minion.z, 25, 3, ARGB(255,3,229,0), 100)
DrawLine3D(minion.x + 30, minion.y, minion.z + 30, minion.x - 30, minion.y, minion.z - 30, 3, ARGB(255,3,229,0))
DrawLine3D(minion.x + 30, minion.y, minion.z - 30, minion.x - 30, minion.y, minion.z + 30, 3, ARGB(255,3,229,0))
elseif minion.health < myHero.totalDamage * 2 then
DrawCircle3D(minion.x, minion.y, minion.z, 43, 3, ARGB(255,229,145,0), 100)
DrawCircle3D(minion.x, minion.y, minion.z, 25, 3, ARGB(255,229,145,0), 100)
DrawLine3D(minion.x + 30, minion.y, minion.z + 30, minion.x - 30, minion.y, minion.z - 30, 3, ARGB(255,229,145,0))
DrawLine3D(minion.x + 30, minion.y, minion.z - 30, minion.x - 30, minion.y, minion.z + 30, 3, ARGB(255,229,145,0))
elseif minion.health < myHero.totalDamage * 3 then
DrawCircle3D(minion.x, minion.y, minion.z, 43, 3, ARGB(255,229,0,0), 100)
DrawCircle3D(minion.x, minion.y, minion.z, 25, 3, ARGB(255,229,0,0), 100)
DrawLine3D(minion.x + 30, minion.y, minion.z + 30, minion.x - 30, minion.y, minion.z - 30, 3, ARGB(255,229,0,0))
DrawLine3D(minion.x + 30, minion.y, minion.z - 30, minion.x - 30, minion.y, minion.z + 30, 3, ARGB(255,229,0,0))
end
end
end
end
function OnApplyBuff(unit, source, buff)
if source and source.isMe and not source.charName:lower():find("baron") and not source.charName:lower():find("spiderboss") then
if buff.name == "SummonerExhaust" and Menu.QSS.Exhaust then
DefensiveItems("Exhaust")
end
if buff.type == 5 and Menu.QSS.Stun then
DefensiveItems("Stun")
end
if buff.type == 7 and Menu.QSS.Silence then
DefensiveItems("Silence")
end
if buff.type == 8 and Menu.QSS.Taunt then
DefensiveItems("Taunt")
end
if buff.type == 11 and Menu.QSS.Root then
DefensiveItems("Root")
end
if buff.type == 21 and Menu.QSS.Fear then
DefensiveItems("Fear")
end
if buff.type == 22 and Menu.QSS.Charm then
DefensiveItems("Charm")
end
if buff.type == 24 and Menu.QSS.Suppression then
DefensiveItems("Suppression")
end
if buff.type == 25 and Menu.QSS.Blind then
DefensiveItems("Blind")
end
if buff.type == 29 and Menu.QSS.KnockUp then
DefensiveItems("KnockUp")
end
end
end
function MinionsKilled()
return myHero:GetInt('MINIONS_KILLED') + myHero:GetInt('NEUTRAL_MINIONS_KILLED')
end
function CheckJungle()
if Menu.Jungle.SmiteON then
for i, jungle in pairs(jungleMinions.objects) do
if jungle ~= nil then
SmiteMonster(jungle)
end
end
end
end
function GetSmiteDamage()
if myHero.level <= 4 then
SmiteDamage = 370 + (myHero.level*20)
end
if myHero.level > 4 and myHero.level <= 9 then
SmiteDamage = 330 + (myHero.level*30)
end
if myHero.level > 9 and myHero.level <= 14 then
SmiteDamage = 240 + (myHero.level*40)
end
if myHero.level > 14 then
SmiteDamage = 100 + (myHero.level*50)
end
return SmiteDamage
end
function SmiteMonster(obj)
if SmitePos ~= nil and myHero:CanUseSpell(SmitePos) == READY and GetDistance(obj) <= 560 and obj.health <= GetSmiteDamage() then
if obj.charName == "SRU_Baron" or obj.charName == "SRU_Dragon_Water" or obj.charName == "SRU_Dragon_Fire" or obj.charName == "SRU_Dragon_Earth" or obj.charName == "SRU_Dragon_Air" or obj.charName == "SRU_Dragon_Elder" or obj.charName == "SRU_RiftHerald" then
CastSpell(SmitePos, obj)
end
end
end
function DefensiveItems(BuffType)
for _, item in pairs(DefensiveItemsList) do
item.slot = GetInventorySlotItem(item.id)
if item.slot ~= nil then
if Menu.QSS.QSSHumanizer == true then
QSSHumanizer = math.random(Menu.QSS.QSSHumanizer.QSSHumanizerMinValue, Menu.QSS.QSSHumanizer.QSSHumanizerMinValue)/1000
else
QSSHumanizer = 0
end
DelayAction(function() CastSpell(item.slot) end, QSSHumanizer)
elseif CleansePos ~= nil and Menu.QSS.Cleanse then
DelayAction(function() CastSpell(CleansePos) end, QSSHumanizer)
end
end
end
function OnAnimation(unit, animation)
if unit.team ~= myHero.team and unit.type == myHero.type and animation == "Death" and Menu.EmoteON then
if kills ~= myHero.kills or assists ~= myHero.assists then
EmoteHumanizer = math.random(100, 250)/1000
DelayAction(function() SendChat("/masterybadge") end, EmoteHumanizer)
kills = myHero.kills
assists = myHero.assists
end
end
if unit.type == "obj_AI_Minion" and unit.team ~= myHero.team and animation == "Death" and GetDistance(unit, myHero) < 1000 and Menu.FarmInfo.FarmInfoON then
totalfarm = totalfarm + 1
farm = math.round(MinionsKilled() / totalfarm * 100)
farmmissed = tostring(totalfarm - MinionsKilled())
if farm >= 80 then
farmcolor = ARGB(255,3,229,0)
elseif farm >= 50 then
farmcolor = ARGB(255,229,221,0)
elseif farm >= 30 then
farmcolor = ARGB(255,229,145,0)
else
farmcolor = ARGB(255,229,0,0)
end
end
end
function OnUnload()
SaveFile = io.open(SAVE_PATH.."DoctorTools_TotalFarm.txt", "w")
SaveFile:write(totalfarm)
SaveFile:close()
end
function OnBugSplat()
SaveFile = io.open(SAVE_PATH.."DoctorTools_TotalFarm.txt", "w")
SaveFile:write(totalfarm)
SaveFile:close()
end
AddDeleteObjCallback(function(o)
if o and o.valid then
if not Game.DidEnd then
if o.name == "SRU_Order_nexus_swirlies.troy" or o.name == "SRU_Chaos_nexus_swirlies.troy" then
Game.DidEnd = true
SaveFile = io.open(SAVE_PATH.."DoctorTools_TotalFarm.txt", "w")
SaveFile:write("0")
SaveFile:close()
end
end
end
end)
function file_exists(name)
local f = io.open(name,"r")
if f ~= nil then
io.close(f)
return true
else
return false
end
end
function Update()
local UpdateHost = "www.s1mplescripts.de"
local ServerPath = "/DrPhoenix/BoL/Scripts/DoctorTools/"
local ServerFileName = "DoctorTools.lua"
local ServerVersionFileName = "DoctorTools.version"
DL = Download()
local ServerVersionDATA = GetWebResult("s1mplescripts.de" , ServerPath..ServerVersionFileName)
if ServerVersionDATA then
local ServerVersion = tonumber(ServerVersionDATA)
if ServerVersion then
if ServerVersion > tonumber(version) then
PrintMsg("Updating, don't press F9")
DL:newDL(UpdateHost, ServerPath..ServerFileName, ServerFileName, SCRIPT_PATH, function ()
PrintMsg("DoctorTools updated, please reload")
end)
end
else
PrintMsg("An error occured, while updating, please reload")
end
else
PrintMsg("Could not connect to update Server")
end
end
class "Download"
function Download:__init()
socket = require("socket")
self.aktivedownloads = {}
self.callbacks = {}
AddTickCallback(function ()
self:RemoveDone()
end)
class("Async")
function Async:__init(host, filepath, localname, drawoffset, localpath)
self.progress = 0
self.host = host
self.filepath = filepath
self.localname = localname
self.offset = drawoffset
self.localpath = localpath
self.CRLF = '\r\n'
self.headsocket = socket.tcp()
self.headsocket:settimeout(1)
self.headsocket:connect(self.host, 80)
self.headsocket:send('HEAD '..self.filepath..' HTTP/1.1'.. self.CRLF ..'Host: '..self.host.. self.CRLF ..'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'.. self.CRLF .. self.CRLF)
self.HEADdata = ""
self.DLdata = ""
self.StartedDownload = false
self.canDL = true
AddTickCallback(function ()
self:tick()
end)
AddDrawCallback(function ()
self:draw()
end)
end
function Async:tick()
if self.progress == 100 then return end
if self.HEADcStatus ~= "timeout" and self.HEADcStatus ~= "closed" then
self.HEADfString, self.HEADcStatus, self.HEADpString = self.headsocket:receive(16);
if self.HEADfString then
self.HEADdata = self.HEADdata..self.HEADfString
elseif self.HEADpString and #self.HEADpString > 0 then
self.HEADdata = self.HEADdata..self.HEADpString
end
elseif self.HEADcStatus == "timeout" then
self.headsocket:close()
--Find Lenght
local begin = string.find(self.HEADdata, "Length: ")
if begin then
self.HEADdata = string.sub(self.HEADdata,begin+8)
local n = 0
local _break = false
for i=1, #self.HEADdata do
local c = tonumber(string.sub(self.HEADdata,i,i))
if c and _break == false then
n = n+1
else
_break = true
end
end
self.HEADdata = string.sub(self.HEADdata,1,n)
self.StartedDownload = true
self.HEADcStatus = "closed"
end
end
if self.HEADcStatus == "closed" and self.StartedDownload == true and self.canDL == true then --Double Check
self.canDL = false
self.DLsocket = socket.tcp()
self.DLsocket:settimeout(1)
self.DLsocket:connect(self.host, 80)
--Start Main Download
self.DLsocket:send('GET '..self.filepath..' HTTP/1.1'.. self.CRLF ..'Host: '..self.host.. self.CRLF ..'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'.. self.CRLF .. self.CRLF)
end
if self.DLsocket and self.DLcStatus ~= "timeout" and self.DLcStatus ~= "closed" then
self.DLfString, self.DLcStatus, self.DLpString = self.DLsocket:receive(1024);
if ((self.DLfString) or (self.DLpString and #self.DLpString > 0)) then
self.DLdata = self.DLdata .. (self.DLfString or self.DLpString)
end
elseif self.DLcStatus and self.DLcStatus == "timeout" then
self.DLsocket:close()
self.DLcStatus = "closed"
self.DLdata = string.sub(self.DLdata,#self.DLdata-tonumber(self.HEADdata)+1)
local file = io.open(self.localpath.."\\"..self.localname, "w+b")
file:write(self.DLdata)
file:close()
self.progress = 100
end
if self.progress ~= 100 and self.DLdata and #self.DLdata > 0 then
self.progress = (#self.DLdata/tonumber(self.HEADdata))*100
end
end
function Async:draw()
if self.progress < 100 then
DrawTextA("Downloading: "..self.localname,15,50,35+self.offset)
DrawRectangleOutline(49,50+self.offset,250,20, ARGB(255,255,255,255),1)
if self.progress ~= 100 then
DrawLine(50,60+self.offset,50+(2.5*self.progress),60+self.offset,18,ARGB(150,255-self.progress*2.5,self.progress*2.5,255-self.progress*2.5))
DrawTextA(tostring(math.round(self.progress).." %"), 15,150,52+self.offset)
end
end
end
end
function Download:newDL(host, file, name, path, callback)
local offset = (#self.aktivedownloads+1)*40
self.aktivedownloads[#self.aktivedownloads+1] = Async(host, file, name, offset-40, path)
if not callback then
callback = (function ()
end)
end
self.callbacks[#self.callbacks+1] = callback
end
function Download:RemoveDone()
if #self.aktivedownloads == 0 then return end
local x = {}
for k, v in pairs(self.aktivedownloads) do
if math.round(v.progress) < 100 then
v.offset = k*40-40
x[#x+1] = v
else
self.callbacks[k]()
end
end
self.aktivedownloads = {}
self.aktivedownloads = x
end |
--
-- Broadway build configuration script
--
-------------------------------------------------------------------------------
--
-- Maintainer notes
--
-- - we're not using the regular _scaffolding_ for this project
-- mostly b/c it's too bloated
-- - scaffolds are still used though
--
-------------------------------------------------------------------------------
--
-- Use the --to=path option to control where the project files get generated. I use
-- this to create project files for each supported toolset, each in their own folder,
-- in preparation for deployment.
--
newoption {
trigger = "to",
value = "path",
description = "Set the output location for the generated files"
}
-------------------------------------------------------------------------------
--
-- Use the --tooolchain=identifier option to control which toolchain is used
--
newoption {
trigger = "toolchain",
value = "string",
description = "Set the toolchain to use for compilation"
}
-------------------------------------------------------------------------------
if not _ACTION then
return true
end
-------------------------------------------------------------------------------
--
-- Pull in dependencies
--
dofile("functions.lua") -- from scaffolding/system/functions.lua
dofile("cppsettings.lua") -- from scaffolding/system/settings.lua
-------------------------------------------------------------------------------
--
-- Solution wide settings
--
local thisscriptpath = path.getabsolute(path.getdirectory(_SCRIPT))
local rootpath = path.getabsolute(path.join(thisscriptpath, '..'))
local locationpath = path.join(os.getcwd(), _OPTIONS["to"] or path.join('build/projects'))
local targetpath = path.join(locationpath, '../bin')
local objectpath = path.join(locationpath, '../obj')
local librarypath = path.join(locationpath, '../lib')
solution "Broadway"
configurations {
"Debug",
"Release"
}
location (locationpath)
configuration { "Debug" }
targetsuffix ""
defines { "DEBUG", "_DEBUG" }
configuration { "Release" }
targetsuffix ""
defines { "RELEASE", "NDEBUG" }
configuration { "windows" }
targetdir (path.join(targetpath, "windows"))
objdir (path.join(objectpath, "windows"))
configuration { "linux*" }
targetdir (path.join(targetpath, "linux"))
objdir (path.join(objectpath, "linux"))
configuration { "macosx" }
targetdir (path.join(targetpath, "darwin"))
objdir (path.join(objectpath, "darwin"))
configuration { "asmjs" }
targetdir (path.join(targetpath, "asmjs"))
objdir (path.join(objectpath, "asmjs"))
configuration { "wasm*" }
targetdir (path.join(targetpath, "wasm"))
objdir (path.join(objectpath, "wasm"))
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "Debug", "windows" }
linkoptions { "-Wl,/DEBUG:FULL" }
configuration {}
flags {
"ExtraWarnings",
"No64BitChecks",
"StaticRuntime",
}
buildoptions {
--"-fdiagnostics-show-hotness",
"-fdiagnostics-fixit-info",
"-fdiagnostics-color",
"-fdiagnostics-show-note-include-stack",
"-Wextra-tokens",
"-Wno-undef",
}
if _OPTIONS.toolchain == 'windows' then
applytoolchain('clang-windows')
elseif _OPTIONS.toolchain == 'macosx' then
applytoolchain('clang-macos')
elseif _OPTIONS.toolchain == 'linux' then
applytoolchain('clang-linux')
elseif _OPTIONS.toolchain == 'asmjs' then
applytoolchain('emscripten-asmjs')
elseif _OPTIONS.toolchain == 'wasm' then
applytoolchain('emscripten-wasm')
end
startproject "broadway-test"
configuration { "ios*" }
defines { "USE_GLES3=1" }
configuration { "android-*" }
defines { "USE_GLES3=1" }
configuration { "asmjs" }
defines { "USE_GLES3=1" }
configuration { "wasm*" }
defines { "USE_GLES3=1" }
configuration {}
-------------------------------------------------------------------------------
--
-- External 'scaffold' projects
--
local external_scaffolds = {
--keep
--this
--line
['khr'] = dofile(path.join(rootpath, "libs", "khr", "khr.lua")),
--keep
--this
--line
['glad'] = dofile(path.join(rootpath, "libs", "glad", "glad.lua")),
--keep
--this
--line
['glew'] = dofile(path.join(rootpath, "libs", "glew", "glew.lua")),
--keep
--this
--line
['sdl'] = dofile(path.join(rootpath, "libs", "sdl", "sdl1-prebuilt.lua")),
--keep
--this
--line
['sdl2'] = dofile(path.join(rootpath, "libs", "sdl", "sdl2-prebuilt.lua")),
--keep
--this
--line
['stb'] = dofile(path.join(rootpath, "libs", "stb", "stb.lua")),
--keep
--this
--line
['cimgui'] = dofile(path.join(rootpath, "libs", "cimgui", "cimgui.lua")),
--keep
--this
--line
['win-unistd'] = dofile(path.join(rootpath, "libs", "win-unistd", "win-unistd.lua")),
--keep
--this
--line
}
create_packages_projects(external_scaffolds)
-------------------------------------------------------------------------------
--
-- Main project
--
core_projects = {
["shaders"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() links { "shaders" } end,
_create_projects = function()
project "shaders"
language "C++"
kind "StaticLib"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_cppfwd()
add_packages {
external_scaffolds['khr'],
}
add_packages_conditional(
function()
return not( _OPTIONS.toolchain == 'asmjs' or
_OPTIONS.toolchain == 'wasm')
end, {
external_scaffolds['glad'],
})
includedirs {
"../Decoder/inc",
"../Decoder/src/shaders",
"../Decoder/src/utils",
}
defines {}
removedefines {}
files {
"../Decoder/src/shaders/**.h",
"../Decoder/src/shaders/**.cpp",
"../Decoder/src/shaders/**.c",
}
configuration {}
buildoptions {
"-fblocks",
"-Rpass=inline",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
end, -- _create_projects()
},
["gitrev"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() links { "gitrev" } end,
_create_projects = function()
project "gitrev"
language "C"
kind "StaticLib"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
files {
"../Decoder/src/gitrev.c",
}
prebuildcommands {
'make -C ' .. rootpath .. ' -f projgen.make generate',
}
end, -- _create_projects()
},
["broadway"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "broadway"
project "broadway"
targetname "broadway"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
add_packages {
external_scaffolds['khr'],
external_scaffolds['sdl2'],
external_scaffolds['stb'],
external_scaffolds['cimgui'],
external_scaffolds['win-unistd'],
}
add_packages_conditional(
function()
return not( _OPTIONS.toolchain == 'asmjs' or
_OPTIONS.toolchain == 'wasm')
end, {
external_scaffolds['glad'],
})
defines {
"H264DEC_TRACE",
"_ASSERT_USED",
"_RANGE_CHECK",
"_DEBUG_PRINT",
"_ERROR_PRINT",
"_SAFE_OPENGL",
"BROADWAY_IMPL",
"RENDER=1",
}
removedefines {
"DECODER_IMPL",
}
links {
"shaders",
"gitrev",
}
includedirs {
"../Decoder/inc",
"../Decoder/src",
"../Decoder/src/utils",
}
files {
'../Decoder/src/**.h',
'../Decoder/inc/**.h',
--'../Decoder/src/**.c',
'../Decoder/src/missing.c',
'../Decoder/src/Broadway.c',
'../Decoder/src/Broadway_*.c',
'../Decoder/src/brdw_*.c',
'../Decoder/src/brdw_*.h',
'../Decoder/src/h264bsd_*.h',
'../Decoder/src/h264bsd_compare.c',
'../Decoder/src/h264bsd_render*.c',
'../Decoder/src/h264bsd_resolve.h',
'../Decoder/src/h264bsd_resolve*.c',
'../Decoder/src/utils/*.h',
'../Decoder/src/utils/*.c',
}
-- implementation
files {
"../Decoder/src/h264bsd_transform.c",
"../Decoder/src/h264bsd_util.c",
"../Decoder/src/h264bsd_byte_stream.c",
"../Decoder/src/h264bsd_seq_param_set.c",
"../Decoder/src/h264bsd_pic_param_set.c",
"../Decoder/src/h264bsd_slice_header.c",
"../Decoder/src/h264bsd_slice_data.c",
"../Decoder/src/h264bsd_macroblock_*.c",
"../Decoder/src/h264bsd_stream.c",
"../Decoder/src/h264bsd_vlc.c",
"../Decoder/src/h264bsd_cavlc.c",
"../Decoder/src/h264bsd_nal_unit.c",
"../Decoder/src/h264bsd_neighbour.c",
"../Decoder/src/h264bsd_storage.c",
"../Decoder/src/h264bsd_slice_group_map.c",
"../Decoder/src/h264bsd_intra_prediction.c",
"../Decoder/src/h264bsd_inter_prediction.c",
"../Decoder/src/h264bsd_reconstruct.c",
"../Decoder/src/h264bsd_dpb.c",
"../Decoder/src/h264bsd_image.c",
"../Decoder/src/h264bsd_deblocking.c",
"../Decoder/src/h264bsd_conceal.c",
"../Decoder/src/h264bsd_vui.c",
"../Decoder/src/h264bsd_pic_order_cnt.c",
"../Decoder/src/h264bsd_decoder.c",
"../Decoder/src/extraFlags.c",
"../Decoder/src/H264SwDecApi.c",
}
buildoptions {
"-fblocks",
"-Wno-undef",
"-Rpass=inline",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "windows" }
defines { "PLATFORM_WINDOWS" }
links { "OpenGL32" }
linkoptions { "-Wl,/subsystem:console" }
configuration { "macosx" }
defines { "PLATFORM_MACOS" }
configuration { "linux*" }
defines { "PLATFORM_LINUX" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration { "asmjs" }
defines {
}
linkoptions {
"-s INITIAL_MEMORY=40304640",
"--embed-file " .. path.join(rootpath, "samples", "illusion.h264@test.h264"),
}
configuration { "wasm*" }
defines {
}
linkoptions {
"-s INITIAL_MEMORY=40304640",
"--embed-file " .. path.join(rootpath, "samples", "illusion.h264@test.h264"),
}
configuration {}
debugargs {
"play",
"-F",
"../../samples/illusion.h264",
}
end, -- _create_projects()
},
["sdltest"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "test"
project "sdltest"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
add_packages {
external_scaffolds['khr'],
external_scaffolds['sdl2'],
external_scaffolds['glew'],
external_scaffolds['win-unistd'],
}
defines {
"USE_GLEW=1",
}
links {}
includedirs {}
files {
'../Decoder/src/sdltest.c',
}
configuration {}
buildoptions {
"-fblocks",
"-Wno-unused-parameter",
"-Rpass=inline",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "windows" }
links { "OpenGL32" }
linkoptions { "-Wl,/subsystem:console" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
debugargs {}
end, -- _create_projects()
},
["sdltest2"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "test"
project "sdltest2"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
add_packages {
external_scaffolds['khr'],
external_scaffolds['sdl2'],
external_scaffolds['win-unistd'],
}
add_packages_conditional(
function()
return not( _OPTIONS.toolchain == 'asmjs' or
_OPTIONS.toolchain == 'wasm')
end, {
external_scaffolds['glad'],
})
defines {}
links {}
includedirs {}
files {
'../Decoder/src/sdltest2.c',
}
configuration {}
buildoptions {
"-fblocks",
"-Wno-unused-parameter",
"-Rpass=inline",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "windows" }
links { "OpenGL32" }
linkoptions { "-Wl,/subsystem:console" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
debugargs {}
end, -- _create_projects()
},
["sdltest3"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "test"
project "sdltest3"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"FatalWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
add_packages {
external_scaffolds['khr'],
external_scaffolds['sdl2'],
external_scaffolds['win-unistd'],
}
add_packages_conditional(
function()
return not( _OPTIONS.toolchain == 'asmjs' or
_OPTIONS.toolchain == 'wasm')
end, {
external_scaffolds['glad'],
})
defines {
"_ASSERT_USED",
"_RANGE_CHECK",
"_DEBUG_PRINT",
"_ERROR_PRINT",
"_SAFE_OPENGL",
}
links {}
includedirs {
'../Decoder/inc',
'../Decoder/src/',
}
files {
'../Decoder/src/sdltest3.c',
'../Decoder/src/utils/*.c',
}
configuration {}
buildoptions {
"-fblocks",
"-Wno-unused-parameter",
"-Rpass=inline",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "windows" }
links { "OpenGL32" }
linkoptions { "-Wl,/subsystem:console" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
debugargs {}
end, -- _create_projects()
},
["index2mb"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "test"
project "index2mb"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
--add_packages {}
defines {}
links {}
includedirs {}
files {
'../Decoder/src/index2mb.c',
'../Decoder/src/utils/morton.c',
}
configuration {}
buildoptions {
"-fblocks",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
debugargs {}
end, -- _create_projects()
},
["mb2index"] = {
_add_includedirs = function() end,
_add_defines = function() end,
_add_libdirs = function() end,
_add_external_links = function() end,
_add_self_links = function() end,
_create_projects = function()
group "test"
project "mb2index"
language "C"
kind "ConsoleApp"
flags {
"ExtraWarnings",
"No64BitChecks",
"StaticRuntime",
"ObjcARC",
}
build_c99()
--add_packages {}
defines {}
links {}
includedirs {}
files {
'../Decoder/src/mb2index.c',
'../Decoder/src/utils/morton.c',
}
configuration {}
buildoptions {
"-fblocks",
}
configuration { "Debug" }
defines { "_DEBUG", }
flags { "Symbols" }
configuration { "Release" }
defines { "NDEBUG", }
flags { "OptimizeSize" }
configuration { "linux*" }
links { "dl", "m" }
buildoptions { "-stdlib=libc++" }
linkoptions { "-rdynamic" }
configuration {}
debugargs {}
end, -- _create_projects()
},
}
create_packages_projects(core_projects)
-------------------------------------------------------------------------------
--
-- Patch _some_ of the scaffolded projects with different properties
--
local projectkinds = {
"consoleapp",
"windowedapp",
"sharedlib",
}
for _,p in ipairs(solution().projects) do
project (p.name)
for __,blk in ipairs(p.blocks) do
if blk.kind and table.icontains(projectkinds, blk.kind:lower()) then
printf("configuring targetdir for project %s %s", colorize(ansicolors.cyan, p.name), colorize(ansicolors.green, blk.kind))
configuration {}
configuration { blk.keywords , "windows" }
targetdir (path.join(rootpath, "bin/windows"))
configuration { blk.keywords , "linux*" }
targetdir (path.join(rootpath, "bin/linux"))
configuration { blk.keywords , "macosx" }
targetdir (path.join(rootpath, "bin/darwin"))
configuration { blk.keywords , "asmjs" }
targetdir (path.join(rootpath, "bin/asmjs"))
configuration { blk.keywords , "wasm*" }
targetdir (path.join(rootpath, "bin/wasm"))
configuration {}
end
end
end
-------------------------------------------------------------------------------
--
-- A more thorough cleanup.
--
if _ACTION == "clean" then
os.rmdir("bin")
os.rmdir("build")
end
-------------------------------------------------------------------------------
--
-- Use the release action to prepare source and binary packages for a new release.
-- This action isn't complete yet; a release still requires some manual work.
--
dofile("release.lua")
newaction {
trigger = "release",
description = "Prepare a new release (incomplete)",
execute = dorelease
}
-------------------------------------------------------------------------------
--
-- Use the embed action to refresh embed source.
--
dofile("embed.lua")
newaction {
trigger = "embed",
description = "Refresh 'embed' sources",
execute = doembed
}
-------------------------------------------------------------------------------
--
-- Use the generate action to generate sources that are generated from templates.
--
dofile("generate.lua")
newaction {
trigger = "generate",
description = "Refresh generated sources",
execute = dogenerate
}
-------------------------------------------------------------------------------
--
-- Use the emsdk action to install/update Emscripten SDK.
--
dofile("emsdk.lua")
-------------------------------------------------------------------------------
--
-- Use the format action to format source files
--
dofile("format.lua")
newaction {
trigger = "format",
description = "Format sources",
execute = doformat
}
-------------------------------------------------------------------------------
--
-- Use the load-packages to load 3rd party packages
--
function doloadpackages()
load_packages(external_scaffolds)
end
newaction {
trigger = "loadpackages",
description = "Load 3rd party packages",
execute = doloadpackages
}
-------------------------------------------------------------------------------
|
-- static starting section of Afeedi
-- The island of Atarlo, may need to rename files/zones
defineTile(".", "LAND")
defineTile("~", "OCEAN")
defineTile("^", "MOUNTAIN")
defineTile("+", "TREES")
defineTile("K", "KHOLBADUL")
defineTile("S", "SUSRAK")
defineTile("<", "UP")
defineTile(">", "DOWN")
defineTile("G", "GORA")
defineTile("H", "HEIGHTONSEA")
defineTile("Z", "CASTLE_ZALA")
defineTile("M", "MURMON")
return [[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..~~~~~~~~~~
~~~..~~~~~~~~~^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~....~~~~~~~~~
~~..^.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..~~~~~~~~~
~~.^^.~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~..~~~~~~~~~~~~~~~^^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~.....~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~.....~~~~~~~~..~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~..........~~..............~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~....~~~................^^^........~~~~~~~~~..~~~~~
~~~~~~~~..........~~...............^^^^^^^^^++...~~~~~~~~~.~~~~~
~~~~~~..........~~~.............+^^^^++++^^^^++...~~~~~~~~~~~~~~
~~~~~~...........~~.............+++++++++++^^^++..~~~~~~~~~~~~~~
~~~~..............................+++...+++++^^++..~~~~~~~~~~~~~
~~~~~..............................+......++++^^+..~~~~~~~~~~~~~
~~~~~~......................................+++^^..~~~~~~~~~~~~~
~~~........................................+++++^^Z~~~~~~~~~~~~~
~~~~~~~...~~.................................++++^^~~~~~~~~~~~~~
~~~~.....~~~~...........++.....................+++^^~~~~~~~~~~~~
~~~~~~~~~~~~~~.........+++++...................+++^^^~~~~~~~~~~~
~~~~~~~~~~~~~..........++^^+++................++++^^^^~~~~~~~~~~
~~~~~~~~~~~~~.........++++^^++++................++^^^^^~~~~~~~~~
~~~~~~~~~~~~..........+++++^^^^++................^^...^^~~~~~~~~
~~~~~~~~~~~............+++++^^^^+++.................^..^^~~~~~~~
~~~~~~~~~~...............++++^M^^^++...............^^^..^^~^~~~~
~~~~..~~~.................+++++^^^++++...............^^^^^^^^^^~
~~~~...~..................++++++^^^^^+.........~~~~.......^.SK^^
~~~~........................++++++^^^+.......~~~~~~~~.......^^^^
~~~~~~.........................++++^++......~~~~~~~~~~~~~~~~^~~^
~~~~~~..........................+++++.....~~~~~~~~~~~~~~~~~~~~~~
~~~~...............+++....................~~~~~~~~~~~~~~~~~~~~~~
~~~~~~.............+^+....................~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~............+++.....................~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~....................................~~~~~~~~~~~~~~~~~~~~
~~~~~~~~....................................~..~~..~~~~~~~~~~~~~
~~~~~~......................................~~~~......~~~~~~~~~~
~~~~~.......+++.................++......................~~~~~~~~
~~~~.......++^^G..........+..++++++++...........+.......~~~~~~~~
~~~~......++++^^...........+++++++++++.......+++++......~~~~~~~~
~~~~......+++++^+.........+++++++++++++......+++++......~~~~~~~~
~~~~~......++++++..........++++++++++.......+.+++.......~..~~~~~
~~~~~~~......++..............++++++..+.....+..++........~.~~~~~~
~~~~~~~.......................+++..............+........~.~~~~~~
~~~~~.....~~~~~...........................................~~~~~~
~~~~....~~~~~.....~~~~~...................................~~~~~~
~~~~..~~~~~.........~~~~~~~..........~~~~~...............~~~~~~~
~~~~..~~~~~........~~~~~...........~~~~~................~~~~~~~~
~~~~H~~~~~~........~~~~~~~~........~~~~~................~~~~~~~~
~~~~~~~..~~~...~~..~~~~~~~~~~~..~~~~~~~~~~~...^^^^.....~~~~~~~~~
~~~~~~~.......~~...~~~~~~~~~~~~~~~~~~~~~~~~~....^^^^....~~~~~~~~
~~~~~~~......~~~~~.~~~...~~~~~~~~~~~~~~~~~~~~...^^^......~~~~~~~
~~~~~~~~~.....~~~~~~~~.^..~~~~~~~~~~~~~~~~~~....^^......~~~~~~~~
~~~~~~~.........~~~~~....~~~~~~~~~~~~~~~~~~......^.....~~~~~~~~~
~~~~~~~~.~....~~~~~~~~~~~~~~~~~~~~~~~~~~~............~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]]
|
-- TODO
local MessagingService = game:GetService("MessagingService")
local settings = require(script.Parent.Parent.Settings)
local strict = require(script.Parent.Parent.strict)
local void = require(script.Parent.Parent.void)
local activeInstances = {}
local onNewMessage = Instance.new("BindableEvent")
local tick = os.time
-- Private functions
local function deepCopyTable(table: {any})
local copy = {}
for key, value in pairs(table) do
if type(value) == "table" then
copy[key] = deepCopyTable(value)
else
copy[key] = value
end
end
return copy
end
local function reconcileTable(target: {any}, template: {any})
for k, v in pairs(template) do
if type(k) == "string" then
if target[k] == nil then
if type(v) == "table" then
target[k] = deepCopyTable(v)
else
target[k] = v
end
elseif type(target[k]) == "table" and type(v) == "table" then
reconcileTable(target[k], v)
end
end
end
end
local function safePcall(retryForever: boolean, functionToCall: () -> any, ...: any)
local retries = 0
local response = {pcall(functionToCall, ...)}
while not response[1] and retries < (retryForever and math.huge or 3) do
response = {pcall(functionToCall, ...)}
retries += 1
task.wait(5)
end
return table.remove(response, 1), unpack(response)
end
local function waitForResponse(validifyFunction: ({any}) -> boolean): {any}
local data = {}
while validifyFunction(data) ~= true do
data = onNewMessage.Event:Wait()
end
return data
end
-- Components
local instance = {}
function instance:AddQueue(queueFunction: () -> any)
if self._QueueLocked then return end
table.insert(self._Queue, queueFunction)
end
function instance:ClearDataAsync()
self:_AddToQueue(function()
self._Data = {}
self:SetWaypoint("BeforeClearDataAsync")
self:Reconcile()
self:SaveAsync()
end)
end
function instance:GetData()
self:_AddToQueue(function()
if self._Data then
return self._Data
else
local _, data, keyInfo = safePcall(true,
self.Parent.GetAsync,
self.Parent,
self.Name
)
self._Data = data or {}
self._Meta = keyInfo:GetMetadata()
self.KeyInfo = keyInfo
self.UserId = keyInfo:GetUserIds()
self:Reconcile()
end
end)
end
function instance:Reconcile(): {any}
assert(self._Template, "Reconcile was called, but there is no template available to be reconciled")
self:_AddToQueue(function()
reconcileTable(self._Data, self._Template)
return self._Data
end)
end
function instance:Release()
self._AddToQueue(function()
local name = self.Name
self._Data = nil
self._Template = nil
self._Meta = nil
self.Parent = nil
self.KeyInfo = nil
safePcall(true,
MessagingService.PublishAsync,
MessagingService,
"CloudDataObject",
"ReleaseInstance",
self.Parent.Name,
name
)
end)
self:_LockQueue(true)
end
function instance:SaveAsync()
self:_AddToQueue(function()
local setOptions = Instance.new("DataStoreSetOptions")
setOptions:SetMetadata(self._Meta)
local success, result = safePcall(false,
self.Parent.SetAsync,
self.Parent,
self.Name,
self._Data,
self.UserId,
setOptions
)
-- todo: proper error-handling
end)
end
function instance:SetWaypoint(waypointName: string)
self._addToQueue(function()
table.insert(self._Meta.Waypoints, {
["Name"] = waypointName,
["Time"] = os.time()
})
end)
end
function instance:_LockQueue(toggle: boolean)
self._QueueLocked = toggle
end
function instance:_StartQueueDaemon()
while self._Status ~= "Released" do
safePcall(true, table.remove(self._Queue[1]))
task.wait()
end
end
-- Something else
MessagingService:SubscribeAsync("CloudDataObject", function(data: {any}, sent: number)
if activeInstances[data[2]] and activeInstances[data[2]][3] then
safePcall(true,
MessagingService.PublishAsync,
MessagingService,
"CloudDataObject",
"IsInstanceBusy",
data[2],
data[3],
true
)
end
onNewMessage:Fire(data, sent)
end)
-- Exports
return strict {
["new"] = function(globalDataStore: GlobalDataStore, key: string, template: {[any]: any})
local data = waitForResponse(function(data)
return data[1] == "IsInstanceBusy" and data[2] == globalDataStore.Name and data[3] == key and data[4] == false
end)
safePcall(true,
MessagingService.PublishAsync,
MessagingService,
"CloudDataObject",
"OccupyInstance",
globalDataStore.Name,
key
)
local self = {}
setmetatable(self, instance)
self.Name = key
self.Parent = globalDataStore
self._Template = template
self._Status = "Alive"
self._Queue = {}
self:_StartQueueDaemon()
self:GetData()
return self
end
} |
return {
version = "1.2",
luaversion = "5.1",
tiledversion = "1.2.3",
orientation = "orthogonal",
renderorder = "right-down",
width = 49,
height = 30,
tilewidth = 32,
tileheight = 32,
nextlayerid = 38,
nextobjectid = 41,
properties = {},
tilesets = {
{
name = "castletileset",
firstgid = 1,
filename = "castletileset.tsx",
tilewidth = 32,
tileheight = 32,
spacing = 0,
margin = 0,
columns = 9,
image = "../img/map/castletileset.png",
imagewidth = 300,
imageheight = 300,
tileoffset = {
x = 0,
y = 0
},
grid = {
orientation = "orthogonal",
width = 32,
height = 32
},
properties = {},
terrains = {},
tilecount = 81,
tiles = {}
},
{
name = "tileset",
firstgid = 82,
filename = "tileset.tsx",
tilewidth = 32,
tileheight = 32,
spacing = 0,
margin = 0,
columns = 9,
image = "../img/map/tileset.png",
imagewidth = 300,
imageheight = 300,
tileoffset = {
x = 0,
y = 0
},
grid = {
orientation = "orthogonal",
width = 32,
height = 32
},
properties = {},
terrains = {},
tilecount = 81,
tiles = {
{
id = 30,
properties = {
["walkPart"] = "waterstep"
}
},
{
id = 31,
properties = {
["walkPart"] = "waterstep"
}
}
}
},
{
name = "dungeonFeatures",
firstgid = 163,
filename = "dungeonFeatures.tsx",
tilewidth = 32,
tileheight = 32,
spacing = 0,
margin = 0,
columns = 10,
image = "../img/map/dungeonFeatures.png",
imagewidth = 320,
imageheight = 320,
tileoffset = {
x = 0,
y = 0
},
grid = {
orientation = "orthogonal",
width = 32,
height = 32
},
properties = {},
terrains = {},
tilecount = 100,
tiles = {}
}
},
layers = {
{
type = "tilelayer",
id = 23,
name = "floor1",
x = 0,
y = 0,
width = 49,
height = 30,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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ible = false,
opacity = 1,
offsetx = 0,
offsety = 0,
draworder = "topdown",
properties = {},
objects = {
{
id = 1,
name = "",
type = "",
shape = "point",
x = 417.578,
y = 306.154,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 2,
name = "",
type = "",
shape = "point",
x = 237.426,
y = 494.637,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 3,
name = "",
type = "",
shape = "point",
x = 833.073,
y = 417.578,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 4,
name = "",
type = "",
shape = "point",
x = 1366.24,
y = 591.482,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 5,
name = "",
type = "",
shape = "point",
x = 1137.14,
y = 596.689,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 6,
name = "",
type = "",
shape = "point",
x = 576.903,
y = 305.113,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
},
{
id = 38,
name = "",
type = "",
shape = "point",
x = 1255.76,
y = 592.83,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["blue"] = 0.16,
["green"] = 0.050000000000000003,
["lightlevel"] = 7,
["red"] = 0.14999999999999999
}
}
}
},
{
type = "objectgroup",
id = 35,
name = "mapinfo",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
draworder = "topdown",
properties = {},
objects = {
{
id = 7,
name = "spawn",
type = "",
shape = "point",
x = 215.558,
y = 494.637,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 8,
name = "grapple",
type = "grapple",
shape = "point",
x = 272.101,
y = 464.741,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 9,
name = "grapple",
type = "grapple",
shape = "point",
x = 400.528,
y = 305.527,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 10,
name = "grapple",
type = "grapple",
shape = "point",
x = 560.622,
y = 337.194,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 11,
name = "grapple",
type = "grapple",
shape = "point",
x = 784.929,
y = 401.114,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 12,
name = "grapple",
type = "grapple",
shape = "point",
x = 848.263,
y = 465.034,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
},
{
id = 13,
name = "grapple",
type = "grapple",
shape = "point",
x = 1135.9,
y = 591.995,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {}
}
}
},
{
type = "objectgroup",
id = 36,
name = "bg",
visible = false,
opacity = 1,
offsetx = 0,
offsety = 0,
draworder = "topdown",
properties = {},
objects = {
{
id = 14,
name = "",
type = "",
shape = "rectangle",
x = 1109.4,
y = 40.3019,
width = 598.666,
height = 493.149,
rotation = 0,
visible = true,
properties = {}
},
{
id = 15,
name = "",
type = "",
shape = "rectangle",
x = 1420.09,
y = 523.925,
width = 304.829,
height = 430.131,
rotation = 0,
visible = true,
properties = {}
},
{
id = 16,
name = "",
type = "",
shape = "rectangle",
x = 1390.78,
y = 591.339,
width = 43.2329,
height = 365.648,
rotation = 0,
visible = true,
properties = {}
},
{
id = 17,
name = "",
type = "",
shape = "rectangle",
x = 1358.54,
y = 622.848,
width = 36.6381,
height = 337.07,
rotation = 0,
visible = true,
properties = {}
},
{
id = 18,
name = "",
type = "",
shape = "rectangle",
x = -48.3623,
y = 652.891,
width = 1407.64,
height = 335.605,
rotation = 0,
visible = true,
properties = {}
},
{
id = 19,
name = "",
type = "",
shape = "rectangle",
x = 908.625,
y = 10.2587,
width = 201.509,
height = 555.433,
rotation = 0,
visible = true,
properties = {}
},
{
id = 20,
name = "",
type = "",
shape = "rectangle",
x = -63.7503,
y = 555.433,
width = 1141.64,
height = 101.854,
rotation = 0,
visible = true,
properties = {}
},
{
id = 21,
name = "",
type = "",
shape = "rectangle",
x = 878.581,
y = 463.105,
width = 35.9053,
height = 105.518,
rotation = 0,
visible = true,
properties = {}
},
{
id = 22,
name = "",
type = "",
shape = "rectangle",
x = 781.124,
y = 490.218,
width = 101.121,
height = 76.2072,
rotation = 0,
visible = true,
properties = {}
},
{
id = 23,
name = "",
type = "",
shape = "rectangle",
x = 734.96,
y = 463.105,
width = 51.2933,
height = 123.837,
rotation = 0,
visible = true,
properties = {}
},
{
id = 24,
name = "",
type = "",
shape = "rectangle",
x = 619.184,
y = -21.2501,
width = 137.759,
height = 489.485,
rotation = 0,
visible = true,
properties = {}
},
{
id = 25,
name = "",
type = "",
shape = "rectangle",
x = 756.943,
y = -27.1122,
width = 30.0432,
height = 401.553,
rotation = 0,
visible = true,
properties = {}
},
{
id = 26,
name = "",
type = "",
shape = "rectangle",
x = 788.452,
y = -2.93105,
width = 131.164,
height = 345.131,
rotation = 0,
visible = true,
properties = {}
},
{
id = 27,
name = "",
type = "",
shape = "rectangle",
x = -19.7846,
y = -9.5259,
width = 639.701,
height = 254.268,
rotation = 0,
visible = true,
properties = {}
},
{
id = 28,
name = "",
type = "",
shape = "rectangle",
x = 592.804,
y = 336.338,
width = 38.1036,
height = 239.613,
rotation = 0,
visible = true,
properties = {}
},
{
id = 29,
name = "",
type = "",
shape = "rectangle",
x = 625.046,
y = 463.105,
width = 119.44,
height = 108.449,
rotation = 0,
visible = true,
properties = {}
},
{
id = 30,
name = "",
type = "",
shape = "rectangle",
x = 400.821,
y = 361.984,
width = 194.182,
height = 209.57,
rotation = 0,
visible = true,
properties = {}
},
{
id = 31,
name = "",
type = "",
shape = "rectangle",
x = 299.7,
y = 333.407,
width = 103.319,
height = 259.398,
rotation = 0,
visible = true,
properties = {}
},
{
id = 32,
name = "",
type = "",
shape = "rectangle",
x = 271.122,
y = 525.39,
width = 40.3019,
height = 41.7674,
rotation = 0,
visible = true,
properties = {}
},
{
id = 33,
name = "",
type = "",
shape = "rectangle",
x = -29.3105,
y = 232.285,
width = 403.752,
height = 103.319,
rotation = 0,
visible = true,
properties = {}
},
{
id = 34,
name = "",
type = "",
shape = "rectangle",
x = 364.915,
y = 237.415,
width = 38.1036,
height = 38.1036,
rotation = 0,
visible = true,
properties = {}
},
{
id = 35,
name = "",
type = "",
shape = "rectangle",
x = -26.3794,
y = 332.674,
width = 329.01,
height = 104.785,
rotation = 0,
visible = true,
properties = {}
},
{
id = 37,
name = "",
type = "",
shape = "rectangle",
x = -38.1036,
y = 433.795,
width = 219.096,
height = 128.233,
rotation = 0,
visible = true,
properties = {}
}
}
},
{
type = "objectgroup",
id = 37,
name = "enemy",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
draworder = "topdown",
properties = {},
objects = {
{
id = 39,
name = "float1",
type = "garg1",
shape = "point",
x = 462.95,
y = 194.28,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["dir"] = "south"
}
},
{
id = 40,
name = "float2",
type = "garg1",
shape = "point",
x = 634.118,
y = 423.227,
width = 0,
height = 0,
rotation = 0,
visible = true,
properties = {
["dir"] = "west"
}
}
}
}
}
}
|
function start(song) -- do nothing
end
function update(elapsed)
end
function beatHit(beat) -- do nothing
end
function stepHit(step) -- do nothing
end
function playerTwoTurn()
tweenCameraZoom(1.3,(crochet * 4) / 1000)
end
function playerTwoSing()
FlxG.camera.shake(0.1, 0.1)
end
function playerOneTurn()
tweenCameraZoom(1.4,(crochet * 4) / 1000)
end |
-- Copyright (C) 2011-2013 Anton Burdinuk
-- clark15b@gmail.com
-- https://tsdemuxer.googlecode.com/svn/trunk/xupnpd
-- MP4-lo
-- MP4-hi
cfg.ivi_fmt='MP4-hi'
cfg.ivi_video_count=100
-- genre:
-- arthouse, boeviki, voennye, detective, detskiy, documentary, drama, comedy, korotkometrazhki, melodramy, zolotaya_klassika, adventures, sovetskoe_kino, thriller, horror, fantastika, erotika
function ivi_updatefeed(feed,friendly_name)
local rc=false
local feed_url=nil
local scroll=false
local feed_name='ivi_'..string.gsub(feed,'/','_')
local feed_m3u_path=cfg.feeds_path..feed_name..'.m3u'
local tmp_m3u_path=cfg.tmp_path..feed_name..'.m3u'
local tfeed=split_string(feed,'/')
if table.maxn(tfeed)>1 then
if tfeed[1]=='genre' then
feed_url='http://www.ivi.ru/videos/all/movies/'..tfeed[2]..'/by_year/?'
scroll=true
else
feed_url=string.format('http://www.ivi.ru/watch/%s/%s',tfeed[1],tfeed[2])
end
else
if tfeed[1]=='new' then
local year=tonumber(os.date('%Y'))
feed_url='http://www.ivi.ru/videos/all/all/all/by_year/?year_from='..(year-1)..'&year_to='..year
scroll=true
else
feed_url='http://www.ivi.ru/watch/'..tfeed[1]
end
end
if feed_url then
local dfd=io.open(tmp_m3u_path,'w+')
if dfd then
dfd:write('#EXTM3U name=\"',friendly_name or feed_name,'\" type=mp4 plugin=ivi\n')
local count=0
while(count<cfg.ivi_video_count) do
local url=nil
if scroll and count~=0 then url=feed_url..'&offset='..count else url=feed_url end
if cfg.debug>0 then print('IVI try url '..url) end
local feed_data=http.download(url)
if feed_data then
if not scroll then
for urn,logo,name in string.gmatch(feed_data,'<li>%s*<span class="image">%s*<a href="/watch/([%w_%-/]+)">%s*<img src="(.-)">%s*</a>%s*</span>%s*<strong>%s*<a href=".-">(.-)</a>%s*</strong>%s*</li>') do
dfd:write('#EXTINF:0 logo=',logo,' ,',name,'\n','http://www.ivi.ru/watch/',urn,'\n')
end
else
local n=0
for id,logo,name in string.gmatch(feed_data,'<a href="/watch/([%w_%-/]+)"%s*>%s*<img src="(.-)" alt="(.-)"%s*>') do
dfd:write('#EXTINF:0 logo=',logo,' ,',name,'\n','http://www.ivi.ru/watch/',id,'\n')
n=n+1
end
if n<1 then scroll=false else count=count+n end
end
feed_data=nil
end
if not scroll then break end
end
dfd:close()
if util.md5(tmp_m3u_path)~=util.md5(feed_m3u_path) then
if os.execute(string.format('mv %s %s',tmp_m3u_path,feed_m3u_path))==0 then
if cfg.debug>0 then print('IVI feed \''..feed_name..'\' updated') end
rc=true
end
else
util.unlink(tmp_m3u_path)
end
end
end
return rc
end
function ivi_sendurl(ivi_url,range)
local url=nil
if plugin_sendurl_from_cache(ivi_url,range) then return end
local ivi_id=string.match(ivi_url,'/?id=(%d+)$')
if not ivi_id then
ivi_id=string.match(ivi_url,'/(%d+)$')
end
if not ivi_id then
if cfg.debug>0 then print('Invalid IVI URL format, example - http://www.ivi.ru/video/view/?id=12345 or http://www.ivi.ru/watch/12345') end
return
end
local clip_page=http.download('http://api.digitalaccess.ru/api/json',nil,
string.format('{"method":"da.content.get","params":["%s",{"site":"s183","contentid":"%s","referrer":"%s"}]}',ivi_id or '',ivi_id or '', ivi_url))
if clip_page then
local x=json.decode(clip_page)
clip_page=nil
if x.result and x.result.files then
local url_lo=nil
for i,j in ipairs(x.result.files) do
if j.content_format==cfg.ivi_fmt then
url=j.url
break
elseif j.content_format=='MP4-lo' then
url_lo=j.url
end
end
if not url then url=url_lo end
end
else
if cfg.debug>0 then print('IVI clip '..ivi_id..' is not found') end
end
if url then
if cfg.debug>0 then print('IVI Real URL: '..url) end
plugin_sendurl(ivi_url,url,range)
else
if cfg.debug>0 then print('IVI Real URL is not found') end
plugin_sendfile('www/corrupted.mp4')
end
end
plugins['ivi']={}
plugins.ivi.name="ivi.ru"
plugins.ivi.desc="new, <i>serial_name</i> or <i>serial_name</i>/<i>season</i> or genre/<i>genre</i>"..
"<br/><b>genres</b>: arthouse, boeviki, voennye, detective, detskiy, documentary, drama, comedy, korotkometrazhki, melodramy, zolotaya_klassika, adventures, sovetskoe_kino, thriller, horror, fantastika, performance, erotika"..
"<br/><b>example</b>: new, luntik, luntik/season2, genre/horror"
plugins.ivi.sendurl=ivi_sendurl
plugins.ivi.updatefeed=ivi_updatefeed
plugins.ivi.ui_config_vars=
{
{ "select", "ivi_fmt" },
{ "input", "ivi_video_count", "int" }
}
--ivi_updatefeed('luntik','Лунтик')
--ivi_updatefeed('luntik/season2','Лунтик')
--ivi_updatefeed('genre/horror','Horrors')
--ivi_updatefeed('new','new')
|
local file
if GAMESTATE:IsCourseMode() then
file = LoadActor("./CourseContentsList.lua")
elseif SL.Global.GameMode == "ITG" then
file = LoadActor("./Grid-ITG.lua")
else
file = LoadActor("./Grid.lua")
end
return file |
--- A line.
-- @classmod Line
-- @usage
-- -- Create a horizontal line
-- local line = Line(0, 10, 20, 10)
Line = class(Component)
--- The color of the line.
Line.color = {0, 0, 0}
--- The width of the line.
Line.size = 1
--- Constructor
-- @section
--- Constructs a new Line.
-- @param x The x coordinate of the new component, relative to its parent.
-- @param y The y coordinate of the new component, relative to its parent.
-- @param endX The ending x coordinate of the line.
-- @param endY The ending y coordinate of the line.
-- @param[opt="black"] color The color of the new component.
-- @param[opt=1] lineSize The width of the line.
function Line:_init(x, y, endX, endY, color, lineSize)
Component._init(self)
self.x = x
self.y = y
self.endX = x
self.endY = y
self.width = endX - x
self.height = endY - y
self.color = color
self.size = size
end
-- @section end
function Line:draw(dt)
local offset = self.offset
local startX = self.x + offset[1]
local startY = self.y + offset[2]
local endX = self.endX + offset[1]
local endY = self.endY + offset[2]
local size = self.size
local color = self.color
PtUtil.drawLine({startX, startY}, {endX, endY}, color, width)
end
|
local function lreverser(source, target)
local targetFile
local sourceFile
if target ~= nil then
local option
print("Czy na pewno chcesz nadpisać plik?\nWybierz t (tak) lub n (nie)")
option = io.read('l')
if option == 'n' then
return
end
targetFile = io.open(target, "w")
io.output(target)
end
if targetFile ~= nil then
io.close(targetFile)
end
if source ~= nil then
io.input(source)
end
local text = {}
for line in io.lines () do
table.insert(text, line)
end
print('\n')
for i = #text, 1, -1 do
io.write(text[i], '\n')
end
io.input(io.stdin)
io.output(io.stdout)
end
lreverser()
lreverser('plik1.in')
lreverser('plik1.in', 'plik2.out') |
--[[local Keys = {}
local bt = CreateFrame("CheckButton", 'NeP_KeyListener', UIParent)
bt:EnableKeyboard(true)
bt:EnableMouse(true)
bt:EnableMouseWheel(true)
bt:RegisterForClicks("AnyUp", "AnyDown")
bt:SetScript("OnKeyDown", function(self, key)
local bind = GetBindingFromClick(key)
if bind ~= "" then
RunBinding(bind)
end
RunBinding(key)
Keys[key] = true
print(key)
end)
bt:SetScript("OnKeyUp", function(self, key)
RunBinding(key)
Keys[key] = false
print(key)
end)]] |
fx_version 'bodacious'
games { 'gta5' }
author 'Nazri Genfil'
description 'Script pemerintah yang sudah termasuk pajak.'
version '1.0.0'
server_scripts {
'config.lua',
'@mysql-async/lib/MySQL.lua',
'server/main.lua',
-- 'server/pajak.lua'
}
client_scripts {
'config.lua',
'client/main.lua',
-- 'client/pajak.lua'
} |
local ltn12 = require "ltn12"
local fmt = function(p, ...)
if select('#', ...) == 0 then
return p
else return string.format(p, ...) end
end
local tprintf = function(t, p, ...)
t[#t+1] = fmt(p, ...)
end
local append_data = function(r, k, data, extra)
tprintf(r, "content-disposition: form-data; name=\"%s\"", k)
if extra.filename then
tprintf(r, "; filename=\"%s\"", extra.filename)
end
if extra.content_type then
tprintf(r, "\r\ncontent-type: %s", extra.content_type)
end
if extra.content_transfer_encoding then
tprintf(
r, "\r\ncontent-transfer-encoding: %s",
extra.content_transfer_encoding
)
end
tprintf(r, "\r\n\r\n")
tprintf(r, data)
tprintf(r, "\r\n")
end
local gen_boundary = function()
local t = {"BOUNDARY-"}
for i=2,17 do t[i] = string.char(math.random(65, 90)) end
t[18] = "-BOUNDARY"
return table.concat(t)
end
local encode = function(t, boundary)
boundary = boundary or gen_boundary()
local r = {}
local _t
for k,v in pairs(t) do
tprintf(r, "--%s\r\n", boundary)
_t = type(v)
if _t == "string" then
append_data(r, k, v, {})
elseif _t == "table" then
assert(v.data, "invalid input")
local extra = {
filename = v.filename or v.name,
content_type = v.content_type or v.mimetype
or "application/octet-stream",
content_transfer_encoding = v.content_transfer_encoding or "binary",
}
append_data(r, k, v.data, extra)
elseif _t == "number" then
append_data(r, k, tostring(v), {})
else error(string.format("unexpected type %s", _t)) end
end
tprintf(r, "--%s--\r\n", boundary)
return table.concat(r), boundary
end
local gen_request = function(t)
local boundary = gen_boundary()
local s = encode(t, boundary)
return {
method = "POST",
source = ltn12.source.string(s),
headers = {
["content-length"] = #s,
["content-type"] = fmt("multipart/form-data; boundary=%s", boundary),
},
}
end
return {
encode = encode,
gen_request = gen_request,
}
|
module(..., package.seeall)
local socket = require 'socket'
local Model = require 'bamboo.model'
local Group
Group = Model:extend {
__name = 'Group';
__indexfd = "name";
__fields = {
['name'] = {},
['desc'] = {},
['created_date'] = {},
['perms'] = { foreign="Permission", st="MANY" },
['owner'] = { foreign="User", st="ONE" },
['managers'] = { foreign="User", st="MANY" },
};
init = function (self, t)
if not t then return self end
self.name = t.name
self.desc = self.desc
self.created_date = socket.gettime()
return self
end;
}
return Group
|
include "third_party/ld80/build.lua"
include "third_party/zmac/build.lua"
include "build/z80test.lua"
local deblocker_tests = {
"deblocker_calculate_physical",
"deblocker_change_block",
"deblocker_calculate_buffer_address",
"deblocker_capacity",
}
for _, n in pairs(deblocker_tests) do
z80test {
name = n,
srcs = { "./tests/"..n..".z80" },
deps = {
"./deblocker.lib",
"include/cpm.lib"
}
}
end
|
Scene_Save = Scene_File:extend("Scene_Save")
function Scene_Save.prototype:onSelect(index)
Save_Manager:save(index)
Scene_Manager:enter(Scene_Map())
Audio_Manager:playSFX("buff_up")
end
function Scene_Save.prototype:helperText()
return "Which File to save?"
end
|
-- pipes
minetest.register_craft({
output = "bitumen:pipe 12",
recipe = {
{"default:steel_ingot", "default:tin_ingot", "default:steel_ingot"},
{"", "", ""},
{"default:steel_ingot", "default:tin_ingot", "default:steel_ingot"},
}
})
minetest.register_craft({
output = "bitumen:intake 1",
type = "shapeless",
recipe = {"bitumen:pipe", "default:tin_ingot"},
})
minetest.register_craft({
output = "bitumen:spout 1",
type = "shapeless",
recipe = {"bitumen:pipe", "default:copper_ingot"},
})
minetest.register_craft({
output = "bitumen:pump 1",
recipe = {
{"bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet"},
{"bitumen:spout", "default:gold_ingot", "bitumen:intake"},
{"bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet"},
},
})
minetest.register_craft({
output = "bitumen:pump_gas 1",
type = "shapeless",
recipe = {"bitumen:pump", "bitumen:gas_engine"},
})
minetest.register_craft({
output = "bitumen:gas_engine 1",
recipe = {
{"", "", ""},
{"default:steel_ingot", "", "default:steel_ingot"},
{"", "default:steelblock", ""},
},
})
-- drilling
minetest.register_craft({
output = 'bitumen:drill_pipe 12',
recipe = {
{'', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''},
}
})
-- refining
minetest.register_craft({
output = 'bitumen:distillation_column',
recipe = {
{'', 'bitumen:galv_steel_sheet', ''},
{'', 'bitumen:galv_steel_sheet', ''},
{'', 'bitumen:galv_steel_sheet', ''},
}
})
minetest.register_craft({
output = 'bitumen:distillation_column_outlet',
recipe = {
{'', 'bitumen:galv_steel_sheet', ''},
{'bitumen:pipe', 'bitumen:galv_steel_sheet', 'bitumen:pipe'},
{'', 'bitumen:galv_steel_sheet', ''},
}
})
minetest.register_craft({
output = 'bitumen:distillation_column_boiler',
type = "shapeless",
recipe = {
'bitumen:distillation_column',
'default:furnace',
},
})
minetest.register_craft({
output = 'bitumen:cracking_boiler',
type = "shapeless",
recipe = {
'bitumen:distillation_column',
'default:furnace',
'default:silver_sand',
'default:silver_sand',
},
})
-- concrete
minetest.register_craft({
type = 'cooking',
output = 'bitumen:lime',
recipe = 'bitumen:chalk',
cooktime = 5,
})
minetest.register_craft({
type = 'cooking',
output = 'bitumen:lime',
recipe = 'default:coral_brown',
cooktime = 5,
})
minetest.register_craft({
type = 'cooking',
output = 'bitumen:lime',
recipe = 'default:coral_orange',
cooktime = 5,
})
minetest.register_craft({
type = 'cooking',
output = 'bitumen:lime',
recipe = 'default:coral_skeleton',
cooktime = 5,
})
minetest.register_craft({
output = 'bitumen:mineral_oil_furnace 1',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'bitumen:mineral_oil_furnace_blueprint', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'bitumen:cement_mixer',
recipe = {
{'bitumen:galv_steel_sheet', '', 'bitumen:galv_steel_sheet',},
{'bitumen:galv_steel_sheet', 'bitumen:cement_mixer_blueprint', 'bitumen:galv_steel_sheet',},
{'', 'bitumen:spout', ''},
}
})
-- concrete's recipe is:
-- ---------------------
-- 1 part cement
-- 2 parts water
-- 3 parts sand
-- 3 parts gravel
-- 3 crafts for combinations of water and river water
minetest.register_craft( {
type = "shapeless",
output = "bitumen:wet_concrete 9",
recipe = {
"bitumen:lime",
"bucket:bucket_water",
"bucket:bucket_water",
"group:sand",
"group:sand",
"group:sand",
"default:gravel",
"default:gravel",
"default:gravel",
},
replacements = {
{ "bucket:bucket_water", "bucket:bucket_empty" },
{ "bucket:bucket_water", "bucket:bucket_empty" },
}
})
minetest.register_craft( {
type = "shapeless",
output = "bitumen:wet_concrete 9",
recipe = {
"bitumen:lime",
"bucket:bucket_river_water",
"bucket:bucket_river_water",
"group:sand",
"group:sand",
"group:sand",
"default:gravel",
"default:gravel",
"default:gravel",
},
replacements = {
{ "bucket:bucket_river_water", "bucket:bucket_empty" },
{ "bucket:bucket_river_water", "bucket:bucket_empty" },
}
})
minetest.register_craft( {
type = "shapeless",
output = "bitumen:wet_concrete 9",
recipe = {
"bitumen:lime",
"bucket:bucket_water",
"bucket:bucket_river_water",
"group:sand",
"group:sand",
"group:sand",
"default:gravel",
"default:gravel",
"default:gravel",
},
replacements = {
{ "bucket:bucket_water", "bucket:bucket_empty" },
{ "bucket:bucket_river_water", "bucket:bucket_empty" },
}
})
-- blueprints
minetest.register_craft( {
type = "shapeless",
output = "bitumen:blueprint_paper",
recipe = {"default:paper", "dye:blue"},
})
minetest.register_craft({
output = 'bitumen:blueprint_book',
recipe = {
{'bitumen:blueprint_paper'},
{'bitumen:blueprint_paper'},
{'bitumen:blueprint_paper'},
}
})
minetest.register_craft({
output = 'bitumen:blueprint_bookshelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'bitumen:blueprint_book', 'bitumen:blueprint_book', 'bitumen:blueprint_book'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
-- barrels
minetest.register_craft({
output = "bitumen:drum_filler",
type = "shapeless",
recipe = { "bitumen:oil_drum", "bitumen:spout" },
})
minetest.register_craft({
output = "bitumen:drum_extractor",
type = "shapeless",
recipe = { "bitumen:oil_drum", "bitumen:intake" },
})
minetest.register_craft({
output = "bitumen:oil_drum 3",
recipe = {
{"default:tin_ingot", "default:tin_ingot", "default:tin_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
}
})
-- tanks
minetest.register_craft({
output = "bitumen:galv_steel_sheet 3",
recipe = {
{"", "", ""},
{"", "", ""},
{"default:steel_ingot", "default:tin_ingot", "default:steel_ingot"},
}
})
minetest.register_craft({
output = "bitumen:cylinder_tank 1",
recipe = {
{"bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet"},
{"bitumen:galv_steel_sheet", "", "bitumen:galv_steel_sheet"},
{"bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet", "bitumen:galv_steel_sheet"},
}
})
minetest.register_craft({
output = "bitumen:cylinder_tank_top 1",
recipe = {
{"", "bitumen:intake", ""},
{"", "bitumen:cylinder_tank", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "bitumen:cylinder_tank_bottom 1",
recipe = {
{"", "", ""},
{"", "bitumen:cylinder_tank", ""},
{"", "bitumen:spout", ""},
}
})
minetest.register_craft({
output = "bitumen:galv_steel_sheet 4",
type = "shapeless",
recipe = {"bitumen:cylinder_tank_cracked"},
})
-- misc machines
minetest.register_craft({
output = "bitumen:kerosene_light",
recipe = {
{"", "", ""},
{"", "default:meselamp", ""},
{"", "bitumen:drum_extractor", ""},
}
})
minetest.register_craft({
output = "bitumen:rock_crusher",
recipe = {
{"", "bitumen:galv_steel_sheet", ""},
{"bitumen:galv_steel_sheet", "bitumen:rock_crusher_blueprint", "bitumen:galv_steel_sheet"},
{"", "bitumen:galv_steel_sheet", ""},
}
})
|
local M = {}
function M.default(name, attributes)
local parts = {}
for attr_name, v in pairs(attributes) do
local value = v
if type(v) == "table" then
local hl_group, default = unpack(v)
value = M.get_attribute(hl_group, attr_name) or default
elseif type(v) == "string" then
value = M.get_attribute(v, attr_name)
end
table.insert(parts, ("%s=%s"):format(attr_name, value))
end
local cmd = ("highlight default %s %s"):format(name, table.concat(parts, " "))
vim.cmd(cmd)
return name
end
local ATTRIBUTES = {
ctermfg = {"fg", "cterm"},
guifg = {"fg", "gui"},
ctermbg = {"bg", "cterm"},
guibg = {"bg", "gui"},
}
function M.get_attribute(hl_group, name)
local hl_id = vim.api.nvim_get_hl_id_by_name(hl_group)
local value = vim.fn.synIDattr(hl_id, unpack(ATTRIBUTES[name]))
if value ~= "" then
return value
end
return nil
end
return M
|
ArkadiusTradeToolsSalesGraph = ZO_Object:Subclass()
function ArkadiusTradeToolsSalesGraph:New(control, ...)
local object = ZO_Object.New(self, ...)
object.control = control
object.minX = 0
object.maxX = 0
object.minY = 0
object.maxY = 0
object.drawArea = control:GetNamedChild("DrawArea")
object.labelYTop = control:GetNamedChild("LabelYTop")
object.labelYCenter = control:GetNamedChild("LabelYCenter")
object.labelYBottom = control:GetNamedChild("LabelYBottom")
object.labelXLeft = control:GetNamedChild("LabelXLeft")
object.labelXCenter = control:GetNamedChild("LabelXCenter")
object.labelXRight = control:GetNamedChild("LabelXRight")
object.drawArea:SetColor(nil, 0, 1, 0, 1)
object.numSurfaces = 0
object.numDots = 0
control.object = object
return object
end
function ArkadiusTradeToolsSalesGraph:Clear()
for i = 1, self.numSurfaces do
self.drawArea:SetSurfaceHidden(i, true)
end
self.numDots = 0
end
function ArkadiusTradeToolsSalesGraph:SetRange(minX, maxX, minY, maxY)
self.minX = minX or 0
self.maxX = maxX or 0
self.minY = minY or 0
self.maxY = maxY or 0
end
function ArkadiusTradeToolsSalesGraph:SetXLabels(left, center, right)
self.labelXLeft:SetText(left)
self.labelXCenter:SetText(center)
self.labelXRight:SetText(right)
end
function ArkadiusTradeToolsSalesGraph:SetYLabels(top, center, bottom)
self.labelYTop:SetText(top)
self.labelYCenter:SetText(center)
self.labelYBottom:SetText(bottom)
end
function ArkadiusTradeToolsSalesGraph:AddDot(x, y, color)
local drawAreaWidth, drawAreaHeight = self.drawArea:GetDimensions()
local rangeX = self.maxX - self.minX
local posX = x - self.minX
local rangeY = self.maxY - self.minY
local posY = self.maxY - y
local left = drawAreaWidth / rangeX * posX
local right = -(drawAreaWidth - left - 2)
local top = drawAreaHeight / rangeY * posY
local bottom = -(drawAreaHeight - top - 2)
-- Serves as the index for our current surface
self.numDots = self.numDots + 1
if (self.numDots > self.numSurfaces) then
self.drawArea:AddSurface(0.25, 0.75, 0.25, 0.75)
self.numSurfaces = self.numSurfaces + 1
else
self.drawArea:SetSurfaceHidden(self.numDots, false)
end
self.drawArea:SetColor(self.numDots, color:UnpackRGBA())
self.drawArea:SetInsets(self.numDots, left - 1, right - 1, top - 1, bottom - 1)
end
|
local panelName = "EquipperPanel"
local ui = setupUI([[
Panel
height: 19
BotSwitch
id: switch
anchors.top: parent.top
anchors.left: parent.left
text-align: center
width: 130
!text: tr('EQ Manager')
Button
id: setup
anchors.top: prev.top
anchors.left: prev.right
anchors.right: parent.right
margin-left: 3
height: 17
text: Setup
]])
ui:setId(panelName)
if not storage[panelName] then
storage[panelName] = {
enabled = false,
rules = {}
}
end
local config = storage[panelName]
ui.switch:setOn(config.enabled)
ui.switch.onClick = function(widget)
config.enabled = not config.enabled
widget:setOn(config.enabled)
end
local conditions = { -- always add new conditions at the bottom
"Item is available and not worn.", -- nothing 1
"Monsters around is more than: ", -- spinbox 2
"Monsters around is less than: ", -- spinbox 3
"Health precent is below:", -- spinbox 4
"Health precent is above:", -- spinbox 5
"Mana precent is below:", -- spinbox 6
"Mana precent is above:", -- spinbox 7
"Target name is:", -- BotTextEdit 8
"Hotkey is being pressed:", -- BotTextEdit 9
"Player is paralyzed", -- nothing 10
"Player is in protection zone", -- nothing 11
"Players around is more than:", -- spinbox 12
"Players around is less than:" -- spinbox 13
}
local conditionNumber = 1
local optionalConditionNumber = 2
local mainWindow = UI.createWindow("EquipWindow")
mainWindow:hide()
ui.setup.onClick = function()
mainWindow:show()
mainWindow:raise()
mainWindow:focus()
end
mainWindow.closeButton.onClick = function()
mainWindow:hide()
resetFields()
end
local inputPanel = mainWindow.inputPanel
local listPanel = mainWindow.listPanel
inputPanel.optionalCondition:hide()
inputPanel.useSecondCondition.onOptionChange = function(widget, option, data)
if option ~= "-" then
inputPanel.optionalCondition:show()
else
inputPanel.optionalCondition:hide()
end
end
inputPanel.unequip.onClick = function()
local value = 115
local panel = inputPanel.unequipPanel
local height = panel:getHeight()
if height == 0 then
panel:setHeight(value)
mainWindow:setHeight(mainWindow:getHeight()+value)
inputPanel:setHeight(inputPanel:getHeight()+value)
listPanel:setHeight(listPanel:getHeight()+value)
else
panel:setHeight(0)
mainWindow:setHeight(mainWindow:getHeight()-value)
inputPanel:setHeight(inputPanel:getHeight()-value)
listPanel:setHeight(listPanel:getHeight()-value)
end
end
local function setCondition(first, n)
local widget
local spinBox
local textEdit
if first then
widget = inputPanel.condition.description.text
spinBox = inputPanel.condition.spinbox
textEdit = inputPanel.condition.text
else
widget = inputPanel.optionalCondition.description.text
spinBox = inputPanel.optionalCondition.spinbox
textEdit = inputPanel.optionalCondition.text
end
-- reset values after change
spinBox:setValue(0)
textEdit:setText('')
if n == 1 or n == 10 or n == 11 then
spinBox:hide()
textEdit:hide()
elseif n == 9 or n == 8 then
spinBox:hide()
textEdit:show()
if n == 9 then
textEdit:setWidth(75)
else
textEdit:setWidth(200)
end
else
spinBox:show()
textEdit:hide()
end
widget:setText(conditions[n])
end
-- add default text & windows
setCondition(true, 1)
setCondition(false, 2)
-- in/de/crementation buttons
inputPanel.condition.nex.onClick = function()
local max = #conditions
if inputPanel.optionalCondition:isVisible() then
if conditionNumber == max then
if optionalConditionNumber == 1 then
conditionNumber = 2
else
conditionNumber = 1
end
else
local futureNumber = conditionNumber + 1
local safeFutureNumber = conditionNumber + 2 > max and 1 or conditionNumber + 2
conditionNumber = futureNumber ~= optionalConditionNumber and futureNumber or safeFutureNumber
end
else
conditionNumber = conditionNumber == max and 1 or conditionNumber + 1
if optionalConditionNumber == conditionNumber then
optionalConditionNumber = optionalConditionNumber == max and 1 or optionalConditionNumber + 1
setCondition(false, optionalConditionNumber)
end
end
setCondition(true, conditionNumber)
end
inputPanel.condition.pre.onClick = function()
local max = #conditions
if inputPanel.optionalCondition:isVisible() then
if conditionNumber == 1 then
if optionalConditionNumber == max then
conditionNumber = max-1
else
conditionNumber = max
end
else
local futureNumber = conditionNumber - 1
local safeFutureNumber = conditionNumber - 2 < 1 and max or conditionNumber - 2
conditionNumber = futureNumber ~= optionalConditionNumber and futureNumber or safeFutureNumber
end
else
conditionNumber = conditionNumber == 1 and max or conditionNumber - 1
if optionalConditionNumber == conditionNumber then
optionalConditionNumber = optionalConditionNumber == 1 and max or optionalConditionNumber - 1
setCondition(false, optionalConditionNumber)
end
end
setCondition(true, conditionNumber)
end
inputPanel.optionalCondition.nex.onClick = function()
local max = #conditions
if optionalConditionNumber == max then
if conditionNumber == 1 then
optionalConditionNumber = 2
else
optionalConditionNumber = 1
end
else
local futureNumber = optionalConditionNumber + 1
local safeFutureNumber = optionalConditionNumber + 2 > max and 1 or optionalConditionNumber + 2
optionalConditionNumber = futureNumber ~= conditionNumber and futureNumber or safeFutureNumber
end
setCondition(false, optionalConditionNumber)
end
inputPanel.optionalCondition.pre.onClick = function()
local max = #conditions
if optionalConditionNumber == 1 then
if conditionNumber == max then
optionalConditionNumber = max-1
else
optionalConditionNumber = max
end
else
local futureNumber = optionalConditionNumber - 1
local safeFutureNumber = optionalConditionNumber - 2 < 1 and max or optionalConditionNumber - 2
optionalConditionNumber = futureNumber ~= conditionNumber and futureNumber or safeFutureNumber
end
setCondition(false, optionalConditionNumber)
end
listPanel.up.onClick = function()
local n = listPanel.list:getChildIndex(listPanel.list:getFocusedChild())
local t = config.rules
t[n], t[n-1] = t[n-1], t[n]
listPanel.up:setEnabled(false)
listPanel.down:setEnabled(false)
refreshRules()
end
listPanel.down.onClick = function()
local n = listPanel.list:getChildIndex(listPanel.list:getFocusedChild())
local t = config.rules
t[n], t[n+1] = t[n+1], t[n]
listPanel.up:setEnabled(false)
listPanel.down:setEnabled(false)
refreshRules()
end
function getItemsFromBox()
local t = {}
for i, child in ipairs(inputPanel.itemBox:getChildren()) do
local id = child:getItemId()
if id > 100 then
table.insert(t, id)
end
end
return t
end
function refreshItemBox(reset)
local max = 8
local box = inputPanel.itemBox
local childAmount = box:getChildCount()
if reset then
box:destroyChildren()
local widget = UI.createWidget("BotItem", box)
widget.onItemChange = function(widget)
local id = widget:getItemId()
local index = box:getChildIndex(widget)
if id < 100 or (table.find(getItemsFromBox(), id) ~= index) then
widget:destroy()
end
refreshItemBox()
end
return
end
if childAmount == 0 then
local widget = UI.createWidget("BotItem", box)
widget.onItemChange = function(widget)
local id = widget:getItemId()
local index = box:getChildIndex(widget)
if id < 100 or (table.find(getItemsFromBox(), id) ~= index) then
widget:destroy()
end
refreshItemBox()
refreshItemBox()
end
elseif box:getLastChild():getItemId() > 100 and childAmount < max then
local widget = UI.createWidget("BotItem", box)
widget.onItemChange = function(widget)
local id = widget:getItemId()
local index = box:getChildIndex(widget)
if id < 100 or (table.find(getItemsFromBox(), id) ~= index) then
widget:destroy()
end
refreshItemBox()
refreshItemBox()
end
end
end
refreshItemBox()
local function resetFields()
refreshItemBox(true)
inputPanel.name:setText('')
conditionNumber = 1
optionalConditionNumber = 2
setCondition(false, optionalConditionNumber)
setCondition(true, conditionNumber)
inputPanel.useSecondCondition:setCurrentOption("-")
for i, child in pairs(inputPanel.unequipPanel:getChildren()) do
child:setChecked(false)
end
end
-- buttons disabled by default
listPanel.up:setEnabled(false)
listPanel.down:setEnabled(false)
function refreshRules()
local list = listPanel.list
list:destroyChildren()
for i,v in pairs(config.rules) do
local widget = UI.createWidget('Rule', list)
widget:setText(v.name)
widget.remove.onClick = function()
widget:destroy()
table.remove(config.rules, table.find(config.rules, v))
listPanel.up:setEnabled(false)
listPanel.down:setEnabled(false)
refreshRules()
end
widget.visible:setColor(v.visible and "green" or "red")
widget.visible.onClick = function()
v.visible = not v.visible
widget.visible:setColor(v.visible and "green" or "red")
end
widget.enabled:setChecked(v.enabled)
widget.enabled.onClick = function()
v.enabled = not v.enabled
widget.enabled:setChecked(v.enabled)
end
local desc
for i, v in ipairs(v.items) do
if i == 1 then
desc = "items: " .. v
else
desc = desc .. ", " .. v
end
end
widget:setTooltip(desc)
widget.onClick = function()
local panel = listPanel
if #panel.list:getChildren() == 1 then
panel.up:setEnabled(false)
panel.down:setEnabled(false)
elseif panel.list:getChildIndex(panel.list:getFocusedChild()) == 1 then
panel.up:setEnabled(false)
panel.down:setEnabled(true)
elseif panel.list:getChildIndex(panel.list:getFocusedChild()) == #panel.list:getChildren() then
panel.up:setEnabled(true)
panel.down:setEnabled(false)
else
panel.up:setEnabled(true)
panel.down:setEnabled(true)
end
end
widget.onDoubleClick = function()
-- main
conditionNumber = v.mainCondition
setCondition(true, conditionNumber)
if conditionNumber == 8 or conditionNumber == 9 then
inputPanel.condition.text:setText(v.mainValue)
elseif conditionNumber ~= 1 then
inputPanel.condition.spinbox:setValue(v.mainValue)
end
-- relation
inputPanel.useSecondCondition:setCurrentOption(v.relation)
-- optional
if v.relation ~= "-" then
optionalConditionNumber = v.optionalCondition
setCondition(false, optionalConditionNumber)
if optionalConditionNumber == 8 or optionalConditionNumber == 9 then
inputPanel.optionalCondition.text:setText(v.optValue)
elseif optionalConditionNumber ~= 1 then
inputPanel.optionalCondition.spinbox:setValue(v.optValue)
end
end
-- name
inputPanel.name:setText(v.name)
-- items
inputPanel.itemBox:destroyChildren()
for i, item in ipairs(v.items) do
local widget = UI.createWidget("BotItem", inputPanel.itemBox)
widget:setItemId(item)
widget.onItemChange = function(widget)
local id = widget:getItemId()
local index = box:getChildIndex(widget)
if id < 100 or (table.find(getItemsFromBox(), id) ~= index) then
widget:destroy()
end
refreshItemBox()
end
end
-- unequip
if type(v.unequip) == "table" then
for i, tick in ipairs(v.unequip) do
local checkbox = inputPanel.unequipPanel:getChildren()[i]
checkbox:setChecked(tick)
end
end
refreshItemBox()
-- remove value
table.remove(config.rules, table.find(config.rules, v))
refreshRules()
end
end
end
refreshRules()
inputPanel.addButton.onClick = function()
local mainVal
local optVal
local relation = inputPanel.useSecondCondition:getText()
local name = inputPanel.name:getText()
local items = getItemsFromBox()
local unequip = {}
for i, child in pairs(inputPanel.unequipPanel:getChildren()) do
if child:isChecked() then
table.insert(unequip, true)
else
table.insert(unequip, false)
end
end
if conditionNumber == 1 then
mainVal = nil
elseif conditionNumber == 8 then
mainVal = inputPanel.condition.text:getText()
if mainVal:len() == 0 then
return warn("[vBot Equipper] Please fill the name of the creature.")
end
elseif conditionNumber == 9 then
mainVal = inputPanel.condition.text:getText()
if mainVal:len() == 0 then
return warn("[vBot Equipper] Please set correct hotkey.")
end
else
mainVal = inputPanel.condition.spinbox:getValue()
end
if relation ~= "-" then
if optionalConditionNumber == 1 then
optVal = nil
elseif optionalConditionNumber == 8 then
optVal = inputPanel.optionalCondition.text:getText()
if optVal:len() == 0 then
return warn("[vBot Equipper] Please fill the name of the creature.")
end
elseif optionalConditionNumber == 9 then
optVal = inputPanel.optionalCondition.text:getText()
if optVal:len() == 0 then
return warn("[vBot Equipper] Please set correct hotkey.")
end
else
optVal = inputPanel.optionalCondition.spinbox:getValue()
end
end
if #items == 0 then
return warn("[vBot Equipper] Please add items.")
end
if #name == 0 then
return warn("[vBot Equipper] Please fill name of the profile.")
end
for i, child in pairs(listPanel.list:getChildren()) do
if child:getText() == name then
return warn("[vBot Equipper] There is already rule with this name! Choose different or remove old one.")
end
end
-- add
table.insert(config.rules, {
enabled = true,
visible = true,
mainCondition = conditionNumber,
optionalCondition = optionalConditionNumber,
mainValue = mainVal,
optValue = optVal,
relation = relation,
items = items,
name = name,
unequip = unequip
})
refreshRules()
resetFields()
end
--"Item is available and not worn.", -- nothing 1
--"Monsters around is more than: ", -- spinbox 2
--"Monsters around is less than: ", -- spinbox 3
--"Health precent is below:", -- spinbox 4
--"Health precent is above:", -- spinbox 5
--"Mana precent is below:", -- spinbox 6
--"Mana precent is above:", -- spinbox 7
--"Target name is:", -- BotTextEdit 8
--"Hotkey is being pressed:", -- Button 9
--"Player is paralyzed", -- nothing 10
local pressedKey = ""
onKeyPress(function(keys)
pressedKey = keys
end)
local function interpreteCondition(n, v)
local hp = hppercent()
local mp = manapercent()
local mobs = getMonsters()
local players = getPlayers()
if n == 1 then
return true
elseif n == 2 then
return mobs > v
elseif n == 3 then
return mobs < v
elseif n == 4 then
return hp < v
elseif n == 5 then
return hp > v
elseif n == 6 then
return mp < v
elseif n == 7 then
return mp > v
elseif n == 8 then
return target() and target():getName():lower() == v:lower() or false
elseif n == 9 then
return pressedKey == v
elseif n == 10 then
return isParalyzed()
elseif n == 11 then
return isInPz()
elseif n == 12 then
return players > v
elseif n == 13 then
return players < v
end
end
local function finalCheck(first,relation,second)
if relation == "-" then
return first
elseif relation == "and" then
return first and second
elseif relation == "or" then
return first or second
end
end
local function isEquipped(id)
local t = {getNeck(), getHead(), getBody(), getRight(), getLeft(), getLeg(), getFeet(), getFinger(), getAmmo()}
local ids = {id, getInactiveItemId(id), getActiveItemId(id)}
for i, slot in pairs(t) do
if slot and table.find(ids, slot:getId()) then
return true
end
end
return false
end
local function unequipItem(table)
--[[
head
neck
torso
left
right
legs
finger
ammo slot
boots
]]
local slots = {getHead(), getNeck(), getBody(), getLeft(), getRight(), getLeg(), getFinger(), getAmmo(), getFeet()}
if type(table) ~= "table" then return end
for i, slot in pairs(table) do
local physicalSlot = slots[i]
if slot and physicalSlot then
g_game.equipItemId(physicalSlot:getId())
return true
end
end
return false
end
EquipManager = macro(50, function()
if not config.enabled then return end
if #config.rules == 0 then return end
for i, rule in ipairs(config.rules) do
if rule.enabled then
local firstCondition = interpreteCondition(rule.mainCondition, rule.mainValue)
local optionalCondition = nil
if rule.relation ~= "-" then
optionalCondition = interpreteCondition(rule.optionalCondition, rule.optValue)
end
if finalCheck(firstCondition, rule.relation, optionalCondition) then
if unequipItem(rule.unequip) == true then
delay(200)
return
end
for i, item in ipairs(rule.items) do
if not isEquipped(item) then
if rule.visible then
if itemAmount(item) > 0 then
delay(200)
return g_game.equipItemId(item)
end
else
delay(200)
return g_game.equipItemId(item)
end
end
end
return
end
end
end
pressedKey = ""
end) |
--[[
Copyright (C) 2006-2007 Nymbia
Copyright (C) 2010-2017 Hendrik "Nevcairiel" Leppkes < h.leppkes@gmail.com >
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
local Quartz3 = LibStub("AceAddon-3.0"):GetAddon("Quartz3")
local L = LibStub("AceLocale-3.0"):GetLocale("Quartz3")
local media = LibStub("LibSharedMedia-3.0")
----------------------------
-- Upvalues
-- GLOBALS: LibStub, InterfaceOptionsFrame_OpenToCategory
local pairs, unpack, type = pairs, unpack, type
local getOpt, setOpt, getColor, setColor
do
function getOpt(info)
local key = info[#info]
return Quartz3.db.profile[key]
end
function setOpt(info, value)
local key = info[#info]
Quartz3.db.profile[key] = value
Quartz3:ApplySettings()
end
function getColor(info)
return unpack(getOpt(info))
end
function setColor(info, r, g, b, a)
setOpt(info, {r, g, b, a})
end
end
local options, moduleOptions = nil, {}
local function getOptions()
if not options then
options = {
type = "group",
args = {
general = {
type = "group",
inline = true,
name = "",
args = {
unlock = {
type = "execute",
name = L["Toggle Bar Lock"],
desc = L["Unlock the Bars to be able to move them around."],
func = function()
Quartz3:ToggleLock(true)
end,
order = 50,
},
nllock = {
type = "description",
name = "",
order = 51,
},
hidesamwise = {
type = "toggle",
name = L["Hide Samwise Icon"],
desc = L["Hide the icon for spells with no icon"],
order = 101,
get = getOpt,
set = setOpt,
},
casttimeprecision = {
type = "range",
name = L["Cast Time Precision"],
desc = L["Number of decimals to show for the Cast Time"],
min = 0, max = 3, step = 1,
get = getOpt,
set = setOpt,
order = 102,
},
colors = {
type = "group",
name = L["Colors"],
desc = L["Colors"],
guiInline = true,
order = 450,
get = getColor,
set = setColor,
args = {
spelltextcolor = {
type = "color",
name = L["Spell Text"],
desc = L["Set the color of the %s"]:format(L["Spell Text"]),
order = 98,
},
timetextcolor = {
type = "color",
name = L["Time Text"],
desc = L["Set the color of the %s"]:format(L["Time Text"]),
order = 98,
},
header = {
type = "header",
name = "",
order = 99,
},
castingcolor = {
type = "color",
name = L["Casting"],
desc = L["Set the color of the cast bar when %s"]:format(L["Casting"]),
},
channelingcolor = {
type = "color",
name = L["Channeling"],
desc = L["Set the color of the cast bar when %s"]:format(L["Channeling"]),
},
completecolor = {
type = "color",
name = L["Complete"],
desc = L["Set the color of the cast bar when %s"]:format(L["Complete"]),
},
failcolor = {
type = "color",
name = L["Failed"],
desc = L["Set the color of the cast bar when %s"]:format(L["Failed"]),
},
sparkcolor = {
type = "color",
name = L["Spark Color"],
desc = L["Set the color of the casting bar spark"],
hasAlpha = true,
},
nl1 = {
type = "description",
name = "",
order = 101,
},
backgroundcolor = {
type = "color",
name = L["Background"],
desc = L["Set the color of the casting bar background"],
order = 102,
},
backgroundalpha = {
type = "range",
name = L["Background Alpha"],
desc = L["Set the alpha of the casting bar background"],
isPercent = true,
min = 0, max = 1, bigStep = 0.025,
get = getOpt,
set = setOpt,
order = 103,
},
bordercolor = {
type = "color",
name = L["Border"],
desc = L["Set the color of the casting bar border"],
order = 104,
},
borderalpha = {
type = "range",
name = L["Border Alpha"],
desc = L["Set the alpha of the casting bar border"],
isPercent = true,
min = 0, max = 1, bigStep = 0.025,
get = getOpt,
set = setOpt,
order = 105,
},
},
},
},
},
},
}
for k,v in pairs(moduleOptions) do
options.args[k] = (type(v) == "function") and v() or v
end
end
return options
end
function Quartz3:ChatCommand(input)
if not input or input:trim() == "" then
InterfaceOptionsFrame_OpenToCategory(Quartz3.optFrames.Profiles)
InterfaceOptionsFrame_OpenToCategory(Quartz3.optFrames.Quartz3)
else
LibStub("AceConfigCmd-3.0").HandleCommand(Quartz3, "quartz", "Quartz3", input)
end
end
function Quartz3:SetupOptions()
self.optFrames = {}
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("Quartz3", getOptions)
self.optFrames.Quartz3 = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Quartz3", "Quartz 3", nil, "general")
self:RegisterModuleOptions("Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db), "Profiles")
self:RegisterChatCommand("quartz", "ChatCommand")
self:RegisterChatCommand("q3", "ChatCommand")
end
function Quartz3:RegisterModuleOptions(name, optTable, displayName)
moduleOptions[name] = optTable
self.optFrames[name] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Quartz3", displayName or name, "Quartz 3", name)
end
|
local lush = require('lush')
local colors = require("codedarku.colors")
local theme = lush(function()
return {
Comment({ bg=colors.none, fg=colors.green, gui='italic' }),
ColorColumn({ bg=colors.green, fg=colors.blue }),
Conceal({ bg=colors.bg, fg=colors.fg }),
Cursor({ bg=colors.cursorlight, fg=colors.cursordark }), -- character under the cursor
-- lCursor { }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
-- CursorIM { }, -- like Cursor, but used when in IME mode |CursorIM|
CursorColumn({ bg=colors.cursordarkdark, fg=colors.none }),
CursorLine({ bg=colors.cursordarkdark, fg=colors.none }),
Directory({ bg=colors.none, fg=colors.blue }),
DiffAdd({ bg=colors.diffgreendark, fg=colors.none }),
DiffChange({ bg=colors.diffreddark, fg=colors.none }),
DiffDelete({ bg=colors.diffredlight, fg=colors.none }),
DiffText({ bg=colors.diffredlight, fg=colors.nonr }),
EndOfBuffer({ bg=colors.bg, fg=colors.linenumber }),
-- TermCursor { }, -- cursor in a focused terminal
-- TermCursorNC { }, -- cursor in an unfocused terminal
ErrorMsg({ bg=colors.none, bg=colors.red }),
VertSplit({ bg=colors.none, bg=colors.spligdark }),
Folded({ bg=colors.none, fg=colors.gray }),
FoldColumn({ bg=colors.none, fg=colors.linenumber }),
SignColumn({ bg=colors.none, fg=colors.none }), -- column where |signs| are displayed
IncSearch({ bg=colors.searchcurrent, fg=colors.none }), -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
-- Substitute { }, -- |:substitute| replacement text highlighting
LineNr({ bg=colors.none, fg=colors.gray }), -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
CursorLineNr({ bg=colors.cursordarkdark, fg=colors.gray }), -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
MatchParen({ bg=colors.none, fg=colors.red }), -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
ModeMsg({ bg=colors.leftdark, fg=colors.none }), -- 'showmode' message (e.g., "-- INSERT -- ")
-- MsgArea { }, -- Area for messages and cmdline
-- MsgSeparator { }, -- Separator for scrolled messages, `msgsep` flag of 'display'
MoreMsg({ bg=colors.leftdark, fg=colors.none }), -- |more-prompt|
NonText({ bg=colors.none, fg=colors.linenumber }), -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
Normal({ bg=colors.bg, fg=colors.fg }),
NormalFloat({ bg=colors.popuphighlightgray, fg=colors.popupfront }), -- Normal text in floating windows.
-- NormalNC { }, -- normal text in non-current windows
Pmenu({ bg=colors.popupback, fg=colors.popupfront }), -- Popup menu: normal item.
PmenuSel({ bg=colors.popuphighlightblue, fg=colors.popupfront }), -- Popup menu: selected item.
PmenuSbar({ bg=colors.popuphighlightgray, fg=colors.none }), -- Popup menu: scrollbar.
PmenuThumb({ bg=colors.popupfront }), -- Popup menu: Thumb of the scrollbar.
Question({ bg=colors.bg, fg=colors.blue }), -- |hit-enter| prompt and yes/no questions
-- QuickFixLine { }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
Search({ bg=colors.search, fg=colors.none }), -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
SpecialKey({ bg=colors.none, fg=colors.blue }), -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
SpellBad({ bg=colors.bg, fg=colors.red }), -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
SpellCap({ bg=colors.bg, fg=colors.red }), -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
SpellLocal({ bg=colors.bg, fg=colors.red }), -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
SpellRare({ bg=colors.bg, fg=colors.red }), -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
StatusLine({ bg=colors.leftmid, fg=colors.fg }), -- status line of current window
StatusLineNC({ bg=colors.leftdark, fg=colors.fg }), -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
TabLine({ bg=colors.tabother, fg=colors.fg }), -- tab pages line, not active tab page label
TabLineFill({ bg=colors.taboutside, fg=colors.fg }), -- tab pages line, where there are no labels
TabLineSel({ bg=colors.tabcurrent, fg=colors.fg }), -- tab pages line, active tab page label
Title({ bg=colors.none, fg=colors.none, gui='bold' }), -- titles for output from ":set all", ":autocmd" etc.
Visual({ bg=colors.selection, fg=colors.none }), -- Visual mode selection
VisualNOS({ bg=colors.selection, fg=colors.none }), -- Visual mode selection when vim is "Not Owning the Selection".
WarningMsg({ bg=colors.bg, fg=colors.orange }), -- warning messages
-- Whitespace { }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
WildMenu({ bg=colors.selection, fg=colors.none }), -- current match in 'wildmenu' completion
Constant({ bg=colors.none, fg=colors.blue }), -- (preferred) any constant
String({ fg=colors.orange }), -- a string constant: "this is a string"
Character({ fg=colors.orange }), -- a character constant: 'c', '\n'
Number({ fg=colors.lightgreen }), -- a number constant: 234, 0xff
Boolean({ fg=colors.blue}), -- a boolean constant: TRUE, false
Float({ fg=colors.lightgreen }), -- a floating point constant: 2.3e10
Identifier({ fg=colors.lightblue }), -- (preferred) any variable name
Function({ fg=colors.yellow }), -- function name (also: methods for classes)
Statement({ fg=colors.pink }), -- (preferred) any statement
Conditional({ fg=colors.pink }), -- if, then, else, endif, switch, etc.
Repeat({ fg=colors.pink }), -- for, do, while, etc.
Label({ fg=colors.pink }), -- case, default, etc.
Operator({ fg=colors.fg }), -- "sizeof", "+", "*", etc.
Keyword({ fg=colors.pink }), -- any other keyword
Exception({ fg=colors.pink }), -- try, catch, throw
PreProc({ fg=colors.pink }), -- (preferred) generic Preprocessor
Include({ fg=colors.pink }), -- preprocessor #include
Define({ fg=colors.pink }), -- preprocessor #define
Macro({ fg=colors.pink }), -- same as Define
PreCondit({ fg=colors.pink }), -- preprocessor #if, #else, #endif, etc.
Type({ fg=colors.blue }), -- (preferred) int, long, char, etc.
StorageClass({ fg=colors.blue }), -- static, register, volatile, etc.
Structure({ fg=colors.blue }), -- struct, union, enum, etc.
Typedef({ fg=colors.blue }), -- A typedef
Special({ fg=colors.yelloworange }), -- (preferred) any special symbol
SpecialChar({ fg=colors.fg }), -- special character in a constant
Tag({ fg=colors.fg }), -- you can use CTRL-] on this
Delimiter({ fg=colors.fg }), -- character that needs attention
SpecialComment({ fg=colors.green }), -- special things inside a comment
Debug({ fg=colors.fg }), -- debugging statements
Ignore ({ fg=colors.fg }), -- (preferred) left blank, hidden |hl-Ignore|
Error({ bg=colors.red, fg=colors.fg, gui='undercurl' }), -- (preferred) any erroneous construct
Todo({ bg=colors.leftmid, fg=colors.none }), -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
-- Markdown
markdownBold({ fg=colors.blue, gui='bold' }),
markdownCode({ fg=colors.orange }),
markdownRule({ fg=colors.blue, gui='bold' }),
markdownCodeDelimiter({ fg=colors.orange }),
markdownHeadingDelimiter({ fg=colors.blue }),
markdownFootnote({ fg=colors.orange }),
markdownFootnoteDefinition({ fg=colors.orange }),
markdownUrl({ fg=colors.lightblue, gui='underline' }),
markdownLinkText({ fg=colors.orange }),
markdownEscape({ fg=colors.yelloworange }),
-- json
jsonKeyword({ fg=colors.lightblue }),
jsonEscape({ fg=colors.yelloworange }),
jsonNull({ fg=colors.blue }),
jsonBoolean({ fg=colors.blue }),
-- HTML
htmlTag({ fg=colors.gray }),
htmlEndTag({ fg=colors.gray }),
htmlTagName({ fg=colors.blue }),
htmlSpecialTagName({ fg=colors.blue }),
htmlArg({ fg=colors.lightblue }),
-- PHP
phpStaticClasses({ fg=colors.bluegreen }),
phpMethod({ fg=colors.yellow }),
phpClass({ fg=colors.bluegreen }),
phpFunction({ fg=colors.yellow }),
phpInclude({ fg=colors.blue }),
phpUseClass({ fg=colors.bluegreen }),
phpRegion({ fg=colors.bluegreen }),
phpMethodsVar({ fg=colors.lightblue }),
-- CSS
cssBraces({ fg=colors.fg }),
cssInclude({ fg=colors.pink }),
cssTagName({ fg=colors.yelloworange }),
cssClassName({ fg=colors.yelloworange }),
cssPseudoClass({ fg=colors.yelloworange }),
cssPseudoClassId({ fg=colors.yelloworange }),
cssPseudoClassLang({ fg=colors.yelloworange }),
cssIdentifier({ fg=colors.yelloworange }),
cssProp({ fg=colors.lightblue }),
cssDefinition({ fg=colors.lightblue }),
cssAttr({ fg=colors.orange }),
cssAttrRegion({ fg=colors.orange }),
cssColor({ fg=colors.orange }),
cssFunction({ fg=colors.orange }),
cssFunctionName({ fg=colors.orange }),
cssVendor({ fg=colors.orange }),
cssValueNumber({ fg=colors.orange }),
cssValueLength({ fg=colors.orange }),
cssUnitDecorators({ fg=colors.orange }),
cssStyle({ fg=colors.lightblue }),
cssImportant({ fg=colors.blue }),
-- JavaScript
jsVariableDef({ fg=colors.lightblue }),
jsFuncArgs({ fg=colors.lightblue }),
jsFuncBlock({ fg=colors.lightblue }),
jsRegexpString({ fg=colors.lightred }),
jsThis({ fg=colors.blue }),
jsOperatorKeyword({ fg=colors.blue }),
jsDestructuringBlock({ fg=colors.lightblue }),
jsObjectKey({ fg=colors.lightblue }),
jsGlobalObjects({ fg=colors.bluegreen }),
jsModuleKeyword({ fg=colors.lightblue }),
jsClassDefinition({ fg=colors.bluegreen }),
jsClassKeyword({ fg=colors.blue }),
jsExtendsKeyword({ fg=colors.blue }),
jsExportDefault({ fg=colors.pink }),
jsFuncCall({ fg=colors.yellow }),
jsObjectValue({ fg=colors.lightblue }),
jsParen({ fg=colors.lightblue }),
jsObjectProp({ fg=colors.lightblue }),
jsIfElseBlock({ fg=colors.lightblue }),
jsParenIfElse({ fg=colors.lightblue }),
jsSpreadOperator({ fg=colors.lightblue }),
jsSpreadExpression({ fg=colors.lightblue }),
-- Typescript
typescriptLabel({ fg=colors.lightblue }),
typescriptExceptions({ fg=colors.lightblue }),
typescriptBraces({ fg=colors.fg }),
typescriptEndColons({ fg=colors.lightblue }),
typescriptParens({ fg=colors.fg }),
typescriptDocTags({ fg=colors.blue }),
typescriptDocComment({ fg=colors.bluegreen }),
typescriptLogicSymbols({ fg=colors.lightblue }),
typescriptImport({ fg=colors.pink }),
typescriptBOM({ fg=colors.lightblue }),
typescriptVariableDeclaration({ fg=colors.lightblue }),
typescriptVariable({ fg=colors.blue }),
typescriptExport({ fg=colors.pink }),
typescriptAliasDeclaration({ fg=colors.bluegreen }),
typescriptAliasKeyword({ fg=colors.blue }),
typescriptClassName({ fg=colors.bluegreen }),
typescriptAccessibilityModifier({ fg=colors.blue }),
typescriptOperator({ fg=colors.blue }),
typescriptArrowFunc({ fg=colors.blue }),
typescriptMethodAccessor({ fg=colors.blue }),
typescriptMember({ fg=colors.yellow }),
typescriptTypeReference({ fg=colors.bluegreen }),
typescriptDefault({ fg=colors.lightblue }),
typescriptTemplateSB({ fg=colors.yelloworange }),
typescriptArrowFuncArg({ fg=colors.lightblue }),
typescriptParamImpl({ fg=colors.lightblue }),
typescriptFuncComma({ fg=colors.lightblue }),
typescriptCastKeyword({ fg=colors.lightblue }),
typescriptCall({ fg=colors.blue }),
typescriptCase({ fg=colors.lightblue }),
typescriptReserved({ fg=colors.pink }),
typescriptDecorator({ fg=colors.yellow }),
typescriptPredefinedType({ fg=colors.bluegreen }),
typescriptClassHeritage({ fg=colors.bluegreen }),
typescriptClassExtends({ fg=colors.blue }),
typescriptClassKeyword({ fg=colors.blue }),
typescriptBlock({ fg=colors.lightblue }),
typescriptDOMDocProp({ fg=colors.lightblue }),
typescriptTemplateSubstitution({ fg=colors.lightblue }),
typescriptClassBlock({ fg=colors.lightblue }),
typescriptFuncCallArg({ fg=colors.lightblue }),
typescriptIndexExpr({ fg=colors.lightblue }),
typescriptConditionalParen({ fg=colors.lightblue }),
typescriptArray({ fg=colors.yellow }),
typescriptES6SetProp({ fg=colors.lightblue }),
typescriptObjectLiteral({ fg=colors.lightblue }),
typescriptTypeParameter({ fg=colors.bluegreen }),
typescriptEnumKeyword({ fg=colors.blue }),
typescriptEnum({ fg=colors.bluegreen }),
typescriptLoopParen({ fg=colors.lightblue }),
typescriptParenExp({ fg=colors.lightblue }),
typescriptModule({ fg=colors.lightblue }),
typescriptAmbientDeclaration({ fg=colors.blue }),
-- typescriptModule({ fg=colors.blue }),
typescriptFuncTypeArrow({ fg=colors.blue }),
typescriptInterfaceHeritage({ fg=colors.bluegreen }),
typescriptInterfaceName({ fg=colors.bluegreen }),
typescriptInterfaceKeyword({ fg=colors.blue }),
typescriptInterfaceExtends({ fg=colors.blue }),
typescriptGlobal({ fg=colors.bluegreen }),
typescriptAsyncFuncKeyword({ fg=colors.blue }),
typescriptFuncKeyword({ fg=colors.blue }),
typescriptGlobalMethod({ fg=colors.yellow }),
typescriptPromiseMethod({ fg=colors.yellow }),
-- XML
xmlTag({ fg=colors.bluegreen }),
xmlTagName({ fg=colors.bluegreen }),
xmlEndTag({ fg=colors.bluegreen }),
-- Ruby
rubyClassNameTag({ fg=colors.bluegreen }),
rubyClassName({ fg=colors.bluegreen }),
rubyModuleName({ fg=colors.bluegreen }),
rubyConstant({ fg=colors.bluegreen }),
-- Golang
goPackage({ fg=colors.blue }),
goImport({ fg=colors.blue }),
goVar({ fg=colors.blue }),
goConst({ fg=colors.blue }),
goStatement({ fg=colors.pink }),
goType({ fg=colors.bluegreen }),
goSignedInts({ fg=colors.bluegreen }),
goUnsignedInts({ fg=colors.bluegreen }),
goFloats({ fg=colors.bluegreen }),
goComplexes({ fg=colors.bluegreen }),
goBuiltins({ fg=colors.yellow }),
goBoolean({ fg=colors.blue }),
goPredefinedIdentifiers({ fg=colors.blue }),
goTodo({ fg=colors.green }),
goDeclaration({ fg=colors.blue }),
goDeclType({ fg=colors.blue }),
goTypeDecl({ fg=colors.blue }),
goTypeName({ fg=colors.bluegreen }),
goVarAssign({ fg=colors.lightblue }),
goVarDefs({ fg=colors.lightblue }),
goReceiver({ fg=colors.fg }),
goReceiverType({ fg=colors.fg }),
goFunctionCall({ fg=colors.yellow }),
goMethodCall({ fg=colors.yellow }),
goSingleDecl({ fg=colors.lightblue }),
-- Python
pythonStatement({ fg=colors.blue }),
pythonOperator({ fg=colors.blue }),
pythonException({ fg=colors.pink }),
pythonExClass({ fg=colors.bluegreen }),
pythonBuiltinObj({ fg=colors.lightblue }),
pythonBuiltinType({ fg=colors.bluegreen }),
pythonBoolean({ fg=colors.blue }),
pythonNone({ fg=colors.blue }),
pythonTodo({ fg=colors.blue }),
pythonClassVar({ fg=colors.blue }),
pythonClassDef({ fg=colors.bluegreen }),
-- TeX
texStatement({ fg=colors.blue }),
texBeginEnd({ fg=colors.yellow }),
texBeginEndName({ fg=colors.lightblue }),
texOption({ fg=colors.lightblue }),
texBeginEndModifier({ fg=colors.lightblue }),
texDocType({ fg=colors.pink }),
texDocTypeArgs({ fg=colors.lightblue }),
-- Git
gitcommitHeader({ fg=colors.gray }),
gitcommitOnBranch({ fg=colors.gray }),
gitcommitBranch({ fg=colors.pink }),
gitcommitComment({ fg=colors.gray }),
gitcommitSelectedType({ fg=colors.green }),
gitcommitSelectedFile({ fg=colors.green }),
gitcommitDiscardedType({ fg=colors.red }),
gitcommitDiscardedFile({ fg=colors.red }),
gitcommitOverflow({ fg=colors.red }),
gitcommitSummary({ fg=colors.pink }),
gitcommitBlank({ fg=colors.pink }),
-- Lua
luaFuncCall({ fg=colors.yellow }),
luaFuncArgName({ fg=colors.lightblue }),
luaFuncKeyword({ fg=colors.pink }),
luaLocal({ fg=colors.pink }),
luaBuiltIn({ fg=colors.blue }),
-- SQL
sqlKeyword({ fg=colors.pink }),
sqlFunction({ fg=colors.yelloworange }),
sqlOperator({ fg=colors.pink }),
-- YAML
yamlKey({ fg=colors.blue }),
yamlConstant({ fg=colors.blue }),
}
end)
return theme
-- vi:nowrap
|
-- ABC: Noobagem!
local e = require("event")
local comp = require("component")
local gpu = comp.gpu
while true do
local _,_,x,y = e.pull("touch")
gpu.set(x,y,"X")
end
|
project "QtSharp.CLI"
kind "ConsoleApp"
language "C#"
SetupCppSharp()
SetupManagedProject()
--debugargs { "C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\qmake.exe C:\Qt\Qt5.3.2\Tools\mingw482_32\bin\mingw32-make.exe" }
files { "*.cs" }
links { "System", "System.Core", "QtSharp" }
|
local playsession = {
{"mewmew", {12114}},
{"sasha21168", {806}},
{"CaAsti", {4430}},
{"DanFT", {4174}},
{"4xBen", {1347474}},
{"Menander", {687638}},
{"Atoms", {500542}},
{"1337oxi", {375}},
{"siriushoward", {46305}},
{"Vuldunobetro", {620}},
{"Eddoasso", {5098}},
{"tajemniczy_303", {290743}},
{"everLord", {375139}},
{"A-l-a-n", {179482}},
{"Reyand", {46154}},
{"TrickyVic", {3002}},
{"KaRaVai", {7696}},
{"KloStein", {2242}},
{"bbc26rus", {1480}},
{"N4RC", {2555}},
{"quintkiller", {6035}},
{"kaimix", {27325}},
{"AhalaiMahalai", {32432}}
}
return playsession |
local AddonName, AddonTable = ...
AddonTable.diremaul = {
-- Zevrim Thornhoof
18323,
18308,
18319,
18313,
18306,
18315,
-- Hydrospawn
18324,
18317,
18305,
18307,
18322,
-- Lethtendris
18311,
18301,
18325,
18302,
-- Alzzin the Wildshaper
18321,
18310,
18328,
18312,
18309,
18326,
18327,
18318,
18314,
-- Tendris Warpwood
18353,
18352,
18393,
18390,
-- Illyana Ravenoak
18347,
18383,
18349,
18377,
18386,
-- Magister Kalendris
18397,
18374,
18350,
18351,
18371,
-- Immol'thar
18372,
18381,
18384,
18389,
18385,
18394,
18391,
18379,
18370,
-- Prince Tortheldrin
18392,
18396,
18376,
18388,
18382,
18373,
18375,
18380,
18378,
18395,
-- Shared Loot (Guard Mol'dar, Guard Fengus, Guard Slip'kik)
18498,
18462,
18463,
18460,
18493,
18494,
18496,
18450,
18497,
18451,
-- Stomper Kreeg
18425,
18464,
-- Captain Kromcrush
18502,
18503,
18458,
18505,
18507,
-- Cho'Rush the Observer
18484,
18483,
18485,
18490,
18459,
18527,
-- King Gordok
18520,
18523,
18526,
18525,
18524,
18521,
18522,
-- Quest Rewards
65924,
}
|
local DIR_ROOT = (path.getabsolute('..') .. '/')
local DIR_LIB = DIR_ROOT .. 'lib/'
return function(options, core)
if not options then options = {} end
if not options.dir then options.dir = DIR_LIB .. 'galaxy/' end
if not options.config then options.config = {} end
configuration(options.config)
if core then
-- Files
files {
DIR_ROOT .. 'include/Unet/Services/ServiceGalaxy.h',
DIR_ROOT .. 'src/Services/ServiceGalaxy.cpp',
}
end
-- Include dir
includedirs {
options.dir .. 'Include/',
}
if options.link then
-- Lib dir
libdirs {
options.dir .. 'Libraries/',
}
-- Link
if os.get() == 'linux' then
configuration(unet_merge_config(options.config, 'x64'))
links { 'Galaxy64' }
configuration(unet_merge_config(options.config, 'x32'))
links { 'Galaxy' }
else
configuration(options.config)
links { 'Galaxy' }
end
end
end
|
Class = require "lib.hump.class"
vector = require "lib.hump.vector"
Entity = require "entity"
SimpleParticle = Class{__includes = Entity,
init = function(self, x, y, size, dx, dy, r, g, b, a, decay)
Entity.init(self, x, y)
self.size = size
self.velocity = vector(dx, dy)
self.red = r
self.green = g
self.blue = b
self.alpha = a
self.decay = decay
end
}
function SimpleParticle:update(dt)
self.alpha = self.alpha - (self.decay * dt)
if self.alpha < 0 then
self:destroy()
end
self.position = self.position + (self.velocity * dt)
end
function SimpleParticle:draw()
local x, y = self.position:unpack()
love.graphics.setColor(self.red, self.green, self.blue, self.alpha)
love.graphics.circle("fill", self.position.x, self.position.y, self.size)
end
return SimpleParticle |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.