Skip to content

Commit

Permalink
Added Tips during background loading
Browse files Browse the repository at this point in the history
Skip endorse window and autosaves while left mouse button is pressed,
trying to avoid hangups during drag&drop and other operations reported
in the past
  • Loading branch information
zilav committed Aug 20, 2016
1 parent 3506050 commit 415dc8e
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 1 deletion.
61 changes: 61 additions & 0 deletions EditTips.txt
@@ -0,0 +1,61 @@
All xEdit versions for different games (TES5Edit, FO4Edit, FNVEdit, etc.) are the same executable, you can rename to run in a different game mode
You can run in several game modes from the same xEdit executable by creating different shortcuts with command line parameters like -fo4 -edit
xLODGen LOD generator tools are the same executables as xEdit, you can generate LOD for a worldspace by right clicking on a plugin with world -> Other -> Generate LOD
You can switch between different language strings files in right click -> Other -> Localization -> Language menu (Skyrim and later games)
Add -l:fr command line parameter to use strings files for the specified language by default, where "fr" is the language ID of strings files (Skyrim and later games)
Adding -cp:utf-8 command line parameters adds support for the game languages that use UTF-8 encoding (Skyrim and later games)
A lot of right click menu options don't work while background loader is still running
If xEdit doesn't start saying that ini or Data folder not found, run the game launcher to restore registry settings
If xEdit doesn't ask to save plugin(s) upon exit, it means there were no changes made. Modified record and plugins are highlighted with bold font
Pressing Ctrl+S saves the current plugin to a temp file which will replace the original one when closing xEdit
When xEdit asks you save plugin(s), pressing OK or closing window with X has the same behaviour! You need to actually uncheck plugins you don't want to save
To edit a plugin and test in game without restarting xEdit, create a copy, load it in xEdit and press F5 to save over the original after making changes
xEdit creates backups of modified plugins in "Data\TES5Edit Backups" folder (TES5 is for Skyrim)
Never change master files in TES4 plugin header manually, that will break plugin in majority of cases because internal FormID numbers are tied to this list. Use right click menu options "Add Masters", "Sort Masters" and "Clean Msters" instead
Pressing F2 in the right pane activates inplace editor
Pressing F2 in the left pane allows to change FormID of a record
Filter is always applied to all plugins, so it doesn't matter where you right click
Hold Ctrl or Shift while clicking in the left pane to select several records/plugins at once
You can compare several records of the same type or drag&drop values by selecting them and right click -> Compare selected
You can compare several versions of the same plugin by loading only one of them, right click on it -> Compare to, select the other one
You can copy data from a record to several others by selecting them in the left pane, make sure that the source record to copy from is the last you selected so it is visible in the right pane, then right click on a data node you want to copy in the right pane -> Copy to selected
You can bookmark up to 5 records with Ctrl+1..5 keys and go back with Alt+1..5 keys. Bookmarks are preserved between different xEdit sessions
Holding Ctrl while clicking on FormIDs in the right pane focuses on them
Hold Ctrl and double click on FormID numbers in the messages tab to focus on those records
Hold Shift and double click on text fields in the right pane to open multiline editor
Double click on text fields in the right pane to open multiline viewer
You can drag&drop values in the right pane between different plugins which allows you to copy even whole structures and lists if you drag by the header
To add a new entry to a list in the right pane, right click on list's header top row and select "Add" or press Insert
To make a copy of entry in a list in the right pane, drop&drop it over the list's header
To delete an existing entry from a list in the right pane, right click on entry's header row and select "Remove" or press Delete
To reorder entries in a list in the right pane, right click for "Move Up" and "Move Down" menu options, or press Ctrl+Up and Ctrl+Down
To move records between child groups edit the top row, for example to move REFR from one CELL to another edit the "Cell" top row
To create a new record right click on a group in the left pane and select "Add". To add new group right click on a plugin. To add new plugins, use "Copy as new/override" right click menu
Press Del in the left pane to delete a record or a group of records. You can select several at once for deletion
Some lists are sorted by xEdit internally and you can't change the order of entries in them, for example leveled lists
Holding Alt while expanding a tree in the left pane does full expand. This can take a lot of time when expanding large trees
Press Ctrl+C to copy to clipboard the text of the selected data node in the rigt pane, handy for copying and editing FormIDs
Pressing Ctrl+F3 brings up Assets Browser which allows to quickly find files inside BSA/BA2 archives and Data folder, unpack them or preview in associated application
Pressing Alt+F3 brings up Worldspace Browser which allows to overlay different information over the worldspace LOD map and quickly navigate between exterior cells using right click
Pressing Ctrl+W when a weather record is selected brings up visual weather editor
Holding Shift while clicking OK in plugins selection window disables building of references for all plugins, this speeds up loading but several functions won't work properly like changing FormIDs for example. Cleaning plugins will work though
xEdit has Options window accessible with right click -> Other -> Options menu, where you can change colors, fonts and other settings
xEdit stores all of it's settings in Plugins.XXXviewsettings file located in the same folder as plugins.txt, but if you create ini file with the same name as executable in the same folder (FO4Edit.ini for example), xEdit will use it instead
If you don't see xEdit window after launching, hold Ctrl next time to reset window position
Italic font in the left pane means that those records or other record(s) deeper in the tree are injected. They have FormID load order index of a master file but don't override any records from it
Underlined font in the left pane means that the reference(s) of those records are injected
Red background color in the records tree doesn't mean something bad, it is just an indication that record(s) are overridden by later loaded plugins having different data
xEdit can't load more than 256 plugins at once due to FormID numbers limitation
You can't reorder plugins in xEdit. Games prior to Skyrim (TES4, FO3, FNV) use plugin files dates for ordering, Skyrim and later games use order defined in the plugins.txt file
You can't edit the game master file loaded at index 00. Use "Copy as override" right click menu to create a plugin and make your changes there
"Copy as new" will still add masters to destination plugin if record references anything else from master file(s) or original plugin
Double clicking on a plugin in the plugins selection window loads only this plugin and it's masters
Right click in the plugins selection window to clear selection, invert it or select all
If you don't see anything when browsing records, you forgot to disable "Hide no conflicts rows" right click menu in the right pane
"Stick to" right click menu in the right pane allows to focus on specified data node by default when browsing records instead of the top Record Header
There are left and right arrow buttons in the right upper corner for your browsing history
"Referenced by" tab shows records that link to the selected one. By default references information is not built for the game master and newly created plugins. You can manually build it using right click -> Other -> Build Reference Info menu
Records override each other using "Rule of one", which means the winning record from the last loaded plugin fully discards all data from the previous ones (except for a few rare occasions)
Modgroups feature allows to hide conflicts in selected plugins combinations for easier conflicts resolution. Google "reddit tes5dit modgroups" for more information and examples.
xEdit supports scripting using Pascal language with right click -> Apply Script menu. Dozens of useful scripts are already provided for modding and learning
Please always try the latest xEdit version from Nexus before reporting any issues
1 change: 1 addition & 0 deletions TES5Edit.dproj
Expand Up @@ -132,6 +132,7 @@
<Form>frmLogAnalyzer</Form>
</DCCReference>
<DCCReference Include="frmLODGenForm.pas"/>
<DCCReference Include="frmTipForm.pas"/>
<DCCReference Include="wbDefinitionsFNV.pas"/>
<DCCReference Include="wbDefinitionsFNVSaves.pas"/>
<DCCReference Include="wbDefinitionsFO3.pas"/>
Expand Down
1 change: 1 addition & 0 deletions TES5EditD24.dproj
Expand Up @@ -194,6 +194,7 @@
<Form>frmLogAnalyzer</Form>
</DCCReference>
<DCCReference Include="frmLODGenForm.pas"/>
<DCCReference Include="frmTipForm.pas"/>
<DCCReference Include="wbDefinitionsFNV.pas"/>
<DCCReference Include="wbDefinitionsFNVSaves.pas"/>
<DCCReference Include="wbDefinitionsFO3.pas"/>
Expand Down
1 change: 1 addition & 0 deletions TES5EditXE3.dproj
Expand Up @@ -194,6 +194,7 @@
<Form>frmLogAnalyzer</Form>
</DCCReference>
<DCCReference Include="frmLODGenForm.pas"/>
<DCCReference Include="frmTipForm.pas"/>
<DCCReference Include="wbDefinitionsFNV.pas"/>
<DCCReference Include="wbDefinitionsFO3.pas"/>
<DCCReference Include="wbDefinitionsFO4.pas"/>
Expand Down
1 change: 1 addition & 0 deletions TES5EditXE5.dproj
Expand Up @@ -192,6 +192,7 @@
<Form>frmLogAnalyzer</Form>
</DCCReference>
<DCCReference Include="frmLODGenForm.pas"/>
<DCCReference Include="frmTipForm.pas"/>
<DCCReference Include="wbDefinitionsFNV.pas"/>
<DCCReference Include="wbDefinitionsFO3.pas"/>
<DCCReference Include="wbDefinitionsFO4.pas"/>
Expand Down
1 change: 1 addition & 0 deletions TES5EditXE7.dproj
Expand Up @@ -193,6 +193,7 @@
<Form>frmLogAnalyzer</Form>
</DCCReference>
<DCCReference Include="frmLODGenForm.pas"/>
<DCCReference Include="frmTipForm.pas"/>
<DCCReference Include="wbDefinitionsFNV.pas"/>
<DCCReference Include="wbDefinitionsFO3.pas"/>
<DCCReference Include="wbDefinitionsFO4.pas"/>
Expand Down
9 changes: 9 additions & 0 deletions frmOptionsForm.dfm
Expand Up @@ -170,6 +170,15 @@ object frmOptions: TfrmOptions
Caption = 'Show elements count for group records'
TabOrder = 14
end
object cbShowTip: TCheckBox
Left = 298
Top = 61
Width = 111
Height = 17
Hint = 'Default only track MGEF and game settings'
Caption = 'Show tip on start'
TabOrder = 15
end
end
object tsCleaning: TTabSheet
Caption = 'Cleaning'
Expand Down
1 change: 1 addition & 0 deletions frmOptionsForm.pas
Expand Up @@ -55,6 +55,7 @@ TfrmOptions = class(TForm)
edColumnWidth: TEdit;
edRowHeight: TEdit;
Label6: TLabel;
cbShowTip: TCheckBox;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure cbConflictThisChange(Sender: TObject);
Expand Down
88 changes: 88 additions & 0 deletions frmTipForm.dfm
@@ -0,0 +1,88 @@
object frmTip: TfrmTip
Left = 0
Top = 0
BorderStyle = bsNone
Caption = 'Tip'
ClientHeight = 213
ClientWidth = 534
Color = clWindow
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object Shape1: TShape
Left = 0
Top = 0
Width = 534
Height = 213
Align = alClient
Brush.Color = clWindow
Pen.Color = clWindowText
ExplicitWidth = 550
end
object lblNextTip: TLabel
Left = 470
Top = 182
Width = 34
Height = 13
Cursor = crHandPoint
Caption = 'Next >'
Font.Charset = DEFAULT_CHARSET
Font.Color = clHotLight
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
OnClick = lblNextTipClick
end
object textTip: TStaticText
Left = 24
Top = 56
Width = 488
Height = 113
AutoSize = False
Caption =
'Please always try the latest xEdit version from Nexus before rep' +
'orting any issues'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
ShowAccelChar = False
TabOrder = 0
end
object StaticText1: TStaticText
Left = 24
Top = 18
Width = 34
Height = 27
Caption = 'Tip'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
end
object cbShowTip: TCheckBox
Left = 24
Top = 188
Width = 257
Height = 17
Caption = 'Show tip (you can enable back in Options)'
Checked = True
State = cbChecked
TabOrder = 2
OnClick = cbShowTipClick
end
end
109 changes: 109 additions & 0 deletions frmTipForm.pas
@@ -0,0 +1,109 @@
unit frmTipForm;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, uniGUIBaseClasses, uniGUIClasses, uniLabel;

