-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New HUD code and new Pulldown menu Some bugfixes and improvements
- Loading branch information
Showing
78 changed files
with
1,476 additions
and
1,032 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
-- | ||
-- AutoDrive Enter Group Name GUI | ||
-- V1.0.0.0 | ||
-- | ||
-- @author Stephan Schlosser | ||
-- @date 09/06/2019 | ||
|
||
adEnterGroupNameGui = {}; | ||
|
||
local adEnterGroupNameGui_mt = Class(adEnterGroupNameGui, ScreenElement); | ||
|
||
function adEnterGroupNameGui:new(target, custom_mt) | ||
local self = ScreenElement:new(target, adEnterGroupNameGui_mt); | ||
self.returnScreenName = ""; | ||
self.textInputElement = nil; | ||
return self; | ||
end; | ||
|
||
function adEnterGroupNameGui:onOpen() | ||
adEnterGroupNameGui:superClass().onOpen(self); | ||
FocusManager:setFocus(self.textInputElement); | ||
self.textInputElement:setText(""); | ||
self.textInputElement:onFocusActivate() | ||
end; | ||
|
||
function adEnterGroupNameGui:onClickOk() | ||
adEnterGroupNameGui:superClass().onClickOk(self); | ||
local enteredName = self.textInputElement.text; | ||
|
||
if enteredName:len() > 1 then | ||
if AutoDrive.groups[enteredName] == nil then | ||
AutoDrive.groupCounter = AutoDrive.groupCounter + 1; | ||
AutoDrive.groups[enteredName] = AutoDrive.groupCounter; | ||
|
||
for _,vehicle in pairs(g_currentMission.vehicles) do | ||
if (vehicle.ad ~= nil) then | ||
if vehicle.ad.groups[enteredName] == nil then | ||
vehicle.ad.groups[enteredName] = true; | ||
end; | ||
end; | ||
end; | ||
AutoDrive.Hud.lastUIScale = 0; | ||
end; | ||
end; | ||
|
||
self:onClickBack(); | ||
end; | ||
|
||
function adEnterGroupNameGui:onClickResetButton() | ||
self.textInputElement.text = ""; | ||
end; | ||
|
||
function adEnterGroupNameGui:onClose() | ||
adEnterGroupNameGui:superClass().onClose(self); | ||
end; | ||
|
||
function adEnterGroupNameGui:onClickBack() | ||
adEnterGroupNameGui:superClass().onClickBack(self); | ||
end; | ||
|
||
function adEnterGroupNameGui:onCreateInputElement(element) | ||
self.textInputElement = element; | ||
element.text = ""; | ||
end; | ||
|
||
function adEnterGroupNameGui:onEnterPressed() | ||
--self:onClickOk(); | ||
end; | ||
|
||
function adEnterGroupNameGui:onEscPressed() | ||
--self:onClose()(); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<GUI onOpen="onOpen" onClose="onClose" onCreate="onCreate"> | ||
<GuiElement type="bitmap" profile="uiFullInGameBackground" /> | ||
<GuiElement type="bitmap" profile="dialogBg" id="dialogElement"> | ||
<GuiElement type="textInput" profile="dialogTextInput" id="textInputElement" onCreate="onCreateInputElement" onEnterPressed="onEnterPressed" onEscPressed="onEscPressed" /> | ||
|
||
<!-- bottom "back" + "ok" --> | ||
<GuiElement type="flowLayout" profile="buttonBoxDocked" id="buttonsPC"> | ||
<GuiElement type="button" profile="buttonBack" text="$l10n_button_back" onClick="onClickBack" id="backButton" /> | ||
<GuiElement type="button" profile="buttonOK" text="$l10n_button_ok" onClick="onClickOk" /> | ||
<GuiElement type="button" profile="buttonCancel" text="$l10n_button_reset" onClick="onClickResetButton" /> | ||
</GuiElement> | ||
</GuiElement> | ||
</GUI> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.