mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
Unify scripts indentation (#2378)
This commit is contained in:
parent
3746a4ab70
commit
ec3db5e94e
21 changed files with 1800 additions and 1786 deletions
|
@ -30,7 +30,7 @@
|
|||
"no-unused-vars": ["warn", { "vars": "local", "args": "after-used" }],
|
||||
"no-trailing-spaces": "warn",
|
||||
"semi": "warn",
|
||||
"indent": ["warn", "tab", { "SwitchCase": 1 }],
|
||||
"indent": ["warn", "tab", { "SwitchCase": 1, "ignoredNodes": ["ConditionalExpression"] }],
|
||||
// Until globals are properly documented
|
||||
"no-undef": "off",
|
||||
"no-var": "off"
|
||||
|
|
|
@ -232,8 +232,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "BlackHeart", Value: 40, Left: 148, Top: 70, ParentGroup: null },
|
||||
{ Name: "ElegantHeartNecklace", Value: 30, Left:155, Top: 152, ParentGroup: null,
|
||||
Layer: [
|
||||
{ Name: "Necklace", AllowColorize: true },
|
||||
{ Name: "Jewels", AllowColorize: true },
|
||||
{ Name: "Necklace", AllowColorize: true },
|
||||
{ Name: "Jewels", AllowColorize: true },
|
||||
]
|
||||
},
|
||||
{ Name: "Bandana", Value: 15, Left: 148, Top: 97, BuyGroup: "ScarfGag", ParentGroup: null},
|
||||
|
@ -451,12 +451,12 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Swimsuit3", Value: 35, DefaultColor: "#E53771", Hide: ["Panties", "ItemNipples", "ItemNipplesPiercings", "ItemVulvaPiercings", "ItemVulva"] },
|
||||
{ Name: "ClamShell", Value: 20, Left: 0, Top: 0, DefaultColor: "#E53771", Hide: ["ItemNipples", "ItemNipplesPiercings"] },
|
||||
{ Name: "CowPrintedBra", Value: 15, Hide: ["ItemNipples", "ItemNipplesPiercings"] },
|
||||
{
|
||||
{
|
||||
Name: "StuddedHarness", Fetish: ["Lingerie", "Leather"], Priority: 20, Value: -1, DefaultColor:"#343131", BuyGroup: "StuddedHarness", Expose:["ItemBreast"], Hide: ["ItemNipples","ItemNipplesPiercings"], HideItem: ["PantiesDiapers1","PantiesDiapers2","PantiesDiapers3"],
|
||||
Layer:[
|
||||
{ Name: "Harness", AllowColorize: true},
|
||||
{ Name: "Metal", AllowColorize: false}
|
||||
]
|
||||
]
|
||||
},
|
||||
{ Name: "Camisole", Priority: 22, DefaultColor: "#908867", Value: 5, Hide: ["ItemNipples", "ItemNipplesPiercings"] },
|
||||
],
|
||||
|
@ -489,12 +489,12 @@ var AssetFemale3DCG = [
|
|||
},
|
||||
{ Name: "LeatherCorsetTop1", Fetish: ["Leather"], Left: 0, Top: 0, BuyGroup: "LeatherCorsetTop1", Priority: 25, Value: 60, HideItem: ["ItemNipplesPiercingsRoundPiercing", "ItemNipplesPiercingsWeightedPiercing", "ItemNipplesLactationPump"], AllowPose: ["Hogtied", "Yoked"] },
|
||||
{Name: "Corset6", Fetish: ["Lingerie"], Value: 40, DefaultColor:["#435331","#363535","#A08759"], Hide: ["ItemNipples", "ItemNipplesPiercings"],
|
||||
Layer:[
|
||||
{ Name: "Cloth", AllowColorize: true},
|
||||
{ Name: "Leather", AllowColorize: true},
|
||||
{ Name: "Buttons", AllowColorize: true}
|
||||
]
|
||||
},
|
||||
Layer:[
|
||||
{ Name: "Cloth", AllowColorize: true},
|
||||
{ Name: "Leather", AllowColorize: true},
|
||||
{ Name: "Buttons", AllowColorize: true}
|
||||
]
|
||||
},
|
||||
],
|
||||
Color: ["Default", "#cccccc", "#aaaaaa", "#888888", "#666666", "#444444", "#222222", "#aa8080", "#80aa80", "#8080aa", "#aaaa80", "#80aaaa", "#aa80aa", "#cc3333", "#33cc33", "#3333cc", "#cccc33", "#33cccc", "#cc33cc"]
|
||||
},
|
||||
|
@ -551,7 +551,7 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Layer1", AllowColorize: true },
|
||||
{ Name: "Layer2", AllowColorize: true },
|
||||
{ Name: "Layer3", AllowColorize: true },
|
||||
]
|
||||
]
|
||||
},
|
||||
],
|
||||
Color: ["Default", "#cccccc", "#aaaaaa", "#888888", "#666666", "#444444", "#222222", "#aa8080", "#80aa80", "#8080aa", "#aaaa80", "#80aaaa", "#aa80aa", "#cc3333", "#33cc33", "#3333cc", "#cccc33", "#33cccc", "#cc33cc"]
|
||||
|
@ -656,9 +656,9 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Heels2", Height: 15 },
|
||||
{ Name: "Boots1", Height: 9,
|
||||
Layer: [
|
||||
{ Name: "Shoes", AllowColorize: true},
|
||||
{ Name: "Sides", AllowColorize: true},
|
||||
{ Name: "Laces", AllowColorize: true}
|
||||
{ Name: "Shoes", AllowColorize: true},
|
||||
{ Name: "Sides", AllowColorize: true},
|
||||
{ Name: "Laces", AllowColorize: true}
|
||||
]
|
||||
},
|
||||
{ Name: "MistressBoots", Fetish: ["Leather"], Value: -1, HideItem: ["SocksSocks4", "SocksSocks5"], Alpha: [{ Group: ["BodyLower", "Socks", "SuitLower"], Masks: [[75, 875, 350, 200]] }], Height: 35 },
|
||||
|
@ -672,7 +672,8 @@ var AssetFemale3DCG = [
|
|||
},
|
||||
{ Name: "PawBoots", Fetish: ["Pet"], Value: 45, Height: 3 },
|
||||
{ Name: "WoollyBootsTall", Fetish: ["Pet"], Value: 60, Height: 9 },
|
||||
{ Name: "ThighHighLatexHeels", Fetish: ["Latex"], Value: 80, BuyGroup: "ThighHighLatexHeels", Alpha: [
|
||||
{ Name: "ThighHighLatexHeels", Fetish: ["Latex"], Value: 80, BuyGroup: "ThighHighLatexHeels",
|
||||
Alpha: [
|
||||
{ Group: ["BodyLower", "Socks", "SuitLower"], Masks: [[75, 680, 350, 320]] },
|
||||
{ Group: ["BodyLower", "Socks", "SuitLower"], Pose: ["LegsClosed"], Masks: [[75, 650, 350, 350]] },
|
||||
], Height: 30
|
||||
|
@ -682,9 +683,9 @@ var AssetFemale3DCG = [
|
|||
{ Name: "LatexAnkleShoes", Fetish: ["Latex"], Value: 60, DefaultColor: ["#373636"], },
|
||||
{ Name: "Flippers", Height: 40, Value: 25, Left: 84,
|
||||
Layer: [
|
||||
{ Name: "Fins", AllowColorize: true },
|
||||
{ Name: "Shoes", AllowColorize: false }
|
||||
]
|
||||
{ Name: "Fins", AllowColorize: true },
|
||||
{ Name: "Shoes", AllowColorize: false }
|
||||
]
|
||||
},
|
||||
{ Name: "DeluxeBoots", Fetish: ["Leather"], Value: -1, Alpha: [{ Group: ["BodyLower", "Socks", "SuitLower"], Masks: [[180, 900, 50, 100], [280, 900, 50, 100]] }], DefaultColor: ["#9F0D0D", "#700A0A", "#700A0A", "#9F0D0D"], Height: 35,
|
||||
Layer: [
|
||||
|
@ -693,7 +694,7 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Heels", AllowColorize: true},
|
||||
{ Name: "Straps", AllowColorize: true},
|
||||
{ Name: "Buckles", AllowColorize: false},
|
||||
]
|
||||
]
|
||||
},
|
||||
],
|
||||
Color: ["Default", "#bbbbbb", "#808080", "#202020", "#aa8080", "#80aa80", "#8080aa", "#aaaa80", "#80aaaa", "#aa80aa", "#cc3333", "#33cc33", "#3333cc", "#cccc33", "#33cccc", "#cc33cc"]
|
||||
|
@ -842,7 +843,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "HairFlower1", Value: 10, BuyGroup: "HairFlower1" },
|
||||
{ Name: "FoxEars1", Fetish: ["Pet"], Value: 15, BuyGroup: "FoxEars1", BodyCosplay: true },
|
||||
{ Name: "BatWings", Fetish: ["Pet"], Value: 20, BuyGroup: "BatWings", BodyCosplay: true },
|
||||
{ Name: "KittenEars1", Fetish: ["Pet"], Value: 20, BuyGroup: "KittenEars1", BodyCosplay: true, Layer: [
|
||||
{ Name: "KittenEars1", Fetish: ["Pet"], Value: 20, BuyGroup: "KittenEars1", BodyCosplay: true,
|
||||
Layer: [
|
||||
{ Name: "Outer" },
|
||||
{ Name: "Inner" },
|
||||
]
|
||||
|
@ -850,7 +852,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "KittenEars2", Fetish: ["Pet"], Value: 20, BuyGroup: "KittenEars2", BodyCosplay: true },
|
||||
{ Name: "WolfEars1", Fetish: ["Pet"], Value: 20, BuyGroup: "WolfEars1", BodyCosplay: true },
|
||||
{ Name: "WolfEars2", Fetish: ["Pet"], Value: 20, BuyGroup: "WolfEars2", BodyCosplay: true },
|
||||
{ Name: "FoxEars2", Fetish: ["Pet"], Value: 20, BuyGroup: "FoxEars2", BodyCosplay: true, Layer: [
|
||||
{ Name: "FoxEars2", Fetish: ["Pet"], Value: 20, BuyGroup: "FoxEars2", BodyCosplay: true,
|
||||
Layer: [
|
||||
{ Name: "Outer" },
|
||||
{ Name: "Inner" },
|
||||
]
|
||||
|
@ -909,7 +912,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Horns3", Fetish: ["Pet"], Value: -1, BuyGroup: "Horns3" },
|
||||
{ Name: "FoxEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "FoxEars1" },
|
||||
{ Name: "BatWings", Fetish: ["Pet"], Value: -1, BuyGroup: "BatWings" },
|
||||
{ Name: "KittenEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "KittenEars1", Layer: [
|
||||
{ Name: "KittenEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "KittenEars1",
|
||||
Layer: [
|
||||
{ Name: "Outer" },
|
||||
{ Name: "Inner" },
|
||||
],
|
||||
|
@ -917,17 +921,20 @@ var AssetFemale3DCG = [
|
|||
{ Name: "KittenEars2", Fetish: ["Pet"], Value: -1, BuyGroup: "KittenEars2" },
|
||||
{ Name: "WolfEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "WolfEars1" },
|
||||
{ Name: "WolfEars2", Fetish: ["Pet"], Value: -1, BuyGroup: "WolfEars2" },
|
||||
{ Name: "FoxEars2", Fetish: ["Pet"], Value: -1, BuyGroup: "FoxEars2", Layer: [
|
||||
{ Name: "FoxEars2", Fetish: ["Pet"], Value: -1, BuyGroup: "FoxEars2",
|
||||
Layer: [
|
||||
{ Name: "Outer" },
|
||||
{ Name: "Inner" },
|
||||
],
|
||||
},
|
||||
{ Name: "FoxEars3", Fetish: ["Pet"], Value: -1, BuyGroup: "FoxEars3", Layer:[
|
||||
{ Name: "EarOuter"},
|
||||
{ Name: "EarInner"},
|
||||
{ Name: "Strap"},
|
||||
{ Name: "Bell"}
|
||||
]},
|
||||
{ Name: "FoxEars3", Fetish: ["Pet"], Value: -1, BuyGroup: "FoxEars3",
|
||||
Layer:[
|
||||
{ Name: "EarOuter"},
|
||||
{ Name: "EarInner"},
|
||||
{ Name: "Strap"},
|
||||
{ Name: "Bell"}
|
||||
]
|
||||
},
|
||||
{ Name: "PuppyEars2", Fetish: ["Pet"], Value: -1, BuyGroup: "PuppyEars2" },
|
||||
{ Name: "RaccoonEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "RaccoonEars1" },
|
||||
{ Name: "MouseEars1", Fetish: ["Pet"], Value: -1, BuyGroup: "MouseEars1" },
|
||||
|
@ -1351,11 +1358,12 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Irish8Cuffs", Fetish: ["Metal"], Value: 25, Time: 10, RemoveTime: 5, AllowLock: true, Audio: "CuffsMetal", SetPose: ["LegsClosed"], AllowActivePose: ["Kneel"] },
|
||||
{ Name: "DuctTape", Fetish: ["Tape"], Value: 50, Time: 15, RemoveTime: 10, BuyGroup: "DuctTape", Audio: "DuctTape", HideItem: ["ItemBootsThighHighLatexHeels"], SetPose: ["LegsClosed"], AllowType: ["HalfFeet", "MostFeet", "CompleteFeet"], Extended: true, AllowActivePose: ["Kneel"] },
|
||||
{ Name: "LeatherAnkleCuffs", Fetish: ["Leather"], Priority: 24, Value: 30, Difficulty: 2, Time: 10, Random: false, AllowLock: true, AllowPose: ["LegsClosed", "Spread"], Effect: ["CuffedFeet"], AllowEffect: ["Freeze", "Prone"], Extended: true, AllowActivePose: ["Kneel"], AllowType: ["Closed"], HasType: false, RemoveItemOnRemove: [{ Name: "X-Cross", Group: "ItemDevices" }], FreezeActivePose: [],
|
||||
DefaultColor: ["#2E2E2E", "Default"],
|
||||
Layer: [
|
||||
{ Name: "Cuffs" },
|
||||
{ Name: "Rings" }
|
||||
]},
|
||||
DefaultColor: ["#2E2E2E", "Default"],
|
||||
Layer: [
|
||||
{ Name: "Cuffs" },
|
||||
{ Name: "Rings" }
|
||||
]
|
||||
},
|
||||
{
|
||||
Name: "FloorShackles", Fetish: ["Metal"], Priority: 24, Left: 0, Value: 20, Difficulty: 6, Time: 10, AllowLock: true, Prerequisite: ["NoItemLegs", "LegsOpen"], SetPose: ["Spread"], AllowPose: ["Spread"], Effect: ["Freeze", "Prone", "BlockKneel"], Block: ["ItemLegs", "ItemBoots", "ItemDevices"], AllowActivityOn: ["ItemLegs", "ItemBoots"],
|
||||
Layer: [
|
||||
|
@ -1662,7 +1670,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "PuppyTailPlug", Fetish: ["Pet"], Value: 25, Time: 10, Top: 20, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], AllowPose: ["AllFours"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }] },
|
||||
{ Name: "PuppyTailPlug1", Fetish: ["Pet"], Value: 30, Time: 10, Top: 30, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }] },
|
||||
{ Name: "SuccubusButtPlug", Fetish: ["Pet"], Value: 15, Time: 10, Top: 65, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], AllowPose: ["AllFours"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }] },
|
||||
{ Name: "SuccubusHeartButtPlug", Fetish: ["Pet"], Value: 25, Time: 10, Top: 60, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }], Layer: [
|
||||
{ Name: "SuccubusHeartButtPlug", Fetish: ["Pet"], Value: 25, Time: 10, Top: 60, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }],
|
||||
Layer: [
|
||||
{ Name: "Tail" },
|
||||
{ Name: "Heart" },
|
||||
]
|
||||
|
@ -1684,12 +1693,14 @@ var AssetFemale3DCG = [
|
|||
{ Name: "ButtPlugLock", Fetish: ["Metal"], Value: 75, Difficulty: 50, Time: 30, RemoveTime: 50, IsRestraint: true, AllowLock: true, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], AllowPose: ["AllFours"], AllowEffect: ["IsPlugged", "Tethered", "Freeze", "ForceKneel", "IsChained"], AllowType: ["ChainShort", "ChainLong"], ExpressionTrigger: [{ Name: "High", Group: "Blush", Timer: 10 }, { Name: "Closed", Group: "Eyes", Timer: 5 }, { Name: "Soft", Group: "Eyebrows", Timer: 5 }], Extended: true },
|
||||
{ Name: "KittenTail1", Fetish: ["Pet"], Value: 30, Time: 10, Top: 100, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], AllowPose: ["AllFours"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }] },
|
||||
{ Name: "KittenTail2", Fetish: ["Pet"], Value: 30, Time: 10, Top: 30, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], AllowPose: ["AllFours"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }] },
|
||||
{ Name: "FoxTail1", Fetish: ["Pet"], Value: 50, Time: 10, Top: 80, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }], Layer: [
|
||||
{ Name: "FoxTail1", Fetish: ["Pet"], Value: 50, Time: 10, Top: 80, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }],
|
||||
Layer: [
|
||||
{ Name: "Base" },
|
||||
{ Name: "Tip" },
|
||||
]
|
||||
},
|
||||
{ Name: "FoxTail2", Fetish: ["Pet"], Value: 50, Time: 10, Top: 100, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }], Layer: [
|
||||
{ Name: "FoxTail2", Fetish: ["Pet"], Value: 50, Time: 10, Top: 100, Prerequisite: ["AccessVulva", "AccessVulvaSuitZip"], ExpressionTrigger: [{ Name: "Low", Group: "Blush", Timer: 10 }],
|
||||
Layer: [
|
||||
{ Name: "Base" },
|
||||
{ Name: "Tip" },
|
||||
]
|
||||
|
@ -2346,7 +2357,8 @@ var AssetFemale3DCG = [
|
|||
},
|
||||
{ Name: "UnderBedBondageCuffs", Fetish: ["Leather"], Value: -1, Difficulty: 9, SelfBondage: 3, Random: false, IsRestraint: true, SetPose: ["Yoked", "LegsOpen"], Prerequisite: ["OnBed", "LegsOpen"], Effect: ["Block", "Prone", "Freeze", "BlockKneel"], Block: ["ItemDevices", "ItemLegs", "ItemFeet", "ItemBoots"], AllowActivityOn: ["ItemLegs", "ItemFeet", "ItemBoots"], AllowLock: true, BuyGroup: "Bed", Left: 0, Top: -250 },
|
||||
{ Name: "TightJacket", Fetish: ["Leather"], DefaultColor: "#FFFFFF", Value: 150, Difficulty: 6, SelfBondage: 8, Time: 35, RemoveTime: 20, AllowLock: true, Hide: ["Cloth", "ItemNipplesPiercings"], HideItem: ["ClothLowerSkirt1", "ClothLowerSkirt2", "ClothLowerSkirt3", "ClothLowerTennisSkirt1", "ClothLowerGown2Skirt", "ClothLowerWaspie1", "ClothLowerWaspie2", "ClothLowerWaspie3", "ClothLowerLatexSkirt1", "ClothLowerLatexSkirt2", "ClothLowerClothSkirt1", "ClothLowerChineseSkirt1", "ClothLowerAdmiralSkirt", "ClothLowerJeanSkirt", "ClothLowerPencilSkirt"], SetPose: ["BackElbowTouch"], Effect: ["Block", "Prone"], Block: ["ItemNipples", "ItemNipplesPiercings", "ItemTorso", "ItemBreast", "ItemHands"], BuyGroup: "TightJacket", SelfUnlock: false, Extended: true, AllowType: ["PulledStraps", "LiningStraps", "ExtraPadding", "PulledLining", "PulledPadding", "PaddedLining", "FullJacket"] },
|
||||
{ Name: "LatexSleevelessLeotard", Fetish: ["Latex"], Value: 120, Priority: 23, Difficulty: 14, SelfBondage: 7, Time: 35, RemoveTime: 20, AllowLock: true, DefaultColor: "#d986a2", Hide: ["Cloth", "ItemNipplesPiercings", "ItemVulvaPiercings", "Corset"], HideItemExclude: ["CorsetCorset1", "CorsetLatexCorset1"], HideItem: ["ItemButtAnalBeads2", "ItemVulvaVibratingDildo", "ItemVulvaInflatableVibeDildo", "ItemVulvaClitSuctionCup"], SetPose: ["BackElbowTouch"], Effect: ["Block", "Prone"], Block: ["ItemNipples", "ItemNipplesPiercings", "ItemVulva", "ItemVulvaPiercings", "ItemButt", "ItemPelvis", "ItemTorso", "ItemBreast", "ItemHands"], Extended: true, SelfUnlock: false, Layer: [
|
||||
{ Name: "LatexSleevelessLeotard", Fetish: ["Latex"], Value: 120, Priority: 23, Difficulty: 14, SelfBondage: 7, Time: 35, RemoveTime: 20, AllowLock: true, DefaultColor: "#d986a2", Hide: ["Cloth", "ItemNipplesPiercings", "ItemVulvaPiercings", "Corset"], HideItemExclude: ["CorsetCorset1", "CorsetLatexCorset1"], HideItem: ["ItemButtAnalBeads2", "ItemVulvaVibratingDildo", "ItemVulvaInflatableVibeDildo", "ItemVulvaClitSuctionCup"], SetPose: ["BackElbowTouch"], Effect: ["Block", "Prone"], Block: ["ItemNipples", "ItemNipplesPiercings", "ItemVulva", "ItemVulvaPiercings", "ItemButt", "ItemPelvis", "ItemTorso", "ItemBreast", "ItemHands"], Extended: true, SelfUnlock: false,
|
||||
Layer: [
|
||||
{ Name: "Latex", AllowColorize: true, AllowTypes: ["", "Polished"], HasType: false },
|
||||
{ Name: "Highlights", AllowColorize: false, AllowTypes: ["", "Polished"] }
|
||||
]
|
||||
|
@ -2460,13 +2472,15 @@ var AssetFemale3DCG = [
|
|||
Zone: [[10, 400, 90, 200], [400, 400, 90, 200]],
|
||||
Activity: ["Bite", "Kiss", "PoliteKiss", "Lick", "Suck", "Nibble", "Spank", "Caress", "TakeCare"],
|
||||
Asset: [
|
||||
{ Name: "PaddedMittens", Fetish: ["ABDL"], Value: 40, Difficulty: 4, SelfBondage: 2, Time: 15, AllowLock: true, DefaultColor: "#bbbbbb", AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], Effect: ["Block", "Prone"], Extended: true, Layer: [
|
||||
{ Name: "PaddedMittens", Fetish: ["ABDL"], Value: 40, Difficulty: 4, SelfBondage: 2, Time: 15, AllowLock: true, DefaultColor: "#bbbbbb", AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], Effect: ["Block", "Prone"], Extended: true,
|
||||
Layer: [
|
||||
{ Name: "Gloves", AllowColorize: true},
|
||||
{ Name: "Straps", AllowColorize: true},
|
||||
{ Name: "Buckles", AllowColorize: true},
|
||||
]
|
||||
},
|
||||
{ Name: "PawMittens", Fetish: ["ABDL", "Pet"], Value: 50, Difficulty: 4, SelfBondage: 1, Time: 15, AllowLock: true, DefaultColor: ["#bbbbbb","#bbbbbb","#bbbbbb","#B38295"], AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], Effect: ["Block", "Prone"], Extended: true, Layer: [
|
||||
{ Name: "PawMittens", Fetish: ["ABDL", "Pet"], Value: 50, Difficulty: 4, SelfBondage: 1, Time: 15, AllowLock: true, DefaultColor: ["#bbbbbb","#bbbbbb","#bbbbbb","#B38295"], AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], Effect: ["Block", "Prone"], Extended: true,
|
||||
Layer: [
|
||||
{ Name: "Gloves", AllowColorize: true},
|
||||
{ Name: "Straps", AllowColorize: true},
|
||||
{ Name: "Buckles", AllowColorize: true},
|
||||
|
@ -2475,7 +2489,7 @@ var AssetFemale3DCG = [
|
|||
},
|
||||
{ Name: "LeatherMittens", Fetish: ["Leather"], Value: 60, Difficulty: 5, SelfBondage: 4, Time: 15, RemoveTime: 5, AllowLock: true, AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], SetPose: ["TapedHands"], Effect: ["Block", "Prone"] },
|
||||
{ Name: "FuturisticMittens", Fetish: ["Metal"], Category: ["SciFi"], Value: 70, Difficulty: 5, SelfBondage: 0, Time: 5, RemoveTime: 5, Audio: "FuturisticApply", Random: false, AllowLock: true, DrawLocks: false, DefaultColor: ["#93C48C", "#3B7F2C", "Default"], AllowPose: ["OverTheHead", "BackBoxTie", "BackElbowTouch", "BackCuffs", "Yoked", "AllFours"], SetPose: ["TapedHands"], Effect: [], AllowEffect: ["Block", "Prone"], SelfUnlock: false, AllowType: ["Gloves"], Extended: true, AlwaysExtend: true,
|
||||
Layer: [
|
||||
Layer: [
|
||||
{ Name: "Mesh", ParentGroup: null},
|
||||
{ Name: "Display", ParentGroup: null},
|
||||
{ Name: "Body", ParentGroup: null},
|
||||
|
@ -2723,16 +2737,18 @@ var AssetFemale3DCG = [
|
|||
Zone: [[100, 200, 100, 70]],
|
||||
Asset: [
|
||||
{
|
||||
Name: "CustomCollarTag", Value: 50, Difficulty: 20, Time: 5, Random: false, IsRestraint: false, AllowLock: true, DefaultColor: ["#aaa366", "#000000"], Prerequisite: "Collared", DynamicAfterDraw: true, Extended: true, Layer: [
|
||||
{ Name: "Tag" },
|
||||
{ Name: "Text" }
|
||||
Name: "CustomCollarTag", Value: 50, Difficulty: 20, Time: 5, Random: false, IsRestraint: false, AllowLock: true, DefaultColor: ["#aaa366", "#000000"], Prerequisite: "Collared", DynamicAfterDraw: true, Extended: true,
|
||||
Layer: [
|
||||
{ Name: "Tag" },
|
||||
{ Name: "Text" }
|
||||
]
|
||||
},
|
||||
{
|
||||
Name: "ElectronicTag", Value: 50, Difficulty: 20, Time: 5, Random: false, IsRestraint: false, AllowLock: true, DrawLocks: false, DefaultColor: ["#40812C", "Default", "#000000"], Prerequisite: "Collared", DynamicAfterDraw: true, Extended: true, Layer: [
|
||||
{ Name: "Display" },
|
||||
{ Name: "Tag" },
|
||||
{ Name: "Text" }
|
||||
Name: "ElectronicTag", Value: 50, Difficulty: 20, Time: 5, Random: false, IsRestraint: false, AllowLock: true, DrawLocks: false, DefaultColor: ["#40812C", "Default", "#000000"], Prerequisite: "Collared", DynamicAfterDraw: true, Extended: true,
|
||||
Layer: [
|
||||
{ Name: "Display" },
|
||||
{ Name: "Tag" },
|
||||
{ Name: "Text" }
|
||||
]
|
||||
},
|
||||
{ Name: "CollarBell", Fetish: ["Metal", "Pet"], Value: 5, Difficulty: 3, Time: 5, Random: false, AllowLock: true, Prerequisite: "Collared", Audio: "BellMedium" },
|
||||
|
@ -3087,7 +3103,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Cloth", AllowColorize: true }
|
||||
]
|
||||
},
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: 40, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Block: ["ItemMouth2", "ItemMouth3"], Layer: [
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: 40, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Block: ["ItemMouth2", "ItemMouth3"],
|
||||
Layer: [
|
||||
{ Name: "Mask"},
|
||||
{ Name: "Sides"},
|
||||
{ Name: "Highlights"},
|
||||
|
@ -3312,7 +3329,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "SteelMuzzleGag", Fetish: ["Leather", "Metal"], Value: -1, Difficulty: 8, Time: 30, AllowLock: true, Audio: "CuffsMetal", BuyGroup: "SteelMuzzleGag", Prerequisite: "GagFlat", Hide: ["Mouth"] },
|
||||
{ Name: "StitchedMuzzleGag", Fetish: ["Leather"], Value: -1, Difficulty: 5, Time: 15, AllowLock: true, BuyGroup: "StitchedMuzzleGag", Prerequisite: "GagFlat", Hide: ["Mouth"], Effect: ["BlockMouth", "GagEasy"] },
|
||||
{ Name: "LatexBallMuzzleGag", Fetish: ["Latex"], Value: -1, Difficulty: 6, Time: 15, AllowLock: true, BuyGroup: "LatexBallMuzzleGag", Prerequisite: "GagFlat", Hide: ["Mouth"], Effect: ["BlockMouth", "GagMedium"] },
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: -1, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Prerequisite: "GagFlat", Block: ["ItemMouth", "ItemMouth3"], Layer: [
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: -1, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Prerequisite: "GagFlat", Block: ["ItemMouth", "ItemMouth3"],
|
||||
Layer: [
|
||||
{ Name: "Mask"},
|
||||
{ Name: "Sides"},
|
||||
{ Name: "Highlights"},
|
||||
|
@ -3342,7 +3360,7 @@ var AssetFemale3DCG = [
|
|||
{ Name: "Strap" },
|
||||
]
|
||||
},
|
||||
],
|
||||
],
|
||||
Color: ["Default", "#202020", "#808080", "#bbbbbb", "#aa8080", "#80aa80", "#8080aa", "#aaaa80", "#80aaaa", "#aa80aa", "#cc3333", "#33cc33", "#3333cc", "#cccc33", "#33cccc", "#cc33cc"]
|
||||
},
|
||||
|
||||
|
@ -3528,7 +3546,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "FuturisticMuzzle", Category: ["SciFi"], Fetish: ["Metal"], Value: -1, Difficulty: 8, Time: 30, BuyGroup: "FuturisticPanelGag", Random: false, AllowLock: true, Audio: "FuturisticApply", Effect: ["BlockMouth", "GagLight"], Prerequisite: "GagFlat", Hide: ["Mouth", "ItemNoseNoseRing"] },
|
||||
{ Name: "StitchedMuzzleGag", Fetish: ["Leather"], Value: -1, Difficulty: 5, Time: 15, AllowLock: true, BuyGroup: "StitchedMuzzleGag", Prerequisite: "GagFlat", Hide: ["Mouth"], Effect: ["BlockMouth", "GagEasy"] },
|
||||
{ Name: "LatexBallMuzzleGag", Fetish: ["Latex"], Value: -1, Difficulty: 6, Time: 15, AllowLock: true, BuyGroup: "LatexBallMuzzleGag", Prerequisite: "GagFlat", Hide: ["Mouth"], Effect: ["BlockMouth", "GagMedium"] },
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: -1, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Prerequisite: "GagFlat", Block: ["ItemMouth", "ItemMouth2"] , Layer: [
|
||||
{ Name: "GasMaskGag", Fetish: ["Leather"], Priority: 53, Value: -1, Difficulty: 4, Time: 20, Random: false, AllowLock: true, BuyGroup: "GasMaskGag", Hide: ["Mouth"], HideItem: ["ItemNoseNoseRing"], Effect: ["BlockMouth"], Prerequisite: "GagFlat", Block: ["ItemMouth", "ItemMouth2"],
|
||||
Layer: [
|
||||
{ Name: "Mask"},
|
||||
{ Name: "Sides"},
|
||||
{ Name: "Highlights"},
|
||||
|
@ -3715,8 +3734,10 @@ var AssetFemale3DCG = [
|
|||
},
|
||||
{
|
||||
Name: "PumpkinHead", Priority: 54, Value: 40, Difficulty: 2, Time: 10, Random: false, AllowLock: false, Hide: ["HairBack"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Block: ["ItemMouth", "ItemMouth2", "ItemMouth3", "ItemNeck", "ItemHead", "ItemNose", "ItemEars"],
|
||||
Alpha: [{ Masks: [[150, 0, 200, 80]] }],
|
||||
Layer: [{ Name: "Front", AllowColorize: true, Priority:54},{ Name: "Back", AllowColorize: true, Priority: 1 }
|
||||
Alpha: [{ Masks: [[150, 0, 200, 80]] }],
|
||||
Layer: [
|
||||
{ Name: "Front", AllowColorize: true, Priority:54},
|
||||
{ Name: "Back", AllowColorize: true, Priority: 1 }
|
||||
]
|
||||
},
|
||||
{ Name: "SackHood", Fetish: ["Rope"], Value: 20, Difficulty: 3, Time: 5, Hide: ["HairFront", "HairBack", "Glasses", "ItemMouth", "ItemMouth2", "ItemMouth3", "HairAccessory1", "HairAccessory2", "HairAccessory3", "Hat", "Mask", "ItemEars"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Effect: ["Prone", "BlindHeavy", "BlockMouth"], Block: ["ItemEars", "ItemMouth", "ItemMouth2", "ItemMouth3", "ItemHead", "ItemNose"] },
|
||||
|
@ -3740,7 +3761,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "FoxyMask", Fetish: ["Pet"], Value: 50, Difficulty: 2, Time: 15, Random: false, AllowLock: true, Effect: ["GagLight", "BlockMouth"], Block: ["ItemMouth", "ItemMouth2", "ItemMouth3", "ItemHead", "ItemNose"] },
|
||||
{ Name: "PonyHood", Fetish: ["Pony"], Value: -1, Difficulty: 50, Time: 15, Random: false, AllowLock: true, DefaultColor: "#404040", Hide: ["HairFront", "HairBack", "Glasses", "ItemMouth", "ItemMouth2", "ItemMouth3", "HairAccessory1", "HairAccessory2", "HairAccessory3", "Mask", "ItemEars"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Effect: ["BlindLight", "GagNormal", "BlockMouth"], Block: ["ItemMouth", "ItemMouth2", "ItemMouth3", "ItemEars", "ItemNeck", "ItemHead", "ItemNose"] },
|
||||
{ Name: "LeatherHoodOpenMouth", Fetish: ["Leather"], Value: 50, Difficulty: 50, Time: 15, AllowLock: true, DefaultColor: "#404040", Hide: ["HairFront", "HairBack", "Glasses", "HairAccessory1", "HairAccessory2", "HairAccessory3", "Mask"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Effect: ["Prone", "BlindHeavy"], Block: ["ItemEars", "ItemHead", "ItemNose"] },
|
||||
{ Name: "CanvasHood", Value: 50, Difficulty: 20, Time: 15, AllowLock: true, DefaultColor: ["#a5a095", "#ce7210"], Hide: ["HairFront", "HairBack", "Glasses", "ItemMouth", "ItemMouth2", "ItemMouth3", "HairAccessory1", "HairAccessory2", "HairAccessory3", "Mask", "ItemEars"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Effect: ["Prone", "BlindHeavy", "GagHeavy", "BlockMouth", "DeafLight"], Block: ["ItemMouth", "ItemMouth2", "ItemMouth3", "ItemEars", "ItemNose", "ItemHead"], Extended: true, DynamicAfterDraw: true, Layer: [
|
||||
{ Name: "CanvasHood", Value: 50, Difficulty: 20, Time: 15, AllowLock: true, DefaultColor: ["#a5a095", "#ce7210"], Hide: ["HairFront", "HairBack", "Glasses", "ItemMouth", "ItemMouth2", "ItemMouth3", "HairAccessory1", "HairAccessory2", "HairAccessory3", "Mask", "ItemEars"], HideItem: ["ItemHeadSnorkel", "ItemEarsFuturisticEarphones"], Effect: ["Prone", "BlindHeavy", "GagHeavy", "BlockMouth", "DeafLight"], Block: ["ItemMouth", "ItemMouth2", "ItemMouth3", "ItemEars", "ItemNose", "ItemHead"], Extended: true, DynamicAfterDraw: true,
|
||||
Layer: [
|
||||
{ Name: "Hood" },
|
||||
{ Name: "Text" },
|
||||
]
|
||||
|
@ -4161,7 +4183,8 @@ var AssetFemale3DCG = [
|
|||
{ Name: "ToeCuffs", Fetish: ["Metal"], Value: 35, Difficulty: 4, Time: 10, RemoveTime: 5, AllowLock: true, Prerequisite: "ToeTied", Audio: "LockSmall", SetPose: ["LegsClosed"], Effect: ["Freeze", "Prone"], AllowActivePose: ["Kneel"], FreezeActivePose: ["BodyLower"] },
|
||||
{ Name: "LeatherToeCuffs", Fetish: ["Leather"], Value: 50, Difficulty: 3, Time: 10, RemoveTime: 5, AllowLock: true, Prerequisite: "ToeTied", SetPose: ["LegsClosed"], Effect: ["Freeze", "Prone"], AllowActivePose: ["Kneel"], FreezeActivePose: ["BodyLower"] },
|
||||
{ Name: "ToeTie", Fetish: ["Rope"], Value: 15, Difficulty: 2, Time: 10, RemoveTime: 5, DefaultColor: "#956B1C", Prerequisite: "ToeTied", Audio: "RopeShort", SetPose: ["LegsClosed"], Effect: ["Freeze", "Prone"], AllowActivePose: ["Kneel"], FreezeActivePose: ["BodyLower"] },
|
||||
{ Name: "ThighHighLatexHeels", Fetish: ["Latex"], Value: -1, Time: 10, RemoveTime: 15, AllowLock: true, BuyGroup: "ThighHighLatexHeels", Alpha: [
|
||||
{ Name: "ThighHighLatexHeels", Fetish: ["Latex"], Value: -1, Time: 10, RemoveTime: 15, AllowLock: true, BuyGroup: "ThighHighLatexHeels",
|
||||
Alpha: [
|
||||
{ Group: ["BodyLower", "Socks", "SuitLower"], Masks: [[75, 680, 350, 320]] },
|
||||
{ Group: ["BodyLower", "Socks", "SuitLower"], Pose: ["LegsClosed"], Masks: [[75, 650, 350, 350]] },
|
||||
], Height: 30
|
||||
|
|
|
@ -14,12 +14,12 @@ var AfkTimerOldEmoticon = null;
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerReset() {
|
||||
AfkTimerIdle = 0;
|
||||
if (AfkTimerIsSet) {
|
||||
AfkTimerIsSet = false;
|
||||
CharacterSetFacialExpression(Player, "Emoticon", AfkTimerOldEmoticon);
|
||||
AfkTimerOldEmoticon = null;
|
||||
}
|
||||
AfkTimerIdle = 0;
|
||||
if (AfkTimerIsSet) {
|
||||
AfkTimerIsSet = false;
|
||||
CharacterSetFacialExpression(Player, "Emoticon", AfkTimerOldEmoticon);
|
||||
AfkTimerOldEmoticon = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,9 +28,9 @@ function AfkTimerReset() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerIncrement() {
|
||||
if (++AfkTimerIdle >= AfkTimerTimout) {
|
||||
AfkTimerSetIsAfk();
|
||||
}
|
||||
if (++AfkTimerIdle >= AfkTimerTimout) {
|
||||
AfkTimerSetIsAfk();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,8 +38,8 @@ function AfkTimerIncrement() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerStart() {
|
||||
AfkTimerEventsList.forEach(e => document.addEventListener(e, AfkTimerReset, true));
|
||||
AfkTimerID = setInterval(AfkTimerIncrement, AfkTimerIncrementMs);
|
||||
AfkTimerEventsList.forEach(e => document.addEventListener(e, AfkTimerReset, true));
|
||||
AfkTimerID = setInterval(AfkTimerIncrement, AfkTimerIncrementMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,9 +47,9 @@ function AfkTimerStart() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerStop() {
|
||||
AfkTimerEventsList.forEach(e => document.removeEventListener(e, AfkTimerReset, true));
|
||||
if (AfkTimerID != null) clearInterval(AfkTimerID);
|
||||
AfkTimerID = null;
|
||||
AfkTimerEventsList.forEach(e => document.removeEventListener(e, AfkTimerReset, true));
|
||||
if (AfkTimerID != null) clearInterval(AfkTimerID);
|
||||
AfkTimerID = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,14 +58,14 @@ function AfkTimerStop() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerSetEnabled(Enabled) {
|
||||
if (typeof Enabled !== 'boolean') return;
|
||||
if (AfkTimerIsEnabled == Enabled) return;
|
||||
AfkTimerIsEnabled = Enabled;
|
||||
if (typeof Enabled !== 'boolean') return;
|
||||
if (AfkTimerIsEnabled == Enabled) return;
|
||||
AfkTimerIsEnabled = Enabled;
|
||||
|
||||
if (AfkTimerIsEnabled)
|
||||
AfkTimerStart();
|
||||
else
|
||||
AfkTimerStop();
|
||||
if (AfkTimerIsEnabled)
|
||||
AfkTimerStart();
|
||||
else
|
||||
AfkTimerStop();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,12 +73,12 @@ function AfkTimerSetEnabled(Enabled) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AfkTimerSetIsAfk() {
|
||||
if (CurrentScreen != "ChatRoom") return;
|
||||
if (AfkTimerIsSet) return;
|
||||
// save the current Emoticon, if there is any
|
||||
if (InventoryGet(Player, "Emoticon") && InventoryGet(Player, "Emoticon").Property && AfkTimerOldEmoticon == null) {
|
||||
AfkTimerOldEmoticon = InventoryGet(Player, "Emoticon").Property.Expression;
|
||||
}
|
||||
CharacterSetFacialExpression(Player, "Emoticon", "Afk");
|
||||
AfkTimerIsSet = true;
|
||||
if (CurrentScreen != "ChatRoom") return;
|
||||
if (AfkTimerIsSet) return;
|
||||
// save the current Emoticon, if there is any
|
||||
if (InventoryGet(Player, "Emoticon") && InventoryGet(Player, "Emoticon").Property && AfkTimerOldEmoticon == null) {
|
||||
AfkTimerOldEmoticon = InventoryGet(Player, "Emoticon").Property.Expression;
|
||||
}
|
||||
CharacterSetFacialExpression(Player, "Emoticon", "Afk");
|
||||
AfkTimerIsSet = true;
|
||||
}
|
|
@ -12,13 +12,13 @@ var AnimationPersistentStorage = {};
|
|||
* @enum
|
||||
*/
|
||||
var AnimationDataTypes = {
|
||||
AssetGroup: "AssetGroup",
|
||||
Base: "",
|
||||
Canvas: "DynamicPlayerCanvas",
|
||||
PersistentData: "PersistentData",
|
||||
Rebuild: "Rebuild",
|
||||
RefreshTime: "RefreshTime",
|
||||
RefreshRate: "RefreshRate",
|
||||
AssetGroup: "AssetGroup",
|
||||
Base: "",
|
||||
Canvas: "DynamicPlayerCanvas",
|
||||
PersistentData: "PersistentData",
|
||||
Rebuild: "Rebuild",
|
||||
RefreshTime: "RefreshTime",
|
||||
RefreshRate: "RefreshRate",
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ var AnimationDataTypes = {
|
|||
* @returns {string} - Contains the name of the persistent data key.
|
||||
*/
|
||||
function AnimationGetDynamicDataName(C, Type, Asset) {
|
||||
return (Type ? Type + "__" : "") + C.AccountName + (Asset ? "__" + Asset.Group.Name + "__" + Asset.Name : "");
|
||||
return (Type ? Type + "__" : "") + C.AccountName + (Asset ? "__" + Asset.Group.Name + "__" + Asset.Name : "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,11 +39,11 @@ function AnimationGetDynamicDataName(C, Type, Asset) {
|
|||
* @returns {object} - Contains the persistent data of the animated object, returns a new empty object if it was never initialized previously.
|
||||
*/
|
||||
function AnimationPersistentDataGet(C, Asset) {
|
||||
const PersistentDataName = AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, Asset);
|
||||
if (!AnimationPersistentStorage[PersistentDataName]) {
|
||||
AnimationPersistentStorage[PersistentDataName] = {};
|
||||
}
|
||||
return AnimationPersistentStorage[PersistentDataName];
|
||||
const PersistentDataName = AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, Asset);
|
||||
if (!AnimationPersistentStorage[PersistentDataName]) {
|
||||
AnimationPersistentStorage[PersistentDataName] = {};
|
||||
}
|
||||
return AnimationPersistentStorage[PersistentDataName];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,11 +53,11 @@ function AnimationPersistentDataGet(C, Asset) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AnimationRequestRefreshRate(C, RequestedRate) {
|
||||
const key = AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshRate);
|
||||
let RefreshRate = AnimationPersistentStorage[key] != null ? AnimationPersistentStorage[key] : Infinity;
|
||||
if (RequestedRate < RefreshRate) {
|
||||
AnimationPersistentStorage[key] = RequestedRate;
|
||||
}
|
||||
const key = AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshRate);
|
||||
let RefreshRate = AnimationPersistentStorage[key] != null ? AnimationPersistentStorage[key] : Infinity;
|
||||
if (RequestedRate < RefreshRate) {
|
||||
AnimationPersistentStorage[key] = RequestedRate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ function AnimationRequestRefreshRate(C, RequestedRate) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AnimationRequestDraw(C) {
|
||||
AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.Rebuild)] = true;
|
||||
AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.Rebuild)] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,14 +76,14 @@ function AnimationRequestDraw(C) {
|
|||
* @returns {object} - Contains the persistent group data, returns a new empty object if it was never initialized previously.
|
||||
*/
|
||||
function AnimationGroupGet(C, Name) {
|
||||
let GroupKey = AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup);
|
||||
if (!AnimationPersistentStorage[GroupKey]) {
|
||||
AnimationPersistentStorage[GroupKey] = {};
|
||||
}
|
||||
if (!AnimationPersistentStorage[GroupKey][Name]) {
|
||||
AnimationPersistentStorage[GroupKey][Name] = { Subscriptions: [] };
|
||||
}
|
||||
return AnimationPersistentStorage[GroupKey][Name];
|
||||
let GroupKey = AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup);
|
||||
if (!AnimationPersistentStorage[GroupKey]) {
|
||||
AnimationPersistentStorage[GroupKey] = {};
|
||||
}
|
||||
if (!AnimationPersistentStorage[GroupKey][Name]) {
|
||||
AnimationPersistentStorage[GroupKey][Name] = { Subscriptions: [] };
|
||||
}
|
||||
return AnimationPersistentStorage[GroupKey][Name];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,12 +94,12 @@ function AnimationGroupGet(C, Name) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AnimationGroupSubscribe(C, Asset, Name) {
|
||||
const DataKey = AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, Asset);
|
||||
const Group = AnimationGroupGet(C, Name);
|
||||
AnimationPersistentDataGet(C, Asset)["GroupData" + Name] = Group;
|
||||
if (Array.isArray(Group.Subscriptions) && !Group.Subscriptions.includes(DataKey)) {
|
||||
Group.Subscriptions.push(DataKey);
|
||||
}
|
||||
const DataKey = AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, Asset);
|
||||
const Group = AnimationGroupGet(C, Name);
|
||||
AnimationPersistentDataGet(C, Asset)["GroupData" + Name] = Group;
|
||||
if (Array.isArray(Group.Subscriptions) && !Group.Subscriptions.includes(DataKey)) {
|
||||
Group.Subscriptions.push(DataKey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,11 +112,11 @@ function AnimationGroupSubscribe(C, Asset, Name) {
|
|||
* @returns {HTMLCanvasElement} - The temporary canvas to use
|
||||
*/
|
||||
function AnimationGenerateTempCanvas(C, A, W, H) {
|
||||
let TempCanvas = document.createElement("canvas");
|
||||
TempCanvas.setAttribute('name', AnimationGetDynamicDataName(C, AnimationDataTypes.Canvas, A));
|
||||
TempCanvas.width = W ? W : 500;
|
||||
TempCanvas.height = H ? H : 500;
|
||||
return TempCanvas;
|
||||
let TempCanvas = document.createElement("canvas");
|
||||
TempCanvas.setAttribute('name', AnimationGetDynamicDataName(C, AnimationDataTypes.Canvas, A));
|
||||
TempCanvas.width = W ? W : 500;
|
||||
TempCanvas.height = H ? H : 500;
|
||||
return TempCanvas;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,53 +126,53 @@ function AnimationGenerateTempCanvas(C, A, W, H) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function AnimationPurge(C, IncludeAll) {
|
||||
const PossibleData = [];
|
||||
const PossibleCanvas = [];
|
||||
const PossibleData = [];
|
||||
const PossibleCanvas = [];
|
||||
|
||||
// Highlights the data to keep
|
||||
if (!IncludeAll) {
|
||||
C.Appearance.forEach((CA) => {
|
||||
PossibleData.push(AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, CA.Asset));
|
||||
PossibleCanvas.push(AnimationGetDynamicDataName(C, AnimationDataTypes.Canvas, CA.Asset));
|
||||
});
|
||||
}
|
||||
// Highlights the data to keep
|
||||
if (!IncludeAll) {
|
||||
C.Appearance.forEach((CA) => {
|
||||
PossibleData.push(AnimationGetDynamicDataName(C, AnimationDataTypes.PersistentData, CA.Asset));
|
||||
PossibleCanvas.push(AnimationGetDynamicDataName(C, AnimationDataTypes.Canvas, CA.Asset));
|
||||
});
|
||||
}
|
||||
|
||||
// Checks if any character specific info is worth being kept
|
||||
if (IncludeAll || !C.Appearance.find(CA => CA.Asset.DynamicScriptDraw || CA.Asset.DynamicAfterDraw || CA.Asset.DynamicBeforeDraw)) {
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshTime)];
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.Rebuild)];
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup)];
|
||||
}
|
||||
// Checks if any character specific info is worth being kept
|
||||
if (IncludeAll || !C.Appearance.find(CA => CA.Asset.DynamicScriptDraw || CA.Asset.DynamicAfterDraw || CA.Asset.DynamicBeforeDraw)) {
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshTime)];
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.Rebuild)];
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup)];
|
||||
}
|
||||
|
||||
// Always delete the refresh rate for accurate requested rate.
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshRate)];
|
||||
// Always delete the refresh rate for accurate requested rate.
|
||||
delete AnimationPersistentStorage[AnimationGetDynamicDataName(C, AnimationDataTypes.RefreshRate)];
|
||||
|
||||
// Clear no longer needed data (Clear the subscription, then clear the asset data)
|
||||
for (const key in AnimationPersistentStorage) {
|
||||
const isCharDataKey = key.startsWith(AnimationDataTypes.PersistentData + "__" + C.AccountName + "__");
|
||||
if (isCharDataKey && !PossibleData.includes(key)) {
|
||||
const Group = AnimationPersistentStorage[key].Group;
|
||||
if (Group && Array.isArray(Group.Subscriptions)) {
|
||||
Group.Subscriptions = Group.Subscriptions.filter(k => k != key);
|
||||
}
|
||||
delete AnimationPersistentStorage[key];
|
||||
}
|
||||
}
|
||||
// Clear no longer needed data (Clear the subscription, then clear the asset data)
|
||||
for (const key in AnimationPersistentStorage) {
|
||||
const isCharDataKey = key.startsWith(AnimationDataTypes.PersistentData + "__" + C.AccountName + "__");
|
||||
if (isCharDataKey && !PossibleData.includes(key)) {
|
||||
const Group = AnimationPersistentStorage[key].Group;
|
||||
if (Group && Array.isArray(Group.Subscriptions)) {
|
||||
Group.Subscriptions = Group.Subscriptions.filter(k => k != key);
|
||||
}
|
||||
delete AnimationPersistentStorage[key];
|
||||
}
|
||||
}
|
||||
|
||||
// Clear no longer needed cached canvases
|
||||
GLDrawImageCache.forEach((img, key) => {
|
||||
if (key.startsWith(AnimationDataTypes.Canvas + "__" + + C.AccountName + "__") && !PossibleCanvas.includes(key)) {
|
||||
GLDrawImageCache.delete(key);
|
||||
}
|
||||
});
|
||||
// Clear no longer needed cached canvases
|
||||
GLDrawImageCache.forEach((img, key) => {
|
||||
if (key.startsWith(AnimationDataTypes.Canvas + "__" + + C.AccountName + "__") && !PossibleCanvas.includes(key)) {
|
||||
GLDrawImageCache.delete(key);
|
||||
}
|
||||
});
|
||||
|
||||
// Clear empty groups when all is done
|
||||
const GroupKey = AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup);
|
||||
if (AnimationPersistentStorage[GroupKey]) {
|
||||
for (const key in AnimationPersistentStorage[GroupKey]) {
|
||||
if (!AnimationPersistentStorage[GroupKey][key].Subscriptions || !Array.isArray(AnimationPersistentStorage[GroupKey][key].Subscriptions) || AnimationPersistentStorage[GroupKey][key].Subscriptions.length == 0) {
|
||||
delete AnimationPersistentStorage[GroupKey][key];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Clear empty groups when all is done
|
||||
const GroupKey = AnimationGetDynamicDataName(C, AnimationDataTypes.AssetGroup);
|
||||
if (AnimationPersistentStorage[GroupKey]) {
|
||||
for (const key in AnimationPersistentStorage[GroupKey]) {
|
||||
if (!AnimationPersistentStorage[GroupKey][key].Subscriptions || !Array.isArray(AnimationPersistentStorage[GroupKey][key].Subscriptions) || AnimationPersistentStorage[GroupKey][key].Subscriptions.length == 0) {
|
||||
delete AnimationPersistentStorage[GroupKey][key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -504,7 +504,7 @@ function AssetCleanArray(AssetArray) {
|
|||
* @returns {*} - The asset group matching the provided family and group name
|
||||
*/
|
||||
function AssetGroupGet(Family, Group) {
|
||||
return AssetGroup.find(g => g.Family === Family && g.Name === Group);
|
||||
return AssetGroup.find(g => g.Family === Family && g.Name === Group);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -763,12 +763,10 @@ function CharacterItemsHavePoseType(C, Type, OnlyItems) {
|
|||
return true;
|
||||
if ((C.Appearance[A].Property != null) && (C.Appearance[A].Property.SetPose != null) && (C.Appearance[A].Property.SetPose.find(P => PossiblePoses.includes(P))))
|
||||
return true;
|
||||
else
|
||||
if (C.Appearance[A].Asset.SetPose != null && (C.Appearance[A].Asset.SetPose.find(P => PossiblePoses.includes(P))))
|
||||
return true;
|
||||
else
|
||||
if (C.Appearance[A].Asset.Group.SetPose != null && (C.Appearance[A].Asset.Group.SetPose.find(P => PossiblePoses.includes(P))))
|
||||
return true;
|
||||
else if (C.Appearance[A].Asset.SetPose != null && (C.Appearance[A].Asset.SetPose.find(P => PossiblePoses.includes(P))))
|
||||
return true;
|
||||
else if (C.Appearance[A].Asset.Group.SetPose != null && (C.Appearance[A].Asset.Group.SetPose.find(P => PossiblePoses.includes(P))))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -834,9 +832,8 @@ function CharacterLoadEffect(C) {
|
|||
if ((C.Appearance[A].Property != null) && (C.Appearance[A].Property.Effect != null)) CharacterAddEffect(C, C.Appearance[A].Property.Effect);
|
||||
if (C.Appearance[A].Asset.Effect != null)
|
||||
CharacterAddEffect(C, C.Appearance[A].Asset.Effect);
|
||||
else
|
||||
if (C.Appearance[A].Asset.Group.Effect != null)
|
||||
CharacterAddEffect(C, C.Appearance[A].Asset.Group.Effect);
|
||||
else if (C.Appearance[A].Asset.Group.Effect != null)
|
||||
CharacterAddEffect(C, C.Appearance[A].Asset.Group.Effect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,12 +20,12 @@ var ColorPickerPalleteHeight = 100;
|
|||
var ColorPickerPalleteGap = 20;
|
||||
|
||||
var ColorPickerLayout = {
|
||||
HueBarOffset: NaN,
|
||||
HueBarHeight: NaN,
|
||||
SVPanelOffset: NaN,
|
||||
SVPanelHeight: NaN,
|
||||
PalleteOffset: NaN,
|
||||
PalleteHeight: NaN
|
||||
HueBarOffset: NaN,
|
||||
HueBarHeight: NaN,
|
||||
SVPanelOffset: NaN,
|
||||
SVPanelHeight: NaN,
|
||||
PalleteOffset: NaN,
|
||||
PalleteHeight: NaN
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -33,11 +33,11 @@ var ColorPickerLayout = {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerAttachEventListener() {
|
||||
var CanvasElement = document.getElementById("MainCanvas");
|
||||
if (!CommonIsMobile) {
|
||||
CanvasElement.addEventListener("mousedown", ColorPickerStartPick);
|
||||
}
|
||||
CanvasElement.addEventListener("touchstart", ColorPickerStartPick);
|
||||
var CanvasElement = document.getElementById("MainCanvas");
|
||||
if (!CommonIsMobile) {
|
||||
CanvasElement.addEventListener("mousedown", ColorPickerStartPick);
|
||||
}
|
||||
CanvasElement.addEventListener("touchstart", ColorPickerStartPick);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,9 +45,9 @@ function ColorPickerAttachEventListener() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerRemoveEventListener() {
|
||||
var CanvasElement = document.getElementById("MainCanvas");
|
||||
CanvasElement.removeEventListener("mousedown", ColorPickerStartPick);
|
||||
CanvasElement.removeEventListener("touchstart", ColorPickerStartPick);
|
||||
var CanvasElement = document.getElementById("MainCanvas");
|
||||
CanvasElement.removeEventListener("mousedown", ColorPickerStartPick);
|
||||
CanvasElement.removeEventListener("touchstart", ColorPickerStartPick);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,34 +56,34 @@ function ColorPickerRemoveEventListener() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerStartPick(Event) {
|
||||
// Only fires at first touch on mobile devices
|
||||
if (Event.changedTouches) {
|
||||
if (Event.changedTouches.length > 1) return;
|
||||
}
|
||||
// Only fires at first touch on mobile devices
|
||||
if (Event.changedTouches) {
|
||||
if (Event.changedTouches.length > 1) return;
|
||||
}
|
||||
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
var PalleteOffset = ColorPickerLayout.PalleteOffset;
|
||||
var PalleteHeight = ColorPickerLayout.PalleteHeight;
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
var PalleteOffset = ColorPickerLayout.PalleteOffset;
|
||||
var PalleteHeight = ColorPickerLayout.PalleteHeight;
|
||||
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var X = C.X;
|
||||
var Y = C.Y;
|
||||
if (X >= ColorPickerX && X < ColorPickerX + ColorPickerWidth) {
|
||||
if (Y >= ColorPickerY && Y < ColorPickerY + ColorPickerHueBarHeight) {
|
||||
document.addEventListener("mousemove", ColorPickerPickHue);
|
||||
document.addEventListener("touchmove", ColorPickerPickHue);
|
||||
ColorPickerPickHue(Event);
|
||||
} else if (Y >= SVPanelOffset && Y < SVPanelOffset + SVPanelHeight) {
|
||||
document.addEventListener("mousemove", ColorPickerPickSV);
|
||||
document.addEventListener("touchmove", ColorPickerPickSV);
|
||||
ColorPickerPickSV(Event);
|
||||
} else if (Y >= PalleteOffset && Y < PalleteOffset + PalleteHeight) {
|
||||
ColorPickerSelectFromPallete(Event);
|
||||
}
|
||||
document.addEventListener("mouseup", ColorPickerEndPick);
|
||||
document.addEventListener("touchend", ColorPickerEndPick);
|
||||
}
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var X = C.X;
|
||||
var Y = C.Y;
|
||||
if (X >= ColorPickerX && X < ColorPickerX + ColorPickerWidth) {
|
||||
if (Y >= ColorPickerY && Y < ColorPickerY + ColorPickerHueBarHeight) {
|
||||
document.addEventListener("mousemove", ColorPickerPickHue);
|
||||
document.addEventListener("touchmove", ColorPickerPickHue);
|
||||
ColorPickerPickHue(Event);
|
||||
} else if (Y >= SVPanelOffset && Y < SVPanelOffset + SVPanelHeight) {
|
||||
document.addEventListener("mousemove", ColorPickerPickSV);
|
||||
document.addEventListener("touchmove", ColorPickerPickSV);
|
||||
ColorPickerPickSV(Event);
|
||||
} else if (Y >= PalleteOffset && Y < PalleteOffset + PalleteHeight) {
|
||||
ColorPickerSelectFromPallete(Event);
|
||||
}
|
||||
document.addEventListener("mouseup", ColorPickerEndPick);
|
||||
document.addEventListener("touchend", ColorPickerEndPick);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,13 +91,13 @@ function ColorPickerStartPick(Event) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerEndPick() {
|
||||
document.removeEventListener("mousemove", ColorPickerPickHue);
|
||||
document.removeEventListener("mousemove", ColorPickerPickSV);
|
||||
document.removeEventListener("mouseup", ColorPickerEndPick);
|
||||
document.removeEventListener("mousemove", ColorPickerPickHue);
|
||||
document.removeEventListener("mousemove", ColorPickerPickSV);
|
||||
document.removeEventListener("mouseup", ColorPickerEndPick);
|
||||
|
||||
document.removeEventListener("touchmove", ColorPickerPickHue);
|
||||
document.removeEventListener("touchmove", ColorPickerPickSV);
|
||||
document.removeEventListener("touchend", ColorPickerEndPick);
|
||||
document.removeEventListener("touchmove", ColorPickerPickHue);
|
||||
document.removeEventListener("touchmove", ColorPickerPickSV);
|
||||
document.removeEventListener("touchend", ColorPickerEndPick);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -106,16 +106,16 @@ function ColorPickerEndPick() {
|
|||
* @returns {{X: number, Y: number}} - Coordinates of the click/touch event on the canvas
|
||||
*/
|
||||
function ColorPickerGetCoordinates(Event) {
|
||||
if (Event.changedTouches) {
|
||||
// Mobile
|
||||
var Touch = Event.changedTouches[0];
|
||||
TouchMove(Touch);
|
||||
} else {
|
||||
// PC
|
||||
MouseMove(Event);
|
||||
}
|
||||
if (Event.changedTouches) {
|
||||
// Mobile
|
||||
var Touch = Event.changedTouches[0];
|
||||
TouchMove(Touch);
|
||||
} else {
|
||||
// PC
|
||||
MouseMove(Event);
|
||||
}
|
||||
|
||||
return { X: MouseX, Y: MouseY };
|
||||
return { X: MouseX, Y: MouseY };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,10 +124,10 @@ function ColorPickerGetCoordinates(Event) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerPickHue(Event) {
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
ColorPickerHSV.H = Math.max(0, Math.min(1, (C.X - ColorPickerX) / ColorPickerWidth));
|
||||
ColorPickerLastHSV = Object.assign({}, ColorPickerHSV);
|
||||
ColorPickerNotify();
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
ColorPickerHSV.H = Math.max(0, Math.min(1, (C.X - ColorPickerX) / ColorPickerWidth));
|
||||
ColorPickerLastHSV = Object.assign({}, ColorPickerHSV);
|
||||
ColorPickerNotify();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,16 +136,16 @@ function ColorPickerPickHue(Event) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerPickSV(Event) {
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
|
||||
var S = (C.X - ColorPickerX) / ColorPickerWidth;
|
||||
var V = 1 - (C.Y - SVPanelOffset) / SVPanelHeight;
|
||||
ColorPickerHSV.S = Math.max(0, Math.min(1, S));
|
||||
ColorPickerHSV.V = Math.max(0, Math.min(1, V));
|
||||
ColorPickerLastHSV = Object.assign({}, ColorPickerHSV);
|
||||
ColorPickerNotify();
|
||||
var S = (C.X - ColorPickerX) / ColorPickerWidth;
|
||||
var V = 1 - (C.Y - SVPanelOffset) / SVPanelHeight;
|
||||
ColorPickerHSV.S = Math.max(0, Math.min(1, S));
|
||||
ColorPickerHSV.V = Math.max(0, Math.min(1, V));
|
||||
ColorPickerLastHSV = Object.assign({}, ColorPickerHSV);
|
||||
ColorPickerNotify();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,11 +154,11 @@ function ColorPickerPickSV(Event) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ColorPickerSelectFromPallete(Event) {
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var P = Math.max(0, Math.min(1, (C.X - ColorPickerX) / ColorPickerWidth));
|
||||
var HSV = P > 0.5 ? ColorPickerInitialHSV : ColorPickerLastHSV;
|
||||
ColorPickerHSV = Object.assign({}, HSV);
|
||||
ColorPickerNotify();
|
||||
var C = ColorPickerGetCoordinates(Event);
|
||||
var P = Math.max(0, Math.min(1, (C.X - ColorPickerX) / ColorPickerWidth));
|
||||
var HSV = P > 0.5 ? ColorPickerInitialHSV : ColorPickerLastHSV;
|
||||
ColorPickerHSV = Object.assign({}, HSV);
|
||||
ColorPickerNotify();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,13 +167,13 @@ function ColorPickerSelectFromPallete(Event) {
|
|||
*/
|
||||
function ColorPickerNotify() {
|
||||
ColorPickerCSS = ColorPickerHSVToCSS(ColorPickerHSV);
|
||||
if (ColorPickerCallback) {
|
||||
ColorPickerCallback(ColorPickerCSS);
|
||||
}
|
||||
if (ColorPickerCallback) {
|
||||
ColorPickerCallback(ColorPickerCSS);
|
||||
}
|
||||
|
||||
if (ColorPickerSourceElement) {
|
||||
ColorPickerSourceElement.value = ColorPickerCSS;
|
||||
}
|
||||
if (ColorPickerSourceElement) {
|
||||
ColorPickerSourceElement.value = ColorPickerCSS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,11 +181,11 @@ function ColorPickerNotify() {
|
|||
* @return {void} - Nothing
|
||||
*/
|
||||
function ColorPickerHide() {
|
||||
ColorPickerSourceElement = null;
|
||||
ColorPickerInitialHSV = null;
|
||||
ColorPickerLastHSV = null;
|
||||
ColorPickerCallback = null;
|
||||
ColorPickerRemoveEventListener();
|
||||
ColorPickerSourceElement = null;
|
||||
ColorPickerInitialHSV = null;
|
||||
ColorPickerLastHSV = null;
|
||||
ColorPickerCallback = null;
|
||||
ColorPickerRemoveEventListener();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,13 +195,13 @@ function ColorPickerHide() {
|
|||
* @returns {boolean} - Returns TRUE if the two colors are the same
|
||||
*/
|
||||
function ColorPickerCSSColorEquals(Color1, Color2) {
|
||||
Color1 = Color1.toUpperCase();
|
||||
Color2 = Color2.toUpperCase();
|
||||
if (!CommonIsColor(Color1) || !CommonIsColor(Color2)) return false;
|
||||
// convert short hand hex color to standard format
|
||||
if (Color1.length == 4) Color1 = "#" + Color1[1] + Color1[1] + Color1[2] + Color1[2] + Color1[3] + Color1[3];
|
||||
if (Color2.length == 4) Color2 = "#" + Color2[1] + Color2[1] + Color2[2] + Color2[2] + Color2[3] + Color2[3];
|
||||
return Color1 === Color2;
|
||||
Color1 = Color1.toUpperCase();
|
||||
Color2 = Color2.toUpperCase();
|
||||
if (!CommonIsColor(Color1) || !CommonIsColor(Color2)) return false;
|
||||
// convert short hand hex color to standard format
|
||||
if (Color1.length == 4) Color1 = "#" + Color1[1] + Color1[1] + Color1[2] + Color1[2] + Color1[3] + Color1[3];
|
||||
if (Color2.length == 4) Color2 = "#" + Color2[1] + Color2[1] + Color2[2] + Color2[2] + Color2[3] + Color2[3];
|
||||
return Color1 === Color2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,108 +216,108 @@ function ColorPickerCSSColorEquals(Color1, Color2) {
|
|||
*/
|
||||
function ColorPickerDraw(X, Y, Width, Height, Src, Callback) {
|
||||
|
||||
// Calculate Layout
|
||||
ColorPickerLayout.HueBarHeight = ColorPickerHueBarHeight;
|
||||
ColorPickerLayout.HueBarOffset = Y;
|
||||
ColorPickerLayout.PalleteHeight = ColorPickerPalleteHeight;
|
||||
ColorPickerLayout.PalleteOffset = Y + Height - ColorPickerLayout.PalleteHeight;
|
||||
ColorPickerLayout.SVPanelHeight = Height - ColorPickerLayout.HueBarHeight - ColorPickerLayout.PalleteHeight - ColorPickerSVPanelGap - ColorPickerPalleteGap;
|
||||
ColorPickerLayout.SVPanelOffset = ColorPickerLayout.HueBarOffset + ColorPickerHueBarHeight + ColorPickerSVPanelGap;
|
||||
// Calculate Layout
|
||||
ColorPickerLayout.HueBarHeight = ColorPickerHueBarHeight;
|
||||
ColorPickerLayout.HueBarOffset = Y;
|
||||
ColorPickerLayout.PalleteHeight = ColorPickerPalleteHeight;
|
||||
ColorPickerLayout.PalleteOffset = Y + Height - ColorPickerLayout.PalleteHeight;
|
||||
ColorPickerLayout.SVPanelHeight = Height - ColorPickerLayout.HueBarHeight - ColorPickerLayout.PalleteHeight - ColorPickerSVPanelGap - ColorPickerPalleteGap;
|
||||
ColorPickerLayout.SVPanelOffset = ColorPickerLayout.HueBarOffset + ColorPickerHueBarHeight + ColorPickerSVPanelGap;
|
||||
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
var PalleteOffset = ColorPickerLayout.PalleteOffset;
|
||||
var PalleteHeight = ColorPickerLayout.PalleteHeight;
|
||||
var SVPanelOffset = ColorPickerLayout.SVPanelOffset;
|
||||
var SVPanelHeight = ColorPickerLayout.SVPanelHeight;
|
||||
var PalleteOffset = ColorPickerLayout.PalleteOffset;
|
||||
var PalleteHeight = ColorPickerLayout.PalleteHeight;
|
||||
|
||||
var HSV;
|
||||
if (ColorPickerInitialHSV == null) {
|
||||
// Get initial color value based on type of source
|
||||
var Color;
|
||||
if (Src instanceof HTMLInputElement) {
|
||||
ColorPickerSourceElement = Src;
|
||||
Color = Src.value.trim();
|
||||
} else {
|
||||
if (ColorPickerSourceElement != null) {
|
||||
ColorPickerSourceElement = null;
|
||||
}
|
||||
Color = Src;
|
||||
}
|
||||
var HSV;
|
||||
if (ColorPickerInitialHSV == null) {
|
||||
// Get initial color value based on type of source
|
||||
var Color;
|
||||
if (Src instanceof HTMLInputElement) {
|
||||
ColorPickerSourceElement = Src;
|
||||
Color = Src.value.trim();
|
||||
} else {
|
||||
if (ColorPickerSourceElement != null) {
|
||||
ColorPickerSourceElement = null;
|
||||
}
|
||||
Color = Src;
|
||||
}
|
||||
|
||||
HSV = ColorPickerCSSToHSV(Color);
|
||||
ColorPickerInitialHSV = Object.assign({}, HSV);
|
||||
ColorPickerLastHSV = Object.assign({}, HSV);
|
||||
ColorPickerHSV = Object.assign({}, HSV);
|
||||
ColorPickerCSS = Color;
|
||||
ColorPickerRemoveEventListener(); // remove possible duplicated attached event listener, just in case
|
||||
ColorPickerAttachEventListener();
|
||||
} else {
|
||||
// Watch source element change
|
||||
if (ColorPickerSourceElement != null) {
|
||||
var UserInputColor = ColorPickerSourceElement.value.trim().toUpperCase();
|
||||
if (CommonIsColor(UserInputColor)) {
|
||||
ColorPickerIsDefault = false;
|
||||
if (!ColorPickerCSSColorEquals(UserInputColor, ColorPickerCSS)) {
|
||||
if (ColorPickerCallback) {
|
||||
// Fire callback due to source element changed by user interaction
|
||||
ColorPickerCallback(UserInputColor);
|
||||
}
|
||||
ColorPickerCSS = UserInputColor;
|
||||
ColorPickerHSV = ColorPickerCSSToHSV(UserInputColor, ColorPickerHSV);
|
||||
}
|
||||
} else if (UserInputColor === "DEFAULT" && !ColorPickerIsDefault) {
|
||||
ColorPickerIsDefault = true;
|
||||
if (ColorPickerCallback) ColorPickerCallback("Default");
|
||||
}
|
||||
}
|
||||
// Use user updated HSV
|
||||
HSV = ColorPickerHSV;
|
||||
}
|
||||
HSV = ColorPickerCSSToHSV(Color);
|
||||
ColorPickerInitialHSV = Object.assign({}, HSV);
|
||||
ColorPickerLastHSV = Object.assign({}, HSV);
|
||||
ColorPickerHSV = Object.assign({}, HSV);
|
||||
ColorPickerCSS = Color;
|
||||
ColorPickerRemoveEventListener(); // remove possible duplicated attached event listener, just in case
|
||||
ColorPickerAttachEventListener();
|
||||
} else {
|
||||
// Watch source element change
|
||||
if (ColorPickerSourceElement != null) {
|
||||
var UserInputColor = ColorPickerSourceElement.value.trim().toUpperCase();
|
||||
if (CommonIsColor(UserInputColor)) {
|
||||
ColorPickerIsDefault = false;
|
||||
if (!ColorPickerCSSColorEquals(UserInputColor, ColorPickerCSS)) {
|
||||
if (ColorPickerCallback) {
|
||||
// Fire callback due to source element changed by user interaction
|
||||
ColorPickerCallback(UserInputColor);
|
||||
}
|
||||
ColorPickerCSS = UserInputColor;
|
||||
ColorPickerHSV = ColorPickerCSSToHSV(UserInputColor, ColorPickerHSV);
|
||||
}
|
||||
} else if (UserInputColor === "DEFAULT" && !ColorPickerIsDefault) {
|
||||
ColorPickerIsDefault = true;
|
||||
if (ColorPickerCallback) ColorPickerCallback("Default");
|
||||
}
|
||||
}
|
||||
// Use user updated HSV
|
||||
HSV = ColorPickerHSV;
|
||||
}
|
||||
|
||||
// Draw Hue Control
|
||||
var Grad;
|
||||
Grad = MainCanvas.createLinearGradient(X, Y, X + Width, Y);
|
||||
Grad.addColorStop(0.00, "#f00");
|
||||
Grad.addColorStop(0.16, "#ff0");
|
||||
Grad.addColorStop(0.33, "#0f0");
|
||||
Grad.addColorStop(0.50, "#0ff");
|
||||
Grad.addColorStop(0.66, "#00f");
|
||||
Grad.addColorStop(0.83, "#f0f");
|
||||
Grad.addColorStop(1.00, "#f00");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, Y, Width, ColorPickerHueBarHeight);
|
||||
// Draw Hue Control
|
||||
var Grad;
|
||||
Grad = MainCanvas.createLinearGradient(X, Y, X + Width, Y);
|
||||
Grad.addColorStop(0.00, "#f00");
|
||||
Grad.addColorStop(0.16, "#ff0");
|
||||
Grad.addColorStop(0.33, "#0f0");
|
||||
Grad.addColorStop(0.50, "#0ff");
|
||||
Grad.addColorStop(0.66, "#00f");
|
||||
Grad.addColorStop(0.83, "#f0f");
|
||||
Grad.addColorStop(1.00, "#f00");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, Y, Width, ColorPickerHueBarHeight);
|
||||
|
||||
// Draw S/V Panel
|
||||
DrawRect(X, SVPanelOffset, Width, SVPanelHeight, ColorPickerHSVToCSS({ H: HSV.H, S: 1, V: 1 }));
|
||||
// Draw S/V Panel
|
||||
DrawRect(X, SVPanelOffset, Width, SVPanelHeight, ColorPickerHSVToCSS({ H: HSV.H, S: 1, V: 1 }));
|
||||
|
||||
Grad = MainCanvas.createLinearGradient(X, SVPanelOffset, X + Width, SVPanelOffset);
|
||||
Grad.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
Grad.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, SVPanelOffset, Width, SVPanelHeight);
|
||||
Grad = MainCanvas.createLinearGradient(X, SVPanelOffset, X + Width, SVPanelOffset);
|
||||
Grad.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
Grad.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, SVPanelOffset, Width, SVPanelHeight);
|
||||
|
||||
Grad = MainCanvas.createLinearGradient(X, SVPanelOffset, X, SVPanelOffset + SVPanelHeight);
|
||||
Grad.addColorStop(0, "rgba(0, 0, 0, 0)");
|
||||
Grad.addColorStop(1, "rgba(0, 0, 0, 1)");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, SVPanelOffset, Width, SVPanelHeight);
|
||||
Grad = MainCanvas.createLinearGradient(X, SVPanelOffset, X, SVPanelOffset + SVPanelHeight);
|
||||
Grad.addColorStop(0, "rgba(0, 0, 0, 0)");
|
||||
Grad.addColorStop(1, "rgba(0, 0, 0, 1)");
|
||||
MainCanvas.fillStyle = Grad;
|
||||
MainCanvas.fillRect(X, SVPanelOffset, Width, SVPanelHeight);
|
||||
|
||||
if (!ColorPickerIsDefault) {
|
||||
var CSS = ColorPickerHSVToCSS(HSV);
|
||||
DrawCircle(X + HSV.S * Width, SVPanelOffset + (1 - HSV.V) * SVPanelHeight, 8, 16, CSS);
|
||||
DrawCircle(X + HSV.S * Width, SVPanelOffset + (1 - HSV.V) * SVPanelHeight, 14, 4, (HSV.V > 0.8 && HSV.S < 0.2) ? "#333333" : "#FFFFFF");
|
||||
}
|
||||
// Draw Hue Picker
|
||||
DrawEmptyRect(X + HSV.H * (Width - 20), Y, 20, ColorPickerHueBarHeight, "#FFFFFF");
|
||||
if (!ColorPickerIsDefault) {
|
||||
var CSS = ColorPickerHSVToCSS(HSV);
|
||||
DrawCircle(X + HSV.S * Width, SVPanelOffset + (1 - HSV.V) * SVPanelHeight, 8, 16, CSS);
|
||||
DrawCircle(X + HSV.S * Width, SVPanelOffset + (1 - HSV.V) * SVPanelHeight, 14, 4, (HSV.V > 0.8 && HSV.S < 0.2) ? "#333333" : "#FFFFFF");
|
||||
}
|
||||
// Draw Hue Picker
|
||||
DrawEmptyRect(X + HSV.H * (Width - 20), Y, 20, ColorPickerHueBarHeight, "#FFFFFF");
|
||||
|
||||
// Draw Pallette
|
||||
DrawRect(X, PalleteOffset, ColorPickerWidth / 2, PalleteHeight, ColorPickerHSVToCSS(ColorPickerLastHSV));
|
||||
DrawRect(X + ColorPickerWidth / 2, PalleteOffset, ColorPickerWidth / 2, PalleteHeight, ColorPickerHSVToCSS(ColorPickerInitialHSV));
|
||||
// Draw Pallette
|
||||
DrawRect(X, PalleteOffset, ColorPickerWidth / 2, PalleteHeight, ColorPickerHSVToCSS(ColorPickerLastHSV));
|
||||
DrawRect(X + ColorPickerWidth / 2, PalleteOffset, ColorPickerWidth / 2, PalleteHeight, ColorPickerHSVToCSS(ColorPickerInitialHSV));
|
||||
|
||||
ColorPickerX = X;
|
||||
ColorPickerY = Y;
|
||||
ColorPickerWidth = Width;
|
||||
ColorPickerHeight = Height;
|
||||
ColorPickerCallback = Callback;
|
||||
ColorPickerX = X;
|
||||
ColorPickerY = Y;
|
||||
ColorPickerWidth = Width;
|
||||
ColorPickerHeight = Height;
|
||||
ColorPickerCallback = Callback;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -328,47 +328,47 @@ function ColorPickerDraw(X, Y, Width, Height, Src, Callback) {
|
|||
* @see {@link https://gist.github.com/mjackson/5311256}
|
||||
*/
|
||||
function ColorPickerCSSToHSV(Color, DefaultHSV) {
|
||||
Color = Color || "#FFFFFF";
|
||||
var M = Color.match(/^#(([0-9a-f]{3})|([0-9a-f]{6}))$/i);
|
||||
var R, G, B;
|
||||
if (M) {
|
||||
var GRP = M[1];
|
||||
if (GRP.length == 3) {
|
||||
R = Number.parseInt(GRP[0] + GRP[0], 16) / 255;
|
||||
G = Number.parseInt(GRP[1] + GRP[1], 16) / 255;
|
||||
B = Number.parseInt(GRP[2] + GRP[2], 16) / 255;
|
||||
} else if (GRP.length == 6) {
|
||||
R = Number.parseInt(GRP[0] + GRP[1], 16) / 255;
|
||||
G = Number.parseInt(GRP[2] + GRP[3], 16) / 255;
|
||||
B = Number.parseInt(GRP[4] + GRP[5], 16) / 255;
|
||||
}
|
||||
}
|
||||
Color = Color || "#FFFFFF";
|
||||
var M = Color.match(/^#(([0-9a-f]{3})|([0-9a-f]{6}))$/i);
|
||||
var R, G, B;
|
||||
if (M) {
|
||||
var GRP = M[1];
|
||||
if (GRP.length == 3) {
|
||||
R = Number.parseInt(GRP[0] + GRP[0], 16) / 255;
|
||||
G = Number.parseInt(GRP[1] + GRP[1], 16) / 255;
|
||||
B = Number.parseInt(GRP[2] + GRP[2], 16) / 255;
|
||||
} else if (GRP.length == 6) {
|
||||
R = Number.parseInt(GRP[0] + GRP[1], 16) / 255;
|
||||
G = Number.parseInt(GRP[2] + GRP[3], 16) / 255;
|
||||
B = Number.parseInt(GRP[4] + GRP[5], 16) / 255;
|
||||
}
|
||||
}
|
||||
|
||||
if (isNaN(R) || isNaN(G) || isNaN(B)) {
|
||||
return DefaultHSV ? DefaultHSV : { H: 0, S: 0, V: 1 };
|
||||
}
|
||||
if (isNaN(R) || isNaN(G) || isNaN(B)) {
|
||||
return DefaultHSV ? DefaultHSV : { H: 0, S: 0, V: 1 };
|
||||
}
|
||||
|
||||
var Max = Math.max(R, G, B);
|
||||
var Min = Math.min(R, G, B);
|
||||
var D = Max - Min;
|
||||
var H = 0;
|
||||
var S = (Max == 0) ? 0 : D / Max;
|
||||
var V = Max;
|
||||
var Max = Math.max(R, G, B);
|
||||
var Min = Math.min(R, G, B);
|
||||
var D = Max - Min;
|
||||
var H = 0;
|
||||
var S = (Max == 0) ? 0 : D / Max;
|
||||
var V = Max;
|
||||
|
||||
if (D == 0) {
|
||||
H = 0;
|
||||
} else {
|
||||
if (Max == R) {
|
||||
H = (G - B) / D + (G < B ? 6 : 0);
|
||||
} else if (Max == G) {
|
||||
H = (B - R) / D + 2;
|
||||
} else {
|
||||
H = (R - G) / D + 4;
|
||||
}
|
||||
H /= 6;
|
||||
}
|
||||
if (D == 0) {
|
||||
H = 0;
|
||||
} else {
|
||||
if (Max == R) {
|
||||
H = (G - B) / D + (G < B ? 6 : 0);
|
||||
} else if (Max == G) {
|
||||
H = (B - R) / D + 2;
|
||||
} else {
|
||||
H = (R - G) / D + 4;
|
||||
}
|
||||
H /= 6;
|
||||
}
|
||||
|
||||
return { H: H, S: S, V: V };
|
||||
return { H: H, S: S, V: V };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -377,30 +377,30 @@ function ColorPickerCSSToHSV(Color, DefaultHSV) {
|
|||
* @returns {HexColor} - Hex color code corresponding to the given HSV
|
||||
*/
|
||||
function ColorPickerHSVToCSS(HSV) {
|
||||
var R, G, B;
|
||||
var H = HSV.H, S = HSV.S, V = HSV.V;
|
||||
var I = Math.floor(H * 6);
|
||||
var F = H * 6 - I;
|
||||
var P = V * (1 - S);
|
||||
var Q = V * (1 - F * S);
|
||||
var T = V * (1 - (1 - F) * S);
|
||||
var R, G, B;
|
||||
var H = HSV.H, S = HSV.S, V = HSV.V;
|
||||
var I = Math.floor(H * 6);
|
||||
var F = H * 6 - I;
|
||||
var P = V * (1 - S);
|
||||
var Q = V * (1 - F * S);
|
||||
var T = V * (1 - (1 - F) * S);
|
||||
|
||||
switch (I % 6) {
|
||||
case 0: R = V; G = T; B = P; break;
|
||||
case 1: R = Q; G = V; B = P; break;
|
||||
case 2: R = P; G = V; B = T; break;
|
||||
case 3: R = P; G = Q; B = V; break;
|
||||
case 4: R = T; G = P; B = V; break;
|
||||
case 5: R = V; G = P; B = Q; break;
|
||||
}
|
||||
switch (I % 6) {
|
||||
case 0: R = V; G = T; B = P; break;
|
||||
case 1: R = Q; G = V; B = P; break;
|
||||
case 2: R = P; G = V; B = T; break;
|
||||
case 3: R = P; G = Q; B = V; break;
|
||||
case 4: R = T; G = P; B = V; break;
|
||||
case 5: R = V; G = P; B = Q; break;
|
||||
}
|
||||
|
||||
var RS = Math.floor(R * 255).toString(16).toUpperCase();
|
||||
var GS = Math.floor(G * 255).toString(16).toUpperCase();
|
||||
var BS = Math.floor(B * 255).toString(16).toUpperCase();
|
||||
var RS = Math.floor(R * 255).toString(16).toUpperCase();
|
||||
var GS = Math.floor(G * 255).toString(16).toUpperCase();
|
||||
var BS = Math.floor(B * 255).toString(16).toUpperCase();
|
||||
|
||||
if (RS.length == 1) RS = "0" + RS;
|
||||
if (GS.length == 1) GS = "0" + GS;
|
||||
if (BS.length == 1) BS = "0" + BS;
|
||||
if (RS.length == 1) RS = "0" + RS;
|
||||
if (GS.length == 1) GS = "0" + GS;
|
||||
if (BS.length == 1) BS = "0" + BS;
|
||||
|
||||
return "#" + RS + GS + BS;
|
||||
return "#" + RS + GS + BS;
|
||||
}
|
||||
|
|
|
@ -303,26 +303,20 @@ function DialogChatRoomCanTakePhotos() { return CurrentScreen == "ChatRoom" && C
|
|||
function DialogPrerequisite(D) {
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite == null)
|
||||
return true;
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("Player.") == 0)
|
||||
return Player[CurrentCharacter.Dialog[D].Prerequisite.substring(7, 250).replace("()", "").trim()]();
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("!Player.") == 0)
|
||||
return !Player[CurrentCharacter.Dialog[D].Prerequisite.substring(8, 250).replace("()", "").trim()]();
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("CurrentCharacter.") == 0)
|
||||
return CurrentCharacter[CurrentCharacter.Dialog[D].Prerequisite.substring(17, 250).replace("()", "").trim()]();
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("!CurrentCharacter.") == 0)
|
||||
return !CurrentCharacter[CurrentCharacter.Dialog[D].Prerequisite.substring(18, 250).replace("()", "").trim()]();
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("(") >= 0)
|
||||
return CommonDynamicFunctionParams(CurrentCharacter.Dialog[D].Prerequisite);
|
||||
else if (CurrentCharacter.Dialog[D].Prerequisite.substring(0, 1) != "!")
|
||||
return window[CurrentScreen + CurrentCharacter.Dialog[D].Prerequisite.trim()];
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("Player.") == 0)
|
||||
return Player[CurrentCharacter.Dialog[D].Prerequisite.substring(7, 250).replace("()", "").trim()]();
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("!Player.") == 0)
|
||||
return !Player[CurrentCharacter.Dialog[D].Prerequisite.substring(8, 250).replace("()", "").trim()]();
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("CurrentCharacter.") == 0)
|
||||
return CurrentCharacter[CurrentCharacter.Dialog[D].Prerequisite.substring(17, 250).replace("()", "").trim()]();
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("!CurrentCharacter.") == 0)
|
||||
return !CurrentCharacter[CurrentCharacter.Dialog[D].Prerequisite.substring(18, 250).replace("()", "").trim()]();
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.indexOf("(") >= 0)
|
||||
return CommonDynamicFunctionParams(CurrentCharacter.Dialog[D].Prerequisite);
|
||||
else
|
||||
if (CurrentCharacter.Dialog[D].Prerequisite.substring(0, 1) != "!")
|
||||
return window[CurrentScreen + CurrentCharacter.Dialog[D].Prerequisite.trim()];
|
||||
else
|
||||
return !window[CurrentScreen + CurrentCharacter.Dialog[D].Prerequisite.substr(1, 250).trim()];
|
||||
return !window[CurrentScreen + CurrentCharacter.Dialog[D].Prerequisite.substr(1, 250).trim()];
|
||||
}
|
||||
|
||||
|
||||
|
@ -369,7 +363,7 @@ function DialogHasKey(C, Item) {
|
|||
if (C.IsLoverOfPlayer() && InventoryAvailable(Player, "LoversPadlockKey", "ItemMisc") && Item.Asset.Enable && Item.Property && Item.Property.LockedBy && !Item.Property.LockedBy.startsWith("Owner")) return true;
|
||||
if (lock && lock.Asset.ExclusiveUnlock && ((!Item.Property.MemberNumberListKeys && Item.Property.LockMemberNumber != Player.MemberNumber) || (Item.Property.MemberNumberListKeys && CommonConvertStringToArray("" + Item.Property.MemberNumberListKeys).indexOf(Player.MemberNumber) < 0))) return false;
|
||||
|
||||
if (lock && lock.Asset.ExclusiveUnlock) return true;
|
||||
if (lock && lock.Asset.ExclusiveUnlock) return true;
|
||||
|
||||
var UnlockName = "Unlock-" + Item.Asset.Name;
|
||||
if ((Item.Property != null) && (Item.Property.LockedBy != null)) UnlockName = "Unlock-" + Item.Property.LockedBy;
|
||||
|
@ -695,33 +689,35 @@ function DialogMenuButtonBuild(C) {
|
|||
|
||||
} else {
|
||||
if ((DialogInventory != null) && (DialogInventory.length > 12) && ((Player.CanInteract() && !IsGroupBlocked) || DialogItemPermissionMode)) DialogMenuButton.push("Next");
|
||||
if (C.FocusGroup.Name == "ItemMouth" || C.FocusGroup.Name == "ItemMouth2" || C.FocusGroup.Name == "ItemMouth3") DialogMenuButton.push("ChangeLayersMouth");
|
||||
if (IsItemLocked && DialogCanUnlock(C, Item) && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked && ((C.ID != 0) || Player.CanInteract())) { DialogMenuButton.push("Remove"); }
|
||||
if (IsItemLocked && ((!Player.IsBlind() || (Item.Property && DialogCanInspectLockWhileBlind(Item.Property.LockedBy))) || (InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked && !InventoryGroupIsBlocked(Player, "ItemHands") && InventoryItemIsPickable(Item)) && (C.ID == 0 || (C.OnlineSharedSettings && !C.OnlineSharedSettings.DisablePickingLocksOnSelf)))
|
||||
&& (Item.Property != null) && (Item.Property.LockedBy != null) && (Item.Property.LockedBy != ""))
|
||||
DialogMenuButton.push("LockMenu");
|
||||
if ((Item != null) && (C.ID == 0) && (!Player.CanInteract() || (IsItemLocked && !DialogCanUnlock(C, Item))) && (DialogMenuButton.indexOf("Unlock") < 0) && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Struggle");
|
||||
if ((Item != null) && !IsItemLocked && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) {
|
||||
if (Item.Asset.AllowLock && (!Item.Property || (Item.Property && Item.Property.AllowLock !== false))) {
|
||||
if (!Item.Asset.AllowLockType || Item.Asset.AllowLockType.includes(Item.Property.Type)) {
|
||||
DialogMenuButton.push("Lock");
|
||||
}
|
||||
if (C.FocusGroup.Name == "ItemMouth" || C.FocusGroup.Name == "ItemMouth2" || C.FocusGroup.Name == "ItemMouth3") DialogMenuButton.push("ChangeLayersMouth");
|
||||
if (IsItemLocked && DialogCanUnlock(C, Item) && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked && ((C.ID != 0) || Player.CanInteract())) { DialogMenuButton.push("Remove"); }
|
||||
if (IsItemLocked && ((!Player.IsBlind() || (Item.Property && DialogCanInspectLockWhileBlind(Item.Property.LockedBy))) || (InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked && !InventoryGroupIsBlocked(Player, "ItemHands") && InventoryItemIsPickable(Item)) && (C.ID == 0 || (C.OnlineSharedSettings && !C.OnlineSharedSettings.DisablePickingLocksOnSelf)))
|
||||
&& (Item.Property != null) && (Item.Property.LockedBy != null) && (Item.Property.LockedBy != "")
|
||||
) {
|
||||
DialogMenuButton.push("LockMenu");
|
||||
}
|
||||
if ((Item != null) && (C.ID == 0) && (!Player.CanInteract() || (IsItemLocked && !DialogCanUnlock(C, Item))) && (DialogMenuButton.indexOf("Unlock") < 0) && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Struggle");
|
||||
if ((Item != null) && !IsItemLocked && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) {
|
||||
if (Item.Asset.AllowLock && (!Item.Property || (Item.Property && Item.Property.AllowLock !== false))) {
|
||||
if (!Item.Asset.AllowLockType || Item.Asset.AllowLockType.includes(Item.Property.Type)) {
|
||||
DialogMenuButton.push("Lock");
|
||||
}
|
||||
}
|
||||
if ((Item != null) && !IsItemLocked && !InventoryItemHasEffect(Item, "Mounted", true) && !InventoryItemHasEffect(Item, "Enclose", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Remove");
|
||||
if ((Item != null) && !IsItemLocked && InventoryItemHasEffect(Item, "Mounted", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Dismount");
|
||||
if ((Item != null) && !IsItemLocked && InventoryItemHasEffect(Item, "Enclose", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Escape");
|
||||
if (DialogCanUseRemote(C, Item)) DialogMenuButton.push("Remote");
|
||||
if ((Item != null) && Item.Asset.Extended && ((Player.CanInteract()) || DialogAlwaysAllowRestraint() || Item.Asset.AlwaysInteract) && (!IsGroupBlocked || Item.Asset.AlwaysExtend) && (!Item.Asset.OwnerOnly || (C.IsOwnedByPlayer())) && (!Item.Asset.LoverOnly || (C.IsLoverOfPlayer())) && !InventoryBlockedOrLimited(C, Item)) DialogMenuButton.push("Use");
|
||||
if (DialogCanColor(C, Item)) DialogMenuButton.push("ColorPick");
|
||||
}
|
||||
if ((Item != null) && !IsItemLocked && !InventoryItemHasEffect(Item, "Mounted", true) && !InventoryItemHasEffect(Item, "Enclose", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Remove");
|
||||
if ((Item != null) && !IsItemLocked && InventoryItemHasEffect(Item, "Mounted", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Dismount");
|
||||
if ((Item != null) && !IsItemLocked && InventoryItemHasEffect(Item, "Enclose", true) && Player.CanInteract() && InventoryAllow(C, Item.Asset.Prerequisite) && !IsGroupBlocked) DialogMenuButton.push("Escape");
|
||||
if (DialogCanUseRemote(C, Item)) DialogMenuButton.push("Remote");
|
||||
if ((Item != null) && Item.Asset.Extended && ((Player.CanInteract()) || DialogAlwaysAllowRestraint() || Item.Asset.AlwaysInteract) && (!IsGroupBlocked || Item.Asset.AlwaysExtend) && (!Item.Asset.OwnerOnly || (C.IsOwnedByPlayer())) && (!Item.Asset.LoverOnly || (C.IsLoverOfPlayer())) && !InventoryBlockedOrLimited(C, Item)) DialogMenuButton.push("Use");
|
||||
if (DialogCanColor(C, Item)) DialogMenuButton.push("ColorPick");
|
||||
|
||||
// Make sure the target player zone is allowed for an activity
|
||||
if ((C.FocusGroup.Activity != null) && ((!C.IsEnclose() && !Player.IsEnclose()) || C.ID == 0) && ActivityAllowed() && (C.ArousalSettings != null) && (C.ArousalSettings.Zone != null) && (C.ArousalSettings.Active != null) && (C.ArousalSettings.Active != "Inactive"))
|
||||
for (let Z = 0; Z < C.ArousalSettings.Zone.length; Z++)
|
||||
if ((C.ArousalSettings.Zone[Z].Name == C.FocusGroup.Name) && (C.ArousalSettings.Zone[Z].Factor != null) && (C.ArousalSettings.Zone[Z].Factor > 0)) {
|
||||
ActivityDialogBuild(C);
|
||||
if (DialogActivity.length > 0) DialogMenuButton.push("Activity");
|
||||
}
|
||||
// Make sure the target player zone is allowed for an activity
|
||||
if ((C.FocusGroup.Activity != null) && ((!C.IsEnclose() && !Player.IsEnclose()) || C.ID == 0) && ActivityAllowed() && (C.ArousalSettings != null) && (C.ArousalSettings.Zone != null) && (C.ArousalSettings.Active != null) && (C.ArousalSettings.Active != "Inactive"))
|
||||
for (let Z = 0; Z < C.ArousalSettings.Zone.length; Z++)
|
||||
if ((C.ArousalSettings.Zone[Z].Name == C.FocusGroup.Name) && (C.ArousalSettings.Zone[Z].Factor != null) && (C.ArousalSettings.Zone[Z].Factor > 0)) {
|
||||
ActivityDialogBuild(C);
|
||||
if (DialogActivity.length > 0) DialogMenuButton.push("Activity");
|
||||
}
|
||||
|
||||
|
||||
// Item permission enter/exit, cannot be done in Extreme mode
|
||||
|
@ -1224,9 +1220,8 @@ function DialogItemClick(ClickItem) {
|
|||
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((CurrentItem.Asset.Name == ClickItem.Asset.Name) && CurrentItem.Asset.Extended)
|
||||
DialogExtendItem(CurrentItem);
|
||||
else if ((CurrentItem.Asset.Name == ClickItem.Asset.Name) && CurrentItem.Asset.Extended)
|
||||
DialogExtendItem(CurrentItem);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1234,12 +1229,10 @@ function DialogItemClick(ClickItem) {
|
|||
if (InventoryAllow(C, ClickItem.Asset.Prerequisite))
|
||||
if (InventoryItemHasEffect(ClickItem, "Unlock-" + CurrentItem.Asset.Name))
|
||||
StruggleProgressStart(C, CurrentItem, null);
|
||||
else
|
||||
if ((CurrentItem.Asset.Name == ClickItem.Asset.Name) && CurrentItem.Asset.Extended)
|
||||
DialogExtendItem(CurrentItem);
|
||||
else
|
||||
if (!ClickItem.Asset.Wear)
|
||||
DialogPublishAction(C, ClickItem);
|
||||
else if ((CurrentItem.Asset.Name == ClickItem.Asset.Name) && CurrentItem.Asset.Extended)
|
||||
DialogExtendItem(CurrentItem);
|
||||
else if (!ClickItem.Asset.Wear)
|
||||
DialogPublishAction(C, ClickItem);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1380,9 +1373,8 @@ function DialogClick() {
|
|||
CurrentCharacter.CurrentDialog = CurrentCharacter.Dialog[D].Result;
|
||||
if (CurrentCharacter.Dialog[D].NextStage != null) CurrentCharacter.Stage = CurrentCharacter.Dialog[D].NextStage;
|
||||
if (CurrentCharacter.Dialog[D].Function != null) CommonDynamicFunctionParams(CurrentCharacter.Dialog[D].Function);
|
||||
} else
|
||||
if ((CurrentCharacter.Dialog[D].Function != null) && (CurrentCharacter.Dialog[D].Function.trim() == "DialogLeave()"))
|
||||
DialogLeave();
|
||||
} else if ((CurrentCharacter.Dialog[D].Function != null) && (CurrentCharacter.Dialog[D].Function.trim() == "DialogLeave()"))
|
||||
DialogLeave();
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ function DrawHexToRGB(color) {
|
|||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : {
|
||||
r: 0,
|
||||
g: 0,
|
||||
b: 0
|
||||
};
|
||||
r: 0,
|
||||
g: 0,
|
||||
b: 0
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -792,14 +792,14 @@ function DrawTextFit(Text, X, Y, Width, Color, BackColor) {
|
|||
}
|
||||
|
||||
// Cuts the text if it would go over the box
|
||||
if (S <= 10) {
|
||||
while (Text.length > 0) {
|
||||
Text = Text.substr(1);
|
||||
const metrics = MainCanvas.measureText(Text);
|
||||
if (metrics.width <= Width)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (S <= 10) {
|
||||
while (Text.length > 0) {
|
||||
Text = Text.substr(1);
|
||||
const metrics = MainCanvas.measureText(Text);
|
||||
if (metrics.width <= Width)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw a back color relief text if needed
|
||||
if ((BackColor != null) && (BackColor != "")) {
|
||||
|
|
|
@ -49,34 +49,36 @@ function init(){
|
|||
renderer.setPixelRatio(window.devicePixelRatio);
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
|
||||
// clock = new THREE.Clock();
|
||||
// clock = new THREE.Clock();
|
||||
|
||||
group1 = new THREE.Group();
|
||||
group1 = new THREE.Group();
|
||||
count = -1;
|
||||
light();
|
||||
for (let i of itemgroup){
|
||||
count += 1;
|
||||
let subst = i.indexOf("/");
|
||||
let grpname = i.slice(0, subst);
|
||||
let itemname = i.slice(subst +1);
|
||||
let loader = new THREE.FBXLoader();
|
||||
loader.load(`${path3d}${grpname}/${itemname}.fbx`,function( object ) {
|
||||
model = object;
|
||||
model.name = itemname;
|
||||
model.group = grpname;
|
||||
for (let i of itemgroup){
|
||||
count += 1;
|
||||
let subst = i.indexOf("/");
|
||||
let grpname = i.slice(0, subst);
|
||||
let itemname = i.slice(subst +1);
|
||||
let loader = new THREE.FBXLoader();
|
||||
loader.load(
|
||||
`${path3d}${grpname}/${itemname}.fbx`,
|
||||
function( object ) {
|
||||
model = object;
|
||||
model.name = itemname;
|
||||
model.group = grpname;
|
||||
|
||||
// model.mixer = new THREE.AnimationMixer(model);
|
||||
// model.mixer.root = model.mixer.getRoot();
|
||||
// model.mixer = new THREE.AnimationMixer(model);
|
||||
// model.mixer.root = model.mixer.getRoot();
|
||||
|
||||
color2("#ADD8E6", i);
|
||||
group1.add(model);
|
||||
},
|
||||
undefined,
|
||||
function( error ) {
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
color2("#ADD8E6", i);
|
||||
group1.add(model);
|
||||
},
|
||||
undefined,
|
||||
function( error ) {
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
scene.add(group1);
|
||||
|
||||
}
|
||||
|
@ -123,49 +125,49 @@ function color2(hexcolor){
|
|||
var texturehair = loader.load(`${path3d}HairFront/t005.bmp`);
|
||||
model.traverse( function ( child ) {
|
||||
if ( child.isMesh ) {
|
||||
if (model.group == "HairBack" || model.group == "HairFront"){
|
||||
child.castShadow = true;
|
||||
child.receiveShadow = true;
|
||||
child.material = new THREE.MeshPhongMaterial( {
|
||||
color: hexcolor, // hair color
|
||||
wireframe: false,
|
||||
map: texturehair,
|
||||
} );
|
||||
}else {
|
||||
child.castShadow = true;
|
||||
child.receiveShadow = true;
|
||||
}
|
||||
if (model.group == "HairBack" || model.group == "HairFront"){
|
||||
child.castShadow = true;
|
||||
child.receiveShadow = true;
|
||||
child.material = new THREE.MeshPhongMaterial( {
|
||||
color: hexcolor, // hair color
|
||||
wireframe: false,
|
||||
map: texturehair,
|
||||
} );
|
||||
}else {
|
||||
child.castShadow = true;
|
||||
child.receiveShadow = true;
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
//strip the model
|
||||
function Strip3Dmodel(models, i){
|
||||
if(i <= -1){
|
||||
console.log("can't strip further");
|
||||
maid = true;
|
||||
}else {
|
||||
if (models[i].group !== "BodyUpper" && models[i].group !== "Eyes" && models[i].group !== "HairBack" && models[i].group !== "HairFront") group1.remove(models[i]);
|
||||
}
|
||||
if(i <= -1){
|
||||
console.log("can't strip further");
|
||||
maid = true;
|
||||
}else {
|
||||
if (models[i].group !== "BodyUpper" && models[i].group !== "Eyes" && models[i].group !== "HairBack" && models[i].group !== "HairFront") group1.remove(models[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function dress3DModels(group, path3d){
|
||||
if ( maid == true){
|
||||
let group2 = [ "Cloth/TopMaid","Panties/PantieMaid", "Bra/MaidBra", "ItemNeck/MaidCollar", "Shoes/HighHeels"];
|
||||
count = 3;
|
||||
// }else{
|
||||
// let group = Character[0].Appearance.length -1;
|
||||
// }
|
||||
// }else{
|
||||
// let group = Character[0].Appearance.length -1;
|
||||
// }
|
||||
for (let i of group2){
|
||||
let subst = i.indexOf("/");
|
||||
// if (maid == true){
|
||||
// if (maid == true){
|
||||
let grpname = i.slice(0, subst);
|
||||
let itemcolor = "#ADD8E6";
|
||||
let itemname = i.slice(subst);
|
||||
// }else {
|
||||
// let grpname = Character[0].Appearance[i].Asset.DynamicGroupName;
|
||||
// let itemname = Character[0].Appearance[i].Asset.Name;
|
||||
// let itemcolor = Character[0].Appearance[i].Color;
|
||||
// }else {
|
||||
// let grpname = Character[0].Appearance[i].Asset.DynamicGroupName;
|
||||
// let itemname = Character[0].Appearance[i].Asset.Name;
|
||||
// let itemcolor = Character[0].Appearance[i].Color;
|
||||
|
||||
|
||||
let loader = new THREE.FBXLoader();
|
||||
|
@ -211,7 +213,9 @@ function refresh3DModel (group, path3d){
|
|||
if (grpname == "BodyUpper" && itemcolor == "Asian") itemname = "Light Skin";
|
||||
|
||||
let loader = new THREE.FBXLoader();
|
||||
loader.load(`${path3d}${grpname}/${itemname}.fbx`, function( object ) {
|
||||
loader.load(
|
||||
`${path3d}${grpname}/${itemname}.fbx`,
|
||||
function( object ) {
|
||||
model = object;
|
||||
model.name = itemname;
|
||||
model.group = grpname;
|
||||
|
@ -226,8 +230,8 @@ function refresh3DModel (group, path3d){
|
|||
}
|
||||
);
|
||||
}
|
||||
scene.add(group1);
|
||||
maid = false;
|
||||
scene.add(group1);
|
||||
maid = false;
|
||||
}
|
||||
|
||||
// function checkitempath(){
|
||||
|
|
|
@ -198,8 +198,8 @@ function ElementCreateDropdown(ID, Options, ClickEventListener) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function ElementCloseAllSelect(elmnt) {
|
||||
/*a function that will close all select boxes in the document,
|
||||
except the current select box:*/
|
||||
/*a function that will close all select boxes in the document,
|
||||
except the current select box:*/
|
||||
var arrNo = [];
|
||||
var y = document.getElementsByClassName("select-selected");
|
||||
for (let i = 0; i < y.length; i++) {
|
||||
|
|
|
@ -235,7 +235,7 @@ function ExtendedItemExit() {
|
|||
* @returns {void} Nothing
|
||||
*/
|
||||
function ExtendedItemSetType(C, Options, Option) {
|
||||
DialogFocusItem = InventoryGet(C, C.FocusGroup.Name);
|
||||
DialogFocusItem = InventoryGet(C, C.FocusGroup.Name);
|
||||
var FunctionPrefix = ExtendedItemFunctionPrefix();
|
||||
|
||||
if (CurrentScreen == "ChatRoom") {
|
||||
|
|
|
@ -20,29 +20,29 @@ window.addEventListener('load', GLDrawLoad);
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawLoad() {
|
||||
GLDrawCanvas = document.createElement("canvas");
|
||||
GLDrawCanvas.width = 1000;
|
||||
GLDrawCanvas.height = CanvasDrawHeight;
|
||||
GLVersion = "webgl2";
|
||||
var gl = GLDrawCanvas.getContext(GLVersion);
|
||||
if (!gl) { GLVersion = "webgl"; gl = GLDrawCanvas.getContext(GLVersion); }
|
||||
if (!gl) { GLVersion = "No WebGL"; GLDrawCanvas.remove(); GLDrawCanvas = null; return; }
|
||||
GLDrawCanvas = document.createElement("canvas");
|
||||
GLDrawCanvas.width = 1000;
|
||||
GLDrawCanvas.height = CanvasDrawHeight;
|
||||
GLVersion = "webgl2";
|
||||
var gl = GLDrawCanvas.getContext(GLVersion);
|
||||
if (!gl) { GLVersion = "webgl"; gl = GLDrawCanvas.getContext(GLVersion); }
|
||||
if (!gl) { GLVersion = "No WebGL"; GLDrawCanvas.remove(); GLDrawCanvas = null; return; }
|
||||
|
||||
GLDrawCanvas = GLDrawInitCharacterCanvas(GLDrawCanvas);
|
||||
GLDrawCanvas = GLDrawInitCharacterCanvas(GLDrawCanvas);
|
||||
|
||||
CharacterAppearanceBuildCanvas = GLDrawAppearanceBuild;
|
||||
CharacterAppearanceBuildCanvas = GLDrawAppearanceBuild;
|
||||
|
||||
// Attach context listeners
|
||||
GLDrawCanvas.addEventListener("webglcontextlost", function (event) {
|
||||
event.preventDefault();
|
||||
console.log("WebGL Drawing disabled: Context Lost. If the context does not restore itself, refresh your page.");
|
||||
}, false);
|
||||
GLDrawCanvas.addEventListener("webglcontextrestored", function () {
|
||||
GLDrawLoad();
|
||||
console.log("WebGL: Context restored.");
|
||||
}, false);
|
||||
// Attach context listeners
|
||||
GLDrawCanvas.addEventListener("webglcontextlost", function (event) {
|
||||
event.preventDefault();
|
||||
console.log("WebGL Drawing disabled: Context Lost. If the context does not restore itself, refresh your page.");
|
||||
}, false);
|
||||
GLDrawCanvas.addEventListener("webglcontextrestored", function () {
|
||||
GLDrawLoad();
|
||||
console.log("WebGL: Context restored.");
|
||||
}, false);
|
||||
|
||||
//console.log("WebGL Drawing enabled: '" + GLVersion + "'");
|
||||
//console.log("WebGL Drawing enabled: '" + GLVersion + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,21 +51,21 @@ function GLDrawLoad() {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawMakeGLProgam(gl) {
|
||||
var vertexShader = GLDrawCreateShader(gl, GLDrawVertexShaderSource, gl.VERTEX_SHADER);
|
||||
var fragmentShader = GLDrawCreateShader(gl, GLDrawFragmentShaderSource, gl.FRAGMENT_SHADER);
|
||||
var fragmentShaderFullAlpha = GLDrawCreateShader(gl, GLDrawFragmentShaderSourceFullAlpha, gl.FRAGMENT_SHADER);
|
||||
var fragmentShaderHalfAlpha = GLDrawCreateShader(gl, GLDrawFragmentShaderSourceHalfAlpha, gl.FRAGMENT_SHADER);
|
||||
var vertexShader = GLDrawCreateShader(gl, GLDrawVertexShaderSource, gl.VERTEX_SHADER);
|
||||
var fragmentShader = GLDrawCreateShader(gl, GLDrawFragmentShaderSource, gl.FRAGMENT_SHADER);
|
||||
var fragmentShaderFullAlpha = GLDrawCreateShader(gl, GLDrawFragmentShaderSourceFullAlpha, gl.FRAGMENT_SHADER);
|
||||
var fragmentShaderHalfAlpha = GLDrawCreateShader(gl, GLDrawFragmentShaderSourceHalfAlpha, gl.FRAGMENT_SHADER);
|
||||
|
||||
gl.program = GLDrawCreateProgram(gl, vertexShader, fragmentShader);
|
||||
gl.programFull = GLDrawCreateProgram(gl, vertexShader, fragmentShaderFullAlpha);
|
||||
gl.programHalf = GLDrawCreateProgram(gl, vertexShader, fragmentShaderHalfAlpha);
|
||||
gl.program = GLDrawCreateProgram(gl, vertexShader, fragmentShader);
|
||||
gl.programFull = GLDrawCreateProgram(gl, vertexShader, fragmentShaderFullAlpha);
|
||||
gl.programHalf = GLDrawCreateProgram(gl, vertexShader, fragmentShaderHalfAlpha);
|
||||
|
||||
gl.program.u_alpha = gl.getUniformLocation(gl.program, "u_alpha");
|
||||
gl.programFull.u_color = gl.getUniformLocation(gl.programFull, "u_color");
|
||||
gl.programHalf.u_color = gl.getUniformLocation(gl.programHalf, "u_color");
|
||||
gl.programFull.u_color = gl.getUniformLocation(gl.programFull, "u_color");
|
||||
gl.programHalf.u_color = gl.getUniformLocation(gl.programHalf, "u_color");
|
||||
|
||||
gl.textureCache = new Map();
|
||||
gl.maskCache = new Map();
|
||||
gl.textureCache = new Map();
|
||||
gl.maskCache = new Map();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,24 +74,24 @@ function GLDrawMakeGLProgam(gl) {
|
|||
* @returns {HTMLCanvasElement} - The prepared canvas
|
||||
*/
|
||||
function GLDrawInitCharacterCanvas(canvas) {
|
||||
if (canvas == null) {
|
||||
canvas = document.createElement("canvas");
|
||||
canvas.width = 1000;
|
||||
canvas.height = CanvasDrawHeight;
|
||||
}
|
||||
if (canvas.GL == null) {
|
||||
canvas.GL = canvas.getContext(GLVersion);
|
||||
if (canvas.GL == null) {
|
||||
canvas.remove();
|
||||
return GLDrawInitCharacterCanvas(null);
|
||||
}
|
||||
} else {
|
||||
GLDrawClearRect(canvas.GL, 0, 0, 1000, CanvasDrawHeight);
|
||||
}
|
||||
if (canvas.GL.program == null) {
|
||||
GLDrawMakeGLProgam(canvas.GL);
|
||||
}
|
||||
return canvas;
|
||||
if (canvas == null) {
|
||||
canvas = document.createElement("canvas");
|
||||
canvas.width = 1000;
|
||||
canvas.height = CanvasDrawHeight;
|
||||
}
|
||||
if (canvas.GL == null) {
|
||||
canvas.GL = canvas.getContext(GLVersion);
|
||||
if (canvas.GL == null) {
|
||||
canvas.remove();
|
||||
return GLDrawInitCharacterCanvas(null);
|
||||
}
|
||||
} else {
|
||||
GLDrawClearRect(canvas.GL, 0, 0, 1000, CanvasDrawHeight);
|
||||
}
|
||||
if (canvas.GL.program == null) {
|
||||
GLDrawMakeGLProgam(canvas.GL);
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -197,13 +197,13 @@ var GLDrawFragmentShaderSourceHalfAlpha = `
|
|||
* @returns {WebGLShader} - The created WebGL shader
|
||||
*/
|
||||
function GLDrawCreateShader(gl, source, type) {
|
||||
var shader = gl.createShader(type);
|
||||
gl.shaderSource(shader, source);
|
||||
gl.compileShader(shader);
|
||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||
throw new Error('Could not compile WebGL program. \n\n' + gl.getShaderInfoLog(shader));
|
||||
}
|
||||
return shader;
|
||||
var shader = gl.createShader(type);
|
||||
gl.shaderSource(shader, source);
|
||||
gl.compileShader(shader);
|
||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||
throw new Error('Could not compile WebGL program. \n\n' + gl.getShaderInfoLog(shader));
|
||||
}
|
||||
return shader;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -214,30 +214,30 @@ function GLDrawCreateShader(gl, source, type) {
|
|||
* @returns {WebGLProgram} - The created WebGL program
|
||||
*/
|
||||
function GLDrawCreateProgram(gl, vertexShader, fragmentShader) {
|
||||
var program = gl.createProgram();
|
||||
gl.attachShader(program, vertexShader);
|
||||
gl.attachShader(program, fragmentShader);
|
||||
gl.linkProgram(program);
|
||||
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
||||
throw new Error('Could not compile WebGL program. \n\n' + gl.getProgramInfoLog(program));
|
||||
}
|
||||
var program = gl.createProgram();
|
||||
gl.attachShader(program, vertexShader);
|
||||
gl.attachShader(program, fragmentShader);
|
||||
gl.linkProgram(program);
|
||||
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
||||
throw new Error('Could not compile WebGL program. \n\n' + gl.getProgramInfoLog(program));
|
||||
}
|
||||
|
||||
program.a_position = gl.getAttribLocation(program, "a_position");
|
||||
program.a_texcoord = gl.getAttribLocation(program, "a_texcoord");
|
||||
program.a_position = gl.getAttribLocation(program, "a_position");
|
||||
program.a_texcoord = gl.getAttribLocation(program, "a_texcoord");
|
||||
|
||||
program.u_matrix = gl.getUniformLocation(program, "u_matrix");
|
||||
program.u_texture = gl.getUniformLocation(program, "u_texture");
|
||||
program.u_alpha_texture = gl.getUniformLocation(program, "u_alpha_texture");
|
||||
program.u_matrix = gl.getUniformLocation(program, "u_matrix");
|
||||
program.u_texture = gl.getUniformLocation(program, "u_texture");
|
||||
program.u_alpha_texture = gl.getUniformLocation(program, "u_alpha_texture");
|
||||
|
||||
program.position_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.position_buffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1,]), gl.STATIC_DRAW);
|
||||
program.position_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.position_buffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1,]), gl.STATIC_DRAW);
|
||||
|
||||
program.texcoord_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.texcoord_buffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1,]), gl.STATIC_DRAW);
|
||||
program.texcoord_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.texcoord_buffer);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1,]), gl.STATIC_DRAW);
|
||||
|
||||
return program;
|
||||
return program;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -267,44 +267,44 @@ function GLDrawImageBlink(url, gl, dstX, dstY, color, fullAlpha, alphaMasks, opa
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawImage(url, gl, dstX, dstY, offsetX, color, fullAlpha, alphaMasks, opacity, rotate = false) {
|
||||
offsetX = offsetX || 0;
|
||||
offsetX = offsetX || 0;
|
||||
opacity = typeof opacity === "number" ? opacity : 1;
|
||||
var tex = GLDrawLoadImage(gl, url);
|
||||
var mask = GLDrawLoadMask(gl, tex.width, tex.height, dstX, dstY, alphaMasks);
|
||||
if (rotate) dstX = 500 - dstX;
|
||||
const sign = rotate ? -1 : 1;
|
||||
var tex = GLDrawLoadImage(gl, url);
|
||||
var mask = GLDrawLoadMask(gl, tex.width, tex.height, dstX, dstY, alphaMasks);
|
||||
if (rotate) dstX = 500 - dstX;
|
||||
const sign = rotate ? -1 : 1;
|
||||
|
||||
var program = (color == null) ? gl.program : (fullAlpha ? gl.programFull : gl.programHalf);
|
||||
var program = (color == null) ? gl.program : (fullAlpha ? gl.programFull : gl.programHalf);
|
||||
|
||||
gl.useProgram(program);
|
||||
gl.useProgram(program);
|
||||
|
||||
gl.enable(gl.BLEND);
|
||||
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.SRC_ALPHA, gl.DST_ALPHA);
|
||||
gl.enable(gl.BLEND);
|
||||
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.SRC_ALPHA, gl.DST_ALPHA);
|
||||
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.position_buffer);
|
||||
gl.enableVertexAttribArray(program.a_position);
|
||||
gl.vertexAttribPointer(program.a_position, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.texcoord_buffer);
|
||||
gl.enableVertexAttribArray(program.a_texcoord);
|
||||
gl.vertexAttribPointer(program.a_texcoord, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.position_buffer);
|
||||
gl.enableVertexAttribArray(program.a_position);
|
||||
gl.vertexAttribPointer(program.a_position, 2, gl.FLOAT, false, 0, 0);
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, program.texcoord_buffer);
|
||||
gl.enableVertexAttribArray(program.a_texcoord);
|
||||
gl.vertexAttribPointer(program.a_texcoord, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
var matrix = m4.orthographic(0, gl.canvas.width, gl.canvas.height, 0, -1, 1);
|
||||
matrix = m4.translate(matrix, dstX + offsetX, dstY, 0);
|
||||
matrix = m4.scale(matrix, sign * tex.width, sign * tex.height, 1);
|
||||
var matrix = m4.orthographic(0, gl.canvas.width, gl.canvas.height, 0, -1, 1);
|
||||
matrix = m4.translate(matrix, dstX + offsetX, dstY, 0);
|
||||
matrix = m4.scale(matrix, sign * tex.width, sign * tex.height, 1);
|
||||
|
||||
gl.uniformMatrix4fv(program.u_matrix, false, matrix);
|
||||
gl.uniform1i(program.u_texture, 0);
|
||||
gl.uniform1i(program.u_alpha_texture, 1);
|
||||
gl.uniformMatrix4fv(program.u_matrix, false, matrix);
|
||||
gl.uniform1i(program.u_texture, 0);
|
||||
gl.uniform1i(program.u_alpha_texture, 1);
|
||||
if (program.u_alpha != null) gl.uniform1f(program.u_alpha, opacity);
|
||||
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, tex.texture);
|
||||
gl.activeTexture(gl.TEXTURE1);
|
||||
gl.bindTexture(gl.TEXTURE_2D, mask);
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
gl.bindTexture(gl.TEXTURE_2D, tex.texture);
|
||||
gl.activeTexture(gl.TEXTURE1);
|
||||
gl.bindTexture(gl.TEXTURE_2D, mask);
|
||||
|
||||
if (program.u_color != null) gl.uniform4fv(program.u_color, GLDrawHexToRGBA(color, opacity));
|
||||
if (program.u_color != null) gl.uniform4fv(program.u_color, GLDrawHexToRGBA(color, opacity));
|
||||
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -325,10 +325,10 @@ function GLDraw2DCanvasBlink(gl, Img, X, Y, alphaMasks) { GLDraw2DCanvas(gl, Img
|
|||
* @param {number[][]} alphaMasks - A list of alpha masks to apply to the asset
|
||||
*/
|
||||
function GLDraw2DCanvas(gl, Img, X, Y, alphaMasks) {
|
||||
var TempCanvasName = Img.getAttribute("name");
|
||||
gl.textureCache.delete(TempCanvasName);
|
||||
GLDrawImageCache.set(TempCanvasName, Img);
|
||||
GLDrawImage(TempCanvasName, gl, X, Y, 0, null, null, alphaMasks);
|
||||
var TempCanvasName = Img.getAttribute("name");
|
||||
gl.textureCache.delete(TempCanvasName);
|
||||
GLDrawImageCache.set(TempCanvasName, Img);
|
||||
GLDrawImage(TempCanvasName, gl, X, Y, 0, null, null, alphaMasks);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,10 +339,10 @@ function GLDraw2DCanvas(gl, Img, X, Y, alphaMasks) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawBingImageToTextureInfo(gl, Img, textureInfo) {
|
||||
textureInfo.width = Img.width;
|
||||
textureInfo.height = Img.height;
|
||||
gl.bindTexture(gl.TEXTURE_2D, textureInfo.texture);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, Img);
|
||||
textureInfo.width = Img.width;
|
||||
textureInfo.height = Img.height;
|
||||
gl.bindTexture(gl.TEXTURE_2D, textureInfo.texture);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, Img);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -353,49 +353,49 @@ function GLDrawBingImageToTextureInfo(gl, Img, textureInfo) {
|
|||
*/
|
||||
function GLDrawLoadImage(gl, url) {
|
||||
|
||||
var textureInfo = gl.textureCache.get(url);
|
||||
var textureInfo = gl.textureCache.get(url);
|
||||
|
||||
if (!textureInfo) {
|
||||
var tex = gl.createTexture();
|
||||
if (!textureInfo) {
|
||||
var tex = gl.createTexture();
|
||||
|
||||
gl.bindTexture(gl.TEXTURE_2D, tex);
|
||||
textureInfo = { width: 1, height: 1, texture: tex, };
|
||||
gl.textureCache.set(url, textureInfo);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.bindTexture(gl.TEXTURE_2D, tex);
|
||||
textureInfo = { width: 1, height: 1, texture: tex, };
|
||||
gl.textureCache.set(url, textureInfo);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
|
||||
var Img = GLDrawImageCache.get(url);
|
||||
var Img = GLDrawImageCache.get(url);
|
||||
|
||||
if (Img) {
|
||||
GLDrawBingImageToTextureInfo(gl, Img, textureInfo);
|
||||
} else {
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 0]));
|
||||
Img = new Image();
|
||||
GLDrawImageCache.set(url, Img);
|
||||
if (Img) {
|
||||
GLDrawBingImageToTextureInfo(gl, Img, textureInfo);
|
||||
} else {
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 0]));
|
||||
Img = new Image();
|
||||
GLDrawImageCache.set(url, Img);
|
||||
|
||||
++GLDrawCacheTotalImages;
|
||||
Img.addEventListener('load', function () {
|
||||
GLDrawBingImageToTextureInfo(gl, Img, textureInfo);
|
||||
++GLDrawCacheLoadedImages;
|
||||
if (GLDrawCacheLoadedImages == GLDrawCacheTotalImages) { Player.MustDraw = true; CharacterLoadCanvasAll(); }
|
||||
});
|
||||
Img.addEventListener('error', function () {
|
||||
if (Img.errorcount == null) Img.errorcount = 0;
|
||||
Img.errorcount += 1;
|
||||
if (Img.errorcount < 3) {
|
||||
// eslint-disable-next-line no-self-assign
|
||||
Img.src = Img.src;
|
||||
} else {
|
||||
console.log("Error loading image " + Img.src);
|
||||
++GLDrawCacheLoadedImages;
|
||||
if (GLDrawCacheLoadedImages == GLDrawCacheTotalImages) CharacterLoadCanvasAll();
|
||||
}
|
||||
});
|
||||
Img.src = url;
|
||||
}
|
||||
}
|
||||
return textureInfo;
|
||||
++GLDrawCacheTotalImages;
|
||||
Img.addEventListener('load', function () {
|
||||
GLDrawBingImageToTextureInfo(gl, Img, textureInfo);
|
||||
++GLDrawCacheLoadedImages;
|
||||
if (GLDrawCacheLoadedImages == GLDrawCacheTotalImages) { Player.MustDraw = true; CharacterLoadCanvasAll(); }
|
||||
});
|
||||
Img.addEventListener('error', function () {
|
||||
if (Img.errorcount == null) Img.errorcount = 0;
|
||||
Img.errorcount += 1;
|
||||
if (Img.errorcount < 3) {
|
||||
// eslint-disable-next-line no-self-assign
|
||||
Img.src = Img.src;
|
||||
} else {
|
||||
console.log("Error loading image " + Img.src);
|
||||
++GLDrawCacheLoadedImages;
|
||||
if (GLDrawCacheLoadedImages == GLDrawCacheTotalImages) CharacterLoadCanvasAll();
|
||||
}
|
||||
});
|
||||
Img.src = url;
|
||||
}
|
||||
}
|
||||
return textureInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,11 +454,11 @@ function GLDrawClearRectBlink(gl, x, y, width, height) { GLDrawClearRect(gl, x +
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawClearRect(gl, x, y, width, height) {
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(x, y, width, height);
|
||||
gl.clearColor(0, 0, 0, 0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.disable(gl.SCISSOR_TEST);
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(x, y, width, height);
|
||||
gl.clearColor(0, 0, 0, 0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.disable(gl.SCISSOR_TEST);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -468,10 +468,10 @@ function GLDrawClearRect(gl, x, y, width, height) {
|
|||
* @return {string} - Converted color code
|
||||
*/
|
||||
function GLDrawHexToRGBA(color, alpha = 1) {
|
||||
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
||||
color = color.replace(shorthandRegex, function (m, r, g, b) { return r + r + g + g + b + b; });
|
||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
|
||||
return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16), alpha] : [0, 0, 0, alpha];
|
||||
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
||||
color = color.replace(shorthandRegex, function (m, r, g, b) { return r + r + g + g + b + b; });
|
||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
|
||||
return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16), alpha] : [0, 0, 0, alpha];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -480,9 +480,9 @@ function GLDrawHexToRGBA(color, alpha = 1) {
|
|||
* @returns {void} - Nothing
|
||||
*/
|
||||
function GLDrawAppearanceBuild(C) {
|
||||
GLDrawClearRect(GLDrawCanvas.GL, 0, 0, 1000, CanvasDrawHeight);
|
||||
CommonDrawCanvasPrepare(C);
|
||||
CommonDrawAppearanceBuild(C, {
|
||||
GLDrawClearRect(GLDrawCanvas.GL, 0, 0, 1000, CanvasDrawHeight);
|
||||
CommonDrawCanvasPrepare(C);
|
||||
CommonDrawAppearanceBuild(C, {
|
||||
clearRect: (x, y, w, h) => GLDrawClearRect(GLDrawCanvas.GL, x, CanvasDrawHeight - y - h, w, h),
|
||||
clearRectBlink: (x, y, w, h) => GLDrawClearRectBlink(GLDrawCanvas.GL, x, CanvasDrawHeight - y - h, w, h),
|
||||
drawImage: (src, x, y, alphaMasks, opacity, rotate) => GLDrawImage(src, GLDrawCanvas.GL, x, y, 0, null, null, alphaMasks, opacity, rotate),
|
||||
|
@ -492,6 +492,6 @@ function GLDrawAppearanceBuild(C) {
|
|||
drawCanvas: (Img, x, y, alphaMasks) => GLDraw2DCanvas(GLDrawCanvas.GL, Img, x, y, alphaMasks),
|
||||
drawCanvasBlink: (Img, x, y, alphaMasks) => GLDraw2DCanvasBlink(GLDrawCanvas.GL, Img, x, y, alphaMasks),
|
||||
});
|
||||
C.Canvas.getContext("2d").drawImage(GLDrawCanvas, 0, 0);
|
||||
C.CanvasBlink.getContext("2d").drawImage(GLDrawCanvas, -500, 0);
|
||||
C.Canvas.getContext("2d").drawImage(GLDrawCanvas, 0, 0);
|
||||
C.CanvasBlink.getContext("2d").drawImage(GLDrawCanvas, -500, 0);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ function LogQueryRemote(C, QueryLogName, QueryLogGroup) {
|
|||
* @returns {Rule[]} - A list of rules that the player's owner is permitted to see
|
||||
*/
|
||||
function LogGetOwnerReadableRules(OwnerIsLover) {
|
||||
return Log.filter(L => L.Group == "OwnerRule" || (L.Group == "LoverRule" && (OwnerIsLover || L.Name.includes("Owner"))));
|
||||
return Log.filter(L => L.Group == "OwnerRule" || (L.Group == "LoverRule" && (OwnerIsLover || L.Name.includes("Owner"))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,5 +139,5 @@ function LogGetOwnerReadableRules(OwnerIsLover) {
|
|||
* @returns {Rule[]} - A list of rules that the player's lover is permitted to see
|
||||
*/
|
||||
function LogGetLoverReadableRules() {
|
||||
return Log.filter(L => L.Group == "LoverRule");
|
||||
return Log.filter(L => L.Group == "LoverRule");
|
||||
}
|
||||
|
|
|
@ -547,7 +547,7 @@ function InventoryGroupIsBlocked(C, GroupName, Activity) {
|
|||
// Default to characters focused group
|
||||
if (GroupName == null) GroupName = C.FocusGroup.Name;
|
||||
|
||||
if (Activity) {
|
||||
if (Activity) {
|
||||
for (let E = 0; E < C.Appearance.length; E++) {
|
||||
if (!C.Appearance[E].Asset.Group.Clothing && (C.Appearance[E].Asset.AllowActivityOn != null) && (C.Appearance[E].Asset.AllowActivityOn.includes(GroupName))){
|
||||
Activity = true;
|
||||
|
@ -557,7 +557,7 @@ function InventoryGroupIsBlocked(C, GroupName, Activity) {
|
|||
break;
|
||||
} else Activity = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Items can block each other (hoods blocks gags, belts blocks eggs, etc.)
|
||||
for (let E = 0; E < C.Appearance.length; E++) {
|
||||
|
@ -625,11 +625,11 @@ function InventoryItemIsPickable(Item) {
|
|||
* item itself does not exist.
|
||||
*/
|
||||
function InventoryGetItemProperty(Item, PropertyName, CheckGroup) {
|
||||
if (!Item || !PropertyName || !Item.Asset) return;
|
||||
let Property = Item.Property && Item.Property[PropertyName];
|
||||
if (typeof Property === "undefined") Property = Item.Asset[PropertyName];
|
||||
if (typeof Property === "undefined" && CheckGroup) Property = Item.Asset.Group[PropertyName];
|
||||
return Property;
|
||||
if (!Item || !PropertyName || !Item.Asset) return;
|
||||
let Property = Item.Property && Item.Property[PropertyName];
|
||||
if (typeof Property === "undefined") Property = Item.Asset[PropertyName];
|
||||
if (typeof Property === "undefined" && CheckGroup) Property = Item.Asset.Group[PropertyName];
|
||||
return Property;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ var MouseY = 0;
|
|||
* @returns {boolean} - Returns TRUE if the click occurred in the given zone
|
||||
*/
|
||||
function MouseIn(Left, Top, Width, Height) {
|
||||
return MouseXIn(Left, Width) && MouseYIn(Top, Height);
|
||||
return MouseXIn(Left, Width) && MouseYIn(Top, Height);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,7 @@ function MouseIn(Left, Top, Width, Height) {
|
|||
* @returns {boolean} - Returns TRUE if the click occurred in the given zone
|
||||
*/
|
||||
function MouseXIn(Left, Width) {
|
||||
return (MouseX >= Left) && (MouseX <= Left + Width);
|
||||
return (MouseX >= Left) && (MouseX <= Left + Width);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ function MouseXIn(Left, Width) {
|
|||
* @returns {boolean} - Returns TRUE if the click occurred in the given zone
|
||||
*/
|
||||
function MouseYIn(Top, Height) {
|
||||
return (MouseY >= Top) && (MouseY <= Top + Height);
|
||||
return (MouseY >= Top) && (MouseY <= Top + Height);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -76,9 +76,8 @@ function NPCTraitGetOptionValue(Dialog, NPCTrait) {
|
|||
for (let N = 0; N < NPCTrait.length; N++)
|
||||
if (NPCTrait[N].Name.trim() == DialogTrait[T].trim())
|
||||
Value = Value + NPCTrait[N].Value;
|
||||
else
|
||||
if (NPCTrait[N].Name.trim() == NPCTraitReverse(DialogTrait[T].trim()))
|
||||
Value = Value - 10000;
|
||||
else if (NPCTrait[N].Name.trim() == NPCTraitReverse(DialogTrait[T].trim()))
|
||||
Value = Value - 10000;
|
||||
return Value;
|
||||
} else return 0;
|
||||
}
|
||||
|
|
|
@ -455,7 +455,7 @@ function StruggleFlexibilityStart(C, PrevItem, NextItem) {
|
|||
if ((PrevItem.Asset.Group.Name != "ItemHands") && InventoryItemHasEffect(InventoryGet(C, "ItemHands"), "Block", true)) S = S - 1; // Harder If we don't target the hands while hands are restrained
|
||||
if ((PrevItem.Asset.Group.Name != "ItemFeet") && InventoryItemHasEffect(InventoryGet(C, "ItemFeet"), "Block", true)) S = S - 2; // Harder if you can't split your feet apart
|
||||
|
||||
if ((PrevItem.Asset.Group.Name == "ItemMouth") || (PrevItem.Asset.Group.Name == "ItemMouth2") || (PrevItem.Asset.Group.Name == "ItemMouth3") || (PrevItem.Asset.Group.Name == "ItemNeck") || (PrevItem.Asset.Group.Name == "ItemHood")) S = S - 4; // The head is not very flexible
|
||||
if ((PrevItem.Asset.Group.Name == "ItemMouth") || (PrevItem.Asset.Group.Name == "ItemMouth2") || (PrevItem.Asset.Group.Name == "ItemMouth3") || (PrevItem.Asset.Group.Name == "ItemNeck") || (PrevItem.Asset.Group.Name == "ItemHood")) S = S - 4; // The head is not very flexible
|
||||
|
||||
|
||||
if ((ChatRoomStruggleAssistTimer >= CurrentTime) && (ChatRoomStruggleAssistBonus >= 1) && (ChatRoomStruggleAssistBonus <= 6)) S = S + ChatRoomStruggleAssistBonus; // If assisted by another player, the player can get a bonus to struggle out
|
||||
|
@ -1222,12 +1222,12 @@ function StruggleLockPickProgressStart(C, Item) {
|
|||
else {
|
||||
var conv = CommonConvertStringToArray(Item.Property.LockPickSeed);
|
||||
for (let PP = 0; PP < conv.length; PP++) {
|
||||
if (typeof conv[PP] != "number") {
|
||||
Item.Property.LockPickSeed = CommonConvertArrayToString(StruggleLockPickOrder);
|
||||
conv = StruggleLockPickOrder;
|
||||
break;
|
||||
}
|
||||
if (typeof conv[PP] != "number") {
|
||||
Item.Property.LockPickSeed = CommonConvertArrayToString(StruggleLockPickOrder);
|
||||
conv = StruggleLockPickOrder;
|
||||
break;
|
||||
}
|
||||
}
|
||||
StruggleLockPickOrder = conv;
|
||||
}
|
||||
|
||||
|
@ -1242,9 +1242,9 @@ function StruggleLockPickProgressStart(C, Item) {
|
|||
// At 4 pins we have a base of 16 tries, with 10 maximum permutions possible
|
||||
// At 10 pins we have a base of 40-30 tries, with 55 maximum permutions possible
|
||||
var NumTries = Math.max(Math.floor(NumPins * (1.5 - 0.3*BondageLevel/10)),
|
||||
Math.ceil(NumPins * (3.25 - BondageLevel/10) - Math.max(0, (StruggleLockPickProgressChallenge + BondageLevel/2)*1.5)));
|
||||
// negative skill of 1 subtracts 2 from the normal lock and 4 from 10 pin locks,
|
||||
// negative skill of 6 subtracts 12 from all locks
|
||||
Math.ceil(NumPins * (3.25 - BondageLevel/10) - Math.max(0, (StruggleLockPickProgressChallenge + BondageLevel/2)*1.5)));
|
||||
// negative skill of 1 subtracts 2 from the normal lock and 4 from 10 pin locks,
|
||||
// negative skill of 6 subtracts 12 from all locks
|
||||
|
||||
|
||||
StruggleLockPickProgressMaxTries = Math.max(1, NumTries - NumPins);
|
||||
|
|
|
@ -73,11 +73,10 @@ function TimerInventoryRemove() {
|
|||
// If we must remove the linked item from the character or the facial expression
|
||||
if ((Character[C].Appearance[A].Property.RemoveItem != null) && Character[C].Appearance[A].Property.RemoveItem && (Character[C].Appearance[A].Asset.Group.Category != null) && (Character[C].Appearance[A].Asset.Group.Category == "Item"))
|
||||
InventoryRemove(Character[C], Character[C].Appearance[A].Asset.Group.Name);
|
||||
else if (Character[C].Appearance[A].Asset.Group.AllowExpression != null)
|
||||
CharacterSetFacialExpression(Character[C], Character[C].Appearance[A].Asset.Group.Name, null);
|
||||
else
|
||||
if (Character[C].Appearance[A].Asset.Group.AllowExpression != null)
|
||||
CharacterSetFacialExpression(Character[C], Character[C].Appearance[A].Asset.Group.Name, null);
|
||||
else
|
||||
CharacterRefresh(Character[C]);
|
||||
CharacterRefresh(Character[C]);
|
||||
|
||||
// Sync with the server and exit
|
||||
if (Character[C].ID == 0) ChatRoomCharacterUpdate(Character[C]);
|
||||
|
@ -242,7 +241,7 @@ function TimerProcess(Timestamp) {
|
|||
DrawRect(MouseX - 5, MouseY - 5, 10, 10, "Cyan");
|
||||
}
|
||||
|
||||
// Launches the main again for the next frame
|
||||
// Launches the main again for the next frame
|
||||
requestAnimationFrame(MainRun);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,66 +1,66 @@
|
|||
"use strict";
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
},
|
||||
plugins: [
|
||||
'sort-keys-custom',
|
||||
],
|
||||
rules: {},
|
||||
overrides: [
|
||||
{
|
||||
files: ['Female3DCG.js'],
|
||||
rules: {
|
||||
'sort-keys-custom/sort-keys-custom': [
|
||||
'warn', [
|
||||
// Object key sort order for assets and asset groups
|
||||
'Name', // Assets
|
||||
'Group', // Asset Groups
|
||||
'ParentGroup', // Asset Groups
|
||||
'ParentSize', // Asset Groups
|
||||
'ParentColor', // Asset Groups
|
||||
'Category', // Asset Groups
|
||||
'Priority', // Both
|
||||
'Value', // Assets
|
||||
'Difficulty', // Assets
|
||||
'SelfBondage', // Assets
|
||||
'Time', // Assets
|
||||
'RemoveTime', // Assets
|
||||
'Enable', // Assets
|
||||
'Visible', // Assets
|
||||
'Default', // Asset Groups
|
||||
'Clothing', // Asset Groups
|
||||
'Underwear', // Asset Groups
|
||||
'Random', // Both
|
||||
'Wear', // Assets
|
||||
'IsRestraint', // Both
|
||||
'AllowLock', // Assets
|
||||
'OwnerOnly', // Assets
|
||||
'LoverOnly', // Assets
|
||||
'Blink', // Asset Groups
|
||||
'Left', // Both
|
||||
'Top', // Both
|
||||
'DefaultColor', // Assets
|
||||
'BuyGroup', // Assets
|
||||
'Prerequisite', // Assets
|
||||
'Hide', // Assets
|
||||
'HideItem', // Assets
|
||||
'FullAlpha', // Asset Groups
|
||||
'AllowNone', // Asset Groups
|
||||
'AllowColorize', // Asset Groups
|
||||
'AllowCustomize', // Asset Groups
|
||||
'AllowPose', // Both
|
||||
'SetPose', // Both
|
||||
'Effect', // Both
|
||||
'Zone', // Asset Groups
|
||||
'Activity', // Both
|
||||
], 'asc',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
},
|
||||
plugins: [
|
||||
'sort-keys-custom',
|
||||
],
|
||||
rules: {},
|
||||
overrides: [
|
||||
{
|
||||
files: ['Female3DCG.js'],
|
||||
rules: {
|
||||
'sort-keys-custom/sort-keys-custom': [
|
||||
'warn', [
|
||||
// Object key sort order for assets and asset groups
|
||||
'Name', // Assets
|
||||
'Group', // Asset Groups
|
||||
'ParentGroup', // Asset Groups
|
||||
'ParentSize', // Asset Groups
|
||||
'ParentColor', // Asset Groups
|
||||
'Category', // Asset Groups
|
||||
'Priority', // Both
|
||||
'Value', // Assets
|
||||
'Difficulty', // Assets
|
||||
'SelfBondage', // Assets
|
||||
'Time', // Assets
|
||||
'RemoveTime', // Assets
|
||||
'Enable', // Assets
|
||||
'Visible', // Assets
|
||||
'Default', // Asset Groups
|
||||
'Clothing', // Asset Groups
|
||||
'Underwear', // Asset Groups
|
||||
'Random', // Both
|
||||
'Wear', // Assets
|
||||
'IsRestraint', // Both
|
||||
'AllowLock', // Assets
|
||||
'OwnerOnly', // Assets
|
||||
'LoverOnly', // Assets
|
||||
'Blink', // Asset Groups
|
||||
'Left', // Both
|
||||
'Top', // Both
|
||||
'DefaultColor', // Assets
|
||||
'BuyGroup', // Assets
|
||||
'Prerequisite', // Assets
|
||||
'Hide', // Assets
|
||||
'HideItem', // Assets
|
||||
'FullAlpha', // Asset Groups
|
||||
'AllowNone', // Asset Groups
|
||||
'AllowColorize', // Asset Groups
|
||||
'AllowCustomize', // Asset Groups
|
||||
'AllowPose', // Both
|
||||
'SetPose', // Both
|
||||
'Effect', // Both
|
||||
'Zone', // Asset Groups
|
||||
'Activity', // Both
|
||||
], 'asc',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue