-
-
Notifications
You must be signed in to change notification settings - Fork 180
Порт системы хоткеев с SS220 Paradise #2065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,3 +293,12 @@ | |
| #define INIT_MACHINERY_PROCESS_ALL 0x3 | ||
| //-- | ||
|
|
||
| //intent defines | ||
| #define INTENT_HELP "help" | ||
| #define INTENT_GRAB "grab" | ||
| #define INTENT_DISARM "disarm" | ||
| #define INTENT_HARM "harm" | ||
|
Comment on lines
+296
to
+300
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Можно убрать. У нас есть дефайны
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. К тому же это не используется нигде, по крайней мере сейчас. |
||
| //NOTE: INTENT_HOTKEY_* defines are not actual intents! | ||
| //they are here to support hotkeys | ||
| #define INTENT_HOTKEY_LEFT "left" | ||
| #define INTENT_HOTKEY_RIGHT "right" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| #define SS_PRIORITY_ICON_UPDATE 20 // Queued icon updates. Mostly used by APCs and tables. | ||
|
|
||
| // Normal | ||
| #define SS_PRIORITY_INPUT 1000 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #define SS_PRIORITY_TICKER 100 // Gameticker. | ||
| #define SS_PRIORITY_MOB 95 // Mob Life(). | ||
| #define SS_PRIORITY_MACHINERY 95 // Machinery + powernet ticks. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1118,3 +1118,6 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) | |
| M.start_pulling(t) | ||
| else | ||
| step(user.pulling, get_dir(user.pulling.loc, A)) | ||
|
|
||
| /proc/REF(input) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Заменить на существующий макрос any2ref, если возможно.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Оно в принципе и не нужно как я понял. |
||
| return "\ref[input]" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,9 @@ | |
| if(modifiers["middle"]) | ||
| MiddleClickOn(A) | ||
| return 1 | ||
| if(modifiers["middle"] && modifiers["alt"]) | ||
| AltMiddleClickOn(A) | ||
| return 1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это должно быть выше |
||
| if(modifiers["shift"]) | ||
| ShiftClickOn(A) | ||
| return 0 | ||
|
|
@@ -219,7 +222,10 @@ | |
| Only used for swapping hands | ||
| */ | ||
| /mob/proc/MiddleClickOn(var/atom/A) | ||
| swap_hand() | ||
| pointed(A) | ||
| return | ||
|
|
||
| /mob/proc/AltMiddleClickOn(var/atom/A) | ||
| return | ||
|
|
||
| // In case of use break glass | ||
|
|
@@ -302,11 +308,8 @@ | |
| /mob/proc/CtrlAltClickOn(var/atom/A) | ||
| if(A.CtrlAltClick(src)) | ||
| return | ||
| pointed(A) | ||
|
|
||
| /atom/proc/CtrlAltClick(var/mob/user) | ||
| if(user.client && user.client.eye == user) | ||
| user.pointed(src) | ||
| return | ||
|
|
||
| /* | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| SUBSYSTEM_DEF(input) | ||
| name = "Input" | ||
| wait = 1 //SS_TICKER means this runs every tick | ||
| init_order = SS_INIT_INPUT | ||
| flags = SS_TICKER | ||
| priority = SS_PRIORITY_INPUT | ||
| runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY | ||
|
|
||
| var/list/macro_sets | ||
| var/list/movement_keys | ||
| var/list/alt_movement_keys | ||
|
|
||
| /datum/controller/subsystem/input/Initialize() | ||
| setup_default_macro_sets() | ||
|
|
||
| setup_default_movement_keys() | ||
|
|
||
| initialized = TRUE | ||
|
|
||
| refresh_client_macro_sets() | ||
|
|
||
| return ..() | ||
|
|
||
| // This is for when macro sets are eventualy datumized | ||
| /datum/controller/subsystem/input/proc/setup_default_macro_sets() | ||
| var/list/static/default_macro_sets | ||
|
|
||
| if(default_macro_sets) | ||
| macro_sets = default_macro_sets | ||
| return | ||
|
|
||
| default_macro_sets = list( | ||
| "default" = list( | ||
| "Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"", | ||
| "Back" = "\".winset \\\"input.focus=true input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs | ||
| "Any" = "\"KeyDown \[\[*\]\]\"", | ||
| "Any+UP" = "\"KeyUp \[\[*\]\]\"", | ||
| ), | ||
| "old_default" = list( | ||
| "Tab" = "\".winset \\\"mainwindow.macro=old_hotkeys map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\"", | ||
| ), | ||
| "old_hotkeys" = list( | ||
| "Tab" = "\".winset \\\"mainwindow.macro=old_default input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"", | ||
| "Back" = "\".winset \\\"input.focus=true input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs | ||
| "Any" = "\"KeyDown \[\[*\]\]\"", | ||
| "Any+UP" = "\"KeyUp \[\[*\]\]\"", | ||
| ), | ||
| ) | ||
|
|
||
| // Because i'm lazy and don't want to type all these out twice | ||
| var/list/old_default = default_macro_sets["old_default"] | ||
|
|
||
| var/list/static/oldmode_keys = list( | ||
| "North", "East", "South", "West", | ||
| "Northeast", "Southeast", "Northwest", "Southwest", | ||
| "Insert", "Delete", "Ctrl", "Alt", "Shift", | ||
| "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", | ||
| ) | ||
|
|
||
| for(var/i in 1 to oldmode_keys.len) | ||
| var/key = oldmode_keys[i] | ||
| old_default[key] = "\"KeyDown [key]\"" | ||
| old_default["[key]+UP"] = "\"KeyUp [key]\"" | ||
|
|
||
| var/list/static/oldmode_ctrl_override_keys = list( | ||
| "W" = "W", "A" = "A", "S" = "S", "D" = "D", // movement | ||
| "1" = "1", "2" = "2", "3" = "3", "4" = "4", // intent | ||
| "B" = "B", // resist, rest | ||
| "E" = "E", // quick equip | ||
| "F" = "F", // intent left | ||
| "G" = "G", // intent right | ||
| "H" = "H", // stop pulling | ||
| "Q" = "Q", // drop | ||
| "R" = "R", // throw | ||
| "X" = "X", // switch hands | ||
| "Y" = "Y", // activate item | ||
| "Z" = "Z", // activate item | ||
| "T" = "T", // say, whisper | ||
| "M" = "M", // me | ||
| "O" = "O", // ooc | ||
| "L" = "L", // looc | ||
| "C" = "C", // stop pulling | ||
| ) | ||
|
|
||
| for(var/i in 1 to oldmode_ctrl_override_keys.len) | ||
| var/key = oldmode_ctrl_override_keys[i] | ||
| var/override = oldmode_ctrl_override_keys[key] | ||
| old_default["Ctrl+[key]"] = "\"KeyDown [override]\"" | ||
| old_default["Ctrl+[key]+UP"] = "\"KeyUp [override]\"" | ||
|
|
||
| macro_sets = default_macro_sets | ||
|
|
||
| // For initially setting up or resetting to default the movement keys | ||
| /datum/controller/subsystem/input/proc/setup_default_movement_keys() | ||
| var/static/list/default_movement_keys = list( | ||
| "W" = NORTH, "A" = WEST, "S" = SOUTH, "D" = EAST, // WASD | ||
| "North" = NORTH, "West" = WEST, "South" = SOUTH, "East" = EAST, // Arrow keys & Numpad | ||
| ) | ||
| var/static/list/azerty_movement_keys = list( | ||
| "Z" = NORTH, "Q" = WEST, "S" = SOUTH, "D" = EAST, // WASD | ||
| "North" = NORTH, "West" = WEST, "South" = SOUTH, "East" = EAST, // Arrow keys & Numpad | ||
| ) | ||
| movement_keys = default_movement_keys.Copy() | ||
| alt_movement_keys = azerty_movement_keys.Copy() | ||
|
|
||
| // Badmins just wanna have fun ♪ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ода юникодовские значки в коментариях |
||
| /datum/controller/subsystem/input/proc/refresh_client_macro_sets() | ||
| var/list/clients = GLOB.clients | ||
| for(var/i in 1 to clients.len) | ||
| var/client/user = clients[i] | ||
| user.set_macros() | ||
|
|
||
| /datum/controller/subsystem/input/fire() | ||
| var/list/clients = GLOB.clients // Let's sing the list cache song | ||
| if(listclearnulls(clients)) // clear nulls before we run keyloop | ||
| log_world("Found a null in clients list!") | ||
| for(var/i in 1 to clients.len) | ||
| var/client/C = clients[i] | ||
| C.keyLoop() | ||
|
|
||
| /datum/controller/subsystem/input/Recover() | ||
| macro_sets = SSinput.macro_sets | ||
| movement_keys = SSinput.movement_keys | ||
| alt_movement_keys = SSinput.alt_movement_keys | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,10 +266,10 @@ | |
| occupant.client.eye = occupant.client.mob | ||
| occupant.client.perspective = MOB_PERSPECTIVE | ||
| if(occupant.loc == src) | ||
| if(not_turf_contains_dense_objects(get_turf(get_step(loc, dir)))) | ||
| occupant.dropInto(get_step(loc, dir)) | ||
| else | ||
| occupant.dropInto(loc) | ||
| // if(not_turf_contains_dense_objects(get_turf(get_step(loc, dir)))) //Because of new input system, I don't want to write more cruthes in it | ||
| // occupant.dropInto(get_step(loc, dir)) | ||
| // else | ||
| occupant.dropInto(loc) | ||
|
Comment on lines
+269
to
+272
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Чо за костыли? |
||
| set_occupant(null) | ||
|
|
||
| for(var/obj/O in (contents - component_parts)) // In case an object was dropped inside or something. Excludes the beaker and component parts. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| active_power_usage = 4000 //inf, was 200 | ||
| clicksound = 'sound/machines/buttonbeep.ogg' | ||
| clickvol = 30 | ||
|
|
||
| machine_name = "cryo cell" | ||
| machine_desc = "Uses a supercooled chemical bath to hold living beings in something close to suspended animation. Often paired with specialized medicines to rapidly heal wounds of a patient inside." | ||
|
|
||
|
|
@@ -278,7 +278,7 @@ | |
| if (occupant.client) | ||
| occupant.client.eye = occupant.client.mob | ||
| occupant.client.perspective = MOB_PERSPECTIVE | ||
| occupant.forceMove(get_step(loc, SOUTH)) | ||
| occupant.forceMove(loc) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
| if (occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) | ||
| occupant.bodytemperature = 261 | ||
| occupant = null | ||
|
|
@@ -401,4 +401,3 @@ | |
|
|
||
| /datum/data/function/proc/display() | ||
| return | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,11 +353,11 @@ | |
| if(istype(O,/obj/item/storage/internal)) //Stop eating pockets, you fuck! | ||
| continue | ||
| O.forceMove(src) | ||
|
|
||
| // Надо их просто удалить | ||
| for(var/obj/item/holder/H in occupant) | ||
| H.destroy_all() | ||
|
|
||
| for(var/obj/item/holder/H in src.contents) | ||
| H.destroy_all() | ||
|
|
||
|
|
@@ -586,10 +586,10 @@ | |
| occupant.client.eye = src.occupant.client.mob | ||
| occupant.client.perspective = MOB_PERSPECTIVE | ||
|
|
||
| if(not_turf_contains_dense_objects(get_turf(get_step(loc, dir)))) | ||
| occupant.dropInto(get_step(loc, dir)) | ||
| else | ||
| occupant.dropInto(loc) | ||
| // if(not_turf_contains_dense_objects(get_turf(get_step(loc, dir)))) //Because of new input system, I don't want to write more cruthes in it | ||
| // occupant.dropInto(get_step(loc, dir)) | ||
| // else | ||
| occupant.dropInto(loc) | ||
|
Comment on lines
+589
to
+592
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Опять же, что за костыли? |
||
|
|
||
| set_occupant(null) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Цвета и буквы в них с маленькой. У нас стоит ЮнитТест на это.