type
TfrmTip = class(TForm)
Shape1: TShape;
textTip: TStaticText;
StaticText1: TStaticText;
cbShowTip: TCheckBox;
lblNextTip: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure lblNextTipClick(Sender: TObject);
procedure cbShowTipClick(Sender: TObject);
private
{ Private declarations }
slTips: TStringList;
public
{ Public declarations }
procedure NextTip;
end;

var
frmTip: TfrmTip;

procedure ShowTip;
procedure HideTip;

implementation

{$R *.dfm}

uses
wbInterface;

procedure ShowTip;
begin
if not Assigned(frmTip) then begin
frmTip := TfrmTip.Create(Application);
ShowWindow(frmTip.Handle, SW_SHOWNOACTIVATE);
frmTip.Visible := True;
end;
end;

procedure HideTip;
begin
if Assigned(frmTip) then begin
if frmTip.Visible then frmTip.Hide;
FreeAndNil(frmTip);
end;
end;

procedure TfrmTip.NextTip;
begin
if slTips.Count <> 0 then
textTip.Caption := slTips[Random(slTips.Count)];
end;

procedure TfrmTip.lblNextTipClick(Sender: TObject);
begin
NextTip;
end;

procedure TfrmTip.cbShowTipClick(Sender: TObject);
begin
wbShowTip := cbShowTip.Checked;
end;

