Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Donations update #1624

Merged
merged 4 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion code/datums/communication/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@
var/can_badmin = !is_stealthed && can_select_ooc_color(C) && (C.prefs.ooccolor != initial(C.prefs.ooccolor))
var/ooc_color = C.prefs.ooccolor

// [SIERRA-ADD] - DON_LOADOUT
var/ckey_prefix = C.donator_info.get_decorated_message(C, "<EM>[C.key]:</EM>")
// [/SIERRA-ADD]
for(var/client/target in GLOB.clients)
if(target.is_key_ignored(C.key)) // If we're ignored by this person, then do nothing.
continue
var/sent_message = "[create_text_tag("ooc", "OOC:", target)] <EM>[C.key]:</EM> [SPAN_CLASS("message linkify", "[message]")]"
// [SIERRA-EDIT] - DON_LOADOUT
// var/sent_message = "[create_text_tag("ooc", "OOC:", target)] <EM>[C.key]:</EM> [SPAN_CLASS("message linkify", "[message]")]" // SIERRA-EDIT - ORIGINAL
var/sent_message = "[create_text_tag("ooc", "OOC:", target)] [ckey_prefix] [SPAN_CLASS("message linkify", "[message]")]"
// [/SIERRA-EDIT]
if(can_badmin)
receive_communication(C, target, SPAN_COLOR(ooc_color, SPAN_CLASS("ooc", sent_message)))
else
Expand Down
22 changes: 22 additions & 0 deletions code/modules/goonchat/browserassets/css/browserOutput.css
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,25 @@ h1.alert, h2.alert {color: #a4bad6;}
.german {color: #4d5d53;}
.lirris {color: #023638;}
.alain {color: #6a1b9a;}

/* DON_LOADOUT */
.dt_1 {
font-weight: bold;
color: rgb(83, 107, 189);
text-shadow: 0 0 8px rgba(83, 107, 189, .6);
}
.dt_2 {
font-weight: bold;
color: rgb(91, 16, 212);
text-shadow: 0 0 8px rgba(91, 16, 212, .6);
}
.dt_3 {
font-weight: bold;
color: rgb(175, 48, 207);
text-shadow: 0 0 8px rgba(175, 48, 207, .6);
}
.dt_4 {
font-weight: bold;
color: rgb(229, 25, 219);
text-shadow: 0 0 8px rgba(229, 25, 219, .6);
}
22 changes: 22 additions & 0 deletions code/modules/goonchat/browserassets/css/browserOutput_white.css
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,25 @@ h1.alert, h2.alert {color: #000080;}
.german {color: #4d5d53;}
.lirris {color: #023638;}
.alain {color: #6a1b9a;}

/* DON_LOADOUT */
.dt_1 {
font-weight: bold;
color: rgb(83, 107, 189);
text-shadow: 0 0 8px rgba(83, 107, 189, .6);
}
.dt_2 {
font-weight: bold;
color: rgb(91, 16, 212);
text-shadow: 0 0 8px rgba(91, 16, 212, .6);
}
.dt_3 {
font-weight: bold;
color: rgb(175, 48, 207);
text-shadow: 0 0 8px rgba(175, 48, 207, .6);
}
.dt_4 {
font-weight: bold;
color: rgb(229, 25, 219);
text-shadow: 0 0 8px rgba(229, 25, 219, .6);
}
14 changes: 10 additions & 4 deletions html/browser/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,23 +423,29 @@ a.gray.selected { box-shadow: inset 0 0 0 1px #ebebeb; }
a.linkOn.selected { box-shadow: inset 0 0 0 1px #aeebae; }
a.linkOff.selected { box-shadow: inset 0 0 0 1px #ebebeb; }

/**************
SierraBay
**************/

/* DON_LOADOUT */

.dt_1 {
font-weight: bold;
color: rgb(83, 107, 189);
text-shadow: 0 0 8px rgba(83, 107, 189, .4);
text-shadow: 0 0 8px rgba(83, 107, 189, .6);
}
.dt_2 {
font-weight: bold;
color: rgb(91, 16, 212);
text-shadow: 0 0 8px rgba(91, 16, 212, .4);
text-shadow: 0 0 8px rgba(91, 16, 212, .6);
}
.dt_3 {
font-weight: bold;
color: rgb(175, 48, 207);
text-shadow: 0 0 8px rgba(175, 48, 207, .4);
text-shadow: 0 0 8px rgba(175, 48, 207, .6);
}
.dt_4 {
font-weight: bold;
color: rgb(229, 25, 219);
text-shadow: 0 0 8px rgba(229, 25, 219, .4);
text-shadow: 0 0 8px rgba(229, 25, 219, .6);
}
1 change: 1 addition & 0 deletions mods/don_loadout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ID мода: DON_LOADOUT
### Изменения *кор кода*

- `code/modules/client/preference_setup/general/05_preview.dm`: `/datum/preferences/proc/dress_preview_mob()`
- `code/datums/communication/ooc.dm`: `/singleton/communication_channel/ooc/do_communicate()`
<!--
Если вы редактировали какие-либо процедуры или переменные в кор коде,
они должны быть указаны здесь.
Expand Down
2 changes: 1 addition & 1 deletion mods/don_loadout/_don_loadout.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "code/donations/donations.dm"
#include "code/donations/donator.dm"
#include "code/donations/ooc_color.dm"
#include "code/donations/preferences.dm"

#include "code/loadout/gear_tweak.dm"
#include "code/loadout/gear.dm"
Expand Down
2 changes: 1 addition & 1 deletion mods/don_loadout/code/donations/donations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

var/DBQuery/query = dbcon.NewQuery({"
SELECT CAST(SUM(amount) as UNSIGNED INTEGER)
FROM budget
FROM `[sqlfdbkdbutil]`.`budget`
WHERE
ckey = '[player.ckey]' AND
is_valid = TRUE AND
Expand Down
12 changes: 5 additions & 7 deletions mods/don_loadout/code/donations/donator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@
/datum/donator_info
var/donator = FALSE
var/donation_type = DONATION_TIER_NONE
var/list/items = new

/datum/donator_info/proc/on_donation_tier_loaded(client/C)
return

/datum/donator_info/proc/get_decorated_ooc_name(client/C)
/datum/donator_info/proc/get_decorated_message(client/C, message)
if(!SScharacter_setup.initialized || isnull(donation_type))
return C.key
return "<span class='[donation_tier_to_css_class(donation_type)]'>[C.key]</span>"
return message
if (C.get_preference_value(/datum/client_preference/ooc_donation_color) != GLOB.PREF_SHOW)
return message
return "<span class='[donation_tier_to_css_class(donation_type)]'>[message]</span>"

/datum/donator_info/proc/get_full_donation_tier()
return donation_tier_decorated(donation_type)
Expand All @@ -63,6 +64,3 @@
return FALSE

CRASH("This code should not be accessible")

/datum/donator_info/proc/has_item(type)
return "[type]" in items
29 changes: 0 additions & 29 deletions mods/don_loadout/code/donations/ooc_color.dm

This file was deleted.

4 changes: 4 additions & 0 deletions mods/don_loadout/code/donations/preferences.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/client_preference/ooc_donation_color
description = "OOC donator color"
key = "OOC_DONATION_COLOR"
options = list(GLOB.PREF_SHOW, GLOB.PREF_HIDE)
2 changes: 1 addition & 1 deletion mods/don_loadout/code/loadout/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
entry += "</td></tr>"

if(!hide_unavailable_gear || allowed_to_see || ticked)
if(user.client.donator_info.has_item(G.type) || (G.donation_tier && user.client.donator_info.donation_tier_available(G.donation_tier)))
if(G.donation_tier && user.client.donator_info.donation_tier_available(G.donation_tier))
purchased_gears += entry
else if(G.donation_tier)
paid_gears += entry
Expand Down