Skip to content

Commit

Permalink
Merge branch 'master' into NewKutjevo
Browse files Browse the repository at this point in the history
  • Loading branch information
Steelpoint committed May 12, 2024
2 parents 130becd + 45b4f2e commit 8b1f657
Show file tree
Hide file tree
Showing 350 changed files with 25,300 additions and 20,689 deletions.
158 changes: 88 additions & 70 deletions .github/add_labels.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import os, re
from github import Github
from github import Github, GithubException

# Format - Key: Array[Label, [StringsToIgnore]]
changelogToPrefix = {
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'fix': ["Fix", ["fixed a few things"]],
'qol': ["Quality of Life", ["made something easier to use"]],
'add': ["Feature", ["Added new mechanics or gameplay changes", "Added more things"]],
'del': ["Removal", ["Removed old things"]],
'spellcheck': ["Grammar and Formatting", ["fixed a few typos"]],
'balance': ["Balance", ["rebalanced something"]],
'code': ["Code Improvement", ["changed some code"]],
'refactor': ["Refactor", ["refactored some code"]],
'config': ["Config", ["changed some config setting"]],
'admin': ["Admin", ["messed with admin stuff"]],
'server': ["Server", ["something server ops should know"]],
'soundadd': ["Sound", ["added a new sound thingy"]],
'sounddel': ["Sound", ["removed an old sound thingy"]],
'imageadd': ["Sprites", ["added some icons and images"]],
Expand All @@ -24,78 +24,96 @@
}

fileToPrefix = {
'wav': 'Sound',
'ogg': 'Sound',
'wav': 'Sound',
'ogg': 'Sound',
'mp3': 'Sound', ## Can't believe they forgot about the best sound format
'dmm': 'Mapping',
'dmm': 'Mapping',

'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',
'js': 'UI',
'tsx': 'UI',
'ts': 'UI',
'jsx': 'UI',
'scss': 'UI',

'dmi': "Sprites",
'dmi': "Sprites",
}

githubLabel = "Github"
missingLogLabel = "Missing Changelog"

def get_labels(pr):
labels = {}

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
return labels
lines = changelog_match.group(1).split('\n')
for line in lines:
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix:
continue

if content in changelogToPrefix[key][1]:
continue

labels[changelogToPrefix[key][0]] = True

return list(labels)
labels = {}
failed = False

files = pr.get_files()
for file in files:
prefix = file.filename.split(".")[-1]
if file.filename.startswith(".github"):
labels[githubLabel] = True
if not prefix in fileToPrefix:
continue
labels[fileToPrefix[prefix]] = True

changelog_match = re.search(r"🆑(.*)/🆑", pr.body, re.S | re.M)
if changelog_match is None:
changelog_match = re.search(r":cl:(.*)/:cl:", pr.body, re.S | re.M)
if changelog_match is None:
print("::warning ::No changelog detected.")
labels[missingLogLabel] = True
return labels, False

lines = changelog_match.group(1).split('\n')
failed = len(lines) <= 2 # Make sure its not an empty changelog
if failed:
print("::error ::Empty changelog.")

for line in lines[1:-1]: # Skip first line with authors and last
line = line.strip()
if not line:
continue

contentSplit = line.split(":")

key = contentSplit.pop(0).strip()
content = ":".join(contentSplit).strip()

if not key in changelogToPrefix: # Some key that we didn't expect
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

if content in changelogToPrefix[key][1]: # They left the template entry in
print(f"::error ::Invalid changelog entry: {line}")
failed = True
continue

labels[changelogToPrefix[key][0]] = True

return list(labels), failed

def main():
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])
g = Github(os.environ["TOKEN"])
repo = g.get_repo(os.environ['REPO'])

pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("Not a PR.")
return
pr = repo.get_pull(int(os.environ["PR_NUMBER"]))
if not pr:
print("::warning ::Not a PR.")
return

labels = get_labels(pr)
labels, failed = get_labels(pr)

if labels is None: # no labels to add
print("No labels to add.")
return
if not missingLogLabel in labels:
try:
pr.remove_from_labels(missingLogLabel)
except GithubException as e:
if e.status == 404:
pass # 404 if we try to remove a label that isn't set

for label in labels:
pr.add_to_labels(label)
for label in labels:
pr.add_to_labels(label)

if failed:
exit(1)