procedure TfrmTip.FormCreate(Sender: TObject);
var
TipsFile: string;
i: integer;
begin
TipsFile := ExtractFilePath(Application.ExeName) + wbToolName + 'Tips.txt';

try
if not FileExists(TipsFile) then
Exit;

slTips := TStringList.Create;
slTips.LoadFromFile(TipsFile, TEncoding.UTF8);

if slTips.Count = 0 then
Exit;

for i := Pred(slTips.Count) downto 0 do
if Trim(slTips[i]) = '' then
slTips.Delete(i);

NextTip;

except end;
end;

procedure TfrmTip.FormDestroy(Sender: TObject);
begin
if Assigned(slTips) then
slTips.Free;
end;

initialization
Randomize;

end.
Binary file modified frmViewMain.dfm
Binary file not shown.
23 changes: 22 additions & 1 deletion frmViewMain.pas
Expand Up @@ -906,7 +906,8 @@ implementation
frmScriptForm,
frmLogAnalyzerForm,
frmLODGenForm,
frmOptionsForm;
frmOptionsForm,
frmTipForm;

var
NoNodes : TNodeArray;
Expand Down Expand Up @@ -4003,6 +4004,10 @@ procedure TfrmMain.DoInit;
if wbQuickClean then
wbBuildRefs := False;

