Skip to content

Commit

Permalink
First upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfearless committed Oct 3, 2019
0 parents commit 5cfa987
Show file tree
Hide file tree
Showing 24 changed files with 2,432 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* text eol=crlf
*.exe binary
*.dll binary
*.zip binary
*.obj binary
*.res binary
*.lib binary
*.dlg binary
*.mnu binary
*.ttf binary
*.ico binary
*.bmp binary
*.png binary
*.jpg binary
*.tpl linguist-language=Text
*.inc linguist-language=Assembly
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bak/
*.undo
*.obj
*.pdb
*.ilk
*.exp
*.bat
Help/
template/
downloads/
screenshots/
wiki/
version/
107 changes: 107 additions & 0 deletions IETLK.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
;==============================================================================
;
; IETLK
;
; Copyright (c) 2019 by fearless
;
; All Rights Reserved
;
; http://github.com/mrfearless/InfinityEngineLibraries
;
;
; This software is provided 'as-is', without any express or implied warranty.
; In no event will the author be held liable for any damages arising from the
; use of this software.
;
; Permission is granted to anyone to use this software for any non-commercial
; program. If you use the library in an application, an acknowledgement in the
; application or documentation is appreciated but not required.
;
; You are allowed to make modifications to the source code, but you must leave
; the original copyright notices intact and not misrepresent the origin of the
; software. It is not allowed to claim you wrote the original software.
; Modified files must have a clear notice that the files are modified, and not
; in the original state. This includes the name of the person(s) who modified
; the code.
;
; If you want to distribute or redistribute any portion of this package, you
; will need to include the full package in it's original state, including this
; license and all the copyrights.
;
; While distributing this package (in it's original state) is allowed, it is
; not allowed to charge anything for this. You may not sell or include the
; package in any commercial package without having permission of the author.
; Neither is it allowed to redistribute any of the package's components with
; commercial applications.
;
;==============================================================================

;------------------------------------------------------------------------------
; IETLK Prototypes
;------------------------------------------------------------------------------
IETLKOpen PROTO :DWORD,:DWORD ; lpszTlkFilename, dwOpenMode. Returns in eax a handle used in other functions: hIETLK
IETLKMem PROTO :DWORD,:DWORD,:DWORD,:DWORD ; pTLKInMemory, lpszTlkFilename, dwTlkFilesize, dwOpenMode. Returns in eax a handle used in other functions: hIETLK
IETLKClose PROTO :DWORD ; hIETLK returned from IETLKOpen.

; Pointers to parts of TLK file:
IETLKHeader PROTO :DWORD ; hIETLK. Returns in eax pointer to a TLKV1_HEADER structure.
IETLKStringDataOffset PROTO :DWORD ; hIETLK. Returns in eax pointer to a strings section in memory
IETLKStrRefEntries PROTO :DWORD ; hIETLK. Returns in eax pointer to TLKV1_ENTRY array entries
IETLKStrRefEntry PROTO :DWORD,:DWORD ; hIETLK, nStrRef. Returns in eax pointer to specific TLKV1_ENTRY entry

; TLK Basic Information:
IETLKTotalStrRefs PROTO :DWORD ; hIETLK. Returns in eax total StrRef entries in TLK file

; TLK File & Version Information:
IETLKFileName PROTO :DWORD ; hIETLK. Returns in eax pointer to tis full path filename
IETLKFileNameOnly PROTO :DWORD,:DWORD ; hIETLK, lpszFileNameOnly. eax contains True or false if succesfull. strips filename of path and ext information.
IETLKFileSize PROTO :DWORD ; hIETLK. Returns in eax size of tlk file in bytes
IETLKVersion PROTO :DWORD ; hIETLK. Returns in eax 0 no tlk, 1 = TLK V1

;------------------------------------------------------------------------------
; IETLK Structures
;------------------------------------------------------------------------------
IFNDEF TLKV1_HEADER
TLKV1_HEADER STRUCT
Signature DD 0 ; 0x0000 4 (bytes) Signature ('TLK ')
Version DD 0 ; 0x0004 4 (bytes) Version ('V1 ')
LangID DW 0 ; 0x0008 2 (word) Language ID
NoStrRefEntries DD 0 ; 0x000a 4 (dword) Number of strref entries in this file
StringDataOffset DD 0 ; 0x000e 4 (dword) Offset to string data
TLKV1_HEADER ENDS
ENDIF

IFNDEF TLKV1_ENTRY ; (StrRef)
TLKV1_ENTRY STRUCT
StrRefType DW 0 ; 0x0000 2 (word) Bit field: 00 No message data, 01 Text exists, 02 Sound exists, 03 Standard message, 04 Token exists
StrRefSound DB 8 DUP (0) ; 8 (resref) Resource name of associated sound
StrRefVolume DD 0 ; 0x000a 4 (dword) Volume variance (Unused, at minimum in BG1)
StrRefPitch DD 0 ; 0x000e 4 (dword) Pitch variance (Unused, at minimum in BG1)
StrRefStringOffset DD 0 ; 0x0012 4 (dword) Offset of this string relative to the strings section
StrRefStringLength DD 0 ; 0x0016 4 (dword) Length of this string
TLKV1_ENTRY ENDS
ENDIF

.CONST
;------------------------------------------------------------------------------
; IETLK Constants
;------------------------------------------------------------------------------

IETLK_ALIGN TEXTEQU <ALIGN 16>
; IETLKOpen open mode:
IETLK_MODE_WRITE EQU 0
IETLK_MODE_READONLY EQU 1
; TLK Versions:
TLK_VERSION_INVALID EQU 0 ; Not a TLK or invalid
TLK_VERSION_TLK_V1 EQU 1 ; TLK_V1











Binary file added IETLK.lib
Binary file not shown.
134 changes: 134 additions & 0 deletions Listview.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
;=========================================================================================
;
; LICENSE
;
; LTLI Listview Library v1.0.0.10
;
; Copyright (c) 2019 by fearless
;
; All Rights Reserved
;
;
; This software is provided 'as-is', without any express or implied warranty. In no
; event will the author be held liable for any damages arising from the use of this
; software.
;
; Permission is granted to anyone to use this software for any non-commercial program.
; If you use the library in an application, an acknowledgement in the application or
; documentation is appreciated but not required.
;
; You are allowed to make modifications to the source code, but you must leave the
; original copyright notices intact and not misrepresent the origin of the software.
; It is not allowed to claim you wrote the original software. Modified files must have
; a clear notice that the files are modified, and not in the original state. This includes
; the name of the person(s) who modified the code.
;
; If you want to distribute or redistribute any portion of this package, you will need
; to include the full package in it's original state, including this license and all
; the copyrights.
;
; While distributing this package (in it's original state) is allowed, it is not allowed
; to charge anything for this. You may not sell or include the package in any commercial
; package without having permission of the author. Neither is it allowed to redistribute
; any of the package's components with commercial applications.
;
;=========================================================================================

;-----------------------------------------------------------------------------------------
; LTLI Listview LIB Prototypes
;-----------------------------------------------------------------------------------------

ListViewSelectAll PROTO :DWORD ; hListview
ListViewDeselectAll PROTO :DWORD,:DWORD ; hListview, bFocused

ListViewClearAll PROTO :DWORD ; hListview
ListViewDeleteAll EQU ListViewClearAll

ListViewDeleteItem PROTO :DWORD,:DWORD ; hListview, nItemIndex

ListViewInsertItem PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, nItemIndex, lpszItemText, nImageListIndex
ListViewInsertSubItem PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, nItemIndex, nSubItemIndex, lpszSubItemText

ListViewCheckboxSet PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwCheckedState
ListViewCheckboxToggle PROTO :DWORD,:DWORD ; hListview, nItemIndex
ListViewSetSelected PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, bFocused
ListViewGetSelected PROTO :DWORD,:DWORD ; hListview, bFocused
ListViewSetFocused PROTO :DWORD,:DWORD ; hListview, nItemIndex
ListViewGetFocused PROTO :DWORD ; hListview

ListViewGetItemText PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD ; hListview, nItemIndex, nSubItemIndex, lpszItemText, lpszItemTextSize
ListViewSetItemText PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, nItemIndex, nSubItemIndex, lpszItemText

ListViewSetItemImage PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, nImageListIndex
ListViewGetItemImage PROTO :DWORD,:DWORD ; hListview, nItemIndex

ListViewSetItemParam PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwParamValue
ListViewGetItemParam PROTO :DWORD,:DWORD ; hListview, nItemIndex

ListViewGetItemState PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwState
ListViewSetItemState PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwStateMask, dwState
ListViewGetItemSelectedState PROTO :DWORD,:DWORD ; hListview, nItemIndex

ListViewGetItemRect PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwPtrRect
ListViewGetSubItemRect PROTO :DWORD,:DWORD,:DWORD ; hListview, nItemIndex, dwPtrRect

ListViewAltRowColor PROTO :DWORD,:DWORD ; lParam, dwAltRowColor
ListViewAltRowColorDlg PROTO :DWORD,:DWORD,:DWORD ; hWin, lParam, dwAltRowColor
ListViewARCBoldItem PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD ; lParam, dwAltRowColor, nBoldItem, hBoldFont, hNormalFont
ListViewARCBoldItemDlg PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD ; hWin, lParam, dwAltRowColor, nBoldItem, hBoldFont, hNormalFont

ListViewSubClassProc PROTO :DWORD,:DWORD ; hListview, lpdwLVSubClassProc
ListViewSubClassData PROTO :DWORD,:DWORD ; hListview, lpdwLVSubClassData

ListViewStyleGridlines PROTO :DWORD ; hListview
ListViewStyleCheckboxes PROTO :DWORD ; hListview
ListViewStyleFullRowSelect PROTO :DWORD ; hListview
ListViewStyleSubItemImages PROTO :DWORD ; hListview
ListViewStyleHdrDragDrop PROTO :DWORD ; hListview
ListViewStyleBorderSelect PROTO :DWORD ; hListview
ListViewStyleDoubleBuffer PROTO :DWORD ; hListview
ListViewStyleNoColumnResize PROTO :DWORD ; hListview
ListViewStyleToggle PROTO :DWORD,:DWORD ; hListview, dwExStyle

ListViewLinkImagelist PROTO :DWORD,:DWORD,:DWORD ; hListview, hImagelist, ImagelistType

ListViewGetColumnCount PROTO :DWORD ; hListview
ListViewGetColumnWidth PROTO :DWORD,:DWORD ; hListview, nCol
ListViewGetColumnFormat PROTO :DWORD,:DWORD ; hListview, nCol
ListViewGetItemCount PROTO :DWORD ; hListview

ListViewInsertColumn PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, dwFormat, dwWidth, lpszColumnText
ListViewInsertColumnImage PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD ; hListview, dwFormat, dwWidth, lpszColumnText, nImageListIndex
ListViewSetColumnText PROTO :DWORD,:DWORD,:DWORD ; hListview, nColumnIndex, lpszColumnText

ListViewIsRowSelected PROTO :DWORD,:DWORD ; hListview, nItemIndex
ListViewIsRowHighlighted PROTO :DWORD,:DWORD ; hListview, nItemIndex
ListViewEnableHighlighting PROTO :DWORD,:DWORD ; hListview, nItemIndex
ListViewDisableHighlighting PROTO :DWORD,:DWORD ; hListview, nItemIndex

ListViewShowItemContextMenu PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hWin, hListview, hRightClickMenu, dwRequiresSelection
ListViewEnsureVisible PROTO :DWORD,:DWORD
ListViewEnsureSubItemVisible PROTO :DWORD,:DWORD ; hListview, dwSubItem
ListViewFindItem PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD ; hListview, lpszFindString, dwStartItem, dwStartSubItem, dwStartCol, dwEndCol, bShowFoundItem, bCaseSensitive

ListViewGetItemClicked PROTO :DWORD,:DWORD,:DWORD,:DWORD ; hListview, lParam, lpdwItem, lpdwSubItem
ListViewGetSubItemClicked PROTO :DWORD,:DWORD,:DWORD ; hListview, lpdwItem, lpdwSubItem


; For ListViewCheckboxSet
LVCB_UNCHECKED EQU 0
LVCB_CHECKED EQU 1

IFNDEF NMLVDISPINFOA
NMLVDISPINFOA STRUCT
hdr NMHDR <>
item LVITEM <>
NMLVDISPINFOA ENDS
ENDIF






Binary file added Listview.lib
Binary file not shown.
96 changes: 96 additions & 0 deletions Menus.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
MenusInit PROTO :DWORD ; Initialize Main Menu and submenus
MenusReset PROTO :DWORD ; Reset all menu items on Main Menu back to default state
MenusUpdate PROTO :DWORD, :DWORD ; Update Main Menu and submenus

MenuMainInit PROTO :DWORD ; Initialize main menu, load bitmaps, set initial state
MenuMainUpdate PROTO :DWORD, :DWORD


.CONST

;TlkViewer.mnu
IDM_MENU equ 10000
IDM_FILE_OPEN equ 10003
IDM_FILE_CLOSE equ 10004
IDM_FILE_EXIT equ 10001
IDM_HELP_INFO equ 10005
IDM_HELP_ABOUT equ 10101


; Menu add shortcut key to text add tab \t - &New\tCtrl+N - right align them you use \a instead of \t &New\aCtrl+N
.CODE


;-------------------------------------------------------------------------------------
; MenusInit - Initialize menus
;-------------------------------------------------------------------------------------
MenusInit PROC hWin:DWORD

Invoke MenuMainInit, hWin

ret
MenusInit ENDP

;-------------------------------------------------------------------------------------
; Reset menus when user closes file
;-------------------------------------------------------------------------------------
MenusReset PROC hWin:DWORD
LOCAL hMainMenu:DWORD
LOCAL mi:MENUITEMINFO

mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE
Invoke GetMenu, hWin
mov hMainMenu, eax

ret
MenusReset ENDP


;-------------------------------------------------------------------------------------
; MenusUpdate - update menus
;-------------------------------------------------------------------------------------
MenusUpdate PROC USES EBX hWin:DWORD, hItem:DWORD

ret
MenusUpdate ENDP


;-------------------------------------------------------------------------------------
; MenuMainInit - Initialize main program menu
;-------------------------------------------------------------------------------------
MenuMainInit PROC hWin:DWORD
LOCAL hMainMenu:DWORD
LOCAL hBitmap:DWORD
LOCAL mi:MENUITEMINFO
mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE
mov mi.fState, MFS_GRAYED
Invoke GetMenu, hWin
mov hMainMenu, eax

xor eax, eax
ret
MenuMainInit ENDP


;-------------------------------------------------------------------------------------
; Update main menu
;-------------------------------------------------------------------------------------
MenuMainUpdate PROC hWin:DWORD, bInLV:DWORD
LOCAL hMainMenu:DWORD
LOCAL mi:MENUITEMINFO

mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE

Invoke GetMenu, hWin
mov hMainMenu, eax

ret
MenuMainUpdate ENDP


Loading

0 comments on commit 5cfa987

Please sign in to comment.