Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMarmite committed May 5, 2024
2 parents 15fe176 + 274ff7b commit 067273b
Show file tree
Hide file tree
Showing 47 changed files with 1,306 additions and 606 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/build_milla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build MILLA
on:
issue_comment:
types: created

jobs:
build-milla:
if: |
github.event.issue.pull_request &&
(github.event.comment.body == '!build_milla') &&
((github.event.sender.id == github.event.issue.user.id) ||
(github.event.comment.author_association == 'COLLABORATOR') ||
(github.event.comment.author_association == 'MEMBER') ||
(github.event.comment.author_association == 'OWNER'))
runs-on: ubuntu-latest
steps:
- name: Like the comment
env:
BASE_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$BASE_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \
-f content='+1'
- name: PR Data
run: |
pr_json=$(curl -L -s --fail-with-body -H "Authorization: token ${{ github.token }}" ${{ github.event.issue.pull_request.url }})
if [ `jq -r '.maintainer_can_modify' <<<$pr_json` == "false" ] ; then
gh pr comment ${{ github.event.issue.html_url }} --body 'GitHub Actions can not push to the repository without "Allow edits and access to secrets by maintainers" checked.'
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
echo "PR_REPO=`jq -r '.head.repo.full_name' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_BRANCH=`jq -r '.head.ref' <<<$pr_json`" >> $GITHUB_ENV
echo "PR_HEAD_LABEL=`jq -r '.head.label' <<<$pr_json`" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ${{ env.PR_REPO }}
ref: ${{ env.PR_BRANCH }}
token: ${{ github.token }}

- name: Build MILLA
env:
BASE_BRANCH: ${{ github.event.repository.default_branch }}
BASE_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
# Get the code.
git config user.name paradisess13[bot]
git config user.email "165046124+paradisess13[bot]@users.noreply.github.com"
git pull origin "$PR_BRANCH" --depth=$((ahead_by + 1))
git remote add upstream "https://github.com/$BASE_REPOSITORY.git"
git fetch upstream "$BASE_BRANCH" --depth=$((behind_by + 1))
cd milla
# Get dependencies.
rustup target add i686-unknown-linux-gnu
rustup target add i686-pc-windows-gnu
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install zlib1g-dev:i386 lib32gcc-11-dev mingw-w64 mingw-w64-i686-dev
# Build it.
cargo build --release --target i686-unknown-linux-gnu
cargo build --release --target i686-pc-windows-gnu
# Copy the built targets to their checked-in locations.
cp target/i686-unknown-linux-gnu/release/libmilla.so ../tools/ci/libmilla_ci.so
cp target/i686-pc-windows-gnu/release/milla.dll ../milla.dll
# Check if a workflow file would be modified by the merge (permissions prevent pushes if so)
latest_workflow_commit=$(git log -n 1 --pretty=format:"%H" upstream/$BASE_BRANCH -- .github/workflows)
if ! git branch --contains $latest_workflow_commit | grep -q "$(git rev-parse --abbrev-ref HEAD)"; then
gh pr comment ${{ github.event.issue.html_url }} --body "GitHub Actions can not push to this branch as workflow files have been changed since your branch was last updated. Please update your branch past https://github.com/$BASE_REPOSITORY/commit/$latest_workflow_commit before using this command again."
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV"
exit 1
fi
git commit -a -m "Build MILLA" --allow-empty
git push origin
- name: Notify Failure
if: failure() && env.FAIL_NOTIFIED != 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment ${{ github.event.issue.html_url }} -b 'Building MILLA failed, see the action run log for details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
8 changes: 8 additions & 0 deletions .github/workflows/merge_upstream_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ jobs:
git merge FETCH_HEAD
git push origin
- name: Rebuild TGUI
if: |
git diff-tree --name-only -r $(git rev-parse HEAD~2) | grep "tgui/public/"
run: |
bash tgui/bin/tgui
git commit -m "Rebuild TGUI"
git push origin
- name: Notify Failure
if: failure() && env.FAIL_NOTIFIED != 'true'
run: |
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/hud_locations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@
#define HUD_STYLE_STANDARD 1
#define HUD_STYLE_REDUCED 2
#define HUD_STYLE_NOHUD 3
#define HUD_STYLE_ACTIONHUD 4


#define HUD_VERSIONS 3 //used in show_hud()
#define HUD_VERSIONS 4 //used in show_hud()
//1 = standard hud
//2 = reduced hud (just hands and intent switcher)
//3 = no hud (for screenshots)
//4 = Only action buttons (so vampires / changelings and such can use abilities while asleep)
111 changes: 73 additions & 38 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
/mob/proc/overlay_fullscreen(category, type, severity)
/mob/proc/overlay_fullscreen(category, type, severity, animated = 0)
var/atom/movable/screen/fullscreen/screen = screens[category]
var/is_centered = istype(screen, /atom/movable/screen/fullscreen/center)

