Skip to content

Commit 8dacf07

Browse files
committed
descriptions added for each environment variable for hook settings
1 parent 8e69bba commit 8dacf07

3 files changed

Lines changed: 76 additions & 6 deletions

File tree

apps/app-frontend/src/components/ui/instance_settings/HooksSettings.vue

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,36 @@ const messages = defineMessages({
5454
hooksDescription: {
5555
id: 'instance.settings.tabs.hooks.description',
5656
defaultMessage:
57-
'Hooks can run commands before launch, as a wrapper, or after exit. Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS.',
57+
'Hooks allow advanced users to run certain system commands before and after launching the game.',
58+
},
59+
hookVariablesDescription: {
60+
id: 'instance.settings.tabs.hooks.variables.description',
61+
defaultMessage:
62+
'Hooks run in the working directory of the instance, with the following variables:',
63+
},
64+
instanceNameDescription: {
65+
id: 'instance.settings.tabs.hooks.variables.inst-name.description',
66+
defaultMessage: '$INST_NAME: The name of the instance',
67+
},
68+
instanceIdDescription: {
69+
id: 'instance.settings.tabs.hooks.variables.inst-id.description',
70+
defaultMessage: "$INST_ID: The name of the instance's folder",
71+
},
72+
instanceDirDescription: {
73+
id: 'instance.settings.tabs.hooks.variables.inst-dir.description',
74+
defaultMessage: "$INST_DIR: The absolute path to the instance's folder",
75+
},
76+
instanceMcDirDescription: {
77+
id: 'instance.settings.tabs.hooks.variables.inst-mc-dir.description',
78+
defaultMessage: '$INST_MC_DIR: An alias for $INST_DIR',
79+
},
80+
instanceJavaDescription: {
81+
id: 'instance.settings.tabs.hooks.variables.inst-java.description',
82+
defaultMessage: '$INST_JAVA: The absolute path to the java binary',
83+
},
84+
instanceJavaArgsDescription: {
85+
id: 'instance.settings.tabs.hooks.variables.inst-java-args.description',
86+
defaultMessage: '$INST_JAVA_ARGS: The JVM Arguments provided to the game',
5887
},
5988
customHooks: {
6089
id: 'instance.settings.tabs.hooks.custom-hooks',
@@ -153,5 +182,17 @@ const messages = defineMessages({
153182
<p class="m-0">
154183
{{ formatMessage(messages.postExitDescription) }}
155184
</p>
185+
186+
<div class="m-0 mt-6">
187+
{{ formatMessage(messages.hookVariablesDescription) }}
188+
</div>
189+
<ul class="m-0 mt-2">
190+
<li>{{ formatMessage(messages.instanceNameDescription) }}</li>
191+
<li>{{ formatMessage(messages.instanceIdDescription) }}</li>
192+
<li>{{ formatMessage(messages.instanceDirDescription) }}</li>
193+
<li>{{ formatMessage(messages.instanceMcDirDescription) }}</li>
194+
<li>{{ formatMessage(messages.instanceJavaDescription) }}</li>
195+
<li>{{ formatMessage(messages.instanceJavaArgsDescription) }}</li>
196+
</ul>
156197
</div>
157198
</template>

apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ watch(
143143
<hr class="my-6 bg-button-border border-none h-[1px]" />
144144

145145
<div class="flex flex-col gap-6">
146-
<p class="m-0 leading-tight">
147-
Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS.
148-
</p>
149-
150146
<div class="flex flex-col gap-2.5">
151147
<h3 class="m-0 text-lg font-semibold text-contrast">Pre launch hook</h3>
152148
<StyledInput
@@ -185,6 +181,18 @@ watch(
185181
/>
186182
<p class="m-0 leading-tight">Ran after the game closes.</p>
187183
</div>
184+
185+
<div class="m-0 leading-tight">
186+
Hooks run in the working directory of the instance, with the following variables:
187+
<ul>
188+
<li>$INST_NAME: The name of the instance</li>
189+
<li>$INST_ID: The name of the instance's folder</li>
190+
<li>$INST_DIR: The absolute path to the instance's folder</li>
191+
<li>$INST_MC_DIR: An alias for $INST_DIR</li>
192+
<li>$INST_JAVA: The absolute path to the java binary</li>
193+
<li>$INST_JAVA_ARGS: The JVM Arguments provided to the game</li>
194+
</ul>
195+
</div>
188196
</div>
189197
</div>
190198
</template>

apps/app-frontend/src/locales/en-US/index.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,28 @@
570570
"message": "Custom launch hooks"
571571
},
572572
"instance.settings.tabs.hooks.description": {
573-
"message": "Hooks can run commands before launch, as a wrapper, or after exit. Commands support $INST_NAME, $INST_ID, $INST_DIR/$INST_MC_DIR, $INST_JAVA, $INST_JAVA_ARGS."
573+
"message": "Hooks allow advanced users to run certain system commands before and after launching the game."
574+
},
575+
"instance.settings.tabs.hooks.variables.description": {
576+
"message": "Hooks run in the working directory of the instance, with the following variables:"
577+
},
578+
"instance.settings.tabs.hooks.variables.inst-dir.description": {
579+
"message": "$INST_DIR: The absolute path to the instance's folder"
580+
},
581+
"instance.settings.tabs.hooks.variables.inst-id.description": {
582+
"message": "$INST_ID: The name of the instance's folder"
583+
},
584+
"instance.settings.tabs.hooks.variables.inst-java-args.description": {
585+
"message": "$INST_JAVA_ARGS: The JVM Arguments provided to the game"
586+
},
587+
"instance.settings.tabs.hooks.variables.inst-java.description": {
588+
"message": "$INST_JAVA: The absolute path to the java binary"
589+
},
590+
"instance.settings.tabs.hooks.variables.inst-mc-dir.description": {
591+
"message": "$INST_MC_DIR: An alias for $INST_DIR"
592+
},
593+
"instance.settings.tabs.hooks.variables.inst-name.description": {
594+
"message": "$INST_NAME: The name of the instance"
574595
},
575596
"instance.settings.tabs.hooks.post-exit": {
576597
"message": "Post-exit"

0 commit comments

Comments
 (0)