Skip to content

Commit

Permalink
refactor files to change variable name using colour to color. (#5396)
Browse files Browse the repository at this point in the history
# About the pull request
refactor files to change variable name using colour to color on those
files:
1-misc_tools.dm, robot_items.dm, paper.dm
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
refactor: refactored files to change variable name using colour to
color.
/:cl:

Co-authored-by: Julien <[email protected]>
  • Loading branch information
Huffie56 and Julien committed Jan 13, 2024
1 parent 093aea3 commit 84957c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions code/game/objects/items/tools/misc_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
matter = list("metal" = 10)
inherent_traits = list(TRAIT_TOOL_PEN)
/// what color the ink is!
var/pen_colour = "black"
var/pen_color = "black"
var/on = TRUE
var/clicky = FALSE

Expand All @@ -180,7 +180,7 @@
/obj/item/tool/pen/proc/update_pen_state()
overlays.Cut()
if(on)
overlays += "+[pen_colour]_tip"
overlays += "+[pen_color]_tip"

/obj/item/tool/pen/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
. = ..()
Expand Down Expand Up @@ -246,7 +246,7 @@

/obj/item/tool/pen/blue
desc = "It's a normal blue ink pen."
pen_colour = "blue"
pen_color = "blue"

/obj/item/tool/pen/blue/clicky
desc = "It's a WY brand extra clicky blue ink pen."
Expand All @@ -255,7 +255,7 @@

/obj/item/tool/pen/red
desc = "It's a normal red ink pen."
pen_colour = "red"
pen_color = "red"

/obj/item/tool/pen/red/clicky
desc = "It's a WY brand extra clicky red ink pen."
Expand All @@ -264,7 +264,7 @@

/obj/item/tool/pen/green
desc = "It's a normal green ink pen."
pen_colour = "green"
pen_color = "green"

/obj/item/tool/pen/green/clicky
desc = "It's a WY brand extra clicky green ink pen."
Expand All @@ -273,7 +273,7 @@

/obj/item/tool/pen/invisible
desc = "It's an invisible pen marker."
pen_colour = "white"
pen_color = "white"

/obj/item/tool/pen/fountain
desc = "A lavish testament to the ingenuity of ARMAT's craftsmanship, this fountain pen is a paragon of design and functionality. Detailed with golden accents and intricate mechanics, the pen allows for a swift change between a myriad of ink colors with a simple twist. A product of precision engineering, each mechanism inside the pen is designed to provide a seamless, effortless transition from one color to the next, creating an instrument of luxurious versatility."
Expand All @@ -282,8 +282,8 @@
icon_state = "fountain_pen"
item_state = "fountain_pen"
matter = list("metal" = 20, "gold" = 10)
var/static/list/colour_list = list("red", "blue", "green", "yellow", "purple", "pink", "brown", "black", "orange") // Can add more colors as required
var/current_colour_index = 1
var/static/list/color_list = list("red", "blue", "green", "yellow", "purple", "pink", "brown", "black", "orange") // Can add more colors as required
var/current_color_index = 1
var/owner_name

/obj/item/tool/pen/fountain/pickup(mob/user, silent)
Expand All @@ -305,9 +305,9 @@

/obj/item/tool/pen/fountain/attack_self(mob/living/carbon/human/user)
if(on)
current_colour_index = (current_colour_index % length(colour_list)) + 1
pen_colour = colour_list[current_colour_index]
balloon_alert(user,"you twist the pen and change the ink color to [pen_colour].")
current_color_index = (current_color_index % length(color_list)) + 1
pen_color = color_list[current_color_index]
balloon_alert(user,"you twist the pen and change the ink color to [pen_color].")
if(clicky)
playsound(user.loc, 'sound/items/pen_click_on.ogg', 100, 1, 5)
update_pen_state()
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/silicon/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
/obj/item/tool/pen/robopen/attack_self(mob/user)
..()

var/choice = tgui_input_list(usr, "Would you like to change color or mode?", "Change Mode", list("Colour","Mode"))
var/choice = tgui_input_list(usr, "Would you like to change color or mode?", "Change Mode", list("Color","Mode"))
if(!choice)
return

playsound(src.loc, 'sound/effects/pop.ogg', 25, FALSE)

switch(choice)
if("Colour")
var/newcolour = tgui_input_list(usr, "Which color would you like to use?", list("black","blue","red","green","yellow"))
if(newcolour) pen_colour = newcolour
if("Color")
var/newcolor = tgui_input_list(usr, "Which color would you like to use?", list("black","blue","red","green","yellow"))
if(newcolor) pen_color = newcolor
if("Mode")
if (mode == 1)
mode = 2
Expand Down
4 changes: 2 additions & 2 deletions code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
t = replacetext(t, "\[upp\]", "<img src = [asset.get_url_mappings()["upplogo.png"]]>")
t = replacetext(t, "\[cmb\]", "<img src = [asset.get_url_mappings()["cmblogo.png"]]>")

t = "<font face=\"[deffont]\" color=[P ? P.pen_colour : "black"]>[t]</font>"
t = "<font face=\"[deffont]\" color=[P ? P.pen_color : "black"]>[t]</font>"
else // If it is a crayon, and he still tries to use these, make them empty!
t = replacetext(t, "\[*\]", "")
t = replacetext(t, "\[hr\]", "")
Expand All @@ -272,7 +272,7 @@
t = replacetext(t, "\[cell\]", "")
t = replacetext(t, "\[logo\]", "")

t = "<font face=\"[crayonfont]\" color=[P ? P.pen_colour : "black"]><b>[t]</b></font>"
t = "<font face=\"[crayonfont]\" color=[P ? P.pen_color : "black"]><b>[t]</b></font>"

// t = replacetext(t, "#", "") // Junk converted to nothing!

Expand Down

0 comments on commit 84957c5

Please sign in to comment.