Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dynamically changing the resource_id

Featured Replies

Anyone had any luck doing something like the following?FLOAT64 FSAPI Adf_Card_cb(PELEMENT_SPRITE pelement){ // Change RES_ID based on Day/Night & Power if (Time::IsDay()) { // Use DAY resource pelement->header.resource_id = BMP_GAUGE_ADF_CARD; } else { // NIGHT if(mainBus.PowerOn() && InstLights::IsPanelLtOn() && cbInstLt.Closed()) { // If power display instrument light switch(InstLights::GetRheoStat()) { case InstLights::BRT: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_BRT; break; case InstLights::ON75: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_75; break; case InstLights::ON50: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_50; break; case InstLights::ON25: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_25; break; default: // Should never get here OFF pelement->header.resource_id = BMP_GAUGE_ADF_CARD; break; } } } // Return Card Azimuth return pelement->source_var_0.var_value.n; // Force redraw REDRAW_IMAGE(pelement);}Seems to have no effect.

Well... It would seem that thispelement->header.resource_idis a cheap, imitation copy of thisLinkage.gauge_header_ptr[n]->elements_list[0]->next_element[0]->resource_idHowever, that is not the whole story, as the above noted substitution will produce a gauge that requires a switch to/from full screen/windowed mode to effect the change in bitmaps.This would seem to indicate that one also needs to trigger the INITIALIZE and GENERATE routines in order to get the new bitmap on the screen.All in all, it would probably be easier to simply declare an icon element for these things.Doug

Thanks Doug for your input. Makes sense now that I think back to the game loop.Can't use another ICON here as it is a SPRITE, and I wanted to avoid using a second one as this seemed more straight forward, avoid all the HIDE/SHOW logic.But forcing an INITIALIZE doesn't seem like a FPS saver at all, haha.So, I guess in the end it is wiser to create the 2nd dreaded SPRITE.Not sure I even know how to do that right now other than resizing a panel either.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.