MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_UpdateProductionStringID

Function GUI_UpdateProductionStringID

src/gui/gui.c:715–756  ·  view source on GitHub ↗

* Sets the activity description to the correct string for the active structure. * @see g_productionStringID */

Source from the content-addressed store, hash-verified

713 * @see g_productionStringID
714 */
715void GUI_UpdateProductionStringID(void)
716{
717 Structure *s = NULL;
718
719 s = Structure_Get_ByPackedTile(g_selectionPosition);
720
721 g_productionStringID = STR_NULL;
722
723 if (s == NULL) return;
724
725 if (!g_table_structureInfo[s->o.type].o.flags.factory) {
726 if (s->o.type == STRUCTURE_PALACE) g_productionStringID = STR_LAUNCH + g_table_houseInfo[s->o.houseID].specialWeapon - 1;
727 return;
728 }
729
730 if (s->o.flags.s.upgrading) {
731 g_productionStringID = STR_UPGRADINGD_DONE;
732 return;
733 }
734
735 if (s->o.linkedID == 0xFF) {
736 g_productionStringID = STR_BUILD_IT;
737 return;
738 }
739
740 if (s->o.flags.s.onHold) {
741 g_productionStringID = STR_ON_HOLD;
742 return;
743 }
744
745 if (s->countDown != 0) {
746 g_productionStringID = STR_D_DONE;
747 return;
748 }
749
750 if (s->o.type == STRUCTURE_CONSTRUCTION_YARD) {
751 g_productionStringID = STR_PLACE_IT;
752 return;
753 }
754
755 g_productionStringID = STR_COMPLETED;
756}
757
758static void GUI_Widget_SetProperties(uint16 index, uint16 xpos, uint16 ypos, uint16 width, uint16 height)
759{

Callers 2

Calls 1

Tested by

no test coverage detected