Turn poll magic strings into defines

This commit is contained in:
Markolie
2015-10-05 19:25:05 +02:00
parent ad0329a1fd
commit fdc3578582
3 changed files with 20 additions and 15 deletions
+7 -7
View File
@@ -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