Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ______________________________________________________________________________functions.cs
- //Fact Window
- package RoleplayClient
- {
- function setGuiPanel(%this, %panel) {
- CharacterCreation_FactCharacterCreator.visible = false;
- CharacterCreation_FactCharacterEditor.visible = false;
- %panelObj = ("CharacterCreation_" @ %panel @ "Panel");
- if (isObject(%panelObj)) {
- %panelObj.visible = true;
- }
- } //turn off things
- //Character things
- function addnewCharacter() //add a new char to roster and save it
- {
- %name = CharacterCreation_newnamebox.getvalue();
- %desc = CharacterCreation_newdescbox.getvalue();
- CharacterCreation_Roster.insertAfter(%rowcount, %name); //puts char on roster after the last one made
- $Client::RPMod::Name[%client.getBLID()] = %name; export("$Client::RPMod::Name*", "config/Client/RPData.cs");
- $Client::RPMod::Desc[%client.getBLID()] = %desc; export("$Client::RPMod::Desc*", "config/Client/RPData.cs"); //basically just saving the info so it doesnt get lost
- CharacterCreation_FactCharacterCreator.visible = false;
- }
- function EditCharacter() //load a character u wanna edit
- {
- CharacterCreation_EditButton.visible = false;
- %name = CharacterCreation_Roster.getSelectedRow.getValue(); //might not work lol
- CharacterCreation_EditName.setValue(%name);
- %desc = $Pref::Client::Desc[%name]; //Reminder to save this way too
- CharacterCreation_EditDesc.setvalue(%desc);
- }
- function SaveEdited() //save a character u edited
- {
- %name = CharacterCreation_EditName.getvalue();
- %desc = CharacterCreation_EditDesc.getvalue();
- $Client::RPMod::Desc[%name] = %desc; export("$Client::RPMod::Name*", "config/client/RPData.cs");
- $Client::RPMod::Name[%name] = %name; export("$Client::RPMod::Desc*", "config/client/RPData.cs");
- CharacterCreation_EditButton.visible = true;
- CharacterCreation_FactCharacterEditor.visible = false;
- }
- function Loadchar() //load a selected character
- {
- %name = CharacterCreation_Roster.getSelectedRow.getValue();
- %desc = $Pref::Client::Desc[%name];
- serverCmdSetRPChar(%name, %desc);
- $Client::RPMod::Last[%client.getBLID] = %name; export("$Client::RPMod::Last*", "config/Client/RPData.cs"); //save previously loaded char
- }
- function LoadPrev() //load last used character
- {
- %name = $Client::RPMod::Last[%client.getBLID];
- %desc = $Client::RPMod::Desc[%name];
- serverCmdSetRPChar(%name, %desc);
- }
- //Roster stuff
- function GuiTextListCtrl::insertAfter(%this, %index, %value) {
- %count = %this.rowCount();
- if (%index >= %count - 1) {
- %this.addRow(%count, %value);
- }
- else {
- %index++;
- %previousRow = %this.getRowText(%index);
- for (%i = %index; %i < %count; %i++) {
- if (%i == %index) {
- %this.setRow(%i, %value);
- }
- else {
- %currentRow = %this.getRowText(%i);
- %this.setRow(%i, %previousRow);
- %previousRow = %currentRow;
- }
- }
- %this.addRow(%count, %previousRow);
- }
- }
- function GuiTextListCtrl::getSelectedRow(%this) {
- %id = %this.getSelectedId();
- return %this.getRowNumById(%id);
- }
- function GuiTextListCtrl::setRow(%this, %index, %value) {
- %id = %this.getRowId(%index);
- if (%id == -1) {
- %this.addRow(%this.rowCount(), %value);
- }
- else {
- %this.setRowById(%id, %value);
- }
- }
- }; //end of package
- activatePackage(RoleplayClient);
- _______________________________________________________________________________________________GUI FILE
- //--- OBJECT WRITE BEGIN ---
- new GuiControl(CharacterCreation) {
- profile = "GuiDefaultProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "0 0";
- extent = "1024 640";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- new GuiWindowCtrl(Fact) {
- profile = "GuiWindowProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "181 180";
- extent = "534 311";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "Fact";
- maxLength = "255";
- resizeWidth = "1";
- resizeHeight = "1";
- canMove = "1";
- canClose = "1";
- canMinimize = "1";
- canMaximize = "1";
- minSize = "50 50";
- new GuiControl(FactCharMenu) {
- profile = "GuiDefaultProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 24";
- extent = "523 281";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- new GuiControl(FactCharacterCreator) {
- profile = "GuiDefaultProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "17 60";
- extent = "283 207";
- minExtent = "8 2";
- enabled = "1";
- visible = "0";
- clipToParent = "1";
- new GuiTextEditCtrl(newnamebox) {
- profile = "GuiTextEditProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "83 19";
- extent = "165 21";
- minExtent = "165 21";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- maxLength = "255";
- historySize = "0";
- password = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- };
- new GuiTextCtrl() {
- profile = "GuiMediumTextProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 15";
- extent = "60 28";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "Name:";
- maxLength = "255";
- };
- new GuiTextCtrl() {
- profile = "GuiMediumTextProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 65";
- extent = "112 28";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "Description:";
- maxLength = "255";
- };
- new GuiTextEditCtrl(newdescbox) {
- profile = "GuiTextEditProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 101";
- extent = "256 62";
- minExtent = "256 62";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "This box is for PHYSICAL DETAIL only!";
- maxLength = "255";
- historySize = "0";
- password = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- };
- new GuiBitmapButtonCtrl() {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "120 171";
- extent = "140 30";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "addnewCharacter();";
- text = "Save Attributes";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button1";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "255 255 255 255";
- };
- };
- new GuiScrollCtrl() {
- profile = "GuiScrollProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "344 58";
- extent = "154 200";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- willFirstRespond = "0";
- hScrollBar = "alwaysOn";
- vScrollBar = "alwaysOn";
- constantThumbHeight = "0";
- childMargin = "0 0";
- rowHeight = "40";
- columnWidth = "30";
- new GuiTextListCtrl(Roster) {
- profile = "GuiTextListProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "1 1";
- extent = "137 2";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- enumerate = "0";
- resizeCell = "1";
- columns = "0";
- fitParentWidth = "1";
- clipColumnText = "0";
- };
- };
- new GuiBitmapButtonCtrl() {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "23 11";
- extent = "139 40";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "setGuiPanel(\"FactCharacterCreator\");";
- text = "Create New";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button2";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "255 255 128 255";
- };
- new GuiBitmapButtonCtrl() {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "186 11";
- extent = "139 40";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "LoadPrev();";
- text = "Load Previous";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button2";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "124 233 241 255";
- };
- new GuiBitmapButtonCtrl() {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "350 11";
- extent = "139 40";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "Loadchar();";
- text = "Load Character";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button2";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "138 255 128 255";
- };
- new GuiControl(FactCharacterEditor) {
- profile = "GuiDefaultProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "17 60";
- extent = "283 207";
- minExtent = "8 2";
- enabled = "1";
- visible = "0";
- clipToParent = "1";
- new GuiTextEditCtrl() {
- profile = "GuiTextEditProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "83 19";
- extent = "165 21";
- minExtent = "165 21";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "";
- maxLength = "255";
- historySize = "0";
- password = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- };
- new GuiTextCtrl() {
- profile = "GuiMediumTextProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 15";
- extent = "60 28";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "Name:";
- maxLength = "255";
- };
- new GuiTextCtrl() {
- profile = "GuiMediumTextProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 65";
- extent = "112 28";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- text = "Description:";
- maxLength = "255";
- };
- new GuiTextEditCtrl() {
- profile = "GuiTextEditProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "5 101";
- extent = "256 62";
- minExtent = "256 62";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "";
- maxLength = "255";
- historySize = "0";
- password = "0";
- tabComplete = "0";
- sinkAllKeyEvents = "0";
- };
- new GuiBitmapButtonCtrl() {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "120 171";
- extent = "140 30";
- minExtent = "8 2";
- enabled = "1";
- visible = "1";
- clipToParent = "1";
- command = "SaveEdited();";
- text = "Save Attributes";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button1";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "255 255 255 255";
- };
- };
- new GuiBitmapButtonCtrl(EditButton) {
- profile = "BlockButtonProfile";
- horizSizing = "right";
- vertSizing = "bottom";
- position = "186 73";
- extent = "140 30";
- minExtent = "8 2";
- enabled = "1";
- visible = "0";
- clipToParent = "1";
- command = "EditCharacter();";
- text = "Edit Selected Char";
- groupNum = "-1";
- buttonType = "PushButton";
- bitmap = "base/client/ui/button1";
- lockAspectRatio = "0";
- alignLeft = "0";
- alignTop = "0";
- overflowImage = "0";
- mKeepCached = "0";
- mColor = "255 255 255 255";
- };
- };
- };
- };
- //--- OBJECT WRITE END ---
- function pushcreategui(%Gui)
- {
- %Gui = canvas.pushDialog(CharacterCreation);
- }
- ________________________________________________________________________________________Client.cs
- exec("./CharacterCreation.gui");
- exec("./functions.cs");
- moveMap.bind(keyboard, "g", pushcreategui);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement