content
stringlengths
5
1.05M
vim.cmd('packadd colorbuddy.nvim') local Color, c, Group, g, s = require("colorbuddy").setup() local b = s.bold local i = s.italic local n = s.inverse local uc = s.undercurl local ul = s.underline local r = s.reverse local sto = s.standout local no = s.NONE local v = vim v.colors_name = 'neowal' ------------------------- -- Vim Terminal Colors -- ------------------------- -- v.g.terminal_color_0 = "#353a44" -- v.g.terminal_color_8 = "#353a44" -- v.g.terminal_color_1 = "#e88388" -- v.g.terminal_color_9 = "#e88388" -- v.g.terminal_color_2 = "#a7cc8c" -- v.g.terminal_color_10 = "#a7cc8c" -- v.g.terminal_color_3 = "#ebca8d" -- v.g.terminal_color_11 = "#ebca8d" -- v.g.terminal_color_4 = "#72bef2" -- v.g.terminal_color_12 = "#72bef2" -- v.g.terminal_color_5 = "#d291e4" -- v.g.terminal_color_13 = "#d291e4" -- v.g.terminal_color_6 = "#65c2cd" -- v.g.terminal_color_14 = "#65c2cd" -- v.g.terminal_color_7 = "#e3e5e9" -- v.g.terminal_color_15 = "#e3e5e9" -- v.colors_name = 'spacebuddy' -- Color.new('mono_1', "#abb2bf") -- Color.new('mono_2', "#828997") -- Color.new('mono_3', "#5c6370") -- Color.new('mono_4', "#4b5263") -- Color.new('hue_1', "#56b6c2") -- Color.new('hue_2', "#61afef") -- Color.new('hue_3', "#c678dd") -- Color.new('hue_4', "#98c379") -- Color.new('hue_5', "#e06c75") -- Color.new('hue_5_2', "#be5046") -- Color.new('hue_6', "#d19a66") -- Color.new('hue_6_2', "#e5c07b") -- Color.new('syntax_bg', "#282c34") -- Color.new('syntax_gutter', "#636d83") -- Color.new('syntax_cursor', "#2c323c") -- Color.new('syntax_accent', "#528bff") -- Color.new('vertsplit', "#181a1f") -- Color.new('special_grey', "#3b4048") -- Color.new('visual_grey', "#3e4452") -- Color.new('pmenu', "#333841") -- for l in io.lines(os.getenv("HOME") .. "/.cache/wal/colors-kitty.conf") do local parts = l:gmatch("%S+") local wal_color_name = parts() local wal_color_code = parts() if (wal_color_name and wal_color_code) then Color.new(wal_color_name, wal_color_code) end end Color.new("test", "#00ff00") v.g.terminal_color_0 = "#353a44" v.g.terminal_color_8 = "#353a44" v.g.terminal_color_1 = "#e88388" v.g.terminal_color_9 = "#e88388" v.g.terminal_color_2 = "#a7cc8c" v.g.terminal_color_10 = "#a7cc8c" v.g.terminal_color_3 = "#ebca8d" v.g.terminal_color_11 = "#ebca8d" v.g.terminal_color_4 = "#72bef2" v.g.terminal_color_12 = "#72bef2" v.g.terminal_color_5 = "#d291e4" v.g.terminal_color_13 = "#d291e4" v.g.terminal_color_6 = "#65c2cd" v.g.terminal_color_14 = "#65c2cd" v.g.terminal_color_7 = "#e3e5e9" v.g.terminal_color_15 = "#e3e5e9" -- color0: dark grey, sometimes background -- color1-6, 9-14: hues -- color8: medium grey -- color7: light grey, sometimes foreground * -- color15: lightest grey/white * c.mono_1 = c.foreground -- Normal text c.mono_2 = c.color8 c.mono_3 = c.color8 -- Comments c.mono_4 = c.color8:dark(.05) -- Wildmenu selection background, line nums c.hue_1 = c.color6 c.hue_2 = c.color4 c.hue_3 = c.color5 c.hue_4 = c.color2 c.hue_5 = c.color1 c.hue_5_2 = c.color9 c.hue_6 = c.color3 c.hue_6_2 = c.color11 c.syntax_bg = c.background -- must be theme bg c.syntax_gutter = c.color8 c.syntax_cursor = c.background:dark(.01) -- colorcolumn, should be darkbg c.syntax_accent = c.color2 c.vertsplit = c.color0 c.special_grey = c.color15 -- Escaped characters c.visual_grey = c.color8 c.pmenu = c.color8 ---------------------- -- Vim Editor Color -- ---------------------- Group.new('Normal', c.mono_1, c.syntax_bg, no) Group.new('bold', c.syntax_bg, c.syntax_bg, b) Group.new('ColorColumn', c.syntax_bg, c.syntax_cursor, no) Group.new('Conceal', c.mono_4, c.syntax_bg, no) Group.new('Cursor', c.syntax_bg, c.syntax_accent, no) Group.new('CursorIM', c.syntax_bg, c.syntax_bg, no) Group.new('CursorColumn', c.syntax_bg, c.syntax_cursor, no) Group.new('CursorLine', c.syntax_bg, c.syntax_cursor, no) Group.new('Directory', c.hue_2, c.syntax_bg, no) Group.new('ErrorMsg', c.hue_5, c.mono_3, no) Group.new('VertSplit', c.vertsplit, c.syntax_bg, no) Group.new('Folded', c.mono_3, c.mono_3, no) Group.new('FoldColumn', c.mono_3, c.syntax_cursor, no) Group.new('IncSearch', c.hue_6, c.syntax_bg, no) Group.new('LineNr', c.mono_4, c.syntax_bg, no) Group.new('CursorLineNr', c.mono_1, c.syntax_cursor, no) Group.new('MatchParen', c.hue_5, c.syntax_cursor, ul + b) Group.new('Italic', c.syntax_bg, c.syntax_bg, i) Group.new('ModeMsg', c.mono_1, c.syntax_bg, no) Group.new('MoreMsg', c.mono_1, c.syntax_bg, no) Group.new('NonText', c.mono_3, c.syntax_bg, no) Group.new('PMenu', c.syntax_bg, c.pmenu, no) Group.new('PMenuSel', c.syntax_bg, c.mono_4, no) Group.new('PMenuSbar', c.syntax_bg, c.mono_3, no) Group.new('PMenuThumb', c.syntax_bg, c.mono_1, no) Group.new('Question', c.hue_2, c.syntax_bg, no) Group.new('Search', c.mono_3, c.hue_6_2, no) Group.new('SpecialKey', c.special_grey, c.syntax_bg, no) Group.new('Whitespace', c.special_grey, c.syntax_bg, no) Group.new('StatusLine', c.mono_1, c.syntax_cursor, no) Group.new('StatusLineNC', c.mono_3, c.syntax_bg:dark(.002), no) -- changed so sline bg isnt invisible Group.new('TabLine', c.mono_2, c.visual_grey, no) Group.new('TabLineFill', c.mono_3, c.visual_grey, no) Group.new('TabLineSel', c.mono_3, c.hue_2, no) Group.new('Title', c.mono_1, c.syntax_bg, b) Group.new('Visual', c.syntax_bg, c.visual_grey, no) Group.new('VisualNOS', c.syntax_bg, c.visual_grey, no) Group.new('WarningMsg', c.hue_5, c.syntax_bg, no) Group.new('TooLong', c.hue_5, c.syntax_bg, no) Group.new('WildMenu', c.mono_1, c.mono_3, no) Group.new('SignColumn', c.syntax_bg, c.mono_3, no) Group.new('Special', c.hue_2, c.syntax_bg, no) --------------------------- -- Vim Help Highlighting -- --------------------------- Group.new('helpCommand', c.hue_6_2, c.syntax_bg, no) Group.new('helpExample', c.hue_6_2, c.syntax_bg, no) Group.new('helpHeader', c.mono_1, c.syntax_bg, b) Group.new('helpSectionDelim', c.mono_3, c.syntax_bg, no) ---------------------------------- -- Standard Syntax Highlighting -- ---------------------------------- Group.new('Comment', c.mono_3, c.syntax_bg, i) Group.new('Constant', c.hue_4, c.syntax_bg, no) Group.new('String', c.hue_4, c.syntax_bg, no) Group.new('Character', c.hue_4, c.syntax_bg, no) Group.new('Number', c.hue_6, c.syntax_bg, no) Group.new('Boolean', c.hue_6, c.syntax_bg, no) Group.new('Float', c.hue_6, c.syntax_bg, no) Group.new('Identifier', c.hue_5, c.syntax_bg, no) Group.new('Function', c.hue_2, c.syntax_bg, no) Group.new('Statement', c.hue_3, c.syntax_bg, no) Group.new('Conditional', c.hue_3, c.syntax_bg, no) Group.new('Repeat', c.hue_3, c.syntax_bg, no) Group.new('Label', c.hue_3, c.syntax_bg, no) Group.new('Operator', c.syntax_accent, c.syntax_bg, no) Group.new('Keyword', c.hue_5, c.syntax_bg, no) Group.new('Exception', c.hue_3, c.syntax_bg, no) Group.new('PreProc', c.hue_6_2, c.syntax_bg, no) Group.new('Include', c.hue_2, c.syntax_bg, no) Group.new('Define', c.hue_3, c.syntax_bg, no) Group.new('Macro', c.hue_3, c.syntax_bg, no) Group.new('PreCondit', c.hue_6_2, c.syntax_bg, no) Group.new('Type', c.hue_6_2, c.syntax_bg, no) Group.new('StorageClass', c.hue_6_2, c.syntax_bg, no) Group.new('Structure', c.hue_6_2, c.syntax_bg, no) Group.new('Typedef', c.hue_6_2, c.syntax_bg, no) Group.new('Special', c.hue_2, c.syntax_bg, no) Group.new('SpecialChar', c.mono_3:light(.03), c.syntax_bg, no) Group.new('Tag', c.syntax_bg, c.syntax_bg, no) Group.new('Delimiter', c.hue_1, c.syntax_bg, no) Group.new('SpecialComment', c.syntax_bg, c.syntax_bg, no) Group.new('Debug', c.syntax_bg, c.syntax_bg, no) Group.new('Underlined', c.syntax_bg, c.syntax_bg, ul) Group.new('Ignore', c.syntax_bg, c.syntax_bg, no) Group.new('Error', c.hue_5, c.mono_3, b) Group.new('Todo', c.hue_3, c.mono_3, no) ----------------------- -- Diff Highlighting -- ----------------------- Group.new('DiffAdd', c.hue_4, c.visual_grey, no) Group.new('DiffChange', c.hue_6, c.visual_grey, no) Group.new('DiffDelete', c.hue_5, c.visual_grey, no) Group.new('DiffText', c.hue_2, c.visual_grey, no) Group.new('DiffAdded', c.hue_4, c.visual_grey, no) Group.new('DiffFile', c.hue_5, c.visual_grey, no) Group.new('DiffNewFile', c.hue_4, c.visual_grey, no) Group.new('DiffLine', c.hue_2, c.visual_grey, no) Group.new('DiffRemoved', c.hue_5, c.visual_grey, no) --------------------------- -- Filetype Highlighting -- --------------------------- -- Asciidoc Group.new('asciidocListingBlock', c.mono_2, c.syntax_bg, no) -- C/C++ highlighting Group.new('cInclude', c.hue_3, c.syntax_bg, no) Group.new('cPreCondit', c.hue_3, c.syntax_bg, no) Group.new('cPreConditMatch', c.hue_3, c.syntax_bg, no) Group.new('cType', c.hue_3, c.syntax_bg, no) Group.new('cStorageClass', c.hue_3, c.syntax_bg, no) Group.new('cStructure', c.hue_3, c.syntax_bg, no) Group.new('cOperator', c.hue_3, c.syntax_bg, no) Group.new('cStatement', c.hue_3, c.syntax_bg, no) Group.new('cTODO', c.hue_3, c.syntax_bg, no) Group.new('cConstant', c.hue_6, c.syntax_bg, no) Group.new('cSpecial', c.hue_1, c.syntax_bg, no) Group.new('cSpecialCharacter', c.hue_1, c.syntax_bg, no) Group.new('cString', c.hue_4, c.syntax_bg, no) Group.new('cppType', c.hue_3, c.syntax_bg, no) Group.new('cppStorageClass', c.hue_3, c.syntax_bg, no) Group.new('cppStructure', c.hue_3, c.syntax_bg, no) Group.new('cppModifier', c.hue_3, c.syntax_bg, no) Group.new('cppOperator', c.hue_3, c.syntax_bg, no) Group.new('cppAccess', c.hue_3, c.syntax_bg, no) Group.new('cppStatement', c.hue_3, c.syntax_bg, no) Group.new('cppConstant', c.hue_5, c.syntax_bg, no) Group.new('cCppString', c.hue_4, c.syntax_bg, no) -- Cucumber Group.new('cucumberGiven', c.hue_2, c.syntax_bg, no) Group.new('cucumberWhen', c.hue_2, c.syntax_bg, no) Group.new('cucumberWhenAnd', c.hue_2, c.syntax_bg, no) Group.new('cucumberThen', c.hue_2, c.syntax_bg, no) Group.new('cucumberThenAnd', c.hue_2, c.syntax_bg, no) Group.new('cucumberUnparsed', c.hue_6, c.syntax_bg, no) Group.new('cucumberFeature', c.hue_5, c.syntax_bg, b) Group.new('cucumberBackground', c.hue_3, c.syntax_bg, b) Group.new('cucumberScenario', c.hue_3, c.syntax_bg, b) Group.new('cucumberScenarioOutline', c.hue_3, c.syntax_bg, b) Group.new('cucumberTags', c.mono_3,c.syntax_bg, b) Group.new('cucumberDelimiter', c.mono_3, c.syntax_bg, b) -- CSS/Sass Group.new('cssAttrComma', c.hue_3, c.syntax_bg, no) Group.new('cssAttributeSelector', c.hue_4, c.syntax_bg, no) Group.new('cssBraces', c.mono_2, c.syntax_bg, no) Group.new('cssClassName', c.hue_6, c.syntax_bg, no) Group.new('cssClassNameDot', c.hue_6, c.syntax_bg, no) Group.new('cssDefinition', c.hue_3, c.syntax_bg, no) Group.new('cssFontAttr', c.hue_6, c.syntax_bg, no) Group.new('cssFontDescriptor', c.hue_3, c.syntax_bg, no) Group.new('cssFunctionName', c.hue_2, c.syntax_bg, no) Group.new('cssIdentifier', c.hue_2, c.syntax_bg, no) Group.new('cssImportant', c.hue_3, c.syntax_bg, no) Group.new('cssInclude', c.mono_1, c.syntax_bg, no) Group.new('cssIncludeKeyword', c.hue_3, c.syntax_bg, no) Group.new('cssMediaType', c.hue_6, c.syntax_bg, no) Group.new('cssProp', c.hue_1, c.syntax_bg, no) Group.new('cssPseudoClassId', c.hue_6, c.syntax_bg, no) Group.new('cssSelectorOp', c.hue_3, c.syntax_bg, no) Group.new('cssSelectorOp2', c.hue_3, c.syntax_bg, no) Group.new('cssStringQ', c.hue_4, c.syntax_bg, no) Group.new('cssStringQQ', c.hue_4, c.syntax_bg, no) Group.new('cssTagName', c.hue_5, c.syntax_bg, no) Group.new('cssAttr', c.hue_6, c.syntax_bg, no) Group.new('sassAmpersand', c.hue_5, c.syntax_bg, no) Group.new('sassClass', c.hue_6_2, c.syntax_bg, no) Group.new('sassControl', c.hue_3, c.syntax_bg, no) Group.new('sassExtend', c.hue_3, c.syntax_bg, no) Group.new('sassFor', c.mono_1, c.syntax_bg, no) Group.new('sassProperty', c.hue_1, c.syntax_bg, no) Group.new('sassFunction', c.hue_1, c.syntax_bg, no) Group.new('sassId', c.hue_2, c.syntax_bg, no) Group.new('sassInclude', c.hue_3, c.syntax_bg, no) Group.new('sassMedia', c.hue_3, c.syntax_bg, no) Group.new('sassMediaOperators', c.mono_1, c.syntax_bg, no) Group.new('sassMixin', c.hue_3, c.syntax_bg, no) Group.new('sassMixinName', c.hue_2, c.syntax_bg, no) Group.new('sassMixing', c.hue_3, c.syntax_bg, no) Group.new('scssSelectorName', c.hue_6_2, c.syntax_bg, no) -- Elixir highlighting Group.new('elixirModuleDefine', g.Define, g.Define, g.Define) Group.new('elixirAlias', c.hue_6_2, c.syntax_bg, no) Group.new('elixirAtom', c.hue_1, c.syntax_bg, no) Group.new('elixirBlockDefinition', c.hue_3, c.syntax_bg, no) Group.new('elixirModuleDeclaration', c.hue_6, c.syntax_bg, no) Group.new('elixirInclude', c.hue_5, c.syntax_bg, no) Group.new('elixirOperator', c.hue_6, c.syntax_bg, no) -- Git and git related plugins Group.new('gitcommitComment', c.mono_3, c.syntax_bg, no) Group.new('gitcommitUnmerged', c.hue_4, c.syntax_bg, no) Group.new('gitcommitOnBranch', c.none, c.syntax_bg, no) Group.new('gitcommitBranch', c.hue_3, c.syntax_bg, no) Group.new('gitcommitDiscardedType', c.hue_5, c.syntax_bg, no) Group.new('gitcommitSelectedType', c.hue_4, c.syntax_bg, no) Group.new('gitcommitHeader', c.syntax_bg, c.syntax_bg, no) Group.new('gitcommitUntrackedFile', c.hue_1, c.syntax_bg, no) Group.new('gitcommitDiscardedFile', c.hue_5, c.syntax_bg, no) Group.new('gitcommitSelectedFile', c.hue_4, c.syntax_bg, no) Group.new('gitcommitUnmergedFile', c.hue_6_2, c.syntax_bg, no) Group.new('gitcommitFile', c.syntax_bg, c.syntax_bg, no) Group.new('gitcommitNoBranch', g.gitcommitBranch, g.gitcommitBranch, g.gitcommitBranch) Group.new('gitcommitUntracked', g.gitcommitComment, g.gitcommitComment, g.gitcommitComment) Group.new('gitcommitDiscarded', g.gitcommitComment, g.gitcommitComment, g.gitcommitComment) Group.new('gitcommitDiscardedArrow', g.gitcommitDiscardedFile, g.gitcommitDiscardedFile, g.gitcommitDiscardedFile) Group.new('gitcommitSelectedArrow', g.gitcommitSelectedFile, g.gitcommitSelectedFile, g.gitcommitSelectedFile) Group.new('gitcommitUnmergedArrow', g.gitcommitUnmergedFile, g.gitcommitUnmergedFile, g.gitcommitUnmergedFile) Group.new('SignifySignAdd', c.hue_4, c.syntax_bg, no) Group.new('SignifySignChange', c.hue_6_2, c.syntax_bg, no) Group.new('SignifySignDelete', c.hue_5, c.syntax_bg, no) Group.new('GitGutterAdd', g.SignifySignAdd, g.SignifySignAdd, g.SignifySignAdd) Group.new('GitGutterChange', g.SignifySignChange, g.SignifySignChange, g.SignifySignChange) Group.new('GitGutterDelete', g.SignifySignDelete, g.SignifySignDelete, g.SignifySignDelete) Group.new('diffAdded', c.hue_4, c.syntax_bg, no) Group.new('diffRemoved', c.hue_5, c.syntax_bg, no) -- Go Group.new('goDeclaration', c.hue_3, c.syntax_bg, no) Group.new('goField', c.hue_5, c.syntax_bg, no) Group.new('goMethod', c.hue_1, c.syntax_bg, no) Group.new('goType', c.hue_3, c.syntax_bg, no) Group.new('goUnsignedInts', c.hue_1, c.syntax_bg, no) -- Haskell highlighting Group.new('haskellDeclKeyword', c.hue_2, c.syntax_bg, no) Group.new('haskellType', c.hue_4, c.syntax_bg, no) Group.new('haskellWhere', c.hue_5, c.syntax_bg, no) Group.new('haskellImportKeywords', c.hue_2, c.syntax_bg, no) Group.new('haskellOperators', c.hue_5, c.syntax_bg, no) Group.new('haskellDelimiter', c.hue_2, c.syntax_bg, no) Group.new('haskellIdentifier', c.hue_6, c.syntax_bg, no) Group.new('haskellKeyword', c.hue_5, c.syntax_bg, no) Group.new('haskellNumber', c.hue_1, c.syntax_bg, no) Group.new('haskellString', c.hue_1, c.syntax_bg, no) -- HTML Group.new('htmlArg', c.hue_6, c.syntax_bg, no) Group.new('htmlTagName', c.hue_5, c.syntax_bg, no) Group.new('htmlTagN', c.hue_5, c.syntax_bg, no) Group.new('htmlSpecialTagName', c.hue_5, c.syntax_bg, no) Group.new('htmlTag', c.mono_2, c.syntax_bg, no) Group.new('htmlEndTag', c.mono_2, c.syntax_bg, no) Group.new('MatchTag', c.hue_5, c.syntax_cursor, ul + b) -- JavaScript Group.new('coffeeString', c.hue_4, c.syntax_bg, no) Group.new('javaScriptBraces', c.mono_2, c.syntax_bg, no) Group.new('javaScriptFunction', c.hue_3, c.syntax_bg, no) Group.new('javaScriptIdentifier', c.hue_3, c.syntax_bg, no) Group.new('javaScriptNull', c.hue_6, c.syntax_bg, no) Group.new('javaScriptNumber', c.hue_6, c.syntax_bg, no) Group.new('javaScriptRequire', c.hue_1, c.syntax_bg, no) Group.new('javaScriptReserved', c.hue_3, c.syntax_bg, no) -- httpc.//github.com/pangloss/vim-javascript Group.new('jsArrowFunction', c.hue_3, c.syntax_bg, no) Group.new('jsBraces', c.mono_2, c.syntax_bg, no) Group.new('jsClassBraces', c.mono_2, c.syntax_bg, no) Group.new('jsClassKeywords', c.hue_3, c.syntax_bg, no) Group.new('jsDocParam', c.hue_2, c.syntax_bg, no) Group.new('jsDocTags', c.hue_3, c.syntax_bg, no) Group.new('jsFuncBraces', c.mono_2, c.syntax_bg, no) Group.new('jsFuncCall', c.hue_2, c.syntax_bg, no) Group.new('jsFuncParens', c.mono_2, c.syntax_bg, no) Group.new('jsFunction', c.hue_3, c.syntax_bg, no) Group.new('jsGlobalObjects', c.hue_6_2, c.syntax_bg, no) Group.new('jsModuleWords', c.hue_3, c.syntax_bg, no) Group.new('jsModules', c.hue_3, c.syntax_bg, no) Group.new('jsNoise', c.mono_2, c.syntax_bg, no) Group.new('jsNull', c.hue_6, c.syntax_bg, no) Group.new('jsOperator', c.hue_3, c.syntax_bg, no) Group.new('jsParens', c.mono_2, c.syntax_bg, no) Group.new('jsStorageClass', c.hue_3, c.syntax_bg, no) Group.new('jsTemplateBraces', c.hue_5_2, c.syntax_bg, no) Group.new('jsTemplateVar', c.hue_4, c.syntax_bg, no) Group.new('jsThis', c.hue_5, c.syntax_bg, no) Group.new('jsUndefined', c.hue_6, c.syntax_bg, no) Group.new('jsObjectValue', c.hue_2, c.syntax_bg, no) Group.new('jsObjectKey', c.hue_1, c.syntax_bg, no) Group.new('jsReturn', c.hue_3, c.syntax_bg, no) -- httpc.//github.com/othree/yajs.vim Group.new('javascriptArrowFunc', c.hue_3, c.syntax_bg, no) Group.new('javascriptClassExtends', c.hue_3, c.syntax_bg, no) Group.new('javascriptClassKeyword', c.hue_3, c.syntax_bg, no) Group.new('javascriptDocNotation', c.hue_3, c.syntax_bg, no) Group.new('javascriptDocParamName', c.hue_2, c.syntax_bg, no) Group.new('javascriptDocTags', c.hue_3, c.syntax_bg, no) Group.new('javascriptEndColons', c.mono_3, c.syntax_bg, no) Group.new('javascriptExport', c.hue_3, c.syntax_bg, no) Group.new('javascriptFuncArg', c.mono_1, c.syntax_bg, no) Group.new('javascriptFuncKeyword', c.hue_3, c.syntax_bg, no) Group.new('javascriptIdentifier', c.hue_5, c.syntax_bg, no) Group.new('javascriptImport', c.hue_3, c.syntax_bg, no) Group.new('javascriptObjectLabel', c.mono_1, c.syntax_bg, no) Group.new('javascriptOpSymbol', c.hue_1, c.syntax_bg, no) Group.new('javascriptOpSymbols', c.hue_1, c.syntax_bg, no) Group.new('javascriptPropertyName', c.hue_4, c.syntax_bg, no) Group.new('javascriptTemplateSB', c.hue_5_2, c.syntax_bg, no) Group.new('javascriptVariable', c.hue_3, c.syntax_bg, no) -- JSON Group.new('jsonCommentError', c.mono_1, c.syntax_bg, no) Group.new('jsonKeyword', c.hue_5, c.syntax_bg, no) Group.new('jsonQuote', c.mono_3, c.syntax_bg, no) Group.new('jsonTrailingCommaError', c.hue_5, c.syntax_bg, r) Group.new('jsonMissingCommaError', c.hue_5, c.syntax_bg, r) Group.new('jsonNoQuotesError', c.hue_5, c.syntax_bg, r) Group.new('jsonNumError', c.hue_5, c.syntax_bg, r) Group.new('jsonString', c.hue_4, c.syntax_bg, no) Group.new('jsonBoolean', c.hue_3, c.syntax_bg, no) Group.new('jsonNumber', c.hue_6, c.syntax_bg, no) Group.new('jsonStringSQError', c.hue_5, c.syntax_bg, r) Group.new('jsonSemicolonError', c.hue_5, c.syntax_bg, r) -- Markdown Group.new('markdownUrl', c.mono_3, c.syntax_bg, no) Group.new('markdownBold', c.hue_6, c.syntax_bg, b) Group.new('markdownItalic', c.hue_6, c.syntax_bg, b) Group.new('markdownCode', c.hue_4, c.syntax_bg, no) Group.new('markdownCodeBlock', c.hue_5, c.syntax_bg, no) Group.new('markdownCodeDelimiter', c.hue_4, c.syntax_bg, no) Group.new('markdownHeadingDelimiter', c.hue_5_2, c.syntax_bg, no) Group.new('markdownH1', c.hue_5, c.syntax_bg, no) Group.new('markdownH2', c.hue_5, c.syntax_bg, no) Group.new('markdownH3', c.hue_5, c.syntax_bg, no) Group.new('markdownH3', c.hue_5, c.syntax_bg, no) Group.new('markdownH4', c.hue_5, c.syntax_bg, no) Group.new('markdownH5', c.hue_5, c.syntax_bg, no) Group.new('markdownH6', c.hue_5, c.syntax_bg, no) Group.new('markdownListMarker', c.hue_5, c.syntax_bg, no) -- PHP Group.new('phpClass', c.hue_6_2, c.syntax_bg, no) Group.new('phpFunction', c.hue_2, c.syntax_bg, no) Group.new('phpFunctions', c.hue_2, c.syntax_bg, no) Group.new('phpInclude', c.hue_3, c.syntax_bg, no) Group.new('phpKeyword', c.hue_3, c.syntax_bg, no) Group.new('phpParent', c.mono_3, c.syntax_bg, no) Group.new('phpType', c.hue_3, c.syntax_bg, no) Group.new('phpSuperGlobals', c.hue_5, c.syntax_bg, no) -- Pug (Formerly Jade) Group.new('pugAttributesDelimiter', c.hue_6, c.syntax_bg, no) Group.new('pugClass', c.hue_6, c.syntax_bg, no) Group.new('pugDocType', c.mono_3, c.syntax_bg, i) Group.new('pugTag', c.hue_5, c.syntax_bg, no) -- PureScript Group.new('purescriptKeyword', c.hue_3, c.syntax_bg, no) Group.new('purescriptModuleName', c.mono_1, c.syntax_bg, no) Group.new('purescriptIdentifier', c.mono_1, c.syntax_bg, no) Group.new('purescriptType', c.hue_6_2, c.syntax_bg, no) Group.new('purescriptTypeVar', c.hue_5, c.syntax_bg, no) Group.new('purescriptConstructor', c.hue_5, c.syntax_bg, no) Group.new('purescriptOperator', c.mono_1, c.syntax_bg, no) -- Python Group.new('pythonImport', c.hue_3, c.syntax_bg, no) Group.new('pythonBuiltin', c.hue_1, c.syntax_bg, no) Group.new('pythonStatement', c.hue_3, c.syntax_bg, no) Group.new('pythonParam', c.hue_6, c.syntax_bg, no) Group.new('pythonEscape', c.hue_5, c.syntax_bg, no) Group.new('pythonSelf', c.mono_2, c.syntax_bg, i) Group.new('pythonClass', c.hue_2, c.syntax_bg, no) Group.new('pythonOperator', c.hue_3, c.syntax_bg, no) Group.new('pythonEscape', c.hue_5, c.syntax_bg, no) Group.new('pythonFunction', c.hue_2, c.syntax_bg, no) Group.new('pythonKeyword', c.hue_2, c.syntax_bg, no) Group.new('pythonModule', c.hue_3, c.syntax_bg, no) Group.new('pythonStringDelimiter', c.hue_4, c.syntax_bg, no) Group.new('pythonSymbol', c.hue_1, c.syntax_bg, no) -- Ruby Group.new('rubyBlock', c.hue_3, c.syntax_bg, no) Group.new('rubyBlockParameter', c.hue_5, c.syntax_bg, no) Group.new('rubyBlockParameterList', c.hue_5, c.syntax_bg, no) Group.new('rubyCapitalizedMethod', c.hue_3, c.syntax_bg, no) Group.new('rubyClass', c.hue_3, c.syntax_bg, no) Group.new('rubyConstant', c.hue_6_2, c.syntax_bg, no) Group.new('rubyControl', c.hue_3, c.syntax_bg, no) Group.new('rubyDefine', c.hue_3, c.syntax_bg, no) Group.new('rubyEscape', c.hue_5, c.syntax_bg, no) Group.new('rubyFunction', c.hue_2, c.syntax_bg, no) Group.new('rubyGlobalVariable', c.hue_5, c.syntax_bg, no) Group.new('rubyInclude', c.hue_2, c.syntax_bg, no) Group.new('rubyIncluderubyGlobalVariable', c.hue_5, c.syntax_bg, no) Group.new('rubyInstanceVariable', c.hue_5, c.syntax_bg, no) Group.new('rubyInterpolation', c.hue_1, c.syntax_bg, no) Group.new('rubyInterpolationDelimiter', c.hue_5, c.syntax_bg, no) Group.new('rubyKeyword', c.hue_2, c.syntax_bg, no) Group.new('rubyModule', c.hue_3, c.syntax_bg, no) Group.new('rubyPseudoVariable', c.hue_5, c.syntax_bg, no) Group.new('rubyRegexp', c.hue_1, c.syntax_bg, no) Group.new('rubyRegexpDelimiter', c.hue_1, c.syntax_bg, no) Group.new('rubyStringDelimiter', c.hue_4, c.syntax_bg, no) Group.new('rubySymbol', c.hue_1, c.syntax_bg, no) -- Spelling Group.new('SpellBad', c.mono_3, c.syntax_bg, uc) Group.new('SpellLocal', c.mono_3, c.syntax_bg, uc) Group.new('SpellCap', c.mono_3, c.syntax_bg, uc) Group.new('SpellRare', c.mono_3, c.syntax_bg, uc) -- Vim Group.new('vimCommand', c.hue_3, c.syntax_bg, no) Group.new('vimCommentTitle', c.mono_3, c.syntax_bg, b) Group.new('vimFunction', c.hue_1, c.syntax_bg, no) Group.new('vimFuncName', c.hue_3, c.syntax_bg, no) Group.new('vimHighlight', c.hue_2, c.syntax_bg, no) Group.new('vimLineComment', c.mono_3, c.syntax_bg, i) Group.new('vimParenSep', c.mono_2, c.syntax_bg, no) Group.new('vimSep', c.mono_2, c.syntax_bg, no) Group.new('vimUserFunc', c.hue_1, c.syntax_bg, no) Group.new('vimVar', c.hue_5, c.syntax_bg, no) -- XML Group.new('xmlAttrib', c.hue_6_2, c.syntax_bg, no) Group.new('xmlEndTag', c.hue_5, c.syntax_bg, no) Group.new('xmlTag', c.hue_5, c.syntax_bg, no) Group.new('xmlTagName', c.hue_5, c.syntax_bg, no) -- ZSH Group.new('zshCommands', c.mono_1, c.syntax_bg, no) Group.new('zshDeref', c.hue_5, c.syntax_bg, no) Group.new('zshShortDeref', c.hue_5, c.syntax_bg, no) Group.new('zshFunction', c.hue_1, c.syntax_bg, no) Group.new('zshKeyword', c.hue_3, c.syntax_bg, no) Group.new('zshSubst', c.hue_5, c.syntax_bg, no) Group.new('zshSubstDelim', c.mono_3, c.syntax_bg, no) Group.new('zshTypes', c.hue_3, c.syntax_bg, no) Group.new('zshVariableDef', c.hue_6, c.syntax_bg, no) -- Rust Group.new('rustExternCrate', c.hue_5, c.syntax_bg, b) Group.new('rustIdentifier', c.hue_2, c.syntax_bg, no) Group.new('rustDeriveTrait', c.hue_4, c.syntax_bg, no) Group.new('SpecialComment', c.mono_3, c.syntax_bg, no) Group.new('rustCommentLine', c.mono_3, c.syntax_bg, no) Group.new('rustCommentLineDoc', c.mono_3, c.syntax_bg, no) Group.new('rustCommentLineDocError', c.mono_3, c.syntax_bg, no) Group.new('rustCommentBlock', c.mono_3, c.syntax_bg, no) Group.new('rustCommentBlockDoc', c.mono_3, c.syntax_bg, no) Group.new('rustCommentBlockDocError', c.mono_3, c.syntax_bg, no) -- Man Group.new('manTitle', g.String, g.String, g.String) Group.new('manFooter', c.mono_3, c.syntax_bg, no) ------------------------- -- Plugin Highlighting -- ------------------------- -- ALE (Asynchronous Lint Engine) Group.new('ALEWarningSign', c.hue_6_2, c.syntax_bg, no) Group.new('ALEErrorSign', c.hue_5, c.syntax_bg, no) -- Neovim NERDTree Background fix Group.new('NERDTreeFile', c.mono_1, c.syntax_bg, no)
-- vim.g.indentLine_char = '┊'
local PLUGIN = PLUGIN local EDITOR = nut.util.include("sv_editor.lua") util.AddNetworkString("nutVendorAllowClass") util.AddNetworkString("nutVendorAllowFaction") util.AddNetworkString("nutVendorExit") util.AddNetworkString("nutVendorEdit") util.AddNetworkString("nutVendorMode") util.AddNetworkString("nutVendorMoney") util.AddNetworkString("nutVendorOpen") util.AddNetworkString("nutVendorPrice") util.AddNetworkString("nutVendorStock") util.AddNetworkString("nutVendorMaxStock") util.AddNetworkString("nutVendorSync") util.AddNetworkString("nutVendorTrade") net.Receive("nutVendorExit", function(_, client) local vendor = client.nutVendor if (IsValid(vendor)) then vendor:removeReceiver(client, true) end end) net.Receive("nutVendorEdit", function(_, client) local key = net.ReadString() if (not client:IsAdmin()) then return end local vendor = client.nutVendor if (not IsValid(vendor) or not EDITOR[key]) then return end EDITOR[key](vendor, client, key) PLUGIN:saveVendors() end) net.Receive("nutVendorTrade", function(_, client) local uniqueID = net.ReadString() local isSellingToVendor = net.ReadBool() if (not client:getChar() or not client:getChar():getInv()) then return end if ((client.nutVendorTry or 0) < CurTime()) then client.nutVendorTry = CurTime() + 0.1 else return end local found local entity = client.nutVendor if ( not IsValid(entity) or client:GetPos():Distance(entity:GetPos()) > 192 ) then return end if (not hook.Run("CanPlayerAccessVendor", client, entity)) then return end hook.Run("VendorTradeAttempt", client, entity, uniqueID, isSellingToVendor) end)
local Dictionary = script.Parent local Llama = Dictionary.Parent local t = require(LLama.Parent.t) local validate = t.table local function values(dictionary) assert(validate(dictionary)) local valuesList = {} local index = 1 for _, value in pairs(dictionary) do valuesList[index] = value index = index + 1 end return valuesList end return values
local alib = loadmodule("avada_lib") local common = alib.common local myHero = objmanager.player local enemies = common.GetEnemyHeroes() -- local smiteSlot = nil -- local smiteDmg = { 390, 410, 430, 450, 480, 510, 540, 570, 600, 640, 680, 720, 760, 800, 850, 900, 950, 1000 } -- if myHero:spellslotcast(4).data.name == "SummonerSmite" or myHero:spellslotcast(4).data.name == "S5_SummonerSmitePlayerGanker" or myHero:spellslotcast(4).data.name == "S5_SummonerSmiteDuel" then -- smiteSlot = 4 -- elseif myHero:spellslotcast(5).data.name == "SummonerSmite" or myHero:spellslotcast(5).data.name == "S5_SummonerSmitePlayerGanker" or myHero:spellslotcast(5).data.name == "S5_SummonerSmiteDuel" then -- smiteSlot = 5 -- end local spellsToDodge = { {name = "Aatrox", spells = { { slot = 0, delay = 0 }, -- Jump { slot = 2, delay = 0 } -- Blade }}, {name = "Soraka", spells = { { slot = 0, delay = 0 }, { slot = 2, delay = 0 } }} } -- local function AutoSmite() -- if not myHero.isDead and smiteSlot and common.CanUseSpell(smiteSlot) then -- for i = 0, objmanager.maxObjects - 1 do -- local obj = objmanager.get(i) -- if common.IsValidTarget(obj) and obj.type == enum.type.minion and obj.team == enum.team.neutral and draw.GetDistance(obj, myHero) < 560 and obj.health <= smiteDmg[myHero.level] 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 -- game.cast("obj", smiteSlot, obj) -- end -- end -- end -- end -- end local function CastQDodge() local target = nil local bestchamp = { hero = nil, health = math.huge, maxHealth = math.huge } if #enemies > 0 then for i = 1, #enemies do local hero = enemies[i] if common.IsValidTarget(hero) and hero.isVisible and draw.GetDistance(myHero, hero) <= 600 then if hero.maxHealth < bestchamp.maxHealth then bestchamp.hero = hero bestchamp.health = hero.health bestchamp.maxHealth = hero.maxHealth end end end target = bestchamp.hero end if target then local enemiesInRange = {} for i = 1, #enemies do local hero = enemies[i] if hero ~= target and common.IsValidTarget(hero) and draw.GetDistance(target, hero) < 1000 then enemiesInRange[#enemiesInRange + 1] = hero end end if #enemiesInRange > 1 then local minions = common.GetMinionsInRange(100) if #minions > 0 then target = minions[1] end end else local minions = common.GetMinionsInRange(600) if #minions > 0 then target = minions[1] end end if target then game.cast("obj", 0, target) print("casted on "..target.charName) else game.cast("self", 1) print("casted W") end end local function Dodge(spell) if common.CanUseSpell(0) and spell and spell.owner and spell.owner.team == enum.team.enemy and not spell.isBasicAttack then print("Enemy spell casted !") if spell.target and spell.target == myHero then print("You're the target") CastQDodge() else print("You're not the target") if draw.GetDistance(myHero, spell.endPos) <= 300 then print("But you're near end pos so let's dodge it !") CastQDodge() end end end end local function OnTick() -- AutoSmite() end local function OnProcessSpell(spell) Dodge(spell) end callback.add(enum.callback.tick, function() OnTick() end) callback.add(enum.callback.recv.spell, function (spell) OnProcessSpell(spell) end) print("Avada Master Yi: Loaded") return {}
local Class = require "Base.Class" local Preset = require "Persist.Preset" local FileSystem = require "Card.FileSystem" local UnitPreset = Class {} UnitPreset:include(Preset) function UnitPreset:init(data) Preset.init(self, data) self:setClassName("UnitPreset") end function UnitPreset:getLoadInfo() return self.data and self.data.loadInfo end function UnitPreset:read(fullpath) if Preset.read(self, fullpath) then local Persist = require "Persist" Persist.regenerateInstanceKeys(self.data) return true else return false end end local function nextBranch(t, k) local k2, v2 = next(t, k) if v2 then local ChainPreset = require "Persist.ChainPreset" return k2, ChainPreset(v2) else return nil end end function UnitPreset:iterateBranches() return nextBranch, self.data.branches, nil end function UnitPreset:getBranch(cname) if self.data.branches then local ChainPreset = require "Persist.ChainPreset" return ChainPreset(self.data.branches[cname]) else return nil end end return UnitPreset
local M = {} M.tokens = { heading = "atx_heading", loose_list = "loose_list", tight_list = "tight_list", list_item = "list_item", fenced_code_block = "fenced_code_block", code_fence_content = "code_fence_content", paragraph = "paragraph", soft_line_break = "soft_line_break", link = "link" } return M
local math_abs = math.abs -- local movetype_blacklist = { MOVETYPE_FLY, MOVETYPE_FLYGRAVITY, MOVETYPE_NOCLIP, MOVETYPE_LADDER, MOVETYPE_OBSERVER, } scommand.Create('act_forward_jump').OnServer(function(ply) if not IsValid(ply) or slib.Animator.IsPlay('forward_jump_anim', ply) then return end if table.HasValueBySeq(movetype_blacklist, ply:GetMoveType()) then return end if not ply:OnGround() then return end local ForwardJump = slib.Instance('ForwardJumpComponent', ply) local tr = ForwardJump:TraceTotalJumpDistance() if tr.Hit then return end tr = ForwardJump:TraceGroundCollision() if GetConVar('sv_forward_jump_ground_detected'):GetBool() and not tr.Hit then return end if tr.Hit and math_abs(ForwardJump.startPosition.z - tr.HitPos.z) >= 20 then return end tr = ForwardJump:TraceAbsenceObstacles() if not tr.Hit or tr.Entity ~= ply then return end if ForwardJump:IsStuckPrediction() then return end local animation_type = 'root' if GetConVar('sv_forward_jump_fastmode'):GetBool() then animation_type = 'root_fast' end slib.Animator.Play('forward_jump_anim', animation_type, ply, { not_parent = true }, { ForwardJump = ForwardJump } ) end).Register()
--author Himanshu Sharma local Point = {} local buddyName = nil local markerName = nil local longitude = nil local success = false local latitude = nil local createdOn = nil function Point:new() o = {} setmetatable(o, self) self.__index = self return o end function Point:getBuddyName() return self.buddyName end function Point:setBuddyName(_buddyName) self.buddyName = _buddyName end function Point:getLatitude() return self.latitude end function Point:setLatitude(_latitude) self.latitude = _latitude end function Point:getMarkerName() return self.markerName end function Point:setMarkerName(_markerName) self.markerName = _markerName end function Point:getCreatedOn() return self.createdOn end function Point:setCreatedOn(_createdOn) self.createdOn = _createdOn end function Point:getLongitude() return self.longitude end function Point:setLongitude(_longitude) self.longitude = _longitude end function Point:getStrResponse() return self.json end function Point:setStrResponse(_json) self.json = _json end function Point:setResponseSuccess(_success) self.success = _success end function Point:getResponseSuccess() return self.success end function Point:getJSONObject() local obj ={} obj.lat = self.latitude obj.lng = self.longitude obj.marker = self.markerName return obj end return Point
-- Copyright (c) 2021 Trevor Redfern -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT return { actions = require "game.rules.npcs.actions", behaviors = require "game.rules.npcs.behaviors", selectors = require "game.rules.npcs.selectors" }
-- BLUA Scripting Project -- Part of OutlandZoning Division -- Scripted by Hellgawd -- Give full credits if posting function Kataru_OnKill(pUnit,Event) pUnit:RemoveEvents(); end function Kataru_EnterCombat(pUnit,Event) pUnit:RegisterEvent("hittest_1",1000, 0) end function hittest_1(pUnit, Event) if pUnit:GetHealthPct() < 90 then pUnit:RemoveEvents(); pUnit:FullCastSpellOnTarget(12058,pUnit:GetClosestPlayer()) pUnit:RegisterEvent("hittest_2",1000, 0) end end function hittest_2(pUnit, Event) if pUnit:GetHealthPct() < 70 then pUnit:RemoveEvents(); pUnit:CastSpell(32734) pUnit:RegisterEvent("hittest_3",1000, 0) end end function hittest_3(pUnit, Event) if pUnit:GetHealthPct() < 45 then pUnit:RemoveEvents(); pUnit:FullCastSpell(15869) pUnit:RegisterEvent("hittest_4",1000, 0) end end function hittest_4(pUnit, Event) if pUnit:GetHealthPct() < 25 then pUnit:RemoveEvents(); pUnit:FullCastSpellOnTarget(12058,pUnit:GetClosestPlayer()) end end function Kataru_Start(pUnit, Event) pUnit:RegisterEvent("hittest_1",1000, 0) end RegisterUnitEvent(18080, 1, "Kataru_Start") RegisterUnitEvent(18080, 3, "Kataru_OnKill") RegisterUnitEvent(18080, 1, "Kataru_EnterCombat")
local assets = { Asset("ANIM", "anim/star.zip") } --Needs to save/load time alive. local function kill_light(inst) inst.AnimState:PlayAnimation("disappear") inst:DoTaskInTime(0.6, function() inst.SoundEmitter:KillAllSounds() inst:Remove() end) end local function resumestar(inst, time) if inst.death then inst.death:Cancel() inst.death = nil end inst.death = inst:DoTaskInTime(time, kill_light) inst.timeleft = time end local function onsave(inst, data) data.timealive = inst:GetTimeAlive() data.init_time = inst.init_time end local function onload(inst, data) if data.timealive and data.init_time then inst.init_time = data.init_time local timeleft = (inst.init_time or 120) - data.timealive if timeleft > 0 then resumestar(inst, timeleft) else kill_light(inst) end end end local function pulse_light(inst) local s = GetSineVal(0.05, true, inst) local rad = Lerp(4, 5, s) local intentsity = Lerp(0.8, 0.7, s) local falloff = Lerp(0.8, 0.7, s) inst.Light:SetFalloff(falloff) inst.Light:SetIntensity(intentsity) inst.Light:SetRadius(rad) inst.Light:Enable(true) end local function fn(Sim) local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() inst.entity:AddSoundEmitter() anim:SetBank("star") anim:SetBuild("star") anim:PlayAnimation("appear") anim:PushAnimation("idle_loop", true) MakeInventoryPhysics(inst) inst:AddComponent("inspectable") inst:AddComponent("cooker") inst:AddComponent("propagator") inst.components.propagator.heatoutput = 15 inst.components.propagator.spreading = true inst.components.propagator:StartUpdating() inst:AddComponent("heater") inst.components.heater.heat = 180 local light = inst.entity:AddLight() light:SetColour(223/255, 208/255, 69/255) light:Enable(false) inst.SoundEmitter:PlaySound("dontstarve/common/staff_star_create") inst.SoundEmitter:PlaySound("dontstarve/common/staff_star_LP", "loop") inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL inst.init_time = 120 inst.task = inst:DoPeriodicTask(0.1, pulse_light) inst.death = inst:DoTaskInTime(inst.init_time, kill_light) inst.OnLoad = onload inst.OnSave = onsave return inst end return Prefab( "common/stafflight", fn, assets)
local keymaps = {} return keymaps
-------------------------------- -- @module MenuItemAtlasFont -- @extend MenuItemLabel -- @parent_module cc -------------------------------- -- Initializes a menu item from a string and atlas with a target/selector. -- @function [parent=#MenuItemAtlasFont] initWithString -- @param self -- @param #string value -- @param #string charMapFile -- @param #int itemWidth -- @param #int itemHeight -- @param #char startCharMap -- @param #function callback -- @return bool#bool ret (return value: bool) -------------------------------- -- js ctor -- @function [parent=#MenuItemAtlasFont] MenuItemAtlasFont -- @param self -- @return MenuItemAtlasFont#MenuItemAtlasFont self (return value: cc.MenuItemAtlasFont) return nil
--- intersection between two geometries ---@class math.intersection local M = {} local vec2 = require('math.vec2') local distance = require('math.distance_point') local function SinCos(angle) return math.sin(angle), math.cos(angle) end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param r number ---@return boolean function M.Point_Circle(p0, p1, r) local dx = p0.x - p1.x local dy = p0.y - p1.y return dx * dx + dy * dy <= r * r end --- ---@param p0 math.vec2 ---@param halfW0 number ---@param halfH0 number ---@param p1 math.vec2 ---@param halfW1 number ---@param halfH1 number ---@return boolean function M.AABB_AABB(p0, halfW0, halfH0, p1, halfW1, halfH1) return math.max(p0.x - halfW0, p1.x - halfW1) <= math.min(p0.x + halfW0, p1.x + halfW1) and math.max(p0.y - halfH0, p1.y - halfH1) <= math.min(p0.y + halfH0, p1.y + halfH1) end --- ---@param p0 math.vec2 ---@param halfW number ---@param halfH number ---@param p1 math.vec2 ---@param r number ---@return boolean function M.AABB_Circle(p0, halfW, halfH, p1, r) local dw = math.max(0, math.abs(p0.x - p1.x) - halfW) local dh = math.max(0, math.abs(p0.y - p1.y) - halfH) return r * r >= dh * dh + dw * dw end --- ---@param p0 math.vec2 ---@param r0 number ---@param p1 math.vec2 ---@param r1 number ---@return boolean function M.Circle_Circle(p0, r0, p1, r1) local d = r0 + r1 local dx = p0.x - p1.x local dy = p0.y - p1.y return dx * dx + dy * dy <= d * d end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param halfW number ---@param halfH number ---@return boolean function M.Point_AABB(p0, p1, halfW, halfH) local dx = p0.x - p1.x local dy = p0.y - p1.y return -halfW < dx and dx < halfW and -halfH < dy and dy < halfH end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param halfW number ---@param halfH number ---@param rot number ---@return boolean function M.Point_OBB(p0, p1, halfW, halfH, rot) local p = p0:getRotateAround(p1, -rot) return M.Point_AABB(p, p1, halfW, halfH) end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot number ---@return boolean function M.Point_Diamond(p0, p1, a, b, rot) local p = (p0 - p1):getRotated(-rot) local x_ = p.x / a local y_ = p.y / b local sum = x_ + y_ local dif = x_ - y_ return -1 < sum and sum < 1 and -1 < dif and dif < 1 end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot number ---@return boolean function M.Point_Ellipse(p0, p1, a, b, rot) if (a == b) then return M.Point_Circle(p0, p1, a) end local p = (p0 - p1):getRotated(-rot) local x = p.x local y = p.y return x * x / (a * a) + y * y / (b * b) < 1 end --- ---@param p math.vec2 ---@param A math.vec2 ---@param B math.vec2 ---@param C math.vec2 ---@return boolean function M.Point_Triangle(p, A, B, C) return M.Point_Triangle2(p - B, A - B, C - B) end --- ---@param P math.vec2 ---@param E0 math.vec2 ---@param E1 math.vec2 ---@return boolean function M.Point_Triangle2(P, E0, E1) local _den = E0.y * E1.x - E0.x * E1.y local s = (P.y * E1.x - P.x * E1.y) / _den local t = (P.x * E0.y - P.y * E0.x) / _den return s > 0 and t > 0 and s + t < 1 end --- ---@param p0 math.vec2 ---@param p1 math.vec2 ---@param halfDiagA math.vec2 ---@param halfDiagB math.vec2 ---@return boolean function M.Point_Parallelogram(p0, p1, halfDiagA, halfDiagB) local E0 = halfDiagA + halfDiagB local E1 = halfDiagA - halfDiagB local P = p0 - p1 + halfDiagA local _den = E0.y * E1.x - E0.x * E1.y local s = (P.y * E1.x - P.x * E1.y) / _den local t = (P.x * E0.y - P.y * E0.x) / _den return 0 < s and s < 1 and 0 < t and t < 1 end --- ---@param p0 math.vec2 ---@param halfW number ---@param halfH number ---@param rot number ---@param p1 math.vec2 ---@param r number ---@return boolean function M.OBB_Circle(p0, halfW, halfH, rot, p1, r) local tSin, tCos = SinCos(rot) local d = p0 - p1 local dw = math.max(0, math.abs(tCos * d.x + tSin * d.y) - halfW) local dh = math.max(0, math.abs(-tSin * d.x + tCos * d.y) - halfH) return r * r >= dh * dh + dw * dw end --- ---@param p0 math.vec2 ---@param halfW0 number ---@param halfH0 number ---@param rot0 number ---@param p1 math.vec2 ---@param halfW1 number ---@param halfH1 number ---@param rot1 number ---@return boolean function M.OBB_OBB(p0, halfW0, halfH0, rot0, p1, halfW1, halfH1, rot1) local tSin0, tCos0 = SinCos(rot0) local tSin1, tCos1 = SinCos(rot1) local e = { { tCos0, tSin0 }, --e00 { -tSin0, tCos0 }, --e01 { tCos1, tSin1 }, --e10 { -tSin1, tCos1 } --e11 } local projOther = { halfW0, halfH0, halfW1, halfH1 } local d = p0 - p1 for i = 1, 4 do --3311 local ii = 3 - math.floor((i - 1) / 2) * 2 local v0 = e[ii] * projOther[ii] local v1 = e[ii + 1] * projOther[ii + 1] local ex = e[i].x local ey = e[i].y local projHalfDiag = math.max( math.abs(ex * (v0.x + v1.x) + ey * (v0.y + v1.y)), math.abs(ex * (v0.x - v1.x) + ey * (v0.y - v1.y)) ) if (projHalfDiag + projOther[i] < math.abs(ex * d.x + ey * d.y)) then return false end end return true end --- ---@param p0 math.vec2 ---@param halfW0 number ---@param halfH0 number ---@param rot0 number ---@param p1 math.vec2 ---@param rot1 number ---@return boolean function M.OBB_Line(p0, halfW0, halfH0, rot0, p1, rot1) local tSin0, tCos0 = SinCos(rot0) local tSin1, tCos1 = SinCos(rot1) local e00 = vec2(tCos0, tSin0) local e01 = vec2(-tSin0, tCos0) local halfDiag0 = e00 * halfW0 + e01 * halfH0 local halfDiag1 = e00 * halfW0 - e01 * halfH0 local eProj = vec2(-tSin1, tCos1) local halfProj = math.max( math.abs(eProj:dot(halfDiag0)), math.abs(eProj:dot(halfDiag1))) local d = distance.line(p0, p1, vec2(tCos1, tSin1)) return d <= halfProj end --- ---@param p math.vec2 ---@param halfW number ---@param halfH number ---@param rot number ---@param A math.vec2 ---@param B math.vec2 ---@param C math.vec2 ---@return boolean function M.OBB_Triangle(p, halfW, halfH, rot, A, B, C) local tSin, tCos = SinCos(rot) local hw = vec2(tCos * halfW, tSin * halfW) local hh = vec2(-tSin * halfH, tCos * halfH) local v0 = p + hw + hh local v1 = p + hw - hh local v2 = p - hw - hh local v3 = p - hw + hh return M.Triangle_Triangle(A, B, C, v0, v1, v2) or M.Triangle_Triangle(A, B, C, v0, v3, v2) end --- ---@param p0 math.vec2 ---@param halfW number ---@param halfH number ---@param rot0 number ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot1 number ---@return boolean function M.OBB_Diamond(p0, halfW, halfH, rot0, p1, a, b, rot1) local tSin0, tCos0 = SinCos(rot0) local tSin1, tCos1 = SinCos(rot1) local hw = vec2(tCos0 * halfW, tSin0 * halfW) local hh = vec2(-tSin0 * halfH, tCos0 * halfH) return M.Parallelogram_Parallelogram( p0, hw + hh, hw - hh, p1, vec2(tCos1 * a, tSin1 * a), vec2(-tSin1 * b, tCos1 * b)) end --- ---@param p0 math.vec2 ---@param halfW number ---@param halfH number ---@param rot0 number ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot1 number ---@return boolean function M.OBB_Ellipse(p0, halfW, halfH, rot0, p1, a, b, rot1) if (a == b) then return M.OBB_Circle(p0, halfW, halfH, rot0, p1, a) end local tSin0, tCos0 = SinCos(rot0) local tSin1, tCos1 = SinCos(rot1) local e00 = vec2(tCos0, tSin0) local e01 = vec2(-tSin0, tCos0) local e11 = vec2(-tSin1, tCos1) local f = e11 * (a / b - 1) local p0_ = p0 + distance.line_signed(p0, p1, e11) * f local tmp = e00 * halfW + p0 local vDiag0 = tmp + e01 * halfH local vDiag1 = tmp - e01 * halfH local vDiag0_ = vDiag0 + distance.line_signed(vDiag0, p1, e11) * f local vDiag1_ = vDiag1 + distance.line_signed(vDiag1, p1, e11) * f local halfDiag0_ = vDiag0_ - p0_ local halfDiag1_ = vDiag1_ - p0_ local d = distance.parallelogram(p1, p0_, halfDiag0_, halfDiag1_) return d <= a end --- ---@param p0 math.vec2 ---@param r number ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot number ---@return boolean function M.Circle_Ellipse(p0, r, p1, a, b, rot) return distance.ellipse(p0, p1, a, b, rot) <= r end --- ---@param p0 math.vec2 ---@param r number ---@param p1 math.vec2 ---@param a number ---@param b number ---@param rot number ---@return boolean function M.Circle_Diamond(p0, r, p1, a, b, rot) return distance.diamond(p0, p1, a, b, rot) <= r end --- ---@param p math.vec2 ---@param r number ---@param A math.vec2 ---@param B math.vec2 ---@param C math.vec2 ---@return boolean function M.Circle_Triangle(p, r, A, B, C) return distance.triangle(p, A, B, C) <= r end --- ---@param p0 math.vec2 ---@param a0 number ---@param b0 number ---@param rot0 number ---@param p1 math.vec2 ---@param a1 number ---@param b1 number ---@param rot1 number ---@return boolean function M.Ellipse_Ellipse(p0, a0, b0, rot0, p1, a1, b1, rot1) if (a0 == b0) then return M.Circle_Ellipse(p0, a0, p1, a1, b1, rot1) end if (a1 == b1) then return M.Circle_Ellipse(p1, a1, p0, a0, b0, rot0) end local s, c = SinCos(rot1 - rot0) local c2 = c * c local s2 = s * s local sc = s * c local a_ = 1 / (a1 * a1) local b_ = 1 / (b1 * b1) local m00 = (a_ * c2 + b_ * s2) * (a0 * a0) local m11 = (b_ * c2 + a_ * s2) * (b0 * b0) local m01 = (a_ - b_) * sc * (a0 * b0) local sum = m00 + m11 local tmp = m00 - m11 local dif = math.sqrt(tmp * tmp + 4 * m01 * m01) local tanv = 2 * m01 / (dif + m00 - m11) local s0, c0 = SinCos(-rot0) local d = p1 - p0 local d_ = vec2(d.x * c0 - d.y * s0, d.y * c0 + d.x * s0) d_.x = d_.x / a0 d_.y = d_.y / b0 return distance.ellipse( vec2.zero(), d_, math.sqrt(2 / (sum + dif)), math.sqrt(2 / (sum - dif)), math.atan(tanv)) <= 1 end --- ---@param p0 math.vec2 ---@param a0 number ---@param b0 number ---@param rot0 number ---@param p1 math.vec2 ---@param a1 number ---@param b1 number ---@param rot1 number ---@return boolean function M.Ellipse_Diamond(p0, a0, b0, rot0, p1, a1, b1, rot1) if (a0 == b0) then return M.Circle_Diamond(p0, a0, p1, a1, b1, rot1) end local s, c = SinCos(rot1 - rot0) local fac = a0 / b0 local p = (p1 - p0):getRotated(-rot0) p.y = p.y * fac return distance.parallelogram( vec2.zero(), p, vec2(c * a1, s * a1 * fac), vec2(-s * b1, c * b1 * fac)) <= a0 end --- ---@param p math.vec2 ---@param a number ---@param b number ---@param rot number ---@param A math.vec2 ---@param B math.vec2 ---@param C math.vec2 ---@return boolean function M.Ellipse_Triangle(p, a, b, rot, A, B, C) if (a == b) then return M.Circle_Triangle(p, a, A, B, C) end local s, c = SinCos(-rot) local fac = a / b local PA = A - p local PB = B - p local PC = C - p local A_ = vec2(PA.x * c - PA.y * s, (PA.y * c + PA.x * s) * fac) local B_ = vec2(PB.x * c - PB.y * s, (PB.y * c + PB.x * s) * fac) local C_ = vec2(PC.x * c - PC.y * s, (PC.y * c + PC.x * s) * fac) return M.Point_Triangle(vec2.zero(), A_, B_, C_) end --- ---@param A0 math.vec2 ---@param B0 math.vec2 ---@param A1 math.vec2 ---@param B1 math.vec2 ---@return boolean function M.Segment_Segment(A0, B0, A1, B1) local A0B0 = B0 - A0 local A0A1 = A1 - A0 local A0B1 = B1 - A0 local c1 = A0B0:cross(A0A1) local c2 = A0B0:cross(A0B1) if (c1 == 0 and c2 == 0) then if (A0B0:lengthSquared() == 0) then return false end local t1 = (A0B0.x == 0) and A0A1.y / A0B0.y or A0A1.x / A0B0.x local t2 = (A0B0.x == 0) and A0B1.y / A0B0.y or A0B1.x / A0B0.x return (0 < t1 and t1 < 1) or (0 < t2 and t2 < 1) or (t1 < 0 and 1 < t2) or (t2 < 0 and 1 < t1) end if (c1 * c2 > 0) then return false end local A1B1 = B1 - A1 local c3 = -A1B1:cross(A0A1) local c4 = A1B1:cross(B0 - A1) return c3 * c4 < 0 end --- ---@param A0 math.vec2 ---@param B0 math.vec2 ---@param C0 math.vec2 ---@param A1 math.vec2 ---@param B1 math.vec2 ---@param C1 math.vec2 ---@return boolean function M.Triangle_Triangle(A0, B0, C0, A1, B1, C1) local E00 = A0 - B0 local E01 = C0 - B0 for _, p in ipairs { A1, B1, C1 } do if (M.Point_Triangle(p - B0, E00, E01)) then return true end end local E10 = A1 - B1 local E11 = C1 - B1 for _, p in ipairs { A0, B0, C0 } do if (M.Point_Triangle(p - B1, E10, E11)) then return true end end for _, p0 in ipairs { A0, C0 } do for _, p1 in ipairs { A1, C1 } do if (M.Segment_Segment(B0, p0, B1, p1)) then return true end end end return false end --- ---@param p0 math.vec2 ---@param halfDiagA0 math.vec2 ---@param halfDiagB0 math.vec2 ---@param p1 math.vec2 ---@param halfDiagA1 math.vec2 ---@param halfDiagB1 math.vec2 ---@return boolean function M.Parallelogram_Parallelogram(p0, halfDiagA0, halfDiagB0, p1, halfDiagA1, halfDiagB1) local d01 = p1 - p0 for _, e in ipairs { (halfDiagA0 + halfDiagB0), (halfDiagA0 - halfDiagB0), (halfDiagA1 + halfDiagB1), (halfDiagA1 - halfDiagB1) } do local ep = e:getPerp():getNormalized() local proj0 = math.max(math.abs(ep:dot(halfDiagA0)), math.abs(ep:dot(halfDiagB0))) local proj1 = math.max(math.abs(ep:dot(halfDiagA1)), math.abs(ep:dot(halfDiagB1))) if (proj0 + proj1 < math.abs(ep:dot(d01))) then return false end end return true end --- ---@param p0 math.vec2 ---@param a0 number ---@param b0 number ---@param rot0 number ---@param p1 math.vec2 ---@param a1 number ---@param b1 number ---@param rot1 number ---@return boolean function M.Diamond_Diamond(p0, a0, b0, rot0, p1, a1, b1, rot1) local tSin0, tCos0 = SinCos(rot0) local tSin1, tCos1 = SinCos(rot1) return M.Parallelogram_Parallelogram( p0, vec2(tCos0 * a0, tSin0 * a0), vec2(-tSin0 * b0, tCos0 * b0), p1, vec2(tCos1 * a1, tSin1 * a1), vec2(-tSin1 * b1, tCos1 * b1)) end --- ---@param p math.vec2 ---@param a number ---@param b number ---@param rot number ---@param A math.vec2 ---@param B math.vec2 ---@param C math.vec2 ---@return boolean function M.Diamond_Triangle(p, a, b, rot, A, B, C) local tSin, tCos = SinCos(rot) local hd0 = vec2(tCos * a, tSin * a) local hd1 = vec2(-tSin * b, tCos * b) local v0 = p + hd0 local v1 = p + hd1 local v2 = p - hd0 local v3 = p - hd1 return M.Triangle_Triangle(A, B, C, v0, v1, v2) or M.Triangle_Triangle(A, B, C, v0, v3, v2) end --- ---@param p0 math.vec2 ---@param r number ---@param p1 math.vec2 ---@param rot number ---@return boolean function M.Line_Circle(p0, r, p1, rot) local tSin0, tCos0 = SinCos(rot) return distance.line(p0, p1, tCos0, tSin0) <= r end return M
local M = setmetatable({}, { __index = TimedGameState }) M.__index = M local Player = require "src.actors.Player" function M.new(gamestate, scene, graphics) if gamestate == nil then error ('gamestate must not be nil') elseif scene == nil or scene == '' then error ('scene must not be nil or empty') elseif graphics == nil then error ('graphics must not be nil') end local self = setmetatable(TimedGameState.new(gamestate, scene), M) self.background = graphics.bg self.bgMusicName = "theme" self.world = lp.newWorld(0, 0, true) self.player = nil self.cameras = { } self:pushCamera(Camera.new()) self.contactListeners = {} self.proximityListeners = {} self.bounds = {} self.warps = {} self.proximityObjects = {} self.staticObjects = {} self.renderBounds = false self.renderWarps = false self.isPhysicalGameState = true self.actors = {} self.colors = { night = { r = 0.5, g = 0.5, b = 0.6 }, day = { r = 1, g = 1, b = 1 } } self.sunriseHourStart = 8 self.sunriseHourEnd = 9 self.sunsetHourStart = 19 self.sunsetHourEnd = 20 self.interactProximity = 18 -- hook up warps and what not self:addContactListeners() self:addProximityListeners() -- hook up actor collisions local contactFilter = function(a,b) return a.callback ~= nil or b.callback ~= nil end local contactOnStart = function(a,b) if a.callback ~= nil then a.callback(gamestate, a, "collision", b) end if b.callback ~= nil then b.callback(gamestate, b, "collision", a) end end local contactOnEnd = function(a,b) if a.callback ~= nil then a.callback(gamestate, a, "end collision", b) end if b.callback ~= nil then b.callback(gamestate, b, "end collision", a) end end self:addContactListener(contactFilter, contactOnStart, contactOnEnd) local physBeginContact = function (a, b, coll) if a == nil or b == nil then return end local aUserData = a:getUserData() local bUserData = b:getUserData() if aUserData ~= nil and bUserData ~= nil then self:physContactBetweenStart(aUserData, bUserData) end end local physEndContact = function (a, b, coll) if a == nil or b == nil then return end local aUserData = a:getUserData() local bUserData = b:getUserData() if aUserData ~= nil and bUserData ~= nil then self:physContactBetweenEnd(aUserData, bUserData) end end local physPreSolve = function (a, b, coll) end local physPostSolve = function (a, b, coll, normalimpulse, tangentimpulse) end self.world:setCallbacks(physBeginContact, physEndContact, physPreSolve, physPostSolve) return self end function M:keypressed( key, scancode, isrepeat ) end function M:keyreleased( key, scancode ) end function M:getColorRightNow() local ticksPerHour = 60 * 60 local ticksOffset = 8 * ticksPerHour local timeOfDay = (self.gamestate.time + ticksOffset) % (ticksPerHour * 24) if timeOfDay < self.sunriseHourStart * ticksPerHour then return self.colors.night elseif timeOfDay < self.sunriseHourEnd * ticksPerHour then local sunriseDuration = self.sunriseHourEnd - self.sunriseHourStart return interpolateValues(self.colors.night, self.colors.day, (timeOfDay - self.sunriseHourStart * ticksPerHour) / (sunriseDuration * ticksPerHour)) elseif timeOfDay < self.sunsetHourStart * ticksPerHour then return self.colors.day elseif timeOfDay < self.sunsetHourEnd * ticksPerHour then local sunsetDuration = self.sunsetHourEnd - self.sunsetHourStart return interpolateValues(self.colors.day, self.colors.night, (timeOfDay - self.sunsetHourStart * ticksPerHour) / (sunsetDuration * ticksPerHour)) else return self.colors.night end end function M:addContactListener(filterFn, startFn, endFn) table.insert(self.contactListeners, { filter = filterFn, onStart = startFn, onEnd = endFn }) end function M:onContactFireEvent(filterFn, contactEvent) self:addContactListener( function (a, b) return a.activated ~= true and filterFn(a, b) end, function (a, b) self.gamestate.fire(contactEvent, true) a.activated = true b.activated = true end, function (a, b) end ) end function M:addContactListeners() self:addContactListener( function (a, b) return a.activated ~= true and a.type == 'warp' and b.type == 'player' end, function (a, b) local path = a.path local door = a.door if path == nil then path = b.path door = b.door end if door ~= nil then door:animateAndWarp(self.gamestate, path) else self.gamestate.fire(WarpEvent.new(path), true) end a.activated = true b.activated = true end, function (a, b) end ) self:onContactFireEvent( function (a, b) return a.type == 'sign' and b.type == 'player' end ) end function M:getActiveObjects() return lume.concat(self.actors, { self.player }, self.proximityObjects, lume.filter(self.staticObjects, { isInteractable = true })) end function M:addProximityListener(proximity, filterFn, onEnterFn, onLeaveFn) table.insert(self.proximityListeners, { proximity = proximity, filter = filterFn, onEnter = onEnterFn, onLeave = onLeaveFn }) end function M:addProximityListeners() self:addProximityListener( self.interactProximity, function (a, b) return a.isInteractable and b.type == 'player' end, function (a, b) local interactable = a local player = b if not interactable.isInteractable then interactable = b player = a end if interactable.hasInteractedWith then return end interactable.hasInteractedWith = true interactable.canInteractWith = true if lume.find(player.interactWith, interactable) == nil then table.insert(player.interactWith, interactable) end end, function (a, b) if a.isInteractable then if b.interactWith ~= nil then lume.remove(b.interactWith, a) end a.hasInteractedWith = false a.canInteractWith = false else if b.interactWith ~= nil then lume.remove(b.interactWith, a) end b.hasInteractedWith = false b.canInteractWith = false end end ) -- self:addProximityListener( -- 10, -- function (a, b) -- return a.type == 'sign' and b.type == 'player' -- end, -- function (a, b) -- local sign = a -- if sign.type ~= 'sign' then -- sign = b -- end -- if sign ~= nil then -- sign.inProximity = true -- end -- end, -- function (a, b) -- if a.type == 'sign' then -- a.inProximity = false -- else -- b.inProximity = false -- end -- end -- ) -- self:onProximityFireEvent( -- function (a, b) return a.type == 'sign' and b.type == 'player' end, -- ) end function M:addExteriorWorldBounds(paddingx, paddingy) if paddingx == nil then paddingx = 2 end if paddingy == nil then paddingy = paddingx end table.insert( self.bounds, { -- Top x = 0, y = -paddingy, w = self:getWidth(), h = paddingy * 2 } ) table.insert( self.bounds, { -- Bottom x = 0, y = self:getHeight() - paddingy * 2, w = self:getWidth(), h = paddingy * 2 } ) table.insert( self.bounds, { -- Left x = -paddingx, y = -paddingy * 2, w = paddingx * 2, h = self:getHeight() + paddingy * 2 } ) table.insert( self.bounds, { -- Right x = self:getWidth() - paddingx, y = -paddingy * 2, w = paddingx * 2, h = self:getHeight() + paddingy * 2 } ) end function M:addWorldBounds(bounds) for k,v in pairs(bounds) do table.insert( self.bounds, v ) end end function M:getWidth() return self.background:getWidth() / 8 end function M:getHeight() return self.background:getHeight() / 8 end function M:drawInWorldView() if self:currentCamera() ~= nil then self:currentCamera():draw() end local ambientColor = self.gamestate.saveData.globalAmbientColor if ambientColor == nil then ambientColor = self:getColorRightNow() end lg.setColor(ambientColor.r, ambientColor.g, ambientColor.b) lg.draw(self.background, 0, 0, 0, 1 / 8, 1 / 8) local drawList = function(list) if list ~= nil then for _, e in pairs(list) do e:draw() end end end drawList(self.doors) drawList(self.animatedObjects) drawList(self.staticObjects) drawList(self.actors) self.player:draw() if self.renderBounds then lg.setColor(1, 0, 0) for k, bound in pairs(self.bounds) do lg.rectangle('line', bound.x, bound.y, bound.w, bound.h) end lg.setColor(1, 1, 1) end if self.renderWarps then lg.setColor(0, 1, 0) for k, warp in pairs(self.warps) do lg.rectangle('line', warp.x, warp.y, warp.w, warp.h) end lg.setColor(1, 1, 1) end lg.setColor(1, 1, 1) end function M:physContactBetweenStart(a, b) for k,listener in pairs(self.contactListeners) do if listener.filter(a, b) or listener.filter(b, a) then listener.onStart(a, b) end end end function M:physContactBetweenEnd(a, b) for k,listener in pairs(self.contactListeners) do if listener.filter(a, b) or listener.filter(b, a) then listener.onEnd(a, b) end end end function M:draw() lg.push() self:drawInWorldView() lg.pop() -- local x = self.player.body:getX() -- local y = self.player.body:getY() -- local currentVx, currentVy = self.player.body:getLinearVelocity() -- lg.print("You are at " .. x .. ", " .. y .. " in " .. self.scene, 0, 0) -- lg.print("Camera is at " .. self:currentCamera().x .. ", " .. self:currentCamera().y, 0, 16) -- lg.print("Player's velocity is " .. currentVx .. ", " .. currentVy, 0, 32) -- lg.print("Current time is " .. self.gamestate.time, 0, 48) TimedGameState.draw(self) end function M:realTimeUpdate(dt) self.world:update(dt) end function M:update(dt) TimedGameState.update(self) self:currentCamera():update(dt) if self.topmost then self.player:update(dt) end self:updateProximityListeners() local updateList = function(list) if list ~= nil then for _, e in pairs(list) do e:update(dt) end end end updateList(self.animatedObjects) updateList(self.actors) updateList(self.doors) end function M:updateProximityListeners() local withinProximity = function(r, a, b) local ax = a.x local ay = a.y local bx = b.x local by = b.y if ax == nil then ax = a:getX() ay = a:getY() end if bx == nil then bx = b:getX() by = b:getY() end local dx = bx - ax local dy = by - ay local d2 = dx * dx + dy * dy local r2 = r * r return d2 < r2 end local allObjects = self:getActiveObjects() for ia,a in pairs(allObjects) do for ib,b in pairs(allObjects) do if ia ~= ib and a ~= nil and b ~= nil then for _,li in pairs(self.proximityListeners) do if li.filter(a, b) or li.filter(b, a) then if withinProximity(li.proximity, a, b) then li.onEnter(a, b) else li.onLeave(a, b) end end end end end end end function M:load() TimedGameState.load(self) self:setupWorldBounds() self:setupWarps() self.player = Player.new(self.world, 'player', self.gamestate, 0, 0, 4, 4, self.gamestate.animations.actors.player) self:pushCamera(Camera.new(self.gamestate, self.player.body)) end function M:switchTo(x, y) TimedGameState.switchTo(self, x, y) self.player:setPosition(x, y, 0, 0) for _,warp in pairs(self.warps) do warp.activated = false end self.player.activated = false end function M:activated() if self.bgMusicName ~= nil then self.gamestate.audio:play(self.bgMusicName) else self.gamestate.audio:fadeAllOut() end end function M:save() end function M:currentCamera() return lume.last(self.cameras) end function M:pushCamera(camera) if camera ~= nil then table.insert(self.cameras, camera) else error('camera must not be nil') end end function M:popCamera() table.remove(self.cameras) end function M:replaceCamera(camera) if camera ~= nil then self.cameras[-1] = camera else error('camera must not be nil') end end function M:removeCamera(camera) for ix, c in pairs(self.cameras) do if c == camera then self.cameras[ix] = nil break end end end function M:setupWorldBounds() for k, bound in pairs(self.bounds) do bound.type = 'world-bound' local body = lp.newBody(self.world, bound.x + bound.w / 2, bound.y + bound.h / 2, "static") local shape = lp.newRectangleShape(bound.w, bound.h) local fixture = lp.newFixture(body, shape) fixture:setUserData(bound) end end function M:setupWarps() for k, warp in pairs(self.warps) do warp.type = 'warp' warp.body = lp.newBody(self.world, warp.x + warp.w / 2, warp.y + warp.h / 2, "static") warp.shape = lp.newRectangleShape(warp.w, warp.h) warp.fixture = lp.newFixture(warp.body, warp.shape) warp.fixture:setUserData(warp) if warp.door ~= nil then warp.door.path = warp.path end end end function M:addActor(name, actor) self.actors[name] = actor end function M:addStaticObject(name, staticObject) self.staticObjects[name] = staticObject end function M:getActor(name) if name == "player" then return self.player else return self.actors[name] end end function M:removeActor(name) local oldActor = self.actors[name] if oldActor ~= nil then self.actors[name] = nil oldActor:onRemove(self) end return oldActor ~= nil end function M:getStaticObject(name) return self.staticObjects[name] end function M:removeStaticObject(name) local oldObj = self.staticObjects[name] if oldObj ~= nil then self.staticObjects[name] = nil oldObj:onRemove(self) end return oldObj ~= nil end function M:addStaticObjects(list) for k,v in pairs(list) do table.insert( self.staticObjects, v ) end end return M
--local transport_drone = require("script/transport_drone") --local depot_common = require("script/depot_common") local informatron = require("prototypes/informatron/informatron_script") local interface = { -- get_drone_count = function() -- return transport_drone.get_drone_count() -- end, informatron_menu = function(data) return informatron.menu_list(data.player_index) end, informatron_page_content = function(data) return informatron.page_content(data.page_name, data.player_index, data.element) end } if not remote.interfaces["colonists"] then remote.add_interface("colonists", interface) end
local ui, uiu, uie = require("ui").quick() local fs = require("fs") local utils = require("utils") local threader = require("threader") local scener = require("scener") local config = require("config") local sharp = require("sharp") local native = require("native") local shaper = require("shaper") local alert = require("alert") local scene = { name = "Installer" } local root = uie.group({ uie.new({ cacheable = false, update = function(self, dt) dt = math.min(0.1, dt) local tf = 0.5 if scene.shapeNext ~= nil then -- Catch up to next shape. if scene.progress then scene.time = scene.progress * 0.5 scene.progress = false end tf = 2 end scene.timeReal = scene.timeReal + dt if scene.shapeNext == nil and scene.progressNext ~= nil then if scene.progress and scene.progressNext then -- progress -> progress on same shape scene.progress = scene.progressNext scene.progressNext = nil scene.time = scene.time + dt * tf elseif scene.progressNext then -- ??? -> progress on possibly new shape if scene.progress then scene.time = scene.progress * 0.5 end local canSwap = scene.time <= 0.5 scene.time = scene.time + dt * tf * 2 if canSwap and scene.time * 2 >= scene.progressNext then scene.progress = scene.progressNext scene.progressNext = nil end else -- ??? -> indeterminate progress if scene.progress then scene.time = scene.progress * 0.5 end scene.progress = scene.progressNext scene.progressNext = nil scene.time = scene.time + dt * tf end else -- General indeterminate progress time update. scene.time = scene.time + dt * tf end if scene.time >= 1 then scene.time = scene.time - 1 if scene.shapeNext ~= nil then scene.shape = scene.shapeNext scene.shapeNext = nil end end self:repaint() end, draw = function(self) uiu.setColor(1, 1, 1, 1) local sx = self.screenX local sy = self.screenY local w = self.width local h = self.height local fw = love.graphics.getWidth() local fh = love.graphics.getHeight() local cx = sx + w * 0.5 local cy = sy + h * 0.5 local cmx = cx - (ui.mouseX - fw * 0.5) * 0.015 * config.parallax local cmy = cy - (ui.mouseY - fh * 0.5) * 0.015 * config.parallax local shape = scene.shape if shape then local progA = 0 local progB = scene.progress if progB then progB = progB else local t = scene.time if t < 0.5 then progA = 0 progB = t * 4 else progA = t * 4 - 2 progB = 1 end end shape:draw(cmx - shape.width * 0.5, cmy - shape.height * 0.5, progA, progB) else local radius = 32 local thickness = radius * 0.25 love.graphics.setLineWidth(thickness) radius = radius - thickness local polygon = {} local edges = 128 local progA = 0 local progB = scene.progress if progB then progB = progB * edges else local t = scene.time local offs = edges * t * 2 if t < 0.5 then progA = offs + 0 progB = offs + edges * t * 2 else progA = offs + edges * (t - 0.5) * 2 progB = offs + edges end end local progAE = math.floor(progA) local progBE = math.ceil(progB - 1) if progBE - progAE >= 1 then local i = 1 for edge = progAE, progBE do local f = edge if edge == progAE then f = progA elseif edge == progBE then f = progB end f = (1 - f / (edges) + 0.5) * math.pi * 2 local x = cmx + math.sin(f) * radius local y = cmy + math.cos(f) * radius polygon[i + 0] = x polygon[i + 1] = y i = i + 2 end love.graphics.line(polygon) end end uiu.resetColor() end, drawDebug = function(self) local sx = self.screenX local sy = self.screenY local w = self.width local h = self.height local fw = love.graphics.getWidth() local fh = love.graphics.getHeight() local cx = sx + w * 0.5 local cy = sy + h * 0.5 local cmx = cx - (ui.mouseX - fw * 0.5) * 0.015 * config.parallax local cmy = cy - (ui.mouseY - fh * 0.5) * 0.015 * config.parallax local shape = scene.shape if shape then shape:drawDebug(cmx - shape.width * 0.5, cmy - shape.height * 0.5) end end }):with(uiu.fillWidth):with(uiu.fillHeight(0.5 - 180)):as("canvas"), uie.group({ uie.paneled.column({ uie.scrollbox( uie.column({ uie.label("installer.lua machine broke, please fix."), }):with({ clip = false, locked = true }):hook({ layoutLateLazy = function(orig, self) self:layoutLate() end, layoutLate = function(orig, self) orig(self) if self.locked and self.height > self.parent.height then self.y = self.parent.height - self.height self.realY = self.parent.height - self.height end end }):with(uiu.fillWidth):as("loglist") ):hook({ onScroll = function(orig, self, mx, my, dx, dy, raw, ...) local child = self.children[1] local y1 = child.y orig(self, mx, my, dx, dy, raw, ...) local y2 = child.y if my and (not raw or dy > 0 or self.children[1].locked) then self.children[1].locked = (raw and dy > 0 or dy < 0) and y1 == y2 end end }):with(uiu.fillWidth):with(uiu.fillHeight(true)), uie.group({}):with(uiu.fillWidth):with(uiu.bottombound):as("actionsholder") }):with(uiu.fill) }):with({ style = { padding = 8 } }):with(uiu.bottombound):with(uiu.fillWidth):with(uiu.fillHeight(0.5 + 120)) }):with({ cacheable = false, _fullroot = true }) scene.root = root scene.canvas = root:findChild("canvas") scene.loglist = root:findChild("loglist") scene.actionsholder = root:findChild("actionsholder") scene.shapes = {} for i, file in ipairs(love.filesystem.getDirectoryItems("data/installshapes")) do local name = file:match("^(.+)%.svg$") if name then scene.shapes[name] = shaper.load("data/installshapes/" .. name .. ".svg") end end scene.shape = nil scene.shapeNext = nil scene.timeReal = 0 scene.time = 0 scene.timeDraw = 0 scene.progress = 0 scene.progressNext = 0 scene.progressDraw = 0 function scene.update(status, progress, shape, replace) if status ~= nil then status = status or "" local loglist = scene.loglist local last = scene.loglast if not replace or not last then if loglist.children[300] then table.remove(loglist.children, 1) end last = uie.label(status):with({ wrap = true }):with(uiu.fillWidth) loglist:addChild(last) scene.loglast = last else last.text = status end end if progress ~= nil then native.setProgress(shape == "error" and "error" or not progress and "indeterminate" or "normal", progress or 0) scene.progressNext = progress end if shape ~= nil then if shape == "" then scene.shapeNext = false else scene.shapeNext = scene.shapes[shape] or scene.shape end if scene.shapeNext == scene.shape then scene.shapeNext = nil end end end function scene.done(buttons) native.flashWindow() local row = uie.row({}):with({ clip = false }):with(uiu.fillWidth) local listcount = #buttons for i = 1, #buttons do local btn = buttons[i] btn = uie.button(table.unpack(btn)) if listcount == 1 then btn = btn:with(uiu.fillWidth) else btn = btn:with(uiu.fillWidth(1 / listcount + 4)):with(uiu.at((i == 1 and 0 or 4) + (i - 1) / listcount, 0)) end row:addChild(btn) end scene.actionsholder:addChild(row:with(utils.important(24))) scene.actionsrow = row end function scene.sharpTask(id, ...) local args = {...} return threader.routine(function() local task = sharp[id](table.unpack(args)):result() local batch local last repeat batch = sharp.pollWaitBatch(task):result() local all = batch[3] for i = 1, #all do local update = all[i] if update ~= nil then if not last or last[1] ~= update[1] or last[2] ~= update[2] or last[3] ~= update[3] or last[4] ~= update[4] then last = update scene.update(update[1], update[2], update[3], update[4]) end else print("installer.sharpTask encountered nil on poll", task) end end until batch[1] ~= "running" and batch[2] == 0 local status = sharp.free(task):result() if status == "error" then scene.update(last and last[1], 1, "error", true) scene.done({ { "Open log", function() alert({ body = [[ You can ask for help in the Celeste Discord server. An invite can be found on the Everest website. Please drag and drop your files into the #modding_help channel. Before uploading, check your logs for sensitive info (f.e. your username).]], buttons = { { "Open log folder", function(container) utils.openFile(fs.getStorageDir()) end }, { "Open Everest Website", function(container) utils.openURL("https://everestapi.github.io/") container:close("website") end }, { "Close" }, } }) end }, { "OK", function() scener.pop(1) end } }) return false end return last[1] end) end function scene.enter() scene.shape = nil scene.shapeNext = nil scene.timeReal = 0 scene.time = 0 scene.timeDraw = 0 scene.progress = 0 scene.progressNext = 0 scene.progressDraw = 0 scene.loglist.children = {} scene.loglist.y = 0 scene.loglist.realY = 0 scene.loglist.locked = true scene.loglist:reflow() scene.loglast = nil if scene.actionsrow then scene.actionsrow:removeSelf() scene.actionsrow = nil end scene.update(nil, false, "") scener.lock() end function scene.leave() scener.unlock() native.setProgress("none", 0) if scene.onLeave then scene.onLeave() end scene.onLeave = nil end return scene
local M = {} function M.read_file(file) local lines = {} for line in io.lines(file) do lines[#lines + 1] = line end return lines end return M
local ffi = require 'ffi' local C = ffi.C ffi.cdef[[ typedef struct _ev_graphics ev_graphics; ev_graphics* ev_graphics_create(void); void ev_graphics_destroy(ev_graphics*); void ev_graphics_clear(ev_graphics*, float, float, float, float); ]] local _M = {} _M.__index = _M function _M:clear(r, g, b, a) C.ev_graphics_clear(self._ev_graphics, r, g, b, a) end function _M.create() local g = {} setmetatable(g, _M) g._ev_graphics = C.ev_graphics_create() return g end return _M
--example functions to be tested list = {} function ascending(a, ...) local function lesser(a, b) return a < b end return sorted(lesser, a, ...) end list.ascending = ascending function descending(a, ...) local function greater(a, b) return a > b end return sorted(greater, a, ...) end list.descending = descending function sorted(before, a, ...) if #{...} == 0 then return a end local function insert(a, b, ...) if b == nil then return a elseif before(b, a) then return b, insert(a, ...) else return a, b, ... end end return insert(a, sorted(before, ...)) end list.sorted = sorted function first(a, ...) return a end list.first = first return list
GM.OCRPPerks = {} GM.OCRPPerks[1] = {} GM.OCRPPerks[1].Name = "Heavy Money" GM.OCRPPerks[1].Desc = "Have online players with $5,000,000 collectively." GM.OCRPPerks[1].Reward = "Ability to carry 5 more pounds." GM.OCRPPerks[1].Check = function(orgid) local totalmoney = 0 for _,member in pairs(OCRP_Orgs[orgid].Members) do local ply = player.GetBySteamID(member.SteamID) if ply and ply:IsValid() then totalmoney = totalmoney + ply:GetMoney(BANK) + ply:GetMoney(WALLET) end end return totalmoney >= 5000000 end GM.OCRPPerks[1].Function = function(ply) ply.OCRPData["Inventory"].WeightData.Max = ply.OCRPData["Inventory"].WeightData.Max + 5 for k,v in pairs(ply.OCRPData["Inventory"]) do if k != "WeightData" then ply:UpdateItem(k) -- update random item to send weight data return end end end GM.OCRPPerks[2] = {} GM.OCRPPerks[2].Name = "Skilled Individuals" GM.OCRPPerks[2].Desc = "Have 3 different online people at max level for every skill." GM.OCRPPerks[2].Reward = "1 extra skill point." GM.OCRPPerks[2].Check = function(orgid) local skillsAtMax = {} for _,member in pairs(OCRP_Orgs[orgid].Members) do local ply = player.GetBySteamID(member.SteamID) if ply and ply:IsValid() then for skill,skillTable in pairs(GAMEMODE.OCRP_Skills) do local max = skillTable.MaxLevel if ply:HasSkill(skill, max) then skillsAtMax[skill] = skillsAtMax[skill] or 0 skillsAtMax[skill] = skillsAtMax[skill] + 1 end end end end local threeinall = true for skill,_ in pairs(GAMEMODE.OCRP_Skills) do if (skillsAtMax[skill] or 0) < 3 then threeinall = false end end return threeinall end GM.OCRPPerks[2].Function = function(ply) ply:SetMaxPoints(ply:GetMaxPoints() + 1) ply:UpdateAllSkills() end GM.OCRPPerks[3] = {} GM.OCRPPerks[3].Name = "Diverse Workforce" GM.OCRPPerks[3].Desc = "Have 8 people working 8 different jobs at once." GM.OCRPPerks[3].Reward = "$25 more on every paycheck." GM.OCRPPerks[3].Check = function(orgid) local jobs = {2,3,4,5,6,7,8,9} local jobsDone = {} for _,member in pairs(OCRP_Orgs[orgid].Members) do local ply = player.GetBySteamID(member.SteamID) if ply and ply:IsValid() and ply:Team() != 1 then jobs[ply:Team()] = true end end local allJobs = true for k,v in pairs(jobs) do if not jobsDone[v] then allJobs = false end end return allJobs end GM.OCRPPerks[3].Function = function(ply) ply.OrgExtraMoney = "25" end GM.OCRPPerks[4] = {} GM.OCRPPerks[4].Name = "Drug Cartel" GM.OCRPPerks[4].Desc = "Have 125 pots of weed planted at once." GM.OCRPPerks[4].Reward = "1 extra max weed plant at a time." GM.OCRPPerks[4].Check = function(orgid) local pots = 0 for _,pot in pairs(ents.FindByClass("item_base")) do if pot.Drug then local ply = Entity(pot:GetNWInt("Owner")) if ply and ply:IsValid() and ply:GetOrg() == orgid then pots = pots + 1 end end end return pots >= 125 end GM.OCRPPerks[4].Function = function(ply) ply.MaxDrugs = ply.MaxDrugs or 5 ply.MaxDrugs = ply.MaxDrugs + 1 end GM.OCRPPerks[5] = {} GM.OCRPPerks[5].Name = "No Lives" GM.OCRPPerks[5].Desc = "Have 1 year of collective playtime." GM.OCRPPerks[5].Reward = "UNDECIDED" GM.OCRPPerks[5].Check = function(orgid) local pt = 0 for _,member in pairs(OCRP_Orgs[orgid]) do pt = pt + member.Playtime end return pt >= 525600 end GM.OCRPPerks[5].Function = function(ply) end GM.OCRPPerks[6] = {} GM.OCRPPerks[6].Name = "Need for Speed" GM.OCRPPerks[6].Desc = "Have online players with all the cars collectively." GM.OCRPPerks[6].Reward = "Ability to purchase the Porsche Tricycle." GM.OCRPPerks[6].Check = function(orgid) local cars = {} for _,member in pairs(OCRP_Orgs[orgid].Members) do local ply = player.GetBySteamID(member.SteamID) if ply and ply:IsValid() then for _,carTable in pairs(ply.OCRPData["Cars"]) do cars[carTable.car] = true end end end local haveAll = true for car,_ in pairs(GAMEMODE.OCRP_Cars) do if not cars[car] then haveAll = false end end return haveAll end GM.OCRPPerks[6].Function = function(ply) ply.CanBuyTricycle = true ply:SetNWBool("CanBuyTricycle", true) end
-------------------------------------------------------------------------------- local Text = require 'cherry.libs.text' -------------------------------------------------------------------------------- local Icon = {} -------------------------------------------------------------------------------- function Icon:draw(options) local icon = display.newImage( options.parent, options.image ) if(options.disabled) then icon.fill.effect = 'filter.desaturate' icon.fill.effect.intensity = 0.8 end icon.x = options.x icon.y = options.y if(options.maxSize) then local heigthRatio = options.maxSize / icon.height local widthRatio = options.maxSize / icon.width local ratio = math.min(widthRatio, heigthRatio) icon:scale(ratio, ratio) end if(options.scale) then icon:scale(options.scale, options.scale) end return icon end -------------------------------------------------------------------------------- function Icon:big(options) local icon = display.newGroup() icon.x = options.x icon.y = options.y options.parent:insert(icon) display.newImage( icon, 'cherry/assets/images/gui/items/circle.container.on.png', 0, 0 ) local picture = display.newImage( icon, options.image, 0, 0 ) local scale = options.scale or 0.5 picture:scale(scale, scale) return icon end -------------------------------------------------------------------------------- function Icon:mini(options) local path = options.path or 'cherry/assets/images/gui/items/' .. options.type .. '.icon.png' local icon = display.newImage( options.parent, path ); if(options.disabled or options.status == 'off') then icon.fill.effect = 'filter.desaturate' icon.fill.effect.intensity = 1 end icon.x = options.x icon.y = options.y local scale = options.scale or 0.26 icon:scale(scale, scale) return icon end -------------------------------------------------------------------------------- function Icon:text(options) local icon = display.newGroup() icon.x = options.x icon.y = options.y options.parent:insert(icon) display.newImage( icon, 'cherry/assets/images/gui/items/circle.container.on.png', 0, 0 ) Text.embossed({ parent = icon, text = options.value, x = 0, y = 0, font = options.font or _G.FONTS.default, fontSize = options.fontSize or 65 }) return icon end -------------------------------------------------------------------------------- return Icon
---------------------------------------------------------------------------------------------------- -- -- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -- its licensors. -- -- For complete copyright and license terms please see the LICENSE at the root of this -- distribution (the "License"). All use of this software is governed by the License, -- or, if provided, by the license below or the license accompanying this file. Do not -- remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- -- ---------------------------------------------------------------------------------------------------- Script.ReloadScript( "Scripts/Entities/Physics/BasicEntity.lua" ); -- Basic entity RigidBodyEx = { Properties = { bSerialize = 0, --by default rigid bodies are not being serialized (save/load) bDamagesPlayerOnCollisionSP = 0, AI = { -- This value is currently used for the MNM Navigation System bUsedAsDynamicObstacle = 1, }, Physics = { bRigidBodyActive = 1, bActivateOnDamage = 0, bResting = 1, -- If rigid body is originally in resting state. bCanBreakOthers = 0, Simulation = { max_time_step = 0.02, sleep_speed = 0.04, damping = 0, bFixedDamping = 0, bUseSimpleSolver = 0, }, Buoyancy= { water_density = 1000, water_damping = 0, water_resistance = 1000, }, CGFPropsOverride = { Joint = { limit = "", twist = "", bend = "", push = "", pull = "", shift = "", }, Constraint = { constraint_limit = "", constraint_minang = "", constraint_maxang = "", constraint_damping = "", constraint_collides = "", }, Deformable = { stiffness = "", thickness = "", max_stretch = "", max_impulse = "", skin_dist = "", hardness = "", explosion_scale = "", }, player_can_break = "", }, ForeignData = { bMovingPlatform = 0, }, }, MultiplayerOptions = { bNetworked = 0, }, }, Editor={ Icon = "physicsobject.bmp", IconOnTop=1, }, States = {"Default","Activated"}, bRigidBodyActive = 1, } local Physics_DX9MP_Simple = { bRigidBodyActive = 0, bActivateOnDamage = 0, bResting = 1, -- If rigid body is originally in resting state. Simulation = { max_time_step = 0.02, sleep_speed = 0.04, damping = 0, bFixedDamping = 0, bUseSimpleSolver = 0, }, Buoyancy= { water_density = 1000, water_damping = 0, water_resistance = 1000, }, } MakeDerivedEntity( RigidBodyEx,BasicEntity ) ------------------------------------------------------- function RigidBodyEx:OnLoad(table) self.bRigidBodyActive = table.bRigidBodyActive; self.health = table.health; self.dead = table.dead; self.broken = table.broken; end ------------------------------------------------------- function RigidBodyEx:OnSave(table) table.bRigidBodyActive = self.bRigidBodyActive table.health = self.health; table.dead = self.dead; table.broken = self.broken; end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:OnSpawn() if (self.Properties.MultiplayerOptions.bNetworked == 0) then self:SetFlags(ENTITY_FLAG_CLIENT_ONLY,0); end if (self.Properties.Physics.bRigidBodyActive == 1) then self.bRigidBodyActive = 1; end self:SetFromProperties(); self:SetupHealthProperties(); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:SetFromProperties() local Properties = self.Properties; if (Properties.object_Model == "") then do return end; end self:LoadObject(0,Properties.object_Model); self:CharacterUpdateOnRender(0,1); -- If it is a character force it to update on render. -- Enabling drawing of the slot. self:DrawSlot(0,1); self.bRigidBodyActive = Properties.Physics.bRigidBodyActive; if (Properties.Physics.bPhysicalize == 1) then self:PhysicalizeThis(); else local params = {}; self:Physicalize(0,PE_NONE,params); end self:GotoState("Default"); -- Mark AI hideable flag. if (self.Properties.bAutoGenAIHidePts == 1) then self:SetFlags(ENTITY_FLAG_AI_HIDEABLE, 0); -- set else self:SetFlags(ENTITY_FLAG_AI_HIDEABLE, 2); -- remove end if (self.Properties.bCanTriggerAreas == 1) then self:SetFlags(ENTITY_FLAG_TRIGGER_AREAS, 0); -- set else self:SetFlags(ENTITY_FLAG_TRIGGER_AREAS, 2); -- remove end self.broken = 0; end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:PhysicalizeThis() -- Init physics. local physics = self.Properties.Physics; if (CryAction.IsImmersivenessEnabled() == 0) then physics = Physics_DX9MP_Simple; end EntityCommon.PhysicalizeRigid( self,0,physics,self.bRigidBodyActive ); end ------------------------------------------------------------------------------------------------------ -- OnPropertyChange called only by the editor. ------------------------------------------------------------------------------------------------------ function RigidBodyEx:OnPropertyChange() self:SetFromProperties(); end ------------------------------------------------------------------------------------------------------ -- OnReset called only by the editor. ------------------------------------------------------------------------------------------------------ function RigidBodyEx:OnReset() self:ResetOnUsed() local PhysProps = self.Properties.Physics; if (PhysProps.bPhysicalize == 1) then if (self:IsInState("Default") ~= 0) then self:AwakePhysics(1-self.Properties.Physics.bResting); end self:GotoState("Default"); end self:SetupHealthProperties(); self.broken = 0; end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_Remove() self:DrawSlot(0,0); self:DestroyPhysics(); self:ActivateOutput( "Remove", true ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_Hide() self:Hide(1); self:ActivateOutput( "Hide", true ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_UnHide() self:Hide(0); self:ActivateOutput( "UnHide", true ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_Ragdollize() self:RagDollize(0); self:ActivateOutput( "Ragdollized", true ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:OnPhysicsBreak( vPos,nPartId,nOtherPartId ) self:ActivateOutput("Break",nPartId+1 ); self.broken = 1; end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:OnDamage( hit ) if (self:IsARigidBody() == 1) then if (self.Properties.Physics.bActivateOnDamage == 1) then if (hit.explosion and self:GetState()~="Activated") then BroadcastEvent(self, "Activate"); self:GotoState("AcTivated"); end end end if( hit.ipart and hit.ipart>=0 ) then self:AddImpulse( hit.ipart, hit.pos, hit.dir, hit.impact_force_mul ); end end function RigidBodyEx:IsUsable(user) local canBeUsed = 0; if(self.broken == 0) then if (self.Properties.bUsable==1 or self.Properties.bPickable==1) then canBeUsed = 1; end else canBeUsed = self.Properties.bUsable; end return canBeUsed; end ------------------------------------------------------------------------------------------------------ -- Input events ------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_Activate(sender) self:GotoState("Activated"); end ------------------------------------------------------------------------------------------------------ -- Events to switch material Applied to object. ------------------------------------------------------------------------------------------------------ function RigidBodyEx:CommonSwitchToMaterial( numStr ) if (not self.sOriginalMaterial) then self.sOriginalMaterial = self:GetMaterial(); end if (self.sOriginalMaterial) then --System.Log( "Material: "..self.sOriginalMaterial..numStr ); self:SetMaterial( self.sOriginalMaterial..numStr ); end end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_SwitchToMaterialOriginal(sender) self:CommonSwitchToMaterial( "" ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_SwitchToMaterial1(sender) self:CommonSwitchToMaterial( "1" ); end ------------------------------------------------------------------------------------------------------ function RigidBodyEx:Event_SwitchToMaterial2(sender) self:CommonSwitchToMaterial( "2" ); end ------------------------------------------------------------------------------------------------------ -- Defaul state. ------------------------------------------------------------------------------------------------------ RigidBodyEx.Server.Default = { OnBeginState = function(self) if (self.Properties.Physics.bRigidBody==1) then if (self.bRigidBodyActive~=self.Properties.Physics.bRigidBodyActive) then self.bRigidBodyActive = self.Properties.Physics.bRigidBodyActive; self:PhysicalizeThis(); else self:AwakePhysics(1-self.Properties.Physics.bResting); end end end, OnDamage = RigidBodyEx.OnDamage, OnPhysicsBreak = RigidBodyEx.OnPhysicsBreak, } ------------------------------------------------------------------------------------------------------ -- Activated state. ------------------------------------------------------------------------------------------------------ RigidBodyEx.Server.Activated = { OnBeginState = function(self) if (self.Properties.Physics.bRigidBody==1 and self.bRigidBodyActive==0) then self.bRigidBodyActive = 1; self:PhysicalizeThis(); self:AwakePhysics(1); end end, OnDamage = RigidBodyEx.OnDamage, OnPhysicsBreak = RigidBodyEx.OnPhysicsBreak, } RigidBodyEx.FlowEvents = { Inputs = { Used = { RigidBodyEx.Event_Used, "bool" }, EnableUsable = { RigidBodyEx.Event_EnableUsable, "bool" }, DisableUsable = { RigidBodyEx.Event_DisableUsable, "bool" }, Activate = { RigidBodyEx.Event_Activate, "bool" }, Hide = { RigidBodyEx.Event_Hide, "bool" }, UnHide = { RigidBodyEx.Event_UnHide, "bool" }, Remove = { RigidBodyEx.Event_Remove, "bool" }, Ragdollize = { RigidBodyEx.Event_Ragdollize, "bool" }, SwitchToMaterial1 = { RigidBodyEx.Event_SwitchToMaterial1, "bool" }, SwitchToMaterial2 = { RigidBodyEx.Event_SwitchToMaterial2, "bool" }, SwitchToMaterialOriginal = { RigidBodyEx.Event_SwitchToMaterialOriginal, "bool" }, ResetHealth = { RigidBodyEx.Event_ResetHealth, "any" }, MakeVulnerable = { RigidBodyEx.Event_MakeVulnerable, "any" }, MakeInvulnerable = { RigidBodyEx.Event_MakeInvulnerable, "any" }, }, Outputs = { Used = "bool", EnableUsable = "bool", DisableUsable = "bool", Activate = "bool", Hide = "bool", UnHide = "bool", Remove = "bool", Ragdollized = "bool", Break = "int", Dead = "bool", Hit = "bool", Health = "float", }, }
Locales['en'] = { -- shop ['boat_shop'] = 'Båd butik', ['boat_shop_open'] = 'Tryk ~INPUT_CONTEXT~ for at åbne ~y~båd butik~s~.', ['boat_shop_confirm'] = 'Køb <span style="color: yellow;">%s</span> for <span style="color: orange;">$%s</span>?', ['boat_shop_bought'] = 'Du har ~y~købt~s~ a ~b~%s~s~ for ~g~$%s~s~', ['boat_shop_nomoney'] = 'Du har ikke ~r~råd~s~ til denne båd!', ['confirm_no'] = 'Nej', ['confirm_yes'] = 'Ja', -- garage ['garage'] = 'Båd garage', ['garage_open'] = 'Tryk ~INPUT_CONTEXT~ for at åbne ~y~båd garage~s~.', ['garage_store'] = 'Tryk ~INPUT_CONTEXT~ for at ~y~parkere~s~ denne båd i din garage.', ['garage_taken'] = 'Båden er blevet taget ud!', ['garage_stored'] = 'Båden er blevet parkeret sikkert!', ['garage_noboats'] = 'Du har ingen parkeret både! Besøg ~y~båd butik~s~ for at købe en', ['garage_blocked'] = 'Båden kan ikke komme ud da der er noget der blokere spawn stedet!', ['garage_notowner'] = 'Du ejer ikke denne båd!', -- license ['license_menu'] = 'Køb båd certifikat?', ['license_buy_no'] = 'Nej', ['license_buy_yes'] = 'Køb båd certifikat <span style="color: green;">$%s</span>', ['license_bought'] = 'Du har købt ~y~båd certifikat~s~ for ~g~$%s~s~', ['license_nomoney'] = 'Du har ikke ~r~råd~s~ til ~y~båd certifikat~s~!', -- blips ['blip_garage'] = 'Båd garage', ['blip_shop'] = 'Båd butik', }
releasedCount = releasedCount + 1 assert(slot1.getState() == 0) -- toggled before calling handlers assert(releasedCount == 1) -- should only ever be called once, when the user releases the button
local gamestate = require "libs.gamestate" local u = require "useful" local Object = require "libs.class" local chain = require "chain" local lg = love.graphics local lm = love.mouse local lk = love.keyboard local palettes = { -- palettes are from http://www.colourlovers.com {u.rgb(120, 75, 121), u.rgb(78, 205, 196), u.rgb(232, 255, 107), u.rgb(232, 126, 40), u.rgb(196, 77, 88)}, -- monday cheer [3101907] -- {u.rgb(66, 66, 84), u.rgb(100, 144, 138), u.rgb(232, 202, 164), u.rgb(204, 42, 65)}, -- you are beautiful [379413] {u.rgb(101, 86, 67), u.rgb(128, 188, 163), u.rgb(246, 247, 189), u.rgb(230, 172, 39), u.rgb(191, 77, 40)}, -- headache [953498] -- {u.rgb(247, 120, 37), u.rgb(211, 206, 61), u.rgb(241, 239, 165), u.rgb(96, 185, 154)}, -- mystery machine [940086] } local pusherColor = {0.9, 0.9, 0.9} local nballs = 10 local flySpeed = 2000 local maxSpeed = 400 local minSpeed = 10 local acc = 400 local radius = 20 local distance = radius * 2 local Ball = Object:inherit() function Ball:init(cx, color, ownSpeed) self.cx = cx self.color = color self.ownSpeed = ownSpeed or 0 self.curSpeed = self.ownSpeed self.detached = false end function Ball:update(dt) -- curSpeed changes towards ownSpeed if self.curSpeed ~= self.ownSpeed then local dist = self.ownSpeed - self.curSpeed local d = acc * dt if math.abs(dist) > d then self.curSpeed = self.curSpeed + u.sign(dist) * d else self.curSpeed = self.ownSpeed end end self.cx = self.cx + self.curSpeed * dt end function Ball:draw() if self.point then lg.setColor(self.color) lg.circle("fill", self.point.x, self.point.y, radius, 20) end end local Pusher = Ball:inherit() function Pusher:init(cx, ownSpeed) Pusher.super.init(self, cx, pusherColor, ownSpeed) self.detached = true end function Pusher:draw() if self.point then lg.setColor(self.color) lg.circle("line", self.point.x, self.point.y, radius, 20) end end local PendingBall = Object:inherit() function PendingBall:init(x, y, color) self.x = x self.y = y self.color = color end function PendingBall:update(dt) self.y = self.y - flySpeed * dt end function PendingBall:draw() lg.setColor(self.color) lg.circle("fill", self.x, self.y, radius, 20) end local Cannon = Object:inherit() function Cannon:init(palette) self.palette = palette self.x = 0 self.y = lg.getHeight() - distance self.current = u.choice(palette) self.next = u.choice(palette) end function Cannon:fire() local ball = PendingBall(self.x, self.y, self.current) self.current = self.next self.next = u.choice(self.palette) return ball end function Cannon:swap() self.current, self.next = self.next, self.current end function Cannon:draw() lg.setColor(self.current) lg.circle("fill", self.x, self.y, radius, 20) lg.setColor(self.next) lg.circle("fill", self.x, self.y + radius, radius / 2, 20) end local game = {} function game:init() self.palette = u.choice(palettes) self.cannon = Cannon(self.palette) self.balls = chain.Chain() self.pending = {} self.path = nil self:spawnBalls(nballs) end function game:enter(previous, newpath) self.path = newpath end function game:spawnBalls(n) local from = self.balls.tail and math.min(self.balls.tail.cx, 0) or 0 for i = 1, n do local ball = Ball(from - distance * i, u.choice(self.palette)) self.balls:insert(ball, self.balls.tail) end local pusher = Pusher(from - distance * (n + 1), maxSpeed) self.balls:insert(pusher, self.balls.tail) end function game:removeBall(ball) self:removeBalls(ball, ball) end function game:removeBalls(from, to) local prevBall = self.balls.links[from].prev if prevBall then if not prevBall.detached then prevBall.detached = true prevBall.curSpeed = from.curSpeed end end self.balls:removeRange(from, to) end function game:keypressed(key) if key == "space" then gamestate.pop() elseif key == "return" then self:spawnBalls(nballs) end end function game:mousepressed(x, y, button) if button == 1 then local pball = self.cannon:fire() self.pending[pball] = true elseif button == 2 then self.cannon:swap() end end function game:update(dt) self.cannon.x = lm.getX() for pball in pairs(self.pending) do pball:update(dt) if pball.y < 0 then self.pending[pball] = nil end for ball in self.balls:iter() do if ball.point and u.dist(pball.x, pball.y, ball.point.x, ball.point.y) < distance and not ball:is(Pusher) then local cx, after local angle1 = math.atan2(ball.point.dy, ball.point.dx) local angle2 = math.atan2(pball.y - ball.point.y, -- or better just hardcode pball.x - ball.point.x) -- the "up" direction? if (angle1 - angle2 + math.pi / 2) % (math.pi * 2) < math.pi then -- same direction (put before) cx = ball.cx - distance after = self.balls.links[ball].prev else -- opposite direction (put after) cx = ball.cx + distance after = ball end self.balls:insert(Ball(cx, pball.color), after) self.pending[pball] = nil break end end end local nextBall = nil local nextDetached = nil local nextPusher = nil local toRemove = {} for ball in self.balls:reverseIter() do if ball.detached then ball:update(dt) if ball:is(Pusher) then if nextBall and ball.cx < nextBall.cx + distance then table.insert(toRemove, {from = ball, to = ball}) else nextPusher = ball end elseif nextBall then if ball.color == nextBall.color or nextBall:is(Pusher) then ball.ownSpeed = -maxSpeed else ball.ownSpeed = 0 end if ball.cx < nextBall.cx + distance then ball.cx = nextBall.cx + distance -- this works wrong when they're -- moving in the same direction nextDetached.curSpeed = nextDetached.curSpeed + ball.curSpeed ball.detached = false ball.ownSpeed = 0 ball.curSpeed = 0 end end nextDetached = ball -- may assign already attached ball else ball.cx = nextBall.cx + distance if nextPusher then nextPusher.ownSpeed = (1 - ball.cx / self.path.length) * maxSpeed + minSpeed end end nextBall = ball ball.point = self.path:getAt(ball.cx) end for i, v in ipairs(toRemove) do self:removeBalls(v.from, v.to) end end function game:draw() self.path:draw() self.cannon:draw() for pball in pairs(self.pending) do pball:draw() end for ball in self.balls:iter() do ball:draw() end end return game
local Translator = require("reacher.core.translator").Translator local regex_matcher = require("reacher.core.matcher").Matcher.must("regex") local vim = vim local M = {} local Collector = {} Collector.__index = Collector M.Collector = Collector function Collector.new(window_id, matcher, lines, number_sign_width, cursor) vim.validate({ window_id = {window_id, "number"}, matcher = {matcher, "table"}, lines = {lines, "table"}, number_sign_width = {number_sign_width, "number"}, cursor = {cursor, "table", true}, }) local raw_lines = {} for _, line in lines:iter() do table.insert(raw_lines, line) end local tbl = { _translator = Translator.new(window_id, matcher, regex_matcher, number_sign_width), _raw_lines = raw_lines, _cursor = cursor, } return setmetatable(tbl, Collector) end function Collector.collect(self, input_line) if #input_line == 0 then if not self._cursor then return {} end local row = self._cursor.row local column = self._cursor.column local line = self._raw_lines[row] if not line then return {} end return self._translator:to_targets_from_position(line.str, row, column) end local raw_targets = {} for row, line in ipairs(self._raw_lines) do raw_targets = vim.list_extend(raw_targets, self._translator:to_targets_from_str(line.str, row, line.column_offset, input_line)) end return raw_targets end return M
local dvdlogo = require('src.dvdlogo') debug = require('src.debug') function love.load() my_dvdlogo = dvdlogo.create() end function love.update() my_dvdlogo:update() end function love.draw() --[[ TODO: put this in a debug module love.graphics.setNewFont(15) love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) --]] debug.drawFps() my_dvdlogo.entity:draw() end
--// Loaders Interface \\-- print("67vsygywgd67867fdsjbgd76") --// This is anti-ban bypass key! \\-- local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local Network = require(LocalPlayer.PlayerScripts.GunFramework.InternalModules.network) --// Functions \\-- function GetPlayer() local MaxDist, Player = math.huge for I,V in pairs(Players:GetPlayers()) do if V == LocalPlayer then continue end if V.Team == LocalPlayer then continue end if not V.Character then continue end local Head = V.Character:FindFirstChild("Head") if not Head then continue end local Pos, Vis = workspace.CurrentCamera:WorldToScreenPoint(Head.Position) if not Vis then continue end local MyPos, TheirPos = Vector2.new(Mouse.X, Mouse.Y), Vector2.new(Pos.X, Pos.Y) local Dist = (TheirPos - MyPos).Magnitude if Dist < MaxDist then MaxDist = Dist Player = V end end return Player end --// Aimbot Script \\-- Old = hookfunction(Network.send, function(self, ...) local Args = {...} if Args[1] == "bullet" then local P = GetPlayer() if P and P.Character and P.Character:FindFirstChild("Head") then Args[2] = P.Character Args[3] = P.Character.Head Args[4] = P.Character.Head.Position return Old(self, unpack(Args)) end end return Old(self, ...) end) for I,V in pairs(game:GetService("ReplicatedStorage").GunModules:GetChildren()) do pcall(function() local a = require(V) a.ReloadTime = 0 a.ClipSize = math.huge a.FireRate = 0 a.Automatic = true end) end --// End \\-- hookfunction(require(LocalPlayer.PlayerScripts.GunFramework.Recoil).ShootRecoil, function() end) local F = getconnections(game:GetService("LogService").MessageOut)[2].Function debug.setupvalue(F, 1, {}) hookfunction(F, function() end)
local betterUIMod = GameMain:GetMod("CanVox.BetterUI"); betterUIMod.TalkUI = betterUIMod.TalkUI or {} local TalkUI = betterUIMod.TalkUI function TalkUI:NewChatText(text) print("TEXT") print(text) if not text then return end self:RefreshJianghu() end function TalkUI:SetSupplementUIVisible(isVisible) TalkUI.secretsFrame.visible = isVisible TalkUI.topLoop.visible = isVisible TalkUI.bottomLoop.visible = isVisible TalkUI.secretsNamePlate.visible = isVisible TalkUI.unknownSecretCount.visible = isVisible TalkUI.secretList.visible = isVisible TalkUI.personalInfoBG.visible = isVisible TalkUI.personalInfoLeftLoop.visible = isVisible TalkUI.personalInfoRightLoop.visible = isVisible TalkUI.personalCusList.visible = isVisible TalkUI.personalCusList2.visible = isVisible end function TalkUI:RefreshJianghu() local targetName = CS.Wnd_JianghuTalk.Instance.UIInfo.m_leftNpcName.text local npcs = World.map.Things:GetActiveNpcs() local foundNpc = nil for i=1,npcs.Count do if npcs[i]:GetName() == targetName then foundNpc = npcs[i] break end end local jianghuData = nil local npcData = nil if foundNpc ~= nil then jianghuData = JianghuMgr:GetJHNpcDataBySeed(foundNpc.JiangHuSeed) npcData = JianghuMgr:GetKnowNpcData(foundNpc.JiangHuSeed) end local hasJianghuData = jianghuData ~= nil and npcData ~= nil self:SetSupplementUIVisible(hasJianghuData) if not hasJianghuData then return end for i=1,4 do if jianghuData.LikeItems and i <= jianghuData.LikeItems.Count then self.favorites.list[i].visible = true if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.__CastFrom(1+i)) then local favoriteDef = ThingMgr:GetDef(g_emThingType.Item, jianghuData.LikeItems[i-1]) self.favorites.list[i].tooltips = favoriteDef.ThingName self.favorites.list[i].icon = favoriteDef.TexPath self.favorites.list[i].m_icon.color = favoriteDef.Color else self.favorites.list[i].tooltips = "???" self.favorites.list[i].icon = "res/sprs/ui/icon_what" self.favorites.list[i].m_icon.color = CS.UnityEngine.Color.white end else self.favorites.list[i].visible = false end end for i=1,4 do if jianghuData.HateItems and i <= jianghuData.HateItems.Count then self.hates.list[i].visible = true if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.__CastFrom(5+i)) then local hateDef = ThingMgr:GetDef(g_emThingType.Item, jianghuData.HateItems[i-1]) self.hates.list[i].tooltips = hateDef.ThingName self.hates.list[i].icon = hateDef.TexPath self.hates.list[i].m_icon.color = hateDef.Color else self.hates.list[i].tooltips = "???" self.hates.list[i].icon = "res/sprs/ui/icon_what" self.hates.list[i].m_icon.color = CS.UnityEngine.Color.white end else self.hates.list[i].visible = false end end for i=1,5 do if jianghuData.Carry and i <= jianghuData.Carry.Count then if npcData:CheckKnowKey("CarryRemove"..(i-1)) then -- Don't show treasures that have been lost self.treasures.list[i].visible = false else self.treasures.list[i].visible = true if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.__CastFrom(9+i)) then local treasureDef = jianghuData.Carry[i-1] if treasureDef.ThingType == 1 then self.treasures.list[i].tooltips = XT("独门秘籍") self.treasures.list[i].icon = "res/Sprs/object/object_miji01" self.treasures.list[i].m_icon.color = CS.UnityEngine.Color.white else self.treasures.list[i].tooltips = treasureDef.ThingName self.treasures.list[i].icon = treasureDef.TexPath self.treasures.list[i].m_icon.color = treasureDef.Color end else self.treasures.list[i].tooltips = "???" self.treasures.list[i].icon = "res/sprs/ui/icon_what" self.treasures.list[i].m_icon.color = CS.UnityEngine.Color.white end end else self.treasures.list[i].visible = false end end for i=1,3 do if jianghuData.Hobby and i <= jianghuData.Hobby.Count then self.weaknesses.list[i].visible = true if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.__CastFrom(15+i)) then local hobbyDef = JianghuMgr:GetHobby(jianghuData.Hobby[i-1]) self.weaknesses.list[i].title = hobbyDef.Title self.weaknesses.list[i].tooltips = hobbyDef:GetHobbyTxt(jianghuData) else self.weaknesses.list[i].title = "???" self.weaknesses.list[i].tooltips = "" end elseif i == 1 then self.weaknesses.list[i].visible = true self.weaknesses.list[i].title = "None" else self.weaknesses.list[i].visible = false end end for i=1,3 do if jianghuData.Secret and i <= jianghuData.Secret.Count then self.mysteries.list[i].visible = true if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.__CastFrom(18+i)) then self.mysteries.list[i].title = JianghuMgr:GetClueTitle(jianghuData.Secret[i-1]) self.mysteries.list[i].tooltips = JianghuMgr:GetClueTypeName(jianghuData.Secret[i-1]) else self.mysteries.list[i].title = "???" self.mysteries.list[i].tooltips = "" end elseif i == 1 then self.mysteries.list[i].visible = true self.mysteries.list[i].title = "None" else self.mysteries.list[i].visible = false end end if jianghuData.Feature ~= CS.XiaWorld.g_emJHNpc_Feature.None then if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.Feature) then self.personality.text = GameDefine.JHFeatureTxts[jianghuData.Feature] else self.personality.text = "???" end else self.personality.text = XT("无") end if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.Track) then self.traces.text = PlacesMgr:GetPlaceDef(npcData.place).DisplayName else self.traces.text = "???" end if not jianghuData.Esoterica then self.esoterica.text = XT("无") else if npcData:IsKnowInfo(CS.XiaWorld.g_emJHNpcDataType.Esoterica) then local esotericaDef = nil if jianghuData.Esoterica.Name then esotericaDef = EsotericaMgr:GetEsotericaDef(jianghuData.Esoterica.Name, true) end if esotericaDef then self.esoterica.text = esotericaDef.DisplayName elseif jianghuData.Esoterica.Type == CS.XiaWorld.g_emEsotericaType.None then self.esoterica.text = XT("无") else self.esoterica.text = GameDefine.GetEsotericaTypeStr(jianghuData.Esoterica.Type)..XT("之法") end else self.esoterica.text = "???" end end end function TalkUI:RemoveByName(baseUI, name) local child = baseUI:GetChild(name) if child then baseUI:RemoveChild(child) end end function TalkUI:BaseItem(itemList) local storyPane = itemList:AddItemFromPool() storyPane.data5 = nil storyPane.m_expandButton.visible = false storyPane.m_n26.visible = false storyPane.m_title.x = storyPane.m_title.x - 30 return storyPane end function TalkUI:AddMysteryItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("隐秘") storyPane.m_Mode.selectedIndex = 3 storyPane.m_n21:RemoveChildrenToPool() storyPane.m_n21.x = storyPane.m_n21.x - 15 self.mysteries = { list = {}, map = {}, } for i=1,3 do local mysteryItem = storyPane.m_n21:AddItemFromPool() mysteryItem.title = "???" mysteryItem.data5 = nil mysteryItem.name = "canvox.mystery"..i self.mysteries.list[i] = mysteryItem self.mysteries.map[mysteryItem.name] = i end return storyPane end function TalkUI:AddTracesItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("行踪") storyPane.m_Mode.selectedIndex = 4 storyPane.m_n22.text = "???" storyPane.m_n22.data5 = nil storyPane.m_n22.x = storyPane.m_n22.x - 15 storyPane.m_n22.name = "canvox.traces" self.traces = storyPane.m_n22 return storyPane end function TalkUI:AddPersonalityItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("性格") storyPane.m_Mode.selectedIndex = 4 storyPane.m_n22.text = "???" storyPane.m_n22.data5 = nil storyPane.m_n22.x = storyPane.m_n22.x - 15 storyPane.m_n22.name = "canvox.personality" self.personality = storyPane.m_n22 return storyPane end function TalkUI:AddWeaknessItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("弱点") storyPane.m_Mode.selectedIndex = 3 storyPane.m_n21:RemoveChildrenToPool() storyPane.m_n21.x = storyPane.m_n21.x - 15 storyPane.m_n21.y = storyPane.m_n21.y - 2 self.weaknesses = { list = {}, map = {}, } for i=1,3 do local weakness = storyPane.m_n21:AddItemFromPool() weakness.title = "???" weakness.data5 = nil weakness.name = "canvox.weakness"..i self.weaknesses.list[i] = weakness self.weaknesses.map[weakness.name] = i end return storyPane end function TalkUI:AddSecretKnowledgeItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("绝学") storyPane.m_Mode.selectedIndex = 4 storyPane.m_n22.text = "???" storyPane.m_n22.data5 = nil storyPane.m_n22.x = storyPane.m_n22.x - 15 storyPane.m_n22.name = "canvox.esoterica" self.esoterica = storyPane.m_n22 return storyPane end function TalkUI:AddFavoritesItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("心仪之物") storyPane.data5 = nil storyPane.m_Mode.selectedIndex = 2 storyPane.m_n20:RemoveChildrenToPool() storyPane.m_n20.x = storyPane.m_n20.x - 15 self.favorites = { list = {}, map = {}, } for i=1,4 do local favorite = storyPane.m_n20:AddItemFromPool() favorite.tooltips = "???" favorite.icon = "res/sprs/ui/icon_what" favorite.m_icon.color = CS.UnityEngine.Color(1, 1, 1, 1) favorite:SetSize(25, 30) favorite.data5 = nil favorite.name = "canvox.favorite"..i self.favorites.list[i] = favorite self.favorites.map[favorite.name] = i end return storyPane end function TalkUI:AddHatesItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("厌恶之物") storyPane.data5 = nil storyPane.m_Mode.selectedIndex = 2 storyPane.m_n20:RemoveChildrenToPool() storyPane.m_n20.x = storyPane.m_n20.x - 15 self.hates = { list = {}, map = {}, } for i=1,4 do local hate = storyPane.m_n20:AddItemFromPool() hate.tooltips = "???" hate.icon = "res/sprs/ui/icon_what" hate.m_icon.color = CS.UnityEngine.Color(1, 1, 1, 1) hate:SetSize(25, 30) hate.data5 = nil hate.name = "canvox.hate"..i self.hates.list[i] = hate self.hates.map[hate.name] = i end return storyPane end function TalkUI:AddTreasuresItem(itemList) local storyPane = self:BaseItem(itemList) storyPane.title = XT("随身宝物") storyPane.data5 = nil storyPane.m_Mode.selectedIndex = 2 storyPane.m_n20:RemoveChildrenToPool() storyPane.m_n20.x = storyPane.m_n20.x - 15 self.treasures = { list = {}, map = {}, } for i=1,5 do local treasure = storyPane.m_n20:AddItemFromPool() treasure.tooltips = "???" treasure.icon = "res/sprs/ui/icon_what" treasure.m_icon.color = CS.UnityEngine.Color(1, 1, 1, 1) treasure:SetSize(25, 30) treasure.data5 = nil treasure.name = "canvox.treasure"..i self.treasures.list[i] = treasure self.treasures.map[treasure.name] = i end return storyPane end function TalkUI:MarkUp(baseUI) local bodyAbilitiesFrame = UIPackage.CreateObjectFromURL("ui://0xrxw6g7abgt52ow4m"); --Attach a frame for secrets to the left side of the UI self.secretsFrame = bodyAbilitiesFrame:GetChild("n90") self.secretsFrame:SetSize(210, 315) self.secretsFrame.x = -200 self.secretsFrame.y = -7 self.secretsFrame.name = "secretsFrameBG" self:RemoveByName(baseUI, "secretsFrameBG") self.topLoop = bodyAbilitiesFrame:GetChild("n91") self.topLoop.x = -10 self.topLoop.y = 45 self.topLoop.name = "secretsFrameTopLoop" self:RemoveByName(baseUI, "secretsFrameTopLoop") self.bottomLoop = bodyAbilitiesFrame:GetChild("n92") self.bottomLoop.x = -10 self.bottomLoop.y = 235 self.bottomLoop.name = "secretsFrameBottomLoop" self:RemoveByName(baseUI, "secretsFrameBottomLoop") self.secretsNamePlate = bodyAbilitiesFrame:GetChild("n93") self.secretsNamePlate.x = -160 self.secretsNamePlate.y = 15 self.secretsNamePlate.name = "secretsFrameTitle" self:RemoveByName(baseUI, "secretsFrameTitle") local secretsTitle = self.secretsNamePlate:GetChild("title") secretsTitle.text = "Held Secrets" -- Add Unknown: ### label and list of known secrets self.unknownSecretCount = UIPackage.CreateObjectFromURL("ui://0xrxw6g7nd594l") self.unknownSecretCount.x = -160 self.unknownSecretCount.y = 40 self.unknownSecretCount:SetSize(145, 30) self.unknownSecretCount.text = "Unknown: 7" self.unknownSecretCount.name = "unknownSecretCount" self:RemoveByName(baseUI, "unknownSecretCount") local unknownSecretFormat = self.unknownSecretCount:GetTextField().textFormat unknownSecretFormat.italic = true unknownSecretFormat.bold = true unknownSecretFormat.size = 16 unknownSecretFormat.color = CS.UnityEngine.Color(0.5,0.5,0.5,1) self.unknownSecretCount:GetTextField().textFormat = unknownSecretFormat local cusList = UIPackage.CreateObjectFromURL("ui://0xrxw6g7m8j0ovnz") self.secretList = cusList:GetChild("list") self.secretList.defaultItem = "ui://0xrxw6g7gebq2l" self.secretList.x = -180 self.secretList.y = 60 self.secretList.name = "secretList" self:RemoveByName(baseUI, "secretList") self.secretList:SetSize(165, 230) for i=0,100 do local otherItem = self.secretList:AddItemFromPool() otherItem:SetSize(90, 18) local itemTitle = otherItem:GetChild("title") itemTitle.text = "Personality: Huo Sun" itemTitle:SetSize(90, 18) itemTitle.x = itemTitle.x + 5 end self.personalCusList = UIPackage.CreateObjectFromURL("ui://0xrxw6g7m8j0ovnz").m_list self.personalCusList.x = 40 self.personalCusList.y = 308 self.personalCusList.defaultItem = "ui://0xrxw6g7kzxt2ovu7" self.personalCusList:SetSize(250, 140) self:AddMysteryItem(self.personalCusList) self:AddTracesItem(self.personalCusList) self:AddWeaknessItem(self.personalCusList) self:AddTreasuresItem(self.personalCusList) self.personalCusList2 = UIPackage.CreateObjectFromURL("ui://0xrxw6g7m8j0ovnz").m_list self.personalCusList2.x = 275 self.personalCusList2.y = 308 self.personalCusList2.defaultItem = "ui://0xrxw6g7kzxt2ovu7" self.personalCusList2:SetSize(230, 160) self:AddPersonalityItem(self.personalCusList2) self:AddSecretKnowledgeItem(self.personalCusList2) self:AddFavoritesItem(self.personalCusList2) self:AddHatesItem(self.personalCusList2) local messageBoxTips = UIPackage.CreateObjectFromURL("ui://0xrxw6g7ic0m35") self.personalInfoBG = messageBoxTips.m_n56 self.personalInfoBG.x = 0 self.personalInfoBG.y = 303 self.personalInfoBG:SetSize(485, 140) self.personalInfoRightLoop = messageBoxTips.m_n63 self.personalInfoRightLoop.x = 462 self.personalInfoRightLoop.y = 290 self.personalInfoLeftLoop = messageBoxTips.m_n62 self.personalInfoLeftLoop.x = 35 self.personalInfoLeftLoop.y = 290 -- Attach new UI elements baseUI:AddChildAt(self.secretsFrame, 0) baseUI:AddChild(self.topLoop) baseUI:AddChild(self.bottomLoop) baseUI:AddChild(self.secretsNamePlate) baseUI:AddChild(self.unknownSecretCount) baseUI:AddChild(self.secretList) baseUI:AddChild(self.personalInfoBG) baseUI:AddChild(self.personalInfoLeftLoop) baseUI:AddChild(self.personalInfoRightLoop) baseUI:AddChild(self.personalCusList) baseUI:AddChild(self.personalCusList2) -- Hook up show/unshow events baseUI.displayObject.onAddedToStage:Add( function() self.UIIsVisible = true self:RefreshJianghu() end) baseUI.displayObject.onRemovedFromStage:Add( function() self.UIIsVisible = false end) local val = self baseUI.m_n89.onClick:Add( function(ctx) TalkUI:OnChatClick(baseUI) end) baseUI.m_n91.onClick:Add( function(ctx) self:OnChatClick(baseUI) end) -- The show event for this chat has already been triggered -- so manually launch the handler self.UIIsVisible = true self.MessageTimer = 0 self.LastChatText = "" self.WaitingOnText = true self.TextLocked = false self:RefreshJianghu() end function TalkUI:OnChatClick(baseUI) local currentText = baseUI.m_txt.text if self.WaitingOnText and currentText then self:NewChatText(currentText) else self.WaitingOnText = true end self.LastChatText = currentText self.TextLocked = true end function TalkUI:OnRender(baseUI, dt) if not betterUIMod.TalkUI.UIIsVisible or not self.WaitingOnText then return end self.MessageTimer = self.MessageTimer + dt if self.MessageTimer < 0.1 then return end self.MessageTimer = 0 local currentText = baseUI.m_txt.text if currentText == self.LastChatText and not self.TextLocked then self.WaitingOnText = false self:NewChatText(currentText) return elseif currentText ~= self.LastChatText and self.TextLocked then self.TextLocked = false end self.LastChatText = currentText end
return { headers = {}, send = function(body) end, ["end"] = function() end, status = 404 }
-- Copyright 2019 Olivier Poitrey (rs@nextdns.io) -- This is free software, licensed under the Apache License, Version 2.0 module("luci.controller.nextdns", package.seeall) local util = require("luci.util") local i18n = require("luci.i18n") local templ = require("luci.template") local http = require("luci.http") function index() if not nixio.fs.access("/etc/config/nextdns") then return end entry({"admin", "services", "nextdns"}, firstchild(), _("NextDNS"), 60).dependent = false entry({"admin", "services", "nextdns", "overview"}, cbi("overview", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true entry({"admin", "services", "nextdns", "log"}, template("nextdns/logread"), _("Logs"), 30).leaf = true entry({"admin", "services", "nextdns", "logread"}, call("logread"), nil).leaf = true end function logread() local content = util.trim(util.exec("logread -e 'nextdns'")) or "" if content == "" then content = "No nextdns related logs yet!" end http.write(content) end
local decode = require "cjson.safe".decode local encode = require "cjson.safe".encode local redis = require "resty.redis" local emojis = require "app.emojis".replace local db = require "app.db" local ntime = ngx.time local htime = ngx.http_time local chat = {} local function time() return htime(ntime()) end function chat:connect() self.redis = self.context.redis self:spawn(chat.subscribe, self) end function chat:subscribe() local r, e = redis:new() if not r then return self:error(e) end local o, e = r:connect("127.0.0.1", 6379) if not o then return self:error(e) end local o, e = r:subscribe "chat" if not o then return self:error(e) end local d, e = r:read_reply() while not e or e == "timeout" do if d then self:send(d[3]) end d, e = r:read_reply() end return self:error(e) end function chat:text(message) local r = self.redis local m = decode(message) if m and m.type then m.time = time() if m.type == "post" then m.post = emojis(m.post) db.posts.store(r, m) elseif m.type == "join" then self.nick = m.nick self:send(encode{ type = "nicks", nicks = db.nicks.all(self.redis) }) local posts = db.posts.last(self.redis, 10) if #posts > 0 then self:send(encode{ type = "posts", posts = posts }) end elseif m.type == "part" then return end self.redis:publish("chat", encode(m)) end end function chat:closing() local nick = self.nick if nick then db.nicks.delete(self.redis, nick) self.redis:publish("chat", encode{ time = time(), type = "part", nick = nick }) end end return chat
--------------------------------------------- --Автоматическая очистка предметов --------------------------------------------- timer.Create( "itemcleanup", 8, 0, function() if table.Count(ents.FindByClass( "nut_item" )) > 40 then for k, v in ipairs(ents.FindByClass("nut_item")) do v:Remove() end end if table.Count(ents.FindByClass( "nut_money" )) > 40 then for k, v in ipairs(ents.FindByClass("nut_money")) do v:Remove() end end end) nut.command.add("itemclean", { adminOnly = true, onRun = function (client, arguments) if (!client:getChar():hasFlags("M")) then return end for k, v in pairs( ents.FindByClass( "nut_item" ) ) do v:Remove() end for k, v in pairs( ents.FindByClass( "nut_money" ) ) do v:Remove() end for k, v in pairs( ents.FindByClass( "nut_item_death" ) ) do v:Remove() end client:notify("Очистка карты завершена") end })
tick = require("tick") Object = require("classic") function love.load() love.window.setMode(256, 192) end function love.draw() end function love.update(dt) end
local map = vim.api.nvim_set_keymap local setting = {noremap = true} -- navigating map('i', "<C-a>", "<Home>", {noremap = true}) map('i', "<C-e>", "<End>", {noremap = true}) map('i', "<C-f>", "<Right>", {noremap = true}) map('i', "<C-b>", "<Left>", {noremap = true}) map('i', "<C-p>", "<Up>", {noremap = true}) map('i', "<C-n>", "<Down>", {noremap = true}) map('n', '/', "<cmd>lua require('telescope.builtin').current_buffer_fuzzy_find()<cr>", setting) map('n', '<leader><space>', "<cmd>lua require('telescope.builtin').commands()<cr>", setting) -- hop -- map('n', '<leader>jj', "<cmd>lua require'hop'.hint_char1()<cr>", setting) -- files -- map('n', '<leader>ff', "<cmd>lua require('telescope.builtin').find_files()<cr>", setting) -- map('n', '<leader>fr', "<cmd>lua require('telescope.builtin').oldfiles()<cr>", setting) -- buffers -- map('n', '<leader>bb', "<cmd>lua require('telescope.builtin').buffers()<cr>", setting) -- search -- map('n', '<leader>sp', "<cmd>lua require('telescope.builtin').live_grep()<cr>", setting) -- map('n', '<leader>si', "<cmd>lua require('telescope.builtin').lsp_document_symbols()<cr>", setting) -- map('n', '<leader>sI', "<cmd>lua require('telescope.builtin').lsp_workspace_symbols()<cr>", setting) -- project map('n', '<leader>pp', ":lua require'telescope'.extensions.project.project{}<CR>", setting) -- lsp & code -- map('n', '<leader>ca', "<cmd>lua require('telescope.builtin').lsp_code_actions()<cr>", setting) -- map('n', '<leader>cr', "<cmd>lua vim.lsp.buf.rename()<CR>", setting) -- map('n', '<leader>cd', "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", setting) -- map('n', '<leader>cD', "<cmd>lua require('telescope.builtin').lsp_implements()<cr>", setting) map('n', 'gd', "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", setting) map('n', 'gD', "<cmd>lua require('telescope.builtin').lsp_implements()<cr>", setting) -- errors -- map('n', '<leader>el', "<cmd>Trouble<cr>", setting)
local class = require 'ext.class' local Equation = require 'symmath.op.Equation' local lt = class(Equation) lt.name = '<' lt.nameForExporterTable = {} lt.nameForExporterTable.LaTeX = '\\lt' lt.nameForExporterTable.SymMath = 'lt' function lt:switch() local a,b = table.unpack(self) return b:gt(a) end function lt:isTrue() if self[1]:getRealRange():last().finish < self[2]:getRealRange()[1].start then return true end if self[1]:getRealRange()[1].start > self[2]:getRealRange():last().finish then return false end end return lt
-- INFO: https://github.com/hrsh7th/nvim-cmp#recommended-configuration vim.o.completeopt = 'menuone,noselect' local cmp = require('cmp'); cmp.setup({ formatting = { format = require('lspkind').cmp_format(), }, mapping = { ['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), ['<C-y>'] = cmp.config.disable, ['<C-e>'] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), ['<CR>'] = cmp.mapping.confirm({ select = true }), }, snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, }, { { name = 'buffer' }, }) }); cmp.setup.cmdline('/', { sources = { { name = 'buffer' } } }); cmp.setup.cmdline(':', { sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) });
object_mobile_dressed_dark_jedi_master_male_gotal_01 = object_mobile_shared_dressed_dark_jedi_master_male_gotal_01:new { } ObjectTemplates:addTemplate(object_mobile_dressed_dark_jedi_master_male_gotal_01, "object/mobile/dressed_dark_jedi_master_male_gotal_01.iff")
return { { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67761 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67751 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67771 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67771, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67762 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67752 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67772 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67772, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67763 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67753 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67773 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67773, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67764 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67754 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67754, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67774 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67774, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67765 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67755 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67755, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67775 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67775, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67766 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67756 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67756, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67776 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67776, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67877 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67767 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67757 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67757, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67777 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67777, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67877 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67768 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67758 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67758, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67778 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67778, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67878 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67878, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67769 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67759 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67759, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67779 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67779, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67879 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67879, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, { effect_list = { { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67770 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67760 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetNil", targetAniEffect = "", arg_list = { weapon_id = 67760, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67780 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67780, delay = 0.25 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67880 } }, { type = "BattleSkillFire", casterAniEffect = "", target_choise = "TargetHarmRandomByWeight", targetAniEffect = "", arg_list = { weapon_id = 67880, delay = 0.25 } }, { type = "BattleSkillAddBuff", casterAniEffect = "", target_choise = "TargetSelf", targetAniEffect = "", arg_list = { buff_id = 11801 } } } }, uiEffect = "", name = "天城弹幕", cd = 0, painting = 1, id = 11800, picture = "1", castCV = "skill", desc = "", aniEffect = { effect = "jineng", offset = { 0, -2, 0 } }, effect_list = {} }
----------------------------------- -- Area: The Garden of Ru'Hmet -- NM: Qn'aern -- Note: The RNG versions in Garden assist Ix'Aern (DRK) -- All Qn'aerns can use their respective two-hour abilities multiple times (guessing 2-minute timers) ----------------------------------- mixins = {require("scripts/mixins/job_special")} require("scripts/globals/status") ----------------------------------- function onMobSpawn(mob) tpz.mix.jobSpecial.config(mob, { specials = { {id = tpz.jsa.EES_AERN, hpp = math.random(90, 95), cooldown = 120} } }) end function onMobDeath(mob, player, isKiller) end
print("hello world") for v=0,10,2 do print("v = "..v) end print("end") for v=1, 10, 1 do print("k", v) end local i = 0 while true do if i % 200000 == 0 then print("i = ", i) i = 0 end i = i + 1 end print("wwwwwww")
---------------------------------------------------------------------------- -- _ _ _______ _____ _____ _______ _____ _______ _______ -- -- | | | | | | | | |______ |______ -- -- |_____| | __|__ |_____ __|__ | __|__ |______ ______| -- ---------------------------------------------------------------------------- require 'cairo' require 'imlib2' require 'rsvg' local i3bar_util = {} -- keep cairo transformation matrix after execute cb() -- cr: cairo_t, created by cairo_create() -- cb: function, callback function i3bar_util.keep_mat(cr, cb) -- store current transformation matrix local mat = cairo_matrix_t.create() cairo_get_matrix(cr,mat) -- execute callback function cb() -- restore transformation matrix cairo_set_matrix(cr, mat) mat = nil end -- function keep_mat -- skew current transformation matrix(CTM) -- in cr by T on X axis -- supplement to cairo's transform function i3bar_util.skewX(cr, T) local mat = cairo_matrix_t.create() cairo_matrix_init(mat, 1, 0, T, 1, 0, 0 ) cairo_transform(cr, mat) mat = nil end -- function skewX -- skew current transformation matrix(CTM) -- in cr by T on Y axis -- supplement to cairo's transform function i3bar_util.skewY(cr, T) local mat = cairo_matrix_t.create() cairo_matrix_init(mat, 1, T, 0, 1, 0, 0 ) cairo_transform(cr, mat) mat = nil end -- function skewY -- Draw SVG function -- Usage: -- draw_svg({x=0,y=0,h=20,w=20,file="/path/to/awesome.svg"}) function i3bar_util.draw_svg(im) local x, y, w, h local file x = (im.x or 0) y = (im.y or 0) w = (im.w or 0) h = (im.h or 0) file = tostring(im.file) if file == nil then print("need svg file") end ----------- local handle = rsvg_handle_new_from_file(file) i3bar_util.keep_mat(im.cr, function () local dimensions = RsvgDimensionData.create() rsvg_handle_get_dimensions(handle, dimensions) local x_factor = w / dimensions['width'] local y_factor = h / dimensions['height'] local scale_factor = math.min(x_factor, y_factor) if scale_factor == 0 then scale_factor = 1 end cairo_translate(im.cr, x, y) -- translate bofore scale! cairo_scale(im.cr, scale_factor, scale_factor) rsvg_handle_render_cairo(handle, im.cr) end) rsvg_destroy_handle(handle) handle = nil end -- function draw_svg -- Draw raster image function -- usage: -- image({x=100,y=100,h=50,w=50,file="/home/username/cute_puppy.png"}) -- Ref: -- https://github.com/brndnmtthws/conky/wiki/Using-Lua-scripts-in-conky:-Useful-functions-and-code#image-display-function function i3bar_util.draw_raster(im) local x, y, w, h local file x = (im.x or 0) y = (im.y or 0) w = (im.w or 0) h = (im.h or 0) file = tostring(im.file) if file == nil then print("need svg file") end --------------------------------------------- local show = imlib_load_image(file) if show == nil then return end local width, height imlib_context_set_image(show) if tonumber(w) == 0 then width = imlib_image_get_width() else width = tonumber(w) end if tonumber(h) == 0 then height = imlib_image_get_height() else height = tonumber(h) end imlib_context_set_image(show) local scaled = imlib_create_cropped_scaled_image( 0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height) imlib_free_image() imlib_context_set_image(scaled) imlib_render_image_on_drawable(x, y) imlib_free_image() show = nil scaled = nil end -- function draw_raster return i3bar_util
-- Description: -- Construct and return the BaseGUI object return function() local BaseGUI = { -- NeedsTicks :: bool -- True if gui will require ticks. NeedsTicks = false } -- OnShow( Self, Event ) :: bool -- Shows the GUI. -- playerIndex -- Self: is a table that contains data used by a specific gui. Data is retained -- accross all events, and can be used to store state information. However -- it is not retained across a save-load. -- If called due to an entity with a node being clicked on, will contain the node and handler. -- Returns: true if the GUI is shown, false if it is not function BaseGUI:OnShow(event) return false end -- OnClose( Self, uint ) :: void -- Closes the GUI. -- playerIndex -- Self: Gui data. @See BaseGUI:OnShow for more details. -- Note: It must be acceptable that Self may be nil, and the GUI must still close! function BaseGUI:OnClose(playerIndex) end -- OnTick( Self, uint, uint ) :: bool -- Called if NeedsTicks is true, every game tick -- Self: Gui data. @See BaseGUI:OnShow for more details. -- Returns: True to keep gui open, return false to close it function BaseGUI:OnTick(playerIndex, tick) return false end -- OnPlayerChangedSelectionElement( Self, Event ) :: void -- Called when the player has changed a selection element for this node. -- Self: Gui data. @See BaseGUI:OnShow for more details. function BaseGUI:OnPlayerChangedSelectionElement(event) end -- OnPlayerChangedCheckboxElement( Self, Event ) :: void -- Called when the player clicks a checkbox in the nodes GUI. -- Self: Gui data. @See BaseGUI:OnShow for more details. function BaseGUI:OnPlayerChangedCheckboxElement(event) end -- OnPlayerChangedDropDown( Self, Event ) :: void -- Called when the player changes a dropdown. -- Self: Gui data. @See BaseGUI:OnShow for more details. function BaseGUI:OnPlayerChangedDropDown(event) end -- OnPlayerClicked( Self, Event ) :: void -- Called when the player clicks something. -- Self: Gui data. @See GuiManager::OnElementClicked for more details. function BaseGUI:OnPlayerClicked(event) end -- OnPlayerChangedText( Self, Event ) :: void -- Called when the player types in a text element function BaseGUI:OnPlayerChangedText(event) end -- OnPlayerChangedSlider( Self, Event ) :: void -- Called when the player moves a slider function BaseGUI:OnPlayerChangedSlider(event) end return BaseGUI end
require 'image' require 'xlua' require 'lmdb' local gm = require 'graphicsmagick' local DataProvider = require 'DataProvider' local config = require 'Config' -------------------------------Settings---------------------------------------------- local PreProcess = function(Img) local im = image.scale(Img, '^' .. config.ImageMinSide) --minimum side of ImageMinSide if im:dim() == 2 then im = im:reshape(1,im:size(1),im:size(2)) end if im:size(1) == 1 then im=torch.repeatTensor(im,3,1,1) end if im:size(1) > 3 then im = im[{{1,3},{},{}}] end return im end local LoadImgData = function(filename) local img = gm.Image(filename):toTensor('float','RGB','DHW') if img == nil then print('Image is buggy') print(filename) os.exit() end img = PreProcess(img) if config.Compressed then return image.compressJPG(img) else return img end end function NameFile(filename) local name = paths.basename(filename,'JPEG') local substring = string.split(name,'_') if substring[1] == 'ILSVRC2012' then -- Validation file local num = tonumber(substring[3]) return config.ImageNetClasses.ClassNum2Wnid[config.ValidationLabels[num]] .. '_' .. num else -- Training file return name end end function LMDBFromFilenames(filenamesProvider,env) env:open() local txn = env:txn() local cursor = txn:cursor() for i=1, filenamesProvider:size() do local filename = filenamesProvider:getItem(i) local data = {Data = LoadImgData(filename), Name = NameFile(filename)} cursor:put(config.Key(i),data, lmdb.C.MDB_NODUPDATA) if i % 1000 == 0 then txn:commit() print(env:stat()) collectgarbage() txn = env:txn() cursor = txn:cursor() end xlua.progress(i,filenamesProvider:size()) end txn:commit() env:close() end local TrainingFiles = DataProvider.FileSearcher{ Name = 'TrainingFilenames', CachePrefix = config.TRAINING_DIR, MaxNumItems = 1e8, CacheFiles = true, PathList = {config.TRAINING_PATH}, SubFolders = true, Verbose = true } local ValidationFiles = DataProvider.FileSearcher{ Name = 'ValidationFilenames', CachePrefix = config.VALIDATION_DIR, MaxNumItems = 1e8, PathList = {config.VALIDATION_PATH}, Verbose = true } local TrainDB = lmdb.env{ Path = config.TRAINING_DIR, Name = 'TrainDB' } local ValDB = lmdb.env{ Path = config.VALIDATION_DIR, Name = 'ValDB' } TrainingFiles:shuffleItems() LMDBFromFilenames(ValidationFiles, ValDB) LMDBFromFilenames(TrainingFiles, TrainDB)
-------------------------------------------------------------------------------- -- АРС-АЛС -------------------------------------------------------------------------------- Metrostroi.DefineSystem("ALS_ARS") TRAIN_SYSTEM.DontAccelerateSimulation = true if CreateConVar then --[[concommand.Add("metrostroi_give_upps", function(ply, _, args) print("Trains on server: "..Metrostroi.TrainCount()) if CPPI then local N = {} for k,v in pairs(Metrostroi.TrainClasses) do local ents = ents.FindByClass(v) for k2,v2 in pairs(ents) do N[v2:CPPIGetOwner() or "(disconnected)"] = (N[v2:CPPIGetOwner() or "(disconnected)"] or 0) + 1 end end for k,v in pairs(N) do print(k,"Trains count: "..v) end end end)]]-- --CreateConVar("metrostroi_upps",0,FCVAR_ARCHIVE) end function TRAIN_SYSTEM:Initialize() self.Train:LoadSystem("UOS","Relay","Switch") self.Train:LoadSystem("BPS","Relay","Switch",{ normally_closed = true }) -- ALS state self.Signal80 = false self.Signal70 = false self.Signal60 = false self.Signal40 = false self.Signal0 = false self.Special = false self.NoFreq = true -- Internal state self.Speed = 0 self.SpeedLimit = 0 self.NextLimit = 0 self.Ring = false self.Overspeed = false self.ElectricBrake = false self.PneumaticBrake1 = false self.PneumaticBrake2 = true self.PneumaticBrake2_1 = false self.AttentionPedal = false -- ARS wires self["33D"] = 0 self["33G"] = 0 self["33Zh"] = 0 self["2"] = 0 self["6"] = 0 self["8"] = 0 self["20"] = 0 --self["21"] = 0 self["29"] = 0 self["31"] = 0 self["32"] = 0 -- Lamps self.LKT = false self.LVD = false self.AutodriveEnabled = false self.KSZD = false self.AutoTimer = false if not TURBOSTROI then self.Train:SetNWString("CustomStr6" ,"BCCD") self.Train:SetNWString("CustomStr10","Disable auto opening doors") self.Train:SetNWString("CustomStr11","Autodrive") self.Train:SetNWString("CustomStr13","Auto") self.Train:SetNWString("CustomStr12","Announcer") end end function TRAIN_SYSTEM:Outputs() return { "2", "8", "20", "31", "32", "29", "33D", "33G", "33Zh", "Speed", "Signal80","Signal70","Signal60","Signal40","Signal0","Special","NoFreq", "SpeedLimit", "NextLimit","Ring" } end function TRAIN_SYSTEM:Inputs() return { "AttentionPedal" } end function TRAIN_SYSTEM:TriggerInput(name,value) local Train = self.Train if name == "AttentionPedal" then self.AttentionPedal = value > 0.5 if Train and Train.PB then Train.PB:TriggerInput("Set",value) end end end local function GetStationRK(mu,dX) -- Calculate RK position based on distance and autodrive profile local TargetBrakeRKPosition = 1 if dX < 160+35*mu then TargetBrakeRKPosition = 1 end if dX < 70+35+25*mu then TargetBrakeRKPosition = 3 end if dX < 50+30+20*mu then TargetBrakeRKPosition = 5 end if dX < 20+25+15*mu then TargetBrakeRKPosition = 9 end if dX < 10+20+10*mu then TargetBrakeRKPosition = 12 end if dX < 15 then TargetBrakeRKPosition = 13 end if dX < 12 then TargetBrakeRKPosition = 15 end if dX < 8 then TargetBrakeRKPosition = 16 end if dX < 5 then TargetBrakeRKPosition = 18 end return TargetBrakeRKPosition end function TRAIN_SYSTEM:UPPS(Train) -- Calculate distance to station local Station = Train:ReadCell(49160) > 0 and Train:ReadCell(49160) or Train:ReadCell(49161) local Corrections = { [110] = 1.50, [111] = -0.10, [113] = -0.05, --[114] = -0.05, [114] = 0.70, [117] = -0.15, [118] = 1.40, [121] = -0.10, [122] = -0.10, [123] = 3.00, [322] = 3.00, } local dX = Train:ReadCell(49165) - 10 - 5 + 6.5 - 3.3 + (Corrections[Station] or 0) local RKPosition = math.floor(Train.RheostatController.Position+0.5) local mu = 0.5 --local OnStation = dX < (160+35*mu - (speedLimit == 40 and 30 or 0)) and not self.StartMoving and Metrostroi.WorkingStations[Station] local TargetBrakeRKPosition = GetStationRK(mu, dX) local RheostatBrakeRotating = RKPosition < TargetBrakeRKPosition local PneumaticValve1 = dX < 1.55 or self.Speed > 50 --self.PneumaticBrake2 = dX < 1.55 and self.Speed < 0.1 -- Enter commands self["29"] = PneumaticValve1 and 1 or 0 -- Engage PN1 self["33D"] = 0 self["33G"] = 1 self["33Zh"] = 0 self["2"] = RheostatBrakeRotating and 1 or 0 --T2 self["6"] = 1 --Engage brakes self["20"] = 1 -- Engage power circuits Train:WriteCell(17,1) timer.Simple(0.1,function() if not IsValid(Train) then return end Train:WriteCell(17,0) end) end function TRAIN_SYSTEM:Autodrive(Train) -- Calculate distance to station local Station = Train:ReadCell(49160) > 0 and Train:ReadCell(49160) or Train:ReadCell(49161) local Path = Train:ReadCell(65510) local Corrections = { [110] = 1.50, [111] = -0.10, [113] = -0.05, --[114] = -0.05, [114] = 0.70, [117] = -0.15, [118] = 1.40, [121] = -0.10, [122] = -0.10, [123] = 3.00, [322] = 3.00, } local dX = Train:ReadCell(49165) - 10 - 5 + 6.5 - 3.3 + (Corrections[Station] or 0) -- Target and real RK position (0 if not braking) local TargetBrakeRKPosition = 0 local RKPosition = math.floor(Train.RheostatController.Position+0.5) -- Calculate next speed limit local speedLimit = self.NextLimit if speedLimit == 0 then speedLimit = 20 end -- Get angle local Slope = Train:GetAngles().pitch -- Check speed constraints if self.Speed > (speedLimit - 5) then self.NoAcceleration = true end if self.Speed < (speedLimit - 9) then self.NoAcceleration = false end local Brake = false local Accelerate = false local threshold = 1.0 + (Slope > 1 and 1 or 0) -- Slow down on slopes if self.Speed > speedLimit - 5 - (self.NoAcceleration and 4 or 9) then if Slope > 1 then if speedLimit == 40 then TargetBrakeRKPosition = 7 elseif speedLimit > 40 then TargetBrakeRKPosition = 1 Brake = (self.Speed > speedLimit - 4) end end end -- Slow down if overspeeding soon if (self.Speed > (speedLimit - threshold)) then TargetBrakeRKPosition = 18 end -- How smooth braking should be (higher mu = more gentle braking) local mu = 0 -- Full stop command if self.SpeedLimit < 30 then TargetBrakeRKPosition = 18 Brake = true end local OnStation = dX < (160+35*mu - (speedLimit == 40 and 30 or 0)) and not self.StartMoving and Metrostroi.AnnouncerData[Station] -- Calculate RK position based on distance and autodrive profile if OnStation then TargetBrakeRKPosition = GetStationRK(mu, dX) else if dX > (160+35*mu - (speedLimit == 40 and 30 or 0)) then self.StartMoving = nil end end -- Generate commands local ElectricBrakeActive = FullStop or TargetBrakeRKPosition > 0 local AcceleratingActive = not ElectricBrakeActive and not self.NoAcceleration and Slope < 1 -- Generate brake rheostat rotation local RheostatBrakeRotating = Brake or RKPosition < TargetBrakeRKPosition -- Generate accel rheostat rotation local PP = math.floor(Train.PositionSwitch.Position + 0.5) == 2 --print(Train.Electric.Itotal) local AmpNorm = Train.Electric.Itotal < (350 - (Train:GetPhysicsObject():GetMass()-30000)/24) * math.floor(Train.PositionSwitch.Position + 0.5) local RheostatAccelRotating = AcceleratingActive if Slope < -2 then --if PP and (8 <= RKPosition and RKPosition <= 12) then RheostatAccelRotating = AmpNorm --end end local PneumaticValve1 = ((dX < 1.55) and (self.Speed > 0.1) and OnStation) or (self.Speed > (self.SpeedLimit - threshold)) --or (Train:ReadCell(6) > 0 and Train:ReadCell(18) < 1 and Slope > 1) --Disable autodrive on end of station brake --local StatID = Metrostroi.WorkingStations[Station] or Metrostroi.WorkingStations[Station + (Path == 1 and 1 or -1)] or 0 if (TargetBrakeRKPosition == 18 and self.Speed < 0.1 and not self.StartMoving and OnStation) or (self.StartMoving and 5 < dX and dX < 160) then if (TargetBrakeRKPosition == 18 and self.Speed < 0.1 and not self.StartMoving and OnStation) then --print("Stopped on "..Curr[1]..", "..(Curr[2] and "right side" or "left side")..", next station is "..(Next and (Next[1]..", "..(Next[2] and "right side" or "left side")) or "nil")) Train.VUD1:TriggerInput("Set",0) self.VUDOverride = true local Station = self.Train:ReadCell(49160) > 0 and self.Train:ReadCell(49160) or self.Train:ReadCell(49161) if Station == 0 then return end --local StatID = Metrostroi.WorkingStations[Station] or Metrostroi.WorkingStations[Station + (Path == 1 and 1 or -1)] or 0 local Curr = Metrostroi.AnnouncerData[Station] if Train.CustomA.Value < 0.5 then if Curr[2] then Train:WriteCell(32,1) else Train:WriteCell(31,1) end timer.Simple(0.1,function() if not IsValid(Train) then return end Train:WriteCell(32,0) Train:WriteCell(31,0) end) self.AutoTimer = CurTime() + 30 end end self.AutrodriveReset = true return end -- Enter commands self["29"] = PneumaticValve1 and 1 or 0 -- Engage PN1 Train:WriteCell(1, AcceleratingActive and 1 or 0) --Engage engines Train:WriteCell(2, (RheostatAccelRotating or (ElectricBrakeActive and RheostatBrakeRotating)) and 1 or 0) --X2/T2 Train:WriteCell(3, (self.Speed > 30 and RheostatAccelRotating) and 1 or 0) --X3 Train:WriteCell(6, ElectricBrakeActive and 1 or 0) --Engage brakes Train:WriteCell(20,(ElectricBrakeActive or not self.NoAcceleration) and 1 or 0) -- Engage power circuits Train:WriteCell(17,1) timer.Simple(0.1,function() if not IsValid(Train) then return end Train:WriteCell(17,0) end) end function TRAIN_SYSTEM:Think() local Train = self.Train local OverrideState = false if (not Train.VB) or (not Train.ALS) or (not Train.ARS) or (not Train.KV) then OverrideState = true end -- ALS, ARS state local KRUEnabled = Train.KRU and Train.KRU.Position > 0 local EnableARS = OverrideState or ((Train.ARS.Value == 1.0) and (Train.VB.Value == 1.0) and (Train.KV.ReverserPosition ~= 0.0 or KRUEnabled)) local EnableALS = OverrideState or ((Train.ALS.Value == 1.0) and (Train.VB.Value == 1.0)) local EnableUOS = (Train.UOS.Value == 1.0) and (Train.VB.Value == 1.0) and ((Train.KV.ReverserPosition ~= 0.0) or KRUEnabled) -- Pedal state if (Train.PB) and ((Train.PB.Value+Train.KVT.Value) >= 1.0) then self.AttentionPedal = true end if (Train.PB) and ((Train.PB.Value+Train.KVT.Value) < 1.0) then self.AttentionPedal = false end -- Ignore pedal if self.IgnorePedal and self.AttentionPedal then self.AttentionPedal = false else self.IgnorePedal = false end -- Speed check and update speed data if CurTime() - (self.LastSpeedCheck or 0) > 0.5 then self.LastSpeedCheck = CurTime() self.Speed = (Train.Speed or 0) end -- Check ARS signals if EnableALS --[[or EnableUOS]] then self.Timer = self.Timer or CurTime() if CurTime() - self.Timer > 1.00 then self.Timer = CurTime() -- Get train position local pos = Metrostroi.TrainPositions[Train] if pos then pos = pos[1] end -- Get previous ARS section local ars if pos then ars = Metrostroi.GetARSJoint(pos.node1,pos.x,false) end if ars then self.Signal80 = ars:GetActiveSignalsBit(10) self.Signal70 = ars:GetActiveSignalsBit(11) self.Signal60 = ars:GetActiveSignalsBit(12) self.Signal40 = ars:GetActiveSignalsBit(13) self.Signal0 = ars:GetActiveSignalsBit(14) self.Special = ars:GetActiveSignalsBit(15) self.NoFreq = false if not (self.Signal80 or self.Signal70 or self.Signal60 or self.Signal40 or self.Signal0) then self.NoFreq = true end else self.Signal80 = false self.Signal70 = false self.Signal60 = false self.Signal40 = false self.Signal0 = false self.Special = false self.NoFreq = true end end else self.Signal80 = false self.Signal70 = false self.Signal60 = false self.Signal40 = false self.Signal0 = false self.Special = false self.NoFreq = false end -- ARS system placeholder logic if EnableALS --[[or EnableUOS]] then local V = math.floor(self.Speed +0.05) local Vlimit = 0 if self.Signal40 then Vlimit = 40 end if self.Signal60 then Vlimit = 60 end if self.Signal70 then Vlimit = 70 end if self.Signal80 then Vlimit = 80 end self.Overspeed = false if (not self.AttentionPedal) and (V > Vlimit) and (V > (self.NoFreq and 0 or 3)) then self.Overspeed = true end if ( self.AttentionPedal) and (Vlimit ~= 0) and (V > Vlimit) then self.Overspeed = true end if ( self.AttentionPedal) and (Vlimit == 0) and (V > 20) then self.Overspeed = true end --self.Ring = self.Overspeed and (self.Speed > 5) -- Determine next limit and current limit self.SpeedLimit = Vlimit self.NextLimit = Vlimit if self.Signal80 then self.NextLimit = 80 end if self.Signal70 then self.NextLimit = 70 end if self.Signal60 then self.NextLimit = 60 end if self.Signal40 then self.NextLimit = 40 end if self.Signal0 then self.NextLimit = 0 end --[=[if EnableUOS then --hack --[[ if self.NextLimit >= 60 then self.SpeedLimit = 40 else self.SpeedLimit = 20 end]] self.SpeedLimit = 40 self.Overspeed = false if (not self.AttentionPedal) then self.Overspeed = true end if ( self.AttentionPedal) and (V > self.SpeedLimit) then self.Overspeed = true end else]=] if not EnableARS then self.ElectricBrake = false self.PneumaticBrake1 = false self.PneumaticBrake2 = true end --self.Ring = false else self.SpeedLimit = 0 self.NextLimit = 0 self.Overspeed = true end if EnableARS then -- Check absolute stop if self.NoFreq and (not self.PrevNoFreq) then self.IgnorePedal = true end self.PrevNoFreq = self.NoFreq -- Check overspeed if self.Overspeed then self.ElectricBrake = true self.PneumaticBrake2 = true self.PV1Timer = CurTime() end -- Check cancel of overspeed command if self.AttentionPedal and (not self.Overspeed) then self.ElectricBrake = false self.PneumaticBrake2 = false end -- Parking brake limit triggerSpeed = 5.0 if (Train:ReadTrainWire(6) > 0) then triggerSpeed = 0.25 end local BPSWorking = (Train:GetAngles().pitch > 1 or Train:GetAngles().pitch < -1) and (Train.BPS ~= nil and Train.BPS.Value > 0.5) and not KRUEnabled -- Check parking brake functionality self.TW1Timer = self.TW1Timer or -1e9 if (self.Speed < triggerSpeed + (BPSWorking and 5 or 0)) and (((CurTime() - self.TW1Timer) > 5) or BPSWorking) and ((Train:ReadTrainWire(2) > 0) or (Train:ReadTrainWire(6) < 1)) then self.PneumaticBrake1 = true self.PneumaticBrake2_1 = BPSWorking end if BPSWorking and Train.Panel and Train.Panel["GreenRP"] > 0.5 and self.Speed < 5 then self.StoppedOnSlopeByRP = true end -- Check cancel pneumatic brake 1 command --if (Train.RV2) and (Train.RV2.Value > 0) then if ((Train:ReadTrainWire(1) > 0) or (KRUEnabled and Train.KRP.Value > 0 and not self.ElectricBrake)) then if Train.Pneumatic.BrakeCylinderPressure < 2.1 then Train.AVT:TriggerInput("Set",1) else self.PneumaticBrake2_1 = false if Train.Panel and Train.Panel["GreenRP"] < 0.5 then self.StoppedOnSlopeByRP = nil end end if (BPSWorking and Train.LK4.Value > 0 and Train.KV.ControllerPosition > 0) or not BPSWorking then self.PneumaticBrake1 = false self.PneumaticBrake2_1 = false if Train.Panel and Train.Panel["GreenRP"] < 0.5 then self.StoppedOnSlopeByRP = nil end self.TW1Timer = CurTime() end end -- Door close cancel pneumatic brake 1 command trigger if (Train:GetSkin() == 1) and (Train.KD) and Train.SubwayTrain.Name:sub(1,-2) == "81-71" then -- Prepare if (Train.KD.Value == 0) then self.KDReadyToRelease = true end if (Train.KD.Value == 1) and (self.KDReadyToRelease == true) then self.KDReadyToRelease = false self.PneumaticBrake1 = false self.TW1Timer = CurTime() - 2.0 end end -- Check use of valve #1 during overspeed self.PV1Timer = self.PV1Timer or -1e9 if ((CurTime() - self.PV1Timer) < 0.45) then self.PneumaticBrake1 = false end if ((CurTime() - self.PV1Timer) < 0.35) then self.PneumaticBrake1 = true end -- ARS signals local Ebrake,Pbrake1,Pbrake2 = (self.ElectricBrake and 1 or 0), (self.PneumaticBrake1 and 1 or 0), (self.PneumaticBrake2 and 1 or 0) -- Apply ARS system commands self["33D"] = (1 - Ebrake)*(1 - Pbrake2) self["33G"] = Ebrake self["33Zh"] = 1-Ebrake self["2"] = Ebrake self["20"] = Ebrake self["29"] = Pbrake1 + ((self.PneumaticBrake2_1 or self.StoppedOnSlopeByRP) and 1 or 0) --print(Train.Speed) self["8"] = Pbrake2*((((CurTime() - self.PV1Timer) > 2.5) and 1 or 0) + ((KRUEnabled) and 1 or 0)*Ebrake) + ((self.PneumaticBrake2_1 or self.StoppedOnSlopeByRP or (self.SpeedLimit < 20 and not self.AttentionPedal)) and 1 or 0) -- Show lamps self.LKT = (self["33G"] > 0.5) or (self["29"] > 0.5) or (Train:ReadTrainWire(35) > 0) self.LVD = self["33D"] < 0.5 self.Ring = self.LVD or self.KSZD elseif EnableUOS then if (Train.RPB) and not self.AttentionPedal then Train.RPB:TriggerInput("Open",1) end local KRP = (Train.KRP ~= nil and Train.KRP.Value > 0.5) and self.Speed + 0.5 <= 40 and 1 or 0 --local Pbrake2 = (self.Overspeed and 1 or 0) -- Apply ARS system commands self["33D"] = KRP self["33G"] = 0 self["33Zh"] = KRP self["2"] = 0 self["20"] = 0 self["29"] = 0 self["8"] = (self.Speed + 0.5 > 40) and 1 or 0--Pbrake2 self.LKT = false self.LVD = false self.Ring = false else if (Train.RPB) and not self.AttentionPedal then Train.RPB:TriggerInput("Open",1) end self.ElectricBrake = true self.PneumaticBrake1 = false self.PneumaticBrake2 = true self["33D"] = 1 self["33Zh"] = 1 self["8"] = 0 self["33G"] = 0 self["2"] = 0 self["20"] = 0 self["29"] = 0 self.LKT = false self.LVD = false self.Ring = false end -- ARS signalling train wires if EnableALS and EnableARS then self.Train:WriteTrainWire(21,self.LVD and 1 or 0)--self.LKT and 1 or 0) else--if not EnableUOS then self.Train:WriteTrainWire(21,0) end -- ARS anti-door-closing if EnableARS then local SD = self.Train:ReadTrainWire(15) if (SD < 1.0) and (self.Speed > 6.0) then self["31"] = 1 self["32"] = 1 else self["31"] = 0 self["32"] = 0 end end -- RC1 operation if self.Train.RC1 and (self.Train.RC1.Value == 0) then if not EnableUOS then self["33D"] = 1 self["33Zh"] = 1 self["8"] = 0 end self["33G"] = 0 -- self["2"] = 0 self["20"] = 0 self["29"] = 0 -- self["31"] = 0 self["32"] = 0 end -- 81-717 autodrive/autostop xpcall(function() if Train.Autodrive then --print(self.VUDOverride, ) if self.VUDOverride and self.Train.Panel["SD"] < 0.5 then self.VUDOverride = false end if self.AutoTimer and (self.AutoTimer - CurTime() <= 13 or (self.Train.Panel["SD"] > 0.5 and not self.VUDOverride)) then if Train.Announcer.AnnState and Train.Announcer.AnnState == 7 and Train.Announcer.Arrive and Train.CustomC.Value > 0.5 then self.Train.Announcer:AnnPlayDepeate() self.Train.Announcer.Arrive = false self.Train.Announcer.AnnState7NeedRedraw = true end end if (self.Train.Announcer and Train.Announcer.AnnState and Train.Announcer.AnnState == 7) and self.AutoTimer and Train.CustomC.Value > 0.5 then if Train:ReadCell(48) == 218 then self.KSZD = true end elseif self.AutoTimer and self.AutoTimer - CurTime() <= 8 then self.KSZD = true end if Train.Custom5.Value > 0.5 then Train:WriteCell(31,1) Train:WriteCell(32,1) timer.Simple(0.1,function() if not IsValid(Train) then return end Train:WriteCell(32,0) Train:WriteCell(31,0) end) end if self.KSZD then if self.AutoTimer then if self.Train.Panel["SD"] > 0.5 then self.AutoTimer = nil self.KSZD = false end end if self.AttentionPedal then self.AutoTimer = nil self.KSZD = false end end if not self.VUDOverride and self.AutoTimer and self.AutoTimer - CurTime() > 8 and self.Train.Panel["SD"] > 0.5 then self.AutoTimer = nil self.KSZD = true if self.Train.Announcer and Train.Announcer.AnnState and Train.Announcer.AnnState == 7 and Train.CustomC.Value > 0.5 then Train.Announcer.Arrive = false self.Train.Announcer.AnnState7NeedRedraw = true end end if self.AutrodriveReset then self.NoAcceleration = nil if Train.KV.ControllerPosition <= 0.0 then Train:WriteCell(1,0) end if Train.KV.ControllerPosition == 0.0 then Train:WriteCell(20,0) end if Train.KV.ControllerPosition <= 1.5 and Train.KV.ControllerPosition >= -1.5 then Train:WriteCell(2,0) end if Train.KV.ControllerPosition <= 2.5 then Train:WriteCell(3,0) end if Train.KV.ControllerPosition >= 0.0 then Train:WriteCell(6,0) end self.AutodriveEnabled = false end if Train.CustomB.Value < 0.5 and self.AutrodriveReset then self.AutrodriveReset = false end --Disable autodrive, if KV pos is not zero, ARS or ALS not enabled, Reverser position is not forward or Driver value pos is > 2 if Train.KV.ControllerPosition ~= 0.0 or not EnableARS or not EnableALS or Train.KV.ReverserPosition ~= 1.0 or Train.Pneumatic.DriverValvePosition > 2 or self.Train.Panel["SD"] < 0.5 then self.AutrodriveReset = true end if Train.CustomB.Value > 0.5 and not self.AutodriveEnabled and not self.AutrodriveReset then --[[ if Train.Schedule then for k,v in pairs(Train.Schedule) do for k1,v1 in pairs(v) do print(k..":"..k1..":"..v1") end end end ]] self.AutodriveEnabled = true self.StartMoving = true end --print(self.AutodriveEnabled,self.AutrodriveReset) --[[if Train:CPPIGetOwner() and Train:CPPIGetOwner():GetName() ~= "glebqip(RUS)" and (self.AutodriveEnabled or not self.AutrodriveReset) then self.AutrodriveReset = true else]] if self.AutodriveEnabled then self:Autodrive(Train) end --end end end, function(err) print("ERROR:", err) self.AutrodriveReset = true self.KSZD = false self.AutoTimer = nil self.VUDOverride = false end) -- 81-717 special VZ1 button if self.Train.VZ1 then self["29"] = self["29"] + self.Train.VZ1.Value end -- Special UPPS behavior if self.Train.A45 and self.Train.A45.Value == 1 and (Train.KV) then local distance = Train:ReadCell(49165) local skip_station = false -- Check if station must be skipped local station = Train:ReadCell(49160) > 0 and Train:ReadCell(49160) or Train:ReadCell(49161) if not Metrostroi.AnnouncerData[station] then skip_station = true end if (self.AttentionPedal and distance < 120 and not self.UPPSOverride) or self.AutodriveEnabled or not Train.KV or Train.KV.ReverserPosition ~= 1.0 or Train.VB.Value ~= 1.0 or Train.KV.ControllerPosition <= -0.5 or not EnableARS or not EnableALS or (self.Train.RC1 and (self.Train.RC1.Value == 0))then self.UPPSOverride = true end if distance > 120 then self.UPPSOverride = false end if distance < 120 and Train.KV.ControllerPosition > -0.5 and not self.UPPSBraking and not self.UPPSOverride and not skip_station then self.UPPSBraking = true Train:PlayOnce("dura1","cabin",0.5,50.0) timer.Create("UPPSAlarm"..Train:EntIndex(),4,0,function() if IsValid(Train) then Train:PlayOnce("dura1","cabin",0.5,50.0) else timer.Remove("UPPSAlarm"..Train:EntIndex()) end end) end if ((distance > 120 or self.UPPSOverride) and self.UPPSBraking) or skip_station then self["2"] = 0 self["6"] = 0 self["20"] = 0 self["33D"] = 1 self["33G"] = 0 self["33Zh"] = 1 timer.Remove("UPPSAlarm"..Train:EntIndex()) self.UPPSBraking = false end if self.UPPSBraking then xpcall(function() self:UPPS(Train) end, function(err) print("ERROR:", err) self.AutrodriveReset = true self.KSZD = false self.AutoTimer = nil self.VUDOverride = false end) end -- Default trigger if (distance > 120) and (distance < 210) and (not skip_station) then self.UPPSArmed1 = true end if self.UPPSArmed1 and (distance < 120) and Train.VB.Value == 1.0 then Train:PlayOnce("upps","cabin",0.55,100.0) self.UPPSArmed1 = false end -- KV trigger if Train.KV and (Train.KV.ReverserPosition == 0.0) then self.UPPSArmed2 = true --self.UPPSTimer2 = CurTime() + 1.5 end if self.UPPSArmed2 and Train.KV and (Train.KV.ReverserPosition == 1.0) and Train.VB.Value == 1.0 then --and self.UPPSTimer2 and (CurTime() > self.UPPSTimer2) then Train:PlayOnce("upps","cabin",0.55,100.0) self.UPPSArmed2 = false end elseif self.UPPSBraking then self["2"] = 0 self["6"] = 0 self["20"] = 0 self["33D"] = 1 self["33G"] = 0 self["33Zh"] = 1 timer.Remove("UPPSAlarm"..Train:EntIndex()) self.UPPSBraking = false end end
require 'xlua' local DataPointer = torch.class('DataPointer') function DataPointer:__init(n_total) self.n_total = n_total if self.n_total > 0 then self.idx_perm = torch.randperm(self.n_total) self.current_pos = 1 else self.idx_perm = nil self.current_pos = nil end end function DataPointer:load_next_batch(batch_size) if self.n_total <= 0 then return nil end if batch_size == 0 then return nil end -- get indices local indices = torch.Tensor() if batch_size + self.current_pos - 1 <= self.n_total then indices = self.idx_perm:narrow(1, self.current_pos, batch_size) else local rest = batch_size + self.current_pos - 1 - self.n_total local part1 = self.idx_perm:narrow(1, self.current_pos, (self.n_total - self.current_pos + 1) ) local part2 = self.idx_perm:narrow(1, 1, rest) indices = torch.cat(part1, part2) end -- update pointer self.current_pos = self.current_pos + batch_size if self.current_pos >= self.n_total then -- reset to the initial position self.current_pos = 1 -- reshuffle the images self.idx_perm = torch.randperm(self.n_total); end return indices end
-- handle get request for / function handler.get(req, res) -- set data for index.html end
local skynet = require "skynet" local define = require "define" local RECORD_HOST = skynet.getenv("RECORD_HOST") local M = {} -- 代理可以直接创建房间,其他玩家不可以解散代理开的房,这里记录房主ID function M.init(info) local tOptions = {} -- 房主ID tOptions["master_id"] = info.player.userid -- 设置房间信息 for _, tData in pairs(info.room.options) do tOptions[tData.key] = tData.snvalue or 0 end tOptions["room_id"] = info.room.roomid tOptions["game_id"] = info.room.gameid -- 局数 if tOptions.room_card == 0 then tOptions.room_card = 6 else tOptions.room_card = tOptions.room_card * 6 end tOptions.player_count = define.GAME_PLAYER M.tOptions = tOptions end -- cost_card 消耗房卡数量,游戏未开始,解散房间,返还此消耗 -- room_id 房间ID -- master_id 房主ID -- game_id 游戏ID -- room_card 房卡->游戏局数 -- player_count -- show_card -- first_out -- press_card -- code_card function M.get(key) return M.tOptions[key] end function M.dump() local ret = {} for key, nValue in pairs(M.tOptions) do table.insert(ret, {key=key, nValue=nValue}) end return ret end function M.finish(msg) skynet.send("roommgr", "lua", "game_finish", msg) end function M.leave(msg) skynet.send("roommgr", "lua", "leave_room_result", msg) end function M.add_record_list(msg) skynet.send("httpclient", "lua", "post", RECORD_HOST, "/add_record_list", msg) end return M
------------------------------------- --- PANELS ------------------------------------- local Panels = MR.CL.Panels -- Section: load map modifications function Panels:SetLoad(parent, frameType, info) local frame = MR.CL.Panels:StartContainer("Load", parent, frameType, info) local width = frame:GetWide() local panel = vgui.Create("DPanel") panel:SetSize(width, 0) panel:SetBackgroundColor(Color(255, 255, 255, 0)) local loadListInfo = { width = frame:GetWide() * 0.70, height = 204, x = MR.CL.Panels:GetGeneralBorders(), y = MR.CL.Panels:GetGeneralBorders() } local loadButtonInfo = { width = panel:GetWide() - loadListInfo.x - loadListInfo.width - MR.CL.Panels:GetGeneralBorders() - MR.CL.Panels:GetGeneralBorders(), height = MR.CL.Panels:GetTextHeight(), x = loadListInfo.x + loadListInfo.width + MR.CL.Panels:GetGeneralBorders(), y = loadListInfo.y } local deleteButtonInfo = { width = loadButtonInfo.width, height = MR.CL.Panels:GetTextHeight(), x = loadButtonInfo.x, y = loadButtonInfo.y + loadButtonInfo.height + MR.CL.Panels:GetGeneralBorders() } local setAutoButtonInfo = { width = deleteButtonInfo.width, height = MR.CL.Panels:GetTextHeight(), x = deleteButtonInfo.x, y = deleteButtonInfo.y + loadButtonInfo.height + MR.CL.Panels:GetGeneralBorders() } local autoLoadPathInfo = { width = loadButtonInfo.width, height = MR.CL.Panels:GetTextHeight() * 1.7, x = loadButtonInfo.x, y = setAutoButtonInfo.y + loadButtonInfo.height + MR.CL.Panels:GetGeneralBorders() } local autoLoadResetInfo = { width = 16, height = 16, x = autoLoadPathInfo.x + autoLoadPathInfo.width - 16/1.5, y = autoLoadPathInfo.y + autoLoadPathInfo.height - 16/1.5 } local speedComboboxInfo = { width = deleteButtonInfo.width/1.6, height = MR.CL.Panels:GetComboboxHeight(), x = deleteButtonInfo.x + deleteButtonInfo.width/3 + MR.CL.Panels:GetGeneralBorders(), y = loadListInfo.height - MR.CL.Panels:GetTextHeight() + MR.CL.Panels:GetGeneralBorders()*2.8, } local speedLabelInfo = { width = deleteButtonInfo.width/2, height = MR.CL.Panels:GetTextHeight(), x = deleteButtonInfo.x, y = speedComboboxInfo.y - MR.CL.Panels:GetGeneralBorders(), } local loadCleanupBoxInfo = { x = speedLabelInfo.x, y = speedLabelInfo.y - speedLabelInfo.height + MR.CL.Panels:GetGeneralBorders() } local progressBoxInfo = { x = speedLabelInfo.x, y = loadCleanupBoxInfo.y - MR.CL.Panels:GetTextHeight() + MR.CL.Panels:GetGeneralBorders() } -------------------------- -- List -------------------------- local loadList = vgui.Create("DListView", panel) MR.CL.ExposedPanels:Set(loadList, "load", "text") loadList:SetSize(loadListInfo.width, loadListInfo.height) loadList:SetPos(loadListInfo.x, loadListInfo.y) loadList:SetMultiSelect(false) loadList:AddColumn("data/"..MR.Base:GetSaveFolder()) for k,v in pairs(MR.Load:GetList()) do loadList:AddLine(k) end loadList:SortByColumn(1) -------------------------- -- Load button -------------------------- local loadButton = vgui.Create("DButton", panel) loadButton:SetSize(loadButtonInfo.width, loadButtonInfo.height) loadButton:SetPos(loadButtonInfo.x, loadButtonInfo.y) loadButton:SetText("Load") loadButton:SetIcon("icon16/folder_go.png") loadButton.DoClick = function() -- Don't allow a person in an initial spawn condition to start a load if MR.Ply:GetFirstSpawn(LocalPlayer()) then return false end local panel = MR.CL.ExposedPanels:Get("load", "text") local value = panel:GetSelected()[1] and panel:GetSelected()[1]:GetColumnText(1) or "" net.Start("SV.Load:Start") net.WriteString(value) net.SendToServer() end -------------------------- -- Delete button -------------------------- local deleteButton = vgui.Create("DButton", panel) deleteButton:SetSize(deleteButtonInfo.width, deleteButtonInfo.height) deleteButton:SetPos(deleteButtonInfo.x, deleteButtonInfo.y) deleteButton:SetText("Delete") deleteButton:SetIcon("icon16/cancel.png") deleteButton.DoClick = function() local panel = MR.CL.ExposedPanels:Get("load", "text") local loadName = panel:GetSelected()[1] and panel:GetSelected()[1]:GetColumnText(1) or "" if loadName == "" then return end local qPanel = vgui.Create("DFrame") qPanel:SetTitle("Deletion Confirmation") qPanel:SetSize(285, 110) qPanel:SetPos(10, 10) qPanel:SetDeleteOnClose(true) qPanel:SetVisible(true) qPanel:SetDraggable(true) qPanel:ShowCloseButton(true) qPanel:MakePopup(true) qPanel:Center() local text = vgui.Create("DLabel", qPanel) text:SetPos(40, 25) text:SetSize(275, 25) text:SetText("Are you sure you want to delete this file?") local panel = vgui.Create("DPanel", qPanel) panel:SetPos(5, 50) panel:SetSize(275, 20) panel:SetBackgroundColor(MR.CL.Panels:GetFrameBackgroundColor()) local save = vgui.Create("DLabel", panel) save:SetPos(10, -2) save:SetSize(275, 25) save:SetText(loadName) save:SetTextColor(Color(0, 0, 0, 255)) local buttonYes = vgui.Create("DButton", qPanel) buttonYes:SetPos(22, 75) buttonYes:SetText("Yes") buttonYes:SetSize(120, 30) buttonYes.DoClick = function() -- Remove the load on every client qPanel:Close() net.Start("SV.Load:Delete") net.WriteString(loadName) net.SendToServer() end local buttonNo = vgui.Create("DButton", qPanel) buttonNo:SetPos(146, 75) buttonNo:SetText("No") buttonNo:SetSize(120, 30) buttonNo.DoClick = function() qPanel:Close() end end -------------------------- -- Auto load reset button -------------------------- local autoLoadReset = vgui.Create("DImageButton", panel) autoLoadReset:SetSize(autoLoadResetInfo.width, autoLoadResetInfo.height) autoLoadReset:SetPos(autoLoadResetInfo.x, autoLoadResetInfo.y) autoLoadReset:SetImage("icon16/cancel.png") autoLoadReset.DoClick = function() net.Start("SV.Load:SetAuto") net.WriteString("") net.SendToServer() if MR.Ply:IsAdmin(LocalPlayer()) then autoLoadReset:Hide() end end if GetConVar("internal_mr_autoload"):GetString() == "" then autoLoadReset:Hide() else timer.Simple(0.01, function() autoLoadReset:MoveToFront() end) end -------------------------- -- Auto load button -------------------------- local setAutoButton = vgui.Create("DButton", panel) setAutoButton:SetSize(setAutoButtonInfo.width, setAutoButtonInfo.height) setAutoButton:SetPos(setAutoButtonInfo.x, setAutoButtonInfo.y) setAutoButton:SetText("Set Auto") setAutoButton:SetTooltip("Auto load a saved file when the map starts.") setAutoButton:SetIcon("icon16/add.png") setAutoButton.DoClick = function() local panel = MR.CL.ExposedPanels:Get("load", "text") local loadName = panel:GetSelected()[1] and panel:GetSelected()[1]:GetColumnText(1) or "" net.Start("SV.Load:SetAuto") net.WriteString(loadName) net.SendToServer() if MR.Ply:IsAdmin(LocalPlayer()) then if loadName ~= "" then autoLoadReset:Show() autoLoadReset:MoveToFront() end end end -------------------------- -- Auto load path -------------------------- local autoLoadPath = vgui.Create("DTextEntry", panel) MR.Sync:Set(autoLoadPath, "load", "autoloadtext") autoLoadPath:SetSize(autoLoadPathInfo.width, autoLoadPathInfo.height) autoLoadPath:SetPos(autoLoadPathInfo.x, autoLoadPathInfo.y) autoLoadPath:SetFont("Default") autoLoadPath:SetConVar("internal_mr_autoload") autoLoadPath:SetMultiline(true) autoLoadPath:SetEnabled(false) autoLoadPath:SetText("") autoLoadPath.OnValueChange = function(self, value) if value ~= "" then autoLoadReset:Show() autoLoadReset:MoveToFront() else autoLoadReset:Hide() end end -------------------------- -- Progress checkbox -------------------------- local progressBox = vgui.Create("DCheckBoxLabel", panel) MR.Sync:Set(progressBox, "load", "progress") progressBox:SetPos(progressBoxInfo.x, progressBoxInfo.y) progressBox:SetText("Progress bar") progressBox:SetTextColor(Color(0, 0, 0, 255)) progressBox:SetValue(GetConVar("internal_mr_progress_bar"):GetBool()) progressBox.OnChange = function(self, val) -- Force the field to update and disable a sync loop block if MR.CL.Sync:GetLoopBlock() then MR.CL.Sync:SetLoopBlock(false) return -- Admin only: reset the option if it's not being synced elseif not MR.Ply:IsAdmin(LocalPlayer()) then progressBox:SetChecked(GetConVar("internal_mr_progress_bar"):GetBool()) end -- Start syncing net.Start("SV.Sync:Replicate") net.WriteString("internal_mr_progress_bar") net.WriteString(val and "1" or "0") net.WriteString("load") net.WriteString("progress") net.SendToServer() end -------------------------- -- Cleanup checkbox -------------------------- local loadCleanupBox = vgui.Create("DCheckBoxLabel", panel) MR.Sync:Set(loadCleanupBox, "load", "box") loadCleanupBox:SetPos(loadCleanupBoxInfo.x, loadCleanupBoxInfo.y) loadCleanupBox:SetText("Cleanup") loadCleanupBox:SetTextColor(Color(0, 0, 0, 255)) loadCleanupBox:SetValue(GetConVar("internal_mr_duplicator_cleanup"):GetBool()) loadCleanupBox.OnChange = function(self, val) -- Force the field to update and disable a sync loop block if MR.CL.Sync:GetLoopBlock() then MR.CL.Sync:SetLoopBlock(false) return -- Admin only: reset the option if it's not being synced elseif not MR.Ply:IsAdmin(LocalPlayer()) then loadCleanupBox:SetChecked(GetConVar("internal_mr_duplicator_cleanup"):GetBool()) end -- Start syncing net.Start("SV.Sync:Replicate") net.WriteString("internal_mr_duplicator_cleanup") net.WriteString(val and "1" or "0") net.WriteString("load") net.WriteString("box") net.SendToServer() end -------------------------- -- Speed label -------------------------- local speedLabel = vgui.Create("DLabel", panel) speedLabel:SetPos(speedLabelInfo.x, speedLabelInfo.y) speedLabel:SetSize(speedLabelInfo.width, speedLabelInfo.height) speedLabel:SetText("Speed:") speedLabel:SetTextColor(Color(0, 0, 0, 255)) -------------------------- -- Speed combobox -------------------------- local delay = GetConVar("internal_mr_delay"):GetString() local selectedID local options = MR.Duplicator:GetSpeeds() local i = 1 for k,v in pairs(options) do if v == tostring(delay) then selectedID = i break end i = i + 1 end local speedCombobox = vgui.Create("DComboBox", panel) MR.Sync:Set(speedCombobox, "load", "speed") speedCombobox:SetSize(speedComboboxInfo.width, speedComboboxInfo.height) speedCombobox:SetPos(speedComboboxInfo.x, speedComboboxInfo.y) local icons = { Fast = "icon16/control_end_blue.png", Normal = "icon16/control_fastforward_blue.png", Slow = "icon16/control_play_blue.png", NotDetected = "icon16/cog.png" } for k,v in pairs(options) do speedCombobox:AddChoice(k, v, nil, icons[k] or icons["NotDetected"]) end if selectedID then speedCombobox:ChooseOptionID(tonumber(selectedID)) end speedCombobox.OnSelect = function(self, index, value, data) -- Force the field to update and disable a sync loop block if MR.CL.Sync:GetLoopBlock() then if index ~= speedCombobox:GetSelected() then speedCombobox:ChooseOptionID(index) end MR.CL.Sync:SetLoopBlock(false) return -- Admin only: reset the option if it's not being synced elseif not MR.Ply:IsAdmin(LocalPlayer()) then speedCombobox:ChooseOptionID(GetConVar("internal_mr_delay"):GetInt()) end net.Start("SV.Sync:Replicate") net.WriteString("internal_mr_delay") net.WriteString(data) net.WriteString("load") net.WriteString("speed") net.SendToServer() end -- Margin bottom local extraBorder = vgui.Create("DPanel", panel) extraBorder:SetSize(MR.CL.Panels:GetGeneralBorders(), MR.CL.Panels:GetGeneralBorders()) extraBorder:SetPos(0, speedComboboxInfo.y + speedComboboxInfo.height) extraBorder:SetBackgroundColor(Color(0, 0, 0, 0)) return MR.CL.Panels:FinishContainer(frame, panel, frameType) end
DefineClass.TerrainPaintConstructionSite = { __parents = { "LandscapeConstructionSiteBase" }, work_request = false, work_required = false, last_progress_marked = 0, } local work_per_hex_for_terrain_painting = 1000 function TerrainPaintConstructionSite:GatherConstructionResources() if self.work_request then return end local landscape = Landscapes[self.mark] if not landscape then assert(false) return end local passed = {} LandscapeForEachObstructor(self.mark, function(obj) if not passed[obj] then if obj:GetEnumFlags(const.efRemoveUnderConstruction + const.efBakedTerrainDecal + const.efBakedTerrainDecalLarge) ~= 0 then DoneObject(obj) end passed[obj] = true end end) self.work_required = landscape.hexes * work_per_hex_for_terrain_painting self.work_request = self:AddWorkRequest("construct", 0, 0, self:GetMaxDrones()) self.construction_resources = {} self.construct_request = self.work_request self.state = "init_done" self:UpdateState() end function TerrainPaintConstructionSite:TryGoToNextState() if self.state == "work" then if self.work_request:GetActualAmount() <= 0 then self.state = "work_done" self:UpdateState() end end end function TerrainPaintConstructionSite:UpdateState() if self.state == "init_done" then if self.work_required > 0 then self.state = "work" self.work_request:AddAmount(self.work_required) else self.state = "work_done" end end if self.state == "work_done" then self.state = "complete" CreateGameTimeThread(self.Complete, self) end end function TerrainPaintConstructionSite:GetTotalLandscapeProgress() local total = self.work_required local progress = 0 if self.state == "work" then progress = self.work_required - self.work_request:GetActualAmount() elseif self.state == "work_done" or self.state == "complete" then progress = total end return MulDivTrunc(progress, 100, total) end function TerrainPaintConstructionSite:GetResourceProgress() local lines = {} if self.state == "work" then lines[#lines+1] = T{12395, "<em>Changing terrain</em><right><percent>%", percent = self:GetTotalLandscapeProgress()} end return table.concat(lines, "<newline><left>") end function TerrainPaintConstructionSite:UpdateLSProgress() local p = self:GetTotalLandscapeProgress() if p > self.last_progress_marked then LandscapeChangeTerrain(self.mark, p) self.last_progress_marked = p self:TryGoToNextState() end end function TerrainPaintConstructionSite:BuildingUpdate(delta, day, hour) if self.state == "work" and UIColony:IsTechResearched("LandscapingNanites") then local current_time = GameTime() if not self.auto_construct_ts_ls then self.auto_construct_ts_ls = current_time end if current_time - self.auto_construct_ts_ls >= construction_site_auto_construct_tick then self.auto_construct_ts_ls = current_time local req = self.work_request local a = req:GetActualAmount() local dec = Min(construction_site_auto_construct_amount, a) a = a - dec req:SetAmount(a) self:UpdateLSProgress(dec, req) RebuildInfopanel(self) end end end function TerrainPaintConstructionSite:GetDroneWorkAmount(drone, request, resource, amount) return amount end function TerrainPaintConstructionSite:RoverLoadResource(amount, resource, request) self:AddResource(amount, resource, true) end function TerrainPaintConstructionSite:AddResource(amount, resource) if resource == "construct" then self.work_request:AddAmount(amount * (const.ResourceScale / DroneResourceUnits.construct)) self:UpdateLSProgress(amount) return end end function TerrainPaintConstructionSite:Getdescription() return T{12470, "<em>Landscaping project.</em> Drones will gradually change the underlying surface towards the desired texture.", self} end
local skynet = require "skynet" local i = 0 local hello = "hello" function response.ping(hello) skynet.sleep(100) return hello end function accept.hello() i = i + 1 print (i, hello) end function response.error() error "throw an error" end function init( ... ) print ("ping server start:", ...) -- You can return "queue" for queue service mode -- return "queue" end function exit(...) print ("ping server exit:", ...) end
-- -- User: Glastis -- Date: 19-Nov-19 -- local widget = require( "widget" ) local composer = require( "composer" ) local scene = composer.newScene() --Forward reference for test function timer local testTimer local USE_IOS7_THEME = false local isGraphicsV1 = ( 1 == display.getDefault( "graphicsCompatibility" ) ) local tableSeparatorColor = { 0.86, 0.86, 0.86, 1 } if isGraphicsV1 then widget._convertColorToV1( tableSeparatorColor ) end local tableView function scene:create( event ) local group = self.view local xAnchor, yAnchor if not isGraphicsV1 then xAnchor = display.contentCenterX yAnchor = display.contentCenterY else xAnchor = 0 yAnchor = 0 end local fontColor = 0 local backColor = { 1 } local background = display.newRect( xAnchor, yAnchor, display.contentWidth, display.contentHeight ) if widget.USE_IOS_THEME then if isGraphicsV1 then background:setFillColor( 197, 204, 212, 255 ) else background:setFillColor( 197/255, 204/255, 212/255, 1 ) end elseif widget.USE_ANDROID_HOLO_LIGHT_THEME then if isGraphicsV1 then background:setFillColor( 255, 255, 255, 255 ) else background:setFillColor( 1, 1, 1, 1 ) end elseif widget.USE_ANDROID_HOLO_DARK_THEME then if isGraphicsV1 then background:setFillColor( 34, 34, 34, 255 ) else background:setFillColor( 34/255, 34/255, 34/255, 1 ) end fontColor = 0.5 backColor = { 34/255 } tableSeparatorColor = { 34/255 } else if isGraphicsV1 then background:setFillColor( 255, 255, 255, 255 ) else background:setFillColor( 1, 1, 1, 1 ) end end group:insert( background ) local backButtonPosition = 5 local backButtonSize = 34 -- Button to return to unit test listing local returnToListing = widget.newButton { id = "returnToListing", left = 0, top = backButtonPosition, label = "Exit", labelAlign = "center", width = 200, height = backButtonSize, cornerRadius = 8, onRelease = function() composer.gotoScene( "unitTestListing" ) end; } returnToListing.x = display.contentCenterX group:insert( returnToListing ) ---------------------------------------------------------------------------------------------------------------- -- START OF UNIT TEST ---------------------------------------------------------------------------------------------------------------- --Toggle these defines to execute tests. NOTE: It is recommended to only enable one of these tests at a time local TEST_SCROLL_TO_Y = false local TEST_SCROLL_TO_INDEX = false local TEST_DELETE_SINGLE_ROW = false local TEST_DELETE_ALL_ROWS = false local TEST_GET_CONTENT_POSITION = false local TEST_REMOVE_AND_RECREATE = false -- Listen for tableView events local function tableViewListener( event ) local phase = event.phase local direction = event.direction if "began" == phase then --print( "Began" ) elseif "moved" == phase then --print( "Moved" ) elseif "ended" == phase then --print( "Ended" ) elseif "stopped" == phase then --print( "Stopped" ) end if event.limitReached then if "up" == direction then print( "Reached Top Limit" ) elseif "down" == direction then print( "Reached Bottom Limit" ) elseif "left" == direction then print( "Reached Left Limit" ) elseif "right" == direction then print( "Reached Right Limit" ) end end return true end local noCategories = 0 -- Handle row rendering local function onRowRender( event ) local phase = event.phase local row = event.row --print( "Rendering row with id:", row.id ) --print( #tableView._view._rows ) local rowTitleText = "Row " .. row.index if row.isCategory then noCategories = noCategories + 1 rowTitleText = "Category" end local rowTitle if USE_IOS7_THEME and not row.isCategory then rowTitle = display.newText( row, rowTitleText, 0, 0, native.systemFont, 17 ) elseif USE_IOS7_THEME and row.isCategory then rowTitle = display.newText( row, rowTitleText, 0, 0, native.systemFontBold, 14 ) else rowTitle = display.newText( row, rowTitleText, 0, 0, nil, 14 ) end rowTitle.x = ( rowTitle.contentWidth * 0.5 + 15 ) rowTitle.y = row.contentHeight * 0.5 rowTitle.anchorY = 0.8 rowTitle:setFillColor( 0, 0, 0 ) if not row.isCategory then --print( row.index ) local spinner = widget.newSpinner{} spinner.x = row.x + ( row.contentWidth * 0.5 ) - ( spinner.contentWidth * 0.5 ) spinner.y = row.contentHeight * 0.5 spinner:scale( 0.5, 0.5 ) row:insert( spinner ) --spinner:start() end end -- Handle touches on the row local function onRowTouch( event ) local phase = event.phase local row = event.target if "swipeRight" == phase then print( "Swiped right on row with index: ", row.index ) elseif "swipeLeft" == phase then print( "Swiped left on row with id: ", row.id ) elseif "tap" == phase then print( "Tapped on row with id:", row.id ) elseif "press" == phase then print( "Pressed row with id: ", row.id ) -- Set the row's default/over color's --row:setRowColor( { default = { 255, 0, 0 }, over = { 0, 0, 255 } } ) print( row.params.rowIdentifier ) elseif "cancelled" == phase then print( "Cancelled event on row with index: ", row.index ) elseif "release" == phase then print( "Released row with index: ", row.index ) -- Test removing all rows and re-adding 20 more if TEST_REMOVE_AND_RECREATE then timer.performWithDelay( 500, function() tableView:deleteAllRows() -- Create 100 rows for i = 1, 20 do local isCategory = false local rowHeight = 40 --local rowColor = --{ -- default = { 255, 255, 255 } --} local lineColor = { 0.86, 0.86, 0.86, 1 } -- Make some rows categories if i == 8 or i == 25 or i == 50 or i == 75 then isCategory = true rowHeight = 24 --rowColor = --{ -- default = { 150, 160, 180, 200 }, --} end -- Insert the row into the tableView tableView:insertRow { id = "row:" .. i, isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, } end end) end end end -- Create a tableView tableView = widget.newTableView { top = 40, left = 0, x = 160, y = 260, width = display.contentWidth, height = display.contentHeight - 40, backgroundColor = backColor, onRowRender = onRowRender, onRowTouch = onRowTouch, listener = tableViewListener, } group:insert( tableView ) -- Create 200 rows for i = 1, 200 do local isCategory = false local rowHeight = 40 local rowColor = nil if not USE_IOS7_THEME then --rowColor = { -- default = { 255, 255, 255 }, -- over = { 217, 217, 217 }, --} end local lineColor = tableSeparatorColor; -- Make some rows categories ---[[ if i == 1 or i == 4 or i == 8 or i == 22 or i == 28 or i == 35 or i == 45 then isCategory = true rowHeight = 24 --rowHeight = 47 if not USE_IOS7_THEME then --rowColor = --{ -- default = { 150, 160, 180, 200 }, --} end end --]] local rowParams = { rowIdentifier = "testing"..i, } -- Insert the row into the tableView tableView:insertRow { id = "row:" .. i, isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, params = rowParams } end ---------------------------------------------------------------------------------------------------------------- -- TESTS ---------------------------------------------------------------------------------------------------------------- -- Test to scroll list to Y position if TEST_SCROLL_TO_Y then testTimer = timer.performWithDelay( 1000, function() tableView:scrollToY{ y = -300, time = 6000 } end, 1 ) end -- Test getting the content position if TEST_GET_CONTENT_POSITION then local function getPosition() print( "tableView content position is: ", tableView:getContentPosition() ) end tableView:scrollToY{ y = - 300, time = 600, onComplete = getPosition } end -- Test to scroll list to index if TEST_SCROLL_TO_INDEX then local currentIndex = 1 local testIndexes = { 31, 1, 7, 168, 4, 14, 2, 8 } local function scrollToNextIndex() print( "Scrolled to row index:", testIndexes[currentIndex] ) if currentIndex < #testIndexes then currentIndex = currentIndex + 1 end timer.performWithDelay( 1500, function() tableView:scrollToIndex( testIndexes[currentIndex], 1000, scrollToNextIndex ) end) end testTimer = timer.performWithDelay( 1000, function() tableView:scrollToIndex( testIndexes[currentIndex], 1000, scrollToNextIndex ) end) end -- Test deleting single row if TEST_DELETE_SINGLE_ROW then testTimer = timer.performWithDelay( 1000, function() tableView:deleteRow( 5 ) --Delete Row 5 end, 1 ) end -- Test delete all rows if TEST_DELETE_ALL_ROWS then testTimer = timer.performWithDelay( 1000, function() tableView:deleteAllRows() --No rows after execution end, 1 ) end end function scene:hide( event ) if ( "did" == event.phase ) then --Cancel test timer if active if testTimer ~= nil then timer.cancel( testTimer ) testTimer = nil end composer.removeHidden( false ) end end scene:addEventListener( "create", scene ) scene:addEventListener( "hide", scene ) return scene
--[[Info]]-- --[[Register]]-- RegisterServerEvent("clothing_shop:SetItems_server") RegisterServerEvent("clothing_shop:SpawnPlayer_server") RegisterServerEvent("skin_customization:SpawnPlayer") RegisterServerEvent("clothing_shop:SaveItem_server") RegisterServerEvent("clothing_shop:GetSkin_server") RegisterServerEvent("clothing_shop:WithDraw_server") --[[Local/Global]]-- local SQL_COLUMNS = { 'skin', 'face', 'face_texture', 'hair', 'hair_texture', 'shirt', 'shirt_texture', 'pants', 'pants_texture', 'shoes', 'shoes_texture', 'vest', 'vest_texture', 'bag', 'bag_texture', 'hat', 'hat_texture', 'mask', 'mask_texture', 'glasses', 'glasses_texture', 'gloves', 'gloves_texture', 'jacket', 'jacket_texture', 'ears', 'ears_texture' } --[[Function]]-- function getPlayerID(source) return getIdentifiant(GetPlayerIdentifiers(source)) end function getIdentifiant(id) for _, v in ipairs(id) do return v end end -- Gives you the column name for a collection and id given -- collection can be "skin", valueId can be null) -- "component", requires a valueId -- "prop", requires a valueId function giveColumnName(collection, valueId) local res = nil if (collection == "skin") then res = "skin" else local id = tonumber(valueId) if (collection == "component") then if (id == 0) then res = "face" end if (id == 1) then res = "mask" end if (id == 2) then res = "hair" end if (id == 3) then res = "gloves" end if (id == 4) then res = "pants" end if (id == 5) then res = "bag" end if (id == 6) then res = "shoes" end if (id == 8) then res = "shirt" end if (id == 9) then res = "vest" end if (id == 11) then res = "jacket" end else if (collection == "prop") then if (id == 0) then res = "hat" end if (id == 1) then res = "glasses" end if (id == 2) then res = "ears" end end end end return res end function getIsFirstConnection(source) return MySQL.Sync.fetchScalar("SELECT isFirstConnection FROM users WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source)}) end function createPlayerIntoDbClothes(source) MySQL.Async.execute("INSERT INTO user_clothes (identifier) VALUES (@identifier)", {['@identifier']= getPlayerID(source) }, function(data) end) end function updateIsFirstConnection(source) MySQL.Async.execute("UPDATE users SET isFirstConnection=@isFirstConnection WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source), ['@isFirstConnection'] = 0}, function(data) end) end function updatePlayerClothes1(source,values) local source = exports.essentialmode:getPlayerFromId(player) MySQL.Async.execute("UPDATE user_clothes SET skin=@value WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source), ['@value'] = values }, function(data) end) end function updatePlayerClothes2(name,values,textures) MySQL.Async.execute("UPDATE user_clothes SET ".. name .."=@value, ".. name..'_texture' .."=@texture_value WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source), ['@value'] = values, ['@texture_value'] = textures}, function(data) end) end function getSPlayerSkin(source) return MySQL.Sync.fetchScalar("SELECT skin FROM user_clothes WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source)}) end function getBackPackId(source,values) return MySQL.Sync.fetchScalar("SELECT id FROM backpack WHERE prop=@prop", {['@prop'] = values}) end function getBackPackPrice(source,values) return MySQL.Sync.fetchScalar("SELECT price FROM backpack WHERE id=@backpack_id", {['@backpack_id'] = getBackPackId(values)}) end function updatePlayerBackPack(source,values) if getBackPackId(values) then MySQL.Async.execute("UPDATE users SET backpack_id=@backpack_id WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source), ['@backpack_id'] = getBackPackId(values)}, function(data) end) TriggerEvent('es:getPlayerFromId', source, function(user) if user.money >= getBackPackPrice(values) then user:removeMoney((getBackPackPrice(values))) TriggerClientEvent("es_freeroam:notify", source, "CHAR_SOCIAL_CLUB", 1, "Binco Shop", false, "You bought a new item!") else TriggerClientEvent("clothing_shop:noMoney", source) end end) else TriggerClientEvent("es_freeroam:notify", source, "CHAR_SOCIAL_CLUB", 1, "Binco Shop", false, "You bought a new item!") TriggerClientEvent("clothing_shop:backPackInfo", source) end end --[[Events]]-- AddEventHandler("clothing_shop:SpawnPlayer_server", function() local source = source if(getIsFirstConnection(source) == 1) then createPlayerIntoDbClothes(source) updateIsFirstConnection(source) MySQL.Async.fetchAll("SELECT * FROM user_clothes WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source)}, function(data) TriggerClientEvent("clothing_shop:loadItems_client", source, data[1]) end) else MySQL.Async.fetchAll("SELECT * FROM user_clothes WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source)}, function(data) TriggerClientEvent("clothing_shop:loadItems_client", source, data[1]) end) end end) AddEventHandler("clothing_shop:SetItems_servers",function() MySQL.Async.fetchAll("SELECT * FROM user_clothes WHERE identifier=@identifier", {['@identifier'] = getPlayerID(source)}, function(data) TriggerClientEvent("clothing_shop:loadItems_client", source, data[1]) end) end) AddEventHandler("clothing_shop:SaveItem_server", function(item, values) if (giveColumnName(item.collection, item.id) == "skin") then updatePlayerClothes1(values.value) TriggerClientEvent("es_freeroam:notify", source, "CHAR_SOCIAL_CLUB", 1, "Binco Shop", false, "You bought a new item!") else updatePlayerClothes2(giveColumnName(item.collection, item.id),values.value,values.texture_value) if (giveColumnName(item.collection, item.id) == "bag" ) then updatePlayerBackPack(values.value) end end end) AddEventHandler("clothing_shop:GetSkin_server",function() TriggerClientEvent("clothing_shop:getSkin_client", source, getSPlayerSkin()) end)
local data_dir = vim.fn.stdpath('data') local lsp = require('modules.lsp') require'lspconfig'.vimls.setup { cmd = { data_dir .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio" }, on_attach = lsp.common_on_attach, capabilities = lsp.capabilities }
function drawCross(o, c, s) local s = s if not s then s = 2 end gui.line(o.x , o.y - s, o.x , o.y + s, c) gui.line(o.x - s, o.y , o.x + s, o.y , c) end function math.clamp(value, min, max) return math.min(max, math.max(min, value)) end function cameraToScreen(o, c, clamp) local cl = clamp and true or false local x, y = o.x - c.x, o.y - c.y if cl then x = math.clamp(x, 0, 149) y = math.clamp(y, 0, 135) end return { x = x, y = y } end function mgposition(addr) local t = memory.readword(addr) t = t / 0x20 return t end function getPosition(addr1, addr2) return { x = mgposition(addr1), y = mgposition(addr2)} end while true do butt = false local ipt = input.get() if ipt.A then memory.writebyte(0xc329, 0x00) memory.writebyte(0xc32a, 0x00) memory.writebyte(0xc32b, 0x40) memory.writebyte(0xc32c, 0x40) --memory.writebyte(0xc32d, 0x42) --memory.writebyte(0xc32e, 0x40) end if ipt.Z then butt = true --memory.writebyte(0xd047, 0x20) end local cameraPos = getPosition(0xc29a, 0xc29c) gui.text(12, 130, string.format("%04x %04x", memory.readword(0xc320), memory.readword(0xc322))) --[[ local playerPos = getPosition(0xd004, 0xd006) local cameraManPos = getPosition(0xd044, 0xd046) drawCross(cameraToScreen(playerPos, cameraPos), "red", 4) drawCross(cameraToScreen(cameraManPos, cameraPos), "white") --]] for i = 0, 0x1F do local mX, mY = 0xd004 + 0x40 * i, 0xd006 + 0x40 * i local objectPos = getPosition(mX, mY) local objectPosCam = cameraToScreen(objectPos, cameraPos) if objectPos.x ~= 0 and objectPos.y ~= 0 then --gui.text(1, 0 + (i * 6), string.format("%02x", i)) drawCross(objectPosCam, "white") local objectPosCam2 = cameraToScreen(objectPos, cameraPos, true) local ix = i if butt then ix = 0xd004 + 0x40 * i end gui.text(objectPosCam2.x + 2, objectPosCam2.y + 1, string.format("%02x", ix)) end end emu.frameadvance() end
function addDrachma( ply, amount, reason, applymultiplier ) if applymultiplier == nil then applymultiplier = true end if applymultiplier then local multy = ply:databaseGetValue( "drachmamultiplier" ) local smulty = GetConVar( "lab_globaldrachmamultiplier" ):GetFloat() if multy != nil then amount = math.Round( amount * multy ) end if smulty != nil then amount = math.Round( amount * smulty ) end end local curPoints = ply:databaseGetValue( "drachma" ) if curPoints == nil then return end local newPoints = curPoints + amount ply:databaseSetValue ( "drachma", newPoints ) ply:databaseAddValue( "lifetimedrachma", amount ) ply:databaseCheckRecord( "lifetimedrachma" ) if reason == nil then printPlayer( ply, "You received "..amount.." drachma!" ) else printPlayer( ply, "You received "..amount.." drachma for"..reason ) end ply:databaseCheck() net.Start( "drachma" ) net.WriteInt( ply:databaseGetValue( "drachma" ), 30 ) net.Send( ply ) end function addDrachmaTable( tab, amount, reason ) for k,v in pairs( tab ) do addDrachma( v, amount, reason ) end end function RemoveDrachma( ply, amount ) drachma = ply:databaseGetValue( "drachma" ) if drachma >= amount then ply:databaseSetValue( "drachma", drachma - amount ) net.Start( "drachma" ) net.WriteInt( ply:databaseGetValue( "drachma" ), 30 ) net.Send( ply ) return true else return false end end net.Receive( "skillupgrade", function( len, ply) drachma = ply:databaseGetValue( "drachma" ) skill = net.ReadString() if skill == "speed" then speed = ply:databaseGetValue( "speed" ) cost = 8 + 2^speed if RemoveDrachma( ply, cost ) then timer.Simple(2, function() vendor = ents.FindByClass( "npc_skills" )[1] if IsValid( vendor ) then vendor:EmitSound("vo/npc/male01/moan0"..math.random(1,5)..".wav") end end) ply:databaseSetValue( "speed", speed + 1 ) printPlayer( ply, "Upgraded speed to "..(speed + 1).." for "..cost.." Drachma.") ply:databaseCheck() ply:EmitSound("vo/npc/male01/fantastic0"..math.random(1,2)..".wav") else printPlayer( ply, "Not enough Drachma." ) end else health = ply:databaseGetValue( "health" ) cost = 8 + 2^health if RemoveDrachma( ply, cost ) then timer.Simple(2 , function() vendor = ents.FindByClass( "npc_skills" )[1] if IsValid( vendor ) then vendor:EmitSound("vo/npc/male01/moan0"..math.random(1,5)..".wav") end end) ply:databaseSetValue( "health", health + 1 ) printPlayer( ply, "Upgraded health to "..(health + 1).." for "..cost.." Drachma.") ply:databaseCheck() ply:EmitSound("vo/npc/male01/fantastic0"..math.random(1,2)..".wav") else printPlayer( ply, "Not enough Drachma." ) end end end) net.Receive( "selectmodel", function( len, ply) drachma = ply:databaseGetValue( "drachma" ) unlockedmodels = ply:databaseGetValue( "models" ) model = net.ReadInt( 16 ) kind = net.ReadInt( 4 ) if kind == 0 then data = HUMANMODELS[model] else data = MINOMODELS[model] end if data and unlockedmodels and drachma then if table.HasValue( unlockedmodels, data.model ) then if kind == 0 then ply:databaseSetValue( "humanmodel" , data.model ) printPlayer( ply, "Set human model to "..data.name.. "." ) else ply:databaseSetValue( "minomodel" , data.model ) printPlayer( ply, "Set minotaur model to "..data.name.. "." ) end ply:databaseCheck() SetProperModel( ply ) else cost = data.cost if RemoveDrachma( ply, cost ) then if cost >= 100 then timer.Simple(3, function() alyx = ents.FindByClass( "npc_models" )[1] alyx:EmitSound( "vo/k_lab/al_buyyoudrink0"..math.random(1,3)..".wav" ) end) end table.insert( unlockedmodels, #unlockedmodels + 1, data.model ) ply:databaseSetValue( "models", unlockedmodels ) ply:EmitSound("vo/npc/male01/fantastic0"..math.random(1,2)..".wav") if kind == 0 then ply:databaseSetValue( "humanmodel" , data.model ) else ply:databaseSetValue( "minomodel" , data.model ) end printPlayer( ply, "Unlocked and equipped "..data.name.. "." ) ply:databaseCheck() SetProperModel( ply ) else printPlayer( ply, "Not enough Drachma." ) end end end end) concommand.Add( "giveDrachma", function( ply, cmd, args, fullstring ) if not IsValid( ply ) or (IsValid( ply ) and ply:IsAdmin()) then local name = args[1] local amount = args[2] local recip = nil for k,v in pairs( player.GetAll() ) do if IsValid( v ) and v:IsPlayer() and string.find( v:Nick(), name, 0, false ) != nil then recip = v end end if IsValid( recip ) and recip:IsPlayer() then print( "Gave "..recip:Nick().." "..amount.." drachma." ) addDrachma( recip, amount, " some reason.", false ) else print( "Failed to find specified player." ) end end end) concommand.Add( "giveDrachmaSID", function( ply, cmd, args, fullstring ) if not IsValid( ply ) or (IsValid( ply ) and ply:IsAdmin()) then local name = args[1] local amount = args[2] local recip = nil if amount == nil then return end for k,v in pairs( player.GetAll() ) do if IsValid( v ) and v:IsPlayer() and string.find( v:SteamID(), name, 0, false ) != nil then recip = v end end if IsValid( recip ) and recip:IsPlayer() then print( "Gave "..recip:Nick().." "..amount.." drachma." ) addDrachma( recip, amount ) else print( "Failed to find specified player." ) end end end) concommand.Add( "setDrachmaMultiplier", function( ply, cmd, args, fullstring ) if not IsValid( ply ) or (IsValid( ply ) and ply:IsAdmin()) then local name = args[1] local amount = args[2] local recip = nil for k,v in pairs( player.GetAll() ) do if IsValid( v ) and v:IsPlayer() and string.find( v:Nick(), name, 0, false ) != nil then recip = v end end if IsValid( recip ) and recip:IsPlayer() then print( "Set "..recip:Nick().."'s drachma multiplier to "..amount ) recip:databaseSetValue ( "drachmamultiplier", amount ) printPlayer( recip, "Your drachma multiplier has been set to "..amount.."." ) else print( "Failed to find specified player." ) end end end) concommand.Add( "setDrachmaMultiplierSID", function( ply, cmd, args, fullstring ) if not IsValid( ply ) or (IsValid( ply ) and ply:IsAdmin()) then local name = args[1] local amount = args[2] local recip = nil if amount == nil then return end for k,v in pairs( player.GetAll() ) do if IsValid( v ) and v:IsPlayer() and string.find( v:SteamID(), name, 0, false ) != nil then recip = v end end if IsValid( recip ) and recip:IsPlayer() then print( "Set "..recip:Nick().."'s drachma multiplier to "..amount ) recip:databaseSetValue ( "drachmamultiplier", amount ) printPlayer( recip, "Your drachma multiplier has been set to "..amount.."." ) else print( "Failed to find specified player." ) end end end)
local BaseClass = require('base') local DerivedClass = {} setmetatable(DerivedClass, BaseClass) DerivedClass.__index = DerivedClass --[[setmetatable(DerivedClass, { __index = BaseClass, -- this is what makes the inheritance work __call = function (cls, ...) local self = setmetatable({}, cls) self:_init(...) return self end, })]] function DerivedClass:new(init) local self = BaseClass.new(self, init) -- call the base class constructor setmetatable(self, DerivedClass) self.value2 = init return self end function DerivedClass:get_value() return self.value + self.value2 end return DerivedClass
local Check = {} function Check.string(str) if type(str) ~= 'string' then log("check_string:", str) assert(false) end end function Check.number(num) if type(num) ~= 'number' then log("check_number:", num) assert(false) end end function Check.table(tbl) if type(tbl) ~= 'table' then log("check_table:", tbl) assert(false) end end return Check
local K, C = unpack(select(2, ...)) local Module = K:GetModule("Blizzard") local _G = _G local floor = _G.math.floor local format = _G.string.format local CreateFrame = _G.CreateFrame local hooksecurefunc = _G.hooksecurefunc local UnitAlternatePowerInfo = _G.UnitAlternatePowerInfo local UnitPowerMax = _G.UnitPowerMax local UnitPower = _G.UnitPower local statusBarColor = {r = 0.2, g = 0.4, b = 0.8} local statusWidth = 250 local statusHeight = 20 local statusBar = K.GetTexture(C["UITextures"].GeneralTextures) local font = K.GetFont(C["UIFonts"].GeneralFonts) local function updateTooltip(self) if _G.GameTooltip:IsForbidden() then return end if self.powerName and self.powerTooltip then _G.GameTooltip:SetText(self.powerName, 1, 1, 1) _G.GameTooltip:AddLine(self.powerTooltip, nil, nil, nil, 1) _G.GameTooltip:Show() end end local function onEnter(self) if (not self:IsVisible()) or _G.GameTooltip:IsForbidden() then return end _G.GameTooltip:ClearAllPoints() _G.GameTooltip_SetDefaultAnchor(_G.GameTooltip, self) updateTooltip(self) end local function onLeave() _G.GameTooltip:Hide() end function Module:SetAltPowerBarText(text, name, value, max) text:SetText(format('%s: %s / %s', name, value, max)) end function Module:PositionAltPower() self:SetPoint("CENTER", _G.AltPowerBarHolder, "CENTER") end function Module:PositionAltPowerBar() local holder = CreateFrame("Frame", "AltPowerBarHolder", UIParent) holder:SetPoint("TOP", UIParent, "TOP", 0, -46) holder:SetSize(128, 50) _G.PlayerPowerBarAlt:ClearAllPoints() _G.PlayerPowerBarAlt:SetPoint("CENTER", holder, "CENTER") _G.PlayerPowerBarAlt:SetParent(holder) _G.PlayerPowerBarAlt.ignoreFramePositionManager = true -- The Blizzard function FramePositionDelegate:UIParentManageFramePositions() -- calls :ClearAllPoints on PlayerPowerBarAlt under certain conditions. -- Doing ".ClearAllPoints = K.Noop" causes error when you enter combat. hooksecurefunc(_G.PlayerPowerBarAlt, "ClearAllPoints", Module.PositionAltPower) K.Mover(holder, "PlayerPowerBarAlt", "Alternative Power", {"TOP", UIParent, "TOP", 0, -46}, statusWidth or 250, statusHeight or 20) end function Module:UpdateAltPowerBarColors() local bar = _G.KKUI_AltPowerBar bar:SetStatusBarColor(statusBarColor.r, statusBarColor.g, statusBarColor.b) end function Module:UpdateAltPowerBarSettings() local bar = _G.KKUI_AltPowerBar bar:SetSize(statusWidth or 250, statusHeight or 20) bar:SetStatusBarTexture(statusBar) bar.text:SetFontObject(font) AltPowerBarHolder:SetSize(bar.Backdrop:GetSize()) Module:SetAltPowerBarText(bar.text, bar.powerName or "", bar.powerValue or 0, bar.powerMaxValue or 0, bar.powerPercent or 0) end function Module:UpdateAltPowerBar() _G.PlayerPowerBarAlt:UnregisterAllEvents() _G.PlayerPowerBarAlt:Hide() local barType, min, _, _, _, _, _, _, _, _, powerName, powerTooltip = UnitAlternatePowerInfo("player") if barType then local power = UnitPower("player", _G.ALTERNATE_POWER_INDEX) local maxPower = UnitPowerMax("player", _G.ALTERNATE_POWER_INDEX) or 0 local perc = (maxPower > 0 and floor(power / maxPower * 100)) or 0 self.powerMaxValue = maxPower self.powerName = powerName self.powerPercent = perc self.powerTooltip = powerTooltip self.powerValue = power self:Show() self:SetMinMaxValues(min, maxPower) self:SetValue(power) Module:SetAltPowerBarText(self.text, powerName or "", power or 0, maxPower, perc) else self.powerMaxValue = nil self.powerName = nil self.powerPercent = nil self.powerTooltip = nil self.powerValue = nil self:Hide() end end function Module:SkinAltPowerBar() local powerbar = CreateFrame("StatusBar", "KKUI_AltPowerBar", UIParent) powerbar:CreateBackdrop() powerbar.Backdrop:SetFrameLevel(1) powerbar:SetMinMaxValues(0, 200) powerbar:SetPoint("CENTER", AltPowerBarHolder) powerbar:Hide() powerbar:SetScript("OnEnter", onEnter) powerbar:SetScript("OnLeave", onLeave) powerbar.text = powerbar:CreateFontString(nil, "OVERLAY") powerbar.text:SetPoint("CENTER", powerbar, "CENTER") powerbar.text:SetJustifyH("CENTER") Module:UpdateAltPowerBarSettings() Module:UpdateAltPowerBarColors() -- Event handling powerbar:RegisterEvent("UNIT_POWER_UPDATE") powerbar:RegisterEvent("UNIT_POWER_BAR_SHOW") powerbar:RegisterEvent("UNIT_POWER_BAR_HIDE") powerbar:RegisterEvent("PLAYER_TARGET_CHANGED") powerbar:RegisterEvent("PLAYER_ENTERING_WORLD") powerbar:SetScript("OnEvent", Module.UpdateAltPowerBar) end function Module:CreateAltPowerbar() if not IsAddOnLoaded("SimplePowerBar") then self:PositionAltPowerBar() self:SkinAltPowerBar() end end
local Carousel = script.Parent local Container = Carousel.Parent local App = Container.Parent local UIBlox = App.Parent local Packages = UIBlox.Parent local Roact = require(Packages.Roact) local t = require(Packages.t) local withStyle = require(UIBlox.Core.Style.withStyle) local Core = UIBlox.Core local getIconSize = require(App.ImageSet.getIconSize) local IconSize = require(App.ImageSet.Enum.IconSize) local Interactable = require(Core.Control.Interactable) local ImageSetComponent = require(Core.ImageSet.ImageSetComponent) local ScrollButton = Roact.PureComponent:extend("ScrollButton") ScrollButton.validateProps = t.strictInterface({ -- The icon of the button icon = t.table, -- Callback action callback = t.callback, }) function ScrollButton:render() return withStyle(function(style) return Roact.createElement(Interactable, { AutoButtonColor = false, Size = UDim2.fromScale(1, 1), BackgroundColor3 = style.Theme.BackgroundUIContrast.Color, BackgroundTransparency = style.Theme.BackgroundUIContrast.Transparency, BorderSizePixel = 0, [Roact.Event.Activated] = self.props.callback, --Note State change is not being used right now. onStateChanged = function()end, }, { Icon = Roact.createElement(ImageSetComponent.Label, { Size = UDim2.fromOffset(getIconSize(IconSize.Medium), getIconSize(IconSize.Medium)), Position = UDim2.fromScale(0.5, 0.5), AnchorPoint = Vector2.new(0.5, 0.5), BackgroundTransparency = 1, Image = self.props.icon, ImageColor3 = style.Theme.IconEmphasis.Color, ImageTransparency = style.Theme.IconEmphasis.Transparency, }), }) end) end return ScrollButton
local Fade = Object:extend() function Fade:new(alpha,timer) self.a = alpha self.t = timer self.state = false end function Fade:update(dt) if self.state == true then self.a = self.a-(1/self.t * dt) end if self.a <= 1 then self.state = false self.a = 1 if door_locked == false then if action_flag == 0 then action_flag = 1 end end end end function Fade:draw() if self.state == true then love.graphics.setColor(0,0,0,self.a) love.graphics.rectangle("fill", 0, 0, width, height) end end return Fade
local cmd = vim.cmd cmd 'packadd packer.nvim' ------------------------ --------Packages-------- ------------------------ return require('packer').startup(function() use {'wbthomason/packer.nvim', opt = true} ---- Utils ---- use 'tpope/vim-repeat' use 'tpope/vim-surround' use 'tpope/vim-commentary' use 'tpope/vim-obsession' use 'tpope/vim-fugitive' use 'antoinemadec/FixCursorHold.nvim' ---- Dev ---- use 'rust-lang/rust.vim' ---- Completion ---- use 'hrsh7th/nvim-compe' ---- Linting ---- use 'dense-analysis/ale' ---- LSP ---- use 'neovim/nvim-lspconfig' use 'nvim-lua/lsp_extensions.nvim' use { 'RishabhRD/nvim-lsputils', requires = { 'RishabhRD/popfix' } } ---- Syntax ---- use 'lnl7/vim-nix' use 'nvim-treesitter/nvim-treesitter' ---- Snippets ---- use 'cohama/lexima.vim' use 'hrsh7th/vim-vsnip' use 'norcalli/snippets.nvim' use 'hrsh7th/vim-vsnip-integ' use 'microsoft/vscode-typescript-next' use 'xabikos/vscode-javascript' use 'microsoft/vscode-cpptools' use 'rust-lang/rls-vscode' use 'tht13/Python-vscode' ---- Theme ---- use 'sainnhe/sonokai' use 'arcticicestudio/nord-vim' use 'norcalli/nvim-colorizer.lua' use 'kyazdani42/nvim-web-devicons' use 'vim-airline/vim-airline' use 'vim-airline/vim-airline-themes' ---- FZF ---- use {'junegunn/fzf', run = function() vim.fn['fzf#install()'](0) end} use 'junegunn/fzf.vim' use 'gfanto/fzf-lsp.nvim' end)
minetest.register_tool("rangedweapons:m60_r", { stack_max= 1, wield_scale = {x=2.0,y=2.0,z=1.4}, description = "", rw_next_reload = "rangedweapons:m60", load_sound = "rangedweapons_rifle_clip_in", range = 0, groups = {not_in_creative_inventory = 1}, inventory_image = "rangedweapons_m60_rld.png", }) minetest.register_tool("rangedweapons:m60", { stack_max= 1, wield_scale = {x=2.0,y=2.0,z=1.4}, description = "" ..core.colorize("#35cdff","m60\n") ..core.colorize("#FFFFFF", "Gun damage: 9\n") ..core.colorize("#FFFFFF", "accuracy: 65%\n") ..core.colorize("#FFFFFF", "Gun knockback: 7\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 13%\n")..core.colorize("#FFFFFF", "Critical efficiency: 3.0x\n") ..core.colorize("#FFFFFF", "Reload delay: 1.0\n") ..core.colorize("#FFFFFF", "Clip size: 100\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.09(full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: heavy machinegun\n") ..core.colorize("#FFFFFF", "Block penetration: 12%\n") ..core.colorize("#FFFFFF", "Enemy penetration: 27%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 64"), range = 0, inventory_image = "rangedweapons_m60.png", RW_gun_capabilities = { automatic_gun = 1, gun_damage = {fleshy=9,knockback=7}, gun_crit = 13, gun_critEffc = 3.0, suitable_ammo = {{"rangedweapons:762mm",100}}, gun_skill = {"heavy_skill",60}, gun_icon = "rangedweapons_m60_icon.png", gun_unloaded = "rangedweapons:m60_r", gun_velocity = 64, gun_accuracy = 65, gun_cooldown = 0.09, gun_reload = 1.0, gun_projectiles = 1, has_shell = 1, gun_gravity = 0, gun_durability = 2750, gun_smokeSize = 5, gun_mob_penetration = 27, gun_node_penetration = 12, gun_unload_sound = "rangedweapons_rifle_clip_out", gun_sound = "rangedweapons_machinegun", }, on_secondary_use = function(itemstack, user, pointed_thing) rangedweapons_reload_gun(itemstack, user) return itemstack end, inventory_image = "rangedweapons_m60.png", })
if !gAC.config.ANTI_METH then return end local _CompileString = CompileString local _math_Round = math.Round local _math_random = math.random local _print = print local _string_char = string.char local _tonumber = tonumber local _util_TableToJSON = util.TableToJSON local stringrandom = function(length, norm) local str = "" for i = 1, length do str = str .. _string_char(_math_Round(_math_random(_tonumber("97"), _tonumber("122")))) end return str end local Things_to_say = { 'When you get detected by meth, https://i.imgur.com/rvuuGEG.png', '"Drug cheat is best" yea bud, sure, maybe double check your code first before bragging?"', 'Meth: yall pay $200 for a shit anti-cheat | gAC: mmm hmm, and yall pay $40 to get detected by it', 'This is how you stir up a cheating community like bees, cucked' } local _check = _tonumber("0") local c = function(f) _check = _tonumber("1") end local _print = function(num) if num > #Things_to_say then num = num - #Things_to_say end _print(Things_to_say[num]) end jit.attach(c, "bc") local f = _CompileString("--", "#" .. stringrandom(_math_Round(_math_random(_tonumber("7"),_tonumber("11"))))) if _check != _tonumber("1") then local num = _math_Round(_math_random(1, #Things_to_say)) _print(num) gAC_Send("g-AC_Detections", _util_TableToJSON({ "Methamphetamine User [Code 115]", gAC.config.METH_PUNISHMENT, gAC.config.METH_BANTIME })) end
--This script is a console with an output as a tree, because each command is a branch and each output a set of leafs --1.1 libraries and clipboard --1.1.1 libraries require("iuplua") --require iuplua for GUIs --1.1.2 initalize clipboard clipboard=iup.clipboard{} --1.1.3 loadstring for Lua 5.3 and higher Lua versions if (not loadstring) then loadstring = load end --if (not loadstring) then --1.1.4 securisation by allowing only necessary os.execute commands do --sandboxing local old=os.date("%H%M%S") local secureTable={} secureTable[old]=os.execute function os.execute(a) if a:lower():match("^sftp ") or a:lower():match("^dir ") or a:lower():match("^pause") or a:lower():match("^title") or a:lower():match("^md ") or a:lower():match("^copy ") or a:lower():match("^color ") or a:lower():match("^start ") or a:lower():match("^cls") then return secureTable[old](a) else print(a .." ist nicht erlaubt.") end --if a:match("del") then end --function os.execute(a) secureTable[old .. "1"]=io.popen function io.popen(a) if a:lower():match("^dir ") or a:lower():match('^"dir ') then return secureTable[old .. "1"](a) else print(a .." ist nicht erlaubt.") end --if a:match("del") then end --function os.execute(a) end --do --sandboxing --1.2 color section --1.2.1 color of the console associated with the graphical user interface if started with lua54.exe and not wlua54.exe os.execute('color 71') --1.2.2 colors color_red="135 131 28" color_light_color_grey="96 197 199" color_grey="162 163 165" color_blue="18 132 86" --1.2.3 color definitions color_background=color_light_color_grey color_buttons=color_blue -- works only for flat buttons color_button_text="255 255 255" color_background_tree="246 246 246" --1.3 path of the graphical user interface and filename of this script path=arg[0]:match("(.*)\\") --test with: print(path) thisfilename=arg[0]:match("\\([^\\]+)$") --test with: print(arg[0]) --test with: print(thisfilename) --2. console objects console = {} --2.1 prompt text area console.prompt = iup.text{expand="Horizontal", dragdrop = "Yes"} console.prompt.tip = "Enter - executes a Lua command\n".. "Result of os.execute and luacom.DumpTypeInfo in console, not in GUI\n".. "Esc - clears the command\n".. "Ctrl+Del - clears the output\n".. "Ctrl+O - selects a file and execute it\n".. "Ctrl+X - exits the console\n".. "Up Arrow - shows the previous command in history\n".. "Down Arrow - shows the next command in history\n".. "Drop files here to execute them" --dropfiles callback function function console.prompt:dropfiles_cb(filename) -- will execute all dropped files, can drop more than one at once -- works in Windows and in Linux --test with: print(filename) if filename:match("%.lua") then console.do_file(filename) else os.execute('start "D" "' .. filename .. '"') end --if filename:match("%.lua") then end --function console.prompt:dropfiles_cb(filename) --key pressed function function console.prompt:k_any(key) if (key == iup.K_CR) then -- Enter executes the string console.do_string(self.value) self.value = "" elseif (key == iup.K_ESC) then -- Esc clears console.prompt self.value = "" elseif (key == iup.K_cO) then -- Ctrl+O selects a file and execute it console.open_file() elseif (key == iup.K_cX) then -- Ctrl+X exits the console console.dialog:close_cb() elseif (key == iup.K_cDEL) then -- Ctrl+Del clears console.output console.output.value = "" elseif (key == iup.K_UP) then -- Up Arrow - shows the previous command in history console.prev_command() elseif (key == iup.K_DOWN) then -- Down Arrow - shows the next command in history console.next_command() end --if (key == iup.K_CR) then end --function console.prompt:k_any(key) --2.2 output in a standard way as text area replaced by tree console.output = iup.text{expand="Yes", readonly="Yes", bgcolor="232 232 232", font = "Courier, 11", appendnewline = "No", multiline = "Yes"} --2.3.1 drag & drop text area branch console.textbox_branch = iup.text{value="Ast bilden",size="45x10", readonly="YES", dragdrop = "Yes",BGCOLOR=color_buttons, FGCOLOR=color_button_text} console.textbox_branch.tip = "Drop files here to build a branch" --callback to add branch with drag & drop function console.textbox_branch:dropfiles_cb(filename) console.outputTree['addbranch']=tostring(filename) end --function console.textbox_branch:dropfiles_cb(filename) --2.3.2 drag & drop text area leaf console.textbox_leaf = iup.text{value="Blatt bilden",size="45x10", readonly="YES", dragdrop = "Yes",BGCOLOR=color_buttons, FGCOLOR=color_button_text} console.textbox_leaf.tip = "Drop files here to build a leaf" --callback to add leaf with drag & drop function console.textbox_leaf:dropfiles_cb(filename) console.outputTree['addleaf']=tostring(filename) end --function console.textbox_leaf:dropfiles_cb(filename) --3. functions --3.1 put original functions in variables console.orig_output = io.output console.orig_write = io.write console.orig_print = print --3.2 output function function io.output(filename) console.orig_output(filename) if (filename) then io.write = console.orig_write else io.write = console.new_write end --if (filename) then end --function io.output(filename) --3.3 write function function console.new_write(...) -- Try to simulate the same behavior of the standard io.write local arg = {...} local str -- allow to print a nil value for i,v in ipairs(arg) do if (str) then str = str .. tostring(v) else str = tostring(v) end --if (str) then end --for i,v in ipairs(arg) do console.print2output(str, true) end --function console.new_write(...) io.write = console.new_write --3.4 print function function print(...) -- Try to simulate the same behavior of the standard print local arg = {...} local str -- allow to print a nil value for i,v in ipairs(arg) do if (i > 1) then str = str .. "\t" -- only add Tab for more than 1 parameters end --if (i > 1) then if (str) then str = str .. tostring(v) else str = tostring(v) end --if (str) then end --for i,v in ipairs(arg) do console.print2output(str) end --function print(...) --3.5 print to output function function console.print2output(s, no_newline) if tostring(s):match("^>") then --find last branch at depth 1 for i=0,console.outputTree.count-1 do if console.outputTree["depth" .. i]=="1" then console.outputTree.value=i end --if tree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do --alternatively: console.outputTree.value=0 --0 and addbranch to have the newest on the top after first leafs --test with: iup.Message(console.outputTree.value,console.outputTree["depth" .. console.outputTree.value]) console.outputTree['insertbranch']=tostring(s):match("^> (.*)") -- console.outputTree.value=console.outputTree.value+1 for i=console.outputTree.value+1,console.outputTree.count-1 do if console.outputTree["depth" .. i]==console.outputTree["depth" .. console.outputTree.value] then console.outputTree.value=i break end --if tree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do else console.outputTree['addleaf']=tostring(s) console.outputTree.value=console.outputTree.value+1 end --if tostring(s):match("^>") then --output in text area if (no_newline) then console.output.append = tostring(s) console.no_newline = no_newline else if (console.no_newline) then -- if io.write was called, then a print is called, must add a new line before console.output.append = "\n" .. tostring(s) .. "\n" console.no_newline = nil else console.output.append = tostring(s) .. "\n" end --if (console.no_newline) then end --if (no_newline) then end --function console.print2output(s, no_newline) --3.6 print command function function console.print_command(cmd) console.add_command(cmd) console.print2output("> " .. cmd) end --function console.print_command(cmd) --3.7 add command function function console.add_command(cmd) console.cmd_index = nil if (not console.cmd_list) then console.cmd_list = {} end --if (not console.cmd_list) then local n = #(console.cmd_list) console.cmd_list[n+1] = cmd end --function console.add_command(cmd) --3.8 previous command function function console.prev_command() if (not console.cmd_list) then return end --if (not console.cmd_list) then if (not console.cmd_index) then console.cmd_index = #(console.cmd_list) else console.cmd_index = console.cmd_index - 1 if (console.cmd_index == 0) then console.cmd_index = 1 end --if (console.cmd_index == 0) then end --if (not console.cmd_index) then console.prompt.value = console.cmd_list[console.cmd_index] end --function console.prev_command() --3.9 next command function function console.next_command() if (not console.cmd_list) then return end --if (not console.cmd_list) then if (not console.cmd_index) then return else console.cmd_index = console.cmd_index + 1 local n = #(console.cmd_list) if (console.cmd_index == n+1) then console.cmd_index = n end end --if (not console.cmd_index) then console.prompt.value = console.cmd_list[console.cmd_index] end --function console.next_command() --3.10 do_file auxiliary function function console.do_file(filename) local cmd = 'dofile(' .. string.format('%q', filename) .. ')' console.print_command(cmd) dofile(filename) end --function console.do_file(filename) --3.11 do_string function function console.do_string(cmd) console.print_command(cmd) assert(loadstring(cmd))() end --function console.do_string(cmd) --3.12 open_file function function console.open_file() local fd=iup.filedlg{dialogtype="OPEN", title="Load File", nochangedir="NO", directory=console.last_directory, filter="*.*", filterinfo="All Files", allownew="NO"} fd:popup(iup.CENTER, iup.CENTER) local status = fd.status local filename = fd.value console.last_directory = fd.directory -- save the previous directory fd:destroy() --load file or not if (status == "-1") or (status == "1") then if (status == "1") then error ("Cannot load file: "..filename) end --if (status == "1") then else console.do_file(filename) end --if (status == "-1") or (status == "1") then end --function console.open_file() --3.13 function checking if file exits 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 file_exists(name) --3.14 function which saves the current iup tree as a Lua table function save_tree_to_lua(tree, outputfile_path) local output_tree_text="lua_tree_output=" --the output string local outputfile=io.open(outputfile_path,"w") --a output file for i=0,tree.count - 1 do --loop for all nodes if tree["KIND" .. i ]=="BRANCH" then --consider cases, if actual node is a branch if (i > 0 and (tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) ) or i==0 then --consider cases if depth increases output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' -- we open a new branch --save state if tree["STATE" .. i ]=="COLLAPSED" then output_tree_text = output_tree_text .. 'state="COLLAPSED",\n' end --if tree["STATE" .. i ]=="COLLAPSED" then elseif i > 0 and tonumber(tree["DEPTH" .. i ]) < tonumber(tree["DEPTH" .. i-1 ]) then --if depth decreases if tree["KIND" .. i-1 ] == "BRANCH" then --depending if the predecessor node was a branch we need to close one bracket more for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do output_tree_text = output_tree_text .. '},\n' end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --and we open the new branch --save state if tree["STATE" .. i ]=="COLLAPSED" then output_tree_text = output_tree_text .. 'state="COLLAPSED",\n' end --if tree["STATE" .. i ]=="COLLAPSED" then else for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do -- or if the predecessor node was a leaf output_tree_text = output_tree_text .. '},\n' end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do output_tree_text = output_tree_text .. '{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --and we open the new branch --save state if tree["STATE" .. i ]=="COLLAPSED" then output_tree_text = output_tree_text .. 'state="COLLAPSED",\n' end --if tree["STATE" .. i ]=="COLLAPSED" then end --if tree["KIND" .. i-1 ] == "BRANCH" then elseif i > 0 and tonumber(tree["DEPTH" .. i ]) == tonumber(tree["DEPTH" .. i-1 ]) then --or if depth stays the same if tree["KIND" .. i-1 ] == "BRANCH" then --again consider if the predecessor node was a branch output_tree_text = output_tree_text .. '},\n{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --save state if tree["STATE" .. i ]=="COLLAPSED" then output_tree_text = output_tree_text .. 'state="COLLAPSED",\n' end --if tree["STATE" .. i ]=="COLLAPSED" then else --or a leaf output_tree_text = output_tree_text .. '\n{ branchname="' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --save state if tree["STATE" .. i ]=="COLLAPSED" then output_tree_text = output_tree_text .. 'state="COLLAPSED",\n' end --if tree["STATE" .. i ]=="COLLAPSED" then end --if tree["KIND" .. i-1 ] == "BRANCH" then end --if (i > 0 and (tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) ) or i==0 then elseif tree["KIND" .. i ]=="LEAF" then --or if actual node is a leaf if (i > 0 and tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) or i==0 then output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --we add the leaf elseif i > 0 and tonumber(tree["DEPTH" .. i ]) < tonumber(tree["DEPTH" .. i-1 ]) then if tree["KIND" .. i-1 ] == "LEAF" then --in the same manner as above, depending if the predecessor node was a leaf or branch, we have to close a different number of brackets for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do output_tree_text = output_tree_text .. '},\n' end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) do output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' --and in each case we add the new leaf else for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do output_tree_text = output_tree_text .. '},\n' end --for j=1, tonumber(tree["DEPTH" .. i-1 ])- tonumber(tree["DEPTH" .. i ]) +1 do output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' end --if tree["KIND" .. i-1 ] == "LEAF" then elseif i > 0 and tonumber(tree["DEPTH" .. i ]) == tonumber(tree["DEPTH" .. i-1 ]) then if tree["KIND" .. i-1 ] == "LEAF" then output_tree_text = output_tree_text .. ' "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' else output_tree_text = output_tree_text .. '},\n "' .. string.escape_forbidden_char(tree["TITLE" .. i ]) .. '", \n' end --if tree["KIND" .. i-1 ] == "LEAF" then end --if (i > 0 and tonumber(tree["DEPTH" .. i ]) > tonumber(tree["DEPTH" .. i-1 ]) ) or i==0 then end --if tree["KIND" .. i ]=="BRANCH" then end --for i=0,tree.count - 1 do for j=1, tonumber(tree["DEPTH" .. tree.count-1]) do output_tree_text = output_tree_text .. "}" --close as many brackets as needed end --for j=1, tonumber(tree["DEPTH" .. tree.count-1]) do if tree["KIND" .. tree.count-1]=="BRANCH" then output_tree_text = output_tree_text .. "}" -- we need to close one more bracket if last node was a branch end --if tree["KIND" .. tree.count-1]=="BRANCH" then --output_tree_text=string.escape_forbidden_char(output_tree_text) outputfile:write(output_tree_text) --write everything into the outputfile outputfile:close() end --function save_tree_to_lua(tree, outputfile_path) --3.15 function escaping magic characters function string.escape_forbidden_char(insertstring) --this function takes a string and returns the same string with escaped characters return insertstring:gsub("\\", "\\\\"):gsub("\"", "\\\""):gsub("\'", "\\\'"):gsub("\n", "\\n"):gsub("\r", "\\n") end --function string.escape_forbidden_char(insertstring) --3.16 function for version informations function console.version_info() print(_VERSION, _COPYRIGHT) -- _COPYRIGHT does not exists by default, but it could... print("IUP " .. iup._VERSION .. " " .. iup._COPYRIGHT) print(" System: " .. iup.GetGlobal("SYSTEM")) print(" System Version: " .. iup.GetGlobal("SYSTEMVERSION")) local mot = iup.GetGlobal("MOTIFVERSION") if (mot) then print(" Motif Version: ", mot) end local gtk = iup.GetGlobal("GTKVERSION") if (gtk) then print(" GTK Version: ", gtk) end end --function console.version_info() --3. functions end --4. dialogs --4.1 rename dialog --ok button ok = iup.flatbutton{title = "OK",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text} function ok:flat_action() console.outputTree.title = text.value return iup.CLOSE end --function ok:flat_action() --cancel button cancel = iup.flatbutton{title = "Abbrechen",size="EIGHTH", BGCOLOR=color_buttons, FGCOLOR=color_button_text} function cancel:flat_action() return iup.CLOSE end --function cancel:flat_action() text = iup.multiline{size="120x50",border="YES",expand="YES",wordwrap="YES"} --textfield label1 = iup.label{title="Name:"}--label for textfield --open the dialog for renaming branch/leaf dlg_rename = iup.dialog{ iup.vbox{label1, text, iup.hbox{ok,cancel}}; title="Knoten bearbeiten", size="QUARTER", startfocus=text, } --4.1 rename dialog end --5. context menus (menus for right mouse click) --5.1 menu of console.outputTree --5.1.1 copy node of console.outputTree startcopy = iup.item {title = "Knoten kopieren"} function startcopy:action() --copy node clipboard.text = console.outputTree['title'] end --function startcopy:action() --5.1.2 rename node and rename action for other needs of console.outputTree renamenode = iup.item {title = "Knoten bearbeiten"} function renamenode:action() text.value = console.outputTree['title'] dlg_rename:popup(iup.CENTER, iup.CENTER) --popup rename dialog iup.SetFocus(console.outputTree) end --function renamenode:action() --5.1.3 add branch to console.outputTree addbranch = iup.item {title = "Ast hinzufügen"} function addbranch:action() console.outputTree.addbranch = "" console.outputTree.value=console.outputTree.value+1 renamenode:action() end --function addbranch:action() --5.1.3.1 add branch to console.outputTree by insertbranch addbranchbottom = iup.item {title = "Ast darunter hinzufügen"} function addbranchbottom:action() console.outputTree["insertbranch" .. console.outputTree.value] = "" for i=console.outputTree.value+1,console.outputTree.count-1 do if console.outputTree["depth" .. i]==console.outputTree["depth" .. console.outputTree.value] then console.outputTree.value=i renamenode:action() break end --if console.outputTree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do end --function addbranchbottom:action() --5.1.3.2 add leaf to console.outputTree by insertleaf addleafbottom = iup.item {title = "Blatt darunter hinzufügen"} function addleafbottom:action() console.outputTree["insertleaf" .. console.outputTree.value] = "" for i=console.outputTree.value+1,console.outputTree.count-1 do if console.outputTree["depth" .. i]==console.outputTree["depth" .. console.outputTree.value] then console.outputTree.value=i renamenode:action() break end --if console.outputTree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do end --function addleafbottom:action() --5.1.4 add branch of console.outputTree from clipboard addbranch_fromclipboard = iup.item {title = "Ast aus Zwischenablage"} function addbranch_fromclipboard:action() console.outputTree.addbranch = clipboard.text console.outputTree.value=console.outputTree.value+1 end --function addbranch_fromclipboard:action() --5.1.4.1 add branch to console.outputTree by insertbranch from clipboard addbranch_fromclipboardbottom = iup.item {title = "Ast darunter aus Zwischenablage"} function addbranch_fromclipboardbottom:action() console.outputTree["insertbranch" .. console.outputTree.value] = clipboard.text for i=console.outputTree.value+1,console.outputTree.count-1 do if console.outputTree["depth" .. i]==console.outputTree["depth" .. console.outputTree.value] then console.outputTree.value=i break end --if console.outputTree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do end --function addbranch_fromclipboardbottom:action() --5.1.4.2 add leaf to console.outputTree by insertleaf from clipboard addleaf_fromclipboardbottom = iup.item {title = "Blatt darunter aus Zwischenablage"} function addleaf_fromclipboardbottom:action() console.outputTree["insertleaf" .. console.outputTree.value] = clipboard.text for i=console.outputTree.value+1,console.outputTree.count-1 do if console.outputTree["depth" .. i]==console.outputTree["depth" .. console.outputTree.value] then console.outputTree.value=i break end --if console.outputTree["depth" .. console.outputTree.value+1]==console.outputTree["depth" .. console.outputTree.value] then end --for i=console.outputTree.value+1,console.outputTree.count-1 do end --function addleaf_fromclipboardbottom:action() --5.1.5 add leaf of console.outputTree addleaf = iup.item {title = "Blatt hinzufügen"} function addleaf:action() console.outputTree.addleaf = "" console.outputTree.value=console.outputTree.value+1 renamenode:action() end --function addleaf:action() --5.1.6 add leaf of console.outputTree from clipboard addleaf_fromclipboard = iup.item {title = "Blatt aus Zwischenablage"} function addleaf_fromclipboard:action() console.outputTree.addleaf = clipboard.text console.outputTree.value=console.outputTree.value+1 end --function addleaf_fromclipboard:action() --5.1.7 copy a version of the file selected in the console.outputTree and give it the next version number startversion = iup.item {title = "Version archivieren"} function startversion:action() --get the version of the file if console.outputTree['title']:match("^.:\\.*%.[^\\]+") then Version=0 p=io.popen('dir "' .. console.outputTree['title']:gsub("(%.+)","_Version*%1") .. '" /b/o') for Datei in p:lines() do --test with: iup.Message("Version",Datei) if Datei:match("_Version(%d+)") then Version_alt=Version Version=tonumber(Datei:match("_Version(%d+)")) if Version<Version_alt then Version=Version_alt end end --test with: iup.Message("Version",Version) end --for Datei in p:lines() do --test with: iup.Message(Version,Version+1) Version=Version+1 iup.Message("Archivieren der Version:",console.outputTree['title']:gsub("(%.+)","_Version" .. Version .. "%1")) os.execute('copy "' .. console.outputTree['title'] .. '" "' .. console.outputTree['title']:gsub("(%.+)","_Version" .. Version .. "%1") .. '"') end --if console.outputTree['title']:match(".:\\.*%.[^\\]+") then end --function startversion:action() --5.1.8 start file of node of console.outputTree in IUP Lua scripter or start empty file in notepad or start empty scripter startnodescripter = iup.item {title = "Skripter starten"} function startnodescripter:action() --read first line of file. If it is empty then scripter cannot open it. So open file with notepad.exe if file_exists(console.outputTree['title']) then inputfile=io.open(console.outputTree['title'],"r") ErsteZeile=inputfile:read() inputfile:close() end if file_exists(console.outputTree['title']) and ErsteZeile then os.execute('start "d" C:\\Lua\\iupluascripter54.exe "' .. console.outputTree['title'] .. '"') elseif file_exists(console.outputTree['title']) then os.execute('start "d" notepad.exe "' .. console.outputTree['title'] .. '"') else os.execute('start "d" C:\\Lua\\iupluascripter54.exe ') end --if file_exists(console.outputTree['title']) and ErsteZeile then end --function startnodescripter:action() --5.1.9 start the file or repository of the node of console.outputTree startnode = iup.item {title = "Starten"} function startnode:action() if console.outputTree['title']:match("^.:\\.*%.[^\\ ]+$") or console.outputTree['title']:match("^.:\\.*[^\\]+$") or console.outputTree['title']:match("^.:\\$") or console.outputTree['title']:match("^[^ ]*//[^ ]+$") then os.execute('start "D" "' .. console.outputTree['title'] .. '"') elseif console.outputTree['title']:match("sftp .*") then os.execute(console.outputTree['title']) end --if console.outputTree['title']:match("^.:\\.*%.[^\\ ]+$") or console.outputTree['title']:match("^.:\\.*[^\\]+$") or console.outputTree['title']:match("^.:\\$") or console.outputTree['title']:match("^[^ ]*//[^ ]+$") then end --function startnode:action() --5.1.10 execute Lua script with Lua chunk of the node of console.outputTree and write result under the node startnode_script = iup.item {title = "Knoten ausführen"} function startnode_script:action() if console.outputTree["KIND"]=="BRANCH" then if console.outputTree['title']:match("^.:\\.*%.[^\\ ]+$") or console.outputTree['title']:match("^.:\\.*[^\\]+$") or console.outputTree['title']:match("^.:\\$") or console.outputTree['title']:match("^[^ ]*//[^ ]+$") then dofile(console.outputTree['title']) elseif console.outputTree['title']:match("%(") or console.outputTree['title']:match("=") then loadstring(console.outputTree['title'])() end --if console.outputTree['title']:match("^.:\\.*%.[^\\ ]+$") or console.outputTree['title']:match("^.:\\.*[^\\]+$") or console.outputTree['title']:match("^.:\\$") or console.outputTree['title']:match("^[^ ]*//[^ ]+$") then end --if console.outputTree["KIND"]=="BRANCH" then end --function startnode_script:action() --5.1.11 execute Lua script with Lua chunk of the node and the child nodes of console.outputTree and write result under the node startnode_script_update_with_children = iup.item {title = "Knoten mit Unterknoten aktualisieren"} function startnode_script_update_with_children:action() if console.outputTree["KIND"]=="BRANCH" then local startNodeValue=console.outputTree.value for i=startNodeValue,startNodeValue+console.outputTree['TOTALCHILDCOUNT' .. startNodeValue] do console.outputTree.value=i if console.outputTree['KIND' .. i]=="BRANCH" and console.outputTree['KIND' .. i+1]=="LEAF" then console.outputTree['delnode' .. i+1]="SELECTED" end --if console.outputTree['KIND' .. i+1]=="LEAF" then if console.outputTree['title' .. i]:match("^.:\\.*%.lua$") then dofile(console.outputTree['title' .. i]) elseif console.outputTree['title' .. i]:match("%(") or console.outputTree['title' .. i]:match("=") then loadstring(console.outputTree['title' .. i])() end --if console.outputTree['title' .. i]:match("^.:\\.*%.lua$") then end --for i=console.outputTree.value+1,console.outputTree.value+console.outputTree['TOTALCHILDCOUNT'] do end --if console.outputTree["KIND"]=="BRANCH" then end --function startnode_script_update_with_children:action() --5.1.12 execute Lua script with Lua chunk of the node of console.outputTree and rewrite result under the node of tree console.outputTree startnode_script_update = iup.item {title = "Knoten aktualisieren"} function startnode_script_update:action() if console.outputTree["KIND"]=="BRANCH" then local startNodeValue=console.outputTree.value if console.outputTree["KIND" .. startNodeValue+1]=="LEAF" then console.outputTree['delnode' .. startNodeValue+1] = "SELECTED" --TOTALCHILDCOUNT end --if console.outputTree["KIND" .. startNodeValue+1]=="LEAF" then if console.outputTree['title']:match("^.:\\.*%.lua$") then dofile(console.outputTree['title']) elseif console.outputTree['title']:match("%(") or console.outputTree['title']:match("=") then loadstring(console.outputTree['title'])() end --if console.outputTree['title']:match("^.:\\.*%.lua$") then end --if console.outputTree["KIND"]=="BRANCH" then end --function startnode_script_update:action() --5.1.13 put the menu items together in the menu for console.outputTree menu = iup.menu{ startcopy, renamenode, addbranch, addbranch_fromclipboard, addbranchbottom, addbranch_fromclipboardbottom, addleaf, addleaf_fromclipboard, addleafbottom, addleaf_fromclipboardbottom, startversion, startnodescripter, startnode_script, startnode_script_update_with_children, startnode_script_update, startnode, } --5.1 menu of console.outputTree end --6 buttons --6.1 logo image definition and button with logo img_logo = iup.image{ { 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,3,3,1,1,3,3,3,1,1,1,1,1,3,1,1,1,3,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,3,3,1,1,3,1,1,3,1,1,1,1,3,1,1,3,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,3,3,3,3,1,1,1,1,1,3,1,1,3,1,1,1,1,3,1,3,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,3,3,3,4,4,3,1,1,1,1,3,3,3,3,1,1,1,1,3,3,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,3,3,3,3,4,4,3,3,1,1,1,3,1,1,1,3,1,1,1,3,1,3,1,1,1,1,1,1,4,4,4 }, { 4,1,1,3,3,3,3,3,3,3,3,1,1,1,3,1,1,1,3,1,1,1,3,1,1,3,1,1,1,1,1,4,4,4 }, { 4,1,1,3,3,3,3,3,3,3,3,1,1,1,3,3,3,3,1,1,3,1,3,1,1,1,3,1,3,1,1,4,4,4 }, { 4,1,1,1,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,3,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,3,1,3,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,3,1,3,3,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,1,1,3,3,1,3,1,3,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,4,1,1,3,3,1,3,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,1,1,1,4,4,4,4,4,3,3,4,4,4,4,1,3,3,1,1,1,1,1,1,1,4,4,4,4 }, { 4,1,1,1,1,1,1,1,4,4,4,4,3,3,3,3,3,3,4,4,4,3,1,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,1,4,4,4,4,4,3,3,3,3,3,3,3,3,3,4,3,4,1,1,1,1,1,1,1,1,4,4,4 }, { 4,1,1,1,1,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,1,1,1,1,1,1,4,4,4 }, { 4,1,1,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,1,1,1,1,1,4,4,4 }, { 4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,1,1,1,4,4,4 }, { 4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,1,1,4,4,4 }, { 4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,4,4,4 }, { 4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4 }, { 4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4 }, { 4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4 }, { 4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, { 4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4 }, { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4 }, { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }, { 3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }, { 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 } ; colors = { "255 255 255", color_light_color_grey, color_blue, "255 255 255" } } button_logo=iup.button{image=img_logo,title="", size="23x20"} function button_logo:action() iup.Message("Dr. Bruno Kaiser","Lizenz Open Source\nb.kaiser@beckmann-partner.de") end --function button_logo:flat_action() --6.2 button for saving tree button_save_lua_table=iup.flatbutton{title="Baum speichern", size="95x20", BGCOLOR=color_buttons, FGCOLOR=color_button_text} function button_save_lua_table:flat_action() save_tree_to_lua(console.outputTree, path .. "\\Tree_console_output.lua") end --function button_save_lua_table:flat_action() --7. Main Dialog --7.1 load output tree from file if file_exists(path .. "\\Tree_console_output.lua") then dofile(path .. "\\Tree_console_output.lua") end --if file_exists(path .. "\\Tree_console_output.lua") then console.outputTree = iup.tree{ map_cb=function(self) if lua_tree_output then self:AddNodes(lua_tree_output) else self:AddNodes({branchname="console"}) end --if lua_tree_output then end, --function(self) SIZE="200x200", showrename="YES",--F2 key active markmode="SINGLE",--for Drag & Drop SINGLE not MULTIPLE showdragdrop="YES", }--console.outputTree = iup.tree{ -- Callback of the right mouse button click function console.outputTree:rightclick_cb(id) console.outputTree.value = id menu:popup(iup.MOUSEPOS,iup.MOUSEPOS) --popup the defined menue end --function console.outputTree:rightclick_cb(id) -- Callback for pressed keys function console.outputTree:k_any(c) if c == iup.K_DEL then console.outputTree.delnode = "MARKED" elseif c == iup.K_cDEL then console.outputTree.delnode0 = "CHILDREN" console.outputTree.title='console' console.version_info() elseif c == iup.K_cC then --copy node of console.outputTree clipboard.text = console.outputTree['title'] elseif c == iup.K_Menu then menu:popup(iup.MOUSEPOS,iup.MOUSEPOS) --popup the defined menue end --if c == iup.K_DEL then end --function console.outputTree:k_any(c) --7.2 building the dialog and put buttons, trees and other elements together console.dialog = iup.dialog{ iup.vbox{ iup.hbox{button_logo, button_save_lua_table, iup.vbox{console.textbox_branch,console.textbox_leaf}, }, --iup.hbox{ iup.frame{title = "Command:", iup.hbox{ -- use it to inherit margins console.prompt, }, --iup.hbox{ }, --iup.frame{title = "Command:", iup.frame{title = "Output:", iup.hbox{ -- use it to inherit margins --console.output, console.outputTree, }, --iup.hbox{ }, --iup.frame{title = "Output:", --margin = "5x5", --gap = "5", }, --iup.vbox{ title="Lua Console", size="HALFxFULL", -- initial size icon=img_logo, -- 0 use the Lua icon from the executable in Windows } --iup.dialog{ --7.3 close Main Dialog function console.dialog:close_cb() print = console.orig_print -- restore print and io.write io.write = console.orig_write iup.ExitLoop() -- should be removed if used inside a bigger application console.dialog:destroy() return iup.IGNORE end --7.4 show the dialog console.dialog:showxy(iup.LEFT,iup.CENTER) console.dialog.size = nil -- reset initial size, allow resize to smaller values iup.SetFocus(console.prompt) --7.5 fill the tree with version informations if tree not build by file if lua_tree_output==nil then console.version_info() end --if lua_tree_output then --7.6 Main Loop if (iup.MainLoopLevel() == 0) then iup.MainLoop() end --if (iup.MainLoopLevel() == 0) then
require "raytrace" MODE = 2 if MODE == 1 then local bvh = newBVH(OBJToTriangles(readOBJFile("models/box.obj"),{generateNormals=false}),4) local cam = newCamera({1.5,2,2}, {0,0,0}, 60, {640,480}) setCameraLookAt(cam,{0,0,0}) local frame = renderNDotL(cam, {1,0.8,0.5}, bvh) writePPM('output/render.ppm',frame) elseif MODE == 2 then local triangles = OBJToTriangles(readOBJFile("models/box.obj"),{generateNormals=false}) local cam = newCamera({2,2,2}, {0,0,0}, 60, {320,240}) setCameraLookAt(cam,{0,0,0}) local light = newDirectionalLight({1,1,1},{-1,-1,-1}) local material = newMaterial(newDiffuseBSDF({1,0,1}),nil) local scene = newScene() sceneAddMaterial(scene,material) sceneAddPrimitives(scene,triangles,{materialIndex=1}) sceneAddLight(scene,light) local frame = render(cam,scene) writePPM('output/render.ppm',frame) end
Locales['es'] = { ['press_collect_coke'] = 'Presiona ~INPUT_CONTEXT~ para cosechar la Coca', ['press_process_coke'] = 'Presiona ~INPUT_CONTEXT~ para tratar la Coca', ['press_sell_coke'] = 'Presiona ~INPUT_CONTEXT~ para vender la Coca', ['press_collect_meth'] = 'Presiona ~INPUT_CONTEXT~ para recoger ingredientes del LSD', ['press_process_meth'] = 'Presiona ~INPUT_CONTEXT~ para cocinar el LSD', ['press_sell_meth'] = 'Presiona ~INPUT_CONTEXT~ para vender el LSD', ['press_collect_weed'] = 'Presiona ~INPUT_CONTEXT~ para cosechar el Hierbón', ['press_process_weed'] = 'Presiona ~INPUT_CONTEXT~ para embolsar el Hierbón', ['press_sell_weed'] = 'Presiona ~INPUT_CONTEXT~ para vender el Hierbón', ['press_collect_opium'] = "Presiona ~INPUT_CONTEXT~ para cosechar el Opio", ['press_process_opium'] = "Presiona ~INPUT_CONTEXT~ para tratar el Opio", ['press_sell_opium'] = "Presiona ~INPUT_CONTEXT~ para vender el Opio", ['act_imp_police'] = 'Acción ~r~imposible~s~, ~b~policias~s~: ~o~%s~s~/~y~%s~s~ online', ['inv_full_coke'] = 'No puedes recoger mas cocaina, tu inventario está ~r~lleno~s~', ['pickup_in_prog'] = '~y~Recogida en curso~s~...', ['too_many_pouches'] = 'Tienes demasiadas bolsas', ['not_enough_coke'] = 'No tienes suficiente hoja de coca para ~r~fabricar~s~', ['packing_in_prog'] = '~y~Fabricación en curso~s~...', ['no_pouches_sale'] = 'No tienes mas bolsas para ~r~vender~s~', ['sold_one_coke'] = 'Has vendido ~g~1 Gramo de Coca~s~', ['sale_in_prog'] = '~g~Venta en curso~s~...', ['inv_full_meth'] = 'No puedes recoger mas ingredientes, tu inventario está ~r~lleno~s~', ['not_enough_meth'] = 'No tienes suficientes ingredientes para ~r~fabricar~s~ mas LSD', ['sold_one_meth'] = 'Has vendido ~g~1 Bote de LSD~s~', ['inv_full_weed'] = 'No puedes recoger mas hierba, tu inventario está ~r~lleno~s~', ['not_enough_weed'] = 'No tienes suficiente hierba para ~r~embolsar~s~', ['sold_one_weed'] = 'Has vendido ~g~1 Bolsa de Hierbón~s~', ['used_one_weed'] = 'Has gastado una bolsa de ~b~hierbón', ['inv_full_opium'] = 'No puedes recoger mas hierba, tu inventario está ~r~lleno~s~', ['not_enough_opium'] = 'No tienes sufiente Opio para ~r~fabricar~s~', ['sold_one_opium'] = 'Has vendido ~g~1 Bolsa de Opio~s~', ['used_one_opium'] = 'Has gastado una bolsa de ~b~Opio', ['exit_marker'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~process~s~', -- Blips ['coke_field'] = 'cocaine Field', ['coke_processing'] = 'cocaine Processing', ['coke_dealer'] = 'cocaine Dealer', ['meth_field'] = 'meth Field', ['meth_processing'] = 'meth Processing', ['meth_dealer'] = 'meth Dealer', ['weed_field'] = 'weed Field', ['weed_processing'] = 'weed Processing', ['weed_dealer'] = 'weed Dealer', ['opium_field'] = 'opium Field', ['opium_processing'] = 'opium Processing', ['opium_dealer'] = 'opium Dealer', }
local L = LibStub("AceLocale-3.0"):NewLocale("ClassicCodex", "zhTW") if not L then return end L = L or {} -- browser.lua L["Quest Start"] = "任務開始" L["Quest End"] = "任務結束" L["Quest Level"] = "任務等級" L["Required Level"] = "需要等級" L["Hostile"] = "敵對" L["Friendly"] = "友方" L["Reaction"] = "反應" L["Alliance"] = "聯盟" L["Horde"] = "部落" L["Location"] = "地點" L["Looted from"] = "拾取自" L["Sold by"] = "售賣者" L["and %d others"] = "以及%d個其他結果" L["Too many entries. Results shown: %d"] = "條目太多,僅顯示前%d條" L["Units"] = "單位" L["Objects"] = "對象" L["Items"] = "物品" L["Quests"] = "任務" L["Left-Click"] = "左鍵" L["Open Browser"] = "打開瀏覽器" L["Shift-Click"] = "Shift-左鍵" L["Move Button"] = "移動按鈕" L["ClassicCodex"] = "ClassicCodex 全能數據庫" L["Clean Map"] = "清除" L["Search"] = "搜索" -- command.lua L["|cff33ffcc/codex|cffffffff show |cffcccccc - Show database interface"] = "|cff33ffcc/codex|cffffffff show |cffcccccc - 顯示數據庫瀏覽器" L["|cff33ffcc/codex|cffffffff unit <unit> |cffcccccc - Search units"] = "|cff33ffcc/codex|cffffffff unit <unit> |cffcccccc - 搜索單位" L["|cff33ffcc/codex|cffffffff object <gameObject> |cffcccccc - Search objects"] = "|cff33ffcc/codex|cffffffff object <gameObject> |cffcccccc - 搜索物體、目標" L["|cff33ffcc/codex|cffffffff item <item> |cffcccccc - Search items"] = "|cff33ffcc/codex|cffffffff item <item> |cffcccccc - 搜索物品" L["|cff33ffcc/codex|cffffffff vendor <item> |cffcccccc - Search vendors for item"] = "|cff33ffcc/codex|cffffffff vendor <item> |cffcccccc - 搜索物品售賣者" L["|cff33ffcc/codex|cffffffff quest <questName> |cffcccccc - Show specific quest giver"] = "|cff33ffcc/codex|cffffffff quest <questName> |cffcccccc - 搜索任務給予者" L["|cff33ffcc/codex|cffffffff quests |cffcccccc - Show all quests on the map"] = "|cff33ffcc/codex|cffffffff quests |cffcccccc - 在地圖上顯示所有任務" L["|cff33ffcc/codex|cffffffff meta <relation> [min, [max]] |cffcccccc - Show related objects on the map"] = "|cff33ffcc/codex|cffffffff meta <relation> [min, [max]] |cffcccccc - 在地圖上顯示相關目標、對象" L["|cff33ffcc/codex|cffffffff clean |cffcccccc - Clean map"] = "|cff33ffcc/codex|cffffffff clean |cffcccccc - 清理地圖" L["|cff33ffcc/codex|cffffffff reset |cffcccccc - Reset map"] = "|cff33ffcc/codex|cffffffff reset |cffcccccc - 重置地圖" L["|cff33ffcc ->|cffffffff Available relations: |cff33ffccchests|r, |cff33ffccherbs|r, |cff33ffccmines|r"] = "|cff33ffcc ->|cffffffff 可用關系: |cff33ffccchests|r - 寶箱, |cff33ffccherbs|r - 草藥, |cff33ffccmines|r - 礦物" -- config.lua L["CONFIG_TEXT_FONT"] = "Fonts/bKAI00M.ttf" L["Auto-Accept Quests"] = "自動接任務" L["Toggle auto-accepting quests"] = "開啟/關閉自動接任務" L["Auto-Turnin Quests"] = "自動交任務" L["Toggle auto-turning in quests"] = "開啟/關閉自動交任務" L["Nameplate Quest Icon"] = "姓名板任務圖標" L["Toggle quest icon on top of enemy nameplates"] = "在任務怪姓名板上方顯示任務感嘆號" L["All Questgivers"] = "顯示所有可接任務" L["If selected, this will display all questgivers on the map"] = "選中後,在地圖和小地圖上顯示可接任務的圖標" L["Current Questgivers"] = "顯示當前任務NPC" L["If selected, current quest-ender npcs/objects will be displayed on the map for active quests"] = "選中後,可交付當前任務的NPC或物體會顯示在地圖上" L["Show Low-level Quests"] = "顯示低等級任務" L["If selected, low-level quests will be hidden on the map"] = "選中後,地圖上的低等級任務(比玩家等級低10級)不再被隱藏" L["Show High-level Quests"] = "顯示高等級任務" L["If selected, quests with a level requirement of your level + 3 will be shown on the map"] = "選中後,可接等級比玩家等級高3級的任務也會顯示在地圖上" L["Show Festival/PVP/Misc Quests"] = "顯示節日/PVP/雜項任務" L["If selected, quests related to WoW festive seasons or PVP or not available at the current stage will be displayed on the map"] = "選中後,與遊戲內節日、PVP相關的任務和某些當前階段不可用的任務會被顯示在地圖上" L["Color By Spawn"] = "按任務怪類型標記顏色" L["If selected, markers' colors will be set per spawn type or per quest if not selected"] = "選中後,不同任務怪的地圖標記顏色不同。如果未選中,則壹個任務的所有任務怪都是同壹個顏色。" L["Quest Marker Size"] = "任務標記大小" L["Spawn Marker Size"] = "怪物標記大小" L["Hide items with a drop probability less than (%)"] = "隱藏掉落概率低於(%)的物品" L["Show All Quests You Manually Hide Again"] = "重新顯示所有手動隱藏的任務" L["Show all the quests you have hidden by shift + click."] = "顯示所有通過Shift+點擊隱藏的任務" L["Hide a quest by holding the shift key and clicking on the quest icon on the minimap or world map."] = "按住Shift並點擊小地圖或世界地圖上的任務圖標可以隱藏任務" L["ClassicCodex: You have no manually hidden quests. You can hold the shift key and click on the quest icon on the minimap or world map to hide it."] = "ClassicCodex: 您沒有手動隱藏過任何任務,按住Shift並點擊小地圖或世界地圖上的任務圖標可以隱藏任務" L["ClassicCodex: %d hidden quests will be able to show again."] = "ClassicCodex: %d個隱藏任務已重新顯示" L["List Manually Hidden Quests"] = "列出手動隱藏的任務" L["List Completed Quests"] = "列出完成的任務" L["Show ID in Codex Browser"] = "在查詢結果中顯示ID" L["If selected, the item/object/unit/quest ID will be displayed when you searching something in Codex browser."] = "選中後,“ClassicCodex全能數據庫”查詢窗口將顯示物品/對象/單位/任務的ID。" L["Show Minimap Button"] = "顯示小地圖按鈕" L["Show a button on the edge of the minimap, click to open Codex browser"] = "在小地圖邊緣顯示一個按鈕,點擊可打開 ClassicCodex 全能數據庫" L["Show Markers on Continent"] = "在大陸地圖上顯示圖標" L["Show markers at the top level of the world map"] = "在世界地圖的頂層顯示圖標" L["Boss Marker Size"] = "BOSS標記大小" L["Display a larger icon for the boss or a single target to help you find it"] = "增大BOSS等單個目標的圖標以便能找到" L["Open Codex Browser"] = "打開 ClassicCodex 全能數據庫" -- map.lua L["Buy"] = "購買" L["Required"] = "需要" L["Loot"] = "拾取" L["Vendor"] = "商販" L["Level"] = "等級" -- quest.lua L["QUEST_STATE_SPLIT_REGEXP"] = "(.*):%s*([%d]+)%s*/%s*([%d]+)" L["Show"] = "顯示" L["Hide"] = "隱藏" L["Reset"] = "重置" L["All Quests"] = "顯示所有任務" L["Tracked Quests"] = "顯示追蹤的任務" L["Manual Selection"] = "顯示手動選擇的任務" L["Hide Quests"] = "不顯示任務" -- ui.lua L["DEFAULT_FONT"] = "Fonts\\bLEI00D.TTF"
-- plugs core lib local class_http = {} function class_http:new (port) if not self._http then self._http = require('http') --print(self._http:new()) end self._port = port return self end function class_plugs:init (lib_name) self._plugs = require(lib_name .. '.init') self._plugs.run(self.plugs_yml, current_dir) end function class_http:result (cookies) return self.data, self.msg end function class_http:cookies (cookies) self._cookies = cookies end function class_http:headers (headers) self._headers = headers end -- this is post method function class_http:request (path, ...) -- use http request to call plugs function local result, error_message = self._http.request("POST", 'http://127.0.0.1:' .. self._port .. path, { body = json_encode({ ... }), headers = self._headers, -- { op = 123 } _cookies = self._cookies -- { op = 123 } }) if error_message then self.data, self.msg = nil, 'Call plugs func got err:' .. error_message else if result['status_code'] == 200 then local res = json_decode(result.body) if res.code == 0 then self.data, self.msg = res.data, nil else self.data, self.msg = res.data, res.msg end else self.data, self.msg = nil, 'Plugs return status not 200' end end return self end function class_http:call (...) return self:request('/call') end return class_http
--[[ Variables ]] pedsFlags = {} defaultpedsFlags = { isDead = false, isCuffed = false, isRobbing = false, isEscorting = false, isEscorted = false, isBlindfolded = false, isInTrunk = false, isInBeatMode = false, isInsideVanillaUnicorn = false, isNPC = false, isJobEmployer = false, isSittingOnChair = false, isPoledancing = false, isPawnBuyer = false, isRecycleExchange = false, isVehicleSpawner = false, isBoatRenter = false, isMethDude = false, isBankAccountManager = false, isShopKeeper = false, isWeaponShopKeeper = false, isToolShopKeeper = false, isSportShopKeeper = false, isCasinoChipSeller = false, } --[[ Functions ]] function GetPedFlags(netID) local flags = pedsFlags[netID] local field = 0 for flag, enabled in pairs(flags) do local mask = Flags["PedFlags"][flag] if mask ~= nil then field = enabled and field | mask or field &~ mask end end return field end --[[ Events ]] RegisterNetEvent("caue:flags:ped:stateChanged") AddEventHandler("caue:flags:ped:stateChanged", function(netId, pFlag, pState) local src = source if pedsFlags[netID] then pedsFlags[netID][pFlag] = pState end end) RegisterNetEvent("caue-base:sessionStarted") AddEventHandler("caue-base:sessionStarted", function() local src = source pedsFlags[src] = defaultpedsFlags end) RegisterNetEvent("SpawnEventsServer") AddEventHandler("SpawnEventsServer", function() local src = source Citizen.Wait(5000) pedsFlags[src] = defaultpedsFlags TriggerClientEvent("caue:flags:set", src, src, "player", "PedFlags", GetPedFlags(src)) end) RegisterNetEvent("caue-flags:ped:getFlags") AddEventHandler("caue-flags:ped:getFlags", function() local src = source if pedsFlags[src] then TriggerClientEvent("caue:flags:set", src, src, "player", "PedFlags", GetPedFlags(src)) end end)
-------------------------------------------------------------------------------- --! @file CharaTppBreakableGenerator.lua --! @brief プレイヤーが壊せるギミック -------------------------------------------------------------------------------- CharaTppBreakableGenerator = { ---------------------------------------- --各システムとの依存関係の定義 -- -- GeoやGrなどの各システムのJob実行タイミングを -- 「キャラクタのJob実行後」に合わせ、 -- システムを正常に動作させるために必要。 -- 使用するシステム名を記述してください。 -- -- "Gr" : 描画を使うなら必要 -- "Geo" : 当たりを使うなら必要 -- "Nt" : 通信同期を使うなら必要 -- "Fx" : エフェクトを使うなら必要 -- "Sd" : サウンドを使うなら必要 -- "Noise" : ノイズを使うなら必要 -- "Nav" : 経路探索を使うなら必要 -- "GroupBehavior" : 連携を使うなら必要 -- "Ui" : UIを使うなら必要 ---------------------------------------- dependSyncPoints = { "Gr", "Geo", "Nt", "Fx", "Sd", "Noise", }, --[[ C++化完了 dependSyncPointsはTppBreakableObjectすべてが移行しないとはずせない pluginIndexEnumInfoName = "TppGadgetPluginDefine", -------------------------------------------------------------------------------- -- callback function -------------------------------------------------------------------------------- ---------------------------------------- --! @brief 生成処理 OnCreate() --! キャラクタ生成時に呼ばれる関数. プラグインの生成などを行う --! @param chara ---------------------------------------- OnCreate = function( chara ) local charaObj = chara:GetCharacterObject() charaObj.gadgetType = 16 end, AddGadgetPlugins = function( chara ) --Fox.Log( "CharaTppBreakableGenerator>OnCreate()" ) -- ギミック共通プラグイン --TppGadgetUtility.AddGadgetCommonPlugin(chara) -- アクションプラグイン追加 CharaTppBreakableGenerator.AddActionPlugin(chara) end, -- OnCreate = function() -- アクションプラグイン追加 AddActionPlugin = function( chara ) chara:AddPlugins { -- 破壊オブジェクトアクション "PLG_DESTRUCTIBLE_ACTION", TppGadgetDestructActionPlugin { name = "DestructibleObjectAction", parent = "ActionRoot", bodyPlugin = "Body", exclusiveGroups = { TppPluginExclusiveGroup.StateAction }, }, } end, ---------------------------------------- --初期化処理 OnReset() -- リスポーン時など、パラメータ類の初期化が必要なタイミングで呼ばれる -- パラメータの初期化などを行う ---------------------------------------- OnReset = function( chara ) if Fox.GetActMode() == "GAME" then -- 稼働音 local plgSound = chara:FindPlugin( "ChSoundPlugin" ) --plgSound:CallSound("PlayGeneratorLoop", ChConnectSoundObject{ eventName = "Play_sfx_m_light_generator_1_loop", }) plgSound:CallSound( "PlayGeneratorLoop", ChSoundObject{ eventName = "Play_sfx_m_light_generator_1_loop", worldMatrix = chara:GetWorldMatrix(), } ) end --chara:SetStop() end, ---------------------------------------- --解放処理 OnRelease() -- キャラクタの解放時によばれる ---------------------------------------- OnRelease = function( chara ) local plgLife = chara:FindPlugin( "ChLifePlugin" ) if not Entity.IsNull(plgLife) then local life = plgLife:GetValue( "Strength" ) if life:Get() < 0 or not Fox.GetActMode() == "GAME" then -- 稼働音停止 local plgSound = chara:FindPlugin( "ChSoundPlugin" ) plgSound:RequestToStoreSoundControl() -- LastSoundが即消えしないようにする。 plgSound:StopSound( "PlayGeneratorLoop" ) -- LoopSoundが残り続けないようにする。 plgSound:CallSound( "PlayGeneratorEnd", ChConnectSoundObject{ eventName = "Play_sfx_m_light_generator_1_down", worldMatrix = chara:GetWorldMatrix(), } ) end end end, ]] } -- CharaTppBreakableGenerator
#!/usr/bin/env lua -- ================================================================== -- -- LOM (Lua Object Model): on top of 'lxp' -- DOM: doc = {['.'] = tag; ['@'] = {}; ['&'] = {{}..}; '\0comment', ...} -- Usage example: -- lom = require('lom') -- doc = lom(xmlfile or '') -- doc = lom('') doc:parse(txt):parse() -- lom(true) -- buildxlink -- xmltxt = doc:drop(1) -- ================================================================== -- local lxp = require('lxp') -- the standard Lua Expat module local class = require('pool') -- https://github.com/josh-feng/pool.git local we = require('us') -- working environment local next, assert, type = next, assert, type local strlen, strsub, strmatch, strgmatch = string.len, string.sub, string.match, string.gmatch local strrep, strgsub, strfind = string.rep, string.gsub, string.find local tinsert, tremove, tconcat = table.insert, table.remove, table.concat local mmin = math.min -- ================================================================== -- local lom = {doc = {}} -- doctree for files, user's management {{{ local docs = lom.doc -- xml object list (hidden upvalue) local function starttag (p, name, attr) -- {{{ local stack = p:getcallbacks().stack tinsert(stack, {['.'] = name, ['@'] = #attr > 0 and attr or nil}) end -- }}} local function endtag (p, name) -- {{{ local stack = p:getcallbacks().stack local element = tremove(stack) -- assert(element['.'] == name) tinsert(stack[#stack], element) end -- }}} local function cleantext (p, txt) -- {{{ if strfind(txt, '%S') then txt = strmatch(txt, '^.*%S') local stack = p:getcallbacks().stack tinsert(stack[#stack], txt) end end -- }}} local function text (p, txt) -- {{{ local stack = p:getcallbacks().stack tinsert(stack[#stack], txt) end -- }}} local function comment (p, txt) -- {{{ local stack = p:getcallbacks().stack tinsert(stack[#stack], '\0'..txt) end -- }}} local function parse (o, txt) -- friend function {{{ local p = o[0] local status, msg, line, col, pos = p:parse(txt) -- pass nil if failed if not (txt and status) then if not status then o['?'] = {msg..' #'..line} end p:close() -- seems destroy the lxp obj o[0] = nil o.parse = nil end return o -- for cascade oop end --}}} -- ================================================================== -- local function xPath (c, paths, doc) -- {{{ return doc/xml-node table, ending index local path = paths[c] if (not path) or path[0] == '/' or path[0] == '' or #doc == 0 then return doc, c end -- xpath syntax: NB: xpointer does not have standard treatment -- /A/B[@attr="val",@bb='4'] -- anywhere/A/B[-3]/-2/3 local anywhere = strsub(path[0], 1, 1) ~= '/' local tag = anywhere and path[0] or strsub(path[0], 2, #path[0]) local idx = tonumber(path) if idx then return xPath(c + 1, paths, {doc[(idx - 1) % #doc + 1]}) end local autopass = true for i = 1, #path do if autopass then autopass = (type(path[i]) == 'number') else break end end local xn = {} -- xml-node (doc) local docl = doc['&'] local docn = docl and 0 repeat for i = 1, #doc do local mt = doc[i] if type(mt) == 'table' then if mt['.'] == tag and (autopass or we.match(mt['@'], path)) then tinsert(xn, mt) elseif anywhere and (#mt > 0 or mt['&']) then local mtl = mt['&'] local mtn = mtl and 0 repeat local sub = xPath(c, paths, mt) for j = 1, #sub do tinsert(xn, sub[j]) end if mtn then mtn = mtn < #mtl and mtn + 1 end mt = mtn and mtl[mtn] until not mt end end end if docn then docn = docn < #docl and docn + 1 end doc = docn and docl[docn] until not doc if #path > 0 and #xn > 0 then -- collect the indixed table local nxn = {} for i = 1, #path do if type(path[i]) == 'number' then tinsert(nxn, xn[(path[i] - 1) % #xn + 1]) end end if #nxn ~= 0 then xn = nxn end -- collected end -- not final: break to further search if #xn > 0 and c ~= #paths and path ~= '' then local nxn = {} for i = 1, #xn do local mt = xn[i] for j = 1, #mt do tinsert(nxn, mt[j]) end end xn = nxn end return xPath(c + 1, paths, xn) end -- }}} local function procXpath (path) -- {{{ XPath language parser -- xpath: path0/path1/path3[att1,att2=txt,attr3='txt'] local t = {} repeat local elem, attr elem, path = strmatch(path, '^(/?[%w_:]*)(.*)$') elem = {[0] = elem} if strsub(path, 1, 1) == '[' then while strsub(path, 1, 1) ~= ']' do attr, path = strmatch(strsub(path, 2, #path), '^([_%w]*)(.*)$') local c = strsub(path, 1, 1) if tonumber(attr) then tinsert(elem, tonumber(attr)) elseif c == ',' then path = strsub(path, 2, #path) elem[attr] = true elseif c == '=' then -- '/" ... c = strsub(path, 2, 2) if c == '"' or c == "'" then c, path = strmatch(strsub(path, 3, #path), '^([^'..c..']*)'..c..'(.*)$') if not c then error('Wrong attr quote', 2) end elem[attr] = c else c, path = strmatch(strsub(path, 2, #path), '^([^,%]]*)(.*)$') elem[attr] = c end elseif c ~= ']' then error('Wrong attr setting: '..attr..':'..path, 2) end if #path < 1 then error('Wrong attr setting', 2) end end path = strsub(path, 2, #path) end tinsert(t, elem) until path == '' return t end -- }}} -- ================================================================== -- local function xmlstr (s, fenc) -- {{{ -- encode: gzip -c | base64 -w 128 -- decode: base64 -i -d | zcat -f -- return '<!-- base64 -i -d | zcat -f -->{{{'.. -- we.popen(s, 'we.gzip -c | base64 -w 128'):read('*all')..'}}}' s = tostring(s) if strfind(s, '\n') or (strlen(s) > 1024) then -- large text if fenc or strfind(s, ']]>') then -- enc flag or hostile strings local status, stdout, stderr = we.popen(s, 'gzip -c | base64 -w 128') return '<!-- base64 -i -d | zcat -f -->{{{'..stdout..'}}}' else -- return (strfind(s, '"') or strfind(s, "'") or strfind(s, '&') or -- strfind(s, '<') or strfind(s, '>')) and '<![CDATA[\n'..s..']]>' or s return (strfind(s, '&') or strfind(s, '<') or strfind(s, '>')) and '<![CDATA[\n'..s..']]>' or s end else -- escape characters return strgsub(strgsub(strgsub(strgsub(strgsub(s, '&', '&amp;'), '"', '&quot;'), "'", '&apos;'), '<', '&lt;'), '>', '&gt;') end end -- }}} local function wXml (node) -- {{{ if 'string' == type(node) then return strsub(node, 1, 1) ~= '\0' and node or '<!--'..node..'-->' end local res = {} if node['@'] then for _, k in ipairs(node['@']) do tinsert(res, k..'="'..strgsub(node['@'][k], '"', '\\"')..'"') end end res = '<'..node['.']..(#res > 0 and ' '..tconcat(res, ' ') or '') if #node == 0 then return res..' />' end res = {res..'>'} for i = 1, #node do tinsert(res, type(node[i]) == 'table' and wXml(node[i]) or xmlstr(node[i])) end if #res == 2 and #(res[2]) < 100 and not strfind(res[2], '\n') then return res[1]..res[2]..'</'..node['.']..'>' end return strgsub(tconcat(res, '\n'), '\n', '\n ')..'\n</'..node['.']..'>' -- indent 2 end -- }}} local dom = class { -- lua document object model {{{ ['.'] = false; -- tag name ['@'] = false; -- attr ['&'] = false; -- xlink table ['?'] = false; -- errors ['*'] = false; -- module ['<'] = function (o, spec, mode) --{{{ if type(spec) == 'table' then -- partial table-tree (0: data/stamp) for k, v in pairs(spec) do if k ~= 0 then o[k] = v end -- new data setting end elseif type(spec) == 'string' then -- '' for text local p = lxp.new { StartElement = starttag, EndElement = endtag, CharacterData = mode and text or cleantext, Comment = mode and comment or nil, _nonstrict = true, stack = {o} -- {{}} } if spec == '' then o[0] = p o.parse = parse else local file, msg = io.open(spec, 'r') if file then local status, msg, line, col, pos = p:parse(file:read('*all')) file:close() if status then status, msg, line = p:parse() end if not status then o['?'] = {msg..' #'..line} end p:close() else o['?'] = {msg} end end end if type(spec) == 'string' and spec ~= '' then docs[spec] = o else tinsert(docs, o) end end; --}}} ['>'] = function (o) for i = 0, #o do o[i] = nil end end; parse = false; -- implemented in friend function xpath = function (o, path, doc) return (xPath(1, procXpath(path), doc or o)) -- only first end; -- output drop = function (o, fxml) -- {{{ drop fxml=1/html if not fxml then return we.var2str(o) end local res = {fxml == 1 and '<?xml version="1.0" encoding="UTF-8"?>' or nil} local docl = o['&'] local docn = docl and 0 repeat for j = 1, #o do tinsert(res, wXml(o[j])) end if docn then docn = docn < #docl and docn + 1 end o = docn and docl[docn] until not o return tconcat(res, '\n') end;-- }}} -- member functions supporting cascade oo style select = function (o, path) return class:new(o, o:xpath(path)) end; } -- }}} local buildxlink = function () -- xlink -- xlink/xpointer based on root {{{ for _, xml in ipairs(docs) do if xml.parse then xml:parse() end end local stamp = math.random() local stack = {} local function traceTbl (doc, xml) -- {{{ lua table form local href = doc['@'] and doc['@']['xlink:href'] if href then -- print(xml..'<'..doc['.']..'>'..href) tinsert(stack, xml..'<'..doc['.']..'>'..href) if stack[href] then href = 'loop '..tconcat(stack, '->') tremove(stack) if not docs[xml]['?'] then docs[xml]['?'] = {} end return tinsert(docs[xml]['?'], href) end stack[href] = true if (not doc['&']) or (doc['&'][0] ~= stamp) then -- attr local link, xpath = strmatch(href, '^([^#]*)(.*)') -- {{{ file_link, tag_path if link == '' then -- back to this doc root link = xml else -- new file if strsub(link, 1, 1) ~= '/' then link = strgsub(type(xml) == 'string' and xml or '', '[^/]*$', '')..link end link = we.normpath(link) end -- }}} if (type(link) == 'string') and not docs[link] then docs[link] = dom(link) end if xml ~= link then traceTbl(docs[link], link) end local paths = procXpath(strmatch(xpath or '', '#xpointer%((.*)%)')) link, xpath = xPath(1, paths, docs[link]) if #link == 0 then -- error message href ='broken path <'..doc['.']..'> '..tostring(xpath) if not docs[xml]['?'] then docs[xml]['?'] = {} end tinsert(docs[xml]['?'], href) doc['&'] = nil else doc['&'] = link -- xlink link[0] = stamp -- print(doc['@']['xlink:href'], 'linked', #link) end end stack[href] = nil tremove(stack) -- #stack end for i = 1, #doc do -- continous override if type(doc[i]) == 'table' and doc[i]['.'] then traceTbl(doc[i], xml) end end end -- }}} for xml, o in pairs(docs) do if not o['?'] then traceTbl(o, xml) end end end; -- }}} setmetatable(lom, { __metatable = true; __tostring = function (c) return we.tbl2str(lom.doc, '\n') end; __call = function (c, spec) -- {{{ dom object creator if type(spec) == 'string' then -- '' for incremental text spec = we.normpath(spec) if docs[spec] then return docs[spec] end elseif spec and type(spec) ~= 'table' then -- closing return buildxlink() -- TODO error message end return dom(spec) end; -- }}} }) -- }}} -- ================================================================== -- lom.api = class[dom].__index; -- dom's member function extension lom.api.data = function (o, data) -- attach {{{ o[0] = type(data) == 'table' and data or {data} return o end -- }}} local function setAttr (t, var, val) -- {{{ t['@'] = t['@'] or {} if t['@'][var] == nil then tinsert(t['@'], var) end t['@'][var] = val end -- }}} lom.api.attr = function (o, var, val) -- {{{ get/set if val then -- cascade coding local c = type(val) == 'function' and type(o[0]) == 'table' for i = 1, c and mmin(#o, #(o[0])) or #o do setAttr(o[i], var, c and val(o[0], i) or val) end return o end local vals = {} for _, t in ipairs(o) do tinsert(vals, t['@'] and t['@'][var] or false) end return vals end -- }}} lom.api.map = function (o, func) -- map data and process nodes {{{ if o[0] and type(func) == 'function' then for i = 1, mmin(#o, #(o[0])) do o[0][i] = func(o[0], i, o) -- pass o as well end end return o end -- }}} lom.api.text = function (o, txt) -- {{{ for i = 1, #o do if type(o[i]) == 'table' then tinsert(o[i], txt) end end return o end -- }}} lom.api.arrange = function (o, ele, i) -- {{{ also remove/append TODO if type(o[1]) == 'table' then tinsert(o[1], ((tonumber(i) or 0) -1) % (#(o[1]) + 1) + 1, {['.'] = ele}) end return o end -- }}} lom.api.filter = function (o, val) -- TODO adjust return o end lom.api.enter = function (o) -- TODO return o end lom.api.exit = function (o) -- TODO return o end -- ================================================================== -- -- service for checking object model and demo/debug -- {{{ if arg and #arg > 0 and strfind(arg[0] or '', 'lom.lua$') then local doc = lom(arg[1] == '-' and '' or arg[1]) if arg[1] == '-' then doc:parse(io.stdin:read('a')):parse() end lom(true) print(doc['?'] and tconcat(doc['?'], '\n') or doc:drop()) end -- }}} return lom -- vim:ts=4:sw=4:sts=4:et:fen:fdm=marker:fmr={{{,}}}:fdl=1
----------------------------------- -- Area: Lower_Delkfutts_Tower ----------------------------------- require("scripts/globals/zone") ----------------------------------- zones = zones or {} zones[tpz.zone.LOWER_DELKFUTTS_TOWER] = { text = { CONQUEST_BASE = 0, -- Tallying conquest results... THE_DOOR_IS_FIRMLY_SHUT_OPEN_KEY = 159, -- The door is firmly shut. You might be able to open it if you had the key. DOOR_FIRMLY_SHUT = 160, -- The door is firmly shut. ITEM_CANNOT_BE_OBTAINED = 6571, -- You cannot obtain the <item>. Come back after sorting your inventory. ITEM_OBTAINED = 6577, -- Obtained: <item>. GIL_OBTAINED = 6578, -- Obtained <number> gil. KEYITEM_OBTAINED = 6580, -- Obtained key item: <keyitem>. FELLOW_MESSAGE_OFFSET = 6606, -- I'm ready. I suppose. FISHING_MESSAGE_OFFSET = 7238, -- You can't fish here. PLAYER_OBTAINS_ITEM = 8621, -- <name> obtains <item>! UNABLE_TO_OBTAIN_ITEM = 8622, -- You were unable to obtain the item. PLAYER_OBTAINS_TEMP_ITEM = 8623, -- <name> obtains the temporary item: <item>! ALREADY_POSSESS_TEMP = 8624, -- You already possess that temporary item. NO_COMBINATION = 8629, -- You were unable to enter a combination. REGIME_REGISTERED = 10707, -- New training regime registered! COMMON_SENSE_SURVIVAL = 11761, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world. }, mob = { HIPPOLYTOS_PH = { [17531000] = 17530999, -- 337.079 -16.1 17.386 [17531002] = 17530999, -- 346.244 -16.126 10.373 }, EPIALTES_PH = { [17530882] = 17530881, -- 432.952 -0.350 -3.719 [17530887] = 17530881, -- 484.735 0.046 23.048 }, EURYMEDON_PH = { [17531118] = 17531114, -- 397.252 -32.128 -32.807 }, DISASTER_IDOL = 17531121, }, npc = { CASKET_BASE = 17531134, }, } return zones[tpz.zone.LOWER_DELKFUTTS_TOWER]
--- --- Generated by EmmyLua(https://github.com/EmmyLua) --- Created by heyqule. --- DateTime: 01/09/2020 6:40 PM --- local Sprites = require('__stdlib__/stdlib/data/modules/sprites') local ERM_WeaponRig = require('__enemyracemanager__/lib/rig/weapon') require('util') local ProjectileAnimation = {} function ProjectileAnimation.create_dragoon_ball() return { type = "projectile", name = "dragoon-projectile", flags = { "not-on-map" }, acceleration = 0.005, action = { type = "direct", action_delivery = { type = "instant", target_effects = { { type = "create-entity", entity_name = "dragoon-explosion-small" } } } }, animation = { layers = { { filename = "__erm_toss__/graphics/entity/projectiles/dragoon/dragoon-ball.png", frame_count = 5, width = 32, height = 32, scale = 1.5, priority = "high", draw_as_glow = true, }, } } } end function ProjectileAnimation.create_dragoon_hit_effect() return { type = "explosion", name = "dragoon-explosion-small", flags = { "not-on-map" }, animations = { { filename = "__erm_toss__/graphics/entity/projectiles/dragoon/dragoon-hit-effect.png", priority = "extra-high", width = 64, height = 64, frame_count = 10, animation_speed = 0.5, draw_as_glow = true, } } } end function ProjectileAnimation.create_corsair_hit_effect() return { type = "explosion", name = "corsair-explosion-small", flags = { "not-on-map" }, animations = { { filename = "__erm_toss__/graphics/entity/projectiles/dragoon/dragoon-hit-effect.png", priority = "extra-high", width = 64, height = 64, frame_count = 10, animation_speed = 0.5, draw_as_glow = true, tint = { 1, 1, 1 } } } } end function ProjectileAnimation.create_arbiter_stasis() return { type = "projectile", name = "stasis-projectile", flags = { "not-on-map" }, acceleration = 0.005, action = { type = "direct", action_delivery = { type = "instant", target_effects = { { type = "create-entity", entity_name = "stasis-explosion-small" } } } }, animation = { layers = { { filename = "__erm_toss__/graphics/entity/projectiles/dragoon/dragoon-ball.png", frame_count = 5, width = 32, height = 32, scale = 1.5, priority = "high", draw_as_glow = true, }, } } } end function ProjectileAnimation.create_arbiter_stasis_hit_effect() return { type = "explosion", name = "stasis-explosion-small", flags = { "not-on-map" }, animations = { { filename = "__erm_toss__/graphics/entity/projectiles/stasis/stasis.png", priority = "extra-high", width = 128, height = 128, frame_count = 13, animation_speed = 0.5, scale = 2.5, draw_as_glow = true, } } } end function ProjectileAnimation.create_carrier_interceptor() return { type = "projectile", name = "interceptor-projectile", flags = { "not-on-map" }, acceleration = 0.005, action = { type = "direct", action_delivery = { type = "instant", target_effects = { { type = "create-entity", entity_name = "medium-explosion" } } } }, animation = { layers = { { filename = "__erm_toss__/graphics/entity/units/interceptor/interceptor-run.png", frame_count = 1, width = 32, height = 32, scale = 1, priority = "high", direction_count = 16, }, } } } end function ProjectileAnimation.create_scout_rocket() return ERM_WeaponRig.remove_damage_from_rocket( util.table.deepcopy(data.raw['projectile']['rocket']), 'scout-rocket' ) end function ProjectileAnimation.create_electric_cloud() return { type = "explosion", name = "electric-cloud-explosion", flags = { "not-on-map" }, animations = { { filename = "__erm_toss__/graphics/entity/projectiles/psystorm/psystorm.png", priority = "extra-high", width = 224, height = 224, frame_count = 14, animation_speed = 0.2, scale = 2, draw_as_glow = true } } } end function ProjectileAnimation.create_archon_hit_effect() return { type = "explosion", name = "archon-hit-explosion", flags = { "not-on-map" }, animations = { { filename = "__erm_toss__/graphics/entity/projectiles/archon_attack/archon-hit-effect.png", priority = "extra-high", width = 80, height = 80, frame_count = 6, animation_speed = 0.5, scale = 1.5, draw_as_glow = true } } } end function ProjectileAnimation.create_air_death() return { type = "explosion", name = "protoss-small-air-death", flags = { "not-on-map" }, animations = { filename = "__erm_toss__/graphics/entity/units/air-death/air-death.png", width = 220, height = 200, frame_count = 15, direction_count = 1, axially_symmetrical = false, scale = 1.5, animation_speed = 0.5, draw_as_glow = true } }, { type = "explosion", name = "protoss-large-air-death", flags = { "not-on-map" }, animations = { filename = "__erm_toss__/graphics/entity/units/air-death/air-death.png", width = 220, height = 200, frame_count = 15, direction_count = 1, axially_symmetrical = false, scale = 2.5, animation_speed = 0.5, draw_as_glow = true } } end function ProjectileAnimation.create_slow_ticker() return { type = "sticker", name = "protoss-slowdown-sticker", flags = {}, animation = Sprites.empty_pictures(), duration_in_ticks = 2 * 60, target_movement_modifier = 0.67, vehicle_speed_modifier = 0.67, } end function ProjectileAnimation.create_ground_death() return { type = "explosion", name = "protoss-zealot-death", flags = { "not-on-map" }, animations = { filename = "__erm_toss__/graphics/entity/units/zealot/zealot-death.png", width = 128, height = 128, frame_count = 7, direction_count = 1, axially_symmetrical = false, scale = 1, animation_speed = 0.2, draw_as_glow = true } }, { type = "explosion", name = "protoss-templar-death", flags = { "not-on-map" }, animations = { filename = "__erm_toss__/graphics/entity/units/templar/templar-death.png", width = 128, height = 128, frame_count = 6, direction_count = 1, axially_symmetrical = false, scale = unit_scale, animation_speed = 0.2, draw_as_glow = true }, } end return ProjectileAnimation
local http = require("socket.http") local ltn12 = require("ltn12") return function( url, args ) local resp = {} args = args or {} -- set some defaults args.url = url args.sink = ltn12.sink.table(resp) if not args.method then args.method = 'GET' end local _, code, headers, status = http.request(args) return { body = table.concat(resp), headers = headers, -- ??? parse ??? raw_cookies = {}, set_cookies = {}, status = code, raw_headers = headers, }, not _, code end
-------------------------------- -- @module ControlButton -- @extend Control -- @parent_module cc -------------------------------- -- -- @function [parent=#ControlButton] isPushed -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- -- @function [parent=#ControlButton] setSelected -- @param self -- @param #bool enabled -------------------------------- -- Sets the title label to use for the specified state.<br> -- If a property is not specified for a state, the default is to use<br> -- the ButtonStateNormal value.<br> -- param label The title label to use for the specified state.<br> -- param state The state that uses the specified title. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setTitleLabelForState -- @param self -- @param #cc.Node label -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] setAdjustBackgroundImage -- @param self -- @param #bool adjustBackgroundImage -------------------------------- -- -- @function [parent=#ControlButton] setHighlighted -- @param self -- @param #bool enabled -------------------------------- -- -- @function [parent=#ControlButton] setZoomOnTouchDown -- @param self -- @param #bool var -------------------------------- -- Sets the title string to use for the specified state.<br> -- If a property is not specified for a state, the default is to use<br> -- the ButtonStateNormal value.<br> -- param title The title string to use for the specified state.<br> -- param state The state that uses the specified title. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setTitleForState -- @param self -- @param #string title -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] setLabelAnchorPoint -- @param self -- @param #vec2_table var -------------------------------- -- -- @function [parent=#ControlButton] getLabelAnchorPoint -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) -------------------------------- -- -- @function [parent=#ControlButton] getTitleTTFSizeForState -- @param self -- @param #int state -- @return float#float ret (return value: float) -------------------------------- -- -- @function [parent=#ControlButton] setTitleTTFForState -- @param self -- @param #string fntFile -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] setTitleTTFSizeForState -- @param self -- @param #float size -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] setTitleLabel -- @param self -- @param #cc.Node var -------------------------------- -- -- @function [parent=#ControlButton] setPreferredSize -- @param self -- @param #size_table var -------------------------------- -- -- @function [parent=#ControlButton] getCurrentTitleColor -- @param self -- @return color3b_table#color3b_table ret (return value: color3b_table) -------------------------------- -- -- @function [parent=#ControlButton] setEnabled -- @param self -- @param #bool enabled -------------------------------- -- Returns the background sprite used for a state.<br> -- param state The state that uses the background sprite. Possible values are<br> -- described in "CCControlState". -- @function [parent=#ControlButton] getBackgroundSpriteForState -- @param self -- @param #int state -- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite) -------------------------------- -- -- @function [parent=#ControlButton] getHorizontalOrigin -- @param self -- @return int#int ret (return value: int) -------------------------------- -- -- @function [parent=#ControlButton] needsLayout -- @param self -------------------------------- -- @overload self -- @overload self -- @function [parent=#ControlButton] getCurrentTitle -- @param self -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#ControlButton] getScaleRatio -- @param self -- @return float#float ret (return value: float) -------------------------------- -- -- @function [parent=#ControlButton] getTitleTTFForState -- @param self -- @param #int state -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#ControlButton] getBackgroundSprite -- @param self -- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite) -------------------------------- -- Returns the title color used for a state.<br> -- param state The state that uses the specified color. The values are described<br> -- in "CCControlState".<br> -- return The color of the title for the specified state. -- @function [parent=#ControlButton] getTitleColorForState -- @param self -- @param #int state -- @return color3b_table#color3b_table ret (return value: color3b_table) -------------------------------- -- Sets the color of the title to use for the specified state.<br> -- param color The color of the title to use for the specified state.<br> -- param state The state that uses the specified color. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setTitleColorForState -- @param self -- @param #color3b_table color -- @param #int state -------------------------------- -- Adjust the background image. YES by default. If the property is set to NO, the<br> -- background will use the prefered size of the background image. -- @function [parent=#ControlButton] doesAdjustBackgroundImage -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Sets the background spriteFrame to use for the specified button state.<br> -- param spriteFrame The background spriteFrame to use for the specified state.<br> -- param state The state that uses the specified image. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setBackgroundSpriteFrameForState -- @param self -- @param #cc.SpriteFrame spriteFrame -- @param #int state -------------------------------- -- Sets the background sprite to use for the specified button state.<br> -- param sprite The background sprite to use for the specified state.<br> -- param state The state that uses the specified image. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setBackgroundSpriteForState -- @param self -- @param #ccui.Scale9Sprite sprite -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] setScaleRatio -- @param self -- @param #float var -------------------------------- -- -- @function [parent=#ControlButton] setBackgroundSprite -- @param self -- @param #ccui.Scale9Sprite var -------------------------------- -- -- @function [parent=#ControlButton] getTitleLabel -- @param self -- @return Node#Node ret (return value: cc.Node) -------------------------------- -- -- @function [parent=#ControlButton] getPreferredSize -- @param self -- @return size_table#size_table ret (return value: size_table) -------------------------------- -- -- @function [parent=#ControlButton] getVerticalMargin -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Returns the title label used for a state.<br> -- param state The state that uses the title label. Possible values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] getTitleLabelForState -- @param self -- @param #int state -- @return Node#Node ret (return value: cc.Node) -------------------------------- -- -- @function [parent=#ControlButton] setMargins -- @param self -- @param #int marginH -- @param #int marginV -------------------------------- -- Sets the font of the label, changes the label to a BMFont if neccessary.<br> -- param fntFile The name of the font to change to<br> -- param state The state that uses the specified fntFile. The values are described<br> -- in "CCControlState". -- @function [parent=#ControlButton] setTitleBMFontForState -- @param self -- @param #string fntFile -- @param #int state -------------------------------- -- -- @function [parent=#ControlButton] getTitleBMFontForState -- @param self -- @param #int state -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#ControlButton] getZoomOnTouchDown -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Returns the title used for a state.<br> -- param state The state that uses the title. Possible values are described in<br> -- "CCControlState".<br> -- return The title for the specified state. -- @function [parent=#ControlButton] getTitleForState -- @param self -- @param #int state -- @return string#string ret (return value: string) -------------------------------- -- @overload self, ccui.Scale9Sprite -- @overload self -- @overload self, cc.Node, ccui.Scale9Sprite -- @overload self, string, string, float -- @function [parent=#ControlButton] create -- @param self -- @param #string title -- @param #string fontName -- @param #float fontSize -- @return ControlButton#ControlButton ret (return value: cc.ControlButton) -------------------------------- -- -- @function [parent=#ControlButton] onTouchMoved -- @param self -- @param #cc.Touch touch -- @param #cc.Event event -------------------------------- -- -- @function [parent=#ControlButton] onTouchEnded -- @param self -- @param #cc.Touch touch -- @param #cc.Event event -------------------------------- -- -- @function [parent=#ControlButton] setColor -- @param self -- @param #color3b_table -------------------------------- -- -- @function [parent=#ControlButton] onTouchCancelled -- @param self -- @param #cc.Touch touch -- @param #cc.Event event -------------------------------- -- -- @function [parent=#ControlButton] setOpacity -- @param self -- @param #unsigned char var -------------------------------- -- -- @function [parent=#ControlButton] updateDisplayedOpacity -- @param self -- @param #unsigned char parentOpacity -------------------------------- -- -- @function [parent=#ControlButton] updateDisplayedColor -- @param self -- @param #color3b_table parentColor -------------------------------- -- -- @function [parent=#ControlButton] onTouchBegan -- @param self -- @param #cc.Touch touch -- @param #cc.Event event -- @return bool#bool ret (return value: bool) return nil
--[[ Train + benchmark the 'best' network arch on the LSP (+MPII) datasets. ]] paths.dofile('train_mpii_lsp.lua') paths.dofile('benchmark_mpii_lsp.lua')
-- Called OnSpellStart function TauntStart(event) local caster = event.caster local ability = event.ability local ability_level = ability:GetLevel() - 1 local radius = ability:GetLevelSpecialValueFor("radius", ability_level) local duration = ability:GetLevelSpecialValueFor("duration", ability_level) local caster_team = caster:GetTeamNumber() local caster_location = caster:GetAbsOrigin() -- Targetting constants local target_team = ability:GetAbilityTargetTeam() or DOTA_UNIT_TARGET_TEAM_ENEMY local target_type = ability:GetAbilityTargetType() or bit.bor(DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_HERO) local target_flags = ability:GetAbilityTargetFlags() or DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES local enemies_in_radius = FindUnitsInRadius(caster_team, caster_location, nil, radius, target_team, target_type, target_flags, FIND_ANY_ORDER, false) for _,enemy in pairs(enemies_in_radius) do if enemy then -- Interrupt channelling and current orders enemy:Interrupt() -- Force the enemy to attack the caster if enemy:IsCreep() and not enemy:IsControllableByAnyPlayer() then enemy:SetForceAttackTarget(caster) elseif not enemy:IsCommandRestricted() then local order = { UnitIndex = enemy:entindex(), OrderType = DOTA_UNIT_ORDER_ATTACK_TARGET, TargetIndex = caster:entindex() } ExecuteOrderFromTable(order) end -- Apply a modifier with command restricted state ability:ApplyDataDrivenModifier(caster, enemy, "modifier_earth_spirit_custom_taunted", {["duration"] = duration}) end end end -- Called OnDestroy function TauntEnd(event) local unit = event.target if unit:IsCreep() then unit:SetForceAttackTarget(nil) end end -- Called OnIntervalThink function TauntCheck(keys) local caster = keys.caster local unit = keys.target if caster and unit then if caster:IsAlive() then if caster:IsInvisible() or caster:IsAttackImmune() or caster:IsInvulnerable() then unit:RemoveModifierByName("modifier_earth_spirit_custom_taunted") end else unit:RemoveModifierByName("modifier_earth_spirit_custom_taunted") end end end
local b = true local GO = nil local InstructionsLayer = nil local GOXform = nil local GOMesh = nil local center = Vector3(0, 0, -16.0) local offscreen = Vector3(50.0, 0, -16.0) local speed = -100.0 local exitscreen = -100 local reached = false local exit = false movein = false completed = false local camera_GO = nil local cameraXform = nil local enterSound = "Tutorial_Page_Paper_Rustle_In" local exitSound = "Tutorial_Page_Paper_Rustle_Out" local myBoolean = false -- texture names local arrayoftextures = {} currTexture = "" function Start() if(currTexture ~= nil) then GOMesh:SetDiffuseTexture(currTexture) end movein = true completed = false if(cameraXform ~= nil) then pos = cameraXform:GetWorldPosition() if(myBoolean == false) then myBoolean = true AudioSystem_PlayAudioAtLocation(enterSound, pos) end end end function OnUpdate(dt) if(b) then InstructionsLayer = GetLayer("InstructionsLayer") if(InstructionsLayer == nil) then InstructionsLayer = CreateLayer("InstructionsLayer") end cam = InstructionsLayer:GetObject("MainCamera") camComp = cam:GetComponent("Camera") lookat = Vector3(0,0,-1) camComp:SetLookAt(lookat) camComp:SetUICam(true) GO = InstructionsLayer:Create("BlackBoard") GOXform = GO:AddComponent("Transform") GOMesh = GO:AddComponent("MeshRenderer") GOMesh:SetMesh("Blackboard") rotation = Vector3(0, 180, 0) GOXform:SetWorldRotation(rotation) scale = Vector3(0.75, 0.75, 0.75) GOXform:SetWorldScale(scale) GOXform:SetWorldPosition(offscreen) -- to be commented away -- currTexture = "KILLALLDUMMIES" -- GOMesh:SetDiffuseTexture(currTexture) -- end of to be commented b = false camera_GO = owner:GetLayer():GetObject("Camera") if(camera_GO ~= nil) then cameraXform = camera_GO:GetComponent("Transform") end write("Instructions.lua : Creation Complete") end currPos = GOXform:GetWorldPosition() if(movein) then if(currPos:x() ~= center:x()) then newX = currPos:x() + speed * dt if(newX < 0) then newX = 0 reached = true end newPos = Vector3(newX, 0, -16.0) GOXform:SetWorldPosition(newPos) end end if(reached) then if(ControllerDown("Shoot") or ControllerDown("Jump")) then exit = true if(cameraXform ~= nil) then pos = cameraXform:GetWorldPosition() if(myBoolean) then AudioSystem_PlayAudioAtLocation(exitSound, pos) myBoolean = false end end end end if(exit) then if(currPos:x() ~= exitscreen) then exitX = currPos:x() + speed * dt if(exitX < exitscreen) then exitX = exitscreen reached = false exit = false movein = false completed = true GOXform:SetWorldPosition(offscreen) else exitPos = Vector3(exitX, 0, -16.0) GOXform:SetWorldPosition(exitPos) end end end end
includeFile("tangible/wearables/cybernetic/s05/cybernetic_s05_torso.lua") includeFile("tangible/wearables/cybernetic/s05/cybernetic_s05_arm_l.lua") includeFile("tangible/wearables/cybernetic/s05/cybernetic_s05_legs.lua") includeFile("tangible/wearables/cybernetic/s05/cybernetic_s05_arm_r.lua")
object_mobile_skeleton_bm_fambaa = object_mobile_skeleton_shared_bm_fambaa:new { } ObjectTemplates:addTemplate(object_mobile_skeleton_bm_fambaa, "object/mobile/skeleton/bm_fambaa.iff")
--este test esta deshabilitado porque no llamo los event handlers con pcall (para facilitar el debug) module(..., lunit.testcase, package.seeall) local common = dofile("common.lua") function test() local order = {} local exceptionHandled = false -- This nextTick function will throw an error. It should only be called once. -- When it throws an error, it should still get removed from the queue. process.nextTick(function() table.insert(order, "A") -- cause an error what() end) -- This nextTick function should remain in the queue when the first one -- is removed. It should be called if the error in the first one is -- caught (which we do in this test). process.nextTick(function() table.insert(order, "C") end) process:addListener('uncaughtException', function() if not exceptionHandled then exceptionHandled = true table.insert(order, "B") else -- If we get here then the first process.nextTick got called twice table.insert(order, "OOPS!") end end) process:addListener("exit", function() assert_equal("A", order[1]) assert_equal("B", order[2]) assert_equal("C", order[3]) end) process:loop() end
-- debugger/form_editor.lua local forms = {} local path = minetest.get_worldpath() -- Load forms local function load_formdata() local res = io.open(path.."/debugger_form_editor.txt", "r") if res then res = minetest.deserialize(res:read("*all")) if type(res) == "table" then forms = res end end end -- Load all forms load_formdata() -- Save forms function save_formdata() io.open(path.."/debugger_form_editor.txt", "w"):write(minetest.serialize(forms)) end -- Register on shutdown minetest.register_on_shutdown(save_formdata) -- Editor formspec local function get_editor_formspec(name) local form_string = forms[name] or "" local output = form_string:split("\n") for i, line in ipairs(output) do output[i] = line end return [[ size[20,12] box[-0.27,-0.3;13,12.68;#FFFFFF00] ]]..table.concat(output)..[[ textarea[13.03,-0.35;7.58,13.9;input;;]]..minetest.formspec_escape(form_string)..[[] button[12.75,11.64;2.5,1;refresh;Refresh and Save] label[15.3,11.8;Elements are separated by a newline.] ]] end -- Register chatcommand minetest.register_chatcommand("form_editor", { param = "<edit/preview>", description = "Formspec Creator", privs = {debug=true}, func = function(name, param) local form_string = forms[name] or "" if param == "preview" then -- Show formspec minetest.show_formspec(name, "debugger:form_preview", form_string) else -- Show formspec editor minetest.show_formspec(name, "debugger:form_editor", get_editor_formspec(name)) end end, }) -- Register tool minetest.register_craftitem("debugger:form_editor", { description = "[DEBUG] Formspec Editor", inventory_image = "debugger_form_editor.png", stack_max = 1, groups = { not_in_creative_inventory = debugger.CREATIVE }, -- [on_use] Show editor on_use = function(itemstack, player) local name = player:get_player_name() -- Show formspec editor minetest.show_formspec(name, "debugger:form_editor", get_editor_formspec(name)) end, on_place = function(itemstack, player) local name = player:get_player_name() local form_string = forms[name] or "" -- Show formspec minetest.show_formspec(name, "debugger:form_preview", form_string) end, }) -- [event] On Receive Fields minetest.register_on_player_receive_fields(function(player, formname, fields) if formname == "debugger:form_editor" then local name = player:get_player_name() if fields.refresh then forms[name] = fields.input -- Update formspec editor minetest.show_formspec(name, "debugger:form_editor", get_editor_formspec(name)) end end end)
local DEBUG = -- function() end d local function _tr(str) return str end if not InventoryManager then InventoryManager = {} end local IM = InventoryManager local _Gain = nil local function do_sell(data, eventCode, itemName, itemQuantity, money) if eventCode ~= nil then _Gain = _Gain + money end IM:ProcessSingleItem(false, data) end local function filter_for_sale(fence, data) if data.stolen ~= fence then return false end if IM.FCOISL:IsProtectedAction( IM.ACTION_SELL, data.bagId, data.slotId, fence) then return false end return true end local function filter_for_launder(data) if IM.FCOISL:IsProtectedAction( IM.ACTION_LAUNDER, data.bagId, data.slotId) then return false end return true end function IM:ReportASState(currently) local currentlystr if(currently) then currentlystr = GetString(IM_LOG_ASSTATE_CURRENTLY) end if(IM.settings.autosell) then CHAT_SYSTEM:AddMessage(zo_strformat(GetString(IM_LOG_ASSTATE_ON), currentlystr)) else CHAT_SYSTEM:AddMessage(zo_strformat(GetString(IM_LOG_ASSTATE_OFF), currentlystr)) end end function IM:SellItems(stolen) local list = { } local end_fn = function(abort, eventCode, itemName, itemQuantity, money) if eventCode ~= nil then _Gain = _Gain + money end CHAT_SYSTEM:AddMessage(zo_strformat(GetString(IM_CUR_SOLDJUNK), _Gain)) end local launder_run = function(abort, eventCode, itemName, itemQuantity, money) if eventCode ~= nil then _Gain = _Gain + money end IM.currentRuleset:ResetCounters() IM:EventProcessBag(BAG_BACKPACK, IM.ACTION_LAUNDER, filter_for_launder, function(data) IM:ProcessSingleItem(false, data) end, function(abort) end_fn(abort) end, EVENT_ITEM_LAUNDER_RESULT, EVENT_CLOSE_STORE, IM.settings.bankMoveDelay) end _Gain = 0 IM.currentRuleset:ResetCounters() self:EventProcessBag(BAG_BACKPACK, IM.ACTION_SELL, function(data) return filter_for_sale(stolen, data) end, do_sell, ((stolen and launder_run) or end_fn), EVENT_SELL_RECEIPT, EVENT_CLOSE_STORE, IM.settings.bankMoveDelay) end local function OnOpenStore(eventCode) if IM.settings.autosell then IM:SellItems(false) end end local function OnOpenFence(eventCode) if IM.settings.autosell then IM:SellItems(true) end end EVENT_MANAGER:RegisterForEvent(IM.name, EVENT_OPEN_STORE, OnOpenStore) EVENT_MANAGER:RegisterForEvent(IM.name, EVENT_OPEN_FENCE, OnOpenFence)
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") -- Creating the net message stuff util.AddNetworkString("xyz_police_sign_open") util.AddNetworkString("xyz_police_sign_update") function ENT:Initialize() self:SetModel("models/freeman/owain_roadsign.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetUseType(SIMPLE_USE) self:SetModelScale(self:GetModelScale()*2.5, 0) self:Activate() local phys = self:GetPhysicsObject() phys:Wake() self:CPPISetOwner(self:Getowning_ent()) self.coolDown = 0 self.health = 400 --self:SetHead("!!ATTENTION!!") --self:SetBody("Please stand clear.\nThis area is off limits!\nPlease turn around when possible\nThank you for your co-operation") self:SetHead("") self:SetBody("") end -- Basic health system, deduct damage from heath, if health is <= 0 then run destroy function and remove the entity. function ENT:OnTakeDamage(dmg) self.health = (self.health or 400) - dmg:GetDamage() if self.health <= 0 then self:Destruct() self:Remove() end end -- Destroy function, just some fanc effects. function ENT:Destruct() local vPoint = self:GetPos() local effectdata = EffectData() effectdata:SetStart(vPoint) effectdata:SetOrigin(vPoint) effectdata:SetScale(1) util.Effect("Explosion", effectdata) end function ENT:Use(_, ply) if not (self:Getowning_ent() == ply) then return end net.Start("xyz_police_sign_open") net.WriteEntity(self) net.Send(ply) end net.Receive("xyz_police_sign_update", function(_, ply) local head = net.ReadString() local lines = net.ReadTable() local sign = net.ReadEntity() if sign.coolDown > CurTime() then return end sign.coolDown = CurTime() + 1 if not sign:GetClass() == "xyz_police_sign" then return end if sign:GetPos():Distance(ply:GetPos()) > 500 then return end if not (sign:Getowning_ent() == ply) then return end head = string.sub(head, 0, 18) sign:SetHead(head) -- 32 char limit per line if table.Count(lines) > 11 then return end local newText = "" for k, v in pairs(lines) do print(k, v) if string.len(v) > 32 then v = string.sub(v, 0, 32) end newText = newText..string.gsub(v, "\n", "").."\n" end newText = string.sub(newText, 0, string.len(newText)-1) sign:SetBody(newText) end)
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --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 Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_tangible_hair_human_shared_hair_human_female_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s01.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3485410635, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s01, "object/tangible/hair/human/shared_hair_human_female_s01.iff") object_tangible_hair_human_shared_hair_human_female_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s02.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 346590684, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s02, "object/tangible/hair/human/shared_hair_human_female_s02.iff") object_tangible_hair_human_shared_hair_human_female_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s03.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1571154513, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s03, "object/tangible/hair/human/shared_hair_human_female_s03.iff") object_tangible_hair_human_shared_hair_human_female_s04 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s04.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s04.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2789654853, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s04, "object/tangible/hair/human/shared_hair_human_female_s04.iff") object_tangible_hair_human_shared_hair_human_female_s05 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s05.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s05.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4014712520, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s05, "object/tangible/hair/human/shared_hair_human_female_s05.iff") object_tangible_hair_human_shared_hair_human_female_s06 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s06.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s06.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 878448223, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s06, "object/tangible/hair/human/shared_hair_human_female_s06.iff") object_tangible_hair_human_shared_hair_human_female_s07 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s07.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s07.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2102487506, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s07, "object/tangible/hair/human/shared_hair_human_female_s07.iff") object_tangible_hair_human_shared_hair_human_female_s08 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s08.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s08.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3344647616, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s08, "object/tangible/hair/human/shared_hair_human_female_s08.iff") object_tangible_hair_human_shared_hair_human_female_s09 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s09.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s09.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2388009549, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s09, "object/tangible/hair/human/shared_hair_human_female_s09.iff") object_tangible_hair_human_shared_hair_human_female_s10 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s10.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s10.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2644135870, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s10, "object/tangible/hair/human/shared_hair_human_female_s10.iff") object_tangible_hair_human_shared_hair_human_female_s11 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s11.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s11.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3566676019, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s11, "object/tangible/hair/human/shared_hair_human_female_s11.iff") object_tangible_hair_human_shared_hair_human_female_s12 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s12.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s12.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 260079780, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s12, "object/tangible/hair/human/shared_hair_human_female_s12.iff") object_tangible_hair_human_shared_hair_human_female_s14 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s14.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s14.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3178155069, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s14, "object/tangible/hair/human/shared_hair_human_female_s14.iff") object_tangible_hair_human_shared_hair_human_female_s15 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s15.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s15.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4100172720, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s15, "object/tangible/hair/human/shared_hair_human_female_s15.iff") object_tangible_hair_human_shared_hair_human_female_s16 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s16.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s16.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 796132135, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s16, "object/tangible/hair/human/shared_hair_human_female_s16.iff") object_tangible_hair_human_shared_hair_human_female_s17 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s17.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s17.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1719231658, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s17, "object/tangible/hair/human/shared_hair_human_female_s17.iff") object_tangible_hair_human_shared_hair_human_female_s18 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s18.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s18.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3698542776, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s18, "object/tangible/hair/human/shared_hair_human_female_s18.iff") object_tangible_hair_human_shared_hair_human_female_s19 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s19.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s19.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2508074805, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s19, "object/tangible/hair/human/shared_hair_human_female_s19.iff") object_tangible_hair_human_shared_hair_human_female_s20 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s20.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s20.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2967623734, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s20, "object/tangible/hair/human/shared_hair_human_female_s20.iff") object_tangible_hair_human_shared_hair_human_female_s21 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s21.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s21.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4193206203, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s21, "object/tangible/hair/human/shared_hair_human_female_s21.iff") object_tangible_hair_human_shared_hair_human_female_s22 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s22.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s22.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 586716972, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s22, "object/tangible/hair/human/shared_hair_human_female_s22.iff") object_tangible_hair_human_shared_hair_human_female_s23 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s23.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s23.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1811280033, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s23, "object/tangible/hair/human/shared_hair_human_female_s23.iff") object_tangible_hair_human_shared_hair_human_female_s24 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s24.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s24.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2417417141, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s24, "object/tangible/hair/human/shared_hair_human_female_s24.iff") object_tangible_hair_human_shared_hair_human_female_s25 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s25.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s25.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3642473528, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s25, "object/tangible/hair/human/shared_hair_human_female_s25.iff") object_tangible_hair_human_shared_hair_human_female_s26 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s26.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s26.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 34346159, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s26, "object/tangible/hair/human/shared_hair_human_female_s26.iff") object_tangible_hair_human_shared_hair_human_female_s27 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s27.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s27.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1258386210, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s27, "object/tangible/hair/human/shared_hair_human_female_s27.iff") object_tangible_hair_human_shared_hair_human_female_s30 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s30.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s30.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2882164046, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s30, "object/tangible/hair/human/shared_hair_human_female_s30.iff") object_tangible_hair_human_shared_hair_human_female_s31 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s31.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s31.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3804705475, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s31, "object/tangible/hair/human/shared_hair_human_female_s31.iff") object_tangible_hair_human_shared_hair_human_female_s32 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s32.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s32.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 969972308, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s32, "object/tangible/hair/human/shared_hair_human_female_s32.iff") object_tangible_hair_human_shared_hair_human_female_s34 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s34.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s34.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2336151245, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s34, "object/tangible/hair/human/shared_hair_human_female_s34.iff") object_tangible_hair_human_shared_hair_human_female_s35 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s35.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s35.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3258167616, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s35, "object/tangible/hair/human/shared_hair_human_female_s35.iff") object_tangible_hair_human_shared_hair_human_female_s36 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s36.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s36.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 421796311, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s36, "object/tangible/hair/human/shared_hair_human_female_s36.iff") object_tangible_hair_human_shared_hair_human_female_s37 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s37.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s37.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1344896602, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s37, "object/tangible/hair/human/shared_hair_human_female_s37.iff") object_tangible_hair_human_shared_hair_human_female_s38 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s38.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s38.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3928183368, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s38, "object/tangible/hair/human/shared_hair_human_female_s38.iff") object_tangible_hair_human_shared_hair_human_female_s39 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s39.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s39.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2737714629, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s39, "object/tangible/hair/human/shared_hair_human_female_s39.iff") object_tangible_hair_human_shared_hair_human_female_s40 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s40.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s40.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3927078694, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s40, "object/tangible/hair/human/shared_hair_human_female_s40.iff") object_tangible_hair_human_shared_hair_human_female_s41 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s41.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s41.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2736722091, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s41, "object/tangible/hair/human/shared_hair_human_female_s41.iff") object_tangible_hair_human_shared_hair_human_female_s42 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_female_s42.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_f_hair_s42.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2013837372, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_female_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_female_s42, "object/tangible/hair/human/shared_hair_human_female_s42.iff") object_tangible_hair_human_shared_hair_human_male_s01 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s01.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s01.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2377331336, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s01, "object/tangible/hair/human/shared_hair_human_male_s01.iff") object_tangible_hair_human_shared_hair_human_male_s02 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s02.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s02.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1453627935, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s02, "object/tangible/hair/human/shared_hair_human_male_s02.iff") object_tangible_hair_human_shared_hair_human_male_s03 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s03.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s03.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 531234194, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s03, "object/tangible/hair/human/shared_hair_human_male_s03.iff") object_tangible_hair_human_shared_hair_human_male_s04 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s04.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s04.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3830109830, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s04, "object/tangible/hair/human/shared_hair_human_male_s04.iff") object_tangible_hair_human_shared_hair_human_male_s05 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s05.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s05.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2907156747, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s05, "object/tangible/hair/human/shared_hair_human_male_s05.iff") object_tangible_hair_human_shared_hair_human_male_s06 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s06.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s06.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1984960924, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s06, "object/tangible/hair/human/shared_hair_human_male_s06.iff") object_tangible_hair_human_shared_hair_human_male_s07 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s07.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s07.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1063091729, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s07, "object/tangible/hair/human/shared_hair_human_male_s07.iff") object_tangible_hair_human_shared_hair_human_male_s08 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s08.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s08.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2237092355, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s08, "object/tangible/hair/human/shared_hair_human_male_s08.iff") object_tangible_hair_human_shared_hair_human_male_s09 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s09.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s09.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3428464014, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s09, "object/tangible/hair/human/shared_hair_human_male_s09.iff") object_tangible_hair_human_shared_hair_human_male_s10 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s10.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s10.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3751172221, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s10, "object/tangible/hair/human/shared_hair_human_male_s10.iff") object_tangible_hair_human_shared_hair_human_male_s11 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s11.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s11.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2526756848, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s11, "object/tangible/hair/human/shared_hair_human_male_s11.iff") object_tangible_hair_human_shared_hair_human_male_s12 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s12.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s12.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1301059431, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s12, "object/tangible/hair/human/shared_hair_human_male_s12.iff") object_tangible_hair_human_shared_hair_human_male_s13 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s13.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s13.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 75624682, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s13, "object/tangible/hair/human/shared_hair_human_male_s13.iff") object_tangible_hair_human_shared_hair_human_male_s14 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s14.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s14.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4284668926, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s14, "object/tangible/hair/human/shared_hair_human_male_s14.iff") object_tangible_hair_human_shared_hair_human_male_s15 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s15.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s15.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3060776051, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s15, "object/tangible/hair/human/shared_hair_human_male_s15.iff") object_tangible_hair_human_shared_hair_human_male_s16 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s16.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s16.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1836586212, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s16, "object/tangible/hair/human/shared_hair_human_male_s16.iff") object_tangible_hair_human_shared_hair_human_male_s17 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s17.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s17.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 611677033, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s17, "object/tangible/hair/human/shared_hair_human_male_s17.iff") object_tangible_hair_human_shared_hair_human_male_s18 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s18.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s18.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2659147643, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s18, "object/tangible/hair/human/shared_hair_human_male_s18.iff") object_tangible_hair_human_shared_hair_human_male_s19 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s19.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s19.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3614587126, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s19, "object/tangible/hair/human/shared_hair_human_male_s19.iff") object_tangible_hair_human_shared_hair_human_male_s20 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s20.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s20.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4075704309, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s20, "object/tangible/hair/human/shared_hair_human_male_s20.iff") object_tangible_hair_human_shared_hair_human_male_s21 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s21.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s21.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3152226424, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s21, "object/tangible/hair/human/shared_hair_human_male_s21.iff") object_tangible_hair_human_shared_hair_human_male_s22 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s22.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s22.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1626636527, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s22, "object/tangible/hair/human/shared_hair_human_male_s22.iff") object_tangible_hair_human_shared_hair_human_male_s23 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s23.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s23.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 704243554, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s23, "object/tangible/hair/human/shared_hair_human_male_s23.iff") object_tangible_hair_human_shared_hair_human_male_s24 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s24.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s24.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3524971638, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s24, "object/tangible/hair/human/shared_hair_human_male_s24.iff") object_tangible_hair_human_shared_hair_human_male_s25 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s25.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s25.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2602019835, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s25, "object/tangible/hair/human/shared_hair_human_male_s25.iff") object_tangible_hair_human_shared_hair_human_male_s26 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s26.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s26.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 1073742700, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s26, "object/tangible/hair/human/shared_hair_human_male_s26.iff") object_tangible_hair_human_shared_hair_human_male_s27 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s27.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s27.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 151872737, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s27, "object/tangible/hair/human/shared_hair_human_male_s27.iff") object_tangible_hair_human_shared_hair_human_male_s28 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s28.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s28.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3003599091, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s28, "object/tangible/hair/human/shared_hair_human_male_s28.iff") object_tangible_hair_human_shared_hair_human_male_s29 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s29.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s29.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 4194971518, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s29, "object/tangible/hair/human/shared_hair_human_male_s29.iff") object_tangible_hair_human_shared_hair_human_male_s30 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s30.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s30.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3922084493, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s30, "object/tangible/hair/human/shared_hair_human_male_s30.iff") object_tangible_hair_human_shared_hair_human_male_s31 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s31.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s31.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2697667840, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s31, "object/tangible/hair/human/shared_hair_human_male_s31.iff") object_tangible_hair_human_shared_hair_human_male_s32 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s32.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s32.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2078051735, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s32, "object/tangible/hair/human/shared_hair_human_male_s32.iff") object_tangible_hair_human_shared_hair_human_male_s33 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s33.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s33.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 852617754, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s33, "object/tangible/hair/human/shared_hair_human_male_s33.iff") object_tangible_hair_human_shared_hair_human_male_s34 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s34.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s34.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3375546638, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s34, "object/tangible/hair/human/shared_hair_human_male_s34.iff") object_tangible_hair_human_shared_hair_human_male_s35 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s35.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s35.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2151655043, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s35, "object/tangible/hair/human/shared_hair_human_male_s35.iff") object_tangible_hair_human_shared_hair_human_male_s37 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s37.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s37.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 304441753, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s37, "object/tangible/hair/human/shared_hair_human_male_s37.iff") object_tangible_hair_human_shared_hair_human_male_s38 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s38.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s38.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2821670283, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s38, "object/tangible/hair/human/shared_hair_human_male_s38.iff") object_tangible_hair_human_shared_hair_human_male_s39 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s39.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s39.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3777110534, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s39, "object/tangible/hair/human/shared_hair_human_male_s39.iff") object_tangible_hair_human_shared_hair_human_male_s40 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s40.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s40.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 2820563173, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s40, "object/tangible/hair/human/shared_hair_human_male_s40.iff") object_tangible_hair_human_shared_hair_human_male_s41 = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/hair/human/shared_hair_human_male_s41.iff" --Data below here is deprecated and loaded from the tres, keeping for easy lookups --[[ appearanceFilename = "appearance/hum_m_hair_s41.sat", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hair.iff", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", clientGameObjectType = 8211, collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@hair_detail:hair", gameObjectType = 8211, locationReservationRadius = 0, lookAtText = "@hair_lookat:hair", noBuildRadius = 0, objectName = "@hair_name:hair", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, totalCellNumber = 0, useStructureFootprintOutline = 0, clientObjectCRC = 3776120680, derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/hair/base/shared_hair_base.iff", "object/tangible/hair/human/base/shared_hair_human_base.iff", "object/tangible/hair/human/base/shared_hair_human_male_base.iff"} ]] } ObjectTemplates:addClientTemplate(object_tangible_hair_human_shared_hair_human_male_s41, "object/tangible/hair/human/shared_hair_human_male_s41.iff")
GM.MapData["slide_city_remake"] = { ToRemove = {}, FirstPush = {2490}, LastBrush = {3224}, LastType = "teleport", -- The restart teleporter doesn't take you to a spawn room SpawnTeleTriggers = {}, }
function Server_AdvanceTurn_Start (game,addNewOrder) AlreadyDeployed = {}; for _,terr in pairs(game.Map.Territories)do AlreadyDeployed[terr.ID] = 0; end --print('MAx DEPLOY ' .. Mod.Settings.MaxDeploy); end function Server_AdvanceTurn_Order(game, order, result, skipThisOrder, addNewOrder) if(order.proxyType == 'GameOrderDeploy') then local Deploys = order.NumArmies; local on = order.DeployOn; if(AlreadyDeployed[on] + Deploys > Mod.Settings.MaxDeploy)then --print('Ausgabe ' .. (AlreadyDeployed[on] + Deploys) .. ' ' .. Mod.Settings.MaxDeploy); Deploys = Mod.Settings.MaxDeploy-AlreadyDeployed[on]; skipThisOrder(WL.ModOrderControl.Skip); if(Deploys > 0)then addNewOrder(WL.GameOrderDeploy.Create(order.PlayerID,Deploys,on,false)); --print('Deploys ' .. Deploys .. ' on ' .. game.Map.Territories[on].Name .. AlreadyDeployed[on] .. ' armies deployed'); local terri = game.ServerGame.LatestTurnStanding.Territories[on]; local remainingarmies = order.NumArmies-Deploys; if(remainingarmies ~= nil)then if(remainingarmies > 0)then for _, terra in pairs(game.ServerGame.LatestTurnStanding.Territories)do if(terri.OwnerPlayerID == terra.OwnerPlayerID)then if(AlreadyDeployed[terra.ID] < Mod.Settings.MaxDeploy)then local PlaceFor = Mod.Settings.MaxDeploy-AlreadyDeployed[terra.ID]; if(PlaceFor>remainingarmies)then PlaceFor = remainingarmies; end if(PlaceFor > 0)then addNewOrder(WL.GameOrderDeploy.Create(terri.OwnerPlayerID,PlaceFor,terra.ID,false)); remainingarmies = remainingarmies - PlaceFor; --print('ReDeploys ' .. PlaceFor .. ' on ' .. game.Map.Territories[terra.ID].Name .. ' before there were ' .. AlreadyDeployed[terra.ID] .. ' armies deployed'); end end end end end end else --print('Ignoring Deploys zero order ' .. Deploys .. ' on ' .. game.Map.Territories[on].Name .. ' before there were ' .. AlreadyDeployed[on] .. ' armies deployed'); end else --print('Successfully ' .. Deploys .. ' on ' .. game.Map.Territories[on].Name .. ' before there were ' .. AlreadyDeployed[on] .. ' armies deployed'); AlreadyDeployed[on] = AlreadyDeployed[on] + Deploys; end end end function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end
local GameplayStatics=import'GameplayStatics'; local testcase={} local HitResult = import('HitResult'); function testcase:test(uworld,actor) print("=====Begin test blueprint") local bpClass = slua.loadClass("/Game/TestActor.TestActor") -- get out TArray for actors local arr=GameplayStatics.GetAllActorsOfClass(actor,bpClass,nil) for k,v in pairs(arr) do print("GetAllActorsOfClass",k,v) end self.bp = bpClass(uworld.CurrentLevel) print("blueprint",self.bp) self.bp:TestFoo("hello") self.bp:TestFoo("world") -- store old actor for map2 use, test a bug oldactor = self local bpClass = slua.loadClass("/Game/LuaBpActor.LuaBpActor") self.balls={} self.basepos={} self.rot={} for n=1,10 do local p = FVector(math.random(-100,100),math.random(-100,100),0) local actor = uworld:SpawnActor(bpClass,p,nil,nil) self.balls[n]=actor self.basepos[n]=p self.rot[n]=math.random(-100,100) -- actor.Name = 'ActorCreateFromLua_'..tostring(n) end -- print("=====End test blueprint",self.bp.Name) end function testcase:update(tt) for i,actor in pairs(self.balls) do local p = self.basepos[i] local h = HitResult() local rot = self.rot[i] local v = FVector(math.sin(tt)*rot,0,0) local offset = FVector(0,math.cos(tt)*rot,0) local ok,h=actor:K2_SetActorLocation(p+v+offset,true,h,true) end end function bpcall(a,b,c,d) print("bpcall",a,b,c,d) return 1024,"return from lua 虚幻引擎" end function bpcall2() print "bpcall2 with empty args" end return testcase
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:25' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] ZO_CompanionFooter_Gamepad = ZO_InitializingObject:Subclass() function ZO_CompanionFooter_Gamepad:Initialize(control) self.control = control local levelBarContainer = control:GetNamedChild("LevelBarContainer") self.companionIcon = levelBarContainer:GetNamedChild("Icon") self.levelLabel = levelBarContainer:GetNamedChild("Level") self.companionNameLabel = control:GetNamedChild("CompanionNameValue") local function OnBarLevelChanged(_, level) self.levelLabel:SetText(level) end local xpBarControl = levelBarContainer:GetNamedChild("Bar") ZO_StatusBar_SetGradientColor(xpBarControl, ZO_XP_BAR_GRADIENT_COLORS) self.xpBar = ZO_WrappingStatusBar:New(xpBarControl, OnBarLevelChanged) EVENT_MANAGER:RegisterForEvent("ZO_CompanionFooter_Gamepad", EVENT_COMPANION_EXPERIENCE_GAIN, function(eventId, ...) self:RefreshCompanionLevel() end) COMPANION_FOOTER_GAMEPAD_FRAGMENT = ZO_FadeSceneFragment:New(control) COMPANION_FOOTER_GAMEPAD_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState) if newState == SCENE_FRAGMENT_SHOWING then if HasActiveCompanion() then self.companionIcon:SetTexture(ZO_COMPANION_MANAGER:GetActiveCompanionIcon()) local FORCE_REFRESH = true self:RefreshCompanionLevel(FORCE_REFRESH) local companionName = GetCompanionName(GetActiveCompanionDefId()) self.companionNameLabel:SetText(zo_strformat(SI_COMPANION_NAME_FORMATTER, companionName)) end end end) end function ZO_CompanionFooter_Gamepad:RefreshCompanionLevel(forceRefresh) if HasActiveCompanion() and (forceRefresh or COMPANION_FOOTER_GAMEPAD_FRAGMENT:IsShowing()) then local level, currentXpInLevel, totalXpInLevel, isMaxLevel = ZO_COMPANION_MANAGER:GetLevelInfo() local shouldNotWrap = forceRefresh if isMaxLevel then self.xpBar:SetValue(level, 1, 1, shouldNotWrap, forceRefresh) else self.xpBar:SetValue(level, currentXpInLevel, totalXpInLevel, shouldNotWrap, forceRefresh) end end end ----------------------------- -- Global XML Functions ----------------------------- function ZO_CompanionFooter_Gamepad_OnInitialized(control) COMPANION_FOOTER_GAMEPAD = ZO_CompanionFooter_Gamepad:New(control) end
-- Toggles the Scoreboard Client:Subscribe("KeyUp", function(key_name) if (key_name == "Tab") then main_hud:CallEvent("ToggleScoreboard", {false}) end end) -- Toggles the Scoreboard Client:Subscribe("KeyDown", function(key_name) if (key_name == "Tab") then main_hud:CallEvent("ToggleScoreboard", {true}) end end) -- Updates someone scoreboard data function UpdatePlayerScoreboard(player) main_hud:CallEvent("UpdatePlayer", {player:GetID(), true, player:GetName(), player:GetPing()}) end -- Adds someone to the scoreboard Player:Subscribe("Spawn", function(player) UpdatePlayerScoreboard(player) end) -- Updates the ping every 5 seconds Timer:SetTimeout(5000, function() for k, player in pairs(NanosWorld:GetPlayers()) do UpdatePlayerScoreboard(player) end end)
torch = require 'torch' laia = laia or {} local ffi = wrequire 'ffi' local ssllib = nil if ffi ~= nil then ssllib = ffi.load('ssl') assert(ssllib ~= nil) ffi.cdef[[ typedef struct MD5state_st { unsigned long A,B,C,D; unsigned long Nl,Nh; unsigned long data[16]; unsigned int num; } MD5_CTX; int MD5_Init(MD5_CTX *c); int MD5_Update(MD5_CTX *c, const void *data, size_t len); int MD5_Final(unsigned char *md, MD5_CTX *c); unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); void MD5_Transform(MD5_CTX *c, const unsigned char *b); ]] end function laia.tensor_md5(x) assert(ffi ~= nil, 'FFI module was not found, you cannot use TensorMD5!') local typemap = { ['torch.CudaByteTensor'] = 'torch.ByteTensor', ['torch.CudaCharTensor'] = 'torch.CharTensor', ['torch.CudaShortTensor'] = 'torch.ShortTensor', ['torch.CudaIntTensor'] = 'torch.IntTensor', ['torch.CudaLongTensor'] = 'torch.LongTensor', ['torch.CudaTensor'] = 'torch.FloatTensor', ['torch.CudaDoubleTensor'] = 'torch.DoubleTensor', -- CPU tensors do not change type ['torch.ByteTensor'] = 'torch.ByteTensor', ['torch.CharTensor'] = 'torch.CharTensor', ['torch.ShortTensor'] = 'torch.ShortTensor', ['torch.IntTensor'] = 'torch.IntTensor', ['torch.LongTensor'] = 'torch.LongTensor', ['torch.FloatTensor'] = 'torch.FloatTensor', ['torch.DoubleTensor'] = 'torch.DoubleTensor' } local t = typemap[torch.type(x)] assert(t ~= nil, ('Tensor type %q cannot be copied to the CPU'):format(torch.type(x))) -- Copy from GPU to CPU and make data contiguous (if necessary) x = x:type(t):contiguous() local memsize = x:nElement() * x:storage().elementSize() -- Compute MD5 local ctx = ffi.new('MD5_CTX') local hash = ffi.new('unsigned char[16]') ssllib.MD5_Init(ctx) ssllib.MD5_Update(ctx, torch.data(x), memsize) ssllib.MD5_Final(hash, ctx) -- Return MD5 as an hex string local s = ffi.string(hash, 16) s = table.pack(s:byte(1, 16)) local o = '' for i=1,#s do o = o .. ('%02x'):format(s[i]) end return o end -- Return a flat view of a nn.Module parameters and gradients. -- This assumes that m:getParameters() was called before to flatten -- the parameters and gradients of the model. function laia.getFlatParameters(m) assert(m ~= nil and torch.isTypeOf(m, 'nn.Module'), ('Expected a nn.Module class (type = %q)'):format(torch.type(m))) local Tensor = torch.factory(m:type()) p, g = m:parameters() if not p then laia.log.warn('p is nil!!!!') end if not p or #p == 0 then return Tensor() end local sp, gp = p[1]:storage(), g[1]:storage() local n = sp:size() return Tensor(sp, 1, n, 1), Tensor(gp, 1, n, 1) end -- Return the factor that divides the width of the image. -- For now, it only works for pooling layers, and assuming that there is no -- stride in these layers. -- TODO(mauvilsa): Make this more generic for all types of layers. local __getWidthFactorFromLayer = { ['cudnn.AveragePooling'] = function(m) return m.kW end, ['cudnn.SpatialMaxPooling'] = function(m) return m.kW end, ['nn.AveragePooling'] = function(m) return m.kW end, ['nn.SpatialMaxPooling'] = function(m) return m.kW end, ['nn.SpatialSubSampling'] = function(m) return m.kW end, ['nn.SpatialDilatedMaxPooling'] = function(m) return m.kW end, ['nn.SpatialLPPooling'] = function(m) return m.kW end } function laia.getWidthFactor(m) local factor = 1 for t, func in pairs(__getWidthFactorFromLayer) do for _, layer in ipairs(m:findModules(t)) do factor = factor * func(layer) end end return factor end
fx_version 'adamant' game 'gta5' ui_page 'html/index.html' files { 'html/index.html', 'html/css/materialize.min.css', 'html/css/style.min.css', 'html/libs/jquery-ui.min.css', 'html/js/build.js', 'html/libs/all.min.css', 'html/libs/jquery.min.js', 'html/libs/jquery.mask.min.js', 'html/libs/jquery-ui.min.js', 'html/libs/materialize.min.js', 'html/libs/moment.min.js', 'html/webfonts/fa-brands-400.eot', 'html/webfonts/fa-brands-400.svg', 'html/webfonts/fa-brands-400.ttf', 'html/webfonts/fa-brands-400.woff', 'html/webfonts/fa-brands-400.woff2', 'html/webfonts/fa-regular-400.eot', 'html/webfonts/fa-regular-400.svg', 'html/webfonts/fa-regular-400.ttf', 'html/webfonts/fa-regular-400.woff', 'html/webfonts/fa-regular-400.woff2', 'html/webfonts/fa-solid-900.eot', 'html/webfonts/fa-solid-900.svg', 'html/webfonts/fa-solid-900.ttf', 'html/webfonts/fa-solid-900.woff', 'html/webfonts/fa-solid-900.woff2', 'html/imgs/back001.png', 'html/imgs/back002.png', 'html/imgs/back003.png', 'html/imgs/iphonex.png', 'html/imgs/s8.png', } client_script { '@salty_tokenizer/init.lua', 'config/config.lua', 'config/apps.lua', 'config/contacts.lua', "client/main.lua", "client/animation.lua", "client/apps/home.lua", "client/apps/contacts.lua", "client/apps/phone.lua", "client/apps/messages.lua", "client/apps/twitter.lua", } server_script { '@salty_tokenizer/init.lua', 'config/config.lua', 'config/apps.lua', 'config/contacts.lua', "server/main.lua", "server/commands.lua", "server/apps/contacts.lua", "server/apps/phone.lua", "server/apps/messages.lua", "server/apps/twitter.lua", } dependency 'salty_tokenizer'
------------------------------------------------------------------------------- --- AUTHOR: Nostrademous --- GITHUB REPO: https://github.com/Nostrademous/Dota2-WebAI ------------------------------------------------------------------------------- function InTable (tab, val) if not tab then return false end for index, value in ipairs (tab) do if value == val then return true end end return false end local Pos_1_Pool = { "npc_dota_hero_sven" } local Pos_2_Pool = { --"npc_dota_hero_invoker", "npc_dota_hero_lina" } local Pos_3_Pool = { "npc_dota_hero_viper" } local Pos_4_Pool = { } local Pos_5_Pool = { "npc_dota_hero_crystal_maiden" } -- roamers, junglers local Pos_X_Pool = { "npc_dota_hero_bloodseeker" } local BotPool = { Pos_1_Pool, -- hard carry Pos_5_Pool, -- hard support {unpack(Pos_4_Pool), unpack(Pos_X_Pool)}, -- semi-support, roamer, jungler Pos_2_Pool, -- mid Pos_3_Pool -- offlane } local BotPool2 = { Pos_1_Pool, -- hard carry Pos_5_Pool, -- hard support {unpack(Pos_4_Pool), unpack(Pos_X_Pool)}, -- semi-support, roamer, jungler Pos_2_Pool, -- mid Pos_3_Pool -- offlane } local chosenHeroes = {} local function HumansReady() local numHumans = 0 local numHumansReady = 0 local IDs = GetTeamPlayers(GetTeam()) for index, id in pairs(IDs) do if not IsPlayerBot(id) then local humanBotName = GetSelectedHeroName(id) numHumans = numHumans + 1 -- check bot name to see if human made selection if humanBotName ~= "" then numHumansReady = numHumansReady + 1 end end end return numHumansReady == numHumans end function Think() gs = GetGameState() --print( "game state: ", gs ) if ( gs == GAME_STATE_HERO_SELECTION ) then a = GetGameMode() if ( a == GAMEMODE_AP ) then --print ( "All Pick" ) if GameTime() < 45 and not HumansReady() then return end local IDs = GetTeamPlayers(GetTeam()) for index, id in pairs(IDs) do if IsPlayerBot(id) and IsPlayerInHeroSelectionControl(id) and GetSelectedHeroName(id) == "" then local pool = nil if GetTeam() == TEAM_RADIANT then pool = BotPool else pool = BotPool2 end local sizeOfPool = #pool[index] for j = 1, sizeOfPool do randomHero = pool[index][RandomInt(1, sizeOfPool)] if not InTable(chosenHeroes, randomHero) then table.insert(chosenHeroes, randomHero) SelectHero(id, randomHero) break end end end end end end end function UpdateLaneAssignments() if ( GetTeam() == TEAM_RADIANT ) then return { [1] = LANE_BOT, [2] = LANE_BOT, [3] = LANE_BOT, [4] = LANE_MID, [5] = LANE_TOP, } elseif ( GetTeam() == TEAM_DIRE ) then return { [1] = LANE_TOP, [2] = LANE_TOP, [3] = LANE_TOP, [4] = LANE_MID, [5] = LANE_BOT, } end end
villageSivarraPhase1ConvoTemplate = ConvoTemplate:new { initialScreen = "", templateType = "Lua", luaClassHandler = "villageSivarraPhase1ConvoHandler", screens = {} } intro = ConvoScreen:new { id = "intro", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_d46bb0c5", -- Hello, I'm the head physician here. Are you one of the new Medics sent to help out? stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_1024d197", "are_you_sure"}, -- Yes, I'm here to help. {"@conversation/fs_medic_puzzle_head_medic:s_3228a43d", "i_wouldnt_loiter"} -- No, sorry I'm in the wrong place. } } villageSivarraPhase1ConvoTemplate:addScreen(intro); intro_not_master_medic = ConvoScreen:new { id = "intro_not_master_medic", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_47a32bb0", -- You don't seem to have enough medical training. I'm sorry, but I don't think you are going to be able to help me. I need at least a Master Medic, if not someone with more experience. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_not_master_medic); intro_has_another_quest = ConvoScreen:new { id = "intro_has_another_quest", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_8a54510d", -- You look to be rather busy at the moment, come back to me when you aren't so busy. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_has_another_quest); intro_cant_talk = ConvoScreen:new { id = "intro_cant_talk", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_3b984995", -- I'm sorry, I don't know you. I only work with people I know. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_cant_talk); intro_did_all_sets = ConvoScreen:new { id = "intro_did_all_sets", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_3496f642", -- You've already done more than anyone ever expected, please take some time to rest, everyone needs to take a moment to rest. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_did_all_sets); intro_inv_full = ConvoScreen:new { id = "intro_inv_full", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_36b08dde", -- You seem to have a few too many items in your bag there, why don't you free up some room, then come talk to me again. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_inv_full); intro_completed_third_set = ConvoScreen:new { id = "intro_completed_third_set", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_cc506105", -- My, you are tenacious. Well, I have something that will prove useful to you, this plant is rather difficult to grow, but if you are up to the challenge, and it seems you are, the fruit is... well, you will see. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_completed_third_set); intro_completed_second_set = ConvoScreen:new { id = "intro_completed_second_set", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_a7afcfea", -- Splendid! Here, I think you may find some use of this, I know it's not much, but it should help. We still have more to do if you are interested, just let me know. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_completed_second_set); intro_completed_first_set = ConvoScreen:new { id = "intro_completed_first_set", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_fc604056", -- Wonderful! You are well under way into understanding your potential. You may wish to talk to Noldan to learn more. If you are looking for more work, let me know. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(intro_completed_first_set); intro_in_progress = ConvoScreen:new { id = "intro_in_progress", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_2fee0236", -- Hmmm? Oh, talk to the medical droids if you are stuck. Medical records show you have %TO more to go. stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_3c93827f", "thanks"} -- Okay. } } villageSivarraPhase1ConvoTemplate:addScreen(intro_in_progress); thanks = ConvoScreen:new { id = "thanks", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_c4682ea6", -- Thanks! stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(thanks); i_wouldnt_loiter = ConvoScreen:new { id = "i_wouldnt_loiter", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_db216f5", -- Well, I wouldn't loiter around here. Too many sick people. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(i_wouldnt_loiter); are_you_sure = ConvoScreen:new { id = "are_you_sure", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_1718c6ed", -- Good. Before we get started, I should let you know that you will be too busy to help out any of the other villagers. Also, I will talk with Noldan and he can help you out with some persuasion techniques if you help out. Are you sure you would like to help? stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_86129116", "great_explain"}, -- Yes, I would like to continue. {"@conversation/fs_medic_puzzle_head_medic:s_69ab9125", "sorry_to_hear"}, -- No, I have some other things to take care of. } } villageSivarraPhase1ConvoTemplate:addScreen(are_you_sure); sorry_to_hear = ConvoScreen:new { id = "sorry_to_hear", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_41e66cca", -- Sorry to hear that. I know everyone here can use some help. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(sorry_to_hear); great_explain = ConvoScreen:new { id = "great_explain", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_728f65ee", -- Great! Let me explain what has happened. It seems in the last attack there were multiple uses of some rather potent chemical weapons. Those you see lying around here are still sick. Unfortunately, normal medicines are not helping them. stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_7857c2a9", "highly_potent"} -- How are you treating them? } } villageSivarraPhase1ConvoTemplate:addScreen(great_explain); highly_potent = ConvoScreen:new { id = "highly_potent", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_94d417d1", -- Well, I devised a highly potent, yet also highly dangerous counteragent to many of the symptoms. The only problem is that it has some side effects that are almost as bad as what they currently have. However, through multiple treatments, I've been able to cure some. Here, this draft schematic will allow you to work with the medical droids to help. stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_d17142db", "with_use"}, -- What do I do with this? {"@conversation/fs_medic_puzzle_head_medic:s_c4682ea6", "talk_droids"} -- Thanks! } } villageSivarraPhase1ConvoTemplate:addScreen(highly_potent); with_use = ConvoScreen:new { id = "with_use", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_17db6d3c", -- With the use of high and lower quality components, and careful experimentation, you can specialize the treatment to cure specific symptoms. You should also be able to change what sort of side effects it produces. See if you can treat five patients, and good luck with that. Talk to the medical droids. They will help you administer the medicine. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(with_use); talk_droids = ConvoScreen:new { id = "talk_droids", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_d08f8eb6", -- Good luck. Talk with the medical droids for help. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(talk_droids); talk_droids_again = ConvoScreen:new { id = "talk_droids_again", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_464f7bf4", -- Good, Please talk to the medical droids again and they will help you. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(talk_droids_again); talk_droids_round_three = ConvoScreen:new { id = "talk_droids_round_three", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_464f7bf4", -- Good, Please talk to the medical droids again and they will help you. stopConversation = "true", options = {} } villageSivarraPhase1ConvoTemplate:addScreen(talk_droids_round_three); intro_start_third_set = ConvoScreen:new { id = "intro_start_third_set", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_e15eb34d", -- Back again are we? Well I have a special plant you may find useful, but you will need to prove you are worthy. Go heal at least another five patients then come talk to me again. stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_86129116", "talk_droids_round_three"}, -- Yes, I would like to continue. {"@conversation/fs_medic_puzzle_head_medic:s_69ab9125", "sorry_to_hear"}, -- No, I have some other things to take care of. } } villageSivarraPhase1ConvoTemplate:addScreen(intro_start_third_set); intro_start_second_set = ConvoScreen:new { id = "intro_start_second_set", leftDialog = "@conversation/fs_medic_puzzle_head_medic:s_ddb49891", -- Oh, you are still here? well if you like, go ahead and heal at least five more patients then come talk to me again, I have a little trinket you might find useful. stopConversation = "false", options = { {"@conversation/fs_medic_puzzle_head_medic:s_86129116", "talk_droids_again"}, -- Yes, I would like to continue. {"@conversation/fs_medic_puzzle_head_medic:s_69ab9125", "sorry_to_hear"}, -- No, I have some other things to take care of. } } villageSivarraPhase1ConvoTemplate:addScreen(intro_start_second_set); addConversationTemplate("villageSivarraPhase1ConvoTemplate", villageSivarraPhase1ConvoTemplate);
local self = {} GLib.IEnumerable = GLib.MakeConstructor (self) function self:ctor () end function self:GetEnumerator () GLib.Error ("IEnumerable:GetEnumerator : Not implemented.") end function self:Filter (filterFunction) return GLib.Enumerable.FromEnumeratorFactory ( function () return GLib.Enumerator.Filter (self:GetEnumerator (), filterFunction) end ) end function self:Map (mapFunction) return GLib.Enumerable.FromEnumeratorFactory ( function () return GLib.Enumerator.Map (self:GetEnumerator (), mapFunction) end ) end function self:Skip (n) return GLib.Enumerable.FromEnumeratorFactory ( function () return GLib.Enumerator.Skip (self:GetEnumerator (), n) end ) end function self:Take (n) return GLib.Enumerable.FromEnumeratorFactory ( function () return GLib.Enumerator.Take (self:GetEnumerator (), n) end ) end function self:Concat (separator) return table.concat (self:ToArray (), separator) end function self:ToArray () return GLib.Enumerator.ToArray (self:GetEnumerator ()) end function self:ToList () return GLib.Containers.List.FromEnumerable (self) end function self:Unpack () return unpack (self:ToArray ()) end
require("@vue/shared") require("runtime-core/src/errorHandling") require("runtime-core/src/errorHandling/ErrorCodes") require("runtime-core/src/warning") require("runtime-core/src/componentProps") function emit(instance, event, ...) local props = instance.vnode.props or EMPTY_OBJ if __DEV__ then local options = normalizeEmitsOptions(instance.type.emits) if options then if not (options[event]) then local propsOptions = normalizePropsOptions(instance.type)[0+1] if not propsOptions or not (propsOptions[ + capitalize(event)]) then warn( + ) end else -- [ts2lua]options下标访问可能不正确 local validator = options[event] if isFunction(validator) then local isValid = validator(...) if not isValid then warn() end end end end end -- [ts2lua]props下标访问可能不正确 local handler = props[] if not handler and event:startsWith('update:') then event = hyphenate(event) -- [ts2lua]props下标访问可能不正确 handler = props[] end if handler then callWithAsyncErrorHandling(handler, instance, ErrorCodes.COMPONENT_EVENT_HANDLER, args) end end function normalizeEmitsOptions(options) if not options then return elseif isArray(options) then if options._n then return options._n end local normalized = {} options:forEach(function(key) -- [ts2lua]normalized下标访问可能不正确 normalized[key] = nil end ) def(options, '_n', normalized) return normalized else return options end end function isEmitListener(emits, key) return isOn(key) and (hasOwn(emits, key[2+1]:toLowerCase() + key:slice(3)) or hasOwn(emits, key:slice(2))) end
local Board = require "board" local window = require "window" local fonts = require "fonts" local Prompt = {} Prompt.__index = Prompt --- -- Create a new Prompt -- @param message to display -- @param callback when user answer's prompt -- @return Prompt function Prompt.new(width, height, message, callback, options) local prompt = {} setmetatable(prompt, Prompt) prompt.message = message prompt.callback = callback -- options is a list of strings, with the last being the default -- if the last is a duplicate, then it is removed and the first instance is set to the default. -- ex: {'red','blue','green','blue'} would only show red, blue and green, but blue is set to the default prompt.options = options or {'Yes','No'} prompt.selected = #prompt.options for i,o in pairs( prompt.options ) do if o == prompt.options[#prompt.options] and i < #prompt.options then prompt.selected = i prompt.options[#prompt.options] = nil break end end prompt.board = Board.new(width, height) prompt.board:open() return prompt end function Prompt:update(dt) self.board:update(dt) if self.board.state == 'closed' and self.callback and not self.called then self.called = true self.callback(self.selected) end end function Prompt:draw(x, y) if self.board.state == 'closed' then return end fonts.set( 'default' ) self.board:draw(x, y) if self.board.state == 'opened' then -- origin / offset ( x,y is centered ) local ox = math.floor(x - self.board.width / 2 + 5) local oy = math.floor(y - self.board.height / 2 + 5) love.graphics.printf(self.message, ox, oy, self.board.width - 10) local _x = ox + self.board.width * 0.30 local _y = oy + self.board.height - ( 20 * math.floor( ( #self.options / 2 ) + 0.5) ) local Font = love.graphics.getFont() for i,o in pairs( self.options ) do love.graphics.setColor( 255, 255, 255, 255 ) if i == self.selected then love.graphics.setColor( 254, 204, 2, 255 ) end love.graphics.print(o, _x - Font:getWidth(o) / 2, _y) if i % 2 == 1 then --right option next _x = ox + self.board.width * 0.7 else --left option / new line next _y = _y + 20 _x = ox + self.board.width * 0.3 end end end love.graphics.setColor( 255, 255, 255, 255 ) fonts.revert() end function Prompt:keypressed( button ) if self.board.state ~= 'opened' then return end if button == 'A' then self.board:close() return end if button == 'LEFT' then if self.selected % 2 == 0 then self.selected = self.selected - 1 end elseif button == 'RIGHT' then if self.selected % 2 == 1 and self.selected < #self.options then self.selected = self.selected + 1 end elseif button == 'UP' then if self.selected > 2 then self.selected = self.selected - 2 end elseif button == 'DOWN' then if self.selected + 2 <= #self.options then self.selected = self.selected + 2 end end end return Prompt