if(!screen || screen.type != type)
// needs to be recreated
clear_fullscreen(category, FALSE)
screens[category] = screen = new type()
else if((!severity || severity == screen.severity) && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view))
else if((!severity || severity == screen.severity) && (!is_centered && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view)))
// doesn't need to be updated
return screen

screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
if(client && screen.should_show_to(src))
screen.update_for_view(client.view)
if(animated)
INVOKE_ASYNC(src, PROC_REF(apply_screen_animation), animated, screen)
if(!is_centered)
screen.update_for_view(client.view)
client.screen += screen

return screen

/mob/proc/apply_screen_animation(animated = 0, atom/movable/screen/fullscreen/screen)
screen.alpha = 0
animate(screen, alpha = 255, time = animated)

/mob/proc/clear_fullscreen(category, animated = 10)
var/atom/movable/screen/fullscreen/screen = screens[category]
if(!screen)
Expand All @@ -30,10 +39,11 @@
if(client)
client.screen -= screen
qdel(screen)
else
if(client)
client.screen -= screen
qdel(screen)
return

if(client)
client.screen -= screen
qdel(screen)

/mob/proc/clear_fullscreens()
for(var/category in screens)
Expand All @@ -46,28 +56,21 @@
for(var/category in screens)
screen = screens[category]
if(screen.should_show_to(mymob))
screen.update_for_view(mymob.client.view)
mymob.client.screen |= screen
else
mymob.client.screen -= screen
continue
mymob.client.screen -= screen

/atom/movable/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
var/view
layer = FULLSCREEN_LAYER
plane = FULLSCREEN_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/view = 7
var/severity = 0
var/show_when_dead = FALSE

/atom/movable/screen/fullscreen/proc/update_for_view(client_view)
if(screen_loc == "CENTER-7,CENTER-7" && view != client_view)
var/list/actualview = getviewsize(client_view)
view = client_view
transform = matrix(actualview[1]/FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2]/FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)

/atom/movable/screen/fullscreen/proc/should_show_to(mob/mymob)
if(!show_when_dead && mymob.stat == DEAD)
return FALSE
Expand All @@ -77,51 +80,62 @@
severity = 0
return ..()

/atom/movable/screen/fullscreen/brute
/// Stretch version is suitable for images that stick to screen edges, as they scale with user screen size
/// For centrally located screen objects, use /atom/movable/screen/fullscreen/center
/atom/movable/screen/fullscreen/stretch
view = 7

/atom/movable/screen/fullscreen/proc/update_for_view(client_view)
if(screen_loc == "CENTER-7,CENTER-7" && view != client_view)
var/list/actualview = getviewsize(client_view)
view = client_view
transform = matrix(actualview[1]/FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2]/FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)

/atom/movable/screen/fullscreen/stretch/brute
icon_state = "brutedamageoverlay"
layer = UI_DAMAGE_LAYER

/atom/movable/screen/fullscreen/oxy
/atom/movable/screen/fullscreen/stretch/oxy
icon_state = "oxydamageoverlay"
layer = UI_DAMAGE_LAYER

/atom/movable/screen/fullscreen/crit
/atom/movable/screen/fullscreen/stretch/crit
icon_state = "passage"
layer = CRIT_LAYER

/atom/movable/screen/fullscreen/blind
/atom/movable/screen/fullscreen/stretch/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER

/atom/movable/screen/fullscreen/impaired
/atom/movable/screen/fullscreen/stretch/impaired
icon_state = "impairedoverlay"

/atom/movable/screen/fullscreen/payback
/atom/movable/screen/fullscreen/stretch/payback
icon = 'icons/mob/screen_payback.dmi'
icon_state = "payback"
show_when_dead = TRUE

/atom/movable/screen/fullscreen/fog
/atom/movable/screen/fullscreen/stretch/fog
icon = 'icons/mob/screen_fog.dmi'
icon_state = "fog"
color = "#FF0000"

/atom/movable/screen/fullscreen/flash
/atom/movable/screen/fullscreen/stretch/flash
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"

/atom/movable/screen/fullscreen/flash/noise
/atom/movable/screen/fullscreen/stretch/flash/noise
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"

/atom/movable/screen/fullscreen/high
/atom/movable/screen/fullscreen/stretch/high
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"

