force exit:
Code:
require "Script.uiLuaString.pbString"
require "Script.uiLua.uiUtil"
Use("i3UIStaticText_Subject") -- subject
Use("i3UIStaticText_Nick") -- text nick
Use("i3UIStaticText_Reason") -- text reason
Use("i3UIComboBox") -- reason combo
Use("i3UIListView_Box") -- user list
Use("i3UIFrameWnd")
Use("i3UIButtonComposed_OK") -- OK
Use("i3UIButtonComposed_Cancel")
i3UIComboBox:enableUIEvent(UI_EVT_SELITEM)
function i3UIComboBox:OnSelItem(...)
local sel, from = ...
SelectReason(sel)
end
i3UIComboBox:enableUIEvent(UI_EVT_COMBOBOX_UNFOLDED)
function i3UIComboBox:OnComboBoxUnfolded()
i3UIListView_Box:setInputDisable(true)
end
i3UIComboBox:enableUIEvent(UI_EVT_COMBOBOX_FOLDED)
function i3UIComboBox:OnComboBoxFolded()
i3UIListView_Box:setInputDisable(false)
end
gSlotCount = 0
function i3UIListView_Box:AddSlot( count)
for i=1,count,1 do
self:AddData( "", "", "")
self:EmptySlot( gSlotCount)
gSlotCount = gSlotCount + 1
end
self:UpdateToPreviewMode()
end
function i3UIListView_Box:DeleteSlot( slot)
self:DeleteData( slot)
gSlotCount = gSlotCount -1
end
function i3UIListView_Box:EmptySlot( slot)
local control = uiLV_GetCellControl( self.ctrlID, slot, 0)
uiCtrl_setEnable( control, false)
self:SetCell( slot, 1, "")
self:SetCell( slot, 2, "")
end
function i3UIListView_Box:SetSlotCount( count)
local precount = self:GetDataCount()
local addCount = count - precount
if addCount > 0 then
self:AddSlot( addCount)
elseif addCount < 0 then
for i = precount-1,count,-1 do
if gSlotCount > 6 then
self:DeleteSlot(i)
else
self:EmptySlot(i)
end
end
self:UpdateToPreviewMode()
end
end
function i3UIListView_Box:SetSlotInfo( slot, nick)
local control = uiLV_GetCellControl( self.ctrlID, slot, 0)
uiCtrl_setEnable( control, true)
self:SetCell( slot, 2, nick)
end
function i3UIListView_Box:InitListBox()
self:SetTextAlign( "Left", "Middle", "Column", 2, 0)
self:AddSlot(6)
end
i3UIListView_Box:enableUIEvent(UI_EVT_SELITEM)
function i3UIListView_Box:OnSelItem(...)
local idx, from = ...
SelectUser(idx)
end
i3UIListView_Box:enableUIEvent(UI_EVT_CLICKED)
function i3UIListView_Box:OnClicked(...)
local idx, from = ...
SelectUser(idx)
end
--[BLOCK_END:i3UIListView_Box]
---------------------------------------
--[BLOCK_START:i3UIButtonComposed3]
i3UIButtonComposed_OK:enableUIEvent(UI_EVT_CLICKED)
function i3UIButtonComposed_OK:OnClicked()
OK()
end
--[BLOCK_END:i3UIButtonComposed3]
---------------------------------------
--[BLOCK_START:i3UIButtonComposed31]
i3UIButtonComposed_Cancel:enableUIEvent(UI_EVT_CLICKED)
function i3UIButtonComposed_Cancel:OnClicked()
Close()
end
--[BLOCK_END:i3UIButtonComposed31]
class "forceremove" (eventHandler)
function forceremove:__init()
i3UIStaticText_Subject:setText(STR_EXIT_POPUP_FORCIBLYREMOVE)
i3UIStaticText_Reason:setText(STR_POPUP_FORCIBLYREMOVE_REASON)
i3UIStaticText_Nick:setText(STR_POPUP_FORCIBLYREMOVE_USERNICK)
i3UIButtonComposed_OK:setText(STR_POPUP_OK)
i3UIButtonComposed_Cancel:setText(STR_POPUP_CANCEL)
i3UIListView_Box:setInputDisable(false)
i3UIListView_Box:InitListBox()
end
function forceremove:OnEvent(evt,...)
end
function forceremove:OnUpdate(tm)
end
function forceremove:SetComboList(str)
i3UIComboBox:SetEditBoxReadOnly(true)
i3UIComboBox:SetItems(str)
i3UIComboBox:SetCurSel(0)
end
function forceremove:SetSlotCount(count)
i3UIListView_Box:SetSlotCount(count)
i3UIListView_Box:UnsetCurSel()
end
function forceremove:SetSlotInfo(slot, nick)
i3UIListView_Box:SetSlotInfo( slot, nick)
end
Vote:
Code:
require "Script.uiLuaString.pbString"
require "Script.uiLua.uiUtil"
Use("i3UIStaticText_Subject") -- subject
Use("i3UIStaticText_Nick") -- nick
Use("i3UIStaticText_AppNick") -- applicant
Use("i3UIStaticText_Whos") -- who's
Use("i3UIStaticText_Reason") -- reason
Use("i3UIStaticText_AgreeKey") -- agree key
Use("i3UIStaticText_RTSubject")
Use("i3UIStaticText_RTNumber")
Use("i3UIStaticText_RTSec")
-- remain time
Use("i3UIStaticText_DisagreeKey") -- reverse
Use("i3UIStaticText_NumAgree")
Use("i3UIStaticText_NumDisagree")
class "vote" (eventHandler)
function vote:__init()
i3UIStaticText_Subject:setText(STR_HUD_FORCIBLYREMOVE_SUBJECT)
i3UIStaticText_Whos:setText(STR_HUD_FORCIBLYREMOVE_WHOS)
i3UIStaticText_RTSubject:setText( STR_HUD_FORCIBLYREMOVE_REMAIN_TIME_SUBJECT )
i3UIStaticText_RTSec:setText( STR_HUD_FORCIBLYREMOVE_REMAIN_TIME_SECOND )
self:SetVoted( false)
end
function vote:OnEvent(evt,...)
end
function vote:OnUpdate(tm)
end
function vote:GetVoteTime()
return 20
end
function vote:SetTime(remain_time)
local str = string.format("%d", remain_time)
i3UIStaticText_RTNumber:setText(str)
end
function vote:SetInfo(app_nick, cand_nick, reason)
i3UIStaticText_AppNick:setText(app_nick)
i3UIStaticText_Nick:setText(cand_nick)
if reason == 0 then
i3UIStaticText_Reason:setText(STR_HUD_FORCIBLYREMOVE_REASON_NOMANNER)
elseif reason == 1 then
i3UIStaticText_Reason:setText(STR_HUD_FORCIBLYREMOVE_REASON_ILLEGALPROGRAM)
elseif reason == 2 then
i3UIStaticText_Reason:setText(STR_HUD_FORCIBLYREMOVE_REASON_ABUSE)
else
i3UIStaticText_Reason:setText(STR_HUD_FORCIBLYREMOVE_REASON_ETC)
end
end
function vote:UpdateVoteCount(strAgree, strDisagree)
i3UIStaticText_NumAgree:setText(strAgree)
i3UIStaticText_NumDisagree:setText(strDisagree)
end
function vote:SetVoted( bVal)
if bVal == false then
i3UIStaticText_AgreeKey:setText(STR_HUD_FORCIBLYREMOVE_KEY_AGREE)
i3UIStaticText_DisagreeKey:setText(STR_HUD_FORCIBLYREMOVE_KEY_REVERSE)
else
i3UIStaticText_AgreeKey:setText(STR_HUD_FORCIBLYREMOVE_AGREE)
i3UIStaticText_DisagreeKey:setText(STR_HUD_FORCIBLYREMOVE_REVERSE)
end
end
Result Info From Vote Kicks:
Code:
require "Script.uiLuaString.pbString"
require "Script.uiLua.uiUtil"
Use("i3UIStaticText_Subject")
Use("i3UIStaticText_Content")
g_Update = false
g_UpdateTime = 0.0
class "result" (eventHandler)
function result:__init()
end
function result:OnEvent(evt,...)
end
function result:OnUpdate(tm)
if g_Update == true then
g_UpdateTime = g_UpdateTime + tm
if g_UpdateTime > 10 then
g_UpdateTime = 0.0
g_Update = false
Close_ForceExit_Result()
end
end
end
function result:SetMsg( title, msg )
i3UIStaticText_Subject:setText(title)
i3UIStaticText_Content:setText(msg)
g_Update = true
g_UpdateTime = 0.0
end
Recommended you know how to code and source about PB.
I myself am in progress of making a hack for PB with some decent features.
~Cookie