wbShowTip := Settings.ReadBool('Options', 'ShowTip', wbShowTip);
if wbShowTip and (wbToolMode in [tmEdit]) then
ShowTip;

wbStartTime := Now;
TLoaderThread.Create(sl);
finally
Expand Down Expand Up @@ -11312,6 +11317,7 @@ procedure TfrmMain.mniNavOptionsClick(Sender: TObject);
edRowHeight.Text := IntToStr(RowHeight);
cbAutoSave.Checked := AutoSave;
//cbIKnow.Checked := wbIKnowWhatImDoing;
cbShowTip.Checked := wbShowTip;
cbTrackAllEditorID.Checked := wbTrackAllEditorID;
cbUDRSetXESP.Checked := wbUDRSetXESP;
cbUDRSetScale.Checked := wbUDRSetScale;
Expand Down Expand Up @@ -11346,6 +11352,7 @@ procedure TfrmMain.mniNavOptionsClick(Sender: TObject);
SetDefaultNodeHeight(RowHeight);
AutoSave := cbAutoSave.Checked;
//wbIKnowWhatImDoing := cbIKnow.Checked;
wbShowTip := cbShowTip.Checked;
wbTrackAllEditorID := cbTrackAllEditorID.Checked;
wbUDRSetXESP := cbUDRSetXESP.Checked;
wbUDRSetScale := cbUDRSetScale.Checked;
Expand Down Expand Up @@ -11376,6 +11383,7 @@ procedure TfrmMain.mniNavOptionsClick(Sender: TObject);
Settings.WriteInteger('Options', 'RowHeight', RowHeight);
//Settings.WriteBool('Options', 'IKnowWhatImDoing', wbIKnowWhatImDoing);
Settings.WriteBool('Options', 'TrackAllEditorID', wbTrackAllEditorID);
Settings.WriteBool('Options', 'ShowTip', wbShowTip);
Settings.WriteBool('Options', 'UDRSetXESP', wbUDRSetXESP);
Settings.WriteBool('Options', 'UDRSetScale', wbUDRSetScale);
Settings.WriteFloat('Options', 'UDRSetScaleValue', wbUDRSetScaleValue);
Expand Down Expand Up @@ -13397,6 +13405,10 @@ procedure TfrmMain.tmrCheckUnsavedTimer(Sender: TObject);
if not wbLoaderDone then
Exit;

// skip if Left mouse button is pressed, could be indication of active drag&drop or other action in progress
if GetAsyncKeyState(VK_LBUTTON) and $8000 <> 0 then
Exit;

if UserWasActive then begin
UserWasActive := False;
TotalUsageTime := TotalUsageTime + 1 / 24 / 60 / 2;
Expand Down Expand Up @@ -16131,6 +16143,15 @@ procedure TfrmMain.WMUser2(var Message: TMessage);
begin
wbLoaderDone := True;

if wbToolMode in [tmEdit] then begin
// unchecked Show Tip checkbox, update setting
if Assigned(frmTip) and not wbShowTip then begin
Settings.WriteBool('Options', 'ShowTip', wbShowTip);
Settings.UpdateFile;
end;
HideTip;
end;

if wbLoaderError then begin
ShowMessage('An error occured while loading modules. Editing is disabled. Check the message log and correct the error.');
Exit;
Expand Down

0 comments on commit 415dc8e

Please sign in to comment.