Skip to content

Commit

Permalink
Tons up updates
Browse files Browse the repository at this point in the history
  • Loading branch information
John Murphy committed Nov 11, 2013
1 parent 1cb013d commit b0ae2c5
Show file tree
Hide file tree
Showing 13 changed files with 729 additions and 226 deletions.
332 changes: 174 additions & 158 deletions @Resources/CScript.lua

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions @Resources/Calendars/Holidays.xml
@@ -1,9 +1,9 @@
<EventFile Repeat="Year">
<!-- Built in Holidays. Add Inactive="true" to disable. -->
<Event Month="{$GoodFridayMonth}" Day="{$GoodFridayDay}" Description="Good Friday"/>
<Event Month="{$EasterMonth}" Day="{$EasterDay}" Description="Easter Sunday"/>
<Event Month="{$AshWednesdayMonth}" Day="{$AshWednesdayDay}" Description="Ash Wednesday"/>
<Event Month="{$MardiGrasMonth}" Day="{$MardiGrasDay}" Description="MardiGras"/>
<Event TimeStamp="({$Easter:Stamp}-(2*86400))" Description="Good Friday"/>
<Event Month="{$Easter:Month}" Day="{$Easter:Day}" Description="Easter Sunday"/>
<Event TimeStamp="({$Easter:Stamp}-(46*86400))" Description="Ash Wednesday"/>
<Event TimeStamp="({$Easter:Stamp}-(47*86400))" Description="MardiGras"/>

<!-- Normal Holidays -->
<Set Month="1">
Expand Down Expand Up @@ -35,7 +35,7 @@
<Event Month="8" Day="26" Description="Women's Equality Day"/>
<Set Month="9">
<Event Day="{$FirstMon}" Description="Labor Day"/>
<Event Day="{$FirstMon}+6" Description="Grandparent's Day"/>
<Event Day="({$FirstMon}+6)" Description="Grandparent's Day"/>
<Event Day="11" Year="2001" Description="Patriot Day" Anniversary="true"/>
<Event Day="17" Description="Citizen Day"/>
</Set>
Expand All @@ -45,7 +45,7 @@
<Event Day="31" Description="Halloween"/>
</Set>
<Set Month="11">
<Event Day="({$FirstMon}+1)*(({$Year}%2)=0)" Description="Election Day"/>
<Event Day="(({$FirstMon}+1)*(({$Year}%2)=0))" Description="Election Day"/>
<Event Day="11" Description="Veterans Day"/>
<Event Day="{$FourthThu}" Description="Thanksgiving Day"/>
</Set>
Expand Down
7 changes: 5 additions & 2 deletions @Resources/Settings.inc
@@ -1,4 +1,4 @@
; Please visit http://smurfier.github.com/LuaCalendar for detailed descriptions of the features listed below.
; Please visit http://smurfier.github.io/LuaCalendar for detailed descriptions of the features listed below.

[Variables]
;Name of the Style Sheet
Expand All @@ -12,7 +12,7 @@ HideLastWeek=0

;Holidays File names
;Note: For Holiday file names, multiple sources can be used by uisng the pipe delimiter (|).
EventFile=D:\John\Documents\Programs\Rainmeter\Skins\LuaCalendar\@Resources\Calendars\Holidays.xml
EventFile=#@#Calendars\Holidays.xml

;Custom Text formatting for Month Labels. See Readme for details.
LabelText=
Expand All @@ -35,3 +35,6 @@ NextFormat=
;Show the Moon Phases as events
ShowMoonPhases=1

;Color to use for the Moon Phases Events
MoonColor=

27 changes: 26 additions & 1 deletion @Resources/Styles/Enigma/meta.txt
@@ -1,4 +1,29 @@
[Metadata]
Name=Enigma
Author=Smurfier and Kaelri
Info=A clone of the Enigma calendar (v4.0) with a couple small additions.
Info=A clone of the Enigma calendar (v4.0) with a couple small additions.

[Clr.hrl]
Input=Color
Label=Date Indicator Color
Default=128,192,255,160

[Clr.Brd]
Input=Color
Label=Border Color
Default=192,192,192,64

[HideBordersTop]
Input=Radio
Label=Hide Top Border
Default=0

[HideBordersBottom]
Input=Radio
Label=Hide Bottom Border
Default=1

