Update SpiffUI-Radials v8

This commit is contained in:
davidh
2022-07-17 20:10:33 -05:00
parent 06b9881ff5
commit 15c7f6d92b
73 changed files with 1794 additions and 337 deletions

View File

@@ -25,7 +25,7 @@
------------------------------------------
-- Set the SpiffUI lib version
local SPIFFUI_VERSION = 2 --<<< DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING
local SPIFFUI_VERSION = 3 --<<< DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING
if SpiffUI then
if SpiffUI.Version >= SPIFFUI_VERSION then
return -- Don't do anything else
@@ -147,10 +147,6 @@ SpiffUI.preCheck = function()
return nil
end
if UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0) then
return nil
end
return player
end
@@ -158,6 +154,7 @@ local function keyDown(key)
--print("Pressed: " .. getKeyName(key) .. " | " .. key)
local player = SpiffUI.preCheck(key)
if not player then return end
for _,bind in ipairs(SpiffUI.KeyBinds) do
if key == getCore():getKey(bind.name) then
if bind.Down then
@@ -165,7 +162,9 @@ local function keyDown(key)
if bind.qBlock and queue and #queue.queue > 0 then
return
end
bind.Down(player)
if bind.allowPause or not (UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0)) then
bind.Down(player)
end
end
break
end
@@ -183,7 +182,9 @@ local function keyHold(key)
if bind.qBlock and queue and #queue.queue > 0 then
return
end
bind.Hold(player)
if bind.allowPause or not (UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0)) then
bind.Hold(player)
end
end
break
end
@@ -201,7 +202,9 @@ local function keyRelease(key)
if bind.qBlock and queue and #queue.queue > 0 then
return
end
bind.Up(player)
if bind.allowPause or not (UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0)) then
bind.Up(player)
end
end
break
end
@@ -231,7 +234,7 @@ SpiffUI.onKeyDown = function(player)
if SpiffUI.action.ready then
-- Hide Radial Menu on Press if applicable
if radialMenu:isReallyVisible() and getCore():getOptionRadialMenuKeyToggle() then
radialMenu:removeFromUIManager()
radialMenu:undisplay()
setJoypadFocus(player:getPlayerNum(), nil)
SpiffUI.action.wasVisible = false
SpiffUI.action.ready = true
@@ -266,6 +269,7 @@ end
SpiffUI.equippedItem = {
["Inventory"] = true,
["Health"] = true,
["QOLEquip"] = true,
["Craft"] = true,
["Movable"] = true,
["Search"] = true,
@@ -280,6 +284,8 @@ function SpiffUI:updateEquippedItem()
-- Redo the ISEquippedItem tree based on what we set
local player = getPlayerData(0)
local y = player.equipped.invBtn:getY()
-- Add support for the QOL Equipment mod's icon
SpiffUI.equippedItem["QOLEquip"] = (SETTINGS_QOLMT and SETTINGS_QOLMT.options and SETTINGS_QOLMT.options.useIcon) or false
for i,v in pairs(SpiffUI.equippedItem) do
if i == "Inventory" then
player.equipped.invBtn:setVisible(v)
@@ -292,6 +298,13 @@ function SpiffUI:updateEquippedItem()
if v then
y = player.equipped.healthBtn:getY() + player.equipped.heartIcon:getHeightOrig() + 5
end
-- Add support for the QOL Equipment mod's icon
elseif i == "QOLEquip" and player.equipped.equipButton then
player.equipped.equipButton:setVisible(v)
player.equipped.equipButton:setY(y)
if v then
y = player.equipped.equipButton:getY() + player.equipped.equipmentIconOFF:getHeightOrig() + 5
end
elseif i == "Craft" then
player.equipped.craftingBtn:setVisible(v)
player.equipped.craftingBtn:setY(y)
@@ -374,6 +387,11 @@ function SpiffUI:ModOptions()
local function apply(data)
local options = data.settings.options
-- Set options
if isDebugEnabled() then
SpiffUI.config.debug = options.debug
else
SpiffUI.config.debug = false
end
end
local SPIFFCONFIG = {
@@ -393,6 +411,15 @@ function SpiffUI:ModOptions()
mod_fullname = getText("UI_Name_SpiffUI")
}
if isDebugEnabled() then
SPIFFCONFIG.options_data.debug = {
name = "Enable Debug",
default = false,
OnApplyMainMenu = apply,
OnApplyInGame = apply
}
end
local optionsInstance = ModOptions:getInstance(SPIFFCONFIG)
ModOptions:loadFile()
@@ -589,6 +616,39 @@ SpiffUI.settingsModal = function(w, h, text, key, callback)
end
end
-- Adapted from: https://www.rosettacode.org/wiki/Word_wrap#Lua
SpiffUI.textwrap = function(text, linewidth)
local function splittokens(s)
local res = {}
for w in s:gmatch("%S+") do
res[#res+1] = w
end
return res
end
if not linewidth then
linewidth = 75
end
local spaceleft = linewidth
local res = {}
local line = {}
for _, word in ipairs(splittokens(text)) do
if #word + 1 > spaceleft then
table.insert(res, table.concat(line, ' '))
line = {word}
spaceleft = linewidth - #word
else
table.insert(line, word)
spaceleft = spaceleft - (#word + 1)
end
end
table.insert(res, table.concat(line, ' '))
return table.concat(res, '\n')
end
------------------------------------------
Events.OnGameBoot.Add(SpiffUI.firstBoot)

View File

@@ -2,6 +2,10 @@
-- SpiffUI Radials
---- ISFirearmRadialMenu getWeapon hack
------------------------------------------
SpiffUI = SpiffUI or {}
-- Register our Radials
local spiff = SpiffUI:Register("radials")
-- This lets us set call the radial without having the wepaon in-hand
---- You must have the weapon equipped in primary in order to do an action though
@@ -12,4 +16,20 @@ function ISFirearmRadialMenu:getWeapon()
return _ISFirearmRadialMenu_getWeapon(self)
end
return self.weapon
end
-- I need to inject our previous page if applicable
local _ISFirearmRadialMenu_display = ISFirearmRadialMenu.display
function ISFirearmRadialMenu:display()
if self.prev then
-- set some expected things
-- there be a previous page
self.page = 1
self.maxPage = 1
self.rmenu = getPlayerRadialMenu(self.playerNum)
local o = spiff.prevCmd:new(self, getText("UI_radial_SpiffUI_Previous"), getTexture("media/spifcons/prevpage.png"))
o:fillMenu()
end
_ISFirearmRadialMenu_display(self)
end

View File

@@ -5,7 +5,7 @@
SpiffUI = SpiffUI or {}
-- Register our inventory
-- Register our module
local spiff = SpiffUI:Register("radials")
local SpiffUIRadialRecipeTooltip = ISRecipeTooltip:derive("SpiffUIRadialRecipeTooltip")
@@ -179,7 +179,6 @@ function SpiffUIRadialRecipeTooltip:layoutContents(x, y)
-- Hack for "Dismantle Digital Watch" and similar recipes.
-- Recipe sources include both left-hand and right-hand versions of the same item.
-- We only want to display one of them.
---[[
for j=1,#itemDataList do
local item = itemDataList[j]
for k=#itemDataList,j+1,-1 do
@@ -189,7 +188,6 @@ function SpiffUIRadialRecipeTooltip:layoutContents(x, y)
end
end
end
--]]
for i,itemData in ipairs(itemDataList) do
local x2 = x1
@@ -286,6 +284,11 @@ function ISRadialMenu:getSliceTooltipMouse(x, y)
return nil
end
function ISRadialMenu:getSliceText(sliceIndex)
if sliceIndex < 1 or sliceIndex > #self.slices then return "" end
return self.slices[sliceIndex].text
end
function ISRadialMenu:showTooltip(item)
if item and spiff.config.showTooltips then
if self.prev == item and (self.toolRender:getIsVisible()
@@ -400,7 +403,6 @@ end
local _ISRadialMenu_undisplay = ISRadialMenu.undisplay
function ISRadialMenu:undisplay()
_ISRadialMenu_undisplay(self)
if self.toolRender and self.toolRender:getIsVisible() then
self.toolRender:removeFromUIManager()
self.toolRender:setVisible(false)
@@ -413,11 +415,17 @@ function ISRadialMenu:undisplay()
self.invRender:removeFromUIManager()
self.invRender:setVisible(false)
end
if self.activeMenu then
self.activeMenu:undisplay()
self.activeMenu = nil
end
end
function ISRadialMenu:RadialTick()
if self:isReallyVisible() then
self:showTooltip(self:getSliceTooltipJoyPad())
if JoypadState.players[self.playerNum+1] then
self:showTooltip(self:getSliceTooltipJoyPad())
end
end
end
@@ -425,11 +433,6 @@ local _ISRadialMenu_new = ISRadialMenu.new
function ISRadialMenu:new(...)
local o = _ISRadialMenu_new(self, ...)
o:makeToolTip()
if JoypadState.players[o.playerNum+1] then
Events.OnRenderTick.Add(function()
o:RadialTick()
end)
end
return o
end

View File

@@ -9,19 +9,18 @@ SpiffUI = SpiffUI or {}
local spiff = SpiffUI:Register("radials")
-- Base SpiffUI Radial Menu
local SpiffUIRadialMenu = ISBaseObject:derive("SpiffUIRadialMenu")
local SpiffUIRadialMenu = ISUIElement:derive("SpiffUIRadialMenu")
-- Base Radial Command
local SpiffUIRadialCommand = ISBaseObject:derive("SpiffUIRadialCommand")
-- Radial Command for asking amount
local SpiffUIRadialCommandAsk = SpiffUIRadialCommand:derive("SpiffUIRadialCommandAsk")
-- Radial Command for Next Page
local SpiffUIRadialCommandNext = SpiffUIRadialCommand:derive("SpiffUIRadialCommandNext")
-- Radial Command for Prev Page
local SpiffUIRadialCommandPrev = SpiffUIRadialCommand:derive("SpiffUIRadialCommandPrev")
spiff.prevCmd = SpiffUIRadialCommandPrev -- need to be able to call this other places
------------------------------------------
function SpiffUIRadialCommand:new(menu, text, texture, tooltip)
@@ -33,24 +32,27 @@ function SpiffUIRadialCommand:new(menu, text, texture, tooltip)
o.tooltip = tooltip
-- -- Disable the text if the menu has a forced center image
-- if menu.centerImg and menu.cIndex then
-- text = ""
-- end
o.text = text
o.texture = texture
o.shouldAsk = 0
o.askText = nil
o.amount = 0
return o
end
function SpiffUIRadialCommand:fillMenu()
if spiff.config.showTooltips and self.tooltip then
if self.forceText then
self.rmenu:addSlice(self.text, self.texture, self.invoke, self)
else
self.rmenu:addSlice("", self.texture, self.invoke, self)
end
else
self.rmenu:addSlice(self.text, self.texture, self.invoke, self)
if self.texture then
self.rmenu:addSlice("", self.texture, self.invoke, self)
else -- add a blank
self.rmenu:addSlice(nil, nil, nil)
end
end
@@ -61,7 +63,8 @@ end
function SpiffUIRadialCommand:invoke()
if self.shouldAsk > 0 then
self.menu.command = self
self.menu:askAmount()
local rad = spiff.subradial.ask:new(self.player, self.menu, self.texture, self.menu.askText)
rad:start()
return
end
self:Action()
@@ -72,19 +75,6 @@ spiff.radialcommand = SpiffUIRadialCommand
------------------------------------------
function SpiffUIRadialCommandAsk:invoke()
self.menu.command.amount = self.amount
self.menu.command:Action()
end
function SpiffUIRadialCommandAsk:new(menu, text, texture, amount)
local o = spiff.radialcommand.new(self, menu, text, texture, nil)
o.amount = amount
return o
end
------------------------------------------
function SpiffUIRadialCommandNext:invoke()
self.menu.page = self.menu.page + 1
self.menu:show()
@@ -97,11 +87,19 @@ end
------------------------------------------
function SpiffUIRadialCommandPrev:invoke()
self.menu.page = self.menu.page - 1
if self.menu.pageReset then
self.menu.maxPage = self.menu.page
if self.menu.page > 1 then
local p = self.menu.page
self.menu.page = self.menu.page - 1
if self.menu.pageReset then
self.menu.maxPage = self.menu.page
self.menu.btmText[p] = nil
self.menu.centerImg[p] = nil
self.menu.cImgChange[p] = nil
end
self.menu:show()
else
self.menu.prev:show()
end
self.menu:show()
end
function SpiffUIRadialCommandPrev:new(menu, text, texture)
@@ -109,93 +107,66 @@ function SpiffUIRadialCommandPrev:new(menu, text, texture)
end
------------------------------------------
function SpiffUIRadialMenu:build()
print("Base SpiffUIRadialMenu build -- Override me!")
function SpiffUIRadialMenu:start()
print("Base SpiffUIRadialMenu start -- Override me!")
end
function SpiffUIRadialMenu:askAmount()
self.rmenu:clear()
--table.wipe(self.commands)
local askCommands = {}
if self.command.shouldAsk == 1 then -- Consume: 1 (all), 1/2, 1/4, Dieter
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.item:getName(), spiff.icons[4], 1))
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.item:getName(), spiff.icons[2], 0.5))
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.item:getName(), spiff.icons[3], 0.25))
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.item:getName(), spiff.icons[5], -1))
elseif self.command.shouldAsk == 2 then -- Crafting, all or 1
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.recipe:getName(), spiff.icons[4], true))
table.insert(askCommands, SpiffUIRadialCommandAsk:new(self, self.command.recipe:getName(), spiff.icons[1], false))
end
for _,command in ipairs(askCommands) do
local count = #self.rmenu.slices
command:fillMenu()
if count == #self.rmenu.slices then
self.rmenu:addSlice(nil, nil, nil)
end
end
self.rmenu:center()
self.rmenu:addToUIManager()
self.rmenu:setVisible(true)
SpiffUI.action.wasVisible = true
if JoypadState.players[self.playerNum+1] then
self.rmenu:setHideWhenButtonReleased(Joypad.DPadUp)
setJoypadFocus(self.playerNum, self.rmenu)
self.player:setJoypadIgnoreAimUntilCentered(true)
function SpiffUIRadialMenu:display()
if self.start then
self:start()
self.page = 1
self:show()
end
end
function SpiffUIRadialMenu:display()
self:build()
self.page = 1
self:show()
function SpiffUIRadialMenu:prepareCmds()
if not self.commands[self.page] then
self.commands[self.page] = {}
else
table.wipe(self.commands[self.page])
end
end
function SpiffUIRadialMenu:show()
self.rmenu:clear()
local hasCommands = false
local count = 0
local min = 3
-- Add the next page
if self.maxPage > 1 and self.page < self.maxPage then
local nextp = SpiffUIRadialCommandNext:new(self, "Next", self.nextTex)
local count = #self.rmenu.slices
local nextp = SpiffUIRadialCommandNext:new(self, getText("UI_radial_SpiffUI_Next"), self.nextTex)
nextp:fillMenu()
if count == #self.rmenu.slices then
self.rmenu:addSlice(nil, nil, nil)
end
end
if self.commands[self.page] then
for _,command in ipairs(self.commands[self.page]) do
local count = #self.rmenu.slices
command:fillMenu()
if count == #self.rmenu.slices then
self.rmenu:addSlice(nil, nil, nil)
end
hasCommands = true
count = count + 1
end
end
-- Add the previous page
if self.maxPage > 1 and self.page > 1 then
local nextp = SpiffUIRadialCommandPrev:new(self, "Previous", self.prevTex)
local count = #self.rmenu.slices
nextp:fillMenu()
if count == #self.rmenu.slices then
-- rule of 3
if count < min then
for i=count,min-1 do
self.rmenu:addSlice(nil, nil, nil)
end
end
if hasCommands then
-- Add the previous page
if (self.maxPage > 1 and self.page > 1) or (self.page == 1 and self.prev) then
local nextp = SpiffUIRadialCommandPrev:new(self, getText("UI_radial_SpiffUI_Previous"), self.prevTex)
nextp:fillMenu()
end
if count > 0 then
self.rmenu:center()
self:center()
self.rmenu:addToUIManager()
self:addToUIManager()
self.rmenu:setVisible(true)
self:setVisible(true)
self:bringToTop()
self.rmenu.activeMenu = self
SpiffUI.action.wasVisible = true
if JoypadState.players[self.playerNum+1] then
self.rmenu:setHideWhenButtonReleased(Joypad.DPadUp)
@@ -208,9 +179,117 @@ function SpiffUIRadialMenu:show()
end
end
function SpiffUIRadialMenu:center()
local x = getPlayerScreenLeft(self.playerNum)
local y = getPlayerScreenTop(self.playerNum)
local w = getPlayerScreenWidth(self.playerNum)
local h = getPlayerScreenHeight(self.playerNum)
x = x + w / 2
y = y + h / 2
if self.cmdText then
local cH = getTextManager():getFontHeight(UIFont.Medium)
local cW = getTextManager():MeasureStringX(UIFont.Medium, self.cmdText)
self.cTX = (x - cW / 2)
self.cTY = (y - cH / 2)
self.bTY = (y - cH / 2) + (cH * 2)
end
if self.btmText[self.page] then
local bh = getTextManager():getFontHeight(UIFont.Medium)
local bw = getTextManager():MeasureStringX(UIFont.Medium, self.btmText[self.page])
self.bTX = (x - bw / 2)
self.bTY = (y - bh / 2) + (bh * 2)
end
self.imgH = self.rmenu.innerRadius/2
self.imgW = self.imgH
self.imgX = (x - self.imgW / 2)
self.imgY = (y - self.imgH / 2)
self.cenX = x
self.cenY = y
end
function SpiffUIRadialMenu:render()
local index = -1
-- This is a better way to handle this. :D
if self.cIndex then -- force show
index = -1
elseif JoypadState.players[self.playerNum+1] then
index = self.rmenu.javaObject:getSliceIndexFromJoypad(self.rmenu.joyfocus.id)
else
index = self.rmenu.javaObject:getSliceIndexFromMouse(self.rmenu:getMouseX(), self.rmenu:getMouseY())
end
self.cmdText = nil
self.cmdImg = nil
if index > -1 then
if self.rmenu:getSliceCommand(index+1) and self.rmenu:getSliceCommand(index+1)[2] then
self.cmdText = SpiffUI.textwrap(self.rmenu:getSliceCommand(index+1)[2].text,20)
self.cmdImg = self.rmenu:getSliceCommand(index+1)[2].texture
end
end
self:center()
if index == -1 then
if self.centerImg[self.page] then
self:drawTextureScaledAspect(self.centerImg[self.page], self.imgX, self.imgY, self.imgW, self.imgH, 1, 1, 1, 1)
end
if self.btmText[self.page] then
self:drawText(self.btmText[self.page], self.bTX, self.bTY, 1,1,1,1, UIFont.Medium)
end
else
if self.cImgChange[self.page] then
if self.cmdImg then
self:drawTextureScaledAspect(self.cmdImg, self.imgX, self.imgY, self.imgW, self.imgH, 1, 1, 1, 1)
else
if self.centerImg[self.page] then
self:drawTextureScaledAspect(self.centerImg[self.page], self.imgX, self.imgY, self.imgW, self.imgH, 1, 1, 1, 1)
end
end
else
if self.centerImg[self.page] then
self:drawTextureScaledAspect(self.centerImg[self.page], self.imgX, self.imgY, self.imgW, self.imgH, 1, 1, 1, 1)
end
end
if self.cmdText then
if self.centerImg[self.page] or self.cImgChange[self.page] then
-- Draw cmdText at bottom
self:drawText(self.cmdText, self.cTX, self.bTY, 1,1,1,1, UIFont.Medium)
else
if self.btmText[self.page] then
-- Draw btmText
self:drawText(self.btmText[self.page], self.bTX, self.bTY, 1,1,1,1, UIFont.Medium)
end
-- Draw cmdText at middle
self:drawText(self.cmdText, self.cTX, self.cTY, 1,1,1,1, UIFont.Medium)
end
else
if self.btmText[self.page] then
self:drawText(self.btmText[self.page], self.bTX, self.bTY, 1,1,1,1, UIFont.Medium)
end
end
if JoypadState.players[self.playerNum+1] then
self.rmenu:showTooltip(self.rmenu:getSliceTooltipJoyPad())
end
end
end
function SpiffUIRadialMenu:undisplay()
self:removeFromUIManager()
end
function SpiffUIRadialMenu:AddCommand(command)
if self.cCount == self.cMax then
--print("Adding New Page: " .. self.cCount)
self.cCount = 0
self.page = self.page + 1
self.maxPage = self.page
@@ -221,11 +300,10 @@ function SpiffUIRadialMenu:AddCommand(command)
end
table.insert(self.commands[self.page], command)
self.cCount = self.cCount + 1
--print("Count: " .. self.cCount)
end
function SpiffUIRadialMenu:new(player)
local o = ISBaseObject.new(self)
function SpiffUIRadialMenu:new(player, prev, centerImg, btmText)
local o = ISUIElement.new(self, 0,0,0,0)
o.player = player
o.playerNum = player:getPlayerNum()
@@ -238,8 +316,26 @@ function SpiffUIRadialMenu:new(player)
o.page = 1
o.maxPage = 1
o.nextTex = getTexture("media/SpiffUI/nextpage.png")
o.prevTex = getTexture("media/SpiffUI/prevpage.png")
o.prev = prev or nil
o.nextTex = getTexture("media/spifcons/nextpage.png")
o.prevTex = getTexture("media/spifcons/prevpage.png")
o.centerImg = {
[o.page] = centerImg
}
o.btmText = {
[o.page] = btmText
}
o.cmdText = nil
o.cmdImg = nil
--o.cIndex = ((o.centerImg[o.page] ~= nil) or false)
o.cImgChange = {}
o:initialise()
o.background = false
return o
end

