wiki.sine.space | sinespace

Scripting/SUI

From wiki.sine.space
Revision as of 17:23, 14 August 2021 by Voidtech (Talk | contribs)

Jump to: navigation, search

Contents

Members

OpenAppearanceEditor

void OpenAppearanceEditor ()

Opens the Appearance Editor (Outfit)

Space.UI.OpenAppearanceEditor()


AddNotification

void AddNotification (string title, string text)

Shows a notification

 Space.UI.AddNotification('Warning','This is a notification')


AddGlobalActionButton

void AddGlobalActionButton (string button, string tooltip, closure action)

Adds a "Global Action Button" which is a custom button you add to the UI that calls an action of your choice then clears after being clicked

gbClick = function()
  Space.Log("global action button pressed")
  end
  Space.UI.AddGlobalActionButton("The Button","The Tooltip", gbClick)


ClearGlobalActionButton

void ClearGlobalActionButton (string button)

Clears a previously added Global Action Button 'button'

 Space.UI.ClearGlobalActionButton("The Button")


ShowLocation

void ShowLocation (string reason, SVector location)

Shows given location

 Space.UI.ShowLocation("the reason", Vector.New(5,1,0))


ShowPathToLocation

void ShowPathToLocation (string reason, SVector location)

Shows a path to given location

 Space.UI.ShowPathToLocation("the reason", Vector.New(5,1,0))


OpenQuestsWindow

void OpenQuestsWindow ()

Opens the Quests window

Space.UI.OpenQuestsWindow()


HideQuestsWindow

void HideQuestsWindow ()

Hides the Quests window

Space.UI.HideQuestsWindow()


OpenSettingsWindow

void OpenSettingsWindow ()

Opens the Settings window

Space.UI.OpenSettingsWindow()


HideSettingsWindow

void HideSettingsWindow ()

Hides the Settings window

Space.UI.HideSettingsWindow()


OpenFriendsWindow

void OpenFriendsWindow ()

Opens the Friends window

Space.UI.OpenFriendsWindow()


HideFriendsWindow

void HideFriendsWindow ()

Hides the Friends window

Space.UI.HideFriendsWindow()


OpenExploreWindow

void OpenExploreWindow ()

Opens the Explore window

Space.UI.OpenExploreWindow()


HideExploreWindow

void HideExploreWindow ()

Hides the Explore window

Space.UI.HideExploreWindow()


OpenEventsWindow

void OpenEventsWindow ()

Opens the Events window

Space.UI.OpenEventsWindow()


HideEventsWindow

void HideEventsWindow ()

Hides the Events window

Space.UI.HideEventsWindow()


OpenHomeWindow

void OpenHomeWindow ()

Opens the Home window

Space.UI.OpenHomeWindow()


HideHomeWindow

void HideHomeWindow ()

Hides the Home window

Space.UI.HideHomeWindow()


OpenInventoryWindow

void OpenInventoryWindow ()

Opens the Inventory window

Space.UI.OpenInventoryWindow()


HideInventoryWindow

void HideInventoryWindow ()

Hides the Inventory window

Space.UI.HideInventoryWindow()


OpenOutfitWindow

void OpenOutfitWindow ()

Opens the Outfit window

Space.UI.OpenOutfitWindow()


HideOutfitWindow

void HideOutfitWindow ()

Hides the Outfit window

Space.UI.HideOutfitWindow()


OpenShopWindow

void OpenShopWindow ()

Opens the Shop window

Space.UI.OpenShopWindow()


HideShopWindow

void HideShopWindow ()

Hides the Shop window

Space.UI.HideShopWindow()


OpenSnapshotWindow

void OpenSnapshotWindow ()

Opens the Snapshot window

Space.UI.OpenSnapshotWindow()


HideSnapshotWindow

void HideSnapshotWindow ()

Hides the Snapshot window

Space.UI.HideSnapshotWindow()


OpenHelpWindow

void OpenHelpWindow ()

Opens the Help window

Space.UI.OpenHelpWindow()


HideHelpWindow

void HideHelpWindow ()

Hides the Help window

Space.UI.HideHelpWindow()


OpenProfileWin

void OpenProfileWin ()

Opens the Profile window

Space.UI.OpenProfileWin()


HideProfileWin

void HideProfileWin ()

Hides the Profile window

Space.UI.HideProfileWin()


OpenUpgradeAccountWindow

void OpenUpgradeAccountWindow ()

Opens the Upgrade Account window

Space.UI.OpenUpgradeAccountWindow()


HideUpgradeAccountWindow

void HideUpgradeAccountWindow ()

Hides the Upgrade Account window

Space.UI.HideUpgradeAccountWindow()


OpenRegionInfoWindow

void OpenRegionInfoWindow ()

Opens the Region Info window

Space.UI.OpenRegionInfoWindow()


HideRegionInfoWindow

void HideRegionInfoWindow ()

Hides the Region Info window

Space.UI.HideRegionInfoWindow()


OpenExitWindow

void OpenExitWindow ()

