| 781 | } |
| 782 | |
| 783 | void CWorldWeaponsDialog::OnLoadWeaponAnim() { |
| 784 | char filename[255]; |
| 785 | int bm_handle; |
| 786 | int anim = 0; |
| 787 | |
| 788 | CString filter = |
| 789 | "Descent III files (*.tga,*.bbm,*.lbm,*.ogf,*.oaf,*.ilf,*.pcx)|*.pcx;*.tga;*.bbm;*.lbm;*.ogf;*.oaf;*.ifl||"; |
| 790 | |
| 791 | if (!OpenFileDialog(this, (LPCSTR)filter, filename, Current_weapon_dir, sizeof(Current_weapon_dir))) |
| 792 | return; |
| 793 | |
| 794 | // Okay, we selected a file. Lets do what needs to be done here. |
| 795 | bm_handle = LoadWeaponHudImage(filename, &anim); |
| 796 | |
| 797 | if (bm_handle < 0) { |
| 798 | OutrageMessageBox("Could not load that bitmap...restoring previous bitmap."); |
| 799 | return; |
| 800 | } |
| 801 | int n = D3EditState.current_weapon; |
| 802 | |
| 803 | Weapons[n].hud_image_handle = bm_handle; |
| 804 | |
| 805 | if (anim) |
| 806 | Weapons[n].flags |= WF_HUD_ANIMATED; |
| 807 | else |
| 808 | Weapons[n].flags &= ~WF_HUD_ANIMATED; |
| 809 | |
| 810 | mprintf(0, "Making a copy of this bitmap/anim locally...\n"); |
| 811 | |
| 812 | std::filesystem::path curname; |
| 813 | if (anim) { |
| 814 | curname = LocalManageGraphicsDir / GameVClips[Weapons[n].hud_image_handle].name; |
| 815 | SaveVClip(curname, Weapons[n].hud_image_handle); |
| 816 | |
| 817 | } else { |
| 818 | curname = LocalManageGraphicsDir / GameBitmaps[Weapons[n].hud_image_handle].name; |
| 819 | bm_SaveFileBitmap(curname, Weapons[n].hud_image_handle); |
| 820 | } |
| 821 | |
| 822 | UpdateDialog(); |
| 823 | } |
| 824 | |
| 825 | void CWorldWeaponsDialog::OnSelendokWeaponPulldown() { |
| 826 | int i, cur; |
nothing calls this directly
no test coverage detected