if __name__ == '__main__':
main()
main()
8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Labeling
name: Labeling and Verification
on:
pull_request_target:
types: [opened]
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
Expand All @@ -13,7 +13,7 @@ jobs:
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "::set-output name=ACTIONS_ENABLED::$SECRET_EXISTS"
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Get The Script
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pygithub
sudo apt-get install dos2unix
- name: Add Labels
- name: Add and verify labels
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
python add_labels.py
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// High Command, can read the deletion log.
#define ARES_ACCESS_HIGH 9
#define ARES_ACCESS_WY_COMMAND 10
/// Debugging. Allows me to view everything without using a high command rank. Unlikely to stay in a full merge.
/// Debugging. Allows me to view everything without using a high command rank.
#define ARES_ACCESS_DEBUG 11

#define ARES_RECORD_ANNOUNCE "Announcement Record"
Expand Down Expand Up @@ -78,6 +78,7 @@
/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
#define COOLDOWN_ARES_VENT 60 SECONDS

/// Time until someone can respawn as Working Joe
#define JOE_JOIN_DEAD_TIME (15 MINUTES)
2 changes: 2 additions & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SEE_INVISIBLE_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.
#define INVISIBILITY_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.

#define HIDE_INVISIBLE_OBSERVER 59 // define for when we want to hide all observer mobs.

#define INVISIBILITY_OBSERVER 60
#define SEE_INVISIBLE_OBSERVER 60

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/_math.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define ROUND_UP(x) ( -round(-(x)))

// round() acts like floor(x, 1) by default but can't handle other values
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
#define FLOOR(x, y) ( floor((x) / (y)) * (y) )

// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
Expand Down
8 changes: 3 additions & 5 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
#define NOTE_ADMIN 1
///This note is used by staff for positive record keeping.
#define NOTE_MERIT 2
///These notes are used by respective whitelist councils for record keeping.
#define NOTE_COMMANDER 3
#define NOTE_SYNTHETIC 4
#define NOTE_YAUTJA 5
///These notes are automatically applied by the Whitelist Panel.
#define NOTE_WHITELIST 3
///Note categories in text form, in order of their numerical #defines.
GLOBAL_LIST_INIT(note_categories, list("Admin", "Merit", "Commanding Officer", "Synthetic", "Yautja"))
GLOBAL_LIST_INIT(note_categories, list("Admin", "Merit", "Whitelist"))

#define ADMIN_FLW(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];adminplayerobservefollow=[REF(user)]'>FLW</a>)"
#define ADMIN_PP(user) "(<a href='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];adminplayeropts=[REF(user)]'>PP</a>)"
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@

#define COMSIG_ITEM_PICKUP "item_pickup"

///from /obj/item/device/camera/broadcasting/attack_self
///from /obj/item/device/camera/broadcasting
#define COMSIG_BROADCAST_GO_LIVE "broadcast_live"
#define COMSIG_BROADCAST_HEAR_TALK "broadcast_hear_talk"
#define COMSIG_BROADCAST_SEE_EMOTE "broadcast_see_emote"

/// from /obj/item/proc/mob_can_equip
#define COMSIG_ITEM_ATTEMPTING_EQUIP "item_attempting_equip"
Expand Down
10 changes: 9 additions & 1 deletion code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@
#define COMSIG_TENT_COLLAPSING "tent_collapsing"

/// from /obj/proc/afterbuckle()
#define COSMIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle"
#define COMSIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle"

/// from /datum/cm_objective/retrieve_data/disk/process()
#define COMSIG_INTEL_DISK_LOST_POWER "intel_disk_lost_power"

/// from /datum/cm_objective/retrieve_data/disk/complete()
#define COMSIG_INTEL_DISK_COMPLETED "intel_disk_completed"

/// from /obj/vehicle/multitile/arc/toggle_antenna()
#define COMSIG_ARC_ANTENNA_TOGGLED "arc_antenna_toggled"
/// from /obj/structure/machinery/cryopod/go_out()
#define COMSIG_CRYOPOD_GO_OUT "cryopod_go_out"

Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@
/// From /proc/biohazard_lockdown()
#define COMSIG_GLOB_RESEARCH_LOCKDOWN "!research_lockdown_closed"
#define COMSIG_GLOB_RESEARCH_LIFT "!research_lockdown_opened"
/// From /proc/aicore_lockdown()
#define COMSIG_GLOB_AICORE_LOCKDOWN "!aicore_lockdown_closed"
#define COMSIG_GLOB_AICORE_LIFT "!aicore_lockdown_opened"

