Skip to content

Commit

Permalink
Merge pull request #120 from MistakeNot4892/fork/pyrelight
Browse files Browse the repository at this point in the history
Updating from Neb dev
  • Loading branch information
MistakeNot4892 authored Jan 19, 2025
2 parents 618da55 + 90206e0 commit 7e69a56
Show file tree
Hide file tree
Showing 600 changed files with 7,466 additions and 5,831 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Issue report
about: Create a report about a bug or other issue
title: ''
labels: ''
assignees: ''

---

<!--
Anything inside tags like these is a comment and will not be displayed in the final issue.
Be careful not to write inside them!
Every field other than 'specific information for locating' is required.
If you do not fill out the 'specific information' field, please delete the header.
/!\ Omitting or not answering a required field will result in your issue being closed. /!\
Repeated violation of this rule, or joke or spam issues, will result in punishment.
PUT YOUR ANSWERS ON THE BLANK LINES BELOW THE HEADERS
(The lines with four #'s)
Don't edit them or delete them - it's part of the formatting
-->

#### Description of issue



#### Difference between expected and actual behavior



#### Steps to reproduce



#### Specific information for locating
<!-- e.g. an object name, paste specific message outputs... -->



#### Length of time in which bug has been known to occur
<!--
Be specific if you approximately know the time it's been occurring
for—this can speed up finding the source. If you're not sure
about it, tell us too!
-->



#### Client version, Server revision & Game ID
<!-- Found with the "Show server revision" verb in the OOC tab in game. -->



#### Issue bingo
<!-- Check these by writing an x inside the [ ] (like this: [x])-->
<!-- Don't forget to remove the space between the brackets, or it won't work! -->
- [ ] Issue could be reproduced at least once
- [ ] Issue could be reproduced by different players
- [ ] Issue could be reproduced in multiple rounds
- [ ] Issue happened in a recent (less than 7 days ago) round
- [ ] [Couldn't find an existing issue about this](https://github.com/NebulaSS13/Nebula/issues)
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ This is a quick and dirty set of agreed-upon standards for contributions to the
- If there's a personal dislike of the PR, post about it for discussion. Maybe have an 'on hold for discussion' label. Try to reach a consensus/compromise. Failing a compromise, a majority maintainer vote will decide.
- First person to review approves the PR, second person to review can merge it. If 24 hours pass with no objections, first person can merge the PR themselves.
- PRs can have a 24 hour grace period applied by maintainers if it seems important for discussion and responses to be involved. Don't merge for the grace period if applied (reviews are fine).

### Footguns
A footgun is a pattern, function, assumption etc. that stands a strong chance to shoot you in the foot. They are documented here for ease of reference by new contributors.

#### List footguns
- Adding lists to lists will actually perform a merge, rather than inserting the list as a new record. If you want to insert a list into a list, you need to either:
- double-wrap it, ex. `my_list += list(list("some_new_data" = 25))`
- set the index directly, ex. `my_list[my_list.len] = list("some_new_data" = 25)`
- Using variables and macros as associative list keys have some notable behavior.
- If declaring an associative list using a macro as a key, in a case where the macro does not exist (due to misspelling, etc.), that macro name will be treated as a string value for the associative list. You can guard against this by wrapping the macro in parens, ex. `list( (MY_MACRO_NAME) = "some_value" )`, which will fail to compile instead in cases where the macro doesn't exist.
- If a variable is used as the associative key, it *must* be wrapped in parens, or it will be used as a string key.
2 changes: 1 addition & 1 deletion code/__defines/_planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ What is the naming convention for planes or layers?
#define ABOVE_LIGHTING_PLANE 4 // laser beams, etc. that shouldn't be affected by darkness
#define ABOVE_LIGHTING_LAYER 1
#define BEAM_PROJECTILE_LAYER 2
#define SUPERMATTER_WALL_LAYER 3
#define SUBSPACE_WALL_LAYER 3
#define OBFUSCATION_LAYER 4

#define FULLSCREEN_PLANE 5 // for fullscreen overlays that do not cover the hud.
Expand Down
25 changes: 0 additions & 25 deletions code/__defines/gamemode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,6 @@
#define DEFAULT_TELECRYSTAL_AMOUNT 130
#define IMPLANT_TELECRYSTAL_AMOUNT(x) (round(x * 0.49)) // If this cost is ever greater than half of DEFAULT_TELECRYSTAL_AMOUNT then it is possible to buy more TC than you spend

// SPELL FLAGS
#define Z2NOCAST BITFLAG(0) //if this is added, the spell can't be cast at centcomm
#define INCLUDEUSER BITFLAG(1) //does the spell include the caster in its target selection?
#define IGNOREDENSE BITFLAG(2) //are dense turfs ignored in selection?

//End split flags
#define CONSTRUCT_CHECK BITFLAG(12) //used by construct spells - checks for nullrods
#define NO_BUTTON BITFLAG(13) //spell won't show up in the HUD with this

//invocation
#define SpI_SHOUT "shout"
#define SpI_WHISPER "whisper"
#define SpI_EMOTE "emote"
#define SpI_NONE "none"

//upgrading
#define Sp_SPEED "speed"
#define Sp_POWER "power"
#define Sp_TOTAL "total"

//casting costs
#define Sp_RECHARGE "recharge"
#define Sp_CHARGES "charges"
#define Sp_HOLDVAR "holdervar"

//Voting-related
#define VOTE_PROCESS_ABORT 1
#define VOTE_PROCESS_COMPLETE 2
Expand Down
16 changes: 0 additions & 16 deletions code/__defines/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
#define STAGE_THREE 5
#define STAGE_FOUR 7
#define STAGE_FIVE 9
#define STAGE_SUPER 11

// NanoUI flags
#define STATUS_INTERACTIVE 2 // GREEN Visability
Expand Down Expand Up @@ -103,21 +102,6 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
#define ATMOS_DEFAULT_VOLUME_MIXER 500 // L.
#define ATMOS_DEFAULT_VOLUME_PIPE 70 // L.

// These are used by supermatter and supermatter monitor program, mostly for UI updating purposes. Higher should always be worse!
#define SUPERMATTER_ERROR -1 // Unknown status, shouldn't happen but just in case.
#define SUPERMATTER_INACTIVE 0 // No or minimal energy
#define SUPERMATTER_NORMAL 1 // Normal operation
#define SUPERMATTER_NOTIFY 2 // Ambient temp > 80% of CRITICAL_TEMPERATURE
#define SUPERMATTER_WARNING 3 // Ambient temp > CRITICAL_TEMPERATURE OR integrity damaged
#define SUPERMATTER_DANGER 4 // Integrity < 50%
#define SUPERMATTER_EMERGENCY 5 // Integrity < 25%
#define SUPERMATTER_DELAMINATING 6 // Pretty obvious.

#define SUPERMATTER_DATA_EER "Relative EER"
#define SUPERMATTER_DATA_TEMPERATURE "Temperature"
#define SUPERMATTER_DATA_PRESSURE "Pressure"
#define SUPERMATTER_DATA_EPR "Chamber EPR"

// Scrubber modes
#define SCRUBBER_SIPHON "siphon"
#define SCRUBBER_SCRUB "scrub"
Expand Down
8 changes: 8 additions & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,11 @@
#define RADIAL_LABELS_NONE 0
#define RADIAL_LABELS_OFFSET 1
#define RADIAL_LABELS_CENTERED 2

#define CRAYON_DRAW_RUNE "rune"
#define CRAYON_DRAW_GRAFFITI "graffiti"
#define CRAYON_DRAW_LETTER "letter"
#define CRAYON_DRAW_ARROW "arrow"

// Default UI style applied to client prefs.
#define DEFAULT_UI_STYLE /decl/ui_style/midnight
29 changes: 29 additions & 0 deletions code/_helpers/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,35 @@ var/global/next_duration_update = 0
var/global/last_round_duration = 0
var/global/round_start_time = 0

/proc/ticks2shortreadable(tick_time, separator = ":")
var/hours = round(tick_time / (1 HOUR))
var/minutes = round((tick_time % (1 HOUR)) / (1 MINUTE))
var/seconds = round((tick_time % (1 MINUTE)) / (1 SECOND))
var/out = list()

if(hours > 0)
out += "[hours]"

if(minutes > 0)
if(minutes < 10 && hours > 0)
out += "0[minutes]"
else
out += "[minutes]"
else if(hours > 0)
out += "00"

if(seconds > 0)
if(seconds < 10 && (minutes > 0 || hours > 0))
out += "0[seconds]"
else
out += "[seconds]"
else if(minutes > 0 || hours > 0)
out += "00"

if(length(out))
return jointext(out, separator)
return null

/proc/ticks2readable(tick_time)
var/hours = round(tick_time / (1 HOUR))
var/minutes = round((tick_time % (1 HOUR)) / (1 MINUTE))
Expand Down
11 changes: 9 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,17 @@
return A.CtrlClick(src)

/atom/proc/CtrlClick(var/mob/user)
if(loc == user)
var/decl/interaction_handler/handler = get_quick_interaction_handler(user)
if(handler)
var/using_item = user.get_active_held_item() || user.get_usable_hand_slot_organ()
if(handler.is_possible(src, user, using_item))
return handler.invoked(src, user, using_item)
return FALSE

/atom/movable/CtrlClick(var/mob/living/user)
return try_make_grab(user, defer_hand = TRUE) || ..()
if(!(. = ..()) && loc != user)
return try_make_grab(user, defer_hand = TRUE) || ..()

/*
Alt click
Expand All @@ -295,7 +302,7 @@
A.AltClick(src)

/atom/proc/AltClick(var/mob/user)
if(try_handle_interactions(user, get_alt_interactions(user), user?.get_active_held_item()))
if(try_handle_interactions(user, get_alt_interactions(user), user?.get_active_held_item(), check_alt_interactions = TRUE))
return TRUE
if(user?.get_preference_value(/datum/client_preference/show_turf_contents) == PREF_ALT_CLICK)
. = show_atom_list_for_turf(user, get_turf(src))
Expand Down
22 changes: 11 additions & 11 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
#define ui_entire_screen "WEST,SOUTH to EAST,NORTH"
#define ui_center_fullscreen "CENTER-7,CENTER-7"

//Lower left, persistant menu
//Lower left, persistent menu
#define ui_inventory "LEFT:6,BOTTOM:5"

//Lower center, persistant menu
//Lower center, persistent menu
#define ui_sstore1 "LEFT+2:10,BOTTOM:5"
#define ui_id "LEFT+3:12,BOTTOM:5"
#define ui_belt "LEFT+4:14,BOTTOM:5"
#define ui_back "CENTER-2:14,BOTTOM:5"
#define ui_back "LEFT+3:22,BOTTOM:5"
#define ui_id "LEFT+4:26,BOTTOM:5"
#define ui_belt "RIGHT-5:16,BOTTOM:5"
#define ui_rhand "CENTER-1:16,BOTTOM:5"
#define ui_lhand "CENTER:16,BOTTOM:5"
#define ui_equip "CENTER-1:16,BOTTOM+1:5"
#define ui_swaphand1 "CENTER-1:16,BOTTOM+1:5"
#define ui_swaphand2 "CENTER:16,BOTTOM+1:5"
#define ui_storage1 "CENTER+1:16,BOTTOM:5"
#define ui_storage2 "CENTER+2:16,BOTTOM:5"
#define ui_storage1 "RIGHT-3:16,BOTTOM:5"
#define ui_storage2 "RIGHT-4:16,BOTTOM:5"

#define ui_alien_head "CENTER-3:12,BOTTOM:5" //aliens
#define ui_alien_oclothing "CENTER-2:14,BOTTOM:5"//aliens
Expand All @@ -48,13 +48,13 @@
#define ui_construct_fire "RIGHT-1:16,CENTER+1:13" //above health, slightly to the left
#define ui_construct_pull "RIGHT-1:28,BOTTOM+1:10" //above the zone selector icon

//Lower right, persistant menu
//Lower right, persistent menu
#define ui_dropbutton "RIGHT-4:22,BOTTOM:5"
#define ui_drop_throw "RIGHT-1:28,BOTTOM+1:7"
#define ui_pull_resist "RIGHT-2:26,BOTTOM+1:7"
#define ui_acti "RIGHT-2:26,BOTTOM:5"
#define ui_movi "RIGHT-3:24,BOTTOM:5"
#define ui_attack_selector "RIGHT-3:24,BOTTOM+1:6"
#define ui_acti "CENTER,BOTTOM:5"
#define ui_movi "RIGHT-2:24,BOTTOM:5"
#define ui_attack_selector "RIGHT-2:27,BOTTOM+2:9"
#define ui_zonesel "RIGHT-1:28,BOTTOM:5"
#define ui_acti_alt "RIGHT-1:28,BOTTOM:5" //alternative intent switcher for when the interface is hidden
#define ui_stamina "RIGHT-3:24,BOTTOM+1:5"
Expand Down
39 changes: 20 additions & 19 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
hud_used = initial(hud_used)
if(ispath(hud_used))
hud_used = new hud_used(src)
if(istype(hud_used))
hud_used.refresh_hud_icons()
refresh_lighting_master()

/datum/hud
Expand All @@ -22,7 +24,7 @@
var/inventory_shown = TRUE //the inventory
var/hotkey_ui_hidden = FALSE //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)

var/default_ui_style = /decl/ui_style/midnight
var/default_ui_style = DEFAULT_UI_STYLE

var/list/alerts

Expand All @@ -45,6 +47,10 @@
instantiate()
..()

/datum/hud/proc/refresh_hud_icons()
for(var/obj/screen/elem in mymob?.client?.screen)
elem.queue_icon_update()

/datum/hud/Destroy()
. = ..()
stamina_bar = null
Expand All @@ -68,19 +74,19 @@
/datum/hud/proc/hide_inventory()
inventory_shown = FALSE
hidden_inventory_update()
persistant_inventory_update()
persistent_inventory_update()

/datum/hud/proc/show_inventory()
inventory_shown = TRUE
hidden_inventory_update()
persistant_inventory_update()
persistent_inventory_update()

/datum/hud/proc/hidden_inventory_update()
var/decl/species/species = mymob?.get_species()
if(istype(species?.species_hud))
refresh_inventory_slots(species.species_hud.hidden_slots, (inventory_shown && hud_shown))

/datum/hud/proc/persistant_inventory_update()
/datum/hud/proc/persistent_inventory_update()
var/decl/species/species = mymob?.get_species()
if(istype(species?.species_hud))
refresh_inventory_slots(species.species_hud.persistent_slots, hud_shown)
Expand Down Expand Up @@ -138,6 +144,9 @@
. = available_styles[1]

/datum/hud/proc/get_ui_color()
var/decl/ui_style/ui_style = get_ui_style_data()
if(!ui_style?.use_ui_color)
return COLOR_WHITE
return mymob?.client?.prefs?.UI_style_color || COLOR_WHITE

/datum/hud/proc/get_ui_alpha()
Expand Down Expand Up @@ -172,25 +181,17 @@
break

if(!inv_box)
inv_box = new /obj/screen/inventory(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_HANDS)
inv_box = new /obj/screen/inventory/hand(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_HANDS)
else
inv_box.set_ui_style(ui_style, UI_ICON_HANDS)
inv_box.color = ui_color
inv_box.alpha = ui_alpha

inv_box.SetName(hand_tag)
inv_box.icon_state = "hand_base"

inv_box.cut_overlays()
inv_box.add_overlay("hand_[inv_slot.hand_overlay || hand_tag]", TRUE)
if(inv_slot.ui_label)
inv_box.add_overlay("hand_[inv_slot.ui_label]", TRUE)
inv_box.update_icon()
LAZYDISTINCTADD(hand_hud_objects, inv_box)

inv_box.SetName(hand_tag)
inv_box.slot_id = hand_tag
inv_box.appearance_flags |= KEEP_TOGETHER

LAZYDISTINCTADD(hand_hud_objects, inv_box)
inv_box.update_icon()

// Clear held item boxes with no held slot.
for(var/obj/screen/inventory/inv_box in hand_hud_objects)
Expand All @@ -201,7 +202,7 @@
qdel(inv_box)

// Rebuild offsets for the hand elements.
var/hand_y_offset = 5
var/hand_y_offset = 21
var/list/elements = hand_hud_objects?.Copy()
while(length(elements))
var/copy_index = min(length(elements), 2)+1
Expand Down Expand Up @@ -363,7 +364,7 @@
client.screen += zone_sel //This one is a special snowflake

hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
hud_used.persistent_inventory_update()
update_action_buttons()

//Similar to minimize_hud() but keeps zone_sel, gun_setting_icon, and healths.
Expand Down Expand Up @@ -400,7 +401,7 @@
hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position

hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
hud_used.persistent_inventory_update()
update_action_buttons()

/client/proc/reset_click_catchers()
Expand Down
Loading

0 comments on commit 7e69a56

Please sign in to comment.