mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Turn poll magic strings into defines
This commit is contained in:
@@ -40,13 +40,13 @@
|
||||
var/choice_amount = 0
|
||||
switch(polltype)
|
||||
if("Single Option")
|
||||
polltype = "OPTION"
|
||||
polltype = POLLTYPE_OPTION
|
||||
if("Text Reply")
|
||||
polltype = "TEXT"
|
||||
polltype = POLLTYPE_TEXT
|
||||
if("Rating")
|
||||
polltype = "NUMVAL"
|
||||
polltype = POLLTYPE_RATING
|
||||
if("Multiple Choice")
|
||||
polltype = "MULTICHOICE"
|
||||
polltype = POLLTYPE_MULTI
|
||||
choice_amount = input("How many choices should be allowed?","Select choice amount") as num|null
|
||||
if(!choice_amount)
|
||||
return
|
||||
@@ -93,7 +93,7 @@
|
||||
var/err = query_polladd_question.ErrorMsg()
|
||||
log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")
|
||||
return
|
||||
if(polltype == "TEXT")
|
||||
if(polltype == POLLTYPE_TEXT)
|
||||
log_admin("[key_name(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"] - Question: [question]")
|
||||
message_admins("[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]<br>Question: [question]")
|
||||
return
|
||||
@@ -107,7 +107,7 @@
|
||||
pollid = query_get_id.item[1]
|
||||
var/add_option = 1
|
||||
while(add_option)
|
||||
var/option = input("Write your option","Option") as message|null
|
||||
var/option = input("Write your option",POLLTYPE_OPTION) as message|null
|
||||
if(!option)
|
||||
return pollid
|
||||
option = sanitizeSQL(option)
|
||||
@@ -124,7 +124,7 @@
|
||||
var/descmin = ""
|
||||
var/descmid = ""
|
||||
var/descmax = ""
|
||||
if(polltype == "NUMVAL")
|
||||
if(polltype == POLLTYPE_RATING)
|
||||
minval = input("Set minimum rating value.","Minimum rating") as num|null
|
||||
if(!minval)
|
||||
return pollid
|
||||
|
||||
Reference in New Issue
Block a user