REPENTOGON phase 2: about 1,880 of its Lua functions, properties and constructors ported onto the rebuild's classes (new classes CostumeSpriteDesc, History, PocketItem, LevelGenerator and others), REPENTOGON's changes to vanilla functions behind the parity switch; 72 goldens identical from converted resources and the install

This commit is contained in:
shweet committed 2026-11-24 07:22:07 -05:00
1 parent 6d8a43775d
commit 881a82b325
115 files changed
+14243 -1987

No files matched your search

+40 -6
View File
@@ -29,9 +29,9 @@ Status rules (against this repository)
function, property, constructor
the rebuild registers a name on a class when src/ (src/lua, src/repentogon and helpers they call) passes it to
lua_method, lua_static, lua_field, lua_field_get or lua_property, or as {"Name", function} or lua_table_set,
inside lua_class_begin(state, "Class") or lua_namespace_begin(state, "Class"). A helper with no class of its own
takes the class at its call site. Class names are compared after REPENTOGON's aliases (RoomConfig.Room is
RoomConfig_Room). A constructor is registered when the class registers "__call", and is vanilla when its class is.
inside lua_class_begin(state, "Class") or lua_namespace_begin(state, "Class"), or after lua_pushglobaltable for
_G. A helper with no class of its own takes the class at its call site. Class names are compared after
REPENTOGON's aliases (RoomConfig.Room is RoomConfig_Room, the _CBindings namespace is _Internals). A constructor is registered when the class registers "__call", and is vanilla when its class is.
done registered, and neither vanilla (dump/lua_bindings.tsv, analysis/lua_all.tsv) nor under a docs "Modified"
section
review registered, but vanilla or documented as modified: the vanilla behaviour exists, REPENTOGON's change
@@ -93,7 +93,7 @@ DOC_CLASS_ALIASES = {"ItemConfig_Item": "Item", "ItemConfig_Costume": "Costume",
DOC_SKIPPED = {"docs", "index", "install", "install_zh"}
# The rebuild's names for REPENTOGON's classes, by namespace.
REBUILD_CLASS_ALIASES = {("RoomConfig", "Room"): "RoomConfig_Room"}
REBUILD_CLASS_ALIASES = {("RoomConfig", "Room"): "RoomConfig_Room", ("_CBindings", "_CBindings"): "_Internals"}
CLASS_AREAS = {
"entities": "Entity EntityRef EntityPtr EntityList EntityConfig EntityConfigEntity EntityDesc EntitySaveState "
@@ -939,7 +939,7 @@ def rebuild_registrations():
continue
stripped, masked = text_strip(text)
files[path] = (stripped, functions_find(masked, braces_match(masked)))
contextRe = re.compile(r'lua_(class|namespace)_begin\(\s*\w+\s*,\s*"(\w+)"')
contextRe = re.compile(r'lua_(class|namespace)_begin\(\s*\w+\s*,\s*"(\w+)"|lua_push(global)table\(')
nameRe = re.compile(r'lua_(?:method|static|field|field_get|property)\s*(?:<[^;]*?>)?\s*\(\s*\w+\s*,\s*"(\w+)"'
r'|\{\s*"(\w+)"\s*,|lua_table_set\(\s*\w+\s*,\s*-?\d+\s*,\s*"(\w+)"\)')
bodies = {}
@@ -954,6 +954,9 @@ def rebuild_registrations():
events = []
namespace = None
for match in contextRe.finditer(body):
if match.group(3):
events.append((match.start(), "_G"))
continue
if match.group(1) == "namespace":
namespace = match.group(2)
events.append((match.start(), class_name(namespace, match.group(2))))
@@ -977,7 +980,7 @@ def rebuild_registrations():
registered = defaultdict(set)
for (path, functionName, start), body in bodies.items():
events = contexts(body)
if not events and not re.search(r"\blua_(method|static|field|field_get|property|table_set)\b", body):
if not events and not re.search(r"\blua_(method|static|field|field_get|property|table_set|functions_add)\b", body):
continue
for match in nameRe.finditer(body):
name = match.group(1) or match.group(2) or match.group(3)
@@ -1160,6 +1163,28 @@ local OBJECTS = {
EntityPlayer = function() return Isaac.GetPlayer(0) end,
Entity = function() return Isaac.GetPlayer(0) end,
TemporaryEffects = function() return Isaac.GetPlayer(0):GetEffects() end,
CostumeSpriteDesc = function() return Isaac.GetPlayer(0):GetCostumeSpriteDescs()[1] end,
EntityConfigPlayer = function() return Isaac.GetPlayer(0):GetEntityConfigPlayer() end,
EntityConfigBaby = function() return EntityConfig.GetBaby(0) end,
Backdrop = function() return game:GetRoom():GetBackdrop() end,
Camera = function() return game:GetRoom():GetCamera() end,
FXLayers = function() return game:GetRoom():GetFXLayers() end,
FXParams = function() return game:GetRoom():GetFXParams() end,
RailManager = function() return game:GetRoom():GetRailManager() end,
LRoomAreaDesc = function() return game:GetRoom():GetLRoomAreaDesc() end,
LRoomTileDesc = function() return game:GetRoom():GetLRoomTileDesc() end,
RoomConfigStage = function() return RoomConfig.GetStage(1) end,
RoomConfigSet = function() return RoomConfig.GetStage(1):GetRoomSet(0) end,
RoomConfig_Room = function() return game:GetLevel():GetCurrentRoomDesc().Data end,
LevelGeneratorEntry = function() return Isaac.LevelGeneratorEntry() end,
PersistentGameData = function() return Isaac.GetPersistentGameData() end,
History = function() return Isaac.GetPlayer(0):GetHistory() end,
HistoryItem = function() return Isaac.GetPlayer(0):GetHistory():GetCollectiblesHistory()[1] end,
PocketItem = function() return Isaac.GetPlayer(0):GetPocketItem(0) end,
ChallengeParam = function() return game:GetChallengeParams() end,
GenericPrompt = function() return GenericPrompt() end,
GridEntityDoor = function() for i = 0, 7 do local d = game:GetRoom():GetDoor(i) if d then return d end end end,
GridEntityRock = function() local r = game:GetRoom() for i = 0, r:GetGridSize() - 1 do local g = r:GetGridEntity(i) if g and g:ToRock() then return g:ToRock() end end end,
Sprite = function() return Sprite() end,
RNG = function() return RNG() end,
Vector = function() return Vector(0, 0) end,
@@ -1168,6 +1193,15 @@ local OBJECTS = {
MusicManager = function() return MusicManager() end,
SFXManager = function() return SFXManager() end,
Font = function() return Font() end,
Capsule = function() return Capsule(Vector(0, 0), Vector(10, 0), 5) end,
Shape = function() return Isaac.GetPlayer(0):GetDebugShape(false) end,
EntityDesc = function() return EntityDesc() end,
EntityConfigEntity = function() return EntityConfig.GetEntity(10) end,
EntityEffect = function() return Isaac.Spawn(1000, 54, 0, Vector(0, 0), Vector(0, 0), nil):ToEffect() end,
GridEntity = function() local r = game:GetRoom() for i = 0, r:GetGridSize() - 1 do if r:GetGridEntity(i) then return r:GetGridEntity(i) end end end,
EntitiesSaveStateVector = function() return game:GetLevel():GetCurrentRoomDesc():GetEntitiesSaveState() end,
GridEntitiesSaveStateVector = function() return game:GetLevel():GetCurrentRoomDesc():GetGridEntitiesSaveState() end,
EntitySaveState = function() return game:GetLevel():GetCurrentRoomDesc():GetEntitiesSaveState():Get(0) end,
}
local function object_get(class)