Adds Button Icons and improved bag of crafting controller detection
This commit is contained in:
1 parent
a4f6098704
commit
bd8b9d18c3
6 files changed
+57
-6
No files matched your search
@@ -670,6 +670,6 @@ EID.descriptions["en_us"].horsepills={
|
||||
EID.descriptions["en_us"].CraftingBagContent = "Bag:"
|
||||
EID.descriptions["en_us"].CraftingRoomContent = "Room:"
|
||||
EID.descriptions["en_us"].CraftingFloorContent = "Floor:"
|
||||
EID.descriptions["en_us"].CraftingResults = "Results:#(Scroll: Hold TAB + Shoot △/▽)"
|
||||
EID.descriptions["en_us"].CraftingResults = "Results:#(Scroll: hold {{ButtonSelect}} + {{ButtonY}} {{ButtonA}})"
|
||||
EID.descriptions["en_us"].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{ColorRed}}This feature currently does not support games with modded items installed"
|
||||
|
||||
+1
-1
@@ -598,7 +598,7 @@ function EID:renderInlineIcons(spriteTable, posX, posY)
|
||||
for _, sprite in ipairs(spriteTable) do
|
||||
local Xoffset = sprite[1][5] or -1
|
||||
local Yoffset = sprite[1][6] or 0
|
||||
local spriteObj = sprite[1][7] or EID.InlineIconSprite
|
||||
local spriteObj = (type(sprite[1][7]) == "function" and sprite[1][7]()) or sprite[1][7] or EID.InlineIconSprite
|
||||
if sprite[1][2] >=0 then
|
||||
spriteObj:SetFrame(sprite[1][1], sprite[1][2])
|
||||
elseif not spriteObj:IsPlaying(sprite[1][1]) or spriteObj:IsFinished(sprite[1][1]) then
|
||||
|
||||
@@ -486,7 +486,7 @@ local function shiftBagContent()
|
||||
end
|
||||
|
||||
local function detectBagContentShift()
|
||||
if Input.IsActionTriggered(ButtonAction.ACTION_DROP, 0) or Input.IsActionTriggered(ButtonAction.ACTION_DROP, 1) then
|
||||
if Input.IsActionTriggered(ButtonAction.ACTION_DROP, EID.player.ControllerIndex) then
|
||||
shiftBagContent()
|
||||
end
|
||||
end
|
||||
@@ -671,9 +671,9 @@ function EID:handleBagOfCraftingRendering()
|
||||
EID:appendToDescription(customDescObj, resultDesc)
|
||||
|
||||
if Input.IsActionPressed(ButtonAction.ACTION_MAP, 0) or Input.IsActionPressed(ButtonAction.ACTION_MAP, 1) then
|
||||
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, 0) or Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, 1) then
|
||||
if Input.IsActionTriggered(ButtonAction.ACTION_SHOOTDOWN, EID.player.ControllerIndex) then
|
||||
EID.bagOfCraftingOffset = math.min(#results-(#results%EID.Config["BagOfCraftingResults"]), EID.bagOfCraftingOffset + EID.Config["BagOfCraftingResults"])
|
||||
elseif Input.IsActionTriggered(ButtonAction.ACTION_SHOOTUP, 0) or Input.IsActionTriggered(ButtonAction.ACTION_SHOOTUP, 1) then
|
||||
elseif Input.IsActionTriggered(ButtonAction.ACTION_SHOOTUP, EID.player.ControllerIndex) then
|
||||
EID.bagOfCraftingOffset = math.max(0, EID.bagOfCraftingOffset - EID.Config["BagOfCraftingResults"])
|
||||
end
|
||||
toggleControls(false)
|
||||
|
||||
@@ -88,6 +88,11 @@ EID.TextReplacementPairs = {
|
||||
{"{{CR}}", "{{ColorReset}}"}, -- Shortcut for Color Resetting
|
||||
{"{{EthernalHeart}}", "{{EternalHeart}}"} -- fix spelling error
|
||||
}
|
||||
local controllerSprites = Sprite()
|
||||
controllerSprites:Load("gfx/ui/buttons.anm2", true)
|
||||
local function getControllerSprite()
|
||||
return (EID.player.ControllerIndex > 0 and controllerSprites) or EID.InlineIconSprite
|
||||
end
|
||||
|
||||
--Format: [SHORTCUT]= {Animationname, Frame, Width, Height, LeftOffset [Default: -1], TopOffset [Default: 0], SpriteObject [Default: EID.InlineIconSprite]}
|
||||
EID.InlineIcons = {
|
||||
@@ -210,6 +215,24 @@ EID.InlineIcons = {
|
||||
["Quality2"] = {"Quality", 2, 10, 10, 0, 0},
|
||||
["Quality3"] = {"Quality", 3, 10, 10, 0, 0},
|
||||
["Quality4"] = {"Quality", 4, 10, 10, 0, 0},
|
||||
-- Controller Button Icons (XBox based)
|
||||
["ButtonY"] = {"XboxOne", 0, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonA"] = {"XboxOne", 1, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonB"] = {"XboxOne", 2, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonX"] = {"XboxOne", 3, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonDDown"] = {"XboxOne", 4, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonDUp"] = {"XboxOne", 5, 8, 9, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonDRight"] = {"XboxOne", 6, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonDLeft"] = {"XboxOne", 7, 9, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonLStick"] = {"XboxOne", 8, 8, 8, 3, 4, controllerSprites},
|
||||
["ButtonRStick"] = {"XboxOne", 9, 8, 8, 3, 4, controllerSprites},
|
||||
["ButtonLB"] = {"XboxOne", 10, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonRB"] = {"XboxOne", 11, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonLT"] = {"XboxOne", 12, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonRT"] = {"XboxOne", 13, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonSelect"] = {"XboxOne", 14, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
["ButtonMenu"] = {"XboxOne", 15, 8, 8, 3, 4, function(_) return getControllerSprite() end},
|
||||
|
||||
-- Crafting
|
||||
|
||||
["Crafting0"] = {"Crafting", 0, 14, 16, -2, -3},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<AnimatedActor>
|
||||
<Info CreatedBy="Unknown" CreatedOn="29.05.2021 02:39:39" Version="60" Fps="30"/>
|
||||
<Info CreatedBy="Unknown" CreatedOn="20.07.2021 21:09:32" Version="68" Fps="30"/>
|
||||
<Content>
|
||||
<Spritesheets>
|
||||
<Spritesheet Path="eid_inline_icons.png" Id="0"/>
|
||||
@@ -330,5 +330,33 @@
|
||||
<NullAnimations/>
|
||||
<Triggers/>
|
||||
</Animation>
|
||||
<Animation Name="XboxOne" FrameNum="30" Loop="false">
|
||||
<RootAnimation>
|
||||
<Frame XPosition="0" YPosition="0" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
</RootAnimation>
|
||||
<LayerAnimations>
|
||||
<LayerAnimation LayerId="0" Visible="true">
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="26" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="39" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="52" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="65" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="39" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="26" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="52" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="65" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="115" YCrop="7" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="118" YCrop="9" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="78" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="91" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="104" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="117" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="7" YPivot="6" XCrop="0" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
<Frame XPosition="0" YPosition="0" XPivot="6" YPivot="6" XCrop="13" YCrop="99" Width="13" Height="13" XScale="100" YScale="100" Delay="1" Visible="true" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
|
||||
</LayerAnimation>
|
||||
<LayerAnimation LayerId="1" Visible="true"/>
|
||||
</LayerAnimations>
|
||||
<NullAnimations/>
|
||||
<Triggers/>
|
||||
</Animation>
|
||||
</Animations>
|
||||
</AnimatedActor>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
Reference in new issue
Block a user