Update CARM SUI-Inv and add SUI-Rads

This commit is contained in:
davidh
2022-05-11 03:16:11 -05:00
parent d742e5fad1
commit d9f4c8bd13
48 changed files with 5225 additions and 95 deletions

View File

@@ -25,7 +25,7 @@
------------------------------------------
-- Set the SpiffUI lib version
local SPIFFUI_VERSION = 1 --<<< DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING
local SPIFFUI_VERSION = 2 --<<< 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
@@ -155,6 +155,7 @@ SpiffUI.preCheck = function()
end
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
@@ -488,13 +489,14 @@ function SpiffUI:ModOptions()
end
end
-- Due to SpiffUI being loaded as one of the first mods, it will be one of the first to Boot
---- We don't want that, we want this to be last. So, this makes sure of that.
-- At first I had this run only once, but apparently when there's only 1 mod this breaks
---- So, OnPostBoot is added to run things last
SpiffUI.firstBoot = function()
Events.OnGameBoot.Add(function()
SpiffUI:OnGameBoot()
SpiffUI:OnPostBoot()
end)
Events.OnGameBoot.Remove(SpiffUI.firstBoot)
--Events.OnGameBoot.Remove(SpiffUI.firstBoot)
SpiffUI:OnGameBoot()
end
function SpiffUI:OnGameBoot()
@@ -513,7 +515,7 @@ function SpiffUI:OnGameBoot()
for i = 1, #keyBinding do
if keyBinding[i].value == name then
table.remove(keyBinding, i)
print("Removed Keybind: " .. name)
--print("Removed Keybind: " .. name)
found = true
break
end
@@ -524,7 +526,7 @@ function SpiffUI:OnGameBoot()
for i,bind in ipairs(SpiffUI.KeyBinds) do
if bind.name == name then
table.remove(SpiffUI.KeyBinds, i)
print("Removed SpiffUI Keybind: " .. name)
--print("Removed SpiffUI Keybind: " .. name)
break
end
end
@@ -547,6 +549,21 @@ function SpiffUI:OnGameBoot()
end
function SpiffUI:OnPostBoot()
-- Let's Remove some keys possibly added by mods
for name,_ in pairs(SpiffUI.KeyDisables) do
local found = false
for i = 1, #keyBinding do
if keyBinding[i].value == name then
table.remove(keyBinding, i)
--print("Removed Keybind: " .. name)
found = true
break
end
end
end
end
function SpiffUI:OnCreatePlayer(id)
for _,j in ipairs(SpiffUI) do
local mod = SpiffUI[j]

View File

