Such a stupid mistake, too! Thank you so much for your help.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuenum Slot_Type {eCharacter, eInventory};
int Char_Slot_Count;
struct Slot {
GUIControl* slotgui;
Slot_Type type;
int contained;
//other stuff
};
QuoteThe way I do it is simply to check in rep-exec what room object (or hotspot) is at the mouse coordinates, so it doesn't matter whether there's a GUI on top or not.
// No SlotStructure struct
struct Slot {
int Whatever_Data_Is_In_The_Slot;
// etc etc
GUIControl* thiscontrol; //So I can issues visual commands to the right button - like to move it from one position to another
}
//again, no SlotStructure struct
struct CharacterSlot {
Character* slotCharacter [4];
int xstart [4];
int ystart[4];
int xend[4];
//etc etc
}
// Header
struct Slot_Structure{
//various variables
int NumberOfSlots;
};
managed struct Slot{
//various variables
int xpos;
int ypos; //to determine where it is on screen
GUI* slotgui;
import static Slot*[] NewArray (int count);
};
// script
Slot_Structure blue;
Slot_Structure red;
static Slot*[] Slot::NewArray (int count)
{
Slot* slot[];
count++; // adding one slot so that slot[0] can refer to the bottom controlling button
slot = new Slot[count];
for (int i=0; i<count;i++) { slot[i] = new Slot; }
return slot;
}
function game_start()
{
blue.NumberOfSlots = 4;
red.NumberOfSlots = 8;
for (int i=0; i<= blue.NumberOfSlots; i++)
{
//assign each slot a GUI
}
for //same thing for red - this could probably be its own extender function
}
arrayname = String.Format("peter");
int arrayname[5];
function HighestGUI()
{
int Previous_ZOrder = 0;
for (int x=0; x<Screen.Width; x+=5)
{
for (int y=0; y<Screen.Height; y+=5)
{
GUI *theGui = GUI.GetAtScreenXY(x,y);
if ((theGui!=null)&&(theGui.ZOrder>Previous_ZOrder)&&(theGui!=gBlackSlug))
{
Previous_ZOrder = theGui.ZOrder;
}
}
}
return(Previous_ZOrder);
}
function ReorderBlackSlug(BlackSlugFade Fadetype, float t)
{
int Target_ZOrder = HighestGUI();
if (Target_ZOrder<=2)
{
gBlackSlug.Visible = false;
gBlackSlug.Clickable =false;
gBlackSlug.Transparency=100;
gBlackSlug.ZOrder = 0;
}
else
{
if (gBlackSlug.Visible==false){gBlackSlug.Visible = true;}
if (gBlackSlug.Clickable==false){gBlackSlug.Clickable = true;}
if (Fadetype == eSlugFade)
{
if (gBlackSlug.Transparency!=100){gBlackSlug.Transparency = 100;}
gBlackSlug.TweenTransparency (t, 40, eEaseLinearTween, eNoBlockTween, 0.0, eTweenSeconds); // This fades in the gBlackSlug to Transparency 40 over t seconds
}
else if (Fadetype== eSlugNoFade)
{
if (gBlackSlug.Transparency!=40){gBlackSlug.Transparency = 40;}
}
gBlackSlug.ZOrder = Target_ZOrder-3;
}
}
if (gMenu.Visible==false)
{
gMenu.Visible = true;
if (!IsGamePaused()){PauseGame();}
gMenu.Clickable= false;
gMenu.TweenPosition(0.5,Menu_Onscreen_X, Menu_Onscreen_Y, eEaseOutExpoTween, eBlockTween, 0.0, eTweenSeconds);
gMenu.Clickable= true;
ReorderBlackSlug(eSlugNoFade, 0.0);
}
else if (gMenu.Visible==true)
{
if (IsGamePaused()==1){UnPauseGame();}
gMenu.TweenPosition(0.5, Menu_Offscreen_X, Screen.Height, eEaseLinearTween, eBlockTween, 0.0, eTweenSeconds);
gMenu.Visible=false;
gMenu.Clickable= false;
ReorderBlackSlug(eSlugNoFade, 0.0);
}
}
if (player.ActiveInventory == null)
{
if (GetLocationType = eLocationObject)
{
lblActionText.Text = ??????????
}
else
{
lblActionText.Text = Game.GetLocationName(mouse.x, mouse.y);
}
}
oObjectName.SetTextProperty("description", "New Description");
function room_RepExec()
{
if ((player.NormalView != 92)&&(Region.GetAtRoomXY(player.x, player.y)== region[1]))
{
player.ChangeView (92);
}
if ((player.NormalView == 92)&&(Region.GetAtRoomXY(player.x, player.y)!= region[1]))
{
player.ChangeView (2);
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.049 seconds with 16 queries.