View File

@@ -0,0 +1,194 @@
------------------------------------------
-- SpiffUI Alarm Actions
---- Radial Menu for setting the alarm
------------------------------------------
SpiffUI = SpiffUI or {}
-- Register our Radials
local spiff = SpiffUI:Register("radials")
local SpiffUIAlarmRadial = spiff.radialmenu:derive("SpiffUIAlarmRadial")
if not spiff.subradial then spiff.subradial = {} end
spiff.subradial.alarm = SpiffUIAlarmRadial
local SpiffUIAlarmRadialCommand = spiff.radialcommand:derive("SpiffUIAlarmRadialCommand")
function SpiffUIAlarmRadialCommand:Action()
if self.mode == 1 then
self.alarm:setAlarmSet(false)
self.alarm:setHour(self.menu.hour)
self.alarm:setMinute(self.menu.minute)
self.alarm:syncAlarmClock()
elseif self.mode == 2 then
self.alarm:setAlarmSet(true)
self.alarm:setHour(self.menu.hour)
self.alarm:setMinute(self.menu.minute)
self.alarm:syncAlarmClock()
elseif self.mode == 3 then
self.menu.oldPrev = self.menu.prev
self.menu.prev = nil
self.menu:hourRadial()
elseif self.mode == 4 then
self.alarm:syncStopRinging()
end
end
function SpiffUIAlarmRadialCommand:new(menu, mode, alarm)
local tex
local label = ""
if mode == 1 then
tex = menu.icons["silence"]
label = getText("UI_alarm_SpiffUI_Silence")
elseif mode == 2 then
tex = menu.icons["enable"]
label = getText("UI_alarm_SpiffUI_Enable")
elseif mode == 3 then
tex = alarm:getTexture()
label = getText("UI_alarm_SpiffUI_Reset")
elseif mode == 4 then
tex = menu.icons["stop"]
label = getText("ContextMenu_StopAlarm")
end
local o = spiff.radialcommand.new(self, menu, label, tex, nil)
o.mode = mode
o.alarm = alarm
return o
end
local SpiffUIAlarmRadialCommandHour = spiff.radialcommand:derive("SpiffUIAlarmRadialCommandHour")
function SpiffUIAlarmRadialCommandHour:Action()
self.menu.hour = self.hour
self.menu:minuteRadial()
end
function SpiffUIAlarmRadialCommandHour:new(menu, hour)
local o = spiff.radialcommand.new(self, menu, "", menu.icons[hour], nil)
o.hour = hour
return o
end
local SpiffUIAlarmRadialCommandMinute = spiff.radialcommand:derive("SpiffUIAlarmRadialCommandMinute")
function SpiffUIAlarmRadialCommandMinute:Action()
self.menu.minute = self.minute
self.menu.alarm:setHour(self.menu.hour)
self.menu.alarm:setMinute(self.menu.minute)
self.menu.alarm:syncAlarmClock()
self.menu.prev = self.menu.oldPrev
self.menu.oldPrev = nil
self.menu:start()
end
function SpiffUIAlarmRadialCommandMinute:new(menu, minute)
local o = spiff.radialcommand.new(self, menu, "", menu.icons[minute], nil)
o.minute = minute
return o
end
------------------------------------------
function SpiffUIAlarmRadial:start()
self:prepareCmds()
local hText = ""
if self.hour == -1 then
hText = getText("UI_alarm_SpiffUI_HH")
else
hText = string.format("%02d", self.hour)
end
local mText = ""
if self.minute == -1 then
mText = getText("UI_alarm_SpiffUI_MM")
else
mText = string.format("%02d", self.minute)
end
self.btmText[self.page] = getText("UI_alarm_SpiffUI_CurrentF", hText, mText)
self.btmText[self.page] = self.btmText[self.page]:gsub('\\n', '\n')
if self.alarm:isRinging() then
self:AddCommand(SpiffUIAlarmRadialCommand:new(self,4,self.alarm))
end
self:AddCommand(SpiffUIAlarmRadialCommand:new(self,3,self.alarm))
self:AddCommand(SpiffUIAlarmRadialCommand:new(self,1,self.alarm))
self:AddCommand(SpiffUIAlarmRadialCommand:new(self,2,self.alarm))
self:show()
end
function SpiffUIAlarmRadial:hourRadial()
self:prepareCmds()
self.btmText[self.page] = getText("UI_alarm_SpiffUI_SetHourF", getText("UI_alarm_SpiffUI_HH"), getText("UI_alarm_SpiffUI_MM"))
self.btmText[self.page] = self.btmText[self.page]:gsub('\\n', '\n')
for i = 0, 23 do
table.insert(self.commands[self.page], SpiffUIAlarmRadialCommandHour:new(self, i))
end
self:show()
end
function SpiffUIAlarmRadial:minuteRadial()
self:prepareCmds()
local hText = ""
if self.hour == -1 then
hText = getText("UI_alarm_SpiffUI_HH")
else
hText = string.format("%02d", self.hour)
end
self.btmText[self.page] = getText("UI_alarm_SpiffUI_SetMinuteF", hText, getText("UI_alarm_SpiffUI_MM"))
self.btmText[self.page] = self.btmText[self.page]:gsub('\\n', '\n')
for i = 0, 5 do
table.insert(self.commands[self.page], SpiffUIAlarmRadialCommandMinute:new(self, i*10))
end
self:show()
end
function SpiffUIAlarmRadial:initialise()
if self.init then
-- This is called by "onSetAlarm"
-- We'll just override this to show the radial instead
self:display()
else
ISUIElement.initialise(self)
self.init = true
end
end
function SpiffUIAlarmRadial:new(player, alarm, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.alarm = alarm
o.hour = o.alarm:getHour()
o.minute = o.alarm:getMinute()
-- Alarm icons
o.icons = {
[30] = getTexture("media/spifcons/alarm/30.png"),
[40] = getTexture("media/spifcons/alarm/40.png"),
[50] = getTexture("media/spifcons/alarm/50.png"),
["silence"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSet.png"),
["enable"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSound.png"),
["stop"] = getTexture("media/ui/emotes/no.png"),
}
-- Do the rest
for i=0,23 do
o.icons[i] = getTexture("media/spifcons/alarm/" .. string.format("%02d", i) .. ".png")
end
return o
end
-- later when i get the inventory to dismiss/reappear for controllers. i've delayed release enough for now
-- local _ISAlarmClockDialog_new = ISAlarmClockDialog.new
-- function ISAlarmClockDialog:new(x, y, width, height, player, alarm)
-- --return _ISAlarmClockDialog_new(self, x, y, width, height, player, alarm)
-- return SpiffUIAlarmRadial:new(getSpecificPlayer(player), alarm)
-- end

View File

@@ -0,0 +1,50 @@
------------------------------------------
-- SpiffUI Choice Actions
---- Radial Menu for making choices (ie how many)
------------------------------------------
SpiffUI = SpiffUI or {}
-- Register our Radials
local spiff = SpiffUI:Register("radials")
local SpiffUIAskRadial = spiff.radialmenu:derive("SpiffUIAskRadial")
if not spiff.subradial then spiff.subradial = {} end
spiff.subradial.ask = SpiffUIAskRadial
------------------------------------------
-- Radial Command for asking amount
local SpiffUIRadialCommandAsk = spiff.radialcommand:derive("SpiffUIRadialCommandAsk")
function SpiffUIRadialCommandAsk:invoke()
self.menu.prev.command.amount = self.amount
self.menu.prev.command:Action()
end
function SpiffUIRadialCommandAsk:new(menu, text, texture, amount)
local o = spiff.radialcommand.new(self, menu, text, texture, nil)
o.amount = amount
return o
end
------------------------------------------
function SpiffUIAskRadial:start()
self:prepareCmds()
if self.prev.command.shouldAsk == 1 then -- Consume: 1 (all), 1/2, 1/4, Dieter
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_One"), getTexture("media/spifcons/choice/ALL.png"), 1))
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_Half"), getTexture("media/spifcons/choice/1-2.png"), 0.5))
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_Quarter"), getTexture("media/spifcons/choice/1-4.png"), 0.25))
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_Full"), getTexture("media/spifcons/choice/FULL.png"), -1))
elseif self.prev.command.shouldAsk == 2 then -- Crafting, all or 1
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_All"), getTexture("media/spifcons/choice/ALL.png"), true))
table.insert(self.commands[self.page], SpiffUIRadialCommandAsk:new(self, getText("UI_amount_SpiffUI_One"), getTexture("media/spifcons/choice/1.png"), false))
end
self:show()
end
function SpiffUIAskRadial:new(player, prev, centerImg, btmText)
local o = spiff.radialmenu.new(self, player, prev, centerImg, btmText)
return o
end

View File

@@ -21,7 +21,16 @@ function SpiffUICraftingRadialCommand:Action()
end
function SpiffUICraftingRadialCommand:new(menu, recipe)
local texture = InventoryItemFactory.CreateItem(recipe.recipe:getResult():getFullType()):getTexture()
if SpiffUI.config.debug then
print("Item: " .. recipe.item:getFullType() .. " | Recipe: " .. recipe.recipe:getName() .. " | Result: " .. recipe.recipe:getResult():getFullType())
end
local texture
local itex = InventoryItemFactory.CreateItem(recipe.recipe:getResult():getFullType())
if itex then
texture = itex:getTexture()
else
texture = recipe.item:getTexture()
end
local tooltip = {
recipe = recipe.recipe,
@@ -50,7 +59,7 @@ local function getRecipes(packs, player)
for p = 0, packs:size() - 1 do
local pack = packs:get(p)
local ps = pack:getAllEval(function(item)
return instanceof(item, "InventoryItem")
return instanceof(item, "InventoryItem") and not instanceof(item, "Moveable")
end)
if ps and ps:size() > 0 then
for i = 0, ps:size() - 1 do
@@ -115,7 +124,7 @@ end
------------------------------------------
function SpiffUICraftingRadial:build()
function SpiffUICraftingRadial:start()
local bags = ISInventoryPaneContextMenu.getContainers(self.player)
local recipes = getRecipes(bags, self.player)
@@ -123,15 +132,20 @@ function SpiffUICraftingRadial:build()
for i,j in pairs(recipes) do
self:AddCommand(SpiffUICraftingRadialCommand:new(self, j))
hasRecipes = true
end
self.centerImg[self.page] = getTexture("media/spifcons/crafting.png")
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Crafting")
self.cImgChange[self.page] = true
end
if not hasRecipes then
self.player:Say(getText("UI_character_SpiffUI_noCraft"))
end
end
function SpiffUICraftingRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUICraftingRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_CraftHowMany")
return o
end
local function SpiffUICraftDown(player)

View File

@@ -70,9 +70,7 @@ local function doDrink(item, player, amount)
end
function SpiffUIDrinkRadialCommand:Action()
doDrink(self.item, self.player, self.amount)
--ISInventoryPaneContextMenu.eatItem(self.item, self.amount, self.playerNum)
doDrink(self.item, self.player, self.amount)
-- Return from whence it came...
if self.item:getContainer() ~= self.player:getInventory() then
ISTimedActionQueue.add(ISInventoryTransferAction:new(self.player, self.item, self.player:getInventory(), self.item:getContainer()))
@@ -97,8 +95,11 @@ local function getItems(packs, player)
local items = {}
for p = 0, packs:size() - 1 do
local pack = packs:get(p)
local ps = pack:getAllEval(function(item)
return not player:isKnownPoison(item) and (item:getCustomMenuOption() and item:getCustomMenuOption() == "Drink") or item:isWaterSource()
local ps = pack:getAllEval(function(item)
-- the only real difference between food and drinks is if there is a custom menu option/animation it seems.
return item:isWaterSource()
or (instanceof(item, "Food") and not player:isKnownPoison(item) and not item:getScriptItem():isCantEat())
and (item:getThirstChange() < 0 and item:getCustomMenuOption() == getText("ContextMenu_Drink"))
end)
if ps and ps:size() > 0 then
for i = 0, ps:size() - 1 do
@@ -143,7 +144,7 @@ end
------------------------------------------
function SpiffUIDrinkRadial:build()
function SpiffUIDrinkRadial:start()
local packs = ISInventoryPaneContextMenu.getContainers(self.player)
local drinks = getItems(packs, self.player)
@@ -165,6 +166,9 @@ function SpiffUIDrinkRadial:build()
self:AddCommand(SpiffUIDrinkRadialCommand:new(self, j))
hasCmd = true
end
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.WaterBottleFull"):getTexture()
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Drink")
self.cImgChange[self.page] = true
end
if not hasCmd then
@@ -172,8 +176,10 @@ function SpiffUIDrinkRadial:build()
end
end
function SpiffUIDrinkRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUIDrinkRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_DrinkHowMuch")
return o
end
local function quickDrink(player)

View File

@@ -74,12 +74,13 @@ function SpiffUIEatRadialCommand:new(menu, item)
return o
end
local function getItems(packs)
local function getItems(packs, player)
local items = {}
for p = 0, packs:size() - 1 do
local pack = packs:get(p)
local ps = pack:getAllEval(function(item)
return instanceof(item, "Food") and item:getHungChange() < 0 and not item:getScriptItem():isCantEat() and not item:getCustomMenuOption()
return (instanceof(item, "Food") and not player:isKnownPoison(item) and not item:getScriptItem():isCantEat())
and item:getHungChange() < 0 and not item:getCustomMenuOption()
end)
if ps and ps:size() > 0 then
for i = 0, ps:size() - 1 do
@@ -111,9 +112,9 @@ end
------------------------------------------
function SpiffUIEatRadial:build()
function SpiffUIEatRadial:start()
local packs = ISInventoryPaneContextMenu.getContainers(self.player)
local food = getItems(packs)
local food = getItems(packs, self.player)
if not food then
self.player:Say(getText("UI_character_SpiffUI_noFood"))
@@ -123,11 +124,16 @@ function SpiffUIEatRadial:build()
-- Build
for _,j in ipairs(food) do
self:AddCommand(SpiffUIEatRadialCommand:new(self, j))
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.Apple"):getTexture()
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Eat")
self.cImgChange[self.page] = true
end
end
function SpiffUIEatRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUIEatRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_EatHowMuch")
return o
end
local function quickEat(player)

View File

@@ -63,8 +63,15 @@ function SpiffUIEquipmentItemRadialCommand:Action()
end
local frm = ISFirearmRadialMenu:new(self.player)
frm.weapon = self.item.item
frm.prev = self.menu
frm:fillMenu()
frm:display()
elseif self.mode == 8 then -- Place
ISInventoryPaneContextMenu.onPlaceItemOnGround({self.item.item}, self.player)
elseif self.mode == 9 then
spiff.subradial.alarm:new(self.player, self.item.item, self.menu):display()
elseif self.mode == 10 then
self.item.item:stopRinging()
else
self.player:Say("OOPS! I don't know how to do that. That's not supposed to happen!")
end
@@ -156,6 +163,7 @@ local clothesSort = {
["FannyPackBack"] = 41,
["FannyPackFront"] = 42,
["Hands"] = 43,
["Watch"] = 44,
["Left_MiddleFinger"] = 144,
["Left_RingFinger"] = 145,
["LeftWrist"] = 146,
@@ -184,6 +192,14 @@ local clothesFilter = {
["ZedDmg"] = true
}
local isWatch = function(item)
if instanceof(item, "AlarmClock") or instanceof(item, "AlarmClockClothing") then
return "Watch"
else
return nil
end
end
local function getItems(packs, player)
local items = nil
@@ -192,7 +208,7 @@ local function getItems(packs, player)
for i=0, clothes:size() - 1 do
if not items then items = {} end
local item = clothes:get(i):getItem()
if item and not clothesFilter[item:getBodyLocation()] then
if item and not clothesFilter[(isWatch(item) or item:getBodyLocation())] then
table.insert(items, item)
end
end
@@ -211,9 +227,12 @@ local function getItems(packs, player)
if items then
-- order our clothes from head to toe
---- NEW: We have to handle watches a bit funny due to how this works
------ Mods may add bracelets or other items that go on the wrist, and we don't want those
table.sort(items, function(a,b)
if not clothesSort[a:getBodyLocation()] or not clothesSort[b:getBodyLocation()] then return false end
return clothesSort[a:getBodyLocation()] < clothesSort[b:getBodyLocation()]
if not clothesSort[isWatch(a) or a:getBodyLocation()] or not clothesSort[isWatch(b) or b:getBodyLocation()] then return false end
return clothesSort[isWatch(a) or a:getBodyLocation()] < clothesSort[isWatch(b) or b:getBodyLocation()]
end)
end
return items
@@ -301,10 +320,6 @@ local function fixerStuff(item, fixing, fixer, player)
end
end
if unavailable then
tooltip.description = tooltip.description .. " <LINE> <RED> " .. "**FUCK YOU, ASSHOLE**"
end
return {
fixing = fixing,
fixer = fixer,
@@ -328,9 +343,15 @@ function SpiffUIEquipmentRadial:itemOptions(item)
if not item then return end
-- Get Hotbar
-- Get Hotbar & loot
local hotbar = getPlayerHotbar(self.player:getPlayerNum())
local loot = getPlayerLoot(self.playerNum)
self.btmText[self.page] = SpiffUI.textwrap(item:getName(), 20) -- some names are just too long :/
--self.btmText[self.page] = nil
self.centerImg[self.page] = item:getTexture()
-- Add "Inspect"
if item:getCategory() == "Clothing" and item:getCoveredParts():size() > 0 then
local stuff = {
@@ -347,7 +368,7 @@ function SpiffUIEquipmentRadial:itemOptions(item)
local stuff = {
item = item,
label = getText("ContextMenu_Unequip"),
texture = spiff.icons["unequip"],
texture = getTexture("media/ui/Icon_InventoryBasic.png"),
tooltip = item,
inHotbar = hotbar:isInHotbar(item) and not self.player:isEquipped(item), -- Trigger a remove from hotbar if item is not equipped
mode = 1
@@ -355,17 +376,30 @@ function SpiffUIEquipmentRadial:itemOptions(item)
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
local loot = getPlayerLoot(self.playerNum)
if loot.inventory:getType() ~= "floor" then
local stuff = {
item = item,
label = getText("UI_radial_SpiffUI_Transfer") .. loot.title,
texture = ContainerButtonIcons[loot.inventory:getType()],
inv = loot.inventory,
tooltip = item,
mode = 2
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
-- Transfer
if spiff.config.equipShowTransfer then
if loot.inventory:getType() ~= "floor" then
local tex = nil
if instanceof(loot.inventory:getContainingItem(), "InventoryContainer") then
tex = loot.inventory:getContainingItem():getTex()
else
tex = ContainerButtonIcons[loot.inventory:getType()]
end
if not tex then
tex = getTexture("media/ui/Container_Shelf.png")
end
local stuff = {
item = item,
label = getText("UI_radial_SpiffUI_Transfer") .. loot.title,
texture = tex,
inv = loot.inventory,
tooltip = item,
mode = 2
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
end
-- Add "Drop"
@@ -373,13 +407,58 @@ function SpiffUIEquipmentRadial:itemOptions(item)
local stuff = {
item = item,
label = getText("ContextMenu_Drop"),
texture = spiff.icons["drop"],
texture = getTexture("media/ui/Container_Floor.png"),
tooltip = item,
mode = 3
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
-- Add "Place"
if spiff.config.equipShowPlace then
-- adapted from ISInventoryPaneContextMenu
local id3 = true
if not item:getWorldStaticItem() and not instanceof(item, "HandWeapon") and not instanceof(item, "Clothing") or item:getType() == "CarBatteryCharger" then
id3 = false
end
if id3 and instanceof(item, "Clothing") then
id3 = item:canBe3DRender()
end
if id3 then
local stuff = {
item = item,
label = getText("IGUI_PlaceObject"),
texture = getTexture("media/spifcons/place_item.png"),
tooltip = item,
mode = 8
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
end
-- Watch!
if instanceof(item, "AlarmClock") or instanceof(item, "AlarmClockClothing") then
if item:isRinging() then
local stuff = {
item = item,
label = getText("ContextMenu_StopAlarm"),
texture = getTexture("media/ui/emotes/no.png"),
mode = 10
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
local stuff = {
item = item,
label = getText("ContextMenu_SetAlarm"),
texture = getTexture("media/ui/ClockAssets/ClockAlarmLargeSound.png"),
mode = 9
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
-- Add Clothing Items Extra
if item.getClothingItemExtraOption and item:getClothingItemExtraOption() and spiff.config.equipShowClothingActions then
@@ -445,27 +524,26 @@ function SpiffUIEquipmentRadial:itemOptions(item)
if item.isRanged and item:isRanged() then
local stuff = {
item = item,
label = "Firearm Radial",
label = getText("UI_equip_SpiffUI_FirearmRadial"),
texture = item:getTexture(),
tooltip = item,
mode = 7
}
table.insert(self.commands[self.page], SpiffUIEquipmentItemRadialCommand:new(self, stuff))
end
end
self:show()
end
function SpiffUIEquipmentRadial:accessories()
self:prepareCmds()
if not self.commands[self.page] then
self.commands[self.page] = {}
else
table.wipe(self.commands[self.page])
end
self.btmText[self.page] = getText("UI_radial_SpiffUI_Accessories")
self.centerImg[self.page] = self.accTex
self.cImgChange[self.page] = true
for _,j in ipairs(self.items) do
if not clothesSort[j:getBodyLocation()] or clothesSort[j:getBodyLocation()] > 100 then
if not clothesSort[isWatch(j) or j:getBodyLocation()] or clothesSort[isWatch(j) or j:getBodyLocation()] > 100 then
-- Add our items to page 2
table.insert(self.commands[self.page], SpiffUIEquipmentRadialCommand:new(self, j, 0))
end
@@ -475,11 +553,11 @@ function SpiffUIEquipmentRadial:accessories()
end
function SpiffUIEquipmentRadial:hotbar()
if not self.commands[self.page] then
self.commands[self.page] = {}
else
table.wipe(self.commands[self.page])
end
self:prepareCmds()
self.btmText[self.page] = getText("UI_radial_SpiffUI_Hotbar")
self.centerImg[self.page] = self.hotTex
self.cImgChange[self.page] = true
local hotbar = getPlayerHotbar(self.playerNum)
for i,item in pairs(hotbar.attachedItems) do
@@ -489,7 +567,7 @@ function SpiffUIEquipmentRadial:hotbar()
self:show()
end
function SpiffUIEquipmentRadial:build()
function SpiffUIEquipmentRadial:start()
self.packs = ISInventoryPaneContextMenu.getContainers(self.player)
self.items = getItems(self.packs, self.player)
@@ -497,22 +575,27 @@ function SpiffUIEquipmentRadial:build()
self.page = 1
self.maxPage = 1
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Equipment")
self.centerImg[self.page] = getTexture("media/spifcons/inventory.png")
local haveAccs = false
local accTex
local hasItems = false
if self.items then
-- Start at page 1
if not self.commands[1] then
self.commands[1] = {}
end
for _,j in ipairs(self.items) do
if clothesSort[j:getBodyLocation()] and clothesSort[j:getBodyLocation()] < 100 then
-- Add our items to page 1
if not self.commands[1] then
self.commands[1] = {}
end
if clothesSort[isWatch(j) or j:getBodyLocation()] and clothesSort[isWatch(j) or j:getBodyLocation()] < 100 then
table.insert(self.commands[1], SpiffUIEquipmentRadialCommand:new(self, j, 0))
hasItems = true
else
haveAccs = true
if not accTex then
accTex = j:getTexture()
self.accTex = accTex
end
end
end
@@ -534,6 +617,7 @@ function SpiffUIEquipmentRadial:build()
label = getText("UI_radial_SpiffUI_Hotbar"),
texture = item:getTexture()
}
self.hotTex = item:getTexture()
table.insert(self.commands[1], SpiffUIEquipmentRadialCommand:new(self, stuff, 2))
hasItems = true
break
@@ -546,10 +630,11 @@ function SpiffUIEquipmentRadial:build()
end
end
function SpiffUIEquipmentRadial:new(player)
local o = spiff.radialmenu.new(self, player)
function SpiffUIEquipmentRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
-- If we end up back at page 1, then we're at the main menu
o.pageReset = true
o.cImgChange[o.page] = true
return o
end

View File

@@ -82,7 +82,7 @@ local function getRecipes(packs, player)
return recipes
end
function SpiffUIFirstAidCraftRadial:build()
function SpiffUIFirstAidCraftRadial:start()
local recipes = {}
local bags = ISInventoryPaneContextMenu.getContainers(self.player)
@@ -93,6 +93,9 @@ function SpiffUIFirstAidCraftRadial:build()
for i,j in pairs(recipes) do
self:AddCommand(SpiffUIFirstAidCraftRadialCommand:new(self, j))
hasCraft = true
self.btmText[self.page] = getText("UI_SpiffUI_Radial_FirstAidCraft")
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.Bandage"):getTexture()
self.cImgChange[self.page] = true
end
if not hasCraft then
@@ -100,8 +103,10 @@ function SpiffUIFirstAidCraftRadial:build()
end
end
function SpiffUIFirstAidCraftRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUIFirstAidCraftRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_CraftHowMany")
return o
end
local function FirstAidCraftDown(player)

View File

@@ -0,0 +1,122 @@
------------------------------------------
-- SpiffUI Game Speed Radial
---- does anyone else even read these? if so, hello. :)
------------------------------------------
SpiffUI = SpiffUI or {}
-- Register our Radials
local spiff = SpiffUI:Register("radials")
local SpiffUIGSRadial = spiff.radialmenu:derive("SpiffUIGSRadial")
if not spiff.radials then spiff.radials = {} end
spiff.radials[10] = SpiffUIGSRadial
------------------------------------------
local SpiffUIGSRadialCommand = spiff.radialcommand:derive("SpiffUIGSRadialCommand")
function SpiffUIGSRadialCommand:Action()
if self.mode == 0 then
UIManager.getSpeedControls():ButtonClicked("Pause")
elseif self.mode == 1 then
UIManager.getSpeedControls():ButtonClicked("Play")
elseif self.mode == 2 then
UIManager.getSpeedControls():ButtonClicked("Fast Forward x 1")
elseif self.mode == 3 then
UIManager.getSpeedControls():ButtonClicked("Fast Forward x 2")
elseif self.mode == 4 then
UIManager.getSpeedControls():ButtonClicked("Wait")
end
end
function SpiffUIGSRadialCommand:new(menu, name, texture, mode)
local o = spiff.radialcommand.new(self, menu, name, texture, nil)
o.mode = mode
return o
end
function SpiffUIGSRadial:start()
local multiplier = getGameTime():getTrueMultiplier()
self.cImgChange[self.page] = true
-- Play/pause
if UIManager.getSpeedControls():getCurrentGameSpeed() == 0 or multiplier > 1 then
self:AddCommand(SpiffUIGSRadialCommand:new(self, getText("IGUI_BackButton_Play"), getTexture("media/ui/Time_Play_Off.png"), 1))
else
self:AddCommand(spiff.radialcommand:new(self, nil, nil, nil))
self.centerImg[self.page] = getTexture("media/ui/Time_Play_On.png")
self.btmText[self.page] = getText("IGUI_BackButton_Play")
end
if UIManager.getSpeedControls():getCurrentGameSpeed() ~= 0 then
self:AddCommand(SpiffUIGSRadialCommand:new(self, getText("UI_optionscreen_binding_Pause"), getTexture("media/ui/Time_Pause_Off.png"), 0))
else
self:AddCommand(spiff.radialcommand:new(self, nil, nil, nil))
self.centerImg[self.page] = getTexture("media/ui/Time_Pause_Off.png")
self.btmText[self.page] = getText("UI_optionscreen_binding_Pause")
end
-- FF
if multiplier == 5 then
self:AddCommand(spiff.radialcommand:new(self, nil, nil, nil))
self.centerImg[self.page] = getTexture("media/ui/Time_FFwd1_Off.png")
self.btmText[self.page] = getText("IGUI_BackButton_FF1")
else
self:AddCommand(SpiffUIGSRadialCommand:new(self, getText("IGUI_BackButton_FF1"), getTexture("media/ui/Time_FFwd1_Off.png"), 2))
end
-- FF x2
if multiplier == 20 then
self:AddCommand(spiff.radialcommand:new(self, nil, nil, nil))
self.centerImg[self.page] = getTexture("media/ui/Time_FFwd2_Off.png")
self.btmText[self.page] = getText("IGUI_BackButton_FF2")
else
self:AddCommand(SpiffUIGSRadialCommand:new(self, getText("IGUI_BackButton_FF2"), getTexture("media/ui/Time_FFwd2_Off.png"), 3))
end
-- FF xWait
if multiplier == 40 then
self:AddCommand(spiff.radialcommand:new(self, nil, nil, nil))
self.centerImg[self.page] = getTexture("media/ui/Time_Wait_Off.png")
self.btmText[self.page] = getText("IGUI_BackButton_FF3")
else
self:AddCommand(SpiffUIGSRadialCommand:new(self, getText("IGUI_BackButton_FF3"), getTexture("media/ui/Time_Wait_Off.png"), 4))
end
end
function SpiffUIGSRadial:new(player, menu)
local o = spiff.radialmenu.new(self, player, menu)
return o
end
local function GSDown(player)
-- Does nothing in multiplayer
if not UIManager.getSpeedControls() or isClient() then return end
SpiffUI.onKeyDown(player)
-- if we're not ready, then we're not doing an action.
---- do it now
if not SpiffUI.action.ready then
-- Create Menu
local menu = SpiffUIGSRadial:new(player)
menu:display()
-- Ready for another action
SpiffUI.action.ready = true
end
end
local function actionInit()
local bind = {
name = 'SpiffUIGSWheel',
key = Keyboard.KEY_GRAVE, -- ~
queue = true,
allowPause = true,
Down = GSDown
}
SpiffUI:AddKeyBind(bind)
end
actionInit()

View File

@@ -1,6 +1,6 @@
------------------------------------------
-- SpiffUI First Aid Craft Actions
---- Radial Menu for First Aid Crafting
-- SpiffUI Main Radial
---- One Radial to Rule Them All
------------------------------------------
SpiffUI = SpiffUI or {}
@@ -17,7 +17,7 @@ local SpiffUIOneRadialCommand = spiff.radialcommand:derive("SpiffUIOneRadialComm
function SpiffUIOneRadialCommand:Action()
local radial = spiff.radials[self.mode]
if radial then
local menu = radial:new(self.player)
local menu = radial:new(self.player, self.menu)
menu:display()
end
@@ -29,40 +29,392 @@ function SpiffUIOneRadialCommand:new(menu, name, texture, mode)
return o
end
function SpiffUIOneRadial:build()
-- Crafting
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Crafting",getTexture("media/SpiffUI/crafting.png"), 0))
-- Drink
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Drink", InventoryItemFactory.CreateItem("Base.WaterBottleFull"):getTexture(), 1))
-- Eat
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Eat", InventoryItemFactory.CreateItem("Base.ChickenFried"):getTexture(), 2))
-- Equipment
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Equipment", getTexture("media/SpiffUI/inventory.png"), 3))
-- First Aid Craft
self:AddCommand(SpiffUIOneRadialCommand:new(self, "First Aid Craft", InventoryItemFactory.CreateItem("Base.Bandage"):getTexture(), 4))
-- Pills
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Pills", InventoryItemFactory.CreateItem("Base.PillsAntiDep"):getTexture(), 5))
-- Repair
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Repair",InventoryItemFactory.CreateItem("Base.Hammer"):getTexture(), 6))
-- Smoke Craft
if getActivatedMods():contains('jiggasGreenfireMod') then
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Smoke Craft", InventoryItemFactory.CreateItem("Greenfire.SmokingPipe"):getTexture(), 7))
elseif getActivatedMods():contains('Smoker') then
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Smoke Craft", InventoryItemFactory.CreateItem("SM.SMSmokingBlend"):getTexture(), 7))
elseif getActivatedMods():contains('MoreCigsMod') then
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Smoke Craft", InventoryItemFactory.CreateItem("Cigs.CigsOpenPackReg"):getTexture(), 7))
else
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Smoke Craft", InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture(), 7))
local tickWatch = ISUIElement:derive("tickWatch")
function tickWatch:render()
local hour = getGameTime():getHour()
minutes = getGameTime():getMinutes()
hour = hour + (minutes/60)
local endX = self.cenX + ( (self.hrLen) * (math.sin(2 * math.pi * hour / 12 ) ) )
local endY = self.cenY + ( (-self.hrLen) * (math.cos(2 * math.pi * hour / 12 ) ) )
self:drawLine2(self.cenX, self.cenY, endX, endY, 1, 1, 1, 1)
endX = self.cenX + ( (self.minLen) * (math.sin(2 * math.pi * minutes / 60 ) ) )
endY = self.cenY + ( (-self.minLen) * (math.cos(2 * math.pi * minutes / 60 ) ) )
self:drawLine2(self.cenX, self.cenY, endX, endY, 1, 1, 1, 1)
end
function tickWatch:center()
local x = getPlayerScreenLeft(self.playerNum)
local y = getPlayerScreenTop(self.playerNum)
local w = getPlayerScreenWidth(self.playerNum)
local h = getPlayerScreenHeight(self.playerNum)
x = x + w / 2
y = y + h / 2
self:setX(x - self.rad / 2)
self:setY(y - self.rad / 2)
self.cenX = x
self.cenY = y
end
function tickWatch:new(playerNum, radius, clock, menu)
local o = ISUIElement.new(self, 0, 0, radius, radius/3)
o:initialise()
o.clock = clock
o.rad = radius
o.playerNum = playerNum
o.imgW = o.rad
o.imgH= o.rad
o.hrLen = o.rad*0.5
o.minLen = o.rad*0.8
self.menu = menu
o:center()
return o
end
local timeImg = ISUIElement:derive("timeImg")
function timeImg:render()
local time = getGameTime():getHour()
local h1 = 0
local h2 = 0
if time > 9 then
h1 = math.floor(time/10)
end
-- Smoke
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Smoke",InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture(), 8))
h2 = time - (h1*10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[1], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons[h2], self.X[2], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons["mid"], self.X[3], 0, self.midW, self.imgH, 1,1,1,1)
time = getGameTime():getMinutes()
h1 = 0
h2 = 0
if time > 9 then
h1 = math.floor(time/10)
end
h2 = time - (h1*10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[4], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons[h2], self.X[5], 0, self.secW, self.imgH, 1,1,1,1)
end
function timeImg:center()
local x = getPlayerScreenLeft(self.playerNum)
local y = getPlayerScreenTop(self.playerNum)
local w = getPlayerScreenWidth(self.playerNum)
local h = getPlayerScreenHeight(self.playerNum)
x = x + w / 2
y = y + h / 2
self:setX(x - self.imgW / 2)
self:setY(y - self.rad / 2)
self.cenX = x
self.cenY = y
end
function timeImg:new(playerNum, radius, clock, menu)
local o = ISUIElement.new(self, 0, 0, radius, radius/3)
o:initialise()
o.clock = clock
o.rad = radius
o.playerNum = playerNum
o.imgW = o.rad
o.imgH= o.rad/3
o.secW = o.rad/4
o.midW = o.rad/8
o.X = {
[1] = 0,
[2] = o.secW,
[3] = o.secW + o.secW,
[4] = o.secW + o.secW + o.midW,
[5] = o.secW + o.secW + o.midW + o.secW
}
o.imgW = o.X[5] + o.secW
self.menu = menu
o:center()
return o
end
local dateImg = ISUIElement:derive("dateImg")
local function round(num)
return math.floor(num * 10) / 10;
end
function dateImg:render()
local time = getGameTime():getMonth()+1
local h1 = 0
local h2 = 0
if time > 9 then
h1 = math.floor(time/10)
end
h2 = time - (h1*10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[1], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons[h2], self.X[2], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons["date"], self.X[3], 0, self.secW, self.imgH, 1,1,1,1)
time = getGameTime():getDay()+1
h1 = 0
h2 = 0
if time > 9 then
h1 = math.floor(time/10)
end
h2 = time - (h1*10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[4], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons[h2], self.X[5], 0, self.secW, self.imgH, 1,1,1,1)
-------------------------------------
local temp = round(self.climate:getAirTemperatureForCharacter(self.player))
time = math.floor(temp)
h1 = 0
h2 = 0
if time > 9 then
h1 = math.floor(time/10)
end
h2 = time - (h1*10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[6], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons[h2], self.X[7], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons["dot"], self.X[8], 5, self.midW, self.imgH, 1,1,1,1)
h1 = math.floor((temp - time) * 10)
self:drawTextureScaledAspect(self.menu.icons[h1], self.X[9], 0, self.secW, self.imgH, 1,1,1,1)
self:drawTextureScaledAspect(self.menu.icons["C"], self.X[10], 0, self.secW, self.imgH, 1,1,1,1)
end
function dateImg:center()
local x = getPlayerScreenLeft(self.playerNum)
local y = getPlayerScreenTop(self.playerNum)
local w = getPlayerScreenWidth(self.playerNum)
local h = getPlayerScreenHeight(self.playerNum)
x = x + w / 2
y = y + h / 2
self:setX(x - self.imgW / 2)
self:setY((y - self.rad / 2) + (self.rad * 0.4))
end
function dateImg:new(playerNum, player, radius, clock, menu)
local o = ISUIElement.new(self, 0, 0, radius, radius/3)
o:initialise()
o.clock = clock
o.climate = getClimateManager()
o.rad = radius
o.playerNum = playerNum
o.player = player
o.imgW = o.rad
o.imgH= o.rad/6
o.secW = (o.rad/8)
o.midW = (o.rad/10)
o.X ={
[1] = 0,
[2] = o.secW,
[3] = 2*o.secW,
[4] = 3*o.secW,
[5] = 4*o.secW,
[6] = 6*o.secW,
[7] = 7*o.secW,
[8] = 8*o.secW-2,
[9] = 8*o.secW+(o.midW/2)+2,
[10] = 9*o.secW+(o.midW/2)+2,
}
o.imgW = 10*o.secW+(o.midW/2)
self.menu = menu
o:center()
return o
end
local function getBestClock(player)
local watch = nil
local items = player:getInventory():getAllEval(function(item)
return instanceof(item, "AlarmClock") or instanceof(item, "AlarmClockClothing")
end)
if items and items:size() > 0 then
for i = 0, items:size()-1 do
local item = items:get(i)
if not watch then
watch = item
else
-- Check to always get best clock in inventory
if (not watch:isDigital() or instanceof(item, "AlarmClock")) and (item:isDigital() and instanceof(item, "AlarmClockClothing")) then
watch = item
end
end
if player:isEquipped(item) then
watch = item
break
end
end
end
return watch
end
function SpiffUIOneRadial:start()
self.clock = getBestClock(self.player)
if self.clock then
self.cFace = nil
if spiff.config.experimental and (not self.clock:isDigital() or instanceof(self.clock, "AlarmClock")) then
-- hand clock or non-digital watch
self.cFace = tickWatch:new(self.playerNum, self.rmenu.innerRadius, self.clock, self)
else
self.cFace = timeImg:new(self.playerNum, self.rmenu.innerRadius, self.clock, self)
end
self:addChild(self.cFace)
-- show date/temp
if self.clock:isDigital() and instanceof(self.clock, "AlarmClockClothing") then
self.dFace = dateImg:new(self.playerNum, self.player, self.rmenu.innerRadius, self.clock, self)
self:addChild(self.dFace)
end
end
-- Crafting
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Crafting"), getTexture("media/spifcons/crafting.png"), 0))
-- Drink
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Drink"), InventoryItemFactory.CreateItem("Base.WaterBottleFull"):getTexture(), 1))
-- Eat
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Eat"), InventoryItemFactory.CreateItem("Base.Apple"):getTexture(), 2))
-- Equipment
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Equipment"), getTexture("media/spifcons/inventory.png"), 3))
-- First Aid Craft
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_FirstAidCraft"), InventoryItemFactory.CreateItem("Base.Bandage"):getTexture(), 4))
-- Pills
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Pills"), InventoryItemFactory.CreateItem("Base.PillsAntiDep"):getTexture(), 5))
-- Repair
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Repair"), InventoryItemFactory.CreateItem("Base.Hammer"):getTexture(), 6))
if spiff.config.showSmokeCraftRadial then
local icon = nil
if getActivatedMods():contains('jiggasGreenfireMod') then
icon = InventoryItemFactory.CreateItem("Greenfire.SmokingPipe"):getTexture()
elseif getActivatedMods():contains('Smoker') then
icon = InventoryItemFactory.CreateItem("SM.SMSmokingBlendPipe"):getTexture()
elseif getActivatedMods():contains('MoreCigsMod') then
icon = InventoryItemFactory.CreateItem("Cigs.CigsOpenPackReg"):getTexture()
else
icon = InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture()
end
-- Smoke Craft
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_SmokeCraft"), icon, 7))
end
if spiff.config.showSmokingRadial then
-- Smoke
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_Smoke"), InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture(), 8))
end
if spiff.radials[9] then
self:AddCommand(SpiffUIOneRadialCommand:new(self, "Clothing Action Radial Menu",InventoryItemFactory.CreateItem("Base.Hat_BaseballCapGreen"):getTexture(), 9))
end
if UIManager.getSpeedControls() and not isClient() then
self:AddCommand(SpiffUIOneRadialCommand:new(self, getText("UI_SpiffUI_Radial_GameSpeed"), getTexture("media/ui/Time_Wait_Off.png"), 10))
end
end
function SpiffUIOneRadial:render()
local index = -1
if self.cIndex then -- force show
index = -1
elseif JoypadState.players[self.playerNum+1] then
index = self.rmenu.javaObject:getSliceIndexFromJoypad(self.rmenu.joyfocus.id)
else
index = self.rmenu.javaObject:getSliceIndexFromMouse(self.rmenu:getMouseX(), self.rmenu:getMouseY())
end
self.cmdText = nil
if index > -1 then
if self.rmenu:getSliceCommand(index+1) and self.rmenu:getSliceCommand(index+1)[2] then
self.cmdText = SpiffUI.textwrap(self.rmenu:getSliceCommand(index+1)[2].text,20)
end
end
self:center()
if index > -1 then
if self.cmdText then
-- Draw cmdText at bottom
self:drawText(self.cmdText, self.cTX, self.bTY, 1,1,1,1, UIFont.Medium)
end
end
if self.clock and self.clock:isAlarmSet() then
local sz = self.rmenu.innerRadius/3
local y = self.cFace:getY() - (sz*1.15)
local x = self.cenX - sz/2
if self.clock:isRinging() then
self:drawTextureScaledAspect(self.icons["enable"], x, y, sz, sz, 1,1,1,1)
else
self:drawTextureScaledAspect(self.icons["silence"], x, y, sz, sz, 1,1,1,1)
end
end
end
function SpiffUIOneRadial:new(player)
return spiff.radialmenu.new(self, player)
local o = spiff.radialmenu.new(self, player)
o.icons = {
["mid"] = getTexture("media/spifcons/clock/mid.png"),
["date"] = getTexture("media/spifcons/clock/slash.png"),
["dot"] = getTexture("media/spifcons/clock/dot.png"),
["F"] = getTexture("media/spifcons/clock/F.png"),
["C"] = getTexture("media/spifcons/clock/C.png"),
["silence"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSet.png"),
["enable"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSound.png"),
}
for i=0,9 do
o.icons[i] = getTexture(string.format("media/spifcons/clock/%d.png", i))
end
return o
end
local function OneDown(player)
@@ -70,9 +422,15 @@ local function OneDown(player)
-- if we're not ready, then we're doing an action.
---- do it now
if not SpiffUI.action.ready then
-- Create Menu
local menu = SpiffUIOneRadial:new(player)
menu:display()
if UIManager.getSpeedControls() and UIManager.getSpeedControls():getCurrentGameSpeed() == 0 then
if not isClient() then
spiff.radials[10]:new(player):display()
else
return
end
else
SpiffUIOneRadial:new(player):display()
end
-- Ready for another action
SpiffUI.action.ready = true
end
@@ -81,20 +439,18 @@ end
------------------------------------------
--- For the DPad
local function showRadialMenu(player)
if UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0) then
if not player or player:isDead() then
return
end
if not player or player:isDead() then
return
end
local queue = ISTimedActionQueue.queues[player]
if queue and #queue.queue > 0 then
return false
if UIManager.getSpeedControls() and (UIManager.getSpeedControls():getCurrentGameSpeed() == 0) then
if not isClient() then
spiff.radials[10]:new(player):display()
end
return
end
local menu = SpiffUIOneRadial:new(player)
menu:display()
SpiffUIOneRadial:new(player):display()
end
---- Show the Radial Menu on the Up DPad when there's not a car around
@@ -113,6 +469,7 @@ local function actionInit()
name = 'SpiffUIOneWheel',
key = Keyboard.KEY_CAPITAL, -- ;
queue = true,
allowPause = true,
Down = OneDown
}
SpiffUI:AddKeyBind(bind)

View File

@@ -48,7 +48,7 @@ local function getItems(packs, pills)
local pill = ps:get(i)
if pill then
-- If not found or has less pills
if not pills[pill:getType()] or pills[pill:getType()]:getUsedDelta() > pill:getUsedDelta() then
if not pills[pill:getType()] or (pill.getUsedDelta and pills[pill:getType()]:getUsedDelta() > pill:getUsedDelta()) then
pills[pill:getType()] = pill
end
end
@@ -58,7 +58,7 @@ local function getItems(packs, pills)
return pills
end
function SpiffUIPillsRadial:build()
function SpiffUIPillsRadial:start()
local pills = {}
local packs = ISInventoryPaneContextMenu.getContainers(self.player)
@@ -69,14 +69,19 @@ function SpiffUIPillsRadial:build()
for i,j in pairs(pills) do
self:AddCommand(SpiffUIPillsRadialCommand:new(self, j))
hasPills = true
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Pills")
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.PillsAntiDep"):getTexture()
self.cImgChange[self.page] = true
end
if not hasPills then
self.player:Say(getText("UI_character_SpiffUI_noPills"))
end
end
function SpiffUIPillsRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUIPillsRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_HowManyPills")
return o
end
------------------------------------------

View File

@@ -119,16 +119,12 @@ local function fixerStuff(item, fixing, fixer, player)
end
end
if unavailable then
tooltip.description = tooltip.description .. " <LINE> <RED> " .. "**FUCK YOU, ASSHOLE**"
end
return {
fixing = fixing,
fixer = fixer,
item = item,
tooltip = tooltip,
label = getText("ContextMenu_Repair") .. getItemNameFromFullType(item:getFullType()),
label = getItemNameFromFullType(item:getFullType()),
texture = tooltip.texture,
unavailable = unavailable,
mode = 5
@@ -190,7 +186,7 @@ local function getItems(packs, player)
return repairs
end
function SpiffUIRepairRadial:build()
function SpiffUIRepairRadial:start()
local packs = ISInventoryPaneContextMenu.getContainers(self.player)
local items = getItems(packs, self.player)
@@ -199,14 +195,17 @@ function SpiffUIRepairRadial:build()
if items then
for _,stuff in ipairs(items) do
self:AddCommand(SpiffUIRepairRadialCommand:new(self, stuff))
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Repair")
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.Hammer"):getTexture()
self.cImgChange[self.page] = true
end
else
self.player:Say(getText("UI_character_SpiffUI_noRepair"))
end
end
function SpiffUIRepairRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUIRepairRadial:new(player, prev)
return spiff.radialmenu.new(self, player, prev)
end
local function RepairDown(player)

View File

@@ -92,7 +92,7 @@ local function getRecipes(packs, player)
end
function SpiffUISmokeCraftRadial:build()
function SpiffUISmokeCraftRadial:start()
local recipes = {}
local bags = ISInventoryPaneContextMenu.getContainers(self.player)
@@ -131,6 +131,9 @@ function SpiffUISmokeCraftRadial:build()
for i,j in pairs(recipes) do
self:AddCommand(SpiffUISmokeCraftRadialCommand:new(self, j))
hasCraft = true
self.btmText[self.page] = getText("UI_SpiffUI_Radial_SmokeCraft")
self.centerImg[self.page] = self.icon
self.cImgChange[self.page] = true
end
if not hasCraft then
@@ -138,8 +141,21 @@ function SpiffUISmokeCraftRadial:build()
end
end
function SpiffUISmokeCraftRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUISmokeCraftRadial:new(player, prev)
local o = spiff.radialmenu.new(self, player, prev)
o.askText = getText("UI_amount_SpiffUI_CraftHowMany")
if getActivatedMods():contains('jiggasGreenfireMod') then
o.icon = InventoryItemFactory.CreateItem("Greenfire.SmokingPipe"):getTexture()
elseif getActivatedMods():contains('Smoker') then
o.icon = InventoryItemFactory.CreateItem("SM.SMSmokingBlendPipe"):getTexture()
elseif getActivatedMods():contains('MoreCigsMod') then
o.icon = InventoryItemFactory.CreateItem("Cigs.CigsOpenPackReg"):getTexture()
else
o.icon = InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture()
end
return o
end
local function SmokeCraftDown(player)

View File

@@ -180,7 +180,7 @@ local function getLighter(pack)
end)
end
function SpiffUISmokeRadial:build()
function SpiffUISmokeRadial:start()
-- A lighter is required to be on you
local lighter = getLighter(self.player:getInventory())
@@ -207,11 +207,14 @@ function SpiffUISmokeRadial:build()
-- Build Smokeables
for _,j in pairs(items) do
self:AddCommand(SpiffUISmokeRadialCommand:new(self, j, lighter))
self.centerImg[self.page] = InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture()
self.btmText[self.page] = getText("UI_SpiffUI_Radial_Smoke")
self.cImgChange[self.page] = true
end
end
function SpiffUISmokeRadial:new(player)
return spiff.radialmenu.new(self, player)
function SpiffUISmokeRadial:new(player, prev)
return spiff.radialmenu.new(self, player, prev)
end
local function SmokeDown(player)

View File

@@ -280,6 +280,11 @@ local function SpiffUIOnGameStart()
}
}
}
if spiff.config.hideClock then
UIManager.RemoveElement(UIManager.getClock())
UIManager.RemoveElement(UIManager.getSpeedControls())
end
end
local function SpiffUIBoot()
@@ -301,13 +306,19 @@ local function SpiffUIBoot()
equipShowAllRepairs = false,
equipShowClothingActions = true,
equipShowRecipes = true,
equipShowPlace = true,
equipShowTransfer = true,
repairShowEquipped = false,
repairShowHotbar = true,
firstAidCraftAmount = -1,
eatAmount = 0,
drinkAmount = 0,
eatQuickAmount = 1,
drinkQuickAmount = 1
drinkQuickAmount = 1,
hideClock = false,
experimental = false,
showSmokeRadial = true,
showSmokeCraftRadial = true
}
if ModOptions and ModOptions.getInstance then
@@ -336,6 +347,8 @@ local function SpiffUIBoot()
spiff.config.equipShowAllRepairs = options.equipShowAllRepairs
spiff.config.equipShowClothingActions = options.equipShowClothingActions
spiff.config.equipShowRecipes = options.equipShowRecipes
spiff.config.equipShowPlace = options.equipShowPlace
spiff.config.equipShowTransfer = options.equipShowTransfer
spiff.config.repairShowEquipped = options.repairShowEquipped
spiff.config.repairShowHotbar = options.repairShowHotbar
@@ -348,6 +361,11 @@ local function SpiffUIBoot()
spiff.config.drinkQuickAmount = rOptions.consume[options.drinkQuickAmount]
SpiffUI.equippedItem["Craft"] = not options.hideCraftButton
spiff.config.hideClock = options.hideClock
spiff.config.showSmokeRadial = options.showSmokeRadial
spiff.config.showSmokeCraftRadial = options.showSmokeCraftRadial
end
local function applyGame(data)
@@ -371,6 +389,25 @@ local function SpiffUIBoot()
OnApplyMainMenu = apply,
OnApplyInGame = applyGame,
},
hideClock = {
name = "UI_ModOptions_SpiffUI_hideClock",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_hideClockTooltip"),
OnApplyMainMenu = apply,
OnApplyInGame = applyGame,
},
showSmokeCraftRadial = {
name = "UI_ModOptions_SpiffUI_showSmokeCraftRadial",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
showSmokingRadial = {
name = "UI_ModOptions_SpiffUI_showSmokingRadial",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
eatShowNow = {
name = "UI_ModOptions_SpiffUI_eatShowNow",
default = false,
@@ -538,6 +575,18 @@ local function SpiffUIBoot()
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
equipShowPlace = {
name = "UI_ModOptions_SpiffUI_equipShowPlace",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
equipShowTransfer = {
name = "UI_ModOptions_SpiffUI_equipShowTransfer",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
repairShowEquipped = {
name = "UI_ModOptions_SpiffUI_repairShowEquipped",
default = false,
@@ -574,15 +623,65 @@ local function SpiffUIBoot()
end)
end
spiff.icons = {
[1] = getTexture("media/SpiffUI/1.png"),
[2] = getTexture("media/SpiffUI/1-2.png"),
[3] = getTexture("media/SpiffUI/1-4.png"),
[4] = getTexture("media/SpiffUI/ALL.png"),
[5] = getTexture("media/SpiffUI/FULL.png"),
["unequip"] = getTexture("media/ui/Icon_InventoryBasic.png"),
["drop"] = getTexture("media/ui/Container_Floor.png")
}
-- spiff.icons = {
-- [1] = getTexture("media/spifcons/1.png"),
-- [2] = getTexture("media/spifcons/1-2.png"),
-- [3] = getTexture("media/spifcons/1-4.png"),
-- [4] = getTexture("media/spifcons/ALL.png"),
-- [5] = getTexture("media/spifcons/FULL.png"),
-- ["unequip"] = getTexture("media/ui/Icon_InventoryBasic.png"),
-- ["drop"] = getTexture("media/ui/Container_Floor.png"),
-- ["place"] = getTexture("media/spifcons/place_item.png"),
-- ["defCon"] = getTexture("media/ui/Container_Shelf.png"),
-- ["nextpage"] = getTexture("media/spifcons/nextpage.png"),
-- ["prevpage"] = getTexture("media/spifcons/prevpage.png")
-- }
-- spiff.icons.radials = {
-- [0] = getTexture("media/spifcons/crafting.png"),
-- [1] = InventoryItemFactory.CreateItem("Base.WaterBottleFull"):getTexture(),
-- [2] = InventoryItemFactory.CreateItem("Base.Apple"):getTexture(),
-- [3] = getTexture("media/spifcons/inventory.png"),
-- [4] = InventoryItemFactory.CreateItem("Base.Bandage"):getTexture(),
-- [5] = InventoryItemFactory.CreateItem("Base.PillsAntiDep"):getTexture(),
-- [6] = InventoryItemFactory.CreateItem("Base.Hammer"):getTexture(),
-- [8] = InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture()
-- }
-- if getActivatedMods():contains('jiggasGreenfireMod') then
-- spiff.icons.radials[7] = InventoryItemFactory.CreateItem("Greenfire.SmokingPipe"):getTexture()
-- elseif getActivatedMods():contains('Smoker') then
-- spiff.icons.radials[7] = InventoryItemFactory.CreateItem("SM.SMSmokingBlend"):getTexture()
-- elseif getActivatedMods():contains('MoreCigsMod') then
-- spiff.icons.radials[7] = InventoryItemFactory.CreateItem("Cigs.CigsOpenPackReg"):getTexture()
-- else
-- spiff.icons.radials[7] = InventoryItemFactory.CreateItem("Base.Cigarettes"):getTexture()
-- end
-- -- Alarm icons
-- spiff.icons.alarm = {
-- [30] = getTexture("media/spifcons/alarm/30.png"),
-- [40] = getTexture("media/spifcons/alarm/40.png"),
-- [50] = getTexture("media/spifcons/alarm/50.png"),
-- ["silence"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSet.png"),
-- ["enable"] = getTexture("media/ui/ClockAssets/ClockAlarmLargeSound.png"),
-- ["stop"] = getTexture("media/ui/emotes/no.png"),
-- }
-- -- Do the rest
-- for i=0,23 do
-- spiff.icons.alarm[i] = getTexture("media/spifcons/alarm/" .. string.format("%02d", i) .. ".png")
-- end
-- spiff.icons.clock = {
-- ["mid"] = getTexture("media/spifcons/clock/mid.png"),
-- ["date"] = getTexture("media/spifcons/clock/slash.png"),
-- ["dot"] = getTexture("media/spifcons/clock/dot.png"),
-- ["F"] = getTexture("media/spifcons/clock/F.png"),
-- ["C"] = getTexture("media/spifcons/clock/C.png"),
-- }
-- for i=0,9 do
-- spiff.icons.clock[i] = getTexture(string.format("media/spifcons/clock/%dL.png", i))
-- end
SpiffUI:AddKeyDisable("Toggle Inventory")
SpiffUI:AddKeyDisable("Crafting UI")
@@ -591,9 +690,266 @@ local function SpiffUIBoot()
SpiffUI:AddKeyDefault("Toggle Moveable Panel Mode", 0)
SpiffUI:AddKeyDefault("Display FPS", 0)
SpiffUI:AddKeyDefault("ToggleLuaConsole", 0)
print(getText("UI_Hello_SpiffUI_Radials"))
end
spiff.SpiffUIConfig = function()
return {
options = {
showTooltips = {
name = "UI_ModOptions_SpiffUI_showTooltips",
default = true,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_showTooltips"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
hideCraftButton = {
name = "UI_ModOptions_SpiffUI_hideCraftButton",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = applyGame
},
-- Eat
sep1 = {
name = "UI_optionscreen_binding_SpiffUIEatWheel",
default = "Seperator"
},
eatShowNow = {
name = "UI_ModOptions_SpiffUI_eatShowNow",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_eatShowNow"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
eatAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_Half"),
getText("UI_amount_SpiffUI_Quarter"), getText("UI_amount_SpiffUI_Ask"),
getText("UI_amount_SpiffUI_Full"),
name = "UI_ModOptions_SpiffUI_eatAmount",
default = 4,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
eatQuickAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_Half"),
getText("UI_amount_SpiffUI_Quarter"), getText("UI_amount_SpiffUI_Full"),
name = "UI_ModOptions_SpiffUI_eatQuickAmount",
default = 1,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Drink
sep2 = {
name = "UI_optionscreen_binding_SpiffUIDrinkWheel",
default = "Seperator"
},
drinkShowNow = {
name = "UI_ModOptions_SpiffUI_drinkShowNow",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_drinkShowNow"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
drinkAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_Half"),
getText("UI_amount_SpiffUI_Quarter"), getText("UI_amount_SpiffUI_Ask"),
getText("UI_amount_SpiffUI_Full"),
name = "UI_ModOptions_SpiffUI_drinkAmount",
default = 4,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
drinkQuickAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_Half"),
getText("UI_amount_SpiffUI_Quarter"), getText("UI_amount_SpiffUI_Full"),
name = "UI_ModOptions_SpiffUI_drinkQuickAmount",
default = 1,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Pills
sep3 = {
name = "UI_optionscreen_binding_SpiffUIPillWheel",
default = "Seperator"
},
pillsShowNow = {
name = "UI_ModOptions_SpiffUI_pillsShowNow",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_pillsShowNow"),
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Smoke
sep4 = {
name = "UI_optionscreen_binding_SpiffUISmokeWheel",
default = "Seperator"
},
smokeShowNow = {
name = "UI_ModOptions_SpiffUI_smokeShowNow",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_smokeShowNow"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
smokeShowButts = {
name = "UI_ModOptions_SpiffUI_smokeShowButts",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
smokeShowGum = {
name = "UI_ModOptions_SpiffUI_smokeShowGum",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Smoke Craft
sep5 = {
name = "UI_optionscreen_binding_SpiffUISmokeCraftWheel",
default = "Seperator"
},
smokeCraftShowDismantle = {
name = "UI_ModOptions_SpiffUI_smokeCraftShowDismantle",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
smokeCraftShowCigPacks = {
name = "UI_ModOptions_SpiffUI_smokeCraftShowCigPacks",
default = false,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
smokeCraftAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_All"),
getText("UI_amount_SpiffUI_Ask"),
name = "UI_ModOptions_SpiffUI_smokeCraftAmount",
default = 3,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Craft
sep6 = {
name = "UI_optionscreen_binding_SpiffUICraftWheel",
default = "Seperator"
},
craftSwitch = {
name = "UI_ModOptions_SpiffUI_craftSwitch",
default = true,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_CraftingWheelSwitch"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
craftShowEquipped = {
name = "UI_ModOptions_SpiffUI_craftShowEquipped",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_craftShowEquipped"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
craftShowSmokeables = {
name = "UI_ModOptions_SpiffUI_craftShowSmokeables",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_craftShowSmokeables"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
craftShowMedical = {
name = "UI_ModOptions_SpiffUI_craftShowMedical",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_craftShowMedical"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
craftFilterUnique = {
name = "UI_ModOptions_SpiffUI_craftFilterUnique",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
craftAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_All"),
getText("UI_amount_SpiffUI_Ask"),
name = "UI_ModOptions_SpiffUI_craftAmount",
default = 3,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Equpiment
sep7 = {
name = "UI_optionscreen_binding_SpiffUIEquipmentWheel",
default = "Seperator"
},
equipShowDrop = {
name = "UI_ModOptions_SpiffUI_equipShowDrop",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
equipShowAllRepairs = {
name = "UI_ModOptions_SpiffUI_equipShowAllRepairs",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_equipShowAllRepairs"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
equipShowClothingActions = {
name = "UI_ModOptions_SpiffUI_equipShowClothingActions",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
equipShowRecipes = {
name = "UI_ModOptions_SpiffUI_equipShowRecipes",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- Repair
sep8 = {
name = "UI_optionscreen_binding_SpiffUIRepairWheel",
default = "Seperator"
},
repairShowEquipped = {
name = "UI_ModOptions_SpiffUI_repairShowEquipped",
default = false,
tooltip = getText("UI_ModOptions_SpiffUI_tooltip_repairShowEquipped"),
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
repairShowHotbar = {
name = "UI_ModOptions_SpiffUI_repairShowHotbar",
default = true,
OnApplyMainMenu = apply,
OnApplyInGame = apply
},
-- First Aid Craft
sep9 = {
name = "UI_optionscreen_binding_SpiffUIFirstAidCraftWheel",
default = "Seperator"
},
firstAidCraftAmount = {
getText("UI_amount_SpiffUI_One"), getText("UI_amount_SpiffUI_All"),
getText("UI_amount_SpiffUI_Ask"),
name = "UI_ModOptions_SpiffUI_firstAidCraftAmount",
default = 3,
OnApplyMainMenu = apply,
OnApplyInGame = apply
}
},
name = getText("UI_Name_SpiffUI_Radials"),
columns = 3
}
end
spiff.Boot = SpiffUIBoot
spiff.Start = SpiffUIOnGameStart

View File

@@ -2,7 +2,7 @@ UI_EN = {
-- SpiffUI
UI_Hello_SpiffUI = "Hello SpiffUI!",
UI_Name_SpiffUI = "SpiffUI",
UI_optionscreen_binding_SpiffUI = "SpiffUI"
UI_optionscreen_binding_SpiffUI = "SpiffUI",
UI_ModOptions_SpiffUI_applyNewKeybinds = "Set SpiffUI Recommended Keybinds",
UI_ModOptions_SpiffUI_Modal_applyNewKeybinds = "<CENTRE><SIZE:medium> Set SpiffUI Keybinds <LINE><LINE><LEFT><SIZE:small> Sets the following Keybinds: <LINE>",
@@ -63,7 +63,7 @@ UI_EN = {
UI_ModOptions_SpiffUI_tooltip_eatShowNow = "Note: Disables Quick Eat Food Action",
UI_ModOptions_SpiffUI_tooltip_craftShowMedical = "Note: Some Recipes may still filter through. Consider using the First Aid Crafting Menu instead!",
UI_ModOptions_SpiffUI_tooltip_craftShowMedical = "Note: Some Recipes may still filter through. Consider using the Medical Craft Menu instead!",
UI_ModOptions_SpiffUI_tooltip_craftShowEquipped = "Note: Recipes on worn items can be done from the Equipment Menu. Items in your hand will still show recipes",
UI_ModOptions_SpiffUI_tooltip_craftShowSmokeables = "Consider using the Smoke Crafting Menu instead!"
@@ -88,13 +88,13 @@ UI_EN = {
UI_optionscreen_binding_SpiffUIPillWheel = "Pill Radial",
UI_optionscreen_binding_SpiffUIDrinkWheel = "Drink Radial",
UI_optionscreen_binding_SpiffUIEatWheel = "Eat Radial",
UI_optionscreen_binding_SpiffUIEatWheel = "Food Radial",
UI_optionscreen_binding_SpiffUISmokeWheel = "Smoke Radial",
UI_optionscreen_binding_SpiffUISmokeCraftWheel = "Smoke Craft Radial",
UI_optionscreen_binding_SpiffUICraftWheel = "Crafting UI/Radial",
UI_optionscreen_binding_SpiffUIEquipmentWheel = "Inventory Toggle/Radial",
UI_optionscreen_binding_SpiffUIRepairWheel = "Repair Radial",
UI_optionscreen_binding_SpiffUIFirstAidCraftWheel = "First Aid Craft",
UI_optionscreen_binding_SpiffUIFirstAidCraftWheel = "Medical Craft",
UI_optionscreen_binding_SpiffUIOneWheel = "SpiffUI Radial",
UI_character_SpiffUI_noLighter = "I need a lighter.",
@@ -115,5 +115,60 @@ UI_EN = {
UI_character_SpiffUI_noPillsQuick = "I have no ",
UI_character_SpiffUI_noPills = "There's no pills",
UI_character_SpiffUI_noPillsNeed = "I'm not in any Mood."
UI_character_SpiffUI_noPillsNeed = "I'm not in any Mood.",
-------------------------------------------
-- NEW v8:
UI_radial_SpiffUI_Previous = "Previous",
UI_radial_SpiffUI_Next = "Next",
UI_alarm_SpiffUI_Silence = "Silence Alarm",
UI_alarm_SpiffUI_Enable = "Enable Alarm",
UI_alarm_SpiffUI_Reset = "Reset Alarm",
UI_alarm_SpiffUI_HH = "HH",
UI_alarm_SpiffUI_MM = "MM",
-- These next few include formatting so that the text lines up more or less.
---- EX: Current Alarm
---- HH:MM
-- I can't do this with richtext, and there's only one label (for simplicity) so brute force it is
-- Sorry to all translators for any tweaks or weirdness you may have to do
-- Hour:Minutes or HH:MM if no alarm
UI_alarm_SpiffUI_CurrentF = "Current Alarm \n %1:%2",
-- HH:MM
UI_alarm_SpiffUI_SetHourF = "SET HOUR \n %1:%2",
-- Hour:MM
UI_alarm_SpiffUI_SetMinuteF = "SET MINUTE \n %1:%2",
UI_equip_SpiffUI_FirearmRadial = "Firearm Radial",
UI_SpiffUI_Radial_Equipment = "Equipment",
UI_SpiffUI_Radial_Crafting = "Crafting",
UI_SpiffUI_Radial_Drink = "Drink",
UI_SpiffUI_Radial_Eat = "Food",
UI_SpiffUI_Radial_FirstAidCraft = "Medical Craft",
UI_SpiffUI_Radial_Pills = "Pills",
UI_SpiffUI_Radial_Repair = "Repair",
UI_SpiffUI_Radial_Smoke = "Smoke",
UI_SpiffUI_Radial_SmokeCraft = "Smoke Craft",
UI_amount_SpiffUI_CraftHowMany = "Craft How Many",
UI_amount_SpiffUI_EatHowMuch = "Eat How Much",
UI_amount_SpiffUI_DrinkHowMuch = "Drink How Much",
UI_amount_SpiffUI_HowManyPills = "Take How Many Pills",
UI_optionscreen_binding_SpiffUIGSWheel = "Game Speed Radial",
UI_SpiffUI_Radial_GameSpeed = "Game Speed",
UI_ModOptions_SpiffUI_equipShowRecipes = "Show Recipes (Equipment)",
UI_ModOptions_SpiffUI_hideClock = "Hide Vanilla Clock",
UI_ModOptions_SpiffUI_hideClockTooltip = "RECOMMENDED: The clock is now present in the SpiffUI Radial. A restart is required if in-game.",
UI_ModOptions_SpiffUI_equipShowPlace = "Show Place Action (Equipment)",
UI_ModOptions_SpiffUI_equipShowTransfer = "Show Transfer Action (Equipment)",
UI_ModOptions_SpiffUI_showSmokeCraftRadial = "Show Smoke Craft Radial (SpiffUI)",
UI_ModOptions_SpiffUI_showSmokingRadial = "Show Smoking Radial (SpiffUI)"
}

View File

@@ -1,122 +1,121 @@
UI_RU = {
-- Translation By: fourteensix
-- Перевод: fourteensix
-- SpiffUI Radial
-- SpiffUI Radial
UI_Hello_SpiffUI = "Hello SpiffUI!",
UI_Name_SpiffUI = "SpiffUI",
UI_optionscreen_binding_SpiffUI = "SpiffUI"
UI_ModOptions_SpiffUI_applyNewKeybinds = "Установите рекомендуемые сочетания клавиш SpiffUI",
UI_ModOptions_SpiffUI_Modal_applyNewKeybinds = "<CENTRE><SIZE:medium> Установить привязки клавиш SpiffUI <LINE><LINE><LEFT><SIZE:small> Устанавливает следующие сочетания клавиш: <LINE>",
UI_ModOptions_SpiffUI_Modal_aNKChild = " <LINE> %1 для: [%2] ",
UI_ModOptions_SpiffUI_applyNewKeybinds = "Установите рекомендуемые сочетания клавиш SpiffUI",
UI_ModOptions_SpiffUI_Modal_applyNewKeybinds = "<CENTRE><SIZE:medium> Установить привязки клавиш SpiffUI <LINE><LINE><LEFT><SIZE:small> Устанавливает следующие сочетания клавиш: <LINE>",
UI_ModOptions_SpiffUI_Modal_aNKChild = " <LINE> %1 для: [%2] ",
UI_ModOptions_SpiffUI_runAllResets = "Запустить полный сброс SpiffUI",
UI_ModOptions_SpiffUI_tooltip_runResets = "Работает только в игре!",
UI_ModOptions_SpiffUI_Modal_runResets = "<CENTRE><SIZE:medium> Сброс SpiffUI <LINE><LINE><LEFT><SIZE:small> Будет сброшено следующее: <LINE>",
UI_ModOptions_SpiffUI_runAllResets = "Запустить полный сброс SpiffUI",
UI_ModOptions_SpiffUI_tooltip_runResets = "Работает только в игре!",
UI_ModOptions_SpiffUI_Modal_runResets = "<CENTRE><SIZE:medium> Сброс SpiffUI <LINE><LINE><LEFT><SIZE:small> Будет сброшено следующее: <LINE>",
-- SpiffUI -- Radials
UI_Hello_SpiffUI_Radials = "Hello SpiffUI - Radials",
UI_Name_SpiffUI_Radials = "SpiffUI - Radials",
UI_ModOptions_SpiffUI_showTooltips = "Показать подсказки",
UI_ModOptions_SpiffUI_hideCraftButton = "Скрыть кнопку крафта",
UI_ModOptions_SpiffUI_showTooltips = "Показать подсказки",
UI_ModOptions_SpiffUI_hideCraftButton = "Скрыть кнопку крафта",
UI_ModOptions_SpiffUI_smokeShowButts = "Показать окурки (мод Smoke)",
UI_ModOptions_SpiffUI_smokeShowGum = "Показать жвачку (мод Smoke)",
UI_ModOptions_SpiffUI_smokeShowNow = "Показать радиальное меню при нажатии (мод Smoke)",
UI_ModOptions_SpiffUI_smokeShowButts = "Показать окурки (мод Smoke)",
UI_ModOptions_SpiffUI_smokeShowGum = "Показать жвачку (мод Smoke)",
UI_ModOptions_SpiffUI_smokeShowNow = "Показать радиальное меню при нажатии (мод Smoke)",
UI_ModOptions_SpiffUI_pillsShowNow = "Показать радиальное меню при нажатии (Таблетки)",
UI_ModOptions_SpiffUI_pillsShowNow = "Показать радиальное меню при нажатии (Таблетки)",
UI_ModOptions_SpiffUI_eatAmount = "Количество еды (Еда)",
UI_ModOptions_SpiffUI_eatQuickAmount = "Количество еды для быстрого перекуса (Еда)",
UI_ModOptions_SpiffUI_eatShowNow = "Показать радиальное меню при нажатии (Еда)",
UI_ModOptions_SpiffUI_eatAmount = "Количество еды (Еда)",
UI_ModOptions_SpiffUI_eatQuickAmount = "Количество еды для быстрого перекуса (Еда)",
UI_ModOptions_SpiffUI_eatShowNow = "Показать радиальное меню при нажатии (Еда)",
UI_ModOptions_SpiffUI_drinkAmount = "Количество питья (Напитки)",
UI_ModOptions_SpiffUI_drinkQuickAmount = "Количество напитка для быстрого удаления жажды (Напитки)",
UI_ModOptions_SpiffUI_drinkShowNow = "Показать радиальное меню при нажатии (Напитки)",
UI_ModOptions_SpiffUI_drinkAmount = "Количество питья (Напитки)",
UI_ModOptions_SpiffUI_drinkQuickAmount = "Количество напитка для быстрого удаления жажды (Напитки)",
UI_ModOptions_SpiffUI_drinkShowNow = "Показать радиальное меню при нажатии (Напитки)",
UI_ModOptions_SpiffUI_smokeCraftShowDismantle = "Показать рецепты разборки (крафт мода Smoke)",
UI_ModOptions_SpiffUI_smokeCraftShowCigPacks = "Показать пачки сигарет (крафт мода Smoke)",
UI_ModOptions_SpiffUI_smokeCraftAmount = "Количество для создания (крафт мода Smoke)",
UI_ModOptions_SpiffUI_smokeCraftShowDismantle = "Показать рецепты разборки (крафт мода Smoke)",
UI_ModOptions_SpiffUI_smokeCraftShowCigPacks = "Показать пачки сигарет (крафт мода Smoke)",
UI_ModOptions_SpiffUI_smokeCraftAmount = "Количество для создания (крафт мода Smoke)",
UI_ModOptions_SpiffUI_craftSwitch = "Показать радиальное меню при нажатии (Крафт)",
UI_ModOptions_SpiffUI_craftShowEquipped = "Показать рецепты на экипированных предметах (Крафт)",
UI_ModOptions_SpiffUI_craftShowSmokeables = "Показать рецепты для курения (Крафт)",
UI_ModOptions_SpiffUI_craftShowMedical = "Показать медицинские рецепты (Крафт)",
UI_ModOptions_SpiffUI_craftAmount = "Количество для крафта (Крафт)",
UI_ModOptions_SpiffUI_craftFilterUnique = "Фильтр повторяющихся рецептов (Крафт)",
UI_ModOptions_SpiffUI_craftSwitch = "Показать радиальное меню при нажатии (Крафт)",
UI_ModOptions_SpiffUI_craftShowEquipped = "Показать рецепты на экипированных предметах (Крафт)",
UI_ModOptions_SpiffUI_craftShowSmokeables = "Показать рецепты для курения (Крафт)",
UI_ModOptions_SpiffUI_craftShowMedical = "Показать медицинские рецепты (Крафт)",
UI_ModOptions_SpiffUI_craftAmount = "Количество для крафта (Крафт)",
UI_ModOptions_SpiffUI_craftFilterUnique = "Фильтр повторяющихся рецептов (Крафт)",
UI_ModOptions_SpiffUI_equipShowDrop = "Показать действие дропа (Экипировка)",
UI_ModOptions_SpiffUI_equipShowAllRepairs = "Показать недоступные параметры ремонта (Экипировка)",
UI_ModOptions_SpiffUI_equipShowClothingActions = "Показать действия с дополнительной одеждой (Экипировка)",
UI_ModOptions_SpiffUI_equipShowRecipes = "Показать рецепты (Экипировка)",
UI_ModOptions_SpiffUI_equipShowDrop = "Показать действие дропа (Экипировка)",
UI_ModOptions_SpiffUI_equipShowAllRepairs = "Показать недоступные параметры ремонта (Экипировка)",
UI_ModOptions_SpiffUI_equipShowClothingActions = "Показать действия с дополнительной одеждой (Экипировка)",
UI_ModOptions_SpiffUI_equipShowRecipes = "Показать рецепты (Экипировка)",
UI_ModOptions_SpiffUI_repairShowEquipped = "Показать ремонт экипированных предметов (Ремонт)",
UI_ModOptions_SpiffUI_repairShowHotbar = "Показать ремонт предметов в хотбаре (Ремонт)",
UI_ModOptions_SpiffUI_repairShowEquipped = "Показать ремонт экипированных предметов (Ремонт)",
UI_ModOptions_SpiffUI_repairShowHotbar = "Показать ремонт предметов в хотбаре (Ремонт)",
UI_ModOptions_SpiffUI_firstAidCraftAmount = "Количество для крафта (Крафт медикаментов)",
UI_ModOptions_SpiffUI_firstAidCraftAmount = "Количество для крафта (Крафт медикаментов)",
UI_ModOptions_SpiffUI_tooltip_showTooltips = "Показывать всплывающие подсказки в радиальных меню для предметов, рецептов и ремонтов (Рекомендуется)",
UI_ModOptions_SpiffUI_tooltip_pillsShowNow = "Примечание: отключает действие *Быстрые таблетки*",
UI_ModOptions_SpiffUI_tooltip_drinkShowNow = "Примечание: отключает действие *Быстрое питьё воды*",
UI_ModOptions_SpiffUI_tooltip_showTooltips = "Показывать всплывающие подсказки в радиальных меню для предметов, рецептов и ремонтов (Рекомендуется)",
UI_ModOptions_SpiffUI_tooltip_eatShowNow = "Примечание: отключает действие *Быстро съесть еду*",
UI_ModOptions_SpiffUI_tooltip_craftShowMedical = "Примечание: некоторые рецепты могут по-прежнему фильтроваться. Вместо этого рассмотрите возможность использования меню крафта первой помощи!",
UI_ModOptions_SpiffUI_tooltip_craftShowEquipped = "Примечание: рецепты на изношенные предметы можно сделать из меню снаряжения. Предметы в вашей руке по-прежнему будут показывать рецепты",
UI_ModOptions_SpiffUI_tooltip_craftShowSmokeables = "Вместо этого рассмотрите возможность использования меню крафта мода Smoke!"
UI_ModOptions_SpiffUI_tooltip_pillsShowNow = "Примечание: отключает действие *Быстрые таблетки*",
UI_ModOptions_SpiffUI_tooltip_smokeShowNow = "Примечание: отключает мод AutoSmoke для быстрого курения",
UI_ModOptions_SpiffUI_tooltip_drinkShowNow = "Примечание: отключает действие *Быстрое питьё воды*",
UI_ModOptions_SpiffUI_tooltip_CraftingWheelSwitch = "Нажмите, чтобы открыть радиальное меню, удерживайте, чтобы открыть окно крафта",
UI_ModOptions_SpiffUI_tooltip_eatShowNow = "Примечание: отключает действие *Быстро съесть еду*",
UI_ModOptions_SpiffUI_tooltip_equipShowAllRepairs = "Показать параметры ремонта, даже если требуемых предметов нет в вашем инвентаре",
UI_ModOptions_SpiffUI_tooltip_repairShowEquipped = "Ремонт снаряжения можно выполнить из меню снаряжения.",
UI_ModOptions_SpiffUI_tooltip_craftShowMedical = "Примечание: некоторые рецепты могут по-прежнему фильтроваться. Вместо этого рассмотрите возможность использования меню крафта первой помощи!",
UI_ModOptions_SpiffUI_tooltip_craftShowEquipped = "Примечание: рецепты на изношенные предметы можно сделать из меню снаряжения. Предметы в вашей руке по-прежнему будут показывать рецепты",
UI_ModOptions_SpiffUI_tooltip_craftShowSmokeables = "Вместо этого рассмотрите возможность использования меню крафта мода Smoke!"
UI_amount_SpiffUI_Ask = "Спросить",
UI_amount_SpiffUI_All = "Всё",
UI_amount_SpiffUI_Full = "Диетолог",
UI_ModOptions_SpiffUI_tooltip_smokeShowNow = "Примечание: отключает мод AutoSmoke для быстрого курения",
UI_ModOptions_SpiffUI_tooltip_CraftingWheelSwitch = "Нажмите, чтобы открыть радиальное меню, удерживайте, чтобы открыть окно крафта",
UI_ModOptions_SpiffUI_tooltip_equipShowAllRepairs = "Показать параметры ремонта, даже если требуемых предметов нет в вашем инвентаре",
UI_ModOptions_SpiffUI_tooltip_repairShowEquipped = "Ремонт снаряжения можно выполнить из меню снаряжения.",
UI_amount_SpiffUI_Ask = "Спросить",
UI_amount_SpiffUI_All = "Всё",
UI_amount_SpiffUI_Full = "Диетолог",
UI_amount_SpiffUI_One = "1",
UI_amount_SpiffUI_Half = "1/2",
UI_amount_SpiffUI_Quarter = "1/4",
UI_radial_SpiffUI_Accessories = "Аксессуары",
UI_radial_SpiffUI_Hotbar = "Хотбар",
UI_radial_SpiffUI_Transfer = "Переместить на ",
UI_radial_SpiffUI_Accessories = "Аксессуары",
UI_radial_SpiffUI_Hotbar = "Хотбар",
UI_radial_SpiffUI_Transfer = "Переместить на ",
UI_optionscreen_binding_SpiffUIPillWheel = "Таблетки в меню",
UI_optionscreen_binding_SpiffUIDrinkWheel = "Напитки в меню",
UI_optionscreen_binding_SpiffUIEatWheel = "Еда в меню",
UI_optionscreen_binding_SpiffUISmokeWheel = "Курение в меню",
UI_optionscreen_binding_SpiffUISmokeCraftWheel = "Крафт мода Smoke в меню",
UI_optionscreen_binding_SpiffUICraftWheel = "Интерфейс крафта/радиальное меню",
UI_optionscreen_binding_SpiffUIEquipmentWheel = "Переключатель инвентаря/Радиальное меню",
UI_optionscreen_binding_SpiffUIRepairWheel = "Ремонт в радиальном меню",
UI_optionscreen_binding_SpiffUIFirstAidCraftWheel = "Крафт для первой помощи",
UI_optionscreen_binding_SpiffUIOneWheel = "SpiffUI Радиальное меню",
UI_optionscreen_binding_SpiffUIPillWheel = "Таблетки в меню",
UI_optionscreen_binding_SpiffUIDrinkWheel = "Напитки в меню",
UI_optionscreen_binding_SpiffUIEatWheel = "Еда в меню",
UI_optionscreen_binding_SpiffUISmokeWheel = "Курение в меню",
UI_optionscreen_binding_SpiffUISmokeCraftWheel = "Крафт мода Smoke в меню",
UI_optionscreen_binding_SpiffUICraftWheel = "Интерфейс крафта/радиальное меню",
UI_optionscreen_binding_SpiffUIEquipmentWheel = "Переключатель инвентаря/Радиальное меню",
UI_optionscreen_binding_SpiffUIRepairWheel = "Ремонт в радиальном меню",
UI_optionscreen_binding_SpiffUIFirstAidCraftWheel = "Крафт для первой помощи",
UI_optionscreen_binding_SpiffUIOneWheel = "SpiffUI Радиальное меню",
UI_character_SpiffUI_noLighter = "Мне нужна зажигалка.",
UI_character_SpiffUI_noSmokes = "Нечего курить.",
UI_character_SpiffUI_noLighter = "Мне нужна зажигалка.",
UI_character_SpiffUI_noSmokes = "Нечего курить.",
UI_character_SpiffUI_noCraft = "Крафтить нечего.",
UI_character_SpiffUI_noCraft = "Крафтить нечего.",
UI_character_SpiffUI_noEquip = "Я Голый!",
UI_character_SpiffUI_noEquip = "Я Голый!",
UI_character_SpiffUI_notHungry = "Я не голоден.",
UI_character_SpiffUI_noFood = "Нет еды, чтобы поесть.",
UI_character_SpiffUI_notHungry = "Я не голоден.",
UI_character_SpiffUI_noFood = "Нет еды, чтобы поесть.",
UI_character_SpiffUI_notThirsty = "Я не хочу пить.",
UI_character_SpiffUI_noDrinks = "Пить нечего.",
UI_character_SpiffUI_notThirsty = "Я не хочу пить.",
UI_character_SpiffUI_noDrinks = "Пить нечего.",
UI_character_SpiffUI_noRepair = "Ремонтировать нечего.",
UI_character_SpiffUI_noRepairItems = "Я не могу отремонтировать это.",
UI_character_SpiffUI_noRepair = "Ремонтировать нечего.",
UI_character_SpiffUI_noRepairItems = "Я не могу отремонтировать это.",
UI_character_SpiffUI_noPillsQuick = "У меня нет ",
UI_character_SpiffUI_noPills = "Нет таблеток",
UI_character_SpiffUI_noPillsNeed = "Я не в настроении.",
}
UI_character_SpiffUI_noPillsQuick = "У меня нет ",
UI_character_SpiffUI_noPills = "Нет таблеток",
UI_character_SpiffUI_noPillsNeed = "Я не в настроении."
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -131,6 +131,12 @@ description=
description=Each Radial has its own Configuration as well. This is expanded upon in the Discussion [url=https://steamcommunity.com/workshop/filedetails/discussion/2802525922/3273564019257617796]SpiffUI Radials and their Configurations[/url].
description=
description=[h2]Translations[/h2]
description=[list]
description=[*]English
description=[*]Russian - [url=https://steamcommunity.com/profiles/76561198433229952]fourteensix[/url]
description=[*]Spanish - [url=https://steamcommunity.com/id/deadinside11]ElDoktor[/url]
description=[/list]
description=
description=Item Names, Recipes, and others use the built-in translations; mods must include this. If you would like to contribute a translation, please submit a pull request on [url=https://github.com/hlfstr/pz-mods]GitHub![/url] I will happily give credit!
tags=Build 41;Food;Interface;Silly/Fun
visibility=public