Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/images/game/imbuing/basic-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/blocked-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/blocked-panels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/imbue-scroll-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/imbuement-icons-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/imbui-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/imbui-timer-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/intricate-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/pick-item-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/imbuing/powerfull-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/images/game/imbuing/slot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/game/prey/balanceBg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/infoPanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/item66.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/right-arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/t2pixel-up-frame-borderimage_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/styles/10-buttons.otui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Button < UIButton
font: cipsoftFont
font: verdana-11px-antialised
color: #dfdfdfff
size: 43 20
text-offset: 0 2
Expand Down Expand Up @@ -211,7 +211,7 @@ NextQtButton < UIButton
image-clip: 48 16 16 16

QtButton < UIButton
font: cipsoftFont
font: verdana-11px-antialised
size: 106 23
text-offset: 0 0
image-source: /images/ui/button
Expand Down
2 changes: 1 addition & 1 deletion data/styles/10-progressbars.otui
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ InvVerticalBar < UIVerticalProgressBarSDInverted

VerticalBar < UIVerticalProgressBarSD
size: 10 30
image-border: 1
image-border: 1
4 changes: 2 additions & 2 deletions modules/corelib/ui/uiprogressbarsd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function UIProgressBarSD.create()
local progressbar = UIProgressBarSD.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.min = 0
progressbar.max = 100
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
Expand Down
4 changes: 2 additions & 2 deletions modules/corelib/ui/uiprogressbarsdinverted.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function UIProgressBarSDInverted.create()
local progressbar = UIProgressBarSDInverted.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.min = 0
progressbar.max = 100
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
Expand Down
111 changes: 111 additions & 0 deletions modules/corelib/uiprogressbarsd.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
-- @docclass
UIProgressBarSD = extends(UIWidget, "UIProgressBarSD")

function UIProgressBarSD.create()
local progressbar = UIProgressBarSD.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
progressbar:insertLuaCall("onGeometryChange")
Comment on lines +4 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Initialize minimum/maximum instead of min/max to avoid nil clamps.
setValue clamps via self.minimum/self.maximum; with current init those are nil until setters run.

🐛 Proposed fix
-  progressbar.min = 0
-  progressbar.max = 100
+  progressbar.minimum = 0
+  progressbar.maximum = 100
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function UIProgressBarSD.create()
local progressbar = UIProgressBarSD.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.min = 0
progressbar.max = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
progressbar:insertLuaCall("onGeometryChange")
function UIProgressBarSD.create()
local progressbar = UIProgressBarSD.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
progressbar:insertLuaCall("onGeometryChange")
🤖 Prompt for AI Agents
In `@modules/corelib/uiprogressbarsd.lua` around lines 4 - 16, In
UIProgressBarSD.create(), the progress bar initializes
progressbar.min/progressbar.max which leaves self.minimum/self.maximum nil (used
by setValue); change the initialization to set progressbar.minimum = 0 and
progressbar.maximum = 100 (keep progressbar.value = 0 and the other setup calls
as-is) so clamps in setValue work correctly.

return progressbar
end

function UIProgressBarSD:setMinimum(minimum)
self.minimum = minimum
if self.value < minimum then
self:setValue(minimum)
end
end

function UIProgressBarSD:setMaximum(maximum)
self.maximum = maximum
if self.value > maximum then
self:setValue(maximum)
end
end

function UIProgressBarSD:setValue(value, minimum, maximum)
if minimum then
self:setMinimum(minimum)
end

if maximum then
self:setMaximum(maximum)
end

self.value = math.max(math.min(value, self.maximum), self.minimum)
self:updateBackground()
end

function UIProgressBarSD:setPercent(percent)
self:setValue(percent, 0, 100)
end

function UIProgressBarSD:getPercent()
return self.value
end

function UIProgressBarSD:getPercentPixels()
return (self.maximum - self.minimum) / self:getWidth()
end

function UIProgressBarSD:getProgress()
if self.minimum == self.maximum then return 1 end
return (self.value - self.minimum) / (self.maximum - self.minimum)
end

function UIProgressBarSD:updateBackground()
if self:isOn() then
local width = math.round(math.max((self:getProgress() * (self:getWidth() - self.bgBorderLeft - self.bgBorderRight)), 1))
local height = self:getHeight() - self.bgBorderTop - self.bgBorderBottom
local rect = { x = self.bgBorderLeft, y = self.bgBorderTop, width = width, height = height }
self:setImageRect(rect)

if width == 1 then
self:setImageVisible(false)
else
self:setImageVisible(true)
end
end
end

function UIProgressBarSD:onSetup()
self:updateBackground()
end

function UIProgressBarSD:onStyleApply(name, node)
for name,value in pairs(node) do
if name == 'background-border-left' then
self.bgBorderLeft = tonumber(value)
elseif name == 'background-border-right' then
self.bgBorderRight = tonumber(value)
elseif name == 'background-border-top' then
self.bgBorderTop = tonumber(value)
elseif name == 'background-border-bottom' then
self.bgBorderBottom = tonumber(value)
elseif name == 'background-border' then
self.bgBorderLeft = tonumber(value)
self.bgBorderRight = tonumber(value)
self.bgBorderTop = tonumber(value)
self.bgBorderBottom = tonumber(value)
elseif name == 'percent' then
self.percent = self:setPercent(tonumber(value))
elseif name == 'tooltip-delayed' then
self.tooltipDelayed = value
end
end
end