/// From /obj/structure/machinery/power/reactor/proc/set_overloading() : (set_overloading)
#define COMSIG_GLOB_GENERATOR_SET_OVERLOADING "!generator_set_overloading"

#define COMSIG_GLOB_HIJACK_IMPACTED "!hijack_impacted"
#define COMSIG_GLOB_HIJACK_LANDED "!hijack_landed"

/// From /datum/controller/subsystem/hijack/fire()
#define COMSIG_GLOB_FUEL_PUMP_UPDATE "!fuel_pump_update"
6 changes: 6 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#define USES_HEARING (1<<17)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define HTML_USE_INITAL_ICON (1<<18)
// Whether or not the object sees emotes
#define USES_SEEING (1<<19)

//==========================================================================================

Expand Down Expand Up @@ -82,6 +84,10 @@
#define ANIMATED_SURGICAL_TOOL (1<<12)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<13)
/// Overrides NODROP in some cases (stripping)
#define FORCEDROP_CONDITIONAL (1<<14)
/// Overrides smartgunner not being able to wear backpacks
#define SMARTGUNNER_BACKPACK_OVERRIDE (1<<15)
//==========================================================================================


Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ GLOBAL_LIST_INIT(job_command_roles, JOB_COMMAND_ROLES_LIST)

//-------- WY Goons --------//
#define JOB_WY_GOON "WY Corporate Security"
#define JOB_WY_GOON_TECH "WY Corporate Security Technician"
#define JOB_WY_GOON_LEAD "WY Corporate Security Lead"
#define JOB_WY_GOON_RESEARCHER "WY Research Consultant"

Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

//#define AREA_LAYER 1

#define DISPLACEMENT_PLATE_RENDER_LAYER 1
#define DISPLACEMENT_PLATE_RENDER_TARGET "*DISPLACEMENT_PLATE_RENDER_TARGET"

#define UNDER_TURF_LAYER 1.99

#define TURF_LAYER 2
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#define CANDAZE (1<<18)
#define CANSLOW (1<<19)
#define NO_PERMANENT_DAMAGE (1<<20)
#define CORRUPTED_ALLY (1<<21)

// =============================
// hive types
Expand Down
30 changes: 30 additions & 0 deletions code/__DEFINES/strippable.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// All of these must be matched in StripMenu.js.
#define STRIPPABLE_ITEM_HEAD "head"
#define STRIPPABLE_ITEM_BACK "back"
#define STRIPPABLE_ITEM_MASK "wear_mask"
#define STRIPPABLE_ITEM_EYES "glasses"
#define STRIPPABLE_ITEM_L_EAR "wear_l_ear"
#define STRIPPABLE_ITEM_R_EAR "wear_r_ear"
#define STRIPPABLE_ITEM_JUMPSUIT "w_uniform"
#define STRIPPABLE_ITEM_SUIT "wear_suit"
#define STRIPPABLE_ITEM_GLOVES "gloves"
#define STRIPPABLE_ITEM_FEET "shoes"
#define STRIPPABLE_ITEM_SUIT_STORAGE "j_store"
#define STRIPPABLE_ITEM_ID "id"
#define STRIPPABLE_ITEM_BELT "belt"
#define STRIPPABLE_ITEM_LPOCKET "l_store"
#define STRIPPABLE_ITEM_RPOCKET "r_store"
#define STRIPPABLE_ITEM_LHAND "l_hand"
#define STRIPPABLE_ITEM_RHAND "r_hand"
#define STRIPPABLE_ITEM_HANDCUFFS "handcuffs"
#define STRIPPABLE_ITEM_LEGCUFFS "legcuffs"


/// This slot is not obscured.
#define STRIPPABLE_OBSCURING_NONE 0

/// This slot is completely obscured, and cannot be accessed.
#define STRIPPABLE_OBSCURING_COMPLETELY 1

/// This slot can't be seen, but can be accessed.
#define STRIPPABLE_OBSCURING_HIDDEN 2
2 changes: 1 addition & 1 deletion code/__DEFINES/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define HDPT_TURRET "turret"
#define HDPT_SPECIAL "special" //special pre-installed hardpoints with unique behaviour

#define HDPT_LAYER_WHEELS 1
#define HDPT_LAYER_WHEELS 0.01 // so it appears below xenomorphs and other mobs
#define HDPT_LAYER_SUPPORT 2
#define HDPT_LAYER_ARMOR 3
#define HDPT_LAYER_TURRET 4
Expand Down
Loading

0 comments on commit 8b1f657

Please sign in to comment.