[cWidth]
Input=Text
Label=Calendar Width
Default=200
11 changes: 0 additions & 11 deletions LuaCalendar.ini
Expand Up @@ -35,17 +35,6 @@ LastWkHidden=0
[Lua]
Measure=Script
ScriptFile=#@#CScript.lua
DayLabels=#DayLabels#
HideLastWeek=#HideLastWeek#
EventFile=#EventFile#
SingleFolder=#SingleFolder#
LabelText=#LabelText#
LeadingZeroes=#LeadingZeroes#
MonthLabels=#MonthLabels#
StartOnMonday=#StartOnMonday#
UseLocalMonths=#UseLocalMonths#
NextFormat=#NextFormat#
ShowMoonPhases=#ShowMoonPhases#

[Background]
Meter=Image
Expand Down
78 changes: 55 additions & 23 deletions Options/Options.ini
Expand Up @@ -2,6 +2,7 @@
MouseLeaveAction=[!HideMeterGroup Scroll][!Update]
OnRefreshAction=["#@#Addons/Options/RainList.exe" "#@#Styles/" "!CommandMeasure Lua &quot;UnpackList([[$FileList$]])&quot; LuaCalendar\Options" 2]
DynamicWindowSize=1
MouseActionCursor=0
;Update=-1

[Metadata]
Expand All @@ -13,7 +14,7 @@

[Variables]
@include=#@#Settings.inc
Width=300
Width=340
StylePosX=5
StylePosY=90

