Corescript formatting, typing, and consistency improvements
This commit is contained in:
parent
4d5f484abd
commit
b9b47c1771
294
Modules/New.luau
294
Modules/New.luau
|
|
@ -1,17 +1,283 @@
|
|||
-- You know what this is guyz
|
||||
-- HELIODEX'S BASIC NEW FUNCTION
|
||||
-- HELIODEX'S (not so anymore now) BASIC NEW FUNCTION
|
||||
|
||||
return function(className: InstanceName | Instance)
|
||||
local obj
|
||||
if type(className) == "string" then
|
||||
obj = Instance.new(className)
|
||||
else
|
||||
obj = className
|
||||
end
|
||||
type Return<T> = (props: { [string]: any }) -> T
|
||||
|
||||
local parent = nil
|
||||
type New =
|
||||
((className: never) -> never) -- induces a never type, not good enough but whatever
|
||||
& ((className: "Accoutrement") -> Return<Accoutrement>)
|
||||
& ((className: "Hat") -> Return<Hat>)
|
||||
& ((className: "AdvancedDragger") -> Return<AdvancedDragger>)
|
||||
& ((className: "Animation") -> Return<Animation>)
|
||||
& ((className: "CurveAnimation") -> Return<CurveAnimation>)
|
||||
& ((className: "KeyframeSequence") -> Return<KeyframeSequence>)
|
||||
& ((className: "AnimationController") -> Return<AnimationController>)
|
||||
& ((className: "AnimationRigData") -> Return<AnimationRigData>)
|
||||
& ((className: "Animator") -> Return<Animator>)
|
||||
& ((className: "AudioDeviceInput") -> Return<AudioDeviceInput>)
|
||||
& ((className: "AudioDeviceOutput") -> Return<AudioDeviceOutput>)
|
||||
& ((className: "AudioDistortion") -> Return<AudioDistortion>)
|
||||
& ((className: "AudioEcho") -> Return<AudioEcho>)
|
||||
& ((className: "AudioEmitter") -> Return<AudioEmitter>)
|
||||
& ((className: "AudioEqualizer") -> Return<AudioEqualizer>)
|
||||
& ((className: "AudioFader") -> Return<AudioFader>)
|
||||
& ((className: "AudioFlanger") -> Return<AudioFlanger>)
|
||||
& ((className: "AudioListener") -> Return<AudioListener>)
|
||||
& ((className: "AudioPitchShifter") -> Return<AudioPitchShifter>)
|
||||
& ((className: "AudioPlayer") -> Return<AudioPlayer>)
|
||||
& ((className: "AudioReverb") -> Return<AudioReverb>)
|
||||
& ((className: "AudioSearchParams") -> Return<AudioSearchParams>)
|
||||
& ((className: "Backpack") -> Return<Backpack>)
|
||||
& ((className: "BindableEvent") -> Return<BindableEvent>)
|
||||
& ((className: "BindableFunction") -> Return<BindableFunction>)
|
||||
& ((className: "BodyAngularVelocity") -> Return<BodyAngularVelocity>)
|
||||
& ((className: "BodyForce") -> Return<BodyForce>)
|
||||
& ((className: "BodyGyro") -> Return<BodyGyro>)
|
||||
& ((className: "BodyPosition") -> Return<BodyPosition>)
|
||||
& ((className: "BodyThrust") -> Return<BodyThrust>)
|
||||
& ((className: "BodyVelocity") -> Return<BodyVelocity>)
|
||||
& ((className: "RocketPropulsion") -> Return<RocketPropulsion>)
|
||||
& ((
|
||||
className: "BubbleChatMessageProperties"
|
||||
) -> Return<BubbleChatMessageProperties>)
|
||||
& ((className: "Camera") -> Return<Camera>)
|
||||
& ((className: "BodyColors") -> Return<BodyColors>)
|
||||
& ((className: "CharacterMesh") -> Return<CharacterMesh>)
|
||||
& ((className: "Pants") -> Return<Pants>)
|
||||
& ((className: "Shirt") -> Return<Shirt>)
|
||||
& ((className: "ShirtGraphic") -> Return<ShirtGraphic>)
|
||||
& ((className: "Skin") -> Return<Skin>)
|
||||
& ((className: "ClickDetector") -> Return<ClickDetector>)
|
||||
& ((className: "DragDetector") -> Return<DragDetector>)
|
||||
& ((className: "Configuration") -> Return<Configuration>)
|
||||
& ((className: "AngularVelocity") -> Return<AngularVelocity>)
|
||||
& ((className: "AnimationConstraint") -> Return<AnimationConstraint>)
|
||||
& ((className: "BallSocketConstraint") -> Return<BallSocketConstraint>)
|
||||
& ((className: "HingeConstraint") -> Return<HingeConstraint>)
|
||||
& ((className: "LineForce") -> Return<LineForce>)
|
||||
& ((className: "LinearVelocity") -> Return<LinearVelocity>)
|
||||
& ((className: "PlaneConstraint") -> Return<PlaneConstraint>)
|
||||
& ((className: "Plane") -> Return<Plane>)
|
||||
& ((className: "RigidConstraint") -> Return<RigidConstraint>)
|
||||
& ((className: "RodConstraint") -> Return<RodConstraint>)
|
||||
& ((className: "RopeConstraint") -> Return<RopeConstraint>)
|
||||
& ((className: "CylindricalConstraint") -> Return<CylindricalConstraint>)
|
||||
& ((className: "PrismaticConstraint") -> Return<PrismaticConstraint>)
|
||||
& ((className: "SpringConstraint") -> Return<SpringConstraint>)
|
||||
& ((className: "Torque") -> Return<Torque>)
|
||||
& ((
|
||||
className: "TorsionSpringConstraint"
|
||||
) -> Return<TorsionSpringConstraint>)
|
||||
& ((className: "UniversalConstraint") -> Return<UniversalConstraint>)
|
||||
& ((className: "HumanoidController") -> Return<HumanoidController>)
|
||||
& ((className: "SkateboardController") -> Return<SkateboardController>)
|
||||
& ((className: "VehicleController") -> Return<VehicleController>)
|
||||
& ((className: "AirController") -> Return<AirController>)
|
||||
& ((className: "ClimbController") -> Return<ClimbController>)
|
||||
& ((className: "GroundController") -> Return<GroundController>)
|
||||
& ((className: "SwimController") -> Return<SwimController>)
|
||||
& ((className: "ControllerManager") -> Return<ControllerManager>)
|
||||
& ((className: "CustomEvent") -> Return<CustomEvent>)
|
||||
& ((className: "CustomEventReceiver") -> Return<CustomEventReceiver>)
|
||||
& ((className: "CylinderMesh") -> Return<CylinderMesh>)
|
||||
& ((className: "DynamicMesh") -> Return<DynamicMesh>)
|
||||
& ((className: "FileMesh") -> Return<FileMesh>)
|
||||
& ((className: "SpecialMesh") -> Return<SpecialMesh>)
|
||||
& ((
|
||||
className: "DataStoreIncrementOptions"
|
||||
) -> Return<DataStoreIncrementOptions>)
|
||||
& ((className: "DataStoreOptions") -> Return<DataStoreOptions>)
|
||||
& ((className: "DataStoreSetOptions") -> Return<DataStoreSetOptions>)
|
||||
& ((className: "DebuggerWatch") -> Return<DebuggerWatch>)
|
||||
& ((className: "Dialog") -> Return<Dialog>)
|
||||
& ((className: "DialogChoice") -> Return<DialogChoice>)
|
||||
& ((className: "Dragger") -> Return<Dragger>)
|
||||
& ((
|
||||
className: "ExperienceInviteOptions"
|
||||
) -> Return<ExperienceInviteOptions>)
|
||||
& ((className: "Explosion") -> Return<Explosion>)
|
||||
& ((className: "Decal") -> Return<Decal>)
|
||||
& ((className: "Texture") -> Return<Texture>)
|
||||
& ((className: "Hole") -> Return<Hole>)
|
||||
& ((className: "MotorFeature") -> Return<MotorFeature>)
|
||||
& ((className: "Fire") -> Return<Fire>)
|
||||
& ((className: "CSGDictionaryService") -> Return<CSGDictionaryService>)
|
||||
& ((
|
||||
className: "NonReplicatedCSGDictionaryService"
|
||||
) -> Return<NonReplicatedCSGDictionaryService>)
|
||||
& ((className: "ForceField") -> Return<ForceField>)
|
||||
& ((className: "FunctionalTest") -> Return<FunctionalTest>)
|
||||
& ((className: "GetTextBoundsParams") -> Return<GetTextBoundsParams>)
|
||||
& ((className: "Frame") -> Return<Frame>)
|
||||
& ((className: "ImageButton") -> Return<ImageButton>)
|
||||
& ((className: "TextButton") -> Return<TextButton>)
|
||||
& ((className: "ImageLabel") -> Return<ImageLabel>)
|
||||
& ((className: "TextLabel") -> Return<TextLabel>)
|
||||
& ((className: "TextBox") -> Return<TextBox>)
|
||||
& ((className: "VideoFrame") -> Return<VideoFrame>)
|
||||
& ((className: "ViewportFrame") -> Return<ViewportFrame>)
|
||||
& ((className: "BillboardGui") -> Return<BillboardGui>)
|
||||
& ((className: "ScreenGui") -> Return<ScreenGui>)
|
||||
& ((className: "GuiMain") -> Return<GuiMain>)
|
||||
& ((className: "AdGui") -> Return<AdGui>)
|
||||
& ((className: "SurfaceGui") -> Return<SurfaceGui>)
|
||||
& ((className: "FloorWire") -> Return<FloorWire>)
|
||||
& ((className: "SelectionBox") -> Return<SelectionBox>)
|
||||
& ((className: "BoxHandleAdornment") -> Return<BoxHandleAdornment>)
|
||||
& ((className: "ConeHandleAdornment") -> Return<ConeHandleAdornment>)
|
||||
& ((
|
||||
className: "CylinderHandleAdornment"
|
||||
) -> Return<CylinderHandleAdornment>)
|
||||
& ((className: "ImageHandleAdornment") -> Return<ImageHandleAdornment>)
|
||||
& ((className: "LineHandleAdornment") -> Return<LineHandleAdornment>)
|
||||
& ((className: "SphereHandleAdornment") -> Return<SphereHandleAdornment>)
|
||||
& ((
|
||||
className: "WireframeHandleAdornment"
|
||||
) -> Return<WireframeHandleAdornment>)
|
||||
& ((className: "ParabolaAdornment") -> Return<ParabolaAdornment>)
|
||||
& ((className: "SelectionSphere") -> Return<SelectionSphere>)
|
||||
& ((className: "ArcHandles") -> Return<ArcHandles>)
|
||||
& ((className: "Handles") -> Return<Handles>)
|
||||
& ((className: "SurfaceSelection") -> Return<SurfaceSelection>)
|
||||
& ((className: "SelectionPartLasso") -> Return<SelectionPartLasso>)
|
||||
& ((className: "SelectionPointLasso") -> Return<SelectionPointLasso>)
|
||||
& ((
|
||||
className: "HeightmapImporterService"
|
||||
) -> Return<HeightmapImporterService>)
|
||||
& ((
|
||||
className: "HiddenSurfaceRemovalAsset"
|
||||
) -> Return<HiddenSurfaceRemovalAsset>)
|
||||
& ((className: "Humanoid") -> Return<Humanoid>)
|
||||
& ((className: "RotateP") -> Return<RotateP>)
|
||||
& ((className: "RotateV") -> Return<RotateV>)
|
||||
& ((className: "Glue") -> Return<Glue>)
|
||||
& ((className: "ManualGlue") -> Return<ManualGlue>)
|
||||
& ((className: "ManualWeld") -> Return<ManualWeld>)
|
||||
& ((className: "Motor") -> Return<Motor>)
|
||||
& ((className: "Motor6D") -> Return<Motor6D>)
|
||||
& ((className: "Rotate") -> Return<Rotate>)
|
||||
& ((className: "Snap") -> Return<Snap>)
|
||||
& ((className: "VelocityMotor") -> Return<VelocityMotor>)
|
||||
& ((className: "Weld") -> Return<Weld>)
|
||||
& ((className: "Keyframe") -> Return<Keyframe>)
|
||||
& ((className: "KeyframeMarker") -> Return<KeyframeMarker>)
|
||||
& ((className: "PointLight") -> Return<PointLight>)
|
||||
& ((className: "SpotLight") -> Return<SpotLight>)
|
||||
& ((className: "SurfaceLight") -> Return<SurfaceLight>)
|
||||
& ((className: "Script") -> Return<Script>)
|
||||
& ((className: "LocalScript") -> Return<LocalScript>)
|
||||
& ((className: "ModuleScript") -> Return<ModuleScript>)
|
||||
& ((className: "MarkerCurve") -> Return<MarkerCurve>)
|
||||
& ((className: "MemoryStoreService") -> Return<MemoryStoreService>)
|
||||
& ((className: "Message") -> Return<Message>)
|
||||
& ((className: "Hint") -> Return<Hint>)
|
||||
& ((className: "CornerWedgePart") -> Return<CornerWedgePart>)
|
||||
& ((className: "Part") -> Return<Part>)
|
||||
& ((className: "FlagStand") -> Return<FlagStand>)
|
||||
& ((className: "Seat") -> Return<Seat>)
|
||||
& ((className: "SkateboardPlatform") -> Return<SkateboardPlatform>)
|
||||
& ((className: "SpawnLocation") -> Return<SpawnLocation>)
|
||||
& ((className: "WedgePart") -> Return<WedgePart>)
|
||||
& ((className: "PartOperation") -> Return<PartOperation>)
|
||||
& ((className: "IntersectOperation") -> Return<IntersectOperation>)
|
||||
& ((className: "NegateOperation") -> Return<NegateOperation>)
|
||||
& ((className: "UnionOperation") -> Return<UnionOperation>)
|
||||
& ((className: "TrussPart") -> Return<TrussPart>)
|
||||
& ((className: "VehicleSeat") -> Return<VehicleSeat>)
|
||||
& ((className: "Model") -> Return<Model>)
|
||||
& ((className: "HopperBin") -> Return<HopperBin>)
|
||||
& ((className: "Tool") -> Return<Tool>)
|
||||
& ((className: "Flag") -> Return<Flag>)
|
||||
& ((className: "WorldModel") -> Return<WorldModel>)
|
||||
& ((className: "PartOperationAsset") -> Return<PartOperationAsset>)
|
||||
& ((className: "PathfindingLink") -> Return<PathfindingLink>)
|
||||
& ((className: "PathfindingModifier") -> Return<PathfindingModifier>)
|
||||
& ((className: "Player") -> Return<Player>)
|
||||
& ((className: "PluginAction") -> Return<PluginAction>)
|
||||
& ((className: "PluginCapabilities") -> Return<PluginCapabilities>)
|
||||
& ((className: "NumberPose") -> Return<NumberPose>)
|
||||
& ((className: "Pose") -> Return<Pose>)
|
||||
& ((className: "ReflectionMetadata") -> Return<ReflectionMetadata>)
|
||||
& ((
|
||||
className: "ReflectionMetadataCallbacks"
|
||||
) -> Return<ReflectionMetadataCallbacks>)
|
||||
& ((
|
||||
className: "ReflectionMetadataClasses"
|
||||
) -> Return<ReflectionMetadataClasses>)
|
||||
& ((
|
||||
className: "ReflectionMetadataEnums"
|
||||
) -> Return<ReflectionMetadataEnums>)
|
||||
& ((
|
||||
className: "ReflectionMetadataEvents"
|
||||
) -> Return<ReflectionMetadataEvents>)
|
||||
& ((
|
||||
className: "ReflectionMetadataFunctions"
|
||||
) -> Return<ReflectionMetadataFunctions>)
|
||||
& ((
|
||||
className: "ReflectionMetadataClass"
|
||||
) -> Return<ReflectionMetadataClass>)
|
||||
& ((className: "ReflectionMetadataEnum") -> Return<ReflectionMetadataEnum>)
|
||||
& ((
|
||||
className: "ReflectionMetadataEnumItem"
|
||||
) -> Return<ReflectionMetadataEnumItem>)
|
||||
& ((
|
||||
className: "ReflectionMetadataMember"
|
||||
) -> Return<ReflectionMetadataMember>)
|
||||
& ((
|
||||
className: "ReflectionMetadataProperties"
|
||||
) -> Return<ReflectionMetadataProperties>)
|
||||
& ((
|
||||
className: "ReflectionMetadataYieldFunctions"
|
||||
) -> Return<ReflectionMetadataYieldFunctions>)
|
||||
& ((className: "RemoteEvent") -> Return<RemoteEvent>)
|
||||
& ((className: "RemoteFunction") -> Return<RemoteFunction>)
|
||||
& ((className: "RenderingTest") -> Return<RenderingTest>)
|
||||
& ((className: "BuoyancySensor") -> Return<BuoyancySensor>)
|
||||
& ((className: "ControllerPartSensor") -> Return<ControllerPartSensor>)
|
||||
& ((className: "Sky") -> Return<Sky>)
|
||||
& ((className: "Smoke") -> Return<Smoke>)
|
||||
& ((className: "Sound") -> Return<Sound>)
|
||||
& ((className: "Sparkles") -> Return<Sparkles>)
|
||||
& ((
|
||||
className: "StandalonePluginScripts"
|
||||
) -> Return<StandalonePluginScripts>)
|
||||
& ((className: "StarterGear") -> Return<StarterGear>)
|
||||
& ((className: "StudioCallout") -> Return<StudioCallout>)
|
||||
& ((className: "StudioObjectBase") -> Return<StudioObjectBase>)
|
||||
& ((className: "StudioWidget") -> Return<StudioWidget>)
|
||||
& ((className: "StyleDerive") -> Return<StyleDerive>)
|
||||
& ((className: "StyleLink") -> Return<StyleLink>)
|
||||
& ((className: "SurfaceAppearance") -> Return<SurfaceAppearance>)
|
||||
& ((className: "Team") -> Return<Team>)
|
||||
& ((className: "TeleportOptions") -> Return<TeleportOptions>)
|
||||
& ((className: "TerrainDetail") -> Return<TerrainDetail>)
|
||||
& ((className: "TerrainRegion") -> Return<TerrainRegion>)
|
||||
& ((className: "TestService") -> Return<TestService>)
|
||||
& ((className: "TextChannel") -> Return<TextChannel>)
|
||||
& ((className: "TextChatCommand") -> Return<TextChatCommand>)
|
||||
& ((
|
||||
className: "TextChatMessageProperties"
|
||||
) -> Return<TextChatMessageProperties>)
|
||||
& ((className: "TrackerStreamAnimation") -> Return<TrackerStreamAnimation>)
|
||||
& ((className: "BinaryStringValue") -> Return<BinaryStringValue>)
|
||||
& ((className: "BoolValue") -> Return<BoolValue>)
|
||||
& ((className: "BrickColorValue") -> Return<BrickColorValue>)
|
||||
& ((className: "CFrameValue") -> Return<CFrameValue>)
|
||||
& ((className: "Color3Value") -> Return<Color3Value>)
|
||||
& ((className: "DoubleConstrainedValue") -> Return<DoubleConstrainedValue>)
|
||||
& ((className: "IntConstrainedValue") -> Return<IntConstrainedValue>)
|
||||
& ((className: "IntValue") -> Return<IntValue>)
|
||||
& ((className: "NumberValue") -> Return<NumberValue>)
|
||||
& ((className: "ObjectValue") -> Return<ObjectValue>)
|
||||
& ((className: "RayValue") -> Return<RayValue>)
|
||||
& ((className: "StringValue") -> Return<StringValue>)
|
||||
& ((className: "Vector3Value") -> Return<Vector3Value>)
|
||||
& ((className: "Wire") -> Return<Wire>)
|
||||
|
||||
local function propsApplier(obj)
|
||||
return function(props: { [string]: any })
|
||||
local parent
|
||||
|
||||
for k, v in pairs(props) do
|
||||
if type(k) == "string" then
|
||||
if k == "Parent" then
|
||||
|
|
@ -29,3 +295,13 @@ return function(className: InstanceName | Instance)
|
|||
return obj
|
||||
end
|
||||
end
|
||||
|
||||
local New = function(className)
|
||||
return propsApplier(Instance.new(className))
|
||||
end :: New
|
||||
|
||||
local Hydrate = function(target)
|
||||
return propsApplier(target)
|
||||
end :: <T>(T) -> (props: { [string]: any }) -> T
|
||||
|
||||
return { New = New, Hydrate = Hydrate }
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ print "[Mercury]: Loaded corescript 107893730"
|
|||
|
||||
local MarketplaceService = game:GetService "MarketplaceService"
|
||||
local GuiService = game:GetService "GuiService"
|
||||
local ContentProvider = game:GetService "ContentProvider"
|
||||
local HttpService = game:GetService "HttpService"
|
||||
|
||||
-- wait for important items to appear
|
||||
while not Game do
|
||||
|
|
@ -23,8 +25,7 @@ end
|
|||
|
||||
-------------------------------- Global Variables ----------------------------------------
|
||||
-- utility variables
|
||||
local RbxUtility
|
||||
local baseUrl = game:GetService("ContentProvider").BaseUrl:lower()
|
||||
local baseUrl = ContentProvider.BaseUrl:lower()
|
||||
|
||||
-- data variables
|
||||
local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable
|
||||
|
|
@ -40,10 +41,10 @@ local purchaseDialog
|
|||
local tweenTime = 0.3
|
||||
local showPosition = UDim2.new(0.5, -330, 0.5, -200)
|
||||
local hidePosition = UDim2.new(0.5, -330, 1, 25)
|
||||
local isSmallScreen
|
||||
-- local isSmallScreen
|
||||
local spinning = false
|
||||
local spinnerIcons
|
||||
local smallScreenThreshold = 450
|
||||
-- local smallScreenThreshold = 450
|
||||
|
||||
-- user facing images
|
||||
local function assetUrl(id: number)
|
||||
|
|
@ -92,13 +93,6 @@ local function getSecureApiBaseUrl()
|
|||
return secureApiUrl
|
||||
end
|
||||
|
||||
local function getRbxUtility()
|
||||
if not RbxUtility then
|
||||
RbxUtility = LoadLibrary "RbxUtility"
|
||||
end
|
||||
return RbxUtility
|
||||
end
|
||||
|
||||
local function preloadAssets()
|
||||
for _, url in ipairs {
|
||||
errorImageUrl,
|
||||
|
|
@ -114,7 +108,7 @@ local function preloadAssets()
|
|||
tixIcon,
|
||||
robuxIcon,
|
||||
} do
|
||||
game:GetService("ContentProvider"):Preload(url)
|
||||
ContentProvider:Preload(url)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -219,7 +213,7 @@ local function currencyEnumToInt(currencyEnum: Enum.CurrencyType)
|
|||
end
|
||||
|
||||
-- oi, this is ugly
|
||||
local function assetTypeToString(assetType)
|
||||
local function assetTypeToString(assetType: number)
|
||||
if assetType == 1 then
|
||||
return "Image"
|
||||
elseif assetType == 2 then
|
||||
|
|
@ -307,7 +301,7 @@ local function currencyTypeToString(currencyType)
|
|||
end
|
||||
|
||||
-- make sure our gui displays the proper purchase data, and set the productid we will try and buy if use specifies a buy action
|
||||
local function updatePurchasePromptData(_)
|
||||
local function updatePurchasePromptData()
|
||||
local newItemDescription = ""
|
||||
|
||||
-- id to use when we request a purchase
|
||||
|
|
@ -359,7 +353,7 @@ local function updatePurchasePromptData(_)
|
|||
end
|
||||
|
||||
-- more enum to int fun!
|
||||
local function membershipTypeToNumber(membership)
|
||||
local function membershipTypeToNumber(membership: EnumItem) -- idk if there's a better type than EnumItem
|
||||
if membership == Enum.MembershipType.None then
|
||||
return 0
|
||||
elseif membership == Enum.MembershipType.BuildersClub then
|
||||
|
|
@ -451,9 +445,7 @@ local function getPlayerBalance()
|
|||
return
|
||||
end
|
||||
|
||||
playerBalance = getRbxUtility().DecodeJSON(playerBalance)
|
||||
|
||||
return playerBalance
|
||||
return HttpService:JSONDecode(playerBalance)
|
||||
end
|
||||
|
||||
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
|
||||
|
|
@ -504,8 +496,7 @@ local function canPurchaseItem()
|
|||
)
|
||||
end)
|
||||
if success then
|
||||
currentProductInfo =
|
||||
getRbxUtility().DecodeJSON(currentProductInfoRaw)
|
||||
currentProductInfo = HttpService:JSONDecode(currentProductInfoRaw)
|
||||
end
|
||||
else
|
||||
success = ypcall(function()
|
||||
|
|
@ -552,7 +543,7 @@ local function canPurchaseItem()
|
|||
-- next we parse through product info and see if we can purchase
|
||||
|
||||
if type(currentProductInfo) ~= "table" then
|
||||
currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfo)
|
||||
currentProductInfo = HttpService:JSONDecode(currentProductInfo)
|
||||
end
|
||||
|
||||
if not currentProductInfo then
|
||||
|
|
@ -851,9 +842,7 @@ local function acceptPurchase()
|
|||
|
||||
local currencyData = `¤cyTypeId={currencyEnumToInt(
|
||||
currentCurrencyType
|
||||
)}¤cyTypeId={currencyEnumToInt(
|
||||
currentCurrencyType
|
||||
)}`
|
||||
)}¤cyTypeId={currencyEnumToInt(currentCurrencyType)}`
|
||||
|
||||
-- consumables need to use a different url
|
||||
if purchasingConsumable then
|
||||
|
|
@ -890,11 +879,10 @@ local function acceptPurchase()
|
|||
end
|
||||
|
||||
-- parse our response, decide how to react
|
||||
response = getRbxUtility().DecodeJSON(response)
|
||||
response = HttpService:JSONDecode(response)
|
||||
|
||||
if response then
|
||||
if response.success == false then
|
||||
if response.status ~= "AlreadyOwned" then
|
||||
if response.success == false and response.status ~= "AlreadyOwned" then
|
||||
print(
|
||||
"web return response of fail on purchase of",
|
||||
currentAssetId,
|
||||
|
|
@ -903,7 +891,6 @@ local function acceptPurchase()
|
|||
purchaseFailed((response.status == "EconomyDisabled"))
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
print(
|
||||
"web return response of non parsable JSON on purchase of",
|
||||
|
|
@ -1261,42 +1248,42 @@ end
|
|||
|
||||
-- next 2 functions are convenienvce creation functions for guis
|
||||
|
||||
local function cutSizeInHalfRecursive(_)
|
||||
-- local function cutSizeInHalfRecursive(_)
|
||||
-- todo: change the gui size based on how much space we have
|
||||
--[[changeSize(instance,0.5)
|
||||
-- changeSize(instance, 0.5)
|
||||
|
||||
local children = instance:GetChildren()
|
||||
for i = 1, #children do
|
||||
cutSizeInHalfRecursive(children[i])
|
||||
end]]
|
||||
end
|
||||
-- local children = instance:GetChildren()
|
||||
-- for i = 1, #children do
|
||||
-- cutSizeInHalfRecursive(children[i])
|
||||
-- end
|
||||
-- end
|
||||
|
||||
local function doubleSizeRecursive(_)
|
||||
-- local function doubleSizeRecursive(_)
|
||||
-- todo: change the gui size based on how much space we have
|
||||
--[[changeSize(instance,2)
|
||||
-- changeSize(instance, 2)
|
||||
|
||||
local children = instance:GetChildren()
|
||||
for i = 1, #children do
|
||||
doubleSizeRecursive(children[i])
|
||||
end]]
|
||||
end
|
||||
-- local children = instance:GetChildren()
|
||||
-- for i = 1, #children do
|
||||
-- doubleSizeRecursive(children[i])
|
||||
-- end
|
||||
-- end
|
||||
|
||||
local function modifyForSmallScreen()
|
||||
cutSizeInHalfRecursive(purchaseDialog)
|
||||
end
|
||||
-- local function modifyForSmallScreen()
|
||||
-- cutSizeInHalfRecursive(purchaseDialog)
|
||||
-- end
|
||||
|
||||
local function modifyForLargeScreen()
|
||||
doubleSizeRecursive(purchaseDialog)
|
||||
end
|
||||
-- local function modifyForLargeScreen()
|
||||
-- doubleSizeRecursive(purchaseDialog)
|
||||
-- end
|
||||
|
||||
-- depending on screen size, we need to change the gui
|
||||
local function changeGuiToScreenSize(smallScreen)
|
||||
if smallScreen then
|
||||
modifyForSmallScreen()
|
||||
else
|
||||
modifyForLargeScreen()
|
||||
end
|
||||
end
|
||||
-- local function changeGuiToScreenSize(smallScreen)
|
||||
-- if smallScreen then
|
||||
-- modifyForSmallScreen()
|
||||
-- else
|
||||
-- modifyForLargeScreen()
|
||||
-- end
|
||||
-- end
|
||||
|
||||
local function doPurchasePrompt(
|
||||
player,
|
||||
|
|
@ -1373,20 +1360,20 @@ if enableBrowserWindowClosedEvent then
|
|||
end)
|
||||
end
|
||||
|
||||
Game.CoreGui.RobloxGui.Changed:connect(function()
|
||||
local nowIsSmallScreen = (
|
||||
game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
|
||||
)
|
||||
if nowIsSmallScreen and not isSmallScreen then
|
||||
changeGuiToScreenSize(true)
|
||||
elseif not nowIsSmallScreen and isSmallScreen then
|
||||
changeGuiToScreenSize(false)
|
||||
end
|
||||
-- Game.CoreGui.RobloxGui.Changed:connect(function()
|
||||
-- local nowIsSmallScreen = (
|
||||
-- game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
|
||||
-- )
|
||||
-- if nowIsSmallScreen and not isSmallScreen then
|
||||
-- changeGuiToScreenSize(true)
|
||||
-- elseif not nowIsSmallScreen and isSmallScreen then
|
||||
-- changeGuiToScreenSize(false)
|
||||
-- end
|
||||
|
||||
isSmallScreen = nowIsSmallScreen
|
||||
end)
|
||||
-- isSmallScreen = nowIsSmallScreen
|
||||
-- end)
|
||||
|
||||
isSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold)
|
||||
if isSmallScreen then
|
||||
changeGuiToScreenSize(true)
|
||||
end
|
||||
-- isSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold)
|
||||
-- if isSmallScreen then
|
||||
-- changeGuiToScreenSize(true)
|
||||
-- end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ for _ = 1, 8 do
|
|||
end
|
||||
|
||||
--Include
|
||||
local New = require "../Modules/New"
|
||||
local New = (require "../Modules/New").New
|
||||
|
||||
-- A Few Script Globals
|
||||
local gui
|
||||
|
|
@ -39,7 +39,7 @@ function initializeDeveloperConsole()
|
|||
end
|
||||
devConsoleInitialized = true
|
||||
|
||||
---Dev-Console Variables
|
||||
-- Dev-Console Variables
|
||||
local LOCAL_CONSOLE = 1
|
||||
local SERVER_CONSOLE = 2
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
-- CoreGui.RobloxGui.CoreScripts/ToolTip
|
||||
print "[Mercury]: Loaded corescript 36868950"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
local controlFrame = script.Parent:FindFirstChild "ControlFrame"
|
||||
|
||||
|
|
@ -72,12 +74,13 @@ local function createSettingsButtonTip(parent)
|
|||
parent = bottomLeftControl:FindFirstChild "SettingsButton"
|
||||
end
|
||||
|
||||
local toolTip = frameTip:clone()
|
||||
toolTip.RobloxLocked = true
|
||||
toolTip.Text = "Settings/Leave Game"
|
||||
toolTip.Position = UDim2.new(0, 0, 0, -18)
|
||||
toolTip.Size = UDim2.new(0, 120, 0, 20)
|
||||
toolTip.Parent = parent
|
||||
local toolTip = Hydrate(frameTip:Clone()) {
|
||||
RobloxLocked = true,
|
||||
Text = "Settings/Leave Game",
|
||||
Position = UDim2.new(0, 0, 0, -18),
|
||||
Size = UDim2.new(0, 120, 0, 20),
|
||||
Parent = parent,
|
||||
}
|
||||
setUpListeners(toolTip)
|
||||
end
|
||||
|
||||
|
|
@ -89,7 +92,7 @@ local bottomLeftChildren = bottomLeftControl:GetChildren()
|
|||
|
||||
for i = 1, #bottomLeftChildren do
|
||||
if bottomLeftChildren[i].Name == "Exit" then
|
||||
local exitTip = New(frameTip:clone()) {
|
||||
local exitTip = Hydrate(frameTip:Clone()) {
|
||||
RobloxLocked = true,
|
||||
Text = "Leave Place",
|
||||
Position = UDim2.new(0, 0, -1, 0),
|
||||
|
|
@ -109,7 +112,7 @@ local bottomRightChildren = bottomRightControl:GetChildren()
|
|||
|
||||
for i = 1, #bottomRightChildren do
|
||||
if bottomRightChildren[i].Name:find "Camera" ~= nil then
|
||||
local cameraTip = New(frameTip:clone()) {
|
||||
local cameraTip = Hydrate(frameTip:Clone()) {
|
||||
RobloxLocked = true,
|
||||
Text = "Camera View",
|
||||
Size = UDim2.new(2, 0, 1.25, 0),
|
||||
|
|
|
|||
|
|
@ -23,36 +23,21 @@ end
|
|||
waitForChild(CoreGui, "RobloxGui")
|
||||
local screenGui = CoreGui:FindFirstChild "RobloxGui"
|
||||
|
||||
-- ToolTipper (creates tool tips for gui)
|
||||
ScriptContext:AddCoreScript(36868950, screenGui, "CoreScripts/ToolTip")
|
||||
-- SettingsScript
|
||||
ScriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings")
|
||||
local scripts = {
|
||||
[36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui)
|
||||
[46295863] = "CoreScripts/Settings", -- SettingsScript
|
||||
[39250920] = "CoreScripts/MainBotChatScript", -- MainBotChatScript
|
||||
[48488451] = "CoreScripts/PopupScript", -- Popup Script
|
||||
[48488398] = "CoreScripts/NotificationScript", -- Friend Notification Script (probably can use this script to expand out to other notifications)
|
||||
[97188756] = "CoreScripts/ChatScript", -- Chat script
|
||||
[107893730] = "CoreScripts/PurchasePromptScript", -- Purchase Prompt Script
|
||||
}
|
||||
|
||||
-- MainBotChatScript
|
||||
ScriptContext:AddCoreScript(
|
||||
39250920,
|
||||
screenGui,
|
||||
"CoreScripts/MainBotChatScript"
|
||||
)
|
||||
for id, path in pairs(scripts) do
|
||||
ScriptContext:AddCoreScript(id, screenGui, path)
|
||||
end
|
||||
|
||||
-- Popup Script
|
||||
ScriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript")
|
||||
-- Friend Notification Script (probably can use this script to expand out to other notifications)
|
||||
ScriptContext:AddCoreScript(
|
||||
48488398,
|
||||
screenGui,
|
||||
"CoreScripts/NotificationScript"
|
||||
)
|
||||
-- Chat script
|
||||
ScriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript")
|
||||
-- Purchase Prompt Script
|
||||
ScriptContext:AddCoreScript(
|
||||
107893730,
|
||||
screenGui,
|
||||
"CoreScripts/PurchasePromptScript"
|
||||
)
|
||||
|
||||
if screenGui.AbsoluteSize.Y > 600 then
|
||||
if screenGui.AbsoluteSize.Y >= 600 then
|
||||
-- New Player List
|
||||
ScriptContext:AddCoreScript(
|
||||
48488235,
|
||||
|
|
@ -103,21 +88,4 @@ ScriptContext:AddCoreScript(
|
|||
"CoreScripts/BackpackScripts/LoadoutScript"
|
||||
)
|
||||
|
||||
local IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable"
|
||||
if IsPersonalServer then
|
||||
ScriptContext:AddCoreScript(
|
||||
64164692,
|
||||
game.Players.LocalPlayer,
|
||||
"BuildToolManager"
|
||||
)
|
||||
end
|
||||
game.Workspace.ChildAdded:connect(function(nchild)
|
||||
if nchild.Name == "PSVariable" and nchild:IsA "BoolValue" then
|
||||
IsPersonalServer = true
|
||||
ScriptContext:AddCoreScript(
|
||||
64164692,
|
||||
game.Players.LocalPlayer,
|
||||
"BuildToolManager"
|
||||
)
|
||||
end
|
||||
end)
|
||||
-- Personal servers are disabled, the corescript for it is not present
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ for _ = 1, 8 do
|
|||
print "IF YOU SEE THIS MESSAGE, PLEASE REPORT IT TO THE MERCURY DEVELOPERS"
|
||||
end
|
||||
|
||||
local damageGuiWidth = 5.0
|
||||
local damageGuiHeight = 5.0
|
||||
local damageGuiWidth = 5
|
||||
local damageGuiHeight = 5
|
||||
|
||||
local function waitForChild(parent, childName)
|
||||
local child = parent:findFirstChild(childName)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
-- CoreGui.RobloxGui.CoreScripts/MainBotChatScript
|
||||
print "[Mercury]: Loaded corescript 39250920"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
local InsertService = game:GetService "InsertService"
|
||||
|
||||
|
|
@ -17,7 +19,9 @@ local function waitForChild(instance, name)
|
|||
end
|
||||
end
|
||||
|
||||
local mainFrame
|
||||
local mainFrame: Frame & {
|
||||
Tail: ImageLabel,
|
||||
}
|
||||
local choices = {}
|
||||
local lastChoice
|
||||
local choiceMap = {}
|
||||
|
|
@ -308,7 +312,7 @@ local function renewKillswitch(dialog)
|
|||
currentAbortDialogScript = nil
|
||||
end
|
||||
|
||||
currentAbortDialogScript = New(timeoutScript:Clone()) {
|
||||
currentAbortDialogScript = Hydrate(timeoutScript:Clone()) {
|
||||
|
||||
archivable = false,
|
||||
Disabled = false,
|
||||
|
|
@ -357,11 +361,37 @@ local function selectChoice(choice)
|
|||
end
|
||||
|
||||
local function newChoice(numberText)
|
||||
local frame = Instance.new "TextButton"
|
||||
frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255)
|
||||
frame.AutoButtonColor = false
|
||||
frame.BorderSizePixel = 0
|
||||
frame.Text = ""
|
||||
local frame = New "TextButton" {
|
||||
BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255),
|
||||
AutoButtonColor = false,
|
||||
BorderSizePixel = 0,
|
||||
Text = "",
|
||||
RobloxLocked = true,
|
||||
New "TextLabel" {
|
||||
Name = "Number",
|
||||
TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255),
|
||||
Text = numberText,
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
BackgroundTransparency = 1,
|
||||
Position = UDim2.new(0, 4, 0, 2),
|
||||
Size = UDim2.new(0, 20, 0, 24),
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
TextYAlignment = Enum.TextYAlignment.Top,
|
||||
RobloxLocked = true,
|
||||
},
|
||||
New "TextLabel" {
|
||||
Name = "UserPrompt",
|
||||
BackgroundTransparency = 1,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
FontSize = Enum.FontSize.Size14,
|
||||
Position = UDim2.new(0, 28, 0, 2),
|
||||
Size = UDim2.new(1, -32, 1, -4),
|
||||
TextXAlignment = Enum.TextXAlignment.Left,
|
||||
TextYAlignment = Enum.TextYAlignment.Top,
|
||||
TextWrap = true,
|
||||
RobloxLocked = true,
|
||||
},
|
||||
}
|
||||
frame.MouseEnter:connect(function()
|
||||
highlightColor(frame, currentTone())
|
||||
end)
|
||||
|
|
@ -371,33 +401,6 @@ local function newChoice(numberText)
|
|||
frame.MouseButton1Click:connect(function()
|
||||
selectChoice(frame)
|
||||
end)
|
||||
frame.RobloxLocked = true
|
||||
|
||||
local number = Instance.new "TextLabel"
|
||||
number.Name = "Number"
|
||||
number.TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255)
|
||||
number.Text = numberText
|
||||
number.FontSize = Enum.FontSize.Size14
|
||||
number.BackgroundTransparency = 1
|
||||
number.Position = UDim2.new(0, 4, 0, 2)
|
||||
number.Size = UDim2.new(0, 20, 0, 24)
|
||||
number.TextXAlignment = Enum.TextXAlignment.Left
|
||||
number.TextYAlignment = Enum.TextYAlignment.Top
|
||||
number.RobloxLocked = true
|
||||
number.Parent = frame
|
||||
|
||||
local prompt = Instance.new "TextLabel"
|
||||
prompt.Name = "UserPrompt"
|
||||
prompt.BackgroundTransparency = 1
|
||||
prompt.TextColor3 = Color3.new(1, 1, 1)
|
||||
prompt.FontSize = Enum.FontSize.Size14
|
||||
prompt.Position = UDim2.new(0, 28, 0, 2)
|
||||
prompt.Size = UDim2.new(1, -32, 1, -4)
|
||||
prompt.TextXAlignment = Enum.TextXAlignment.Left
|
||||
prompt.TextYAlignment = Enum.TextYAlignment.Top
|
||||
prompt.TextWrap = true
|
||||
prompt.RobloxLocked = true
|
||||
prompt.Parent = frame
|
||||
|
||||
return frame
|
||||
end
|
||||
|
|
@ -412,30 +415,29 @@ local function initialize(parent)
|
|||
lastChoice.UserPrompt.Text = "Goodbye!"
|
||||
lastChoice.Size = UDim2.new(1, 0, 0, 28)
|
||||
|
||||
mainFrame = Instance.new "Frame"
|
||||
mainFrame.Name = "UserDialogArea"
|
||||
mainFrame.Size = UDim2.new(0, 350, 0, 200)
|
||||
mainFrame.Style = Enum.FrameStyle.ChatBlue
|
||||
mainFrame.Visible = false
|
||||
|
||||
local imageLabel = Instance.new "ImageLabel"
|
||||
imageLabel.Name = "Tail"
|
||||
imageLabel.Size = UDim2.new(0, 62, 0, 53)
|
||||
imageLabel.Position = UDim2.new(1, 8, 0.25)
|
||||
imageLabel.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png"
|
||||
imageLabel.BackgroundTransparency = 1
|
||||
imageLabel.RobloxLocked = true
|
||||
imageLabel.Parent = mainFrame
|
||||
mainFrame = New "Frame" {
|
||||
Name = "UserDialogArea",
|
||||
Size = UDim2.new(0, 350, 0, 200),
|
||||
Style = Enum.FrameStyle.ChatBlue,
|
||||
Visible = false,
|
||||
RobloxLocked = true,
|
||||
New "ImageLabel" {
|
||||
Name = "Tail",
|
||||
Size = UDim2.new(0, 62, 0, 53),
|
||||
Position = UDim2.new(1, 8, 0.25),
|
||||
Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png",
|
||||
BackgroundTransparency = 1,
|
||||
RobloxLocked = true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, obj in pairs(choices) do
|
||||
obj.RobloxLocked = true
|
||||
obj.Parent = mainFrame
|
||||
end
|
||||
lastChoice.RobloxLocked = true
|
||||
lastChoice.Parent = mainFrame
|
||||
|
||||
mainFrame.RobloxLocked = true
|
||||
mainFrame.Parent = parent
|
||||
lastChoice.Parent = mainFrame
|
||||
end
|
||||
|
||||
local function doDialog(dialog)
|
||||
|
|
@ -521,7 +523,7 @@ end
|
|||
local function addDialog(dialog)
|
||||
if dialog.Parent then
|
||||
if dialog.Parent:IsA "BasePart" then
|
||||
local chatGui = New(chatNotificationGui:clone()) {
|
||||
local chatGui = Hydrate(chatNotificationGui:Clone()) {
|
||||
Enabled = not dialog.InUse,
|
||||
Adornee = dialog.Parent,
|
||||
RobloxLocked = true,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
-- RbxGui
|
||||
print "[Mercury]: Loaded corescript 45284430"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
local RbxGui = {}
|
||||
|
||||
|
|
@ -16,7 +18,7 @@ local function ScopedConnect(
|
|||
local eventConnection
|
||||
|
||||
--Connection on parentInstance is scoped by parentInstance (when destroyed, it goes away)
|
||||
local tryConnect = function()
|
||||
local function tryConnect()
|
||||
if game:IsAncestorOf(parentInstance) then
|
||||
--Entering the world, make sure we are connected/synced
|
||||
if not eventConnection then
|
||||
|
|
@ -53,26 +55,25 @@ local function getScreenGuiAncestor(instance)
|
|||
return localInstance
|
||||
end
|
||||
|
||||
local function Colour3(r, g, b)
|
||||
return Color3.new(r / 255, g / 255, b / 255)
|
||||
end
|
||||
|
||||
local function CreateButtons(frame, buttons, yPos, ySize)
|
||||
local buttonNum = 1
|
||||
local buttonObjs = {}
|
||||
for _, obj in ipairs(buttons) do
|
||||
local button = Instance.new "TextButton"
|
||||
button.Name = "Button" .. buttonNum
|
||||
button.Font = Enum.Font.Arial
|
||||
button.FontSize = Enum.FontSize.Size18
|
||||
button.AutoButtonColor = true
|
||||
button.Modal = true
|
||||
if obj.Style then
|
||||
button.Style = obj.Style
|
||||
else
|
||||
button.Style = Enum.ButtonStyle.RobloxButton
|
||||
end
|
||||
button.Text = obj.Text
|
||||
button.TextColor3 = Color3.new(1, 1, 1)
|
||||
button.MouseButton1Click:connect(obj.Function)
|
||||
button.Parent = frame
|
||||
buttonObjs[buttonNum] = button
|
||||
buttonObjs[buttonNum] = New "TextButton" {
|
||||
Name = "Button" .. buttonNum,
|
||||
Font = Enum.Font.Arial,
|
||||
FontSize = Enum.FontSize.Size18,
|
||||
AutoButtonColor = true,
|
||||
Modal = true,
|
||||
Style = obj.Style or Enum.ButtonStyle.RobloxButton,
|
||||
Text = obj.Text,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
Parent = frame,
|
||||
}
|
||||
|
||||
buttonNum += 1
|
||||
end
|
||||
|
|
@ -151,7 +152,7 @@ RbxGui.CreateStyledMessageDialog = function(title, message, style, buttons)
|
|||
Text = title,
|
||||
TextStrokeTransparency = 0,
|
||||
BackgroundTransparency = 1,
|
||||
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
|
||||
TextColor3 = Colour3(221, 221, 221),
|
||||
Position = UDim2.new(0, 80, 0, 0),
|
||||
Size = UDim2.new(1, -80, 0, 40),
|
||||
Font = Enum.Font.ArialBold,
|
||||
|
|
@ -163,7 +164,7 @@ RbxGui.CreateStyledMessageDialog = function(title, message, style, buttons)
|
|||
Name = "Message",
|
||||
Text = message,
|
||||
TextStrokeTransparency = 0,
|
||||
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
|
||||
TextColor3 = Colour3(221, 221, 221),
|
||||
Position = UDim2.new(0.025, 80, 0, 45),
|
||||
Size = UDim2.new(0.95, -80, 0, 55),
|
||||
BackgroundTransparency = 1,
|
||||
|
|
@ -211,7 +212,7 @@ RbxGui.CreateMessageDialog = function(title, message, buttons)
|
|||
Name = "Title",
|
||||
Text = title,
|
||||
BackgroundTransparency = 1,
|
||||
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
|
||||
TextColor3 = Colour3(221, 221, 221),
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
Size = UDim2.new(1, 0, 0.15, 0),
|
||||
Font = Enum.Font.ArialBold,
|
||||
|
|
@ -222,7 +223,7 @@ RbxGui.CreateMessageDialog = function(title, message, buttons)
|
|||
New "TextLabel" {
|
||||
Name = "Message",
|
||||
Text = message,
|
||||
TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255),
|
||||
TextColor3 = Colour3(221, 221, 221),
|
||||
Position = UDim2.new(0.025, 0, 0.175, 0),
|
||||
Size = UDim2.new(0.95, 0, 0.55, 0),
|
||||
BackgroundTransparency = 1,
|
||||
|
|
@ -552,7 +553,7 @@ RbxGui.CreateDropDownMenu = function(items, onSelect, forRoblox)
|
|||
|
||||
for _, item in ipairs(items) do
|
||||
-- needed to maintain local scope for items in event listeners below
|
||||
local button = choiceButton:clone()
|
||||
local button = choiceButton:Clone()
|
||||
if forRoblox then
|
||||
button.RobloxLocked = true
|
||||
end
|
||||
|
|
@ -857,7 +858,7 @@ RbxGui.CreateSlider = function(steps, width, position)
|
|||
else
|
||||
bar.Size = UDim2.new(0, 200, 0, 5)
|
||||
end
|
||||
bar.BorderColor3 = Color3.new(95 / 255, 95 / 255, 95 / 255)
|
||||
bar.BorderColor3 = Colour3(95, 95, 95)
|
||||
bar.ZIndex = 2
|
||||
bar.Parent = sliderGui
|
||||
|
||||
|
|
@ -994,7 +995,7 @@ RbxGui.CreateTrueScrollingFrame = function()
|
|||
end
|
||||
end)
|
||||
|
||||
local scrollDownButton = scrollUpButton:clone()
|
||||
local scrollDownButton = scrollUpButton:Clone()
|
||||
scrollDownButton.Name = "ScrollDownButton"
|
||||
scrollDownButton.Position = UDim2.new(0, 0, 1, -18)
|
||||
local downChildren = scrollDownButton:GetChildren()
|
||||
|
|
@ -1047,11 +1048,11 @@ RbxGui.CreateTrueScrollingFrame = function()
|
|||
scrollNub.BackgroundTransparency = 0.5
|
||||
scrollNub.Parent = scrollbar
|
||||
|
||||
local newNub = scrollNub:clone()
|
||||
local newNub = scrollNub:Clone()
|
||||
newNub.Position = UDim2.new(0.5, -5, 0.5, -2)
|
||||
newNub.Parent = scrollbar
|
||||
|
||||
local lastNub = scrollNub:clone()
|
||||
local lastNub = scrollNub:Clone()
|
||||
lastNub.Position = UDim2.new(0.5, -5, 0.5, 2)
|
||||
lastNub.Parent = scrollbar
|
||||
|
||||
|
|
@ -2170,16 +2171,17 @@ end
|
|||
RbxGui.AutoTruncateTextObject = function(textLabel)
|
||||
local text = textLabel.Text
|
||||
|
||||
local fullLabel = textLabel:Clone()
|
||||
fullLabel.Name = "Full" .. textLabel.Name
|
||||
fullLabel.BorderSizePixel = 0
|
||||
fullLabel.BackgroundTransparency = 0
|
||||
fullLabel.Text = text
|
||||
fullLabel.TextXAlignment = Enum.TextXAlignment.Center
|
||||
fullLabel.Position = UDim2.new(0, -3, 0, 0)
|
||||
fullLabel.Size = UDim2.new(0, 100, 1, 0)
|
||||
fullLabel.Visible = false
|
||||
fullLabel.Parent = textLabel
|
||||
local fullLabel = Hydrate(textLabel:Clone()) {
|
||||
Name = "Full" .. textLabel.Name,
|
||||
BorderSizePixel = 0,
|
||||
BackgroundTransparency = 0,
|
||||
Text = text,
|
||||
TextXAlignment = Enum.TextXAlignment.Center,
|
||||
Position = UDim2.new(0, -3, 0, 0),
|
||||
Size = UDim2.new(0, 100, 1, 0),
|
||||
Visible = false,
|
||||
Parent = textLabel,
|
||||
}
|
||||
|
||||
local shortText
|
||||
local mouseEnterConnection
|
||||
|
|
@ -2356,9 +2358,7 @@ RbxGui.CreateTutorial = function(name, tutorialKey, createButtons)
|
|||
|
||||
local function getVisiblePageAndHideOthers()
|
||||
local visiblePage
|
||||
local children = pages:GetChildren()
|
||||
if children then
|
||||
for _, child in ipairs(children) do
|
||||
for _, child in ipairs(pages:GetChildren() or {}) do
|
||||
if child.Visible then
|
||||
if visiblePage then
|
||||
child.Visible = false
|
||||
|
|
@ -2367,7 +2367,6 @@ RbxGui.CreateTutorial = function(name, tutorialKey, createButtons)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return visiblePage
|
||||
end
|
||||
|
||||
|
|
@ -2521,11 +2520,8 @@ local function CreateBasicTutorialPage(
|
|||
Parent = frame,
|
||||
}
|
||||
|
||||
if giveDoneButton then
|
||||
innerFrame.Size = UDim2.new(1, 0, 1, -75)
|
||||
else
|
||||
innerFrame.Size = UDim2.new(1, 0, 1, -22)
|
||||
end
|
||||
innerFrame.Size = giveDoneButton and UDim2.new(1, 0, 1, -75)
|
||||
or UDim2.new(1, 0, 1, -22)
|
||||
|
||||
local parentConnection
|
||||
|
||||
|
|
@ -2837,7 +2833,7 @@ RbxGui.CreateSetPanel = function(
|
|||
Parent = waterFrame,
|
||||
}
|
||||
|
||||
local waterForceDirLabel = New(waterForceLabel:Clone()) {
|
||||
local waterForceDirLabel = Hydrate(waterForceLabel:Clone()) {
|
||||
Name = "WaterForceDirectionLabel",
|
||||
Text = "Water Force Direction",
|
||||
Position = UDim2.new(0, 0, 0, 50),
|
||||
|
|
@ -2943,7 +2939,7 @@ RbxGui.CreateSetPanel = function(
|
|||
Size = UDim2.new(0, 3, 0.9, 0),
|
||||
ZIndex = 6,
|
||||
},
|
||||
New(setsLists) {
|
||||
Hydrate(setsLists) {
|
||||
Size = UDim2.new(1, -6, 0.94, 0),
|
||||
Position = UDim2.new(0, 0, 0.06, 0),
|
||||
BackgroundTransparency = 1,
|
||||
|
|
@ -3015,7 +3011,7 @@ RbxGui.CreateSetPanel = function(
|
|||
end
|
||||
|
||||
local function buildSetButton(name, setId, _, _, _)
|
||||
return New(createSetButton(name)) {
|
||||
return Hydrate(createSetButton(name)) {
|
||||
Text = name,
|
||||
Name = "SetButton",
|
||||
Visible = true,
|
||||
|
|
@ -3106,7 +3102,7 @@ RbxGui.CreateSetPanel = function(
|
|||
Parent = button,
|
||||
}
|
||||
|
||||
New(buttonImage:Clone()) {
|
||||
Hydrate(buttonImage:Clone()) {
|
||||
Name = "ConfigIcon",
|
||||
Visible = false,
|
||||
Position = UDim2.new(1, -23, 1, -24),
|
||||
|
|
@ -3556,7 +3552,7 @@ RbxGui.CreateSetPanel = function(
|
|||
)
|
||||
|
||||
local scrollFrame, controlFrame = RbxGui.CreateTrueScrollingFrame()
|
||||
New(scrollFrame) {
|
||||
Hydrate(scrollFrame) {
|
||||
Size = UDim2.new(0.54, 0, 0.85, 0),
|
||||
Position = UDim2.new(0.24, 0, 0.085, 0),
|
||||
Name = "ItemsFrame",
|
||||
|
|
@ -3640,86 +3636,60 @@ RbxGui.CreateSetPanel = function(
|
|||
waterTypeChangedEvent
|
||||
end
|
||||
|
||||
local function getEnumFromName(choice)
|
||||
if choice == "Grass" then
|
||||
return 1
|
||||
elseif choice == "Sand" then
|
||||
return 2
|
||||
elseif choice == "Erase" then
|
||||
return 0
|
||||
elseif choice == "Brick" then
|
||||
return 3
|
||||
elseif choice == "Granite" then
|
||||
return 4
|
||||
elseif choice == "Asphalt" then
|
||||
return 5
|
||||
elseif choice == "Iron" then
|
||||
return 6
|
||||
elseif choice == "Aluminum" then
|
||||
return 7
|
||||
elseif choice == "Gold" then
|
||||
return 8
|
||||
elseif choice == "Plank" then
|
||||
return 9
|
||||
elseif choice == "Log" then
|
||||
return 10
|
||||
elseif choice == "Gravel" then
|
||||
return 11
|
||||
elseif choice == "Cinder Block" then
|
||||
return 12
|
||||
elseif choice == "Stone Wall" then
|
||||
return 13
|
||||
elseif choice == "Concrete" then
|
||||
return 14
|
||||
elseif choice == "Plastic (red)" then
|
||||
return 15
|
||||
elseif choice == "Plastic (blue)" then
|
||||
return 16
|
||||
elseif choice == "Water" then
|
||||
return 17
|
||||
local cm = Enum.CellMaterial
|
||||
local EnumMaterialNames = {
|
||||
[cm.Grass] = "Grass",
|
||||
[cm.Sand] = "Sand",
|
||||
[cm.Empty] = "Erase",
|
||||
[cm.Brick] = "Brick",
|
||||
[cm.Granite] = "Granite",
|
||||
[cm.Asphalt] = "Asphalt",
|
||||
[cm.Iron] = "Iron",
|
||||
[cm.Aluminum] = "Aluminum",
|
||||
[cm.Gold] = "Gold",
|
||||
[cm.WoodPlank] = "Plank",
|
||||
[cm.WoodLog] = "Log",
|
||||
[cm.Gravel] = "Gravel",
|
||||
[cm.CinderBlock] = "Cinder Block",
|
||||
[cm.MossyStone] = "Stone Wall",
|
||||
[cm.Cement] = "Concrete",
|
||||
[cm.RedPlastic] = "Plastic (red)",
|
||||
[cm.BluePlastic] = "Plastic (blue)",
|
||||
[cm.Water] = "Water",
|
||||
}
|
||||
|
||||
local MaterialNames = {
|
||||
"Grass",
|
||||
"Sand",
|
||||
"Erase",
|
||||
"Brick",
|
||||
"Granite",
|
||||
"Asphalt",
|
||||
"Iron",
|
||||
"Aluminum",
|
||||
"Gold",
|
||||
"Plank",
|
||||
"Log",
|
||||
"Gravel",
|
||||
"Cinder Block",
|
||||
"Stone Wall",
|
||||
"Concrete",
|
||||
"Plastic (red)",
|
||||
"Plastic (blue)",
|
||||
"Water",
|
||||
}
|
||||
|
||||
local StringChoices = {}
|
||||
for k, v in pairs(EnumMaterialNames) do
|
||||
StringChoices[v] = k
|
||||
end
|
||||
return
|
||||
|
||||
local function getEnumFromName(choice)
|
||||
return StringChoices[choice]
|
||||
end
|
||||
|
||||
local function getNameFromEnum(choice)
|
||||
if choice == Enum.CellMaterial.Grass or choice == 1 then
|
||||
return "Grass"
|
||||
elseif choice == Enum.CellMaterial.Sand or choice == 2 then
|
||||
return "Sand"
|
||||
elseif choice == Enum.CellMaterial.Empty or choice == 0 then
|
||||
return "Erase"
|
||||
elseif choice == Enum.CellMaterial.Brick or choice == 3 then
|
||||
return "Brick"
|
||||
elseif choice == Enum.CellMaterial.Granite or choice == 4 then
|
||||
return "Granite"
|
||||
elseif choice == Enum.CellMaterial.Asphalt or choice == 5 then
|
||||
return "Asphalt"
|
||||
elseif choice == Enum.CellMaterial.Iron or choice == 6 then
|
||||
return "Iron"
|
||||
elseif choice == Enum.CellMaterial.Aluminum or choice == 7 then
|
||||
return "Aluminum"
|
||||
elseif choice == Enum.CellMaterial.Gold or choice == 8 then
|
||||
return "Gold"
|
||||
elseif choice == Enum.CellMaterial.WoodPlank or choice == 9 then
|
||||
return "Plank"
|
||||
elseif choice == Enum.CellMaterial.WoodLog or choice == 10 then
|
||||
return "Log"
|
||||
elseif choice == Enum.CellMaterial.Gravel or choice == 11 then
|
||||
return "Gravel"
|
||||
elseif choice == Enum.CellMaterial.CinderBlock or choice == 12 then
|
||||
return "Cinder Block"
|
||||
elseif choice == Enum.CellMaterial.MossyStone or choice == 13 then
|
||||
return "Stone Wall"
|
||||
elseif choice == Enum.CellMaterial.Cement or choice == 14 then
|
||||
return "Concrete"
|
||||
elseif choice == Enum.CellMaterial.RedPlastic or choice == 15 then
|
||||
return "Plastic (red)"
|
||||
elseif choice == Enum.CellMaterial.BluePlastic or choice == 16 then
|
||||
return "Plastic (blue)"
|
||||
elseif choice == Enum.CellMaterial.Water or choice == 17 then
|
||||
return "Water"
|
||||
end
|
||||
return
|
||||
return EnumMaterialNames[choice] or MaterialNames[choice]
|
||||
end
|
||||
|
||||
RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
||||
|
|
@ -3741,25 +3711,6 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
|||
terrainMaterialSelectionChanged.Parent = frame
|
||||
|
||||
local materialToImageMap = {}
|
||||
local materialNames = {
|
||||
"Grass",
|
||||
"Sand",
|
||||
"Brick",
|
||||
"Granite",
|
||||
"Asphalt",
|
||||
"Iron",
|
||||
"Aluminum",
|
||||
"Gold",
|
||||
"Plank",
|
||||
"Log",
|
||||
"Gravel",
|
||||
"Cinder Block",
|
||||
"Stone Wall",
|
||||
"Concrete",
|
||||
"Plastic (red)",
|
||||
"Plastic (blue)",
|
||||
"Water",
|
||||
}
|
||||
|
||||
local currentMaterial = 1
|
||||
|
||||
|
|
@ -3768,46 +3719,31 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
|||
terrainMaterialSelectionChanged:Fire(currentMaterial)
|
||||
end
|
||||
|
||||
-- we so need a better way to do this
|
||||
for _, v in pairs(materialNames) do
|
||||
local toAdd
|
||||
if v == "Grass" then
|
||||
toAdd = 56563112
|
||||
elseif v == "Sand" then
|
||||
toAdd = 62356652
|
||||
elseif v == "Brick" then
|
||||
toAdd = 65961537
|
||||
elseif v == "Granite" then
|
||||
toAdd = 67532153
|
||||
elseif v == "Asphalt" then
|
||||
toAdd = 67532038
|
||||
elseif v == "Iron" then
|
||||
toAdd = 67532093
|
||||
elseif v == "Aluminum" then
|
||||
toAdd = 67531995
|
||||
elseif v == "Gold" then
|
||||
toAdd = 67532118
|
||||
elseif v == "Plastic (red)" then
|
||||
toAdd = 67531848
|
||||
elseif v == "Plastic (blue)" then
|
||||
toAdd = 67531924
|
||||
elseif v == "Plank" then
|
||||
toAdd = 67532015
|
||||
elseif v == "Log" then
|
||||
toAdd = 67532051
|
||||
elseif v == "Gravel" then
|
||||
toAdd = 67532206
|
||||
elseif v == "Cinder Block" then
|
||||
toAdd = 67532103
|
||||
elseif v == "Stone Wall" then
|
||||
toAdd = 67531804
|
||||
elseif v == "Concrete" then
|
||||
toAdd = 67532059
|
||||
elseif v == "Water" then
|
||||
toAdd = 81407474
|
||||
else
|
||||
toAdd = 66887593 -- fill in the rest here!!
|
||||
for _, v in pairs(MaterialNames) do
|
||||
local materials = {
|
||||
Grass = 56563112,
|
||||
Sand = 62356652,
|
||||
Brick = 65961537,
|
||||
Granite = 67532153,
|
||||
Asphalt = 67532038,
|
||||
Iron = 67532093,
|
||||
Aluminum = 67531995,
|
||||
Gold = 67532118,
|
||||
["Plastic (red)"] = 67531848,
|
||||
["Plastic (blue)"] = 67531924,
|
||||
Plank = 67532015,
|
||||
Log = 67532051,
|
||||
Gravel = 67532206,
|
||||
["Cinder Block"] = 67532103,
|
||||
["Stone Wall"] = 67531804,
|
||||
Concrete = 67532059,
|
||||
Water = 81407474,
|
||||
}
|
||||
local toAdd = materials[v]
|
||||
if not toAdd then
|
||||
toAdd = 66887593
|
||||
end
|
||||
|
||||
materialToImageMap[v] =
|
||||
{ Regular = `http://banland.xyz/asset/?id={toAdd}` }
|
||||
end
|
||||
|
|
@ -3875,10 +3811,10 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
|||
return buttonWrap
|
||||
end
|
||||
|
||||
for i = 1, #materialNames do
|
||||
local imageButton = createMaterialButton(materialNames[i])
|
||||
for i = 1, #MaterialNames do
|
||||
local imageButton = createMaterialButton(MaterialNames[i])
|
||||
|
||||
if materialNames[i] == "Grass" then -- always start with grass as the default
|
||||
if MaterialNames[i] == "Grass" then -- always start with grass as the default
|
||||
selectedButton = imageButton
|
||||
imageButton.BackgroundTransparency = 0
|
||||
end
|
||||
|
|
@ -3886,11 +3822,8 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
|||
imageButton.Parent = scrollFrame
|
||||
end
|
||||
|
||||
local forceTerrainMaterialSelection = function(newMaterialType)
|
||||
if not newMaterialType then
|
||||
return
|
||||
end
|
||||
if currentMaterial == newMaterialType then
|
||||
local function forceTerrainMaterialSelection(newMaterialType)
|
||||
if not newMaterialType or currentMaterial == newMaterialType then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -3898,23 +3831,16 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
|
|||
local buttons = scrollFrame:GetChildren()
|
||||
for i = 1, #buttons do
|
||||
if
|
||||
(
|
||||
buttons[i].Name == "Plastic (blue)"
|
||||
and matName == "Plastic (blue)"
|
||||
)
|
||||
or (buttons[i].Name == "Plastic (red)" and matName == "Plastic (red)")
|
||||
or string.find(buttons[i].Name, matName)
|
||||
then
|
||||
goToNewMaterial(buttons[i], matName)
|
||||
return
|
||||
end
|
||||
if
|
||||
buttons[i].Name == "Plastic (red)"
|
||||
and matName == "Plastic (red)"
|
||||
then
|
||||
goToNewMaterial(buttons[i], matName)
|
||||
return
|
||||
end
|
||||
if string.find(buttons[i].Name, matName) then
|
||||
goToNewMaterial(buttons[i], matName)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -3948,21 +3874,13 @@ RbxGui.CreateLoadingFrame = function(name, size, position)
|
|||
},
|
||||
}
|
||||
|
||||
if size then
|
||||
loadingFrame.Size = size
|
||||
else
|
||||
loadingFrame.Size = UDim2.new(0, 300, 0, 160)
|
||||
end
|
||||
if position then
|
||||
loadingFrame.Position = position
|
||||
else
|
||||
loadingFrame.Position = UDim2.new(0.5, -150, 0.5, -80)
|
||||
end
|
||||
loadingFrame.Size = size or UDim2.new(0, 300, 0, 160)
|
||||
loadingFrame.Position = position or UDim2.new(0.5, -150, 0.5, -80)
|
||||
|
||||
local loadingBar = New "Frame" {
|
||||
Name = "LoadingBar",
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BorderColor3 = Color3.new(79 / 255, 79 / 255, 79 / 255),
|
||||
BorderColor3 = Colour3(79, 79, 79),
|
||||
Position = UDim2.new(0, 0, 0, 41),
|
||||
Size = UDim2.new(1, 0, 0, 30),
|
||||
Parent = loadingFrame,
|
||||
|
|
@ -4096,7 +4014,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
Text = text,
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
BorderSizePixel = 0,
|
||||
BackgroundColor3 = Color3.new(20 / 255, 20 / 255, 20 / 255),
|
||||
BackgroundColor3 = Colour3(20, 20, 20),
|
||||
}
|
||||
|
||||
button.MouseEnter:connect(function()
|
||||
|
|
@ -4119,7 +4037,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
|
||||
local dragBar = New "ImageButton" {
|
||||
Name = `{name}DragBar`,
|
||||
BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255),
|
||||
BackgroundColor3 = Colour3(39, 39, 39),
|
||||
BorderColor3 = Color3.new(0, 0, 0),
|
||||
Active = true,
|
||||
Draggable = true,
|
||||
|
|
@ -4147,10 +4065,10 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
end
|
||||
--dragBar.Visible = false
|
||||
dragBar.MouseEnter:connect(function()
|
||||
dragBar.BackgroundColor3 = Color3.new(49 / 255, 49 / 255, 49 / 255)
|
||||
dragBar.BackgroundColor3 = Colour3(49, 49, 49)
|
||||
end)
|
||||
dragBar.MouseLeave:connect(function()
|
||||
dragBar.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255)
|
||||
dragBar.BackgroundColor3 = Colour3(39, 39, 39)
|
||||
end)
|
||||
dragBar.Parent = parent
|
||||
|
||||
|
|
@ -4230,7 +4148,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
|
||||
local minimizeFrame = New "Frame" {
|
||||
Name = "MinimizeFrame",
|
||||
BackgroundColor3 = Color3.new(73 / 255, 73 / 255, 73 / 255),
|
||||
BackgroundColor3 = Colour3(73, 73, 73),
|
||||
BorderColor3 = Color3.new(0, 0, 0),
|
||||
Position = UDim2.new(0, 0, 1, 0),
|
||||
Visible = false,
|
||||
|
|
@ -4257,14 +4175,14 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
|
||||
local separatingLine = New "Frame" {
|
||||
Name = "SeparatingLine",
|
||||
BackgroundColor3 = Color3.new(115 / 255, 115 / 255, 115 / 255),
|
||||
BackgroundColor3 = Colour3(115, 115, 115),
|
||||
BorderSizePixel = 0,
|
||||
Position = UDim2.new(1, -18, 0.5, -7),
|
||||
Size = UDim2.new(0, 1, 0, 14),
|
||||
Parent = dragBar,
|
||||
}
|
||||
-- otherSeparatingLine
|
||||
New(separatingLine:clone()) {
|
||||
Hydrate(separatingLine:Clone()) {
|
||||
Position = UDim2.new(1, -35, 0.5, -7),
|
||||
Parent = dragBar,
|
||||
}
|
||||
|
|
@ -4277,8 +4195,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
}
|
||||
if not scrollable then
|
||||
widgetContainer.BackgroundTransparency = 0
|
||||
widgetContainer.BackgroundColor3 =
|
||||
Color3.new(72 / 255, 72 / 255, 72 / 255)
|
||||
widgetContainer.BackgroundColor3 = Colour3(72, 72, 72)
|
||||
end
|
||||
widgetContainer.Parent = dragBar
|
||||
|
||||
|
|
@ -4308,15 +4225,15 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
if scrollable then
|
||||
--frame for widgets
|
||||
frame, control = RbxGui.CreateTrueScrollingFrame()
|
||||
New(frame) {
|
||||
Hydrate(frame) {
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255),
|
||||
BackgroundColor3 = Colour3(72, 72, 72),
|
||||
BorderColor3 = Color3.new(0, 0, 0),
|
||||
Active = true,
|
||||
Parent = widgetContainer,
|
||||
}
|
||||
New(control) {
|
||||
BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255),
|
||||
Hydrate(control) {
|
||||
BackgroundColor3 = Colour3(72, 72, 72),
|
||||
BorderSizePixel = 0,
|
||||
BackgroundTransparency = 0,
|
||||
Position = UDim2.new(1, -21, 1, 1),
|
||||
|
|
@ -4338,37 +4255,36 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
|
||||
control.Parent = dragBar
|
||||
|
||||
local function scrubFrame()
|
||||
return New "Frame" {
|
||||
Name = "ScrubFrame",
|
||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
||||
BorderSizePixel = 0,
|
||||
Size = UDim2.new(0, 10, 0, 1),
|
||||
ZIndex = 5,
|
||||
}
|
||||
end
|
||||
|
||||
verticalDragger = New "TextButton" {
|
||||
ZIndex = 2,
|
||||
AutoButtonColor = false,
|
||||
Name = "VerticalDragger",
|
||||
BackgroundColor3 = Color3.new(50 / 255, 50 / 255, 50 / 255),
|
||||
BackgroundColor3 = Colour3(50, 50, 50),
|
||||
BorderColor3 = Color3.new(0, 0, 0),
|
||||
Size = UDim2.new(1, 20, 0, 20),
|
||||
Position = UDim2.new(0, 0, 1, 0),
|
||||
Active = true,
|
||||
Text = "",
|
||||
Parent = widgetContainer,
|
||||
}
|
||||
|
||||
local scrubFrame = New "Frame" {
|
||||
Name = "ScrubFrame",
|
||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
||||
BorderSizePixel = 0,
|
||||
Position = UDim2.new(0.5, -5, 0.5, 0),
|
||||
Size = UDim2.new(0, 10, 0, 1),
|
||||
ZIndex = 5,
|
||||
Parent = verticalDragger,
|
||||
}
|
||||
-- scrubTwo
|
||||
New(scrubFrame:clone()) {
|
||||
Hydrate(scrubFrame()) {
|
||||
Position = UDim2.new(0.5, -5, 0.5, -2),
|
||||
Parent = verticalDragger,
|
||||
}
|
||||
-- scrubThree
|
||||
New(scrubFrame:clone()) {
|
||||
},
|
||||
Hydrate(scrubFrame()) {
|
||||
Position = UDim2.new(0.5, -5, 0.5, 0),
|
||||
},
|
||||
Hydrate(scrubFrame()) {
|
||||
Position = UDim2.new(0.5, -5, 0.5, 2),
|
||||
Parent = verticalDragger,
|
||||
},
|
||||
}
|
||||
|
||||
local areaSoak = New "TextButton" {
|
||||
|
|
@ -4386,12 +4302,10 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
local draggingVertical = false
|
||||
local startYPos
|
||||
verticalDragger.MouseEnter:connect(function()
|
||||
verticalDragger.BackgroundColor3 =
|
||||
Color3.new(60 / 255, 60 / 255, 60 / 255)
|
||||
verticalDragger.BackgroundColor3 = Colour3(60, 60, 60)
|
||||
end)
|
||||
verticalDragger.MouseLeave:connect(function()
|
||||
verticalDragger.BackgroundColor3 =
|
||||
Color3.new(50 / 255, 50 / 255, 50 / 255)
|
||||
verticalDragger.BackgroundColor3 = Colour3(50, 50, 50)
|
||||
end)
|
||||
verticalDragger.MouseButton1Down:connect(function(_, y)
|
||||
draggingVertical = true
|
||||
|
|
@ -4448,11 +4362,7 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
|
|||
widgetContainer.Visible = not widgetContainer.Visible
|
||||
end
|
||||
|
||||
if minimizeFrame.Visible then
|
||||
minimizeButton.Text = "+"
|
||||
else
|
||||
minimizeButton.Text = "-"
|
||||
end
|
||||
minimizeButton.Text = minimizeFrame.Visible and "+" or "-"
|
||||
end
|
||||
|
||||
minimizeBigButton.MouseButton1Click:connect(function()
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ local function createGameMainMenu(baseZIndex, shield)
|
|||
screenshotButton.Visible = not macClient
|
||||
screenshotButton:SetVerb "Screenshot"
|
||||
|
||||
local screenshotShortcut = helpShortcut:clone()
|
||||
local screenshotShortcut = helpShortcut:Clone()
|
||||
screenshotShortcut.Name = "ScreenshotShortcutText"
|
||||
screenshotShortcut.Text = "PrintSc"
|
||||
screenshotShortcut.Position = UDim2.new(0, 118, 0, 0)
|
||||
|
|
@ -733,7 +733,7 @@ local function createGameMainMenu(baseZIndex, shield)
|
|||
recordVideoButton.Visible = not macClient
|
||||
recordVideoButton:SetVerb "RecordToggle"
|
||||
|
||||
local recordVideoShortcut = helpShortcut:clone()
|
||||
local recordVideoShortcut = helpShortcut:Clone()
|
||||
recordVideoShortcut.Visible = hasGraphicsSlider
|
||||
recordVideoShortcut.Name = "RecordVideoShortcutText"
|
||||
recordVideoShortcut.Text = "F12"
|
||||
|
|
@ -899,7 +899,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
|||
studioText.BackgroundTransparency = 1
|
||||
studioText.Parent = gameSettingsMenuFrame
|
||||
|
||||
local studioShortcut = fullscreenShortcut:clone()
|
||||
local studioShortcut = fullscreenShortcut:Clone()
|
||||
studioShortcut.Name = "StudioShortcutText"
|
||||
studioShortcut.Visible = false -- TODO: turn back on when f2 hack is fixed
|
||||
studioShortcut.Text = "F2"
|
||||
|
|
@ -921,7 +921,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
|||
qualityText.Parent = gameSettingsMenuFrame
|
||||
qualityText.Visible = not inStudioMode
|
||||
|
||||
local autoText = qualityText:clone()
|
||||
local autoText = qualityText:Clone()
|
||||
autoText.Name = "AutoText"
|
||||
autoText.Text = "Auto"
|
||||
autoText.Position = UDim2.new(0, 183, 0, 214)
|
||||
|
|
@ -930,7 +930,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
|||
autoText.Parent = gameSettingsMenuFrame
|
||||
autoText.Visible = not inStudioMode
|
||||
|
||||
local fasterText = autoText:clone()
|
||||
local fasterText = autoText:Clone()
|
||||
fasterText.Name = "FasterText"
|
||||
fasterText.Text = "Faster"
|
||||
fasterText.Position = UDim2.new(0, 185, 0, 274)
|
||||
|
|
@ -939,14 +939,14 @@ local function createGameSettingsMenu(baseZIndex, _)
|
|||
fasterText.Parent = gameSettingsMenuFrame
|
||||
fasterText.Visible = not inStudioMode
|
||||
|
||||
local fasterShortcut = fullscreenShortcut:clone()
|
||||
local fasterShortcut = fullscreenShortcut:Clone()
|
||||
fasterShortcut.Name = "FasterShortcutText"
|
||||
fasterShortcut.Text = "F10 + Shift"
|
||||
fasterShortcut.Position = UDim2.new(0, 185, 0, 283)
|
||||
fasterShortcut.Parent = gameSettingsMenuFrame
|
||||
fasterShortcut.Visible = not inStudioMode
|
||||
|
||||
local betterQualityText = autoText:clone()
|
||||
local betterQualityText = autoText:Clone()
|
||||
betterQualityText.Name = "BetterQualityText"
|
||||
betterQualityText.Text = "Better Quality"
|
||||
betterQualityText.TextWrap = true
|
||||
|
|
@ -957,7 +957,7 @@ local function createGameSettingsMenu(baseZIndex, _)
|
|||
betterQualityText.Parent = gameSettingsMenuFrame
|
||||
betterQualityText.Visible = not inStudioMode
|
||||
|
||||
local betterQualityShortcut = fullscreenShortcut:clone()
|
||||
local betterQualityShortcut = fullscreenShortcut:Clone()
|
||||
betterQualityShortcut.Name = "BetterQualityShortcut"
|
||||
betterQualityShortcut.Text = "F10"
|
||||
betterQualityShortcut.Position = UDim2.new(0, 394, 0, 288)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
-- CoreGui.RobloxGui.CoreScripts/PlayerListScript
|
||||
print "[Mercury]: Loaded corescript 48488235"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local New = (require "../Modules/New").New
|
||||
|
||||
--------------------
|
||||
-- Super Util
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
-- CoreGui.RobloxGui.CoreScripts/PopupScript
|
||||
print "[Mercury]: Loaded corescript 48488451"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
--build our gui
|
||||
|
||||
|
|
@ -39,7 +41,7 @@ local popupFrame = New "Frame" {
|
|||
ZIndex = 5,
|
||||
},
|
||||
}
|
||||
New(popupFrame:clone()) {
|
||||
Hydrate(popupFrame:Clone()) {
|
||||
Name = "Darken",
|
||||
Size = UDim2.new(1, 16, 1, 16),
|
||||
Position = UDim2.new(0, -8, 0, -8),
|
||||
|
|
@ -58,13 +60,13 @@ local acceptButton = New "TextButton" {
|
|||
ZIndex = 5,
|
||||
Parent = popupFrame,
|
||||
}
|
||||
New(acceptButton:clone()) {
|
||||
Hydrate(acceptButton:Clone()) {
|
||||
Name = "DeclineButton",
|
||||
Text = "No",
|
||||
Position = UDim2.new(1, -120, 0, 270),
|
||||
Parent = popupFrame,
|
||||
}
|
||||
New(acceptButton:clone()) {
|
||||
Hydrate(acceptButton:Clone()) {
|
||||
Name = "OKButton",
|
||||
Text = "OK",
|
||||
Position = UDim2.new(0.5, -50, 0, 270),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
-- CoreGui.RobloxGui.CoreScripts/BackpackScripts/BackpackBuild
|
||||
print "[Mercury]: Loaded corescript 53878047"
|
||||
|
||||
local New = require "../Modules/New"
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
|
||||
-- TODO: automate this process
|
||||
|
|
@ -159,13 +161,13 @@ local CurrentLoadout = New "Frame" {
|
|||
ZIndex = 5.0,
|
||||
},
|
||||
SlotNumber(),
|
||||
New(SlotNumber()) {
|
||||
Hydrate(SlotNumber()) {
|
||||
Name = "SlotNumberDownShadow",
|
||||
TextColor3 = Color3.new(0, 0, 0),
|
||||
Position = UDim2.new(0, 1, 0, -1),
|
||||
ZIndex = 2,
|
||||
},
|
||||
New(SlotNumber()) {
|
||||
Hydrate(SlotNumber()) {
|
||||
Name = "SlotNumberUpShadow",
|
||||
TextColor3 = Color3.new(0, 0, 0),
|
||||
Position = UDim2.new(0, -1, 0, -1),
|
||||
|
|
@ -184,7 +186,7 @@ New "ImageButton" {
|
|||
Image = "http://banland.xyz/asset/?id=97617958",
|
||||
Position = UDim2.new(0.5, -60, 1, -108),
|
||||
Size = UDim2.new(0, 120, 0, 18),
|
||||
Parent = gui.ControlFrame
|
||||
Parent = gui.ControlFrame,
|
||||
}
|
||||
|
||||
for i = 0, 9 do
|
||||
|
|
@ -391,7 +393,7 @@ New "Frame" {
|
|||
TextColor3 = Color3.new(1, 1, 1),
|
||||
},
|
||||
},
|
||||
New(GearGridScrollingArea()) {
|
||||
Hydrate(GearGridScrollingArea()) {
|
||||
Name = "GearLoadoutsScrollingArea",
|
||||
Position = UDim2.new(1, -15, 0.15, 2),
|
||||
Size = UDim2.new(0, 17, 0.85, -2),
|
||||
|
|
@ -451,17 +453,17 @@ New "Frame" {
|
|||
Visible = false,
|
||||
ZIndex = 9,
|
||||
AttributeImage(),
|
||||
New(AttributeImage()) {
|
||||
Hydrate(AttributeImage()) {
|
||||
Name = "AttributeOneImage",
|
||||
BackgroundColor3 = Color3.new(1, 51 / 255, 0),
|
||||
Position = UDim2.new(0.25, 0, 0, 0),
|
||||
},
|
||||
New(AttributeImage()) {
|
||||
Hydrate(AttributeImage()) {
|
||||
Name = "AttributeTwoImage",
|
||||
BackgroundColor3 = Color3.new(153 / 255, 1, 153 / 255),
|
||||
Position = UDim2.new(0.5, 0, 0, 0),
|
||||
},
|
||||
New(AttributeImage()) {
|
||||
Hydrate(AttributeImage()) {
|
||||
Name = "AttributeThreeImage",
|
||||
BackgroundColor3 = Color3.new(0, 0.5, 0.5),
|
||||
Position = UDim2.new(0.75, 0, 0, 0),
|
||||
|
|
|
|||
|
|
@ -620,9 +620,9 @@ local function resolveDrag(gearClone, x, y)
|
|||
local frames = frame.Parent:GetChildren()
|
||||
|
||||
for i = 1, #frames do
|
||||
if frames[i]:IsA "Frame" then
|
||||
if
|
||||
pointInRectangle(
|
||||
frames[i]:IsA "Frame"
|
||||
and pointInRectangle(
|
||||
mousePoint,
|
||||
frames[i].AbsolutePosition,
|
||||
frames[i].AbsoluteSize
|
||||
|
|
@ -632,7 +632,6 @@ local function resolveDrag(gearClone, x, y)
|
|||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if
|
||||
(
|
||||
|
|
@ -738,7 +737,7 @@ local function addingPlayerChild(
|
|||
end
|
||||
end
|
||||
|
||||
local gearClone = currentLoadout.TempSlot:clone()
|
||||
local gearClone = currentLoadout.TempSlot:Clone()
|
||||
gearClone.Name = child.Name
|
||||
gearClone.GearImage.Image = child.TextureId
|
||||
if gearClone.GearImage.Image == "" then
|
||||
|
|
@ -1175,21 +1174,14 @@ end)
|
|||
|
||||
delay(2, function()
|
||||
-- while true do
|
||||
if not backpackWasOpened then
|
||||
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||
if not backpackWasOpened and robloxGui.AbsoluteSize.Y <= 320 then
|
||||
local cChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #cChildren do
|
||||
local slotNum = tonumber(
|
||||
string.sub(
|
||||
cChildren[i].Name,
|
||||
5,
|
||||
string.len(cChildren[i].Name)
|
||||
)
|
||||
string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))
|
||||
)
|
||||
if type(slotNum) == "number" then
|
||||
cChildren[i].Position =
|
||||
UDim2.new(0, (slotNum - 1) * 60, 0, 0)
|
||||
end
|
||||
cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1289,8 +1281,7 @@ player.CharacterAdded:connect(function()
|
|||
moveHealthBar(player.PlayerGui)
|
||||
delay(2, function()
|
||||
-- while true do
|
||||
if not backpackWasOpened then
|
||||
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||
if not backpackWasOpened and robloxGui.AbsoluteSize.Y <= 320 then
|
||||
local cChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #cChildren do
|
||||
local slotNum = tonumber(
|
||||
|
|
@ -1306,7 +1297,6 @@ player.CharacterAdded:connect(function()
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
wait(0.25)
|
||||
-- end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
-- RbxUtility
|
||||
print "[Mercury]: Loaded corescript 60595411"
|
||||
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
local Terrain = game:GetService "Terrain"
|
||||
|
||||
local RbxUtility = {}
|
||||
|
|
@ -66,14 +70,11 @@ RbxUtility.SelectTerrainRegion = function(
|
|||
local emptyMaterial = Enum.CellMaterial.Empty
|
||||
|
||||
-- container for all adornments, passed back to user
|
||||
local selectionContainer = Instance.new "Model"
|
||||
selectionContainer.Name = "SelectionContainer"
|
||||
selectionContainer.Archivable = false
|
||||
if selectionParent then
|
||||
selectionContainer.Parent = selectionParent
|
||||
else
|
||||
selectionContainer.Parent = game.Workspace
|
||||
end
|
||||
local selectionContainer = New "Model" {
|
||||
Name = "SelectionContainer",
|
||||
Archivable = false,
|
||||
Parent = selectionParent or game.Workspace,
|
||||
}
|
||||
|
||||
local updateSelection -- function we return to allow user to update selection
|
||||
local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed
|
||||
|
|
@ -82,13 +83,14 @@ RbxUtility.SelectTerrainRegion = function(
|
|||
local adornments = {} -- contains all adornments
|
||||
local reusableAdorns = {}
|
||||
|
||||
local selectionPart = Instance.new "Part"
|
||||
selectionPart.Name = "SelectionPart"
|
||||
selectionPart.Transparency = 1
|
||||
selectionPart.Anchored = true
|
||||
selectionPart.Locked = true
|
||||
selectionPart.CanCollide = false
|
||||
selectionPart.Size = Vector3.new(4.2, 4.2, 4.2)
|
||||
local selectionPart = New "Part" {
|
||||
Name = "SelectionPart",
|
||||
Transparency = 1,
|
||||
Anchored = true,
|
||||
Locked = true,
|
||||
CanCollide = false,
|
||||
Size = Vector3.new(4.2, 4.2, 4.2),
|
||||
}
|
||||
|
||||
local selectionBox = Instance.new "SelectionBox"
|
||||
|
||||
|
|
@ -104,18 +106,15 @@ RbxUtility.SelectTerrainRegion = function(
|
|||
|
||||
selectionBoxClone.Visible = true
|
||||
else
|
||||
selectionPartClone = selectionPart:Clone()
|
||||
selectionPartClone.Archivable = false
|
||||
selectionPartClone = Hydrate(selectionPart:Clone()) {
|
||||
Archivable = false,
|
||||
}
|
||||
|
||||
selectionBoxClone = selectionBox:Clone()
|
||||
selectionBoxClone.Archivable = false
|
||||
|
||||
selectionBoxClone.Adornee = selectionPartClone
|
||||
selectionBoxClone.Parent = selectionContainer
|
||||
|
||||
selectionBoxClone.Adornee = selectionPartClone
|
||||
|
||||
selectionBoxClone.Parent = selectionContainer
|
||||
selectionBoxClone = Hydrate(selectionBox:Clone()) {
|
||||
Archivable = false,
|
||||
Adornee = selectionPartClone,
|
||||
Parent = selectionContainer,
|
||||
}
|
||||
end
|
||||
|
||||
if theColour then
|
||||
|
|
@ -142,9 +141,7 @@ RbxUtility.SelectTerrainRegion = function(
|
|||
-- helper function to update tag
|
||||
local function incrementAliveCounter()
|
||||
aliveCounter += 1
|
||||
if aliveCounter > 1000000 then
|
||||
aliveCounter = 0
|
||||
end
|
||||
aliveCounter %= 1000000
|
||||
return aliveCounter
|
||||
end
|
||||
|
||||
|
|
@ -238,7 +235,7 @@ RbxUtility.SelectTerrainRegion = function(
|
|||
if selectionContainer then
|
||||
selectionContainer:Destroy()
|
||||
end
|
||||
adornments = nil
|
||||
adornments = {}
|
||||
end
|
||||
|
||||
return updateSelection, destroyFunc
|
||||
|
|
@ -597,7 +594,7 @@ RbxUtility.Help = function(funcNameOrFunc)
|
|||
.. "Lua code. "
|
||||
.. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. "
|
||||
.. "For more info you can pass the method name to the Help function, or view the wiki page "
|
||||
.. "for this library. EG: Help('Signal:connect')."
|
||||
.. 'for this library. EG: Help "Signal:connect".'
|
||||
end
|
||||
if funcNameOrFunc == "Signal:connect" then
|
||||
return "Method Signal:connect. "
|
||||
|
|
@ -635,7 +632,7 @@ RbxUtility.Help = function(funcNameOrFunc)
|
|||
return "Function Create. "
|
||||
.. "Arguments: A table containing information about how to construct a collection of objects. "
|
||||
.. "Returns: The constructed objects. "
|
||||
.. "Descrition: Create is a very powerfull function, whose description is too long to fit here, and "
|
||||
.. "Descrition: Create is a very powerful function, whose description is too long to fit here, and "
|
||||
.. "is best described via example, please see the wiki page for a description of how to use it."
|
||||
end
|
||||
return "No help available for this function"
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ end
|
|||
--
|
||||
-- Return:
|
||||
-- cellPos - Cell position hit. Nil if none.
|
||||
function GetTerrainForMouse(mouse)
|
||||
local function GetTerrainForMouse(mouse)
|
||||
-- There was no target, so all it could be is a plane intersection.
|
||||
-- Check for a plane intersection. If there isn't one then nothing will get hit.
|
||||
local cell = game.Workspace.Terrain:WorldToCellPreferSolid(
|
||||
|
|
@ -896,13 +896,9 @@ RbxStamper.GetStampModel = function(assetId, terrainShape, useAssetVersionId)
|
|||
|
||||
if totalTime >= maxWait then
|
||||
return nil, "Load Time Fail"
|
||||
end
|
||||
|
||||
if root == nil then
|
||||
elseif root == nil then
|
||||
return nil, "Load Asset Fail"
|
||||
end
|
||||
|
||||
if not root:IsA "Model" then
|
||||
elseif not root:IsA "Model" then
|
||||
return nil, "Load Type Fail"
|
||||
end
|
||||
|
||||
|
|
@ -2997,6 +2993,7 @@ RbxStamper.Help = function(funcNameOrFunc)
|
|||
then
|
||||
return "Function SetupStamperDragger. Side Effect: Creates 4x4 stamping mechanism for building out parts quickly. Arguments: ModelToStamp, Mouse, LegalStampCheckFunction. ModelToStamp should be a Model or Part, preferrably loaded from RbxStamper.GetStampModel and should have extents that are multiples of 4. Mouse should be a mouse object (obtained from things such as Tool.OnEquipped), used to drag parts around 'stamp' them out. LegalStampCheckFunction is optional, used as a callback with a table argument (table is full of instances about to be stamped). Function should return either true or false, false stopping the stamp action."
|
||||
end
|
||||
return "No help available for this function"
|
||||
end
|
||||
|
||||
return RbxStamper
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (2?)
|
||||
print "[Mercury]: Loaded corescript 89449093"
|
||||
|
||||
local News = require "../Modules/New"
|
||||
local New = News.New
|
||||
local Hydrate = News.Hydrate
|
||||
|
||||
local GuiService = game:GetService "GuiService"
|
||||
|
||||
-- basic functions
|
||||
|
|
@ -26,18 +30,17 @@ end
|
|||
waitForProperty(game.Players, "LocalPlayer")
|
||||
|
||||
------------------------ Locals ------------------------------
|
||||
local backpack = script.Parent
|
||||
local backpack = script.Parent :: GuiObject
|
||||
waitForChild(backpack, "Gear")
|
||||
|
||||
local screen = script.Parent.Parent
|
||||
assert(screen:IsA "ScreenGui")
|
||||
local screen = backpack.Parent :: ScreenGui
|
||||
|
||||
waitForChild(backpack, "Tabs")
|
||||
waitForChild(backpack.Tabs, "CloseButton")
|
||||
local closeButton = backpack.Tabs.CloseButton
|
||||
|
||||
waitForChild(backpack.Tabs, "InventoryButton")
|
||||
local inventoryButton = backpack.Tabs.InventoryButton
|
||||
local inventoryButton: TextButton = backpack.Tabs.InventoryButton
|
||||
|
||||
waitForChild(backpack.Parent, "ControlFrame")
|
||||
local backpackButton =
|
||||
|
|
@ -78,100 +81,48 @@ end
|
|||
|
||||
---------------------------------------- Public Event Setup ----------------------------------------
|
||||
|
||||
function createPublicEvent(eventName)
|
||||
assert(eventName, "eventName is nil")
|
||||
assert(tostring(eventName), "eventName is not a string")
|
||||
|
||||
local newEvent = Instance.new "BindableEvent"
|
||||
newEvent.Name = tostring(eventName)
|
||||
newEvent.Parent = script
|
||||
|
||||
return newEvent
|
||||
function publicEvent(eventName: string)
|
||||
return New "BindableEvent" {
|
||||
Name = eventName,
|
||||
Parent = script,
|
||||
}
|
||||
end
|
||||
|
||||
function createPublicFunction(funcName, invokeFunc)
|
||||
assert(funcName, "funcName is nil")
|
||||
assert(tostring(funcName), "funcName is not a string")
|
||||
assert(invokeFunc, "invokeFunc is nil")
|
||||
assert(
|
||||
type(invokeFunc) == "function",
|
||||
"invokeFunc should be of type 'function'"
|
||||
)
|
||||
|
||||
local newFunction = Instance.new "BindableFunction"
|
||||
newFunction.Name = tostring(funcName)
|
||||
newFunction.OnInvoke = invokeFunc
|
||||
newFunction.Parent = script
|
||||
|
||||
return newFunction
|
||||
function publicFunction(funcName: string, invokeFunc: () -> ())
|
||||
return New "BindableFunction" {
|
||||
Name = funcName,
|
||||
OnInvoke = invokeFunc,
|
||||
Parent = script,
|
||||
}
|
||||
end
|
||||
|
||||
-- Events
|
||||
local resizeEvent = createPublicEvent "ResizeEvent"
|
||||
local backpackOpenEvent = createPublicEvent "BackpackOpenEvent"
|
||||
local backpackCloseEvent = createPublicEvent "BackpackCloseEvent"
|
||||
local tabClickedEvent = createPublicEvent "TabClickedEvent"
|
||||
local searchRequestedEvent = createPublicEvent "SearchRequestedEvent"
|
||||
local resizeEvent = publicEvent "ResizeEvent"
|
||||
local backpackOpenEvent = publicEvent "BackpackOpenEvent"
|
||||
local backpackCloseEvent = publicEvent "BackpackCloseEvent"
|
||||
local tabClickedEvent = publicEvent "TabClickedEvent"
|
||||
local searchRequestedEvent = publicEvent "SearchRequestedEvent"
|
||||
---------------------------------------- End Public Event Setup ----------------------------------------
|
||||
|
||||
--------------------------- Internal Functions ----------------------------------------
|
||||
|
||||
function deactivateBackpack()
|
||||
local function deactivateBackpack()
|
||||
backpack.Visible = false
|
||||
active = false
|
||||
end
|
||||
|
||||
function initHumanoidDiedConnections()
|
||||
local function initHumanoidDiedConnections()
|
||||
if humanoidDiedCon then
|
||||
humanoidDiedCon:disconnect()
|
||||
end
|
||||
waitForProperty(game.Players.LocalPlayer, "Character")
|
||||
waitForChild(game.Players.LocalPlayer.Character, "Humanoid")
|
||||
humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(
|
||||
deactivateBackpack
|
||||
)
|
||||
local localPlayer = game.Players.LocalPlayer
|
||||
waitForChild(localPlayer.Character, "Humanoid")
|
||||
humanoidDiedCon =
|
||||
localPlayer.Character.Humanoid.Died:connect(deactivateBackpack)
|
||||
end
|
||||
|
||||
function activateBackpack()
|
||||
initHumanoidDiedConnections()
|
||||
active = true
|
||||
backpack.Visible = backpackIsOpen
|
||||
if backpackIsOpen then
|
||||
toggleBackpack()
|
||||
end
|
||||
end
|
||||
|
||||
local hideBackpack = function()
|
||||
backpackIsOpen = false
|
||||
readyForNextEvent = false
|
||||
backpackButton.Selected = false
|
||||
resetSearch()
|
||||
backpackCloseEvent:Fire(currentTab)
|
||||
backpack.Tabs.Visible = false
|
||||
searchFrame.Visible = false
|
||||
backpack:TweenSizeAndPosition(
|
||||
UDim2.new(0, backpackSize.X.Offset, 0, 0),
|
||||
UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -85),
|
||||
Enum.EasingDirection.Out,
|
||||
Enum.EasingStyle.Quad,
|
||||
guiTweenSpeed,
|
||||
true,
|
||||
function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
end
|
||||
)
|
||||
delay(guiTweenSpeed, function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
readyForNextEvent = true
|
||||
canToggle = true
|
||||
end)
|
||||
end
|
||||
|
||||
function showBackpack()
|
||||
local function showBackpack()
|
||||
game.GuiService:AddCenterDialog(
|
||||
backpack,
|
||||
Enum.CenterDialogType.PlayerInitiatedDialog,
|
||||
|
|
@ -211,17 +162,45 @@ function showBackpack()
|
|||
end)
|
||||
end
|
||||
|
||||
function toggleBackpack()
|
||||
if not game.Players.LocalPlayer then
|
||||
return
|
||||
local function hideBackpack()
|
||||
backpackIsOpen = false
|
||||
readyForNextEvent = false
|
||||
backpackButton.Selected = false
|
||||
resetSearch()
|
||||
backpackCloseEvent:Fire(currentTab)
|
||||
backpack.Tabs.Visible = false
|
||||
searchFrame.Visible = false
|
||||
backpack:TweenSizeAndPosition(
|
||||
UDim2.new(0, backpackSize.X.Offset, 0, 0),
|
||||
UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -85),
|
||||
Enum.EasingDirection.Out,
|
||||
Enum.EasingStyle.Quad,
|
||||
guiTweenSpeed,
|
||||
true,
|
||||
function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
end
|
||||
if not game.Players.LocalPlayer.Character then
|
||||
return
|
||||
)
|
||||
delay(guiTweenSpeed, function()
|
||||
game.GuiService:RemoveCenterDialog(backpack)
|
||||
backpack.Visible = false
|
||||
backpackButton.Selected = false
|
||||
readyForNextEvent = true
|
||||
canToggle = true
|
||||
end)
|
||||
end
|
||||
if not canToggle then
|
||||
return
|
||||
end
|
||||
if not readyForNextEvent then
|
||||
|
||||
local function toggleBackpack()
|
||||
if
|
||||
not (
|
||||
game.Players.LocalPlayer
|
||||
and game.Players.LocalPlayer.Character
|
||||
and canToggle
|
||||
and readyForNextEvent
|
||||
)
|
||||
then
|
||||
return
|
||||
end
|
||||
readyForNextEvent = false
|
||||
|
|
@ -230,20 +209,26 @@ function toggleBackpack()
|
|||
backpackIsOpen = not backpackIsOpen
|
||||
|
||||
if backpackIsOpen then
|
||||
loadoutBackground.Image = "http://banland.xyz/asset/?id=97623721"
|
||||
loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0)
|
||||
loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0)
|
||||
loadoutBackground.ZIndex = 2.0
|
||||
loadoutBackground.Visible = true
|
||||
Hydrate(loadoutBackground) {
|
||||
Image = "http://banland.xyz/asset/?id=97623721",
|
||||
Position = UDim2.new(-0.03, 0, -0.17, 0),
|
||||
Size = UDim2.new(1.05, 0, 1.25, 0),
|
||||
ZIndex = 2.0,
|
||||
Visible = true,
|
||||
}
|
||||
showBackpack()
|
||||
else
|
||||
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
||||
loadoutBackground.Visible = false
|
||||
backpackButton.Selected = false
|
||||
backpackButton.Image = "http://banland.xyz/asset/?id=97617958"
|
||||
loadoutBackground.Image = "http://banland.xyz/asset/?id=96536002"
|
||||
loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
|
||||
loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
|
||||
Hydrate(backpackButton) {
|
||||
Position = UDim2.new(0.5, -60, 1, -44),
|
||||
Selected = false,
|
||||
Image = "http://banland.xyz/asset/?id=97617958",
|
||||
}
|
||||
Hydrate(loadoutBackground) {
|
||||
Visible = false,
|
||||
Image = "http://banland.xyz/asset/?id=96536002",
|
||||
Position = UDim2.new(-0.1, 0, -0.1, 0),
|
||||
Size = UDim2.new(1.2, 0, 1.2, 0),
|
||||
}
|
||||
hideBackpack()
|
||||
|
||||
local clChildren = currentLoadout:GetChildren()
|
||||
|
|
@ -265,98 +250,57 @@ function toggleBackpack()
|
|||
end
|
||||
end
|
||||
|
||||
function closeBackpack()
|
||||
local function activateBackpack()
|
||||
initHumanoidDiedConnections()
|
||||
active = true
|
||||
backpack.Visible = backpackIsOpen
|
||||
if backpackIsOpen then
|
||||
toggleBackpack()
|
||||
end
|
||||
end
|
||||
|
||||
function setSelected(tab)
|
||||
assert(tab)
|
||||
assert(tab:IsA "TextButton")
|
||||
|
||||
tab.BackgroundColor3 = Color3.new(1, 1, 1)
|
||||
tab.TextColor3 = Color3.new(0, 0, 0)
|
||||
tab.Selected = true
|
||||
tab.ZIndex = 3
|
||||
local function closeBackpack()
|
||||
if backpackIsOpen then
|
||||
toggleBackpack()
|
||||
end
|
||||
end
|
||||
|
||||
function setUnselected(tab)
|
||||
assert(tab)
|
||||
assert(tab:IsA "TextButton")
|
||||
|
||||
tab.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
tab.TextColor3 = Color3.new(1, 1, 1)
|
||||
tab.Selected = false
|
||||
tab.ZIndex = 1
|
||||
end
|
||||
|
||||
function updateTabGui(selectedTab)
|
||||
assert(selectedTab)
|
||||
|
||||
local function updateTabGui(selectedTab: string)
|
||||
if selectedTab == "gear" then
|
||||
setSelected(inventoryButton)
|
||||
-- Selected
|
||||
Hydrate(inventoryButton) {
|
||||
BackgroundColor3 = Color3.new(1, 1, 1),
|
||||
TextColor3 = Color3.new(0, 0, 0),
|
||||
Selected = true,
|
||||
ZIndex = 3,
|
||||
}
|
||||
elseif selectedTab == "wardrobe" then
|
||||
setUnselected(inventoryButton)
|
||||
-- Unselected
|
||||
Hydrate(inventoryButton) {
|
||||
BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
TextColor3 = Color3.new(1, 1, 1),
|
||||
Selected = false,
|
||||
ZIndex = 1,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function mouseLeaveTab(button)
|
||||
assert(button)
|
||||
assert(button:IsA "TextButton")
|
||||
|
||||
if button.Selected then
|
||||
return
|
||||
end
|
||||
|
||||
button.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
end
|
||||
|
||||
function mouseOverTab(button)
|
||||
assert(button)
|
||||
assert(button:IsA "TextButton")
|
||||
|
||||
if button.Selected then
|
||||
return
|
||||
end
|
||||
|
||||
button.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255)
|
||||
end
|
||||
|
||||
function newTabClicked(tabName)
|
||||
assert(tabName)
|
||||
tabName = string.lower(tabName)
|
||||
currentTab = tabName
|
||||
|
||||
updateTabGui(tabName)
|
||||
tabClickedEvent:Fire(tabName)
|
||||
local function newTabClicked()
|
||||
updateTabGui(currentTab)
|
||||
tabClickedEvent:Fire(currentTab)
|
||||
resetSearch()
|
||||
end
|
||||
|
||||
function trim(s)
|
||||
local function trim(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
-- function splitByWhitespace(text)
|
||||
-- if type(text) ~= "string" then
|
||||
-- return nil
|
||||
-- end
|
||||
|
||||
-- local terms = {}
|
||||
-- for token in string.gmatch(text, "[^%s]+") do
|
||||
-- if string.len(token) > 0 then
|
||||
-- table.insert(terms, token)
|
||||
-- end
|
||||
-- end
|
||||
-- return terms
|
||||
-- end
|
||||
|
||||
function resetSearchBoxGui()
|
||||
local function resetSearchBoxGui()
|
||||
resetButton.Visible = false
|
||||
searchBox.Text = searchDefaultText
|
||||
end
|
||||
|
||||
function doSearch()
|
||||
local function doSearch()
|
||||
local searchText = searchBox.Text
|
||||
if searchText == "" then
|
||||
resetSearch()
|
||||
|
|
@ -364,7 +308,6 @@ function doSearch()
|
|||
end
|
||||
searchText = trim(searchText)
|
||||
resetButton.Visible = true
|
||||
-- termTable = splitByWhitespace(searchText)
|
||||
searchRequestedEvent:Fire(searchText) -- todo: replace this with termtable when table passing is possible
|
||||
end
|
||||
|
||||
|
|
@ -407,9 +350,8 @@ end
|
|||
--------------------------- End Internal Functions -------------------------------------
|
||||
|
||||
------------------------------ Public Functions Setup -------------------------------------
|
||||
createPublicFunction("CloseBackpack", hideBackpack)
|
||||
createPublicFunction("BackpackReady", backpackReady)
|
||||
------------------------------ End Public Functions Setup ---------------------------------
|
||||
publicFunction("CloseBackpack", hideBackpack)
|
||||
publicFunction("BackpackReady", backpackReady)
|
||||
|
||||
------------------------ Connections/Script Main -------------------------------------------
|
||||
|
||||
|
|
@ -421,14 +363,20 @@ pcall(function()
|
|||
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
|
||||
end)
|
||||
|
||||
inventoryButton.MouseButton1Click:connect(function()
|
||||
newTabClicked "gear"
|
||||
end)
|
||||
inventoryButton.MouseButton1Click:connect(newTabClicked)
|
||||
inventoryButton.MouseEnter:connect(function()
|
||||
mouseOverTab(inventoryButton)
|
||||
if inventoryButton.Selected then
|
||||
return
|
||||
end
|
||||
|
||||
inventoryButton.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255)
|
||||
end)
|
||||
inventoryButton.MouseLeave:connect(function()
|
||||
mouseLeaveTab(inventoryButton)
|
||||
if inventoryButton.Selected then
|
||||
return
|
||||
end
|
||||
|
||||
inventoryButton.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
end)
|
||||
|
||||
closeButton.MouseButton1Click:connect(closeBackpack)
|
||||
|
|
@ -445,8 +393,7 @@ GuiService:AddKey(backtick)
|
|||
GuiService.KeyPressed:connect(function(key)
|
||||
if not active or disabledByDeveloper then
|
||||
return
|
||||
end
|
||||
if key == tilde or key == backtick then
|
||||
elseif key == tilde or key == backtick then
|
||||
toggleBackpack()
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ print "[Mercury]: Loaded corescript 97188756"
|
|||
//NOTE: If you find any bugs or inaccuracies PM Sorcus on Roblox or @Canavus on Twitter
|
||||
]]
|
||||
|
||||
local SafeChat = require "../Modules/Safechat.yml"
|
||||
local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA
|
||||
local New = (require "../Modules/New").New
|
||||
|
||||
local forceChatGUI = false
|
||||
|
||||
|
|
@ -53,14 +54,13 @@ local Player = Game.Players.LocalPlayer
|
|||
while Player.Character == nil do
|
||||
wait(0.03)
|
||||
end
|
||||
local RbxUtility = LoadLibrary "RbxUtility"
|
||||
local Create = RbxUtility.Create
|
||||
local Camera = Game.Workspace.CurrentCamera
|
||||
|
||||
-- Services
|
||||
local CoreGuiService = Game:GetService "CoreGui"
|
||||
local PlayersService = Game:GetService "Players"
|
||||
local GuiService = Game:GetService "GuiService"
|
||||
local UserInputService = Game:GetService "UserInputService"
|
||||
|
||||
-- Lua Enums
|
||||
local Enums, CreateEnum
|
||||
|
|
@ -119,7 +119,6 @@ end
|
|||
local Input = {
|
||||
Mouse = Player:GetMouse(),
|
||||
Speed = 0,
|
||||
Simulating = false,
|
||||
|
||||
Configuration = {
|
||||
DefaultSpeed = 1,
|
||||
|
|
@ -252,38 +251,46 @@ end
|
|||
-- end
|
||||
-- end
|
||||
|
||||
-- Check if we are running on a touch device
|
||||
function Chat:IsTouchDevice()
|
||||
local touchEnabled = false
|
||||
pcall(function()
|
||||
touchEnabled = Game:GetService("UserInputService").TouchEnabled
|
||||
end)
|
||||
return touchEnabled
|
||||
end
|
||||
|
||||
-- Scrolling
|
||||
-- function Chat:ScrollQueue(value)
|
||||
-- for i = 1, #self.MessageQueue do
|
||||
-- if self.MessageQueue[i] then
|
||||
-- for _, label in pairs(self.MessageQueue[i]) do
|
||||
-- local next = self.MessageQueue[i].Next
|
||||
-- local previous = self.MessageQueue[i].Previous
|
||||
-- if
|
||||
-- label and label:IsA "TextLabel" or label:IsA "TextButton"
|
||||
-- then
|
||||
-- if value > 0 and previous and previous.Message then
|
||||
-- label.Position = previous["Message"].Position
|
||||
-- elseif value < 1 and next.Message then
|
||||
-- label.Position = previous["Message"].Position
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
function Chat:ScrollQueue(value)
|
||||
for i = 1, #self.MessageQueue do
|
||||
if self.MessageQueue[i] then
|
||||
for _, label in pairs(self.MessageQueue[i]) do
|
||||
local Next = self.MessageQueue[i + 1]
|
||||
local Previous = self.MessageQueue[i - 1]
|
||||
if
|
||||
label
|
||||
and type(label) == "userdata" -- until i figure out what's going on
|
||||
and (label:IsA "TextLabel" or label:IsA "TextButton")
|
||||
then
|
||||
print(
|
||||
"scrolling",
|
||||
value,
|
||||
"|",
|
||||
Previous,
|
||||
"|",
|
||||
Previous and Previous.message or "none",
|
||||
"|",
|
||||
Next,
|
||||
"|",
|
||||
Next and Next.message or "none"
|
||||
)
|
||||
-- if value > 0 and Previous and Previous.Message then
|
||||
-- -- label.Position = previous.Message.Position
|
||||
-- label.Position += UDim2.new(0, 0, 1, 0)
|
||||
-- elseif value < 1 and Next.Message then
|
||||
-- -- label.Position = previous.Message.Position
|
||||
-- label.Position -= UDim2.new(0, 0, 1, 0)
|
||||
-- end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Handles the rendering of the text objects in their appropriate places
|
||||
function Chat:UpdateQueue(field, diff)
|
||||
print "Updating queue"
|
||||
-- Have to do some sort of correction here
|
||||
for i = #self.MessageQueue, 1, -1 do
|
||||
if self.MessageQueue[i] then
|
||||
|
|
@ -356,15 +363,15 @@ function Chat:CheckIfInBounds(value)
|
|||
if
|
||||
value > 0
|
||||
and Chat.MessageQueue[1]
|
||||
and Chat.MessageQueue[1]["Player"]
|
||||
and Chat.MessageQueue[1]["Player"].Position.Y.Scale == 0
|
||||
and Chat.MessageQueue[1].Player
|
||||
and Chat.MessageQueue[1].Player.Position.Y.Scale == 0
|
||||
then
|
||||
return true
|
||||
elseif
|
||||
value < 0
|
||||
and Chat.MessageQueue[1]
|
||||
and Chat.MessageQueue[1]["Player"]
|
||||
and Chat.MessageQueue[1]["Player"].Position.Y.Scale < 0
|
||||
and Chat.MessageQueue[1].Player
|
||||
and Chat.MessageQueue[1].Player.Position.Y.Scale < 0
|
||||
then
|
||||
return true
|
||||
end
|
||||
|
|
@ -376,7 +383,7 @@ end
|
|||
function Chat:ComputeSpaceString(pLabel)
|
||||
local nString = " "
|
||||
if not self.TempSpaceLabel then
|
||||
self.TempSpaceLabel = Create "TextButton" {
|
||||
self.TempSpaceLabel = New "TextButton" {
|
||||
Size = UDim2.new(
|
||||
0,
|
||||
pLabel.AbsoluteSize.X,
|
||||
|
|
@ -427,31 +434,24 @@ function Chat:UpdateChat(cPlayer, message)
|
|||
end
|
||||
|
||||
-- function Chat:RecalculateSpacing()
|
||||
--[[for i = 1, #self.MessageQueue do
|
||||
local pLabel = self.MessageQueue[i]['Player']
|
||||
local mLabel = self.MessageQueue[i]['Message']
|
||||
-- for i = 1, #self.MessageQueue do
|
||||
-- local pLabel = self.MessageQueue[i].Player
|
||||
-- local mLabel = self.MessageQueue[i].Message
|
||||
|
||||
local prevYScale = mLabel.Size.Y.Scale
|
||||
local prevText = mLabel.Text
|
||||
mLabel.Text = prevText
|
||||
-- local prevYScale = mLabel.Size.Y.Scale
|
||||
-- local prevText = mLabel.Text
|
||||
-- mLabel.Text = prevText
|
||||
|
||||
local heightField = mLabel.TextBounds.Y
|
||||
-- local heightField = mLabel.TextBounds.Y
|
||||
|
||||
mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0)
|
||||
pLabel.Size = mLabel.Size
|
||||
-- mLabel.Size =
|
||||
-- UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0)
|
||||
-- pLabel.Size = mLabel.Size
|
||||
|
||||
local diff = mLabel.Size.Y.Scale - prevYScale
|
||||
-- local diff = mLabel.Size.Y.Scale - prevYScale
|
||||
|
||||
Chat:UpdateQueue(self.MessageQueue[i], diff)
|
||||
end ]]
|
||||
-- Chat:UpdateQueue(self.MessageQueue[i], diff)
|
||||
-- end
|
||||
|
||||
-- function Chat:ApplyFilter(str)
|
||||
-- --[[for _, word in pair(self.Filter_List) do
|
||||
-- if string.find(str, word) then
|
||||
-- str:gsub(word, '@#$^')
|
||||
-- end
|
||||
-- end ]]
|
||||
-- end
|
||||
|
||||
-- NOTE: Temporarily disabled ring buffer to allow for chat to always wrap around
|
||||
|
|
@ -469,43 +469,42 @@ function Chat:CreateMessage(cPlayer, message)
|
|||
-- If we ever hit the mark, which would be in every popular game btw
|
||||
-- we wrap around and reuse the labels
|
||||
if #self.MessageQueue > self.Configuration.HistoryLength then
|
||||
--[[pLabel = self.MessageQueue[#self.MessageQueue]["Player"]
|
||||
mLabel = self.MessageQueue[#self.MessageQueue]["Message"]
|
||||
-- pLabel = self.MessageQueue[#self.MessageQueue].Player
|
||||
-- mLabel = self.MessageQueue[#self.MessageQueue].Message
|
||||
|
||||
pLabel.Text = `{pName}:`
|
||||
pLabel.Name = pName
|
||||
-- pLabel.Text = `{pName}:`
|
||||
-- pLabel.Name = pName
|
||||
|
||||
local pColor
|
||||
if cPlayer.Neutral then
|
||||
pLabel.TextColor3 = Chat:ComputeChatColor(pName)
|
||||
else
|
||||
pLabel.TextColor3 = cPlayer.TeamColor.Color
|
||||
end
|
||||
-- if cPlayer.Neutral then
|
||||
-- pLabel.TextColor3 = Chat:ComputeChatColor(pName)
|
||||
-- else
|
||||
-- pLabel.TextColor3 = cPlayer.TeamColor.Color
|
||||
-- end
|
||||
|
||||
local nString
|
||||
-- local nString
|
||||
|
||||
if not self.CachedSpaceStrings_List[pName] then
|
||||
nString = Chat:ComputeSpaceString(pLabel)
|
||||
else
|
||||
nString = self.CachedSpaceStrings_List[pName]
|
||||
end
|
||||
-- if not self.CachedSpaceStrings_List[pName] then
|
||||
-- nString = Chat:ComputeSpaceString(pLabel)
|
||||
-- else
|
||||
-- nString = self.CachedSpaceStrings_List[pName]
|
||||
-- end
|
||||
|
||||
mLabel.Text = ""
|
||||
mLabel.Name = `{pName} - message`
|
||||
mLabel.Text = nString .. message
|
||||
-- mLabel.Text = ""
|
||||
-- mLabel.Name = `{pName} - message`
|
||||
-- mLabel.Text = nString .. message
|
||||
|
||||
mLabel.Parent = nil
|
||||
mLabel.Parent = self.RenderFrame
|
||||
-- mLabel.Parent = nil
|
||||
-- mLabel.Parent = self.RenderFrame
|
||||
|
||||
mLabel.Position = UDim2.new(0, 0, 1, 0)
|
||||
pLabel.Position = UDim2.new(0, 0, 1, 0)]]
|
||||
-- mLabel.Position = UDim2.new(0, 0, 1, 0)
|
||||
-- pLabel.Position = UDim2.new(0, 0, 1, 0)
|
||||
|
||||
-- Reinserted at the beginning, ring buffer
|
||||
self.MessageQueue[#self.MessageQueue] = nil
|
||||
end
|
||||
--else
|
||||
-- Haven't hit the mark yet, so keep creating
|
||||
pLabel = Create "TextLabel" {
|
||||
pLabel = New "TextLabel" {
|
||||
Name = pName,
|
||||
Text = `{pName}:`,
|
||||
-- TextColor3 = pColor,
|
||||
|
|
@ -537,7 +536,7 @@ function Chat:CreateMessage(cPlayer, message)
|
|||
nString = self.CachedSpaceStrings_List[pName]
|
||||
end
|
||||
|
||||
mLabel = Create "TextLabel" {
|
||||
mLabel = New "TextLabel" {
|
||||
Name = `{pName} - message`,
|
||||
-- Max is 3 lines
|
||||
Size = UDim2.new(1, 0, 0.5, 0),
|
||||
|
|
@ -580,10 +579,11 @@ function Chat:CreateMessage(cPlayer, message)
|
|||
UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0)
|
||||
pLabel.Size = mLabel.Size
|
||||
|
||||
local queueField = {}
|
||||
queueField.Player = pLabel
|
||||
queueField.Message = mLabel
|
||||
queueField.SpawnTime = tick() -- Used for identifying when to make the message invisible
|
||||
local queueField = {
|
||||
Player = pLabel,
|
||||
Message = mLabel,
|
||||
SpawnTime = tick(), -- Used for identifying when to make the message invisible
|
||||
}
|
||||
|
||||
table.insert(self.MessageQueue, 1, queueField)
|
||||
Chat:UpdateQueue(queueField)
|
||||
|
|
@ -631,7 +631,7 @@ function Chat:CreateSafeChatOptions(list, rootButton)
|
|||
rootButton = rootButton or self.SafeChatButton
|
||||
for msg, _ in pairs(list) do
|
||||
if type(msg) == "string" then
|
||||
local chatText = Create "TextButton" {
|
||||
local chatText = New "TextButton" {
|
||||
Name = msg,
|
||||
Text = msg,
|
||||
Size = UDim2.new(0, 100, 0, 20),
|
||||
|
|
@ -682,13 +682,13 @@ function Chat:CreateSafeChatOptions(list, rootButton)
|
|||
end
|
||||
|
||||
function Chat:CreateSafeChatGui()
|
||||
self.SafeChatFrame = Create "Frame" {
|
||||
self.SafeChatFrame = New "Frame" {
|
||||
Name = "SafeChatFrame",
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Parent = self.Gui,
|
||||
BackgroundTransparency = 1,
|
||||
|
||||
Create "ImageButton" {
|
||||
New "ImageButton" {
|
||||
Name = "SafeChatButton",
|
||||
Size = UDim2.new(0, 44, 0, 31),
|
||||
Position = UDim2.new(0, 1, 0.35, 0),
|
||||
|
|
@ -721,21 +721,21 @@ end
|
|||
|
||||
-- For touch devices we create a button instead
|
||||
function Chat:CreateTouchButton()
|
||||
self.ChatTouchFrame = Create "Frame" {
|
||||
self.ChatTouchFrame = New "Frame" {
|
||||
Name = "ChatTouchFrame",
|
||||
Size = UDim2.new(0, 128, 0, 32),
|
||||
Position = UDim2.new(0, 88, 0, 0),
|
||||
BackgroundTransparency = 1,
|
||||
Parent = self.Gui,
|
||||
|
||||
Create "ImageButton" {
|
||||
New "ImageButton" {
|
||||
Name = "ChatLabel",
|
||||
Size = UDim2.new(0, 74, 0, 28),
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
BackgroundTransparency = 1,
|
||||
ZIndex = 2.0,
|
||||
},
|
||||
Create "ImageLabel" {
|
||||
New "ImageLabel" {
|
||||
Name = "Background",
|
||||
Size = UDim2.new(1, 0, 1, 0),
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
|
|
@ -746,7 +746,7 @@ function Chat:CreateTouchButton()
|
|||
self.TapToChatLabel = self.ChatTouchFrame.ChatLabel
|
||||
self.TouchLabelBackground = self.ChatTouchFrame.Background
|
||||
|
||||
self.ChatBar = Create "TextBox" {
|
||||
self.ChatBar = New "TextBox" {
|
||||
Name = "ChatBar",
|
||||
Size = UDim2.new(1, 0, 0.2, 0),
|
||||
Position = UDim2.new(0, 0, 0.8, 800),
|
||||
|
|
@ -778,7 +778,7 @@ function Chat:CreateChatBar()
|
|||
return GuiService.UseLuaChat
|
||||
end)
|
||||
if forceChatGUI or (status and result) then
|
||||
self.ClickToChatButton = Create "TextButton" {
|
||||
self.ClickToChatButton = New "TextButton" {
|
||||
Name = "ClickToChat",
|
||||
Size = UDim2.new(1, 0, 0, 20),
|
||||
BackgroundTransparency = 1,
|
||||
|
|
@ -791,7 +791,7 @@ function Chat:CreateChatBar()
|
|||
FontSize = Enum.FontSize.Size12,
|
||||
}
|
||||
|
||||
self.ChatBar = Create "TextBox" {
|
||||
self.ChatBar = New "TextBox" {
|
||||
Name = "ChatBar",
|
||||
Size = UDim2.new(1, 0, 0, 20),
|
||||
Position = UDim2.new(0, 0, 1, 0),
|
||||
|
|
@ -814,7 +814,7 @@ function Chat:CreateChatBar()
|
|||
if not success then
|
||||
GuiService:SetGlobalSizeOffsetPixel(0, -20)
|
||||
end
|
||||
-- CHatHotKey is '/'
|
||||
-- ChatHotKey is '/'
|
||||
GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey)
|
||||
GuiService.SpecialKeyPressed:connect(function(key)
|
||||
if key == Enum.SpecialKey.ChatHotkey then
|
||||
|
|
@ -832,7 +832,7 @@ end
|
|||
-- Done only once
|
||||
function Chat:CreateGui()
|
||||
self.Gui = WaitForChild(CoreGuiService, "RobloxGui")
|
||||
self.Frame = Create "Frame" {
|
||||
self.Frame = New "Frame" {
|
||||
Name = "ChatFrame",
|
||||
--Size = self.Configuration.Size;
|
||||
Size = UDim2.new(0, 500, 0, 120),
|
||||
|
|
@ -843,7 +843,7 @@ function Chat:CreateGui()
|
|||
Parent = self.Gui,
|
||||
Active = false,
|
||||
|
||||
Create "ImageLabel" {
|
||||
New "ImageLabel" {
|
||||
Name = "Background",
|
||||
Image = "http://banland.xyz/asset/?id=97120937", --96551212';
|
||||
Size = UDim2.new(1.3, 0, 1.64, 0),
|
||||
|
|
@ -853,7 +853,7 @@ function Chat:CreateGui()
|
|||
Visible = false,
|
||||
},
|
||||
|
||||
Create "Frame" {
|
||||
New "Frame" {
|
||||
Name = "Border",
|
||||
Size = UDim2.new(1, 0, 0, 1),
|
||||
Position = UDim2.new(0, 0, 0.8, 0),
|
||||
|
|
@ -863,7 +863,7 @@ function Chat:CreateGui()
|
|||
Visible = false,
|
||||
},
|
||||
|
||||
Create "Frame" {
|
||||
New "Frame" {
|
||||
Name = "ChatRenderFrame",
|
||||
Size = UDim2.new(1.02, 0, 1.01, 0),
|
||||
Position = UDim2.new(0, 0, 0, 0),
|
||||
|
|
@ -882,10 +882,7 @@ function Chat:CreateGui()
|
|||
end)
|
||||
|
||||
self.RenderFrame = self.Frame.ChatRenderFrame
|
||||
if Chat:IsTouchDevice() then
|
||||
self.Frame.Position = self.Configuration.Position
|
||||
self.RenderFrame.Size = UDim2.new(1, 0, 1, 0)
|
||||
elseif self.Frame.AbsoluteSize.Y > 120 then
|
||||
if self.Frame.AbsoluteSize.Y > 120 then
|
||||
Chat:ScreenSizeChanged()
|
||||
self.Gui.Changed:connect(function(property)
|
||||
if property == "AbsoluteSize" then
|
||||
|
|
@ -895,35 +892,19 @@ function Chat:CreateGui()
|
|||
end
|
||||
|
||||
if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then
|
||||
if Chat:IsTouchDevice() then
|
||||
Chat:CreateTouchButton()
|
||||
else
|
||||
Chat:CreateChatBar()
|
||||
-- Chat:CreateSafeChatGui()
|
||||
end
|
||||
|
||||
if self.ChatBar then
|
||||
self.ChatBar.FocusLost:connect(function(enterPressed)
|
||||
Chat.GotFocus = false
|
||||
if Chat:IsTouchDevice() then
|
||||
self.ChatBar.Visible = false
|
||||
self.TapToChatLabel.Visible = true
|
||||
|
||||
if self.TouchLabelBackground then
|
||||
self.TouchLabelBackground.Visible = true
|
||||
end
|
||||
end
|
||||
if enterPressed and self.ChatBar.Text ~= "" then
|
||||
local cText = self.ChatBar.Text
|
||||
if string.sub(self.ChatBar.Text, 1, 1) == "%" then
|
||||
cText = "(TEAM) " .. string.sub(cText, 2, #cText)
|
||||
pcall(function()
|
||||
PlayersService:TeamChat(cText)
|
||||
end)
|
||||
pcall(PlayersService.TeamChat, PlayersService, cText)
|
||||
else
|
||||
pcall(function()
|
||||
PlayersService:Chat(cText)
|
||||
end)
|
||||
pcall(PlayersService.Chat, PlayersService, cText)
|
||||
end
|
||||
|
||||
if self.ClickToChatButton then
|
||||
|
|
@ -932,7 +913,7 @@ function Chat:CreateGui()
|
|||
self.ChatBar.Text = ""
|
||||
end
|
||||
Spawn(function()
|
||||
wait(5.0)
|
||||
wait(5)
|
||||
if not Chat.GotFocus then
|
||||
Chat.Frame.Background.Visible = false
|
||||
end
|
||||
|
|
@ -965,15 +946,13 @@ function Input:OnMouseScroll()
|
|||
if Chat:CheckIfInBounds(Input.Speed) then
|
||||
return
|
||||
end
|
||||
-- Chat:ScrollQueue()
|
||||
Chat:ScrollQueue(Input.Speed)
|
||||
end
|
||||
|
||||
function Input:ApplySpeed(value)
|
||||
Input.Speed += value
|
||||
if not self.Simulating then
|
||||
Input:OnMouseScroll()
|
||||
end
|
||||
end
|
||||
|
||||
function Input:Initialize()
|
||||
self.Mouse.WheelBackward:connect(function()
|
||||
|
|
@ -1080,7 +1059,7 @@ function Chat:CoreGuiChanged(coreGuiType, enabled)
|
|||
self.Frame.Visible = enabled
|
||||
end
|
||||
|
||||
if not Chat:IsTouchDevice() and self.ChatBar then
|
||||
if self.ChatBar then
|
||||
self.ChatBar.Visible = enabled
|
||||
if enabled then
|
||||
GuiService:SetGlobalGuiInset(0, 0, 0, 20)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
||||
local RenderModule = require "../Modules/Render.luau"
|
||||
local New = (require "../Modules/New").New
|
||||
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation
|
||||
|
||||
local player =
|
||||
|
|
@ -18,12 +19,13 @@ local CameraAngle = player.Character.Head.CFrame
|
|||
local CameraPosition = CameraAngle
|
||||
+ CFrame.Angles(0, math.pi, 0).lookVector.unit * 2.75
|
||||
|
||||
local Camera = Instance.new "Camera"
|
||||
Camera.Name = "ThumbnailCamera"
|
||||
Camera.CameraType = Enum.CameraType.Scriptable
|
||||
Camera.CoordinateFrame = CFrame.new(CameraPosition.p, CameraAngle.p)
|
||||
Camera.FieldOfView = 52.5
|
||||
Camera.Parent = player.Character
|
||||
local Camera = New "Camera" {
|
||||
Name = "ThumbnailCamera",
|
||||
CameraType = Enum.CameraType.Scriptable,
|
||||
CoordinateFrame = CFrame.new(CameraPosition.p, CameraAngle.p),
|
||||
FieldOfView = 52.5,
|
||||
Parent = player.Character,
|
||||
}
|
||||
workspace.CurrentCamera = Camera
|
||||
|
||||
local clickHead = ThumbnailGenerator:Click("PNG", 300, 300, true)
|
||||
|
|
|
|||
Loading…
Reference in New Issue