Skip to content

Commit

Permalink
well
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-54321 committed Nov 15, 2023
1 parent 34a339d commit f74ee9a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/~monkestation/admin.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define ADMIN_APPROVE_TOKEN(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];approve_token=[REF(user)]'>Yes</a>)"
#define ADMIN_REJECT_TOKEN(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];reject_token=[REF(user)]'>No</a>)"
#define ADMIN_APPROVE_TOKEN(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];approve_antag_token=[REF(user)]'>Yes</a>)"
#define ADMIN_REJECT_TOKEN(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];reject_antag_token=[REF(user)]'>No</a>)"
#define ADMIN_OPEN_REVIEW(id) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];open_music_review=[id]'>Open Review</a>)"
#define ADMIN_APPROVE_TOKEN_EVENT(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];approve_token_event=[REF(user)]'>Yes</a>)"
#define ADMIN_REJECT_TOKEN_EVENT(user) "(<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];reject_token_event=[REF(user)]'>No</a>)"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@

web_sound(usr, link_url)
//monkestation edit start
else if(href_list["approve_token"])
else if(href_list["approve_antag_token"])
if(!check_rights(R_ADMIN))
return
var/atom/movable/target = locate(href_list["approve_token"])
Expand All @@ -1769,7 +1769,7 @@
user_client.client_token_holder.approve_token()
message_admins("[user_client]'s token has been approved, by [owner]")

else if(href_list["reject_token"])
else if(href_list["reject_antag_token"])
if(!check_rights(R_ADMIN))
return
var/atom/movable/target = locate(href_list["reject_token"])
Expand Down
17 changes: 14 additions & 3 deletions monkestation/code/datums/meta_tokens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GLOBAL_LIST_INIT(used_monthly_token, list())
var/datum/meta_token_holder/client_token_holder

/datum/meta_token_holder
///the client that owns this holder
var/client/owner
///are they a donator? and do they have their free token?
var/donator_token = FALSE
Expand All @@ -18,7 +19,14 @@ GLOBAL_LIST_INIT(used_monthly_token, list())
///the antagonist we are currently waiting for a reply on whether we can use
var/datum/antagonist/in_queue
var/in_queued_tier
///is the queued token a donor token
var/queued_donor = FALSE
///how many event tokens we currently have
var/event_tokens = 0
///the month we last used event tokens on
var/event_token_month = 0
///what token event do we currently have queued
var/datum/twitch_event/queued_token_event

/datum/meta_token_holder/New(client/creator)
. = ..()
Expand All @@ -36,6 +44,8 @@ GLOBAL_LIST_INIT(used_monthly_token, list())
total_low_threat_tokens = saved_tokens["low_threat"]
total_medium_threat_tokens = saved_tokens["medium_threat"]
total_high_threat_tokens = saved_tokens["high_threat"]
event_tokens = saved_tokens["event_tokens"]
event_token_month = saved_tokens["event_token_month"]

total_antag_tokens = total_low_threat_tokens + total_medium_threat_tokens + total_high_threat_tokens

Expand All @@ -44,6 +54,8 @@ GLOBAL_LIST_INIT(used_monthly_token, list())
"low_threat" = total_low_threat_tokens,
"medium_threat" = total_medium_threat_tokens,
"high_threat" = total_high_threat_tokens,
"event_tokens" = event_tokens,
"event_token_month" = event_token_month,
)
owner.prefs.save_preferences()

Expand Down Expand Up @@ -87,8 +99,7 @@ GLOBAL_LIST_INIT(used_monthly_token, list())

convert_tokens_to_list()


/datum/meta_token_holder/proc/approve_token()
/datum/meta_token_holder/proc/approve_token(thing_to_approve)
if(!in_queue)
return
to_chat(owner, "Your request to play as [in_queue] has been approved.")
Expand All @@ -103,7 +114,7 @@ GLOBAL_LIST_INIT(used_monthly_token, list())
in_queued_tier = null
queued_donor = FALSE

/datum/meta_token_holder/proc/reject_token()
/datum/meta_token_holder/proc/reject_token(thing_to_reject)
to_chat(owner, "Your request to play as [in_queue] has been denied.")
in_queue = null
in_queued_tier = null
Expand Down
9 changes: 2 additions & 7 deletions monkestation/code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"high_threat" = 0,
"medium_threat" = 0,
"low_threat" = 0,
"event_tokens" = 0,
"event_token_month" = 0,
)

///amount of metaconis you can earn per shift
Expand All @@ -30,10 +32,3 @@
var/list/alt_job_titles = list()
/// the month we used our last donator token on
var/token_month = 0

///how many event tokens we currently have
var/event_tokens = 0
///the month we last used event tokens on
var/event_token_month = 0
///what token event do we currently have queued
var/datum/twitch_event/queued_token_event

0 comments on commit f74ee9a

Please sign in to comment.