From ca31e4c2c9b98981f107d52c326aa25d4e08e174 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 24 Dec 2023 03:27:18 -0600 Subject: [PATCH] leverage the new getMethodSigsNS, getFieldCountNS, and getFieldNS functions to look up methods and (hardcoded) variables from the classrep rather than creating an instance this did cost us dynamic variable listing, but that's runtime assignment as-is and can likely be referenced another route in the end --- .../data/Prototyping/UI/classPrototyping.gui | 7 ----- .../Prototyping/UI/classPrototyping.tscript | 31 +++++-------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.gui b/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.gui index e0aa673aa..bc30ae062 100644 --- a/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.gui +++ b/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.gui @@ -110,13 +110,6 @@ $guiContent = new GuiControl(classPrototyping) { profile = "ToolsGuiCheckBoxProfile"; tooltipProfile = "GuiToolTipProfile"; }; - new GuiCheckBoxCtrl(ReportDynamicVariables) { - text = "Report Dynamic Variables"; - position = "300 420"; - extent = "150 30"; - profile = "ToolsGuiCheckBoxProfile"; - tooltipProfile = "GuiToolTipProfile"; - }; }; }; //--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.tscript b/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.tscript index 341670ae2..c50c47360 100644 --- a/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.tscript +++ b/Templates/BaseGame/game/data/Prototyping/UI/classPrototyping.tscript @@ -60,21 +60,14 @@ function classPrototyping::fillClasslist(%this, %classInstance) function classPrototyping::SetNamespaceUsed(%this, %nameSpaceUsed) { ClassMethodListCtrl.deleteAllObjects(); - if (%nameSpaceUsed $= %this.instanceName) - { - %this.tempClass = %this.inst; - %this.fillMethodlist(%this.inst); - return; - } - eval("classPrototyping.tempClass = new "@ %nameSpaceUsed @"(){};"); - %this.fillMethodlist(%this.tempClass); + %this.fillMethodlist(%nameSpaceUsed); } -function classPrototyping::fillMethodlist(%this, %classInstance) +function classPrototyping::fillMethodlist(%this, %nameSpaceUsed) { ClassMethodListCtrl.deleteAllObjects(); - - %this.methodArray = %classInstance.getMethodSigs(); + %this.nameSpaceUsed = %nameSpaceUsed; + %this.methodArray = getMethodSigsNS(%nameSpaceUsed); %this.methodCount = %this.methodArray.count(); for (%i=0; %i<%this.methodCount; %i++) @@ -113,7 +106,7 @@ function classPrototyping::writeResults(%this) if (ReportCommands.isStateOn()) { - %this.commandArray = %this.tempClass.getMethodSigs(true); + %this.commandArray = getMethodSigsNS(%this.nameSpaceUsed,true); %this.commandCount = %this.commandArray.count(); echo("/* Available Commands:"); for (%i=0; %i< %this.commandCount; %i++) @@ -126,19 +119,9 @@ function classPrototyping::writeResults(%this) if (ReportVariables.isStateOn()) { echo("/* HardCoded Variables"); - for (%i=0; %i< %this.tempClass.getFieldCount(); %i++) + for (%i=0; %i< getFieldCountNS(%this.nameSpaceUsed); %i++) { - echo(%this.tempClass.getField(%i)); - } - echo("*/"); - } - - if (ReportDynamicVariables.isStateOn()) - { - echo("/* Dynamic Variables"); - for (%i=0; %i< %this.tempClass.getDynamicFieldCount(); %i++) - { - echo(getword(%this.tempClass.getDynamicField(%i),0)); + echo(getFieldNS(%this.nameSpaceUsed,%i)); } echo("*/"); }