@@ -34,7 +34,7 @@ ThumbnailCaptureScript::ThumbnailCaptureScript()
3434 , mItemViewers()
3535 , mpItemViewer(nullptr )
3636 , mFolderPath()
37- , mIsEnabled (false )
37+ , mbIsEnabled (false )
3838{
3939}
4040
@@ -199,16 +199,20 @@ void ThumbnailCaptureScript::InjectListeners() {
199199 // standard editor/planner
200200 if (pageUI.page ->mStandardItems .size () > 0 ) {
201201 for (StandardItemUIPtr itemUI : pageUI.page ->mStandardItems ) {
202- itemUI->field_18 ->AddWinProc (this );
203- mItemViewers [itemUI->field_18 .get ()] = itemUI->mpViewer .get ();
202+ itemUI->mpWindow ->AddWinProc (this );
203+ mItemViewers [itemUI->mpWindow .get ()] = itemUI->mpViewer .get ();
204204 }
205205 }
206206 // adventure editor
207207 /*
208208 else {
209- for (eastl::intrusive_ptr<Palettes::IAdvancedItemUI> itemUI : pageUI.page->mAdvancedItems) {
210- itemUI->mpWindow
211- mItemViewers[itemUI->field_18.get()] = itemUI->mpViewer.get();
209+ for (IAdvancedItemUIPtr itemUI : pageUI.page->mAdvancedItems) {
210+ auto item = object_cast<Palettes::DefaultItemFrameUI>(itemUI.get());
211+ if (item && item->mpWindow) {
212+ item->mpWindow->AddWinProc(this);
213+ mItemViewers[item->mpWindow.get()] = itemUI->mpViewer.get();
214+ }
215+
212216 }
213217 }*/
214218
@@ -218,9 +222,11 @@ void ThumbnailCaptureScript::InjectListeners() {
218222 // simple category
219223 else {
220224 for (auto pageUI : catUI->mPageUIs ) {
221- for (StandardItemUIPtr itemUI : pageUI.page ->mStandardItems ) {
222- itemUI->field_18 ->AddWinProc (this );
223- mItemViewers [itemUI->field_18 .get ()] = itemUI->mpViewer .get ();
225+ if (pageUI.page ->mStandardItems .size () > 0 ) {
226+ for (StandardItemUIPtr itemUI : pageUI.page ->mStandardItems ) {
227+ itemUI->mpWindow ->AddWinProc (this );
228+ mItemViewers [itemUI->mpWindow .get ()] = itemUI->mpViewer .get ();
229+ }
224230 }
225231 }
226232 }
@@ -247,14 +253,14 @@ void ThumbnailCaptureScript::RemoveListeners() {
247253 // standard editor/planner
248254 if (pageUI.page ->mStandardItems .size () > 0 ) {
249255 for (StandardItemUIPtr itemUI : pageUI.page ->mStandardItems ) {
250- itemUI->field_18 ->RemoveWinProc (this );
256+ itemUI->mpWindow ->RemoveWinProc (this );
251257 }
252258 }
253259 /*
254260 // adventure editor
255261 else {
256262 for (StandardItemUIPtr itemUI : pageUI.page->mpPage->mItems) {
257- itemUI->field_18 ->RemoveWinProc(this);
263+ itemUI->mpWindow ->RemoveWinProc(this);
258264 }
259265 }
260266 */
@@ -265,8 +271,8 @@ void ThumbnailCaptureScript::RemoveListeners() {
265271 else {
266272 for (auto pageUI : catUI->mPageUIs ) {
267273 for (StandardItemUIPtr itemUI : pageUI.page ->mStandardItems ) {
268- if (itemUI && itemUI->field_18 ) {
269- itemUI->field_18 ->RemoveWinProc (this );
274+ if (itemUI && itemUI->mpWindow ) {
275+ itemUI->mpWindow ->RemoveWinProc (this );
270276 }
271277 }
272278 }
@@ -279,10 +285,10 @@ void ThumbnailCaptureScript::RemoveListeners() {
279285}
280286
281287void ThumbnailCaptureScript::ParseLine (const ArgScript::Line& line) {
282- if (mIsEnabled ) {
288+ if (mbIsEnabled ) {
283289 RemoveListeners ();
284290 App::ConsolePrintF (" Icon capture disabled." );
285- mIsEnabled = false ;
291+ mbIsEnabled = false ;
286292 return ;
287293 }
288294
@@ -327,7 +333,7 @@ void ThumbnailCaptureScript::ParseLine(const ArgScript::Line& line) {
327333 InjectListeners ();
328334
329335 App::ConsolePrintF (" Icon capture enabled: hover a palette item and wait until it starts rotating to generate the icon." );
330- mIsEnabled = true ;
336+ mbIsEnabled = true ;
331337}
332338
333339const char * ThumbnailCaptureScript::GetDescription (ArgScript::DescriptionMode mode) const {
0 commit comments