@@ -131,18 +131,18 @@ function ISInventoryPage:update()
self.inventory:getParent():setHighlightColor(getCore():getObjectHighlitedColor());
self.coloredInv = self.inventory;
end
if not self.isCollapsed and self.inventoryPane.inventory:getType() == "floor" and self.inventoryPane.inventory:getItems():isEmpty() then
if self.autoHide and self.holdOpen and not self.prevMouse then
self:Collapse(true, "No Floor Items")
end
end
end
------------------------------------------
self.collapseCounter = 0
self.wasVisible = not self.isCollapsed
if not self.onCharacter and not self.isCollapsed and self.inventoryPane.inventory:getType() == "floor" and self.inventoryPane.inventory:getItems():isEmpty() then
if self.autoHide and self.holdOpen and not self.prevMouse and not spiff.config.mouseHide then
self:Collapse(true, "No Floor Items")
end
end
if not self.isCollapsed then
-- When we stop dragging, set panel to close after next mouseout or click, or set to tie with our friend
if not self.fVisible and (not ISMouseDrag.dragging or #ISMouseDrag.dragging == 0) and self.fromDrag then
@@ -173,7 +173,7 @@ function ISInventoryPage:update()
--- prevmouse is to not have this happen immediately, we need a tick for other logic to kick in on state change
--- holdOpen should prevent the window from closing if we click on an object
--- We do this here so we can check the mouse location with our buffer
if not self.fVisible and self.autoHide and not self.prevMouse and not self.holdOpen and not self.fromDrag and not self.toDrag and not self.wasDrag and not self:isMouseInBuffer() then
if not self.fVisible and not spiff.config.mouseHide and self.autoHide and not self.prevMouse and not self.holdOpen and not self.fromDrag and not self.toDrag and not self.wasDrag and not self:isMouseInBuffer() then
self:Collapse(true, "Autohide")
end
@@ -463,6 +463,7 @@ function ISInventoryPage:InitSUI()
self.wasDrag = false
self.wasVisible = false
--self.mouseHide = spiff.config.mouseHide
end
function ISInventoryPage:SUIReset()

View File

@@ -7,7 +7,8 @@ SpiffUI = SpiffUI or {}
local spiff = SpiffUI:Register("inventory")
spiff.config = {
enabled = true
enabled = true,
mouseHide = false
}
local function SpiffUIBoot()
@@ -16,6 +17,7 @@ local function SpiffUIBoot()
local options = data.settings.options
-- Set options
spiff.config.enabled = options.enableInv
spiff.config.mouseHide = options.mouseHide
SpiffUI.equippedItem["Inventory"] = not options.hideInv
end
@@ -40,6 +42,12 @@ local function SpiffUIBoot()
OnApplyMainMenu = apply,
OnApplyInGame = applyGame,
},
mouseHide = {
name = "UI_ModOptions_SpiffUI_Inv_mouseHide",
default = false,
OnApplyMainMenu = apply,
OnApplyInGame = apply,
},
},
mod_id = "SpiffUI - Inventory",
mod_shortname = "SpiffUI-Inv",

View File

@@ -23,5 +23,7 @@ UI_EN = {
UI_ModOptions_SpiffUI_Inv_hideInv = "Hide Inventory Button",
UI_ModOptions_SpiffUI_Inv_mouseHide = "Only Autohide on Mouse Click",
UI_optionscreen_binding_SpiffUI_Inv = "Toggle Inventory"
}

View File

@@ -0,0 +1,31 @@
UI_RU = {
-- SpiffUI
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_runAllResets = "Запустить полный сброс SpiffUI",
UI_ModOptions_SpiffUI_tooltip_runResets = "Работает только в игре!",
UI_ModOptions_SpiffUI_Modal_runResets = "<CENTRE><SIZE:medium> Сброс SpiffUI <LINE><LINE><LEFT><SIZE:small> Будут сброшены: <LINE>",
-- SpiffUI -- Inventory
UI_Hello_SpiffUI_Inv = "Hello SpiffUI - Инвентарь!",
UI_Name_SpiffUI_Inv = "SpiffUI - Инвентарь",
UI_ModOptions_SpiffUI_Inv_enable = "Включить инвентарь SpiffUI",
UI_ModOptions_SpiffUI_Inv_tooltip_enable = "Примечание. В игре требуется перезагрузка!",
UI_ModOptions_SpiffUI_Inv_hideInv = "Скрыть кнопку инвентаря",
UI_ModOptions_SpiffUI_Inv_mouseHide = "Только автоматическое скрытие по щелчку мыши",
UI_optionscreen_binding_SpiffUI_Inv = "Переключить инвентарь",
}

View File

