forked from kevans91/Chatters
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 #19 from koyeall/master
Fixed CIM bug, changed quote system, added showcode button.
- Loading branch information
Showing
14 changed files
with
245 additions
and
1,217 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
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
QuoteManager | ||
New() | ||
..() | ||
|
||
loadQuotes() | ||
|
||
var | ||
list/quotes = null | ||
|
||
proc | ||
loadQuotes() | ||
quotes = list() | ||
|
||
var | ||
f = kText.replaceText(file2text("data/quotes.txt"), "\n", "") | ||
list/split = kText.text2list(f, ";;") | ||
|
||
for(var/q in split) | ||
if(q) | ||
var/list/qsplit = kText.text2list(q, "##") | ||
|
||
if(length(qsplit) >= 2) | ||
var/Quote/quote = new | ||
quote.author = qsplit[1] | ||
quote.text = qsplit[2] | ||
if(length(qsplit) >= 3) quote.link = qsplit[3] | ||
|
||
quotes += quote | ||
|
||
getQOTD() | ||
var | ||
t = time2text(world.timeofday, "MMDD") | ||
month = text2num(copytext(t, 1, 3)) | ||
day = text2num(copytext(t, 3)) | ||
|
||
qloc = ((month - 1) * 12) + day // compute the location of today's quote in the quote list | ||
Quote/q | ||
qlen = length(quotes) | ||
|
||
if(qloc && (qloc <= qlen)) q = quotes[qloc] | ||
else | ||
qloc = round(qloc % qlen) | ||
if(qloc < 1) qloc = 1 | ||
if(qloc > qlen) qloc = qlen | ||
q = quotes[qloc] | ||
|
||
if(q) | ||
var/qtxt = "\"[q.text]\"<br> - [q.author]" | ||
if(q.link) qtxt += " ([q.link])" | ||
|
||
return qtxt | ||
|
||
Quote | ||
var | ||
text = "" | ||
link = "" | ||
author = "" |
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
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 |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
kText by Keeth | ||
*/ | ||
|
||
var/kText/kText = new | ||
|
||
kText | ||
var | ||
const | ||
|
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
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
Oops, something went wrong.