vRice
Veteran
- Messages
- 58
- Reaction score
- 86
- Points
- 793
What's up everyone I'm vRice/VintageRice. Some of you may already know me from YouTube or Se7ensins or wherever. I recently found this website and thought it's quite decent and it's not going to be a complete flop like a lot of other contenders, anyway I thought I would create something for you all.
Before I go any further you should know I haven't scripted GSC for over two years now so getting started was a little bit clunky. But I decided to remake the Windows 10 style menu base which I created for WaW because I thought it had some potential.
IMPORTANT
If anyone could implement a good overflow fix that would help me a lot and you'll get yourself in the vRice wall of fame (I'm yet to build this, but I will seriously credit you).
Features:
Unlimited pages/options
Moderately interesting animations
Looks half-decent
Made with love
No overflow fix for you mad lads
Proper nicely formatted source
Unique design too
Preview video of it in action:
Source code (download also attached):
Older updates:
Before I go any further you should know I haven't scripted GSC for over two years now so getting started was a little bit clunky. But I decided to remake the Windows 10 style menu base which I created for WaW because I thought it had some potential.
IMPORTANT
If anyone could implement a good overflow fix that would help me a lot and you'll get yourself in the vRice wall of fame (I'm yet to build this, but I will seriously credit you).
Features:
Unlimited pages/options
Moderately interesting animations
Looks half-decent
Made with love
No overflow fix for you mad lads
Proper nicely formatted source
Unique design too
Preview video of it in action:
Source code (download also attached):
Code:
/*
Windows Style Menu Base
by vRice
Please credit me if you're gonna use this!
*/
setupMenu()
{
self.menuOpen = false;
self menuOptions();
self thread runMenu();
self thread deathWatch();
}
deathWatch()
{
while(true)
{
self waittill("death");
self menuClose();
}
}
runMenu()
{
while(true)
{
self endon("death");
self endon("disconnect");
if(!self.menuOpen)
{
if(self adsButtonPressed() && self meleeButtonPressed())
{
self.menuOpen = true;
self.menuCurs = 0;
self.pageNumber = 0;
self freezeControls(true);
self setBlur(5, .25);
self setClientUiVisibilityFlag("hud_visible", 0);
self drawMenu();
self newMenu("main");
wait .25;
}
}
else
{
if(self attackButtonPressed() || self adsButtonPressed() || self fragButtonPressed() || self secondaryOffhandButtonPressed())
{
if(self adsButtonPressed())
{
if(self.menuHUD["scroller"].x != self.menuHUD["text"][0].x)
self.xScroll -= 125;
else
{
if(self.pageNumber != 0)
self.pageNumber--;
else
self.pageNumber = int(self.menuName[self.subMenu].size / 12);
self.xScroll += 375;
self newMenu(self.subMenu);
}
}
if(self attackButtonPressed())
{
if(self.menuHUD["scroller"].x != self.menuHUD["text"][3].x)
self.xScroll += 125;
else
{
if(self.pageNumber != int(self.menuName[self.subMenu].size / 12))
self.pageNumber++;
else
self.pageNumber = 0;
self.xScroll -= 375;
self newMenu(self.subMenu);
}
}
if(self fragButtonPressed())
{
if(self.menuHUD["scroller"].y != self.menuHUD["text"][0].y)
self.yScroll -= 100;
}
if(self secondaryOffhandButtonPressed())
{
if(self.menuHUD["scroller"].y != self.menuHUD["text"][9].y)
self.yScroll += 100;
}
self doScroll();
}
if(self useButtonPressed())
{
self.newCurs = (12 * self.pageNumber) + self.menuCurs;
self thread [[self.function[self.subMenu][self.newCurs]]](self.input[self.subMenu][self.newCurs]);
wait .25;
}
if(self meleeButtonPressed())
{
if(self.subMenu != "main")
self newMenu("main");
else
self menuClose();
wait .15;
}
}
wait .05;
}
}
menuOptions()
{
self.menuTitle["main"] = "Windows Menu Base";
for(i = 0; i < 41; i++)
self addOption("main", i, "Sub Menu " + i, ::newMenu, "submenu_" + i);
for(i = 0; i < 41; i++)
{
self.menuTitle["submenu_" + i] = "Sub Menu " + i;
for(j = 0; j < 41; j++)
self addOption("submenu_" + i, j, "Sub Option " + j, ::testFunc);
}
}
menuClose()
{
self.menuOpen = false;
self.subMenu = "";
self animateMenu();
for(i = 0; i < self.menuHUD["text"].size; i++)
self.menuHUD["text"][i] destroy();
for(i = 0; i < 3; i++)
{
self.menuHUD["line"]["x"][i] destroy();
self.menuHUD["line"]["y"][i] destroy();
}
self.menuHUD["scroller"] destroy();
self.menuHUD["background"] destroy();
self.menuHUD["title"] destroy();
self freezeControls(false);
self setBlur(0, .25);
self setClientUiVisibilityFlag("hud_visible", 1);
}
doScroll()
{
self.menuHUD["scroller"] moveElem(self.xScroll, self.yScroll);
for(i = 0; i < 12; i++)
{
self.menuHUD["text"][i] fadeElem(undefined, (1, 1, 1), .5);
if(self.menuHUD["scroller"].x == self.menuHUD["text"][i].x)
if(self.menuHUD["scroller"].y == self.menuHUD["text"][i].y)
self.menuCurs = i;
}
wait .15;
self.menuHUD["text"][self.menuCurs] fadeElem(undefined, (0, .5, 1), .2);
}
newMenu(menu)
{
self.menuCurs = 0;
if(self.subMenu != menu)
{
self.subMenu = menu;
self.pageNumber = 0;
self.menuHUD["title"] fadeElem(0, undefined, .15);
self.menuHUD["page"] fadeElem(0, undefined, .15);
}
for(i = 0; i < 12; i++)
self.menuHUD["text"][i] fadeElem(0, undefined, .15);
self doScroll();
wait .2;
for(i = 0; i < 12; i++)
{
self.menuHUD["text"][i] fadeElem(1, undefined, .15);
self.menuHUD["text"][i] setText(self.menuName[menu][(12 * self.pageNumber) + i]);
}
self.menuHUD["title"] fadeElem(1, undefined, .15);
self.menuHUD["title"] setText(self.menuTitle[menu]);
self.menuHUD["page"] fadeElem(1, undefined, .15);
self.menuHUD["page"] setText("Page " + (self.pageNumber + 1) + " of " + int((self.menuName[self.subMenu].size / 12) + 1));
}
animateMenu()
{
if(self.menuOpen)
{
for(i = 0; i < 3; i++)
self.menuHUD["line"]["x"][i] moveElem((i * 125) - 125, 0, .2);
for(i = 0; i < 2; i++)
self.menuHUD["line"]["y"][i] moveElem(0, (i * 100) - 50, .2);
wait .2;
self.menuHUD["background"] fadeElem(.25, undefined, .25);
self.menuHUD["scroller"] fadeElem(.35, undefined, .25);
}
else
{
for(i = 0; i < 12; i++)
self.menuHUD["text"][i] fadeElem(0, undefined, .15);
self.menuHUD["title"] fadeElem(0, undefined, .15);
self.menuHUD["page"] fadeElem(0, undefined, .15);
wait .2;
self.menuHUD["background"] fadeElem(0, undefined, .25);
self.menuHUD["scroller"] fadeElem(0, undefined, .25);
wait .2;
for(i = 0; i < 2; i++)
self.menuHUD["line"]["y"][i] moveElem(-1000, (i * 100) - 50, .2);
for(i = 0; i < 3; i++)
self.menuHUD["line"]["x"][i] moveElem((i * 125) - 125, -1000, .2);
}
}
fadeElem(alpha, colour, time)
{
self fadeOverTime(time);
if(isDefined(alpha))
self.alpha = alpha;
if(isDefined(colour))
self.color = colour;
}
drawMenu()
{
self.menuHUD["title"] = drawText(0, -163, "center", "center", (1, 1, 1), 1, "", "default", 1.75, 1);
self.menuHUD["page"] = drawText(0, 163, "center", "center", (1, 1, 1), 1, "", "default", 1, 1);
self.optInt = 0;
for(y = 0; y < 3; y++)
{
for(x = 0; x < 4; x++)
{
self.menuHUD["text"][self.optInt] = drawText((x * 125) - 187.5, (y * 100) - 100, "center", "center", (1, 1, 1), 0, "", "default", 1.25, 2);
self.optInt++;
}
}
for(i = 0; i < 3; i++)
self.menuHUD["line"]["x"][i] = drawShader((i * 125) - 125, -1000, "center", "center", (0, 0, 0), .35, "white", 2, 300, 0);
for(i = 0; i < 2; i++)
self.menuHUD["line"]["y"][i] = drawShader(-1000, (i * 100) - 50, "center", "center", (0, 0, 0), .35, "white", 500, 2, 0);
self.xScroll = self.menuHUD["text"][0].x;
self.yScroll = self.menuHUD["text"][0].y;
self.menuHUD["background"] = drawShader(0, 0, "center", "center", (0, 0, 0), 0, "white", 500, 300, 0);
self.menuHUD["scroller"] = drawShader(self.menuHUD["text"][0].x, self.menuHUD["text"][0].y, "center", "center", (0, 0, 0), 0, "white", 125, 100, 1);
self animateMenu();
}
moveElem(x, y, hold)
{
self moveOverTime(.25);
self.x = x;
self.y = y;
if(isDefined(hold))
wait hold;
}
addOption(menu, int, name, function, option)
{
self.menuName[menu][int] = name;
self.function[menu][int] = function;
if(isDefined(option))
self.input[menu][int] = option;
}
testFunc()
{
self iPrintLn("WORKING");
}
drawText(x, y, relative, align, colour, alpha, text, font, scale, sort)
{
self endon("death");
self endon("disconnect");
newElem = self createFontString(font, scale);
newElem setText(text);
newElem setPoint(align, relative, x, y);
newElem.color = colour;
newElem.alpha = alpha;
newElem.sort = sort;
return newElem;
}
drawShader(x, y, relative, align, colour, alpha, shader, width, height, sort)
{
self endon("death");
self endon("disconnect");
newElem = newClientHudElem(self);
newElem.elemType = "icon";
newElem.color = colour;
newElem.alpha = alpha;
newElem.sort = sort;
newElem.children = [];
newElem setParent(level.uiParent);
newElem setShader(shader, width, height);
newElem setPoint(align, relative, x, y);
return newElem;
}
Older updates:
Attachments
Last edited: