# @name Wochentage # @desc Wochentage im Loop anzeigen # @author ElDie # @version 0.9 # @config Ncol color "Farbe für normale Wochentage / Weekday color" default=#000000 # @config Wcol color "Farbe fürs Wochenende / Weekend color" default=#FF0000 # @config lang select "Sprache / Language" default=deutsch options=deutsch,english class WochentageApp var tage, lang var col, col1 , ccol var Ncol, Wcol def init() self.Ncol = store.get("Ncol") self.Wcol = store.get("Wcol") self.lang = store.get("lang") # Abkürzungen für die Wochentage if self.lang == "deutsch" self.tage = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"] elif self.lang == "english" self.tage = ["Monday", "Thuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] end end def draw() self.col = self.Ncol self.col1 = self.Wcol if self.Ncol == 0 self.col = settings.get("textColor") end if self.Wcol == 0 self.col1 = settings.get("textColor") end # Wochentag ermitteln (1 = Montag, 7 = Sonntag) var wochentag = weekday() - 1 # Text des aktuellen Tages anzeigen var aktueller_tag = self.tage[wochentag] if wochentag == 5 || wochentag == 6 self.ccol = self.col1 else self.ccol = self.col end scroll_text(aktueller_tag,self.col1,{"mode": "loop"}) end end return WochentageApp()