mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Adds a preference setting to the "ghost item attack" thing
This commit is contained in:
@@ -247,6 +247,7 @@ CREATE TABLE `player` (
|
||||
`randomslot` tinyint(1) DEFAULT '0',
|
||||
`volume` smallint(4) DEFAULT '100',
|
||||
`nanoui_fancy` smallint(4) DEFAULT '1',
|
||||
`show_ghostitem_attack` smallint(4) DEFAULT '1',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ckey` (`ckey`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1;
|
||||
|
||||
@@ -247,6 +247,7 @@ CREATE TABLE `SS13_player` (
|
||||
`randomslot` tinyint(1) DEFAULT '0',
|
||||
`volume` smallint(4) DEFAULT '100',
|
||||
`nanoui_fancy` smallint(4) DEFAULT '1',
|
||||
`show_ghostitem_attack` smallint(4) DEFAULT '1',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ckey` (`ckey`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1;
|
||||
|
||||
@@ -84,6 +84,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
var/nanoui_fancy = TRUE
|
||||
var/toggles = TOGGLES_DEFAULT
|
||||
var/sound = SOUND_DEFAULT
|
||||
var/show_ghostitem_attack = TRUE
|
||||
var/UI_style_color = "#ffffff"
|
||||
var/UI_style_alpha = 255
|
||||
|
||||
@@ -397,6 +398,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
dat += "<h2>General Settings</h2>"
|
||||
dat += "<b>UI Style:</b> <a href='?_src_=prefs;preference=ui'><b>[UI_style]</b></a><br>"
|
||||
dat += "<b>Fancy NanoUI:</b> <a href='?_src_=prefs;preference=nanoui'>[(nanoui_fancy) ? "Yes" : "No"]</a><br>"
|
||||
dat += "<b>Ghost-Item Attack Animation:</b> <a href='?_src_=prefs;preference=ghost_att_anim'>[(show_ghostitem_attack) ? "Yes" : "No"]</a><br>"
|
||||
dat += "<b>Custom UI settings:</b><br>"
|
||||
dat += "<b>Color:</b> <a href='?_src_=prefs;preference=UIcolor'><b>[UI_style_color]</b></a> <table style='display:inline;' bgcolor='[UI_style_color]'><tr><td>__</td></tr></table><br>"
|
||||
dat += "<b>Alpha (transparency):</b> <a href='?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
|
||||
@@ -1568,6 +1570,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
if("nanoui")
|
||||
nanoui_fancy = !nanoui_fancy
|
||||
|
||||
if("ghost_att_anim")
|
||||
show_ghostitem_attack = !show_ghostitem_attack
|
||||
|
||||
if("UIcolor")
|
||||
var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!", UI_style_color) as color|null
|
||||
if(!UI_style_color_new) return
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
sound,
|
||||
randomslot,
|
||||
volume,
|
||||
nanoui_fancy
|
||||
nanoui_fancy,
|
||||
show_ghostitem_attack
|
||||
FROM [format_table_name("player")]
|
||||
WHERE ckey='[C.ckey]'"}
|
||||
)
|
||||
@@ -36,6 +37,7 @@
|
||||
randomslot = text2num(query.item[9])
|
||||
volume = text2num(query.item[10])
|
||||
nanoui_fancy = text2num(query.item[11])
|
||||
show_ghostitem_attack = text2num(query.item[12])
|
||||
|
||||
//Sanitize
|
||||
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
|
||||
@@ -49,6 +51,7 @@
|
||||
randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot))
|
||||
volume = sanitize_integer(volume, 0, 100, initial(volume))
|
||||
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
|
||||
show_ghostitem_attack = sanitize_integer(show_ghostitem_attack, 0, 1, initial(show_ghostitem_attack))
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences(client/C)
|
||||
@@ -71,7 +74,8 @@
|
||||
sound='[sound]',
|
||||
randomslot='[randomslot]',
|
||||
volume='[volume]',
|
||||
nanoui_fancy='[nanoui_fancy]'
|
||||
nanoui_fancy='[nanoui_fancy]',
|
||||
show_ghostitem_attack='[show_ghostitem_attack]'
|
||||
WHERE ckey='[C.ckey]'"}
|
||||
)
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@
|
||||
// Who can see the attack?
|
||||
var/list/viewing = list()
|
||||
for(var/mob/M in viewers(A))
|
||||
if(M.client)
|
||||
if(M.client && M.client.prefs.show_ghostitem_attack)
|
||||
viewing |= M.client
|
||||
flick_overlay(I, viewing, 5) // 5 ticks/half a second
|
||||
|
||||
|
||||
Reference in New Issue
Block a user