Expand Down Expand Up @@ -75,7 +76,7 @@
StringAlign=CenterCenter
H=30
W=#Width#
X=150
X=(#Width#/2)
Y=15
SolidColor=100,100,100,255

Expand Down Expand Up @@ -146,81 +147,113 @@
Y=10r
StringAlign=LeftCenter

[LastWeek]
[LastWeekStyle]
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable HideLastWeek (1-#HideLastWeek#)][!Update]

[LastWeek]
Meter=Roundline
MeterStyle=Radio
MeterStyle=Radio|LastWeekStyle
LineStart=(#HideLastWeek#?0:4)
Y=-10R
X=5
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable HideLastWeek (1-#HideLastWeek#)][!Update]

[LastWeekLabel]
Meter=String
MeterStyle=Text
MeterStyle=Text|LastWeekStyle
Text=Hide the Last Week
X=R
Y=10r
StringAlign=LeftCenter
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable HideLastWeek (1-#HideLastWeek#)][!Update]

[MoonPhasesStyle]
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable ShowMoonPhases (1-#ShowMoonPhases#)][!Update]

[MoonPhases]
Meter=Roundline
MeterStyle=Radio
MeterStyle=Radio|MoonPhasesStyle
LineStart=(#ShowMoonPhases#?0:4)
Y=-10R
X=5
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable ShowMoonPhases (1-#ShowMoonPhases#)][!Update]

[MoonPhasesLabel]
Meter=String
MeterStyle=Text
MeterStyle=Text|MoonPhasesStyle
Text=Show the Moon Phases
X=R
Y=10r
StringAlign=LeftCenter
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable ShowMoonPhases (1-#ShowMoonPhases#)][!Update]

[LeadingStyle]
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable LeadingZeroes (1-#LeadingZeroes#)][!Update]

[Leading]
Meter=Roundline
MeterStyle=Radio
MeterStyle=Radio|LeadingStyle
LineStart=(#LeadingZeroes#?0:4)
Y=[Local:Y]
X=(#Width#/2+2)
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable LeadingZeroes (1-#LeadingZeroes#)][!Update]

[LeadingLabel]
Meter=String
MeterStyle=Text
MeterStyle=Text|LeadingStyle
Text=Leading Zeroes
X=R
Y=10r
StringAlign=LeftCenter
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable LeadingZeroes (1-#LeadingZeroes#)][!Update]

[StartMondayStyle]
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable StartOnMonday (1-#StartOnMonday#)][!Update]

[StartMonday]
Meter=Roundline
MeterStyle=Radio
MeterStyle=Radio|StartMondayStyle
LineStart=(#StartOnMonday#?0:4)
Y=-10R
X=(#Width#/2+2)
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable StartOnMonday (1-#StartOnMonday#)][!Update]

[StartMondayLabel]
Meter=String
MeterStyle=Text
MeterStyle=Text|StartMondayStyle
Text=Start on Monday
X=R
Y=10r
StringAlign=LeftCenter
LeftMouseUpAction=[!SetOption Message Text " "][!SetVariable StartOnMonday (1-#StartOnMonday#)][!Update]

[MoonColorFillStyle]
ToolTipText=Right Click to Clear
LeftMouseUpAction=[!WriteKeyValue Variables Color "#MoonColor#" "#CURRENTPATH#Utilities\ColorPicker.ini"][!WriteKeyValue Variables VariableName "MoonColor" "#CURRENTPATH#Utilities\ColorPicker.ini"][!ActivateConfig #CURRENTCONFIG#\Utilities ColorPicker.ini]
RightMouseUpAction=[!SetVariable MoonColor ''][!SetOption MoonColorFill LineColor 0,0,0,1][!Update]

[MoonColorFill]
Meter=Roundline
MeterStyle=Radio|MoonColorFillStyle
LineLength=4
LineColor=#MoonColor#
Y=-10R
X=(#Width#/2+2)

[MoonColorOutline]
Meter=Roundline
MeterStyle=Radio
LineStart=4
Y=r
X=r

[MoonColorLabel]
Meter=String
MeterStyle=Text|MoonColorFillStyle
Text=Moon Phase Event Color
X=R
Y=10r
StringAlign=LeftCenter

; ========== TEXT INPUT ==========

[EventFileLabel]
Meter=String
MeterStyle=Text
X=5
Y=10R
Y=R
Text=Event Files

[EventFile]
Expand All @@ -229,7 +262,7 @@
Text=#EventFile#
X=5
Y=R
W=260
W=(#Width#-40)
ClipString=1

[EventFileBrowse]
Expand Down Expand Up @@ -273,7 +306,7 @@
Text=#LabelText#
X=r
Y=R
W=142
W=(Floor((#Width#-15)/2))
ClipString=1
LeftMouseUpAction=!CommandMeasure InputText "ExecuteBatch 3"

Expand All @@ -293,7 +326,6 @@
W=(Floor((#Width#-15)/2))
ClipString=1
LeftMouseUpAction=!CommandMeasure InputText "ExecuteBatch 4"
;LeftMouseUpAction=!SetClip "X=[#CURRENTSECTION#:X] Y=[#CURRENTSECTION#:Y] W=[#CURRENTSECTION#:W]"

[MonthsLabel]
Meter=String
Expand Down
60 changes: 35 additions & 25 deletions Options/Options.lua
@@ -1,23 +1,28 @@
Scroll = {
Position = 1,
ItemHeight = 0,
Folders = {},
}

Variables = {
Style = 'Default',
DayLabels = '',
HideLastWeek = 0,
EventFile = '#**@**#Calendars\\Holidays.xml',
LabelText = '',
LeadingZeroes = 0,
MonthLabels = '',
StartOnMonday = 0,
UseLocalMonths = 1,
NextFormat = '',
ShowMoonPhases = 1,
MoonColor = '',
}

function Initialize()
Scroll = {
Position = 1,
ItemHeight = 0,
Folders = {},
}

Variables = {
Style = 'Default',
DayLabels = '',
HideLastWeek = 0,
EventFile = '#@#Calendars\\Holidays.xml',
LabelText = '',
LeadingZeroes = 0,
MonthLabels = '',
StartOnMonday = 0,
UseLocalMonths = 1,
NextFormat = '',
ShowMoonPhases = 1,
}
if SKIN:GetVariable('MoonColor') == '' then
SKIN:Bang('!SetOption', 'MoonColorFill', 'LineColor', '0,0,0,1')
end
end -- Initialize

function Update()
Expand All @@ -31,6 +36,14 @@ function Update()
end
end -- Update

function SetColor(name, color)
if name == 'MoonColor' then
SKIN:Bang('!SetOption', 'MoonColorFill', 'LineColor', '#*MoonColor*#')
end
SKIN:Bang('!SetVariable', name, color)
SKIN:Bang('!Update')
end -- SetColor

-- ========== START SCROLLBOX ==========

function DrawItems()
Expand All @@ -54,11 +67,9 @@ function DrawItems()
end -- DrawItems

function UnpackList(input)
local path = SKIN:GetVariable('@') .. 'Styles\\%s\\meta.txt'

for _, word in ipairs(delim(input)) do
local temp = {folder = word, name = word, author = '', info = '',}
local ini = ReadIni(SKIN:ReplaceVariables(path:format(word)))
local ini = ReadIni(SKIN:ReplaceVariables(('#@#Styles\\%s\\meta.txt'):format(word)))
if ini.metadata then
temp = {
folder = word,
Expand Down Expand Up @@ -186,15 +197,14 @@ end -- MessageOutput

function TablePosition(tbl, key, func)
for i, v in ipairs(tbl) do
if func then v = func(v) end
if v == key then
if (func and func(v) or v) == key then
return i
end
end
return nil
end -- TablePosition

function delim(input, sep)
function delim(input)
local temp = {}
for word in input:gmatch('[^|]+') do table.insert(temp, word) end
return temp
Expand Down

0 comments on commit b0ae2c5

Please sign in to comment.