1
0
Fork
You've already forked kw-mh-frames
0
No description
  • TeX 100%
Find a file
2026年07月07日 21:46:15 +03:00
.vscode Add basic frames structs, imports and sync unit 2026年03月15日 16:04:14 +03:00
imports/root add root dir, move import files to root dir 2026年06月15日 17:52:55 +03:00
scripts bump version, fix bug with incorrect ToBin converting 2026年07月07日 21:46:15 +03:00
units move mostly needed parts of system to ZINC 2026年06月16日 14:37:51 +03:00
library.json bump version, fix bug with incorrect ToBin converting 2026年07月07日 21:46:15 +03:00
LICENSE Initial commit 2026年03月09日 17:33:31 +03:00
README.md move mostly needed parts of system to ZINC 2026年06月16日 14:37:51 +03:00

kw-mh-frames - Frames lib for Unryze Memhack

Examples

Connect click to function
scope clickConnection initializer init 
 globals
 public unit clickUnit = null // This unit will be used in frames for SyncChoose(unit, player) 
 endglobals
 public function testFunc takes nothing returns nothing 
 local integer id = getSyncId() // Id of clicked element
 local player p = getSyncPlayer() // Player which click on element
 call BJDebugMsg(I2S(id))
 call BJDebugMsg(I2S(GetPlayerId(p)))
 endfunction
 private function init takes nothing returns nothing
 set clickUnit = makeEndSyncUnitForFunction("clickConnection_testFunc") // This function will be executed with ExecuteFunc(string)
 endfunction
endscope
Simple button
scope simpleButtonUI 
 struct simpleButtonUI extends uiElement 
 integer clickId = 12 // Supported only numbers from 0 to 255
 Icon icon
 Button btn
 boolean isHovering = true
 method onUIInit takes nothing returns nothing
 local string texture = "ReplaceableTextures\\CommandButtons\\"
 local Vector2 size = Vector2.fromXY(.075, .075)
 local Vector2 pos = Vector2.fromXY(.005, .0125)
 set icon = Icon.make("Icon" + I2S(clickId), pGameUI, texture, pos, size)
 set btn = Button.make("Button|" + I2S(clickId), pGameUI, texture, pos, size)
 
 call icon.show()
 call btn.show()
 endmethod
 method onClick takes nothing returns nothing
 local integer pid = libCustomUi_mousePlayerId
 call SyncChoose(clickId, clickConnection_clickUnit) // Use sync with clickedId and clickUnit
 endmethod
 method isHovered takes nothing returns boolean
 return this.isHovering and FindCLayerUnderCursor() == btn.frame
 endmethod
 method show takes nothing returns nothing
 call btn.show()
 call icon.show()
 endmethod
 method hide takes nothing returns nothing
 call btn.hide()
 call icon.hide()
 endmethod
 implement staticModuleUI
 private static method onInit takes nothing returns nothing
 call simpleButtonUI.make("simpleButton")
 endmethod
 endstruct
endscope 

New examples (not ready yet)

Create Button with click and hover actions on ZINC

library testTextUI requires frameTextStruct {
 
 private function onInit() {
 FrameText text = FrameText.make(
 "Test text, trololo",
 Vector2.fromXY(.005, .0125),
 function () { // onPeriodic 
 FrameText text = FrameText.getCurrent();
 });
 }
}