TABLE OF CONTENTS
- 1. Utils/UUI
- 1.1. UUI/UUI.CreateCommands
- 1.2. UUI/UUI.Travel_Array
- 1.3. UUI/UUI.Add_Command
- 1.4. UUI/UUI.Add_Commands
- 1.5. UUI/UUI.Delete_Widgets
- 1.6. UUI/UUI.Get_Skill_Marks
- 1.7. UUI/UUI.Minutes_To_Date
- 1.8. UUI/UUI.Set_Fonts
- 1.9. UUI/UUI.Show_Inventory_Item_Info
- 1.10. UUI/UUI.Show_Screen
- 1.11. UUI/UUI.Travel_Info
- 1.12. UUI/UUI.Update_Messages
- 1.13. UUI/UUI.Get_String_Command
- 1.14. UUI/UUI.Process_Question_Command
- 1.15. UUI/UUI.Set_Destination_Command
- 1.16. UUI/UUI.Set_Scrollbar_Bindings_Command
- 1.17. UUI/UUI.Set_Text_Variable_Command
- 1.18. UUI/UUI.Show_On_Map_Command
Utils/UUI [ Packages ]
[ Top ] [ Utils ] [ Packages ]
FUNCTION
Provide various code for GUI
SOURCE
package Utils.UI is
UUI/UUI.CreateCommands [ Types ]
FUNCTION
Used to add new Tcl commands to interpreter
SOURCE
package CreateCommands is new Tcl.Ada.Generic_Command (ClientData => Integer);
UUI/UUI.Travel_Array [ Types ]
FUNCTION
The values returned by Travel_Info function: ETA and fuel usage
SOURCE
type Travel_Array is array(1 .. 2) of Natural;
UUI/UUI.Add_Command [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Add the selected command to Tcl interpreter
SOURCE
procedure Add_Command (Name: String; Ada_Command: not null CreateCommands.Tcl_CmdProc) with Pre => Name'Length > 0;
PARAMETERS
Name - The name of the command which will be used in Tcl Ada_Command - Ada function which will be invoked
UUI/UUI.Add_Commands [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Add various, UI related Tcl commands
SOURCE
procedure Add_Commands;
UUI/UUI.Delete_Widgets [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Remove widgets from the selected frame
SOURCE
procedure Delete_Widgets (Start_Index, End_Index: Integer; Frame: Tk_Widget'Class);
PARAMETERS
Start_Index - The first row from which widgets will be removed End_Index - The last row in which widgets will be removed Frame - The fram from which widgets will be removed
HISTORY
5.9 - Added
UUI/UUI.Get_Skill_Marks [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Get the marks for the selected skill for the selected crew member
SOURCE
function Get_Skill_Marks (Skill_Index: Skills_Amount_Range; Member_Index: Positive) return String with Pre => Skill_Index <= Skills_Amount and Member_Index <= Player_Ship.Crew.Last_Index;
PARAMETERS
Skill_Index - The index of the skill which will be checked Member_Index - The index of the player ship crew member which will be checked
RESULT
If the crew member don't have the selected skill, empty String, if have the skill, " +", if the skill is the highest in the crew, " ++"
HISTORY
6.7 - Added
UUI/UUI.Minutes_To_Date [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Convert minutes to game date and add it to text
SOURCE
procedure Minutes_To_Date (Minutes: Natural; Info_Text: in out Unbounded_String);
PARAMETERS
Minutes - Amount of minutes to convert Info_Text - Text to which time info will be added
RESULT
Parameter InfoText
UUI/UUI.Set_Fonts [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Set all the game fonts to the selected size
SOURCE
procedure Set_Fonts(New_Size: Positive; Font_Type: Font_Types);
PARAMETERS
New_Size - The new size of the selected font's type Font_Type - The type of the font
HISTORY
7.1 - Added
UUI/UUI.Show_Inventory_Item_Info [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Show info about selected item in ship cargo or crew member inventory
SOURCE
procedure Show_Inventory_Item_Info (Parent: String; Item_Index: Positive; Member_Index: Natural; Button_1, Button_2: Button_Settings := Empty_Button_Settings) with Pre => Member_Index <= Player_Ship.Crew.Last_Index and Parent'Length > 0;
PARAMETERS
Parent - The name of the parent widget Item_Index - Index of item (can be inventory or ship cargo) Member_Index - If item is in crew member inventory, crew index of member, otherwise 0 Button_1 - The settings for the first optional button. If empty, the button will not show. Default value is empty. Button_2 - The setting for the second optional button. If empty, the button will not show. Default value is empty.
UUI/UUI.Show_Screen [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Remove an old screen from the window and add a new to it
SOURCE
procedure Show_Screen(New_Screen_Name: String) with Pre => New_Screen_Name'Length > 0;
PARAMETERS
NewScreenName - Part of th name of the new Ttk_Frame to add
UUI/UUI.Travel_Info [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Count the ETA and fuel usage for the selected distance
SOURCE
function Travel_Info(Distance: Positive) return Travel_Array;
PARAMETERS
Distance - Distance in map fields to destination point
RESULT
The array with two values, the first is estimated time to travel the distance, the second is the amount of fuel needed to travel the distance.
HISTORY
9.1 - Changed into function and removed parameters
UUI/UUI.Update_Messages [ Subprograms ]
[ Top ] [ UUI ] [ Subprograms ]
FUNCTION
Update game messages
SOURCE
procedure Update_Messages;
UUI/UUI.Set_Destination_Command [ Commands ]
FUNCTION
Set the selected map point as the player's ship destination
SOURCE
function Set_Destination_Command (Client_Data: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C;
PARAMETERS
Client_Data - Custom data send to the command. Unused Interp - Tcl interpreter in which command was executed. Argc - Number of arguments passed to the command. Unused Argv - Values of arguments passed to the command.
RESULT
This function always return TCL_OK
COMMANDS
SetDestination X Y X is the x coordinate of point to set, Y is the y coordinate of point to set
UUI/UUI.Show_On_Map_Command [ Commands ]
FUNCTION
Show the selected point on map
SOURCE
function Show_On_Map_Command (Client_Data: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C;
PARAMETERS
Client_Data - Custom data send to the command. Unused Interp - Tcl interpreter in which command was executed. Argc - Number of arguments passed to the command. Unused Argv - Values of arguments passed to the command.
RESULT
This function always return TCL_OK
COMMANDS
ShowOnMap X Y X is the x coordinate of point to show, Y is the y coordinate of point to show