reyFix2
โ๏ธ = works ; โ๏ธ = TV & Radio ReInvented UI doesn't show
Vanilla TV Names are like ValuTech Television
in B41
BetterSorting
mod changes the name to Television - ValuTech
BetterSorting\media\lua\shared\Translate\EN\ItemName_EN.txt
BetterSorting
loads it by "some" script "somewhere" along the way.... ๐คTV ReInvented
ISRadioWindow
(reimplements parts only)
prerender()
readFromObject()
local checkName()
[not Vanilla]
getItemNameFromFullType()
against "smth shady"InventoryItemFullType
= e.g. Radio.TvBlack
(B41) = Base.TvBlack
(B42 ReWrite)InventoryItemFullType
= ItemID
InventoryItemFullType
= getItemNameFromFullType()
Radio.TvBlack
= Unique Identifier for all ValuTech Television in B41
Radio.TvBlack
won't change
"smth shady" = nameD
in here
function ISRadioWindow:readFromObject( _player, _deviceObject )
local function checkName(name)
return nameD == getItemNameFromFullType(name) -- here "name" = "Radio.TvBlack"
end
-- REYNEP suggests a rename
function ISRadioWindow:readFromObject(Player, IsoObject_Radio)
Right Hand Side = getItemNameFromFullType()
= Pretty Consistent
BetterSorting
Enabled
SinglePlayer
= Television - ValuTech
MultiPlayer
= Television - ValuTech
Television - ValuTech
Television - ValuTech
BetterSorting
Disabled
SinglePlayer
= ValuTech Television
MultiPlayer
= ValuTech Television
ValuTech Television
ValuTech Television
nameD
BetterSorting
Enabled
SinglePlayer
= Television - ValuTech
MultiPlayer
= ValuTech Television
๐จ
ValuTech Television
๐จBetterSorting
Disabled
SinglePlayer
= ValuTech Television
MultiPlayer
= ValuTech Television
ValuTech Television
ValuTech Television
TV & Radio Inventory
aren't supposed to be working๐จ = is where the issue is....
it's a local checkName()
implementation issue! ๐จ with nameD
nameD
? -- UnModified Code from `Radio & TV ReInvented` + Added LineGaps only
function ISRadioWindow:readFromObject( _player, _deviceObject )
self:clear();
self.player = _player;
self.device = _deviceObject;
if self.device then
self.deviceType =
(instanceof(self.device, "Radio") and "InventoryItem" ) or
(instanceof(self.device, "IsoWaveSignal") and "IsoObject" ) or
(instanceof(self.device, "VehiclePart") and "VehiclePart" );
if self.deviceType then
self.deviceData = _deviceObject:getDeviceData();
self.title = self.deviceData:getDeviceName();
end
end
if (not self.player) or (not self.device) or (not self.deviceData) or (not self.deviceType) then
self:clear();
return;
end
local nameD = self.title
.
.
. -- Function goes on
local nameD = _deviceObject:getDeviceData():getDeviceName();
print(class-object-instance)
print()
zombie.iso.objects.IsoTelevision@747bfeba
This is what i got on the debugMode CommandConsole
*Note:- as i clicked on the TV inside a room in Zomboid / or / RightClick โก๏ธ Device Options
Functions / Member of this lua class is listed here
return nameD == getItemNameFromFullType("Radio.TvBlack")
return zombie.iso.objects.IsoTelevision:getDeviceData():getDeviceName() == getItemNameFromFullType("Radio.TvBlack")
BetterSorting
is enabledWell, Technically speaking, we shouldn't even be comparing "NAMES" like "ValuTech Television" or "Television - ValuTech" in the first place ๐โโ๏ธ
Radio.TvBlack
right now
getItemNameFromFullType("Radio.TvBlack")
InventoryItemFullType
So, why compare the "Name" when we already got the Constant Unique Identifier ๐โโ๏ธ?
So, from now on Constant Unique Identifier = InventoryItemFullType
InventoryItemFullType
? - you might ask getItemNameFromFullType("Radio.TvBlack")
zombie.inventory.InventoryItem:getFullType()
Radio.TvBlack
= FullType
FullType
of what? โก๏ธ an inventoryItem
Well, we should just check
Constant Unique Identifier
= Radio.TvBlack
(as of B41)
= Base.TvBlack
(B42)
= InventoryItemFullType
= Not Changable in even DebugMode
instead of,
BetterSorting
)InventoryItemFullType
from IsoObject
?function ISRadioWindow:readFromObject( _player, _deviceObject )
...
_deviceObject:getProperties():Val("CustomItem") == "Radio.TvBlack"
-- which would translate into
zombie.iso.objects.IsoTelevision:getProperties():Val("CustomItem") == "Radio.TvBlack"
-- we would ideally / essentially be comparing
"Radio.TvBlack" == "Radio.TvBlack" -- or
...
TV + Radio ReInvented
mod (not my fix, made sure your one from steam)doTuneInButton()
syntax / code issue