I know its old but hope the author is still active and will update with some new (incorporate) features that i posted there. In mean time im trying to modify it myself the ugly way.
Summary, the notes are being added top wise and the whole skin is also moving upwards. Im using the skin towards the upper side of screen and the skin moving upwards is hitting the screen edge. I wanted it to go downwards and i accomplished it.
But also, i want the new notes to be the last entries rather than first and thats what i cant figure out.
This is the original part of the Lua code that adds and removes entries:
Code: Select all
function AddItem()
local input, crlf = SKIN:GetVariable('Input'):gsub("\r\n", "#*CRLF*#")
if input ~= "" then
for i = 1, 15 do
SKIN:Bang('!WriteKeyValue Variables Item'..(i+1)..' """'..SKIN:GetVariable('Item'..i):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
end
SKIN:Bang('!WriteKeyValue Variables Item1 """'..input..'""" "#CURRENTPATH#Notes.txt"')
SKIN:Bang('[!Move #CURRENTCONFIGX# (#CURRENTCONFIGY#-4-'..(SKIN:GetMeter('Input'):GetH()*(crlf+1))..')][!Refresh]')
end
end
function DeleteItem(n)
for i = n, 15 do
SKIN:Bang('!WriteKeyValue Variables Item'..i..' """'..SKIN:GetVariable('Item'..(i+1)):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
end
SKIN:Bang('!WriteKeyValue Variables Item16 "" "#CURRENTPATH#Notes.txt"')
SKIN:Bang('[!Move #CURRENTCONFIGX# (#CURRENTCONFIGY#+4+'..SKIN:GetMeter('Item'..n):GetH()..')][!Refresh]')
end
Code: Select all
function AddItem()
local input, crlf = SKIN:GetVariable('Input'):gsub("\r\n", "#*CRLF*#")
if input ~= "" then
for i = 1, 15 do
SKIN:Bang('!WriteKeyValue Variables Item'..(i+1)..' """'..SKIN:GetVariable('Item'..i):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
end
SKIN:Bang('!WriteKeyValue Variables Item1 """'..input..'""" "#CURRENTPATH#Notes.txt"')
SKIN:Bang('[!Refresh]')
end
end
function DeleteItem(n)
for i = n, 15 do
SKIN:Bang('!WriteKeyValue Variables Item'..i..' """'..SKIN:GetVariable('Item'..(i+1)):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
end
SKIN:Bang('!WriteKeyValue Variables Item16 "" "#CURRENTPATH#Notes.txt"')
SKIN:Bang('[!Refresh]')
end
SKIN:Bang('[!Move #CURRENTCONFIGX# (#CURRENTCONFIGY#-4-'..(SKIN:GetMeter('Input'):GetH()*(crlf+1))..')]
with this:
SKIN:Bang('[!Refresh]')
But i cant figure out how to make it append entries.
As i understood the code, it is rewriting all the values from itemN to itemN+1 which moves all the old notes down and the new note is being written on the item1. I tired to modify it to write to get the NextIndex stored in the skins variables section but nothing is happening.
This is what i tired.
Skin.ini:
Code: Select all
[Variables]
NextIndex=3
Code: Select all
function AddItem()
local input, crlf = SKIN:GetVariable('Input'):gsub("\r\n", "#*CRLF*#")
local index = SKIN:GetVariable('NextIndex')
SKIN:Bang('!WriteKeyValue Variables Item'..index..' """'..input..'""" "#CURRENTPATH#Notes.txt"')
SKIN:Bang('[!Refresh]')
end
end
The logic is simple, i want the oldest notes (mostly used as ToDo:) to be the first entry and new ones at the bottom since im going throught the list top to bottom. Thanks!