Mapping Actions over Time
Re: Mapping Actions over Time
Thanks for the update & explanations.
Re: Mapping Actions over Time
I have done a first pass at the new code and adapted it to use a layered window and drawing functions.
This first draft only has one display type but I have a few other already worked out, I just need to class this to make it easier to modify it on the fly.
It does however already offer a number of properties that can be changed such as color bar width / height etc.
This version is designed to act as an screen overlay, it can be positioned anywhere, but the top left corner is the best fit atm
It can be toggled on and off with the Numpad1 hotkey.
This first draft only has one display type but I have a few other already worked out, I just need to class this to make it easier to modify it on the fly.
It does however already offer a number of properties that can be changed such as color bar width / height etc.
This version is designed to act as an screen overlay, it can be positioned anywhere, but the top left corner is the best fit atm
It can be toggled on and off with the Numpad1 hotkey.
Code: Select all
;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;Gdip by Tic
#Include <PopUpWindow Class> ;https://www.autohotkey.com/boards/viewtopic.php?f=6&t=94961
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchlines, -1
Gdip_Startup()
gosub, AddGui
gosub, Activate
return
*ESC::ExitApp
NumPad3::PopUpWindow.Helper()
#If ( Active )
~*LButton::
Clicks++
Return
#If
Numpad1::
Activate:
if( Active := !Active ){
clicks := 0
Gosub, Advance
SetTimer, Advance, 1000
SetTimer, DrawGui, 30
}else{
Gosub, Advance
SetTimer, Advance, Off
SetTimer, DrawGui, Off
Loop, % Gui1.BarCount
Gui1.DisplayArray[ A_Index ] := Gui1.StorageArray[ A_Index ] := ""
Gui1.ClearWindow()
Gui1.UpdateWindow()
}
return
AddGui:
w := 550 , h := 100
Gui1 := New PopUpWindow( { WindowName: "2" , WindowOptions: " -DPIScale +AlwaysOnTop +E0x20" , WindowSmoothing: 2 , X: 0 , Y: "10" , W: w , H: h } )
;~ Gui1 := New PopUpWindow( { WindowName: "2" , WindowOptions: " -DPIScale +AlwaysOnTop +E0x20" , WindowSmoothing: 2 , X: "Center" , Y: "Center" , W: w , H: h } )
Gui1.ShowWindow()
Gui1.DisplayArray := []
Gui1.YMid := h / 2
Gui1.StorageArray := []
Gui1.BarWidth := 2
Gui1.BarScale := 3 ;px per click
Gui1.BarCount := 180
Gui1.BarColor1 := "0xFFff0000" ;BAR COLOR
Gui1.BarCoror2 := "0x00000000"
Gui1.BarStyle := 2 ;2 = above and below the center
Gui1.BGRound := 10
Gui1.BGColor1 := "0xFFaaaaaa"
Gui1.BGColor2 := "0xFF112233"
Loop, % Gui1.BarCount
Gui1.DisplayArray[ A_Index ] := Gui1.StorageArray[ A_Index ] := Random(0,9)
HB_BITMAP_MAKER( obj , clicks )
Gui1.UpdateWindow()
return
Advance:
Gui1.StorageArray.Insert( 1, Clicks )
Clicks := 0
Gui1.StorageArray.Pop()
Return
DrawGui:
Loop, % Gui1.BarCount
Gui1.DisplayArray[ A_Index ] := Gui1.StorageArray[ A_Index ]
Gui1.ClearWindow()
HB_BITMAP_MAKER( Gui1 , clicks )
Gui1.UpdateWindow()
return
HB_BITMAP_MAKER( obj , clicks ){
;Bitmap Created Using: HB Bitmap Maker
Loop, % pos := Obj.BarCount
Pen := Gdip_CreatePen( Obj.BarColor1 , Obj.BarWidth ) , Gdip_DrawLine( Obj.G , Pen , ( A_Index * ( Obj.BarWidth + 1 ) ) + 3 , Obj.YMid + ( ( obj.DisplayArray[A_Index] * obj.BarScale ) + 1 ) , ( A_Index * ( Obj.BarWidth + 1 ) ) + 3 , Obj.YMid - ( ( obj.DisplayArray[A_Index] * obj.BarScale ) + 1 ) ) , Gdip_DeletePen( Pen )
;reverse order
;~ Pen := Gdip_CreatePen( Obj.BarColor1 , Obj.BarWidth ) , Gdip_DrawLine( Obj.G , Pen , ( A_Index * ( Obj.BarWidth + 1 ) ) + 3 , Obj.YMid + ( ( obj.DisplayArray[pos] * obj.BarScale ) + 1 ) , ( A_Index * ( Obj.BarWidth + 1 ) ) + 3 , Obj.YMid - ( ( obj.DisplayArray[pos--] * obj.BarScale ) + 1 ) ) , Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0x66000000" ) , Gdip_FillRoundedRectangle( Obj.G , Brush , 0 , 0 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" ) , Gdip_TextToGraphics( Obj.G , "CPS: " , "s16 Bold c" Brush " x10 y0" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFffffff" ) , Gdip_TextToGraphics( Obj.G , clicks , "s16 Bold c" Brush " x54 y-1" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFff0000" ) , Gdip_TextToGraphics( Obj.G , clicks , "s16 Bold c" Brush " x55 y0" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
}
Random(Min, Max){
local out
Random, out, min, max
return out
}