Project Zomboid reyFix2

โš”๏ธ Conflicting Mods

  1. TV & Radio ReInvented ๐Ÿ”— by tealera
  2. Better Sorting ๐Ÿ”— by ChthonicKnight

๐Ÿค Acknowledgements

๐Ÿž๏ธ The Bug ๐Ÿšจ

โœ”๏ธ = works ; โœ–๏ธ = TV & Radio ReInvented UI doesn't show

๐Ÿ“ Same Reports from others


Page-Break

If, you are feeling exhausted โžก๏ธ See TL:DR in every page


๐Ÿ” Pin-Pointing

  1. Vanilla TV Names are like ValuTech Television in B41

  2. BetterSorting mod changes the name to Television - ValuTech

    • Both in SinglePlayer + MultiPlayer
    • This is done via
      • BetterSorting\media\lua\shared\Translate\EN\ItemName_EN.txt
      • BetterSorting loads it by "some" script "somewhere" along the way.... ๐Ÿค”
  3. TV ReInvented

    • Modifies Vanilla Implementation of ISRadioWindow (reimplements parts only)
      • ๐Ÿ› ๏ธ prerender()
      • ๐Ÿ› ๏ธ readFromObject()
    • Both has
      • local checkName() [not Vanilla]
        • which checks getItemNameFromFullType() against "smth shady"

๐Ÿ“œ Glossary

๐Ÿ•ต๏ธ Investigation

๐Ÿšด TL;DR

it's a local checkName() implementation issue! ๐Ÿšจ with nameD

๐Ÿค” So, What issss really 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

Page-Break

๐Ÿ˜ตโ€๐Ÿ’ซ What do we do now?

๐Ÿง What exactly is getting passed in?

๐Ÿšด TL;DR ๐Ÿงข Under the Hood

return nameD == getItemNameFromFullType("Radio.TvBlack")
return zombie.iso.objects.IsoTelevision:getDeviceData():getDeviceName() == getItemNameFromFullType("Radio.TvBlack")

Page-Break

๐Ÿค” So, How do we fix this issue now?


Why InventoryItemFullType? - you might ask


๐Ÿšด TL;DR ๐Ÿ“œ So, What's the Solution?


Page-Break

(DocStrange) โ˜๏ธ 1 Last Problem

How to get 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
    ...


Page-Break

๐Ÿ› ๏ธ Refactoring Suggestions, Patch v2

๐Ÿ› ๏ธ This Patch should AutoFix 1 other issue

๐Ÿ“œ Findings / Conclusions

๐Ÿ“ Other UnRelated Bug Reports, (I may try to fix later on)

  1. Inventory Tetris, GridSize problem
  2. Broadcast Voice (Framework) / Voiced TV & Radio
  3. Vanilla Portable Disc Player
  4. Vanilla doTuneInButton() syntax / code issue
  5. Spiffophonic Sound Lite
  6. True Music Radio
    • comment #08 ๐Ÿ”—
      • I really don't like this user's tone.
      • But it's still a report nontheless.... ๐Ÿคฆโ€โ™€๏ธ

Project Zomboid reyFix2

โ‰ก