Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tla241219 #34

Merged
merged 9 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Configs/Default.focfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DeadHitPoints = -20
BagRefreshTime = 60 # Real minutes
WisperDist = 2
ShoutDist = 400
RegistrationTimeout = 300 # In real seconds, 0 to disable
RegistrationTimeout = 0 # In real seconds, 0 to disable
AccountPlayTime = 600 # In real seconds, 0 to disable
TalkDistance = 3
NpcMaxTalkers = 1
Expand Down
1 change: 1 addition & 0 deletions Critters/Gordon.focr
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SkillEnergyWeapons = 81
SkillUnarmed = 6
SkillMeleeWeapons = 16
SkillThrowing = 32
SkillBarter = 50

$Text russ = Гордон
$Text engl = Gordon
4 changes: 3 additions & 1 deletion Dialogs/repl_terminal.fodlg
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ lang=russ engl
{1000}{}{Initial preferences}
{1010}{}{---}
{2000}{}{Terminal for operations on replicative account welcomes you.
Select the type of operation.}
Select the type of operation.

Replication account balance: @lex total@}
{2010}{}{[Replenish your account]}
{2020}{}{[Withdraw money from account]}
{2030}{}{[Replenish account of another customer]}
Expand Down
38 changes: 19 additions & 19 deletions Gui/Barter.fogui
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": true,
"Selected": false,
"Selected": true,
"Active": true,
"Name": "Barter",
"Position": "0, 0",
Expand All @@ -23,10 +23,10 @@
"IsNotHittable": false,
"CheckTransparentOnHit": false,
"GlobalScope": null,
"ClassFields": "ident CritterId;\r\n\r\nstring GetItemsInfoStr( int collection )\r\n{\r\n uint weight = 0;\r\n uint volume = 0;\r\n uint cost = 0;\r\n \r\n Item@[] @ items = ClientItems::RefreshItemsCollection( collection );\r\n for( uint i = 0; i < items.length(); i++ )\r\n cost += items[ i ].Cost * items[ i ].Count;\r\n \r\n return \"$\" + cost;\r\n}",
"ClassFields": "ident CritterId;\r\n\r\nstring GetItemsInfoStr( int collection )\r\n{\r\n uint weight = 0;\r\n uint volume = 0;\r\n uint cost = 0;\r\n \r\n Item@[] @ items = ClientItems::RefreshItemsCollection( collection );\r\n for( uint i = 0; i < items.length(); i++ )\r\n cost += items[ i ].Cost * items[ i ].Count;\r\n \r\n return \"$\" + cost;\r\n}\r\n\r\nvoid SetDialogText(string msg)\r\n{\r\n auto panel = FindPanel(\"DiscPanel\");\r\n auto text = panel.FindText( \"DescText\" );\r\n if(text != null)\r\n {\r\n text.SetText( msg );\r\n }\r\n}",
"OnInit": null,
"OnShow": "CritterId = params[ \"CritterId\" ];",
"OnHide": null,
"OnHide": "ClientItems::RefreshItemsCollection(ITEMS_INVENTORY);",
"OnAppear": null,
"OnDisappear": null,
"OnDraw": null,
Expand All @@ -42,7 +42,7 @@
"OnRMouseClick": null,
"OnMouseMove": null,
"OnGlobalMouseDown": null,
"OnGlobalMouseUp": null,
"OnGlobalMouseUp": "",
"OnGlobalMousePressed": null,
"OnGlobalMouseClick": null,
"OnGlobalMouseMove": null,
Expand Down Expand Up @@ -323,9 +323,9 @@
{
"$type": "ItemView",
"UserData": null,
"UserDataExt": null,
"UserDataExt": "ITEMS_BARTER",
"UseSorting": true,
"OnGetItems": null,
"OnGetItems": "Item[] items = ClientItems::RefreshItemsCollection( UserDataExt );\r\n\r\nreturn items;",
"OnCheckItem": "return int( 0x7FFF + item.SortValue );",
"CellPrototype": "\".ImageChosen\"",
"GridSize": "3",
Expand Down Expand Up @@ -502,9 +502,9 @@
{
"$type": "ItemView",
"UserData": null,
"UserDataExt": null,
"UserDataExt": "ITEMS_BARTER_OFFER",
"UseSorting": true,
"OnGetItems": null,
"OnGetItems": "Item[] items = ClientItems::RefreshItemsCollection( UserDataExt );\r\nGame.Log(\"refreshing items \" + UserDataExt);\r\nreturn items;",
"OnCheckItem": "return int( 0x7FFF + item.SortValue );",
"CellPrototype": "\".ImageChosen\"",
"GridSize": "4",
Expand Down Expand Up @@ -685,7 +685,7 @@
"CropContent": false,
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "ImageChosen",
Expand All @@ -707,7 +707,7 @@
"OnPostDraw": null,
"OnMove": null,
"OnMouseDown": null,
"OnMouseUp": null,
"OnMouseUp": "",
"OnMousePressed": "",
"OnLMousePressed": null,
"OnRMousePressed": null,
Expand All @@ -725,7 +725,7 @@
"OnActiveChanged": null,
"OnFocusChanged": null,
"OnHoverChanged": null,
"OnDragChanged": null,
"OnDragChanged": "",
"OnResizeGrid": "SetPosition( 0, 0 );",
"OnDrawItem": "SetDraggable( item !is null );\r\nhstring picInv;\r\nif( item !is null )\r\n picInv = item.PicInv;\r\nBackgroundImage.Load( picInv );",
"Children": [
Expand Down Expand Up @@ -955,9 +955,9 @@
{
"$type": "ItemView",
"UserData": null,
"UserDataExt": null,
"UserDataExt": "ITEMS_BARTER_OPPONENT",
"UseSorting": true,
"OnGetItems": null,
"OnGetItems": "Item[] items = ClientItems::RefreshItemsCollection( UserDataExt );\r\n\r\nreturn items;",
"OnCheckItem": "return int( 0x7FFF + item.SortValue );",
"CellPrototype": "\".ImageOther\"",
"GridSize": "3",
Expand Down Expand Up @@ -1134,9 +1134,9 @@
{
"$type": "ItemView",
"UserData": null,
"UserDataExt": null,
"UserDataExt": "ITEMS_BARTER_OPPONENT_OFFER",
"UseSorting": true,
"OnGetItems": null,
"OnGetItems": "Item[] items = ClientItems::RefreshItemsCollection( UserDataExt );\r\n\r\nreturn items;",
"OnCheckItem": "return int( 0x7FFF + item.SortValue );",
"CellPrototype": "\".ImageOther\"",
"GridSize": "4",
Expand Down Expand Up @@ -1317,7 +1317,7 @@
"CropContent": false,
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "ImageOther",
Expand Down Expand Up @@ -1435,7 +1435,7 @@
"NormalColor": "COLOR_WHITE",
"FocusedColor": null,
"Expanded": false,
"Selected": true,
"Selected": false,
"Active": true,
"Name": "CostOtherOffer",
"Position": "9, 170",
Expand Down Expand Up @@ -1522,7 +1522,7 @@
"OnLMousePressed": null,
"OnRMousePressed": null,
"OnMouseClick": null,
"OnLMouseClick": "Game.CustomCall( \"BarterOffer\" );",
"OnLMouseClick": "ClientItems::BarterOffer();",
"OnRMouseClick": null,
"OnMouseMove": null,
"OnGlobalMouseDown": null,
Expand Down Expand Up @@ -1720,4 +1720,4 @@
]
}
]
}
}
22 changes: 11 additions & 11 deletions Gui/Dialog.fogui
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": true,
"Selected": true,
"Selected": false,
"Active": true,
"Name": "Dialog",
"Position": "0, 0",
Expand All @@ -22,11 +22,11 @@
"IsDraggable": false,
"IsNotHittable": false,
"CheckTransparentOnHit": false,
"GlobalScope": null,
"GlobalScope": "string[]@ SplitParams(string param)\r\n{\r\n return cast< string[]@ >(param.split( \"\\n\" ));\r\n}",
"ClassFields": "bool TalkerIsNpc;\r\nident TalkerId;\r\nstring Text;\r\nstring[] Answers = {};\r\nuint TalkTime;\r\nuint TalkStartTick;",
"OnInit": null,
"OnShow": "TalkerIsNpc = params[ \"TalkerIsNpc\" ];\r\nTalkerId = params[ \"TalkerId\" ];\r\nText = params[ \"Text\" ];\r\n// Todo: restore gui Answers = cast< string[]@ >( params[ \"Answers\" ] );\r\nTalkTime = params[ \"TalkTime\" ];\r\nTalkStartTick = Game.GetTick();",
"OnHide": null,
"OnShow": "TalkerIsNpc = params[ \"TalkerIsNpc\" ];\r\nTalkerId = params[ \"TalkerId\" ];\r\nText = params[ \"Text\" ];\r\nAnswers = SplitParams(params[ \"Answers\" ]);\r\nTalkTime = params[ \"TalkTime\" ];\r\nTalkStartTick = Game.GetTick();",
"OnHide": " Game.HideScreen(CLIENT_SCREEN_BARTER);",
"OnAppear": null,
"OnDisappear": null,
"OnDraw": null,
Expand Down Expand Up @@ -172,7 +172,7 @@
"CropContent": true,
"IsVerticalScroll": true,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "SpeechPanel",
Expand Down Expand Up @@ -287,7 +287,7 @@
"CropContent": true,
"IsVerticalScroll": true,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "AnswersGrid",
Expand Down Expand Up @@ -405,7 +405,7 @@
"CropContent": false,
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "BarterButton",
Expand Down Expand Up @@ -523,8 +523,8 @@
"CropContent": false,
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Selected": false,
"Expanded": true,
"Selected": true,
"Active": true,
"Name": "SayButton",
"Position": "589, 211",
Expand All @@ -550,7 +550,7 @@
"OnLMousePressed": null,
"OnRMousePressed": null,
"OnMouseClick": null,
"OnLMouseClick": " dict<string, any> dict = {};\r\n dict[ \"TalkerIsNpc\" ] = cast<Dialog>(Parent).TalkerIsNpc ? \"1\" : \"0\";\r\n dict[ \"TalkerId\" ] = \"\" + cast<Dialog>(Parent).TalkerId;\r\n dict[ \"TalkStartTick\" ] = \"\" + cast<Dialog>(Parent).TalkStartTick;\r\n dict[\"FromDialog\"] = \"1\";\r\n Game.ShowScreen( CLIENT_SCREEN_SAY, dict );",
"OnLMouseClick": " dict<string, any> dict = {};\r\n dict[ \"TalkerIsNpc\" ] = cast<Dialog>(Parent).TalkerIsNpc ? \"1\" : \"0\";\r\n dict[ \"TalkerId\" ] = \"\" + cast<Dialog>(Parent).TalkerId;\r\n dict[ \"TalkStartTick\" ] = \"\" + cast<Dialog>(Parent).TalkStartTick;\r\n dict[\"FromDialog\"] = true;\r\n Game.ShowScreen( CLIENT_SCREEN_SAY, dict );",
"OnRMouseClick": null,
"OnMouseMove": null,
"OnGlobalMouseDown": null,
Expand Down Expand Up @@ -745,4 +745,4 @@
"Children": []
}
]
}
}
4 changes: 2 additions & 2 deletions Gui/Preview.fogui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"IsNotHittable": false,
"CheckTransparentOnHit": false,
"GlobalScope": null,
"ClassFields": "ident PreviewCritterId;\r\nident PreviewItemId;\r\nbool ItemInInv = false;\r\nint ItemsCollection = ITEMS_CHOSEN_ALL;\r\nSprite::Sprite spr = Sprite::Sprite();\r\nint CurDir = 0;\r\nuint LastDirChangeTick = 0;",
"ClassFields": "ident PreviewCritterId;\r\nident PreviewItemId;\r\nbool ItemInInv = false;\r\nClientItems::Collection ItemsCollection = ClientItems::Collection::ChosenAll;\r\nSprite::Sprite spr = Sprite::Sprite();\r\nint CurDir = 0;\r\nuint LastDirChangeTick = 0;",
"OnInit": "SetSize( Parent.Width, Parent.Height );\r\nCurDir = 0;\r\nLastDirChangeTick = Game.GetTick();",
"OnShow": "if( PreviewCritterId == ZERO_IDENT && PreviewItemId == ZERO_IDENT )\r\n{\r\n Critter@ chosen = Game.GetChosen();\r\n PreviewCritterId = ( chosen !is null ? chosen.Id : ZERO_IDENT );\r\n}",
"OnHide": null,
Expand Down Expand Up @@ -49,4 +49,4 @@
"OnResizeGrid": null,
"OnDrawItem": null,
"Children": []
}
}
14 changes: 7 additions & 7 deletions Gui/Split.fogui
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": true,
"Selected": false,
"Selected": true,
"Active": true,
"Name": "Split",
"Position": "0, 0",
Expand All @@ -23,7 +23,7 @@
"IsNotHittable": false,
"CheckTransparentOnHit": false,
"GlobalScope": "",
"ClassFields": "ident TargetItemId;\r\nuint SplitCount;\r\nint ItemsCollection;\r\n\r\nItem@ GetTargetItem()\r\n{\r\n Item@[]@ items = ClientItems::RefreshItemsCollection( ItemsCollection );\r\n for( uint i = 0; i < items.length(); i++ )\r\n if( items[ i ].Id == TargetItemId )\r\n return items[ i ];\r\n return null;\r\n}",
"ClassFields": "ident TargetItemId;\r\nuint SplitCount;\r\nint ItemsCollection;\r\n\r\nItem@ GetTargetItem()\r\n{\r\n Item@[]@ items = ClientItems::RefreshItemsCollection( ItemsCollection );\r\n for( uint i = 0; i < items.length(); i++ )\r\n if( items[ i ].Id == TargetItemId )\r\n return items[ i ];\r\n Game.Log(\"item not found\");\r\n return null;\r\n}",
"OnInit": null,
"OnShow": "SplitCount = 1;\r\nTargetItemId = params[ \"TargetItemId\" ];\r\nItemsCollection = params[ \"ItemsCollection\" ];",
"OnHide": null,
Expand Down Expand Up @@ -121,7 +121,7 @@
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Selected": true,
"Selected": false,
"Active": true,
"Name": "ViewItemPanel",
"Position": "17, 46",
Expand All @@ -134,7 +134,7 @@
"GlobalScope": null,
"ClassFields": null,
"OnInit": "GuiScreens::Preview::CreateHierarchy( this );",
"OnShow": "Split@ split = cast< Split >( Screen );\r\nauto@ preview = cast< GuiScreens::Preview::Preview >( GetChild( 0 ) );\r\npreview.PreviewItemId = split.TargetItemId;\r\npreview.ItemInInv = true;\r\npreview.ItemsCollection = split.ItemsCollection;",
"OnShow": "Split@ split = cast< Split >( Screen );\r\nauto@ preview = cast< GuiScreens::Preview::Preview >( GetChild( 0 ) );\r\npreview.PreviewItemId = split.TargetItemId;\r\npreview.ItemInInv = true;\r\npreview.ItemsCollection = ClientItems::GetCollectionFromType(split.ItemsCollection);",
"OnHide": null,
"OnAppear": null,
"OnDisappear": null,
Expand Down Expand Up @@ -355,7 +355,7 @@
"CropContent": false,
"IsVerticalScroll": false,
"IsHorizontalScroll": false,
"Expanded": false,
"Expanded": true,
"Selected": false,
"Active": true,
"Name": "MaxCountButton",
Expand Down Expand Up @@ -500,7 +500,7 @@
"OnLMousePressed": null,
"OnRMousePressed": null,
"OnMouseClick": null,
"OnLMouseClick": "Split@ split = cast< Split >( Screen );\r\nItem@ item = split.GetTargetItem();\r\nif( item !is null )\r\n{\r\n if( split.SplitCount > item.Count )\r\n {\r\n split.SplitCount = item.Count;\r\n return;\r\n }\r\n \r\n if( split.ItemsCollection == ITEMS_CHOSEN_ALL )\r\n {\r\n ChosenActions::SetChosenActions( array< any > = { Tla::ChosenMoveItem, item.Id, split.SplitCount, CritterItemSlot::Outside, 0, 0, 0 } );\r\n }\r\n else if( split.ItemsCollection == ITEMS_PICKUP || split.ItemsCollection == ITEMS_PICKUP_FROM )\r\n {\r\n ChosenActions::SetChosenActions( array< any > = { Tla::ChosenMoveItemCont, item.Id, split.ItemsCollection, split.SplitCount, 0, 0, 0 } );\r\n }\r\n else if( split.ItemsCollection == ITEMS_BARTER || split.ItemsCollection == ITEMS_BARTER_OFFER ||\r\n split.ItemsCollection == ITEMS_BARTER_OPPONENT || split.ItemsCollection == ITEMS_BARTER_OPPONENT_OFFER )\r\n {\r\n Game.CustomCall( \"BarterMoveItem \" + split.TargetItemId + \" \" + split.ItemsCollection + \" \" + split.SplitCount );\r\n }\r\n}\r\nGame.HideScreen();",
"OnLMouseClick": "Split@ split = cast< Split >( Screen );\r\nItem@ item = split.GetTargetItem();\r\n Game.Log(\"Calling barter close! collection \" + split.ItemsCollection + \"; split.SplitCount \" + split.SplitCount );\r\nif( item !is null )\r\n{\r\n Game.Log(\"Item not null/ Count: \" + item.Count);\r\n if( split.SplitCount > item.Count )\r\n {\r\n split.SplitCount = item.Count;\r\n return;\r\n }\r\n \r\n if( split.ItemsCollection == ITEMS_CHOSEN_ALL )\r\n {\r\n ChosenActions::SetChosenActions( array< any > = { Tla::ChosenMoveItem, item.Id, split.SplitCount, CritterItemSlot::Outside, 0, 0, 0 } );\r\n }\r\n else if( split.ItemsCollection == ITEMS_PICKUP || split.ItemsCollection == ITEMS_PICKUP_FROM )\r\n {\r\n ChosenActions::SetChosenActions( array< any > = { Tla::ChosenMoveItemCont, item.Id, split.ItemsCollection, split.SplitCount, 0, 0, 0 } );\r\n }\r\n else if( split.ItemsCollection == ITEMS_BARTER || split.ItemsCollection == ITEMS_BARTER_OFFER ||\r\n split.ItemsCollection == ITEMS_BARTER_OPPONENT || split.ItemsCollection == ITEMS_BARTER_OPPONENT_OFFER )\r\n {\r\n Game.Log(\"Calling barter transfer!\");\r\n ClientItems::BarterTransfer(split.TargetItemId, split.ItemsCollection, split.SplitCount);\r\n //Game.CustomCall( \"BarterMoveItem \" + split.TargetItemId + \" \" + split.ItemsCollection + \" \" + split.SplitCount );\r\n }\r\n}\r\nGame.HideScreen();",
"OnRMouseClick": null,
"OnMouseMove": null,
"OnGlobalMouseDown": null,
Expand Down Expand Up @@ -578,4 +578,4 @@
"Children": []
}
]
}
}
2 changes: 1 addition & 1 deletion Items/Static/generic_2147.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
IsNoBlock = True
IsLightThru = True
IsColorize = True
ColorizeColor = 0x7f000000
PicMap = art/scenery/VWIN01.FRM
LightColor = 0x7f000000
Type = Generic
IsStatic = True
IsScenery = True
Expand Down
2 changes: 1 addition & 1 deletion Items/Static/generic_2148.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
IsNoBlock = True
IsLightThru = True
IsColorize = True
ColorizeColor = 0x7f000000
PicMap = art/scenery/VWIN02.FRM
LightColor = 0x7f000000
Type = Generic
IsStatic = True
IsScenery = True
Expand Down
2 changes: 1 addition & 1 deletion Items/Static/generic_2149.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
IsNoBlock = True
IsLightThru = True
IsColorize = True
ColorizeColor = 0x7f000000
PicMap = art/scenery/VWIN03.FRM
LightColor = 0x7f000000
Type = Generic
IsStatic = True
IsScenery = True
Expand Down
2 changes: 1 addition & 1 deletion Items/Static/generic_2150.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
IsNoBlock = True
IsLightThru = True
IsColorize = True
ColorizeColor = 0x7f000000
PicMap = art/scenery/VWIN04.FRM
LightColor = 0x7f000000
Type = Generic
IsStatic = True
IsScenery = True
Expand Down
1 change: 1 addition & 0 deletions Items/Static/generic_2489.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ IsLightThru = True
IsShowAnim = True
IsLight = True
IsColorize = True
ColorizeColor = 0x7f00ffff
IsCanLook = True
PicMap = art/scenery/FFIELD01.FRM
LightDistance = 3
Expand Down
1 change: 1 addition & 0 deletions Items/Static/generic_2490.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ IsLightThru = True
IsShowAnim = True
IsLight = True
IsColorize = True
ColorizeColor = 0x7f00ffff
IsCanLook = True
PicMap = art/scenery/FFIELD03.FRM
LightDistance = 3
Expand Down
1 change: 1 addition & 0 deletions Items/Static/generic_2491.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ IsLightThru = True
IsShowAnim = True
IsLight = True
IsColorize = True
ColorizeColor = 0x7f0000ff
IsCanLook = True
PicMap = art/scenery/FFIELD02.FRM
LightDistance = 3
Expand Down
1 change: 1 addition & 0 deletions Items/Static/generic_2492.foitem
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ IsLightThru = True
IsShowAnim = True
IsLight = True
IsColorize = True
ColorizeColor = 0x7f0000ff
IsCanLook = True
PicMap = art/scenery/FFIELD04.FRM
LightDistance = 3
Expand Down
Loading