WinterWildfire

Module Internals

Announcement

Hey guys ! Just wanted to let you know that I need to run some maintenance on the website because of the recent domain name changes from netlify. So, some pages will appear like this for a few days... but guess what's coming new to the pages ? A Dark theme switch !!!

Before jumping into extending the module for your use, I think it might help you if you spend a bit of time understanding where the data gets pulled from. It might help you write your own VSCode plug-in someday too.

File structure(1/3)

The module pulls its data from six JSON files

  • Default_Actor_h.json and Default_Actor_h.json are the first to be written to respective header/source file to give skeleton for everything else.
  • The $1, $2 symbols are later replaced automatically.
[
	"// Fill out your copyright notice in the Description page of Project Settings.\n",
	"#include \"$1.generated.h\"\n",
	"UCLASS()",
	"class $2_API $4$1 : public $3",
	"{",
	"\tGENERATED_BODY()\n",
	"public:",
	"\t$4$1();\n",
	"protected:",
	"private:",
	"};"
]
[
	"// Fill out your copyright notice in the Description page of Project Settings.\n",
	"#include \"$1.h\""
]

File structure(2/3)

  • BuildTemplates.json and BuildExtension.json are then used to provide class selection options and contain relevant data regarding what to add into the skeleton produced by previous part.
  • Every entry of this json file has the following structure (refer the image)

uprop

Explanation:

  • As mentioned previously, every buildspace has a list of templates referred by id.
  • The classprefix is appended at required places.
  • Our target class derives from whatever exists in parent field.
  • Interfaces support will be added in future updates.
  • Headers listed here are appended automatically to (.h) files
  • Functions are listed here. These are pulled from the other 2 JSON files as mentioned in the following section.

File structure(3/3)

  • FunctionTemplates.json and FunctionExtension.json are used to lookup for listed Functions by ID.

uprop

Explanation:

  • The id in both JSON files must match.
  • Comment is added on top of header definitions.
  • Body is appended to source(.cpp) file.
  • Field is used for position in header file. When calling other commandlets as well, It is always recommended to not delete public/protected/private to avoid any bugs.

As you saw, there are two files data is pulled from. One is for use by the developer, the other is for use by the users to extend.

The extension feature is not battle-tested. Until the plug-in reaches v1.0, I will account for user feedback to patch any issues. But that's that. A perfect module when you just need to write tons of skeleton code and nothing else.

Happy coding.

See you later... 🖐

Thank you for visiting!

Hope you got the resources you needed. Come visit again :)

I upload weekly and revamp bi-monthly. You can support my work at Patreon | Paypal | Marketplace | Gumroad