diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-09-23 08:26:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 08:26:32 +0200 |
commit | 91dee900cc7bc40db5e936d2e9f2f18dcbbe870f (patch) | |
tree | 55549f29cd4061067bb93bb1f74dd43acd2beedb | |
parent | 143d1521bc3a5ff02e071e0c771aeb5f74e49db8 (diff) | |
download | skyhanni-91dee900cc7bc40db5e936d2e9f2f18dcbbe870f.tar.gz skyhanni-91dee900cc7bc40db5e936d2e9f2f18dcbbe870f.tar.bz2 skyhanni-91dee900cc7bc40db5e936d2e9f2f18dcbbe870f.zip |
Internal: Shared Live Templates for common structures (#2463)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .idea/liveTemplates/SkyHanni.xml | 101 |
2 files changed, 102 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index d77f4bd8b..7f4081e02 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ !.idea/icon.svg !.idea/dictionaries/default_user.xml !.idea/scopes/Mixins.xml +!.idea/liveTemplates/SkyHanni.xml .vscode/ run/ build/ diff --git a/.idea/liveTemplates/SkyHanni.xml b/.idea/liveTemplates/SkyHanni.xml new file mode 100644 index 000000000..08c6737b5 --- /dev/null +++ b/.idea/liveTemplates/SkyHanni.xml @@ -0,0 +1,101 @@ +<templateSet group="SkyHanni"> + <template name="configColor" value="@Expose @ConfigOption(name = "$Name$", desc = "$Desc$.") @ConfigEditorColour public String $internalName$ = "0:245:85:255:85";" description="Template for color config value" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="Color" alwaysStopAt="true" /> + <variable name="Desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="camelCase(Name)" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="configBool" value="@Expose @ConfigOption(name = "$Name$", desc = "$Desc$.") @ConfigEditorBoolean public boolean $internalName$ = $default$;" description="Template for bool config value" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="Color" alwaysStopAt="true" /> + <variable name="Desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="camelCase(Name)" defaultValue="" alwaysStopAt="false" /> + <variable name="default" expression="enum("true","false")" defaultValue="false" alwaysStopAt="true" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="eFun" value="@SubscribeEvent fun on$EventPre$(event : $Event$) { }" description="A Event Function" toReformat="true" toShortenFQNames="true"> + <variable name="Event" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <variable name="EventPre" expression="capitalize(regularExpression(Event,"Event|\\.",""))" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="KOTLIN_CLASS" value="true" /> + <option name="KOTLIN_OBJECT_DECLARATION" value="true" /> + <option name="KOTLIN_STATEMENT" value="true" /> + <option name="KOTLIN_TOPLEVEL" value="true" /> + </context> + </template> + <template name="enabled" value="fun isEnabled() = LorenzUtils.inSkyBlock && $condition$" description="isEnabled Function for Skyhanni Feature" toReformat="true" toShortenFQNames="true"> + <variable name="condition" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <context> + <option name="KOTLIN_CLASS" value="true" /> + </context> + </template> + <template name="configPosition" value="@Expose @ConfigLink(owner = $owner$.class, field = "$member$") private Position $name$ = new Position(20,20);" description="Template for a position" toReformat="false" toShortenFQNames="true"> + <variable name="name" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" /> + <variable name="member" expression="variableOfType("boolean")" defaultValue="enable" alwaysStopAt="true" /> + <variable name="owner" expression="className()" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="&&" value="§" description="Replace && with §" toReformat="false" toShortenFQNames="true"> + <context> + <option name="OTHER" value="true" /> + </context> + </template> + <template name="configKey" value="@Expose @ConfigOption(name = "$name$", desc = "$desc$.") @ConfigEditorKeybind(defaultKey = Keyboard.$bind$) public int $internalName$ = Keyboard.$bind$;" description="Tempalte for Keybind config value" toReformat="false" toShortenFQNames="true"> + <variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="bind" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="camelCase(name)" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="configLink" value="@ConfigLink(owner = $owner$.class, field = "$member$")" description="Auto fill for config link" toReformat="false" toShortenFQNames="true"> + <variable name="owner" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="member" expression="" defaultValue="" alwaysStopAt="true" /> + </template> + <template name="configAccordion" value="@Expose @ConfigOption(name = "$Name$",desc="") @Accordion public $Class$ $internalName$ = new $Class$();" description="Template for a config accordion" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="Class" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="decapitalize(regularExpression(Class,"Config",""))" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="configCategory" value="@Expose @Category(name = "$Name$",desc="$desc$") public $Class$ $internalName$ = new $Class$();" description="Template for a config category" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="Class" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="decapitalize(regularExpression(Class,"Config",""))" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="fconfig" value="private val config get() = SkyHanniMod.feature" description="Default declartion of feature config" toReformat="true" toShortenFQNames="true"> + <context> + <option name="KOTLIN_OBJECT_DECLARATION" value="true" /> + </context> + </template> + <template name="configSlider" value="@Expose @ConfigOption(name = "$Name$", desc = "$Desc$.") @ConfigEditorSlider(minValue = 1f,maxValue = 10f,minStep = 1f) public float $internalName$ = 1f;" description="Template for config slider" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="Color" alwaysStopAt="true" /> + <variable name="Desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="camelCase(Name)" defaultValue="" alwaysStopAt="false" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> + <template name="configButton" value="@ConfigOption(name = "$Name$", desc = "$Desc$.") @ConfigEditorButton(buttonText = "$Button$") public Runnable $internalName$ = () -> $function$;" description="Template for config button" toReformat="false" toShortenFQNames="true"> + <variable name="Name" expression="" defaultValue="Color" alwaysStopAt="true" /> + <variable name="Desc" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="Button" expression="" defaultValue="" alwaysStopAt="true" /> + <variable name="internalName" expression="camelCase(Name)" defaultValue="" alwaysStopAt="false" /> + <variable name="function" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> + <context> + <option name="JAVA_DECLARATION" value="true" /> + </context> + </template> +</templateSet>
\ No newline at end of file |