@@ -49,7 +49,7 @@ public static MacroLocationFactory getInstance() {
4949 * @return a new {@link MacroLocation} object for an unknown location.
5050 */
5151 public MacroLocation createUnknownLocation (@ Nonnull String name ) {
52- return new MacroLocation (name , MacroSource .unknown , "" , null );
52+ return new MacroLocation (name , MacroSource .unknown , "" );
5353 }
5454
5555 /**
@@ -59,7 +59,7 @@ public MacroLocation createUnknownLocation(@Nonnull String name) {
5959 * @return a new {@link MacroLocation} object for a global Panel.
6060 */
6161 public MacroLocation createGlobalLocation (@ Nonnull String name ) {
62- return new MacroLocation (name , MacroSource .global , MacroSource .global .getSourceName (), null );
62+ return new MacroLocation (name , MacroSource .global , MacroSource .global .getSourceName ());
6363 }
6464
6565 /**
@@ -69,8 +69,7 @@ public MacroLocation createGlobalLocation(@Nonnull String name) {
6969 * @return a new {@link MacroLocation} object for a campaign Panel.
7070 */
7171 public MacroLocation createCampaignLocation (@ Nonnull String name ) {
72- return new MacroLocation (
73- name , MacroSource .campaign , MacroSource .campaign .getSourceName (), null );
72+ return new MacroLocation (name , MacroSource .campaign , MacroSource .campaign .getSourceName ());
7473 }
7574
7675 /**
@@ -81,18 +80,7 @@ public MacroLocation createCampaignLocation(@Nonnull String name) {
8180 * @return a new {@link MacroLocation} object for a token.
8281 */
8382 public MacroLocation createTokenLocation (@ Nonnull String name , @ Nonnull Token token ) {
84- return createTokenLocation (name , token .getName ());
85- }
86-
87- /**
88- * Creates a new {@link MacroLocation} object for a token.
89- *
90- * @param name the name of the macro.
91- * @param tokenName the name of the token associated with the macro.
92- * @return a new {@link MacroLocation} object for a token.
93- */
94- public MacroLocation createTokenLocation (@ Nonnull String name , @ Nonnull String tokenName ) {
95- return new MacroLocation (name , MacroSource .token , tokenName , null );
83+ return new MacroLocation (name , MacroSource .token , token .getName (), null , token );
9684 }
9785
9886 /**
@@ -103,18 +91,8 @@ public MacroLocation createTokenLocation(@Nonnull String name, @Nonnull String t
10391 * @return a new {@link MacroLocation} object for a library token.
10492 */
10593 public MacroLocation createLibTokenLocation (@ Nonnull String name , @ Nonnull Token libToken ) {
106- return createLibTokenLocation (name , libToken .getName ());
107- }
108-
109- /**
110- * Creates a new {@link MacroLocation} object for a library token.
111- *
112- * @param name the name of the macro.
113- * @param libTokenName the name of the library token associated with the macro.
114- * @return a new {@link MacroLocation} object for a library token.
115- */
116- public MacroLocation createLibTokenLocation (@ Nonnull String name , @ Nonnull String libTokenName ) {
117- return new MacroLocation (name , MacroSource .library , libTokenName .substring (4 ), null );
94+ return new MacroLocation (
95+ name , MacroSource .library , libToken .getName ().substring (4 ), null , libToken );
11896 }
11997
12098 /**
@@ -124,7 +102,7 @@ public MacroLocation createLibTokenLocation(@Nonnull String name, @Nonnull Strin
124102 * @return a new {@link MacroLocation} object for a GM Panel.
125103 */
126104 public MacroLocation createGmLocation (@ Nonnull String name ) {
127- return new MacroLocation (name , MacroSource .gm , MacroSource .gm .getSourceName (), null );
105+ return new MacroLocation (name , MacroSource .gm , MacroSource .gm .getSourceName ());
128106 }
129107
130108 /**
@@ -135,7 +113,7 @@ public MacroLocation createGmLocation(@Nonnull String name) {
135113 */
136114 public MacroLocation createExecFunctionLocation (@ Nonnull String functionName ) {
137115 return new MacroLocation (
138- MacroSource .execFunction .getSourceName (), MacroSource .execFunction , functionName , null );
116+ MacroSource .execFunction .getSourceName (), MacroSource .execFunction , functionName );
139117 }
140118
141119 /**
@@ -148,8 +126,7 @@ public MacroLocation createMacroLinkLocation(@Nonnull String name) {
148126 return new MacroLocation (
149127 MacroSource .macroLink .getSourceName (),
150128 MacroSource .macroLink ,
151- MacroSource .macroLink .getSourceName (),
152- null );
129+ MacroSource .macroLink .getSourceName ());
153130 }
154131
155132 /**
@@ -159,15 +136,14 @@ public MacroLocation createMacroLinkLocation(@Nonnull String name) {
159136 * @return a new {@link MacroLocation} object for an event.
160137 */
161138 public MacroLocation createEventLocation (@ Nonnull String name ) {
162- return new MacroLocation (MacroSource .event .getSourceName (), MacroSource .event , name , null );
139+ return new MacroLocation (MacroSource .event .getSourceName (), MacroSource .event , name );
163140 }
164141
165142 public MacroLocation createSentryIoLoggingLocation () {
166143 return new MacroLocation (
167144 MacroSource .sentryIoLogging .getSourceName (),
168145 MacroSource .sentryIoLogging ,
169- MacroSource .sentryIoLogging .getSourceName (),
170- null );
146+ MacroSource .sentryIoLogging .getSourceName ());
171147 }
172148
173149 /**
@@ -186,7 +162,7 @@ public MacroLocation createUriLocation(@Nonnull String name, @Nullable URI calle
186162 }
187163 uri = calledFrom .resolve (uri );
188164 }
189- return new MacroLocation (uri .getPath (), MacroSource .uri , uri .getHost (), uri );
165+ return new MacroLocation (uri .getPath (), MacroSource .uri , uri .getHost (), uri , null );
190166 } catch (URISyntaxException e ) {
191167 return createUnknownLocation (name );
192168 }
@@ -195,12 +171,12 @@ public MacroLocation createUriLocation(@Nonnull String name, @Nullable URI calle
195171 /**
196172 * Creates a new {@link MacroLocation} object for the chat box.
197173 *
198- * @param token the token associated with the the chat box.
174+ * @param token the token associated with the chat box.
199175 * @return a new {@link MacroLocation} object for a the chat box.
200176 */
201177 public MacroLocation createChatLocation () {
202178 return new MacroLocation (
203- MacroSource .chat .getSourceName (), MacroSource .chat , MacroSource .chat .getSourceName (), null );
179+ MacroSource .chat .getSourceName (), MacroSource .chat , MacroSource .chat .getSourceName ());
204180 }
205181
206182 /**
@@ -214,6 +190,7 @@ public MacroLocation createToolTipLocation(@Nullable Token token) {
214190 MacroSource .tooltip .getSourceName (),
215191 MacroSource .tooltip ,
216192 token != null ? token .getName () : "" ,
217- null );
193+ null ,
194+ token );
218195 }
219196}
0 commit comments