From d9ed6ca46a0ddfe025f4be78d268e2611c72e12a Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Thu, 11 Oct 2018 22:09:18 -0300 Subject: [PATCH 1/5] Fixes newscaster images and spruces up newscaster feed message formatting --- code/game/machinery/newscaster.dm | 10 ++++++++-- nano/templates/newscaster.tmpl | 15 +++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 491cb93018e..a712e033afd 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -241,8 +241,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co data["censored"] = viewing_channel.censored var/list/messages = list() data["messages"] = messages + var/message_number = 0 for(var/datum/feed_message/M in viewing_channel.messages) - messages[++messages.len] = list("title" = M.title, "body" = M.body, "img" = M.img ? icon2base64(M.img) : null, "message_type" = M.message_type, "author" = M.author, "view_count" = M.view_count) + if(M.img) + user << browse_rsc(M.img, "tmp_photo[message_number].png") + messages[++messages.len] = list("title" = M.title, "body" = M.body, "img" = M.img ? M.img : null, "message_type" = M.message_type, "author" = M.author, "view_count" = M.view_count, "message_number" = message_number) + message_number += 1 if(8, 9) data["channel_name"] = viewing_channel.channel_name data["ref"] = "\ref[viewing_channel]" @@ -273,7 +277,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co data["author"] = news_network.wanted_issue.backup_author data["criminal"] = news_network.wanted_issue.author data["description"] = news_network.wanted_issue.body - data["photo"] = news_network.wanted_issue.img ? icon2base64(news_network.wanted_issue.img) : 0 + if(news_network.wanted_issue.img) + user << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") + data["photo"] = news_network.wanted_issue.img ? news_network.wanted_issue.img : 0 if(12) var/list/jobs = list() data["jobs"] = jobs diff --git a/nano/templates/newscaster.tmpl b/nano/templates/newscaster.tmpl index 16c201407e3..fb39a6aac3f 100644 --- a/nano/templates/newscaster.tmpl +++ b/nano/templates/newscaster.tmpl @@ -139,11 +139,14 @@ Property of Nanotrasen
{{else}} {{for data.messages}}
- {{:value.title}}
- {{:value.body}}
+

+ + {{:value.title}}
{{if value.img}} -
- {{/if}} +
+ {{/if}} +

+ {{:value.body}}
[{{:value.message_type}} by {{:value.author}}]
Message view count: {{:value.view_count}}

@@ -296,10 +299,10 @@ Property of Nanotrasen
{{:data.description}}
-
Photo:
+
Photo:

{{if data.photo}} - +
{{else}} None {{/if}} From ca22b73a1d9f24be078324b1ae4d73f04bdd21af Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Fri, 12 Oct 2018 03:24:19 -0300 Subject: [PATCH 2/5] Fixes indentation and adds closing

's --- nano/templates/newscaster.tmpl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nano/templates/newscaster.tmpl b/nano/templates/newscaster.tmpl index fb39a6aac3f..ff826222bc7 100644 --- a/nano/templates/newscaster.tmpl +++ b/nano/templates/newscaster.tmpl @@ -140,13 +140,14 @@ Property of Nanotrasen
{{for data.messages}}

- - {{:value.title}}
+ {{:value.title}}
+

{{if value.img}} -
+
{{/if}}

- {{:value.body}}
+ {{:value.body}}
+

[{{:value.message_type}} by {{:value.author}}]
Message view count: {{:value.view_count}}
From 50a13bc37e7f6ce806d4c0e87ba44b1556a1c825 Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Fri, 12 Oct 2018 18:52:12 -0300 Subject: [PATCH 3/5] Migrates align tags to style tags (future proof) and centers newscaster images. --- nano/templates/newscaster.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nano/templates/newscaster.tmpl b/nano/templates/newscaster.tmpl index ff826222bc7..891fcf75a41 100644 --- a/nano/templates/newscaster.tmpl +++ b/nano/templates/newscaster.tmpl @@ -139,13 +139,13 @@ Property of Nanotrasen
{{else}} {{for data.messages}}
-

+

{{:value.title}}

{{if value.img}} -
+
{{/if}} -

+

{{:value.body}}

[{{:value.message_type}} by {{:value.author}}]
From 2bce5e00af288253d790e07a50c8295388a461fe Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Fri, 12 Oct 2018 19:01:05 -0300 Subject: [PATCH 4/5] deletes extra quotation mark, migrates quotation mark to apostrophe --- nano/templates/newscaster.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nano/templates/newscaster.tmpl b/nano/templates/newscaster.tmpl index 891fcf75a41..d83344bb0a8 100644 --- a/nano/templates/newscaster.tmpl +++ b/nano/templates/newscaster.tmpl @@ -139,13 +139,13 @@ Property of Nanotrasen
{{else}} {{for data.messages}}
-

+

{{:value.title}}

{{if value.img}}
{{/if}} -

+

{{:value.body}}

[{{:value.message_type}} by {{:value.author}}]
From d356346fc693f6cd013296983cb5934ffeb65cca Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Fri, 12 Oct 2018 19:05:52 -0300 Subject: [PATCH 5/5] adds space after text-align, and semicolons --- nano/templates/newscaster.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nano/templates/newscaster.tmpl b/nano/templates/newscaster.tmpl index d83344bb0a8..4ddf376e71f 100644 --- a/nano/templates/newscaster.tmpl +++ b/nano/templates/newscaster.tmpl @@ -139,13 +139,13 @@ Property of Nanotrasen
{{else}} {{for data.messages}}
-

+

{{:value.title}}

{{if value.img}}
{{/if}} -

+

{{:value.body}}

[{{:value.message_type}} by {{:value.author}}]