├── @Resources
├── Actions
│ ├── Source code
│ │ ├── Snip.ahk
│ │ ├── Close.ahk
│ │ └── QuickNote.ahk
│ ├── AHKv1.exe
│ ├── nircmd.exe
│ ├── HotKeys.ini
│ ├── InstallData.ini
│ └── Installer.ahk
├── PatchNoteVar.inc
├── Vars.inc
├── Version.inc
├── Icons
│ ├── Add.png
│ ├── Dot.png
│ ├── Check.png
│ ├── Core.png
│ ├── Delete.png
│ ├── Remove.png
│ └── TopIcon
│ │ ├── Pen.png
│ │ ├── Arrow.png
│ │ ├── Core.png
│ │ ├── List.png
│ │ ├── Tiles.png
│ │ ├── Todo.png
│ │ └── Pencil.png
├── Lua
│ ├── Func.lua
│ ├── DropDownFunc.lua
│ └── tween.lua
├── Data
│ ├── 1
│ │ ├── Lines.inc
│ │ └── 1Bools.inc
│ ├── 2
│ │ ├── Lines.inc
│ │ └── 1Bools.inc
│ ├── 3
│ │ ├── Lines.inc
│ │ └── 1Bools.inc
│ ├── 4
│ │ ├── Lines.inc
│ │ └── 1Bools.inc
│ └── 5
│ │ ├── Lines.inc
│ │ └── 1Bools.inc
├── Fonts
│ ├── Roboto-Bold.ttf
│ ├── Roboto-Thin.ttf
│ ├── Atami-Regular.otf
│ ├── Atami-Stencil.otf
│ ├── Poppins-Bold.ttf
│ ├── Poppins-Light.ttf
│ ├── Poppins-Thin.ttf
│ ├── Roboto-Light.ttf
│ ├── Roboto-Medium.ttf
│ ├── Runic-Regular.otf
│ ├── Poppins-Medium.ttf
│ ├── Poppins-Regular.ttf
│ ├── Poppins-SemiBold.ttf
│ ├── Roboto-Regular.ttf
│ ├── Poppins-ExtraBold.ttf
│ ├── Poppins-ExtraLight.ttf
│ ├── Atami-Display-Regular.otf
│ └── SF-Pro-Rounded-Regular.otf
├── Includes
│ ├── Animation0.inc
│ └── Animation1.inc
├── Presets
│ ├── Dark.inc
│ ├── Light.inc
│ ├── CoreUI.inc
│ ├── Amarena.inc
│ ├── Dracula.inc
│ ├── Kimi.inc
│ ├── Nord.inc
│ └── Lovelace.inc
└── LuaTween
│ ├── Types
│ ├── Single.lua
│ ├── Multiple.lua
│ ├── _Shared.lua
│ └── Chain.lua
│ ├── Main.lua
│ └── tween.lua
├── Core
├── #page.inc
├── Info.inc
├── General.inc
├── Position.inc
├── Appearance.inc
├── Colorscheme.inc
├── Colorscheme
│ ├── CoreUI.png
│ ├── Dark.png
│ ├── Kimi.png
│ ├── Light.png
│ ├── Nord.png
│ ├── Amarena.png
│ ├── Dracula.png
│ └── Lovelace.png
└── PatchNote
│ └── Main.inc
├── Main
├── @Rows.inc
├── Main.ini
└── Accessories
│ ├── Drop.ini
│ └── DropStyles
│ └── File.inc
├── .gitattributes
├── @Start
├── Logo.png
├── QuickNote.png
├── Main.ini
├── Logic.lua
└── DownloadFile
│ └── Parsed.inc
├── QuickNotesWorkspace.code-workspace
└── README.md
/@Resources/Actions/Source code/Snip.ahk:
--------------------------------------------------------------------------------
1 | Send #+{s}
2 | ExitApp
--------------------------------------------------------------------------------
/@Resources/PatchNoteVar.inc:
--------------------------------------------------------------------------------
1 | [Variables]
2 | Core.patchNoteCheckvariable=Jax
3 |
--------------------------------------------------------------------------------
/Core/#page.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/#page.inc
--------------------------------------------------------------------------------
/Core/Info.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Info.inc
--------------------------------------------------------------------------------
/Main/@Rows.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Main/@Rows.inc
--------------------------------------------------------------------------------
/Main/Main.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Main/Main.ini
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/@Start/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Start/Logo.png
--------------------------------------------------------------------------------
/Core/General.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/General.inc
--------------------------------------------------------------------------------
/Core/Position.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Position.inc
--------------------------------------------------------------------------------
/@Resources/Vars.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Vars.inc
--------------------------------------------------------------------------------
/Core/Appearance.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Appearance.inc
--------------------------------------------------------------------------------
/@Resources/Version.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Version.inc
--------------------------------------------------------------------------------
/@Start/QuickNote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Start/QuickNote.png
--------------------------------------------------------------------------------
/Core/Colorscheme.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme.inc
--------------------------------------------------------------------------------
/@Resources/Icons/Add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Add.png
--------------------------------------------------------------------------------
/@Resources/Icons/Dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Dot.png
--------------------------------------------------------------------------------
/@Resources/Lua/Func.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Lua/Func.lua
--------------------------------------------------------------------------------
/@Resources/Data/1/Lines.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/1/Lines.inc
--------------------------------------------------------------------------------
/@Resources/Data/2/Lines.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/2/Lines.inc
--------------------------------------------------------------------------------
/@Resources/Data/3/Lines.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/3/Lines.inc
--------------------------------------------------------------------------------
/@Resources/Data/4/Lines.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/4/Lines.inc
--------------------------------------------------------------------------------
/@Resources/Data/5/Lines.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/5/Lines.inc
--------------------------------------------------------------------------------
/@Resources/Icons/Check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Check.png
--------------------------------------------------------------------------------
/@Resources/Icons/Core.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Core.png
--------------------------------------------------------------------------------
/@Resources/Icons/Delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Delete.png
--------------------------------------------------------------------------------
/@Resources/Icons/Remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/Remove.png
--------------------------------------------------------------------------------
/Core/Colorscheme/CoreUI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/CoreUI.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Dark.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Kimi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Kimi.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Light.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Nord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Nord.png
--------------------------------------------------------------------------------
/Main/Accessories/Drop.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Main/Accessories/Drop.ini
--------------------------------------------------------------------------------
/@Resources/Actions/AHKv1.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Actions/AHKv1.exe
--------------------------------------------------------------------------------
/@Resources/Actions/nircmd.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Actions/nircmd.exe
--------------------------------------------------------------------------------
/@Resources/Data/1/1Bools.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/1/1Bools.inc
--------------------------------------------------------------------------------
/@Resources/Data/2/1Bools.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/2/1Bools.inc
--------------------------------------------------------------------------------
/@Resources/Data/3/1Bools.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/3/1Bools.inc
--------------------------------------------------------------------------------
/@Resources/Data/4/1Bools.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/4/1Bools.inc
--------------------------------------------------------------------------------
/@Resources/Data/5/1Bools.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Data/5/1Bools.inc
--------------------------------------------------------------------------------
/Core/Colorscheme/Amarena.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Amarena.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Dracula.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Dracula.png
--------------------------------------------------------------------------------
/Core/Colorscheme/Lovelace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Core/Colorscheme/Lovelace.png
--------------------------------------------------------------------------------
/@Resources/Fonts/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Roboto-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Roboto-Thin.ttf
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Pen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Pen.png
--------------------------------------------------------------------------------
/@Resources/Lua/DropDownFunc.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Lua/DropDownFunc.lua
--------------------------------------------------------------------------------
/@Resources/Fonts/Atami-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Atami-Regular.otf
--------------------------------------------------------------------------------
/@Resources/Fonts/Atami-Stencil.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Atami-Stencil.otf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-Bold.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-Light.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-Thin.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Runic-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Runic-Regular.otf
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Arrow.png
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Core.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Core.png
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/List.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/List.png
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Tiles.png
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Todo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Todo.png
--------------------------------------------------------------------------------
/@Resources/Includes/Animation0.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Includes/Animation0.inc
--------------------------------------------------------------------------------
/@Resources/Includes/Animation1.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Includes/Animation1.inc
--------------------------------------------------------------------------------
/QuickNotesWorkspace.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": "."
5 | }
6 | ],
7 | "settings": {}
8 | }
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-Medium.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-Regular.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-SemiBold.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/@Resources/Icons/TopIcon/Pencil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Icons/TopIcon/Pencil.png
--------------------------------------------------------------------------------
/Main/Accessories/DropStyles/File.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/Main/Accessories/DropStyles/File.inc
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-ExtraBold.ttf
--------------------------------------------------------------------------------
/@Resources/Fonts/Poppins-ExtraLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Poppins-ExtraLight.ttf
--------------------------------------------------------------------------------
/@Resources/Actions/HotKeys.ini:
--------------------------------------------------------------------------------
1 | [Variables]
2 | Key=#W
3 | RMPATH=C:\Program Files\Rainmeter\Rainmeter.exe
4 | KeyInString= LWin W
5 |
--------------------------------------------------------------------------------
/@Resources/Actions/Source code/Close.ahk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Actions/Source code/Close.ahk
--------------------------------------------------------------------------------
/@Resources/Fonts/Atami-Display-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/Atami-Display-Regular.otf
--------------------------------------------------------------------------------
/@Resources/Actions/Source code/QuickNote.ahk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Actions/Source code/QuickNote.ahk
--------------------------------------------------------------------------------
/@Resources/Fonts/SF-Pro-Rounded-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jax-Core/QuickNote/HEAD/@Resources/Fonts/SF-Pro-Rounded-Regular.otf
--------------------------------------------------------------------------------
/@Resources/Presets/Dark.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=36,36,36
3 | SecColor=54,54,54
4 | StrokeColor=60,60,60
5 | FontColor=255,255,255
6 | AccentColor=190,190,190
7 | BoolColor=35,159,255
8 | FontFace=Segoe UI
--------------------------------------------------------------------------------
/@Resources/Presets/Light.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=247,247,247
3 | SecColor=23,23,23, 50
4 | StrokeColor=212,212,212
5 | FontColor=23,23,23
6 | AccentColor=23,23,23
7 | BoolColor=23,23,23
8 | FontFace=Segoe UI
--------------------------------------------------------------------------------
/@Resources/Presets/CoreUI.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=12,12,12
3 | SecColor=242, 52, 0, 50
4 | StrokeColor=30,30,30
5 | FontColor=242,240,255
6 | AccentColor=242, 52, 0
7 | BoolColor=242, 52, 0
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/@Resources/Actions/InstallData.ini:
--------------------------------------------------------------------------------
1 | [Data]
2 | DownloadLink=https://github.com/Jax-Core/JaxCore/releases/download/v00011/JaxCore_v00011.rmskin
3 | SaveLocation=C:\Users\enhan\Documents\Rainmeter\Skins\#CoreUpdater\@Resources\Actions
4 |
--------------------------------------------------------------------------------
/@Resources/Presets/Amarena.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=26, 32, 38
3 | SecColor=251, 99, 150, 50
4 | StrokeColor=30, 37, 44
5 | FontColor=255,255,255
6 | AccentColor=251, 99, 150
7 | BoolColor=82, 97, 112
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/@Resources/Presets/Dracula.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=40, 42, 54
3 | SecColor=255, 85, 85, 50
4 | StrokeColor=68, 71, 90
5 | FontColor=248, 248, 242
6 | AccentColor=255, 85, 85
7 | BoolColor=255, 85, 85
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/@Resources/Presets/Kimi.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=48, 44, 69
3 | SecColor=166, 124, 243
4 | StrokeColor=88, 78, 123
5 | FontColor=255, 255, 255
6 | AccentColor=255, 255, 255
7 | BoolColor=255, 255, 255
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/@Resources/Presets/Nord.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=59, 66, 82
3 | SecColor=216, 222, 233, 50
4 | StrokeColor=46, 52, 64
5 | FontColor=236, 239, 244
6 | AccentColor=216, 222, 233
7 | BoolColor=216, 222, 233
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/@Resources/Presets/Lovelace.inc:
--------------------------------------------------------------------------------
1 | [@Resources\Vars.inc]
2 | Maincolor=43, 53, 68
3 | SecColor=209, 94, 234, 50
4 | StrokeColor=52, 64, 85
5 | FontColor=215, 218, 222
6 | AccentColor=209, 94, 234
7 | BoolColor=209, 94, 234
8 | FontFace=Poppins
--------------------------------------------------------------------------------
/Core/PatchNote/Main.inc:
--------------------------------------------------------------------------------
1 |
2 |
3 | [Title.1_42]
4 | Meter=String
5 | Text="Change log v1.42"
6 | MeterStyle=Sec.String:S | Style.Title:S
7 |
8 | [Description.1_42]
9 | Meter=String
10 | Text="· New Core UI"
11 | MeterStyle=Sec.String:S | Style.Description:S
--------------------------------------------------------------------------------
/@Resources/Actions/Installer.ahk:
--------------------------------------------------------------------------------
1 | #SingleInstance, Force
2 | SendMode Input
3 | SetWorkingDir, %A_ScriptDir%
4 |
5 | IniRead, SaveLocation, InstallData.ini, Data, SaveLocation
6 | IniRead, DownloadLink, InstallData.ini, Data, DownloadLink
7 |
8 | SplashTextOn , 400, 100, Rainmeter, "Downloading skin..."
9 | UrlDownloadToFile, %DownloadLink%, %SaveLocation%\INSTALL.rmskin
10 | SplashTextOff
11 | Run, INSTALL.rmskin
12 | WinWait, Rainmeter Skin Installer
13 | Sleep, 100
14 | Send, {Enter}
15 |
16 | ExitApp
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 | This is part of JaxCore's legacy modules.
21 |
--------------------------------------------------------------------------------
/@Start/Main.ini:
--------------------------------------------------------------------------------
1 | [Rainmeter]
2 | Update=-1
3 |
4 | DefaultKeepOnScreen=0
5 |
6 | [Variables]
7 | Parsed=0
8 |
9 | [CheckParsed]
10 | Measure=String
11 | String=#Parsed#
12 | IFmatch=0
13 | IfMatchaction=[!WriteKeyValue Variables Parsed 1][!Delay 1000][!Refresh]
14 | IfNotMatchAction=[!WriteKeyValue Variables Parsed 0]
15 |
16 | [GetStart]
17 | Measure=WebParser
18 | URL=https://raw.githubusercontent.com/Jax-Core/JaxCore/main/CoreShell/Start/Main.inc
19 | Debug=2
20 | Debug2File=DownloadFile\Parsed.inc
21 |
22 | [DummyString]
23 | Meter=String
24 |
25 | ; ---------------------------------------------------------------------------- ;
26 | ; Parsed ;
27 | ; ---------------------------------------------------------------------------- ;
28 |
29 | @includeParsed=DownloadFile\Parsed.inc
30 |
--------------------------------------------------------------------------------
/@Start/Logic.lua:
--------------------------------------------------------------------------------
1 | function check()
2 | mVer = SKIN:GetMeasure('mVer')
3 | CoreVer = tonumber(SKIN:GetVariable('Core.Ver', '00000'))
4 | ParsedVer = tonumber(mVer:GetStringValue())
5 | ParsedVerFull = mVer:GetStringValue()
6 | SavePos = SKIN:GetVariable('@')..'Actions\\InstallData.ini'
7 | SaveLocation = SKIN:GetVariable('@')..'Actions'
8 | if ParsedVer == CoreVer then
9 | print('Up2date - '..ParsedVer..'=='..CoreVer)
10 | SKIN:Bang('!UpdateMeasure', 'JaxCoreYes')
11 | elseif ParsedVer <= CoreVer then
12 | print('Beta - '..ParsedVer..'<='..CoreVer)
13 | SKIN:Bang('!UpdateMeasure', 'JaxCoreYes')
14 | else
15 | print('Update required - '..ParsedVer..'>='..CoreVer)
16 | SKIN:Bang('!WriteKeyValue', 'Data', 'DownloadLink', 'https://github.com/Jax-Core/JaxCore/releases/download/v'..ParsedVerFull..'/JaxCore_v'..ParsedVerFull..'.rmskin', SavePos)
17 | SKIN:Bang('!WriteKeyValue', 'Data', 'SaveLocation', SaveLocation, SavePos)
18 | SKIN:Bang('!UpdateMeasure', 'JaxCoreNo')
19 | end
20 | end
--------------------------------------------------------------------------------
/@Resources/LuaTween/Types/Single.lua:
--------------------------------------------------------------------------------
1 | -- Single-type tween
2 |
3 | -- Values are passed from Main's DoFileParams()
4 | local SKIN, Shared, tween = ...
5 |
6 | -- Standard varaibles that all type tween script's should have
7 | local tweensTable = {}
8 | local redraw = false
9 |
10 | --region Private functions
11 |
12 | -- Formats the parameters from RM, return false if parameters are insufficient
13 | -- Params: SectionName | OptionName | StartValue ; 0.0 | ... | EndValue ; 1.0 | Duration
14 | local function FormatParams(unformatParams)
15 | local params = Shared.SplitUnformat(unformatParams)
16 | local paramsLen = Shared.TableLength(params)
17 |
18 | if paramsLen < 5 then
19 | error("Parameters insufficient => " .. unformatParams)
20 | return false
21 | else
22 | for i,v in pairs(params) do params[i] = Shared.ParseFormula(v) end
23 |
24 | local valueTable = Shared.CalcPathValueTable(params, 3, paramsLen - 1, unformatParams)
25 |
26 | if valueTable == nil then
27 | error("Path value syntax invalid for " .. unformatParams)
28 | return false
29 | end
30 |
31 | return params[1], params[2], valueTable, params[paramsLen]
32 | end
33 | end
34 |
35 | -- return easing, group, loop
36 | local function FormatOptionals(unformatOptionals)
37 | local optionals = Shared.SplitUnformat(unformatOptionals)
38 |
39 | -- Available optionals
40 | local easing, group, loop
41 |
42 | for _,v in pairs(optionals) do
43 | local param = Shared.SplitOptionalParam(v)
44 | local paramName = param[1]:lower()
45 |
46 | -- Process params
47 | if paramName == "easing" then
48 | easing = param[2]:lower()
49 |
50 | elseif paramName == "group" then
51 | group = param[2]:lower()
52 |
53 | elseif paramName == "loop" then
54 | loop = param[2]:lower()
55 | end
56 | end
57 |
58 | return easing, group, loop
59 | end
60 |
61 | local function Update(tween, dt)
62 | -- If state not equal 0, its either playing forwards or backwards
63 | if tween.state ~= 0 then
64 | -- Updates the tween tweenvalue and return whether tweening is done, if so do loop
65 | if tween.indexer:update(dt * tween.state) then
66 | Shared.DoLoop(tween.loop, tween, tween.indexer)
67 | end
68 |
69 | local indexerValue = tween.indexerValue
70 |
71 | for _,v in ipairs(tween.tweens) do
72 | -- Check in range
73 | if indexerValue >= v.startPercent and indexerValue <= v.endPercent then
74 | -- Manually set value rather than update for precision
75 | v.tween:set(indexerValue - v.startPercent)
76 | Shared.DoTweenBang(tween.sectionType, tween.sectionName, tween.optionName, Shared.TableToValue(v.value))
77 | break
78 | end
79 | end
80 |
81 | -- Needs redraw
82 | redraw = true
83 | end
84 | end
85 |
86 | -- Used by public functions to get the tween by index
87 | -- *func* refers to the function to be applied on the tween
88 | local function ProcessTween(index, func)
89 | return Shared.ProcessTween(tweensTable, index, func)
90 | end
91 |
92 | --endregion
93 |
94 | --region Public functions
95 |
96 | Single = {}
97 |
98 | function Single.New(index, unformatParams, unformatOptionals)
99 | local sectionName, optionName, valueTable, duration = FormatParams(unformatParams)
100 | local easing, group, loop = FormatOptionals(unformatOptionals)
101 |
102 | -- Early out if params are invalid
103 | if not sectionName then
104 | error("Single-type tween creation failed")
105 | return
106 | end
107 |
108 | -- String -> number
109 | duration = tonumber(duration)
110 |
111 | local subject =
112 | {
113 | sectionType = Shared.GetSectionType(sectionName),
114 | sectionName = sectionName,
115 | optionName = optionName,
116 | group = group,
117 | loop = Shared.CheckLoop(loop),
118 | state = 0,
119 | tweens = {},
120 | indexerValue = 0
121 | }
122 |
123 | -- indexer in charges of tweening from 0 to 1, the indexerValue is then used to calculate the current value of the path
124 | subject.indexer = tween.new(duration, subject, { indexerValue = 1 }, easing or 'linear')
125 |
126 | -- A path consist of one or more linear tweens, create(a,b) creates the tween
127 | local create = function(a,b)
128 | if a.percent == b.percent then return end
129 |
130 | local subSubject =
131 | {
132 | startPercent = a.percent,
133 | endPercent = b.percent,
134 | value = Shared.ValueToTable(a.value)
135 | }
136 | subSubject.tween = tween.new(b.percent - a.percent, subSubject, { value = Shared.ValueToTable(b.value) }, 'linear')
137 |
138 | table.insert(subject.tweens, subSubject)
139 | end
140 |
141 | -- Iterate through the sorted values, creates the tween for the path
142 | for k,v in ipairs(valueTable) do
143 | -- For situations when the first percentual value is more than 0
144 | if k == 1 and v.percent > 0 then
145 | create({ value = v.value, percent = 0 }, v)
146 | end
147 |
148 | -- Normal situations when the next percentual value is available
149 | if valueTable[k+1] ~= nil then
150 | create(v, valueTable[k+1])
151 | -- For situations when the last percentual value is less than 1
152 | elseif v.percent < 1 then
153 | create(v, { value = v.value, percent = 1 })
154 | end
155 | end
156 |
157 | tweensTable[index] = subject
158 | end
159 |
160 | -- Called by Mains's Update cycle
161 | function Single.Update(dt)
162 | redraw = false
163 |
164 | for _,v in pairs(tweensTable) do
165 | Update(v, dt)
166 | end
167 |
168 | return redraw
169 | end
170 |
171 |
172 | -- Plays the tween forwards
173 | function Single.Start(index)
174 | return ProcessTween(index, function(t)
175 | t.state = 1
176 | end)
177 | end
178 |
179 | -- Plays the tween backwards
180 | function Single.Reverse(index)
181 | return ProcessTween(index, function(t)
182 | t.state = -1
183 | end)
184 | end
185 |
186 | -- Pauses the tween from playing
187 | function Single.Pause(index)
188 | return ProcessTween(index, function(t)
189 | t.state = 0
190 | end)
191 | end
192 |
193 | -- Sets the tween clock = duration, value is the EndValue
194 | function Single.Finish(index)
195 | return ProcessTween(index, function(t)
196 | t.indexer:finish()
197 | t.state = 1
198 |
199 | -- loop is set to none for a constant outcome of Update
200 | local cacheLoop = t.loop
201 | t.loop = "none"
202 | Update(t, 810)
203 | t.loop = cacheLoop
204 | end)
205 | end
206 |
207 | -- Sets the tween clock = 0, , value is the StartValue
208 | function Single.Reset(index)
209 | return ProcessTween(index, function(t)
210 | t.indexer:reset()
211 | t.state = -1
212 |
213 | -- loop is set to none for a constant outcome of Update
214 | local cacheLoop = t.loop
215 | t.loop = "none"
216 | Update(t, 810)
217 | t.loop = cacheLoop
218 | end)
219 | end
220 |
221 | -- Set the optional of a tween
222 | function Single.SetOptional(index, optionalName, ...)
223 | optionalName = optionalName:lower()
224 | local func
225 |
226 | if optionalName == "easing" then
227 | func = function(t)
228 | t.indexer:setEasing(arg[1]:lower())
229 | end
230 | elseif optionalName == "group" then
231 | func = function(t)
232 | t.group = arg[1]:lower()
233 | end
234 | elseif optionalName == "loop" then
235 | func = function(t)
236 | t.loop = arg[1]:lower()
237 | end
238 | else
239 | error("Option Name \"" .. optionalName .. "\" is an invalid optional")
240 | end
241 |
242 | return ProcessTween(index, func)
243 | end
244 |
245 | --endregion
--------------------------------------------------------------------------------
/@Resources/LuaTween/Main.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Author: Blu
3 | Reddit: /u/IamLUG
4 | Github: https://github.com/bluwy
5 |
6 | ------------------------------------------------------------
7 |
8 | Main.lua
9 | ~ Main.lua is the powerhouse of the project, link the script measure to this script
10 | ~ Tween any number in Rainmeter with Lua
11 | ~ Supports tweening meter options, measure options, variables and groups!
12 | ~ Easily tween a value with lesser syntax than manual tweening in Rainmeter
13 | ~ Credits: https://github.com/kikito/tween.lua for the tweening and easing functions
14 | ~ License: https://github.com/bluwy/LuaTween-for-Rainmeter/blob/master/LICENSE.txt
15 |
16 | -------------------------------------------------------------
17 |
18 | For syntaxes or tutorials:
19 | Visit https://github.com/bluwy/LuaTween-for-Rainmeter/
20 | ]]--
21 |
22 |
23 |
24 | --region Rainmeter
25 |
26 | function Initialize()
27 | -- Section: USER MODIFY
28 | -- ~ LuaTween provides default Single, Chain and Multiple scripts for usage, if you're excluding
29 | -- some of these scripts or including your custom scripts, modify here to avoid errors
30 | --
31 | -- How to modify?
32 | -- ~ In the *tweenTypeFileNames* table, modify it to have the exact names of the files in
33 | -- LuaTween/Types
34 | -- ~ In *tweenTypes* table, modify it to be in this format:
35 | -- "Your syntax in RM" = "Table Name of the related script"
36 | --
37 | local tweenTypeFileNames =
38 | {
39 | -- FileName
40 | "Single",
41 | "Chain",
42 | "Multiple"
43 | }
44 |
45 | ImportScripts(tweenTypeFileNames)
46 |
47 | tweenTypes =
48 | {
49 | -- Syntax = TableName
50 | single = Single,
51 | chain = Chain,
52 | multiple = Multiple
53 | }
54 | -- EndSection: USER MODIFY
55 |
56 |
57 | -- The group for updates and redraws (Default: "Tweenable")
58 | tweenGroup = SELF:GetOption("TweenGroup", "Tweenable")
59 |
60 | -- The delta time of the script's Update
61 | dt = 0
62 | -- the previous time to calculate delta time (Current time - previous time)
63 | prevTime = os.clock()
64 |
65 |
66 | -- Whether redraw is needed, if any tween is playing.
67 | redraw = false
68 | -- How many times to redraw after *redraw* = true
69 | redrawTimes = 2
70 | -- redraw cache
71 | redrawsLeft = 0
72 | -- ended actions checker
73 | ended = 1
74 |
75 | -- Initializes all the tweens
76 | InitAllTweens()
77 | end
78 |
79 | function Update()
80 | -- Calculate delta time and set previous time to now
81 | dt = (os.clock() - prevTime) * 1000
82 | prevTime = os.clock()
83 |
84 | -- Iterate all tween types script and executes their respective Updates
85 | for _,v in pairs(tweenTypes) do
86 | redraw = v.Update(dt) or redraw
87 | end
88 |
89 | if redraw then
90 | redrawsLeft = redrawTimes
91 | redraw = false
92 | else
93 | if ended == 0 then
94 | SKIN:Bang(SELF:GetOption("FinishAction", ""))
95 | ended = 1
96 | end
97 | end
98 |
99 | if redrawsLeft > 0 then
100 | redrawsLeft = redrawsLeft - 1
101 |
102 | -- Updates and redraws group
103 | UpdateAndRedraw()
104 | end
105 | end
106 |
107 | --endregion
108 |
109 | --region Public functions
110 |
111 | -- Plays the tween forwards
112 | function Start(index, ...)
113 | ended = 0
114 | local inRange = false
115 | for _,v in pairs(tweenTypes) do
116 | inRange = v.Start(index, ...) or inRange
117 | end
118 | if not inRange then LogIndexError(index) end
119 | end
120 |
121 | -- Plays the tween backwards
122 | function Reverse(index, ...)
123 | local inRange = false
124 | for _,v in pairs(tweenTypes) do
125 | inRange = v.Reverse(index, ...) or inRange
126 | end
127 | if not inRange then LogIndexError(index) end
128 | end
129 |
130 | -- Pauses the tween from playing
131 | function Pause(index, ...)
132 | local inRange = false
133 | for _,v in pairs(tweenTypes) do
134 | inRange = v.Pause(index, ...) or inRange
135 | end
136 | if not inRange then LogIndexError(index) end
137 | end
138 |
139 | -- Sets the tween clock = duration, value is the EndValue
140 | function Finish(index, ...)
141 | local inRange = false
142 | for _,v in pairs(tweenTypes) do
143 | inRange = v.Finish(index, ...) or inRange
144 | end
145 | if not inRange then LogIndexError(index) end
146 | end
147 |
148 | -- Sets the tween clock = 0, , value is the StartValue
149 | function Reset(index, ...)
150 | local inRange = false
151 | for _,v in pairs(tweenTypes) do
152 | inRange = v.Reset(index, ...) or inRange
153 | end
154 | if not inRange then LogIndexError(index) end
155 | end
156 |
157 | -- Calls Reset and Start
158 | function Restart(index, ...)
159 | Reset(index, ...)
160 | Start(index, ...)
161 | end
162 |
163 | -- Calls Finish and Reverse
164 | function Rewind(index, ...)
165 | Finish(index, ...)
166 | Reverse(index, ...)
167 | end
168 |
169 | function SetOptional(index, ...)
170 | local inRange = false
171 | for _,v in pairs(tweenTypes) do
172 | inRange = v.SetOptional(index, ...) or inRange
173 | end
174 | if not inRange then LogIndexError(index) end
175 | end
176 |
177 | -- Reinitializes the tween and gets the new values
178 | function Reinit(index)
179 | InitTween(index)
180 | end
181 |
182 | --endregion
183 |
184 | --region Private functions
185 |
186 | function InitAllTweens()
187 | local i = 0
188 | while true do
189 | if not InitTween(i, false) then break end
190 | i = i + 1
191 | end
192 | end
193 |
194 | -- Initializes the tween (Returns true if succeeds)
195 | -- if publicCall, sends error when index is out of range
196 | function InitTween(index, publicCall)
197 | -- Gets the string form TweenN
198 | local optTween = SELF:GetOption("Tween" .. index)
199 |
200 | if optTween == "" then
201 | if publicCall then
202 | error("No tween with index \"" .. index .. "\" found")
203 | end
204 | return false
205 | end
206 |
207 | local type = GetTweenType(optTween)
208 |
209 | if tweenTypes[type] == nil then
210 | error("No tween type \"" .. index .. "\" found")
211 | return false
212 | end
213 |
214 | -- Creates a new tween of *type*
215 | tweenTypes[type].New(index, GetTweenUnformatParams(optTween), SELF:GetOption("Optional" .. index))
216 |
217 | return true
218 | end
219 |
220 | -- Gets the first param, which is the tween's type
221 | function GetTweenType(str)
222 | local result = Shared.SplitUnformat(str, 1)
223 |
224 | if #result < 1 then
225 | error("Parameters insufficent for \"" .. str .. "\"")
226 | else
227 | return result[1]:lower()
228 | end
229 | end
230 |
231 | -- Gets the string behind the first "|", which is after the tween type param
232 | function GetTweenUnformatParams(str)
233 | return str:sub(str:find("|") + 1)
234 | end
235 |
236 | -- Updates and Redraws group in RM
237 | function UpdateAndRedraw()
238 | SKIN:Bang('!UpdateMeasureGroup', tweenGroup)
239 | SKIN:Bang('!UpdateMeterGroup', tweenGroup)
240 | SKIN:Bang('!RedrawGroup', tweenGroup)
241 | end
242 |
243 | -- Similar to dofile(), but with custom params
244 | function DoFileParams(fileName, ...)
245 | local f = assert(loadfile(fileName))
246 | f(...)
247 | end
248 |
249 | function ImportScripts(tweenTypeFileNames)
250 | -- Path to current script's folder
251 | local folderPath = SELF:GetOption("ScriptFile"):match("(.*[/\\])")
252 |
253 | -- Load the tween.lua file (The file must be in the same folder as this script)
254 | -- Preserved var: tween
255 | dofile(folderPath .. "tween.lua")
256 | -- Preserved var: Shared
257 | DoFileParams(folderPath .. "Types/_Shared.lua", SKIN)
258 |
259 | for _,v in pairs(tweenTypeFileNames) do
260 | DoFileParams(folderPath .. "Types/" .. v .. ".lua", SKIN, Shared, tween)
261 | end
262 | end
263 |
264 | -- Default logger for public functions if tween is not found
265 | function LogIndexError(index)
266 | if type(index) == "number" then
267 | error("No tween with index \"" .. index .. "\" found")
268 | elseif type(index) == "string" then
269 | error("No tween with group name \"" .. index .. "\" found")
270 | end
271 | end
272 |
273 | --endregion
--------------------------------------------------------------------------------
/@Start/DownloadFile/Parsed.inc:
--------------------------------------------------------------------------------
1 | [Rainmeter]
2 | Rightmouseupaction=[]
3 | OnRefreshAction=[!ZPos 1][!Move (#SCREENAREAWIDTH#/2-#Sec.W#/2) (#SCREENAREAHEIGHT#/2-#Sec.H#/2)][!SetOption Dep3 MeterStyle "Dep.Shape:S | Dep.ShapeYes:S"][!UpdateMEter *][!Redraw]
4 |
5 | ; ---------------------------------------------------------------------------- ;
6 | ; Export vars ;
7 | ; ---------------------------------------------------------------------------- ;
8 |
9 | [ExportVariables]
10 | Measure=Calc
11 | OnUpdateAction=[!WriteKeyValue Variables RMPATH "#PROGRAMPATH#Rainmeter.exe" "#@#Actions\Hotkeys.ini"][!Delay 100][!EnableMeasureGroup NUOL]
12 |
13 | [CheckModular]
14 | Measure=String
15 | String=#ROOTCONFIG#
16 | IFmatch=ModularClocks|ModularPlayers
17 | IfNotMatchAction=[!HideMeter Dep2][!HideMeter Deptext2][!Redraw]
18 |
19 | [Variables]
20 | @includeVersion=#@#Version.inc
21 | @includeJaxCoreChecker=#SKINSPATH#\#JaxCore\@Resources\Version.inc
22 | Sec.W=800
23 | Sec.H=500
24 | Sec.P=40
25 | Sec.L=350
26 | Sec.R=10
27 |
28 | Pri_Color=12,12,12
29 | Sec_Color=28,28,28
30 | Ter_Color=35,35,35
31 | Accent_Color=255, 117, 81
32 | Text_Color=242,240,255
33 | SubText_Color=120,120,120
34 |
35 | [String:S]
36 | FontColor=#Text_Color#
37 | Fontface=Roboto Light
38 | AntiAlias=1
39 | X=r
40 | Y=10R
41 | FontSize=10
42 |
43 | [Dep.Shape:S]
44 | X=-20r
45 | Y=35r
46 | Shape=Rectangle 0,0,(#SEc.W#-#Sec.L#-#Sec.P#*2),50,2.5 | StrokeWidth 0 | Extend This
47 | Shape2=Rectangle 0,0,5,50,2.5 | StrokeWidth 0 | Fill Color #SubText_Color#
48 | This=fill Color 0,0,0,1
49 | MouseOverAction=[!SetOption #CURRENTSECTION# This "Fill Color #Ter_Color#"][!UpdateMeter #CURRENTSECTION#][!Redraw]
50 | MouseLeaveAction=[!SetOption #CURRENTSECTION# This "Fill Color 0,0,0,1"][!UpdateMeter #CURRENTSECTION#][!Redraw]
51 | [Dep.ShapeYes:S]
52 | Shape2=Rectangle 0,0,5,50,2.5 | StrokeWidth 0 | Fill Color 0,255,50,100
53 | This=Fill Color 0,255,50,50
54 | MouseOverAction=[!SetOption #CURRENTSECTION# This "Fill Color 0,255,50,100"][!UpdateMeter #CURRENTSECTION#][!Redraw]
55 | MouseLeaveAction=[!SetOption #CURRENTSECTION# This "Fill Color 0,255,50,50"][!UpdateMeter #CURRENTSECTION#][!Redraw]
56 | [Dep.ShapeNo:S]
57 | Shape2=Rectangle 0,0,5,50,2.5 | StrokeWidth 0 | Fill Color 255,0,0,100
58 | This=Fill Color 255,0,0,50
59 | MouseOverAction=[!SetOption #CURRENTSECTION# This "Fill Color 255,0,0,100"][!UpdateMeter #CURRENTSECTION#][!Redraw]
60 | MouseLeaveAction=[!SetOption #CURRENTSECTION# This "Fill Color 255,0,0,50"][!UpdateMeter #CURRENTSECTION#][!Redraw]
61 | [Dep.Text:S]
62 | X=20r
63 | Y=25r
64 | W=(#SEc.W#-#Sec.L#-#Sec.P#*2-50)
65 | clipString=2
66 | StringAlign=LeftCenter
67 | FontColor=#Text_Color#
68 | Fontface=Roboto
69 | AntiAlias=1
70 | FontSize=12
71 | InlinePattern=//.*
72 | InlineSetting=Color | #SubText_Color#
73 | InlinePattern2=//.*
74 | InlineSetting2=Size | 10
75 |
76 | ; ---------------------------------------------------------------------------- ;
77 | ; Content ;
78 | ; ---------------------------------------------------------------------------- ;
79 |
80 | ; ------------------------------------ Gen ----------------------------------- ;
81 |
82 | [B]
83 | Meter=Shape
84 | Shape=Rectangle 0,0,#Sec.W#,#Sec.H#,#sec.R# | strokeWidth 0 | Fill Color #Pri_Color#
85 | [BC]
86 | Meter=Shape
87 | X=(#Sec.W#-#SEc.L#)
88 | Shape=Rectangle 0,0,(#Sec.L#),#Sec.H#,#sec.R# | strokeWidth 0 | Fill LinearGradient This
89 | This=0 | 0,0,0,150 ; 0.0 | 0,0,0,0 ; 1.0
90 |
91 | [Logo]
92 | Meter=Image
93 | ImageName=Logo.png
94 | X=#Sec.P#
95 | Y=(#Sec.H#-#Sec.P#-40)
96 | W=40
97 | H=40
98 |
99 | [Image]
100 | Meter=Image
101 | Container=BC
102 | ; X=(#Sec.L#-#Sec.H#*6/4)
103 | ; PreserveAspectRatio=0
104 | H=#Sec.H#
105 | W=#Sec.L#
106 | PreserveAspectRatio=2
107 | ImageName=#ROOTCONFIG#.png
108 |
109 | [Esc]
110 | Meter=Shape
111 | DynamicVariables=1
112 | Shape=Ellipse (#Sec.W#-15),(15),(5),(5) | StrokeWidth 10 | StrokeColor 0,0,0,1 | Extend FillE
113 | FillE=Fill Color #Text_Color#,50
114 | MouseOverAction=[!SetOption Esc FillE "Fill Color #Text_Color#"][!UpdateMeter Esc][!Redraw]
115 | MouseLeaveAction=[!SetOption Esc FillE "Fill Color #Text_Color#,50"][!UpdateMeter Esc][!Redraw]
116 | LeftMouseUpAction=[!DeactivateConfig]
117 |
118 | ; --------------------------------- Left --------------------------------- ;
119 |
120 | [MainText]
121 | Meter=String
122 | X=(#Sec.P#)
123 | Y=#Sec.P#
124 | Text=#ROOTCONFIG# by Jax | #Version#
125 | StringAlign=LEftTOp
126 | FontFace=Roboto Bold
127 | FontSize=25
128 | InlinePattern=by.*
129 | InlineSetting=Size | 10
130 | InlinePattern2=by.*
131 | InlineSetting2=Color | #SubText_Color#
132 | InlinePattern3=by.*
133 | InlineSetting3=Face | Roboto
134 | MeterStyle=String:S
135 |
136 | [Des]
137 | Meter=String
138 | Text=Here you can find the list of dependencies. Click on any one of them to install, make sure you are connected to the internet.
139 | W=(#SEc.W#-#Sec.L#-#Sec.P#*2)
140 | clipString=2
141 | MeterStyle=String:S
142 |
143 | ; ------------------------------------ Dep ----------------------------------- ;
144 |
145 | [Dep1]
146 | Meter=Shape
147 | X=r
148 | Y=20R
149 | MEterStyle=Dep.Shape:S
150 | [DepText1]
151 | Meter=String
152 | Text=JaxCore // Checking...
153 | MeterStyle=Dep.Text:S
154 |
155 | [Dep3]
156 | Meter=Shape
157 | MEterStyle=Dep.Shape:S
158 | [DepText3]
159 | Meter=String
160 | Text=Your appreciation
161 | MeterStyle=Dep.Text:S
162 |
163 | [Dep2]
164 | Meter=Shape
165 | MEterStyle=Dep.Shape:S
166 | Leftmouseupaction=["https://github.com/khanhas/MagickMeter#how-to-install"]
167 | [DepText2]
168 | Meter=String
169 | Text=ImageMagick // optional - required for Modular skins
170 | MeterStyle=Dep.Text:S
171 |
172 | ; ------------------------------------ Bot ----------------------------------- ;
173 |
174 | [ContinueButton]
175 | Meter=Shape
176 | X=(#Sec.P#+50)
177 | Y=(#Sec.H#-#Sec.P#-40)
178 | DynamicVariables=1
179 | Shape=Rectangle 0,0,120,40,(#Sec.R#/3) | StrokeWidth 0 | Fill COlor 0,255,50,200
180 | Leftmouseupaction=[!ActivateConfig "#JaxCore\Main" "Home.ini"][!DeactivateConfig]
181 | Hidden=1
182 | Group=Button
183 | [ContinueText]
184 | Meter=String
185 | X=(60)r
186 | y=(20)r
187 | FontSize=(10)
188 | Text=Continue
189 | FontFace=Roboto
190 | FontWeight=700
191 | StringAlign=CenterCenter
192 | MeterStyle=String:S
193 | Hidden=1
194 | Group=Button
195 |
196 | ; ---------------------------------------------------------------------------- ;
197 | ; Check for jax core ;
198 | ; ---------------------------------------------------------------------------- ;
199 |
200 | [WebParser]
201 | Measure=Calc
202 | Formula=40000
203 | ;URL=https://raw.githubusercontent.com/Jax-Core/JaxCore/main/%40Resources/Version.inc
204 | ;RegExp==(.*)$
205 | OnUpdateAction=[!Delay 1000][!CommandMeasure LogicalScript "check()"]
206 | OnConnectionErrorAction=[!SetOption Dep1 MeterStyle "Dep.Shape:S | Dep.ShapeNo:S"][!SetOption DepText1 Text "//Failed to connect to JaxCore github, if this is an issue please report to me"][!UpdateMEter *][!Redraw]
207 | OnRegExpErrorAction=[!Log Developer:RegExpFalse]
208 | Disabled=1
209 |
210 | [WebParserCheck]
211 | Measure=Calc
212 | IfCondition=#Parsed# = 1
213 | IfTrueAction=[!EnableMeasure WebParser][!UpdateMeasure WebParser][!CommandMeasure WebParser "Reset"]
214 |
215 | [InternetStatus]
216 | Measure=PLUGIN
217 | Plugin=SysInfo
218 | SysInfoType=INTERNET_CONNECTIVITY
219 | IfCondition=InternetStatus = -1
220 | ifTrueaction=[!SetOption Dep1 MeterStyle "Dep.Shape:S | Dep.ShapeNo:S"][!SetOption DepText1 Text "JaxCore // connection error, please check internet connection"][!UpdateMEter *][!Redraw]
221 |
222 | [mVer]
223 | Measure=Calc
224 | Formula=40000
225 | ;Measure=WebParser
226 | ;URL=[WebParser]
227 | ;StringIndex=1
228 |
229 | [LogicalScript]
230 | Measure=Script
231 | ScriptFile=Logic.lua
232 |
233 | [JaxCoreYes]
234 | Measure=String
235 | Group=NUOL
236 | Disabled=1
237 | OnUpdateAction=[!SetOption Dep1 MeterStyle "Dep.Shape:S | Dep.ShapeYes:S"][!SetOption DepText1 Text "JaxCore // v#Core.Ver# installed"][!ShowMeterGroup Button][!UpdateMEter *][!Redraw]
238 |
239 | [JaxCoreNo]
240 | Measure=String
241 | Group=NUOL
242 | Disabled=1
243 | OnUpdateAction=[!SetOption Dep1 MeterStyle "Dep.Shape:S | Dep.ShapeNo:S"][!SetOption DepText1 Text "JaxCore // click here to install"][!SetOption Dep1 Leftmouseupaction """["#@#Actions\AHKv1.exe" "#@#Actions\Installer.ahk"][!SetOption DepText1 Text "JaxCore // download here if it doesn't automatically install"][!SetOption Dep1 Leftmouseupaction """["https://github.com/Jax-Core/JaxCore/releases/latest"][!UpdateMEter *][!Redraw]"""][!UpdateMEter *][!Redraw]"""][!UpdateMEter *][!Redraw]
244 |
--------------------------------------------------------------------------------
/@Resources/LuaTween/Types/Multiple.lua:
--------------------------------------------------------------------------------
1 | -- Multiple-type tween
2 |
3 | -- Values are passed from Main's DoFileParams()
4 | local SKIN, Shared, tween = ...
5 |
6 | -- Standard varaibles that all type tween script's should have
7 | local tweensTable = {}
8 | local redraw = false
9 |
10 | --region Private functions
11 |
12 | -- Formats the parameters from RM, return false if parameters are insufficient
13 | -- Params: SectionName | optionalName | StartValue ; 0.0 | ... | EndValue ; 1.0 | Duration | SectionCount
14 | local function FormatParams(unformatParams)
15 | local params = Shared.SplitUnformat(unformatParams)
16 | local paramsLen = Shared.TableLength(params)
17 |
18 | if paramsLen < 6 then
19 | error("Parameters insufficient => " .. unformatParams)
20 | return false
21 | else
22 | for i=2, paramsLen do
23 | params[i] = Shared.ParseFormula(params[i])
24 | end
25 |
26 | local valueTable = Shared.CalcPathValueTable(params, 3, paramsLen - 2, unformatParams)
27 |
28 | if valueTable == nil then
29 | error("Path value syntax invalid for " .. unformatParams)
30 | return false
31 | end
32 |
33 | return params[1], params[2], valueTable, params[paramsLen-1], params[paramsLen]
34 | end
35 | end
36 |
37 | -- return easing, group, loop
38 | local function FormatOptionals(unformatOptionals)
39 | local optionals = Shared.SplitUnformat(unformatOptionals)
40 |
41 | -- Available optionals
42 | local easing, group, loop
43 |
44 | for _,v in pairs(optionals) do
45 | local param = Shared.SplitOptionalParam(v)
46 | local paramName = param[1]:lower()
47 |
48 | -- Process params
49 | if paramName == "easing" then
50 | easing = param[2]:lower()
51 |
52 | elseif paramName == "group" then
53 | group = param[2]:lower()
54 |
55 | elseif paramName == "loop" then
56 | loop = param[2]:lower()
57 | end
58 | end
59 |
60 | return easing, group, loop
61 | end
62 |
63 | local function Update(tween, child, dt)
64 | -- If state not equal 0, its either playing forwards or backwards
65 | if child.state ~= 0 then
66 | -- Updates the tween tweenvalue and return whether tweening is done, if so set state to 0 so no more updates
67 | if child.indexer:update(dt * child.state) then
68 | Shared.DoLoop(tween.loop, child, child.indexer)
69 | end
70 |
71 | local indexerValue = child.indexerValue
72 |
73 | for _,v in ipairs(child.tweens) do
74 | -- Check in range
75 | if indexerValue >= v.startPercent and indexerValue <= v.endPercent then
76 | -- Manually set value rather than update for precision
77 | v.tween:set(indexerValue - v.startPercent)
78 | Shared.DoTweenBang(tween.sectionType, child.sectionName, child.optionalName, Shared.TableToValue(v.value))
79 | break
80 | end
81 | end
82 |
83 | -- Needs redraw
84 | redraw = true
85 | end
86 | end
87 |
88 | -- Used by public functions to get the tween by index
89 | -- *func* refers to the function to be applied on the tween
90 | local function ProcessTween(index, subIndex, func)
91 | return Shared.ProcessTween(tweensTable, index, function(t)
92 | if subIndex == nil then
93 | for _,v in pairs(t.children) do
94 | func(t, v)
95 | end
96 | elseif t.children[subIndex] ~= nil then
97 | func(t, t.children[subIndex])
98 | else
99 | error("Tween" .. index .. " doesn't have a subIndex of " .. subIndex)
100 | end
101 | end)
102 | end
103 |
104 | --endregion
105 |
106 | --region Public functions
107 |
108 | Multiple = {}
109 |
110 | function Multiple.New(index, unformatParams, unformatOptionals)
111 | local sectionName, optionalName, valueTable, duration, sectionCount = FormatParams(unformatParams)
112 | local easing, group, loop = FormatOptionals(unformatOptionals)
113 |
114 | if not sectionName then
115 | error("Multiple-type tween creation failed")
116 | return
117 | end
118 |
119 | -- String -> number
120 | duration, sectionCount = tonumber(duration), tonumber(sectionCount)
121 |
122 | -- The parentSubject abstracts common variables of the child tweens to avoid repetitions
123 | local parentSubject =
124 | {
125 | sectionType = Shared.GetSectionType(Shared.ParseFormula(Shared.DoSub(sectionName, 0))),
126 | group = group,
127 | loop = Shared.CheckLoop(loop),
128 | children = {}
129 | }
130 |
131 | -- Creating the children
132 | for i=0, sectionCount-1 do
133 | local subject =
134 | {
135 | sectionName = Shared.ParseFormula(Shared.DoSub(sectionName, i)),
136 | optionalName = Shared.ParseFormula(Shared.DoSub(optionalName, i)),
137 | state = 0,
138 | tweens = {},
139 | indexerValue = 0
140 | }
141 |
142 | -- indexer in charges of tweening from 0 to 1, the indexerValue is then used to calculate the current value of the path
143 | subject.indexer = tween.new(duration, subject, { indexerValue = 1 }, easing or 'linear')
144 |
145 | -- A path consist of one or more linear tweens, create(a,b) creates the tween
146 | local create = function(a,b)
147 | if a.percent == b.percent then return end
148 |
149 | local subSubject =
150 | {
151 | startPercent = a.percent,
152 | endPercent = b.percent,
153 | value = Shared.ValueToTable(a.value)
154 | }
155 | subSubject.tween = tween.new(b.percent - a.percent, subSubject, { value = Shared.ValueToTable(b.value) }, 'linear')
156 |
157 | table.insert(subject.tweens, subSubject)
158 | end
159 |
160 | -- Iterate through the sorted values, creates the tween for the path
161 | for k,v in ipairs(valueTable) do
162 | -- For situations when the first percentual value is more than 0
163 | if k == 1 and v.percent > 0 then
164 | create({ value = v.value, percent = 0 }, v)
165 | end
166 |
167 | -- Normal situations when the next percentual value is available
168 | if valueTable[k+1] ~= nil then
169 | create(v, valueTable[k+1])
170 | -- For situations when the last percentual value is less than 1
171 | elseif v.percent < 1 then
172 | create(v, { value = v.value, percent = 1 })
173 | end
174 | end
175 |
176 | parentSubject.children[i] = subject
177 | end
178 |
179 | tweensTable[index] = parentSubject
180 | end
181 |
182 | -- Called by Mains's Update cycle
183 | function Multiple.Update(dt)
184 | redraw = false
185 |
186 | for _,v in pairs(tweensTable) do
187 | for _,vi in pairs(v.children) do
188 | Update(v, vi, dt)
189 | end
190 | end
191 |
192 | return redraw
193 | end
194 |
195 |
196 | -- Plays the tween forwards
197 | function Multiple.Start(index, subIndex)
198 | return ProcessTween(index, subIndex, function(t, st)
199 | st.state = 1
200 | end)
201 | end
202 |
203 | -- Plays the tween backwards
204 | function Multiple.Reverse(index, subIndex)
205 | return ProcessTween(index, subIndex, function(t, st)
206 | st.state = -1
207 | end)
208 | end
209 |
210 | -- Pauses the tween from playing
211 | function Multiple.Pause(index, subIndex)
212 | return ProcessTween(index, subIndex, function(t, st)
213 | st.state = 0
214 | end)
215 | end
216 |
217 | -- Sets the tween clock = duration, value is the EndValue
218 | function Multiple.Finish(index, subIndex)
219 | return ProcessTween(index, subIndex, function(t, st)
220 | st.indexer:finish()
221 | st.state = 1
222 |
223 | local cacheLoop = t.loop
224 | t.loop = "none"
225 | Update(t, st, 810)
226 | t.loop = cacheLoop
227 | end)
228 | end
229 |
230 | -- Sets the tween clock = 0, , value is the StartValue
231 | function Multiple.Reset(index, subIndex)
232 | return ProcessTween(index, subIndex, function(t, st)
233 | st.indexer:reset()
234 | st.state = -1
235 |
236 | local cacheLoop = t.loop
237 | t.loop = "none"
238 | Update(t, st, 810)
239 | t.loop = cacheLoop
240 | end)
241 | end
242 |
243 | -- Set the optional of a tween
244 | function Multiple.SetOptional(index, subIndex, optionalName, ...)
245 | if type(subIndex) == "string" then
246 | table.insert(arg, 1, optionalName)
247 | optionalName = subIndex
248 | subIndex = nil
249 | end
250 |
251 | optionalName = optionalName:lower()
252 | local func
253 |
254 | if optionalName == "easing" then
255 | func = function(t, st)
256 | st.indexer:setEasing(arg[1]:lower())
257 | end
258 | elseif optionalName == "group" then
259 | func = function(t)
260 | t.group = arg[1]:lower()
261 | end
262 | elseif optionalName == "loop" then
263 | func = function(t)
264 | t.loop = arg[1]:lower()
265 | end
266 | else
267 | error("Option Name \"" .. optionalName .. "\" is an invalid option or couldn't be set")
268 | end
269 |
270 | return ProcessTween(index, subIndex, func)
271 | end
272 |
273 | --endregion
--------------------------------------------------------------------------------
/@Resources/LuaTween/Types/_Shared.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Shared.lua
3 |
4 | This script extracts common functions used by the tween types (Single, Chain and Multiple)
5 | to reduce repetitive declaration. It may save a tincy wincy of time when loading skins.
6 | The script is also akin to a Helper class for other scripts.
7 | ]]--
8 |
9 | -- Value is passed from Main's DoFileParams()
10 | local SKIN = ...
11 |
12 | -- The type of loops supported
13 | local loops = { "none", "restart", "yoyo" }
14 |
15 | Shared = {}
16 |
17 |
18 |
19 | --region Split functions
20 |
21 | -- Split params by "|"
22 | function Shared.SplitUnformat(str, maxNb)
23 | return Shared.split(str, "|", maxNb)
24 | end
25 |
26 | -- Split optional params
27 | -- From Easing linear
28 | -- To Easing linear
29 | function Shared.SplitOptionalParam(str, maxNb)
30 | return Shared.split(str, " ", maxNb)
31 | end
32 |
33 | -- From 0,255,180 ; 0.5
34 | -- To 0,255,180 0.5
35 | function Shared.SplitPathValueParam(str)
36 | local valueParam = Shared.split(str, ";", 2)
37 |
38 | if #valueParam < 1 then
39 | error("Parameters insufficient => " .. str)
40 | return false
41 | else
42 | return valueParam[1], valueParam[2]
43 | end
44 | end
45 |
46 | --endregion
47 |
48 | --region Substitution and parsing
49 |
50 | -- Parse string to RM to be calculated
51 | function Shared.ParseFormula(str)
52 | return SKIN:ReplaceVariables(str):gsub("%(.+%)", function(f) return SKIN:ParseFormula(f) end)
53 | end
54 |
55 | -- Substitute %% to i
56 | function Shared.DoSub(str, i)
57 | return str:gsub("%%%%", i)
58 | end
59 |
60 | -- eg 8,1,0 to { 8, 1, 0 }
61 | -- So that tween.lua can calculate the tween by tables
62 | function Shared.ValueToTable(value)
63 | local tbl = Shared.split(value, ",")
64 | for i,v in pairs(tbl) do tbl[i] = tonumber(v) end
65 | return tbl
66 | end
67 |
68 | -- Similar to ValueToTable(value) but doesnt convert the values to numbers
69 | function Shared.GroupToTable(groupParams)
70 | return Shared.split(groupParams, ",")
71 | end
72 |
73 | -- Inverse of ValueToTable(value)
74 | function Shared.TableToValue(tbl)
75 | return table.concat(tbl, ",")
76 | end
77 |
78 | --endregion
79 |
80 | --region Rainmeter stuff
81 |
82 | -- Whether the section supplied is a meter, measure, variable or group
83 | function Shared.GetSectionType(sectionName)
84 | if sectionName:lower() == "variable" then
85 | return "variable"
86 | elseif SKIN:GetMeter(sectionName) ~= nil then
87 | return "meter"
88 | elseif SKIN:GetMeasure(sectionName) ~= nil then
89 | return "measure"
90 | else
91 | return "group"
92 | end
93 | end
94 |
95 | -- Apply the changes in RM (Used by UpdateTween(v))
96 | function Shared.DoTweenBang(type, sectionName, optionName, value)
97 | if type == "meter" or type == 'measure' then
98 | SKIN:Bang('!SetOption', sectionName, optionName, value)
99 |
100 | elseif type == "variable" then
101 | SKIN:Bang('!SetVariable', optionName, value)
102 |
103 | elseif type == "group" then
104 | SKIN:Bang('!SetOptionGroup', sectionName, optionName, value)
105 |
106 | else
107 | Shared.LogInternalError("Tween Bang error: " .. type)
108 | end
109 | end
110 |
111 | -- Check if the loop is valid by comparing the *loops* table
112 | function Shared.CheckLoop(type)
113 | if Shared.ContainsValue(loops, type) then
114 | return type
115 | else
116 | return "none"
117 | end
118 | end
119 |
120 | -- Process the input when a public function is called (eg "Start(0)")
121 | -- Requires tweensTable and groupTable, which should be included in all
122 | -- tween type scripts.
123 | -- *func* refers to the function to be applied on the tween
124 | function Shared.ProcessTween(tweensTable, index, func)
125 | if type(index) == "number" then
126 | if tweensTable[index] ~= nil then
127 | func(tweensTable[index])
128 | else
129 | return false
130 | end
131 | elseif type(index) == "string" then
132 | index = index:lower()
133 | local found = 0
134 |
135 | for _,v in pairs(tweensTable) do
136 | if v.group == index then
137 | func(v)
138 | found = found + 1
139 | end
140 | end
141 |
142 | if found == 0 then
143 | return false
144 | end
145 | else
146 | error("The index given is a " .. type(index) .. ". Numbers and strings are only accepted")
147 | return false
148 | end
149 |
150 | return true
151 | end
152 |
153 | -- Do loop based on loop type on the tween or state
154 | -- This function in slightly hard-coded because in depends on state
155 | -- *subjectWithState* is passed rather then *state* to be passed as reference rather than values
156 | function Shared.DoLoop(loopType, subjectWithState, subjectsTween)
157 | if loopType == "none" then
158 | subjectWithState.state = 0
159 |
160 | elseif loopType == "restart" then
161 | if subjectWithState.state > 0 then subjectsTween:reset() else subjectsTween:finish() end
162 |
163 | elseif loopType == "yoyo" then
164 | subjectWithState.state = -subjectWithState.state
165 | else
166 | Shared.LogInternalError("Loop error: " .. loopType)
167 | end
168 | end
169 |
170 | -- Calculates the path valueTable from paramsTable
171 | -- *paramsTable* refers to the formated params in a table
172 | -- then index the table from *fromIndex* to *toIndex*
173 | -- finally returns the valueTable
174 | -- *unformatParams is passed in for debugging purpose*
175 | function Shared.CalcPathValueTable(paramsTable, fromIndex, toIndex, unformatParams)
176 | local valueTable = {}
177 | local isPercentDefined = false
178 | local gapCount, index = toIndex - fromIndex, 0
179 |
180 | for i=fromIndex, toIndex do
181 | local value, percent = Shared.SplitPathValueParam(paramsTable[i])
182 |
183 | -- Early out if syntax is invalid
184 | if not value then
185 | error("Syntax invalid for param number" .. i .. " in " .. unformatParams)
186 | return
187 | end
188 |
189 | -- Make sure all values are defined with the same syntax (With percentual or otherwise)
190 | if i == fromIndex then
191 | isPercentDefined = percent ~= nil
192 | elseif isPercentDefined == (percent == nil) then
193 | error("You've used percentages in the param => " .. unformatParams .. ". The rest should also explicitly use percentages in their params")
194 | return
195 | end
196 |
197 | if isPercentDefined then
198 | -- Use hte defined percentual values
199 | percent = Shared.Clamp(tonumber(percent), 0, 1)
200 | else
201 | -- Equivalently distribute percentages acroos values
202 | percent = index / gapCount
203 | end
204 |
205 | table.insert(valueTable, { value = value, percent = percent })
206 |
207 | index = index + 1
208 | end
209 |
210 | -- If percent is defined explicitly, make sure the percentual values are in order
211 | if isPercentDefined then
212 | table.sort(valueTable, function(a,b) return a.percent < b.percent end)
213 | end
214 |
215 | return valueTable
216 | end
217 |
218 | --endregion
219 |
220 | --region Utilities
221 |
222 | -- Copied from https://www.lua-users.org/wiki/SplitJoin
223 | -- Added trimming
224 | function Shared.split(str, delim, maxNb)
225 | -- Eliminate bad cases...
226 | if string.find(str, delim) == nil then
227 | return { str }
228 | end
229 |
230 | if maxNb == nil or maxNb < 1 then
231 | maxNb = 0 -- No limit
232 | end
233 |
234 | local result = {}
235 | local pat = "(.-)" .. delim .. "()"
236 | local nb = 0
237 | local lastPos = 0
238 |
239 | for part, pos in string.gmatch(str, pat) do
240 | local s = Shared.trim(part)
241 |
242 | if s ~= nil and s ~= "" then
243 | nb = nb + 1
244 | result[nb] = s
245 | end
246 |
247 | lastPos = pos
248 |
249 | if(nb == maxNb) then
250 | break
251 | end
252 | end
253 |
254 | if nb ~= maxNb then
255 | result[nb + 1] = Shared.trim(str:sub(lastPos))
256 | end
257 |
258 | return result
259 | end
260 |
261 | -- Copied from https://lua-users.org/wiki/CommonFunctions
262 | -- remove trailing and leading whitespace from string
263 | -- https://en.wikipedia.org/wiki/Trim_(programming)
264 | function Shared.trim(s)
265 | -- from PiL2 20.4
266 | return s:gsub("^%s*(.-)%s*$", "%1")
267 | end
268 |
269 | -- Clamps value between min and max
270 | function Shared.Clamp(value, min, max)
271 | if value < min then value = min
272 | elseif value > max then value = max
273 | end
274 |
275 | return value
276 | end
277 |
278 | function Shared.ContainsValue(table, value)
279 | if value == nil then
280 | return false
281 | end
282 |
283 | for i,v in pairs(table) do
284 | if v == value then
285 | return true, i
286 | end
287 | end
288 |
289 | return false
290 | end
291 |
292 | -- Gets the length of table
293 | function Shared.TableLength(table)
294 | local i = 0
295 | for _ in pairs(table) do i = i + 1 end
296 | return i
297 | end
298 |
299 | -- A log function incase things happen where it shouldnt happen :P
300 | function Shared.LogInternalError(message)
301 | print("Oops, internal error.. Please contact me :)", "Message: " .. message)
302 | end
303 |
304 | --endregion
--------------------------------------------------------------------------------
/@Resources/LuaTween/Types/Chain.lua:
--------------------------------------------------------------------------------
1 | -- Chain-type tween
2 |
3 | -- Values are passed from Main's DoFileParams()
4 | local SKIN, Shared, tween = ...
5 |
6 | -- Standard varaibles that all type tween script's should have
7 | local tweensTable = {}
8 | local redraw = false
9 |
10 | --region Private functions
11 |
12 | -- Formats the parameters from RM, return false if parameters are insufficient
13 | -- Params: SectionName | optionalName | StartValue ; 0.0 | ... | EndValue ; 1.0 | Duration | Interval | SectionCount
14 | local function FormatParams(unformatParams)
15 | local params = Shared.SplitUnformat(unformatParams)
16 | local paramsLen = Shared.TableLength(params)
17 |
18 | if paramsLen < 7 then
19 | error("Parameters insufficient => " .. unformatParams)
20 | return false
21 | else
22 | for i=2, paramsLen do
23 | params[i] = Shared.ParseFormula(params[i])
24 | end
25 |
26 | local valueTable = Shared.CalcPathValueTable(params, 3, paramsLen - 3, unformatParams)
27 |
28 | if valueTable == nil then
29 | error("Path value syntax invalid for " .. unformatParams)
30 | return false
31 | end
32 |
33 | return params[1], params[2], valueTable, params[paramsLen - 2], params[paramsLen - 1], params[paramsLen]
34 | end
35 | end
36 |
37 | -- return easing, group, loop
38 | local function FormatOptionals(unformatOptionals)
39 | local optionals = Shared.SplitUnformat(unformatOptionals)
40 |
41 | local easing, group, loop
42 |
43 | for _,v in pairs(optionals) do
44 | local param = Shared.SplitOptionalParam(v)
45 | local paramName = param[1]:lower()
46 |
47 | -- Process param
48 | if paramName == "easing" then
49 | easing = param[2]:lower()
50 |
51 | elseif paramName == "group" then
52 | group = param[2]:lower()
53 |
54 | elseif paramName == "loop" then
55 | loop = param[2]:lower()
56 | end
57 | end
58 |
59 | return easing, group, loop
60 | end
61 |
62 | -- Whether the chain(parent) needs to trigger the child to play (Used by UpdateTween(v))
63 | local function ChainNeedTrigger(parent, child)
64 | -- If playing forward, return true if clock passed the startTime but passed is not marked true
65 | if parent.state > 0 then return parent.clock >= child.startTime and not child.passed
66 | -- If playing forward, return true if clock passed the endTime but passed is marked true (Should be not passed)
67 | elseif parent.state < 0 then return parent.clock <= child.endTime and child.passed
68 | else return false
69 | end
70 | end
71 |
72 | local function Update(tween, dt)
73 | -- If state not equal 0, its either playing forwards or backwards
74 | if tween.state ~= 0 then
75 | -- Updates the tween value and return whether tweening is done (Cache since tween.state be used below again, will do loop at the end)
76 | local tweenDone = tween.tween:update(dt * tween.state)
77 |
78 | -- Iterate through all the tweens of the tweenChain
79 | for _,v in pairs(tween.tweens) do
80 | -- Check if a trigger is needed to set the tween state (The set will only occur once)
81 | if ChainNeedTrigger(tween, v) then
82 | -- Set the state to the parent state (play forwards or backwards)
83 | v.state = tween.state
84 | -- Set passed true if playing forwards, false if playing backwards
85 | v.passed = (tween.state > 0)
86 | end
87 |
88 | -- If state not equal 0, its either playing forwards or backwards
89 | if v.state ~= 0 then
90 | -- Updates the tween tweenvalue and return whether tweening is done, if so s set state to 0
91 | if v.indexer:update(dt * v.state) then v.state = 0 end
92 |
93 | local indexerValue = v.indexerValue
94 |
95 | for _,vi in ipairs(v.tweens) do
96 | -- Check in range
97 | if indexerValue >= vi.startPercent and indexerValue <= vi.endPercent then
98 | -- Manually set value rather than update for precision
99 | vi.tween:set(indexerValue - vi.startPercent)
100 | Shared.DoTweenBang(tween.sectionType, v.sectionName, v.optionalName, Shared.TableToValue(vi.value))
101 | break
102 | end
103 | end
104 | end
105 | end
106 |
107 | if tweenDone then
108 | Shared.DoLoop(tween.loop, tween, tween.tween)
109 | end
110 |
111 | -- Needs redraw
112 | redraw = true
113 | end
114 | end
115 |
116 | -- Used by public functions to get the tween by index
117 | -- *func* refers to the function to be applied on the tween
118 | local function ProcessTween(index, func)
119 | return Shared.ProcessTween(tweensTable, index, func)
120 | end
121 |
122 | --endregion
123 |
124 | --region Public functions
125 |
126 | Chain = {}
127 |
128 | function Chain.New(index, unformatParams, unformatOptionals)
129 | local sectionName, optionalName, valueTable, duration, interval, sectionCount = FormatParams(unformatParams)
130 | local easing, group, loop = FormatOptionals(unformatOptionals)
131 |
132 | if not sectionName then
133 | error("Chain-type tween creation failed")
134 | return
135 | end
136 |
137 | -- String -> number
138 | duration, interval, sectionCount = tonumber(duration), tonumber(interval), tonumber(sectionCount)
139 |
140 | -- The total time needed to tween all
141 | local totalTime = (sectionCount - 1) * interval + duration
142 |
143 | local parentSubject =
144 | {
145 | sectionType = Shared.GetSectionType(Shared.ParseFormula(Shared.DoSub(sectionName, 0))),
146 | group = group,
147 | loop = Shared.CheckLoop(loop),
148 | state = 0,
149 | clock = 0,
150 | tweens = {},
151 | }
152 |
153 | -- Tweens across the chain of tweens by tweening the clock
154 | -- The update cycle will then determine which subtweens(or child tweens) to play
155 | parentSubject.tween = tween.new(totalTime, parentSubject, { clock = totalTime }, 'linear')
156 |
157 | -- Creating the children
158 | for j=0, sectionCount-1 do
159 | local subject =
160 | {
161 | sectionName = Shared.ParseFormula(Shared.DoSub(sectionName, j)),
162 | optionalName = Shared.ParseFormula(Shared.DoSub(optionalName, j)),
163 | startTime = interval * j,
164 | endTime = interval * j + duration,
165 | valueTable = valueTable,
166 | passed = false,
167 | state = 0,
168 | tweens = {},
169 | indexerValue = 0
170 | }
171 |
172 | -- indexer in charges of tweening from 0 to 1, the indexerValue is then used to calculate the current value of the path
173 | subject.indexer = tween.new(duration, subject, { indexerValue = 1 }, easing or 'linear')
174 |
175 | -- A path consist of one or more linear tweens, create(a,b) creates the tween
176 | local create = function(a,b)
177 | if a.percent == b.percent then return end
178 |
179 | local subSubject =
180 | {
181 | startPercent = a.percent,
182 | endPercent = b.percent,
183 | value = Shared.ValueToTable(a.value)
184 | }
185 | subSubject.tween = tween.new(b.percent - a.percent, subSubject, { value = Shared.ValueToTable(b.value) }, 'linear')
186 |
187 | table.insert(subject.tweens, subSubject)
188 | end
189 |
190 | -- Iterate through the sorted values, creates the tween for the path
191 | for k,v in ipairs(valueTable) do
192 | -- For situations when the first percentual value is more than 0
193 | if k == 1 and v.percent > 0 then
194 | create({ value = v.value, percent = 0 }, v)
195 | end
196 |
197 | -- Normal situations when the next percentual value is available
198 | if valueTable[k+1] ~= nil then
199 | create(v, valueTable[k+1])
200 | -- For situations when the last percentual value is less than 1
201 | elseif v.percent < 1 then
202 | create(v, { value = v.value, percent = 1 })
203 | end
204 | end
205 |
206 | parentSubject.tweens[j] = subject
207 | end
208 |
209 | tweensTable[index] = parentSubject
210 | end
211 |
212 | -- Called by Mains's Update cycle
213 | function Chain.Update(dt)
214 | redraw = false
215 |
216 | for _,v in pairs(tweensTable) do
217 | Update(v, dt)
218 | end
219 |
220 | return redraw
221 | end
222 |
223 |
224 | -- Plays the tween forwards
225 | function Chain.Start(index)
226 | return ProcessTween(index, function(t)
227 | t.state = 1
228 | end)
229 | end
230 |
231 | -- Plays the tween backwards
232 | function Chain.Reverse(index)
233 | return ProcessTween(index, function(t)
234 | t.state = -1
235 | end)
236 | end
237 |
238 | -- Pauses the tween from playing
239 | function Chain.Pause(index)
240 | return ProcessTween(index, function(t)
241 | t.state = 0
242 | end)
243 | end
244 |
245 | -- Sets the tween clock = duration, value is the EndValue
246 | function Chain.Finish(index)
247 | return ProcessTween(index, function(t)
248 | t.tween:finish()
249 | t.state = 1
250 |
251 | -- loop is set to none for a constant outcome of Update
252 | local cacheLoop = t.loop
253 | t.loop = "none"
254 | for _,v in pairs(t.tweens) do v.indexer:finish() end
255 | Update(t, 810)
256 | t.loop = cacheLoop
257 | end)
258 | end
259 |
260 | -- Sets the tween clock = 0, , value is the StartValue
261 | function Chain.Reset(index)
262 | return ProcessTween(index, function(t)
263 | t.tween:reset()
264 | t.state = -1
265 |
266 | -- loop is set to none for a constant outcome of Update
267 | local cacheLoop = t.loop
268 | t.loop = "none"
269 | for _,v in pairs(t.tweens) do v.indexer:reset() end
270 | Update(t, 810)
271 | t.loop = cacheLoop
272 | end)
273 | end
274 |
275 | -- Set the optional of a tween
276 | function Chain.SetOptional(index, optionalName, ...)
277 | optionalName = optionalName:lower()
278 | local func
279 |
280 | if optionalName == "easing" then
281 | func = function(t)
282 | for _,v in pairs(t.tweens) do
283 | v.indexer:setEasing(arg[1]:lower())
284 | end
285 | end
286 | elseif optionalName == "group" then
287 | func = function(t)
288 | t.group = arg[1]:lower()
289 | end
290 | elseif optionalName == "loop" then
291 | func = function(t)
292 | t.loop = arg[1]:lower()
293 | end
294 | else
295 | error("Option Name \"" .. optionalName .. "\" is an invalid option or couldn't be set")
296 | end
297 |
298 | return ProcessTween(index, func)
299 | end
300 |
301 | --endregion
--------------------------------------------------------------------------------
/@Resources/Lua/tween.lua:
--------------------------------------------------------------------------------
1 | tween = {
2 | _VERSION = 'tween 2.1.1',
3 | _DESCRIPTION = 'tweening for lua',
4 | _URL = 'https://github.com/kikito/tween.lua',
5 | _LICENSE = [[
6 | MIT LICENSE
7 |
8 | Copyright (c) 2014 Enrique García Cota, Yuichi Tateno, Emmanuel Oga
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a
11 | copy of this software and associated documentation files (the
12 | "Software"), to deal in the Software without restriction, including
13 | without limitation the rights to use, copy, modify, merge, publish,
14 | distribute, sublicense, and/or sell copies of the Software, and to
15 | permit persons to whom the Software is furnished to do so, subject to
16 | the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included
19 | in all copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 | ]]
29 | }
30 |
31 | -- easing
32 |
33 | -- Adapted from https://github.com/EmmanuelOga/easing. See LICENSE.txt for credits.
34 | -- For all easing functions:
35 | -- t = time == how much time has to pass for the tweening to complete
36 | -- b = begin == starting property value
37 | -- c = change == ending - beginning
38 | -- d = duration == running time. How much time has passed *right now*
39 |
40 | local pow, sin, cos, pi, sqrt, abs, asin = math.pow, math.sin, math.cos, math.pi, math.sqrt, math.abs, math.asin
41 |
42 | -- linear
43 | local function linear(t, b, c, d) return c * t / d + b end
44 |
45 | -- quad
46 | local function inQuad(t, b, c, d) return c * pow(t / d, 2) + b end
47 | local function outQuad(t, b, c, d)
48 | t = t / d
49 | return -c * t * (t - 2) + b
50 | end
51 | local function inOutQuad(t, b, c, d)
52 | t = t / d * 2
53 | if t < 1 then return c / 2 * pow(t, 2) + b end
54 | return -c / 2 * ((t - 1) * (t - 3) - 1) + b
55 | end
56 | local function outInQuad(t, b, c, d)
57 | if t < d / 2 then return outQuad(t * 2, b, c / 2, d) end
58 | return inQuad((t * 2) - d, b + c / 2, c / 2, d)
59 | end
60 |
61 | -- cubic
62 | local function inCubic (t, b, c, d) return c * pow(t / d, 3) + b end
63 | local function outCubic(t, b, c, d) return c * (pow(t / d - 1, 3) + 1) + b end
64 | local function inOutCubic(t, b, c, d)
65 | t = t / d * 2
66 | if t < 1 then return c / 2 * t * t * t + b end
67 | t = t - 2
68 | return c / 2 * (t * t * t + 2) + b
69 | end
70 | local function outInCubic(t, b, c, d)
71 | if t < d / 2 then return outCubic(t * 2, b, c / 2, d) end
72 | return inCubic((t * 2) - d, b + c / 2, c / 2, d)
73 | end
74 |
75 | -- quart
76 | local function inQuart(t, b, c, d) return c * pow(t / d, 4) + b end
77 | local function outQuart(t, b, c, d) return -c * (pow(t / d - 1, 4) - 1) + b end
78 | local function inOutQuart(t, b, c, d)
79 | t = t / d * 2
80 | if t < 1 then return c / 2 * pow(t, 4) + b end
81 | return -c / 2 * (pow(t - 2, 4) - 2) + b
82 | end
83 | local function outInQuart(t, b, c, d)
84 | if t < d / 2 then return outQuart(t * 2, b, c / 2, d) end
85 | return inQuart((t * 2) - d, b + c / 2, c / 2, d)
86 | end
87 |
88 | -- quint
89 | local function inQuint(t, b, c, d) return c * pow(t / d, 5) + b end
90 | local function outQuint(t, b, c, d) return c * (pow(t / d - 1, 5) + 1) + b end
91 | local function inOutQuint(t, b, c, d)
92 | t = t / d * 2
93 | if t < 1 then return c / 2 * pow(t, 5) + b end
94 | return c / 2 * (pow(t - 2, 5) + 2) + b
95 | end
96 | local function outInQuint(t, b, c, d)
97 | if t < d / 2 then return outQuint(t * 2, b, c / 2, d) end
98 | return inQuint((t * 2) - d, b + c / 2, c / 2, d)
99 | end
100 |
101 | -- sine
102 | local function inSine(t, b, c, d) return -c * cos(t / d * (pi / 2)) + c + b end
103 | local function outSine(t, b, c, d) return c * sin(t / d * (pi / 2)) + b end
104 | local function inOutSine(t, b, c, d) return -c / 2 * (cos(pi * t / d) - 1) + b end
105 | local function outInSine(t, b, c, d)
106 | if t < d / 2 then return outSine(t * 2, b, c / 2, d) end
107 | return inSine((t * 2) -d, b + c / 2, c / 2, d)
108 | end
109 |
110 | -- expo
111 | local function inExpo(t, b, c, d)
112 | if t == 0 then return b end
113 | return c * pow(2, 10 * (t / d - 1)) + b - c * 0.001
114 | end
115 | local function outExpo(t, b, c, d)
116 | if t == d then return b + c end
117 | return c * 1.001 * (-pow(2, -10 * t / d) + 1) + b
118 | end
119 | local function inOutExpo(t, b, c, d)
120 | if t == 0 then return b end
121 | if t == d then return b + c end
122 | t = t / d * 2
123 | if t < 1 then return c / 2 * pow(2, 10 * (t - 1)) + b - c * 0.0005 end
124 | return c / 2 * 1.0005 * (-pow(2, -10 * (t - 1)) + 2) + b
125 | end
126 | local function outInExpo(t, b, c, d)
127 | if t < d / 2 then return outExpo(t * 2, b, c / 2, d) end
128 | return inExpo((t * 2) - d, b + c / 2, c / 2, d)
129 | end
130 |
131 | -- circ
132 | local function inCirc(t, b, c, d) return(-c * (sqrt(1 - pow(t / d, 2)) - 1) + b) end
133 | local function outCirc(t, b, c, d) return(c * sqrt(1 - pow(t / d - 1, 2)) + b) end
134 | local function inOutCirc(t, b, c, d)
135 | t = t / d * 2
136 | if t < 1 then return -c / 2 * (sqrt(1 - t * t) - 1) + b end
137 | t = t - 2
138 | return c / 2 * (sqrt(1 - t * t) + 1) + b
139 | end
140 | local function outInCirc(t, b, c, d)
141 | if t < d / 2 then return outCirc(t * 2, b, c / 2, d) end
142 | return inCirc((t * 2) - d, b + c / 2, c / 2, d)
143 | end
144 |
145 | -- elastic
146 | local function calculatePAS(p,a,c,d)
147 | p, a = p or d * 0.3, a or 0
148 | if a < abs(c) then return p, c, p / 4 end -- p, a, s
149 | return p, a, p / (2 * pi) * asin(c/a) -- p,a,s
150 | end
151 | local function inElastic(t, b, c, d, a, p)
152 | local s
153 | if t == 0 then return b end
154 | t = t / d
155 | if t == 1 then return b + c end
156 | p,a,s = calculatePAS(p,a,c,d)
157 | t = t - 1
158 | return -(a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b
159 | end
160 | local function outElastic(t, b, c, d, a, p)
161 | local s
162 | if t == 0 then return b end
163 | t = t / d
164 | if t == 1 then return b + c end
165 | p,a,s = calculatePAS(p,a,c,d)
166 | return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
167 | end
168 | local function inOutElastic(t, b, c, d, a, p)
169 | local s
170 | if t == 0 then return b end
171 | t = t / d * 2
172 | if t == 2 then return b + c end
173 | p,a,s = calculatePAS(p,a,c,d)
174 | t = t - 1
175 | if t < 0 then return -0.5 * (a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b end
176 | return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p ) * 0.5 + c + b
177 | end
178 | local function outInElastic(t, b, c, d, a, p)
179 | if t < d / 2 then return outElastic(t * 2, b, c / 2, d, a, p) end
180 | return inElastic((t * 2) - d, b + c / 2, c / 2, d, a, p)
181 | end
182 |
183 | -- back
184 | local function inBack(t, b, c, d, s)
185 | s = s or 1.70158
186 | t = t / d
187 | return c * t * t * ((s + 1) * t - s) + b
188 | end
189 | local function outBack(t, b, c, d, s)
190 | s = s or 1.70158
191 | t = t / d - 1
192 | return c * (t * t * ((s + 1) * t + s) + 1) + b
193 | end
194 | local function inOutBack(t, b, c, d, s)
195 | s = (s or 1.70158) * 1.525
196 | t = t / d * 2
197 | if t < 1 then return c / 2 * (t * t * ((s + 1) * t - s)) + b end
198 | t = t - 2
199 | return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b
200 | end
201 | local function outInBack(t, b, c, d, s)
202 | if t < d / 2 then return outBack(t * 2, b, c / 2, d, s) end
203 | return inBack((t * 2) - d, b + c / 2, c / 2, d, s)
204 | end
205 |
206 | -- bounce
207 | local function outBounce(t, b, c, d)
208 | t = t / d
209 | if t < 1 / 2.75 then return c * (7.5625 * t * t) + b end
210 | if t < 2 / 2.75 then
211 | t = t - (1.5 / 2.75)
212 | return c * (7.5625 * t * t + 0.75) + b
213 | elseif t < 2.5 / 2.75 then
214 | t = t - (2.25 / 2.75)
215 | return c * (7.5625 * t * t + 0.9375) + b
216 | end
217 | t = t - (2.625 / 2.75)
218 | return c * (7.5625 * t * t + 0.984375) + b
219 | end
220 | local function inBounce(t, b, c, d) return c - outBounce(d - t, 0, c, d) + b end
221 | local function inOutBounce(t, b, c, d)
222 | if t < d / 2 then return inBounce(t * 2, 0, c, d) * 0.5 + b end
223 | return outBounce(t * 2 - d, 0, c, d) * 0.5 + c * .5 + b
224 | end
225 | local function outInBounce(t, b, c, d)
226 | if t < d / 2 then return outBounce(t * 2, b, c / 2, d) end
227 | return inBounce((t * 2) - d, b + c / 2, c / 2, d)
228 | end
229 |
230 | -- Keys to lowercase by Blu, to enable case-insensitivity when using easings
231 | tween.easing = {
232 | linear = linear,
233 | inquad = inQuad, outquad = outQuad, inoutquad = inOutQuad, outinquad = outInQuad,
234 | incubic = inCubic, outcubic = outCubic, inoutcubic = inOutCubic, outincubic = outInCubic,
235 | inquart = inQuart, outquart = outQuart, inoutquart = inOutQuart, outinquart = outInQuart,
236 | inquint = inQuint, outquint = outQuint, inoutquint = inOutQuint, outinquint = outInQuint,
237 | insine = inSine, outsine = outSine, inoutsine = inOutSine, outinsine = outInSine,
238 | inexpo = inExpo, outexpo = outExpo, inoutexpo = inOutExpo, outinexpo = outInExpo,
239 | incirc = inCirc, outcirc = outCirc, inoutcirc = inOutCirc, outincirc = outInCirc,
240 | inelastic = inElastic, outelastic = outElastic, inoutelastic = inOutElastic, outinelastic = outInElastic,
241 | inback = inBack, outback = outBack, inoutback = inOutBack, outinback = outInBack,
242 | inbounce = inBounce, outbounce = outBounce, inoutbounce = inOutBounce, outinbounce = outInBounce
243 | }
244 |
245 |
246 |
247 | -- private stuff
248 |
249 | local function copyTables(destination, keysTable, valuesTable)
250 | valuesTable = valuesTable or keysTable
251 | local mt = getmetatable(keysTable)
252 | if mt and getmetatable(destination) == nil then
253 | setmetatable(destination, mt)
254 | end
255 | for k,v in pairs(keysTable) do
256 | if type(v) == 'table' then
257 | destination[k] = copyTables({}, v, valuesTable[k])
258 | else
259 | destination[k] = valuesTable[k]
260 | end
261 | end
262 | return destination
263 | end
264 |
265 | local function checkSubjectAndTargetRecursively(subject, target, path)
266 | path = path or {}
267 | local targetType, newPath
268 | for k,targetValue in pairs(target) do
269 | targetType, newPath = type(targetValue), copyTables({}, path)
270 | table.insert(newPath, tostring(k))
271 | if targetType == 'number' then
272 | assert(type(subject[k]) == 'number', "Parameter '" .. table.concat(newPath,'/') .. "' is missing from subject or isn't a number")
273 | elseif targetType == 'table' then
274 | checkSubjectAndTargetRecursively(subject[k], targetValue, newPath)
275 | else
276 | print(targetType)
277 | assert(targetType == 'number', "Parameter '" .. table.concat(newPath,'/') .. "' must be a number or table of numbers")
278 | end
279 | end
280 | end
281 |
282 | local function checkNewParams(duration, subject, target, easing)
283 | assert(type(duration) == 'number' and duration > 0, "duration must be a positive number. Was " .. tostring(duration))
284 | local tsubject = type(subject)
285 | assert(tsubject == 'table' or tsubject == 'userdata', "subject must be a table or userdata. Was " .. tostring(subject))
286 | assert(type(target)== 'table', "target must be a table. Was " .. tostring(target))
287 | assert(type(easing)=='function', "easing must be a function. Was " .. tostring(easing))
288 | checkSubjectAndTargetRecursively(subject, target)
289 | end
290 |
291 | local function getEasingFunction(easing)
292 | easing = easing or "linear"
293 | if type(easing) == 'string' then
294 | local name = easing:lower()
295 | easing = tween.easing[name]
296 |
297 | if type(easing) ~= 'function' then
298 | -- Added by Blu
299 | easing = tween.easing["linear"]
300 | error("The easing function name '" .. name .. "' is invalid. Replaced to \"linear\"")
301 | end
302 | end
303 | return easing
304 | end
305 |
306 | local function performEasingOnSubject(subject, target, initial, clock, duration, easing)
307 | local t,b,c,d
308 | for k,v in pairs(target) do
309 | if type(v) == 'table' then
310 | performEasingOnSubject(subject[k], v, initial[k], clock, duration, easing)
311 | else
312 | t,b,c,d = clock, initial[k], v - initial[k], duration
313 | subject[k] = easing(t,b,c,d)
314 | end
315 | end
316 | end
317 |
318 |
319 | -- Tween methods
320 |
321 | local Tween = {}
322 | local Tween_mt = {__index = Tween}
323 |
324 | function Tween:set(clock)
325 | assert(type(clock) == 'number', "clock must be a positive number or 0")
326 |
327 | self.initial = self.initial or copyTables({}, self.target, self.subject)
328 | self.clock = clock
329 |
330 | if self.clock <= 0 then
331 |
332 | self.clock = 0
333 | copyTables(self.subject, self.initial)
334 |
335 | elseif self.clock >= self.duration then -- the tween has expired
336 |
337 | self.clock = self.duration
338 | copyTables(self.subject, self.target)
339 |
340 | else
341 |
342 | performEasingOnSubject(self.subject, self.target, self.initial, self.clock, self.duration, self.easing)
343 |
344 | end
345 |
346 | return self.clock >= self.duration or self.clock <= 0 -- Added by Blu (" or self.clock <= 0")
347 | end
348 |
349 | function Tween:reset()
350 | return self:set(0)
351 | end
352 |
353 | function Tween:update(dt)
354 | assert(type(dt) == 'number', "dt must be a number")
355 | return self:set(self.clock + dt)
356 | end
357 |
358 | -- Added by Blu
359 | function Tween:finish()
360 | return self:set(self.duration)
361 | end
362 |
363 | -- Added by Blu
364 | function Tween:setEasing(easing)
365 | self.easing = getEasingFunction(easing)
366 | end
367 |
368 | -- Public interface
369 |
370 | function tween.new(duration, subject, target, easing)
371 | easing = getEasingFunction(easing)
372 | checkNewParams(duration, subject, target, easing)
373 | return setmetatable({
374 | duration = duration,
375 | subject = subject,
376 | target = target,
377 | easing = easing,
378 | clock = 0
379 | }, Tween_mt)
380 | end
381 |
382 | -- Commented out by Blu
383 | -- return tween
--------------------------------------------------------------------------------
/@Resources/LuaTween/tween.lua:
--------------------------------------------------------------------------------
1 | tween = {
2 | _VERSION = 'tween 2.1.1',
3 | _DESCRIPTION = 'tweening for lua',
4 | _URL = 'https://github.com/kikito/tween.lua',
5 | _LICENSE = [[
6 | MIT LICENSE
7 |
8 | Copyright (c) 2014 Enrique García Cota, Yuichi Tateno, Emmanuel Oga
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a
11 | copy of this software and associated documentation files (the
12 | "Software"), to deal in the Software without restriction, including
13 | without limitation the rights to use, copy, modify, merge, publish,
14 | distribute, sublicense, and/or sell copies of the Software, and to
15 | permit persons to whom the Software is furnished to do so, subject to
16 | the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included
19 | in all copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 | ]]
29 | }
30 |
31 | -- easing
32 |
33 | -- Adapted from https://github.com/EmmanuelOga/easing. See LICENSE.txt for credits.
34 | -- For all easing functions:
35 | -- t = time == how much time has to pass for the tweening to complete
36 | -- b = begin == starting property value
37 | -- c = change == ending - beginning
38 | -- d = duration == running time. How much time has passed *right now*
39 |
40 | local pow, sin, cos, pi, sqrt, abs, asin = math.pow, math.sin, math.cos, math.pi, math.sqrt, math.abs, math.asin
41 |
42 | -- linear
43 | local function linear(t, b, c, d) return c * t / d + b end
44 |
45 | -- quad
46 | local function inQuad(t, b, c, d) return c * pow(t / d, 2) + b end
47 | local function outQuad(t, b, c, d)
48 | t = t / d
49 | return -c * t * (t - 2) + b
50 | end
51 | local function inOutQuad(t, b, c, d)
52 | t = t / d * 2
53 | if t < 1 then return c / 2 * pow(t, 2) + b end
54 | return -c / 2 * ((t - 1) * (t - 3) - 1) + b
55 | end
56 | local function outInQuad(t, b, c, d)
57 | if t < d / 2 then return outQuad(t * 2, b, c / 2, d) end
58 | return inQuad((t * 2) - d, b + c / 2, c / 2, d)
59 | end
60 |
61 | -- cubic
62 | local function inCubic (t, b, c, d) return c * pow(t / d, 3) + b end
63 | local function outCubic(t, b, c, d) return c * (pow(t / d - 1, 3) + 1) + b end
64 | local function inOutCubic(t, b, c, d)
65 | t = t / d * 2
66 | if t < 1 then return c / 2 * t * t * t + b end
67 | t = t - 2
68 | return c / 2 * (t * t * t + 2) + b
69 | end
70 | local function outInCubic(t, b, c, d)
71 | if t < d / 2 then return outCubic(t * 2, b, c / 2, d) end
72 | return inCubic((t * 2) - d, b + c / 2, c / 2, d)
73 | end
74 |
75 | -- quart
76 | local function inQuart(t, b, c, d) return c * pow(t / d, 4) + b end
77 | local function outQuart(t, b, c, d) return -c * (pow(t / d - 1, 4) - 1) + b end
78 | local function inOutQuart(t, b, c, d)
79 | t = t / d * 2
80 | if t < 1 then return c / 2 * pow(t, 4) + b end
81 | return -c / 2 * (pow(t - 2, 4) - 2) + b
82 | end
83 | local function outInQuart(t, b, c, d)
84 | if t < d / 2 then return outQuart(t * 2, b, c / 2, d) end
85 | return inQuart((t * 2) - d, b + c / 2, c / 2, d)
86 | end
87 |
88 | -- quint
89 | local function inQuint(t, b, c, d) return c * pow(t / d, 5) + b end
90 | local function outQuint(t, b, c, d) return c * (pow(t / d - 1, 5) + 1) + b end
91 | local function inOutQuint(t, b, c, d)
92 | t = t / d * 2
93 | if t < 1 then return c / 2 * pow(t, 5) + b end
94 | return c / 2 * (pow(t - 2, 5) + 2) + b
95 | end
96 | local function outInQuint(t, b, c, d)
97 | if t < d / 2 then return outQuint(t * 2, b, c / 2, d) end
98 | return inQuint((t * 2) - d, b + c / 2, c / 2, d)
99 | end
100 |
101 | -- sine
102 | local function inSine(t, b, c, d) return -c * cos(t / d * (pi / 2)) + c + b end
103 | local function outSine(t, b, c, d) return c * sin(t / d * (pi / 2)) + b end
104 | local function inOutSine(t, b, c, d) return -c / 2 * (cos(pi * t / d) - 1) + b end
105 | local function outInSine(t, b, c, d)
106 | if t < d / 2 then return outSine(t * 2, b, c / 2, d) end
107 | return inSine((t * 2) -d, b + c / 2, c / 2, d)
108 | end
109 |
110 | -- expo
111 | local function inExpo(t, b, c, d)
112 | if t == 0 then return b end
113 | return c * pow(2, 10 * (t / d - 1)) + b - c * 0.001
114 | end
115 | local function outExpo(t, b, c, d)
116 | if t == d then return b + c end
117 | return c * 1.001 * (-pow(2, -10 * t / d) + 1) + b
118 | end
119 | local function inOutExpo(t, b, c, d)
120 | if t == 0 then return b end
121 | if t == d then return b + c end
122 | t = t / d * 2
123 | if t < 1 then return c / 2 * pow(2, 10 * (t - 1)) + b - c * 0.0005 end
124 | return c / 2 * 1.0005 * (-pow(2, -10 * (t - 1)) + 2) + b
125 | end
126 | local function outInExpo(t, b, c, d)
127 | if t < d / 2 then return outExpo(t * 2, b, c / 2, d) end
128 | return inExpo((t * 2) - d, b + c / 2, c / 2, d)
129 | end
130 |
131 | -- circ
132 | local function inCirc(t, b, c, d) return(-c * (sqrt(1 - pow(t / d, 2)) - 1) + b) end
133 | local function outCirc(t, b, c, d) return(c * sqrt(1 - pow(t / d - 1, 2)) + b) end
134 | local function inOutCirc(t, b, c, d)
135 | t = t / d * 2
136 | if t < 1 then return -c / 2 * (sqrt(1 - t * t) - 1) + b end
137 | t = t - 2
138 | return c / 2 * (sqrt(1 - t * t) + 1) + b
139 | end
140 | local function outInCirc(t, b, c, d)
141 | if t < d / 2 then return outCirc(t * 2, b, c / 2, d) end
142 | return inCirc((t * 2) - d, b + c / 2, c / 2, d)
143 | end
144 |
145 | -- elastic
146 | local function calculatePAS(p,a,c,d)
147 | p, a = p or d * 0.3, a or 0
148 | if a < abs(c) then return p, c, p / 4 end -- p, a, s
149 | return p, a, p / (2 * pi) * asin(c/a) -- p,a,s
150 | end
151 | local function inElastic(t, b, c, d, a, p)
152 | local s
153 | if t == 0 then return b end
154 | t = t / d
155 | if t == 1 then return b + c end
156 | p,a,s = calculatePAS(p,a,c,d)
157 | t = t - 1
158 | return -(a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b
159 | end
160 | local function outElastic(t, b, c, d, a, p)
161 | local s
162 | if t == 0 then return b end
163 | t = t / d
164 | if t == 1 then return b + c end
165 | p,a,s = calculatePAS(p,a,c,d)
166 | return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
167 | end
168 | local function inOutElastic(t, b, c, d, a, p)
169 | local s
170 | if t == 0 then return b end
171 | t = t / d * 2
172 | if t == 2 then return b + c end
173 | p,a,s = calculatePAS(p,a,c,d)
174 | t = t - 1
175 | if t < 0 then return -0.5 * (a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b end
176 | return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p ) * 0.5 + c + b
177 | end
178 | local function outInElastic(t, b, c, d, a, p)
179 | if t < d / 2 then return outElastic(t * 2, b, c / 2, d, a, p) end
180 | return inElastic((t * 2) - d, b + c / 2, c / 2, d, a, p)
181 | end
182 |
183 | -- back
184 | local function inBack(t, b, c, d, s)
185 | s = s or 1.70158
186 | t = t / d
187 | return c * t * t * ((s + 1) * t - s) + b
188 | end
189 | local function outBack(t, b, c, d, s)
190 | s = s or 1.70158
191 | t = t / d - 1
192 | return c * (t * t * ((s + 1) * t + s) + 1) + b
193 | end
194 | local function inOutBack(t, b, c, d, s)
195 | s = (s or 1.70158) * 1.525
196 | t = t / d * 2
197 | if t < 1 then return c / 2 * (t * t * ((s + 1) * t - s)) + b end
198 | t = t - 2
199 | return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b
200 | end
201 | local function outInBack(t, b, c, d, s)
202 | if t < d / 2 then return outBack(t * 2, b, c / 2, d, s) end
203 | return inBack((t * 2) - d, b + c / 2, c / 2, d, s)
204 | end
205 |
206 | -- bounce
207 | local function outBounce(t, b, c, d)
208 | t = t / d
209 | if t < 1 / 2.75 then return c * (7.5625 * t * t) + b end
210 | if t < 2 / 2.75 then
211 | t = t - (1.5 / 2.75)
212 | return c * (7.5625 * t * t + 0.75) + b
213 | elseif t < 2.5 / 2.75 then
214 | t = t - (2.25 / 2.75)
215 | return c * (7.5625 * t * t + 0.9375) + b
216 | end
217 | t = t - (2.625 / 2.75)
218 | return c * (7.5625 * t * t + 0.984375) + b
219 | end
220 | local function inBounce(t, b, c, d) return c - outBounce(d - t, 0, c, d) + b end
221 | local function inOutBounce(t, b, c, d)
222 | if t < d / 2 then return inBounce(t * 2, 0, c, d) * 0.5 + b end
223 | return outBounce(t * 2 - d, 0, c, d) * 0.5 + c * .5 + b
224 | end
225 | local function outInBounce(t, b, c, d)
226 | if t < d / 2 then return outBounce(t * 2, b, c / 2, d) end
227 | return inBounce((t * 2) - d, b + c / 2, c / 2, d)
228 | end
229 |
230 | -- Keys to lowercase by Blu, to enable case-insensitivity when using easings
231 | tween.easing = {
232 | linear = linear,
233 | inquad = inQuad, outquad = outQuad, inoutquad = inOutQuad, outinquad = outInQuad,
234 | incubic = inCubic, outcubic = outCubic, inoutcubic = inOutCubic, outincubic = outInCubic,
235 | inquart = inQuart, outquart = outQuart, inoutquart = inOutQuart, outinquart = outInQuart,
236 | inquint = inQuint, outquint = outQuint, inoutquint = inOutQuint, outinquint = outInQuint,
237 | insine = inSine, outsine = outSine, inoutsine = inOutSine, outinsine = outInSine,
238 | inexpo = inExpo, outexpo = outExpo, inoutexpo = inOutExpo, outinexpo = outInExpo,
239 | incirc = inCirc, outcirc = outCirc, inoutcirc = inOutCirc, outincirc = outInCirc,
240 | inelastic = inElastic, outelastic = outElastic, inoutelastic = inOutElastic, outinelastic = outInElastic,
241 | inback = inBack, outback = outBack, inoutback = inOutBack, outinback = outInBack,
242 | inbounce = inBounce, outbounce = outBounce, inoutbounce = inOutBounce, outinbounce = outInBounce
243 | }
244 |
245 |
246 |
247 | -- private stuff
248 |
249 | local function copyTables(destination, keysTable, valuesTable)
250 | valuesTable = valuesTable or keysTable
251 | local mt = getmetatable(keysTable)
252 | if mt and getmetatable(destination) == nil then
253 | setmetatable(destination, mt)
254 | end
255 | for k,v in pairs(keysTable) do
256 | if type(v) == 'table' then
257 | destination[k] = copyTables({}, v, valuesTable[k])
258 | else
259 | destination[k] = valuesTable[k]
260 | end
261 | end
262 | return destination
263 | end
264 |
265 | local function checkSubjectAndTargetRecursively(subject, target, path)
266 | path = path or {}
267 | local targetType, newPath
268 | for k,targetValue in pairs(target) do
269 | targetType, newPath = type(targetValue), copyTables({}, path)
270 | table.insert(newPath, tostring(k))
271 | if targetType == 'number' then
272 | assert(type(subject[k]) == 'number', "Parameter '" .. table.concat(newPath,'/') .. "' is missing from subject or isn't a number")
273 | elseif targetType == 'table' then
274 | checkSubjectAndTargetRecursively(subject[k], targetValue, newPath)
275 | else
276 | print(targetType)
277 | assert(targetType == 'number', "Parameter '" .. table.concat(newPath,'/') .. "' must be a number or table of numbers")
278 | end
279 | end
280 | end
281 |
282 | local function checkNewParams(duration, subject, target, easing)
283 | assert(type(duration) == 'number' and duration > 0, "duration must be a positive number. Was " .. tostring(duration))
284 | local tsubject = type(subject)
285 | assert(tsubject == 'table' or tsubject == 'userdata', "subject must be a table or userdata. Was " .. tostring(subject))
286 | assert(type(target)== 'table', "target must be a table. Was " .. tostring(target))
287 | assert(type(easing)=='function', "easing must be a function. Was " .. tostring(easing))
288 | checkSubjectAndTargetRecursively(subject, target)
289 | end
290 |
291 | local function getEasingFunction(easing)
292 | easing = easing or "linear"
293 | if type(easing) == 'string' then
294 | local name = easing:lower()
295 | easing = tween.easing[name]
296 |
297 | if type(easing) ~= 'function' then
298 | -- Added by Blu
299 | easing = tween.easing["linear"]
300 | error("The easing function name '" .. name .. "' is invalid. Replaced to \"linear\"")
301 | end
302 | end
303 | return easing
304 | end
305 |
306 | local function performEasingOnSubject(subject, target, initial, clock, duration, easing)
307 | local t,b,c,d
308 | for k,v in pairs(target) do
309 | if type(v) == 'table' then
310 | performEasingOnSubject(subject[k], v, initial[k], clock, duration, easing)
311 | else
312 | t,b,c,d = clock, initial[k], v - initial[k], duration
313 | subject[k] = easing(t,b,c,d)
314 | end
315 | end
316 | end
317 |
318 |
319 | -- Tween methods
320 |
321 | local Tween = {}
322 | local Tween_mt = {__index = Tween}
323 |
324 | function Tween:set(clock)
325 | assert(type(clock) == 'number', "clock must be a positive number or 0")
326 |
327 | self.initial = self.initial or copyTables({}, self.target, self.subject)
328 | self.clock = clock
329 |
330 | if self.clock <= 0 then
331 |
332 | self.clock = 0
333 | copyTables(self.subject, self.initial)
334 |
335 | elseif self.clock >= self.duration then -- the tween has expired
336 |
337 | self.clock = self.duration
338 | copyTables(self.subject, self.target)
339 |
340 | else
341 |
342 | performEasingOnSubject(self.subject, self.target, self.initial, self.clock, self.duration, self.easing)
343 |
344 | end
345 |
346 | return self.clock >= self.duration or self.clock <= 0 -- Added by Blu (" or self.clock <= 0")
347 | end
348 |
349 | function Tween:reset()
350 | return self:set(0)
351 | end
352 |
353 | function Tween:update(dt)
354 | assert(type(dt) == 'number', "dt must be a number")
355 | return self:set(self.clock + dt)
356 | end
357 |
358 | -- Added by Blu
359 | function Tween:finish()
360 | return self:set(self.duration)
361 | end
362 |
363 | -- Added by Blu
364 | function Tween:setEasing(easing)
365 | self.easing = getEasingFunction(easing)
366 | end
367 |
368 | -- Public interface
369 |
370 | function tween.new(duration, subject, target, easing)
371 | easing = getEasingFunction(easing)
372 | checkNewParams(duration, subject, target, easing)
373 | return setmetatable({
374 | duration = duration,
375 | subject = subject,
376 | target = target,
377 | easing = easing,
378 | clock = 0
379 | }, Tween_mt)
380 | end
381 |
382 | -- Commented out by Blu
383 | -- return tween
--------------------------------------------------------------------------------