Skip to content

Commit

Permalink
v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bellyillish committed Dec 14, 2023
1 parent ed34918 commit 63783f2
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 61 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
run: |
mkdir -p "00 Dart Core (Required)/gamedata/configs/ui"
mkdir -p "00 Dart Core (Required)/gamedata/scripts"
mkdir -p "01 (HUD) BHS/gamedata/configs/unlocalizers"
mkdir -p "01 (HUD) BHS/gamedata/scripts"
mkdir -p "02 (HUD) Companion List/gamedata/scripts"
mkdir -p "03 (HUD) Faction ID Patches/gamedata/configs/unlocalizers"
Expand All @@ -40,6 +41,7 @@ jobs:
mv gamedata/scripts/dart_dxml.script "00 Dart Core (Required)/gamedata/scripts/"
mv gamedata/scripts/dart_module.script "00 Dart Core (Required)/gamedata/scripts/"
mv gamedata/scripts/dart_utils.script "00 Dart Core (Required)/gamedata/scripts/"
mv gamedata/configs/unlocalizers/unlocalizer_dart_bhs.ltx "01 (HUD) BHS/gamedata/configs/unlocalizers/"
mv gamedata/scripts/modxml_z_dart_bhs.script "01 (HUD) BHS/gamedata/scripts/"
mv gamedata/scripts/modxml_z_dart_companion_list.script "02 (HUD) Companion List/gamedata/scripts/"
mv gamedata/scripts/zzz_dart_companion_list.script "02 (HUD) Companion List/gamedata/scripts/"
Expand All @@ -58,7 +60,7 @@ jobs:
mv gamedata/scripts/modxml_z_dart_inventory.script "10 Inventory Icons/gamedata/scripts/"
mv gamedata/scripts/zzz_dart_inventory.script "10 Inventory Icons/gamedata/scripts/"
mv gamedata/shaders/r3/* "11 Mask Tweaks (from GIRTH)/gamedata/shaders/r3/"
rm -rf gamedata
rm -r gamedata
- name: Archive files
run: |
Expand All @@ -84,9 +86,8 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset: ./release.7z
asset_path: ./release.7z
asset_name: ${{ github.event.release.name }}.7z
asset_content_type: application/x-7z-compressed
overwrite: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions gamedata/configs/unlocalizers/unlocalizer_dart_bhs.ltx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[zzz_player_injuries]
display_width
display_height
display_ratio
init
2 changes: 1 addition & 1 deletion gamedata/scripts/dart_config.script
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dart.config.ammoWheel.scale = 1
Dart.config.bhs.scale = 1
Dart.config.companionList.scale = 1
Dart.config.companionWheel.scale = 1
Dart.config.inventory.scale = 0.85 -- scales icons
Dart.config.inventory.scale = 1 -- scales icons
Dart.config.minimap.scale = 1
Dart.config.messages.scale = 1
Dart.config.patches.scale = 1.25 -- scales patches
Expand Down
2 changes: 1 addition & 1 deletion gamedata/scripts/dart_core.script
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config = {

inventory = {
autoscale = false,
scale = 0.85,
scale = 1,
padScale = 1,
},

Expand Down
4 changes: 2 additions & 2 deletions gamedata/scripts/dart_module.script
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ local Utils = dart_utils
local DartDXML = dart_dxml


-- returns true if a DART module is disabled
-- check if a DART module is disabled (placeholder)
function isDisabled(mod)
return Utils.getAspectRatioVs(Dart.ratio16x9) <= 1
return false
end


Expand Down
2 changes: 1 addition & 1 deletion gamedata/scripts/dart_utils.script
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end


function getAspectRatioVs(otherRatio)
return math.max(getAspectRatio() / otherRatio - 0.01, 1)
return getAspectRatio() / otherRatio
end


Expand Down
72 changes: 24 additions & 48 deletions gamedata/scripts/modxml_z_dart_bhs.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local Dart = Dart_core
local DartDXML = dart_dxml
local Module = dart_module
local Utils = dart_module
local Dart = Dart_core
local Module = dart_module


local mod = "BHS"
Expand All @@ -26,11 +24,7 @@ function isBHSElement(DXML, element)
end

local name = DXML:getElementName(element)

return
(name:match("^bhs_") or name:match("^body_health_"))
and not name:match("_43$")
and not name:match("_1610$")
return name:match("^bhs_") or name:match("^body_health_")
end


Expand Down Expand Up @@ -64,15 +58,25 @@ function parseMaingame(DXML)
return
end

DXML:safeIterate(hudStates, function(child)
DXML:scaleElement(child, getScaleSettings())
end)
local psybar = DXML:query("progress_bar_psy", hudStates)[1]
local progress = DXML:query("progress", psybar)[1]

local psyProgress = DXML:query("progress_bar_psy > progress", hudStates)[1]
if psybar then
-- slight nudge for better alignment
DXML:safeSetAttrs(psybar, function(attrs)
return {height = attrs.height + 1, width = attrs.width - 1}
end)
end

if psyProgress then
DXML:safeSetAttrs(psyProgress, {stretch = 1})
if progress then
DXML:safeSetAttrs(progress, function(attrs)
return {stretch = 1}
end)
end

DXML:safeIterate(hudStates, function(child)
DXML:scaleElement(child, getScaleSettings())
end)
end


Expand All @@ -85,40 +89,12 @@ function parseSidHudComponent(DXML)
return
end

DXML:safeSetAttrs(radHealth, function(attrs)
-- transfer y value from sidhud to radHealth
if attrs.y then
attrs.y = attrs.y + (DXML:safeGetAttrs(sidhud).y or 0)
end

-- appearance tweaks to base GAMMA values
if attrs.x == "13" then
attrs.x = attrs.x + 1
end
if attrs.height == "2" then
attrs.height = attrs.height + 1
end
DXML:scaleElement(sidhud, getScaleSettings())

return attrs
end)

DXML:safeSetAttrs(sidhud, {y = 0})

DXML:safeSetAttrs(value, function(attrs)
attrs.x = 0

-- appearance tweaks to base GAMMA values
if attrs.width == "70" then
attrs.width = attrs.width + 1
end
if attrs.height == "2" then
attrs.height = attrs.height + 1
end

return attrs
end)

DXML:scaleElement(radHealth, getScaleSettings())
DXML:scaleElement(radHealth, {
scale = config.scale,
autoscale = config.autoscale,
})

DXML:scaleElement(value, {
scale = config.scale,
Expand Down
10 changes: 5 additions & 5 deletions gamedata/scripts/modxml_z_dart_markers.script
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ function adjustPDAMarker(DXML, element)
local heightChange = attrs.height

-- factor aspect ratio
widthChange = widthChange * (factor - 1)
heightChange = widthChange * (factor - 1)
widthChange = widthChange * (factor - 1)
heightChange = heightChange * (factor - 1)

-- factor angle and scale down if not 90 degrees
widthChange = widthChange * (Utils.abcosd(angle) - 0.5 * (angle % 90) / 45)
heightChange = heightChange * (Utils.absind(angle) - 0.5 * (angle % 90) / 45)
widthChange = widthChange * (Utils.abcosd(angle) - 0.68 * (angle % 90) / 45)
heightChange = heightChange * (Utils.absind(angle) - 0.68 * (angle % 90) / 45)

DXML:safeSetAttrs(element, {
width = attrs.width + widthChange,
width = attrs.width + widthChange,
height = attrs.height + heightChange,
stretch = 1,
})
Expand Down

0 comments on commit 63783f2

Please sign in to comment.