|
checking panel pointer bmap
#414294
12/28/12 12:57
12/28/12 12:57
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi guys, How can I check what the bmap is of a panel? I have a pointer called Pointer_ItemInSlot1:
PANEL* Pointer_ItemInSlot1;
and I want to check the bmap is of the panel the pointer addresses. Thanks for taking the time.
|
|
|
Re: checking panel pointer bmap
[Re: rayp]
#414325
12/28/12 19:55
12/28/12 19:55
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Yes that is what I meant I have a bug though. The if code doesn't seem to work here in my code. Here's the relevant code:
BMAP* interfacedummy_png = "InterfaceDummy.png";
...
PANEL* Pointer_ItemInSlot1 = interfacedummy_png;
...
function buy_stinger()
{
if (goldplayer >= 40) { //ignore this
if (Pointer_ItemInSlot1.bmap == interfacedummy_png) { //the slot = empty
Pointer_ItemInSlot1.bmap = IconItemStinger_bmp;
Pointer_ItemInSlot1.skill_x = 1; //ignore this
goldplayer -= 40;} //ignore this
...
The 'goldplayer' is not the problem, i know this 100% sure. The problem is that it ignores the "if (Pointer_ItemInSlot1.bmap == interfacedummy_png)" but I don't know why.
Last edited by Reconnoiter; 12/28/12 19:56.
|
|
|
Re: checking panel pointer bmap
[Re: Reconnoiter]
#414331
12/29/12 09:29
12/29/12 09:29
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Assigning a pointer to a bitmap to pointer to a panel is not a good idea...
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: checking panel pointer bmap
[Re: muffel]
#414343
12/29/12 13:44
12/29/12 13:44
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
And what about reading a bmap from a button? Not possible afaik. But you can go exactly the way rayp suggested. You just have to ensure you initialize your panel correctly. Either with a static definition or with pan_create.
PANEL* Pointer_ItemInSlot1 =
{
bmap="InterfaceDummy.png";
}
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|