-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from iArxic/production
"Currently testing" + icons
- Loading branch information
Showing
2 changed files
with
60 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,60 @@ | ||
local activityCreator = {} | ||
local activityCreator = {}; | ||
|
||
local StudioPresence = script:FindFirstAncestor("StudioPresence") | ||
local StudioPresence = script:FindFirstAncestor("StudioPresence"); | ||
|
||
local Activity = require(StudioPresence.src.activity).new() | ||
local FormatString = require(StudioPresence.src.generators.formatString) | ||
local Data = require(StudioPresence.src.dataHandler) | ||
local StudioService = game:GetService("StudioService") | ||
local Activity = require(StudioPresence.src.activity).new(); | ||
local FormatString = require(StudioPresence.src.generators.formatString); | ||
local Data = require(StudioPresence.src.dataHandler); | ||
local StudioService = game:GetService("StudioService"); | ||
|
||
function eval(item) | ||
if item == "" then | ||
return false | ||
end | ||
if item == nil then | ||
return false | ||
end | ||
if item == false then | ||
return false | ||
end | ||
if item == 0 then | ||
return false | ||
end | ||
if pcall(function() | ||
return #item | ||
end) and #item == 0 then | ||
return false | ||
end | ||
return true | ||
end | ||
if item == "" then return false end; | ||
if item == nil then return false end; | ||
if item == false then return false end; | ||
if item == 0 then return false end; | ||
if pcall(function() return #item end) and #item == 0 then return false end; | ||
return true; | ||
end; | ||
|
||
function activityCreator:Get() | ||
local savedDescription = Data:Get("Description") | ||
local savedState = Data:Get("State") | ||
|
||
local savedDescription = Data:Get("Description"); | ||
local savedState = Data:Get("State"); | ||
local active = StudioService.ActiveScript | ||
local editing = "StudioPresence by iArxic" | ||
local description = "Developing" | ||
if active ~= nil then | ||
description = "Editing " .. active.Name .. " (" .. #string.split(active.source, "\n") .. " lines)" | ||
local smallImageKey, smallImageDesc = "","" | ||
if active~=nil then | ||
description = "Editing "..active.Name.." ("..#string.split(active.source,"\n").." lines)" | ||
end | ||
if active == nil then | ||
if active==nil then | ||
active = "studio" | ||
elseif active:IsA("ModuleScript") then | ||
editing = "Editing a MODULE Script" | ||
active = "modulescript" | ||
active="modulescript" | ||
elseif active:IsA("LocalScript") then | ||
editing = "Editing a CLIENT Script" | ||
active = "clientscript" | ||
editing="Editing a CLIENT Script" | ||
active="clientscript" | ||
elseif active:IsA("Script") then | ||
editing = "Editing a SERVER Script" | ||
active = "serverscript" | ||
editing="Editing a SERVER Script" | ||
active="serverscript" | ||
end | ||
|
||
Activity:clear() | ||
if game:GetService("RunService"):IsRunning() then | ||
editing="StudioPresence by iArxic" | ||
active="studio" | ||
description="Currently play-testing" | ||
smallImageKey="playtesticon" | ||
smallImageDesc = "Currently play-testing" | ||
end | ||
Activity | ||
:clear() | ||
:setDescription(description) | ||
:setState(FormatString:process("Workspace: $WORKSPACE")) | ||
:setImage(active, editing) | ||
:setTimer() | ||
|
||
return Activity | ||
end | ||
|
||
return activityCreator | ||
:setThumbnail(smallImageKey,smallImageDesc) | ||
:setImage(active,editing) | ||
:setTimer(); | ||
|
||
return Activity; | ||
end; | ||
|
||
return activityCreator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters