Fix Cosmetics Not Showing In DM Form Sometimes
This commit is contained in:
parent
c1ca1ec402
commit
520b01f5a0
@ -349,22 +349,26 @@ namespace qtcnet_client
|
||||
}
|
||||
}
|
||||
|
||||
private void ProfileForm_OnMessageClicked(object? sender, EventArgs e)
|
||||
private async void ProfileForm_OnMessageClicked(object? sender, EventArgs e)
|
||||
{
|
||||
if(sender is ProfileForm _profileForm)
|
||||
{
|
||||
// create dm form
|
||||
DirectMessageForm _dmForm = new(_imgFactory)
|
||||
var _userInfo = await _apiService.GetUserInformationAsync(_profileForm.UserId);
|
||||
if(_userInfo.Success && _userInfo.Data != null)
|
||||
{
|
||||
UserId = _profileForm.UserId,
|
||||
Username = _profileForm.Username,
|
||||
ProfileImage = _imgFactory.GetAndCreateProfileImage(_profileForm.UserId, -1), // TODO - probably rework forms to take in models instead of individual params
|
||||
};
|
||||
_dmForm.OnClose += DirectMessage_OnClose;
|
||||
_dmForm.OnSend += DirectMessage_OnSend;
|
||||
// create dm form
|
||||
DirectMessageForm _dmForm = new(_imgFactory)
|
||||
{
|
||||
UserId = _profileForm.UserId,
|
||||
Username = _profileForm.Username,
|
||||
ProfileImage = _imgFactory.GetAndCreateProfileImage(_profileForm.UserId, -1, _userInfo.Data.ProfileCosmeticId),
|
||||
};
|
||||
_dmForm.OnClose += DirectMessage_OnClose;
|
||||
_dmForm.OnSend += DirectMessage_OnSend;
|
||||
|
||||
_dmForm.Show();
|
||||
OpenDirectMessagesForms.Add(_dmForm);
|
||||
_dmForm.Show();
|
||||
OpenDirectMessagesForms.Add(_dmForm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -406,6 +410,7 @@ namespace qtcnet_client
|
||||
_profile.ProfileImage = _imgFactory.GetAndCreateProfileImage(_user.Data.Id, _user.Data.Status, _user.Data.ProfileCosmeticId);
|
||||
|
||||
_profile.OnClose += ProfileForm_OnClose;
|
||||
_profile.OnMessageClicked += ProfileForm_OnMessageClicked;
|
||||
|
||||
OpenProfileForms.Add(_profile);
|
||||
_profile.Show();
|
||||
@ -876,7 +881,8 @@ namespace qtcnet_client
|
||||
{
|
||||
ItemId = _itemId,
|
||||
ItemName = _ctrl.SelectedStoreItem.Text,
|
||||
ItemThumbnail = await _imgFactory.GetStoreItemThumb(_itemId)
|
||||
ItemThumbnail = await _imgFactory.GetStoreItemThumb(_itemId),
|
||||
Price = _item.Data.Price,
|
||||
};
|
||||
_itemForm.OnBuyClicked += _itemForm_OnBuyClicked;
|
||||
|
||||
@ -899,7 +905,7 @@ namespace qtcnet_client
|
||||
}
|
||||
else
|
||||
{
|
||||
KryptonMessageBox.Show("Something Went Wrong Buying This Item. Please Try Again Later.", "Uh Oh.");
|
||||
KryptonMessageBox.Show("Something Went Wrong Buying This Item. You May Not Have Enough Q's. Please Try Again Later.", "Uh Oh.");
|
||||
_form.Close();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user