Skip to content

Commit

Permalink
New Icon for Cursor. (#2355)
Browse files Browse the repository at this point in the history
* Change client pointer.

Now need change to TGUI pointer

* Safe moment

* Mouse on everyone (No Scrollbars)

---------

Co-authored-by: DeadLine <[email protected]>
  • Loading branch information
DeadLineSS13 and Dedlain authored May 17, 2023
1 parent 2d8fd69 commit e56dcd2
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*.gif binary
*.jpg binary
*.png binary
*.ico binary
*.so binary

## Merger hooks, run tools/hooks/install.bat or install.sh to set up
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/beakerpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
background: #40628a;
border: 1px solid #161616;
margin: 0 2px 0 0;
cursor:default;
cursor: url("default_mousepointer.ico"), default;
}

.remove-reagent {
Expand Down
3 changes: 3 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@

var/atom/movable/screen/click_catcher/void

mouse_pointer_icon = 'mojave/icons/effects/mouse_pointers/mojave_pointer.dmi' //MOJAVE Edit
var/mojave_pointer_icon = 'mojave/icons/effects/mouse_pointers/mojave_pointer.dmi' //MOJAVE Add

///used to make a special mouse cursor, this one for mouse up icon
var/mouse_up_icon = null
///used to make a special mouse cursor, this one for mouse up icon
Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
set_macros()

// Initialize tgui panel
var/datum/asset/A = get_asset_datum(/datum/asset/simple/mouse)
A.send(src)
src << browse(file('html/statbrowser.html'), "window=statbrowser")
addtimer(CALLBACK(src, .proc/check_panel_loaded), 30 SECONDS)
tgui_panel.initialize()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/dead/new_player/poll.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ GLOBAL_PROTECT(poll_options)
<script src="[SSassets.transport.get_asset_url("jquery-ui.custom-core-widgit-mouse-sortable.min.js")]"></script>
<style>
#sortable { list-style-type: none; margin: 0; padding: 2em; }
#sortable li { min-height: 1em; margin: 0px 1px 1px 1px; padding: 1px; border: 1px solid black; border-radius: 5px; background-color: white; cursor:move;}
#sortable li { min-height: 1em; margin: 0px 1px 1px 1px; padding: 1px; border: 1px solid black; border-radius: 5px; background-color: white; cursor: move;}
#sortable .sortable-placeholder-highlight { min-height: 1em; margin: 0 2px 2px 2px; padding: 2px; border: 1px dotted blue; border-radius: 5px; background-color: GhostWhite; }
span.grippy { content: '....'; width: 10px; height: 20px; display: inline-block; overflow: hidden; line-height: 5px; padding: 3px 1px; cursor: move; vertical-align: middle; margin-top: -.7em; margin-right: .3em; font-size: 12px; font-family: sans-serif; letter-spacing: 2px; color: #cccccc; text-shadow: 1px 0 1px black; }
span.grippy::after { content: '.. .. .. ..';}
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@
/mob/proc/update_mouse_pointer()
if(!client)
return
client.mouse_pointer_icon = initial(client.mouse_pointer_icon)
client.mouse_pointer_icon = client.mojave_pointer_icon
if(examine_cursor_icon && client.keys_held["Shift"]) //mouse shit is hardcoded, make this non hard-coded once we make mouse modifiers bindable
client.mouse_pointer_icon = examine_cursor_icon
if(istype(loc, /obj/vehicle/sealed))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/// A special action? No idea why this lives here
var/list/datum/action/chameleon_item_actions
///Cursor icon used when holding shift over things
var/examine_cursor_icon = 'icons/effects/mouse_pointers/examine_pointer.dmi'
var/examine_cursor_icon = 'mojave/icons/effects/mouse_pointers/examine_pointer.dmi' //MOJAVE Edit

///Whether this mob has or is in the middle of committing suicide.
var/suiciding = FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/vehicles/mecha/mecha_topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
hr {border: 1px solid #0f0; color: #0f0; background-color: #0f0;}
a {padding:2px 5px;;color:#0f0;}
.wr {margin-bottom: 5px;}
.header {cursor:pointer;}
.header {cursor: url("drag_mousepointer.ico"), pointer;}
.open, .closed {background: #32CD32; color:#000; padding:1px 2px;}
.links a {margin-bottom: 2px;padding-top:3px;}
.visible {display: block;}
Expand Down
2 changes: 1 addition & 1 deletion html/admin/admin_panels_css3.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.inputlabel {
position: relative;
display: inline;
cursor: pointer;
cursor: url("drag_mousepointer.ico"), pointer;
padding-left: 20px;
}

Expand Down
11 changes: 8 additions & 3 deletions html/browser/common.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
html, body
{
cursor: url("default_mousepointer.ico"), default;
}

body
{
padding: 0;
Expand All @@ -22,7 +27,7 @@ a, button, a:link, a:visited, a:active, .linkOn, .linkOff
border: 1px solid #161616;
padding: 1px 4px 1px 4px;
margin: 0 2px 0 0;
cursor:default;
cursor: url("drag_mousepointer.ico"), pointer;
}

a:hover
Expand All @@ -39,7 +44,7 @@ a.white, a.white:link, a.white:visited, a.white:active
border: 1px solid #161616;
padding: 1px 4px 1px 4px;
margin: 0 2px 0 0;
cursor:default;
cursor: url("drag_mousepointer.ico"), pointer;
}

a.white:hover
Expand Down Expand Up @@ -316,7 +321,7 @@ div.notice

.slider {
position: absolute;
cursor: pointer;
cursor: url("drag_mousepointer.ico"), pointer;
top: 0;
left: 0;
right: 0;
Expand Down
14 changes: 11 additions & 3 deletions html/statbrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
<meta http-equiv="Cache-Control" content="max-age=15; must-revalidate" />
<link id="goonStyle" rel="stylesheet" type="text/css" href="browserOutput_white.css" media="all" />
<style>

html {
cursor: url("default_mousepointer.ico"), auto;
}

body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 12px !important;
margin: 0 !important;
padding: 0 !important;
overflow-x: hidden;
overflow-y: scroll;
cursor: url("default_mousepointer.ico"), auto;
}

body.dark {
Expand Down Expand Up @@ -45,7 +51,8 @@

a {
color: black;
text-decoration: none
text-decoration: none;
cursor: url("drag_mousepointer.ico"), pointer;
}

.dark a {
Expand Down Expand Up @@ -73,6 +80,7 @@
text-align: center;
padding: 14px 16px;
text-decoration: none;
cursor: url("drag_mousepointer.ico"), pointer;
}

li a:hover:not(.active) {
Expand All @@ -99,7 +107,7 @@
text-decoration: none;
font-size: 12px;
margin: 0;
cursor: pointer;
cursor: url("drag_mousepointer.ico"), pointer;
transition-duration: 100ms;
order: 3;
min-width: 40px;
Expand Down Expand Up @@ -209,7 +217,7 @@
padding: 7px 14px;
color: black;
text-decoration: none;
cursor: pointer;
cursor: url("drag_mousepointer.ico"), pointer;
font-size: 13px;
margin: 2px 2px;
}
Expand Down
10 changes: 10 additions & 0 deletions mojave/code/modules/asset_cache/assets/mouse.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/datum/asset/simple/mouse
early = TRUE
keep_local_name = TRUE
assets = list(
"default_mousepointer.ico" = 'tgui/packages/tgui/assets/default_mousepointer.ico',
"drag_mousepointer.ico" = 'tgui/packages/tgui/assets/drag_mousepointer.ico',
"n-resize_mousepointer.ico" = 'tgui/packages/tgui/assets/n-resize_mousepointer.ico',
"e-resize_mousepointer.ico" = 'tgui/packages/tgui/assets/e-resize_mousepointer.ico',
"se-resize_mousepointer.ico" = 'tgui/packages/tgui/assets/se-resize_mousepointer.ico',
)
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion mojave/machinery/terminals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
var/clicksound = pick('mojave/sound/ms13machines/terminals/ui_hacking_charenter_01.ogg','mojave/sound/ms13machines/terminals/ui_hacking_charenter_02.ogg', 'mojave/sound/ms13machines/terminals/ui_hacking_charenter_03.ogg',)
playsound(src, clicksound, 50, FALSE)
var/dat = ""
dat += "<head><style>body {padding: 0; margin: 15px; background-color: [main_color]; color: [secondary_color]; line-height: 170%;} a, button, a:link, a:visited, a:active, .linkOn, .linkOff {color: [secondary_color]; text-decoration: none; background: [main_color]; border: none; padding: 1px 4px 1px 4px; margin: 0 2px 0 0; cursor:default;} a:hover {color: [main_color]; background: [secondary_color]; border: 1px solid [secondary_color]} a.white, a.white:link, a.white:visited, a.white:active {color: [secondary_color]; text-decoration: none; background: [secondary_color]; border: 1px solid #161616; padding: 1px 4px 1px 4px; margin: 0 2px 0 0; cursor:default;} a.white:hover {color: [main_color]; background: [secondary_color];} .linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover {color: [secondary_color]; background: [main_color]; border-color: [main_color];} .linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover{color: [secondary_color]; background: [main_color]; border-color: [main_color];}</style></head><font face='courier'>"
dat += "<head><style>body {padding: 0; margin: 15px; background-color: [main_color]; color: [secondary_color]; line-height: 170%;} a, button, a:link, a:visited, a:active, .linkOn, .linkOff {color: [secondary_color]; text-decoration: none; background: [main_color]; border: none; padding: 1px 4px 1px 4px; margin: 0 2px 0 0; cursor: url('default_mousepointer.ico'), default;} a:hover {color: [main_color]; background: [secondary_color]; border: 1px solid [secondary_color]} a.white, a.white:link, a.white:visited, a.white:active {color: [secondary_color]; text-decoration: none; background: [secondary_color]; border: 1px solid #161616; padding: 1px 4px 1px 4px; margin: 0 2px 0 0; cursor: url('default_mousepointer.ico'), default;} a.white:hover {color: [main_color]; background: [secondary_color];} .linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover {color: [secondary_color]; background: [main_color]; border-color: [main_color];} .linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover{color: [secondary_color]; background: [main_color]; border-color: [main_color];}</style></head><font face='courier'>"
switch (system)
if ("ROBCO50")
dat += "<center><b>ROBCO INDUSTRIES UNIFIED OPERATING SYSTEM V.5.0</b><br>"
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4400,6 +4400,7 @@
#include "mojave\code\game\objects\effects\displacement_maps.dm"
#include "mojave\code\game\objects\effects\displacement\fat.dm"
#include "mojave\code\modules\ai\effect_node.dm"
#include "mojave\code\modules\asset_cache\assets\mouse.dm"
#include "mojave\code\modules\atmosphere\atmosphere.dm"
#include "mojave\code\modules\client\preferences\fatness.dm"
#include "mojave\code\modules\clothing\spacesuits\power_armor.dm"
Expand Down
Binary file added tgui/packages/tgui/assets/default_mousepointer.ico
Binary file not shown.
Binary file added tgui/packages/tgui/assets/drag_mousepointer.ico
Binary file not shown.
Binary file added tgui/packages/tgui/assets/e-resize_mousepointer.ico
Binary file not shown.
Binary file added tgui/packages/tgui/assets/n-resize_mousepointer.ico
Binary file not shown.
Binary file added tgui/packages/tgui/assets/se-resize_mousepointer.ico
Binary file not shown.
1 change: 0 additions & 1 deletion tgui/packages/tgui/styles/components/Knob.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ $inner-padding: 0.1em;
height: 2.6em;
margin: 0 auto;
margin-bottom: -0.2em;
cursor: n-resize;

// Adjusts a baseline in a way, that makes knob middle-aligned
// when it flows with the text.
Expand Down
1 change: 0 additions & 1 deletion tgui/packages/tgui/styles/components/NumberInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ $border-radius: Input.$border-radius !default;
line-height: base.em(17px);
text-align: right;
overflow: visible;
cursor: n-resize;
}

.NumberInput--fluid {
Expand Down
3 changes: 0 additions & 3 deletions tgui/packages/tgui/styles/components/Slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ $cursor-color: base.$color-fg !default;
$popup-background-color: #000000 !default;
$popup-text-color: #ffffff !default;

.Slider {
cursor: e-resize;
}

.Slider__cursorOffset {
position: absolute;
Expand Down
3 changes: 0 additions & 3 deletions tgui/packages/tgui/styles/layouts/Window.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
width: base.rem(20px);
height: 20px;
height: base.rem(20px);
cursor: se-resize;
}

.Window__resizeHandle__s {
Expand All @@ -87,7 +86,6 @@
right: 0;
height: 6px;
height: base.rem(6px);
cursor: s-resize;
}

.Window__resizeHandle__e {
Expand All @@ -97,5 +95,4 @@
right: 0;
width: 3px;
width: base.rem(3px);
cursor: e-resize;
}
20 changes: 20 additions & 0 deletions tgui/public/tgui.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,26 @@
</script>

<style>
html, body{
cursor: url("default_mousepointer.ico"), auto;
}

.Button, .Tabs, .TitleBar__close {
cursor: url("drag_mousepointer.ico"), pointer;
}

.Knob, .NumberInput, .Window__resizeHandle__s {
cursor: url("n-resize_mousepointer.ico"), s-resize;
}

.Window__resizeHandle__e {
cursor: url("e-resize_mousepointer.ico"), e-resize;
}

.Window__resizeHandle__se {
cursor: url("se-resize_mousepointer.ico"), se-resize;
}

.FatalError {
display: none;
position: absolute;
Expand Down

0 comments on commit e56dcd2

Please sign in to comment.