/atom/movable/screen/fullscreen/lighting_backdrop
/atom/movable/screen/fullscreen/stretch/lighting_backdrop
icon = 'icons/mob/screen_gen.dmi'
icon_state = "flash"
transform = matrix(200, 0, 0, 0, 200, 0)
Expand All @@ -130,26 +144,26 @@
show_when_dead = TRUE

//Provides darkness to the back of the lighting plane
/atom/movable/screen/fullscreen/lighting_backdrop/lit
/atom/movable/screen/fullscreen/stretch/lighting_backdrop/lit
invisibility = INVISIBILITY_LIGHTING
layer = BACKGROUND_LAYER+21
color = "#000"
show_when_dead = TRUE

//Provides whiteness in case you don't see lights so everything is still visible
/atom/movable/screen/fullscreen/lighting_backdrop/unlit
/atom/movable/screen/fullscreen/stretch/lighting_backdrop/unlit
layer = BACKGROUND_LAYER+20
show_when_dead = TRUE

/atom/movable/screen/fullscreen/see_through_darkness
/atom/movable/screen/fullscreen/stretch/see_through_darkness
icon_state = "nightvision"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
blend_mode = BLEND_ADD
show_when_dead = TRUE

/// An effect which tracks the cursor's location on the screen
/atom/movable/screen/fullscreen/cursor_catcher
/atom/movable/screen/fullscreen/stretch/cursor_catcher
icon_state = "fullscreen_blocker" // Fullscreen semi transparent icon
plane = HUD_PLANE
mouse_opacity = MOUSE_OPACITY_ICON
Expand All @@ -167,14 +181,14 @@
var/mouse_params

/// Links this up with a mob
/atom/movable/screen/fullscreen/cursor_catcher/proc/assign_to_mob(mob/owner)
/atom/movable/screen/fullscreen/stretch/cursor_catcher/proc/assign_to_mob(mob/owner)
src.owner = owner
view_list = getviewsize(owner.client.view)
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))
calculate_params()

/// Update when the mob we're assigned to has moved
/atom/movable/screen/fullscreen/cursor_catcher/proc/on_move(atom/source, atom/oldloc, dir, forced)
/atom/movable/screen/fullscreen/stretch/cursor_catcher/proc/on_move(atom/source, atom/oldloc, dir, forced)
SIGNAL_HANDLER

if(!given_turf)
Expand All @@ -183,19 +197,18 @@
var/y_offset = source.loc.y - oldloc.y
given_turf = locate(given_turf.x + x_offset, given_turf.y + y_offset, given_turf.z)


/atom/movable/screen/fullscreen/cursor_catcher/MouseEntered(location, control, params)
/atom/movable/screen/fullscreen/stretch/cursor_catcher/MouseEntered(location, control, params)
. = ..()
MouseMove(location, control, params)
if(usr == owner)
calculate_params()

/atom/movable/screen/fullscreen/cursor_catcher/MouseMove(location, control, params)
/atom/movable/screen/fullscreen/stretch/cursor_catcher/MouseMove(location, control, params)
if(usr != owner)
return
mouse_params = params

/atom/movable/screen/fullscreen/cursor_catcher/proc/calculate_params()
/atom/movable/screen/fullscreen/stretch/cursor_catcher/proc/calculate_params()
var/list/modifiers = params2list(mouse_params)
var/icon_x = text2num(LAZYACCESS(modifiers, "vis-x"))
if(isnull(icon_x))
Expand All @@ -209,6 +222,28 @@
given_x = round(icon_x - world.icon_size * our_x, 1)
given_y = round(icon_y - world.icon_size * our_y, 1)

/// Centered fullscreen atoms
/// These are used to center a widescreen image so it scales properly across screen sizes, not suitable for screen images that eminate from the edge of the screen
/atom/movable/screen/fullscreen/center
appearance_flags = TILE_BOUND

/atom/movable/screen/fullscreen/center/Initialize(mapload)
. = ..()
var/icon/I = new(icon)
var/x_offset = -((I.Width() - world.icon_size) / 2)
var/y_offset = -((I.Height() - world.icon_size) / 2)
qdel(I)
screen_loc = "CENTER:[x_offset],CENTER:[y_offset]"

/atom/movable/screen/fullscreen/center/blind/sleeping
icon = 'icons/mob/screen_sleeping.dmi'
icon_state = "sleepblind"
layer = BLIND_LAYER

/atom/movable/screen/fullscreen/center/blind/disky
icon = 'icons/mob/screen_tight.dmi'
icon_state = "disky"
layer = BLIND_LAYER

#undef FULLSCREEN_LAYER
#undef BLIND_LAYER
Expand Down
Loading

0 comments on commit 067273b

Please sign in to comment.