Page MenuHomeFeedback Tracker

enScript decorators are not documented or fully implemented
Assigned, UrgentPublic

Description

We can create decorators but not do anything with them in script. Ideally we would want:

  1. Ability to walk all variables of a class and read presence or absence of a decorator and the values.
  2. Perform work on a decorated object.
  3. Know which object the decorator was applied.

In the example below, there does not appear methods to do anything with the values other than on creation of the object, and we have no methods to know what object called the decorator or pass back.

class TestClassDecorator {
	int x;
	void TestClassDecorator(int _x) {
		x = _x;
		Print(ToString() + " " + x + " " + ClassName() + " " + Type());
	}
}

class TestPropertyDecorator {
	int y;
	void TestPropertyDecorator(int _y) {
		y = _y;
		Print(ToString() + " " + y + " " + ClassName() + " " + Type());
	}
}

[TestClassDecorator(1)] class TestDecorateMe {
	[TestPropertyDecorator(2)] int test = 0;

	void TestDecorateMe() {
		Print(ToString() + " " + test + " " + ClassName() + " " + Type());
	}

	void ~TestDecorateMe() {}
}

ref TestDecorateMe g_TestMe = new TestDecorateMe();

modded class DayZGame {
	void DayZGame() {
		g_TestMe.test++;

		Print(g_TestMe.ToString() + " " + g_TestMe.test + " " + g_TestMe.ClassName() + " " + g_TestMe.Type());
	}

	void ~DayZGame() {}
}

OUTPUT:

SCRIPT       : TestDecorateMe<9fe89960> 0 TestDecorateMe TestDecorateMe
SCRIPT       : TestClassDecorator<a09a80f0> 1 TestClassDecorator TestClassDecorator
SCRIPT       : TestPropertyDecorator<a09a7170> 2 TestPropertyDecorator TestPropertyDecorator
SCRIPT       : TestDecorateMe<9fe89960> 1 TestDecorateMe TestDecorateMe

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

antihax created this task.Jul 27 2023, 10:23 PM
Geez changed the task status from New to Assigned.Jul 28 2023, 10:22 AM