function UIProgressBarSD:onGeometryChange(oldRect, newRect)
if not self:isOn() then
self:setHeight(0)
end
self:updateBackground()
end
110 changes: 110 additions & 0 deletions modules/corelib/uiprogressbarsdinverted.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
-- @docclass
UIProgressBarSDInverted = extends(UIWidget, "UIProgressBarSDInverted")

function UIProgressBarSDInverted.create()
local progressbar = UIProgressBarSDInverted.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
Comment on lines +4 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Initialize minimum/maximum instead of min/max to avoid nil clamps.
setValue clamps via self.minimum/self.maximum; with current init those are nil until setters run.

🐛 Proposed fix
-  progressbar.min = 0
-  progressbar.max = 100
+  progressbar.minimum = 0
+  progressbar.maximum = 100
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function UIProgressBarSDInverted.create()
local progressbar = UIProgressBarSDInverted.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.min = 0
progressbar.max = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
function UIProgressBarSDInverted.create()
local progressbar = UIProgressBarSDInverted.internalCreate()
progressbar:setFocusable(false)
progressbar:setOn(true)
progressbar.minimum = 0
progressbar.maximum = 100
progressbar.value = 0
progressbar.bgBorderLeft = 0
progressbar.bgBorderRight = 0
progressbar.bgBorderTop = 0
progressbar.bgBorderBottom = 0
progressbar:insertLuaCall("onSetup")
🤖 Prompt for AI Agents
In `@modules/corelib/uiprogressbarsdinverted.lua` around lines 4 - 15, The create
function sets progressbar.min/progressbar.max which leaves
progressbar.minimum/progressbar.maximum nil and causes setValue (which clamps
against self.minimum/self.maximum) to fail; change
UIProgressBarSDInverted.create to initialize progressbar.minimum and
progressbar.maximum (and set progressbar.value after them) instead of
progressbar.min/progressbar.max so setValue/clamping works correctly, leaving
other initializations (bgBorder*, setFocusable, setOn, insertLuaCall("onSetup"))
unchanged.

progressbar:insertLuaCall("onGeometryChange")
return progressbar
end

function UIProgressBarSDInverted:setMinimum(minimum)
self.minimum = minimum
if self.value < minimum then
self:setValue(minimum)
end
end

function UIProgressBarSDInverted:setMaximum(maximum)
self.maximum = maximum
if self.value > maximum then
self:setValue(maximum)
end
end

function UIProgressBarSDInverted:setValue(value, minimum, maximum)
if minimum then
self:setMinimum(minimum)
end

if maximum then
self:setMaximum(maximum)
end

self.value = math.max(math.min(value, self.maximum), self.minimum)
self:updateBackground()
end

function UIProgressBarSDInverted:setPercent(percent)
self:setValue(percent, 0, 100)
end

function UIProgressBarSDInverted:getPercent()
return self.value
end

function UIProgressBarSDInverted:getPercentPixels()
return (self.maximum - self.minimum) / self:getWidth()
end

function UIProgressBarSDInverted:getProgress()
if self.minimum == self.maximum then return 1 end
return (self.value - self.minimum) / (self.maximum - self.minimum)
end

function UIProgressBarSDInverted:updateBackground()
if self:isOn() then
local width = math.round(math.max((self:getProgress() * (self:getWidth() - self.bgBorderLeft - self.bgBorderRight)), 1))
local height = self:getHeight() - self.bgBorderTop - self.bgBorderBottom
local rect = { x = self:getWidth() - (self:getProgress() * self:getWidth()), y = self.bgBorderTop, width = width, height = height }
if width == 1 then
rect.x = rect.x - 1
end
self:setImageRect(rect)

if width == 1 then
self:setImageVisible(false)
else
self:setImageVisible(true)
end
end
end

function UIProgressBarSDInverted:onSetup()
self:updateBackground()
end

function UIProgressBarSDInverted:onStyleApply(name, node)
for name,value in pairs(node) do
if name == 'background-border-left' then
self.bgBorderLeft = tonumber(value)
elseif name == 'background-border-right' then
self.bgBorderRight = tonumber(value)
elseif name == 'background-border-top' then
self.bgBorderTop = tonumber(value)
elseif name == 'background-border-bottom' then
self.bgBorderBottom = tonumber(value)
elseif name == 'background-border' then
self.bgBorderLeft = tonumber(value)
self.bgBorderRight = tonumber(value)
self.bgBorderTop = tonumber(value)
self.bgBorderBottom = tonumber(value)
end
end
end

function UIProgressBarSDInverted:onGeometryChange(oldRect, newRect)
if not self:isOn() then
self:setHeight(0)
end
self:updateBackground()
end
Loading
Loading