@@ -4,32 +4,33 @@
## About SpiffUI
SpiffUI is an attempt to make the Project Zomboid in-game UI more player-friendly. The UI currently acts like a windowing system overtop a video game; similar in behavior to the Openbox/Fluxbox windowing system for a Linux Desktop. This is works as the complexity of the game warrants this, but with little tweaks it can be so much better.
SpiffUI (pronounced "Spiffy") is an attempt to make the Project Zomboid in-game UI more player-friendly. The UI currently acts like a windowing system overtop a video game; similar in behavior to the Openbox/Fluxbox windowing system for a Linux Desktop. This works as the complexity of the game warrants this, but with little tweaks it can be so much better.
There will be several independent modules released under the SpiffUI name that each change/add their own features.
There will be several independent modules released under the SpiffUI name that each change/add their own features. This allows me to make modifications to these independently, and allow you, the user, to choose which are active.
**Supports B41+. Works in Multiplayer**
## SpiffUI - Inventory
Changes the default behavior of the Loot and Player Inventories in how they are displayed.
The goal of this mod is to change the default behavior of the Loot and Player Inventories in how they are displayed. The Inventory/Loot Panel rules should make sense in normal usage, but may take a small adjustment to your playstyle. Try it for yourself and let me know what you think!
For starters, the Inventory and Loot panels are hidden until the player triggers an interaction.
### Features
The Inventory is now bound to the "Tab" key by default. Pressing Tab will open/close both the inventory and loot panels for the player, the panels cannot be closed when open in this way until you press the key again.
- The Inventory and Loot panels are hidden until the player triggers an interaction.
Bringing the mouse to the top of the screen will show the inventory or loot panel allowing easy access; you can freely switch between which panel is open by moving the mouse. The panel is automatically hidden after losing mouse focus.
- The Inventory is now bound to the "Tab" key by default. Pressing Tab will open/close both the inventory and loot panels for the player, the panels cannot be closed when open in this way until you press the key again.
Panels are no longer able to be resized horizontally or moved around. They are instead locked to the top of the screen in the default location, and can only be resized vertically. The "Close", "Info", "Collapse", and "Pin" buttons are also hidden.
- Bringing the mouse to the top of the screen will show the inventory or loot panel allowing easy access; you can freely switch between which panel is open by moving the mouse. The panel is automatically hidden after losing mouse focus.
Clicking on a world container will show the loot panel and lock it open until the window is interacted with, an external mouse click, or if you walk away changing the loot panel to a blank floor.
- Panels are no longer able to be resized horizontally or moved around. They are instead locked to the top of the screen in the default location, and can only be resized vertically. The "Close", "Info", "Collapse", and "Pin" buttons are also hidden.
Even when "hidden", the panels are only a small mouse-movement or key-press away!
- Clicking on a world container will show the loot panel and lock it open until the window is interacted with, an external mouse click, or if you walk away changing the loot panel to a blank floor.
Option to Hide the "Inventory" button in the left panel. (I know the keybind, I don't need it)
- Option to Hide the "Inventory" button in the left panel. (I know the keybind, I don't need it)
The Inventory/Loot Panel rules should make sense in normal usage, but may take a small adjustment to your playstyle. Try it for yourself and let me know what you think!
### Controllers
If playing with a controller the new behavior will not apply and the inventory will behave like Vanilla.
If playing with a controller these rules will not apply.
**NOTE:** I HIGHLY recommend that you run both the "Set SpiffUI Recommended Keybinds" and "Run All SpiffUI Resets" after you first install and start the game!
## SpiffUI Configuration
@@ -62,8 +63,15 @@ If ModOptions is installed (Recommended) SpiffUI will appear as a category. Thi
## Translations
This mod is currently only in English! If you would like to help with translations, please submit a Pull Request.
English
Spanish - [ElDoktor](https://github.com/fcastro97)
Thai - [radiusgreenhill](https://github.com/radiusgreenhill)
If you would like to help with translations, please submit a Pull Request.
```
Workshop ID: 2799848602
Mod ID: SpiffUI-Inv
```

View File

@@ -6,33 +6,33 @@ description=[h3]A new save is not required[/h3]
description=
description=[h2]About SpiffUI[/h2]
description=
description=SpiffUI is an attempt to make the Project Zomboid in-game UI more player-friendly. The UI currently acts like a windowing system overtop a video game; similar in behavior to the Openbox/Fluxbox windowing system for a Linux Desktop. This is works as the complexity of the game warrants this, but with little tweaks it can be so much better.
description=SpiffUI (pronounced "Spiffy") is an attempt to make the Project Zomboid in-game UI more player-friendly. The UI currently acts like a windowing system overtop a video game; similar in behavior to the Openbox/Fluxbox windowing system for a Linux Desktop. This works as the complexity of the game warrants this, but with little tweaks it can be so much better.
description=
description=There will be several independent modules released under the SpiffUI name that each change/add their own features. This allows me to make modifications to these independently, and allow you, the user, to choose which are active.
description=
description=[h2]About SpiffUI[/h2]
description=[h2]About SpiffUI - Inventory[/h2]
description=
description=Changes the default behavior of the Loot and Player Inventories in how they are displayed.
description=The goal of this mod is to change the default behavior of the Loot and Player Inventories in how they are displayed. The Inventory/Loot Panel rules should make sense in normal usage, but may take a small adjustment to your playstyle. Try it for yourself and let me know what you think!
description=
description=For starters, the Inventory and Loot panels are hidden until the player triggers an interaction.
description=[b]Features[/b]
description=[list]
description=[*]The Inventory and Loot panels are hidden until the player triggers an interaction.
description=[*]The Inventory is now bound to the "Tab" key by default. Pressing Tab will open/close both the inventory and loot panels for the player. The panels cannot be closed when open in this way until you press the key again.
description=[*]Bringing the mouse to the top of the screen will show the inventory or loot panel allowing easy access; you can freely switch between which panel is open by moving the mouse. The panel is automatically hidden after losing mouse focus.
description=[*]Panels are no longer able to be resized horizontally or moved around. They are instead locked to the top of the screen in the default location, and can only be resized vertically. The "Close", "Info", "Collapse", and "Pin" buttons are also hidden.
description=[*]Clicking on a world container will show the loot panel and lock it open until the window is interacted with, an external mouse click, or if you walk away changing the loot panel to a blank floor.
description=[*]Option to Hide the "Inventory" button in the left panel. (I know the keybind, I don't need it)
description=[/list]
description=
description=The Inventory is now bound to the "Tab" key by default. Pressing Tab will open/close both the inventory and loot panels for the player, the panels cannot be closed when open in this way until you press the key again.
description=[b]Update v2[/b]
description=[list]
description=[*]Added option to only autohide on External Mouse Click from windows
description=[/list]
description=
description=Bringing the mouse to the top of the screen will show the inventory or loot panel allowing easy access; you can freely switch between which panel is open by moving the mouse. The panel is automatically hidden after losing mouse focus.
description=[h3] Controllers [/h3]
description=If playing with a controller the new behavior will not apply and the inventory will behave like Vanilla.
description=
description=Panels are no longer able to be resized horizontally or moved around. They are instead locked to the top of the screen in the default location, and can only be resized vertically. The "Close", "Info", "Collapse", and "Pin" buttons are also hidden.
description=
description=Clicking on a world container will show the loot panel and lock it open until the window is interacted with, an external mouse click, or if you walk away changing the loot panel to a blank floor.
description=
description=Even when "hidden", the panels are only a small mouse-movement or key-press away!
description=
description=Option to Hide the "Inventory" button in the left panel. (I know the keybind, I don't need it)
description=
description=The Inventory/Loot Panel rules should make sense in normal usage, but may take a small adjustment to your playstyle. Try it for yourself and let me know what you think!
description=
description=If playing with a controller these rules will not apply.
description=
description=I HIGHLY recommend that you run both the "Set SpiffUI Recommended Keybinds" and "Run All SpiffUI Resets" after you first install and start the game!
description=[b]NOTE:[/b] I HIGHLY recommend that you run both the "Set SpiffUI Recommended Keybinds" and "Run All SpiffUI Resets" after you first install and start the game!
description=
description=[h2]SpiffUI Configuration[/h2]
description=
@@ -77,8 +77,21 @@ description=[td]Hides the Inventory button in the left sidemenu[/td]
description=[/tr]
description=[/table]
description=
description=[h2]Translations[/h2]
description=[h2] Known Issues [/h2]
description=[list]
description=[*] The Dialog Box shown for the SpiffUI options will trigger the game to be unpaused if in-game.
description=[*] Controllers do not gain focus to the Settings Dialog; please use a mouse for now.
description=[*] Initiating a splitscreen game does not move Player 1's Inventory/Loot panels. This is vanilla behavior, but complicates things as you cannot move these panels with this mod.
description=[/list]
description=
description=This mod is currently only in English. 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!
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=[*]Thai - radiusgreenhill
description=[/list]
description= 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;Framework;Interface;Misc
visibility=friendsOnly
visibility=public