├── @Resources ├── Fonts │ ├── A-15-BIT.ttf │ ├── AUSTRALIA-TITLE.otf │ ├── Agatha Needs Flesh - Terms of Use End User Lisence Agreement.txt │ ├── Agatha Needs Flesh.ttf │ ├── AlteHaasGroteskBold.ttf │ ├── AlteHaasGroteskRegular.ttf │ ├── Avantgarde.ttf │ ├── BLACKOUT.TTF │ ├── BebasNeue Light.ttf │ ├── Elegant Lux Mager.otf │ ├── FUTRFW.TTF │ ├── Fiesta.ttf │ ├── Future.ttf │ ├── Futurist Fixed-width Bold.ttf │ ├── Galano Grotesque Alt DEMO Bold.otf │ ├── Galano Grotesque DEMO Bold.otf │ ├── GeosansLight.ttf │ ├── GlacialIndifference-Bold.otf │ ├── GlacialIndifference-Regular.otf │ ├── GracedScript_PersonalUseOnly.ttf │ ├── Grunge Strokes 01.ttf │ ├── HunDIN1451.ttf │ ├── LeviReBrushed.ttf │ ├── Lions.ttf │ ├── Material icons 2.ttf │ ├── MaterialIcons-Regular.ttf │ ├── Museo Sans Cyrl 300.otf │ ├── NOVUM-Regular.ttf │ ├── NoirMedium.ttf │ ├── Pacifico.ttf │ ├── Product Sans Regular.ttf │ ├── Retro Mono Wide.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-Thin.ttf │ └── SF_Collegiate_Solid.ttf └── Scripts │ ├── ColorKeywords.lua │ ├── FileLoader.lua │ ├── HelperFunctions.lua │ ├── ModifierHandler.lua │ ├── PathTypes │ ├── A.lua │ ├── C.lua │ ├── H.lua │ ├── L.lua │ ├── M.lua │ ├── Q.lua │ ├── S.lua │ ├── T.lua │ ├── V.lua │ └── Z.lua │ ├── SvgTypes │ ├── circle.lua │ ├── defs.lua │ ├── g.lua │ ├── path.lua │ ├── polygon.lua │ ├── rect.lua │ ├── style.lua │ └── svg.lua │ ├── XmlParser.lua │ └── lol │ ├── ColorKeywords.lua │ ├── Converter.lua │ ├── FileLoader.lua │ ├── HelperFunctions.lua │ ├── ModifierHandler.lua │ ├── MouseHandler.lua │ ├── PathTypes │ ├── A.lua │ ├── C.lua │ ├── H.lua │ ├── L.lua │ ├── M.lua │ ├── Q.lua │ ├── S.lua │ ├── T.lua │ ├── V.lua │ └── Z.lua │ ├── ReplaceText.lua │ ├── SvgTypes │ ├── circle.lua │ ├── defs.lua │ ├── g.lua │ ├── path.lua │ ├── polygon.lua │ ├── rect.lua │ ├── style.lua │ └── svg.lua │ ├── WindowHandler.lua │ └── XmlParser.lua ├── Bit ├── Bit.ini ├── Converter.lua └── ReplaceText.lua ├── Clear Futurist └── Clear Futurist.ini ├── Clock Future Style └── Clock Future Style.ini ├── Clock Hun Style └── Clock Hun Style.ini ├── Clock Neo Style └── Clock Neo Style.ini ├── College ├── College.ini ├── Converter.lua ├── ReplaceText.lua └── ReplaceText2.lua ├── Exclusive ├── Converter.lua ├── Exclusive.ini └── ReplaceText.lua ├── Glacial Contrast ├── Converter.lua ├── Glacial Contrast.ini └── ReplaceText.lua ├── Lion └── Lion.ini ├── Pacific Futurist └── Pacific Futurist.ini ├── Pacific └── Pacific.ini ├── Product └── Product.ini ├── README.md ├── Retro └── Retro.ini ├── Ribbon ├── Converter.lua ├── ReplaceText.lua └── Ribbon.ini ├── Roll └── Roll.ini ├── Straight Hidden ├── Converter.lua ├── ReplaceText.lua └── Straight Hidden.ini ├── Stroke ├── Stroke.ini ├── apr.png ├── aug.png ├── dec.png ├── feb.png ├── jan.png ├── jul.png ├── jun.png ├── mar.png ├── may.png ├── nov.png ├── oct.png ├── sep.png └── template.psd ├── Tilt Reveal ├── Converter.lua ├── ReplaceText.lua └── Tilt Reveal.ini └── Vertical Lineup └── Vertical Lineup.ini /@Resources/Fonts/A-15-BIT.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/A-15-BIT.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/AUSTRALIA-TITLE.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/AUSTRALIA-TITLE.otf -------------------------------------------------------------------------------- /@Resources/Fonts/Agatha Needs Flesh - Terms of Use End User Lisence Agreement.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Agatha Needs Flesh - Terms of Use End User Lisence Agreement.txt -------------------------------------------------------------------------------- /@Resources/Fonts/Agatha Needs Flesh.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Agatha Needs Flesh.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/AlteHaasGroteskBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/AlteHaasGroteskBold.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/AlteHaasGroteskRegular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/AlteHaasGroteskRegular.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Avantgarde.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Avantgarde.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/BLACKOUT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/BLACKOUT.TTF -------------------------------------------------------------------------------- /@Resources/Fonts/BebasNeue Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/BebasNeue Light.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Elegant Lux Mager.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Elegant Lux Mager.otf -------------------------------------------------------------------------------- /@Resources/Fonts/FUTRFW.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/FUTRFW.TTF -------------------------------------------------------------------------------- /@Resources/Fonts/Fiesta.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Fiesta.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Future.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Future.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Futurist Fixed-width Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Futurist Fixed-width Bold.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Galano Grotesque Alt DEMO Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Galano Grotesque Alt DEMO Bold.otf -------------------------------------------------------------------------------- /@Resources/Fonts/Galano Grotesque DEMO Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Galano Grotesque DEMO Bold.otf -------------------------------------------------------------------------------- /@Resources/Fonts/GeosansLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/GeosansLight.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/GlacialIndifference-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/GlacialIndifference-Bold.otf -------------------------------------------------------------------------------- /@Resources/Fonts/GlacialIndifference-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/GlacialIndifference-Regular.otf -------------------------------------------------------------------------------- /@Resources/Fonts/GracedScript_PersonalUseOnly.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/GracedScript_PersonalUseOnly.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Grunge Strokes 01.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Grunge Strokes 01.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/HunDIN1451.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/HunDIN1451.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/LeviReBrushed.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/LeviReBrushed.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Lions.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Lions.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Material icons 2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Material icons 2.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Museo Sans Cyrl 300.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Museo Sans Cyrl 300.otf -------------------------------------------------------------------------------- /@Resources/Fonts/NOVUM-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/NOVUM-Regular.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/NoirMedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/NoirMedium.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Pacifico.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Pacifico.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Product Sans Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Product Sans Regular.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Retro Mono Wide.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Retro Mono Wide.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /@Resources/Fonts/SF_Collegiate_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/@Resources/Fonts/SF_Collegiate_Solid.ttf -------------------------------------------------------------------------------- /@Resources/Scripts/ColorKeywords.lua: -------------------------------------------------------------------------------- 1 | local keywords = {} 2 | 3 | keywords["aliceblue"] = "240, 248, 255" 4 | keywords["antiquewhite"] = "250, 235, 215" 5 | keywords["aqua"] = "0, 255, 255" 6 | keywords["aquamarine"] = "127, 255, 212" 7 | keywords["azure"] = "240, 255, 255" 8 | keywords["beige"] = "245, 245, 220" 9 | keywords["bisque"] = "255, 228, 196" 10 | keywords["black"] = "0, 0, 0" 11 | keywords["blanchedalmond"] = "255, 235, 205" 12 | keywords["blue"] = "0, 0, 255" 13 | keywords["blueviolet"] = "138, 43, 226" 14 | keywords["brown"] = "165, 42, 42" 15 | keywords["burlywood"] = "222, 184, 135" 16 | keywords["cadetblue"] = "95, 158, 160" 17 | keywords["chartreuse"] = "127, 255, 0" 18 | keywords["chocolate"] = "210, 105, 30" 19 | keywords["coral"] = "255, 127, 80" 20 | keywords["cornflowerblue"] = "100, 149, 237" 21 | keywords["cornsilk"] = "255, 248, 220" 22 | keywords["crimson"] = "220, 20, 60" 23 | keywords["cyan"] = "0, 255, 255" 24 | keywords["darkblue"] = "0, 0, 139" 25 | keywords["darkcyan"] = "0, 139, 139" 26 | keywords["darkgoldenrod"] = "184, 134, 11" 27 | keywords["darkgray"] = "169, 169, 169" 28 | keywords["darkgreen"] = "0, 100, 0" 29 | keywords["darkgrey"] = "169, 169, 169" 30 | keywords["darkkhaki"] = "189, 183, 107" 31 | keywords["darkmagenta"] = "139, 0, 139" 32 | keywords["darkolivegreen"] = "85, 107, 47" 33 | keywords["darkorange"] = "255, 140, 0" 34 | keywords["darkorchid"] = "153, 50, 204" 35 | keywords["darkred"] = "139, 0, 0" 36 | keywords["darksalmon"] = "233, 150, 122" 37 | keywords["darkseagreen"] = "143, 188, 143" 38 | keywords["darkslateblue"] = "72, 61, 139" 39 | keywords["darkslategray"] = "47, 79, 79" 40 | keywords["darkturquoise"] = "0, 206, 209" 41 | keywords["darkviolet"] = "148, 0, 211" 42 | keywords["deeppink"] = "255, 20, 147" 43 | keywords["deepskyblue"] = "0, 191, 255" 44 | keywords["dimgray"] = "105, 105, 105" 45 | keywords["dodgerblue"] = "30, 144, 255" 46 | keywords["firebrick"] = "178, 34, 34" 47 | keywords["floralwhite"] = "255, 250, 240" 48 | keywords["forestgreen"] = "34, 139, 34" 49 | keywords["fuchsia"] = "255, 0, 255" 50 | keywords["gainsboro"] = "220, 220, 220" 51 | keywords["ghostwhite"] = "248, 248, 255" 52 | keywords["gold"] = "255, 215, 0" 53 | keywords["goldenrod"] = "218, 165, 32" 54 | keywords["gray"] = "128, 128, 128" 55 | keywords["green"] = "0, 128, 0" 56 | keywords["greenyellow"] = "173, 255, 47" 57 | keywords["honeydew"] = "240, 255, 240" 58 | keywords["hotpink"] = "255, 105, 180" 59 | keywords["indianred"] = "205, 92, 92" 60 | keywords["indigo"] = "75, 0, 130" 61 | keywords["ivory"] = "255, 255, 240" 62 | keywords["khaki"] = "240, 230, 140" 63 | keywords["lavender"] = "230, 230, 250" 64 | keywords["lavenderblush"] = "255, 240, 245" 65 | keywords["lawngreen"] = "124, 252, 0" 66 | keywords["lemonchiffon"] = "255, 250, 205" 67 | keywords["lightblue"] = "173, 216, 230" 68 | keywords["lightcoral"] = "240, 128, 128" 69 | keywords["lightcyan"] = "224, 255, 255" 70 | keywords["lightgoldenrodyellow"] = "250, 250, 210" 71 | keywords["lightgray"] = "211, 211, 211" 72 | keywords["lightgreen"] = "144, 238, 144" 73 | keywords["lightpink"] = "255, 182, 193" 74 | keywords["lightsalmon"] = "255, 160, 122" 75 | keywords["lightseagreen"] = "32, 178, 170" 76 | keywords["lightskyblue"] = "135, 206, 250" 77 | keywords["lightslategray"] = "119, 136, 153" 78 | keywords["lightsteelblue"] = "176, 196, 222" 79 | keywords["lightyellow"] = "255, 255, 224" 80 | keywords["lime"] = "0, 255, 0" 81 | keywords["limegreen"] = "50, 205, 50" 82 | keywords["linen"] = "250, 240, 230" 83 | keywords["magenta"] = "255, 0, 255" 84 | keywords["maroon"] = "128, 0, 0" 85 | keywords["mediumaquamarine"] = "102, 205, 170" 86 | keywords["mediumblue"] = "0, 0, 205" 87 | keywords["mediumorchid"] = "186, 85, 211" 88 | keywords["mediumpurple"] = "147, 112, 219" 89 | keywords["mediumseagreen"] = "60, 179, 113" 90 | keywords["mediumslateblue"] = "123, 104, 238" 91 | keywords["mediumspringgreen"] = "0, 250, 154" 92 | keywords["mediumturquoise"] = "72, 209, 204" 93 | keywords["mediumvioletred"] = "199, 21, 133" 94 | keywords["midnightblue"] = "25, 25, 112" 95 | keywords["mintcream"] = "245, 255, 250" 96 | keywords["mistyrose"] = "255, 228, 225" 97 | keywords["moccasin"] = "255, 228, 181" 98 | keywords["navajowhite"] = "255, 222, 173" 99 | keywords["navy"] = "0, 0, 128" 100 | keywords["oldlace"] = "253, 245, 230" 101 | keywords["olive"] = "128, 128, 0" 102 | keywords["olivedrab"] = "107, 142, 35" 103 | keywords["orange"] = "255, 165, 0" 104 | keywords["orangered"] = "255, 69, 0" 105 | keywords["orchid"] = "218, 112, 214" 106 | keywords["palegoldenrod"] = "238, 232, 170" 107 | keywords["palegreen"] = "152, 251, 152" 108 | keywords["paleturquoise"] = "175, 238, 238" 109 | keywords["palevioletred"] = "219, 112, 147" 110 | keywords["papayawhip"] = "255, 239, 213" 111 | keywords["peachpuff"] = "255, 218, 185" 112 | keywords["peru"] = "205, 133, 63" 113 | keywords["pink"] = "255, 192, 203" 114 | keywords["plum"] = "221, 160, 221" 115 | keywords["powderblue"] = "176, 224, 230" 116 | keywords["purple"] = "128, 0, 128" 117 | keywords["red"] = "255, 0, 0" 118 | keywords["rosybrown"] = "188, 143, 143" 119 | keywords["royalblue"] = "65, 105, 225" 120 | keywords["saddlebrown"] = "139, 69, 19" 121 | keywords["salmon"] = "250, 128, 114" 122 | keywords["sandybrown"] = "244, 164, 96" 123 | keywords["seagreen"] = "46, 139, 87" 124 | keywords["seashell"] = "255, 245, 238" 125 | keywords["sienna"] = "160, 82, 45" 126 | keywords["silver"] = "192, 192, 192" 127 | keywords["skyblue"] = "135, 206, 235" 128 | keywords["slateblue"] = "106, 90, 205" 129 | keywords["slategray"] = "112, 128, 144" 130 | keywords["slategrey"] = "112, 128, 144" 131 | keywords["snow"] = "255, 250, 250" 132 | keywords["springgreen"] = "0, 255, 127" 133 | keywords["steelblue"] = "70, 130, 180" 134 | keywords["tan"] = "210, 180, 140" 135 | keywords["teal"] = "0, 128, 128" 136 | keywords["thistle"] = "216, 191, 216" 137 | keywords["tomato"] = "255, 99, 71" 138 | keywords["turquoise"] = "64, 224, 208" 139 | keywords["violet"] = "238, 130, 238" 140 | keywords["wheat"] = "245, 222, 179" 141 | keywords["white"] = "255, 255, 255" 142 | keywords["whitesmoke"] = "245, 245, 245" 143 | keywords["yellow"] = "255, 255, 0" 144 | keywords["yellowgreen"] = "154, 205, 50" 145 | 146 | keywords["none"] = "0,0,0,0" -- Custom transparent 147 | 148 | return keywords -------------------------------------------------------------------------------- /@Resources/Scripts/FileLoader.lua: -------------------------------------------------------------------------------- 1 | local FileLoadQueue = {} 2 | local IsLoading = false 3 | FileLoadFinishedCallback = {} 4 | 5 | function LoadFilesCallback() 6 | local measure = SKIN:GetMeasure("FileReader") 7 | local files = measure:GetStringValue() 8 | local allFiles = split(files, "\n") 9 | 10 | if #FileLoadQueue > 0 then 11 | local top = FileLoadQueue[1] 12 | top[2](allFiles) 13 | table.remove(FileLoadQueue, 1) 14 | end 15 | 16 | if #FileLoadQueue > 0 then 17 | local top = FileLoadQueue[1] 18 | local path = top[1] 19 | SKIN:Bang("[!SetOption FileReader StartInFolder \"".. path.. "\"][!UpdateMeasure FileReader][!CommandMeasure FileReader Run]") 20 | else 21 | IsLoading = false 22 | for _,j in pairs(FileLoadFinishedCallback) do j() end 23 | end 24 | end 25 | 26 | function LoadFiles(path, functionCallback) 27 | FileLoadQueue[#FileLoadQueue + 1] = {path, functionCallback} 28 | if not IsLoading then 29 | SKIN:Bang("[!SetOption FileReader StartInFolder \"".. path.. "\"][!UpdateMeasure FileReader][!CommandMeasure FileReader Run]") 30 | IsLoading = true 31 | end 32 | end 33 | 34 | function IsFilesLoading() return IsLoading end -------------------------------------------------------------------------------- /@Resources/Scripts/HelperFunctions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | Removes spaces before and after the string 4 | 5 | --]] 6 | function trim(s) 7 | if s == nil then return nil end 8 | return (s:gsub("^%s*(.-)%s*$", "%1")) 9 | end 10 | 11 | --[[ 12 | 13 | Merges two tables, t2 takes priority and will overwrite values in t1 14 | 15 | --]] 16 | 17 | function tableMerge(t1, t2) 18 | for k,v in pairs(t2) do 19 | if type(v) == "table" then 20 | if type(t1[k] or false) == "table" then 21 | t1[k] = tableMerge(t1[k] or {}, t2[k] or {}) 22 | else 23 | t1[k] = v 24 | end 25 | else 26 | t1[k] = v 27 | end 28 | end 29 | return t1 30 | end 31 | 32 | --[[ 33 | 34 | Splits string at separator 35 | 36 | --]] 37 | 38 | function split(inputstr, sep) 39 | if sep == nil then 40 | sep = "%s" 41 | end 42 | local t={} ; i=1 43 | for str in string.gmatch(inputstr, "([^"..sep.."]+)") do 44 | t[i] = str 45 | i = i + 1 46 | end 47 | return t 48 | end 49 | 50 | 51 | --[[ 52 | 53 | No regex, so manual number crunching. 54 | 55 | Takes a string and parses it into a table of numbers 56 | Warning, svg numbers can be very compressed and are therefore quite difficult to parse manually. 57 | e.g "4.2,3.1-2.3-.3,2-3.2" = {4.2, 3.1, -2.3, -0.3, 2, -3.2} 58 | 59 | --]] 60 | 61 | function parseSvgNumbers(parameters) 62 | local parsedNumbers = {} 63 | local pos = 0 64 | while pos <= #parameters do 65 | local prefix = parameters:find("-", pos) 66 | local nextNumberMax = false 67 | if prefix == nil then prefix = #parameters end 68 | 69 | local dot = parameters:find("%.", pos) 70 | if dot == nil then dot = #parameters end 71 | 72 | local number = parameters:find("[%d]+", pos) 73 | if number == nil then number = #parameters end 74 | local strNum = parameters:match("[%d]+", pos) 75 | if strNum ~= nil then 76 | local nextNumber = parameters:find("[%d]+", number + #strNum) 77 | if nextNumber == nil then nextNumber = #parameters nextNumberMax = true end 78 | local nextStrNum = parameters:match("[%d]+", number + #strNum) 79 | 80 | local separator = parameters:find("%s", pos) 81 | if separator == nil then separator = #parameters end 82 | if separator < number then 83 | separator = number + 1 84 | separator = parameters:find("%s", separator) 85 | if separator == nil then separator = #parameters end 86 | end 87 | local separator2 = parameters:find("%,", pos) 88 | if separator2 == nil then separator2 = #parameters end 89 | if separator2 < number then 90 | separator2 = number + 1 91 | separator2 = parameters:find("%,", separator2) 92 | if separator2 == nil then separator2 = #parameters end 93 | end 94 | if separator > separator2 then separator = separator2 end 95 | local nextPrefix = parameters:find("-", prefix+1) 96 | if nextPrefix == nil then nextPrefix = #parameters end 97 | 98 | local usePrefix = prefix < number 99 | local singleDecimal = dot < number 100 | local isDecimal = singleDecimal or ((prefix < number or prefix >= nextNumber) and nextNumber <= nextPrefix and nextNumber <= separator and not nextNumberMax) 101 | local finalNum = 0 102 | local neg = 1 103 | if usePrefix then 104 | neg = -1 105 | end 106 | if singleDecimal then 107 | finalNum = neg * tonumber("0." .. strNum) 108 | pos = number + #strNum 109 | elseif isDecimal then 110 | finalNum = neg * tonumber(strNum .. "." .. nextStrNum) 111 | pos = nextNumber + #nextStrNum 112 | else 113 | finalNum = neg * tonumber(strNum) 114 | pos = number + #strNum 115 | end 116 | parsedNumbers[#parsedNumbers + 1] = finalNum 117 | else 118 | pos = #parameters + 1 119 | end 120 | end 121 | 122 | return parsedNumbers 123 | end 124 | 125 | function tprint (tbl, indent) 126 | if not indent then indent = 0 end 127 | for k, v in pairs(tbl) do 128 | formatting = string.rep(" ", indent) .. k .. ": " 129 | if type(v) == "table" then 130 | print(formatting) 131 | tprint(v, indent+1) 132 | elseif type(v) == "boolean" then 133 | local val = "" 134 | if tprint then val = "true" else val = "false" end 135 | print(formatting.. val) 136 | else 137 | print(formatting .. v) 138 | end 139 | end 140 | end 141 | 142 | function deepcopy(orig) 143 | local orig_type = type(orig) 144 | local copy 145 | if orig_type == 'table' then 146 | copy = {} 147 | for orig_key, orig_value in next, orig, nil do 148 | copy[deepcopy(orig_key)] = deepcopy(orig_value) 149 | end 150 | setmetatable(copy, deepcopy(getmetatable(orig))) 151 | else -- number, string, boolean, etc 152 | copy = orig 153 | end 154 | return copy 155 | end -------------------------------------------------------------------------------- /@Resources/Scripts/ModifierHandler.lua: -------------------------------------------------------------------------------- 1 | 2 | function getModifiers(attributes) -- TODO: ADD MORE MODIFIERS 3 | if attributes == nil then 4 | return attributes 5 | end 6 | local modifiers = {} 7 | modifiers["Special"] = {} 8 | modifiers["Special"]["Display"] = true 9 | 10 | if attributes["style"] ~= nil then 11 | modifiers = dissectInkScape(modifiers, attributes["style"]) 12 | else 13 | modifiers = dissectHTML(modifiers, attributes) 14 | end 15 | return modifiers 16 | end 17 | 18 | function mergeModifiers(groupModifiers, modifiers) 19 | if groupModifiers ~= nil and modifiers ~= nil then 20 | local merged = tableMerge(groupModifiers, modifiers) 21 | return merged 22 | elseif modifiers ~= nil then 23 | return modifiers 24 | elseif groupModifiers ~= nil then 25 | return groupModifiers 26 | end 27 | return {} 28 | end 29 | 30 | function newShape(groupModifiers, attributes) 31 | local modifiers = getModifiers(attributes) 32 | local shape = {} 33 | shape["modifiers"] = mergeModifiers(groupModifiers, modifiers) 34 | return shape 35 | end 36 | 37 | local colorKeywords = dofile(ColorKeywordsPath) 38 | 39 | function getCssColor(color) 40 | if color == nil or type(color) ~= "string" then 41 | return nil 42 | end 43 | 44 | color = trim(color:lower()) 45 | 46 | if colorKeywords[color] ~= nil then 47 | return colorKeywords[color] 48 | elseif color:sub(1, 3) == "rgb" then 49 | return color:gsub("rgb", ""):gsub("%(", ""):gsub("%)", "") 50 | else 51 | color = color:gsub("#", "") 52 | local r = tonumber(color:sub(1, 2), 16) 53 | local g = tonumber(color:sub(3, 4), 16) 54 | local b = tonumber(color:sub(5, 6), 16) 55 | 56 | return "" .. r .. ", " .. g .. ", " .. b 57 | end 58 | if color == "none" then return "0, 0, 0, 0" end 59 | end 60 | 61 | local 62 | 63 | function cssToShapeModifier(modifiers, modifierName, modifierValue) 64 | 65 | if modifierName == nil then return end 66 | if modifierValue == nil then 67 | modifiers[modifierName] = nil 68 | end 69 | 70 | if modifierName == "display" then 71 | if modifierValue == "none" then 72 | modifiers["Special"]["Display"] = false 73 | end 74 | end 75 | 76 | -- These are modifiers with direct bindings 77 | if modifierName == "fill" then modifiers["fill color"] = getCssColor(modifierValue) end 78 | if modifierName == "stroke" then modifiers["stroke color"] = getCssColor(modifierValue) end 79 | if modifierName == "stroke-width" then modifiers["StrokeWidth"] = modifierValue:gsub("px", "") end 80 | 81 | -- These are attributes that can be done, but there is no direct modifier binding to them 82 | if modifierName == "stroke-opacity" then modifiers["Special"]["StrokeOpcaity"] = modifierValue end 83 | if modifierName == "fill-opacity" then modifiers["Special"]["FillOpcaity"] = modifierValue end 84 | 85 | 86 | -- TODO, ADD FILLMODE WHEN WE GET WINDING ;) 87 | 88 | end 89 | 90 | function dissectInkScape(modifiers, style) 91 | local styleParts = split(style, ";") 92 | for i,part in pairs(styleParts) do 93 | local stylePair = split(part, ":") 94 | local styleName = trim(stylePair[1]) 95 | local styleValue = trim(stylePair[2]) 96 | cssToShapeModifier(modifiers, trim(styleName), trim(styleValue)) 97 | 98 | end 99 | return modifiers 100 | end 101 | 102 | function dissectHTML(modifiers, attributes) 103 | for i,j in pairs(attributes) do 104 | cssToShapeModifier(modifiers, trim(i), trim(j)) 105 | end 106 | return modifiers 107 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/A.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Arc segment is one or multiple arcs 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 7 do 14 | local rx = tonumber(parameters[i]) 15 | local ry = tonumber(parameters[i+1]) 16 | local rotationAngle = tonumber(parameters[i+2]) 17 | local arcSize = tonumber(parameters[i+3]) 18 | local sweep = tonumber(parameters[i+4]) 19 | sweep = 1 - sweep 20 | local x = tonumber(parameters[i+5]) 21 | local y = tonumber(parameters[i+6]) 22 | if relative then 23 | x = x + pen.X 24 | y = y + pen.Y 25 | end 26 | 27 | shape["path"] = shape["path"] .. " | ArcTo " .. x .. ", " .. y .. ", " .. rx .. ", " .. ry .. ", " .. rotationAngle .. ", " .. sweep .. ", " .. arcSize 28 | 29 | lastControlX = nil 30 | lastControlY = nil 31 | lastQuadraticX = nil 32 | lastQuadraticY = nil 33 | pen.X = x 34 | pen.Y = y 35 | end 36 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/C.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Curve segment is one or multiple bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 6 do 14 | --if parameters[i] ~= nil and parameters[i+1] ~= nil and parameters[i+2] ~= nil and parameters[i+3] ~= nil and parameters[i+4] ~= nil and parameters[i+5] ~= nil then 15 | local x1 = tonumber(parameters[i]) 16 | local y1 = tonumber(parameters[i+1]) 17 | local x2 = tonumber(parameters[i+2]) 18 | local y2 = tonumber(parameters[i+3]) 19 | local x = tonumber(parameters[i+4]) 20 | local y = tonumber(parameters[i+5]) 21 | if relative then 22 | x1 = x1 + pen.X 23 | y1 = y1 + pen.Y 24 | x2 = x2 + pen.X 25 | y2 = y2 + pen.Y 26 | x = x + pen.X 27 | y = y + pen.Y 28 | end 29 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. x1 .. ", " .. y1 .. ", " .. x2 .. ", " .. y2 30 | if relative then 31 | x = x - pen.X 32 | y = y - pen.Y 33 | x2 = x2 - pen.X 34 | y2 = y2 - pen.Y 35 | end 36 | lastControlX = x2 + (x - x2) * 2 37 | lastControlY = y2 + (y - y2) * 2 38 | lastQuadraticX = nil 39 | lastQuadraticY = nil 40 | 41 | if relative then 42 | x = x + pen.X 43 | y = y + pen.Y 44 | lastControlX = lastControlX + pen.X 45 | lastControlY = lastControlY + pen.Y 46 | end 47 | pen.X = x 48 | pen.Y = y 49 | --else 50 | -- print("Invalid bezier curve ", parameters[i], parameters[i+1], parameters[i+2], parameters[i+3], parameters[i+4], parameters[i+5]) 51 | --end 52 | end 53 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/H.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Horizontal LineTo segment is one or multiple horizontal lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters do 14 | local x = tonumber(parameters[i]) 15 | if relative then 16 | x = x + pen.X 17 | end 18 | shape["path"] = shape["path"] .. " | LineTo " .. x .. ", " .. pen.Y 19 | pen.X = x 20 | lastControlX = x2 21 | lastControlY = y2 22 | lastQuadraticX = nil 23 | lastQuadraticY = nil 24 | end 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/L.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the LineTo segment is one or multiple lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 2 do 14 | local x = tonumber(parameters[i]) 15 | local y = tonumber(parameters[i+1]) 16 | if relative then 17 | x = x + pen.X 18 | y = y + pen.Y 19 | end 20 | shape["path"] = shape["path"] .. " | LineTo " .. x .. ", " .. y 21 | pen.X = x 22 | pen.Y = y 23 | lastControlX = x2 24 | lastControlY = y2 25 | lastQuadraticX = nil 26 | lastQuadraticY = nil 27 | end 28 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/M.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | MoveTo segment, this indicates where the path should start and is the same as lifting the pen and moving it to a new location. (e.g starting a new Path shape) 4 | 5 | Note: additional parameters after the initial point is counted as LineTo, hence the "pathSegments:L()" 6 | 7 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 8 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 9 | shape - the current shape 10 | relative - is this relative to the last pen location 11 | 12 | --]] 13 | 14 | return function (parameters, pen, shape, relative) 15 | local x = tonumber(parameters[1]) 16 | local y = tonumber(parameters[2]) 17 | if relative then 18 | x = x + pen.X 19 | y = y + pen.Y 20 | end 21 | local moveShape = nil 22 | if shape["path"] ~= nil and trim(shape["path"]) ~= "" then 23 | local newShape = {} 24 | newShape["modifiers"] = deepcopy(shape["modifiers"]) 25 | newShape["shape"] = "Path Path" .. nextPath 26 | nextPath = nextPath + 1 27 | moveShape = newShape 28 | else 29 | moveShape = shape 30 | end 31 | moveShape["path"] = x .. ", " .. y 32 | pen.X = x 33 | pen.Y = y 34 | lastControlX = x2 35 | lastControlY = y2 36 | lastQuadraticX = nil 37 | lastQuadraticY = nil 38 | table.remove(parameters, 1) 39 | table.remove(parameters, 1) 40 | pathSegments.L(parameters, pen, moveShape, relative) 41 | return moveShape 42 | end 43 | -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/Q.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Quadratic Curve segment is one or multiple quadratic bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 4 do 14 | local x1 = tonumber(parameters[i]) 15 | local y1 = tonumber(parameters[i+1]) 16 | local x = tonumber(parameters[i+2]) 17 | local y = tonumber(parameters[i+3]) 18 | if relative then 19 | x1 = x1 + pen.X 20 | y1 = y1 + pen.Y 21 | x = x + pen.X 22 | y = y + pen.Y 23 | end 24 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. x1 .. ", " .. y1 25 | if relative then 26 | x = x - pen.X 27 | y = y - pen.Y 28 | x1 = x1 - pen.X 29 | y1 = y1 - pen.Y 30 | end 31 | lastControlX = nil 32 | lastControlY = nil 33 | lastQuadraticX = x1 + (x - x1) * 2 34 | lastQuadraticY = y1 + (y - y1) * 2 35 | 36 | if relative then 37 | x = x + pen.X 38 | y = y + pen.Y 39 | lastQuadraticX = lastQuadraticX + pen.X 40 | lastQuadraticY = lastQuadraticY + pen.Y 41 | end 42 | pen.X = x 43 | pen.Y = y 44 | end 45 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/S.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Simple Curve segment is one or multiple simplified bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 4 do 14 | local x2 = tonumber(parameters[i]) 15 | local y2 = tonumber(parameters[i+1]) 16 | local x = tonumber(parameters[i+2]) 17 | local y = tonumber(parameters[i+3]) 18 | if relative then 19 | x2 = x2 + pen.X 20 | y2 = y2 + pen.Y 21 | x = x + pen.X 22 | y = y + pen.Y 23 | end 24 | 25 | if lastControlX == nil then 26 | lastControlX = x2 27 | end 28 | if lastControlY == nil then 29 | lastControlY = y2 30 | end 31 | 32 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. lastControlX .. ", " .. lastControlY .. ", " .. x2 .. ", " .. y2 33 | 34 | if relative then 35 | x = x - pen.X 36 | y = y - pen.Y 37 | x2 = x2 - pen.X 38 | y2 = y2 - pen.Y 39 | end 40 | lastControlX = x2 + (x - x2) * 2 41 | lastControlY = y2 + (y - y2) * 2 42 | lastQuadraticX = nil 43 | lastQuadraticY = nil 44 | 45 | if relative then 46 | x = x + pen.X 47 | y = y + pen.Y 48 | lastControlX = lastControlX + pen.X 49 | lastControlY = lastControlY + pen.Y 50 | end 51 | 52 | pen.X = x 53 | pen.Y = y 54 | end 55 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/T.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Simplified Quadratic Curve segment is one or multiple simple quadratic bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function(parameters, pen, shape, relative) 13 | for i=1, #parameters, 2 do 14 | local x = tonumber(parameters[i]) 15 | local y = tonumber(parameters[i+1]) 16 | if relative then 17 | x = x + pen.X 18 | y = y + pen.Y 19 | end 20 | 21 | if lastQuadraticX == nil then 22 | lastQuadraticX = x2 23 | end 24 | if lastQuadraticY == nil then 25 | lastQuadraticY = y2 26 | end 27 | 28 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. lastQuadraticX .. ", " .. lastQuadraticY 29 | 30 | if relative then 31 | x = x - pen.X 32 | y = y - pen.Y 33 | end 34 | lastControlX = nil 35 | lastControlY = nil 36 | lastQuadraticX = lastQuadraticX + (x - lastQuadraticX) * 2 37 | lastQuadraticY = lastQuadraticY + (y - lastQuadraticY) * 2 38 | 39 | if relative then 40 | x = x + pen.X 41 | y = y + pen.Y 42 | lastControlX = lastControlX + pen.X 43 | lastControlY = lastControlY + pen.Y 44 | end 45 | 46 | pen.X = x 47 | pen.Y = y 48 | end 49 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/V.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Vertical LineTo segment is one or multiple vertical lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters do 14 | local y = tonumber(parameters[i]) 15 | if relative then 16 | y = y + pen.Y 17 | end 18 | shape["path"] = shape["path"] .. " | LineTo " .. pen.X .. ", " .. y 19 | pen.Y = y 20 | lastControlX = x2 21 | lastControlY = y2 22 | lastQuadraticX = nil 23 | lastQuadraticY = nil 24 | end 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/PathTypes/Z.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the close path segment closes the path. 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | shape["path"] = shape["path"] .. " | ClosePath 1" 14 | lastControlX = x2 15 | lastControlY = y2 16 | lastQuadraticX = nil 17 | lastQuadraticY = nil 18 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/circle.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | local shape = newShape(groupModifiers, attributes) 15 | local x = attributes["cx"] 16 | local y = attributes["cy"] 17 | local r = attributes["r"] 18 | shape["shape"] = "Ellipse " .. x .. ", " .. y .. ", " .. r 19 | local class = attributes["class"] 20 | if shapeStyles[class] ~= nil then 21 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 22 | end 23 | shapes[#shapes+1] = shape 24 | return shapes 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/defs.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag that can be used in the .svg format 4 | This is probably not fully implemented as i'm only sending the tag that appears here into the parser again to be handled in style.lua 5 | 6 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 7 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 8 | children - All the tags inside the current tag 9 | groupModifiers - These are modifiers that is applied through inheritence by the tag 10 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 11 | 12 | ]] 13 | 14 | return function (shapes, attributes, children, groupModifiers, value) 15 | --for i, j in pairs(children) do 16 | -- shapes = getShape(j, shapes, groupModifiers) 17 | --end 18 | 19 | --TODO: this 20 | return shapes 21 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/g.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag, which styles it's children. 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) -- group 14 | debugPrint("group") 15 | if children ~= nil then 16 | local mods = getModifiers(attributes) 17 | groupModifiers = mergeModifiers(groupModifiers, mods) 18 | local class = attributes["class"] 19 | if shapeStyles[class] ~= nil then 20 | groupModifiers = mergeModifiers(groupModifiers, shapeStyles[class]) 21 | end 22 | for i, j in pairs(children) do 23 | shapes = getShape(j, shapes, groupModifiers) 24 | end 25 | end 26 | return shapes 27 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/path.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | Note: This is a pretty advanced tag, and i've therefore made the segments into modules inside #@#Scripts/PathTypes 6 | 7 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 8 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 9 | children - All the tags inside the current tag 10 | groupModifiers - These are modifiers that is applied through inheritence by the tag 11 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 12 | 13 | --]] 14 | 15 | -- Table where the functions of all the path types are stored 16 | pathSegments = {} 17 | 18 | --These are used for the C, S, Q and T segments, used to calculate the S and T control points 19 | lastControlX = nil 20 | lastControlY = nil 21 | lastQuadraticX = nil 22 | lastQuadraticY = nil 23 | 24 | local pathSegmentDir = SKIN:ReplaceVariables("#@#Scripts\\PathTypes\\") 25 | 26 | local function LoadPathSegments(files) 27 | for id, file in pairs(files) do 28 | fileName = split(file, ".")[1] 29 | pathSegments[fileName] = dofile(pathSegmentDir .. file) 30 | end 31 | end 32 | 33 | LoadFiles(pathSegmentDir, LoadPathSegments) 34 | 35 | function parsePath(input) 36 | local out = {}; 37 | 38 | for instr, vals in input:gmatch("([a-df-zA-DF-Z])([^a-df-zA-DF-Z]*)") do 39 | local line = { instr }; 40 | local carry = nil 41 | for v in vals:gmatch("([+-]?[%deE.]+)") do 42 | if v:match("[eE]") then 43 | carry = v 44 | else 45 | if carry then 46 | line[#line+1] = carry .. v; 47 | carry = nil 48 | else 49 | line[#line+1] = v; 50 | end 51 | end 52 | 53 | end 54 | out[#out+1] = line; 55 | end 56 | return out; 57 | end 58 | 59 | 60 | return function (shapes, attributes, children, groupModifiers, value) 61 | local shape = newShape(groupModifiers, attributes) 62 | local class = attributes["class"] 63 | if shapeStyles[class] ~= nil then 64 | shape["modifiers"] = mergeModifiers(shapeStyles[class], shape["modifiers"]) 65 | end 66 | shape["shape"] = "Path Path" .. nextPath 67 | nextPath = nextPath + 1 68 | --local path = trim(attributes["d"]:gsub("%s+", " ")) 69 | local pen = {X = 0, Y = 0} 70 | 71 | local combine = "" 72 | local fistCombine = true 73 | local shapeCount = 0 74 | local iterations = 0 75 | 76 | local special = shape["modifiers"]["Special"] 77 | 78 | local segments = parsePath(attributes["d"]) 79 | for i=1, #segments do 80 | local parameters = segments[i] 81 | local char = parameters[1] 82 | table.remove(parameters, 1) 83 | 84 | if pathSegments[char:upper()] ~= nil then 85 | local relative = char:lower() == char 86 | local nextShape = pathSegments[char:upper()](parameters, pen, shape, relative) 87 | 88 | if nextShape ~= nil and nextShape ~= shape then 89 | if fistCombine then 90 | combine = "Combine Shape" .. (#shapes + 1) 91 | fistCombine = false 92 | else 93 | combine = combine .. " | XOR Shape" .. (#shapes + 1) 94 | shape["modifiers"] = {} 95 | shape["modifiers"]["Special"] = special 96 | end 97 | shapes[#shapes+1] = shape 98 | shape = nextShape 99 | shapeCount = shapeCount + 1 100 | end 101 | else 102 | print("Path segment by type " .. char:upper() .. " does not exist!") 103 | end 104 | iterations = iterations + 1 105 | end 106 | 107 | if shape["shape"] ~= nil and trim(shape["shape"]) ~= "" and iterations > 1 then 108 | if fistCombine then 109 | combine = "Combine Shape" .. (#shapes + 1) 110 | fistCombine = false 111 | else 112 | combine = combine .. " | XOR Shape" .. (#shapes + 1) 113 | shape["modifiers"] = {} 114 | shape["modifiers"]["Special"] = special 115 | end 116 | shapes[#shapes+1] = shape 117 | shape = nextShape 118 | shapeCount = shapeCount + 1 119 | else 120 | nextPath = nextPath - 1 121 | end 122 | 123 | if combine ~= "" and shapeCount > 1 then 124 | local combinedShape = {modifiers = {}} 125 | combinedShape["shape"] = combine 126 | combinedShape["modifiers"]["Special"] = special 127 | combinedShape["combined"] = true 128 | shapes[#shapes+1] = combinedShape 129 | end 130 | 131 | return shapes 132 | end 133 | -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/polygon.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | 15 | local shape = newShape(groupModifiers, attributes) 16 | local class = attributes["class"] 17 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 18 | debugPrint("polygon") 19 | local parameters = attributes["points"] 20 | parameters = trim(parameters:gsub("%s+", " ")) 21 | 22 | parameters = parseSvgNumbers(parameters) 23 | 24 | local path = "" 25 | local first = true 26 | for i=1, #parameters, 2 do 27 | local x = tonumber(parameters[i]) 28 | local y = tonumber(parameters[i+1]) 29 | if first then 30 | path = path .. x .. ", " .. y 31 | first = false 32 | else 33 | path = path .. " | LineTo " .. x .. ", " .. y 34 | end 35 | end 36 | path = path .. " | ClosePath 1" 37 | 38 | shape["shape"] = "Path Path"..nextPath 39 | shape["path"] = path 40 | nextPath = nextPath + 1 41 | 42 | local class = attributes["class"] 43 | if shapeStyles[class] ~= nil then 44 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 45 | end 46 | 47 | shapes[#shapes+1] = shape 48 | return shapes 49 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/rect.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | local shape = newShape(groupModifiers, attributes) 15 | local x = attributes["x"] 16 | if x == nil then x = 0 end 17 | local y = attributes["y"] 18 | if y == nil then y = 0 end 19 | local w = attributes["width"] 20 | local h = attributes["height"] 21 | shape["shape"] = "Rectangle " .. x .. ", " .. y .. ", " .. w .. ", " .. h 22 | local class = attributes["class"] 23 | if shapeStyles[class] ~= nil then 24 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 25 | end 26 | shapes[#shapes+1] = shape 27 | return shapes 28 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/style.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | handles the tag in the .svg, and saves them to the shapeStyles table to be fetched later. 4 | 5 | Note: only classes are handled for now, i assume that ids will probably appear, but i have yet to implement that 6 | 7 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 8 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 9 | children - All the tags inside the current tag 10 | groupModifiers - These are modifiers that is applied through inheritence by the tag 11 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 12 | 13 | --]] 14 | 15 | return function (shapes, attributes, children, groupModifiers, value) 16 | local firstSplit = split(value, "}") 17 | for i, stylePart in pairs(firstSplit) do 18 | local idContentPair = split(stylePart, "{") 19 | local ids = split(idContentPair[1], ",") 20 | for j, id in pairs(ids) do 21 | local id = trim(id):sub(2) 22 | local content = idContentPair[2] 23 | local att = {} 24 | att["style"] = content 25 | local modifiers = getModifiers(att) 26 | shapeStyles[id] = mergeModifiers(modifiers, shapeStyles[id]) 27 | end 28 | end 29 | return shapes 30 | end -------------------------------------------------------------------------------- /@Resources/Scripts/SvgTypes/svg.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag, which declares that the following is a svg shape 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | ]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | debugPrint("svg", children, attributes) 15 | if children == nil then 16 | print(ErrorEmptySVG) 17 | return nil 18 | end 19 | if attributes == nil then 20 | print(CorruptSVG) 21 | return nil 22 | end 23 | 24 | if attributes["viewBox"] ~= nil then 25 | local view = split(attributes["viewBox"], " ") 26 | local x = view[1] 27 | local y = view[2] 28 | local width = view[3] 29 | local height = view[4] 30 | shapes["X"] = tostring(-tonumber(x)) 31 | shapes["Y"] = tostring(-tonumber(y)) 32 | shapes["width"] = width 33 | shapes["height"] = height 34 | end 35 | 36 | for i, j in pairs(children) do 37 | shapes = getShape(j, shapes, groupModifiers) 38 | end 39 | return shapes 40 | end -------------------------------------------------------------------------------- /@Resources/Scripts/XmlParser.lua: -------------------------------------------------------------------------------- 1 | -- Code from: http://lua-users.org/wiki/LuaXml 2 | ----------------------------------------------------------------------------------------- 3 | -- LUA only XmlParser from Alexander Makeev 4 | ----------------------------------------------------------------------------------------- 5 | -- Using this code "As Is" 6 | -- Jaya Polumuru 7 | 8 | XmlParser = {}; 9 | 10 | function XmlParser:ToXmlString(value) 11 | value = string.gsub (value, "&", "&"); -- '&' -> "&" 12 | value = string.gsub (value, "<", "<"); -- '<' -> "<" 13 | value = string.gsub (value, ">", ">"); -- '>' -> ">" 14 | --value = string.gsub (value, "'", "'"); -- '\'' -> "'" 15 | value = string.gsub (value, "\"", """); -- '"' -> """ 16 | -- replace non printable char -> " " 17 | value = string.gsub(value, "([^%w%&%;%p%\t% ])", 18 | function (c) 19 | return string.format("&#x%X;", string.byte(c)) 20 | --return string.format("&#x%02X;", string.byte(c)) 21 | --return string.format("&#%02d;", string.byte(c)) 22 | end); 23 | return value; 24 | end 25 | 26 | function XmlParser:FromXmlString(value) 27 | value = string.gsub(value, "&#x([%x]+)%;", 28 | function(h) 29 | return string.char(tonumber(h,16)) 30 | end); 31 | value = string.gsub(value, "&#([0-9]+)%;", 32 | function(h) 33 | return string.char(tonumber(h,10)) 34 | end); 35 | value = string.gsub (value, """, "\""); 36 | value = string.gsub (value, "'", "'"); 37 | value = string.gsub (value, ">", ">"); 38 | value = string.gsub (value, "<", "<"); 39 | value = string.gsub (value, "&", "&"); 40 | return value; 41 | end 42 | 43 | function XmlParser:ParseArgs(s) 44 | local arg = {} 45 | string.gsub(s, "(%w*%-?%w+)=([\"'])(.-)%2", function (w, _, a) 46 | arg[w] = XmlParser:FromXmlString(a); 47 | end) 48 | return arg 49 | end 50 | 51 | function XmlParser:ParseXmlText(xmlText) 52 | local stack = {} 53 | local top = {Name=nil,Value=nil,Attributes={},ChildNodes={}} 54 | table.insert(stack, top) 55 | local ni,c,label,xarg, empty 56 | local i, j = 1, 1 57 | while true do 58 | ni,j,c,label,xarg, empty = string.find(xmlText, "<(%/?)([%w:]+)(.-)(%/?)>", i) 59 | if not ni then break end 60 | local text = string.sub(xmlText, i, ni-1); 61 | if not string.find(text, "^%s*$") then 62 | top.Value=(top.Value or "")..XmlParser:FromXmlString(text); 63 | end 64 | if empty == "/" then -- empty element tag 65 | -- print ("Label:" .. label) -- comment these out 66 | table.insert(top.ChildNodes, {Name=label,Value=nil,Attributes=XmlParser:ParseArgs(xarg),ChildNodes={}}) 67 | elseif c == "" then -- start tag 68 | top = {Name=label, Value=nil, Attributes=XmlParser:ParseArgs(xarg), ChildNodes={}} 69 | table.insert(stack, top) -- new level 70 | -- print("openTag ="..top.Name); -- comment these out 71 | else -- end tag 72 | local toclose = table.remove(stack) -- remove top 73 | -- print("closeTag="..toclose.Name); -- comment these out 74 | top = stack[#stack] 75 | if #stack < 1 then 76 | error("XmlParser: nothing to close with "..label) 77 | end 78 | if toclose.Name ~= label then 79 | error("XmlParser: trying to close "..toclose.Name.." with "..label) 80 | end 81 | table.insert(top.ChildNodes, toclose) 82 | end 83 | i = j+1 84 | end 85 | local text = string.sub(xmlText, i); 86 | if not string.find(text, "^%s*$") then 87 | stack[#stack].Value=(stack[#stack].Value or "")..XmlParser:FromXmlString(text); 88 | end 89 | if #stack > 1 then 90 | error("XmlParser: unclosed "..stack[stack.n].Name) 91 | end 92 | return stack[1].ChildNodes[1]; 93 | end 94 | 95 | function XmlParser:ParseXmlFile(xmlFileName) 96 | local hFile,err = io.open(xmlFileName,"r"); 97 | if (not err) then 98 | local xmlText=hFile:read("*a"); -- read file content 99 | io.close(hFile); 100 | return XmlParser:ParseXmlText(xmlText),nil; 101 | else 102 | return nil,err; 103 | end 104 | end 105 | ------------------------------------------------------------------------------------------ 106 | --example: 107 | 108 | function dump(resourceFile, _class, no_func, depth) 109 | if(not _class) then 110 | print("nil"); 111 | return; 112 | end 113 | 114 | if(depth==nil) then depth=0; end 115 | local str=""; 116 | for n=0,depth,1 do 117 | str=str.."\t"; 118 | end 119 | 120 | resourceFile:write(str.."["..type(_class).."]\n"); 121 | resourceFile:write(str.."{\n"); 122 | 123 | for i,field in pairs(_class) do 124 | if(type(field)=="table") then 125 | resourceFile:write(str.."\t"..tostring(i).." =".."\n"); 126 | dump(resourceFile, field, no_func, depth+1); 127 | else 128 | if(type(field)=="number") then 129 | resourceFile:write(str.."\t"..tostring(i).."="..field.."\n"); 130 | elseif(type(field) == "string") then 131 | resourceFile:write(str.."\t"..tostring(i).."=".."\""..field.."\"\n"); 132 | elseif(type(field) == "boolean") then 133 | resourceFile:write(str.."\t"..tostring(i).."=".."\""..tostring(field).."\"\n"); 134 | else 135 | if(not no_func)then 136 | if(type(field)=="function")then 137 | resourceFile:write(str.."\t"..tostring(i).."()\n"); 138 | else 139 | resourceFile:write(str.."\t"..tostring(i).."\n"); 140 | end 141 | end 142 | end 143 | end 144 | end 145 | resourceFile:write(str.."}\n"); 146 | end 147 | 148 | return XmlParser -------------------------------------------------------------------------------- /@Resources/Scripts/lol/ColorKeywords.lua: -------------------------------------------------------------------------------- 1 | local keywords = {} 2 | 3 | keywords["aliceblue"] = "240, 248, 255" 4 | keywords["antiquewhite"] = "250, 235, 215" 5 | keywords["aqua"] = "0, 255, 255" 6 | keywords["aquamarine"] = "127, 255, 212" 7 | keywords["azure"] = "240, 255, 255" 8 | keywords["beige"] = "245, 245, 220" 9 | keywords["bisque"] = "255, 228, 196" 10 | keywords["black"] = "0, 0, 0" 11 | keywords["blanchedalmond"] = "255, 235, 205" 12 | keywords["blue"] = "0, 0, 255" 13 | keywords["blueviolet"] = "138, 43, 226" 14 | keywords["brown"] = "165, 42, 42" 15 | keywords["burlywood"] = "222, 184, 135" 16 | keywords["cadetblue"] = "95, 158, 160" 17 | keywords["chartreuse"] = "127, 255, 0" 18 | keywords["chocolate"] = "210, 105, 30" 19 | keywords["coral"] = "255, 127, 80" 20 | keywords["cornflowerblue"] = "100, 149, 237" 21 | keywords["cornsilk"] = "255, 248, 220" 22 | keywords["crimson"] = "220, 20, 60" 23 | keywords["cyan"] = "0, 255, 255" 24 | keywords["darkblue"] = "0, 0, 139" 25 | keywords["darkcyan"] = "0, 139, 139" 26 | keywords["darkgoldenrod"] = "184, 134, 11" 27 | keywords["darkgray"] = "169, 169, 169" 28 | keywords["darkgreen"] = "0, 100, 0" 29 | keywords["darkgrey"] = "169, 169, 169" 30 | keywords["darkkhaki"] = "189, 183, 107" 31 | keywords["darkmagenta"] = "139, 0, 139" 32 | keywords["darkolivegreen"] = "85, 107, 47" 33 | keywords["darkorange"] = "255, 140, 0" 34 | keywords["darkorchid"] = "153, 50, 204" 35 | keywords["darkred"] = "139, 0, 0" 36 | keywords["darksalmon"] = "233, 150, 122" 37 | keywords["darkseagreen"] = "143, 188, 143" 38 | keywords["darkslateblue"] = "72, 61, 139" 39 | keywords["darkslategray"] = "47, 79, 79" 40 | keywords["darkturquoise"] = "0, 206, 209" 41 | keywords["darkviolet"] = "148, 0, 211" 42 | keywords["deeppink"] = "255, 20, 147" 43 | keywords["deepskyblue"] = "0, 191, 255" 44 | keywords["dimgray"] = "105, 105, 105" 45 | keywords["dodgerblue"] = "30, 144, 255" 46 | keywords["firebrick"] = "178, 34, 34" 47 | keywords["floralwhite"] = "255, 250, 240" 48 | keywords["forestgreen"] = "34, 139, 34" 49 | keywords["fuchsia"] = "255, 0, 255" 50 | keywords["gainsboro"] = "220, 220, 220" 51 | keywords["ghostwhite"] = "248, 248, 255" 52 | keywords["gold"] = "255, 215, 0" 53 | keywords["goldenrod"] = "218, 165, 32" 54 | keywords["gray"] = "128, 128, 128" 55 | keywords["green"] = "0, 128, 0" 56 | keywords["greenyellow"] = "173, 255, 47" 57 | keywords["honeydew"] = "240, 255, 240" 58 | keywords["hotpink"] = "255, 105, 180" 59 | keywords["indianred"] = "205, 92, 92" 60 | keywords["indigo"] = "75, 0, 130" 61 | keywords["ivory"] = "255, 255, 240" 62 | keywords["khaki"] = "240, 230, 140" 63 | keywords["lavender"] = "230, 230, 250" 64 | keywords["lavenderblush"] = "255, 240, 245" 65 | keywords["lawngreen"] = "124, 252, 0" 66 | keywords["lemonchiffon"] = "255, 250, 205" 67 | keywords["lightblue"] = "173, 216, 230" 68 | keywords["lightcoral"] = "240, 128, 128" 69 | keywords["lightcyan"] = "224, 255, 255" 70 | keywords["lightgoldenrodyellow"] = "250, 250, 210" 71 | keywords["lightgray"] = "211, 211, 211" 72 | keywords["lightgreen"] = "144, 238, 144" 73 | keywords["lightpink"] = "255, 182, 193" 74 | keywords["lightsalmon"] = "255, 160, 122" 75 | keywords["lightseagreen"] = "32, 178, 170" 76 | keywords["lightskyblue"] = "135, 206, 250" 77 | keywords["lightslategray"] = "119, 136, 153" 78 | keywords["lightsteelblue"] = "176, 196, 222" 79 | keywords["lightyellow"] = "255, 255, 224" 80 | keywords["lime"] = "0, 255, 0" 81 | keywords["limegreen"] = "50, 205, 50" 82 | keywords["linen"] = "250, 240, 230" 83 | keywords["magenta"] = "255, 0, 255" 84 | keywords["maroon"] = "128, 0, 0" 85 | keywords["mediumaquamarine"] = "102, 205, 170" 86 | keywords["mediumblue"] = "0, 0, 205" 87 | keywords["mediumorchid"] = "186, 85, 211" 88 | keywords["mediumpurple"] = "147, 112, 219" 89 | keywords["mediumseagreen"] = "60, 179, 113" 90 | keywords["mediumslateblue"] = "123, 104, 238" 91 | keywords["mediumspringgreen"] = "0, 250, 154" 92 | keywords["mediumturquoise"] = "72, 209, 204" 93 | keywords["mediumvioletred"] = "199, 21, 133" 94 | keywords["midnightblue"] = "25, 25, 112" 95 | keywords["mintcream"] = "245, 255, 250" 96 | keywords["mistyrose"] = "255, 228, 225" 97 | keywords["moccasin"] = "255, 228, 181" 98 | keywords["navajowhite"] = "255, 222, 173" 99 | keywords["navy"] = "0, 0, 128" 100 | keywords["oldlace"] = "253, 245, 230" 101 | keywords["olive"] = "128, 128, 0" 102 | keywords["olivedrab"] = "107, 142, 35" 103 | keywords["orange"] = "255, 165, 0" 104 | keywords["orangered"] = "255, 69, 0" 105 | keywords["orchid"] = "218, 112, 214" 106 | keywords["palegoldenrod"] = "238, 232, 170" 107 | keywords["palegreen"] = "152, 251, 152" 108 | keywords["paleturquoise"] = "175, 238, 238" 109 | keywords["palevioletred"] = "219, 112, 147" 110 | keywords["papayawhip"] = "255, 239, 213" 111 | keywords["peachpuff"] = "255, 218, 185" 112 | keywords["peru"] = "205, 133, 63" 113 | keywords["pink"] = "255, 192, 203" 114 | keywords["plum"] = "221, 160, 221" 115 | keywords["powderblue"] = "176, 224, 230" 116 | keywords["purple"] = "128, 0, 128" 117 | keywords["red"] = "255, 0, 0" 118 | keywords["rosybrown"] = "188, 143, 143" 119 | keywords["royalblue"] = "65, 105, 225" 120 | keywords["saddlebrown"] = "139, 69, 19" 121 | keywords["salmon"] = "250, 128, 114" 122 | keywords["sandybrown"] = "244, 164, 96" 123 | keywords["seagreen"] = "46, 139, 87" 124 | keywords["seashell"] = "255, 245, 238" 125 | keywords["sienna"] = "160, 82, 45" 126 | keywords["silver"] = "192, 192, 192" 127 | keywords["skyblue"] = "135, 206, 235" 128 | keywords["slateblue"] = "106, 90, 205" 129 | keywords["slategray"] = "112, 128, 144" 130 | keywords["slategrey"] = "112, 128, 144" 131 | keywords["snow"] = "255, 250, 250" 132 | keywords["springgreen"] = "0, 255, 127" 133 | keywords["steelblue"] = "70, 130, 180" 134 | keywords["tan"] = "210, 180, 140" 135 | keywords["teal"] = "0, 128, 128" 136 | keywords["thistle"] = "216, 191, 216" 137 | keywords["tomato"] = "255, 99, 71" 138 | keywords["turquoise"] = "64, 224, 208" 139 | keywords["violet"] = "238, 130, 238" 140 | keywords["wheat"] = "245, 222, 179" 141 | keywords["white"] = "255, 255, 255" 142 | keywords["whitesmoke"] = "245, 245, 245" 143 | keywords["yellow"] = "255, 255, 0" 144 | keywords["yellowgreen"] = "154, 205, 50" 145 | 146 | keywords["none"] = "0,0,0,0" -- Custom transparent 147 | 148 | return keywords -------------------------------------------------------------------------------- /@Resources/Scripts/lol/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else -- number, string, boolean, etc 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) -- Someone tell me why tf i need this nil here... 32 | end 33 | return shapes 34 | end 35 | 36 | --------------------------------------------------- The things above this will probably be moved to a separate file ;) 37 | 38 | function xmlToShape(svgFile) 39 | 40 | local xml = XmlParser:ParseXmlFile(svgFile) 41 | if xml["Name"] ~= "svg" then 42 | print("Invalid svg file: ", svgFile) 43 | return nil 44 | end 45 | nextPath = 1 46 | style = {} 47 | endShapes = getShape(xml, {}, {}) 48 | return endShapes 49 | end 50 | 51 | 52 | 53 | function Initialize() 54 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 55 | 56 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 57 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 58 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 59 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 60 | 61 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 62 | 63 | local SvgLoad = function(files) 64 | for id, file in pairs(files) do 65 | fileName = split(file, ".")[1] 66 | svgTypes[fileName] = dofile(dir .. file) 67 | end 68 | print("Svg components initialized") 69 | 70 | end 71 | 72 | LoadFiles(dir, SvgLoad) 73 | end 74 | 75 | function ConvertFile() 76 | local path = SKIN:ReplaceVariables("#CurrentTextboxFile#") 77 | local shapes = xmlToShape(path) 78 | local xOffsett = shapes["X"] 79 | local yOffsett = shapes["Y"] 80 | 81 | local paths = {} 82 | 83 | local meterOptions = "" 84 | 85 | local X = 0 86 | local Y = 0 87 | 88 | if xOffsett ~= nil then 89 | X = X + tonumber(xOffsett) 90 | end 91 | 92 | if yOffsett ~= nil then 93 | Y = Y + tonumber(yOffsett) 94 | end 95 | countshape = 0 96 | for i,shape in pairs(shapes) do 97 | if shape["shape"] == nil then 98 | --print("ERROR IN SHAPE") 99 | else 100 | if shape["modifiers"]["Special"]["Display"] then 101 | local shapeName = "[!SetOption Shape Shape" 102 | if i ~= 1 then shapeName = shapeName .. i end 103 | meterOptions = meterOptions .. shapeName .. " \"" .. shape["shape"] 104 | 105 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 106 | if modifierName ~= "Special" then 107 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 108 | end 109 | end 110 | 111 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 112 | meterOptions = meterOptions .. " | StrokeWidth 0" 113 | end 114 | 115 | meterOptions = meterOptions .. "\"]" 116 | 117 | if shape["path"] ~= nil then 118 | paths[#paths+1] = shape["path"] 119 | end 120 | end 121 | countshape = countshape + 1 122 | end 123 | end 124 | countpath = 0 125 | for i, path in pairs(paths) do 126 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 127 | countpath = countpath + 1 128 | end 129 | SKIN:Bang(meterOptions) 130 | local meterOptions = meterOptions:gsub("\n", "#CRLF#") 131 | --SKIN:Bang("[!WriteKeyValue Variables CurrentTextboxFile \"\"]") 132 | --SKIN:Bang("[!SetOption CodeStr Text \"" .. meterOptions .. "\"][!UpdateMeter *][!Redraw]") 133 | end 134 | 135 | function ClearAllShapePath() 136 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 137 | for i=2,countshape do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 138 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 139 | end 140 | -------------------------------------------------------------------------------- /@Resources/Scripts/lol/FileLoader.lua: -------------------------------------------------------------------------------- 1 | local FileLoadQueue = {} 2 | local IsLoading = false 3 | FileLoadFinishedCallback = {} 4 | 5 | function LoadFilesCallback() 6 | local measure = SKIN:GetMeasure("FileReader") 7 | local files = measure:GetStringValue() 8 | local allFiles = split(files, "\n") 9 | 10 | if #FileLoadQueue > 0 then 11 | local top = FileLoadQueue[1] 12 | top[2](allFiles) 13 | table.remove(FileLoadQueue, 1) 14 | end 15 | 16 | if #FileLoadQueue > 0 then 17 | local top = FileLoadQueue[1] 18 | local path = top[1] 19 | SKIN:Bang("[!SetOption FileReader StartInFolder \"".. path.. "\"][!UpdateMeasure FileReader][!CommandMeasure FileReader Run]") 20 | else 21 | IsLoading = false 22 | for _,j in pairs(FileLoadFinishedCallback) do j() end 23 | end 24 | end 25 | 26 | function LoadFiles(path, functionCallback) 27 | FileLoadQueue[#FileLoadQueue + 1] = {path, functionCallback} 28 | if not IsLoading then 29 | SKIN:Bang("[!SetOption FileReader StartInFolder \"".. path.. "\"][!UpdateMeasure FileReader][!CommandMeasure FileReader Run]") 30 | IsLoading = true 31 | end 32 | end 33 | 34 | function IsFilesLoading() return IsLoading end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/HelperFunctions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | Removes spaces before and after the string 4 | 5 | --]] 6 | function trim(s) 7 | if s == nil then return nil end 8 | return (s:gsub("^%s*(.-)%s*$", "%1")) 9 | end 10 | 11 | --[[ 12 | 13 | Merges two tables, t2 takes priority and will overwrite values in t1 14 | 15 | --]] 16 | 17 | function tableMerge(t1, t2) 18 | for k,v in pairs(t2) do 19 | if type(v) == "table" then 20 | if type(t1[k] or false) == "table" then 21 | t1[k] = tableMerge(t1[k] or {}, t2[k] or {}) 22 | else 23 | t1[k] = v 24 | end 25 | else 26 | t1[k] = v 27 | end 28 | end 29 | return t1 30 | end 31 | 32 | --[[ 33 | 34 | Splits string at separator 35 | 36 | --]] 37 | 38 | function split(inputstr, sep) 39 | if sep == nil then 40 | sep = "%s" 41 | end 42 | local t={} ; i=1 43 | for str in string.gmatch(inputstr, "([^"..sep.."]+)") do 44 | t[i] = str 45 | i = i + 1 46 | end 47 | return t 48 | end 49 | 50 | 51 | --[[ 52 | 53 | No regex, so manual number crunching. 54 | 55 | Takes a string and parses it into a table of numbers 56 | Warning, svg numbers can be very compressed and are therefore quite difficult to parse manually. 57 | e.g "4.2,3.1-2.3-.3,2-3.2" = {4.2, 3.1, -2.3, -0.3, 2, -3.2} 58 | 59 | --]] 60 | 61 | function parseSvgNumbers(parameters) 62 | local parsedNumbers = {} 63 | local pos = 0 64 | while pos <= #parameters do 65 | local prefix = parameters:find("-", pos) 66 | local nextNumberMax = false 67 | if prefix == nil then prefix = #parameters end 68 | 69 | local dot = parameters:find("%.", pos) 70 | if dot == nil then dot = #parameters end 71 | 72 | local number = parameters:find("[%d]+", pos) 73 | if number == nil then number = #parameters end 74 | local strNum = parameters:match("[%d]+", pos) 75 | if strNum ~= nil then 76 | local nextNumber = parameters:find("[%d]+", number + #strNum) 77 | if nextNumber == nil then nextNumber = #parameters nextNumberMax = true end 78 | local nextStrNum = parameters:match("[%d]+", number + #strNum) 79 | 80 | local separator = parameters:find("%s", pos) 81 | if separator == nil then separator = #parameters end 82 | if separator < number then 83 | separator = number + 1 84 | separator = parameters:find("%s", separator) 85 | if separator == nil then separator = #parameters end 86 | end 87 | local separator2 = parameters:find("%,", pos) 88 | if separator2 == nil then separator2 = #parameters end 89 | if separator2 < number then 90 | separator2 = number + 1 91 | separator2 = parameters:find("%,", separator2) 92 | if separator2 == nil then separator2 = #parameters end 93 | end 94 | if separator > separator2 then separator = separator2 end 95 | local nextPrefix = parameters:find("-", prefix+1) 96 | if nextPrefix == nil then nextPrefix = #parameters end 97 | 98 | local usePrefix = prefix < number 99 | local singleDecimal = dot < number 100 | local isDecimal = singleDecimal or ((prefix < number or prefix >= nextNumber) and nextNumber <= nextPrefix and nextNumber <= separator and not nextNumberMax) 101 | local finalNum = 0 102 | local neg = 1 103 | if usePrefix then 104 | neg = -1 105 | end 106 | if singleDecimal then 107 | finalNum = neg * tonumber("0." .. strNum) 108 | pos = number + #strNum 109 | elseif isDecimal then 110 | finalNum = neg * tonumber(strNum .. "." .. nextStrNum) 111 | pos = nextNumber + #nextStrNum 112 | else 113 | finalNum = neg * tonumber(strNum) 114 | pos = number + #strNum 115 | end 116 | parsedNumbers[#parsedNumbers + 1] = finalNum 117 | else 118 | pos = #parameters + 1 119 | end 120 | end 121 | 122 | return parsedNumbers 123 | end 124 | 125 | function tprint (tbl, indent) 126 | if not indent then indent = 0 end 127 | for k, v in pairs(tbl) do 128 | formatting = string.rep(" ", indent) .. k .. ": " 129 | if type(v) == "table" then 130 | print(formatting) 131 | tprint(v, indent+1) 132 | elseif type(v) == "boolean" then 133 | local val = "" 134 | if tprint then val = "true" else val = "false" end 135 | print(formatting.. val) 136 | else 137 | print(formatting .. v) 138 | end 139 | end 140 | end 141 | 142 | function deepcopy(orig) 143 | local orig_type = type(orig) 144 | local copy 145 | if orig_type == 'table' then 146 | copy = {} 147 | for orig_key, orig_value in next, orig, nil do 148 | copy[deepcopy(orig_key)] = deepcopy(orig_value) 149 | end 150 | setmetatable(copy, deepcopy(getmetatable(orig))) 151 | else -- number, string, boolean, etc 152 | copy = orig 153 | end 154 | return copy 155 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/ModifierHandler.lua: -------------------------------------------------------------------------------- 1 | 2 | function getModifiers(attributes) -- TODO: ADD MORE MODIFIERS 3 | if attributes == nil then 4 | return attributes 5 | end 6 | local modifiers = {} 7 | modifiers["Special"] = {} 8 | modifiers["Special"]["Display"] = true 9 | 10 | if attributes["style"] ~= nil then 11 | modifiers = dissectInkScape(modifiers, attributes["style"]) 12 | else 13 | modifiers = dissectHTML(modifiers, attributes) 14 | end 15 | return modifiers 16 | end 17 | 18 | function mergeModifiers(groupModifiers, modifiers) 19 | if groupModifiers ~= nil and modifiers ~= nil then 20 | local merged = tableMerge(groupModifiers, modifiers) 21 | return merged 22 | elseif modifiers ~= nil then 23 | return modifiers 24 | elseif groupModifiers ~= nil then 25 | return groupModifiers 26 | end 27 | return {} 28 | end 29 | 30 | function newShape(groupModifiers, attributes) 31 | local modifiers = getModifiers(attributes) 32 | local shape = {} 33 | shape["modifiers"] = mergeModifiers(groupModifiers, modifiers) 34 | return shape 35 | end 36 | 37 | local colorKeywords = dofile(ColorKeywordsPath) 38 | 39 | function getCssColor(color) 40 | if color == nil or type(color) ~= "string" then 41 | return nil 42 | end 43 | 44 | color = trim(color:lower()) 45 | 46 | if colorKeywords[color] ~= nil then 47 | return colorKeywords[color] 48 | elseif color:sub(1, 3) == "rgb" then 49 | return color:gsub("rgb", ""):gsub("%(", ""):gsub("%)", "") 50 | else 51 | color = color:gsub("#", "") 52 | local r = tonumber(color:sub(1, 2), 16) 53 | local g = tonumber(color:sub(3, 4), 16) 54 | local b = tonumber(color:sub(5, 6), 16) 55 | 56 | return "" .. r .. ", " .. g .. ", " .. b 57 | end 58 | if color == "none" then return "0, 0, 0, 0" end 59 | end 60 | 61 | local 62 | 63 | function cssToShapeModifier(modifiers, modifierName, modifierValue) 64 | 65 | if modifierName == nil then return end 66 | if modifierValue == nil then 67 | modifiers[modifierName] = nil 68 | end 69 | 70 | if modifierName == "display" then 71 | if modifierValue == "none" then 72 | modifiers["Special"]["Display"] = false 73 | end 74 | end 75 | 76 | -- These are modifiers with direct bindings 77 | if modifierName == "fill" then modifiers["fill color"] = getCssColor(modifierValue) end 78 | if modifierName == "stroke" then modifiers["stroke color"] = getCssColor(modifierValue) end 79 | if modifierName == "stroke-width" then modifiers["StrokeWidth"] = modifierValue:gsub("px", "") end 80 | 81 | -- These are attributes that can be done, but there is no direct modifier binding to them 82 | if modifierName == "stroke-opacity" then modifiers["Special"]["StrokeOpcaity"] = modifierValue end 83 | if modifierName == "fill-opacity" then modifiers["Special"]["FillOpcaity"] = modifierValue end 84 | 85 | 86 | -- TODO, ADD FILLMODE WHEN WE GET WINDING ;) 87 | 88 | end 89 | 90 | function dissectInkScape(modifiers, style) 91 | local styleParts = split(style, ";") 92 | for i,part in pairs(styleParts) do 93 | local stylePair = split(part, ":") 94 | local styleName = trim(stylePair[1]) 95 | local styleValue = trim(stylePair[2]) 96 | cssToShapeModifier(modifiers, trim(styleName), trim(styleValue)) 97 | 98 | end 99 | return modifiers 100 | end 101 | 102 | function dissectHTML(modifiers, attributes) 103 | for i,j in pairs(attributes) do 104 | cssToShapeModifier(modifiers, trim(i), trim(j)) 105 | end 106 | return modifiers 107 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/MouseHandler.lua: -------------------------------------------------------------------------------- 1 | local Events = { 2 | MouseMove = {}, 3 | LeftMouseDown = {}, 4 | LeftMouseUp = {}, 5 | } 6 | 7 | function SubscribeMouseEvent(callbackFunc, measureName, eventType) 8 | if Events[eventType] == nil then 9 | print("Mouse event type:", eventType, "does not exist") 10 | return 11 | end 12 | 13 | if measureName == nil or callbackFunc == nil then 14 | print("Could not subscribe to event. MeasureName or Callbackfunction was nil") 15 | return 16 | end 17 | Events[eventType][measureName] = callbackFunc 18 | end 19 | 20 | function UnsubscribeMouseEvent(measureName, eventType) 21 | if Events[eventType] == nil then 22 | print("Mouse event type:", eventType, "does not exist") 23 | return 24 | end 25 | 26 | if measureName == nil then 27 | print("Could not unsubscribe from event. MeasureName was nil") 28 | return 29 | end 30 | 31 | if Events[eventType][measureName] == nil then 32 | print("No callback subscribed to event ", eventType, " for measure ", measureName) 33 | return 34 | end 35 | Events[eventType][measureName] = nil 36 | end 37 | 38 | function MouseMove(mouseX, mouseY) 39 | for measure, callback in pairs(Events["MouseMove"]) do 40 | bang = "[!CommandMeasure ".. measure .." " .. callback .."(" .. mouseX .. "," .. mouseY .. ")]" 41 | SKIN:Bang(bang) 42 | end 43 | end 44 | 45 | function LeftMouseReleased(mouseX, mouseY) 46 | for measure, callback in pairs(Events["LeftMouseUp"]) do 47 | bang = "[!CommandMeasure ".. measure .." " .. callback .."(" .. mouseX .. "," .. mouseY .. ")]" 48 | SKIN:Bang(bang) 49 | end 50 | end 51 | 52 | function Initialize() 53 | 54 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/A.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Arc segment is one or multiple arcs 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 7 do 14 | local rx = tonumber(parameters[i]) 15 | local ry = tonumber(parameters[i+1]) 16 | local rotationAngle = tonumber(parameters[i+2]) 17 | local arcSize = tonumber(parameters[i+3]) 18 | local sweep = tonumber(parameters[i+4]) 19 | sweep = 1 - sweep 20 | local x = tonumber(parameters[i+5]) 21 | local y = tonumber(parameters[i+6]) 22 | if relative then 23 | x = x + pen.X 24 | y = y + pen.Y 25 | end 26 | 27 | shape["path"] = shape["path"] .. " | ArcTo " .. x .. ", " .. y .. ", " .. rx .. ", " .. ry .. ", " .. rotationAngle .. ", " .. sweep .. ", " .. arcSize 28 | 29 | lastControlX = nil 30 | lastControlY = nil 31 | lastQuadraticX = nil 32 | lastQuadraticY = nil 33 | pen.X = x 34 | pen.Y = y 35 | end 36 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/C.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Curve segment is one or multiple bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 6 do 14 | --if parameters[i] ~= nil and parameters[i+1] ~= nil and parameters[i+2] ~= nil and parameters[i+3] ~= nil and parameters[i+4] ~= nil and parameters[i+5] ~= nil then 15 | local x1 = tonumber(parameters[i]) 16 | local y1 = tonumber(parameters[i+1]) 17 | local x2 = tonumber(parameters[i+2]) 18 | local y2 = tonumber(parameters[i+3]) 19 | local x = tonumber(parameters[i+4]) 20 | local y = tonumber(parameters[i+5]) 21 | if relative then 22 | x1 = x1 + pen.X 23 | y1 = y1 + pen.Y 24 | x2 = x2 + pen.X 25 | y2 = y2 + pen.Y 26 | x = x + pen.X 27 | y = y + pen.Y 28 | end 29 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. x1 .. ", " .. y1 .. ", " .. x2 .. ", " .. y2 30 | if relative then 31 | x = x - pen.X 32 | y = y - pen.Y 33 | x2 = x2 - pen.X 34 | y2 = y2 - pen.Y 35 | end 36 | lastControlX = x2 + (x - x2) * 2 37 | lastControlY = y2 + (y - y2) * 2 38 | lastQuadraticX = nil 39 | lastQuadraticY = nil 40 | 41 | if relative then 42 | x = x + pen.X 43 | y = y + pen.Y 44 | lastControlX = lastControlX + pen.X 45 | lastControlY = lastControlY + pen.Y 46 | end 47 | pen.X = x 48 | pen.Y = y 49 | --else 50 | -- print("Invalid bezier curve ", parameters[i], parameters[i+1], parameters[i+2], parameters[i+3], parameters[i+4], parameters[i+5]) 51 | --end 52 | end 53 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/H.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Horizontal LineTo segment is one or multiple horizontal lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters do 14 | local x = tonumber(parameters[i]) 15 | if relative then 16 | x = x + pen.X 17 | end 18 | shape["path"] = shape["path"] .. " | LineTo " .. x .. ", " .. pen.Y 19 | pen.X = x 20 | lastControlX = x2 21 | lastControlY = y2 22 | lastQuadraticX = nil 23 | lastQuadraticY = nil 24 | end 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/L.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the LineTo segment is one or multiple lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 2 do 14 | local x = tonumber(parameters[i]) 15 | local y = tonumber(parameters[i+1]) 16 | if relative then 17 | x = x + pen.X 18 | y = y + pen.Y 19 | end 20 | shape["path"] = shape["path"] .. " | LineTo " .. x .. ", " .. y 21 | pen.X = x 22 | pen.Y = y 23 | lastControlX = x2 24 | lastControlY = y2 25 | lastQuadraticX = nil 26 | lastQuadraticY = nil 27 | end 28 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/M.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | MoveTo segment, this indicates where the path should start and is the same as lifting the pen and moving it to a new location. (e.g starting a new Path shape) 4 | 5 | Note: additional parameters after the initial point is counted as LineTo, hence the "pathSegments:L()" 6 | 7 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 8 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 9 | shape - the current shape 10 | relative - is this relative to the last pen location 11 | 12 | --]] 13 | 14 | return function (parameters, pen, shape, relative) 15 | local x = tonumber(parameters[1]) 16 | local y = tonumber(parameters[2]) 17 | if relative then 18 | x = x + pen.X 19 | y = y + pen.Y 20 | end 21 | local moveShape = nil 22 | if shape["path"] ~= nil and trim(shape["path"]) ~= "" then 23 | local newShape = {} 24 | newShape["modifiers"] = deepcopy(shape["modifiers"]) 25 | newShape["shape"] = "Path Path" .. nextPath 26 | nextPath = nextPath + 1 27 | moveShape = newShape 28 | else 29 | moveShape = shape 30 | end 31 | moveShape["path"] = x .. ", " .. y 32 | pen.X = x 33 | pen.Y = y 34 | lastControlX = x2 35 | lastControlY = y2 36 | lastQuadraticX = nil 37 | lastQuadraticY = nil 38 | table.remove(parameters, 1) 39 | table.remove(parameters, 1) 40 | pathSegments.L(parameters, pen, moveShape, relative) 41 | return moveShape 42 | end 43 | -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/Q.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Quadratic Curve segment is one or multiple quadratic bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 4 do 14 | local x1 = tonumber(parameters[i]) 15 | local y1 = tonumber(parameters[i+1]) 16 | local x = tonumber(parameters[i+2]) 17 | local y = tonumber(parameters[i+3]) 18 | if relative then 19 | x1 = x1 + pen.X 20 | y1 = y1 + pen.Y 21 | x = x + pen.X 22 | y = y + pen.Y 23 | end 24 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. x1 .. ", " .. y1 25 | if relative then 26 | x = x - pen.X 27 | y = y - pen.Y 28 | x1 = x1 - pen.X 29 | y1 = y1 - pen.Y 30 | end 31 | lastControlX = nil 32 | lastControlY = nil 33 | lastQuadraticX = x1 + (x - x1) * 2 34 | lastQuadraticY = y1 + (y - y1) * 2 35 | 36 | if relative then 37 | x = x + pen.X 38 | y = y + pen.Y 39 | lastQuadraticX = lastQuadraticX + pen.X 40 | lastQuadraticY = lastQuadraticY + pen.Y 41 | end 42 | pen.X = x 43 | pen.Y = y 44 | end 45 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/S.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Simple Curve segment is one or multiple simplified bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters, 4 do 14 | local x2 = tonumber(parameters[i]) 15 | local y2 = tonumber(parameters[i+1]) 16 | local x = tonumber(parameters[i+2]) 17 | local y = tonumber(parameters[i+3]) 18 | if relative then 19 | x2 = x2 + pen.X 20 | y2 = y2 + pen.Y 21 | x = x + pen.X 22 | y = y + pen.Y 23 | end 24 | 25 | if lastControlX == nil then 26 | lastControlX = x2 27 | end 28 | if lastControlY == nil then 29 | lastControlY = y2 30 | end 31 | 32 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. lastControlX .. ", " .. lastControlY .. ", " .. x2 .. ", " .. y2 33 | 34 | if relative then 35 | x = x - pen.X 36 | y = y - pen.Y 37 | x2 = x2 - pen.X 38 | y2 = y2 - pen.Y 39 | end 40 | lastControlX = x2 + (x - x2) * 2 41 | lastControlY = y2 + (y - y2) * 2 42 | lastQuadraticX = nil 43 | lastQuadraticY = nil 44 | 45 | if relative then 46 | x = x + pen.X 47 | y = y + pen.Y 48 | lastControlX = lastControlX + pen.X 49 | lastControlY = lastControlY + pen.Y 50 | end 51 | 52 | pen.X = x 53 | pen.Y = y 54 | end 55 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/T.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Simplified Quadratic Curve segment is one or multiple simple quadratic bezier curves 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function(parameters, pen, shape, relative) 13 | for i=1, #parameters, 2 do 14 | local x = tonumber(parameters[i]) 15 | local y = tonumber(parameters[i+1]) 16 | if relative then 17 | x = x + pen.X 18 | y = y + pen.Y 19 | end 20 | 21 | if lastQuadraticX == nil then 22 | lastQuadraticX = x2 23 | end 24 | if lastQuadraticY == nil then 25 | lastQuadraticY = y2 26 | end 27 | 28 | shape["path"] = shape["path"] .. " | CurveTo " .. x .. ", " .. y .. ", " .. lastQuadraticX .. ", " .. lastQuadraticY 29 | 30 | if relative then 31 | x = x - pen.X 32 | y = y - pen.Y 33 | end 34 | lastControlX = nil 35 | lastControlY = nil 36 | lastQuadraticX = lastQuadraticX + (x - lastQuadraticX) * 2 37 | lastQuadraticY = lastQuadraticY + (y - lastQuadraticY) * 2 38 | 39 | if relative then 40 | x = x + pen.X 41 | y = y + pen.Y 42 | lastControlX = lastControlX + pen.X 43 | lastControlY = lastControlY + pen.Y 44 | end 45 | 46 | pen.X = x 47 | pen.Y = y 48 | end 49 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/V.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the Vertical LineTo segment is one or multiple vertical lines 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | for i=1, #parameters do 14 | local y = tonumber(parameters[i]) 15 | if relative then 16 | y = y + pen.Y 17 | end 18 | shape["path"] = shape["path"] .. " | LineTo " .. pen.X .. ", " .. y 19 | pen.Y = y 20 | lastControlX = x2 21 | lastControlY = y2 22 | lastQuadraticX = nil 23 | lastQuadraticY = nil 24 | end 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/PathTypes/Z.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | the close path segment closes the path. 4 | 5 | parameters - a table of numbers that is the numbers trailing the segment character (e.g "M 200, 300") 6 | pen - the current pen location (table: { X= xPos, Y = yPos} ) 7 | shape - the current shape 8 | relative - is this relative to the last pen location 9 | 10 | --]] 11 | 12 | return function (parameters, pen, shape, relative) 13 | shape["path"] = shape["path"] .. " | ClosePath 1" 14 | lastControlX = x2 15 | lastControlY = y2 16 | lastQuadraticX = nil 17 | lastQuadraticY = nil 18 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | text = SKIN:GetMeasure('MeasureHour'):GetStringValue() 3 | font = SELF:GetOption('Font') 4 | size = SELF:GetOption('Size') 5 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 6 | template={"","","","","","","image/svg+xml","","","","","",""..text.."",""} 7 | file:write(table.concat(template, "\n")) 8 | file:close() 9 | 10 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 11 | 12 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/circle.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | local shape = newShape(groupModifiers, attributes) 15 | local x = attributes["cx"] 16 | local y = attributes["cy"] 17 | local r = attributes["r"] 18 | shape["shape"] = "Ellipse " .. x .. ", " .. y .. ", " .. r 19 | local class = attributes["class"] 20 | if shapeStyles[class] ~= nil then 21 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 22 | end 23 | shapes[#shapes+1] = shape 24 | return shapes 25 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/defs.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag that can be used in the .svg format 4 | This is probably not fully implemented as i'm only sending the tag that appears here into the parser again to be handled in style.lua 5 | 6 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 7 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 8 | children - All the tags inside the current tag 9 | groupModifiers - These are modifiers that is applied through inheritence by the tag 10 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 11 | 12 | ]] 13 | 14 | return function (shapes, attributes, children, groupModifiers, value) 15 | --for i, j in pairs(children) do 16 | -- shapes = getShape(j, shapes, groupModifiers) 17 | --end 18 | 19 | --TODO: this 20 | return shapes 21 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/g.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag, which styles it's children. 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) -- group 14 | debugPrint("group") 15 | if children ~= nil then 16 | local mods = getModifiers(attributes) 17 | groupModifiers = mergeModifiers(groupModifiers, mods) 18 | local class = attributes["class"] 19 | if shapeStyles[class] ~= nil then 20 | groupModifiers = mergeModifiers(groupModifiers, shapeStyles[class]) 21 | end 22 | for i, j in pairs(children) do 23 | shapes = getShape(j, shapes, groupModifiers) 24 | end 25 | end 26 | return shapes 27 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/path.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | Note: This is a pretty advanced tag, and i've therefore made the segments into modules inside #@#Scripts/PathTypes 6 | 7 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 8 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 9 | children - All the tags inside the current tag 10 | groupModifiers - These are modifiers that is applied through inheritence by the tag 11 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 12 | 13 | --]] 14 | 15 | -- Table where the functions of all the path types are stored 16 | pathSegments = {} 17 | 18 | --These are used for the C, S, Q and T segments, used to calculate the S and T control points 19 | lastControlX = nil 20 | lastControlY = nil 21 | lastQuadraticX = nil 22 | lastQuadraticY = nil 23 | 24 | local pathSegmentDir = SKIN:ReplaceVariables("#@#Scripts\\PathTypes\\") 25 | 26 | local function LoadPathSegments(files) 27 | for id, file in pairs(files) do 28 | fileName = split(file, ".")[1] 29 | pathSegments[fileName] = dofile(pathSegmentDir .. file) 30 | end 31 | print("Path segments loaded") 32 | end 33 | 34 | LoadFiles(pathSegmentDir, LoadPathSegments) 35 | 36 | function parsePath(input) 37 | local out = {}; 38 | 39 | for instr, vals in input:gmatch("([a-df-zA-DF-Z])([^a-df-zA-DF-Z]*)") do 40 | local line = { instr }; 41 | local carry = nil 42 | for v in vals:gmatch("([+-]?[%deE.]+)") do 43 | if v:match("[eE]") then 44 | carry = v 45 | else 46 | if carry then 47 | line[#line+1] = carry .. v; 48 | carry = nil 49 | else 50 | line[#line+1] = v; 51 | end 52 | end 53 | 54 | end 55 | out[#out+1] = line; 56 | end 57 | return out; 58 | end 59 | 60 | 61 | return function (shapes, attributes, children, groupModifiers, value) 62 | local shape = newShape(groupModifiers, attributes) 63 | local class = attributes["class"] 64 | if shapeStyles[class] ~= nil then 65 | shape["modifiers"] = mergeModifiers(shapeStyles[class], shape["modifiers"]) 66 | end 67 | shape["shape"] = "Path Path" .. nextPath 68 | nextPath = nextPath + 1 69 | --local path = trim(attributes["d"]:gsub("%s+", " ")) 70 | local pen = {X = 0, Y = 0} 71 | 72 | local combine = "" 73 | local fistCombine = true 74 | local shapeCount = 0 75 | local iterations = 0 76 | 77 | local special = shape["modifiers"]["Special"] 78 | 79 | local segments = parsePath(attributes["d"]) 80 | for i=1, #segments do 81 | local parameters = segments[i] 82 | local char = parameters[1] 83 | table.remove(parameters, 1) 84 | 85 | if pathSegments[char:upper()] ~= nil then 86 | local relative = char:lower() == char 87 | local nextShape = pathSegments[char:upper()](parameters, pen, shape, relative) 88 | 89 | if nextShape ~= nil and nextShape ~= shape then 90 | if fistCombine then 91 | combine = "Combine Shape" .. (#shapes + 1) 92 | fistCombine = false 93 | else 94 | combine = combine .. " | XOR Shape" .. (#shapes + 1) 95 | shape["modifiers"] = {} 96 | shape["modifiers"]["Special"] = special 97 | end 98 | shapes[#shapes+1] = shape 99 | shape = nextShape 100 | shapeCount = shapeCount + 1 101 | end 102 | else 103 | print("Path segment by type " .. char:upper() .. " does not exist!") 104 | end 105 | iterations = iterations + 1 106 | end 107 | 108 | if shape["shape"] ~= nil and trim(shape["shape"]) ~= "" and iterations > 1 then 109 | if fistCombine then 110 | combine = "Combine Shape" .. (#shapes + 1) 111 | fistCombine = false 112 | else 113 | combine = combine .. " | XOR Shape" .. (#shapes + 1) 114 | shape["modifiers"] = {} 115 | shape["modifiers"]["Special"] = special 116 | end 117 | shapes[#shapes+1] = shape 118 | shape = nextShape 119 | shapeCount = shapeCount + 1 120 | else 121 | nextPath = nextPath - 1 122 | end 123 | 124 | if combine ~= "" and shapeCount > 1 then 125 | local combinedShape = {modifiers = {}} 126 | combinedShape["shape"] = combine 127 | combinedShape["modifiers"]["Special"] = special 128 | combinedShape["combined"] = true 129 | shapes[#shapes+1] = combinedShape 130 | end 131 | 132 | return shapes 133 | end 134 | -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/polygon.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | 15 | local shape = newShape(groupModifiers, attributes) 16 | local class = attributes["class"] 17 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 18 | debugPrint("polygon") 19 | local parameters = attributes["points"] 20 | parameters = trim(parameters:gsub("%s+", " ")) 21 | 22 | parameters = parseSvgNumbers(parameters) 23 | 24 | local path = "" 25 | local first = true 26 | for i=1, #parameters, 2 do 27 | local x = tonumber(parameters[i]) 28 | local y = tonumber(parameters[i+1]) 29 | if first then 30 | path = path .. x .. ", " .. y 31 | first = false 32 | else 33 | path = path .. " | LineTo " .. x .. ", " .. y 34 | end 35 | end 36 | path = path .. " | ClosePath 1" 37 | 38 | shape["shape"] = "Path Path"..nextPath 39 | shape["path"] = path 40 | nextPath = nextPath + 1 41 | 42 | local class = attributes["class"] 43 | if shapeStyles[class] ~= nil then 44 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 45 | end 46 | 47 | shapes[#shapes+1] = shape 48 | return shapes 49 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/rect.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This converts the tag in .svg to a shape that rainmeter can use 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | --]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | local shape = newShape(groupModifiers, attributes) 15 | local x = attributes["x"] 16 | if x == nil then x = 0 end 17 | local y = attributes["y"] 18 | if y == nil then y = 0 end 19 | local w = attributes["width"] 20 | local h = attributes["height"] 21 | shape["shape"] = "Rectangle " .. x .. ", " .. y .. ", " .. w .. ", " .. h 22 | local class = attributes["class"] 23 | if shapeStyles[class] ~= nil then 24 | shape["modifiers"] = mergeModifiers(shape["modifiers"], shapeStyles[class]) 25 | end 26 | shapes[#shapes+1] = shape 27 | return shapes 28 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/style.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | handles the tag in the .svg, and saves them to the shapeStyles table to be fetched later. 4 | 5 | Note: only classes are handled for now, i assume that ids will probably appear, but i have yet to implement that 6 | 7 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 8 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 9 | children - All the tags inside the current tag 10 | groupModifiers - These are modifiers that is applied through inheritence by the tag 11 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 12 | 13 | --]] 14 | 15 | return function (shapes, attributes, children, groupModifiers, value) 16 | local firstSplit = split(value, "}") 17 | for i, stylePart in pairs(firstSplit) do 18 | local idContentPair = split(stylePart, "{") 19 | local ids = split(idContentPair[1], ",") 20 | for j, id in pairs(ids) do 21 | local id = trim(id):sub(2) 22 | local content = idContentPair[2] 23 | local att = {} 24 | att["style"] = content 25 | local modifiers = getModifiers(att) 26 | shapeStyles[id] = mergeModifiers(modifiers, shapeStyles[id]) 27 | end 28 | end 29 | return shapes 30 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/SvgTypes/svg.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | This handles the tag, which declares that the following is a svg shape 4 | 5 | shapes - All shapes generated so far, do "shapes[#shapes + 1] = shape" to add a new shape 6 | attributes - This is the attributes for the tag (e.g , class is an attribute to the svg tag ) 7 | children - All the tags inside the current tag 8 | groupModifiers - These are modifiers that is applied through inheritence by the tag 9 | value - The actual value of the tag (e.g the content inside that tags that are not other tags.) 10 | 11 | ]] 12 | 13 | return function (shapes, attributes, children, groupModifiers, value) 14 | debugPrint("svg", children, attributes) 15 | if children == nil then 16 | print(ErrorEmptySVG) 17 | return nil 18 | end 19 | if attributes == nil then 20 | print(CorruptSVG) 21 | return nil 22 | end 23 | 24 | if attributes["viewBox"] ~= nil then 25 | local view = split(attributes["viewBox"], " ") 26 | local x = view[1] 27 | local y = view[2] 28 | local width = view[3] 29 | local height = view[4] 30 | shapes["X"] = tostring(-tonumber(x)) 31 | shapes["Y"] = tostring(-tonumber(y)) 32 | shapes["width"] = width 33 | shapes["height"] = height 34 | end 35 | 36 | for i, j in pairs(children) do 37 | shapes = getShape(j, shapes, groupModifiers) 38 | end 39 | return shapes 40 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/WindowHandler.lua: -------------------------------------------------------------------------------- 1 | local savedW = 0 2 | local savedH = 0 3 | local savedX = 0 4 | local savedY = 0 5 | 6 | function ToggleMaximize() 7 | SKIN:Bang("[!AutoSelectScreen 1]") 8 | local isMaximized = tonumber(SKIN:GetVariable("WindowMaximized")) 9 | local WindowPosX = tonumber(SKIN:GetVariable("CURRENTCONFIGX")) 10 | local WindowPosY = tonumber(SKIN:GetVariable("CURRENTCONFIGY")) 11 | local windowWidth = tonumber(SKIN:GetVariable("WindowW")) 12 | local windowHeight = tonumber(SKIN:GetVariable("WindowH")) 13 | 14 | local workAreaX = tonumber(SKIN:GetVariable("WORKAREAX")) 15 | local workAreaY = tonumber(SKIN:GetVariable("WORKAREAY")) 16 | local dragMargin = tonumber(SKIN:GetVariable("WindowDragMarginSize")) 17 | 18 | isMaximized = math.abs(-isMaximized + 1) -- switch maximized 19 | 20 | 21 | local bang = "" 22 | bang = bang .. "[!SetVariable WindowMaximized " .. isMaximized .. "]" 23 | bang = bang .. "[!WriteKeyValue Variables WindowMaximized " .. isMaximized .. "]" 24 | if isMaximized == 1 then 25 | bang = bang .. "[!SetVariable WindowPosX (#WORKAREAX# - #WindowDragMarginSize#)][!SetVariable WindowPosY (#WORKAREAY# - #WindowDragMarginSize#)]" 26 | bang = bang .. "[!SetVariable WindowW (#WORKAREAWIDTH#)][!SetVariable WindowH (#WORKAREAHEIGHT#)]" 27 | bang = bang .. "[!WriteKeyValue Variables WindowPosX " .. WindowPosX .. "]" 28 | bang = bang .. "[!WriteKeyValue Variables WindowPosY " .. WindowPosY .. "]" 29 | bang = bang .. "[!WriteKeyValue Variables WindowW " .. windowWidth .. "]" 30 | bang = bang .. "[!WriteKeyValue Variables WindowH " .. windowHeight .. "]" 31 | bang = bang .. "[!HideMeterGroup WindowDragMargin][!UpdateMeter *][!Redraw]" 32 | bang = bang .. "[!Move ".. (workAreaX - dragMargin) .." ".. (workAreaY - dragMargin).."]" 33 | bang = bang .. "[!Draggable 0]" 34 | 35 | -- Store positions for future use 36 | savedX = WindowPosX 37 | savedY = WindowPosY 38 | savedW = windowWidth 39 | savedH = windowHeight 40 | else 41 | bang = bang .. "[!SetVariable WindowPosX " .. savedX .. "][!SetVariable WindowPosY " .. savedY .. "]" 42 | bang = bang .. "[!SetVariable WindowW " .. savedW .. "][!SetVariable WindowH " .. savedH .. "]" 43 | bang = bang .. "[!ShowMeterGroup WindowDragMargin][!UpdateMeter *][!Redraw]" 44 | bang = bang .. "[!Move " .. (savedX) .. " " .. (savedY) .. "]" 45 | bang = bang .. "[!Draggable 1]" 46 | end 47 | 48 | SKIN:Bang(bang) 49 | print(bang) 50 | end 51 | 52 | --[[ 53 | 54 | Called when the skin refreshes to set the maximize and size variables 55 | 56 | ]] 57 | local function RefreshMaximize() 58 | local isMaximized = tonumber(SKIN:GetVariable("WindowMaximized")) 59 | local WindowPosX = tonumber(SKIN:GetVariable("WindowPosX")) 60 | local WindowPosY = tonumber(SKIN:GetVariable("WindowPosY")) 61 | local windowWidth = tonumber(SKIN:GetVariable("WindowW")) 62 | local windowHeight = tonumber(SKIN:GetVariable("WindowH")) 63 | 64 | local workAreaX = tonumber(SKIN:GetVariable("WORKAREAX")) 65 | local workAreaY = tonumber(SKIN:GetVariable("WORKAREAY")) 66 | local dragMargin = tonumber(SKIN:GetVariable("WindowDragMarginSize")) 67 | 68 | savedX = WindowPosX 69 | savedY = WindowPosY 70 | savedW = windowWidth 71 | savedH = windowHeight 72 | 73 | if isMaximized == 1 then 74 | 75 | local bang = "" 76 | bang = bang .. "[!SetVariable WindowPosX #WORKAREAX#][!SetVariable WindowPosY #WORKAREAY#]" -- Set position variables 77 | bang = bang .. "[!SetVariable WindowW #WORKAREAWIDTH#][!SetVariable WindowH #WORKAREAHEIGHT#]" -- Set size variables 78 | bang = bang .. "[!UpdateMeter *][!Redraw]" -- Update and Redraw meters 79 | bang = bang .. "[!Move ".. (workAreaX - dragMargin) .." " .. (workAreaY - dragMargin) .."]" -- Move Window 80 | bang = bang .. "[!Draggable 0]" 81 | SKIN:Bang(bang) 82 | print(bang) -- Execute 83 | 84 | else 85 | local WindowPosX = tonumber(SKIN:GetVariable("CURRENTCONFIGX")) 86 | local WindowPosY = tonumber(SKIN:GetVariable("CURRENTCONFIGY")) 87 | savedX = WindowPosX 88 | savedY = WindowPosY 89 | SKIN:Bang("[!Move " .. WindowPosX .. " " .. WindowPosY .. "][!SetVariable WindowPosX " .. WindowPosX .. "][!SetVariable WindowPosY " .. WindowPosY .. "][!Draggable 1]") 90 | end 91 | end 92 | 93 | local Resizing = false 94 | local ResizeBorder = nil 95 | local offsetX = 0 96 | local offsetY = 0 97 | 98 | function MouseMovedCallback(mouseX, mouseY) 99 | if not Resizing then 100 | print("Error, MouseMovedCallback called when not resizing") 101 | return 102 | end 103 | 104 | local skinPosX = tonumber(SKIN:GetVariable("CURRENTCONFIGX")) 105 | local skinPosY = tonumber(SKIN:GetVariable("CURRENTCONFIGY")) 106 | local windowWidth = tonumber(SKIN:GetVariable("WindowW")) 107 | local windowHeight = tonumber(SKIN:GetVariable("WindowH")) 108 | local minWindowWidth = tonumber(SKIN:GetVariable("MinWindowW")) 109 | local minWindowHeight = tonumber(SKIN:GetVariable("MinWindowH")) 110 | local maxWindowWidth = tonumber(SKIN:GetVariable("MaxWindowW")) 111 | local maxWindowHeight = tonumber(SKIN:GetVariable("MaxWindowH")) 112 | local dragMargin = tonumber(SKIN:GetVariable("WindowDragMarginSize")) 113 | 114 | local newWindowX = nil 115 | local newWindowY = nil 116 | local newWindowWidth = nil 117 | local newWindowHeight = nil 118 | 119 | if ResizeBorder == "DragMarginRight" or ResizeBorder == "DragMarginTopRight" or ResizeBorder == "DragMarginBottomRight" then 120 | newWindowWidth = (mouseX - skinPosX - dragMargin - offsetX) 121 | end 122 | 123 | if ResizeBorder == "DragMarginBottom" or ResizeBorder == "DragMarginBottomRight" or ResizeBorder == "DragMarginBottomLeft" then 124 | newWindowHeight = (mouseY - skinPosY - dragMargin - offsetY) 125 | end 126 | 127 | if ResizeBorder == "DragMarginLeft" or ResizeBorder == "DragMarginBottomLeft" or ResizeBorder == "DragMarginTopLeft" then 128 | newWindowX = mouseX - offsetX 129 | newWindowWidth = windowWidth + skinPosX - newWindowX 130 | end 131 | 132 | if ResizeBorder == "DragMarginTop" or ResizeBorder == "DragMarginTopLeft" or ResizeBorder == "DragMarginTopRight" then 133 | newWindowY = mouseY - offsetY 134 | newWindowHeight = windowHeight + skinPosY - newWindowY 135 | end 136 | 137 | local bang = "" 138 | 139 | if newWindowWidth ~= nil then 140 | if newWindowX ~= nil then 141 | if newWindowWidth < minWindowWidth then 142 | newWindowX = newWindowX - minWindowWidth + newWindowWidth 143 | end 144 | if newWindowWidth > maxWindowWidth then 145 | newWindowX = newWindowX - maxWindowWidth + newWindowWidth 146 | end 147 | end 148 | if newWindowWidth < minWindowWidth then newWindowWidth = minWindowWidth end 149 | if newWindowWidth > maxWindowWidth then newWindowWidth = maxWindowWidth end 150 | bang = bang .. "[!SetVariable WindowW " .. newWindowWidth .. "]" 151 | end 152 | 153 | if newWindowHeight ~= nil then 154 | if newWindowY ~= nil then 155 | if newWindowHeight < minWindowHeight then 156 | newWindowY = newWindowY - minWindowHeight + newWindowHeight 157 | end 158 | if newWindowHeight > maxWindowHeight then 159 | newWindowY = newWindowY - maxWindowHeight + newWindowHeight 160 | end 161 | end 162 | if newWindowHeight < minWindowHeight then newWindowHeight = minWindowHeight end 163 | if newWindowHeight > maxWindowHeight then newWindowHeight = maxWindowHeight end 164 | 165 | bang = bang .. "[!SetVariable WindowH " .. newWindowHeight .. "]" 166 | end 167 | 168 | if bang ~= "" then 169 | --bang = bang .. "[!UpdateMeterGroup Window][!Redraw]" TODO When clip is implemented? 170 | bang = bang .. "[!UpdateMeter *][!Redraw]" 171 | 172 | end 173 | 174 | if newWindowX ~= nil and newWindowY ~= nil then 175 | bang = bang .. "[!Move " .. newWindowX .. " " .. newWindowY .. "]" 176 | elseif newWindowX ~= nil then 177 | bang = bang .. "[!Move " .. newWindowX .. " " .. skinPosY .. "]" 178 | elseif newWindowY ~= nil then 179 | bang = bang .. "[!Move " .. skinPosX .. " " .. newWindowY .. "]" 180 | end 181 | SKIN:Bang(bang) 182 | end 183 | 184 | function LeftMouseUpCallback(mouseX, mouseY) 185 | bang = "[!CommandMeasure ScriptMouseHandler UnsubscribeMouseEvent('WindowHandler','MouseMove')]" 186 | bang = bang .. "[!CommandMeasure ScriptMouseHandler UnsubscribeMouseEvent('WindowHandler','LeftMouseUp')]" 187 | local skinPosX = tonumber(SKIN:GetVariable("CURRENTCONFIGX")) 188 | local skinPosY = tonumber(SKIN:GetVariable("CURRENTCONFIGY")) 189 | local windowWidth = tonumber(SKIN:GetVariable("WindowW")) 190 | local windowHeight = tonumber(SKIN:GetVariable("WindowH")) 191 | bang = bang .. "[!WriteKeyValue Variables WindowPosX " .. skinPosX .. "]" -- Write X pos in case of refresh 192 | bang = bang .. "[!WriteKeyValue Variables WindowPosY " .. skinPosY .. "]" -- Write Y pos in case of refresh 193 | bang = bang .. "[!WriteKeyValue Variables WindowW " .. windowWidth .. "]" -- Write Width in case of refresh 194 | bang = bang .. "[!WriteKeyValue Variables WindowH " .. windowHeight .. "]" -- Write Height in case of refresh 195 | bang = bang .. "[!UpdateMeter *][!Redraw]" 196 | 197 | SKIN:Bang(bang) 198 | ResizeBorder = nil 199 | Resizing = false 200 | end 201 | 202 | function ResizeWindow(border, mouseX, mouseY) 203 | local mouseHandler = SKIN:GetMeasure("ScriptMouseHandler") 204 | if mouseHandler == nil then 205 | print("Mouse handler not found, include module ScriptMouseHandler") 206 | return 207 | end 208 | ResizeBorder = border 209 | Resizing = true 210 | bang = "[!CommandMeasure ScriptMouseHandler SubscribeMouseEvent('MouseMovedCallback','WindowHandler','MouseMove')]" 211 | bang = bang .. "[!CommandMeasure ScriptMouseHandler SubscribeMouseEvent('LeftMouseUpCallback','WindowHandler','LeftMouseUp')]" 212 | SKIN:Bang(bang) 213 | offsetX = mouseX 214 | offsetY = mouseY 215 | end 216 | 217 | function Initialize() 218 | RefreshMaximize() 219 | end -------------------------------------------------------------------------------- /@Resources/Scripts/lol/XmlParser.lua: -------------------------------------------------------------------------------- 1 | -- Code from: http://lua-users.org/wiki/LuaXml 2 | ----------------------------------------------------------------------------------------- 3 | -- LUA only XmlParser from Alexander Makeev 4 | ----------------------------------------------------------------------------------------- 5 | -- Using this code "As Is" 6 | -- Jaya Polumuru 7 | 8 | XmlParser = {}; 9 | 10 | function XmlParser:ToXmlString(value) 11 | value = string.gsub (value, "&", "&"); -- '&' -> "&" 12 | value = string.gsub (value, "<", "<"); -- '<' -> "<" 13 | value = string.gsub (value, ">", ">"); -- '>' -> ">" 14 | --value = string.gsub (value, "'", "'"); -- '\'' -> "'" 15 | value = string.gsub (value, "\"", """); -- '"' -> """ 16 | -- replace non printable char -> " " 17 | value = string.gsub(value, "([^%w%&%;%p%\t% ])", 18 | function (c) 19 | return string.format("&#x%X;", string.byte(c)) 20 | --return string.format("&#x%02X;", string.byte(c)) 21 | --return string.format("&#%02d;", string.byte(c)) 22 | end); 23 | return value; 24 | end 25 | 26 | function XmlParser:FromXmlString(value) 27 | value = string.gsub(value, "&#x([%x]+)%;", 28 | function(h) 29 | return string.char(tonumber(h,16)) 30 | end); 31 | value = string.gsub(value, "&#([0-9]+)%;", 32 | function(h) 33 | return string.char(tonumber(h,10)) 34 | end); 35 | value = string.gsub (value, """, "\""); 36 | value = string.gsub (value, "'", "'"); 37 | value = string.gsub (value, ">", ">"); 38 | value = string.gsub (value, "<", "<"); 39 | value = string.gsub (value, "&", "&"); 40 | return value; 41 | end 42 | 43 | function XmlParser:ParseArgs(s) 44 | local arg = {} 45 | string.gsub(s, "(%w*%-?%w+)=([\"'])(.-)%2", function (w, _, a) 46 | arg[w] = XmlParser:FromXmlString(a); 47 | end) 48 | return arg 49 | end 50 | 51 | function XmlParser:ParseXmlText(xmlText) 52 | local stack = {} 53 | local top = {Name=nil,Value=nil,Attributes={},ChildNodes={}} 54 | table.insert(stack, top) 55 | local ni,c,label,xarg, empty 56 | local i, j = 1, 1 57 | while true do 58 | ni,j,c,label,xarg, empty = string.find(xmlText, "<(%/?)([%w:]+)(.-)(%/?)>", i) 59 | if not ni then break end 60 | local text = string.sub(xmlText, i, ni-1); 61 | if not string.find(text, "^%s*$") then 62 | top.Value=(top.Value or "")..XmlParser:FromXmlString(text); 63 | end 64 | if empty == "/" then -- empty element tag 65 | -- print ("Label:" .. label) -- comment these out 66 | table.insert(top.ChildNodes, {Name=label,Value=nil,Attributes=XmlParser:ParseArgs(xarg),ChildNodes={}}) 67 | elseif c == "" then -- start tag 68 | top = {Name=label, Value=nil, Attributes=XmlParser:ParseArgs(xarg), ChildNodes={}} 69 | table.insert(stack, top) -- new level 70 | -- print("openTag ="..top.Name); -- comment these out 71 | else -- end tag 72 | local toclose = table.remove(stack) -- remove top 73 | -- print("closeTag="..toclose.Name); -- comment these out 74 | top = stack[#stack] 75 | if #stack < 1 then 76 | error("XmlParser: nothing to close with "..label) 77 | end 78 | if toclose.Name ~= label then 79 | error("XmlParser: trying to close "..toclose.Name.." with "..label) 80 | end 81 | table.insert(top.ChildNodes, toclose) 82 | end 83 | i = j+1 84 | end 85 | local text = string.sub(xmlText, i); 86 | if not string.find(text, "^%s*$") then 87 | stack[#stack].Value=(stack[#stack].Value or "")..XmlParser:FromXmlString(text); 88 | end 89 | if #stack > 1 then 90 | error("XmlParser: unclosed "..stack[stack.n].Name) 91 | end 92 | return stack[1].ChildNodes[1]; 93 | end 94 | 95 | function XmlParser:ParseXmlFile(xmlFileName) 96 | local hFile,err = io.open(xmlFileName,"r"); 97 | if (not err) then 98 | local xmlText=hFile:read("*a"); -- read file content 99 | io.close(hFile); 100 | return XmlParser:ParseXmlText(xmlText),nil; 101 | else 102 | return nil,err; 103 | end 104 | end 105 | ------------------------------------------------------------------------------------------ 106 | --example: 107 | 108 | function dump(resourceFile, _class, no_func, depth) 109 | if(not _class) then 110 | print("nil"); 111 | return; 112 | end 113 | 114 | if(depth==nil) then depth=0; end 115 | local str=""; 116 | for n=0,depth,1 do 117 | str=str.."\t"; 118 | end 119 | 120 | resourceFile:write(str.."["..type(_class).."]\n"); 121 | resourceFile:write(str.."{\n"); 122 | 123 | for i,field in pairs(_class) do 124 | if(type(field)=="table") then 125 | resourceFile:write(str.."\t"..tostring(i).." =".."\n"); 126 | dump(resourceFile, field, no_func, depth+1); 127 | else 128 | if(type(field)=="number") then 129 | resourceFile:write(str.."\t"..tostring(i).."="..field.."\n"); 130 | elseif(type(field) == "string") then 131 | resourceFile:write(str.."\t"..tostring(i).."=".."\""..field.."\"\n"); 132 | elseif(type(field) == "boolean") then 133 | resourceFile:write(str.."\t"..tostring(i).."=".."\""..tostring(field).."\"\n"); 134 | else 135 | if(not no_func)then 136 | if(type(field)=="function")then 137 | resourceFile:write(str.."\t"..tostring(i).."()\n"); 138 | else 139 | resourceFile:write(str.."\t"..tostring(i).."\n"); 140 | end 141 | end 142 | end 143 | end 144 | end 145 | resourceFile:write(str.."}\n"); 146 | end 147 | 148 | return XmlParser -------------------------------------------------------------------------------- /Bit/Bit.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL A-15-BIT.ttf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | Color=255,255,255 11 | Scale=1 12 | 13 | ;Shape Converter----------------------------------- 14 | [MeasureTime] 15 | Measure=Time 16 | Format=%I:%M 17 | ;%R for 24-h format 18 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 19 | 20 | [ReplaceTextScript] 21 | Measure=Script 22 | ScriptFile=#CURRENTPATH#ReplaceText.lua 23 | FontSize = (25*#Scale#) 24 | FontFace = A-15-BIT 25 | ;Use font that installed on your computer 26 | SVGfile=#CURRENTPATH#svg.svg 27 | 28 | [Inkscape] 29 | Measure=Plugin 30 | Plugin=RunCommand 31 | Program=""#@#Inkscape\inkscape.exe"" 32 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone.svg"" 33 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"] 34 | 35 | [ScriptVectorConverter] 36 | Measure=Script 37 | ScriptFile=#CURRENTPATH#Converter.lua 38 | SVGfile=#CURRENTPATH#svgdone.svg 39 | 40 | [FileReader] 41 | Measure=Plugin 42 | Plugin=RunCommand 43 | Parameter=dir /B 44 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 45 | DynamicVariables=1 46 | ;-------------------------------------------------- 47 | 48 | [Shape] 49 | Meter=Shape 50 | ;Shift the block where you want with these X,Y 51 | X=0 52 | Y=0 53 | 54 | [MeasureHour] 55 | Measure=Time 56 | Format=%I 57 | IfCondition=#CURRENTSECTION# >= 6 58 | IfTrueAction =[!SetVariable Sweep1 1] 59 | IfFalseAction=[!SetVariable Sweep1 0] 60 | 61 | [MeasureMinute] 62 | Measure=Time 63 | Format=%M 64 | IfCondition=#CURRENTSECTION# >= 30 65 | IfTrueAction =[!SetVariable Sweep2 1] 66 | IfFalseAction=[!SetVariable Sweep2 0] 67 | 68 | [Shape2] 69 | Meter=Shape 70 | X=(200*#Scale#) 71 | Y=(200*#Scale#) 72 | Shape = Ellipse 0,0,(180*#Scale#) | StrokeWidth (5*#Scale#) | StrokeColor #Color#,100 | Fill Color 0,0,0,0 73 | Shape2 = Arc (180*#Scale#*cos(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),((-180*#Scale#)*sin(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),0,(-180*#Scale#),(180*#Scale#),(180*#Scale#),0,1,#Sweep1#,0 | StrokeWidth (5*#Scale#) | Stroke Color #color# 74 | ;If you want Hour arc not relative with minute amount, use Shape2 below instead of above 75 | ;Shape2= Arc (180*#Scale#*cos(PI/2-[MeasureHour]/12*2*PI)),((-180*#Scale#)*sin(PI/2-[MeasureHour]/12*2*PI)),0,(-180*#Scale#),(180*#Scale#),(180*#Scale#),0,1,#Sweep1#,0 | StrokeWidth (5*#Scale#) | Stroke Color #color# 76 | Shape3= Arc (190*#Scale#*cos(PI/2-[MeasureMinute]/60*2*PI)),((-190*#Scale#)*sin(PI/2-[MeasureMinute]/60*2*PI)),0,(-190*#Scale#),(190*#Scale#),(190*#Scale#),0,1,#Sweep2#,0 | StrokeWidth (5*#Scale#) | Stroke Color #color# 77 | DynamicVariables=1 -------------------------------------------------------------------------------- /Bit/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | ClearAllShapePath() 81 | countshape = 0 82 | local union = {} 83 | 84 | for i,shape in pairs(shapes) do 85 | if shape["shape"] ~= nil then 86 | if shape["modifiers"]["Special"]["Display"] then 87 | local shapeName = "Shape" 88 | 89 | if i ~= 1 then shapeName = shapeName .. i end 90 | table.insert(union,'|Union '..shapeName) 91 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 92 | 93 | local sepNum = 1 94 | 95 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 96 | 97 | if sepNum ~= 1 then 98 | for j=(i-1),(i-sepNum),-1 do 99 | union[j] = "" 100 | end 101 | end 102 | 103 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 104 | if modifierName ~= "Special" then 105 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 106 | end 107 | end 108 | 109 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 110 | meterOptions = meterOptions .. " | StrokeWidth 0" 111 | end 112 | 113 | meterOptions = meterOptions .. "\"]" 114 | 115 | if shape["path"] ~= nil then 116 | paths[#paths+1] = shape["path"] 117 | end 118 | end 119 | countshape = countshape + 1 120 | 121 | end 122 | end 123 | 124 | countpath = 0 125 | for i, path in pairs(paths) do 126 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 127 | countpath = countpath + 1 128 | end 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0\"]" 130 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 131 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+3).." \"Ellipse (200*#Scale#),(200*#Scale#),(110*#Scale#)|StrokeWidth 0 |Fill Color #color#\"]" 132 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."\"]" 133 | 134 | SKIN:Bang(meterOptions..'[!UpdateMeter Shape]') 135 | end 136 | 137 | function ClearAllShapePath() 138 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 139 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 140 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 141 | end -------------------------------------------------------------------------------- /Bit/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | text= SKIN:GetMeasure('MeasureTime'):GetStringValue() 4 | font = SELF:GetOption('FontFace') 5 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 6 | realFontSize = math.ceil(fontsize*100/70) 7 | X = 200*scale 8 | Y = 200*scale+fontsize/2 9 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 10 | template={ 11 | "", 12 | "", 22 | "", 24 | "", 26 | "", 27 | "", 29 | "image/svg+xml", 30 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | ""..text.."", 43 | } 44 | file:write(table.concat(template, "\n")) 45 | file:close() 46 | 47 | SKIN:Bang('[!CommandMeasure Inkscape "Run"]') 48 | 49 | end -------------------------------------------------------------------------------- /Clear Futurist/Clear Futurist.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | DynamicWindowSize=1 4 | 5 | [Variables] 6 | Color=255,255,255 7 | Size=200 8 | 9 | BottomLineLenght=[MeasureMonthBottomLineLenght] 10 | RightLineLenght=[MeasureMonthRightLineLenght] 11 | 12 | ;Shorten Bottom and Right side of square to fit month text 13 | [MeasureMonthBottomLineLenght] 14 | Measure=Time 15 | Format=%b 16 | Substitute="Jan":"(#size#/4)","Feb":"(#size#/20)","Mar":"(#size#*13/40)","Apr":"(#size#/2)","May":"(#size#*9/20)","Jun":"(#size#*2/5)","Jul":"(#size#*9/20)","Aug":"(#size#*2/5)","Sep":"(#size#/10)","Oct":"(#size#/5)","Nov":"(#size#/10)","Dec":"(#size#/10)" 17 | 18 | [MeasureMonthRightLineLenght] 19 | Measure=Time 20 | Format=%b 21 | Substitute="Jan":"(#size#*7/10)","Feb":"(#size#*7/10)","Mar":"(#size#*11/20)","Apr":"(#size#*11/20)","May":"(#size#*3/4)","Jun":"(#size#*3/4)","Jul":"(#size#*3/4)","Aug":"(#size#*7/10)","Sep":"(#size#*11/20)","Oct":"(#size#*7/10)","Nov":"(#size#*11/20)","Dec":"(#size#*11/20)" 22 | ;--------------------------------------------------------- 23 | 24 | [Square] 25 | Meter=Shape 26 | Shape=Rectangle (#size#),(#size#/10),#size#,(#size#*3/200) | Fill Color #Color# | StrokeWidth 0 27 | Shape2=Rectangle (#size#),(#size#/10),(#size#*3/200),#size# | Fill Color #Color# | StrokeWidth 0 28 | Shape3=Rectangle (#size#),(#size#/10+#size#),#BottomLineLenght#,(#size#*3/200) | Fill Color #Color# | StrokeWidth 0 29 | Shape4=Rectangle (#size#+#size#),(#size#/10),(#size#*3/200),#RightLineLenght# | Fill Color #Color# | StrokeWidth 0 30 | DynamicVariables=1 31 | 32 | [MeasureMonth] 33 | Measure=Time 34 | Format=%B 35 | 36 | [Month] 37 | Meter=String 38 | MeasureName=MeasureMonth 39 | FontFace=Agatha Needs Flesh 40 | FontSize=(#size#*3/8) 41 | FontColor=#Color# 42 | StringAlign=CenterCenter 43 | AntiAlias=1 44 | Angle=(-PI/8) 45 | X=(-#size#*7/20)R 46 | Y=(-#size#/40)R 47 | DynamicVariables=1 48 | 49 | [MeasureTime] 50 | Measure=Time 51 | Format=%H %M 52 | Substitute="00":"Zero","01":"One","02":"Two","03":"Three","04":"Four","05":"Five","06":"Six","07":"Seven","08":"Eight","09":"Nine","10":"Ten","11":"Eleven","12":"Twelve","13":"Thirteen","14":"Fourteen","15":"Fifteen","16":"Sixteen","17":"Seventeen","18":"Eighteen","19":"Nineteen","20":"Twenty","21":"TwentyOne","22":"TwentyTwo","23":"TwentyThree","24":"TwentyFour","25":"TwentyFive","26":"TwentySix","27":"TwentySeven","28":"TwentyEight","29":"TwentyNine","30":"Thirty","31":"ThirtyOne","32":"ThirtyTwo","33":"ThirtyThree","34":"ThirtyFour","35":"ThirtyFive","36":"ThirtySix","37":"ThirtySeven","38":"ThirtyEight","39":"ThirtyNine","40":"Forty","41":"FortyOne","42":"FortyTwo","43":"FortyThree","44":"FortyFour","45":"FortyFive","46":"FortySix","47":"FortySeven","48":"FortyEight","49":"FortyNine","50":"Fifty","51":"FiftyOne","52":"FiftyTwo","53":"FiftyThree","54":"FiftyFour","55":"FiftyFive","56":"FiftySix","57":"FiftySeven","58":"FiftyEight","59":"FiftyNine" 53 | 54 | [Time] 55 | Meter=String 56 | MeasureName=MeasureTime 57 | FontFace=Futurist Fixed-width 58 | FontSize=(#size#*9/100) 59 | StringStyle=Bold 60 | StringCase=Upper 61 | FontColor=#Color# 62 | StringAlign=CenterCenter 63 | X=(#size#*3/2) 64 | Y=(-#size#/100)R 65 | AntiAlias=1 66 | DynamicVariables=1 67 | 68 | [MeasureDate] 69 | Measure=Time 70 | Format=%A-%d 71 | 72 | [Date] 73 | Meter=String 74 | MeasureName=MeasureDate 75 | FontFace=Futurist Fixed-width 76 | StringStyle=Bold 77 | FontSize=(#size#*9/100) 78 | StringCase=Upper 79 | FontColor=#Color# 80 | StringAlign=CenterCenter 81 | X=r 82 | Y=(#size#/20)R 83 | AntiAlias=1 84 | DynamicVariables=1 -------------------------------------------------------------------------------- /Clock Future Style/Clock Future Style.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | 6 | [Variables] 7 | Color=255,255,255 8 | Scale=1 9 | 10 | [MeasureHour] 11 | Measure=Time 12 | Format=%I 13 | 14 | [MeasureMinute] 15 | Measure=Time 16 | Format=%M 17 | 18 | [Shape] 19 | Meter=Shape 20 | X=(100*#Scale#) 21 | Y=(100*#Scale#) 22 | Shape = Ellipse 0,0,(90*#Scale#) | StrokeWidth (3*#Scale#) | StrokeColor #Color# | Fill Color 0,0,0,0 23 | Shape2= Rectangle (-4*#Scale#+(45/2)*#Scale#*cos(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),((-45/2)*#Scale#-(45/2)*#Scale#*sin(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),(8*#Scale#),(45*#Scale#),(4*#Scale#) | Rotate (([MeasureHour]*60+[MeasureMinute])/720*360) | StrokeWidth 0 24 | Shape3= Rectangle (-4*#Scale#+35*#Scale#*cos(PI/2-[MeasureMinute]/60*2*PI)),(-35*#Scale#-35*#Scale#*sin(PI/2-[MeasureMinute]/60*2*PI)),(8*#Scale#),(70*#Scale#),(4*#Scale#) | Rotate ([MeasureMinute]/60*360) | StrokeWidth 0 25 | Shape4= Ellipse 0,0,(10*#Scale#) | StrokeWidth 0 | Fill Color #color# 26 | Shape5= Rectangle (150*#Scale#),(-90*#Scale#),(3*#Scale#),(180*#Scale#) | StrokeWidth 0 | Fill Color #color# 27 | DynamicVariables=1 28 | 29 | [MeasureTime] 30 | Measure=Time 31 | Format=%I:%M%p 32 | 33 | [MeasureDate] 34 | Measure=Time 35 | Format=%B %d,%Y 36 | FormatLocale=Local 37 | 38 | [MeasureWeekDay] 39 | Measure=Time 40 | Format=%A 41 | FormatLocale=Local 42 | 43 | [Time] 44 | Meter=String 45 | MeasureName=MeasureTime 46 | FontColor=#Color# 47 | FontFace=Futurist Fixed-width 48 | FontSize=(31*#scale#) 49 | StringCase=Upper 50 | AntiAlias=1 51 | Y=(30*#scale#) 52 | X=(300*#scale#) 53 | 54 | [Date] 55 | Meter=String 56 | MeasureName=MeasureDate 57 | FontColor=#Color# 58 | FontFace=Futurist Fixed-width 59 | FontSize=(20*#scale#) 60 | StringCase=Upper 61 | AntiAlias=1 62 | Y=(10*#scale#)R 63 | X=r 64 | 65 | [WeekDay] 66 | Meter=String 67 | MeasureName=MeasureWeekDay 68 | FontColor=#Color# 69 | FontFace=Futurist Fixed-width 70 | FontSize=(20*#scale#) 71 | StringCase=Upper 72 | AntiAlias=1 73 | Y=(10*#scale#)R 74 | X=r -------------------------------------------------------------------------------- /Clock Hun Style/Clock Hun Style.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | 6 | [Variables] 7 | Color=255,255,255 8 | Scale=1 9 | 10 | [MeasureHour] 11 | Measure=Time 12 | Format=%I 13 | 14 | [MeasureMinute] 15 | Measure=Time 16 | Format=%M 17 | 18 | [Shape] 19 | Meter=Shape 20 | X=(200*#Scale#) 21 | Y=(200*#Scale#) 22 | Shape = Ellipse 0,0,(90*#Scale#) | StrokeWidth (3*#Scale#) | StrokeColor #Color# | Fill Color 0,0,0,0 23 | Shape2= Rectangle (-4*#Scale#+(45/2)*#Scale#*cos(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),((-45/2)*#Scale#-(45/2)*#Scale#*sin(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),(8*#Scale#),(45*#Scale#),(4*#Scale#) | Rotate (([MeasureHour]*60+[MeasureMinute])/720*360) 24 | Shape3= Rectangle (-2*#Scale#+50*#Scale#*cos(PI/2-[MeasureMinute]/60*2*PI)),(-50*#Scale#-50*#Scale#*sin(PI/2-[MeasureMinute]/60*2*PI)),(4*#Scale#),(100*#Scale#),(2*#Scale#) | Rotate ([MeasureMinute]/60*360) 25 | Shape4= Ellipse 0,0,(10*#Scale#) | StrokeWidth 0 | Fill Color #color# 26 | Shape5= Ellipse 0,0,(6*#Scale#) 27 | Shape6= Combine Shape4 | Union Shape2 | Union Shape 3 | XOR Shape5 28 | 29 | Shape7= Rectangle (-90*#Scale#),(220*#Scale#),(180*#Scale#),(50*#Scale#),(10*#Scale#) | StrokeWidth (2*#Scale#) | StrokeColor #Color# | Fill Color 0,0,0,0 30 | DynamicVariables=1 31 | 32 | [MeasureTime] 33 | Measure=Time 34 | Format=%#I:%M 35 | ;%R for 24-h format 36 | 37 | [Time] 38 | Meter=String 39 | MeasureName=MeasureTime 40 | FontColor=#Color# 41 | FontFace=HUN-din 1451 42 | FontSize=(50*#scale#) 43 | StringAlign=Center 44 | AntiAlias=1 45 | Y=(330*#scale#) 46 | X=(200*#scale#) 47 | 48 | [MeasureDate] 49 | Measure=Time 50 | Format=%A-%d 51 | FormatLocale=Local 52 | 53 | [Date] 54 | Meter=String 55 | MeasureName=MeasureDate 56 | FontColor=#Color# 57 | FontFace=Alte Haas Grotesk 58 | StringCase=Lower 59 | FontSize=(15*#scale#) 60 | StringAlign=Center 61 | AntiAlias=1 62 | Y=(432*#scale#) 63 | X=(200*#scale#) -------------------------------------------------------------------------------- /Clock Neo Style/Clock Neo Style.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | 6 | [Variables] 7 | Color=255,255,255 8 | Scale=1 9 | 10 | [MeasureHour] 11 | Measure=Time 12 | Format=%I 13 | 14 | [MeasureMinute] 15 | Measure=Time 16 | Format=%M 17 | 18 | [Shape] 19 | Meter=Shape 20 | Shape = Ellipse (200*#Scale#),(200*#Scale#),(90*#Scale#) | StrokeWidth (3*#Scale#) | StrokeColor #Color# | Fill Color 0,0,0,0 21 | Shape2= Rectangle (196*#Scale#+(45/2)*#Scale#*cos(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),((200-45/2)*#Scale#-(45/2)*#Scale#*sin(PI/2-([MeasureHour]*60+[MeasureMinute])/720*2*PI)),(8*#Scale#),(45*#Scale#),(4*#Scale#) | Rotate (([MeasureHour]*60+[MeasureMinute])/720*360) 22 | Shape3= Rectangle (198*#Scale#+35*#Scale#*cos(PI/2-[MeasureMinute]/60*2*PI)),(165*#Scale#-35*#Scale#*sin(PI/2-[MeasureMinute]/60*2*PI)),(4*#Scale#),(70*#Scale#),(2*#Scale#) | Rotate ([MeasureMinute]/60*360) 23 | Shape4= Ellipse (200*#Scale#),(200*#Scale#),(10*#Scale#) | StrokeWidth 0 | Fill Color #color# 24 | Shape5= Ellipse (200*#Scale#),(200*#Scale#),(6*#Scale#) 25 | Shape6= Combine Shape4 | Union Shape2 | Union Shape 3 | XOR Shape5 26 | DynamicVariables=1 27 | 28 | [MeasureWeekDay] 29 | Measure=Time 30 | Format=%A 31 | FormatLocale=Local 32 | 33 | [WeekDay] 34 | Meter=String 35 | MeasureName=MeasureWeekDay 36 | FontColor=#Color# 37 | FontFace=Graced Script PERSONAL USE 38 | FontSize=(50*#scale#) 39 | StringCase=Lower 40 | StringAlign=Center 41 | AntiAlias=1 42 | Y=(320*#scale#) 43 | X=(200*#scale#) 44 | 45 | [MeasureDate] 46 | Measure=Time 47 | Format=%B %d,%Y 48 | FormatLocale=Local 49 | 50 | [Date] 51 | Meter=String 52 | MeasureName=MeasureDate 53 | FontColor=#Color# 54 | FontFace=Futurist Fixed-width 55 | StringCase=Upper 56 | FontSize=(11*#scale#) 57 | StringAlign=Center 58 | AntiAlias=1 59 | Y=(390*#scale#) 60 | X=(200*#scale#) -------------------------------------------------------------------------------- /College/College.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL SF_Collegiate_Solid.ttf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | ;Month and Weekday text color 11 | Color=255,255,255 12 | ;Circle inside color 13 | Color2=255,255,255 14 | Scale=1 15 | 16 | ;Shape Converter----------------------------------- 17 | [MeasureWeekDay] 18 | Measure=Time 19 | Format=%A 20 | FormatLocale=Local 21 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 22 | 23 | [MeasureMonth] 24 | Measure=Time 25 | Format=%B 26 | FormatLocale=Local 27 | 28 | [ReplaceTextScript] 29 | Measure=Script 30 | ScriptFile=#CURRENTPATH#ReplaceText.lua 31 | FontSize=(100*#Scale#) 32 | FontFace =SF Collegiate Solid 33 | ;Use font that installed on your computer 34 | SVGfile=#CURRENTPATH#svg.svg 35 | 36 | [Inkscape] 37 | Measure=Plugin 38 | Plugin=RunCommand 39 | Program=""#@#Inkscape\inkscape.exe"" 40 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone.svg"" 41 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"][!Commandmeasure ReplaceTextScript2 "replacetext()"] 42 | 43 | [ScriptVectorConverter] 44 | Measure=Script 45 | ScriptFile=#CURRENTPATH#Converter.lua 46 | SVGfile=#CURRENTPATH#svgdone.svg 47 | SVGfile2=#CURRENTPATH#svgdone2.svg 48 | [FileReader] 49 | Measure=Plugin 50 | Plugin=RunCommand 51 | Parameter=dir /B 52 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 53 | DynamicVariables=1 54 | ;-------------------------------------------------- 55 | 56 | ;Shape Converter 2----------------------------------- 57 | [MeasureDay] 58 | Measure=Time 59 | Format=%d 60 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 61 | 62 | [ReplaceTextScript2] 63 | Measure=Script 64 | ScriptFile=#CURRENTPATH#ReplaceText2.lua 65 | FontSize=(40*#Scale#) 66 | FontFace =SF Collegiate Solid 67 | ;Use font that installed on your computer 68 | SVGfile=#CURRENTPATH#svg2.svg 69 | 70 | [Inkscape2] 71 | Measure=Plugin 72 | Plugin=RunCommand 73 | Program=""#@#Inkscape\inkscape.exe"" 74 | Parameter=""#CURRENTPATH#svg2.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone2.svg"" 75 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile2()"] 76 | ;-------------------------------------------------- 77 | 78 | [Shape] 79 | Meter=Shape 80 | 81 | [Shape2] 82 | Meter=Shape 83 | 84 | [MeasureTime] 85 | Measure=Time 86 | Format=%I:%M %p 87 | 88 | [Time] 89 | Meter=String 90 | MeasureName=MeasureTime 91 | FontColor=#Color# 92 | FontFace=Futurist Fixed-width 93 | StringAlign=Center 94 | StringCase=Upper 95 | FontSize=(20*#scale#) 96 | AntiAlias=1 97 | Y=(60*#Scale#) 98 | X=(300*#scale#) -------------------------------------------------------------------------------- /College/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0\"]" 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 130 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+3).." \"Ellipse (300*#scale#),(200*#scale#),(60*#scale#) | StrokeWidth 0 | Fill Color #Color#\"]" 131 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."|Intersect Shape"..(countshape+2).."\"]" 132 | SKIN:Bang(meterOptions) 133 | end 134 | 135 | function ClearAllShapePath() 136 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 137 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 138 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 139 | end 140 | 141 | function ConvertFile2() 142 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile2")) 143 | local shapes = xmlToShape(path) 144 | 145 | local paths = {} 146 | 147 | local meterOptions = "" 148 | 149 | countshape2 = 0 150 | local union = {} 151 | 152 | for i,shape in pairs(shapes) do 153 | if shape["shape"] ~= nil then 154 | if shape["modifiers"]["Special"]["Display"] then 155 | local shapeName = "Shape" 156 | 157 | if i ~= 1 then shapeName = shapeName .. i end 158 | table.insert(union,'|Union '..shapeName) 159 | meterOptions = meterOptions .. "[!SetOption Shape2 " .. shapeName .. " \"" .. shape["shape"] 160 | 161 | local sepNum = 1 162 | 163 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 164 | 165 | if sepNum ~= 1 then 166 | for j=(i-1),(i-sepNum),-1 do 167 | union[j] = "" 168 | end 169 | end 170 | 171 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 172 | if modifierName ~= "Special" then 173 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 174 | end 175 | end 176 | 177 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 178 | meterOptions = meterOptions .. " | StrokeWidth 0" 179 | end 180 | 181 | meterOptions = meterOptions .. "\"]" 182 | 183 | if shape["path"] ~= nil then 184 | paths[#paths+1] = shape["path"] 185 | end 186 | end 187 | countshape2 = countshape2 + 1 188 | 189 | end 190 | end 191 | 192 | countpath2 = 0 193 | for i, path in pairs(paths) do 194 | meterOptions = meterOptions .. "[!SetOption Shape2 Path" .. i .. " \"" .. path .. "\"]" 195 | countpath2 = countpath2 + 1 196 | end 197 | meterOptions = meterOptions .. "[!SetOption Shape2 Shape"..(countshape2+1).." \"Rectangle 0,0,0,0|StrokeWidth 0 \"]" 198 | meterOptions = meterOptions .. "[!SetOption Shape2 Shape"..(countshape2+2).." \"Combine Shape"..(countshape2+1)..table.concat(union).."\"]" 199 | meterOptions = meterOptions .. "[!SetOption Shape2 Shape"..(countshape2+3).." \"Ellipse (300*#scale#),(200*#scale#),(53*#scale#) | StrokeWidth 0 | Fill Color #Color2#\"]" 200 | meterOptions = meterOptions .. "[!SetOption Shape2 Shape"..(countshape2+4).." \"Combine Shape"..(countshape2+3).."|XOR Shape"..(countshape2+2).."\"]" 201 | SKIN:Bang(meterOptions) 202 | end 203 | 204 | function ClearAllShapePath2() 205 | SKIN:Bang('[!SetOption Shape2 Shape \"\"]') 206 | for i=2,(countshape2+4) do SKIN:Bang('[!SetOption Shape2 Shape'..i..' \"\"]') end 207 | for i=1,countpath2 do SKIN:Bang('[!SetOption Shape2 Path'..i..' \"\"]') end 208 | end -------------------------------------------------------------------------------- /College/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | line1= string.lower(SKIN:GetMeasure('MeasureWeekDay'):GetStringValue()) 4 | line2= string.lower(SKIN:GetMeasure('MeasureMonth'):GetStringValue()) 5 | font = SELF:GetOption('FontFace') 6 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 7 | realFontSize = math.ceil(fontsize*100/70) 8 | X = 300*scale 9 | Y = 190*scale 10 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 11 | template={ 12 | "", 13 | "", 23 | "", 25 | "", 27 | "", 28 | "", 30 | "image/svg+xml", 31 | "", 33 | "", 34 | "", 35 | "", 36 | "", 37 | ""..line1.."", 44 | ""..line2.."" 51 | } 52 | file:write(table.concat(template, "\n")) 53 | file:close() 54 | 55 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 56 | 57 | end -------------------------------------------------------------------------------- /College/ReplaceText2.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | text= string.lower(SKIN:GetMeasure('MeasureDay'):GetStringValue()) 4 | font = SELF:GetOption('FontFace') 5 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 6 | realFontSize = math.ceil(fontsize*100/70) 7 | X = 300*scale 8 | Y = 200*scale+fontsize/2 9 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 10 | template={ 11 | "", 12 | "", 22 | "", 24 | "", 26 | "", 27 | "", 29 | "image/svg+xml", 30 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | ""..text.."", 43 | } 44 | file:write(table.concat(template, "\n")) 45 | file:close() 46 | 47 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath2()"][!CommandMeasure Inkscape2 "Run"]') 48 | 49 | end -------------------------------------------------------------------------------- /Exclusive/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0\"]" 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 130 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+3).." \"Rectangle 0,0,(200*#Scale#),(200*#Scale#)|StrokeWidth 0 |Fill Color #color#\"]" 131 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."\"]" 132 | SKIN:Bang(meterOptions..'[!UpdateMeter Shape]') 133 | end 134 | 135 | function ClearAllShapePath() 136 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 137 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 138 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 139 | end -------------------------------------------------------------------------------- /Exclusive/Exclusive.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL Galano Grotesque DEMO Bold.otf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | Color=255,255,255 11 | Scale=1 12 | 13 | ;Shape Converter----------------------------------- 14 | [MeasureDay] 15 | Measure=Time 16 | Format=#%#d 17 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 18 | 19 | [MeasureMonth] 20 | Measure=Time 21 | Format=%b. 22 | 23 | [ReplaceTextScript] 24 | Measure=Script 25 | ScriptFile=#CURRENTPATH#ReplaceText.lua 26 | FontSize = (26*#Scale#) 27 | FontSize2= (52*#Scale#) 28 | FontFace = GalanoGrotesqueDEMO-Bold 29 | ;Use font that installed on your computer 30 | SVGfile=#CURRENTPATH#svg.svg 31 | 32 | [Inkscape] 33 | Measure=Plugin 34 | Plugin=RunCommand 35 | Program=""#@#Inkscape\inkscape.exe"" 36 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone.svg"" 37 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"] 38 | 39 | [ScriptVectorConverter] 40 | Measure=Script 41 | ScriptFile=#CURRENTPATH#Converter.lua 42 | SVGfile=#CURRENTPATH#svgdone.svg 43 | 44 | [FileReader] 45 | Measure=Plugin 46 | Plugin=RunCommand 47 | Parameter=dir /B 48 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 49 | DynamicVariables=1 50 | ;-------------------------------------------------- 51 | 52 | [Shape] 53 | Meter=Shape 54 | ;Shift the block where you want with these X,Y 55 | X=0 56 | Y=0 57 | 58 | [MeasureDate] 59 | Measure=Time 60 | Format=%A 61 | 62 | [Date] 63 | Meter=String 64 | MeasureName=MeasureDate 65 | FontFace=Futurist Fixed-width 66 | FontSize=(16*#Scale#) 67 | StringCase=Upper 68 | FontColor=#Color# 69 | StringAlign=CenterTop 70 | X=(100*#Scale#) 71 | Y=(210*#Scale#) 72 | AntiAlias=1 73 | DynamicVariables=1 -------------------------------------------------------------------------------- /Exclusive/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | day= SKIN:GetMeasure('MeasureDay'):GetStringValue() 4 | month= SKIN:GetMeasure('MeasureMonth'):GetStringValue() 5 | font = SELF:GetOption('FontFace') 6 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 7 | realFontSize = math.ceil(fontsize*100/70) 8 | fontsize2 = SKIN:ParseFormula('('..SELF:GetOption('FontSize2')..')') 9 | realFontSize2 = math.ceil(fontsize2*100/70) 10 | X1 = 15*scale 11 | Y1 = 45*scale 12 | X2 = 120*scale 13 | Y2 = 175*scale 14 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 15 | template={ 16 | "", 17 | "", 27 | "", 29 | "", 31 | "", 32 | "", 34 | "image/svg+xml", 35 | "", 37 | "", 38 | "", 39 | "", 40 | "", 41 | ""..day.."", 47 | ""..month.."", 53 | "" 54 | } 55 | file:write(table.concat(template, "\n")) 56 | file:close() 57 | 58 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 59 | 60 | end -------------------------------------------------------------------------------- /Glacial Contrast/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0\"][!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"][!SetOption Shape Shape"..(countshape+3).." \"Rectangle 0,(160*#scale#),(220*#scale#),(120*#scale#) | StrokeWidth 0 | Fill Color #Color#\"][!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."\"]" 129 | SKIN:Bang(meterOptions) 130 | end 131 | 132 | function ClearAllShapePath() 133 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 134 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 135 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 136 | end -------------------------------------------------------------------------------- /Glacial Contrast/Glacial Contrast.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Glacial Contrast/Glacial Contrast.ini -------------------------------------------------------------------------------- /Glacial Contrast/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | text = SKIN:GetMeasure('MeasureHour'):GetStringValue() 4 | font = SELF:GetOption('FontFace') 5 | fontsize = SKIN:ParseFormula('('..SKIN:GetMeter('Minute'):GetOption('FontSize')..')') 6 | realFontSize = math.ceil(fontsize*100/70) 7 | X = 220*scale/2 8 | Y = 160*scale + 120*scale/2 + fontsize/2 9 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 10 | template={ 11 | "", 12 | "", 22 | "", 24 | "", 26 | "", 27 | "", 29 | "image/svg+xml", 30 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | ""..text.."", 43 | "" 44 | } 45 | file:write(table.concat(template, "\n")) 46 | file:close() 47 | 48 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 49 | 50 | end -------------------------------------------------------------------------------- /Lion/Lion.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | 4 | [Variables] 5 | Color=255,255,255 6 | Size=200 7 | 8 | [Lion] 9 | Meter=String 10 | Text=T 11 | FontFace=Lions 12 | FontSize=#Size# 13 | FontColor=#Color# 14 | AntiAlias=1 15 | StringAlign=CenterCenter 16 | X=#Size# 17 | Y=(#Size#*0.6) 18 | 19 | [MeasureDayname] 20 | Measure=Time 21 | Format=%A'S 22 | 23 | [Dayname] 24 | Meter=String 25 | MeasureName=MeasureDayname 26 | StringCase=Upper 27 | FontFace=AUSTRALIA TITLE 28 | FontSize=(#Size#*16/61) 29 | FontColor=#Color# 30 | AntiAlias=1 31 | StringAlign=CenterCenter 32 | X=r 33 | Y=(#Size#*40/61)r 34 | DynamicVariables=1 35 | 36 | [MeasureTime] 37 | Measure=Time 38 | Format=%Hx%M 39 | 40 | [Time] 41 | Meter=String 42 | MeasureName=MeasureTime 43 | FontFace=Avantgarde 44 | FontSize=(#Size#*11/122) 45 | FontColor=#Color# 46 | AntiAlias=1 47 | StringAlign=CenterCenter 48 | X=r 49 | Y=(#Size#*20/61)r 50 | DynamicVariables=1 51 | 52 | [MeasureDate] 53 | Measure=Time 54 | Format=%d %B %Y 55 | 56 | [Date] 57 | Meter=String 58 | MeasureName=MeasureDate 59 | StringCase=Upper 60 | FontFace=Blackout 61 | FontSize=(#Size#*15/122) 62 | FontColor=#Color# 63 | AntiAlias=1 64 | StringAlign=CenterCenter 65 | X=r 66 | Y=(#Size#*15/61)r 67 | DynamicVariables=1 -------------------------------------------------------------------------------- /Pacific Futurist/Pacific Futurist.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | 6 | [Variables] 7 | Color=255,255,255 8 | Scale=1 9 | 10 | [MeasureHour] 11 | Measure=Time 12 | Format=%I 13 | Substitute="00":"Zero","01":"One","02":"Two","03":"Three","04":"Four","05":"Five","06":"Six","07":"Seven","08":"Eight","09":"Nine","10":"Ten","11":"Eleven","12":"Twelve" 14 | 15 | [Hour] 16 | Meter=String 17 | MeasureName=MeasureHour 18 | FontColor=#Color# 19 | FontFace=Pacifico 20 | FontSize=(100*#scale#) 21 | StringAlign=Center 22 | AntiAlias=1 23 | Y=(100*#scale#) 24 | X=(200*#scale#) 25 | 26 | [Shape] 27 | Meter=Shape 28 | Shape=Path Underline | StrokeWidth (10*#Scale#) | StrokeColor #Color# | StrokeStartCap Round | StrokeEndCap Round 29 | Underline= ([Hour:X]-20*#Scale#),(330*#Scale#) | Curveto ([Hour:X]+[Hour:W]+20*#Scale#),(310*#Scale#),([Hour:X]+[Hour:W]/2),(305*#Scale#) 30 | Shape2=Ellipse ([Hour:X]+[Hour:W]+40*#Scale#),(310*#Scale#),(8*#Scale#) | StrokeWidth 0 31 | Shape3=Ellipse (320*#Scale#),(160*#Scale#),(40*#Scale#) | StrokeWidth 0 32 | DynamicVariables=1 33 | 34 | [MeasureDate] 35 | Measure=Time 36 | Format=%m-%d-%Y#CRLF#%A 37 | 38 | [Date] 39 | Meter=String 40 | MeasureName=MeasureDate 41 | FontColor=#Color# 42 | FontFace=Futurist Fixed-width 43 | StringStyle=Bold 44 | StringAlign=Center 45 | StringCase=Upper 46 | FontSize=(20*#scale#) 47 | AntiAlias=1 48 | Y=(350*#Scale#) 49 | X=(200*#scale#) 50 | 51 | [MeasureMinute] 52 | Measure=Time 53 | Format=%M 54 | 55 | [Minute] 56 | Meter=String 57 | MeasureName=MeasureMinute 58 | FontColor=0,0,0 59 | FontFace=Elegant Lux Mager 60 | StringAlign=CenterCenter 61 | FontSize=(25*#scale#) 62 | AntiAlias=1 63 | Y=(160*#scale#) 64 | X=(320*#scale#) -------------------------------------------------------------------------------- /Pacific/Pacific.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | 6 | [Variables] 7 | Color=255,255,255 8 | Scale=1 9 | 10 | [MeasureMonth] 11 | Measure=Time 12 | Format=%b. 13 | 14 | [Month] 15 | Meter=String 16 | MeasureName=MeasureMonth 17 | FontColor=#Color# 18 | FontFace=Pacifico 19 | FontSize=(100*#scale#) 20 | StringAlign=Right 21 | AntiAlias=1 22 | Y=(-60*#scale#) 23 | X=(500*#scale#) 24 | 25 | [MeasureYearTimeDate] 26 | Measure=Time 27 | Format=%Y#CRLF#%I:%M %p on %A %d 28 | 29 | [YearTimeDate] 30 | Meter=String 31 | MeasureName=MeasureYearTimeDate 32 | FontColor=#Color# 33 | FontFace=GeosansLight 34 | FontSize=(22*#scale#) 35 | StringCase=Upper 36 | StringAlign=Right 37 | AntiAlias=1 38 | Y=(-30*#scale#)R 39 | X=(-30*#scale#)r 40 | 41 | -------------------------------------------------------------------------------- /Product/Product.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | 4 | [Variables] 5 | Color=255,255,255 6 | Size=160 7 | 8 | [MeasureTimeDayName] 9 | Measure=Time 10 | Format=%H%M %a 11 | 12 | [TimeDayName] 13 | Meter=String 14 | MeasureName=MeasureTimeDayName 15 | FontSize=(#Size#/2) 16 | FontFace=Product Sans 17 | FontColor=#Color# 18 | StringCase=Upper 19 | StringAlign=CenterCenter 20 | AntiAlias=1 21 | X=(#size#*1.75) 22 | Y=(#Size#/2.5) 23 | InlineSetting=Color | #Color#,150 24 | InlinePattern=\d\d(\d\d) 25 | DynamicVariables=1 26 | 27 | [MeasureDayYear] 28 | Measure=Time 29 | Format=%d%b'%y 30 | 31 | [DateYear] 32 | Meter=String 33 | MeasureName=MeasureDayYear 34 | FontSize=(#Size#/2) 35 | FontFace=Product Sans 36 | FontColor=#Color# 37 | StringCase=Upper 38 | StringAlign=CenterCenter 39 | AntiAlias=1 40 | X=r 41 | Y=(-#Size#*3/8)R 42 | InlineSetting=Color | #Color#,150 43 | InlinePattern=(\d\d).* 44 | DynamicVariables=1 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mnml UI for Rainmeter 2 | [![GitHub release](https://img.shields.io/github/release/khanhas/mnmlUI.svg?colorB=97CA00?label=version)](https://github.com/khanhas/mnmlUI/releases/latest) [![Github All Releases](https://img.shields.io/github/downloads/khanhas/mnmlUI/total.svg?colorB=97CA00)](https://github.com/khanhas/mnmlUI/releases) 3 | 4 | A date and clock collection 5 | 6 | All was designed by ppick CH. If you like these skins, consider install [mnml UI](https://play.google.com/store/apps/details?id=com.bedefined.mnmlui) app and give it a like. 7 | 8 | Almost all skins are scalable infinitely. So I need to include VectorConverter by theAzack9 and Inkscape to automatically generate shapes. 9 | 10 | # How to use 11 | - Download rmskin pack from [release page](https://github.com/khanhas/mnmlUI/releases/). 12 | - Install (installing time is going to take a while, so be patient). 13 | - Access `@Resources\Inkscape` and open `Inkscape.exe`. 14 | - Hit Ctrl+Shift+P or Edit\Preferences in menu. 15 | - Input\Output page -> SVG output -> Path string format: Absolute. ![instruction](https://i.imgur.com/ZbyltRV.png) 16 | - Close Preferences and Inkscape windows 17 | - Now just load the skin you want. Check these demo images below and make sure you install font if skin is needed. 18 | 19 | # Demos 20 | ![imgur1](https://i.imgur.com/RdokE1o.png) ![imgur2](https://i.imgur.com/umAeCSl.png) ![imgur3](https://i.imgur.com/rSeM0NG.png) ![imgur4](https://i.imgur.com/FOf5UkV.png) ![imgur5](https://i.imgur.com/6pYTha7.png) ![imgur6](https://i.imgur.com/CJ0cyVm.png) ![imgur7](https://i.imgur.com/y6sop8t.png) ![imgur8](https://i.imgur.com/IrX8tm6.png) ![imgur9](https://i.imgur.com/PRby0m8.png) ![imgur10](https://i.imgur.com/6CpqAdP.png) ![imgur11](https://i.imgur.com/Pack31h.png) ![imgur12](https://i.imgur.com/SrBm1pN.png) ![imgur13](https://i.imgur.com/8M0NvVS.png) ![imgur14](https://i.imgur.com/wvrP2wy.png) ![imgur15](https://i.imgur.com/ueaYBlw.png) ![imgur16](https://i.imgur.com/bg6OOUi.png) ![imgur17](https://i.imgur.com/wSku0XS.png) ![imgur18](https://i.imgur.com/ir21GGE.png) ![imgur19](https://i.imgur.com/Wyp929w.png) 21 | 22 | # Credits 23 | - [mnml UI for Zooper](https://play.google.com/store/apps/details?id=com.bedefined.mnmlui) from pppick CH 24 | - [VectorConverter](https://forum.rainmeter.net/viewtopic.php?f=27&t=25334) from [TheAzack9](https://github.com/theazack9) 25 | - [Inkscape](https://inkscape.org) 26 | -------------------------------------------------------------------------------- /Retro/Retro.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | 4 | [Variables] 5 | Color=255,255,255 6 | Size=160 7 | 8 | [MeasureDayMonth] 9 | Measure=Time 10 | Format=%d'%b 11 | 12 | [DayMonth] 13 | Meter=String 14 | MeasureName=MeasureDayMonth 15 | FontSize=(#Size#/2) 16 | FontFace=Retro Mono Wide 17 | FontColor=#Color# 18 | StringCase=Upper 19 | StringAlign=CenterCenter 20 | AntiAlias=1 21 | X=(#size#*2) 22 | Y=(#Size#/2.5) 23 | InlineSetting=Color | #Color#,150 24 | InlinePattern=(\d\d) 25 | DynamicVariables=1 26 | 27 | [MeasureTime] 28 | Measure=Time 29 | Format=%H %M 30 | Substitute="00":"Zero","01":"One","02":"Two","03":"Three","04":"Four","05":"Five","06":"Six","07":"Seven","08":"Eight","09":"Nine","10":"Ten","11":"Eleven","12":"Twelve","13":"Thirteen","14":"Fourteen","15":"Fifteen","16":"Sixteen","17":"Seventeen","18":"Eighteen","19":"Nineteen","20":"Twenty","21":"TwentyOne","22":"TwentyTwo","23":"TwentyThree","24":"TwentyFour","25":"TwentyFive","26":"TwentySix","27":"TwentySeven","28":"TwentyEight","29":"TwentyNine","30":"Thirty","31":"ThirtyOne","32":"ThirtyTwo","33":"ThirtyThree","34":"ThirtyFour","35":"ThirtyFive","36":"ThirtySix","37":"ThirtySeven","38":"ThirtyEight","39":"ThirtyNine","40":"Forty","41":"FortyOne","42":"FortyTwo","43":"FortyThree","44":"FortyFour","45":"FortyFive","46":"FortySix","47":"FortySeven","48":"FortyEight","49":"FortyNine","50":"Fifty","51":"FiftyOne","52":"FiftyTwo","53":"FiftyThree","54":"FiftyFour","55":"FiftyFive","56":"FiftySix","57":"FiftySeven","58":"FiftyEight","59":"FiftyNine" 31 | 32 | [DateYear] 33 | Meter=String 34 | MeasureName=MeasureTime 35 | FontSize=(#size#*21/100) 36 | FontFace=Product Sans 37 | FontColor=#Color# 38 | StringCase=Upper 39 | StringAlign=CenterCenter 40 | AntiAlias=1 41 | X=r 42 | Y=(#size#/1.75)r 43 | InlineSetting=Color | #Color#,150 44 | InlinePattern=.* (.*) 45 | DynamicVariables=1 -------------------------------------------------------------------------------- /Ribbon/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0|Fill Color #color2#\"]" 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 130 | SKIN:Bang(meterOptions..'[!UpdateMeter Shape]') 131 | end 132 | 133 | function ClearAllShapePath() 134 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 135 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 136 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 137 | end -------------------------------------------------------------------------------- /Ribbon/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | text= string.upper(SKIN:GetMeasure('MeasureWeekDay'):GetStringValue()) 4 | font = SELF:GetOption('FontFace') 5 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 6 | realFontSize = math.ceil(fontsize*100/70) 7 | X = 215*scale 8 | Y = 190*scale 9 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 10 | 11 | ParameterTable ={} 12 | for parameter in string.gmatch(SELF:GetOption('Curve'),"%d+") do ParameterTable[#ParameterTable+1] = parameter*scale end 13 | 14 | template={ 15 | "", 16 | "", 27 | "", 29 | "", 31 | "", 32 | "", 34 | "image/svg+xml", 35 | "", 37 | "", 38 | "", 39 | "", 40 | "", 41 | ""..text.."", 49 | "", 53 | "" 54 | } 55 | file:write(table.concat(template, "\n")) 56 | file:close() 57 | 58 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 59 | 60 | end -------------------------------------------------------------------------------- /Ribbon/Ribbon.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL Galano Grotesque DEMO Bold.otf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | ;Time Color 11 | Color=255,255,255 12 | ;Date Color 13 | Color2=111,111,111 14 | ;Ribbon color 15 | Color3=255,255,255 16 | ;Ribbon tail Color 17 | Color4=212,212,212 18 | 19 | Scale=1 20 | 21 | [MeasureTime] 22 | Measure=Time 23 | Format=%I:%M 24 | ;%R for 24-h format 25 | 26 | [Time] 27 | Meter=String 28 | MeasureName=MeasureTime 29 | FontFace=Bebas Neue Light 30 | FontSize=(315*#Scale#) 31 | FontColor=#Color# 32 | StringAlign=Center 33 | X=(360*#Scale#) 34 | Y=0 35 | AntiAlias=1 36 | 37 | ;Shape Converter----------------------------------- 38 | [MeasureWeekDay] 39 | Measure=Time 40 | Format=%A/%d 41 | FormatLocale=Local 42 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 43 | 44 | [ReplaceTextScript] 45 | Measure=Script 46 | ScriptFile=#CURRENTPATH#ReplaceText.lua 47 | FontSize=(40*#Scale#) 48 | FontFace = NOVU M 49 | ;Use font that installed on your computer 50 | Curve= 10,150,420,150,215,120 51 | ;Default= 10,150,420,150,215,120 52 | ;Curve line that text follow. No need to add #Scale# because I already did that in script. 53 | ;Parameter (all required): StartX,StartY,EndX,EndY,ControlX,ControlY 54 | SVGfile=#CURRENTPATH#svg.svg 55 | 56 | [Inkscape] 57 | Measure=Plugin 58 | Plugin=RunCommand 59 | Program=""#@#Inkscape\inkscape.exe"" 60 | ;If you want to show the curve for easier editing, remove --export-id=maintext in the line below. 61 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-id=maintext --export-plain-svg="#CURRENTPATH#svgdone.svg"" 62 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"] 63 | 64 | [ScriptVectorConverter] 65 | Measure=Script 66 | ScriptFile=#CURRENTPATH#Converter.lua 67 | SVGfile=#CURRENTPATH#svgdone.svg 68 | 69 | [FileReader] 70 | Measure=Plugin 71 | Plugin=RunCommand 72 | Parameter=dir /B 73 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 74 | DynamicVariables=1 75 | ;-------------------------------------------------- 76 | 77 | [Shape2] 78 | Meter = Shape 79 | Y=(140*#scale#) 80 | Shape = Path TailLeft | StrokeWidth 0 | Fill Color #color4# 81 | TailLeft=(40*#Scale#),(210*#Scale#) | Lineto (190*#Scale#),(210*#Scale#) | Lineto (190*#Scale#),(300*#Scale#) | Lineto (40*#Scale#),(300*#Scale#) | Lineto (90*#Scale#),(255*#Scale#) 82 | Shape2= path TailRight | StrokeWidth 0 | Fill Color #color4# 83 | TailRight= (530*#Scale#),(210*#Scale#) | Lineto (680*#Scale#),(210*#Scale#) | Lineto (630*#Scale#),(255*#Scale#) | Lineto (680*#Scale#),(300*#Scale#) | Lineto (530*#Scale#),(300*#Scale#) 84 | Shape3= Path Ribbon | StrokeWidth 0 | Fill Color #color3# 85 | Ribbon=(110*#Scale#),(270*#Scale#) | Curveto (610*#Scale#),(270*#Scale#),(355*#Scale#),(230*#Scale#) | Lineto (620*#Scale#),(190*#Scale#) | Curveto (100*#Scale#),(190*#Scale#),(330*#Scale#),(150*#Scale#) 86 | 87 | [Shape] 88 | Meter=Shape 89 | X=(150*#scale#) 90 | Y=(240*#scale#) 91 | 92 | -------------------------------------------------------------------------------- /Roll/Roll.ini: -------------------------------------------------------------------------------- 1 | 2 | [Rainmeter] 3 | Update=3000 4 | 5 | [Variables] 6 | Color=255,255,255 7 | Size=600 8 | 9 | [MeasureMonthNext1] 10 | Measure=Time 11 | Format=%m 12 | Substitute="01":"February","02":"March","03":"April","04":"May","05":"June","06":"July","07":"August","08":"September","09":"October","10":"November","11":"December","12":"January" 13 | 14 | [MeasureMonthNext2] 15 | Measure=Time 16 | Format=%m 17 | Substitute="01":"March","02":"April","03":"May","04":"June","05":"July","06":"August","07":"September","08":"October","09":"November","10":"December","11":"January","12":"February" 18 | 19 | [MeasureMonthPrev1] 20 | Measure=Time 21 | Format=%m 22 | Substitute="01":"December","02":"January","03":"February","04":"March","05":"April","06":"May","07":"June","08":"July","09":"August","10":"September","11":"October","12":"November" 23 | 24 | [MeasureMonthPrev2] 25 | Measure=Time 26 | Format=%m 27 | Substitute="01":"November","02":"December","03":"January","04":"February","05":"March","06":"April","07":"May","08":"June","09":"July","10":"August","11":"September","12":"October" 28 | 29 | [MeasureMonth] 30 | Measure=Time 31 | Format=%B 32 | 33 | [MonthPrev2] 34 | Meter=String 35 | MeasureName=MeasureMonthPrev2 36 | FontSize=(#size#/20) 37 | FontColor=#Color#,100 38 | FontFace=Futurist Fixed-width 39 | StringCase=Upper 40 | AntiAlias=1 41 | StringAlign=Center 42 | X=(#Size#/2) 43 | 44 | [MonthPrev1] 45 | Meter=String 46 | MeasureName=MeasureMonthPrev1 47 | FontSize=(#size#/20) 48 | FontColor=#Color#,150 49 | FontFace=Futurist Fixed-width 50 | StringCase=Upper 51 | AntiAlias=1 52 | StringAlign=Center 53 | X=r 54 | Y=(#size#/20)R 55 | 56 | [MeasureTime] 57 | Measure=Time 58 | Format=%R %p 59 | 60 | [Time] 61 | Meter=String 62 | MeasureName=MeasureTime 63 | FontSize=(#size#/40) 64 | FontColor=#Color# 65 | FontFace=GalanoGrotesqueDEMO-Bold 66 | StringCase=Upper 67 | AntiAlias=1 68 | StringAlign=Center 69 | X=(#size#/4) 70 | Y=R 71 | DynamicVariables=1 72 | 73 | [Month] 74 | Meter=String 75 | MeasureName=MeasureMonth 76 | FontSize=(#size#/10) 77 | FontColor=#Color# 78 | FontFace=GalanoGrotesqueDEMO-Bold 79 | StringCase=Upper 80 | AntiAlias=1 81 | StringAlign=Center 82 | X=(#Size#/2) 83 | Y=(-#size#/20)R 84 | 85 | [MeasureDaynameDay] 86 | Measure=Time 87 | Format=%A %d 88 | 89 | [DaynameDay] 90 | Meter=String 91 | MeasureName=MeasureDaynameDay 92 | FontSize=(#size#/40) 93 | FontColor=#Color# 94 | FontFace=GalanoGrotesqueDEMO-Bold 95 | StringCase=Upper 96 | AntiAlias=1 97 | StringAlign=Center 98 | X=(#size#*3/4) 99 | Y=(-#size#/40)R 100 | DynamicVariables=1 101 | 102 | [MonthNext1] 103 | Meter=String 104 | MeasureName=MeasureMonthNext1 105 | FontSize=(#size#/20) 106 | FontColor=#Color#,150 107 | FontFace=Futurist Fixed-width 108 | StringCase=Upper 109 | AntiAlias=1 110 | StringAlign=Center 111 | X=(#Size#/2) 112 | Y=(#size#/40)R 113 | 114 | [MonthNext2] 115 | Meter=String 116 | MeasureName=MeasureMonthNext2 117 | FontSize=(#size#/20) 118 | FontColor=#Color#,100 119 | FontFace=Futurist Fixed-width 120 | StringCase=Upper 121 | AntiAlias=1 122 | StringAlign=Center 123 | X=r 124 | Y=(#size#/20)R -------------------------------------------------------------------------------- /Straight Hidden/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0\"]" 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 130 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+3).." \"Rectangle (110*#scale#),0,(-110*#scale#),(250*#scale#) | StrokeWidth 0 | Fill Color #Color#\"]" 131 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."|Intersect Shape"..(countshape+2).."\"]" 132 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+5).." \"Rectangle (110*#scale#),(30*#scale#),(-2*#scale#),(210*#scale#) | StrokeWidth 0 | Fill Color #Color#\"]" 133 | SKIN:Bang(meterOptions) 134 | end 135 | 136 | function ClearAllShapePath() 137 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 138 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 139 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 140 | end -------------------------------------------------------------------------------- /Straight Hidden/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | text= string.upper(SKIN:GetMeasure('MeasureWeekDay'):GetStringValue()) 4 | font = SELF:GetOption('FontFace') 5 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 6 | realFontSize = math.ceil(fontsize*100/70) 7 | X = 55*scale 8 | Y = 190*scale 9 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 10 | template={ 11 | "", 12 | "", 22 | "", 24 | "", 26 | "", 27 | "", 29 | "image/svg+xml", 30 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | ""..text.."", 42 | "" 43 | } 44 | file:write(table.concat(template, "\n")) 45 | file:close() 46 | 47 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 48 | 49 | end -------------------------------------------------------------------------------- /Straight Hidden/Straight Hidden.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL Galano Grotesque DEMO Bold.otf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | Color=255,255,255 11 | Scale=1 12 | 13 | [MeasureTime] 14 | Measure=Time 15 | Format=%R 16 | ;%I:%M for 12-h format 17 | 18 | [Time] 19 | Meter=String 20 | MeasureName=MeasureTime 21 | FontFace=GalanoGrotesqueDEMO-Bold 22 | FontSize=(50*#Scale#) 23 | FontColor=#Color# 24 | StringAlign=CenterBottom 25 | X=0 26 | Y=(240*#Scale#) 27 | AntiAlias=1 28 | Angle=(-PI/2) 29 | 30 | ;Shape Converter----------------------------------- 31 | [MeasureWeekDay] 32 | Measure=Time 33 | Format=%a 34 | FormatLocale=Local 35 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 36 | 37 | [ReplaceTextScript] 38 | Measure=Script 39 | ScriptFile=#CURRENTPATH#ReplaceText.lua 40 | FontSize=(120*#Scale#) 41 | FontFace = GalanoGrotesqueDEMO-Bold 42 | ;Use font that installed on your computer 43 | SVGfile=#CURRENTPATH#svg.svg 44 | 45 | [Inkscape] 46 | Measure=Plugin 47 | Plugin=RunCommand 48 | Program=""#@#Inkscape\inkscape.exe"" 49 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone.svg"" 50 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"] 51 | 52 | [ScriptVectorConverter] 53 | Measure=Script 54 | ScriptFile=#CURRENTPATH#Converter.lua 55 | SVGfile=#CURRENTPATH#svgdone.svg 56 | 57 | [FileReader] 58 | Measure=Plugin 59 | Plugin=RunCommand 60 | Parameter=dir /B 61 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 62 | DynamicVariables=1 63 | ;-------------------------------------------------- 64 | 65 | [Shape] 66 | Meter=Shape 67 | 68 | 69 | -------------------------------------------------------------------------------- /Stroke/Stroke.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | 4 | [Variables] 5 | Color=255,255,255 6 | Size=600 7 | 8 | [MeasureMonth] 9 | Measure=Time 10 | Format=%b 11 | 12 | [Month] 13 | Meter=Image 14 | ImageName=[MeasureMonth] 15 | W=#Size# 16 | ImageTint=#Color# 17 | DynamicVariables=1 18 | 19 | [MeasureDay] 20 | Measure=Time 21 | Format=%d 22 | 23 | [Day] 24 | Meter=String 25 | MeasureName=MeasureDay 26 | FontFace=LeviReBrushed 27 | FontSize=(#Size#*4/75) 28 | FontColor=#Color# 29 | X=(#Size#*19/30) 30 | Y=(#Size#*7/20) 31 | AntiAlias=1 32 | DynamicVariables=1 33 | 34 | [MeasureDaynameYear] 35 | Measure=Time 36 | Format=%A,%Y 37 | 38 | [DaynameYear] 39 | Meter=String 40 | MeasureName=MeasureDaynameYear 41 | FontFace=Futurist Fixed-width 42 | FontSize=(#Size#*9/400) 43 | StringCase=Upper 44 | FontColor=#Color# 45 | StringAlign=CenterCenter 46 | X=(#Size#/2) 47 | Y=R 48 | AntiAlias=1 49 | DynamicVariables=1 50 | 51 | [MeasureTime] 52 | Measure=Time 53 | Format=%H %M 54 | Substitute="00":"Zero","01":"One","02":"Two","03":"Three","04":"Four","05":"Five","06":"Six","07":"Seven","08":"Eight","09":"Nine","10":"Ten","11":"Eleven","12":"Twelve","13":"Thirteen","14":"Fourteen","15":"Fifteen","16":"Sixteen","17":"Seventeen","18":"Eighteen","19":"Nineteen","20":"Twenty","21":"TwentyOne","22":"TwentyTwo","23":"TwentyThree","24":"TwentyFour","25":"TwentyFive","26":"TwentySix","27":"TwentySeven","28":"TwentyEight","29":"TwentyNine","30":"Thirty","31":"ThirtyOne","32":"ThirtyTwo","33":"ThirtyThree","34":"ThirtyFour","35":"ThirtyFive","36":"ThirtySix","37":"ThirtySeven","38":"ThirtyEight","39":"ThirtyNine","40":"Forty","41":"FortyOne","42":"FortyTwo","43":"FortyThree","44":"FortyFour","45":"FortyFive","46":"FortySix","47":"FortySeven","48":"FortyEight","49":"FortyNine","50":"Fifty","51":"FiftyOne","52":"FiftyTwo","53":"FiftyThree","54":"FiftyFour","55":"FiftyFive","56":"FiftySix","57":"FiftySeven","58":"FiftyEight","59":"FiftyNine" 55 | 56 | [DateYear] 57 | Meter=String 58 | MeasureName=MeasureTime 59 | FontSize=(#Size#*9/400) 60 | FontFace=Futurist Fixed-width 61 | FontColor=#Color# 62 | StringCase=Upper 63 | StringAlign=CenterCenter 64 | AntiAlias=1 65 | X=r 66 | Y=R 67 | DynamicVariables=1 -------------------------------------------------------------------------------- /Stroke/apr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/apr.png -------------------------------------------------------------------------------- /Stroke/aug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/aug.png -------------------------------------------------------------------------------- /Stroke/dec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/dec.png -------------------------------------------------------------------------------- /Stroke/feb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/feb.png -------------------------------------------------------------------------------- /Stroke/jan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/jan.png -------------------------------------------------------------------------------- /Stroke/jul.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/jul.png -------------------------------------------------------------------------------- /Stroke/jun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/jun.png -------------------------------------------------------------------------------- /Stroke/mar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/mar.png -------------------------------------------------------------------------------- /Stroke/may.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/may.png -------------------------------------------------------------------------------- /Stroke/nov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/nov.png -------------------------------------------------------------------------------- /Stroke/oct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/oct.png -------------------------------------------------------------------------------- /Stroke/sep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/sep.png -------------------------------------------------------------------------------- /Stroke/template.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Stroke/template.psd -------------------------------------------------------------------------------- /Tilt Reveal/Converter.lua: -------------------------------------------------------------------------------- 1 | 2 | svgTypes = {} 3 | 4 | debugPrint = function(k) end 5 | nextPath = 2; 6 | shapeStyles = {} 7 | 8 | 9 | local ErrorEmptySVG = "Error: Parsing empty Svg file" 10 | local CorruptSVG = "Error: The svg file is corrupt" 11 | local GetModifiersError = "Error: Invalid attributes table given to get modifiers, returning nil" 12 | 13 | function shallowcopy(orig) 14 | local orig_type = type(orig) 15 | local copy 16 | if orig_type == 'table' then 17 | copy = {} 18 | for orig_key, orig_value in pairs(orig) do 19 | copy[orig_key] = orig_value 20 | end 21 | else 22 | copy = orig 23 | end 24 | return copy 25 | end 26 | 27 | function getShape(xmlTable, shapes, groupModifiers) 28 | local svgTypeName = xmlTable["Name"] 29 | local children = xmlTable["ChildNodes"] 30 | if svgTypes[svgTypeName] ~= nil then 31 | shapes = svgTypes[svgTypeName](shapes, xmlTable["Attributes"], children, deepcopy(groupModifiers), xmlTable["Value"]) 32 | end 33 | return shapes 34 | end 35 | 36 | function xmlToShape(svgFile) 37 | 38 | local xml = XmlParser:ParseXmlFile(svgFile) 39 | if xml["Name"] ~= "svg" then 40 | print("Invalid svg file: ", svgFile) 41 | return nil 42 | end 43 | nextPath = 1 44 | style = {} 45 | endShapes = getShape(xml, {}, {}) 46 | return endShapes 47 | end 48 | 49 | 50 | function Initialize() 51 | ColorKeywordsPath = SKIN:ReplaceVariables("#@#Scripts/ColorKeywords.lua") 52 | 53 | XmlParser = dofile(SKIN:ReplaceVariables("#@#Scripts/XmlParser.lua")) 54 | dofile(SKIN:ReplaceVariables("#@#Scripts/FileLoader.lua")) -- FileLoader 55 | dofile(SKIN:ReplaceVariables("#@#Scripts/HelperFunctions.lua")) -- HelperFunctions 56 | dofile(SKIN:ReplaceVariables("#@#Scripts/ModifierHandler.lua")) -- ModifierHandler 57 | 58 | local dir = SKIN:ReplaceVariables("#@#Scripts\\SvgTypes\\") 59 | 60 | local SvgLoad = function(files) 61 | for id, file in pairs(files) do 62 | fileName = split(file, ".")[1] 63 | svgTypes[fileName] = dofile(dir .. file) 64 | end 65 | end 66 | 67 | LoadFiles(dir, SvgLoad) 68 | countshape = 0 69 | countpath = 0 70 | end 71 | 72 | function ConvertFile() 73 | local path = SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")) 74 | local shapes = xmlToShape(path) 75 | 76 | local paths = {} 77 | 78 | local meterOptions = "" 79 | 80 | countshape = 0 81 | local union = {} 82 | 83 | for i,shape in pairs(shapes) do 84 | if shape["shape"] ~= nil then 85 | if shape["modifiers"]["Special"]["Display"] then 86 | local shapeName = "Shape" 87 | 88 | if i ~= 1 then shapeName = shapeName .. i end 89 | table.insert(union,'|Union '..shapeName) 90 | meterOptions = meterOptions .. "[!SetOption Shape " .. shapeName .. " \"" .. shape["shape"] 91 | 92 | local sepNum = 1 93 | 94 | for separator in string.gmatch(shape["shape"],"|") do sepNum = sepNum+1 end 95 | 96 | if sepNum ~= 1 then 97 | for j=(i-1),(i-sepNum),-1 do 98 | union[j] = "" 99 | end 100 | end 101 | 102 | for modifierName, modifierValue in pairs(shape["modifiers"]) do 103 | if modifierName ~= "Special" then 104 | meterOptions = meterOptions .. " | " .. modifierName .. " " .. modifierValue 105 | end 106 | end 107 | 108 | if shape["modifiers"]["StrokeWidth"] == nil and shape["combined"] == nil then 109 | meterOptions = meterOptions .. " | StrokeWidth 0" 110 | end 111 | 112 | meterOptions = meterOptions .. "\"]" 113 | 114 | if shape["path"] ~= nil then 115 | paths[#paths+1] = shape["path"] 116 | end 117 | end 118 | countshape = countshape + 1 119 | 120 | end 121 | end 122 | 123 | countpath = 0 124 | for i, path in pairs(paths) do 125 | meterOptions = meterOptions .. "[!SetOption Shape Path" .. i .. " \"" .. path .. "\"]" 126 | countpath = countpath + 1 127 | end 128 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+1).." \"Rectangle 0,0,0,0|StrokeWidth 0\"]" 129 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+2).." \"Combine Shape"..(countshape+1)..table.concat(union).."\"]" 130 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+3).." \"Rectangle (45*#scale#),(180*#scale#),(230*#scale#),(-40*#scale#) | StrokeWidth 0 | Fill Color #Color#|Rotate -50\"]" 131 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+4).." \"Combine Shape"..(countshape+3).."|XOR Shape"..(countshape+2).."|Intersect Shape"..(countshape+2).."\"]" 132 | meterOptions = meterOptions .. "[!SetOption Shape Shape"..(countshape+5).." \"Rectangle (28*#scale#),(170*#scale#),(300*#scale#),(-2*#scale#) | StrokeWidth 0 | Fill Color #Color#|Rotate -50\"]" 133 | SKIN:Bang(meterOptions) 134 | end 135 | 136 | function ClearAllShapePath() 137 | SKIN:Bang('[!SetOption Shape Shape \"\"]') 138 | for i=2,(countshape+4) do SKIN:Bang('[!SetOption Shape Shape'..i..' \"\"]') end 139 | for i=1,countpath do SKIN:Bang('[!SetOption Shape Path'..i..' \"\"]') end 140 | end -------------------------------------------------------------------------------- /Tilt Reveal/ReplaceText.lua: -------------------------------------------------------------------------------- 1 | function replacetext() 2 | scale = tonumber(SKIN:GetVariable('Scale')) 3 | line1= string.lower(SKIN:GetMeasure('MeasureWeekDay'):GetStringValue()) 4 | line2= string.lower(SKIN:GetMeasure('MeasureMonth'):GetStringValue()) 5 | line3= string.lower(SKIN:GetMeasure('MeasureYear'):GetStringValue()) 6 | font = SELF:GetOption('FontFace') 7 | fontsize = SKIN:ParseFormula('('..SELF:GetOption('FontSize')..')') 8 | realFontSize = math.ceil(fontsize*100/70) 9 | X = 200*scale 10 | Y = 150*scale 11 | file = io.open(SKIN:MakePathAbsolute(SELF:GetOption("SVGfile")), "w") 12 | template={ 13 | "", 14 | "", 24 | "", 26 | "", 28 | "", 29 | "", 31 | "image/svg+xml", 32 | "", 34 | "", 35 | "", 36 | "", 37 | "", 38 | ""..line1.."", 44 | ""..line2.."", 50 | ""..line3.."", 56 | "" 57 | } 58 | file:write(table.concat(template, "\n")) 59 | file:close() 60 | 61 | SKIN:Bang('[!Commandmeasure ScriptVectorConverter "ClearAllShapePath()"][!CommandMeasure Inkscape "Run"]') 62 | 63 | end -------------------------------------------------------------------------------- /Tilt Reveal/Tilt Reveal.ini: -------------------------------------------------------------------------------- 1 | [Rainmeter] 2 | Update=3000 3 | AccurateText=1 4 | DynamicWindowSize=1 5 | OnRefreshAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 6 | 7 | ;PLEASE INSTALL NoirMedium.ttf IN @RESOURSE/FONTS FOLDER. 8 | 9 | [Variables] 10 | Color=255,255,255 11 | ;It's too hard to seperate color for each text line. So if that's what you looking for, sorry :c. 12 | Scale=1 13 | 14 | [MeasureDay] 15 | Measure=Time 16 | Format=%d 17 | 18 | [Day] 19 | Meter=String 20 | MeasureName=MeasureDay 21 | FontFace=Roboto 22 | FontSize=(100*#Scale#) 23 | FontColor=#Color# 24 | StringAlign=RightBottom 25 | X=(200*#Scale#) 26 | Y=(185*#Scale#) 27 | AntiAlias=1 28 | InlineSetting=Weight | 100 29 | 30 | ;Shape Converter----------------------------------- 31 | [MeasureWeekDay] 32 | Measure=Time 33 | Format=%A 34 | FormatLocale=Local 35 | OnChangeAction=[!Commandmeasure ReplaceTextScript "replacetext()"] 36 | 37 | [MeasureMonth] 38 | Measure=Time 39 | Format=%B 40 | FormatLocale=Local 41 | 42 | [MeasureYear] 43 | Measure=Time 44 | Format=%Y 45 | FormatLocale=Local 46 | 47 | [ReplaceTextScript] 48 | Measure=Script 49 | ScriptFile=#CURRENTPATH#ReplaceText.lua 50 | FontSize=(50*#Scale#) 51 | FontFace =Noir 52 | ;Use font that installed on your computer 53 | SVGfile=#CURRENTPATH#svg.svg 54 | 55 | [Inkscape] 56 | Measure=Plugin 57 | Plugin=RunCommand 58 | Program=""#@#Inkscape\inkscape.exe"" 59 | Parameter=""#CURRENTPATH#svg.svg" --export-text-to-path --export-plain-svg="#CURRENTPATH#svgdone.svg"" 60 | FinishAction=[!CommandMeasure ScriptVectorConverter "ConvertFile()"] 61 | 62 | [ScriptVectorConverter] 63 | Measure=Script 64 | ScriptFile=#CURRENTPATH#Converter.lua 65 | SVGfile=#CURRENTPATH#svgdone.svg 66 | 67 | [FileReader] 68 | Measure=Plugin 69 | Plugin=RunCommand 70 | Parameter=dir /B 71 | FinishAction=[!UpdateMeasure FileReader][!UpdateMeasure ScriptVectorConverter][!CommandMeasure ScriptVectorConverter "LoadFilesCallback()"] 72 | DynamicVariables=1 73 | ;-------------------------------------------------- 74 | 75 | [Shape] 76 | Meter=Shape 77 | 78 | 79 | -------------------------------------------------------------------------------- /Vertical Lineup/Vertical Lineup.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khanhas/mnmlUI/4c86060b120c5e97708701b3a6a0937281e1235d/Vertical Lineup/Vertical Lineup.ini --------------------------------------------------------------------------------