Opens the Exit window

Space.UI.OpenExitWindow()


HideExitWindow

void HideExitWindow ()

Hides the Exit window

Space.UI.HideExitWindow()


OpenMailWindow

void OpenMailWindow ()

Opens the Mail window

Space.UI.OpenMailWindow()


HideMailWindow

void HideMailWindow ()

Hides the Mail window

Space.UI.HideMailWindow()


OpenBuyGoldWindow

void OpenBuyGoldWindow ()

Opens the Buy Gold window

Space.UI.OpenBuyGoldWindow()


HideBuyGoldWindow

void HideBuyGoldWindow ()

Hides the Buy Gold window

Space.UI.HideBuyGoldWindow()


OpenChatWindow

void OpenChatWindow ()

Opens the Chat window

Space.UI.OpenChatWindow()


HideChatWindow

void HideChatWindow ()

Hides the Chat window

Space.UI.HideChatWindow()


OpenRoomEditorWindow

void OpenRoomEditorWindow ()

Opens the Room Editor window

Space.UI.OpenRoomEditorWindow()


HideRoomEditorWindow

void HideRoomEditorWindow ()

Hides the Room Editor window

Space.UI.HideRoomEditorWindow()


OpenDevicePicker

void OpenDevicePicker ()

Opens the Device Picker

Space.UI.OpenDevicePicker()


Raycast

SUIRaycastResult Raycast ()

Shoots a UI Raycast and returns the result as SUIRayCastResult

RayCastResult= Space.UI.Raycast()



Properties

ShowAuctionButton

bool ShowAuctionButton { get; set; }

Show the Auction button

Space.UI.ShowAuctionButton = false


--This script will make a UI Toggle show/hide the Auction Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowAuctionButton = true
  else
    Space.UI.ShowAuctionButton = false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowChat

bool ShowChat { get; set; }

Show the Chat

Space.UI.ShowChat = false


--This script will make a UI Toggle show/hide the Chat
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowChat= true
  else
    Space.UI.ShowChat= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowCurrencyButton

bool ShowCurrencyButton { get; set; }

Show the Currency button

Space.UI.ShowCurrencyButton = false


--This script will make a UI Toggle show/hide the Currency Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowCurrencyButton= true
  else
    Space.UI.ShowCurrencyButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowExploreButton

bool ShowExploreButton { get; set; }

Show the Explore button

Space.UI.ShowExploreButton = false


--This script will make a UI Toggle show/hide the Explore Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowExploreButton = true
  else
    Space.UI.ShowExploreButton = false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowFriendsButton

bool ShowFriendsButton { get; set; }

Show the Friends button

Space.UI.ShowFriendsButton = false


--This script will make a UI Toggle show/hide the Friends Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowFriendsButton = true
  else
    Space.UI.ShowFriendsButton = false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowHelpButton

bool ShowHelpButton { get; set; }

Show the Help button

Space.UI.ShowHelpButton = false


--This script will make a UI Toggle show/hide the Help Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowHelpButton= true
  else
    Space.UI.ShowHelpButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowHomeButton

bool ShowHomeButton { get; set; }

Show the Home button

Space.UI.ShowHomeButton = false


--This script will make a UI Toggle show/hide the Home Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowHomeButton= true
  else
    Space.UI.ShowHomeButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowHotBar

bool ShowHotBar { get; set; }

Show the Hot Bar

Space.UI.ShowHotBar = false


--This script will make a UI Toggle show/hide the Hot Bar
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowHotBar= true
  else
    Space.UI.ShowHotBar= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowInventoryButton

bool ShowInventoryButton { get; set; }

Show the Inventory button

Space.UI.ShowInventoryButton = false


--This script will make a UI Toggle show/hide the Inventory Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowInventoryButton= true
  else
    Space.UI.ShowInventoryButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowMiniMap

bool ShowMiniMap { get; set; }

Set to true to show the Minimap

Space.UI.ShowMiniMap = false


--This script will make a UI Toggle show/hide the Minimap
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowMiniMap= true
  else
    Space.UI.ShowMiniMap= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowOutfitButton

bool ShowOutfitButton { get; set; }

Set to true to show the Outfit button

Space.UI.ShowOutfitButton = false


--This script will make a UI Toggle show/hide the Outfit Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowOutfitButton= true
  else
    Space.UI.ShowOutfitButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowQuestsButton

bool ShowQuestsButton { get; set; }

Show the Quests button

Space.UI.ShowQuestsButton = false


--This script will make a UI Toggle show/hide the Quests button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowQuestsButton= true
  else
    Space.UI.ShowQuestsButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowShopButton

bool ShowShopButton { get; set; }

Show the Shop button

Space.UI.ShowShopButton = false


--This script will make a UI Toggle show/hide the Shop Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowShopButton= true
  else
    Space.UI.ShowShopButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowSnapshotButton

bool ShowSnapshotButton { get; set; }

Show the Snapshot button

Space.UI.ShowSnapshotButton = false


ShowUI

