diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index b8a3c03a45c0..8c24b2b20b32 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -87,7 +87,7 @@ for(var/obj/item/I in src.loc) if(itemcount >= storage_capacity) break - if(!I.anchored) + if(!I.anchored && !istype(I, /obj/item/weapon/paper/sticker)) I.forceMove(src) itemcount++ @@ -178,6 +178,9 @@ else if(istagger(W)) return + else if(istype(W, /obj/item/weapon/paper/sticker)) + return + else attack_hand(user) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index e6980e6f6c50..4673ce49af69 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -89,7 +89,7 @@ playsound(src, pick(SOUNDIN_SPARKS), VOL_EFFECTS_MASTER) visible_message("The locker has been sliced open by [user] with an [W.name]!", blind_message = "You hear metal being sliced and sparks flying.", viewing_distance = 3) - else if(istype(W,/obj/item/weapon/packageWrap) || iswelding(W)) + else if(istype(W,/obj/item/weapon/packageWrap) || iswelding(W) || istype(W, /obj/item/weapon/paper/sticker)) return ..(W,user) else togglelock(user) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 775c3742f3e0..638287e57cb5 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -44,6 +44,10 @@ ///Last world.time tick the contents of this paper was changed. var/last_info_change = 0 + var/windowWidth = 425 + var/windowHeight = 600 + var/windowTheme = CSS_THEME_LIGHT + //lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm! /obj/item/weapon/paper/atom_init() @@ -58,9 +62,9 @@ /obj/item/weapon/paper/update_icon() if(info) - icon_state = "paper_words" + icon_state = "[initial(icon_state)]_words" return - icon_state = "paper" + icon_state = "[initial(icon_state)]" /obj/item/weapon/paper/proc/update_space(new_text) if(!new_text) @@ -91,7 +95,7 @@ data = "[infolinks ? info_links : info][stamp_text]" if(view) - var/datum/browser/popup = new(user, "window=[name]", "[name]", 425, 600, ntheme = CSS_THEME_LIGHT) + var/datum/browser/popup = new(user, "window=[name]", "[name]", windowWidth, windowHeight, ntheme = windowTheme) popup.set_content(data) popup.open() diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 6adccbc5bfed..5c41c5b7dd20 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -95,7 +95,7 @@ var/obj/item/weapon/paper/P = W dat += P.show_content(human_user, view = FALSE) - var/datum/browser/popup = new(human_user, "window=[name]", "[sanitize(P.name)]", 300, 480, ntheme = CSS_THEME_LIGHT) + var/datum/browser/popup = new(human_user, "window=[name]", "[sanitize(P.name)]", P.windowWidth, P.windowHeight, ntheme = P.windowTheme) popup.set_content(dat) popup.open() diff --git a/code/modules/paperwork/stickers.dm b/code/modules/paperwork/stickers.dm new file mode 100644 index 000000000000..7565d43c7b38 --- /dev/null +++ b/code/modules/paperwork/stickers.dm @@ -0,0 +1,106 @@ +/obj/item/weapon/paper/sticker + name = "sticker" + cases = list("стикер", "стикера", "стикеру", "стикер", "стикером", "стикере") + desc = "Самоклеящаяся бумага для заметок." + icon_state = "sticker_yellow" + slot_flags = null + + free_space = 100 + + windowWidth = 200 + windowHeight = 200 + windowTheme = "sticker_theme_yellow" + +/obj/item/weapon/paper/sticker/yellow + icon_state = "sticker_yellow" + + windowTheme = "sticker_theme_yellow" + +/obj/item/weapon/paper/sticker/red + icon_state = "sticker_red" + + windowTheme = "sticker_theme_red" + +/obj/item/weapon/paper/sticker/green + icon_state = "sticker_green" + + windowTheme = "sticker_theme_green" + +/obj/item/weapon/paper/sticker/blue + icon_state = "sticker_blue" + + windowTheme = "sticker_theme_blue" + + +/obj/item/weapon/paper/sticker/afterattack(atom/target, mob/user, proximity, params) + if(!proximity) + return + if(!istype(target, /obj/structure) && !ismachinery(target)) + return + + var/list/click_params = params2list(params) + var/matrix/M = matrix() + M.Turn(rand(-20,20)) + transform = M + user.drop_from_inventory(src, target.loc, text2num(click_params[ICON_X]) + target.pixel_x - world.icon_size / 2, text2num(click_params[ICON_Y]) + target.pixel_y - world.icon_size / 2) + + AddComponent(/datum/component/bounded, target, 0, 0, CALLBACK(src, PROC_REF(resolve_stranded))) + +/obj/item/weapon/paper/sticker/proc/resolve_stranded(datum/component/bounded/bounds) + if(get_dist(bounds.master, src) <= 1 && isturf(loc)) + forceMove(bounds.master.loc) + var/dist = get_dist(src, get_turf(bounds.master)) + if(dist >= bounds.min_dist && dist <= bounds.max_dist) + return TRUE + + qdel(GetComponent(/datum/component/bounded)) + return TRUE + +/obj/item/weapon/stickers + name = "stickers" + cases = list("стикеры", "стикеров", "стикерам", "стикеры", "стикерами", "стикерах") + desc = "Самоклеящаяся бумага для заметок." + icon = 'icons/obj/bureaucracy.dmi' + icon_state = "stickers_4" + + var/stickers_amount = 20 + +/obj/item/weapon/stickers/update_icon() + icon_state = "stickers_[ceil(stickers_amount/5)]" + +/obj/item/weapon/stickers/MouseDrop(mob/user) + . = ..() + if(.) + user.put_in_hands(src) + +/obj/item/weapon/stickers/attack_paw(mob/user) + return attack_hand(user) + +/obj/item/weapon/stickers/attack_hand(mob/living/user) + if(user && user.a_intent == INTENT_GRAB) + return ..() + + var/obj/item/weapon/paper/sticker/S + + switch(stickers_amount) + if(1 to 5) + S = new /obj/item/weapon/paper/sticker/blue(src) + if(6 to 10) + S = new /obj/item/weapon/paper/sticker/green(src) + if(11 to 15) + S = new /obj/item/weapon/paper/sticker/red(src) + if(16 to 20) + S = new /obj/item/weapon/paper/sticker/yellow(src) + + user.put_in_hands(S) + + stickers_amount-- + + to_chat(user, "Вы взяли стикер.") + add_fingerprint(user) + + if(stickers_amount <= 0) + qdel(src) + return + + update_icon() diff --git a/html/browser/common.css b/html/browser/common.css index 23d18864f263..85598b07cc53 100644 --- a/html/browser/common.css +++ b/html/browser/common.css @@ -646,3 +646,52 @@ body.theme_abductor { margin-right: auto; width: 50%; } + +body.sticker_theme_yellow { + background-color: #fcf7be; + background-image:none; + color: #000000; +} + +.sticker_theme_yellow .uiTitle { + border-bottom: 2px solid #f6d896; + background: #fcf7be; + color: #30373d; +} + +body.sticker_theme_red { + background-color: #ffe0b7; + background-image:none; + color: #000000; +} + +.sticker_theme_red .uiTitle { + border-bottom: 2px solid #fca570; + background: #ffe0b7; + color: #30373d; +} + +body.sticker_theme_green { + background-color: #b5e7cb; + background-image:none; + color: #000000; +} + +.sticker_theme_green .uiTitle { + border-bottom: 2px solid #86c69a; + background: #b5e7cb; + color: #30373d; +} + +body.sticker_theme_blue { + background-color: #42bfe8; + background-image:none; + color: #000000; +} + +.sticker_theme_blue .uiTitle { + border-bottom: 2px solid #2789cd; + background: #42bfe8; + color: #30373d; +} + diff --git a/icons/obj/bureaucracy.dmi b/icons/obj/bureaucracy.dmi index a87a38b9d718..83fb9d1955e2 100644 Binary files a/icons/obj/bureaucracy.dmi and b/icons/obj/bureaucracy.dmi differ diff --git a/taucetistation.dme b/taucetistation.dme index ba4917bc7072..49236eda8ffe 100644 --- a/taucetistation.dme +++ b/taucetistation.dme @@ -2145,6 +2145,7 @@ #include "code\modules\paperwork\predefined_forms.dm" #include "code\modules\paperwork\silicon_photography.dm" #include "code\modules\paperwork\stamps.dm" +#include "code\modules\paperwork\stickers.dm" #include "code\modules\paperwork\ticket_machine.dm" #include "code\modules\persistent_cache\persistent_cache.dm" #include "code\modules\power\apc.dm"