Skip to content
AlphaGaming7780 edited this page Mar 25, 2024 · 1 revision

ExtendedRadio

Event

CallOnRadioLoad

This event is called after the mod load the custom radio and radio add-ons. You can use it like this :

ExtendedRadio.ExtendedRadio.CallOnRadioLoad += FunctionToCall;

CustomRadios

Method

Note

I named some method using a paterne.

  • All the "convert" method use this paterne.
    The Paterne : SomethingToSomething
    Example : JsonToRadioChannel
    In this example I convert a "Json" to the RadioChannel component/element

Note

In the name of the method you will find both Radio and RadioChannel, this is two different things.

  • Radio: Is used when it converts/creates an entire radio, which creates a RadioChannel with all programs and segments inside.
  • RadioChannel: Is used when it converts/create a RadioChannel component/element, there is no program inside.

RegisterCustomRadioDirectory

This method add your CustomRadio directory to the a List. ExtendedRadio loop inside this list and load all the radio/network inside your folder.

Example :

ExtendedRadio.CustomRadios.RegisterCustomRadioDirectory(path)

Arguments :

  • path : String : The path to your custom radio directory, Example of value : Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)+"\\CustomRadios"

AddRadioNetworkToTheGame

This method let you add a RadioNetwork to the game. This function need to be called during the CallOnRadioLoad event.

Example :

ExtendedRadio.CustomRadios.AddRadioNetworkToTheGame(radioNetwork);

Arguments :

  • radioNetwork : RadioNetwork : The radio network you want to add into the game.

Return :

  • true : If the RadioNetwork is added correctly.
  • false : Failed to add the RadioNetwork, because it already exists.

AddRadioChannelToTheGame

This method let you add a RadioChannel to the game. This function need to be called during the CallOnRadioLoad event.

Example :

ExtendedRadio.CustomRadios.AddRadioChannelToTheGame(radioChannel);

Arguments :

  • radioChannel : RadioChannel : The radio channel you want to add into the game.

Return :

  • true : If the RadioChannel is added correctly.
  • false : Failed to add the RadioChannel, because it already exists.

JsonToRadio

This method create a radio channel with all is program and segment.

Example :

ExtendedRadio.CustomRadios.JsonToRadio(path, radioNetworkName);

Arguments :

  • path : String : The path of the folder that contain the RadioChannel.json file.
  • radioNetworkName : String : (OPTIONAL) The name of the Network this radio should be in, it override the info inside the RadioChannel.json and Segment.json.

Return : a RadioChannel.

JsonToRadioNetwork

This method create a radio network from is Json file.

Example :

ExtendedRadio.CustomRadios.JsonToRadioNetwork(path);

Arguments :

  • path : String : The path of the folder that contain the RadioNetwork.json file.

Return : a RadioNetwork.

JsonToRadioChannel

This method create a radio channel from is Json file.

Example :

ExtendedRadio.CustomRadios.JsonToRadioChannel(path);

Arguments :

  • path : String : The path of the folder that contain the RadioChannel.json file.

Return : a RadioChannel.

JsonToProgram

This method create a Program from is Json file.

Example :

ExtendedRadio.CustomRadios.JsonToProgram(path);

Arguments :

  • path : String : The path of the folder that contain the Program.json file.

Return : a Program.

JsonToSegment

This method create a Segment from is Json file.

Example :

ExtendedRadio.CustomRadios.JsonToSegment(path);

Arguments :

  • path : String : The path of the folder that contain the Segment.json file.

Return : a Segment.