bool ShowUI { get; set; }

Show the User Interface

Space.UI.ShowUI = false


--This script will make a UI Toggle show/hide the  User Interface
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowUI= true
  else
    Space.UI.ShowUI= false
  end
end

toggle.OnValueChanged(OnValueChanged)


ShowWorldUI

bool ShowWorldUI { get; set; }

Show the World User Interface

Space.UI.ShowUI = false


MusicVolume

int MusicVolume { get; set; }

Set/Get the Music volume

MusicVolume= Space.UI.MusicVolume


--This script will make moving a slider control the Music Volume
--and also update a text field with the current Music Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.MusicVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MusicVolume
end

slider.OnValueChanged(OnValueChanged)

MasterVolume

int MasterVolume { get; set; }

Set/Get the Master volume

MasterVolume= Space.UI.MasterVolume


--This script will make moving a slider control the Master Volume
--and also update a text field with the current Master Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.MasterVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.MasterVolume
end

slider.OnValueChanged(OnValueChanged)

SFXVolume

int SFXVolume { get; set; }

Set/Get the SFX volume

SFXVolume= Space.UI.SFXVolume


--This script will make moving a slider control the SFX Volume
--and also update a text field with the current SFX Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.SFXVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.SFXVolume
end

slider.OnValueChanged(OnValueChanged)

UIVolume

int UIVolume { get; set; }

Set/Get the UI volume

UIVolume= Space.UI.UIVolume


--This script will make moving a slider control the UI Volume
--and also update a text field with the current UI Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.UIVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.UIVolume
end

slider.OnValueChanged(OnValueChanged)

VOIPVolume

int VOIPVolume { get; set; }

Set/Get the VOIP volume

VOIPVolume = Space.UI.VOIPVolume


 --This script will make moving a slider control the Voice Volume
--and also update a text field with the current Voice Volume
--(example: custom UI)
--[You need to add the slider and text field as a reference]

slider = Space.Host.GetReference("Slider").UISlider
textField = Space.Host.GetReference("Text Field").UIText


OnValueChanged = function()
Space.UI.VOIPVolume = slider.NormalizedValue * 100
textField.Text = Space.UI.VOIPVolume
end

slider.OnValueChanged(OnValueChanged) 

ShowEventsButton

bool ShowEventsButton { get; set; }

Show the Events button

Space.UI.ShowEventsButton= false


--This script will make a UI Toggle show/hide the  Events button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowEventsButton= true
  else
    Space.UI.ShowEventsButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowGoldAndBuyButton

bool ShowGoldAndBuyButton { get; set; }

Show the Gold and Buy button

Space.UI.ShowGoldAndBuyButton= false


--This script will make a UI Toggle show/hide the Gold and Buy button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowGoldAndBuyButton= true
  else
    Space.UI.ShowGoldAndBuyButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowClock

bool ShowClock { get; set; }

Show the clock

Space.UI.ShowClock= false


--This script will make a UI Toggle show/hide the Clock
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowClock= true
  else
    Space.UI.ShowClock= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowActivityPanel

bool ShowActivityPanel { get; set; }

Show the Activity Panel

Space.UI.ShowActivityPanel= false


--This script will make a UI Toggle show/hide the Activity Panel
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowActivityPanel= true
  else
    Space.UI.ShowActivityPanel= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowProfileImage

bool ShowProfileImage { get; set; }

Show the Profile Image

Space.UI.ShowProfileImage= false


--This script will make a UI Toggle show/hide the Profile Image
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowProfileImage= true
  else
    Space.UI.ShowProfileImage= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowRightButtonGroup

bool ShowRightButtonGroup { get; set; }

Show the Button group on the right

Space.UI.ShowRightButtonGroup= false


ShowRoomInfoOption

bool ShowRoomInfoOption { get; set; }

Show the Room Info Option

Space.UI.ShowRoomInfoOption= false


ShowSearch

bool ShowSearch { get; set; }

Show the Search bar

Space.UI.ShowSearch= false


--This script will make a UI Toggle show/hide the Search Bar
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowSearch= true
  else
    Space.UI.ShowSearch= false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowMailButton

bool ShowMailButton { get; set; }

Show the Mail button

Space.UI.ShowMailButton= false


--This script will make a UI Toggle show/hide the Mail Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowMailButton = true
  else
    Space.UI.ShowMailButton = false
  end
end

toggle.OnValueChanged(OnValueChanged)

ShowNotificationButton

bool ShowNotificationButton { get; set; }

Show the Notification button

Space.UI.ShowNotificationButton= false


 --This script will make a UI Toggle show/hide the Notification Button
--(example: tools for user to customize UI)
--[You need to add an object with UI Toggle as a reference (scripting runtime)]

toggle = Space.Host.GetReference("Toggle").UIToggle


OnValueChanged = function()
  if toggle.IsOn then
    Space.UI.ShowNotificationButton= true
  else
    Space.UI.ShowNotificationButton= false
  end
end

toggle.OnValueChanged(OnValueChanged)